@vuetify/nightly 3.0.0-beta.0 → 3.0.0-beta.13
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 -2
- package/_settings.scss +2 -0
- package/_styles.scss +1 -0
- package/_tools.scss +1 -0
- package/dist/_component-variables.sass +61 -0
- package/dist/json/attributes.json +898 -526
- package/dist/json/importMap.json +156 -180
- package/dist/json/tags.json +221 -147
- package/dist/json/web-types.json +2698 -1609
- package/dist/vuetify.css +4126 -4566
- package/dist/vuetify.d.ts +13705 -11374
- package/dist/vuetify.esm.js +11107 -9293
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +11015 -9200
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +3 -3
- package/dist/vuetify.min.js +1375 -1254
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +171 -0
- package/lib/blueprints/index.mjs +4 -0
- package/lib/blueprints/index.mjs.map +1 -0
- package/lib/blueprints/md1.d.ts +167 -0
- package/lib/blueprints/md1.mjs +63 -0
- package/lib/blueprints/md1.mjs.map +1 -0
- package/lib/blueprints/md2.d.ts +167 -0
- package/lib/blueprints/md2.mjs +60 -0
- package/lib/blueprints/md2.mjs.map +1 -0
- package/lib/blueprints/md3.d.ts +167 -0
- package/lib/blueprints/md3.mjs +74 -0
- package/lib/blueprints/md3.mjs.map +1 -0
- package/lib/components/VAlert/VAlert.css +36 -19
- package/lib/components/VAlert/VAlert.mjs +69 -40
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.sass +26 -11
- package/lib/components/VAlert/VAlertTitle.mjs +1 -0
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/_variables.scss +14 -7
- package/lib/components/VAlert/index.d.ts +185 -0
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.css +2 -15
- package/lib/components/VApp/VApp.mjs +3 -4
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +11 -20
- package/lib/components/VApp/index.d.ts +83 -0
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VApp/variables.scss +6 -0
- package/lib/components/VAppBar/VAppBar.css +4 -1
- package/lib/components/VAppBar/VAppBar.mjs +15 -10
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.sass +3 -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.d.ts +156 -0
- package/lib/components/VAppBar/index.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +11 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +142 -105
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +10 -2
- package/lib/components/VAutocomplete/_variables.scss +1 -0
- package/lib/components/VAutocomplete/index.d.ts +1569 -0
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.css +48 -3
- package/lib/components/VAvatar/VAvatar.mjs +29 -23
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +10 -3
- package/lib/components/VAvatar/_mixins.scss +0 -1
- package/lib/components/VAvatar/_variables.scss +9 -4
- package/lib/components/VAvatar/index.d.ts +80 -0
- package/lib/components/VAvatar/index.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.css +3 -6
- package/lib/components/VBadge/VBadge.mjs +20 -49
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.sass +2 -5
- package/lib/components/VBadge/_variables.scss +3 -4
- package/lib/components/VBadge/index.d.ts +123 -0
- package/lib/components/VBadge/index.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.css +81 -57
- package/lib/components/VBanner/VBanner.mjs +45 -37
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.sass +60 -55
- package/lib/components/VBanner/VBannerActions.mjs +34 -2
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/VBannerText.mjs.map +1 -1
- package/lib/components/VBanner/_variables.scss +10 -14
- package/lib/components/VBanner/index.d.ts +122 -0
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +6 -13
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +5 -4
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.sass +6 -14
- package/lib/components/VBottomNavigation/_variables.scss +7 -8
- package/lib/components/VBottomNavigation/index.d.ts +143 -0
- package/lib/components/VBottomNavigation/index.mjs.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/components/VBottomSheet/index.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +13 -6
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +35 -21
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +8 -4
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +15 -17
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/_variables.scss +2 -1
- package/lib/components/VBreadcrumbs/index.d.ts +301 -0
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.css +141 -28
- package/lib/components/VBtn/VBtn.mjs +109 -34
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +119 -16
- package/lib/components/VBtn/_variables.scss +10 -1
- package/lib/components/VBtn/index.d.ts +210 -0
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.css +16 -7
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.sass +14 -7
- package/lib/components/VBtnGroup/_variables.scss +2 -0
- package/lib/components/VBtnGroup/index.d.ts +65 -0
- package/lib/components/VBtnGroup/index.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.mjs +1 -3
- 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.d.ts +175 -0
- package/lib/components/VBtnToggle/index.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
- package/lib/components/VCalendar/index.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-base.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs +2 -6
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/times.mjs.map +1 -1
- package/lib/components/VCalendar/modes/column.mjs.map +1 -1
- package/lib/components/VCalendar/modes/common.mjs.map +1 -1
- package/lib/components/VCalendar/modes/index.mjs.map +1 -1
- package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
- package/lib/components/VCalendar/util/events.mjs.map +1 -1
- package/lib/components/VCalendar/util/parser.mjs.map +1 -1
- package/lib/components/VCalendar/util/props.mjs.map +1 -1
- package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
- package/lib/components/VCard/VCard.css +108 -84
- package/lib/components/VCard/VCard.mjs +72 -73
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +76 -61
- package/lib/components/VCard/VCardActions.mjs +2 -3
- package/lib/components/VCard/VCardActions.mjs.map +1 -1
- package/lib/components/VCard/VCardItem.mjs +88 -0
- package/lib/components/VCard/VCardItem.mjs.map +1 -0
- package/lib/components/VCard/VCardSubtitle.mjs.map +1 -1
- package/lib/components/VCard/VCardText.mjs.map +1 -1
- package/lib/components/VCard/VCardTitle.mjs.map +1 -1
- package/lib/components/VCard/_variables.scss +45 -23
- package/lib/components/VCard/index.d.ts +230 -0
- package/lib/components/VCard/index.mjs +1 -4
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +9 -7
- 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.d.ts +80 -0
- package/lib/components/VCarousel/index.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.mjs +15 -47
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.sass +0 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +67 -0
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -0
- package/lib/components/VCheckbox/index.d.ts +291 -0
- package/lib/components/VCheckbox/index.mjs +1 -0
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +147 -68
- package/lib/components/VChip/VChip.mjs +83 -43
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +9 -1
- package/lib/components/VChip/_mixins.scss +26 -6
- package/lib/components/VChip/_variables.scss +4 -5
- package/lib/components/VChip/index.d.ts +195 -0
- 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.d.ts +89 -0
- 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.d.ts +19 -0
- package/lib/components/VCode/index.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.css +3 -3
- package/lib/components/VColorPicker/VColorPicker.mjs +55 -53
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.css +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +10 -9
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +4 -3
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +14 -21
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.sass +0 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +6 -5
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.sass +0 -1
- package/lib/components/VColorPicker/_variables.scss +17 -10
- package/lib/components/VColorPicker/index.d.ts +116 -0
- package/lib/components/VColorPicker/index.mjs.map +1 -1
- package/lib/components/VColorPicker/util/index.mjs +1 -3
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +11 -1
- package/lib/components/VCombobox/VCombobox.mjs +145 -116
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +10 -2
- package/lib/components/VCombobox/_variables.scss +1 -0
- package/lib/components/VCombobox/index.d.ts +1590 -0
- package/lib/components/VCombobox/index.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.mjs +16 -16
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.sass +1 -2
- package/lib/components/VCounter/_variables.scss +2 -1
- package/lib/components/VCounter/index.d.ts +223 -0
- package/lib/components/VCounter/index.mjs.map +1 -1
- package/lib/components/VData/VData.mjs.map +1 -1
- package/lib/components/VData/index.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
- package/lib/components/VDataIterator/index.mjs.map +1 -1
- package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
- package/lib/components/VDataTable/Row.mjs.map +1 -1
- package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.mjs +11 -15
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
- package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
- package/lib/components/VDataTable/index.mjs.map +1 -1
- package/lib/components/VDataTable/mixins/header.mjs +1 -3
- package/lib/components/VDataTable/mixins/header.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.mjs.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs.map +1 -1
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
- package/lib/components/VDatePicker/util/index.mjs.map +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs.map +1 -1
- package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
- package/lib/components/VDatePicker/util/pad.mjs.map +1 -1
- package/lib/components/VDatePicker/util/sanitizeDateString.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/index.d.ts +26 -0
- package/lib/components/VDefaultsProvider/index.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.css +36 -17
- package/lib/components/VDialog/VDialog.mjs +46 -38
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +30 -15
- package/lib/components/VDialog/_variables.scss +3 -8
- package/lib/components/VDialog/index.d.ts +859 -0
- 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.d.ts +22 -0
- package/lib/components/VDivider/index.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.css +15 -7
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +15 -6
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +14 -11
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs +4 -0
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/_variables.scss +15 -10
- package/lib/components/VExpansionPanel/index.d.ts +206 -0
- package/lib/components/VExpansionPanel/index.mjs.map +1 -1
- package/lib/components/VField/VField.css +63 -41
- package/lib/components/VField/VField.mjs +52 -36
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +49 -35
- package/lib/components/VField/VFieldLabel.mjs +8 -9
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/_variables.scss +6 -5
- package/lib/components/VField/index.d.ts +332 -0
- package/lib/components/VField/index.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +3 -3
- package/lib/components/VFileInput/VFileInput.mjs +48 -47
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +3 -4
- package/lib/components/VFileInput/index.d.ts +236 -0
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.css +8 -1
- package/lib/components/VFooter/VFooter.mjs +36 -18
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.sass +1 -2
- package/lib/components/VFooter/_variables.scss +13 -1
- package/lib/components/VFooter/index.d.ts +76 -0
- package/lib/components/VFooter/index.mjs.map +1 -1
- package/lib/components/VForm/VForm.mjs +27 -13
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.d.ts +72 -0
- package/lib/components/VForm/index.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +2 -1
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +4 -3
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +8 -3
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VGrid/index.d.ts +154 -0
- package/lib/components/VGrid/index.mjs.map +1 -1
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.d.ts +30 -0
- package/lib/components/VHover/index.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.css +13 -16
- package/lib/components/VIcon/VIcon.mjs +34 -33
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.sass +8 -16
- package/lib/components/VIcon/_variables.scss +2 -5
- package/lib/components/VIcon/index.d.ts +124 -0
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.mjs +29 -26
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +0 -1
- package/lib/components/VImg/index.d.ts +89 -0
- package/lib/components/VImg/index.mjs.map +1 -1
- package/lib/components/VInput/InputIcon.mjs +33 -0
- package/lib/components/VInput/InputIcon.mjs.map +1 -0
- package/lib/components/VInput/VInput.css +5 -2
- package/lib/components/VInput/VInput.mjs +26 -18
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +5 -3
- package/lib/components/VInput/_variables.scss +4 -1
- package/lib/components/VInput/index.d.ts +325 -0
- package/lib/components/VInput/index.mjs.map +1 -1
- package/lib/components/VItemGroup/VItem.mjs +3 -0
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.sass +0 -1
- package/lib/components/VItemGroup/index.d.ts +210 -0
- package/lib/components/VItemGroup/index.mjs.map +1 -1
- package/lib/components/VKbd/VKbd.css +1 -1
- package/lib/components/VKbd/VKbd.sass +0 -1
- package/lib/components/VKbd/_variables.scss +1 -1
- package/lib/components/VKbd/index.d.ts +19 -0
- package/lib/components/VKbd/index.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.css +4 -1
- package/lib/components/VLabel/VLabel.mjs +8 -4
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.sass +3 -2
- package/lib/components/VLabel/_variables.scss +1 -0
- package/lib/components/VLabel/index.d.ts +16 -0
- package/lib/components/VLabel/index.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.css +0 -2
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.sass +0 -2
- package/lib/components/VLayout/VLayoutItem.mjs +1 -1
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/index.d.ts +75 -0
- 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.d.ts +85 -0
- package/lib/components/VLazy/index.mjs.map +1 -1
- package/lib/components/VList/VList.css +14 -16
- package/lib/components/VList/VList.mjs +92 -59
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +9 -6
- package/lib/components/VList/VListChildren.mjs +69 -13
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +52 -19
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +181 -73
- package/lib/components/VList/VListItem.mjs +124 -82
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +125 -49
- package/lib/components/VList/VListItemAction.mjs +28 -0
- package/lib/components/VList/VListItemAction.mjs.map +1 -0
- package/lib/components/VList/VListItemMedia.mjs +8 -7
- package/lib/components/VList/VListItemMedia.mjs.map +1 -1
- package/lib/components/VList/VListItemSubtitle.mjs.map +1 -1
- package/lib/components/VList/VListItemTitle.mjs.map +1 -1
- package/lib/components/VList/VListSubheader.mjs +8 -7
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/_variables.scss +24 -9
- package/lib/components/VList/index.d.ts +1250 -0
- package/lib/components/VList/index.mjs +3 -4
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +5 -3
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VLocaleProvider/index.d.ts +23 -0
- package/lib/components/VLocaleProvider/index.mjs.map +1 -1
- package/lib/components/VMain/VMain.css +20 -9
- package/lib/components/VMain/VMain.mjs +17 -11
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +17 -11
- package/lib/components/VMain/_variables.scss +1 -1
- package/lib/components/VMain/index.d.ts +26 -0
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.css +3 -13
- package/lib/components/VMenu/VMenu.mjs +81 -34
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +3 -7
- package/lib/components/VMenu/_variables.scss +0 -1
- package/lib/components/VMenu/index.d.ts +817 -0
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs +2 -0
- package/lib/components/VMenu/shared.mjs.map +1 -0
- package/lib/components/VMessages/VMessages.mjs +5 -3
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.sass +0 -1
- package/lib/components/VMessages/_variables.scss +1 -1
- package/lib/components/VMessages/index.d.ts +234 -0
- package/lib/components/VMessages/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +14 -19
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +60 -21
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +16 -22
- package/lib/components/VNavigationDrawer/_variables.scss +4 -2
- package/lib/components/VNavigationDrawer/index.d.ts +148 -0
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/sticky.mjs +70 -0
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -0
- package/lib/components/VNavigationDrawer/touch.mjs +5 -2
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
- package/lib/components/VNoSsr/index.d.ts +7 -0
- package/lib/components/VNoSsr/index.mjs.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
- package/lib/components/VOtpInput/index.mjs.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
- package/lib/components/VOverflowBtn/index.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.css +7 -0
- package/lib/components/VOverlay/VOverlay.mjs +73 -45
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +8 -1
- package/lib/components/VOverlay/_variables.scss +1 -1
- package/lib/components/VOverlay/index.d.ts +579 -0
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +404 -0
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -0
- package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +19 -13
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +86 -17
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VOverlay/util/point.mjs +3 -3
- package/lib/components/VOverlay/util/point.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +63 -44
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.sass +0 -1
- package/lib/components/VPagination/index.d.ts +247 -0
- package/lib/components/VPagination/index.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.mjs +30 -16
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/index.d.ts +18 -0
- 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.d.ts +68 -0
- package/lib/components/VProgressCircular/index.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.css +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -3
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.sass +0 -1
- package/lib/components/VProgressLinear/_variables.scss +1 -0
- package/lib/components/VProgressLinear/index.d.ts +101 -0
- package/lib/components/VProgressLinear/index.mjs.map +1 -1
- package/lib/components/VRadio/VRadio.mjs +9 -17
- package/lib/components/VRadio/VRadio.mjs.map +1 -1
- package/lib/components/VRadio/index.d.ts +103 -0
- package/lib/components/VRadio/index.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.css +2 -3
- package/lib/components/VRadioGroup/VRadioGroup.mjs +32 -9
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.sass +6 -4
- package/lib/components/VRadioGroup/_variables.scss +2 -4
- package/lib/components/VRadioGroup/index.d.ts +186 -0
- package/lib/components/VRadioGroup/index.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +27 -15
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.ts +242 -0
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.css +2 -2
- package/lib/components/VRating/VRating.mjs +24 -18
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/VRating.sass +4 -3
- package/lib/components/VRating/index.d.ts +356 -0
- 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.d.ts +23 -0
- package/lib/components/VResponsive/index.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.css +18 -2
- package/lib/components/VSelect/VSelect.mjs +145 -112
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +20 -3
- package/lib/components/VSelect/_variables.scss +1 -0
- package/lib/components/VSelect/index.d.ts +1521 -0
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.css +1 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs +33 -25
- 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.d.ts +275 -0
- package/lib/components/VSelectionControl/index.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +5 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +10 -7
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +6 -6
- package/lib/components/VSelectionControlGroup/_variables.scss +1 -4
- package/lib/components/VSelectionControlGroup/index.d.ts +47 -0
- package/lib/components/VSelectionControlGroup/index.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.css +1 -1
- package/lib/components/VSheet/VSheet.mjs +10 -6
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.sass +0 -1
- package/lib/components/VSheet/_variables.scss +3 -2
- package/lib/components/VSheet/index.d.ts +68 -0
- package/lib/components/VSheet/index.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/index.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.css +0 -5
- package/lib/components/VSlideGroup/VSlideGroup.mjs +105 -74
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.sass +0 -5
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +10 -4
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/_variables.scss +0 -5
- package/lib/components/VSlideGroup/helpers.mjs +4 -15
- package/lib/components/VSlideGroup/helpers.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.ts +151 -0
- package/lib/components/VSlideGroup/index.mjs +2 -2
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.css +14 -4
- package/lib/components/VSlider/VSlider.mjs +17 -9
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +17 -9
- package/lib/components/VSlider/VSliderThumb.css +10 -6
- package/lib/components/VSlider/VSliderThumb.mjs +9 -8
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.sass +11 -10
- package/lib/components/VSlider/VSliderTrack.css +25 -25
- package/lib/components/VSlider/VSliderTrack.mjs +22 -16
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.sass +20 -22
- package/lib/components/VSlider/_variables.scss +7 -4
- package/lib/components/VSlider/index.d.ts +239 -0
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +15 -25
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.css +22 -40
- package/lib/components/VSnackbar/VSnackbar.mjs +70 -50
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.sass +15 -35
- package/lib/components/VSnackbar/_variables.scss +3 -7
- package/lib/components/VSnackbar/index.d.ts +892 -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.css +9 -2
- package/lib/components/VSwitch/VSwitch.mjs +15 -6
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +6 -1
- package/lib/components/VSwitch/_variables.scss +1 -0
- package/lib/components/VSwitch/index.d.ts +175 -0
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +1 -6
- package/lib/components/VSystemBar/VSystemBar.mjs +22 -17
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.sass +0 -6
- package/lib/components/VSystemBar/_variables.scss +2 -4
- package/lib/components/VSystemBar/index.d.ts +61 -0
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.css +1 -0
- package/lib/components/VTable/VTable.mjs +9 -8
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +1 -1
- package/lib/components/VTable/_variables.scss +2 -0
- package/lib/components/VTable/index.d.ts +39 -0
- package/lib/components/VTable/index.mjs.map +1 -1
- package/lib/components/VTabs/VTab.css +6 -3
- package/lib/components/VTabs/VTab.mjs +34 -36
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +7 -4
- package/lib/components/VTabs/VTabs.css +16 -13
- package/lib/components/VTabs/VTabs.mjs +17 -15
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +11 -8
- package/lib/components/VTabs/_variables.scss +2 -0
- package/lib/components/VTabs/index.d.ts +178 -0
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs +2 -0
- package/lib/components/VTabs/shared.mjs.map +1 -0
- package/lib/components/VTextField/VTextField.css +5 -5
- package/lib/components/VTextField/VTextField.mjs +42 -37
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +5 -7
- package/lib/components/VTextField/_variables.scss +1 -1
- package/lib/components/VTextField/index.d.ts +582 -0
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.css +14 -5
- package/lib/components/VTextarea/VTextarea.mjs +47 -26
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +18 -8
- package/lib/components/VTextarea/_variables.scss +1 -1
- package/lib/components/VTextarea/index.d.ts +218 -0
- package/lib/components/VTextarea/index.mjs.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
- package/lib/components/VThemeProvider/index.d.ts +24 -0
- package/lib/components/VThemeProvider/index.mjs.map +1 -1
- package/lib/components/VTimePicker/SelectingTimes.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
- package/lib/components/VTimePicker/index.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.css +241 -55
- package/lib/components/VTimeline/VTimeline.mjs +52 -32
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +251 -57
- package/lib/components/VTimeline/VTimelineDivider.mjs +45 -37
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +17 -15
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_mixins.sass +10 -0
- package/lib/components/VTimeline/_variables.scss +16 -9
- package/lib/components/VTimeline/index.d.ts +154 -0
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.css +24 -33
- package/lib/components/VToolbar/VToolbar.mjs +32 -31
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +17 -19
- package/lib/components/VToolbar/VToolbarItems.mjs +12 -9
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
- package/lib/components/VToolbar/_variables.scss +20 -8
- package/lib/components/VToolbar/index.d.ts +414 -0
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.mjs +48 -41
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +0 -1
- package/lib/components/VTooltip/_variables.scss +1 -0
- package/lib/components/VTooltip/index.d.ts +799 -0
- package/lib/components/VTooltip/index.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeview.mjs +1 -3
- package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.mjs.map +1 -1
- package/lib/components/VTreeview/index.mjs.map +1 -1
- package/lib/components/VTreeview/util/filterTreeItems.mjs.map +1 -1
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.ts +61 -0
- package/lib/components/VValidation/index.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.mjs +7 -21
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.sass +0 -2
- package/lib/components/VWindow/VWindowItem.mjs +21 -11
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/_variables.scss +1 -0
- package/lib/components/VWindow/index.d.ts +428 -0
- package/lib/components/VWindow/index.mjs.map +1 -1
- package/lib/components/index.d.ts +14675 -12342
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +66 -10
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/transitions/index.d.ts +454 -0
- package/lib/components/transitions/index.mjs +0 -5
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +5 -6
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs +19 -26
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +2 -2
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/delay.mjs +1 -3
- package/lib/composables/delay.mjs.map +1 -1
- package/lib/composables/density.mjs.map +1 -1
- package/lib/composables/dimensions.mjs.map +1 -1
- package/lib/composables/display.mjs +12 -10
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/elevation.mjs.map +1 -1
- package/lib/composables/filter.mjs +35 -17
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +44 -11
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRefs.mjs +72 -0
- package/lib/composables/forwardRefs.mjs.map +1 -0
- package/lib/composables/group.mjs +16 -12
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/icons.mjs +16 -4
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs +3 -2
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/items.mjs +84 -0
- package/lib/composables/items.mjs.map +1 -0
- package/lib/composables/layout.mjs +24 -24
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/loader.mjs.map +1 -1
- package/lib/composables/locale.mjs +21 -25
- package/lib/composables/locale.mjs.map +1 -1
- package/lib/composables/location.mjs +66 -0
- package/lib/composables/location.mjs.map +1 -0
- package/lib/composables/mutationObserver.mjs +4 -6
- package/lib/composables/mutationObserver.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +34 -22
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs +63 -36
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs +163 -122
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/position.mjs +4 -25
- package/lib/composables/position.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +29 -10
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/refs.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs +1 -9
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +39 -17
- package/lib/composables/router.mjs.map +1 -1
- package/lib/composables/rtl.mjs +2 -4
- package/lib/composables/rtl.mjs.map +1 -1
- package/lib/composables/scopeId.mjs +11 -0
- package/lib/composables/scopeId.mjs.map +1 -0
- package/lib/composables/scroll.mjs +1 -3
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/selectLink.mjs +19 -0
- package/lib/composables/selectLink.mjs.map +1 -0
- package/lib/composables/size.mjs +18 -14
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +3 -2
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +37 -23
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/tag.mjs.map +1 -1
- package/lib/composables/teleport.mjs.map +1 -1
- package/lib/composables/theme.mjs +123 -112
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +18 -0
- package/lib/composables/toggleScope.mjs.map +1 -0
- package/lib/composables/touch.mjs +1 -3
- package/lib/composables/touch.mjs.map +1 -1
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +24 -10
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +7 -8
- package/lib/composables/variant.mjs.map +1 -1
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/color/index.mjs.map +1 -1
- package/lib/directives/index.mjs.map +1 -1
- package/lib/directives/intersect/index.mjs.map +1 -1
- package/lib/directives/mutate/index.mjs +4 -6
- package/lib/directives/mutate/index.mjs.map +1 -1
- package/lib/directives/resize/index.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.sass +0 -1
- package/lib/directives/ripple/index.mjs +16 -6
- package/lib/directives/ripple/index.mjs.map +1 -1
- package/lib/directives/scroll/index.mjs +1 -3
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs +3 -3
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +2 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +59 -47
- 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 +158 -130
- package/lib/locale/adapters/vue-i18n.d.ts +35 -0
- package/lib/locale/adapters/vue-i18n.mjs +1 -3
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/adapters/vue-intl.d.ts +42 -0
- package/lib/locale/adapters/vue-intl.mjs +3 -5
- package/lib/locale/adapters/vue-intl.mjs.map +1 -1
- package/lib/locale/af.mjs +5 -0
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs +5 -0
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs +5 -0
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs +5 -0
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs +14 -9
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs +5 -0
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs +5 -0
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs +5 -0
- package/lib/locale/da.mjs.map +1 -1
- package/lib/locale/de.mjs +5 -0
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs +5 -0
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs +5 -0
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs +5 -0
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs +5 -0
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs +5 -0
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs +5 -0
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs +5 -0
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs +5 -0
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs +5 -0
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs +5 -0
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs +5 -0
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.d.ts +210 -0
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs +5 -0
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs +5 -0
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs +5 -0
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs +5 -0
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs +5 -0
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs +5 -0
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs +5 -0
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs +5 -0
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs +5 -0
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs +5 -0
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs +5 -0
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs +5 -0
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs +5 -0
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs +5 -0
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs +5 -0
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs +5 -0
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs +5 -0
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs +5 -0
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs +5 -0
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs +5 -0
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs +5 -0
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs +5 -0
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/generic/_colors.scss +17 -10
- package/lib/styles/generic/_transitions.scss +13 -77
- package/lib/styles/main.css +1677 -1919
- package/lib/styles/settings/_colors.scss +84 -84
- package/lib/styles/settings/_elevations.scss +3 -3
- package/lib/styles/settings/_utilities.scss +74 -35
- package/lib/styles/tools/_states.sass +18 -5
- package/lib/styles/tools/_utilities.sass +1 -1
- package/lib/styles/tools/_variant.sass +6 -7
- package/lib/styles/utilities/_index.sass +0 -1
- package/lib/util/anchor.mjs +56 -0
- package/lib/util/anchor.mjs.map +1 -0
- package/lib/util/animation.mjs +18 -2
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/box.mjs +12 -0
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/color/APCA.mjs.map +1 -1
- package/lib/util/color/transformCIELAB.mjs.map +1 -1
- package/lib/util/color/transformSRGB.mjs.map +1 -1
- package/lib/util/colorUtils.mjs +2 -2
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/colors.mjs +1 -1
- package/lib/util/colors.mjs.map +1 -1
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs +1 -1
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +37 -11
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/easing.mjs.map +1 -1
- package/lib/util/getCurrentInstance.mjs +22 -4
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/getScrollParent.mjs +3 -1
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/lib/util/globals.mjs +1 -4
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +37 -7
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/index.mjs +1 -0
- package/lib/util/index.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +12 -0
- package/lib/util/injectSelf.mjs.map +1 -0
- package/lib/util/isFixedPosition.mjs.map +1 -1
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +50 -35
- package/lib/components/VBreadcrumbs/shared.mjs +0 -2
- package/lib/components/VBreadcrumbs/shared.mjs.map +0 -1
- package/lib/components/VCard/VCardAvatar.mjs +0 -3
- package/lib/components/VCard/VCardAvatar.mjs.map +0 -1
- package/lib/components/VCard/VCardHeader.mjs +0 -3
- package/lib/components/VCard/VCardHeader.mjs.map +0 -1
- package/lib/components/VCard/VCardHeaderText.mjs +0 -3
- package/lib/components/VCard/VCardHeaderText.mjs.map +0 -1
- package/lib/components/VCard/VCardImg.mjs +0 -3
- package/lib/components/VCard/VCardImg.mjs.map +0 -1
- package/lib/components/VList/VListItemAvatar.mjs +0 -29
- package/lib/components/VList/VListItemAvatar.mjs.map +0 -1
- package/lib/components/VList/VListItemHeader.mjs +0 -3
- package/lib/components/VList/VListItemHeader.mjs.map +0 -1
- package/lib/components/VOverlay/positionStrategies.mjs +0 -203
- package/lib/components/VOverlay/positionStrategies.mjs.map +0 -1
- package/lib/components/VOverlay/util/anchor.mjs +0 -52
- package/lib/components/VOverlay/util/anchor.mjs.map +0 -1
- package/lib/components/VTimeline/shared.mjs +0 -2
- package/lib/components/VTimeline/shared.mjs.map +0 -1
- package/lib/composables/forwardRef.mjs +0 -42
- package/lib/composables/forwardRef.mjs.map +0 -1
- package/lib/composables/overlay.mjs +0 -30
- package/lib/composables/overlay.mjs.map +0 -1
- package/lib/presets/default/index.mjs +0 -71
- package/lib/presets/default/index.mjs.map +0 -1
- package/lib/styles/utilities/_text.sass +0 -9
- package/lib/styles.scss +0 -4
|
@@ -1,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,51 +86,55 @@ 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 =
|
|
94
|
+
const themes = {};
|
|
95
|
+
|
|
96
|
+
for (const [key, theme] of Object.entries(options.themes ?? {})) {
|
|
97
97
|
var _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
|
-
export function createTheme(
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const styleEl = ref();
|
|
114
|
-
const current = ref(parsedOptions.defaultTheme);
|
|
109
|
+
export function createTheme(options) {
|
|
110
|
+
const parsedOptions = reactive(parseThemeOptions(options));
|
|
111
|
+
const name = ref(parsedOptions.defaultTheme);
|
|
115
112
|
const themes = ref(parsedOptions.themes);
|
|
116
|
-
const variations = ref(parsedOptions.variations);
|
|
117
113
|
const computedThemes = computed(() => {
|
|
118
|
-
|
|
119
|
-
var _parsedOptions$variat;
|
|
114
|
+
const acc = {};
|
|
120
115
|
|
|
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
|
-
}, {})
|
|
116
|
+
for (const [name, original] of Object.entries(themes.value)) {
|
|
117
|
+
const theme = acc[name] = { ...original,
|
|
118
|
+
colors: { ...original.colors
|
|
129
119
|
}
|
|
130
120
|
};
|
|
131
121
|
|
|
122
|
+
if (parsedOptions.variations) {
|
|
123
|
+
for (const name of parsedOptions.variations.colors) {
|
|
124
|
+
const color = theme.colors[name];
|
|
125
|
+
|
|
126
|
+
for (const variation of ['lighten', 'darken']) {
|
|
127
|
+
const fn = variation === 'lighten' ? lighten : darken;
|
|
128
|
+
|
|
129
|
+
for (const amount of createRange(parsedOptions.variations[variation], 1)) {
|
|
130
|
+
theme.colors[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
132
136
|
for (const color of Object.keys(theme.colors)) {
|
|
133
|
-
if (
|
|
137
|
+
if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
134
138
|
const onColor = `on-${color}`;
|
|
135
139
|
const colorVal = colorToInt(theme.colors[color]);
|
|
136
140
|
const blackContrast = Math.abs(APCAcontrast(0, colorVal));
|
|
@@ -146,131 +150,117 @@ export function createTheme(app, options) {
|
|
|
146
150
|
|
|
147
151
|
theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
|
|
148
152
|
}
|
|
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
153
|
}
|
|
165
154
|
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
|
|
155
|
+
return acc;
|
|
156
|
+
});
|
|
157
|
+
const current = computed(() => computedThemes.value[name.value]);
|
|
169
158
|
const styles = computed(() => {
|
|
170
159
|
const lines = [];
|
|
171
160
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
161
|
+
if (current.value.dark) {
|
|
162
|
+
createCssClass(lines, ':root', ['color-scheme: dark']);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
for (const [themeName, theme] of Object.entries(computedThemes.value)) {
|
|
166
|
+
const {
|
|
167
|
+
variables,
|
|
168
|
+
dark
|
|
169
|
+
} = theme;
|
|
170
|
+
createCssClass(lines, `.v-theme--${themeName}`, [`color-scheme: ${dark ? 'dark' : 'normal'}`, ...genCssVariables(theme), ...Object.keys(variables).map(key => {
|
|
175
171
|
const value = variables[key];
|
|
176
172
|
const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined;
|
|
177
173
|
const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined;
|
|
178
|
-
return `--v-${key}: ${rgb
|
|
179
|
-
})])
|
|
174
|
+
return `--v-${key}: ${rgb ?? value}`;
|
|
175
|
+
})]);
|
|
180
176
|
}
|
|
181
177
|
|
|
178
|
+
const bgLines = [];
|
|
179
|
+
const fgLines = [];
|
|
182
180
|
const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)));
|
|
183
181
|
|
|
184
182
|
for (const key of colors) {
|
|
185
|
-
if (
|
|
186
|
-
|
|
183
|
+
if (/^on-[a-z]/.test(key)) {
|
|
184
|
+
createCssClass(fgLines, `.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
187
185
|
} else {
|
|
188
|
-
|
|
186
|
+
createCssClass(bgLines, `.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`]);
|
|
187
|
+
createCssClass(fgLines, `.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
188
|
+
createCssClass(fgLines, `.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
lines.push(...bgLines, ...fgLines);
|
|
192
193
|
return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('');
|
|
193
194
|
});
|
|
194
195
|
|
|
195
|
-
function
|
|
196
|
-
const
|
|
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 = [];
|
|
196
|
+
function install(app) {
|
|
197
|
+
const head = app._context.provides.usehead;
|
|
201
198
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
if (head) {
|
|
200
|
+
head.addHeadObjs(computed(() => {
|
|
201
|
+
const style = {
|
|
202
|
+
children: styles.value,
|
|
203
|
+
type: 'text/css',
|
|
204
|
+
id: 'vuetify-theme-stylesheet'
|
|
205
|
+
};
|
|
206
|
+
if (parsedOptions.cspNonce) style.nonce = parsedOptions.cspNonce;
|
|
207
|
+
return {
|
|
208
|
+
style: [style]
|
|
209
|
+
};
|
|
210
|
+
}));
|
|
205
211
|
|
|
206
|
-
if (
|
|
207
|
-
|
|
212
|
+
if (IN_BROWSER) {
|
|
213
|
+
watchEffect(() => head.updateDOM());
|
|
208
214
|
}
|
|
209
|
-
}
|
|
215
|
+
} else {
|
|
216
|
+
let styleEl = IN_BROWSER ? document.getElementById('vuetify-theme-stylesheet') : null;
|
|
217
|
+
watch(styles, updateStyles, {
|
|
218
|
+
immediate: true
|
|
219
|
+
});
|
|
210
220
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
function createCssClass(selector, content) {
|
|
215
|
-
return [`${selector} {\n`, ...content.map(line => ` ${line};\n`), '}\n'];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (head) {
|
|
219
|
-
head.addHeadObjs(computed(() => ({
|
|
220
|
-
style: [{
|
|
221
|
-
children: styles.value,
|
|
222
|
-
type: 'text/css',
|
|
223
|
-
id: 'vuetify-theme-stylesheet'
|
|
224
|
-
}]
|
|
225
|
-
})));
|
|
226
|
-
|
|
227
|
-
if (IN_BROWSER) {
|
|
228
|
-
watchEffect(() => head.updateDOM());
|
|
229
|
-
}
|
|
230
|
-
} else {
|
|
231
|
-
watch(themes, updateStyles, {
|
|
232
|
-
deep: true,
|
|
233
|
-
immediate: true
|
|
234
|
-
});
|
|
221
|
+
function updateStyles() {
|
|
222
|
+
if (parsedOptions.isDisabled) return;
|
|
235
223
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
224
|
+
if (typeof document !== 'undefined' && !styleEl) {
|
|
225
|
+
const el = document.createElement('style');
|
|
226
|
+
el.type = 'text/css';
|
|
227
|
+
el.id = 'vuetify-theme-stylesheet';
|
|
228
|
+
if (parsedOptions.cspNonce) el.setAttribute('nonce', parsedOptions.cspNonce);
|
|
229
|
+
styleEl = el;
|
|
230
|
+
document.head.appendChild(styleEl);
|
|
231
|
+
}
|
|
241
232
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const el = document.createElement('style');
|
|
245
|
-
el.type = 'text/css';
|
|
246
|
-
el.id = 'vuetify-theme-stylesheet';
|
|
247
|
-
styleEl.value = el;
|
|
248
|
-
document.head.appendChild(styleEl.value);
|
|
233
|
+
if (styleEl) styleEl.innerHTML = styles.value;
|
|
234
|
+
}
|
|
249
235
|
}
|
|
250
236
|
}
|
|
251
237
|
|
|
238
|
+
const themeClasses = computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${name.value}`);
|
|
252
239
|
return {
|
|
240
|
+
install,
|
|
253
241
|
isDisabled: parsedOptions.isDisabled,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
getTheme: key => computedThemes.value[key],
|
|
242
|
+
name,
|
|
243
|
+
themes,
|
|
257
244
|
current,
|
|
258
|
-
|
|
259
|
-
|
|
245
|
+
computedThemes,
|
|
246
|
+
themeClasses,
|
|
247
|
+
styles,
|
|
248
|
+
global: {
|
|
249
|
+
name,
|
|
250
|
+
current
|
|
251
|
+
}
|
|
260
252
|
};
|
|
261
253
|
}
|
|
262
254
|
export function provideTheme(props) {
|
|
263
255
|
getCurrentInstance('provideTheme');
|
|
264
256
|
const theme = inject(ThemeSymbol, null);
|
|
265
257
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return (_props$theme = props.theme) != null ? _props$theme : theme == null ? void 0 : theme.current.value;
|
|
258
|
+
const name = computed(() => {
|
|
259
|
+
return props.theme ?? (theme == null ? void 0 : theme.name.value);
|
|
270
260
|
});
|
|
271
|
-
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${
|
|
261
|
+
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${name.value}`);
|
|
272
262
|
const newTheme = { ...theme,
|
|
273
|
-
|
|
263
|
+
name,
|
|
274
264
|
themeClasses
|
|
275
265
|
};
|
|
276
266
|
provide(ThemeSymbol, newTheme);
|
|
@@ -282,4 +272,25 @@ export function useTheme() {
|
|
|
282
272
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
283
273
|
return theme;
|
|
284
274
|
}
|
|
275
|
+
|
|
276
|
+
function createCssClass(lines, selector, content) {
|
|
277
|
+
lines.push(`${selector} {\n`, ...content.map(line => ` ${line};\n`), '}\n');
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function genCssVariables(theme) {
|
|
281
|
+
const lightOverlay = theme.dark ? 2 : 1;
|
|
282
|
+
const darkOverlay = theme.dark ? 1 : 2;
|
|
283
|
+
const variables = [];
|
|
284
|
+
|
|
285
|
+
for (const [key, value] of Object.entries(theme.colors)) {
|
|
286
|
+
const rgb = colorToRGB(value);
|
|
287
|
+
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
288
|
+
|
|
289
|
+
if (!key.startsWith('on-')) {
|
|
290
|
+
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return variables;
|
|
295
|
+
}
|
|
285
296
|
//# 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,EAAAA,MAAM,EAAE;AACNC,IAAAA,KAAK,EAAE;AACLC,MAAAA,IAAI,EAAE,KADD;AAELH,MAAAA,MAAM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AAM2D,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","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","bgLines","fgLines","Set","values","flatMap","push","str","i","join","install","app","head","_context","provides","usehead","addHeadObjs","style","children","type","id","cspNonce","nonce","updateDOM","styleEl","document","getElementById","updateStyles","immediate","el","createElement","setAttribute","appendChild","innerHTML","themeClasses","global","provideTheme","props","Error","newTheme","useTheme","selector","content","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 { HeadAttrs, 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 cspNonce?: string\n defaultTheme?: string\n variations?: false | VariationsOptions\n themes?: Record<string, ThemeDefinition>\n}\nexport type ThemeDefinition = DeepPartial<InternalThemeDefinition>\n\ninterface InternalThemeOptions {\n cspNonce?: string\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 (options?: ThemeOptions): ThemeInstance & { install: (app: App) => void } {\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 bgLines: string[] = []\n const fgLines: string[] = []\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(fgLines, `.${key}`, [`color: rgb(var(--v-theme-${key})) !important`])\n } else {\n createCssClass(bgLines, `.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(fgLines, `.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`])\n createCssClass(fgLines, `.border-${key}`, [`--v-border-color: var(--v-theme-${key})`])\n }\n }\n\n lines.push(...bgLines, ...fgLines)\n\n return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('')\n })\n\n function install (app: App) {\n const head = app._context.provides.usehead as HeadClient | undefined\n if (head) {\n head.addHeadObjs(computed(() => {\n const style: HeadAttrs = {\n children: styles.value,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n }\n if (parsedOptions.cspNonce) style.nonce = parsedOptions.cspNonce\n\n return { style: [style] }\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\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 if (parsedOptions.cspNonce) el.setAttribute('nonce', parsedOptions.cspNonce)\n\n styleEl = el\n document.head.appendChild(styleEl)\n }\n\n if (styleEl) styleEl.innerHTML = styles.value\n }\n }\n }\n\n const themeClasses = computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${name.value}`)\n\n return {\n install,\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;;AA6EA,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,EA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I,KAAL,EAAY,MAAM,IAAI8F,KAAJ,CAAU,wCAAV,CAAN;EAEZ,OAAO9F,KAAP;AACD;;AAED,SAAS+C,cAAT,CAAyBD,KAAzB,EAA0CmD,QAA1C,EAA4DC,OAA5D,EAA+E;EAC7EpD,KAAK,CAACgB,IAAN,CACG,GAAEmC,QAAS,MADd,EAEE,GAAGC,OAAO,CAAChD,GAAR,CAAYiD,IAAI,IAAK,KAAIA,IAAK,KAA9B,CAFL,EAGE,KAHF;AAKD;;AAED,SAASlD,eAAT,CAA0BjD,KAA1B,EAA0D;EACxD,MAAMoG,YAAY,GAAGpG,KAAK,CAACQ,IAAN,GAAa,CAAb,GAAiB,CAAtC;EACA,MAAM6F,WAAW,GAAGrG,KAAK,CAACQ,IAAN,GAAa,CAAb,GAAiB,CAArC;EAEA,MAAMS,SAAmB,GAAG,EAA5B;;EACA,KAAK,MAAM,CAACI,GAAD,EAAMS,KAAN,CAAX,IAA2BR,MAAM,CAACC,OAAP,CAAevB,KAAK,CAACK,MAArB,CAA3B,EAAyD;IACvD,MAAMgD,GAAG,GAAGpE,UAAU,CAAC6C,KAAD,CAAtB;IACAb,SAAS,CAAC6C,IAAV,CAAgB,aAAYzC,GAAI,KAAIgC,GAAG,CAACC,CAAE,IAAGD,GAAG,CAACE,CAAE,IAAGF,GAAG,CAACG,CAAE,EAA5D;;IACA,IAAI,CAACnC,GAAG,CAAC8B,UAAJ,CAAe,KAAf,CAAL,EAA4B;MAC1BlC,SAAS,CAAC6C,IAAV,CAAgB,aAAYzC,GAAI,wBAAuBhC,OAAO,CAACyC,KAAD,CAAP,GAAiB,IAAjB,GAAwBsE,YAAxB,GAAuCC,WAAY,EAA1G;IACD;EACF;;EAED,OAAOpF,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"}
|
|
@@ -62,9 +62,7 @@ export function useVelocity() {
|
|
|
62
62
|
|
|
63
63
|
function addMovement(e) {
|
|
64
64
|
Array.from(e.changedTouches).forEach(touch => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const samples = (_touches$touch$identi = touches[touch.identifier]) != null ? _touches$touch$identi : touches[touch.identifier] = new CircularBuffer(HISTORY);
|
|
65
|
+
const samples = touches[touch.identifier] ?? (touches[touch.identifier] = new CircularBuffer(HISTORY));
|
|
68
66
|
samples.push([e.timeStamp, touch]);
|
|
69
67
|
});
|
|
70
68
|
}
|
|
@@ -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,S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AAC,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 } from 'vue';
|
|
5
|
+
import { computed, onBeforeMount, onBeforeUnmount, onMounted, 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({
|
|
@@ -17,20 +17,24 @@ export const makeValidationProps = propsFactory({
|
|
|
17
17
|
default: 1
|
|
18
18
|
},
|
|
19
19
|
name: String,
|
|
20
|
+
label: String,
|
|
20
21
|
readonly: Boolean,
|
|
21
22
|
rules: {
|
|
22
23
|
type: Array,
|
|
23
24
|
default: () => []
|
|
24
25
|
},
|
|
25
|
-
modelValue: null
|
|
26
|
+
modelValue: null,
|
|
27
|
+
validationValue: null
|
|
26
28
|
});
|
|
27
29
|
export function useValidation(props) {
|
|
28
30
|
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
|
|
31
|
+
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getUid();
|
|
29
32
|
const model = useProxiedModel(props, 'modelValue');
|
|
33
|
+
const validationModel = computed(() => props.validationValue === undefined ? model.value : props.validationValue);
|
|
30
34
|
const form = useForm();
|
|
31
35
|
const internalErrorMessages = ref([]);
|
|
32
36
|
const isPristine = ref(true);
|
|
33
|
-
const isDirty = computed(() => wrapInArray(model.value
|
|
37
|
+
const isDirty = computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
34
38
|
const isDisabled = computed(() => !!(props.disabled || form != null && form.isDisabled.value));
|
|
35
39
|
const isReadonly = computed(() => !!(props.readonly || form != null && form.isReadonly.value));
|
|
36
40
|
const errorMessages = computed(() => {
|
|
@@ -38,6 +42,7 @@ export function useValidation(props) {
|
|
|
38
42
|
});
|
|
39
43
|
const isValid = computed(() => {
|
|
40
44
|
if (props.error || errorMessages.value.length) return false;
|
|
45
|
+
if (!props.rules.length) return true;
|
|
41
46
|
return isPristine.value ? null : true;
|
|
42
47
|
});
|
|
43
48
|
const isValidating = ref(false);
|
|
@@ -49,16 +54,25 @@ export function useValidation(props) {
|
|
|
49
54
|
[`${name}--readonly`]: isReadonly.value
|
|
50
55
|
};
|
|
51
56
|
});
|
|
52
|
-
const uid = computed(() =>
|
|
53
|
-
var _props$name;
|
|
54
|
-
|
|
55
|
-
return (_props$name = props.name) != null ? _props$name : getUid();
|
|
56
|
-
});
|
|
57
|
+
const uid = computed(() => props.name ?? unref(id));
|
|
57
58
|
onBeforeMount(() => {
|
|
58
|
-
form == null ? void 0 : form.register(
|
|
59
|
+
form == null ? void 0 : form.register({
|
|
60
|
+
id: uid.value,
|
|
61
|
+
validate,
|
|
62
|
+
reset,
|
|
63
|
+
resetValidation
|
|
64
|
+
});
|
|
59
65
|
});
|
|
60
66
|
onBeforeUnmount(() => {
|
|
61
67
|
form == null ? void 0 : form.unregister(uid.value);
|
|
68
|
+
}); // Set initial valid state, for inputs that might not have rules
|
|
69
|
+
|
|
70
|
+
onMounted(() => form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value));
|
|
71
|
+
watch(validationModel, () => {
|
|
72
|
+
if (validationModel.value != null) validate();
|
|
73
|
+
});
|
|
74
|
+
watch(isValid, () => {
|
|
75
|
+
form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value);
|
|
62
76
|
});
|
|
63
77
|
|
|
64
78
|
function reset() {
|
|
@@ -81,7 +95,7 @@ export function useValidation(props) {
|
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
const handler = typeof rule === 'function' ? rule : () => rule;
|
|
84
|
-
const result = await handler(
|
|
98
|
+
const result = await handler(validationModel.value);
|
|
85
99
|
if (result === true) continue;
|
|
86
100
|
|
|
87
101
|
if (typeof result !== 'string') {
|