1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
|
{"version":3,"file":"VProgressLinear.mjs","names":["useBackgroundColor","useTextColor","makeComponentProps","useIntersectionObserver","useRtl","makeLocationProps","useLocation","useProxiedModel","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","computed","Transition","convertToUnit","genericComponent","propsFactory","useRender","makeVProgressLinearProps","absolute","Boolean","active","type","default","bgColor","String","bgOpacity","Number","bufferValue","clickable","color","height","indeterminate","max","modelValue","reverse","stream","striped","roundedBar","location","VProgressLinear","name","props","emits","value","setup","_ref","slots","progress","isRtl","rtlClasses","themeClasses","locationStyles","textColorClasses","textColorStyles","backgroundColorClasses","backgroundColorStyles","barColorClasses","barColorStyles","roundedClasses","intersectionRef","isIntersecting","parseInt","normalizedBuffer","parseFloat","normalizedValue","isReversed","transition","opacity","handleClick","e","left","right","width","getBoundingClientRect","clientX","Math","round","_createVNode","tag","rounded","class","bottom","undefined","top","style","borderTop","map","bar","buffer"],"sources":["../../../src/components/VProgressLinear/VProgressLinear.tsx"],"sourcesContent":["// Styles\nimport './VProgressLinear.sass'\n\n// Composables\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { useIntersectionObserver } from '@/composables/intersectionObserver'\nimport { useRtl } from '@/composables/locale'\nimport { makeLocationProps, useLocation } from '@/composables/location'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { computed, Transition } from 'vue'\nimport { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'\n\ntype VProgressLinearSlots = {\n default: { value: number, buffer: number }\n}\n\nexport const makeVProgressLinearProps = propsFactory({\n absolute: Boolean,\n active: {\n type: Boolean,\n default: true,\n },\n bgColor: String,\n bgOpacity: [Number, String],\n bufferValue: {\n type: [Number, String],\n default: 0,\n },\n clickable: Boolean,\n color: String,\n height: {\n type: [Number, String],\n default: 4,\n },\n indeterminate: Boolean,\n max: {\n type: [Number, String],\n default: 100,\n },\n modelValue: {\n type: [Number, String],\n default: 0,\n },\n reverse: Boolean,\n stream: Boolean,\n striped: Boolean,\n roundedBar: Boolean,\n\n ...makeComponentProps(),\n ...makeLocationProps({ location: 'top' } as const),\n ...makeRoundedProps(),\n ...makeTagProps(),\n ...makeThemeProps(),\n}, 'VProgressLinear')\n\nexport const VProgressLinear = genericComponent<VProgressLinearSlots>()({\n name: 'VProgressLinear',\n\n props: makeVProgressLinearProps(),\n\n emits: {\n 'update:modelValue': (value: number) => true,\n },\n\n setup (props, { slots }) {\n const progress = useProxiedModel(props, 'modelValue')\n const { isRtl, rtlClasses } = useRtl()\n const { themeClasses } = provideTheme(props)\n const { locationStyles } = useLocation(props)\n const { textColorClasses, textColorStyles } = useTextColor(props, 'color')\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(computed(() => props.bgColor || props.color))\n const { backgroundColorClasses: barColorClasses, backgroundColorStyles: barColorStyles } = useBackgroundColor(props, 'color')\n const { roundedClasses } = useRounded(props)\n const { intersectionRef, isIntersecting } = useIntersectionObserver()\n\n const max = computed(() => parseInt(props.max, 10))\n const height = computed(() => parseInt(props.height, 10))\n const normalizedBuffer = computed(() => parseFloat(props.bufferValue) / max.value * 100)\
|