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

1 line
7.0 KiB
Plaintext
Raw Permalink Normal View History

{"version":3,"file":"VRadioGroup.mjs","names":["makeVInputProps","VInput","VLabel","VSelectionControl","makeSelectionControlGroupProps","VSelectionControlGroup","IconValue","useProxiedModel","computed","filterInputAttrs","genericComponent","getUid","omit","propsFactory","useRender","makeVRadioGroupProps","height","type","Number","String","default","trueIcon","falseIcon","VRadioGroup","name","inheritAttrs","props","emits","value","setup","_ref","attrs","slots","uid","id","model","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","label","for","_createVNode","_mergeProps","class","style","$event","_ref2","messagesId","isDisabled","isReadonly","_Fragment","undefined"],"sources":["../../../src/components/VRadioGroup/VRadioGroup.tsx"],"sourcesContent":["// Styles\nimport './VRadioGroup.sass'\n\n// Components\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VLabel } from '@/components/VLabel'\nimport { VSelectionControl } from '@/components/VSelectionControl'\nimport { makeSelectionControlGroupProps, VSelectionControlGroup } from '@/components/VSelectionControlGroup/VSelectionControlGroup'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { GenericProps } from '@/util'\n\nexport type VRadioGroupSlots = Omit<VInputSlots, 'default'> & {\n default: never\n label: {\n label: string | undefined\n props: Record<string, any>\n }\n}\n\nexport const makeVRadioGroupProps = propsFactory({\n height: {\n type: [Number, String],\n default: 'auto',\n },\n\n ...makeVInputProps(),\n ...omit(makeSelectionControlGroupProps(), ['multiple']),\n\n trueIcon: {\n type: IconValue,\n default: '$radioOn',\n },\n falseIcon: {\n type: IconValue,\n default: '$radioOff',\n },\n type: {\n type: String,\n default: 'radio',\n },\n}, 'VRadioGroup')\n\nexport const VRadioGroup = genericComponent<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VRadioGroupSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VRadioGroup',\n\n inheritAttrs: false,\n\n props: makeVRadioGroupProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const uid = getUid()\n const id = computed(() => props.id || `radio-group-${uid}`)\n const model = useProxiedModel(props, 'modelValue')\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const inputProps = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n\n return (\n <VInput\n class={[\n 'v-radio-group',\n props.class,\n ]}\n style={ props.style }\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n }) => (\n <>\n { label && (\n <VLabel id={ id.value }>\n { label }\n </VLabel>\n )}\n\n <VSelectionControlGroup\n { ...controlProps }\n id={ id.value }\n aria-describedby={ messagesId.value }\n defaultsTarget=\"VRadio\"\n trueIcon={ props.trueIcon }\n falseIcon={ props.falseIcon }\n type={ props.type }\n