@vuetify/nightly 3.0.0-beta.0 → 3.0.0-beta.10
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 +2 -2
- package/_settings.scss +2 -0
- package/_styles.scss +1 -0
- package/_tools.scss +1 -0
- package/dist/_component-variables.sass +61 -0
- package/dist/json/attributes.json +860 -496
- package/dist/json/importMap.json +170 -194
- package/dist/json/tags.json +211 -139
- package/dist/json/web-types.json +2560 -1485
- package/dist/vuetify.css +3961 -4505
- package/dist/vuetify.d.ts +10313 -10018
- package/dist/vuetify.esm.js +10729 -9050
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +10728 -9048
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +3 -3
- package/dist/vuetify.min.js +1368 -1253
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.mjs +4 -0
- package/lib/blueprints/index.mjs.map +1 -0
- package/lib/blueprints/md1.mjs +63 -0
- package/lib/blueprints/md1.mjs.map +1 -0
- package/lib/blueprints/md2.mjs +60 -0
- package/lib/blueprints/md2.mjs.map +1 -0
- package/lib/blueprints/md3.mjs +74 -0
- package/lib/blueprints/md3.mjs.map +1 -0
- package/lib/components/VAlert/VAlert.css +36 -19
- package/lib/components/VAlert/VAlert.mjs +69 -40
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.sass +26 -11
- package/lib/components/VAlert/VAlertTitle.mjs +1 -0
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/_variables.scss +14 -7
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.css +2 -15
- package/lib/components/VApp/VApp.mjs +3 -4
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +11 -20
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VApp/variables.scss +6 -0
- package/lib/components/VAppBar/VAppBar.css +1 -1
- package/lib/components/VAppBar/VAppBar.mjs +15 -10
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.sass +0 -1
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +11 -14
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +7 -4
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/_variables.scss +2 -0
- package/lib/components/VAppBar/index.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +11 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +142 -105
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +10 -2
- package/lib/components/VAutocomplete/_variables.scss +1 -0
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.css +4 -1
- package/lib/components/VAvatar/VAvatar.mjs +17 -15
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +5 -2
- package/lib/components/VAvatar/_mixins.scss +0 -1
- package/lib/components/VAvatar/index.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.css +3 -6
- package/lib/components/VBadge/VBadge.mjs +20 -49
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.sass +2 -5
- package/lib/components/VBadge/_variables.scss +3 -4
- package/lib/components/VBadge/index.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.css +81 -57
- package/lib/components/VBanner/VBanner.mjs +45 -37
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.sass +60 -55
- package/lib/components/VBanner/VBannerActions.mjs +34 -2
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/VBannerText.mjs.map +1 -1
- package/lib/components/VBanner/_variables.scss +10 -14
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +6 -13
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +5 -4
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.sass +6 -14
- package/lib/components/VBottomNavigation/_variables.scss +7 -8
- package/lib/components/VBottomNavigation/index.mjs.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/components/VBottomSheet/index.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +13 -6
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +35 -21
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +8 -4
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +15 -17
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/_variables.scss +2 -1
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.css +136 -28
- package/lib/components/VBtn/VBtn.mjs +98 -33
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +119 -16
- package/lib/components/VBtn/_variables.scss +10 -1
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.css +16 -7
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.sass +14 -7
- package/lib/components/VBtnGroup/_variables.scss +2 -0
- package/lib/components/VBtnGroup/index.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.sass +0 -1
- package/lib/components/VBtnToggle/_variables.scss +1 -0
- package/lib/components/VBtnToggle/index.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
- 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.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs +2 -6
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/times.mjs.map +1 -1
- package/lib/components/VCalendar/modes/column.mjs.map +1 -1
- package/lib/components/VCalendar/modes/common.mjs.map +1 -1
- package/lib/components/VCalendar/modes/index.mjs.map +1 -1
- package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
- package/lib/components/VCalendar/util/events.mjs.map +1 -1
- package/lib/components/VCalendar/util/parser.mjs.map +1 -1
- package/lib/components/VCalendar/util/props.mjs.map +1 -1
- package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
- package/lib/components/VCard/VCard.css +103 -84
- package/lib/components/VCard/VCard.mjs +72 -73
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +76 -61
- package/lib/components/VCard/VCardActions.mjs +2 -3
- package/lib/components/VCard/VCardActions.mjs.map +1 -1
- package/lib/components/VCard/VCardItem.mjs +88 -0
- package/lib/components/VCard/VCardItem.mjs.map +1 -0
- 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/_variables.scss +45 -23
- package/lib/components/VCard/index.mjs +1 -4
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +6 -4
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +0 -1
- package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
- package/lib/components/VCarousel/_variables.scss +1 -0
- package/lib/components/VCarousel/index.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.mjs +15 -47
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.sass +0 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +67 -0
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -0
- package/lib/components/VCheckbox/index.mjs +1 -0
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +147 -68
- package/lib/components/VChip/VChip.mjs +83 -43
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +9 -1
- package/lib/components/VChip/_mixins.scss +26 -6
- package/lib/components/VChip/_variables.scss +4 -5
- package/lib/components/VChip/index.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.mjs +5 -4
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.sass +1 -1
- package/lib/components/VChipGroup/_variables.scss +1 -1
- package/lib/components/VChipGroup/index.mjs.map +1 -1
- package/lib/components/VCode/VCode.sass +1 -2
- package/lib/components/VCode/_variables.scss +1 -1
- package/lib/components/VCode/index.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.css +3 -3
- package/lib/components/VColorPicker/VColorPicker.mjs +55 -53
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.css +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +10 -9
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +4 -3
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +14 -21
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +6 -5
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.sass +0 -1
- package/lib/components/VColorPicker/_variables.scss +17 -10
- package/lib/components/VColorPicker/index.mjs.map +1 -1
- package/lib/components/VColorPicker/util/index.mjs +1 -3
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +11 -1
- package/lib/components/VCombobox/VCombobox.mjs +145 -116
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +10 -2
- package/lib/components/VCombobox/_variables.scss +1 -0
- package/lib/components/VCombobox/index.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.mjs +16 -16
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.sass +1 -2
- package/lib/components/VCounter/_variables.scss +2 -1
- package/lib/components/VCounter/index.mjs.map +1 -1
- package/lib/components/VData/VData.mjs.map +1 -1
- package/lib/components/VData/index.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
- package/lib/components/VDataIterator/index.mjs.map +1 -1
- package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
- package/lib/components/VDataTable/Row.mjs.map +1 -1
- package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.mjs +11 -15
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
- package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
- package/lib/components/VDataTable/index.mjs.map +1 -1
- package/lib/components/VDataTable/mixins/header.mjs +1 -3
- package/lib/components/VDataTable/mixins/header.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
- 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.map +1 -1
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
- package/lib/components/VDatePicker/util/index.mjs.map +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs.map +1 -1
- package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
- 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.map +1 -1
- package/lib/components/VDefaultsProvider/index.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.css +34 -17
- package/lib/components/VDialog/VDialog.mjs +34 -31
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +28 -15
- package/lib/components/VDialog/_variables.scss +3 -8
- package/lib/components/VDialog/index.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.mjs +16 -17
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.sass +0 -1
- package/lib/components/VDivider/_variables.scss +3 -1
- package/lib/components/VDivider/index.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.css +10 -7
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +15 -6
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +14 -11
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs +4 -0
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/_variables.scss +15 -10
- package/lib/components/VExpansionPanel/index.mjs.map +1 -1
- package/lib/components/VField/VField.css +54 -35
- package/lib/components/VField/VField.mjs +52 -36
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +39 -27
- package/lib/components/VField/VFieldLabel.mjs +8 -9
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/_variables.scss +6 -5
- package/lib/components/VField/index.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +3 -3
- package/lib/components/VFileInput/VFileInput.mjs +45 -44
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +3 -4
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.css +1 -1
- package/lib/components/VFooter/VFooter.mjs +36 -18
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.sass +0 -1
- package/lib/components/VFooter/_variables.scss +2 -1
- package/lib/components/VFooter/index.mjs.map +1 -1
- package/lib/components/VForm/VForm.mjs +27 -13
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +2 -1
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +4 -3
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +8 -3
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VGrid/index.mjs.map +1 -1
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.css +13 -16
- package/lib/components/VIcon/VIcon.mjs +34 -33
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.sass +8 -16
- package/lib/components/VIcon/_variables.scss +2 -5
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.mjs +1 -0
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +0 -1
- package/lib/components/VImg/index.mjs.map +1 -1
- package/lib/components/VInput/InputIcon.mjs +33 -0
- package/lib/components/VInput/InputIcon.mjs.map +1 -0
- package/lib/components/VInput/VInput.css +5 -2
- package/lib/components/VInput/VInput.mjs +26 -18
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +5 -3
- package/lib/components/VInput/_variables.scss +4 -1
- package/lib/components/VInput/index.mjs.map +1 -1
- package/lib/components/VItemGroup/VItem.mjs +3 -0
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.sass +0 -1
- package/lib/components/VItemGroup/index.mjs.map +1 -1
- package/lib/components/VKbd/VKbd.css +1 -1
- package/lib/components/VKbd/VKbd.sass +0 -1
- package/lib/components/VKbd/_variables.scss +1 -1
- package/lib/components/VKbd/index.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.mjs +4 -3
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.sass +0 -1
- package/lib/components/VLabel/_variables.scss +1 -0
- package/lib/components/VLabel/index.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.css +0 -2
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.sass +0 -2
- package/lib/components/VLayout/VLayoutItem.mjs +1 -1
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/index.mjs.map +1 -1
- package/lib/components/VLazy/VLazy.mjs +5 -3
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VLazy/index.mjs.map +1 -1
- package/lib/components/VList/VList.css +14 -16
- package/lib/components/VList/VList.mjs +92 -59
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +9 -6
- package/lib/components/VList/VListChildren.mjs +69 -13
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +52 -19
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +176 -73
- package/lib/components/VList/VListItem.mjs +123 -81
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +125 -49
- package/lib/components/VList/VListItemAction.mjs +28 -0
- package/lib/components/VList/VListItemAction.mjs.map +1 -0
- package/lib/components/VList/VListItemMedia.mjs +8 -7
- 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 +8 -7
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/_variables.scss +24 -9
- package/lib/components/VList/index.mjs +3 -4
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +5 -3
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VLocaleProvider/index.mjs.map +1 -1
- package/lib/components/VMain/VMain.css +20 -9
- package/lib/components/VMain/VMain.mjs +17 -11
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +17 -11
- package/lib/components/VMain/_variables.scss +1 -1
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.css +3 -13
- package/lib/components/VMenu/VMenu.mjs +68 -34
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +3 -7
- package/lib/components/VMenu/_variables.scss +0 -1
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs +2 -0
- package/lib/components/VMenu/shared.mjs.map +1 -0
- package/lib/components/VMessages/VMessages.mjs +5 -3
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.sass +0 -1
- package/lib/components/VMessages/_variables.scss +1 -1
- package/lib/components/VMessages/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +14 -19
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +60 -21
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +16 -22
- package/lib/components/VNavigationDrawer/_variables.scss +4 -2
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/sticky.mjs +70 -0
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -0
- package/lib/components/VNavigationDrawer/touch.mjs +5 -2
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
- package/lib/components/VNoSsr/index.mjs.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
- package/lib/components/VOtpInput/index.mjs.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
- package/lib/components/VOverflowBtn/index.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.css +7 -0
- package/lib/components/VOverlay/VOverlay.mjs +70 -43
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +8 -1
- package/lib/components/VOverlay/_variables.scss +1 -1
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +404 -0
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -0
- package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +19 -13
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +60 -17
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VOverlay/util/point.mjs +3 -3
- package/lib/components/VOverlay/util/point.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +60 -44
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.sass +0 -1
- package/lib/components/VPagination/index.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.mjs +8 -8
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/index.mjs.map +1 -1
- package/lib/components/VPicker/VPicker.mjs.map +1 -1
- package/lib/components/VPicker/index.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.mjs +6 -5
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.sass +0 -1
- package/lib/components/VProgressCircular/_variables.scss +2 -0
- package/lib/components/VProgressCircular/index.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.css +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -3
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.sass +0 -1
- package/lib/components/VProgressLinear/_variables.scss +1 -0
- package/lib/components/VProgressLinear/index.mjs.map +1 -1
- package/lib/components/VRadio/VRadio.mjs +9 -17
- package/lib/components/VRadio/VRadio.mjs.map +1 -1
- package/lib/components/VRadio/index.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +30 -8
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.sass +5 -3
- package/lib/components/VRadioGroup/_variables.scss +3 -4
- package/lib/components/VRadioGroup/index.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +16 -14
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.css +2 -2
- package/lib/components/VRating/VRating.mjs +24 -18
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/VRating.sass +4 -3
- package/lib/components/VRating/index.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.mjs +7 -6
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VResponsive/index.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.css +18 -2
- package/lib/components/VSelect/VSelect.mjs +145 -112
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +20 -3
- package/lib/components/VSelect/_variables.scss +1 -0
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.css +1 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs +31 -24
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.sass +1 -1
- package/lib/components/VSelectionControl/_variables.scss +1 -0
- package/lib/components/VSelectionControl/index.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +7 -6
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +1 -6
- package/lib/components/VSelectionControlGroup/_variables.scss +1 -4
- package/lib/components/VSelectionControlGroup/index.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.css +1 -1
- package/lib/components/VSheet/VSheet.mjs +10 -6
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.sass +0 -1
- package/lib/components/VSheet/_variables.scss +3 -2
- package/lib/components/VSheet/index.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/index.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.css +0 -5
- package/lib/components/VSlideGroup/VSlideGroup.mjs +105 -74
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.sass +0 -5
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +10 -4
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/_variables.scss +0 -5
- package/lib/components/VSlideGroup/helpers.mjs +4 -15
- package/lib/components/VSlideGroup/helpers.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.mjs +2 -2
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.css +7 -2
- package/lib/components/VSlider/VSlider.mjs +7 -9
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +11 -7
- package/lib/components/VSlider/VSliderThumb.css +10 -6
- package/lib/components/VSlider/VSliderThumb.mjs +9 -8
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.sass +11 -10
- package/lib/components/VSlider/VSliderTrack.css +6 -6
- package/lib/components/VSlider/VSliderTrack.mjs +17 -15
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.sass +7 -9
- package/lib/components/VSlider/_variables.scss +5 -2
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +13 -23
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.css +22 -40
- package/lib/components/VSnackbar/VSnackbar.mjs +67 -48
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.sass +15 -35
- package/lib/components/VSnackbar/_variables.scss +3 -7
- package/lib/components/VSnackbar/index.mjs.map +1 -1
- package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/core.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/math.mjs.map +1 -1
- 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.map +1 -1
- package/lib/components/VSpeedDial/index.mjs.map +1 -1
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepperContent.mjs.map +1 -1
- package/lib/components/VStepper/VStepperStep.mjs.map +1 -1
- package/lib/components/VStepper/index.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.css +9 -2
- package/lib/components/VSwitch/VSwitch.mjs +15 -6
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +6 -1
- package/lib/components/VSwitch/_variables.scss +1 -0
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +1 -6
- package/lib/components/VSystemBar/VSystemBar.mjs +22 -17
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.sass +0 -6
- package/lib/components/VSystemBar/_variables.scss +2 -4
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.css +1 -0
- package/lib/components/VTable/VTable.mjs +9 -8
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +1 -1
- package/lib/components/VTable/_variables.scss +2 -0
- package/lib/components/VTable/index.mjs.map +1 -1
- package/lib/components/VTabs/VTab.css +6 -3
- package/lib/components/VTabs/VTab.mjs +33 -36
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +7 -4
- package/lib/components/VTabs/VTabs.css +16 -13
- package/lib/components/VTabs/VTabs.mjs +17 -15
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +11 -8
- package/lib/components/VTabs/_variables.scss +2 -0
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs +2 -0
- package/lib/components/VTabs/shared.mjs.map +1 -0
- package/lib/components/VTextField/VTextField.css +6 -5
- package/lib/components/VTextField/VTextField.mjs +42 -37
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +7 -7
- package/lib/components/VTextField/_variables.scss +1 -1
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.css +12 -5
- package/lib/components/VTextarea/VTextarea.mjs +45 -25
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +17 -8
- package/lib/components/VTextarea/_variables.scss +1 -1
- package/lib/components/VTextarea/index.mjs.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
- package/lib/components/VThemeProvider/index.mjs.map +1 -1
- package/lib/components/VTimePicker/SelectingTimes.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
- package/lib/components/VTimePicker/index.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.css +220 -49
- package/lib/components/VTimeline/VTimeline.mjs +47 -32
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +235 -55
- package/lib/components/VTimeline/VTimelineDivider.mjs +45 -37
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +17 -15
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_mixins.sass +10 -0
- package/lib/components/VTimeline/_variables.scss +12 -6
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.css +25 -33
- package/lib/components/VToolbar/VToolbar.mjs +32 -31
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +18 -19
- package/lib/components/VToolbar/VToolbarItems.mjs +12 -9
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
- package/lib/components/VToolbar/_variables.scss +20 -8
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.mjs +48 -41
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +0 -1
- package/lib/components/VTooltip/_variables.scss +1 -0
- package/lib/components/VTooltip/index.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeview.mjs +1 -3
- package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
- 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.map +1 -1
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.mjs +7 -21
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.sass +0 -2
- package/lib/components/VWindow/VWindowItem.mjs +21 -11
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/_variables.scss +1 -0
- package/lib/components/VWindow/index.mjs.map +1 -1
- package/lib/components/index.d.ts +9808 -9503
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +66 -10
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/transitions/index.mjs +0 -5
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +5 -6
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs +19 -26
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +2 -2
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/delay.mjs +1 -3
- package/lib/composables/delay.mjs.map +1 -1
- package/lib/composables/density.mjs.map +1 -1
- package/lib/composables/dimensions.mjs.map +1 -1
- package/lib/composables/display.mjs +13 -11
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/elevation.mjs.map +1 -1
- package/lib/composables/filter.mjs +35 -17
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +44 -11
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRefs.mjs +72 -0
- package/lib/composables/forwardRefs.mjs.map +1 -0
- package/lib/composables/group.mjs +16 -12
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/icons.mjs +16 -4
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs +3 -2
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/items.mjs +84 -0
- package/lib/composables/items.mjs.map +1 -0
- package/lib/composables/layout.mjs +24 -24
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/loader.mjs.map +1 -1
- package/lib/composables/locale.mjs +17 -28
- package/lib/composables/locale.mjs.map +1 -1
- package/lib/composables/location.mjs +66 -0
- package/lib/composables/location.mjs.map +1 -0
- package/lib/composables/mutationObserver.mjs +4 -6
- package/lib/composables/mutationObserver.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +34 -22
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs +63 -36
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs +163 -122
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/position.mjs +4 -25
- package/lib/composables/position.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +2 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/refs.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs +1 -9
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +29 -15
- package/lib/composables/router.mjs.map +1 -1
- package/lib/composables/rtl.mjs +2 -4
- package/lib/composables/rtl.mjs.map +1 -1
- package/lib/composables/scopeId.mjs +11 -0
- package/lib/composables/scopeId.mjs.map +1 -0
- package/lib/composables/scroll.mjs +1 -3
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/selectLink.mjs +19 -0
- package/lib/composables/selectLink.mjs.map +1 -0
- package/lib/composables/size.mjs +18 -14
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +3 -2
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +37 -23
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/tag.mjs.map +1 -1
- package/lib/composables/teleport.mjs.map +1 -1
- package/lib/composables/theme.mjs +108 -101
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +18 -0
- package/lib/composables/toggleScope.mjs.map +1 -0
- package/lib/composables/touch.mjs +1 -3
- package/lib/composables/touch.mjs.map +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +24 -10
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +7 -8
- package/lib/composables/variant.mjs.map +1 -1
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/color/index.mjs.map +1 -1
- package/lib/directives/index.mjs.map +1 -1
- package/lib/directives/intersect/index.mjs.map +1 -1
- package/lib/directives/mutate/index.mjs +4 -6
- package/lib/directives/mutate/index.mjs.map +1 -1
- package/lib/directives/resize/index.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.sass +0 -1
- package/lib/directives/ripple/index.mjs +16 -6
- package/lib/directives/ripple/index.mjs.map +1 -1
- package/lib/directives/scroll/index.mjs +1 -3
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs +3 -3
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +2 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +49 -32
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa-svg.d.ts +2 -1
- package/lib/iconsets/fa-svg.mjs.map +1 -1
- package/lib/iconsets/fa.d.ts +2 -1
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.d.ts +2 -1
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.d.ts +2 -1
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.d.ts +2 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.d.ts +2 -1
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.ts +155 -136
- package/lib/locale/adapters/vue-i18n.mjs +1 -3
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/adapters/vue-intl.mjs +3 -5
- package/lib/locale/adapters/vue-intl.mjs.map +1 -1
- package/lib/locale/af.mjs +5 -0
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs +5 -0
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs +5 -0
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs +5 -0
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs +14 -9
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs +5 -0
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs +5 -0
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs +5 -0
- package/lib/locale/da.mjs.map +1 -1
- package/lib/locale/de.mjs +5 -0
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs +5 -0
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs +5 -0
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs +5 -0
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs +5 -0
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs +5 -0
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs +5 -0
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs +5 -0
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs +5 -0
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs +5 -0
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs +5 -0
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs +5 -0
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.d.ts +210 -0
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs +5 -0
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs +5 -0
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs +5 -0
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs +5 -0
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs +5 -0
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs +5 -0
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs +5 -0
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs +5 -0
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs +5 -0
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs +5 -0
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs +5 -0
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs +5 -0
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs +5 -0
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs +5 -0
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs +5 -0
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs +5 -0
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs +5 -0
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs +5 -0
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs +5 -0
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs +5 -0
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs +5 -0
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs +5 -0
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/generic/_colors.scss +17 -10
- package/lib/styles/generic/_transitions.scss +13 -77
- package/lib/styles/main.css +1611 -1853
- package/lib/styles/settings/_elevations.scss +3 -3
- package/lib/styles/settings/_utilities.scss +74 -35
- package/lib/styles/tools/_states.sass +11 -3
- package/lib/styles/tools/_utilities.sass +1 -1
- package/lib/styles/tools/_variant.sass +6 -7
- package/lib/styles/utilities/_index.sass +0 -1
- package/lib/util/anchor.mjs +56 -0
- package/lib/util/anchor.mjs.map +1 -0
- package/lib/util/animation.mjs +18 -2
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/box.mjs +12 -0
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/color/APCA.mjs.map +1 -1
- package/lib/util/color/transformCIELAB.mjs.map +1 -1
- package/lib/util/color/transformSRGB.mjs.map +1 -1
- package/lib/util/colorUtils.mjs +2 -2
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/colors.mjs +1 -1
- package/lib/util/colors.mjs.map +1 -1
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs +1 -1
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +37 -11
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/easing.mjs.map +1 -1
- package/lib/util/getCurrentInstance.mjs +20 -1
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/getScrollParent.mjs +3 -1
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/lib/util/globals.mjs +1 -4
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +42 -7
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/index.mjs +1 -0
- package/lib/util/index.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +12 -0
- package/lib/util/injectSelf.mjs.map +1 -0
- package/lib/util/isFixedPosition.mjs.map +1 -1
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +47 -34
- package/lib/components/VBreadcrumbs/shared.mjs +0 -2
- package/lib/components/VBreadcrumbs/shared.mjs.map +0 -1
- package/lib/components/VCard/VCardAvatar.mjs +0 -3
- package/lib/components/VCard/VCardAvatar.mjs.map +0 -1
- package/lib/components/VCard/VCardHeader.mjs +0 -3
- package/lib/components/VCard/VCardHeader.mjs.map +0 -1
- package/lib/components/VCard/VCardHeaderText.mjs +0 -3
- package/lib/components/VCard/VCardHeaderText.mjs.map +0 -1
- package/lib/components/VCard/VCardImg.mjs +0 -3
- package/lib/components/VCard/VCardImg.mjs.map +0 -1
- package/lib/components/VList/VListItemAvatar.mjs +0 -29
- package/lib/components/VList/VListItemAvatar.mjs.map +0 -1
- package/lib/components/VList/VListItemHeader.mjs +0 -3
- package/lib/components/VList/VListItemHeader.mjs.map +0 -1
- package/lib/components/VOverlay/positionStrategies.mjs +0 -203
- package/lib/components/VOverlay/positionStrategies.mjs.map +0 -1
- package/lib/components/VOverlay/util/anchor.mjs +0 -52
- package/lib/components/VOverlay/util/anchor.mjs.map +0 -1
- package/lib/components/VTimeline/shared.mjs +0 -2
- package/lib/components/VTimeline/shared.mjs.map +0 -1
- package/lib/composables/forwardRef.mjs +0 -42
- package/lib/composables/forwardRef.mjs.map +0 -1
- package/lib/composables/overlay.mjs +0 -30
- package/lib/composables/overlay.mjs.map +0 -1
- package/lib/presets/default/index.mjs +0 -71
- package/lib/presets/default/index.mjs.map +0 -1
- package/lib/styles/utilities/_text.sass +0 -9
- package/lib/styles.scss +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/composables/display.ts"],"names":["inject","reactive","ref","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","Math","max","document","documentElement","clientWidth","window","innerWidth","getClientHeight","clientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","ssr","touch","createDisplay","height","platform","state","width","onResize","value","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"mappings":"AAAA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,GAA3B,EAAgCC,MAAhC,EAAwCC,WAAxC,QAA2D,KAA3D;SACSC,S,6BAET;;SACSC,U,EAAYC,c,+BAErB;;AAgEA,OAAO,MAAMC,aAAoD,GAAGC,MAAM,CAACC,GAAP,CAAW,iBAAX,CAA7D;AAEP,MAAMC,qBAAqC,GAAG;AAC5CC,EAAAA,gBAAgB,EAAE,IAD0B;AAE5CC,EAAAA,UAAU,EAAE;AACVC,IAAAA,EAAE,EAAE,CADM;AAEVC,IAAAA,EAAE,EAAE,GAFM;AAGVC,IAAAA,EAAE,EAAE,GAHM;AAIVC,IAAAA,EAAE,EAAE,IAJM;AAKVC,IAAAA,EAAE,EAAE,IALM;AAMVC,IAAAA,GAAG,EAAE;AANK;AAFgC,CAA9C;;AAYA,MAAMC,mBAAmB,GAAG,YAAqD;AAAA,MAApDC,OAAoD,uEAA1BV,qBAA0B;AAC/E,SAAON,SAAS,CAACM,qBAAD,EAAwBU,OAAxB,CAAhB;AACD,CAFD,C,CAIA;AACA;;;AACA,SAASC,cAAT,GAA2B;AACzB,SAAOhB,UAAU,GAAGiB,IAAI,CAACC,GAAL,CAClBC,QAAQ,CAACC,eAAT,CAA0BC,WADR,EAElBC,MAAM,CAACC,UAFW,CAAH,GAGb,CAHJ,CADyB,CAInB;AACP;;AAED,SAASC,eAAT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AAK,CAACa,SAAN,GAAkB,EAAElD,EAAE,IAAIC,GAAR,CAAlB;AACAoC,IAAAA,KAAK,CAACc,SAAN,GAAkB,CAAClD,GAAnB;AACAoC,IAAAA,KAAK,CAACI,IAAN,GAAaA,IAAb;AACAJ,IAAAA,KAAK,CAACF,MAAN,GAAeA,MAAM,CAACK,KAAtB;AACAH,IAAAA,KAAK,CAACC,KAAN,GAAcA,KAAK,CAACE,KAApB;AACAH,IAAAA,KAAK,CAACM,MAAN,GAAeA,MAAf;AACAN,IAAAA,KAAK,CAAC3C,gBAAN,GAAyBA,gBAAzB;AACA2C,IAAAA,KAAK,CAACD,QAAN,GAAiBA,QAAjB;AACAC,IAAAA,KAAK,CAAC1C,UAAN,GAAmBA,UAAnB;AACD,GAxCU,CAAX;;AA0CA,MAAIP,UAAJ,EAAgB;AACdsB,IAAAA,MAAM,CAAC0C,gBAAP,CAAwB,QAAxB,EAAkCb,QAAlC,EAA4C;AAAEc,MAAAA,OAAO,EAAE;AAAX,KAA5C;AACD;;AAED,SAAOpE,MAAM,CAACoD,KAAD,CAAb;AACD;AAED,OAAO,SAASiB,UAAT,GAAuB;AAC5B,QAAMC,OAAO,GAAGzE,MAAM,CAACQ,aAAD,CAAtB;AAEA,MAAI,CAACiE,OAAL,EAAc,MAAM,IAAIC,KAAJ,CAAU,0CAAV,CAAN;AAEd,SAAOD,OAAP;AACD","sourcesContent":["// Utilities\nimport { inject, reactive, ref, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, ToRefs } from 'vue'\n\nexport type DisplayBreakpoint = keyof DisplayThresholds\n\nexport interface DisplayThresholds {\n xs: number\n sm: number\n md: number\n lg: number\n xl: number\n xxl: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: boolean\n sm: boolean\n md: boolean\n lg: boolean\n xl: boolean\n xxl: boolean\n smAndUp: boolean\n mdAndUp: boolean\n lgAndUp: boolean\n xlAndUp: boolean\n smAndDown: boolean\n mdAndDown: boolean\n lgAndDown: boolean\n xlAndDown: boolean\n name: DisplayBreakpoint\n height: number\n width: number\n mobile: boolean\n mobileBreakpoint: number | DisplayBreakpoint\n platform: DisplayPlatform\n thresholds: DisplayThresholds\n}\n\nexport const DisplaySymbol: InjectionKey<ToRefs<DisplayInstance>> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\n// Cross-browser support as described in:\n// https://stackoverflow.com/questions/1248081\nfunction getClientWidth () {\n return IN_BROWSER ? Math.max(\n document.documentElement!.clientWidth,\n window.innerWidth\n ) : 0 // SSR\n}\n\nfunction getClientHeight () {\n return IN_BROWSER ? Math.max(\n document.documentElement!.clientHeight,\n window.innerHeight\n ) : 0 // SSR\n}\n\nfunction getPlatform (): DisplayPlatform {\n const userAgent = IN_BROWSER ? window.navigator.userAgent : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n const ssr = match(/ssr/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr,\n }\n}\n\nexport function createDisplay (options?: DisplayOptions): ToRefs<DisplayInstance> {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight())\n const platform = getPlatform()\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth())\n\n function onResize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = !platform.ssr\n ? width.value < breakpointValue\n : platform.android || platform.ios || platform.opera\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', onResize, { passive: true })\n }\n\n return toRefs(state)\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"file":"display.mjs"}
|
|
1
|
+
{"version":3,"file":"display.mjs","names":["inject","nextTick","reactive","ref","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","ssr","touch","createDisplay","height","platform","state","width","onResize","value","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, nextTick, reactive, ref, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, ToRefs } from 'vue'\n\nexport type DisplayBreakpoint = keyof DisplayThresholds\n\nexport interface DisplayThresholds {\n xs: number\n sm: number\n md: number\n lg: number\n xl: number\n xxl: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: boolean\n sm: boolean\n md: boolean\n lg: boolean\n xl: boolean\n xxl: boolean\n smAndUp: boolean\n mdAndUp: boolean\n lgAndUp: boolean\n xlAndUp: boolean\n smAndDown: boolean\n mdAndDown: boolean\n lgAndDown: boolean\n xlAndDown: boolean\n name: DisplayBreakpoint\n height: number\n width: number\n mobile: boolean\n mobileBreakpoint: number | DisplayBreakpoint\n platform: DisplayPlatform\n thresholds: DisplayThresholds\n}\n\nexport const DisplaySymbol: InjectionKey<ToRefs<DisplayInstance>> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (): DisplayPlatform {\n const userAgent = IN_BROWSER ? window.navigator.userAgent : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n const ssr = match(/ssr/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr,\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, isHydrate?: boolean): ToRefs<DisplayInstance> {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight(isHydrate))\n const platform = getPlatform()\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth(isHydrate))\n\n function onResize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n\n if (isHydrate) {\n nextTick(() => onResize())\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = !platform.ssr\n ? width.value < breakpointValue\n : platform.android || platform.ios || platform.opera\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', onResize, { passive: true })\n }\n\n return toRefs(state)\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,QAA3B,EAAqCC,GAArC,EAA0CC,MAA1C,EAAkDC,WAAlD,QAAqE,KAArE;SACSC,S,6BAET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V,CAAN;EAEd,OAAOD,OAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"elevation.mjs","names":["computed","isRef","propsFactory","makeElevationProps","elevation","type","Number","String","validator","v","value","parseInt","isNaN","useElevation","props","elevationClasses","classes","push"],"sources":["../../src/composables/elevation.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\nexport interface ElevationProps {\n elevation?: number | string | null\n}\n\n// Composables\nexport const makeElevationProps = propsFactory({\n elevation: {\n type: [Number, String],\n validator (v: any) {\n const value = parseInt(v)\n\n return (\n !isNaN(value) &&\n value >= 0 &&\n // Material Design has a maximum elevation of 24\n // https://material.io/design/environment/elevation.html#default-elevations\n value <= 24\n )\n },\n },\n}, 'elevation')\n\ntype ElevationData = {\n elevationClasses: Ref<string[]>\n}\n\nexport function useElevation (props: ElevationProps | Ref<number | string | undefined>): ElevationData {\n const elevationClasses = computed(() => {\n const elevation = isRef(props) ? props.value : props.elevation\n const classes: string[] = []\n\n if (elevation == null) return classes\n\n classes.push(`elevation-${elevation}`)\n\n return classes\n })\n\n return { elevationClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC;SACSC,Y,6BAET;;AAMA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;EAC7CE,SAAS,EAAE;IACTC,IAAI,EAAE,CAACC,MAAD,EAASC,MAAT,CADG;;IAETC,SAAS,CAAEC,CAAF,EAAU;MACjB,MAAMC,KAAK,GAAGC,QAAQ,CAACF,CAAD,CAAtB;MAEA,OACE,CAACG,KAAK,CAACF,KAAD,CAAN,IACAA,KAAK,IAAI,CADT,IAEA;MACA;MACAA,KAAK,IAAI,EALX;IAOD;;EAZQ;AADkC,CAAD,EAe3C,WAf2C,CAAvC;AAqBP,OAAO,SAASG,YAAT,CAAuBC,KAAvB,EAAgG;EACrG,MAAMC,gBAAgB,GAAGf,QAAQ,CAAC,MAAM;IACtC,MAAMI,SAAS,GAAGH,KAAK,CAACa,KAAD,CAAL,GAAeA,KAAK,CAACJ,KAArB,GAA6BI,KAAK,CAACV,SAArD;IACA,MAAMY,OAAiB,GAAG,EAA1B;IAEA,IAAIZ,SAAS,IAAI,IAAjB,EAAuB,OAAOY,OAAP;IAEvBA,OAAO,CAACC,IAAR,CAAc,aAAYb,SAAU,EAApC;IAEA,OAAOY,OAAP;EACD,CATgC,CAAjC;EAWA,OAAO;IAAED;EAAF,CAAP;AACD"}
|
|
@@ -21,34 +21,41 @@ export const makeFilterProps = propsFactory({
|
|
|
21
21
|
noFilter: Boolean
|
|
22
22
|
}, 'filter');
|
|
23
23
|
export function filterItems(items, query, options) {
|
|
24
|
-
var _options$default, _options$customKeyFil;
|
|
25
|
-
|
|
26
24
|
const array = []; // always ensure we fall back to a functioning filter
|
|
27
25
|
|
|
28
|
-
const filter = (
|
|
26
|
+
const filter = (options == null ? void 0 : options.default) ?? defaultFilter;
|
|
29
27
|
const keys = options != null && options.filterKeys ? wrapInArray(options.filterKeys) : false;
|
|
30
|
-
const customFiltersLength = Object.keys((
|
|
28
|
+
const customFiltersLength = Object.keys((options == null ? void 0 : options.customKeyFilter) ?? {}).length;
|
|
31
29
|
if (!(items != null && items.length)) return array;
|
|
32
30
|
|
|
33
|
-
loop: for (
|
|
31
|
+
loop: for (let i = 0; i < items.length; i++) {
|
|
32
|
+
const item = items[i];
|
|
34
33
|
const customMatches = {};
|
|
35
34
|
const defaultMatches = {};
|
|
36
35
|
let match = -1;
|
|
37
36
|
|
|
38
|
-
if (query &&
|
|
39
|
-
|
|
37
|
+
if (query && !(options != null && options.noFilter)) {
|
|
38
|
+
if (typeof item === 'object') {
|
|
39
|
+
const filterKeys = keys || Object.keys(item);
|
|
40
|
+
|
|
41
|
+
for (const key of filterKeys) {
|
|
42
|
+
var _options$customKeyFil;
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
const value = getPropertyFromItem(item, key, item);
|
|
45
|
+
const keyFilter = options == null ? void 0 : (_options$customKeyFil = options.customKeyFilter) == null ? void 0 : _options$customKeyFil[key];
|
|
46
|
+
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
if (match !== -1 && match !== false) {
|
|
49
|
+
if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
|
|
50
|
+
} else if ((options == null ? void 0 : options.filterMode) === 'every') {
|
|
51
|
+
continue loop;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
match = filter(item, query, item);
|
|
47
56
|
|
|
48
57
|
if (match !== -1 && match !== false) {
|
|
49
|
-
|
|
50
|
-
} else if ((options == null ? void 0 : options.filterMode) === 'every') {
|
|
51
|
-
continue loop;
|
|
58
|
+
defaultMatches.title = match;
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
|
|
@@ -60,7 +67,7 @@ export function filterItems(items, query, options) {
|
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
array.push({
|
|
63
|
-
|
|
70
|
+
index: i,
|
|
64
71
|
matches: { ...defaultMatches,
|
|
65
72
|
...customMatches
|
|
66
73
|
}
|
|
@@ -72,13 +79,24 @@ export function filterItems(items, query, options) {
|
|
|
72
79
|
export function useFilter(props, items, query) {
|
|
73
80
|
const strQuery = computed(() => typeof (query == null ? void 0 : query.value) !== 'string' && typeof (query == null ? void 0 : query.value) !== 'number' ? '' : String(query.value));
|
|
74
81
|
const filteredItems = computed(() => {
|
|
75
|
-
|
|
82
|
+
const transformedItems = unref(items);
|
|
83
|
+
const matches = filterItems(transformedItems, strQuery.value, {
|
|
76
84
|
customKeyFilter: props.customKeyFilter,
|
|
77
85
|
default: props.customFilter,
|
|
78
86
|
filterKeys: props.filterKeys,
|
|
79
87
|
filterMode: props.filterMode,
|
|
80
88
|
noFilter: props.noFilter
|
|
81
89
|
});
|
|
90
|
+
return matches.map(_ref => {
|
|
91
|
+
let {
|
|
92
|
+
index,
|
|
93
|
+
matches
|
|
94
|
+
} = _ref;
|
|
95
|
+
return {
|
|
96
|
+
item: transformedItems[index],
|
|
97
|
+
matches
|
|
98
|
+
};
|
|
99
|
+
});
|
|
82
100
|
});
|
|
83
101
|
return {
|
|
84
102
|
filteredItems
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"filter.mjs","names":["getPropertyFromItem","propsFactory","wrapInArray","computed","unref","defaultFilter","value","query","item","toString","toLocaleLowerCase","indexOf","makeFilterProps","customFilter","Function","customKeyFilter","Object","filterKeys","Array","String","filterMode","type","default","noFilter","Boolean","filterItems","items","options","array","filter","keys","customFiltersLength","length","loop","i","customMatches","defaultMatches","match","key","keyFilter","title","defaultMatchesLength","customMatchesLength","push","index","matches","useFilter","props","strQuery","filteredItems","transformedItems","map"],"sources":["../../src/composables/filter.ts"],"sourcesContent":["/* eslint-disable max-statements */\n/* eslint-disable no-labels */\n\n// Utilities\nimport { getPropertyFromItem, propsFactory, wrapInArray } from '@/util'\nimport { computed, unref } from 'vue'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\nimport type { InternalItem } from './items'\n\n/**\n * - match without highlight\n * - single match (index), length already known\n * - single match (start, end)\n * - multiple matches (start, end), probably shouldn't overlap\n */\nexport type FilterMatch = boolean | number | [number, number] | [number, number][]\nexport type FilterFunction = (value: string, query: string, item?: any) => FilterMatch\nexport type FilterKeyFunctions = Record<string, FilterFunction>\nexport type FilterKeys = string | string[]\nexport type FilterMode = 'some' | 'every' | 'union' | 'intersection'\n\nexport interface FilterProps {\n customFilter?: FilterFunction\n customKeyFilter?: FilterKeyFunctions\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n}\n\n// Composables\nexport const defaultFilter: FilterFunction = (value, query, item) => {\n if (value == null || query == null) return -1\n\n return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase())\n}\n\nexport const makeFilterProps = propsFactory({\n customFilter: Function as PropType<FilterFunction>,\n customKeyFilter: Object as PropType<FilterKeyFunctions>,\n filterKeys: [Array, String] as PropType<FilterKeys>,\n filterMode: {\n type: String as PropType<FilterMode>,\n default: 'intersection',\n },\n noFilter: Boolean,\n}, 'filter')\n\nexport function filterItems (\n items: any[],\n query: string,\n options?: {\n customKeyFilter?: FilterKeyFunctions\n default?: FilterFunction\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n },\n) {\n const array: { index: number, matches: Record<string, FilterMatch> }[] = []\n // always ensure we fall back to a functioning filter\n const filter = options?.default ?? defaultFilter\n const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false\n const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length\n\n if (!items?.length) return array\n\n loop:\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n const customMatches: Record<string, FilterMatch> = {}\n const defaultMatches: Record<string, FilterMatch> = {}\n let match: FilterMatch = -1\n\n if (query && !options?.noFilter) {\n if (typeof item === 'object') {\n const filterKeys = keys || Object.keys(item)\n\n for (const key of filterKeys) {\n const value = getPropertyFromItem(item as any, key, item)\n const keyFilter = options?.customKeyFilter?.[key]\n\n match = keyFilter\n ? keyFilter(value, query, item)\n : filter(value, query, item)\n\n if (match !== -1 && match !== false) {\n if (keyFilter) customMatches[key] = match\n else defaultMatches[key] = match\n } else if (options?.filterMode === 'every') {\n continue loop\n }\n }\n } else {\n match = filter(item, query, item)\n if (match !== -1 && match !== false) {\n defaultMatches.title = match\n }\n }\n\n const defaultMatchesLength = Object.keys(defaultMatches).length\n const customMatchesLength = Object.keys(customMatches).length\n\n if (!defaultMatchesLength && !customMatchesLength) continue\n\n if (\n options?.filterMode === 'union' &&\n customMatchesLength !== customFiltersLength &&\n !defaultMatchesLength\n ) continue\n\n if (\n options?.filterMode === 'intersection' &&\n (\n customMatchesLength !== customFiltersLength ||\n !defaultMatchesLength\n )\n ) continue\n }\n\n array.push({ index: i, matches: { ...defaultMatches, ...customMatches } })\n }\n\n return array\n}\n\nexport function useFilter (\n props: FilterProps,\n items: MaybeRef<InternalItem[]>,\n query?: Ref<string | undefined>,\n) {\n const strQuery = computed(() => (\n typeof query?.value !== 'string' &&\n typeof query?.value !== 'number'\n ) ? '' : String(query.value))\n\n const filteredItems = computed(() => {\n const transformedItems = unref(items)\n const matches = filterItems(\n transformedItems,\n strQuery.value,\n {\n customKeyFilter: props.customKeyFilter,\n default: props.customFilter,\n filterKeys: props.filterKeys,\n filterMode: props.filterMode,\n noFilter: props.noFilter,\n },\n )\n\n return matches.map(({ index, matches }) => ({\n item: transformedItems[index],\n matches,\n }))\n })\n\n return { filteredItems }\n}\n"],"mappings":"AAAA;;AACA;AAEA;SACSA,mB,EAAqBC,Y,EAAcC,W;AAC5C,SAASC,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC,C,CAEA;;AAyBA;AACA,OAAO,MAAMC,aAA6B,GAAG,CAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf,KAAwB;EACnE,IAAIF,KAAK,IAAI,IAAT,IAAiBC,KAAK,IAAI,IAA9B,EAAoC,OAAO,CAAC,CAAR;EAEpC,OAAOD,KAAK,CAACG,QAAN,GAAiBC,iBAAjB,GAAqCC,OAArC,CAA6CJ,KAAK,CAACE,QAAN,GAAiBC,iBAAjB,EAA7C,CAAP;AACD,CAJM;AAMP,OAAO,MAAME,eAAe,GAAGX,YAAY,CAAC;EAC1CY,YAAY,EAAEC,QAD4B;EAE1CC,eAAe,EAAEC,MAFyB;EAG1CC,UAAU,EAAE,CAACC,KAAD,EAAQC,MAAR,CAH8B;EAI1CC,UAAU,EAAE;IACVC,IAAI,EAAEF,MADI;IAEVG,OAAO,EAAE;EAFC,CAJ8B;EAQ1CC,QAAQ,EAAEC;AARgC,CAAD,EASxC,QATwC,CAApC;AAWP,OAAO,SAASC,WA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E,EAAE,GAAGT,cAAL;QAAqB,GAAGD;MAAxB;IAArB,CAAX;EACD;;EAED,OAAOP,KAAP;AACD;AAED,OAAO,SAASkB,SAAT,CACLC,KADK,EAELrB,KAFK,EAGLnB,KAHK,EAIL;EACA,MAAMyC,QAAQ,GAAG7C,QAAQ,CAAC,MACxB,QAAOI,KAAP,oBAAOA,KAAK,CAAED,KAAd,MAAwB,QAAxB,IACA,QAAOC,KAAP,oBAAOA,KAAK,CAAED,KAAd,MAAwB,QAFM,GAG5B,EAH4B,GAGvBa,MAAM,CAACZ,KAAK,CAACD,KAAP,CAHU,CAAzB;EAKA,MAAM2C,aAAa,GAAG9C,QAAQ,CAAC,MAAM;IACnC,MAAM+C,gBAAgB,GAAG9C,KAAK,CAACsB,KAAD,CAA9B;IACA,MAAMmB,OAAO,GAAGpB,WAAW,CACzByB,gBADyB,EAEzBF,QAAQ,CAAC1C,KAFgB,EAGzB;MACES,eAAe,EAAEgC,KAAK,CAAChC,eADzB;MAEEO,OAAO,EAAEyB,KAAK,CAAClC,YAFjB;MAGEI,UAAU,EAAE8B,KAAK,CAAC9B,UAHpB;MAIEG,UAAU,EAAE2B,KAAK,CAAC3B,UAJpB;MAKEG,QAAQ,EAAEwB,KAAK,CAACxB;IALlB,CAHyB,CAA3B;IAYA,OAAOsB,OAAO,CAACM,GAAR,CAAY;MAAA,IAAC;QAAEP,KAAF;QAASC;MAAT,CAAD;MAAA,OAAyB;QAC1CrC,IAAI,EAAE0C,gBAAgB,CAACN,KAAD,CADoB;QAE1CC;MAF0C,CAAzB;IAAA,CAAZ,CAAP;EAID,CAlB6B,CAA9B;EAoBA,OAAO;IAAEI;EAAF,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"focus.mjs","names":["useProxiedModel","computed","getCurrentInstanceName","propsFactory","makeFocusProps","focused","Boolean","useFocus","props","name","isFocused","focusClasses","value","focus","blur"],"sources":["../../src/composables/focus.ts"],"sourcesContent":["// Components\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nexport interface FocusProps {\n focused: boolean\n 'onUpdate:focused': ((val: boolean) => void) | undefined\n}\n\n// Composables\nexport const makeFocusProps = propsFactory({\n focused: Boolean,\n}, 'focus')\n\nexport function useFocus (\n props: FocusProps,\n name = getCurrentInstanceName()\n) {\n const isFocused = useProxiedModel(props, 'focused')\n const focusClasses = computed(() => {\n return ({\n [`${name}--focused`]: isFocused.value,\n })\n })\n\n function focus () {\n isFocused.value = true\n }\n\n function blur () {\n isFocused.value = false\n }\n\n return { focusClasses, isFocused, focus, blur }\n}\n"],"mappings":"AAAA;SACSA,e,8BAET;;AACA,SAASC,QAAT,QAAyB,KAAzB;SACSC,sB,EAAwBC,Y,6BAEjC;;AAMA;AACA,OAAO,MAAMC,cAAc,GAAGD,YAAY,CAAC;EACzCE,OAAO,EAAEC;AADgC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,OAAO,SAASC,QAAT,CACLC,KADK,EAGL;EAAA,IADAC,IACA,uEADOP,sBAAsB,EAC7B;EACA,MAAMQ,SAAS,GAAGV,eAAe,CAACQ,KAAD,EAAQ,SAAR,CAAjC;EACA,MAAMG,YAAY,GAAGV,QAAQ,CAAC,MAAM;IAClC,OAAQ;MACN,CAAE,GAAEQ,IAAK,WAAT,GAAsBC,SAAS,CAACE;IAD1B,CAAR;EAGD,CAJ4B,CAA7B;;EAMA,SAASC,KAAT,GAAkB;IAChBH,SAAS,CAACE,KAAV,GAAkB,IAAlB;EACD;;EAED,SAASE,IAAT,GAAiB;IACfJ,SAAS,CAACE,KAAV,GAAkB,KAAlB;EACD;;EAED,OAAO;IAAED,YAAF;IAAgBD,SAAhB;IAA2BG,KAA3B;IAAkCC;EAAlC,CAAP;AACD"}
|
package/lib/composables/form.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Utilities
|
|
2
|
-
import { computed, inject, provide, ref } from 'vue';
|
|
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
5
|
|
|
@@ -20,13 +20,12 @@ export function createForm(props) {
|
|
|
20
20
|
const isReadonly = computed(() => props.readonly);
|
|
21
21
|
const isValidating = ref(false);
|
|
22
22
|
const items = ref([]);
|
|
23
|
-
const
|
|
23
|
+
const errors = ref([]);
|
|
24
24
|
|
|
25
25
|
async function validate() {
|
|
26
26
|
const results = [];
|
|
27
27
|
let valid = true;
|
|
28
|
-
|
|
29
|
-
model.value = null;
|
|
28
|
+
errors.value = [];
|
|
30
29
|
isValidating.value = true;
|
|
31
30
|
|
|
32
31
|
for (const item of items.value) {
|
|
@@ -43,12 +42,11 @@ export function createForm(props) {
|
|
|
43
42
|
if (!valid && props.fastFail) break;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
model.value = valid;
|
|
45
|
+
errors.value = results;
|
|
48
46
|
isValidating.value = false;
|
|
49
47
|
return {
|
|
50
48
|
valid,
|
|
51
|
-
|
|
49
|
+
errors: errors.value
|
|
52
50
|
};
|
|
53
51
|
}
|
|
54
52
|
|
|
@@ -59,12 +57,39 @@ export function createForm(props) {
|
|
|
59
57
|
|
|
60
58
|
function resetValidation() {
|
|
61
59
|
items.value.forEach(item => item.resetValidation());
|
|
62
|
-
|
|
60
|
+
errors.value = [];
|
|
63
61
|
model.value = null;
|
|
64
62
|
}
|
|
65
63
|
|
|
64
|
+
watch(items, () => {
|
|
65
|
+
let valid = 0;
|
|
66
|
+
let invalid = 0;
|
|
67
|
+
const results = [];
|
|
68
|
+
|
|
69
|
+
for (const item of items.value) {
|
|
70
|
+
if (item.isValid === false) {
|
|
71
|
+
invalid++;
|
|
72
|
+
results.push({
|
|
73
|
+
id: item.id,
|
|
74
|
+
errorMessages: item.errorMessages
|
|
75
|
+
});
|
|
76
|
+
} else if (item.isValid === true) valid++;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
errors.value = results;
|
|
80
|
+
model.value = invalid > 0 ? false : valid === items.value.length ? true : null;
|
|
81
|
+
}, {
|
|
82
|
+
deep: true
|
|
83
|
+
});
|
|
66
84
|
provide(FormKey, {
|
|
67
|
-
register:
|
|
85
|
+
register: _ref => {
|
|
86
|
+
let {
|
|
87
|
+
id,
|
|
88
|
+
validate,
|
|
89
|
+
reset,
|
|
90
|
+
resetValidation
|
|
91
|
+
} = _ref;
|
|
92
|
+
|
|
68
93
|
if (items.value.some(item => item.id === id)) {
|
|
69
94
|
consoleWarn(`Duplicate input name "${id}"`);
|
|
70
95
|
}
|
|
@@ -73,7 +98,9 @@ export function createForm(props) {
|
|
|
73
98
|
id,
|
|
74
99
|
validate,
|
|
75
100
|
reset,
|
|
76
|
-
resetValidation
|
|
101
|
+
resetValidation,
|
|
102
|
+
isValid: null,
|
|
103
|
+
errorMessages: []
|
|
77
104
|
});
|
|
78
105
|
},
|
|
79
106
|
unregister: id => {
|
|
@@ -81,13 +108,19 @@ export function createForm(props) {
|
|
|
81
108
|
return item.id !== id;
|
|
82
109
|
});
|
|
83
110
|
},
|
|
111
|
+
update: (id, isValid, errorMessages) => {
|
|
112
|
+
const found = items.value.find(item => item.id === id);
|
|
113
|
+
if (!found) return;
|
|
114
|
+
found.isValid = isValid;
|
|
115
|
+
found.errorMessages = errorMessages;
|
|
116
|
+
},
|
|
84
117
|
isDisabled,
|
|
85
118
|
isReadonly,
|
|
86
119
|
isValidating,
|
|
87
120
|
items
|
|
88
121
|
});
|
|
89
122
|
return {
|
|
90
|
-
|
|
123
|
+
errors,
|
|
91
124
|
isDisabled,
|
|
92
125
|
isReadonly,
|
|
93
126
|
isValidating,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyCC,KAAzC,QAAsD,KAAtD;SACSC,e;SACAC,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AASW,OAAT,GAAoB;EACzB,OAAOlD,MAAM,CAACO,OAAD,EAAU,IAAV,CAAb;AACD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const Refs = Symbol('Forwarded refs');
|
|
2
|
+
/** Omit properties starting with P */
|
|
3
|
+
|
|
4
|
+
export function forwardRefs(target) {
|
|
5
|
+
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
6
|
+
refs[_key - 1] = arguments[_key];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
target[Refs] = refs;
|
|
10
|
+
return new Proxy(target, {
|
|
11
|
+
get(target, key) {
|
|
12
|
+
if (Reflect.has(target, key)) {
|
|
13
|
+
return Reflect.get(target, key);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
for (const ref of refs) {
|
|
17
|
+
if (ref.value && Reflect.has(ref.value, key)) {
|
|
18
|
+
const val = Reflect.get(ref.value, key);
|
|
19
|
+
return typeof val === 'function' ? val.bind(ref.value) : val;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
getOwnPropertyDescriptor(target, key) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
|
|
26
|
+
if (descriptor) return descriptor; // Skip internal properties
|
|
27
|
+
|
|
28
|
+
if (typeof key === 'symbol' || key.startsWith('__')) return; // Check each ref's own properties
|
|
29
|
+
|
|
30
|
+
for (const ref of refs) {
|
|
31
|
+
if (!ref.value) continue;
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
|
|
33
|
+
if (descriptor) return descriptor;
|
|
34
|
+
|
|
35
|
+
if ('_' in ref.value && 'setupState' in ref.value._) {
|
|
36
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
|
|
37
|
+
if (descriptor) return descriptor;
|
|
38
|
+
}
|
|
39
|
+
} // Recursive search up each ref's prototype
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
for (const ref of refs) {
|
|
43
|
+
let obj = ref.value && Object.getPrototypeOf(ref.value);
|
|
44
|
+
|
|
45
|
+
while (obj) {
|
|
46
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
|
|
47
|
+
if (descriptor) return descriptor;
|
|
48
|
+
obj = Object.getPrototypeOf(obj);
|
|
49
|
+
}
|
|
50
|
+
} // Call forwarded refs' proxies
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
for (const ref of refs) {
|
|
54
|
+
const childRefs = ref.value && ref.value[Refs];
|
|
55
|
+
if (!childRefs) continue;
|
|
56
|
+
const queue = childRefs.slice();
|
|
57
|
+
|
|
58
|
+
while (queue.length) {
|
|
59
|
+
const ref = queue.shift();
|
|
60
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
|
|
61
|
+
if (descriptor) return descriptor;
|
|
62
|
+
const childRefs = ref.value && ref.value[Refs];
|
|
63
|
+
if (childRefs) queue.push(...childRefs);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=forwardRefs.mjs.map
|
|
@@ -0,0 +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> = Omit<T, keyof T extends `${P}${any}` ? keyof T : never>\n\nexport function forwardRefs<T extends {}, U extends Ref<HTMLElement | Omit<ComponentPublicInstance, '$emit'> | undefined>[]> (\n target: T,\n ...refs: U\n): T & OmitPrefix<UnwrapRef<UnionToIntersection<U[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,gBAAD,CAAnB;AAEA;;AAGA,OAAO,SAASC,WAAT,CACLC,MADK,EAG2D;EAAA,kCAD7DC,IAC6D;IAD7DA,IAC6D;EAAA;;EA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CAACI,IAAN,CAAW,GAAGL,SAAd;QAChB;MACF;;MACD,OAAOM,SAAP;IACD;;EAtDsB,CAAlB,CAAP;AAwDD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Composables
|
|
2
2
|
import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
|
|
3
3
|
|
|
4
|
-
import { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef } from 'vue';
|
|
4
|
+
import { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue';
|
|
5
5
|
import { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
|
|
6
6
|
|
|
7
7
|
export const makeGroupProps = propsFactory({
|
|
@@ -50,10 +50,11 @@ export function useGroupItem(props, injectKey) {
|
|
|
50
50
|
const isSelected = computed(() => {
|
|
51
51
|
return group.isSelected(id);
|
|
52
52
|
});
|
|
53
|
-
const selectedClass = computed(() =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass]);
|
|
54
|
+
watch(isSelected, value => {
|
|
55
|
+
vm.emit('group:selected', {
|
|
56
|
+
value
|
|
57
|
+
});
|
|
57
58
|
});
|
|
58
59
|
return {
|
|
59
60
|
id,
|
|
@@ -123,12 +124,10 @@ export function useGroup(props, injectKey) {
|
|
|
123
124
|
if (value && item != null && item.disabled) return;
|
|
124
125
|
|
|
125
126
|
if (props.multiple) {
|
|
126
|
-
var _value;
|
|
127
|
-
|
|
128
127
|
const internalValue = selected.value.slice();
|
|
129
128
|
const index = internalValue.findIndex(v => v === id);
|
|
130
129
|
const isSelected = ~index;
|
|
131
|
-
value =
|
|
130
|
+
value = value ?? !isSelected; // We can't remove value if group is
|
|
132
131
|
// mandatory, value already exists,
|
|
133
132
|
// and it is the only value
|
|
134
133
|
|
|
@@ -139,11 +138,9 @@ export function useGroup(props, injectKey) {
|
|
|
139
138
|
if (index < 0 && value) internalValue.push(id);else if (index >= 0 && !value) internalValue.splice(index, 1);
|
|
140
139
|
selected.value = internalValue;
|
|
141
140
|
} else {
|
|
142
|
-
var _value2;
|
|
143
|
-
|
|
144
141
|
const isSelected = selected.value.includes(id);
|
|
145
142
|
if (props.mandatory && isSelected) return;
|
|
146
|
-
selected.value =
|
|
143
|
+
selected.value = value ?? !isSelected ? [id] : [];
|
|
147
144
|
}
|
|
148
145
|
}
|
|
149
146
|
|
|
@@ -180,12 +177,19 @@ export function useGroup(props, injectKey) {
|
|
|
180
177
|
next: () => step(1),
|
|
181
178
|
isSelected: id => selected.value.includes(id),
|
|
182
179
|
selectedClass: computed(() => props.selectedClass),
|
|
183
|
-
items: computed(() => items)
|
|
180
|
+
items: computed(() => items),
|
|
181
|
+
getItemIndex: value => getItemIndex(items, value)
|
|
184
182
|
};
|
|
185
183
|
provide(injectKey, state);
|
|
186
184
|
return state;
|
|
187
185
|
}
|
|
188
186
|
|
|
187
|
+
function getItemIndex(items, value) {
|
|
188
|
+
const ids = getIds(items, [value]);
|
|
189
|
+
if (!ids.length) return -1;
|
|
190
|
+
return items.findIndex(item => item.id === ids[0]);
|
|
191
|
+
}
|
|
192
|
+
|
|
189
193
|
function getIds(items, modelValue) {
|
|
190
194
|
const ids = [];
|
|
191
195
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/composables/group.ts"],"names":["useProxiedModel","computed","inject","onBeforeUnmount","onMounted","provide","reactive","toRef","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","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","ids","values"],"mappings":"AAAA;SACSA,e,8BAET;;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,eAA3B,EAA4CC,SAA5C,EAAuDC,OAAvD,EAAgEC,QAAhE,EAA0EC,KAA1E,QAAuF,KAAvF;SACSC,W,EAAaC,S,EAAWC,uB,EAAyBC,kB,EAAoBC,M,EAAQC,Y,EAAcC,W,6BAEpG;;AA+CA,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;AACzCG,EAAAA,UAAU,EAAE;AACVC,IAAAA,IAAI,EAAE,IADI;AAEVC,IAAAA,OAAO,EAAEC;AAFC,GAD6B;AAKzCC,EAAAA,QAAQ,EAAEC,OAL+B;AAMzCC,EAAAA,SAAS,EAAE,CAACD,OAAD,EAAUE,MAAV,CAN8B;AAOzCC,EAAAA,GAAG,EAAEC,MAPoC;AAQzCC,EAAAA,aAAa,EAAEH,MAR0B;AASzCI,EAAAA,QAAQ,EAAEN;AAT+B,CAAD,EAUvC,OAVuC,CAAnC;AAYP,OAAO,MAAMO,kBAAkB,GAAGf,YAAY,CAAC;AAC7CgB,EAAAA,KAAK,EAAE,IADsC;AAE7CF,EAAAA,QAAQ,EAAEN,OAFmC;AAG7CK,EAAAA,aAAa,EAAEH;AAH8B,CAAD,EAI3C,YAJ2C,CAAvC;AAmBP,OAAO,SAASO,YAAT,CACLC,KADK,EAELC,SAFK,EAIoB;AAAA,MADzBC,QACyB,uEADd,IACc;AACzB,QAAMC,EAAE,GAAGvB,kBAAkB,CAAC,cAAD,CAA7B;;AAEA,MAAI,CAACuB,EAAL,EAAS;AACP,UAAM,IAAIC,KAAJ,CACJ,kFADI,CAAN;AAGD;;AAED,QAAMC,EAAE,GAAGxB,MAAM,EAAjB;AAEAP,EAAAA,OAAO,CAACgC,MAAM,CAACC,GAAP,CAAY,GAAEN,SAAS,CAACO,WAAY,KAApC,CAAD,EAA4CH,EAA5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c,IAAd,GAAqB0B,IAAI,CAAC1B,KAA1B,GAAkC8C,CAA9C;AACD;AACF;;AAED,SAAOO,MAAP;AACD","sourcesContent":["// Composables\nimport { useProxiedModel } from './proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef } 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<any[]>\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}\n\nexport interface GroupItemProvide {\n id: number\n isSelected: Ref<boolean>\n toggle: () => void\n select: (value: boolean) => void\n selectedClass: Ref<string | false | undefined>\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 type GroupItemProps = ExtractPropTypes<ReturnType<typeof makeGroupItemProps>>\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 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 = {\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 }\n\n provide(injectKey, state)\n\n return state\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"],"file":"group.mjs"}
|
|
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,EAAEN;AAT+B,CAAD,EAUvC,OAVuC,CAAnC;AAYP,OAAO,MAAMO,k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