Vulture/VApp/node_modules/vuetify/lib/components/VSelectionControl/VSelectionControl.mjs.map

1 line
17 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"VSelectionControl.mjs","names":["VIcon","VLabel","makeSelectionControlGroupProps","VSelectionControlGroupSymbol","useBackgroundColor","useTextColor","makeComponentProps","useDensity","useProxiedModel","Ripple","computed","inject","nextTick","ref","shallowRef","filterInputAttrs","genericComponent","getUid","matchesSelector","propsFactory","useRender","wrapInArray","makeVSelectionControlProps","label","String","baseColor","trueValue","falseValue","value","useSelectionControl","props","group","undefined","densityClasses","modelValue","isMultiple","multiple","Array","isArray","model","get","val","some","v","valueComparator","set","readonly","currentValue","newVal","filter","item","textColorClasses","textColorStyles","error","disabled","color","backgroundColorClasses","backgroundColorStyles","icon","trueIcon","falseIcon","VSelectionControl","name","directives","inheritAttrs","emits","setup","_ref","attrs","slots","uid","isFocused","isFocusVisible","input","id","isInteractive","onForceUpdate","checked","onFocus","e","target","onBlur","onClickLabel","stopPropagation","onInput","forceUpdate","for","rootAttrs","inputAttrs","inputNode","_createVNode","_mergeProps","type","inline","class","style","default","_withDirectives","_Fragment","_resolveDirective","ripple"],"sources":["../../../src/components/VSelectionControl/VSelectionControl.tsx"],"sourcesContent":["// Styles\nimport './VSelectionControl.sass'\n\n// Components\nimport { VIcon } from '@/components/VIcon'\nimport { VLabel } from '@/components/VLabel'\nimport { makeSelectionControlGroupProps, VSelectionControlGroupSymbol } from '@/components/VSelectionControlGroup/VSelectionControlGroup'\n\n// Composables\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { useDensity } from '@/composables/density'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Directives\nimport { Ripple } from '@/directives/ripple'\n\n// Utilities\nimport { computed, inject, nextTick, ref, shallowRef } from 'vue'\nimport {\n filterInputAttrs,\n genericComponent,\n getUid,\n matchesSelector,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { CSSProperties, ExtractPropTypes, Ref, VNode, WritableComputedRef } from 'vue'\nimport type { IconValue } from '@/composables/icons'\nimport type { EventProp, GenericProps } from '@/util'\n\nexport type SelectionControlSlot = {\n model: WritableComputedRef<boolean>\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n inputNode: VNode\n icon: IconValue | undefined\n props: {\n onBlur: (e: Event) => void\n onFocus: (e: FocusEvent) => void\n id: string\n }\n}\n\nexport type VSelectionControlSlots = {\n default: {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n }\n label: { label: string | undefined, props: Record<string, unknown> }\n input: SelectionControlSlot\n}\n\nexport const makeVSelectionControlProps = propsFactory({\n label: String,\n baseColor: String,\n trueValue: null,\n falseValue: null,\n value: null,\n\n ...makeComponentProps(),\n ...makeSelectionControlGroupProps(),\n}, 'VSelectionControl')\n\nexport function useSelectionControl (\n props: ExtractPropTypes<ReturnType<typeof makeVSelectionControlProps>> & {\n 'onUpdate:modelValue': EventProp | undefined\n }\n) {\n const group = inject(VSelectionControlGroupSymbol, undefined)\n const { densityClasses } = useDensity(props)\n const modelValue = useProxiedModel(props, 'modelValue')\n const trueValue = computed(() => (\n props.trueValue !== undefined ? props.trueValue\n : props.value !== undefined ? props.value\n : true\n ))\n const falseValue = computed(() => props.falseValue !== undefined ? props.falseValue : false)\n const isMultiple = computed(() => (\n !!props.multiple ||\n (props.multiple == null && Array.isArray(modelValue.value))\n