All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.components.VProgressLinear.VProgressLinear.mjs.map Maven / Gradle / Ivy

{"version":3,"file":"VProgressLinear.mjs","names":["useBackgroundColor","useTextColor","makeComponentProps","useIntersectionObserver","useRtl","makeLocationProps","useLocation","useProxiedModel","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","computed","Transition","clamp","convertToUnit","genericComponent","IN_BROWSER","propsFactory","useRender","makeVProgressLinearProps","absolute","Boolean","active","type","default","bgColor","String","bgOpacity","Number","bufferValue","bufferColor","bufferOpacity","clickable","color","height","indeterminate","max","modelValue","opacity","reverse","stream","striped","roundedBar","location","VProgressLinear","name","props","emits","value","setup","_ref","slots","progress","isRtl","rtlClasses","themeClasses","locationStyles","textColorClasses","textColorStyles","backgroundColorClasses","backgroundColorStyles","bufferColorClasses","bufferColorStyles","barColorClasses","barColorStyles","roundedClasses","intersectionRef","isIntersecting","parseFloat","normalizedBuffer","normalizedValue","isReversed","transition","isForcedColorsModeActive","window","matchMedia","matches","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 { clamp, convertToUnit, genericComponent, IN_BROWSER, 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  bufferColor: String,\n  bufferOpacity: [Number, String],\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  opacity: [Number, String],\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()({\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 {\n      backgroundColorClasses,\n      backgroundColorStyles,\n    } = useBackgroundColor(computed(() => props.bgColor || props.color))\n    const {\n      backgroundColorClasses: bufferColorClasses,\n      backgroundColorStyles: bufferColorStyles,\n    } = useBackgroundColor(computed(() => props.bufferColor || props.bgColor || props.color))\n    const {\n      backgroundColorClasses: barColorClasses,\n      backgroundColorStyles: barColorStyles,\n    } = useBackgroundColor(props, 'color')\n    const { roundedClasses } = useRounded(props)\n    const { intersectionRef, isIntersecting } = useIntersectionObserver()\n\n    const max = computed(() => parseFloat(props.max))\n    const height = computed(() => parseFloat(props.height))\n    const normalizedBuffer = computed(() => clamp(parseFloat(props.bufferValue) / max.value * 100, 0, 100))\n    const normalizedValue = computed(() => clamp(parseFloat(progress.value) / max.value * 100, 0, 100))\n    const isReversed = computed(() => isRtl.value !== props.reverse)\n    const transition = computed(() => props.indeterminate ? 'fade-transition' : 'slide-x-transition')\n    const isForcedColorsModeActive = IN_BROWSER && window.matchMedia?.('(forced-colors: active)').matches\n\n    function handleClick (e: MouseEvent) {\n      if (!intersectionRef.value) return\n\n      const { left, right, width } = intersectionRef.value.getBoundingClientRect()\n      const value = isReversed.value ? (width - e.clientX) + (right - width) : e.clientX - left\n\n      progress.value = Math.round(value / width * max.value)\n    }\n\n    useRender(() => (\n      \n        { props.stream && (\n          \n        )}\n\n        \n\n        \n\n        \n          { !props.indeterminate ? (\n            \n          ) : (\n            
\n {['long', 'short'].map(bar => (\n \n ))}\n
\n )}\n
\n\n { slots.default && (\n
\n { slots.default({ value: normalizedValue.value, buffer: normalizedBuffer.value }) }\n
\n )}\n \n ))\n\n return {}\n },\n})\n\nexport type VProgressLinear = InstanceType\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB;AAAA,SAClBC,uBAAuB;AAAA,SACvBC,MAAM;AAAA,SACNC,iBAAiB,EAAEC,WAAW;AAAA,SAC9BC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY,uCAErC;AACA,SAASC,QAAQ,EAAEC,UAAU,QAAQ,KAAK;AAAA,SACjCC,KAAK,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,YAAY,EAAEC,SAAS;AAMpF,OAAO,MAAMC,wBAAwB,GAAGF,YAAY,CAAC;EACnDG,QAAQ,EAAEC,OAAO;EACjBC,MAAM,EAAE;IACNC,IAAI,EAAEF,OAAO;IACbG,OAAO,EAAE;EACX,CAAC;EACDC,OAAO,EAAEC,MAAM;EACfC,SAAS,EAAE,CAACC,MAAM,EAAEF,MAAM,CAAC;EAC3BG,WAAW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