@vuetify/nightly 3.0.0-beta.13 → 3.0.0-beta.15
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/CHANGELOG.md +23 -5
- package/dist/json/importMap.json +26 -30
- package/dist/vuetify.css +262 -173
- package/dist/vuetify.d.ts +16645 -7306
- package/dist/vuetify.esm.js +1040 -2004
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +1038 -2003
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +531 -537
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +24 -32
- package/lib/blueprints/index.mjs.map +1 -1
- package/lib/blueprints/md1.d.ts +24 -32
- package/lib/blueprints/md1.mjs +3 -1
- package/lib/blueprints/md1.mjs.map +1 -1
- package/lib/blueprints/md2.d.ts +24 -32
- package/lib/blueprints/md2.mjs +3 -1
- package/lib/blueprints/md2.mjs.map +1 -1
- package/lib/blueprints/md3.d.ts +24 -32
- package/lib/blueprints/md3.mjs +2 -2
- package/lib/blueprints/md3.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.mjs +2 -9
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/index.d.ts +7 -5
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.mjs +5 -7
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/index.d.ts +4 -2
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.mjs +4 -8
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +0 -4
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +2 -4
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.ts +7 -3
- package/lib/components/VAppBar/index.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +18 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +16 -35
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +11 -1
- package/lib/components/VAutocomplete/_variables.scss +1 -0
- package/lib/components/VAutocomplete/index.d.ts +267 -376
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.mjs +3 -7
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/index.d.ts +5 -3
- package/lib/components/VAvatar/index.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.mjs +2 -6
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/index.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.mjs +5 -7
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBannerActions.mjs +0 -4
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/VBannerText.mjs.map +1 -1
- package/lib/components/VBanner/index.d.ts +7 -3
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +2 -5
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.ts +5 -3
- package/lib/components/VBottomNavigation/index.mjs.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs +5 -5
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/components/VBottomSheet/index.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +5 -9
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +0 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/index.d.ts +50 -40
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.mjs +2 -10
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/index.d.ts +5 -3
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.mjs +2 -4
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/index.d.ts +6 -3
- package/lib/components/VBtnGroup/index.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.mjs +2 -7
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.ts +20 -25
- package/lib/components/VBtnToggle/index.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendar.mjs +6 -67
- package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.mjs +7 -18
- package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.mjs +3 -34
- package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs +3 -7
- package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.mjs +3 -32
- package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
- package/lib/components/VCalendar/index.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-base.mjs +1 -19
- package/lib/components/VCalendar/mixins/calendar-base.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs +14 -78
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs +0 -30
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.mjs +7 -17
- package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/times.mjs +1 -9
- package/lib/components/VCalendar/mixins/times.mjs.map +1 -1
- package/lib/components/VCalendar/modes/column.mjs +0 -3
- package/lib/components/VCalendar/modes/column.mjs.map +1 -1
- package/lib/components/VCalendar/modes/common.mjs +0 -14
- package/lib/components/VCalendar/modes/common.mjs.map +1 -1
- package/lib/components/VCalendar/modes/index.mjs +0 -1
- package/lib/components/VCalendar/modes/index.mjs.map +1 -1
- package/lib/components/VCalendar/modes/stack.mjs +3 -45
- package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
- package/lib/components/VCalendar/util/events.mjs +0 -1
- package/lib/components/VCalendar/util/events.mjs.map +1 -1
- package/lib/components/VCalendar/util/parser.mjs +3 -4
- package/lib/components/VCalendar/util/parser.mjs.map +1 -1
- package/lib/components/VCalendar/util/props.mjs +0 -13
- package/lib/components/VCalendar/util/props.mjs.map +1 -1
- package/lib/components/VCalendar/util/timestamp.mjs +2 -64
- package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
- package/lib/components/VCard/VCard.mjs +3 -8
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCardActions.mjs +0 -4
- package/lib/components/VCard/VCardActions.mjs.map +1 -1
- package/lib/components/VCard/VCardItem.mjs +0 -5
- package/lib/components/VCard/VCardItem.mjs.map +1 -1
- package/lib/components/VCard/VCardSubtitle.mjs.map +1 -1
- package/lib/components/VCard/VCardText.mjs.map +1 -1
- package/lib/components/VCard/VCardTitle.mjs.map +1 -1
- package/lib/components/VCard/index.d.ts +13 -6
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +5 -9
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarouselItem.mjs +0 -3
- package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
- package/lib/components/VCarousel/index.d.ts +1 -0
- package/lib/components/VCarousel/index.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.mjs +6 -6
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +7 -15
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +24 -22
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +25 -0
- package/lib/components/VChip/VChip.mjs +2 -10
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +1 -0
- package/lib/components/VChip/index.d.ts +5 -3
- package/lib/components/VChip/index.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.mjs +5 -6
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.mjs.map +1 -1
- package/lib/components/VCode/index.d.ts +1 -0
- package/lib/components/VCode/index.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.mjs +9 -12
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +5 -20
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +6 -10
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +6 -8
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +2 -6
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/index.mjs.map +1 -1
- package/lib/components/VColorPicker/util/index.mjs +24 -26
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +13 -0
- package/lib/components/VCombobox/VCombobox.mjs +23 -50
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +5 -0
- package/lib/components/VCombobox/_variables.scss +1 -0
- package/lib/components/VCombobox/index.d.ts +275 -384
- package/lib/components/VCombobox/index.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.mjs +2 -5
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/index.d.ts +1 -0
- package/lib/components/VCounter/index.mjs.map +1 -1
- package/lib/components/VData/VData.mjs +9 -67
- package/lib/components/VData/VData.mjs.map +1 -1
- package/lib/components/VData/index.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs +6 -25
- package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.mjs +12 -51
- package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
- package/lib/components/VDataIterator/index.mjs.map +1 -1
- package/lib/components/VDataTable/MobileRow.mjs +3 -8
- package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
- package/lib/components/VDataTable/Row.mjs +1 -8
- package/lib/components/VDataTable/Row.mjs.map +1 -1
- package/lib/components/VDataTable/RowGroup.mjs +1 -7
- package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.mjs +42 -90
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.mjs +6 -10
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs +0 -18
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs +0 -9
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
- package/lib/components/VDataTable/VEditDialog.mjs +3 -17
- package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.mjs +3 -28
- package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
- package/lib/components/VDataTable/index.mjs +0 -1
- package/lib/components/VDataTable/index.mjs.map +1 -1
- package/lib/components/VDataTable/mixins/header.mjs +0 -5
- package/lib/components/VDataTable/mixins/header.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.mjs +2 -69
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs +1 -29
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs +4 -17
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs +1 -12
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.mjs +4 -15
- package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +4 -18
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.mjs.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs +6 -33
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs.map +1 -1
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs +0 -5
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.mjs +2 -3
- package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
- package/lib/components/VDatePicker/util/index.mjs +0 -1
- package/lib/components/VDatePicker/util/index.mjs.map +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs.map +1 -1
- package/lib/components/VDatePicker/util/monthChange.mjs +0 -3
- package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
- package/lib/components/VDatePicker/util/pad.mjs +1 -6
- package/lib/components/VDatePicker/util/pad.mjs.map +1 -1
- package/lib/components/VDatePicker/util/sanitizeDateString.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs +2 -4
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/index.d.ts +1 -0
- package/lib/components/VDefaultsProvider/index.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.mjs +7 -20
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/index.d.ts +1208 -188
- package/lib/components/VDialog/index.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.mjs +2 -8
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VDivider/index.d.ts +1 -0
- package/lib/components/VDivider/index.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +0 -5
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs +2 -6
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +3 -8
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs +2 -5
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/index.mjs.map +1 -1
- package/lib/components/VField/VField.css +1 -1
- package/lib/components/VField/VField.mjs +4 -11
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +0 -1
- package/lib/components/VField/VFieldLabel.mjs +0 -3
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/index.d.ts +33 -59
- package/lib/components/VField/index.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +16 -0
- package/lib/components/VFileInput/VFileInput.mjs +6 -20
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +10 -0
- package/lib/components/VFileInput/_variables.scss +2 -0
- package/lib/components/VFileInput/index.d.ts +233 -5
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.mjs +2 -4
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/index.d.ts +1 -0
- package/lib/components/VFooter/index.mjs.map +1 -1
- package/lib/components/VForm/VForm.mjs +2 -13
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.d.ts +1 -1
- package/lib/components/VForm/index.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +8 -23
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +2 -4
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +6 -24
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VGrid/index.d.ts +2 -0
- package/lib/components/VGrid/index.mjs.map +1 -1
- package/lib/components/VHover/VHover.mjs +0 -4
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.d.ts +1 -0
- package/lib/components/VHover/index.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.mjs +2 -8
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/index.d.ts +1 -0
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.mjs +9 -35
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +8 -4
- package/lib/components/VImg/index.mjs.map +1 -1
- package/lib/components/VInput/InputIcon.mjs +0 -2
- package/lib/components/VInput/InputIcon.mjs.map +1 -1
- package/lib/components/VInput/VInput.mjs +5 -9
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.ts +29 -45
- package/lib/components/VInput/index.mjs.map +1 -1
- package/lib/components/VItemGroup/VItem.mjs +0 -5
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs +4 -6
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.ts +19 -25
- package/lib/components/VItemGroup/index.mjs.map +1 -1
- package/lib/components/VKbd/index.d.ts +1 -0
- package/lib/components/VKbd/index.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.mjs +2 -5
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/index.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.mjs +2 -5
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayoutItem.mjs +2 -6
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/index.d.ts +5 -2
- package/lib/components/VLayout/index.mjs.map +1 -1
- package/lib/components/VLazy/VLazy.mjs +0 -8
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VLazy/index.d.ts +1 -0
- package/lib/components/VLazy/index.mjs.map +1 -1
- package/lib/components/VList/VList.mjs +2 -11
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListChildren.mjs +12 -21
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +1 -12
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs.map +1 -1
- package/lib/components/VList/VListItem.mjs +2 -12
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItemAction.mjs +0 -3
- package/lib/components/VList/VListItemAction.mjs.map +1 -1
- package/lib/components/VList/VListItemMedia.mjs +0 -3
- package/lib/components/VList/VListItemMedia.mjs.map +1 -1
- package/lib/components/VList/VListItemSubtitle.mjs.map +1 -1
- package/lib/components/VList/VListItemTitle.mjs.map +1 -1
- package/lib/components/VList/VListSubheader.mjs +0 -4
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/index.d.ts +147 -170
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VList/list.mjs +5 -2
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +4 -9
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VLocaleProvider/index.d.ts +1 -0
- package/lib/components/VLocaleProvider/index.mjs.map +1 -1
- package/lib/components/VMain/VMain.mjs +2 -5
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/index.d.ts +1 -0
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.mjs +3 -14
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.ts +1203 -183
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.mjs +2 -6
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/index.d.ts +1 -0
- package/lib/components/VMessages/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +6 -11
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/sticky.mjs +0 -4
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/touch.mjs +2 -15
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VNoSsr/VNoSsr.mjs +0 -4
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
- package/lib/components/VNoSsr/index.d.ts +1 -0
- package/lib/components/VNoSsr/index.mjs.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.mjs +7 -58
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
- package/lib/components/VOtpInput/index.mjs.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs +7 -19
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
- package/lib/components/VOverflowBtn/index.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.mjs +8 -17
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.ts +32 -60
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +23 -56
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/requestNewFrame.mjs +1 -2
- package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +2 -18
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +6 -32
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VOverlay/util/point.mjs +3 -4
- package/lib/components/VOverlay/util/point.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +11 -23
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/index.d.ts +5 -3
- package/lib/components/VPagination/index.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.mjs +6 -12
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/index.mjs.map +1 -1
- package/lib/components/VPicker/VPicker.mjs +3 -12
- package/lib/components/VPicker/VPicker.mjs.map +1 -1
- package/lib/components/VPicker/index.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.mjs +2 -5
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/index.d.ts +1 -0
- package/lib/components/VProgressCircular/index.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -8
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/index.d.ts +1 -0
- package/lib/components/VProgressLinear/index.mjs.map +1 -1
- package/lib/components/VRadio/VRadio.mjs +2 -4
- package/lib/components/VRadio/VRadio.mjs.map +1 -1
- package/lib/components/VRadio/index.d.ts +13 -11
- package/lib/components/VRadio/index.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +15 -20
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.ts +26 -38
- package/lib/components/VRadioGroup/index.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +13 -26
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.ts +5 -3
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +4 -22
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/index.d.ts +32 -40
- package/lib/components/VRating/index.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.mjs +2 -5
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VResponsive/index.d.ts +1 -0
- package/lib/components/VResponsive/index.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.css +13 -0
- package/lib/components/VSelect/VSelect.mjs +9 -22
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +6 -0
- package/lib/components/VSelect/_variables.scss +1 -0
- package/lib/components/VSelect/index.d.ts +4264 -776
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs +14 -58
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +62 -78
- package/lib/components/VSelectionControl/index.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +1 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +56 -28
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +1 -0
- package/lib/components/VSelectionControlGroup/index.d.ts +53 -4
- package/lib/components/VSelectionControlGroup/index.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.mjs +2 -4
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/index.d.ts +1 -0
- package/lib/components/VSheet/index.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs +19 -32
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/index.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.mjs +16 -47
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +5 -9
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/helpers.mjs +0 -2
- package/lib/components/VSlideGroup/helpers.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.ts +342 -59
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.mjs +6 -9
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.mjs +4 -15
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.mjs +6 -8
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/index.d.ts +5 -3
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +6 -27
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.mjs +3 -10
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.ts +1215 -191
- package/lib/components/VSnackbar/index.mjs.map +1 -1
- package/lib/components/VSparkline/VSparkline.mjs +5 -40
- package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/core.mjs +1 -1
- package/lib/components/VSparkline/helpers/core.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/math.mjs +2 -3
- package/lib/components/VSparkline/helpers/math.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/path.mjs +0 -4
- package/lib/components/VSparkline/helpers/path.mjs.map +1 -1
- package/lib/components/VSparkline/index.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.mjs +3 -12
- package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/components/VSpeedDial/index.mjs.map +1 -1
- package/lib/components/VStepper/VStepper.mjs +5 -24
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepperContent.mjs +4 -25
- package/lib/components/VStepper/VStepperContent.mjs.map +1 -1
- package/lib/components/VStepper/VStepperStep.mjs +0 -24
- package/lib/components/VStepper/VStepperStep.mjs.map +1 -1
- package/lib/components/VStepper/index.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.mjs +14 -15
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.ts +15 -11
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.mjs +2 -4
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/index.d.ts +1 -0
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.css +3 -3
- package/lib/components/VTable/VTable.mjs +5 -6
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +9 -3
- package/lib/components/VTable/index.d.ts +8 -3
- package/lib/components/VTable/index.mjs.map +1 -1
- package/lib/components/VTabs/VTab.mjs +2 -10
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.css +5 -5
- package/lib/components/VTabs/VTabs.mjs +12 -17
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +4 -4
- package/lib/components/VTabs/_variables.scss +1 -1
- package/lib/components/VTabs/index.d.ts +23 -15
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.mjs +13 -24
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/index.d.ts +1375 -191
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +6 -24
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +233 -5
- package/lib/components/VTextarea/index.mjs.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.mjs +2 -5
- package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
- package/lib/components/VThemeProvider/index.d.ts +1 -0
- package/lib/components/VThemeProvider/index.mjs.map +1 -1
- package/lib/components/VTimePicker/SelectingTimes.mjs +0 -3
- package/lib/components/VTimePicker/SelectingTimes.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.mjs +3 -53
- package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerClock.mjs +6 -42
- package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerTitle.mjs +4 -13
- package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
- package/lib/components/VTimePicker/index.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.mjs +2 -9
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineDivider.mjs +0 -5
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +0 -6
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/index.d.ts +7 -3
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.mjs +2 -8
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarItems.mjs +0 -4
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.mjs +0 -5
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
- package/lib/components/VToolbar/index.d.ts +34 -71
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.mjs +2 -8
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/index.d.ts +1196 -176
- package/lib/components/VTooltip/index.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeview.mjs +17 -72
- package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.mjs +2 -32
- package/lib/components/VTreeview/VTreeviewNode.mjs.map +1 -1
- package/lib/components/VTreeview/index.mjs.map +1 -1
- package/lib/components/VTreeview/util/filterTreeItems.mjs +0 -6
- package/lib/components/VTreeview/util/filterTreeItems.mjs.map +1 -1
- package/lib/components/VValidation/VValidation.mjs +2 -5
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.ts +1 -0
- package/lib/components/VValidation/index.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +3 -18
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.mjs +5 -15
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindowItem.mjs +8 -21
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/index.d.ts +37 -87
- package/lib/components/VWindow/index.mjs.map +1 -1
- package/lib/components/index.d.ts +16084 -6799
- package/lib/components/index.mjs +0 -11
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs +0 -10
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +3 -18
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs +2 -11
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/transitions/index.d.ts +16 -0
- package/lib/components/transitions/index.mjs +5 -4
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +0 -3
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs +0 -4
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +0 -5
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/delay.mjs +0 -3
- package/lib/composables/delay.mjs.map +1 -1
- package/lib/composables/density.mjs +4 -1
- package/lib/composables/density.mjs.map +1 -1
- package/lib/composables/dimensions.mjs +0 -1
- package/lib/composables/dimensions.mjs.map +1 -1
- package/lib/composables/display.mjs +7 -20
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/elevation.mjs +2 -4
- package/lib/composables/elevation.mjs.map +1 -1
- package/lib/composables/filter.mjs +7 -14
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/focus.mjs +0 -5
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +1 -14
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRefs.mjs +9 -16
- package/lib/composables/forwardRefs.mjs.map +1 -1
- package/lib/composables/group.mjs +10 -33
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs +0 -1
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/icons.mjs +4 -17
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs +1 -2
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs +0 -3
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/items.mjs +3 -15
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/layout.mjs +29 -31
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs +2 -3
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/loader.mjs +0 -3
- package/lib/composables/loader.mjs.map +1 -1
- package/lib/composables/locale.mjs +46 -118
- package/lib/composables/locale.mjs.map +1 -1
- package/lib/composables/location.mjs +1 -8
- package/lib/composables/location.mjs.map +1 -1
- package/lib/composables/mutationObserver.mjs +3 -1
- package/lib/composables/mutationObserver.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +4 -20
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs +0 -9
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs +6 -21
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/position.mjs +1 -4
- package/lib/composables/position.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +3 -9
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/refs.mjs +0 -2
- package/lib/composables/refs.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs +0 -3
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/rounded.mjs +0 -3
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +3 -11
- package/lib/composables/router.mjs.map +1 -1
- package/lib/composables/scopeId.mjs.map +1 -1
- package/lib/composables/scroll.mjs +3 -9
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/selectLink.mjs +3 -2
- package/lib/composables/selectLink.mjs.map +1 -1
- package/lib/composables/size.mjs +0 -3
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +2 -1
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +0 -6
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/tag.mjs +0 -1
- package/lib/composables/tag.mjs.map +1 -1
- package/lib/composables/teleport.mjs +0 -4
- package/lib/composables/teleport.mjs.map +1 -1
- package/lib/composables/theme.mjs +18 -38
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +0 -1
- package/lib/composables/toggleScope.mjs.map +1 -1
- package/lib/composables/touch.mjs +5 -28
- package/lib/composables/touch.mjs.map +1 -1
- package/lib/composables/transition.mjs +0 -2
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +3 -13
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +0 -2
- package/lib/composables/variant.mjs.map +1 -1
- package/lib/directives/click-outside/index.mjs +10 -22
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/color/index.mjs +0 -11
- package/lib/directives/color/index.mjs.map +1 -1
- package/lib/directives/index.d.ts +104 -13
- package/lib/directives/index.mjs +0 -1
- package/lib/directives/index.mjs.map +1 -1
- package/lib/directives/intersect/index.mjs +3 -10
- package/lib/directives/intersect/index.mjs.map +1 -1
- package/lib/directives/mutate/index.mjs +1 -5
- package/lib/directives/mutate/index.mjs.map +1 -1
- package/lib/directives/resize/index.mjs +0 -5
- package/lib/directives/resize/index.mjs.map +1 -1
- package/lib/directives/ripple/index.mjs +11 -63
- package/lib/directives/ripple/index.mjs.map +1 -1
- package/lib/directives/scroll/index.mjs +0 -4
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs +0 -15
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +24 -22
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa-svg.mjs +0 -1
- package/lib/iconsets/fa-svg.mjs.map +1 -1
- package/lib/iconsets/fa.mjs +0 -1
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.mjs +4 -3
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.mjs +4 -3
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.mjs +0 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.mjs +4 -3
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.ts +92 -106
- package/lib/locale/adapters/vue-i18n.d.ts +10 -16
- package/lib/locale/adapters/vue-i18n.mjs +59 -52
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/adapters/vuetify.d.ts +24 -0
- package/lib/locale/adapters/vuetify.mjs +97 -0
- package/lib/locale/adapters/vuetify.mjs.map +1 -0
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs.map +1 -1
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.d.ts +2 -2
- package/lib/locale/index.mjs +1 -1
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs +7 -7
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs +24 -24
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs +11 -15
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs +1 -8
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/main.css +4 -0
- package/lib/styles/settings/_utilities.scss +7 -0
- package/lib/util/anchor.mjs +0 -3
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/animation.mjs +0 -6
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/box.mjs +0 -5
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/color/APCA.mjs +23 -21
- package/lib/util/color/APCA.mjs.map +1 -1
- package/lib/util/color/transformCIELAB.mjs +0 -2
- package/lib/util/color/transformCIELAB.mjs.map +1 -1
- package/lib/util/color/transformSRGB.mjs +14 -12
- package/lib/util/color/transformSRGB.mjs.map +1 -1
- package/lib/util/colorUtils.mjs +8 -25
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/colors.mjs.map +1 -1
- package/lib/util/console.mjs +5 -14
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs +0 -3
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs +0 -10
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +6 -22
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/dom.mjs +4 -4
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/easing.mjs +0 -1
- package/lib/util/easing.mjs.map +1 -1
- package/lib/util/getCurrentInstance.mjs +1 -7
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/getScrollParent.mjs +0 -3
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +18 -75
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +0 -1
- package/lib/util/injectSelf.mjs.map +1 -1
- package/lib/util/isFixedPosition.mjs +0 -2
- package/lib/util/isFixedPosition.mjs.map +1 -1
- package/lib/util/propsFactory.mjs +11 -5
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs +0 -1
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +6 -10
- package/dist/json/attributes.json +0 -5602
- package/dist/json/tags.json +0 -1945
- package/dist/json/web-types.json +0 -19006
- package/lib/composables/rtl.mjs +0 -42
- package/lib/composables/rtl.mjs.map +0 -1
- package/lib/locale/adapters/vue-intl.d.ts +0 -42
- package/lib/locale/adapters/vue-intl.mjs +0 -65
- package/lib/locale/adapters/vue-intl.mjs.map +0 -1
package/lib/composables/form.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, inject, provide, ref, watch } from 'vue';
|
|
3
3
|
import { useProxiedModel } from "./proxiedModel.mjs";
|
|
4
4
|
import { consoleWarn, propsFactory } from "../util/index.mjs"; // Types
|
|
5
|
-
|
|
6
5
|
export const FormKey = Symbol.for('vuetify:form');
|
|
7
6
|
export const makeFormProps = propsFactory({
|
|
8
7
|
disabled: Boolean,
|
|
@@ -13,7 +12,7 @@ export const makeFormProps = propsFactory({
|
|
|
13
12
|
type: Boolean,
|
|
14
13
|
default: null
|
|
15
14
|
}
|
|
16
|
-
});
|
|
15
|
+
}, 'form');
|
|
17
16
|
export function createForm(props) {
|
|
18
17
|
const model = useProxiedModel(props, 'modelValue');
|
|
19
18
|
const isDisabled = computed(() => props.disabled);
|
|
@@ -21,16 +20,13 @@ export function createForm(props) {
|
|
|
21
20
|
const isValidating = ref(false);
|
|
22
21
|
const items = ref([]);
|
|
23
22
|
const errors = ref([]);
|
|
24
|
-
|
|
25
23
|
async function validate() {
|
|
26
24
|
const results = [];
|
|
27
25
|
let valid = true;
|
|
28
26
|
errors.value = [];
|
|
29
27
|
isValidating.value = true;
|
|
30
|
-
|
|
31
28
|
for (const item of items.value) {
|
|
32
29
|
const itemErrorMessages = await item.validate();
|
|
33
|
-
|
|
34
30
|
if (itemErrorMessages.length > 0) {
|
|
35
31
|
valid = false;
|
|
36
32
|
results.push({
|
|
@@ -38,10 +34,8 @@ export function createForm(props) {
|
|
|
38
34
|
errorMessages: itemErrorMessages
|
|
39
35
|
});
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
if (!valid && props.fastFail) break;
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
errors.value = results;
|
|
46
40
|
isValidating.value = false;
|
|
47
41
|
return {
|
|
@@ -49,23 +43,19 @@ export function createForm(props) {
|
|
|
49
43
|
errors: errors.value
|
|
50
44
|
};
|
|
51
45
|
}
|
|
52
|
-
|
|
53
46
|
function reset() {
|
|
54
47
|
items.value.forEach(item => item.reset());
|
|
55
48
|
model.value = null;
|
|
56
49
|
}
|
|
57
|
-
|
|
58
50
|
function resetValidation() {
|
|
59
51
|
items.value.forEach(item => item.resetValidation());
|
|
60
52
|
errors.value = [];
|
|
61
53
|
model.value = null;
|
|
62
54
|
}
|
|
63
|
-
|
|
64
55
|
watch(items, () => {
|
|
65
56
|
let valid = 0;
|
|
66
57
|
let invalid = 0;
|
|
67
58
|
const results = [];
|
|
68
|
-
|
|
69
59
|
for (const item of items.value) {
|
|
70
60
|
if (item.isValid === false) {
|
|
71
61
|
invalid++;
|
|
@@ -75,7 +65,6 @@ export function createForm(props) {
|
|
|
75
65
|
});
|
|
76
66
|
} else if (item.isValid === true) valid++;
|
|
77
67
|
}
|
|
78
|
-
|
|
79
68
|
errors.value = results;
|
|
80
69
|
model.value = invalid > 0 ? false : valid === items.value.length ? true : null;
|
|
81
70
|
}, {
|
|
@@ -89,11 +78,9 @@ export function createForm(props) {
|
|
|
89
78
|
reset,
|
|
90
79
|
resetValidation
|
|
91
80
|
} = _ref;
|
|
92
|
-
|
|
93
81
|
if (items.value.some(item => item.id === id)) {
|
|
94
82
|
consoleWarn(`Duplicate input name "${id}"`);
|
|
95
83
|
}
|
|
96
|
-
|
|
97
84
|
items.value.push({
|
|
98
85
|
id,
|
|
99
86
|
validate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","lazyValidation","readonly","modelValue","type","default","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n}\n\ninterface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\ninterface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\ninterface FormValidationResult {\n valid: boolean\n errors: FieldValidationResult[]\n}\n\nexport interface SubmitEventPromise extends SubmitEvent, Promise<FormValidationResult> {}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n lazyValidation: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n})\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errors = ref<FieldValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errors.value = []\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errors.value = results\n isValidating.value = false\n\n return { valid, errors: errors.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errors.value = []\n model.value = null\n }\n\n watch(items, () => {\n let valid = 0\n let invalid = 0\n const results = []\n\n for (const item of items.value) {\n if (item.isValid === false) {\n invalid++\n results.push({\n id: item.id,\n errorMessages: item.errorMessages,\n })\n } else if (item.isValid === true) valid++\n }\n\n errors.value = results\n model.value =\n invalid > 0 ? false\n : valid === items.value.length ? true\n : null\n }, { deep: true })\n\n provide(FormKey, {\n register: ({ id, validate, reset, resetValidation }) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n isValid: null,\n errorMessages: [],\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n update: (id, isValid, errorMessages) => {\n const found = items.value.find(item => item.id === id)\n\n if (!found) return\n\n found.isValid = isValid\n found.errorMessages = errorMessages\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n })\n\n return {\n errors,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"mappings":"AAAA;AACA,SAASA,
|
|
1
|
+
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","lazyValidation","readonly","modelValue","type","default","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n}\n\ninterface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\ninterface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\ninterface FormValidationResult {\n valid: boolean\n errors: FieldValidationResult[]\n}\n\nexport interface SubmitEventPromise extends SubmitEvent, Promise<FormValidationResult> {}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n lazyValidation: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n}, 'form')\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errors = ref<FieldValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errors.value = []\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errors.value = results\n isValidating.value = false\n\n return { valid, errors: errors.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errors.value = []\n model.value = null\n }\n\n watch(items, () => {\n let valid = 0\n let invalid = 0\n const results = []\n\n for (const item of items.value) {\n if (item.isValid === false) {\n invalid++\n results.push({\n id: item.id,\n errorMessages: item.errorMessages,\n })\n } else if (item.isValid === true) valid++\n }\n\n errors.value = results\n model.value =\n invalid > 0 ? false\n : valid === items.value.length ? true\n : null\n }, { deep: true })\n\n provide(FormKey, {\n register: ({ id, validate, reset, resetValidation }) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n isValid: null,\n errorMessages: [],\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n update: (id, isValid, errorMessages) => {\n const found = items.value.find(item => item.id === id)\n\n if (!found) return\n\n found.isValid = isValid\n found.errorMessages = errorMessages\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n })\n\n return {\n errors,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAClDC,eAAe;AAAA,SACfC,WAAW,EAAEC,YAAY,6BAElC;AAuCA,OAAO,MAAMC,OAAkC,GAAGC,MAAM,CAACC,GAAG,CAAC,cAAc,CAAC;AAW5E,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAAC;EACxCK,QAAQ,EAAEC,OAAO;EACjBC,QAAQ,EAAED,OAAO;EACjBE,cAAc,EAAEF,OAAO;EACvBG,QAAQ,EAAEH,OAAO;EACjBI,UAAU,EAAE;IACVC,IAAI,EAAEL,OAAmC;IACzCM,OAAO,EAAE;EACX;AACF,CAAC,EAAE,MAAM,CAAC;AAEV,OAAO,SAASC,UAAU,CAAEC,KAAgB,EAAE;EAC5C,MAAMC,KAAK,GAAGjB,eAAe,CAACgB,KAAK,EAAE,YAAY,CAAC;EAElD,MAAME,UAAU,GAAGvB,QAAQ,CAAC,MAAMqB,KAAK,CAACT,QAAQ,CAAC;EACjD,MAAMY,UAAU,GAAGxB,QAAQ,CAAC,MAAMqB,KAAK,CAACL,QAAQ,CAAC;EACjD,MAAMS,YAAY,GAAGtB,GAAG,CAA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KAAKA,EAAE;MACvB,CAAC,CAAC;IACJ,CAAC;IACDY,MAAM,EAAE,CAACZ,EAAE,EAAEM,OAAO,EAAEL,aAAa,KAAK;MACtC,MAAMY,KAAK,GAAGvB,KAAK,CAACK,KAAK,CAACmB,IAAI,CAAClB,IAAI,IAAIA,IAAI,CAACI,EAAE,KAAKA,EAAE,CAAC;MAEtD,IAAI,CAACa,KAAK,EAAE;MAEZA,KAAK,CAACP,OAAO,GAAGA,OAAO;MACvBO,KAAK,CAACZ,aAAa,GAAGA,aAAa;IACrC,CAAC;IACDd,UAAU;IACVC,UAAU;IACVC,YAAY;IACZC;EACF,CAAC,CAAC;EAEF,OAAO;IACLC,MAAM;IACNJ,UAAU;IACVC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLE,QAAQ;IACRU,KAAK;IACLE;EACF,CAAC;AACH;AAEA,OAAO,SAASW,OAAO,GAAI;EACzB,OAAOlD,MAAM,CAACO,OAAO,EAAE,IAAI,CAAC;AAC9B"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
const Refs = Symbol('Forwarded refs');
|
|
2
|
+
|
|
2
3
|
/** Omit properties starting with P */
|
|
3
4
|
|
|
4
5
|
export function forwardRefs(target) {
|
|
5
6
|
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
6
7
|
refs[_key - 1] = arguments[_key];
|
|
7
8
|
}
|
|
8
|
-
|
|
9
9
|
target[Refs] = refs;
|
|
10
10
|
return new Proxy(target, {
|
|
11
11
|
get(target, key) {
|
|
12
12
|
if (Reflect.has(target, key)) {
|
|
13
13
|
return Reflect.get(target, key);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
15
|
for (const ref of refs) {
|
|
17
16
|
if (ref.value && Reflect.has(ref.value, key)) {
|
|
18
17
|
const val = Reflect.get(ref.value, key);
|
|
@@ -20,41 +19,37 @@ export function forwardRefs(target) {
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
},
|
|
23
|
-
|
|
24
22
|
getOwnPropertyDescriptor(target, key) {
|
|
25
23
|
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
|
|
26
|
-
if (descriptor) return descriptor;
|
|
24
|
+
if (descriptor) return descriptor;
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
// Skip internal properties
|
|
27
|
+
if (typeof key === 'symbol' || key.startsWith('__')) return;
|
|
29
28
|
|
|
29
|
+
// Check each ref's own properties
|
|
30
30
|
for (const ref of refs) {
|
|
31
31
|
if (!ref.value) continue;
|
|
32
32
|
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
|
|
33
33
|
if (descriptor) return descriptor;
|
|
34
|
-
|
|
35
34
|
if ('_' in ref.value && 'setupState' in ref.value._) {
|
|
36
35
|
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
|
|
37
36
|
if (descriptor) return descriptor;
|
|
38
37
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}
|
|
39
|
+
// Recursive search up each ref's prototype
|
|
42
40
|
for (const ref of refs) {
|
|
43
41
|
let obj = ref.value && Object.getPrototypeOf(ref.value);
|
|
44
|
-
|
|
45
42
|
while (obj) {
|
|
46
43
|
const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
|
|
47
44
|
if (descriptor) return descriptor;
|
|
48
45
|
obj = Object.getPrototypeOf(obj);
|
|
49
46
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
}
|
|
48
|
+
// Call forwarded refs' proxies
|
|
53
49
|
for (const ref of refs) {
|
|
54
50
|
const childRefs = ref.value && ref.value[Refs];
|
|
55
51
|
if (!childRefs) continue;
|
|
56
52
|
const queue = childRefs.slice();
|
|
57
|
-
|
|
58
53
|
while (queue.length) {
|
|
59
54
|
const ref = queue.shift();
|
|
60
55
|
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
|
|
@@ -63,10 +58,8 @@ export function forwardRefs(target) {
|
|
|
63
58
|
if (childRefs) queue.push(...childRefs);
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
|
|
67
61
|
return undefined;
|
|
68
62
|
}
|
|
69
|
-
|
|
70
63
|
});
|
|
71
64
|
}
|
|
72
65
|
//# sourceMappingURL=forwardRefs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forwardRefs.mjs","names":["Refs","Symbol","forwardRefs","target","refs","Proxy","get","key","Reflect","has","ref","value","val","bind","getOwnPropertyDescriptor","descriptor","startsWith","_","setupState","obj","Object","getPrototypeOf","childRefs","queue","slice","length","shift","push","undefined"],"sources":["../../src/composables/forwardRefs.ts"],"sourcesContent":["import type { ComponentPublicInstance, Ref, UnwrapRef } from 'vue'\nimport type { UnionToIntersection } from '@/util'\n\nconst Refs = Symbol('Forwarded refs')\n\n/** Omit properties starting with P */\ntype OmitPrefix<T, P extends string> =
|
|
1
|
+
{"version":3,"file":"forwardRefs.mjs","names":["Refs","Symbol","forwardRefs","target","refs","Proxy","get","key","Reflect","has","ref","value","val","bind","getOwnPropertyDescriptor","descriptor","startsWith","_","setupState","obj","Object","getPrototypeOf","childRefs","queue","slice","length","shift","push","undefined"],"sources":["../../src/composables/forwardRefs.ts"],"sourcesContent":["import type { ComponentPublicInstance, Ref, UnwrapRef } from 'vue'\nimport type { UnionToIntersection } from '@/util'\n\nconst Refs = Symbol('Forwarded refs')\n\n/** Omit properties starting with P */\ntype OmitPrefix<T, P extends string> = [Extract<keyof T, `${P}${any}`>] extends [never] ? T : Omit<T, `${P}${any}`>\n\ntype OmitProps<T> = T extends { $props: any } ? Omit<T, keyof T['$props']> : never\n\nexport function forwardRefs<T extends {}, U extends Ref<HTMLElement | Omit<ComponentPublicInstance, '$emit'> | undefined>[]> (\n target: T,\n ...refs: U\n): T & UnionToIntersection<{ [K in keyof U]: OmitPrefix<OmitProps<NonNullable<UnwrapRef<U[K]>>>, '$'> }[number]> {\n (target as any)[Refs] = refs\n\n return new Proxy(target, {\n get (target, key) {\n if (Reflect.has(target, key)) {\n return Reflect.get(target, key)\n }\n for (const ref of refs) {\n if (ref.value && Reflect.has(ref.value, key)) {\n const val = Reflect.get(ref.value, key)\n return typeof val === 'function'\n ? val.bind(ref.value)\n : val\n }\n }\n },\n getOwnPropertyDescriptor (target, key) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, key)\n if (descriptor) return descriptor\n\n // Skip internal properties\n if (typeof key === 'symbol' || key.startsWith('__')) return\n\n // Check each ref's own properties\n for (const ref of refs) {\n if (!ref.value) continue\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)\n if (descriptor) return descriptor\n if ('_' in ref.value && 'setupState' in ref.value._) {\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key)\n if (descriptor) return descriptor\n }\n }\n // Recursive search up each ref's prototype\n for (const ref of refs) {\n let obj = ref.value && Object.getPrototypeOf(ref.value)\n while (obj) {\n const descriptor = Reflect.getOwnPropertyDescriptor(obj, key)\n if (descriptor) return descriptor\n obj = Object.getPrototypeOf(obj)\n }\n }\n // Call forwarded refs' proxies\n for (const ref of refs) {\n const childRefs = ref.value && (ref.value as any)[Refs]\n if (!childRefs) continue\n const queue = childRefs.slice()\n while (queue.length) {\n const ref = queue.shift()\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)\n if (descriptor) return descriptor\n const childRefs = ref.value && (ref.value as any)[Refs]\n if (childRefs) queue.push(...childRefs)\n }\n }\n return undefined\n },\n }) as any\n}\n"],"mappings":"AAGA,MAAMA,IAAI,GAAGC,MAAM,CAAC,gBAAgB,CAAC;;AAErC;;AAKA,OAAO,SAASC,WAAW,CACzBC,MAAS,EAEsG;EAAA,kCAD5GC,IAAI;IAAJA,IAAI;EAAA;EAEND,MAAM,CAASH,IAAI,CAAC,GAAGI,IAAI;EAE5B,OAAO,IAAIC,KAAK,CAACF,MAAM,EAAE;IACvBG,GAAG,CAAEH,MAAM,EAAEI,GAAG,EAA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AE,OAAOA,UAAU;QACnC;MACF;MACA;MACA,KAAK,MAAML,GAAG,IAAIN,IAAI,EAAE;QACtB,IAAIe,GAAG,GAAGT,GAAG,CAACC,KAAK,IAAIS,MAAM,CAACC,cAAc,CAACX,GAAG,CAACC,KAAK,CAAC;QACvD,OAAOQ,GAAG,EAAE;UACV,MAAMJ,UAAU,GAAGP,OAAO,CAACM,wBAAwB,CAACK,GAAG,EAAEZ,GAAG,CAAC;UAC7D,IAAIQ,UAAU,EAAE,OAAOA,UAAU;UACjCI,GAAG,GAAGC,MAAM,CAACC,cAAc,CAACF,GAAG,CAAC;QAClC;MACF;MACA;MACA,KAAK,MAAMT,GAAG,IAAIN,IAAI,EAAE;QACtB,MAAMkB,SAAS,GAAGZ,GAAG,CAACC,KAAK,IAAKD,GAAG,CAACC,KAAK,CAASX,IAAI,CAAC;QACvD,IAAI,CAACsB,SAAS,EAAE;QAChB,MAAMC,KAAK,GAAGD,SAAS,CAACE,KAAK,EAAE;QAC/B,OAAOD,KAAK,CAACE,MAAM,EAAE;UACnB,MAAMf,GAAG,GAAGa,KAAK,CAACG,KAAK,EAAE;UACzB,MAAMX,UAAU,GAAGP,OAAO,CAACM,wBAAwB,CAACJ,GAAG,CAACC,KAAK,EAAEJ,GAAG,CAAC;UACnE,IAAIQ,UAAU,EAAE,OAAOA,UAAU;UACjC,MAAMO,SAAS,GAAGZ,GAAG,CAACC,KAAK,IAAKD,GAAG,CAACC,KAAK,CAASX,IAAI,CAAC;UACvD,IAAIsB,SAAS,EAAEC,KAAK,CAACI,IAAI,CAAC,GAAGL,SAAS,CAAC;QACzC;MACF;MACA,OAAOM,SAAS;IAClB;EACF,CAAC,CAAC;AACJ"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Composables
|
|
2
2
|
import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
|
|
3
|
-
|
|
4
3
|
import { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue';
|
|
5
4
|
import { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
|
|
6
|
-
|
|
7
5
|
export const makeGroupProps = propsFactory({
|
|
8
6
|
modelValue: {
|
|
9
7
|
type: null,
|
|
@@ -23,20 +21,16 @@ export const makeGroupItemProps = propsFactory({
|
|
|
23
21
|
export function useGroupItem(props, injectKey) {
|
|
24
22
|
let required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
25
23
|
const vm = getCurrentInstance('useGroupItem');
|
|
26
|
-
|
|
27
24
|
if (!vm) {
|
|
28
25
|
throw new Error('[Vuetify] useGroupItem composable must be used inside a component setup function');
|
|
29
26
|
}
|
|
30
|
-
|
|
31
27
|
const id = getUid();
|
|
32
28
|
provide(Symbol.for(`${injectKey.description}:id`), id);
|
|
33
29
|
const group = inject(injectKey, null);
|
|
34
|
-
|
|
35
30
|
if (!group) {
|
|
36
31
|
if (!required) return group;
|
|
37
32
|
throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`);
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
const value = toRef(props, 'value');
|
|
41
35
|
const disabled = computed(() => group.disabled.value || props.disabled);
|
|
42
36
|
group.register({
|
|
@@ -78,62 +72,59 @@ export function useGroup(props, injectKey) {
|
|
|
78
72
|
return props.multiple ? arr : arr[0];
|
|
79
73
|
});
|
|
80
74
|
const groupVm = getCurrentInstance('useGroup');
|
|
81
|
-
|
|
82
75
|
function register(item, vm) {
|
|
83
76
|
// Is there a better way to fix this typing?
|
|
84
77
|
const unwrapped = item;
|
|
85
78
|
const key = Symbol.for(`${injectKey.description}:id`);
|
|
86
79
|
const children = findChildrenWithProvide(key, groupVm == null ? void 0 : groupVm.vnode);
|
|
87
80
|
const index = children.indexOf(vm);
|
|
88
|
-
|
|
89
81
|
if (index > -1) {
|
|
90
82
|
items.splice(index, 0, unwrapped);
|
|
91
83
|
} else {
|
|
92
84
|
items.push(unwrapped);
|
|
93
85
|
}
|
|
94
86
|
}
|
|
95
|
-
|
|
96
87
|
function unregister(id) {
|
|
97
|
-
if (isUnmounted) return;
|
|
88
|
+
if (isUnmounted) return;
|
|
89
|
+
|
|
90
|
+
// TODO: re-evaluate this line's importance in the future
|
|
98
91
|
// should we only modify the model if mandatory is set.
|
|
99
92
|
// selected.value = selected.value.filter(v => v !== id)
|
|
100
93
|
|
|
101
94
|
forceMandatoryValue();
|
|
102
95
|
const index = items.findIndex(item => item.id === id);
|
|
103
96
|
items.splice(index, 1);
|
|
104
|
-
}
|
|
105
|
-
|
|
97
|
+
}
|
|
106
98
|
|
|
99
|
+
// If mandatory and nothing is selected, then select first non-disabled item
|
|
107
100
|
function forceMandatoryValue() {
|
|
108
101
|
const item = items.find(item => !item.disabled);
|
|
109
|
-
|
|
110
102
|
if (item && props.mandatory === 'force' && !selected.value.length) {
|
|
111
103
|
selected.value = [item.id];
|
|
112
104
|
}
|
|
113
105
|
}
|
|
114
|
-
|
|
115
106
|
onMounted(() => {
|
|
116
107
|
forceMandatoryValue();
|
|
117
108
|
});
|
|
118
109
|
onBeforeUnmount(() => {
|
|
119
110
|
isUnmounted = true;
|
|
120
111
|
});
|
|
121
|
-
|
|
122
112
|
function select(id, value) {
|
|
123
113
|
const item = items.find(item => item.id === id);
|
|
124
114
|
if (value && item != null && item.disabled) return;
|
|
125
|
-
|
|
126
115
|
if (props.multiple) {
|
|
127
116
|
const internalValue = selected.value.slice();
|
|
128
117
|
const index = internalValue.findIndex(v => v === id);
|
|
129
118
|
const isSelected = ~index;
|
|
130
|
-
value = value ?? !isSelected;
|
|
119
|
+
value = value ?? !isSelected;
|
|
120
|
+
|
|
121
|
+
// We can't remove value if group is
|
|
131
122
|
// mandatory, value already exists,
|
|
132
123
|
// and it is the only value
|
|
124
|
+
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
133
125
|
|
|
134
|
-
|
|
126
|
+
// We can't add value if it would
|
|
135
127
|
// cause max limit to be exceeded
|
|
136
|
-
|
|
137
128
|
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
138
129
|
if (index < 0 && value) internalValue.push(id);else if (index >= 0 && !value) internalValue.splice(index, 1);
|
|
139
130
|
selected.value = internalValue;
|
|
@@ -143,11 +134,9 @@ export function useGroup(props, injectKey) {
|
|
|
143
134
|
selected.value = value ?? !isSelected ? [id] : [];
|
|
144
135
|
}
|
|
145
136
|
}
|
|
146
|
-
|
|
147
137
|
function step(offset) {
|
|
148
138
|
// getting an offset from selected value obviously won't work with multiple values
|
|
149
139
|
if (props.multiple) consoleWarn('This method is not supported when using "multiple" prop');
|
|
150
|
-
|
|
151
140
|
if (!selected.value.length) {
|
|
152
141
|
const item = items.find(item => !item.disabled);
|
|
153
142
|
item && (selected.value = [item.id]);
|
|
@@ -156,17 +145,14 @@ export function useGroup(props, injectKey) {
|
|
|
156
145
|
const currentIndex = items.findIndex(i => i.id === currentId);
|
|
157
146
|
let newIndex = (currentIndex + offset) % items.length;
|
|
158
147
|
let newItem = items[newIndex];
|
|
159
|
-
|
|
160
148
|
while (newItem.disabled && newIndex !== currentIndex) {
|
|
161
149
|
newIndex = (newIndex + offset) % items.length;
|
|
162
150
|
newItem = items[newIndex];
|
|
163
151
|
}
|
|
164
|
-
|
|
165
152
|
if (newItem.disabled) return;
|
|
166
153
|
selected.value = [items[newIndex].id];
|
|
167
154
|
}
|
|
168
155
|
}
|
|
169
|
-
|
|
170
156
|
const state = {
|
|
171
157
|
register,
|
|
172
158
|
unregister,
|
|
@@ -183,19 +169,15 @@ export function useGroup(props, injectKey) {
|
|
|
183
169
|
provide(injectKey, state);
|
|
184
170
|
return state;
|
|
185
171
|
}
|
|
186
|
-
|
|
187
172
|
function getItemIndex(items, value) {
|
|
188
173
|
const ids = getIds(items, [value]);
|
|
189
174
|
if (!ids.length) return -1;
|
|
190
175
|
return items.findIndex(item => item.id === ids[0]);
|
|
191
176
|
}
|
|
192
|
-
|
|
193
177
|
function getIds(items, modelValue) {
|
|
194
178
|
const ids = [];
|
|
195
|
-
|
|
196
179
|
for (let i = 0; i < items.length; i++) {
|
|
197
180
|
const item = items[i];
|
|
198
|
-
|
|
199
181
|
if (item.value != null) {
|
|
200
182
|
if (modelValue.find(value => deepEqual(value, item.value)) != null) {
|
|
201
183
|
ids.push(item.id);
|
|
@@ -204,21 +186,16 @@ function getIds(items, modelValue) {
|
|
|
204
186
|
ids.push(item.id);
|
|
205
187
|
}
|
|
206
188
|
}
|
|
207
|
-
|
|
208
189
|
return ids;
|
|
209
190
|
}
|
|
210
|
-
|
|
211
191
|
function getValues(items, ids) {
|
|
212
192
|
const values = [];
|
|
213
|
-
|
|
214
193
|
for (let i = 0; i < items.length; i++) {
|
|
215
194
|
const item = items[i];
|
|
216
|
-
|
|
217
195
|
if (ids.includes(item.id)) {
|
|
218
196
|
values.push(item.value != null ? item.value : i);
|
|
219
197
|
}
|
|
220
198
|
}
|
|
221
|
-
|
|
222
199
|
return values;
|
|
223
200
|
}
|
|
224
201
|
//# sourceMappingURL=group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.mjs","names":["useProxiedModel","computed","inject","onBeforeUnmount","onMounted","provide","reactive","toRef","watch","consoleWarn","deepEqual","findChildrenWithProvide","getCurrentInstance","getUid","propsFactory","wrapInArray","makeGroupProps","modelValue","type","default","undefined","multiple","Boolean","mandatory","String","max","Number","selectedClass","disabled","makeGroupItemProps","value","useGroupItem","props","injectKey","required","vm","Error","id","Symbol","for","description","group","register","unregister","isSelected","emit","toggle","select","useGroup","isUnmounted","items","selected","v","getIds","arr","getValues","groupVm","item","unwrapped","key","children","vnode","index","indexOf","splice","push","forceMandatoryValue","findIndex","find","length","internalValue","slice","includes","step","offset","currentId","currentIndex","i","newIndex","newItem","state","prev","next","getItemIndex","ids","values"],"sources":["../../src/composables/group.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from './proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue'\nimport { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { ComponentInternalInstance, ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref, UnwrapRef } from 'vue'\n\nexport interface GroupItem {\n id: number\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n}\n\nexport interface GroupProps {\n disabled: boolean\n modelValue: unknown\n multiple?: boolean\n mandatory?: boolean | 'force' | undefined\n max?: number | undefined\n selectedClass: string | undefined\n 'onUpdate:modelValue': ((val: unknown) => void) | undefined\n}\n\nexport interface GroupProvide {\n register: (item: GroupItem, cmp: ComponentInternalInstance) => void\n unregister: (id: number) => void\n select: (id: number, value: boolean) => void\n selected: Ref<Readonly<number[]>>\n isSelected: (id: number) => boolean\n prev: () => void\n next: () => void\n selectedClass: Ref<string | undefined>\n items: ComputedRef<{\n id: number\n value: unknown\n disabled: boolean | undefined\n }[]>\n disabled: Ref<boolean | undefined>\n getItemIndex: (value: unknown) => number\n}\n\nexport interface GroupItemProvide {\n id: number\n isSelected: Ref<boolean>\n toggle: () => void\n select: (value: boolean) => void\n selectedClass: Ref<(string | undefined)[] | false>\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n group: GroupProvide\n}\n\nexport const makeGroupProps = propsFactory({\n modelValue: {\n type: null,\n default: undefined,\n },\n multiple: Boolean,\n mandatory: [Boolean, String] as PropType<boolean | 'force'>,\n max: Number,\n selectedClass: String,\n disabled: Boolean,\n}, 'group')\n\nexport const makeGroupItemProps = propsFactory({\n value: null,\n disabled: Boolean,\n selectedClass: String,\n}, 'group-item')\n\nexport interface GroupItemProps extends ExtractPropTypes<ReturnType<typeof makeGroupItemProps>> {\n 'onGroup:selected': ((val: { value: boolean }) => void) | undefined\n}\n\n// Composables\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required?: true,\n): GroupItemProvide\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required: false,\n): GroupItemProvide | null\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required = true,\n): GroupItemProvide | null {\n const vm = getCurrentInstance('useGroupItem')\n\n if (!vm) {\n throw new Error(\n '[Vuetify] useGroupItem composable must be used inside a component setup function'\n )\n }\n\n const id = getUid()\n\n provide(Symbol.for(`${injectKey.description}:id`), id)\n\n const group = inject(injectKey, null)\n\n if (!group) {\n if (!required) return group\n\n throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`)\n }\n\n const value = toRef(props, 'value')\n const disabled = computed(() => group.disabled.value || props.disabled)\n\n group.register({\n id,\n value,\n disabled,\n }, vm)\n\n onBeforeUnmount(() => {\n group.unregister(id)\n })\n\n const isSelected = computed(() => {\n return group.isSelected(id)\n })\n\n const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass])\n\n watch(isSelected, value => {\n vm.emit('group:selected', { value })\n })\n\n return {\n id,\n isSelected,\n toggle: () => group.select(id, !isSelected.value),\n select: (value: boolean) => group.select(id, value),\n selectedClass,\n value,\n disabled,\n group,\n }\n}\n\nexport function useGroup (\n props: GroupProps,\n injectKey: InjectionKey<GroupProvide>\n) {\n let isUnmounted = false\n const items = reactive<GroupItem[]>([])\n const selected = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => {\n if (v == null) return []\n\n return getIds(items, wrapInArray(v))\n },\n v => {\n const arr = getValues(items, v)\n\n return props.multiple ? arr : arr[0]\n }\n )\n\n const groupVm = getCurrentInstance('useGroup')\n\n function register (item: GroupItem, vm: ComponentInternalInstance) {\n // Is there a better way to fix this typing?\n const unwrapped = item as unknown as UnwrapRef<GroupItem>\n\n const key = Symbol.for(`${injectKey.description}:id`)\n const children = findChildrenWithProvide(key, groupVm?.vnode)\n const index = children.indexOf(vm)\n\n if (index > -1) {\n items.splice(index, 0, unwrapped)\n } else {\n items.push(unwrapped)\n }\n }\n\n function unregister (id: number) {\n if (isUnmounted) return\n\n // TODO: re-evaluate this line's importance in the future\n // should we only modify the model if mandatory is set.\n // selected.value = selected.value.filter(v => v !== id)\n\n forceMandatoryValue()\n\n const index = items.findIndex(item => item.id === id)\n items.splice(index, 1)\n }\n\n // If mandatory and nothing is selected, then select first non-disabled item\n function forceMandatoryValue () {\n const item = items.find(item => !item.disabled)\n if (item && props.mandatory === 'force' && !selected.value.length) {\n selected.value = [item.id]\n }\n }\n\n onMounted(() => {\n forceMandatoryValue()\n })\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function select (id: number, value?: boolean) {\n const item = items.find(item => item.id === id)\n if (value && item?.disabled) return\n\n if (props.multiple) {\n const internalValue = selected.value.slice()\n const index = internalValue.findIndex(v => v === id)\n const isSelected = ~index\n value = value ?? !isSelected\n\n // We can't remove value if group is\n // mandatory, value already exists,\n // and it is the only value\n if (\n isSelected &&\n props.mandatory &&\n internalValue.length <= 1\n ) return\n\n // We can't add value if it would\n // cause max limit to be exceeded\n if (\n !isSelected &&\n props.max != null &&\n internalValue.length + 1 > props.max\n ) return\n\n if (index < 0 && value) internalValue.push(id)\n else if (index >= 0 && !value) internalValue.splice(index, 1)\n\n selected.value = internalValue\n } else {\n const isSelected = selected.value.includes(id)\n if (props.mandatory && isSelected) return\n\n selected.value = (value ?? !isSelected) ? [id] : []\n }\n }\n\n function step (offset: number) {\n // getting an offset from selected value obviously won't work with multiple values\n if (props.multiple) consoleWarn('This method is not supported when using \"multiple\" prop')\n\n if (!selected.value.length) {\n const item = items.find(item => !item.disabled)\n item && (selected.value = [item.id])\n } else {\n const currentId = selected.value[0]\n const currentIndex = items.findIndex(i => i.id === currentId)\n\n let newIndex = (currentIndex + offset) % items.length\n let newItem = items[newIndex]\n\n while (newItem.disabled && newIndex !== currentIndex) {\n newIndex = (newIndex + offset) % items.length\n newItem = items[newIndex]\n }\n\n if (newItem.disabled) return\n\n selected.value = [items[newIndex].id]\n }\n }\n\n const state: GroupProvide = {\n register,\n unregister,\n selected,\n select,\n disabled: toRef(props, 'disabled'),\n prev: () => step(items.length - 1),\n next: () => step(1),\n isSelected: (id: number) => selected.value.includes(id),\n selectedClass: computed(() => props.selectedClass),\n items: computed(() => items),\n getItemIndex: (value: unknown) => getItemIndex(items, value),\n }\n\n provide(injectKey, state)\n\n return state\n}\n\nfunction getItemIndex (items: UnwrapRef<GroupItem[]>, value: unknown) {\n const ids = getIds(items, [value])\n\n if (!ids.length) return -1\n\n return items.findIndex(item => item.id === ids[0])\n}\n\nfunction getIds (items: UnwrapRef<GroupItem[]>, modelValue: any[]) {\n const ids = []\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n\n if (item.value != null) {\n if (modelValue.find(value => deepEqual(value, item.value)) != null) {\n ids.push(item.id)\n }\n } else if (modelValue.includes(i)) {\n ids.push(item.id)\n }\n }\n\n return ids\n}\n\nfunction getValues (items: UnwrapRef<GroupItem[]>, ids: any[]) {\n const values = []\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n\n if (ids.includes(item.id)) {\n values.push(item.value != null ? item.value : i)\n }\n }\n\n return values\n}\n"],"mappings":"AAAA;SACSA,e,8BAET;;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,eAA3B,EAA4CC,SAA5C,EAAuDC,OAAvD,EAAgEC,QAAhE,EAA0EC,KAA1E,EAAiFC,KAAjF,QAA8F,KAA9F;SACSC,W,EAAaC,S,EAAWC,uB,EAAyBC,kB,EAAoBC,M,EAAQC,Y,EAAcC,W,6BAEpG;;AAgDA,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;EACzCG,UAAU,EAAE;IACVC,IAAI,EAAE,IADI;IAEVC,OAAO,EAAEC;EAFC,CAD6B;EAKzCC,QAAQ,EAAEC,OAL+B;EAMzCC,SAAS,EAAE,CAACD,OAAD,EAAUE,MAAV,CAN8B;EAOzCC,GAAG,EAAEC,MAPoC;EAQzCC,aAAa,EAAEH,MAR0B;EASzCI,QAAQ,EA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AAwB;MACtB,IAAIb,UAAU,CAACmD,IAAX,CAAgBtC,KAAK,IAAIpB,SAAS,CAACoB,KAAD,EAAQ2B,IAAI,CAAC3B,KAAb,CAAlC,KAA0D,IAA9D,EAAoE;QAClEsD,GAAG,CAACnB,IAAJ,CAASR,IAAI,CAACpB,EAAd;MACD;IACF,CAJD,MAIO,IAAIpB,UAAU,CAACuD,QAAX,CAAoBK,CAApB,CAAJ,EAA4B;MACjCO,GAAG,CAACnB,IAAJ,CAASR,IAAI,CAACpB,EAAd;IACD;EACF;;EAED,OAAO+C,GAAP;AACD;;AAED,SAAS7B,SAAT,CAAoBL,KAApB,EAAmDkC,GAAnD,EAA+D;EAC7D,MAAMC,MAAM,GAAG,EAAf;;EAEA,KAAK,IAAIR,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG3B,KAAK,CAACmB,MAA1B,EAAkCQ,CAAC,EAAnC,EAAuC;IACrC,MAAMpB,IAAI,GAAGP,KAAK,CAAC2B,CAAD,CAAlB;;IAEA,IAAIO,GAAG,CAACZ,QAAJ,CAAaf,IAAI,CAACpB,EAAlB,CAAJ,EAA2B;MACzBgD,MAAM,CAACpB,IAAP,CAAYR,IAAI,CAAC3B,KAAL,IAAc,IAAd,GAAqB2B,IAAI,CAAC3B,KAA1B,GAAkC+C,CAA9C;IACD;EACF;;EAED,OAAOQ,MAAP;AACD"}
|
|
1
|
+
{"version":3,"file":"group.mjs","names":["useProxiedModel","computed","inject","onBeforeUnmount","onMounted","provide","reactive","toRef","watch","consoleWarn","deepEqual","findChildrenWithProvide","getCurrentInstance","getUid","propsFactory","wrapInArray","makeGroupProps","modelValue","type","default","undefined","multiple","Boolean","mandatory","String","max","Number","selectedClass","disabled","makeGroupItemProps","value","useGroupItem","props","injectKey","required","vm","Error","id","Symbol","for","description","group","register","unregister","isSelected","emit","toggle","select","useGroup","isUnmounted","items","selected","v","getIds","arr","getValues","groupVm","item","unwrapped","key","children","vnode","index","indexOf","splice","push","forceMandatoryValue","findIndex","find","length","internalValue","slice","includes","step","offset","currentId","currentIndex","i","newIndex","newItem","state","prev","next","getItemIndex","ids","values"],"sources":["../../src/composables/group.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from './proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue'\nimport { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { ComponentInternalInstance, ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref, UnwrapRef } from 'vue'\n\nexport interface GroupItem {\n id: number\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n}\n\nexport interface GroupProps {\n disabled: boolean\n modelValue: unknown\n multiple?: boolean\n mandatory?: boolean | 'force' | undefined\n max?: number | undefined\n selectedClass: string | undefined\n 'onUpdate:modelValue': ((val: unknown) => void) | undefined\n}\n\nexport interface GroupProvide {\n register: (item: GroupItem, cmp: ComponentInternalInstance) => void\n unregister: (id: number) => void\n select: (id: number, value: boolean) => void\n selected: Ref<Readonly<number[]>>\n isSelected: (id: number) => boolean\n prev: () => void\n next: () => void\n selectedClass: Ref<string | undefined>\n items: ComputedRef<{\n id: number\n value: unknown\n disabled: boolean | undefined\n }[]>\n disabled: Ref<boolean | undefined>\n getItemIndex: (value: unknown) => number\n}\n\nexport interface GroupItemProvide {\n id: number\n isSelected: Ref<boolean>\n toggle: () => void\n select: (value: boolean) => void\n selectedClass: Ref<(string | undefined)[] | false>\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n group: GroupProvide\n}\n\nexport const makeGroupProps = propsFactory({\n modelValue: {\n type: null,\n default: undefined,\n },\n multiple: Boolean,\n mandatory: [Boolean, String] as PropType<boolean | 'force'>,\n max: Number,\n selectedClass: String,\n disabled: Boolean,\n}, 'group')\n\nexport const makeGroupItemProps = propsFactory({\n value: null,\n disabled: Boolean,\n selectedClass: String,\n}, 'group-item')\n\nexport interface GroupItemProps extends ExtractPropTypes<ReturnType<typeof makeGroupItemProps>> {\n 'onGroup:selected': ((val: { value: boolean }) => void) | undefined\n}\n\n// Composables\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required?: true,\n): GroupItemProvide\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required: false,\n): GroupItemProvide | null\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required = true,\n): GroupItemProvide | null {\n const vm = getCurrentInstance('useGroupItem')\n\n if (!vm) {\n throw new Error(\n '[Vuetify] useGroupItem composable must be used inside a component setup function'\n )\n }\n\n const id = getUid()\n\n provide(Symbol.for(`${injectKey.description}:id`), id)\n\n const group = inject(injectKey, null)\n\n if (!group) {\n if (!required) return group\n\n throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`)\n }\n\n const value = toRef(props, 'value')\n const disabled = computed(() => group.disabled.value || props.disabled)\n\n group.register({\n id,\n value,\n disabled,\n }, vm)\n\n onBeforeUnmount(() => {\n group.unregister(id)\n })\n\n const isSelected = computed(() => {\n return group.isSelected(id)\n })\n\n const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass])\n\n watch(isSelected, value => {\n vm.emit('group:selected', { value })\n })\n\n return {\n id,\n isSelected,\n toggle: () => group.select(id, !isSelected.value),\n select: (value: boolean) => group.select(id, value),\n selectedClass,\n value,\n disabled,\n group,\n }\n}\n\nexport function useGroup (\n props: GroupProps,\n injectKey: InjectionKey<GroupProvide>\n) {\n let isUnmounted = false\n const items = reactive<GroupItem[]>([])\n const selected = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => {\n if (v == null) return []\n\n return getIds(items, wrapInArray(v))\n },\n v => {\n const arr = getValues(items, v)\n\n return props.multiple ? arr : arr[0]\n }\n )\n\n const groupVm = getCurrentInstance('useGroup')\n\n function register (item: GroupItem, vm: ComponentInternalInstance) {\n // Is there a better way to fix this typing?\n const unwrapped = item as unknown as UnwrapRef<GroupItem>\n\n const key = Symbol.for(`${injectKey.description}:id`)\n const children = findChildrenWithProvide(key, groupVm?.vnode)\n const index = children.indexOf(vm)\n\n if (index > -1) {\n items.splice(index, 0, unwrapped)\n } else {\n items.push(unwrapped)\n }\n }\n\n function unregister (id: number) {\n if (isUnmounted) return\n\n // TODO: re-evaluate this line's importance in the future\n // should we only modify the model if mandatory is set.\n // selected.value = selected.value.filter(v => v !== id)\n\n forceMandatoryValue()\n\n const index = items.findIndex(item => item.id === id)\n items.splice(index, 1)\n }\n\n // If mandatory and nothing is selected, then select first non-disabled item\n function forceMandatoryValue () {\n const item = items.find(item => !item.disabled)\n if (item && props.mandatory === 'force' && !selected.value.length) {\n selected.value = [item.id]\n }\n }\n\n onMounted(() => {\n forceMandatoryValue()\n })\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function select (id: number, value?: boolean) {\n const item = items.find(item => item.id === id)\n if (value && item?.disabled) return\n\n if (props.multiple) {\n const internalValue = selected.value.slice()\n const index = internalValue.findIndex(v => v === id)\n const isSelected = ~index\n value = value ?? !isSelected\n\n // We can't remove value if group is\n // mandatory, value already exists,\n // and it is the only value\n if (\n isSelected &&\n props.mandatory &&\n internalValue.length <= 1\n ) return\n\n // We can't add value if it would\n // cause max limit to be exceeded\n if (\n !isSelected &&\n props.max != null &&\n internalValue.length + 1 > props.max\n ) return\n\n if (index < 0 && value) internalValue.push(id)\n else if (index >= 0 && !value) internalValue.splice(index, 1)\n\n selected.value = internalValue\n } else {\n const isSelected = selected.value.includes(id)\n if (props.mandatory && isSelected) return\n\n selected.value = (value ?? !isSelected) ? [id] : []\n }\n }\n\n function step (offset: number) {\n // getting an offset from selected value obviously won't work with multiple values\n if (props.multiple) consoleWarn('This method is not supported when using \"multiple\" prop')\n\n if (!selected.value.length) {\n const item = items.find(item => !item.disabled)\n item && (selected.value = [item.id])\n } else {\n const currentId = selected.value[0]\n const currentIndex = items.findIndex(i => i.id === currentId)\n\n let newIndex = (currentIndex + offset) % items.length\n let newItem = items[newIndex]\n\n while (newItem.disabled && newIndex !== currentIndex) {\n newIndex = (newIndex + offset) % items.length\n newItem = items[newIndex]\n }\n\n if (newItem.disabled) return\n\n selected.value = [items[newIndex].id]\n }\n }\n\n const state: GroupProvide = {\n register,\n unregister,\n selected,\n select,\n disabled: toRef(props, 'disabled'),\n prev: () => step(items.length - 1),\n next: () => step(1),\n isSelected: (id: number) => selected.value.includes(id),\n selectedClass: computed(() => props.selectedClass),\n items: computed(() => items),\n getItemIndex: (value: unknown) => getItemIndex(items, value),\n }\n\n provide(injectKey, state)\n\n return state\n}\n\nfunction getItemIndex (items: UnwrapRef<GroupItem[]>, value: unknown) {\n const ids = getIds(items, [value])\n\n if (!ids.length) return -1\n\n return items.findIndex(item => item.id === ids[0])\n}\n\nfunction getIds (items: UnwrapRef<GroupItem[]>, modelValue: any[]) {\n const ids = []\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n\n if (item.value != null) {\n if (modelValue.find(value => deepEqual(value, item.value)) != null) {\n ids.push(item.id)\n }\n } else if (modelValue.includes(i)) {\n ids.push(item.id)\n }\n }\n\n return ids\n}\n\nfunction getValues (items: UnwrapRef<GroupItem[]>, ids: any[]) {\n const values = []\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n\n if (ids.includes(item.id)) {\n values.push(item.value != null ? item.value : i)\n }\n }\n\n return values\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,8BAExB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC1FC,WAAW,EAAEC,SAAS,EAAEC,uBAAuB,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,WAAW,6BAE/G;AAgDA,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;EACzCG,UAAU,EAAE;IACVC,IAA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pB,IAAI,CAAC3B,KAAK,IAAI,IAAI,EAAE;MACtB,IAAIb,UAAU,CAACmD,IAAI,CAACtC,KAAK,IAAIpB,SAAS,CAACoB,KAAK,EAAE2B,IAAI,CAAC3B,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE;QAClEsD,GAAG,CAACnB,IAAI,CAACR,IAAI,CAACpB,EAAE,CAAC;MACnB;IACF,CAAC,MAAM,IAAIpB,UAAU,CAACuD,QAAQ,CAACK,CAAC,CAAC,EAAE;MACjCO,GAAG,CAACnB,IAAI,CAACR,IAAI,CAACpB,EAAE,CAAC;IACnB;EACF;EAEA,OAAO+C,GAAG;AACZ;AAEA,SAAS7B,SAAS,CAAEL,KAA6B,EAAEkC,GAAU,EAAE;EAC7D,MAAMC,MAAM,GAAG,EAAE;EAEjB,KAAK,IAAIR,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG3B,KAAK,CAACmB,MAAM,EAAEQ,CAAC,EAAE,EAAE;IACrC,MAAMpB,IAAI,GAAGP,KAAK,CAAC2B,CAAC,CAAC;IAErB,IAAIO,GAAG,CAACZ,QAAQ,CAACf,IAAI,CAACpB,EAAE,CAAC,EAAE;MACzBgD,MAAM,CAACpB,IAAI,CAACR,IAAI,CAAC3B,KAAK,IAAI,IAAI,GAAG2B,IAAI,CAAC3B,KAAK,GAAG+C,CAAC,CAAC;IAClD;EACF;EAEA,OAAOQ,MAAM;AACf"}
|
|
@@ -3,7 +3,6 @@ import { getCurrentInstance, IN_BROWSER } from "../util/index.mjs";
|
|
|
3
3
|
import { onMounted } from 'vue';
|
|
4
4
|
export function useHydration(callback) {
|
|
5
5
|
var _vm$root, _vm$root$appContext, _vm$root$appContext$a;
|
|
6
|
-
|
|
7
6
|
if (!IN_BROWSER) return;
|
|
8
7
|
const vm = getCurrentInstance('useHydration');
|
|
9
8
|
const rootEl = vm == null ? void 0 : (_vm$root = vm.root) == null ? void 0 : (_vm$root$appContext = _vm$root.appContext) == null ? void 0 : (_vm$root$appContext$a = _vm$root$appContext.app) == null ? void 0 : _vm$root$appContext$a._container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.mjs","names":["getCurrentInstance","IN_BROWSER","onMounted","useHydration","callback","vm","rootEl","root","appContext","app","_container","__vue_app__"],"sources":["../../src/composables/hydration.ts"],"sourcesContent":["// Utilities\nimport { getCurrentInstance, IN_BROWSER } from '@/util'\nimport { onMounted } from 'vue'\n\nexport function useHydration (callback: () => void) {\n if (!IN_BROWSER) return\n\n const vm = getCurrentInstance('useHydration')\n const rootEl = vm?.root?.appContext?.app?._container\n\n return rootEl?.__vue_app__ ? callback() : onMounted(callback)\n}\n"],"mappings":"AAAA;SACSA,
|
|
1
|
+
{"version":3,"file":"hydration.mjs","names":["getCurrentInstance","IN_BROWSER","onMounted","useHydration","callback","vm","rootEl","root","appContext","app","_container","__vue_app__"],"sources":["../../src/composables/hydration.ts"],"sourcesContent":["// Utilities\nimport { getCurrentInstance, IN_BROWSER } from '@/util'\nimport { onMounted } from 'vue'\n\nexport function useHydration (callback: () => void) {\n if (!IN_BROWSER) return\n\n const vm = getCurrentInstance('useHydration')\n const rootEl = vm?.root?.appContext?.app?._container\n\n return rootEl?.__vue_app__ ? callback() : onMounted(callback)\n}\n"],"mappings":"AAAA;AAAA,SACSA,kBAAkB,EAAEC,UAAU;AACvC,SAASC,SAAS,QAAQ,KAAK;AAE/B,OAAO,SAASC,YAAY,CAAEC,QAAoB,EAAE;EAAA;EAClD,IAAI,CAACH,UAAU,EAAE;EAEjB,MAAMI,EAAE,GAAGL,kBAAkB,CAAC,cAAc,CAAC;EAC7C,MAAMM,MAAM,GAAGD,EAAE,gCAAFA,EAAE,CAAEE,IAAI,4CAAR,SAAUC,UAAU,8CAApB,oBAAsBC,GAAG,qBAAzB,sBAA2BC,UAAU;EAEpD,OAAOJ,MAAM,YAANA,MAAM,CAAEK,WAAW,GAAGP,QAAQ,EAAE,GAAGF,SAAS,CAACE,QAAQ,CAAC;AAC/D"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
|
2
2
|
// Icons
|
|
3
3
|
import { aliases, mdi } from "../iconsets/mdi.mjs"; // Utilities
|
|
4
|
-
|
|
5
4
|
import { computed, inject, isRef } from 'vue';
|
|
6
5
|
import { defineComponent, mergeDeep, propsFactory } from "../util/index.mjs"; // Types
|
|
7
|
-
|
|
8
6
|
export const IconValue = [String, Function, Object];
|
|
9
7
|
export const IconSymbol = Symbol.for('vuetify:icons');
|
|
10
8
|
export const makeIconProps = propsFactory({
|
|
@@ -21,7 +19,6 @@ export const makeIconProps = propsFactory({
|
|
|
21
19
|
export const VComponentIcon = defineComponent({
|
|
22
20
|
name: 'VComponentIcon',
|
|
23
21
|
props: makeIconProps(),
|
|
24
|
-
|
|
25
22
|
setup(props) {
|
|
26
23
|
return () => {
|
|
27
24
|
return _createVNode(props.tag, null, {
|
|
@@ -29,13 +26,11 @@ export const VComponentIcon = defineComponent({
|
|
|
29
26
|
});
|
|
30
27
|
};
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
});
|
|
34
30
|
export const VSvgIcon = defineComponent({
|
|
35
31
|
name: 'VSvgIcon',
|
|
36
32
|
inheritAttrs: false,
|
|
37
33
|
props: makeIconProps(),
|
|
38
|
-
|
|
39
34
|
setup(props, _ref) {
|
|
40
35
|
let {
|
|
41
36
|
attrs
|
|
@@ -56,12 +51,10 @@ export const VSvgIcon = defineComponent({
|
|
|
56
51
|
});
|
|
57
52
|
};
|
|
58
53
|
}
|
|
59
|
-
|
|
60
54
|
});
|
|
61
55
|
export const VLigatureIcon = defineComponent({
|
|
62
56
|
name: 'VLigatureIcon',
|
|
63
57
|
props: makeIconProps(),
|
|
64
|
-
|
|
65
58
|
setup(props) {
|
|
66
59
|
return () => {
|
|
67
60
|
return _createVNode(props.tag, null, {
|
|
@@ -69,12 +62,10 @@ export const VLigatureIcon = defineComponent({
|
|
|
69
62
|
});
|
|
70
63
|
};
|
|
71
64
|
}
|
|
72
|
-
|
|
73
65
|
});
|
|
74
66
|
export const VClassIcon = defineComponent({
|
|
75
67
|
name: 'VClassIcon',
|
|
76
68
|
props: makeIconProps(),
|
|
77
|
-
|
|
78
69
|
setup(props) {
|
|
79
70
|
return () => {
|
|
80
71
|
return _createVNode(props.tag, {
|
|
@@ -82,7 +73,6 @@ export const VClassIcon = defineComponent({
|
|
|
82
73
|
}, null);
|
|
83
74
|
};
|
|
84
75
|
}
|
|
85
|
-
|
|
86
76
|
});
|
|
87
77
|
export const defaultSets = {
|
|
88
78
|
svg: {
|
|
@@ -91,12 +81,14 @@ export const defaultSets = {
|
|
|
91
81
|
class: {
|
|
92
82
|
component: VClassIcon
|
|
93
83
|
}
|
|
94
|
-
};
|
|
84
|
+
};
|
|
95
85
|
|
|
86
|
+
// Composables
|
|
96
87
|
export function createIcons(options) {
|
|
97
88
|
return mergeDeep({
|
|
98
89
|
defaultSet: 'mdi',
|
|
99
|
-
sets: {
|
|
90
|
+
sets: {
|
|
91
|
+
...defaultSets,
|
|
100
92
|
mdi
|
|
101
93
|
},
|
|
102
94
|
aliases
|
|
@@ -109,22 +101,17 @@ export const useIcon = props => {
|
|
|
109
101
|
const iconAlias = isRef(props) ? props.value : props.icon;
|
|
110
102
|
if (!iconAlias) throw new Error('Icon value is undefined or null');
|
|
111
103
|
let icon = iconAlias;
|
|
112
|
-
|
|
113
104
|
if (typeof iconAlias === 'string' && iconAlias.includes('$')) {
|
|
114
105
|
var _icons$aliases;
|
|
115
|
-
|
|
116
106
|
icon = (_icons$aliases = icons.aliases) == null ? void 0 : _icons$aliases[iconAlias.slice(iconAlias.indexOf('$') + 1)];
|
|
117
107
|
}
|
|
118
|
-
|
|
119
108
|
if (!icon) throw new Error(`Could not find aliased icon "${iconAlias}"`);
|
|
120
|
-
|
|
121
109
|
if (typeof icon !== 'string') {
|
|
122
110
|
return {
|
|
123
111
|
component: VComponentIcon,
|
|
124
112
|
icon
|
|
125
113
|
};
|
|
126
114
|
}
|
|
127
|
-
|
|
128
115
|
const iconSetName = Object.keys(icons.sets).find(setName => typeof icon === 'string' && icon.startsWith(`${setName}:`));
|
|
129
116
|
const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon;
|
|
130
117
|
const iconSet = icons.sets[iconSetName ?? icons.defaultSet];
|