Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.lib.components.VSparkline.VSparkline.mjs.map Maven / Gradle / Ivy
{"version":3,"file":"VSparkline.mjs","names":["makeVBarlineProps","VBarline","makeVTrendlineProps","VTrendline","useTextColor","computed","toRef","genericComponent","propsFactory","useRender","makeVSparklineProps","type","String","default","VSparkline","name","props","setup","_ref","slots","textColorClasses","textColorStyles","hasLabels","Boolean","showLabels","labels","length","label","totalHeight","height","parseInt","value","labelSize","Tag","lineProps","filterProps","_createVNode","_mergeProps","width"],"sources":["../../../src/components/VSparkline/VSparkline.tsx"],"sourcesContent":["// Components\nimport { makeVBarlineProps, VBarline } from './VBarline'\nimport { makeVTrendlineProps, VTrendline } from './VTrendline'\n\n// Composables\nimport { useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\n// Types\n\nexport const makeVSparklineProps = propsFactory({\n type: {\n type: String as PropType<'trend' | 'bar'>,\n default: 'trend',\n },\n\n ...makeVBarlineProps(),\n ...makeVTrendlineProps(),\n}, 'VSparkline')\n\nexport type VSparklineSlots = {\n default: void\n label: { index: number, value: string }\n}\n\nexport const VSparkline = genericComponent()({\n name: 'VSparkline',\n\n props: makeVSparklineProps(),\n\n setup (props, { slots }) {\n const { textColorClasses, textColorStyles } = useTextColor(toRef(props, 'color'))\n const hasLabels = computed(() => {\n return Boolean(\n props.showLabels ||\n props.labels.length > 0 ||\n !!slots?.label\n )\n })\n const totalHeight = computed(() => {\n let height = parseInt(props.height, 10)\n\n if (hasLabels.value) height += parseInt(props.labelSize, 10) * 1.5\n\n return height\n })\n\n useRender(() => {\n const Tag = props.type === 'trend' ? VTrendline : VBarline\n const lineProps = props.type === 'trend' ? VTrendline.filterProps(props) : VBarline.filterProps(props)\n\n return (\n \n )\n })\n },\n})\n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