@vuetify/nightly 3.7.4-next.2024-11-06 → 3.7.5-dev.2024-12-16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json/attributes.json +2853 -2845
- package/dist/json/importMap-labs.json +20 -20
- package/dist/json/importMap.json +150 -150
- package/dist/json/tags.json +2 -0
- package/dist/json/web-types.json +5324 -5306
- package/dist/vuetify-labs.css +25135 -23418
- package/dist/vuetify-labs.d.ts +202 -196
- package/dist/vuetify-labs.esm.js +107 -106
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +106 -105
- package/dist/vuetify-labs.min.css +4 -3
- package/dist/vuetify.css +23838 -22118
- package/dist/vuetify.d.ts +191 -185
- package/dist/vuetify.esm.js +96 -96
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +95 -95
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +4 -3
- package/dist/vuetify.min.js +884 -889
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.css +215 -207
- package/lib/components/VApp/VApp.css +15 -16
- package/lib/components/VAppBar/VAppBar.css +12 -14
- package/lib/components/VAppBar/index.d.mts +6 -6
- package/lib/components/VAutocomplete/VAutocomplete.css +85 -86
- package/lib/components/VAutocomplete/VAutocomplete.mjs +4 -4
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +22 -22
- package/lib/components/VAvatar/VAvatar.css +106 -108
- package/lib/components/VBadge/VBadge.css +77 -73
- package/lib/components/VBadge/VBadge.sass +4 -0
- package/lib/components/VBanner/VBanner.css +166 -161
- package/lib/components/VBottomNavigation/VBottomNavigation.css +63 -64
- package/lib/components/VBottomSheet/VBottomSheet.css +31 -34
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +57 -54
- package/lib/components/VBtn/VBtn.css +408 -385
- package/lib/components/VBtn/VBtn.sass +4 -4
- package/lib/components/VBtn/index.d.mts +7 -7
- package/lib/components/VBtnGroup/VBtnGroup.css +64 -63
- package/lib/components/VBtnToggle/VBtnToggle.css +14 -16
- package/lib/components/VBtnToggle/index.d.mts +9 -9
- package/lib/components/VCard/VCard.css +302 -294
- package/lib/components/VCarousel/VCarousel.css +65 -63
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +1 -1
- package/lib/components/VCarousel/index.d.mts +9 -9
- package/lib/components/VCheckbox/VCheckbox.css +5 -7
- package/lib/components/VCheckbox/VCheckbox.mjs +3 -3
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +411 -378
- package/lib/components/VChip/VChip.mjs +18 -10
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/index.d.mts +13 -8
- package/lib/components/VChipGroup/VChipGroup.css +18 -19
- package/lib/components/VChipGroup/VChipGroup.mjs +2 -0
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +20 -15
- package/lib/components/VCode/VCode.css +8 -10
- package/lib/components/VColorPicker/VColorPicker.css +22 -22
- package/lib/components/VColorPicker/VColorPickerCanvas.css +22 -24
- package/lib/components/VColorPicker/VColorPickerEdit.css +28 -29
- package/lib/components/VColorPicker/VColorPickerPreview.css +67 -69
- package/lib/components/VColorPicker/VColorPickerPreview.sass +2 -4
- package/lib/components/VColorPicker/VColorPickerSwatches.css +34 -34
- package/lib/components/VCombobox/VCombobox.css +85 -86
- package/lib/components/VCombobox/VCombobox.mjs +4 -4
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +22 -22
- package/lib/components/VConfirmEdit/VConfirmEdit.mjs +9 -7
- package/lib/components/VConfirmEdit/VConfirmEdit.mjs.map +1 -1
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.mjs +1 -1
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.mjs.map +1 -1
- package/lib/components/VConfirmEdit/index.d.mts +3 -7
- package/lib/components/VCounter/VCounter.css +5 -7
- package/lib/components/VDataTable/VDataTable.css +186 -189
- package/lib/components/VDataTable/VDataTable.sass +10 -20
- package/lib/components/VDataTable/VDataTableFooter.css +31 -33
- package/lib/components/VDatePicker/VDatePicker.css +6 -8
- package/lib/components/VDatePicker/VDatePickerControls.css +56 -54
- package/lib/components/VDatePicker/VDatePickerHeader.css +60 -56
- package/lib/components/VDatePicker/VDatePickerHeader.mjs +2 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonth.css +55 -51
- package/lib/components/VDatePicker/VDatePickerMonths.css +19 -20
- package/lib/components/VDatePicker/VDatePickerYears.css +15 -16
- package/lib/components/VDatePicker/index.d.mts +5 -5
- package/lib/components/VDialog/VDialog.css +95 -95
- package/lib/components/VDivider/VDivider.css +52 -52
- package/lib/components/VEmptyState/VEmptyState.css +67 -62
- package/lib/components/VExpansionPanel/VExpansionPanel.css +209 -203
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +25 -27
- package/lib/components/VExpansionPanel/index.d.mts +7 -7
- package/lib/components/VFab/VFab.css +69 -74
- package/lib/components/VFab/VFab.sass +4 -5
- package/lib/components/VFab/index.d.mts +6 -6
- package/lib/components/VField/VField.css +579 -539
- package/lib/components/VField/VField.mjs +5 -4
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +29 -31
- package/lib/components/VFooter/VFooter.css +36 -38
- package/lib/components/VGrid/VGrid.css +592 -565
- package/lib/components/VIcon/VIcon.css +52 -51
- package/lib/components/VImg/VImg.css +51 -50
- package/lib/components/VInfiniteScroll/VInfiniteScroll.css +37 -36
- package/lib/components/VInput/VInput.css +142 -131
- package/lib/components/VInput/VInput.mjs +3 -3
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.css +5 -7
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +9 -9
- package/lib/components/VKbd/VKbd.css +11 -13
- package/lib/components/VLabel/VLabel.css +15 -16
- package/lib/components/VLayout/VLayout.css +8 -10
- package/lib/components/VLayout/VLayoutItem.css +7 -8
- package/lib/components/VList/VList.css +108 -104
- package/lib/components/VList/VList.mjs +3 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +1 -1
- package/lib/components/VList/VListItem.css +452 -440
- package/lib/components/VList/VListItem.mjs +3 -2
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +1 -2
- package/lib/components/VList/index.d.mts +10 -10
- package/lib/components/VLocaleProvider/VLocaleProvider.css +2 -4
- package/lib/components/VMain/VMain.css +30 -32
- package/lib/components/VMenu/VMenu.css +19 -21
- package/lib/components/VMenu/VMenu.mjs +3 -3
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.mts +6 -6
- package/lib/components/VMessages/VMessages.css +15 -17
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +108 -106
- package/lib/components/VOtpInput/VOtpInput.css +58 -56
- package/lib/components/VOverlay/VOverlay.css +63 -60
- package/lib/components/VOverlay/VOverlay.sass +13 -14
- package/lib/components/VPagination/VPagination.css +8 -10
- package/lib/components/VParallax/VParallax.css +6 -8
- package/lib/components/VProgressCircular/VProgressCircular.css +101 -95
- package/lib/components/VProgressLinear/VProgressLinear.css +222 -209
- package/lib/components/VRadioGroup/VRadioGroup.css +12 -14
- package/lib/components/VRadioGroup/VRadioGroup.mjs +3 -3
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRating/VRating.css +53 -52
- package/lib/components/VRating/VRating.mjs +4 -3
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.css +26 -25
- package/lib/components/VSelect/VSelect.css +52 -54
- package/lib/components/VSelect/VSelect.mjs +3 -3
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +22 -22
- package/lib/components/VSelectionControl/VSelectionControl.css +102 -100
- package/lib/components/VSelectionControl/VSelectionControl.mjs +3 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +8 -10
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +3 -3
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.css +36 -38
- package/lib/components/VSkeletonLoader/VSkeletonLoader.css +224 -225
- package/lib/components/VSlideGroup/VSlideGroup.css +55 -53
- package/lib/components/VSlideGroup/index.d.mts +10 -10
- package/lib/components/VSlider/VSlider.css +57 -53
- package/lib/components/VSlider/VSliderThumb.css +153 -142
- package/lib/components/VSlider/VSliderTrack.css +174 -155
- package/lib/components/VSnackbar/VSnackbar.css +140 -140
- package/lib/components/VSparkline/VBarline.mjs +3 -3
- package/lib/components/VSparkline/VBarline.mjs.map +1 -1
- package/lib/components/VSparkline/VTrendline.mjs +3 -3
- package/lib/components/VSparkline/VTrendline.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.css +41 -43
- package/lib/components/VStepper/VStepper.css +56 -55
- package/lib/components/VStepper/VStepper.mjs +5 -4
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepperItem.css +115 -112
- package/lib/components/VStepper/VStepperItem.mjs +5 -4
- package/lib/components/VStepper/VStepperItem.mjs.map +1 -1
- package/lib/components/VStepper/index.d.mts +51 -45
- package/lib/components/VSwitch/VSwitch.css +139 -129
- package/lib/components/VSwitch/VSwitch.mjs +3 -3
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +43 -45
- package/lib/components/VTable/VTable.css +141 -140
- package/lib/components/VTable/VTable.sass +2 -4
- package/lib/components/VTabs/VTab.css +29 -30
- package/lib/components/VTabs/VTabs.css +65 -59
- package/lib/components/VTabs/index.d.mts +7 -7
- package/lib/components/VTextField/VTextField.css +68 -65
- package/lib/components/VTextarea/VTextarea.css +39 -47
- package/lib/components/VTextarea/VTextarea.sass +2 -4
- package/lib/components/VThemeProvider/VThemeProvider.css +3 -5
- package/lib/components/VTimeline/VTimeline.css +418 -379
- package/lib/components/VToolbar/VToolbar.css +143 -136
- package/lib/components/VTooltip/VTooltip.css +21 -25
- package/lib/components/VTooltip/VTooltip.mjs +3 -3
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +6 -8
- package/lib/components/VVirtualScroll/VVirtualScroll.css +9 -11
- package/lib/components/VWindow/VWindow.css +70 -73
- package/lib/components/VWindow/index.d.mts +7 -7
- package/lib/components/index.d.mts +138 -132
- package/lib/composables/form.mjs +7 -2
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs +3 -3
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/layout.mjs +3 -3
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +2 -2
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/theme.mjs +4 -4
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/validation.mjs +13 -15
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.css +36 -38
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +2 -3
- package/lib/framework.mjs.map +1 -1
- package/lib/index.d.mts +53 -53
- package/lib/labs/VCalendar/VCalendar.css +225 -219
- package/lib/labs/VCalendar/VCalendarDay.css +32 -33
- package/lib/labs/VCalendar/VCalendarHeader.css +13 -13
- package/lib/labs/VCalendar/VCalendarInterval.css +42 -43
- package/lib/labs/VCalendar/VCalendarIntervalEvent.css +5 -7
- package/lib/labs/VCalendar/VCalendarMonthDay.css +58 -61
- package/lib/labs/VCalendar/VCalendarMonthDay.sass +2 -3
- package/lib/labs/VDateInput/VDateInput.mjs +1 -1
- package/lib/labs/VDateInput/VDateInput.mjs.map +1 -1
- package/lib/labs/VNumberInput/VNumberInput.css +38 -40
- package/lib/labs/VNumberInput/VNumberInput.mjs +7 -5
- package/lib/labs/VNumberInput/VNumberInput.mjs.map +1 -1
- package/lib/labs/VPicker/VPicker.css +57 -53
- package/lib/labs/VStepperVertical/index.d.mts +44 -44
- package/lib/labs/VTimePicker/VTimePicker.css +7 -9
- package/lib/labs/VTimePicker/VTimePickerClock.css +129 -126
- package/lib/labs/VTimePicker/VTimePickerControls.css +103 -102
- package/lib/labs/VTreeview/VTreeviewItem.css +15 -17
- package/lib/labs/VTreeview/VTreeviewItem.mjs +3 -4
- package/lib/labs/VTreeview/VTreeviewItem.mjs.map +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.sass +1 -2
- package/lib/labs/VTreeview/index.d.mts +20 -20
- package/lib/labs/components.d.mts +64 -64
- package/lib/locale/fr.mjs +1 -1
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/styles/elements/_global.sass +1 -1
- package/lib/styles/generic/_colors.scss +3 -3
- package/lib/styles/generic/_layers.scss +1 -13
- package/lib/styles/generic/_transitions.scss +32 -32
- package/lib/styles/main.css +16139 -14666
- package/lib/styles/settings/_utilities.scss +5 -0
- package/lib/styles/settings/_variables.scss +2 -1
- package/lib/styles/tools/_bootable.sass +3 -0
- package/lib/styles/tools/_border.sass +4 -4
- package/lib/styles/tools/_display.sass +10 -0
- package/lib/styles/tools/_elevation.sass +2 -2
- package/lib/styles/tools/_index.sass +2 -0
- package/lib/styles/tools/_layer.scss +2 -4
- package/lib/styles/tools/_position.sass +2 -2
- package/lib/styles/tools/_radius.sass +10 -0
- package/lib/styles/tools/_rounded.sass +2 -2
- package/lib/styles/tools/_utilities.sass +5 -1
- package/lib/styles/utilities/_elevation.scss +1 -1
- package/lib/util/getCurrentInstance.mjs +1 -15
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"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 ))\n const model = computed({\n get () {\n const val = group ? group.modelValue.value : modelValue.value\n\n return isMultiple.value\n ? wrapInArray(val).some((v: any) => props.valueComparator(v, trueValue.value))\n : props.valueComparator(val, trueValue.value)\n },\n set (val: boolean) {\n if (props.readonly) return\n\n const currentValue = val ? trueValue.value : falseValue.value\n\n let newVal = currentValue\n\n if (isMultiple.value) {\n newVal = val\n ? [...wrapInArray(modelValue.value), currentValue]\n : wrapInArray(modelValue.value).filter((item: any) => !props.valueComparator(item, trueValue.value))\n }\n\n if (group) {\n group.modelValue.value = newVal\n } else {\n modelValue.value = newVal\n }\n },\n })\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n if (props.error || props.disabled) return undefined\n\n return model.value ? props.color : props.baseColor\n }))\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(computed(() => {\n return (\n model.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : props.baseColor\n }))\n const icon = computed(() => model.value ? props.trueIcon : props.falseIcon)\n\n return {\n group,\n densityClasses,\n trueValue,\n falseValue,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n icon,\n }\n}\n\nexport const VSelectionControl = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (value: T) => void\n },\n slots: VSelectionControlSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelectionControl',\n\n directives: { Ripple },\n\n inheritAttrs: false,\n\n props: makeVSelectionControlProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const {\n group,\n densityClasses,\n icon,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n trueValue,\n } = useSelectionControl(props)\n const uid = getUid()\n const isFocused = shallowRef(false)\n const isFocusVisible = shallowRef(false)\n const input = ref<HTMLInputElement>()\n const id = computed(() => props.id || `input-${uid}`)\n const isInteractive = computed(() => !props.disabled && !props.readonly)\n\n group?.onForceUpdate(() => {\n if (input.value) {\n input.value.checked = model.value\n }\n })\n\n function onFocus (e: FocusEvent) {\n if (!isInteractive.value) return\n\n isFocused.value = true\n if (matchesSelector(e.target as HTMLElement, ':focus-visible') !== false) {\n isFocusVisible.value = true\n }\n }\n\n function onBlur () {\n isFocused.value = false\n isFocusVisible.value = false\n }\n\n function onClickLabel (e: Event) {\n e.stopPropagation()\n }\n\n function onInput (e: Event) {\n if (!isInteractive.value) {\n if (input.value) {\n // model value is not updated when input is not interactive\n // but the internal checked state of the input is still updated,\n // so here it's value is restored\n input.value.checked = model.value\n }\n\n return\n }\n\n if (props.readonly && group) {\n nextTick(() => group.forceUpdate())\n }\n model.value = (e.target as HTMLInputElement).checked\n }\n\n useRender(() => {\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n const inputNode = (\n <input\n ref={ input }\n checked={ model.value }\n disabled={ !!props.disabled }\n id={ id.value }\n onBlur={ onBlur }\n onFocus={ onFocus }\n onInput={ onInput }\n aria-disabled={ !!props.disabled }\n aria-label={ props.label }\n type={ props.type }\n value={ trueValue.value }\n name={ props.name }\n aria-checked={ props.type === 'checkbox' ? model.value : undefined }\n { ...inputAttrs }\n />\n )\n\n return (\n <div\n class={[\n 'v-selection-control',\n {\n 'v-selection-control--dirty': model.value,\n 'v-selection-control--disabled': props.disabled,\n 'v-selection-control--error': props.error,\n 'v-selection-control--focused': isFocused.value,\n 'v-selection-control--focus-visible': isFocusVisible.value,\n 'v-selection-control--inline': props.inline,\n },\n densityClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n style={ props.style }\n >\n <div\n class={[\n 'v-selection-control__wrapper',\n textColorClasses.value,\n ]}\n style={ textColorStyles.value }\n >\n { slots.default?.({\n backgroundColorClasses,\n backgroundColorStyles,\n })}\n\n <div\n class={[\n 'v-selection-control__input',\n ]}\n v-ripple={ props.ripple && [\n !props.disabled && !props.readonly,\n null,\n ['center', 'circle'],\n ]}\n >\n { slots.input?.({\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n inputNode,\n icon: icon.value,\n props: {\n onFocus,\n onBlur,\n id: id.value,\n },\n } satisfies SelectionControlSlot) ?? (\n <>\n { icon.value && <VIcon key=\"icon\" icon={ icon.value } /> }\n\n { inputNode }\n </>\n )}\n </div>\n </div>\n\n { label && (\n <VLabel for={ id.value } onClick={ onClickLabel }>\n { label }\n </VLabel>\n )}\n </div>\n )\n })\n\n return {\n isFocused,\n input,\n }\n },\n})\n\nexport type VSelectionControl = InstanceType<typeof VSelectionControl>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,MAAM;AAAA,SACNC,8BAA8B,EAAEC,4BAA4B,gEAErE;AAAA,SACSC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB;AAAA,SAClBC,UAAU;AAAA,SACVC,eAAe,8CAExB;AAAA,SACSC,MAAM,6CAEf;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAA,SAE/DC,gBAAgB,EAChBC,gBAAgB,EAChBC,MAAM,EACNC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AA6BA,OAAO,MAAMC,0BAA0B,GAAGH,YAAY,CAAC;EACrDI,KAAK,EAAEC,MAAM;EACbC,SAAS,EAAED,MAAM;EACjBE,SAAS,EAAE,IAAI;EACfC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EAEX,GAAGtB,kBAAkB,CAAC,CAAC;EACvB,GAAGJ,8BAA8B,CAAC;AACpC,CAAC,EAAE,mBAAmB,CAAC;AAEvB,OAAO,SAAS2B,mBAAmBA,CACjCC,KAEC,EACD;EACA,MAAMC,KAAK,GAAGpB,MAAM,CAACR,4BAA4B,EAAE6B,SAAS,CAAC;EAC7D,MAAM;IAAEC;EAAe,CAAC,GAAG1B,UAAU,CAACuB,KAAK,CAAC;EAC5C,MAAMI,UAAU,GAAG1B,eAAe,CAACsB,KAAK,EAAE,YAAY,CAAC;EACvD,MAAMJ,SAAS,GAAGhB,QAAQ,CAAC,MACzBoB,KAAK,CAACJ,SAAS,KAAKM,SAAS,GAAGF,KAAK,CAACJ,SAAS,GAC7CI,KAAK,CAACF,KAAK,KAAKI,SAAS,GAAGF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0D,IAAI,CAAC9B;MAAK,QAAK,EAEtD6D,SAAS,EAEd,MAAAU,iBAAA,YAzBUrE,KAAK,CAACsE,MAAM,IAAI,CACzB,CAACtE,KAAK,CAACwB,QAAQ,IAAI,CAACxB,KAAK,CAACgB,QAAQ,EAClC,IAAI,EACJ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACrB,OAyBHvB,KAAK,IAAAmE,YAAA,CAAAzF,MAAA;QAAA,OACSyE,EAAE,CAAC9C,KAAK;QAAA,WAAasD;MAAY;QAAAc,OAAA,EAAAA,CAAA,MAC3CzE,KAAK;MAAA,EAEV;IAGP,CAAC,CAAC;IAEF,OAAO;MACLgD,SAAS;MACTE;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VSelectionControl.mjs","names":["VIcon","VLabel","makeSelectionControlGroupProps","VSelectionControlGroupSymbol","useBackgroundColor","useTextColor","makeComponentProps","useDensity","useProxiedModel","Ripple","computed","inject","nextTick","ref","shallowRef","useId","filterInputAttrs","genericComponent","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, useId } from 'vue'\nimport {\n filterInputAttrs,\n genericComponent,\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 ))\n const model = computed({\n get () {\n const val = group ? group.modelValue.value : modelValue.value\n\n return isMultiple.value\n ? wrapInArray(val).some((v: any) => props.valueComparator(v, trueValue.value))\n : props.valueComparator(val, trueValue.value)\n },\n set (val: boolean) {\n if (props.readonly) return\n\n const currentValue = val ? trueValue.value : falseValue.value\n\n let newVal = currentValue\n\n if (isMultiple.value) {\n newVal = val\n ? [...wrapInArray(modelValue.value), currentValue]\n : wrapInArray(modelValue.value).filter((item: any) => !props.valueComparator(item, trueValue.value))\n }\n\n if (group) {\n group.modelValue.value = newVal\n } else {\n modelValue.value = newVal\n }\n },\n })\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n if (props.error || props.disabled) return undefined\n\n return model.value ? props.color : props.baseColor\n }))\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(computed(() => {\n return (\n model.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : props.baseColor\n }))\n const icon = computed(() => model.value ? props.trueIcon : props.falseIcon)\n\n return {\n group,\n densityClasses,\n trueValue,\n falseValue,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n icon,\n }\n}\n\nexport const VSelectionControl = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (value: T) => void\n },\n slots: VSelectionControlSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelectionControl',\n\n directives: { Ripple },\n\n inheritAttrs: false,\n\n props: makeVSelectionControlProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const {\n group,\n densityClasses,\n icon,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n trueValue,\n } = useSelectionControl(props)\n const uid = useId()\n const isFocused = shallowRef(false)\n const isFocusVisible = shallowRef(false)\n const input = ref<HTMLInputElement>()\n const id = computed(() => props.id || `input-${uid}`)\n const isInteractive = computed(() => !props.disabled && !props.readonly)\n\n group?.onForceUpdate(() => {\n if (input.value) {\n input.value.checked = model.value\n }\n })\n\n function onFocus (e: FocusEvent) {\n if (!isInteractive.value) return\n\n isFocused.value = true\n if (matchesSelector(e.target as HTMLElement, ':focus-visible') !== false) {\n isFocusVisible.value = true\n }\n }\n\n function onBlur () {\n isFocused.value = false\n isFocusVisible.value = false\n }\n\n function onClickLabel (e: Event) {\n e.stopPropagation()\n }\n\n function onInput (e: Event) {\n if (!isInteractive.value) {\n if (input.value) {\n // model value is not updated when input is not interactive\n // but the internal checked state of the input is still updated,\n // so here it's value is restored\n input.value.checked = model.value\n }\n\n return\n }\n\n if (props.readonly && group) {\n nextTick(() => group.forceUpdate())\n }\n model.value = (e.target as HTMLInputElement).checked\n }\n\n useRender(() => {\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n const inputNode = (\n <input\n ref={ input }\n checked={ model.value }\n disabled={ !!props.disabled }\n id={ id.value }\n onBlur={ onBlur }\n onFocus={ onFocus }\n onInput={ onInput }\n aria-disabled={ !!props.disabled }\n aria-label={ props.label }\n type={ props.type }\n value={ trueValue.value }\n name={ props.name }\n aria-checked={ props.type === 'checkbox' ? model.value : undefined }\n { ...inputAttrs }\n />\n )\n\n return (\n <div\n class={[\n 'v-selection-control',\n {\n 'v-selection-control--dirty': model.value,\n 'v-selection-control--disabled': props.disabled,\n 'v-selection-control--error': props.error,\n 'v-selection-control--focused': isFocused.value,\n 'v-selection-control--focus-visible': isFocusVisible.value,\n 'v-selection-control--inline': props.inline,\n },\n densityClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n style={ props.style }\n >\n <div\n class={[\n 'v-selection-control__wrapper',\n textColorClasses.value,\n ]}\n style={ textColorStyles.value }\n >\n { slots.default?.({\n backgroundColorClasses,\n backgroundColorStyles,\n })}\n\n <div\n class={[\n 'v-selection-control__input',\n ]}\n v-ripple={ props.ripple && [\n !props.disabled && !props.readonly,\n null,\n ['center', 'circle'],\n ]}\n >\n { slots.input?.({\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n inputNode,\n icon: icon.value,\n props: {\n onFocus,\n onBlur,\n id: id.value,\n },\n } satisfies SelectionControlSlot) ?? (\n <>\n { icon.value && <VIcon key=\"icon\" icon={ icon.value } /> }\n\n { inputNode }\n </>\n )}\n </div>\n </div>\n\n { label && (\n <VLabel for={ id.value } onClick={ onClickLabel }>\n { label }\n </VLabel>\n )}\n </div>\n )\n })\n\n return {\n isFocused,\n input,\n }\n },\n})\n\nexport type VSelectionControl = InstanceType<typeof VSelectionControl>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,MAAM;AAAA,SACNC,8BAA8B,EAAEC,4BAA4B,gEAErE;AAAA,SACSC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB;AAAA,SAClBC,UAAU;AAAA,SACVC,eAAe,8CAExB;AAAA,SACSC,MAAM,6CAEf;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAEtEC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AA6BA,OAAO,MAAMC,0BAA0B,GAAGH,YAAY,CAAC;EACrDI,KAAK,EAAEC,MAAM;EACbC,SAAS,EAAED,MAAM;EACjBE,SAAS,EAAE,IAAI;EACfC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EAEX,GAAGtB,kBAAkB,CAAC,CAAC;EACvB,GAAGJ,8BAA8B,CAAC;AACpC,CAAC,EAAE,mBAAmB,CAAC;AAEvB,OAAO,SAAS2B,mBA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AA4B;MAC7B,IAOCrB,KAAK,CAACI,KAAK,GAAG;QACdlC,KAAK;QACLY,gBAAgB;QAChBC,eAAe;QACfI,sBAAsB;QACtBC,qBAAqB;QACrBgC,SAAS;QACT/B,IAAI,EAAEA,IAAI,CAAC9B,KAAK;QAChBE,KAAK,EAAE;UACLgD,OAAO;UACPG,MAAM;UACNP,EAAE,EAAEA,EAAE,CAAC9C;QACT;MACF,CAAgC,CAAC,IAAA8D,YAAA,CAAAQ,SAAA,SAE3BxC,IAAI,CAAC9B,KAAK,IAAA8D,YAAA,CAAA1F,KAAA;QAAA;QAAA,QAA6B0D,IAAI,CAAC9B;MAAK,QAAK,EAEtD6D,SAAS,EAEd,MAAAU,iBAAA,YAzBUrE,KAAK,CAACsE,MAAM,IAAI,CACzB,CAACtE,KAAK,CAACwB,QAAQ,IAAI,CAACxB,KAAK,CAACgB,QAAQ,EAClC,IAAI,EACJ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACrB,OAyBHvB,KAAK,IAAAmE,YAAA,CAAAzF,MAAA;QAAA,OACSyE,EAAE,CAAC9C,KAAK;QAAA,WAAasD;MAAY;QAAAc,OAAA,EAAAA,CAAA,MAC3CzE,KAAK;MAAA,EAEV;IAGP,CAAC,CAAC;IAEF,OAAO;MACLgD,SAAS;MACTE;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -1,11 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
flex-wrap: wrap;
|
10
|
-
}
|
1
|
+
.v-selection-control-group {
|
2
|
+
grid-area: control;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
}
|
6
|
+
.v-selection-control-group--inline {
|
7
|
+
flex-direction: row;
|
8
|
+
flex-wrap: wrap;
|
11
9
|
}
|
@@ -9,8 +9,8 @@ import { makeDensityProps } from "../../composables/density.mjs";
|
|
9
9
|
import { IconValue } from "../../composables/icons.mjs";
|
10
10
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs";
|
11
11
|
import { makeThemeProps } from "../../composables/theme.mjs"; // Utilities
|
12
|
-
import { computed, onScopeDispose, provide, toRef } from 'vue';
|
13
|
-
import { deepEqual, genericComponent,
|
12
|
+
import { computed, onScopeDispose, provide, toRef, useId } from 'vue';
|
13
|
+
import { deepEqual, genericComponent, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
14
14
|
export const VSelectionControlGroupSymbol = Symbol.for('vuetify:selection-control-group');
|
15
15
|
export const makeSelectionControlGroupProps = propsFactory({
|
16
16
|
color: String,
|
@@ -63,7 +63,7 @@ export const VSelectionControlGroup = genericComponent()({
|
|
63
63
|
slots
|
64
64
|
} = _ref;
|
65
65
|
const modelValue = useProxiedModel(props, 'modelValue');
|
66
|
-
const uid =
|
66
|
+
const uid = useId();
|
67
67
|
const id = computed(() => props.id || `v-selection-control-group-${uid}`);
|
68
68
|
const name = computed(() => props.name || id.value);
|
69
69
|
const updateHandlers = new Set();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VSelectionControlGroup.mjs","names":["makeComponentProps","provideDefaults","makeDensityProps","IconValue","useProxiedModel","makeThemeProps","computed","onScopeDispose","provide","toRef","
|
1
|
+
{"version":3,"file":"VSelectionControlGroup.mjs","names":["makeComponentProps","provideDefaults","makeDensityProps","IconValue","useProxiedModel","makeThemeProps","computed","onScopeDispose","provide","toRef","useId","deepEqual","genericComponent","propsFactory","useRender","VSelectionControlGroupSymbol","Symbol","for","makeSelectionControlGroupProps","color","String","disabled","type","Boolean","default","defaultsTarget","error","id","inline","falseIcon","trueIcon","ripple","Object","multiple","name","readonly","modelValue","valueComparator","Function","makeVSelectionControlGroupProps","VSelectionControlGroup","props","emits","value","setup","_ref","slots","uid","updateHandlers","Set","forceUpdate","forEach","fn","onForceUpdate","cb","add","delete","density","Array","isArray","_createVNode","class","style","undefined"],"sources":["../../../src/components/VSelectionControlGroup/VSelectionControlGroup.tsx"],"sourcesContent":["// Styles\nimport './VSelectionControlGroup.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDensityProps } from '@/composables/density'\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeThemeProps } from '@/composables/theme'\n\n// Utilities\nimport { computed, onScopeDispose, provide, toRef, useId } from 'vue'\nimport { deepEqual, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { RippleDirectiveBinding } from '@/directives/ripple'\nimport type { GenericProps } from '@/util'\n\nexport interface VSelectionGroupContext {\n modelValue: Ref<any>\n forceUpdate: () => void\n onForceUpdate: (fn: () => void) => void\n}\n\nexport const VSelectionControlGroupSymbol: InjectionKey<VSelectionGroupContext> = Symbol.for('vuetify:selection-control-group')\n\nexport const makeSelectionControlGroupProps = propsFactory({\n color: String,\n disabled: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n defaultsTarget: String,\n error: Boolean,\n id: String,\n inline: Boolean,\n falseIcon: IconValue,\n trueIcon: IconValue,\n ripple: {\n type: [Boolean, Object] as PropType<RippleDirectiveBinding['value']>,\n default: true,\n },\n multiple: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n name: String,\n readonly: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n modelValue: null,\n type: String,\n valueComparator: {\n type: Function as PropType<typeof deepEqual>,\n default: deepEqual,\n },\n\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeThemeProps(),\n}, 'SelectionControlGroup')\n\nexport const makeVSelectionControlGroupProps = propsFactory({\n ...makeSelectionControlGroupProps({\n defaultsTarget: 'VSelectionControl',\n }),\n}, 'VSelectionControlGroup')\n\nexport const VSelectionControlGroup = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (value: T) => void\n },\n slots: { default: never },\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelectionControlGroup',\n\n props: makeVSelectionControlGroupProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { slots }) {\n const modelValue = useProxiedModel(props, 'modelValue')\n const uid = useId()\n const id = computed(() => props.id || `v-selection-control-group-${uid}`)\n const name = computed(() => props.name || id.value)\n\n const updateHandlers = new Set<() => void>()\n provide(VSelectionControlGroupSymbol, {\n modelValue,\n forceUpdate: () => {\n updateHandlers.forEach(fn => fn())\n },\n onForceUpdate: cb => {\n updateHandlers.add(cb)\n onScopeDispose(() => {\n updateHandlers.delete(cb)\n })\n },\n })\n\n provideDefaults({\n [props.defaultsTarget]: {\n color: toRef(props, 'color'),\n disabled: toRef(props, 'disabled'),\n density: toRef(props, 'density'),\n error: toRef(props, 'error'),\n inline: toRef(props, 'inline'),\n modelValue,\n multiple: computed(() => !!props.multiple || (props.multiple == null && Array.isArray(modelValue.value))),\n name,\n falseIcon: toRef(props, 'falseIcon'),\n trueIcon: toRef(props, 'trueIcon'),\n readonly: toRef(props, 'readonly'),\n ripple: toRef(props, 'ripple'),\n type: toRef(props, 'type'),\n valueComparator: toRef(props, 'valueComparator'),\n },\n })\n\n useRender(() => (\n <div\n class={[\n 'v-selection-control-group',\n { 'v-selection-control-group--inline': props.inline },\n props.class,\n ]}\n style={ props.style }\n role={ props.type === 'radio' ? 'radiogroup' : undefined }\n >\n { slots.default?.() }\n </div>\n ))\n\n return {}\n },\n})\n\nexport type VSelectionControlGroup = InstanceType<typeof VSelectionControlGroup>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,eAAe;AAAA,SACfC,gBAAgB;AAAA,SAChBC,SAAS;AAAA,SACTC,eAAe;AAAA,SACfC,cAAc,uCAEvB;AACA,SAASC,QAAQ,EAAEC,cAAc,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5DC,SAAS,EAAEC,gBAAgB,EAAE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
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
border-radius: 4px;
|
38
|
-
}
|
1
|
+
.v-sheet {
|
2
|
+
display: block;
|
3
|
+
}
|
4
|
+
.v-sheet {
|
5
|
+
border-color: rgba(var(--v-border-color), var(--v-border-opacity));
|
6
|
+
border-style: solid;
|
7
|
+
border-width: 0;
|
8
|
+
}
|
9
|
+
.v-sheet--border {
|
10
|
+
border-width: thin;
|
11
|
+
box-shadow: none;
|
12
|
+
}
|
13
|
+
.v-sheet {
|
14
|
+
box-shadow: 0px 0px 0px 0px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 0px 0px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 0px 0px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12));
|
15
|
+
}
|
16
|
+
.v-sheet--absolute {
|
17
|
+
position: absolute;
|
18
|
+
}
|
19
|
+
.v-sheet--fixed {
|
20
|
+
position: fixed;
|
21
|
+
}
|
22
|
+
.v-sheet--relative {
|
23
|
+
position: relative;
|
24
|
+
}
|
25
|
+
.v-sheet--sticky {
|
26
|
+
position: sticky;
|
27
|
+
}
|
28
|
+
.v-sheet {
|
29
|
+
border-radius: 0;
|
30
|
+
}
|
31
|
+
.v-sheet {
|
32
|
+
background: rgb(var(--v-theme-surface));
|
33
|
+
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
|
34
|
+
}
|
35
|
+
.v-sheet--rounded {
|
36
|
+
border-radius: 4px;
|
39
37
|
}
|