@vuetify/nightly 3.0.0-beta.2 → 3.0.0-beta.5
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 +13 -45
- package/dist/_component-variables.sass +61 -0
- package/dist/json/attributes.json +398 -370
- package/dist/json/importMap.json +207 -219
- package/dist/json/tags.json +99 -121
- package/dist/json/web-types.json +1246 -1055
- package/dist/vuetify.css +994 -858
- package/dist/vuetify.d.ts +8241 -5547
- package/dist/vuetify.esm.js +8872 -8039
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +8871 -8038
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +1142 -1077
- 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 +5 -5
- package/lib/components/VAlert/VAlert.mjs +19 -8
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.sass +0 -2
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.css +2 -5
- package/lib/components/VApp/VApp.mjs +3 -4
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +11 -12
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VApp/variables.scss +6 -0
- package/lib/components/VAppBar/VAppBar.mjs +8 -7
- 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.mjs +76 -53
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +0 -2
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.css +1 -1
- package/lib/components/VAvatar/VAvatar.mjs +3 -2
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +1 -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 +21 -48
- 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 +7 -7
- package/lib/components/VBanner/VBanner.mjs +34 -22
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.sass +6 -8
- package/lib/components/VBanner/VBannerActions.mjs +1 -1
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/VBannerText.mjs.map +1 -1
- package/lib/components/VBanner/index.mjs +0 -2
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +5 -12
- 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.mjs +31 -15
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +0 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +5 -8
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.css +83 -24
- package/lib/components/VBtn/VBtn.mjs +80 -31
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +57 -8
- package/lib/components/VBtn/_variables.scss +7 -4
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.css +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.sass +0 -1
- 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.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 +91 -73
- package/lib/components/VCard/VCard.mjs +61 -70
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +71 -59
- package/lib/components/VCard/VCardActions.mjs +1 -1
- 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 +39 -24
- package/lib/components/VCard/index.mjs +1 -5
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +5 -3
- 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 +13 -45
- 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 +142 -65
- package/lib/components/VChip/VChip.mjs +80 -41
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +6 -1
- package/lib/components/VChip/_mixins.scss +26 -6
- package/lib/components/VChip/_variables.scss +1 -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.mjs +16 -10
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +5 -4
- 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 +4 -3
- 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.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +82 -66
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +0 -2
- 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.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.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 +2 -6
- package/lib/components/VDialog/VDialog.mjs +29 -25
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +1 -6
- package/lib/components/VDialog/_variables.scss +0 -2
- 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 +8 -7
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +6 -4
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +0 -1
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +7 -6
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- 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 +9 -9
- package/lib/components/VField/VField.mjs +24 -15
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +6 -8
- package/lib/components/VField/VFieldLabel.mjs +8 -9
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/_variables.scss +3 -3
- package/lib/components/VField/index.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.mjs +3 -2
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +0 -1
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.mjs +5 -4
- 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 +3 -3
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.mjs.map +1 -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.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 +0 -8
- package/lib/components/VIcon/VIcon.mjs +21 -24
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.sass +0 -9
- package/lib/components/VIcon/_variables.scss +2 -5
- package/lib/components/VIcon/index.mjs.map +1 -1
- 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/VInput.mjs +13 -8
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +0 -1
- package/lib/components/VInput/index.mjs.map +1 -1
- 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.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.mjs.map +1 -1
- 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 +0 -6
- package/lib/components/VList/VList.mjs +62 -48
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +0 -2
- package/lib/components/VList/VListChildren.mjs +43 -5
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +18 -7
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +14 -13
- package/lib/components/VList/VListItem.mjs +25 -19
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +1 -2
- package/lib/components/VList/VListItemAction.mjs +8 -9
- package/lib/components/VList/VListItemAction.mjs.map +1 -1
- package/lib/components/VList/VListItemAvatar.mjs +4 -3
- package/lib/components/VList/VListItemAvatar.mjs.map +1 -1
- package/lib/components/VList/VListItemHeader.mjs.map +1 -1
- package/lib/components/VList/VListItemIcon.mjs +4 -3
- package/lib/components/VList/VListItemIcon.mjs.map +1 -1
- package/lib/components/VList/VListItemMedia.mjs +4 -3
- package/lib/components/VList/VListItemMedia.mjs.map +1 -1
- package/lib/components/VList/VListItemSubtitle.mjs.map +1 -1
- package/lib/components/VList/VListItemTitle.mjs.map +1 -1
- package/lib/components/VList/VListSubheader.mjs +7 -6
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/_variables.scss +0 -1
- package/lib/components/VList/index.mjs +2 -2
- 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.mjs +4 -3
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +0 -1
- package/lib/components/VMain/_variables.scss +1 -1
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.mjs +10 -6
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +0 -1
- package/lib/components/VMenu/_variables.scss +0 -1
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs.map +1 -1
- 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.mjs +17 -11
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +0 -1
- package/lib/components/VNavigationDrawer/_variables.scss +2 -1
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- 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 +0 -1
- package/lib/components/VOverlay/VOverlay.mjs +54 -28
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +0 -2
- package/lib/components/VOverlay/_variables.scss +0 -1
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +395 -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 +2 -2
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +11 -4
- 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 +22 -17
- 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 +5 -5
- 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.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 +5 -3
- package/lib/components/VRadio/VRadio.mjs.map +1 -1
- package/lib/components/VRadio/index.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +10 -5
- 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 +12 -13
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +9 -7
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/VRating.sass +2 -1
- 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.mjs +90 -38
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +0 -2
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.css +1 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs +17 -14
- 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 +5 -4
- 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.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.mjs +48 -49
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.sass +0 -1
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +4 -3
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/_variables.scss +0 -5
- 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.mjs +7 -9
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +0 -2
- package/lib/components/VSlider/VSliderThumb.mjs +6 -5
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.sass +0 -2
- package/lib/components/VSlider/VSliderTrack.mjs +13 -11
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.sass +0 -2
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +4 -4
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.css +5 -23
- package/lib/components/VSnackbar/VSnackbar.mjs +55 -52
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.sass +0 -19
- package/lib/components/VSnackbar/_variables.scss +2 -0
- 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.mjs +8 -2
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +0 -1
- package/lib/components/VSwitch/_variables.scss +1 -0
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.mjs +5 -13
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.sass +0 -1
- package/lib/components/VSystemBar/_variables.scss +2 -1
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.mjs +9 -8
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +0 -1
- package/lib/components/VTable/_variables.scss +2 -0
- package/lib/components/VTable/index.mjs.map +1 -1
- package/lib/components/VTabs/VTab.css +1 -1
- package/lib/components/VTabs/VTab.mjs +6 -5
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +1 -2
- package/lib/components/VTabs/VTabs.css +8 -9
- package/lib/components/VTabs/VTabs.mjs +9 -7
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +4 -6
- package/lib/components/VTabs/_variables.scss +2 -0
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.mjs +10 -7
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +0 -1
- package/lib/components/VTextField/_variables.scss +1 -1
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +4 -4
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +0 -2
- package/lib/components/VTextarea/_variables.scss +1 -0
- 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.mjs +24 -25
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +3 -3
- package/lib/components/VTimeline/VTimelineDivider.mjs +42 -38
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +12 -12
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_variables.scss +11 -6
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.css +15 -6
- package/lib/components/VToolbar/VToolbar.mjs +25 -18
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +15 -7
- package/lib/components/VToolbar/VToolbarItems.mjs +12 -8
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
- package/lib/components/VToolbar/_variables.scss +6 -2
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.mjs +44 -40
- 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.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 +6 -6
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.sass +0 -2
- package/lib/components/VWindow/VWindowItem.mjs +18 -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 +6631 -3928
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +64 -8
- 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.map +1 -1
- package/lib/composables/border.mjs +5 -6
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs.map +1 -1
- 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 +33 -13
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +6 -6
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRef.mjs.map +1 -1
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/icons.mjs +15 -3
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/items.mjs +39 -11
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/layout.mjs +3 -3
- 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 +11 -8
- 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.map +1 -1
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- 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.map +1 -1
- package/lib/composables/refs.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +25 -23
- package/lib/composables/router.mjs.map +1 -1
- 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.map +1 -1
- package/lib/composables/selectLink.mjs.map +1 -1
- package/lib/composables/size.mjs +2 -2
- 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 +23 -22
- 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 +94 -93
- 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.map +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +15 -7
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +5 -3
- 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.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.map +1 -1
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +36 -26
- 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 +151 -145
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/adapters/vue-intl.mjs.map +1 -1
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs.map +1 -1
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/tools/_states.sass +9 -2
- package/lib/styles/tools/_utilities.sass +1 -1
- package/lib/styles/tools/_variant.sass +6 -6
- package/lib/util/anchor.mjs +58 -0
- package/lib/util/anchor.mjs.map +1 -0
- package/lib/util/animation.mjs +2 -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.map +1 -1
- package/lib/util/colors.mjs.map +1 -1
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- 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 +19 -0
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/lib/util/globals.mjs +0 -3
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +10 -6
- 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/isFixedPosition.mjs.map +1 -1
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +32 -26
- package/lib/components/VBanner/VBannerAvatar.mjs +0 -20
- package/lib/components/VBanner/VBannerAvatar.mjs.map +0 -1
- package/lib/components/VBanner/VBannerIcon.mjs +0 -20
- package/lib/components/VBanner/VBannerIcon.mjs.map +0 -1
- 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/VCardContent.mjs +0 -3
- package/lib/components/VCard/VCardContent.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/VOverlay/positionStrategies.mjs +0 -207
- 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/overlay.mjs +0 -34
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Utilities
|
|
2
|
-
import { computed, inject, provide, ref, watch, watchEffect } from 'vue';
|
|
2
|
+
import { computed, inject, provide, reactive, ref, watch, watchEffect } from 'vue';
|
|
3
3
|
import { colorToInt, colorToRGB, createRange, darken, getCurrentInstance, getLuma, IN_BROWSER, intToHex, lighten, mergeDeep, propsFactory } from "../util/index.mjs";
|
|
4
4
|
import { APCAcontrast } from "../util/color/APCA.mjs"; // Types
|
|
5
5
|
|
|
@@ -86,49 +86,54 @@ const defaultThemeOptions = {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
var _options$themes;
|
|
91
|
-
|
|
89
|
+
function parseThemeOptions() {
|
|
92
90
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultThemeOptions;
|
|
93
91
|
if (!options) return { ...defaultThemeOptions,
|
|
94
92
|
isDisabled: true
|
|
95
93
|
};
|
|
96
|
-
const themes =
|
|
97
|
-
|
|
94
|
+
const themes = {};
|
|
95
|
+
|
|
96
|
+
for (const [key, theme] of Object.entries((_options$themes = options.themes) != null ? _options$themes : {})) {
|
|
97
|
+
var _options$themes, _defaultThemeOptions$, _defaultThemeOptions$2;
|
|
98
98
|
|
|
99
|
-
let [key, theme] = _ref;
|
|
100
99
|
const defaultTheme = theme.dark ? (_defaultThemeOptions$ = defaultThemeOptions.themes) == null ? void 0 : _defaultThemeOptions$.dark : (_defaultThemeOptions$2 = defaultThemeOptions.themes) == null ? void 0 : _defaultThemeOptions$2.light;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
themes[key] = mergeDeep(defaultTheme, theme);
|
|
101
|
+
}
|
|
102
|
+
|
|
104
103
|
return mergeDeep(defaultThemeOptions, { ...options,
|
|
105
104
|
themes
|
|
106
105
|
});
|
|
107
|
-
}
|
|
106
|
+
} // Composables
|
|
108
107
|
|
|
109
108
|
|
|
110
109
|
export function createTheme(app, options) {
|
|
111
110
|
const head = app._context.provides.usehead;
|
|
112
|
-
const parsedOptions = parseThemeOptions(options);
|
|
113
|
-
const
|
|
114
|
-
const current = ref(parsedOptions.defaultTheme);
|
|
111
|
+
const parsedOptions = reactive(parseThemeOptions(options));
|
|
112
|
+
const name = ref(parsedOptions.defaultTheme);
|
|
115
113
|
const themes = ref(parsedOptions.themes);
|
|
116
|
-
const variations = ref(parsedOptions.variations);
|
|
117
114
|
const computedThemes = computed(() => {
|
|
118
|
-
|
|
119
|
-
var _parsedOptions$variat;
|
|
115
|
+
const acc = {};
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
const theme = { ...original,
|
|
123
|
-
colors: { ...original.colors
|
|
124
|
-
...((_parsedOptions$variat = parsedOptions.variations.colors) != null ? _parsedOptions$variat : []).reduce((obj, color) => {
|
|
125
|
-
return { ...obj,
|
|
126
|
-
...genColorVariations(color, original.colors[color])
|
|
127
|
-
};
|
|
128
|
-
}, {})
|
|
117
|
+
for (const [name, original] of Object.entries(themes.value)) {
|
|
118
|
+
const theme = acc[name] = { ...original,
|
|
119
|
+
colors: { ...original.colors
|
|
129
120
|
}
|
|
130
121
|
};
|
|
131
122
|
|
|
123
|
+
if (parsedOptions.variations) {
|
|
124
|
+
for (const name of parsedOptions.variations.colors) {
|
|
125
|
+
const color = theme.colors[name];
|
|
126
|
+
|
|
127
|
+
for (const variation of ['lighten', 'darken']) {
|
|
128
|
+
const fn = variation === 'lighten' ? lighten : darken;
|
|
129
|
+
|
|
130
|
+
for (const amount of createRange(parsedOptions.variations[variation], 1)) {
|
|
131
|
+
theme.colors[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
132
137
|
for (const color of Object.keys(theme.colors)) {
|
|
133
138
|
if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
134
139
|
const onColor = `on-${color}`;
|
|
@@ -146,75 +151,46 @@ export function createTheme(app, options) {
|
|
|
146
151
|
|
|
147
152
|
theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
|
|
148
153
|
}
|
|
149
|
-
|
|
150
|
-
obj[name] = theme;
|
|
151
|
-
return obj;
|
|
152
|
-
}, {});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
function genColorVariations(name, color) {
|
|
156
|
-
const obj = {};
|
|
157
|
-
|
|
158
|
-
for (const variation of ['lighten', 'darken']) {
|
|
159
|
-
const fn = variation === 'lighten' ? lighten : darken;
|
|
160
|
-
|
|
161
|
-
for (const amount of createRange(variations.value[variation], 1)) {
|
|
162
|
-
obj[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount));
|
|
163
|
-
}
|
|
164
154
|
}
|
|
165
155
|
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
|
|
156
|
+
return acc;
|
|
157
|
+
});
|
|
158
|
+
const current = computed(() => computedThemes.value[name.value]);
|
|
169
159
|
const styles = computed(() => {
|
|
170
160
|
const lines = [];
|
|
171
161
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
162
|
+
if (current.value.dark) {
|
|
163
|
+
createCssClass(lines, ':root', ['color-scheme: dark']);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
for (const [themeName, theme] of Object.entries(computedThemes.value)) {
|
|
167
|
+
const {
|
|
168
|
+
variables,
|
|
169
|
+
dark
|
|
170
|
+
} = theme;
|
|
171
|
+
createCssClass(lines, `.v-theme--${themeName}`, [`color-scheme: ${dark ? 'dark' : 'normal'}`, ...genCssVariables(theme), ...Object.keys(variables).map(key => {
|
|
175
172
|
const value = variables[key];
|
|
176
173
|
const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined;
|
|
177
174
|
const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined;
|
|
178
175
|
return `--v-${key}: ${rgb != null ? rgb : value}`;
|
|
179
|
-
})])
|
|
176
|
+
})]);
|
|
180
177
|
}
|
|
181
178
|
|
|
182
179
|
const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)));
|
|
183
180
|
|
|
184
181
|
for (const key of colors) {
|
|
185
182
|
if (/on-[a-z]/.test(key)) {
|
|
186
|
-
|
|
183
|
+
createCssClass(lines, `.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
187
184
|
} else {
|
|
188
|
-
|
|
185
|
+
createCssClass(lines, `.bg-${key}`, [`--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`, `background: rgb(var(--v-theme-${key})) !important`, `color: rgb(var(--v-theme-on-${key})) !important`]);
|
|
186
|
+
createCssClass(lines, `.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
187
|
+
createCssClass(lines, `.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]);
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('');
|
|
193
192
|
});
|
|
194
193
|
|
|
195
|
-
function genCssVariables(name) {
|
|
196
|
-
const theme = computedThemes.value[name];
|
|
197
|
-
if (!theme) throw new Error(`Could not find theme ${name}`);
|
|
198
|
-
const lightOverlay = theme.dark ? 2 : 1;
|
|
199
|
-
const darkOverlay = theme.dark ? 1 : 2;
|
|
200
|
-
const variables = [];
|
|
201
|
-
|
|
202
|
-
for (const [key, value] of Object.entries(theme.colors)) {
|
|
203
|
-
const rgb = colorToRGB(value);
|
|
204
|
-
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
205
|
-
|
|
206
|
-
if (!key.startsWith('on-')) {
|
|
207
|
-
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return variables;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function createCssClass(selector, content) {
|
|
215
|
-
return [`${selector} {\n`, ...content.map(line => ` ${line};\n`), '}\n'];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
194
|
if (head) {
|
|
219
195
|
head.addHeadObjs(computed(() => ({
|
|
220
196
|
style: [{
|
|
@@ -228,49 +204,53 @@ export function createTheme(app, options) {
|
|
|
228
204
|
watchEffect(() => head.updateDOM());
|
|
229
205
|
}
|
|
230
206
|
} else {
|
|
231
|
-
|
|
232
|
-
|
|
207
|
+
let styleEl = IN_BROWSER ? document.getElementById('vuetify-theme-stylesheet') : null;
|
|
208
|
+
watch(styles, updateStyles, {
|
|
233
209
|
immediate: true
|
|
234
210
|
});
|
|
235
211
|
|
|
236
212
|
function updateStyles() {
|
|
237
213
|
if (parsedOptions.isDisabled) return;
|
|
238
|
-
genStyleElement();
|
|
239
|
-
if (styleEl.value) styleEl.value.innerHTML = styles.value;
|
|
240
|
-
}
|
|
241
214
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
215
|
+
if (typeof document !== 'undefined' && !styleEl) {
|
|
216
|
+
const el = document.createElement('style');
|
|
217
|
+
el.type = 'text/css';
|
|
218
|
+
el.id = 'vuetify-theme-stylesheet';
|
|
219
|
+
styleEl = el;
|
|
220
|
+
document.head.appendChild(styleEl);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (styleEl) styleEl.innerHTML = styles.value;
|
|
249
224
|
}
|
|
250
225
|
}
|
|
251
226
|
|
|
227
|
+
const themeClasses = computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${name.value}`);
|
|
252
228
|
return {
|
|
253
229
|
isDisabled: parsedOptions.isDisabled,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
getTheme: key => computedThemes.value[key],
|
|
230
|
+
name,
|
|
231
|
+
themes,
|
|
257
232
|
current,
|
|
258
|
-
|
|
259
|
-
|
|
233
|
+
computedThemes,
|
|
234
|
+
themeClasses,
|
|
235
|
+
styles,
|
|
236
|
+
global: {
|
|
237
|
+
name,
|
|
238
|
+
current
|
|
239
|
+
}
|
|
260
240
|
};
|
|
261
241
|
}
|
|
262
242
|
export function provideTheme(props) {
|
|
263
243
|
getCurrentInstance('provideTheme');
|
|
264
244
|
const theme = inject(ThemeSymbol, null);
|
|
265
245
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
266
|
-
const
|
|
246
|
+
const name = computed(() => {
|
|
267
247
|
var _props$theme;
|
|
268
248
|
|
|
269
|
-
return (_props$theme = props.theme) != null ? _props$theme : theme == null ? void 0 : theme.
|
|
249
|
+
return (_props$theme = props.theme) != null ? _props$theme : theme == null ? void 0 : theme.name.value;
|
|
270
250
|
});
|
|
271
|
-
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${
|
|
251
|
+
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${name.value}`);
|
|
272
252
|
const newTheme = { ...theme,
|
|
273
|
-
|
|
253
|
+
name,
|
|
274
254
|
themeClasses
|
|
275
255
|
};
|
|
276
256
|
provide(ThemeSymbol, newTheme);
|
|
@@ -282,4 +262,25 @@ export function useTheme() {
|
|
|
282
262
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
283
263
|
return theme;
|
|
284
264
|
}
|
|
265
|
+
|
|
266
|
+
function createCssClass(lines, selector, content) {
|
|
267
|
+
lines.push(`${selector} {\n`, ...content.map(line => ` ${line};\n`), '}\n');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function genCssVariables(theme) {
|
|
271
|
+
const lightOverlay = theme.dark ? 2 : 1;
|
|
272
|
+
const darkOverlay = theme.dark ? 1 : 2;
|
|
273
|
+
const variables = [];
|
|
274
|
+
|
|
275
|
+
for (const [key, value] of Object.entries(theme.colors)) {
|
|
276
|
+
const rgb = colorToRGB(value);
|
|
277
|
+
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
278
|
+
|
|
279
|
+
if (!key.startsWith('on-')) {
|
|
280
|
+
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return variables;
|
|
285
|
+
}
|
|
285
286
|
//# sourceMappingURL=theme.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/composables/theme.ts"],"names":["computed","inject","provide","ref","watch","watchEffect","colorToInt","colorToRGB","createRange","darken","getCurrentInstance","getLuma","IN_BROWSER","intToHex","lighten","mergeDeep","propsFactory","APCAcontrast","ThemeSymbol","Symbol","for","makeThemeProps","theme","String","defaultThemeOptions","defaultTheme","variations","colors","themes","light","dark","background","surface","primary","secondary","error","info","success","warning","variables","parseThemeOptions","options","isDisabled","Object","entries","reduce","obj","key","createTheme","app","head","_context","provides","usehead","parsedOptions","styleEl","current","computedThemes","value","name","original","color","genColorVariations","keys","test","onColor","colorVal","blackContrast","Math","abs","whiteContrast","min","variation","fn","amount","styles","lines","themeName","push","createCssClass","genCssVariables","map","startsWith","undefined","rgb","r","g","b","Set","values","flatMap","str","i","join","Error","lightOverlay","darkOverlay","selector","content","line","addHeadObjs","style","children","type","id","updateDOM","updateStyles","deep","immediate","genStyleElement","innerHTML","document","el","createElement","appendChild","setTheme","getTheme","themeClasses","provideTheme","props","newTheme","useTheme"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyCC,KAAzC,EAAgDC,WAAhD,QAAmE,KAAnE;SAEEC,U,EACAC,U,EACAC,W,EACAC,M,EACAC,kB,EACAC,O,EACAC,U,EACAC,Q,EACAC,O,EACAC,S,EACAC,Y;SAEOC,Y,kCAET;;AAqEA,OAAO,MAAMC,WAAwC,GAAGC,MAAM,CAACC,GAAP,CAAW,eAAX,CAAjD;AAEP,OAAO,MAAMC,cAAc,GAAGL,YAAY,CAAC;AACzCM,EAAAA,KAAK,EAAEC;AADkC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,MAAMC,mBAAiC,GAAG;AACxCC,EAAAA,YAAY,EAAE,OAD0B;AAExCC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE,EAAV;AAAcb,IAAAA,OAAO,EAAE,CAAvB;AAA0BL,IAAAA,MAAM,EAAE;AAAlC,GAF4B;AAGxCmB,EAAA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,2BAAsBA,KAAtB,oBAAsBA,KAAK,CAAEkC,OAAP,CAAeE,KAArC;AACD,GAFuB,CAAxB;AAIA,QAAM2D,YAAY,GAAGrH,QAAQ,CAAC,MAAMsB,KAAK,CAACoB,UAAN,GAAmByC,SAAnB,GAAgC,YAAW3B,OAAO,CAACE,KAAM,EAAhE,CAA7B;AAEA,QAAM8D,QAAuB,GAAG,EAC9B,GAAGlG,KAD2B;AAE9BkC,IAAAA,OAF8B;AAG9B6D,IAAAA;AAH8B,GAAhC;AAMAnH,EAAAA,OAAO,CAACgB,WAAD,EAAcsG,QAAd,CAAP;AAEA,SAAOA,QAAP;AACD;AAED,OAAO,SAASC,QAAT,GAAqB;AAC1B/G,EAAAA,kBAAkB,CAAC,UAAD,CAAlB;AAEA,QAAMY,KAAK,GAAGrB,MAAM,CAACiB,WAAD,EAAc,IAAd,CAApB;AAEA,MAAI,CAACI,KAAL,EAAY,MAAM,IAAIwE,KAAJ,CAAU,wCAAV,CAAN;AAEZ,SAAOxE,KAAP;AACD","sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, watch, watchEffect } from 'vue'\nimport {\n colorToInt,\n colorToRGB,\n createRange,\n darken,\n getCurrentInstance,\n getLuma,\n IN_BROWSER,\n intToHex,\n lighten,\n mergeDeep,\n propsFactory,\n} from '@/util'\nimport { APCAcontrast } from '@/util/color/APCA'\n\n// Types\nimport type { App, InjectionKey, Ref } from 'vue'\nimport type { HeadClient } from '@vueuse/head'\n\ntype DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T\n\ninterface BaseColors {\n background: string\n surface: string\n primary: string\n secondary: string\n success: string\n warning: string\n error: string\n info: string\n}\n\ninterface OnColors {\n 'on-background': string\n 'on-surface': string\n 'on-primary': string\n 'on-secondary': string\n 'on-success': string\n 'on-warning': string\n 'on-error': string\n 'on-info': string\n}\n\nexport interface Colors extends BaseColors, OnColors {\n [key: string]: string\n}\n\ninterface InternalThemeDefinition {\n dark: boolean\n colors: Colors\n variables: Record<string, string | number>\n}\n\ninterface VariationsOptions {\n colors: string[]\n lighten: number\n darken: number\n}\n\ninterface InternalThemeOptions {\n isDisabled: boolean\n defaultTheme: string\n variations: VariationsOptions\n themes: Record<string, InternalThemeDefinition>\n}\n\nexport type ThemeDefinition = DeepPartial<InternalThemeDefinition>\n\nexport type ThemeOptions = false | {\n defaultTheme?: string\n variations?: false | VariationsOptions\n themes?: Record<string, ThemeDefinition>\n}\n\nexport interface ThemeInstance {\n isDisabled: boolean\n themes: Ref<Record<string, InternalThemeDefinition>>\n current: Ref<string>\n themeClasses: Ref<string | undefined>\n setTheme: (key: string, theme: InternalThemeDefinition) => void\n getTheme: (key: string) => InternalThemeDefinition\n styles: Ref<string>\n}\n\nexport const ThemeSymbol: InjectionKey<ThemeInstance> = Symbol.for('vuetify:theme')\n\nexport const makeThemeProps = propsFactory({\n theme: String,\n}, 'theme')\n\nconst defaultThemeOptions: ThemeOptions = {\n defaultTheme: 'light',\n variations: { colors: [], lighten: 0, darken: 0 },\n themes: {\n light: {\n dark: false,\n colors: {\n background: '#FFFFFF',\n surface: '#FFFFFF',\n 'surface-variant': '#424242',\n 'on-surface-variant': '#EEEEEE',\n primary: '#6200EE',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC6',\n 'secondary-darken-1': '#018786',\n error: '#B00020',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#000000',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.04,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.12,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#C2C2C2',\n },\n },\n dark: {\n dark: true,\n colors: {\n background: '#121212',\n surface: '#212121',\n 'surface-variant': '#BDBDBD',\n 'on-surface-variant': '#424242',\n primary: '#BB86FC',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC5',\n 'secondary-darken-1': '#03DAC5',\n error: '#CF6679',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#FFFFFF',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.10,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.16,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#B7B7B7',\n },\n },\n },\n}\n\nconst parseThemeOptions = (options: ThemeOptions = defaultThemeOptions): InternalThemeOptions => {\n if (!options) return { ...defaultThemeOptions, isDisabled: true } as InternalThemeOptions\n\n const themes = Object.entries(options.themes ?? {}).reduce((obj, [key, theme]) => {\n const defaultTheme = theme.dark ? defaultThemeOptions.themes?.dark : defaultThemeOptions.themes?.light\n obj[key] = mergeDeep(defaultTheme, theme)\n return obj\n }, {} as Record<string, ThemeDefinition>)\n\n return mergeDeep(\n defaultThemeOptions,\n { ...options, themes },\n ) as InternalThemeOptions\n}\n\n// Composables\nexport function createTheme (app: App, options?: ThemeOptions): ThemeInstance {\n const head = app._context.provides.usehead as HeadClient | undefined\n const parsedOptions = parseThemeOptions(options)\n const styleEl = ref<HTMLStyleElement>()\n const current = ref(parsedOptions.defaultTheme)\n const themes = ref(parsedOptions.themes)\n const variations = ref(parsedOptions.variations)\n\n const computedThemes = computed(() => {\n return Object.entries(themes.value).reduce((obj, [name, original]) => {\n const theme: InternalThemeDefinition = {\n ...original,\n colors: {\n ...original.colors,\n ...(parsedOptions.variations.colors ?? []).reduce((obj, color) => {\n return { ...obj, ...genColorVariations(color, original.colors[color]!) }\n }, {}),\n },\n }\n\n for (const color of Object.keys(theme.colors)) {\n if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue\n\n const onColor = `on-${color}` as keyof OnColors\n const colorVal = colorToInt(theme.colors[color]!)\n\n const blackContrast = Math.abs(APCAcontrast(0, colorVal))\n const whiteContrast = Math.abs(APCAcontrast(0xffffff, colorVal))\n\n // TODO: warn about poor color selections\n // const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))\n // const minContrast = Math.max(blackContrast, whiteContrast)\n // if (minContrast < 60) {\n // consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)\n // } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {\n // consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)\n // }\n\n // Prefer white text if both have an acceptable contrast ratio\n theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000'\n }\n\n obj[name] = theme\n\n return obj\n }, {} as Record<string, InternalThemeDefinition>)\n })\n\n function genColorVariations (name: string, color: string) {\n const obj: Record<string, string> = {}\n for (const variation of (['lighten', 'darken'] as const)) {\n const fn = variation === 'lighten' ? lighten : darken\n for (const amount of createRange(variations.value[variation], 1)) {\n obj[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount))\n }\n }\n\n return obj\n }\n\n const styles = computed(() => {\n const lines = []\n\n for (const themeName of Object.keys(computedThemes.value)) {\n const variables = computedThemes.value[themeName].variables\n\n lines.push(...createCssClass(`.v-theme--${themeName}`, [\n ...genCssVariables(themeName),\n ...Object.keys(variables).map(key => {\n const value = variables[key]\n const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined\n const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined\n\n return `--v-${key}: ${rgb ?? value}`\n }),\n ]))\n }\n\n const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)))\n for (const key of colors) {\n if (/on-[a-z]/.test(key)) {\n lines.push(...createCssClass(`.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]))\n } else {\n lines.push(\n ...createCssClass(`.bg-${key}`, [\n `--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`,\n `background: rgb(var(--v-theme-${key})) !important`,\n `color: rgb(var(--v-theme-on-${key})) !important`,\n ]),\n ...createCssClass(`.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]),\n ...createCssClass(`.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]),\n )\n }\n }\n\n return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('')\n })\n\n function genCssVariables (name: string) {\n const theme = computedThemes.value[name]\n\n if (!theme) throw new Error(`Could not find theme ${name}`)\n\n const lightOverlay = theme.dark ? 2 : 1\n const darkOverlay = theme.dark ? 1 : 2\n\n const variables: string[] = []\n for (const [key, value] of Object.entries(theme.colors)) {\n const rgb = colorToRGB(value!)\n variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`)\n if (!key.startsWith('on-')) {\n variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`)\n }\n }\n\n return variables\n }\n\n function createCssClass (selector: string, content: string[]) {\n return [\n `${selector} {\\n`,\n ...content.map(line => ` ${line};\\n`),\n '}\\n',\n ]\n }\n\n if (head) {\n head.addHeadObjs(computed(() => ({\n style: [{\n children: styles.value,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n }],\n })))\n\n if (IN_BROWSER) {\n watchEffect(() => head.updateDOM())\n }\n } else {\n watch(themes, updateStyles, { deep: true, immediate: true })\n\n function updateStyles () {\n if (parsedOptions.isDisabled) return\n\n genStyleElement()\n\n if (styleEl.value) styleEl.value.innerHTML = styles.value\n }\n\n function genStyleElement () {\n if (typeof document === 'undefined' || styleEl.value) return\n\n const el = document.createElement('style')\n el.type = 'text/css'\n el.id = 'vuetify-theme-stylesheet'\n\n styleEl.value = el\n document.head.appendChild(styleEl.value)\n }\n }\n\n return {\n isDisabled: parsedOptions.isDisabled,\n themes: computedThemes,\n setTheme: (key: string, theme: InternalThemeDefinition) => themes.value[key] = theme,\n getTheme: (key: string) => computedThemes.value[key],\n current,\n themeClasses: computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${current.value}`),\n styles,\n }\n}\n\nexport function provideTheme (props: { theme?: string }) {\n getCurrentInstance('provideTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n const current = computed<string>(() => {\n return props.theme ?? theme?.current.value\n })\n\n const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${current.value}`)\n\n const newTheme: ThemeInstance = {\n ...theme,\n current,\n themeClasses,\n }\n\n provide(ThemeSymbol, newTheme)\n\n return newTheme\n}\n\nexport function useTheme () {\n getCurrentInstance('useTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n return theme\n}\n"],"file":"theme.mjs"}
|
|
1
|
+
{"version":3,"file":"theme.mjs","names":["computed","inject","provide","reactive","ref","watch","watchEffect","colorToInt","colorToRGB","createRange","darken","getCurrentInstance","getLuma","IN_BROWSER","intToHex","lighten","mergeDeep","propsFactory","APCAcontrast","ThemeSymbol","Symbol","for","makeThemeProps","theme","String","defaultThemeOptions","defaultTheme","variations","colors","themes","light","dark","background","surface","primary","secondary","error","info","success","warning","variables","parseThemeOptions","options","isDisabled","key","Object","entries","createTheme","app","head","_context","provides","usehead","parsedOptions","name","computedThemes","acc","original","value","color","variation","fn","amount","keys","test","onColor","colorVal","blackContrast","Math","abs","whiteContrast","min","current","styles","lines","createCssClass","themeName","genCssVariables","map","startsWith","undefined","rgb","r","g","b","Set","values","flatMap","str","i","join","addHeadObjs","style","children","type","id","updateDOM","styleEl","document","getElementById","updateStyles","immediate","el","createElement","appendChild","innerHTML","themeClasses","global","provideTheme","props","Error","newTheme","useTheme","selector","content","push","line","lightOverlay","darkOverlay"],"sources":["../../src/composables/theme.ts"],"sourcesContent":["// Utilities\nimport {\n computed,\n inject,\n provide,\n reactive,\n ref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n colorToInt,\n colorToRGB,\n createRange,\n darken,\n getCurrentInstance,\n getLuma,\n IN_BROWSER,\n intToHex,\n lighten,\n mergeDeep,\n propsFactory,\n} from '@/util'\nimport { APCAcontrast } from '@/util/color/APCA'\n\n// Types\nimport type { App, DeepReadonly, InjectionKey, Ref } from 'vue'\nimport type { HeadClient } from '@vueuse/head'\n\ntype DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T\n\nexport type ThemeOptions = false | {\n defaultTheme?: string\n variations?: false | VariationsOptions\n themes?: Record<string, ThemeDefinition>\n}\nexport type ThemeDefinition = DeepPartial<InternalThemeDefinition>\n\ninterface InternalThemeOptions {\n isDisabled: boolean\n defaultTheme: string\n variations: false | VariationsOptions\n themes: Record<string, InternalThemeDefinition>\n}\n\ninterface VariationsOptions {\n colors: string[]\n lighten: number\n darken: number\n}\n\ninterface InternalThemeDefinition {\n dark: boolean\n colors: Colors\n variables: Record<string, string | number>\n}\n\nexport interface Colors extends BaseColors, OnColors {\n [key: string]: string\n}\n\ninterface BaseColors {\n background: string\n surface: string\n primary: string\n secondary: string\n success: string\n warning: string\n error: string\n info: string\n}\n\ninterface OnColors {\n 'on-background': string\n 'on-surface': string\n 'on-primary': string\n 'on-secondary': string\n 'on-success': string\n 'on-warning': string\n 'on-error': string\n 'on-info': string\n}\n\nexport interface ThemeInstance {\n readonly isDisabled: boolean\n readonly themes: Ref<Record<string, InternalThemeDefinition>>\n\n readonly name: Readonly<Ref<string>>\n readonly current: DeepReadonly<Ref<InternalThemeDefinition>>\n readonly computedThemes: DeepReadonly<Ref<Record<string, InternalThemeDefinition>>>\n\n readonly themeClasses: Readonly<Ref<string | undefined>>\n readonly styles: Readonly<Ref<string>>\n\n readonly global: {\n readonly name: Ref<string>\n readonly current: DeepReadonly<Ref<InternalThemeDefinition>>\n }\n}\n\nexport const ThemeSymbol: InjectionKey<ThemeInstance> = Symbol.for('vuetify:theme')\n\nexport const makeThemeProps = propsFactory({\n theme: String,\n}, 'theme')\n\nconst defaultThemeOptions: Exclude<ThemeOptions, false> = {\n defaultTheme: 'light',\n variations: { colors: [], lighten: 0, darken: 0 },\n themes: {\n light: {\n dark: false,\n colors: {\n background: '#FFFFFF',\n surface: '#FFFFFF',\n 'surface-variant': '#424242',\n 'on-surface-variant': '#EEEEEE',\n primary: '#6200EE',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC6',\n 'secondary-darken-1': '#018786',\n error: '#B00020',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#000000',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.04,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.12,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#C2C2C2',\n },\n },\n dark: {\n dark: true,\n colors: {\n background: '#121212',\n surface: '#212121',\n 'surface-variant': '#BDBDBD',\n 'on-surface-variant': '#424242',\n primary: '#BB86FC',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC5',\n 'secondary-darken-1': '#03DAC5',\n error: '#CF6679',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#FFFFFF',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.10,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.16,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#B7B7B7',\n },\n },\n },\n}\n\nfunction parseThemeOptions (options: ThemeOptions = defaultThemeOptions): InternalThemeOptions {\n if (!options) return { ...defaultThemeOptions, isDisabled: true } as InternalThemeOptions\n\n const themes: Record<string, InternalThemeDefinition> = {}\n for (const [key, theme] of Object.entries(options.themes ?? {})) {\n const defaultTheme = theme.dark\n ? defaultThemeOptions.themes?.dark\n : defaultThemeOptions.themes?.light\n themes[key] = mergeDeep(defaultTheme, theme) as InternalThemeDefinition\n }\n\n return mergeDeep(\n defaultThemeOptions,\n { ...options, themes },\n ) as InternalThemeOptions\n}\n\n// Composables\nexport function createTheme (app: App, options?: ThemeOptions): ThemeInstance {\n const head = app._context.provides.usehead as HeadClient | undefined\n const parsedOptions = reactive(parseThemeOptions(options))\n const name = ref(parsedOptions.defaultTheme)\n const themes = ref(parsedOptions.themes)\n\n const computedThemes = computed(() => {\n const acc: Record<string, InternalThemeDefinition> = {}\n for (const [name, original] of Object.entries(themes.value)) {\n const theme: InternalThemeDefinition = acc[name] = {\n ...original,\n colors: {\n ...original.colors,\n },\n }\n\n if (parsedOptions.variations) {\n for (const name of parsedOptions.variations.colors) {\n const color = theme.colors[name]\n for (const variation of (['lighten', 'darken'] as const)) {\n const fn = variation === 'lighten' ? lighten : darken\n for (const amount of createRange(parsedOptions.variations[variation], 1)) {\n theme.colors[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount))\n }\n }\n }\n }\n\n for (const color of Object.keys(theme.colors)) {\n if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue\n\n const onColor = `on-${color}` as keyof OnColors\n const colorVal = colorToInt(theme.colors[color]!)\n\n const blackContrast = Math.abs(APCAcontrast(0, colorVal))\n const whiteContrast = Math.abs(APCAcontrast(0xffffff, colorVal))\n\n // TODO: warn about poor color selections\n // const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))\n // const minContrast = Math.max(blackContrast, whiteContrast)\n // if (minContrast < 60) {\n // consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)\n // } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {\n // consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)\n // }\n\n // Prefer white text if both have an acceptable contrast ratio\n theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000'\n }\n }\n\n return acc\n })\n const current = computed(() => computedThemes.value[name.value])\n\n const styles = computed(() => {\n const lines: string[] = []\n\n if (current.value.dark) {\n createCssClass(lines, ':root', ['color-scheme: dark'])\n }\n\n for (const [themeName, theme] of Object.entries(computedThemes.value)) {\n const { variables, dark } = theme\n\n createCssClass(lines, `.v-theme--${themeName}`, [\n `color-scheme: ${dark ? 'dark' : 'normal'}`,\n ...genCssVariables(theme),\n ...Object.keys(variables).map(key => {\n const value = variables[key]\n const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined\n const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined\n\n return `--v-${key}: ${rgb ?? value}`\n }),\n ])\n }\n\n const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)))\n for (const key of colors) {\n if (/on-[a-z]/.test(key)) {\n createCssClass(lines, `.${key}`, [`color: rgb(var(--v-theme-${key})) !important`])\n } else {\n createCssClass(lines, `.bg-${key}`, [\n `--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`,\n `background: rgb(var(--v-theme-${key})) !important`,\n `color: rgb(var(--v-theme-on-${key})) !important`,\n ])\n createCssClass(lines, `.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`])\n createCssClass(lines, `.border-${key}`, [`--v-border-color: var(--v-theme-${key})`])\n }\n }\n\n return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('')\n })\n\n if (head) {\n head.addHeadObjs(computed(() => ({\n style: [{\n children: styles.value,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n }],\n })))\n\n if (IN_BROWSER) {\n watchEffect(() => head.updateDOM())\n }\n } else {\n let styleEl = IN_BROWSER\n ? document.getElementById('vuetify-theme-stylesheet')\n : null\n\n watch(styles, updateStyles, { immediate: true })\n function updateStyles () {\n if (parsedOptions.isDisabled) return\n\n if (typeof document !== 'undefined' && !styleEl) {\n const el = document.createElement('style')\n el.type = 'text/css'\n el.id = 'vuetify-theme-stylesheet'\n\n styleEl = el\n document.head.appendChild(styleEl)\n }\n\n if (styleEl) styleEl.innerHTML = styles.value\n }\n }\n\n const themeClasses = computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${name.value}`)\n\n return {\n isDisabled: parsedOptions.isDisabled,\n name,\n themes,\n current,\n computedThemes,\n themeClasses,\n styles,\n global: {\n name,\n current,\n },\n }\n}\n\nexport function provideTheme (props: { theme?: string }) {\n getCurrentInstance('provideTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n const name = computed<string>(() => {\n return props.theme ?? theme?.name.value\n })\n\n const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${name.value}`)\n\n const newTheme: ThemeInstance = {\n ...theme,\n name,\n themeClasses,\n }\n\n provide(ThemeSymbol, newTheme)\n\n return newTheme\n}\n\nexport function useTheme () {\n getCurrentInstance('useTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n return theme\n}\n\nfunction createCssClass (lines: string[], selector: string, content: string[]) {\n lines.push(\n `${selector} {\\n`,\n ...content.map(line => ` ${line};\\n`),\n '}\\n',\n )\n}\n\nfunction genCssVariables (theme: InternalThemeDefinition) {\n const lightOverlay = theme.dark ? 2 : 1\n const darkOverlay = theme.dark ? 1 : 2\n\n const variables: string[] = []\n for (const [key, value] of Object.entries(theme.colors)) {\n const rgb = colorToRGB(value)\n variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`)\n if (!key.startsWith('on-')) {\n variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`)\n }\n }\n\n return variables\n}\n"],"mappings":"AAAA;AACA,SACEA,QADF,EAEEC,MAFF,EAGEC,OAHF,EAIEC,QAJF,EAKEC,GALF,EAMEC,KANF,EAOEC,WAPF,QAQO,KARP;SAUEC,U,EACAC,U,EACAC,W,EACAC,M,EACAC,kB,EACAC,O,EACAC,U,EACAC,Q,EACAC,O,EACAC,S,EACAC,Y;SAEOC,Y,kCAET;;AA2EA,OAAO,MAAMC,WAAwC,GAAGC,MAAM,CAACC,GAAP,CAAW,eAAX,CAAjD;AAEP,OAAO,MAAMC,cAAc,GAAGL,YAAY,CAAC;EACzCM,KAAK,EAAEC;AADkC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,MAAMC,mBAAiD,GAAG;EACxDC,YAAY,EAAE,OAD0C;EAExDC,UAAU,EAAE;IAAEC,MAAM,EAAE,EAAV;IAAcb,OAAO,EAAE,CAAvB;IAA0BL,MAAM,EAAE;EAAlC,CAF4C;EAGxDmB,MAAM,EAAE;IACNC,KAAK,EAAE;MACLC,IAAI,EAAE,KADD;MAELH,MAAM,EAAE;QACNI,UAAU,EAAE,SADN;QAENC,OAAO,EAAE,SAFH;QAGN,mBAAmB,SAHb;QAIN,sBAAsB,SAJhB;QAKNC,OAAO,EAAE,SALH;QAMN,oBAAoB,SANd;QAONC,SAAS,EAAE,SAPL;QAQN,sBAAsB,SARhB;QASNC,KAAK,EAAE,SATD;QAUNC,IAAI,EAAE,SAVA;QAWNC,OAAO,EAAE,SAXH;QAYNC,OAAO,EAAE;MAZH,CAFH;MAgBLC,SAAS,EAAE;QACT,gBAAgB,SADP;QAET,kBAAkB,IAFT;QAGT,yBAAyB,IAHhB;QAIT,2BAA2B,IAJlB;QAKT,oBAAoB,IALX;QAMT,gBAAgB,IANP;QAOT,iBAAiB,IAP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AAM,CAACC,OAAP,CAAevB,KAAK,CAACK,MAArB,CAA3B,EAAyD;IACvD,MAAMqD,GAAG,GAAGzE,UAAU,CAACkD,KAAD,CAAtB;IACAlB,SAAS,CAAC2E,IAAV,CAAgB,aAAYvE,GAAI,KAAIqC,GAAG,CAACC,CAAE,IAAGD,GAAG,CAACE,CAAE,IAAGF,GAAG,CAACG,CAAE,EAA5D;;IACA,IAAI,CAACxC,GAAG,CAACmC,UAAJ,CAAe,KAAf,CAAL,EAA4B;MAC1BvC,SAAS,CAAC2E,IAAV,CAAgB,aAAYvE,GAAI,wBAAuBhC,OAAO,CAAC8C,KAAD,CAAP,GAAiB,IAAjB,GAAwB2D,YAAxB,GAAuCC,WAAY,EAA1G;IACD;EACF;;EAED,OAAO9E,SAAP;AACD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { effectScope, watch } from 'vue';
|
|
2
|
+
export function useToggleScope(source, cb) {
|
|
3
|
+
let scope;
|
|
4
|
+
watch(source, active => {
|
|
5
|
+
if (active && !scope) {
|
|
6
|
+
scope = effectScope();
|
|
7
|
+
scope.run(cb);
|
|
8
|
+
} else {
|
|
9
|
+
var _scope;
|
|
10
|
+
|
|
11
|
+
(_scope = scope) == null ? void 0 : _scope.stop();
|
|
12
|
+
scope = undefined;
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
immediate: true
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=toggleScope.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggleScope.mjs","names":["effectScope","watch","useToggleScope","source","cb","scope","active","run","stop","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, cb: () => void) {\n let scope: EffectScope | undefined\n watch(source, active => {\n if (active && !scope) {\n scope = effectScope()\n scope.run(cb)\n } else {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n}\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,KAAtB,QAAmC,KAAnC;AAGA,OAAO,SAASC,cAAT,CAAyBC,MAAzB,EAAuDC,EAAvD,EAAuE;EAC5E,IAAIC,KAAJ;EACAJ,KAAK,CAACE,MAAD,EAASG,MAAM,IAAI;IACtB,IAAIA,MAAM,IAAI,CAACD,KAAf,EAAsB;MACpBA,KAAK,GAAGL,WAAW,EAAnB;MACAK,KAAK,CAACE,GAAN,CAAUH,EAAV;IACD,CAHD,MAGO;MAAA;;MACL,UAAAC,KAAK,SAAL,mBAAOG,IAAP;MACAH,KAAK,GAAGI,SAAR;IACD;EACF,CARI,EAQF;IAAEC,SAAS,EAAE;EAAb,CARE,CAAL;AASD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"touch.mjs","names":["CircularBuffer","HORIZON","HISTORY","kineticEnergyToVelocity","work","sqrt2","Math","sqrt","abs","calculateImpulseVelocity","samples","length","t","d","i","vprev","vcurr","useVelocity","touches","addMovement","e","Array","from","changedTouches","forEach","touch","identifier","push","timeStamp","endTouch","getVelocity","id","values","reverse","Error","newest","x","y","val","clientX","clientY","direction","absX","absY","oops"],"sources":["../../src/composables/touch.ts"],"sourcesContent":["import { CircularBuffer } from '@/util'\n\nconst HORIZON = 100 // ms\nconst HISTORY = 20 // number of samples to keep\n\nexport interface Sample {\n t: number\n d: number\n}\n\n/** @see https://android.googlesource.com/platform/frameworks/native/+/master/libs/input/VelocityTracker.cpp */\nfunction kineticEnergyToVelocity (work: number) {\n const sqrt2 = 1.41421356237\n return (work < 0 ? -1.0 : 1.0) * Math.sqrt(Math.abs(work)) * sqrt2\n}\n\n/**\n * Returns pointer velocity in px/s\n */\nexport function calculateImpulseVelocity (samples: Sample[]) {\n // The input should be in reversed time order (most recent sample at index i=0)\n if (samples.length < 2) {\n // if 0 or 1 points, velocity is zero\n return 0\n }\n // if (samples[1].t > samples[0].t) {\n // // Algorithm will still work, but not perfectly\n // consoleWarn('Samples provided to calculateImpulseVelocity in the wrong order')\n // }\n if (samples.length === 2) {\n // if 2 points, basic linear calculation\n if (samples[1].t === samples[0].t) {\n // consoleWarn(`Events have identical time stamps t=${samples[0].t}, setting velocity = 0`)\n return 0\n }\n return (samples[1].d - samples[0].d) / (samples[1].t - samples[0].t)\n }\n // Guaranteed to have at least 3 points here\n // start with the oldest sample and go forward in time\n let work = 0\n for (let i = samples.length - 1; i > 0; i--) {\n if (samples[i].t === samples[i - 1].t) {\n // consoleWarn(`Events have identical time stamps t=${samples[i].t}, skipping sample`)\n continue\n }\n const vprev = kineticEnergyToVelocity(work) // v[i-1]\n const vcurr = (samples[i].d - samples[i - 1].d) / (samples[i].t - samples[i - 1].t) // v[i]\n work += (vcurr - vprev) * Math.abs(vcurr)\n if (i === samples.length - 1) {\n work *= 0.5\n }\n }\n return kineticEnergyToVelocity(work) * 1000\n}\n\nexport function useVelocity () {\n const touches: Record<number, CircularBuffer<[number, Touch]> | undefined> = {}\n\n function addMovement (e: TouchEvent) {\n Array.from(e.changedTouches).forEach(touch => {\n const samples = touches[touch.identifier] ?? (touches[touch.identifier] = new CircularBuffer(HISTORY))\n samples.push([e.timeStamp, touch])\n })\n }\n\n function endTouch (e: TouchEvent) {\n Array.from(e.changedTouches).forEach(touch => {\n delete touches[touch.identifier]\n })\n }\n\n function getVelocity (id: number) {\n const samples = touches[id]?.values().reverse()\n\n if (!samples) {\n throw new Error(`No samples for touch id ${id}`)\n }\n\n const newest = samples[0]\n const x: Sample[] = []\n const y: Sample[] = []\n for (const val of samples) {\n if (newest[0] - val[0] > HORIZON) break\n\n x.push({ t: val[0], d: val[1].clientX })\n y.push({ t: val[0], d: val[1].clientY })\n }\n\n return {\n x: calculateImpulseVelocity(x),\n y: calculateImpulseVelocity(y),\n get direction () {\n const { x, y } = this\n const [absX, absY] = [Math.abs(x), Math.abs(y)]\n\n return absX > absY && x >= 0 ? 'right'\n : absX > absY && x <= 0 ? 'left'\n : absY > absX && y >= 0 ? 'down'\n : absY > absX && y <= 0 ? 'up'\n : oops()\n },\n }\n }\n\n return { addMovement, endTouch, getVelocity }\n}\n\nfunction oops (): never {\n throw new Error()\n}\n"],"mappings":"SAASA,c;AAET,MAAMC,OAAO,GAAG,GAAhB,C,CAAoB;;AACpB,MAAMC,OAAO,GAAG,EAAhB,C,CAAmB;;AAOnB;AACA,SAASC,uBAAT,CAAkCC,IAAlC,EAAgD;EAC9C,MAAMC,KAAK,GAAG,aAAd;EACA,OAAO,CAACD,IAAI,GAAG,CAAP,GAAW,CAAC,GAAZ,GAAkB,GAAnB,IAA0BE,IAAI,CAACC,IAAL,CAAUD,IAAI,CAACE,GAAL,CAASJ,IAAT,CAAV,CAA1B,GAAsDC,KAA7D;AACD;AAED;AACA;AACA;;;AACA,OAAO,SAASI,wBAAT,CAAmCC,OAAnC,EAAsD;EAC3D;EACA,IAAIA,OAAO,CAACC,MAAR,GAAiB,CAArB,EAAwB;IACtB;IACA,OAAO,CAAP;EACD,CAL0D,CAM3D;EACA;EACA;EACA;;;EACA,IAAID,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;IACxB;IACA,IAAID,OAAO,CAAC,CAAD,CAAP,CAAWE,CAAX,KAAiBF,OAAO,CAAC,CAAD,CAAP,CAAWE,CAAhC,EAAmC;MACjC;MACA,OAAO,CAAP;IACD;;IACD,OAAO,CAACF,OAAO,CAAC,CAAD,CAAP,CAAWG,CAAX,GAAeH,OAAO,CAAC,CAAD,CAAP,CAAWG,CAA3B,KAAiCH,OAAO,CAAC,CAAD,CAAP,CAAWE,CAAX,GAAeF,OAAO,CAAC,CAAD,CAAP,CAAWE,CAA3D,CAAP;EACD,CAjB0D,CAkB3D;EACA;;;EACA,IAAIR,IAAI,GAAG,CAAX;;EACA,KAAK,IAAIU,CAAC,GAAGJ,OAAO,CAACC,MAAR,GAAiB,CAA9B,EAAiCG,CAAC,GAAG,CAAr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c9B,IAAI,CAACE,GAAL,CAAS6B,CAAT,CAAd,CAArB;QAEA,OAAOK,IAAI,GAAGC,IAAP,IAAeP,CAAC,IAAI,CAApB,GAAwB,OAAxB,GACHM,IAAI,GAAGC,IAAP,IAAeP,CAAC,IAAI,CAApB,GAAwB,MAAxB,GACAO,IAAI,GAAGD,IAAP,IAAeL,CAAC,IAAI,CAApB,GAAwB,MAAxB,GACAM,IAAI,GAAGD,IAAP,IAAeL,CAAC,IAAI,CAApB,GAAwB,IAAxB,GACAO,IAAI,EAJR;MAKD;;IAZI,CAAP;EAcD;;EAED,OAAO;IAAEzB,WAAF;IAAeU,QAAf;IAAyBC;EAAzB,CAAP;AACD;;AAED,SAASc,IAAT,GAAwB;EACtB,MAAM,IAAIV,KAAJ,EAAN;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"transition.mjs","names":["h","mergeProps","Transition","propsFactory","makeTransitionProps","transition","type","Boolean","String","Object","default","validator","val","MaybeTransition","props","slots","rest","component","customProps","name"],"sources":["../../src/composables/transition.ts"],"sourcesContent":["// Utilities\nimport { h, mergeProps, Transition } from 'vue'\nimport { propsFactory } from '@/util'\n\n// Types\nimport type { Component, FunctionalComponent, PropType, TransitionProps } from 'vue'\n\nexport const makeTransitionProps = propsFactory({\n transition: {\n type: [Boolean, String, Object] as PropType<string | boolean | TransitionProps & { component?: Component }>,\n default: 'fade-transition',\n validator: val => val !== true,\n },\n}, 'transition')\n\ninterface MaybeTransitionProps extends TransitionProps {\n transition?: string | boolean | TransitionProps & { component?: any }\n}\n\nexport const MaybeTransition: FunctionalComponent<MaybeTransitionProps> = (props, { slots }) => {\n const { transition, ...rest } = props\n\n if (!transition || typeof transition === 'boolean') return slots.default?.()\n\n const { component = Transition, ...customProps } = typeof transition === 'object' ? transition : {}\n\n return h(\n component,\n mergeProps(typeof transition === 'string' ? { name: transition } : customProps as any, rest as any),\n slots\n )\n}\n"],"mappings":"AAAA;AACA,SAASA,CAAT,EAAYC,UAAZ,EAAwBC,UAAxB,QAA0C,KAA1C;SACSC,Y,6BAET;;AAGA,OAAO,MAAMC,mBAAmB,GAAGD,YAAY,CAAC;EAC9CE,UAAU,EAAE;IACVC,IAAI,EAAE,CAACC,OAAD,EAAUC,MAAV,EAAkBC,MAAlB,CADI;IAEVC,OAAO,EAAE,iBAFC;IAGVC,SAAS,EAAEC,GAAG,IAAIA,GAAG,KAAK;EAHhB;AADkC,CAAD,EAM5C,YAN4C,CAAxC;AAYP,OAAO,MAAMC,eAA0D,GAAG,CAACC,KAAD,WAAsB;EAAA;;EAAA,IAAd;IAAEC;EAAF,CAAc;EAC9F,MAAM;IAAEV,UAAF;IAAc,GAAGW;EAAjB,IAA0BF,KAAhC;EAEA,IAAI,CAACT,UAAD,IAAe,OAAOA,UAAP,KAAsB,SAAzC,EAAoD,yBAAOU,KAAK,CAACL,OAAb,qBAAO,oBAAAK,KAAK,CAAZ;EAEpD,MAAM;IAAEE,SAAS,GAAGf,UAAd;IAA0B,GAAGgB;EAA7B,IAA6C,OAAOb,UAAP,KAAsB,QAAtB,GAAiCA,UAAjC,GAA8C,EAAjG;EAEA,OAAOL,CAAC,CACNiB,SADM,EAENhB,UAAU,CAAC,OAAOI,UAAP,KAAsB,QAAtB,GAAiC;IAAEc,IAAI,EAAEd;EAAR,CAAjC,GAAwDa,WAAzD,EAA6EF,IAA7E,CAFJ,EAGND,KAHM,CAAR;AAKD,CAZM"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useForm } from "./form.mjs";
|
|
3
3
|
import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
|
|
4
4
|
|
|
5
|
-
import { computed, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue';
|
|
5
|
+
import { computed, onBeforeMount, onBeforeUnmount, ref, unref, watch } from 'vue';
|
|
6
6
|
import { getCurrentInstanceName, getUid, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
|
|
7
7
|
|
|
8
8
|
export const makeValidationProps = propsFactory({
|
|
@@ -22,15 +22,22 @@ export const makeValidationProps = propsFactory({
|
|
|
22
22
|
type: Array,
|
|
23
23
|
default: () => []
|
|
24
24
|
},
|
|
25
|
-
modelValue: null
|
|
25
|
+
modelValue: null,
|
|
26
|
+
validationValue: null
|
|
26
27
|
});
|
|
27
28
|
export function useValidation(props) {
|
|
28
29
|
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
|
|
30
|
+
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getUid();
|
|
29
31
|
const model = useProxiedModel(props, 'modelValue');
|
|
32
|
+
const validationModel = computed(() => {
|
|
33
|
+
var _props$validationValu;
|
|
34
|
+
|
|
35
|
+
return (_props$validationValu = props.validationValue) != null ? _props$validationValu : model.value;
|
|
36
|
+
});
|
|
30
37
|
const form = useForm();
|
|
31
38
|
const internalErrorMessages = ref([]);
|
|
32
39
|
const isPristine = ref(true);
|
|
33
|
-
const isDirty = computed(() => wrapInArray(model.value === '' ? null : model.value).length
|
|
40
|
+
const isDirty = computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
34
41
|
const isDisabled = computed(() => !!(props.disabled || form != null && form.isDisabled.value));
|
|
35
42
|
const isReadonly = computed(() => !!(props.readonly || form != null && form.isReadonly.value));
|
|
36
43
|
const errorMessages = computed(() => {
|
|
@@ -38,6 +45,7 @@ export function useValidation(props) {
|
|
|
38
45
|
});
|
|
39
46
|
const isValid = computed(() => {
|
|
40
47
|
if (props.error || errorMessages.value.length) return false;
|
|
48
|
+
if (!props.rules.length) return true;
|
|
41
49
|
return isPristine.value ? null : true;
|
|
42
50
|
});
|
|
43
51
|
const isValidating = ref(false);
|
|
@@ -52,7 +60,7 @@ export function useValidation(props) {
|
|
|
52
60
|
const uid = computed(() => {
|
|
53
61
|
var _props$name;
|
|
54
62
|
|
|
55
|
-
return (_props$name = props.name) != null ? _props$name :
|
|
63
|
+
return (_props$name = props.name) != null ? _props$name : unref(id);
|
|
56
64
|
});
|
|
57
65
|
onBeforeMount(() => {
|
|
58
66
|
form == null ? void 0 : form.register(uid.value, validate, reset, resetValidation, isValid);
|
|
@@ -60,8 +68,8 @@ export function useValidation(props) {
|
|
|
60
68
|
onBeforeUnmount(() => {
|
|
61
69
|
form == null ? void 0 : form.unregister(uid.value);
|
|
62
70
|
});
|
|
63
|
-
watch(
|
|
64
|
-
if (
|
|
71
|
+
watch(validationModel, () => {
|
|
72
|
+
if (validationModel.value != null) validate();
|
|
65
73
|
});
|
|
66
74
|
|
|
67
75
|
function reset() {
|
|
@@ -84,7 +92,7 @@ export function useValidation(props) {
|
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
const handler = typeof rule === 'function' ? rule : () => rule;
|
|
87
|
-
const result = await handler(
|
|
95
|
+
const result = await handler(validationModel.value);
|
|
88
96
|
if (result === true) continue;
|
|
89
97
|
|
|
90
98
|
if (typeof result !== 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":["useForm","useProxiedModel","computed","onBeforeMount","onBeforeUnmount","ref","unref","watch","getCurrentInstanceName","getUid","propsFactory","wrapInArray","makeValidationProps","disabled","Boolean","error","errorMessages","type","Array","String","default","maxErrors","Number","name","readonly","rules","modelValue","validationValue","useValidation","props","id","model","validationModel","value","form","internalErrorMessages","isPristine","isDirty","length","isDisabled","isReadonly","isValid","isValidating","validationClasses","uid","register","validate","reset","resetValidation","unregister","results","rule","handler","result","console","warn","push"],"sources":["../../src/composables/validation.ts"],"sourcesContent":["// Composables\nimport { useForm } from '@/composables/form'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, onBeforeMount, onBeforeUnmount, ref, unref, watch } from 'vue'\nimport type { MaybeRef } from '@/util'\nimport { getCurrentInstanceName, getUid, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nexport type ValidationResult = string | true\nexport type ValidationRule =\n | ValidationResult\n | PromiseLike<ValidationResult>\n | ((value: any) => ValidationResult)\n | ((value: any) => PromiseLike<ValidationResult>)\n\nexport interface ValidationProps {\n disabled: boolean\n error: boolean\n errorMessages: string | string[]\n maxErrors: string | number\n name: string | undefined\n readonly: boolean\n rules: ValidationRule[]\n modelValue: any\n 'onUpdate:modelValue': ((val: any) => void) | undefined\n validationValue: any\n}\n\nexport const makeValidationProps = propsFactory({\n disabled: Boolean,\n error: Boolean,\n errorMessages: {\n type: [Array, String] as PropType<string | string[]>,\n default: () => ([]),\n },\n maxErrors: {\n type: [Number, String],\n default: 1,\n },\n name: String,\n readonly: Boolean,\n rules: {\n type: Array as PropType<ValidationRule[]>,\n default: () => ([]),\n },\n modelValue: null,\n validationValue: null,\n})\n\nexport function useValidation (\n props: ValidationProps,\n name = getCurrentInstanceName(),\n id: MaybeRef<string | number> = getUid(),\n) {\n const model = useProxiedModel(props, 'modelValue')\n const validationModel = computed(() => props.validationValue ?? model.value)\n const form = useForm()\n const internalErrorMessages = ref<string[]>([])\n const isPristine = ref(true)\n const isDirty = computed(() => !!(\n wrapInArray(model.value === '' ? null : model.value).length ||\n wrapInArray(validationModel.value === '' ? null : validationModel.value).length\n ))\n const isDisabled = computed(() => !!(props.disabled || form?.isDisabled.value))\n const isReadonly = computed(() => !!(props.readonly || form?.isReadonly.value))\n const errorMessages = computed(() => {\n return props.errorMessages.length\n ? wrapInArray(props.errorMessages)\n : internalErrorMessages.value\n })\n const isValid = computed(() => {\n if (props.error || errorMessages.value.length) return false\n if (!props.rules.length) return true\n\n return isPristine.value ? null : true\n })\n const isValidating = ref(false)\n const validationClasses = computed(() => {\n return {\n [`${name}--error`]: isValid.value === false,\n [`${name}--dirty`]: isDirty.value,\n [`${name}--disabled`]: isDisabled.value,\n [`${name}--readonly`]: isReadonly.value,\n }\n })\n\n const uid = computed(() => props.name ?? unref(id))\n\n onBeforeMount(() => {\n form?.register(uid.value, validate, reset, resetValidation, isValid)\n })\n\n onBeforeUnmount(() => {\n form?.unregister(uid.value)\n })\n\n watch(validationModel, () => {\n if (validationModel.value != null) validate()\n })\n\n function reset () {\n resetValidation()\n model.value = null\n }\n\n function resetValidation () {\n isPristine.value = true\n internalErrorMessages.value = []\n }\n\n async function validate () {\n const results = []\n\n isValidating.value = true\n\n for (const rule of props.rules) {\n if (results.length >= (props.maxErrors || 1)) {\n break\n }\n\n const handler = typeof rule === 'function' ? rule : () => rule\n const result = await handler(validationModel.value)\n\n if (result === true) continue\n\n if (typeof result !== 'string') {\n // eslint-disable-next-line no-console\n console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`)\n\n continue\n }\n\n results.push(result)\n }\n\n internalErrorMessages.value = results\n isValidating.value = false\n isPristine.value = false\n\n return internalErrorMessages.value\n }\n\n return {\n errorMessages,\n isDirty,\n isDisabled,\n isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n validationClasses,\n }\n}\n"],"mappings":"AAAA;SACSA,O;SACAC,e,8BAET;;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,eAAlC,EAAmDC,GAAnD,EAAwDC,KAAxD,EAA+DC,KAA/D,QAA4E,KAA5E;SAESC,sB,EAAwBC,M,EAAQC,Y,EAAcC,W,6BAEvD;;AAuBA,OAAO,MAAMC,mBAAmB,GAAGF,YAAY,CAAC;EAC9CG,QAAQ,EAAEC,OADoC;EAE9CC,KAAK,EAAED,OAFuC;EAG9CE,aAAa,EAAE;IACbC,IAAI,EAAE,CAACC,KAAD,EAAQC,MAAR,CADO;IAEbC,OAAO,EAAE,MAAO;EAFH,CAH+B;EAO9CC,SAAS,EAAE;IACTJ,IAAI,EAAE,CAACK,MAAD,EAASH,MAAT,CADG;IAETC,OAAO,EAAE;EAFA,CAPmC;EAW9CG,IAAI,EAAEJ,MAXwC;EAY9CK,QAAQ,EAAEV,OAZoC;EAa9CW,KAAK,EAAE;IACLR,IAAI,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LK,OANK;IAOLC,YAPK;IAQLK,KARK;IASLC,eATK;IAULF,QAVK;IAWLH;EAXK,CAAP;AAaD"}
|
|
@@ -5,11 +5,13 @@ import { useColor } from "./color.mjs"; // Utilities
|
|
|
5
5
|
import { computed, unref } from 'vue';
|
|
6
6
|
import { getCurrentInstanceName, propsFactory } from "../util/index.mjs"; // Types
|
|
7
7
|
|
|
8
|
-
export const allowedVariants = ['
|
|
8
|
+
export const allowedVariants = ['elevated', 'flat', 'tonal', 'outlined', 'text', 'plain'];
|
|
9
9
|
export function genOverlays(isClickable, name) {
|
|
10
10
|
return _createVNode(_Fragment, null, [isClickable && _createVNode("div", {
|
|
11
|
+
"key": "overlay",
|
|
11
12
|
"class": `${name}__overlay`
|
|
12
13
|
}, null), _createVNode("div", {
|
|
14
|
+
"key": "underlay",
|
|
13
15
|
"class": `${name}__underlay`
|
|
14
16
|
}, null)]);
|
|
15
17
|
}
|
|
@@ -17,7 +19,7 @@ export const makeVariantProps = propsFactory({
|
|
|
17
19
|
color: String,
|
|
18
20
|
variant: {
|
|
19
21
|
type: String,
|
|
20
|
-
default: '
|
|
22
|
+
default: 'elevated',
|
|
21
23
|
validator: v => allowedVariants.includes(v)
|
|
22
24
|
}
|
|
23
25
|
}, 'variant');
|
|
@@ -38,7 +40,7 @@ export function useVariant(props) {
|
|
|
38
40
|
color
|
|
39
41
|
} = unref(props);
|
|
40
42
|
return {
|
|
41
|
-
[['
|
|
43
|
+
[['elevated', 'flat'].includes(variant) ? 'background' : 'text']: color
|
|
42
44
|
};
|
|
43
45
|
}));
|
|
44
46
|
return {
|