vuetify 3.8.5 → 3.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json/attributes.json +2718 -2718
- package/dist/json/importMap-labs.json +12 -12
- package/dist/json/importMap.json +182 -182
- package/dist/json/web-types.json +4939 -4939
- package/dist/vuetify-labs.cjs +1014 -932
- package/dist/vuetify-labs.css +5501 -5490
- package/dist/vuetify-labs.d.ts +609 -606
- package/dist/vuetify-labs.esm.js +1015 -933
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +1014 -932
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +901 -819
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +3585 -3574
- package/dist/vuetify.d.ts +521 -518
- package/dist/vuetify.esm.js +902 -820
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +901 -819
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +1064 -1053
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.js +11 -11
- package/lib/components/VAlert/VAlert.js.map +1 -1
- package/lib/components/VApp/VApp.js +5 -5
- package/lib/components/VApp/VApp.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.d.ts +84 -84
- package/lib/components/VAutocomplete/VAutocomplete.js +9 -9
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VAvatar/VAvatar.js +4 -4
- package/lib/components/VAvatar/VAvatar.js.map +1 -1
- package/lib/components/VBadge/VBadge.js +3 -3
- package/lib/components/VBadge/VBadge.js.map +1 -1
- package/lib/components/VBanner/VBanner.js +6 -6
- package/lib/components/VBanner/VBanner.js.map +1 -1
- package/lib/components/VBanner/VBannerActions.js +4 -4
- package/lib/components/VBanner/VBannerActions.js.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.js +6 -6
- package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js +5 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.js +4 -4
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js +5 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
- package/lib/components/VBtn/VBtn.js +7 -7
- package/lib/components/VBtn/VBtn.js.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.js +4 -4
- package/lib/components/VBtnGroup/VBtnGroup.js.map +1 -1
- package/lib/components/VCard/VCard.js +5 -5
- package/lib/components/VCard/VCard.js.map +1 -1
- package/lib/components/VCard/VCardActions.js +4 -4
- package/lib/components/VCard/VCardActions.js.map +1 -1
- package/lib/components/VCard/VCardItem.js +9 -9
- package/lib/components/VCard/VCardItem.js.map +1 -1
- package/lib/components/VCard/VCardSubtitle.js +4 -4
- package/lib/components/VCard/VCardSubtitle.js.map +1 -1
- package/lib/components/VCard/VCardText.js +4 -4
- package/lib/components/VCard/VCardText.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.js +4 -4
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.d.ts +12 -12
- package/lib/components/VChip/VChip.js +11 -11
- package/lib/components/VChip/VChip.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.js +3 -3
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.js +9 -9
- package/lib/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.js +6 -6
- package/lib/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.js +11 -11
- package/lib/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.js +10 -10
- package/lib/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/lib/components/VCombobox/VCombobox.d.ts +84 -84
- package/lib/components/VCombobox/VCombobox.js +9 -9
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VConfirmEdit/VConfirmEdit.js +3 -3
- package/lib/components/VConfirmEdit/VConfirmEdit.js.map +1 -1
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.js +3 -3
- package/lib/components/VConfirmEdit/__test__/VConfirmEdit.spec.browser.js.map +1 -1
- package/lib/components/VCounter/VCounter.js +5 -5
- package/lib/components/VCounter/VCounter.js.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.js +5 -5
- package/lib/components/VDataIterator/VDataIterator.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +4 -4
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VDataTable/VDataTableColumn.js +5 -5
- package/lib/components/VDataTable/VDataTableColumn.js.map +1 -1
- package/lib/components/VDataTable/VDataTableFooter.js +6 -6
- package/lib/components/VDataTable/VDataTableFooter.js.map +1 -1
- package/lib/components/VDataTable/VDataTableGroupHeaderRow.js +7 -7
- package/lib/components/VDataTable/VDataTableGroupHeaderRow.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaders.js +11 -11
- package/lib/components/VDataTable/VDataTableHeaders.js.map +1 -1
- package/lib/components/VDataTable/VDataTableRow.js +6 -6
- package/lib/components/VDataTable/VDataTableRow.js.map +1 -1
- package/lib/components/VDataTable/VDataTableRows.js +7 -7
- package/lib/components/VDataTable/VDataTableRows.js.map +1 -1
- package/lib/components/VDataTable/VDataTableServer.js +4 -4
- package/lib/components/VDataTable/VDataTableServer.js.map +1 -1
- package/lib/components/VDataTable/VDataTableVirtual.js +14 -14
- package/lib/components/VDataTable/VDataTableVirtual.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +3 -3
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerControls.js +5 -5
- package/lib/components/VDatePicker/VDatePickerControls.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.js +8 -8
- package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonth.js +10 -10
- package/lib/components/VDatePicker/VDatePickerMonth.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonths.js +5 -5
- package/lib/components/VDatePicker/VDatePickerMonths.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.js +5 -5
- package/lib/components/VDatePicker/VDatePickerYears.js.map +1 -1
- package/lib/components/VDialog/__test__/VDialog.spec.browser.js +5 -5
- package/lib/components/VDialog/__test__/VDialog.spec.browser.js.map +1 -1
- package/lib/components/VDivider/VDivider.js +10 -10
- package/lib/components/VDivider/VDivider.js.map +1 -1
- package/lib/components/VEmptyState/VEmptyState.js +14 -14
- package/lib/components/VEmptyState/VEmptyState.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.js +6 -6
- package/lib/components/VExpansionPanel/VExpansionPanel.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelText.js +5 -5
- package/lib/components/VExpansionPanel/VExpansionPanelText.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.js +10 -10
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.js +4 -4
- package/lib/components/VExpansionPanel/VExpansionPanels.js.map +1 -1
- package/lib/components/VFab/VFab.js +7 -7
- package/lib/components/VFab/VFab.js.map +1 -1
- package/lib/components/VField/VField.js +20 -18
- package/lib/components/VField/VField.js.map +1 -1
- package/lib/components/VField/VFieldLabel.js +4 -4
- package/lib/components/VField/VFieldLabel.js.map +1 -1
- package/lib/components/VFileInput/VFileInput.d.ts +30 -30
- package/lib/components/VFileInput/VFileInput.js +5 -5
- package/lib/components/VFileInput/VFileInput.js.map +1 -1
- package/lib/components/VFooter/VFooter.js +4 -4
- package/lib/components/VFooter/VFooter.js.map +1 -1
- package/lib/components/VForm/VForm.js +4 -4
- package/lib/components/VForm/VForm.js.map +1 -1
- package/lib/components/VGrid/VContainer.js +4 -4
- package/lib/components/VGrid/VContainer.js.map +1 -1
- package/lib/components/VIcon/VIcon.js +5 -5
- package/lib/components/VIcon/VIcon.js.map +1 -1
- package/lib/components/VImg/VImg.js +19 -19
- package/lib/components/VImg/VImg.js.map +1 -1
- package/lib/components/VInfiniteScroll/VInfiniteScroll.js +10 -10
- package/lib/components/VInfiniteScroll/VInfiniteScroll.js.map +1 -1
- package/lib/components/VInput/InputIcon.d.ts +1 -1
- package/lib/components/VInput/InputIcon.js +5 -4
- package/lib/components/VInput/InputIcon.js.map +1 -1
- package/lib/components/VInput/VInput.d.ts +12 -12
- package/lib/components/VInput/VInput.js +9 -9
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +3 -3
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VLabel/VLabel.js +5 -5
- package/lib/components/VLabel/VLabel.js.map +1 -1
- package/lib/components/VLayout/VLayout.js +4 -4
- package/lib/components/VLayout/VLayout.js.map +1 -1
- package/lib/components/VLayout/VLayoutItem.js +4 -4
- package/lib/components/VLayout/VLayoutItem.js.map +1 -1
- package/lib/components/VLazy/VLazy.js +6 -6
- package/lib/components/VLazy/VLazy.js.map +1 -1
- package/lib/components/VList/VList.d.ts +3 -3
- package/lib/components/VList/VList.js +4 -4
- package/lib/components/VList/VList.js.map +1 -1
- package/lib/components/VList/VListGroup.js +5 -5
- package/lib/components/VList/VListGroup.js.map +1 -1
- package/lib/components/VList/VListItem.js +11 -11
- package/lib/components/VList/VListItem.js.map +1 -1
- package/lib/components/VList/VListItemAction.js +4 -4
- package/lib/components/VList/VListItemAction.js.map +1 -1
- package/lib/components/VList/VListItemMedia.js +4 -4
- package/lib/components/VList/VListItemMedia.js.map +1 -1
- package/lib/components/VList/VListItemSubtitle.js +4 -4
- package/lib/components/VList/VListItemSubtitle.js.map +1 -1
- package/lib/components/VList/VListSubheader.js +6 -6
- package/lib/components/VList/VListSubheader.js.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.js +4 -4
- package/lib/components/VLocaleProvider/VLocaleProvider.js.map +1 -1
- package/lib/components/VMain/VMain.js +5 -5
- package/lib/components/VMain/VMain.js.map +1 -1
- package/lib/components/VMessages/VMessages.js +4 -4
- package/lib/components/VMessages/VMessages.js.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js +7 -7
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/lib/components/VNavigationDrawer/touch.js +2 -4
- package/lib/components/VNavigationDrawer/touch.js.map +1 -1
- package/lib/components/VNumberInput/VNumberInput.css +15 -4
- package/lib/components/VNumberInput/VNumberInput.d.ts +80 -80
- package/lib/components/VNumberInput/VNumberInput.js +38 -22
- package/lib/components/VNumberInput/VNumberInput.js.map +1 -1
- package/lib/components/VNumberInput/VNumberInput.sass +18 -6
- package/lib/components/VOtpInput/VOtpInput.js +7 -7
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/components/VOverlay/VOverlay.js +8 -8
- package/lib/components/VOverlay/VOverlay.js.map +1 -1
- package/lib/components/VOverlay/locationStrategies.js +16 -8
- package/lib/components/VOverlay/locationStrategies.js.map +1 -1
- package/lib/components/VPagination/VPagination.js +11 -11
- package/lib/components/VPagination/VPagination.js.map +1 -1
- package/lib/components/VParallax/VParallax.js +4 -4
- package/lib/components/VParallax/VParallax.js.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.js +14 -14
- package/lib/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.js +26 -26
- package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.d.ts +12 -12
- package/lib/components/VRadioGroup/VRadioGroup.js +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.d.ts +12 -12
- package/lib/components/VRangeSlider/VRangeSlider.js +5 -5
- package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/lib/components/VRating/VRating.js +14 -14
- package/lib/components/VRating/VRating.js.map +1 -1
- package/lib/components/VResponsive/VResponsive.js +9 -9
- package/lib/components/VResponsive/VResponsive.js.map +1 -1
- package/lib/components/VSelect/VSelect.d.ts +84 -84
- package/lib/components/VSelect/VSelect.js +44 -13
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.js +11 -11
- package/lib/components/VSelectionControl/VSelectionControl.js.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.js +5 -5
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.js.map +1 -1
- package/lib/components/VSheet/VSheet.js +3 -3
- package/lib/components/VSheet/VSheet.js.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.js +4 -4
- package/lib/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +12 -12
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VSlider/VSlider.d.ts +12 -12
- package/lib/components/VSlider/VSlider.js +4 -4
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VSlider/VSliderThumb.js +19 -19
- package/lib/components/VSlider/VSliderThumb.js.map +1 -1
- package/lib/components/VSlider/VSliderTrack.js +23 -23
- package/lib/components/VSlider/VSliderTrack.js.map +1 -1
- package/lib/components/VSlider/slider.js +1 -1
- package/lib/components/VSlider/slider.js.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.js +4 -4
- package/lib/components/VSnackbar/VSnackbar.js.map +1 -1
- package/lib/components/VSnackbarQueue/VSnackbarQueue.js +3 -3
- package/lib/components/VSnackbarQueue/VSnackbarQueue.js.map +1 -1
- package/lib/components/VSparkline/VBarline.js +12 -12
- package/lib/components/VSparkline/VBarline.js.map +1 -1
- package/lib/components/VSparkline/VTrendline.js +8 -8
- package/lib/components/VSparkline/VTrendline.js.map +1 -1
- package/lib/components/VStepper/VStepper.js +2 -2
- package/lib/components/VStepper/VStepper.js.map +1 -1
- package/lib/components/VStepper/VStepperActions.js +2 -2
- package/lib/components/VStepper/VStepperActions.js.map +1 -1
- package/lib/components/VStepper/VStepperItem.js +10 -10
- package/lib/components/VStepper/VStepperItem.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.d.ts +12 -12
- package/lib/components/VSwitch/VSwitch.js +10 -10
- package/lib/components/VSwitch/VSwitch.js.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.js +4 -4
- package/lib/components/VSystemBar/VSystemBar.js.map +1 -1
- package/lib/components/VTable/VTable.js +8 -8
- package/lib/components/VTable/VTable.js.map +1 -1
- package/lib/components/VTabs/VTab.js +4 -4
- package/lib/components/VTabs/VTab.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +2 -2
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTextField/VTextField.d.ts +30 -30
- package/lib/components/VTextField/VTextField.js +12 -12
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTextarea/VTextarea.d.ts +30 -30
- package/lib/components/VTextarea/VTextarea.js +10 -10
- package/lib/components/VTextarea/VTextarea.js.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.js +3 -3
- package/lib/components/VThemeProvider/VThemeProvider.js.map +1 -1
- package/lib/components/VTimeline/VTimeline.js +5 -5
- package/lib/components/VTimeline/VTimeline.js.map +1 -1
- package/lib/components/VTimeline/VTimelineDivider.js +17 -17
- package/lib/components/VTimeline/VTimelineDivider.js.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.js +9 -9
- package/lib/components/VTimeline/VTimelineItem.js.map +1 -1
- package/lib/components/VToolbar/VToolbar.js +13 -13
- package/lib/components/VToolbar/VToolbar.js.map +1 -1
- package/lib/components/VToolbar/VToolbarItems.js +4 -4
- package/lib/components/VToolbar/VToolbarItems.js.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.js +4 -4
- package/lib/components/VToolbar/VToolbarTitle.js.map +1 -1
- package/lib/components/VValidation/VValidation.d.ts +8 -8
- package/lib/components/VVirtualScroll/VVirtualScroll.js +13 -13
- package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScrollItem.js +3 -3
- package/lib/components/VVirtualScroll/VVirtualScrollItem.js.map +1 -1
- package/lib/components/VWindow/VWindow.js +13 -13
- package/lib/components/VWindow/VWindow.js.map +1 -1
- package/lib/components/VWindow/VWindowItem.js +6 -6
- package/lib/components/VWindow/VWindowItem.js.map +1 -1
- package/lib/composables/filter.js +8 -8
- package/lib/composables/filter.js.map +1 -1
- package/lib/composables/goto.js +1 -1
- package/lib/composables/goto.js.map +1 -1
- package/lib/composables/icons.js +6 -6
- package/lib/composables/icons.js.map +1 -1
- package/lib/composables/loader.js +3 -3
- package/lib/composables/loader.js.map +1 -1
- package/lib/composables/validation.d.ts +6 -5
- package/lib/composables/validation.js +4 -29
- package/lib/composables/validation.js.map +1 -1
- package/lib/composables/variant.js +5 -5
- package/lib/composables/variant.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +60 -60
- package/lib/framework.js +1 -1
- package/lib/labs/VCalendar/VCalendar.js +15 -15
- package/lib/labs/VCalendar/VCalendar.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarDay.js +4 -4
- package/lib/labs/VCalendar/VCalendarDay.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarHeader.js +4 -4
- package/lib/labs/VCalendar/VCalendarHeader.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarInterval.js +10 -10
- package/lib/labs/VCalendar/VCalendarInterval.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarIntervalEvent.js +2 -2
- package/lib/labs/VCalendar/VCalendarIntervalEvent.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarMonthDay.js +6 -6
- package/lib/labs/VCalendar/VCalendarMonthDay.js.map +1 -1
- package/lib/labs/VColorInput/VColorInput.d.ts +12 -12
- package/lib/labs/VColorInput/VColorInput.js +3 -3
- package/lib/labs/VColorInput/VColorInput.js.map +1 -1
- package/lib/labs/VDateInput/VDateInput.d.ts +84 -84
- package/lib/labs/VDateInput/VDateInput.js +2 -2
- package/lib/labs/VDateInput/VDateInput.js.map +1 -1
- package/lib/labs/VFileUpload/VFileUpload.js +9 -9
- package/lib/labs/VFileUpload/VFileUpload.js.map +1 -1
- package/lib/labs/VFileUpload/VFileUploadItem.js +3 -3
- package/lib/labs/VFileUpload/VFileUploadItem.js.map +1 -1
- package/lib/labs/VIconBtn/VIconBtn.js +7 -7
- package/lib/labs/VIconBtn/VIconBtn.js.map +1 -1
- package/lib/labs/VPicker/VPicker.js +7 -7
- package/lib/labs/VPicker/VPicker.js.map +1 -1
- package/lib/labs/VPullToRefresh/VPullToRefresh.js +13 -13
- package/lib/labs/VPullToRefresh/VPullToRefresh.js.map +1 -1
- package/lib/labs/VStepperVertical/VStepperVertical.js +2 -2
- package/lib/labs/VStepperVertical/VStepperVertical.js.map +1 -1
- package/lib/labs/VStepperVertical/VStepperVerticalItem.js +5 -5
- package/lib/labs/VStepperVertical/VStepperVerticalItem.js.map +1 -1
- package/lib/labs/VTimePicker/VTimePicker.js +2 -2
- package/lib/labs/VTimePicker/VTimePicker.js.map +1 -1
- package/lib/labs/VTimePicker/VTimePickerClock.js +15 -15
- package/lib/labs/VTimePicker/VTimePickerClock.js.map +1 -1
- package/lib/labs/VTimePicker/VTimePickerControls.js +24 -24
- package/lib/labs/VTimePicker/VTimePickerControls.js.map +1 -1
- package/lib/labs/VTreeview/VTreeviewChildren.js +2 -2
- package/lib/labs/VTreeview/VTreeviewChildren.js.map +1 -1
- package/lib/labs/VTreeview/VTreeviewGroup.js +2 -2
- package/lib/labs/VTreeview/VTreeviewGroup.js.map +1 -1
- package/lib/labs/VTreeview/VTreeviewItem.js +3 -3
- package/lib/labs/VTreeview/VTreeviewItem.js.map +1 -1
- package/lib/labs/rules/rules.d.ts +9 -5
- package/lib/labs/rules/rules.js +73 -51
- package/lib/labs/rules/rules.js.map +1 -1
- package/lib/util/box.d.ts +1 -0
- package/lib/util/box.js +27 -0
- package/lib/util/box.js.map +1 -1
- package/lib/util/helpers.d.ts +1 -0
- package/lib/util/helpers.js +16 -1
- package/lib/util/helpers.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
+
import type { ValidationAlias } from "../labs/rules/index.js";
|
|
2
3
|
import type { EventProp, MaybeRef } from "../util/index.js";
|
|
3
4
|
export type ValidationResult = string | boolean;
|
|
4
5
|
export type ValidationRule = ValidationResult | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>);
|
|
@@ -13,7 +14,7 @@ export interface ValidationProps {
|
|
|
13
14
|
name: string | undefined;
|
|
14
15
|
label: string | undefined;
|
|
15
16
|
readonly: boolean | null;
|
|
16
|
-
rules: readonly ValidationRule[];
|
|
17
|
+
rules: readonly (ValidationRule | ValidationAlias)[];
|
|
17
18
|
modelValue: any;
|
|
18
19
|
'onUpdate:modelValue': EventProp | undefined;
|
|
19
20
|
validateOn?: ValidateOn;
|
|
@@ -95,14 +96,14 @@ export declare const makeValidationProps: <Defaults extends {
|
|
|
95
96
|
default: unknown extends Defaults["readonly"] ? boolean | null : NonNullable<boolean | null> | Defaults["readonly"];
|
|
96
97
|
};
|
|
97
98
|
rules: unknown extends Defaults["rules"] ? {
|
|
98
|
-
type: PropType<readonly ValidationRule[]>;
|
|
99
|
+
type: PropType<readonly (ValidationRule | ValidationAlias)[]>;
|
|
99
100
|
default: () => never[];
|
|
100
101
|
} : Omit<{
|
|
101
|
-
type: PropType<readonly ValidationRule[]>;
|
|
102
|
+
type: PropType<readonly (ValidationRule | ValidationAlias)[]>;
|
|
102
103
|
default: () => never[];
|
|
103
104
|
}, "type" | "default"> & {
|
|
104
|
-
type: PropType<unknown extends Defaults["rules"] ? readonly
|
|
105
|
-
default: unknown extends Defaults["rules"] ? readonly
|
|
105
|
+
type: PropType<unknown extends Defaults["rules"] ? readonly (string | boolean | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>) | [string, any, (string | undefined)?])[] : readonly (string | boolean | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>) | [string, any, (string | undefined)?])[] | Defaults["rules"]>;
|
|
106
|
+
default: unknown extends Defaults["rules"] ? readonly (string | boolean | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>) | [string, any, (string | undefined)?])[] : readonly (string | boolean | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>) | [string, any, (string | undefined)?])[] | Defaults["rules"];
|
|
106
107
|
};
|
|
107
108
|
modelValue: unknown extends Defaults["modelValue"] ? null : {
|
|
108
109
|
type: PropType<unknown extends Defaults["modelValue"] ? any : any>;
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import { makeFocusProps } from "./focus.js";
|
|
3
3
|
import { useForm } from "./form.js";
|
|
4
4
|
import { useProxiedModel } from "./proxiedModel.js";
|
|
5
|
-
import { useToggleScope } from "./toggleScope.js";
|
|
6
|
-
// Utilities
|
|
5
|
+
import { useToggleScope } from "./toggleScope.js";
|
|
6
|
+
import { useRules } from "../labs/rules/index.js"; // Utilities
|
|
7
7
|
import { computed, nextTick, onBeforeMount, onBeforeUnmount, onMounted, ref, shallowRef, unref, useId, watch } from 'vue';
|
|
8
8
|
import { getCurrentInstance, getCurrentInstanceName, propsFactory, wrapInArray } from "../util/index.js"; // Types
|
|
9
|
-
// type ValidationRuleParams = [any, string?]
|
|
10
|
-
// type ValidationAlias = string | [string, ...ValidationRuleParams]
|
|
11
9
|
export const makeValidationProps = propsFactory({
|
|
12
10
|
disabled: {
|
|
13
11
|
type: Boolean,
|
|
@@ -30,7 +28,6 @@ export const makeValidationProps = propsFactory({
|
|
|
30
28
|
},
|
|
31
29
|
rules: {
|
|
32
30
|
type: Array,
|
|
33
|
-
// type: Array as PropType<readonly (ValidationRule | ValidationAlias)[]>,
|
|
34
31
|
default: () => []
|
|
35
32
|
},
|
|
36
33
|
modelValue: null,
|
|
@@ -44,7 +41,7 @@ export function useValidation(props) {
|
|
|
44
41
|
const model = useProxiedModel(props, 'modelValue');
|
|
45
42
|
const validationModel = computed(() => props.validationValue === undefined ? model.value : props.validationValue);
|
|
46
43
|
const form = useForm(props);
|
|
47
|
-
|
|
44
|
+
const rules = useRules(() => props.rules);
|
|
48
45
|
const internalErrorMessages = ref([]);
|
|
49
46
|
const isPristine = shallowRef(true);
|
|
50
47
|
const isDirty = computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
@@ -84,28 +81,6 @@ export function useValidation(props) {
|
|
|
84
81
|
});
|
|
85
82
|
const vm = getCurrentInstance('validation');
|
|
86
83
|
const uid = computed(() => props.name ?? unref(id));
|
|
87
|
-
|
|
88
|
-
// const resolvedRules = computed(() => props.rules.map(rule => {
|
|
89
|
-
// let ruleName: string | null = null
|
|
90
|
-
// let ruleParams: ValidationRuleParams = [undefined]
|
|
91
|
-
// if (Array.isArray(rule)) {
|
|
92
|
-
// ruleName = rule[0]
|
|
93
|
-
// ruleParams = rule.slice(1) as ValidationRuleParams
|
|
94
|
-
// } else if (typeof rule === 'string') {
|
|
95
|
-
// ruleName = rule
|
|
96
|
-
// }
|
|
97
|
-
|
|
98
|
-
// if (ruleName !== null) {
|
|
99
|
-
// if (ruleName.startsWith('$')) {
|
|
100
|
-
// ruleName = ruleName.slice(1)
|
|
101
|
-
// }
|
|
102
|
-
|
|
103
|
-
// return rules?.[ruleName]?.(...ruleParams)
|
|
104
|
-
// } else {
|
|
105
|
-
// return rule
|
|
106
|
-
// }
|
|
107
|
-
// }))
|
|
108
|
-
|
|
109
84
|
onBeforeMount(() => {
|
|
110
85
|
form.register?.({
|
|
111
86
|
id: uid.value,
|
|
@@ -161,7 +136,7 @@ export function useValidation(props) {
|
|
|
161
136
|
let silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
162
137
|
const results = [];
|
|
163
138
|
isValidating.value = true;
|
|
164
|
-
for (const rule of
|
|
139
|
+
for (const rule of rules.value) {
|
|
165
140
|
if (results.length >= Number(props.maxErrors ?? 1)) {
|
|
166
141
|
break;
|
|
167
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","names":["makeFocusProps","useForm","useProxiedModel","useToggleScope","computed","nextTick","onBeforeMount","onBeforeUnmount","onMounted","ref","shallowRef","unref","useId","watch","getCurrentInstance","getCurrentInstanceName","propsFactory","wrapInArray","makeValidationProps","disabled","type","Boolean","default","error","errorMessages","Array","String","maxErrors","Number","name","label","readonly","rules","modelValue","validateOn","validationValue","useValidation","props","arguments","length","undefined","id","model","validationModel","value","form","internalErrorMessages","isPristine","isDirty","concat","slice","Math","max","set","Set","split","input","has","blur","invalidInput","lazy","eager","isValid","isValidating","validationClasses","isDisabled","isReadonly","vm","uid","register","validate","reset","resetValidation","unregister","update","focused","unwatch","val","silent","results","rule","handler","result","console","warn","push"],"sources":["../../src/composables/validation.ts"],"sourcesContent":["// Composables\nimport { makeFocusProps } from '@/composables/focus'\nimport { useForm } from '@/composables/form'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useToggleScope } from '@/composables/toggleScope'\n// import { useRules } from '@/labs/rules'\n\n// Utilities\nimport { computed, nextTick, onBeforeMount, onBeforeUnmount, onMounted, ref, shallowRef, unref, useId, watch } from 'vue'\nimport { getCurrentInstance, getCurrentInstanceName, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { EventProp, MaybeRef } from '@/util'\n\nexport type ValidationResult = string | boolean\nexport type ValidationRule =\n | ValidationResult\n | PromiseLike<ValidationResult>\n | ((value: any) => ValidationResult)\n | ((value: any) => PromiseLike<ValidationResult>)\n\ntype ValidateOnValue = 'blur' | 'input' | 'submit' | 'invalid-input'\ntype ValidateOn =\n | ValidateOnValue\n | `${ValidateOnValue} lazy`\n | `${ValidateOnValue} eager`\n | `lazy ${ValidateOnValue}`\n | `eager ${ValidateOnValue}`\n | 'lazy'\n | 'eager'\n\n// type ValidationRuleParams = [any, string?]\n// type ValidationAlias = string | [string, ...ValidationRuleParams]\n\nexport interface ValidationProps {\n disabled: boolean | null\n error: boolean\n errorMessages: string | readonly string[] | null\n focused: boolean\n maxErrors: string | number\n name: string | undefined\n label: string | undefined\n readonly: boolean | null\n rules: readonly ValidationRule[]\n // rules: readonly (ValidationRule | ValidationAlias)[]\n modelValue: any\n 'onUpdate:modelValue': EventProp | undefined\n validateOn?: ValidateOn\n validationValue: any\n}\n\nexport const makeValidationProps = propsFactory({\n disabled: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n error: Boolean,\n errorMessages: {\n type: [Array, String] as PropType<string | readonly string[] | null>,\n default: () => ([]),\n },\n maxErrors: {\n type: [Number, String],\n default: 1,\n },\n name: String,\n label: String,\n readonly: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n rules: {\n type: Array as PropType<readonly ValidationRule[]>,\n // type: Array as PropType<readonly (ValidationRule | ValidationAlias)[]>,\n default: () => ([]),\n },\n modelValue: null,\n validateOn: String as PropType<ValidationProps['validateOn']>,\n validationValue: null,\n\n ...makeFocusProps(),\n}, 'validation')\n\nexport function useValidation (\n props: ValidationProps,\n name = getCurrentInstanceName(),\n id: MaybeRef<string | number> = useId(),\n) {\n const model = useProxiedModel(props, 'modelValue')\n const validationModel = computed(() => props.validationValue === undefined ? model.value : props.validationValue)\n const form = useForm(props)\n // const rules = useRules()\n const internalErrorMessages = ref<string[]>([])\n const isPristine = shallowRef(true)\n const isDirty = computed(() => !!(\n wrapInArray(model.value === '' ? null : model.value).length ||\n wrapInArray(validationModel.value === '' ? null : validationModel.value).length\n ))\n const errorMessages = computed(() => {\n return props.errorMessages?.length\n ? wrapInArray(props.errorMessages).concat(internalErrorMessages.value).slice(0, Math.max(0, Number(props.maxErrors)))\n : internalErrorMessages.value\n })\n const validateOn = computed(() => {\n let value = (props.validateOn ?? form.validateOn?.value) || 'input'\n if (value === 'lazy') value = 'input lazy'\n if (value === 'eager') value = 'input eager'\n const set = new Set(value?.split(' ') ?? [])\n\n return {\n input: set.has('input'),\n blur: set.has('blur') || set.has('input') || set.has('invalid-input'),\n invalidInput: set.has('invalid-input'),\n lazy: set.has('lazy'),\n eager: set.has('eager'),\n }\n })\n const isValid = computed(() => {\n if (props.error || props.errorMessages?.length) return false\n if (!props.rules.length) return true\n if (isPristine.value) {\n return internalErrorMessages.value.length || validateOn.value.lazy ? null : true\n } else {\n return !internalErrorMessages.value.length\n }\n })\n const isValidating = shallowRef(false)\n const validationClasses = computed(() => {\n return {\n [`${name}--error`]: isValid.value === false,\n [`${name}--dirty`]: isDirty.value,\n [`${name}--disabled`]: form.isDisabled.value,\n [`${name}--readonly`]: form.isReadonly.value,\n }\n })\n\n const vm = getCurrentInstance('validation')\n const uid = computed(() => props.name ?? unref(id))\n\n // const resolvedRules = computed(() => props.rules.map(rule => {\n // let ruleName: string | null = null\n // let ruleParams: ValidationRuleParams = [undefined]\n // if (Array.isArray(rule)) {\n // ruleName = rule[0]\n // ruleParams = rule.slice(1) as ValidationRuleParams\n // } else if (typeof rule === 'string') {\n // ruleName = rule\n // }\n\n // if (ruleName !== null) {\n // if (ruleName.startsWith('$')) {\n // ruleName = ruleName.slice(1)\n // }\n\n // return rules?.[ruleName]?.(...ruleParams)\n // } else {\n // return rule\n // }\n // }))\n\n onBeforeMount(() => {\n form.register?.({\n id: uid.value,\n vm,\n validate,\n reset,\n resetValidation,\n })\n })\n\n onBeforeUnmount(() => {\n form.unregister?.(uid.value)\n })\n\n onMounted(async () => {\n if (!validateOn.value.lazy) {\n await validate(!validateOn.value.eager)\n }\n form.update?.(uid.value, isValid.value, errorMessages.value)\n })\n\n useToggleScope(() => validateOn.value.input || (validateOn.value.invalidInput && isValid.value === false), () => {\n watch(validationModel, () => {\n if (validationModel.value != null) {\n validate()\n } else if (props.focused) {\n const unwatch = watch(() => props.focused, val => {\n if (!val) validate()\n\n unwatch()\n })\n }\n })\n })\n\n useToggleScope(() => validateOn.value.blur, () => {\n watch(() => props.focused, val => {\n if (!val) validate()\n })\n })\n\n watch([isValid, errorMessages], () => {\n form.update?.(uid.value, isValid.value, errorMessages.value)\n })\n\n async function reset () {\n model.value = null\n await nextTick()\n await resetValidation()\n }\n\n async function resetValidation () {\n isPristine.value = true\n if (!validateOn.value.lazy) {\n await validate(!validateOn.value.eager)\n } else {\n internalErrorMessages.value = []\n }\n }\n\n async function validate (silent = false) {\n const results = []\n\n isValidating.value = true\n\n for (const rule of props.rules) {\n if (results.length >= Number(props.maxErrors ?? 1)) {\n break\n }\n\n const handler = typeof rule === 'function' ? rule : () => rule\n const result = await handler(validationModel.value)\n\n if (result === true) continue\n\n if (result !== false && typeof result !== 'string') {\n // eslint-disable-next-line no-console\n console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`)\n\n continue\n }\n\n results.push(result || '')\n }\n\n internalErrorMessages.value = results\n isValidating.value = false\n isPristine.value = silent\n\n return internalErrorMessages.value\n }\n\n return {\n errorMessages,\n isDirty,\n isDisabled: form.isDisabled,\n isReadonly: form.isReadonly,\n isPristine,\n isValid,\n isValidating,\n reset,\n resetValidation,\n validate,\n validationClasses,\n }\n}\n"],"mappings":"AAAA;AAAA,SACSA,cAAc;AAAA,SACdC,OAAO;AAAA,SACPC,eAAe;AAAA,SACfC,cAAc,4BACvB;AAEA;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,e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A,MAAG,KAAK;IACrC,MAAMyC,OAAO,GAAG,EAAE;IAElBhB,YAAY,CAACnB,KAAK,GAAG,IAAI;IAEzB,KAAK,MAAMoC,IAAI,IAAI3C,KAAK,CAACL,KAAK,EAAE;MAC9B,IAAI+C,OAAO,CAACxC,MAAM,IAAIX,MAAM,CAACS,KAAK,CAACV,SAAS,IAAI,CAAC,CAAC,EAAE;QAClD;MACF;MAEA,MAAMsD,OAAO,GAAG,OAAOD,IAAI,KAAK,UAAU,GAAGA,IAAI,GAAG,MAAMA,IAAI;MAC9D,MAAME,MAAM,GAAG,MAAMD,OAAO,CAACtC,eAAe,CAACC,KAAK,CAAC;MAEnD,IAAIsC,MAAM,KAAK,IAAI,EAAE;MAErB,IAAIA,MAAM,KAAK,KAAK,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;QAClD;QACAC,OAAO,CAACC,IAAI,CAAC,GAAGF,MAAM,6EAA6E,CAAC;QAEpG;MACF;MAEAH,OAAO,CAACM,IAAI,CAACH,MAAM,IAAI,EAAE,CAAC;IAC5B;IAEApC,qBAAqB,CAACF,KAAK,GAAGmC,OAAO;IACrChB,YAAY,CAACnB,KAAK,GAAG,KAAK;IAC1BG,UAAU,CAACH,KAAK,GAAGkC,MAAM;IAEzB,OAAOhC,qBAAqB,CAACF,KAAK;EACpC;EAEA,OAAO;IACLpB,aAAa;IACbwB,OAAO;IACPiB,UAAU,EAAEpB,IAAI,CAACoB,UAAU;IAC3BC,UAAU,EAAErB,IAAI,CAACqB,UAAU;IAC3BnB,UAAU;IACVe,OAAO;IACPC,YAAY;IACZQ,KAAK;IACLC,eAAe;IACfF,QAAQ;IACRN;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"validation.js","names":["makeFocusProps","useForm","useProxiedModel","useToggleScope","useRules","computed","nextTick","onBeforeMount","onBeforeUnmount","onMounted","ref","shallowRef","unref","useId","watch","getCurrentInstance","getCurrentInstanceName","propsFactory","wrapInArray","makeValidationProps","disabled","type","Boolean","default","error","errorMessages","Array","String","maxErrors","Number","name","label","readonly","rules","modelValue","validateOn","validationValue","useValidation","props","arguments","length","undefined","id","model","validationModel","value","form","internalErrorMessages","isPristine","isDirty","concat","slice","Math","max","set","Set","split","input","has","blur","invalidInput","lazy","eager","isValid","isValidating","validationClasses","isDisabled","isReadonly","vm","uid","register","validate","reset","resetValidation","unregister","update","focused","unwatch","val","silent","results","rule","handler","result","console","warn","push"],"sources":["../../src/composables/validation.ts"],"sourcesContent":["// Composables\nimport { makeFocusProps } from '@/composables/focus'\nimport { useForm } from '@/composables/form'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useToggleScope } from '@/composables/toggleScope'\nimport { useRules } from '@/labs/rules'\n\n// Utilities\nimport { computed, nextTick, onBeforeMount, onBeforeUnmount, onMounted, ref, shallowRef, unref, useId, watch } from 'vue'\nimport { getCurrentInstance, getCurrentInstanceName, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { ValidationAlias } from '@/labs/rules'\nimport type { EventProp, MaybeRef } from '@/util'\n\nexport type ValidationResult = string | boolean\nexport type ValidationRule =\n | ValidationResult\n | PromiseLike<ValidationResult>\n | ((value: any) => ValidationResult)\n | ((value: any) => PromiseLike<ValidationResult>)\n\ntype ValidateOnValue = 'blur' | 'input' | 'submit' | 'invalid-input'\ntype ValidateOn =\n | ValidateOnValue\n | `${ValidateOnValue} lazy`\n | `${ValidateOnValue} eager`\n | `lazy ${ValidateOnValue}`\n | `eager ${ValidateOnValue}`\n | 'lazy'\n | 'eager'\n\nexport interface ValidationProps {\n disabled: boolean | null\n error: boolean\n errorMessages: string | readonly string[] | null\n focused: boolean\n maxErrors: string | number\n name: string | undefined\n label: string | undefined\n readonly: boolean | null\n rules: readonly (ValidationRule | ValidationAlias)[]\n modelValue: any\n 'onUpdate:modelValue': EventProp | undefined\n validateOn?: ValidateOn\n validationValue: any\n}\n\nexport const makeValidationProps = propsFactory({\n disabled: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n error: Boolean,\n errorMessages: {\n type: [Array, String] as PropType<string | readonly string[] | null>,\n default: () => ([]),\n },\n maxErrors: {\n type: [Number, String],\n default: 1,\n },\n name: String,\n label: String,\n readonly: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n rules: {\n type: Array as PropType<readonly (ValidationRule | ValidationAlias)[]>,\n default: () => ([]),\n },\n modelValue: null,\n validateOn: String as PropType<ValidationProps['validateOn']>,\n validationValue: null,\n\n ...makeFocusProps(),\n}, 'validation')\n\nexport function useValidation (\n props: ValidationProps,\n name = getCurrentInstanceName(),\n id: MaybeRef<string | number> = useId(),\n) {\n const model = useProxiedModel(props, 'modelValue')\n const validationModel = computed(() => props.validationValue === undefined ? model.value : props.validationValue)\n const form = useForm(props)\n const rules = useRules(() => props.rules)\n const internalErrorMessages = ref<string[]>([])\n const isPristine = shallowRef(true)\n const isDirty = computed(() => !!(\n wrapInArray(model.value === '' ? null : model.value).length ||\n wrapInArray(validationModel.value === '' ? null : validationModel.value).length\n ))\n const errorMessages = computed(() => {\n return props.errorMessages?.length\n ? wrapInArray(props.errorMessages).concat(internalErrorMessages.value).slice(0, Math.max(0, Number(props.maxErrors)))\n : internalErrorMessages.value\n })\n const validateOn = computed(() => {\n let value = (props.validateOn ?? form.validateOn?.value) || 'input'\n if (value === 'lazy') value = 'input lazy'\n if (value === 'eager') value = 'input eager'\n const set = new Set(value?.split(' ') ?? [])\n\n return {\n input: set.has('input'),\n blur: set.has('blur') || set.has('input') || set.has('invalid-input'),\n invalidInput: set.has('invalid-input'),\n lazy: set.has('lazy'),\n eager: set.has('eager'),\n }\n })\n const isValid = computed(() => {\n if (props.error || props.errorMessages?.length) return false\n if (!props.rules.length) return true\n if (isPristine.value) {\n return internalErrorMessages.value.length || validateOn.value.lazy ? null : true\n } else {\n return !internalErrorMessages.value.length\n }\n })\n const isValidating = shallowRef(false)\n const validationClasses = computed(() => {\n return {\n [`${name}--error`]: isValid.value === false,\n [`${name}--dirty`]: isDirty.value,\n [`${name}--disabled`]: form.isDisabled.value,\n [`${name}--readonly`]: form.isReadonly.value,\n }\n })\n\n const vm = getCurrentInstance('validation')\n const uid = computed(() => props.name ?? unref(id))\n\n onBeforeMount(() => {\n form.register?.({\n id: uid.value,\n vm,\n validate,\n reset,\n resetValidation,\n })\n })\n\n onBeforeUnmount(() => {\n form.unregister?.(uid.value)\n })\n\n onMounted(async () => {\n if (!validateOn.value.lazy) {\n await validate(!validateOn.value.eager)\n }\n form.update?.(uid.value, isValid.value, errorMessages.value)\n })\n\n useToggleScope(() => validateOn.value.input || (validateOn.value.invalidInput && isValid.value === false), () => {\n watch(validationModel, () => {\n if (validationModel.value != null) {\n validate()\n } else if (props.focused) {\n const unwatch = watch(() => props.focused, val => {\n if (!val) validate()\n\n unwatch()\n })\n }\n })\n })\n\n useToggleScope(() => validateOn.value.blur, () => {\n watch(() => props.focused, val => {\n if (!val) validate()\n })\n })\n\n watch([isValid, errorMessages], () => {\n form.update?.(uid.value, isValid.value, errorMessages.value)\n })\n\n async function reset () {\n model.value = null\n await nextTick()\n await resetValidation()\n }\n\n async function resetValidation () {\n isPristine.value = true\n if (!validateOn.value.lazy) {\n await validate(!validateOn.value.eager)\n } else {\n internalErrorMessages.value = []\n }\n }\n\n async function validate (silent = false) {\n const results = []\n\n isValidating.value = true\n\n for (const rule of rules.value) {\n if (results.length >= Number(props.maxErrors ?? 1)) {\n break\n }\n\n const handler = typeof rule === 'function' ? rule : () => rule\n const result = await handler(validationModel.value)\n\n if (result === true) continue\n\n if (result !== false && typeof result !== 'string') {\n // eslint-disable-next-line no-console\n console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`)\n\n continue\n }\n\n results.push(result || '')\n }\n\n internalErrorMessages.value = results\n isValidating.value = false\n isPristine.value = silent\n\n return internalErrorMessages.value\n }\n\n return {\n errorMessages,\n isDirty,\n isDisabled: form.isDisabled,\n isReadonly: form.isReadonly,\n isPristine,\n isValid,\n isValidating,\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,16 @@
|
|
|
1
|
-
import { Fragment as _Fragment,
|
|
1
|
+
import { Fragment as _Fragment, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
|
|
2
2
|
// Composables
|
|
3
3
|
import { useColor } from "./color.js"; // Utilities
|
|
4
4
|
import { toRef, toValue } from 'vue';
|
|
5
5
|
import { getCurrentInstanceName, propsFactory } from "../util/index.js"; // Types
|
|
6
6
|
export const allowedVariants = ['elevated', 'flat', 'tonal', 'outlined', 'text', 'plain'];
|
|
7
7
|
export function genOverlays(isClickable, name) {
|
|
8
|
-
return
|
|
8
|
+
return _createElementVNode(_Fragment, null, [isClickable && _createElementVNode("span", {
|
|
9
9
|
"key": "overlay",
|
|
10
|
-
"class": `${name}__overlay`
|
|
11
|
-
}, null),
|
|
10
|
+
"class": _normalizeClass(`${name}__overlay`)
|
|
11
|
+
}, null), _createElementVNode("span", {
|
|
12
12
|
"key": "underlay",
|
|
13
|
-
"class": `${name}__underlay`
|
|
13
|
+
"class": _normalizeClass(`${name}__underlay`)
|
|
14
14
|
}, null)]);
|
|
15
15
|
}
|
|
16
16
|
export const makeVariantProps = propsFactory({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant.js","names":["useColor","toRef","toValue","getCurrentInstanceName","propsFactory","allowedVariants","genOverlays","isClickable","name","
|
|
1
|
+
{"version":3,"file":"variant.js","names":["useColor","toRef","toValue","getCurrentInstanceName","propsFactory","allowedVariants","genOverlays","isClickable","name","_createElementVNode","_Fragment","_normalizeClass","makeVariantProps","color","String","variant","type","default","validator","v","includes","useVariant","props","arguments","length","undefined","variantClasses","colorClasses","colorStyles"],"sources":["../../src/composables/variant.tsx"],"sourcesContent":["// Composables\nimport { useColor } from '@/composables/color'\n\n// Utilities\nimport { toRef, toValue } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { MaybeRefOrGetter, PropType } from 'vue'\n\nexport const allowedVariants = [\n 'elevated',\n 'flat',\n 'tonal',\n 'outlined',\n 'text',\n 'plain',\n] as const\n\nexport type Variant = typeof allowedVariants[number]\n\nexport interface VariantProps {\n color?: string\n variant: Variant\n}\n\nexport function genOverlays (isClickable: boolean, name: string) {\n return (\n <>\n { isClickable && <span key=\"overlay\" class={ `${name}__overlay` } /> }\n\n <span key=\"underlay\" class={ `${name}__underlay` } />\n </>\n )\n}\n\nexport const makeVariantProps = propsFactory({\n color: String,\n variant: {\n type: String as PropType<Variant>,\n default: 'elevated',\n validator: (v: any) => allowedVariants.includes(v),\n },\n}, 'variant')\n\nexport function useVariant (\n props: MaybeRefOrGetter<VariantProps>,\n name = getCurrentInstanceName(),\n) {\n const variantClasses = toRef(() => {\n const { variant } = toValue(props)\n return `${name}--variant-${variant}`\n })\n\n const { colorClasses, colorStyles } = useColor(() => {\n const { variant, color } = toValue(props)\n return {\n [['elevated', 'flat'].includes(variant) ? 'background' : 'text']: color,\n }\n })\n\n return { colorClasses, colorStyles, variantClasses }\n}\n"],"mappings":";AAAA;AAAA,SACSA,QAAQ,sBAEjB;AACA,SAASC,KAAK,EAAEC,OAAO,QAAQ,KAAK;AAAA,SAC3BC,sBAAsB,EAAEC,YAAY,4BAE7C;AAGA,OAAO,MAAMC,eAAe,GAAG,CAC7B,UAAU,EACV,MAAM,EACN,OAAO,EACP,UAAU,EACV,MAAM,EACN,OAAO,CACC;AASV,OAAO,SAASC,WAAWA,CAAEC,WAAoB,EAAEC,IAAY,EAAE;EAC/D,OAAAC,mBAAA,CAAAC,SAAA,SAEMH,WAAW,IAAAE,mBAAA;IAAA;IAAA,SAAAE,eAAA,CAAgC,GAAGH,IAAI,WAAW;EAAA,QAAK,EAAAC,mBAAA;IAAA;IAAA,SAAAE,eAAA,CAEvC,GAAGH,IAAI,YAAY;EAAA;AAGtD;AAEA,OAAO,MAAMI,gBAAgB,GAAGR,YAAY,CAAC;EAC3CS,KAAK,EAAEC,MAAM;EACbC,OAAO,EAAE;IACPC,IAAI,EAAEF,MAA2B;IACjCG,OAAO,EAAE,UAAU;IACnBC,SAAS,EAAGC,CAAM,IAAKd,eAAe,CAACe,QAAQ,CAACD,CAAC;EACnD;AACF,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,SAASE,UAAUA,CACxBC,KAAqC,EAErC;EAAA,IADAd,IAAI,GAAAe,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGpB,sBAAsB,CAAC,CAAC;EAE/B,MAAMuB,cAAc,GAAGzB,KAAK,CAAC,MAAM;IACjC,MAAM;MAAEc;IAAQ,CAAC,GAAGb,OAAO,CAACoB,KAAK,CAAC;IAClC,OAAO,GAAGd,IAAI,aAAaO,OAAO,EAAE;EACtC,CAAC,CAAC;EAEF,MAAM;IAAEY,YAAY;IAAEC;EAAY,CAAC,GAAG5B,QAAQ,CAAC,MAAM;IACnD,MAAM;MAAEe,OAAO;MAAEF;IAAM,CAAC,GAAGX,OAAO,CAACoB,KAAK,CAAC;IACzC,OAAO;MACL,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAACF,QAAQ,CAACL,OAAO,CAAC,GAAG,YAAY,GAAG,MAAM,GAAGF;IACpE,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IAAEc,YAAY;IAAEC,WAAW;IAAEF;EAAe,CAAC;AACtD","ignoreList":[]}
|
package/lib/entry-bundler.js
CHANGED
|
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
|
16
16
|
...options
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
export const version = "3.8.
|
|
19
|
+
export const version = "3.8.7";
|
|
20
20
|
createVuetify.version = version;
|
|
21
21
|
export { blueprints, components, directives };
|
|
22
22
|
export * from "./composables/index.js";
|
package/lib/framework.d.ts
CHANGED
|
@@ -2539,40 +2539,40 @@ declare module 'vue' {
|
|
|
2539
2539
|
$children?: VNodeChild
|
|
2540
2540
|
}
|
|
2541
2541
|
export interface GlobalComponents {
|
|
2542
|
+
VApp: typeof import('vuetify/components')['VApp']
|
|
2543
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
2544
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
|
2542
2545
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
2543
2546
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
2544
2547
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
2545
2548
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
2546
2549
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
2547
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
2548
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
2549
|
-
VBadge: typeof import('vuetify/components')['VBadge']
|
|
2550
2550
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
2551
2551
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
2552
2552
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
2553
2553
|
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
2554
2554
|
VBtn: typeof import('vuetify/components')['VBtn']
|
|
2555
|
-
|
|
2556
|
-
|
|
2555
|
+
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
2556
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
2557
2557
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
2558
2558
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
2559
2559
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
2560
|
-
|
|
2560
|
+
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
2561
|
+
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
2562
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
2563
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
2564
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
2565
|
+
VChip: typeof import('vuetify/components')['VChip']
|
|
2566
|
+
VCode: typeof import('vuetify/components')['VCode']
|
|
2567
|
+
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
2561
2568
|
VCard: typeof import('vuetify/components')['VCard']
|
|
2562
2569
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
2563
2570
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
2564
2571
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
2565
2572
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
2566
2573
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
2567
|
-
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
2568
|
-
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
2569
|
-
VChip: typeof import('vuetify/components')['VChip']
|
|
2570
2574
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
2571
|
-
|
|
2572
|
-
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
2573
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
2574
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
2575
|
-
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
2575
|
+
VCounter: typeof import('vuetify/components')['VCounter']
|
|
2576
2576
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
|
2577
2577
|
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
|
2578
2578
|
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
|
@@ -2580,7 +2580,6 @@ declare module 'vue' {
|
|
|
2580
2580
|
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
|
2581
2581
|
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
|
2582
2582
|
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
|
2583
|
-
VCounter: typeof import('vuetify/components')['VCounter']
|
|
2584
2583
|
VDatePicker: typeof import('vuetify/components')['VDatePicker']
|
|
2585
2584
|
VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
|
|
2586
2585
|
VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
|
|
@@ -2588,29 +2587,28 @@ declare module 'vue' {
|
|
|
2588
2587
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
|
2589
2588
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
|
2590
2589
|
VDialog: typeof import('vuetify/components')['VDialog']
|
|
2591
|
-
|
|
2592
|
-
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
|
2590
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
2593
2591
|
VFab: typeof import('vuetify/components')['VFab']
|
|
2594
|
-
VField: typeof import('vuetify/components')['VField']
|
|
2595
|
-
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
2596
|
-
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
2597
|
-
VFooter: typeof import('vuetify/components')['VFooter']
|
|
2598
2592
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
2599
2593
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
2600
2594
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
2601
2595
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
2602
|
-
|
|
2596
|
+
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
|
2597
|
+
VDivider: typeof import('vuetify/components')['VDivider']
|
|
2598
|
+
VField: typeof import('vuetify/components')['VField']
|
|
2599
|
+
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
2600
|
+
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
2601
|
+
VFooter: typeof import('vuetify/components')['VFooter']
|
|
2603
2602
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
2604
2603
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
2605
2604
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
2606
2605
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
|
2607
2606
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
2608
|
-
|
|
2609
|
-
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
2610
|
-
VItem: typeof import('vuetify/components')['VItem']
|
|
2607
|
+
VImg: typeof import('vuetify/components')['VImg']
|
|
2611
2608
|
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
2609
|
+
VInput: typeof import('vuetify/components')['VInput']
|
|
2612
2610
|
VKbd: typeof import('vuetify/components')['VKbd']
|
|
2613
|
-
|
|
2611
|
+
VMenu: typeof import('vuetify/components')['VMenu']
|
|
2614
2612
|
VList: typeof import('vuetify/components')['VList']
|
|
2615
2613
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
2616
2614
|
VListImg: typeof import('vuetify/components')['VListImg']
|
|
@@ -2620,49 +2618,55 @@ declare module 'vue' {
|
|
|
2620
2618
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
|
2621
2619
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
2622
2620
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
2623
|
-
|
|
2624
|
-
|
|
2621
|
+
VLabel: typeof import('vuetify/components')['VLabel']
|
|
2622
|
+
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
2623
|
+
VItem: typeof import('vuetify/components')['VItem']
|
|
2625
2624
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
2626
|
-
VPagination: typeof import('vuetify/components')['VPagination']
|
|
2627
|
-
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
2628
|
-
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
2629
2625
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
2626
|
+
VMain: typeof import('vuetify/components')['VMain']
|
|
2627
|
+
VPagination: typeof import('vuetify/components')['VPagination']
|
|
2628
|
+
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
2630
2629
|
VNumberInput: typeof import('vuetify/components')['VNumberInput']
|
|
2630
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
2631
|
+
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
2632
|
+
VRating: typeof import('vuetify/components')['VRating']
|
|
2631
2633
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
2632
|
-
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
2633
2634
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
2634
|
-
VRating: typeof import('vuetify/components')['VRating']
|
|
2635
|
-
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
2636
|
-
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
2637
2635
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
2638
|
-
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
2639
|
-
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
2640
2636
|
VSelect: typeof import('vuetify/components')['VSelect']
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
VTable: typeof import('vuetify/components')['VTable']
|
|
2637
|
+
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
2638
|
+
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
2644
2639
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
2645
2640
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
2646
|
-
|
|
2647
|
-
VTabs: typeof import('vuetify/components')['VTabs']
|
|
2648
|
-
VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
|
|
2649
|
-
VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
|
|
2641
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
2650
2642
|
VStepper: typeof import('vuetify/components')['VStepper']
|
|
2651
2643
|
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
|
2652
2644
|
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
|
2653
2645
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
|
2654
2646
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
|
2655
2647
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
|
2648
|
+
VSlider: typeof import('vuetify/components')['VSlider']
|
|
2649
|
+
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
2650
|
+
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
2651
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
2652
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
2653
|
+
VTab: typeof import('vuetify/components')['VTab']
|
|
2654
|
+
VTabs: typeof import('vuetify/components')['VTabs']
|
|
2655
|
+
VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
|
|
2656
|
+
VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
|
|
2657
|
+
VTable: typeof import('vuetify/components')['VTable']
|
|
2658
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
|
2659
|
+
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
2660
|
+
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
2656
2661
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
2657
2662
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
2658
2663
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
2659
2664
|
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
2660
|
-
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
2661
|
-
VApp: typeof import('vuetify/components')['VApp']
|
|
2662
|
-
VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
|
|
2663
|
-
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
2664
2665
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
2665
2666
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
2667
|
+
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
2668
|
+
VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
|
|
2669
|
+
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
2666
2670
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
2667
2671
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
2668
2672
|
VCol: typeof import('vuetify/components')['VCol']
|
|
@@ -2674,15 +2678,17 @@ declare module 'vue' {
|
|
|
2674
2678
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
2675
2679
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
2676
2680
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
2681
|
+
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
2677
2682
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
2678
2683
|
VRadio: typeof import('vuetify/components')['VRadio']
|
|
2684
|
+
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
2679
2685
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
2680
|
-
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
2681
|
-
VSnackbarQueue: typeof import('vuetify/components')['VSnackbarQueue']
|
|
2682
|
-
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
2683
2686
|
VSparkline: typeof import('vuetify/components')['VSparkline']
|
|
2687
|
+
VSnackbarQueue: typeof import('vuetify/components')['VSnackbarQueue']
|
|
2684
2688
|
VSpeedDial: typeof import('vuetify/components')['VSpeedDial']
|
|
2685
2689
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
2690
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
2691
|
+
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
2686
2692
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
2687
2693
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
2688
2694
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -2699,12 +2705,6 @@ declare module 'vue' {
|
|
|
2699
2705
|
VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
|
|
2700
2706
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
|
2701
2707
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
2702
|
-
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
2703
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
2704
|
-
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
2705
|
-
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
2706
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
|
2707
|
-
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
2708
2708
|
VCalendar: typeof import('vuetify/labs/components')['VCalendar']
|
|
2709
2709
|
VCalendarDay: typeof import('vuetify/labs/components')['VCalendarDay']
|
|
2710
2710
|
VCalendarHeader: typeof import('vuetify/labs/components')['VCalendarHeader']
|
|
@@ -2712,14 +2712,14 @@ declare module 'vue' {
|
|
|
2712
2712
|
VCalendarIntervalEvent: typeof import('vuetify/labs/components')['VCalendarIntervalEvent']
|
|
2713
2713
|
VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
|
|
2714
2714
|
VColorInput: typeof import('vuetify/labs/components')['VColorInput']
|
|
2715
|
+
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
|
2716
|
+
VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
|
|
2717
|
+
VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
|
|
2715
2718
|
VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
|
|
2716
2719
|
VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
|
|
2717
2720
|
VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
|
|
2718
2721
|
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
|
2719
2722
|
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
|
2720
|
-
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
|
2721
|
-
VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
|
|
2722
|
-
VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
|
|
2723
2723
|
VTreeview: typeof import('vuetify/labs/components')['VTreeview']
|
|
2724
2724
|
VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
|
|
2725
2725
|
VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
|
package/lib/framework.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
|
1
|
+
import { mergeProps as _mergeProps, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue";
|
|
2
2
|
// Styles
|
|
3
3
|
import "./VCalendar.css";
|
|
4
4
|
|
|
@@ -80,13 +80,13 @@ export const VCalendar = genericComponent()({
|
|
|
80
80
|
useRender(() => {
|
|
81
81
|
const calendarDayProps = VCalendarDay.filterProps(props);
|
|
82
82
|
const calendarHeaderProps = VCalendarHeader.filterProps(props);
|
|
83
|
-
return
|
|
84
|
-
"class": ['v-calendar', {
|
|
83
|
+
return _createElementVNode("div", {
|
|
84
|
+
"class": _normalizeClass(['v-calendar', {
|
|
85
85
|
'v-calendar-monthly': props.viewMode === 'month',
|
|
86
86
|
'v-calendar-weekly': props.viewMode === 'week',
|
|
87
87
|
'v-calendar-day': props.viewMode === 'day'
|
|
88
|
-
}]
|
|
89
|
-
}, [
|
|
88
|
+
}])
|
|
89
|
+
}, [_createElementVNode("div", null, [!props.hideHeader && (slots.header?.({
|
|
90
90
|
title: title.value,
|
|
91
91
|
clickNext: onClickNext,
|
|
92
92
|
clickPrev: onClickPrev,
|
|
@@ -100,20 +100,20 @@ export const VCalendar = genericComponent()({
|
|
|
100
100
|
"onClick:toToday": onClickToday
|
|
101
101
|
}), {
|
|
102
102
|
title: slots.title
|
|
103
|
-
}))]),
|
|
104
|
-
"class": ['v-calendar__container', `days__${weekDays.value.length}`]
|
|
105
|
-
}, [props.viewMode === 'month' && !props.hideDayHeader &&
|
|
106
|
-
"class": ['v-calendar-weekly__head', `days__${weekDays.value.length}`, ...(!props.hideWeekNumber ? ['v-calendar-weekly__head-weeknumbers'] : [])],
|
|
103
|
+
}))]), _createElementVNode("div", {
|
|
104
|
+
"class": _normalizeClass(['v-calendar__container', `days__${weekDays.value.length}`])
|
|
105
|
+
}, [props.viewMode === 'month' && !props.hideDayHeader && _createElementVNode("div", {
|
|
106
|
+
"class": _normalizeClass(['v-calendar-weekly__head', `days__${weekDays.value.length}`, ...(!props.hideWeekNumber ? ['v-calendar-weekly__head-weeknumbers'] : [])]),
|
|
107
107
|
"key": "calendarWeeklyHead"
|
|
108
|
-
}, [!props.hideWeekNumber ?
|
|
108
|
+
}, [!props.hideWeekNumber ? _createElementVNode("div", {
|
|
109
109
|
"key": "weekNumber0",
|
|
110
110
|
"class": "v-calendar-weekly__head-weeknumber"
|
|
111
|
-
}, null) : '', weekDays.value.map(weekday =>
|
|
112
|
-
"class": `v-calendar-weekly__head-weekday${!props.hideWeekNumber ? '-with-weeknumber' : ''}`
|
|
113
|
-
}, [dayNames[weekday]]))]), props.viewMode === 'month' &&
|
|
111
|
+
}, null) : '', weekDays.value.map(weekday => _createElementVNode("div", {
|
|
112
|
+
"class": _normalizeClass(`v-calendar-weekly__head-weekday${!props.hideWeekNumber ? '-with-weeknumber' : ''}`)
|
|
113
|
+
}, [dayNames[weekday]]))]), props.viewMode === 'month' && _createElementVNode("div", {
|
|
114
114
|
"key": "VCalendarMonth",
|
|
115
|
-
"class": ['v-calendar-month__days', `days${!props.hideWeekNumber ? '-with-weeknumbers' : ''}__${weekDays.value.length}`, ...(!props.hideWeekNumber ? ['v-calendar-month__weeknumbers'] : [])]
|
|
116
|
-
}, [chunkArray(daysInMonth.value, weekDays.value.length).map((week, wi) => [!props.hideWeekNumber ?
|
|
115
|
+
"class": _normalizeClass(['v-calendar-month__days', `days${!props.hideWeekNumber ? '-with-weeknumbers' : ''}__${weekDays.value.length}`, ...(!props.hideWeekNumber ? ['v-calendar-month__weeknumbers'] : [])])
|
|
116
|
+
}, [chunkArray(daysInMonth.value, weekDays.value.length).map((week, wi) => [!props.hideWeekNumber ? _createElementVNode("div", _mergeProps({
|
|
117
117
|
"class": "v-calendar-month__weeknumber"
|
|
118
118
|
}, getPrefixedEventHandlers(attrs, ':weekNumber', () => ({
|
|
119
119
|
weekNumber: weekNumbers.value[wi],
|