@kokoccc/vuetify 1.0.1
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/package.json +116 -0
- package/src/components/VAlert/VAlert.sass +190 -0
- package/src/components/VAlert/VAlert.ts +256 -0
- package/src/components/VAlert/__tests__/VAlert.spec.ts +222 -0
- package/src/components/VAlert/__tests__/__snapshots__/VAlert.spec.ts.snap +69 -0
- package/src/components/VAlert/_variables.scss +16 -0
- package/src/components/VAlert/index.ts +4 -0
- package/src/components/VApp/VApp.sass +44 -0
- package/src/components/VApp/VApp.ts +60 -0
- package/src/components/VApp/__tests__/VApp.spec.ts +78 -0
- package/src/components/VApp/__tests__/__snapshots__/VApp.spec.ts.snap +21 -0
- package/src/components/VApp/index.ts +4 -0
- package/src/components/VAppBar/VAppBar.sass +55 -0
- package/src/components/VAppBar/VAppBar.ts +293 -0
- package/src/components/VAppBar/VAppBarNavIcon.ts +26 -0
- package/src/components/VAppBar/VAppBarTitle.ts +82 -0
- package/src/components/VAppBar/__tests__/VAppBar.spec.ts +521 -0
- package/src/components/VAppBar/__tests__/VAppBarNavIcon.spec.ts +26 -0
- package/src/components/VAppBar/__tests__/__snapshots__/VAppBar.spec.ts.snap +35 -0
- package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +14 -0
- package/src/components/VAppBar/_variables.scss +7 -0
- package/src/components/VAppBar/index.ts +13 -0
- package/src/components/VAutocomplete/VAutocomplete.sass +41 -0
- package/src/components/VAutocomplete/VAutocomplete.ts +480 -0
- package/src/components/VAutocomplete/__tests__/VAutocomplete.spec.ts +585 -0
- package/src/components/VAutocomplete/__tests__/VAutocomplete2.spec.ts +498 -0
- package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +318 -0
- package/src/components/VAutocomplete/_variables.scss +5 -0
- package/src/components/VAutocomplete/index.ts +4 -0
- package/src/components/VAvatar/VAvatar.sass +22 -0
- package/src/components/VAvatar/VAvatar.ts +60 -0
- package/src/components/VAvatar/__tests__/VAvatar.spec.ts +97 -0
- package/src/components/VAvatar/__tests__/__snapshots__/VAvatar.spec.ts.snap +8 -0
- package/src/components/VAvatar/_variables.scss +3 -0
- package/src/components/VAvatar/index.ts +4 -0
- package/src/components/VBadge/VBadge.sass +108 -0
- package/src/components/VBadge/VBadge.ts +206 -0
- package/src/components/VBadge/__tests__/VBadge.spec.ts +150 -0
- package/src/components/VBadge/__tests__/__snapshots__/VBadge.spec.ts.snap +42 -0
- package/src/components/VBadge/_variables.scss +21 -0
- package/src/components/VBadge/index.ts +4 -0
- package/src/components/VBanner/VBanner.sass +148 -0
- package/src/components/VBanner/VBanner.ts +175 -0
- package/src/components/VBanner/__tests__/VBanner.spec.ts +227 -0
- package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +126 -0
- package/src/components/VBanner/_variables.scss +19 -0
- package/src/components/VBanner/index.ts +4 -0
- package/src/components/VBottomNavigation/VBottomNavigation.sass +89 -0
- package/src/components/VBottomNavigation/VBottomNavigation.ts +168 -0
- package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +144 -0
- package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +53 -0
- package/src/components/VBottomNavigation/_variables.scss +7 -0
- package/src/components/VBottomNavigation/index.ts +4 -0
- package/src/components/VBottomSheet/VBottomSheet.sass +23 -0
- package/src/components/VBottomSheet/VBottomSheet.ts +30 -0
- package/src/components/VBottomSheet/_variables.scss +3 -0
- package/src/components/VBottomSheet/index.ts +4 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.sass +45 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.ts +82 -0
- package/src/components/VBreadcrumbs/VBreadcrumbsDivider.ts +3 -0
- package/src/components/VBreadcrumbs/VBreadcrumbsItem.ts +48 -0
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbs.spec.ts +213 -0
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbsItem.spec.ts +44 -0
- package/src/components/VBreadcrumbs/__tests__/__snapshots__/VBreadcrumbs.spec.ts.snap +108 -0
- package/src/components/VBreadcrumbs/__tests__/__snapshots__/VBreadcrumbsItem.spec.ts.snap +17 -0
- package/src/components/VBreadcrumbs/_variables.scss +8 -0
- package/src/components/VBreadcrumbs/index.ts +13 -0
- package/src/components/VBtn/VBtn.sass +249 -0
- package/src/components/VBtn/VBtn.ts +223 -0
- package/src/components/VBtn/__tests__/VBtn.spec.ts +306 -0
- package/src/components/VBtn/__tests__/__snapshots__/VBtn.spec.ts.snap +61 -0
- package/src/components/VBtn/_variables.scss +73 -0
- package/src/components/VBtn/index.ts +4 -0
- package/src/components/VBtnToggle/VBtnToggle.sass +99 -0
- package/src/components/VBtnToggle/VBtnToggle.ts +55 -0
- package/src/components/VBtnToggle/__tests__/VBtnToggle.spec.ts +40 -0
- package/src/components/VBtnToggle/_variables.scss +11 -0
- package/src/components/VBtnToggle/index.ts +4 -0
- package/src/components/VCalendar/VCalendar.ts +383 -0
- package/src/components/VCalendar/VCalendarCategory.sass +100 -0
- package/src/components/VCalendar/VCalendarCategory.ts +143 -0
- package/src/components/VCalendar/VCalendarDaily.sass +140 -0
- package/src/components/VCalendar/VCalendarDaily.ts +250 -0
- package/src/components/VCalendar/VCalendarMonthly.ts +30 -0
- package/src/components/VCalendar/VCalendarWeekly.sass +118 -0
- package/src/components/VCalendar/VCalendarWeekly.ts +225 -0
- package/src/components/VCalendar/__tests__/VCalendar.spec.ts +129 -0
- package/src/components/VCalendar/__tests__/VCalendarCategory.spec.ts +112 -0
- package/src/components/VCalendar/__tests__/VCalendarDaily.spec.ts +187 -0
- package/src/components/VCalendar/__tests__/__snapshots__/VCalendar.spec.ts.snap +3378 -0
- package/src/components/VCalendar/__tests__/__snapshots__/VCalendarDaily.spec.ts.snap +9127 -0
- package/src/components/VCalendar/_variables.scss +34 -0
- package/src/components/VCalendar/index.ts +17 -0
- package/src/components/VCalendar/mixins/__tests__/__snapshots__/calendar-base.spec.ts.snap +225 -0
- package/src/components/VCalendar/mixins/__tests__/__snapshots__/calendar-with-events.spec.ts.snap +3 -0
- package/src/components/VCalendar/mixins/__tests__/__snapshots__/calendar-with-intervals.spec.ts.snap +4566 -0
- package/src/components/VCalendar/mixins/__tests__/__snapshots__/times.spec.ts.snap +19 -0
- package/src/components/VCalendar/mixins/__tests__/calendar-base.spec.ts +179 -0
- package/src/components/VCalendar/mixins/__tests__/calendar-with-events.spec.ts +228 -0
- package/src/components/VCalendar/mixins/__tests__/calendar-with-intervals.spec.ts +360 -0
- package/src/components/VCalendar/mixins/__tests__/times.spec.ts +80 -0
- package/src/components/VCalendar/mixins/calendar-base.ts +118 -0
- package/src/components/VCalendar/mixins/calendar-with-events.sass +67 -0
- package/src/components/VCalendar/mixins/calendar-with-events.ts +511 -0
- package/src/components/VCalendar/mixins/calendar-with-intervals.ts +164 -0
- package/src/components/VCalendar/mixins/times.ts +74 -0
- package/src/components/VCalendar/modes/__tests__/__snapshots__/common.spec.ts.snap +185 -0
- package/src/components/VCalendar/modes/__tests__/common.spec.ts +77 -0
- package/src/components/VCalendar/modes/column.ts +21 -0
- package/src/components/VCalendar/modes/common.ts +140 -0
- package/src/components/VCalendar/modes/index.ts +8 -0
- package/src/components/VCalendar/modes/stack.ts +255 -0
- package/src/components/VCalendar/util/__tests__/__snapshots__/events.spec.ts.snap +231 -0
- package/src/components/VCalendar/util/__tests__/__snapshots__/timestamp.spec.ts.snap +396 -0
- package/src/components/VCalendar/util/__tests__/events.spec.ts +85 -0
- package/src/components/VCalendar/util/__tests__/props.spec.ts +15 -0
- package/src/components/VCalendar/util/__tests__/timestamp.spec.ts +512 -0
- package/src/components/VCalendar/util/events.ts +52 -0
- package/src/components/VCalendar/util/parser.ts +30 -0
- package/src/components/VCalendar/util/props.ts +261 -0
- package/src/components/VCalendar/util/timestamp.ts +480 -0
- package/src/components/VCard/VCard.sass +155 -0
- package/src/components/VCard/VCard.ts +92 -0
- package/src/components/VCard/__tests__/VCard.spec.ts +122 -0
- package/src/components/VCard/__tests__/__snapshots__/VCard.spec.ts.snap +61 -0
- package/src/components/VCard/_variables.scss +29 -0
- package/src/components/VCard/index.ts +25 -0
- package/src/components/VCarousel/VCarousel.sass +61 -0
- package/src/components/VCarousel/VCarousel.ts +232 -0
- package/src/components/VCarousel/VCarouselItem.ts +73 -0
- package/src/components/VCarousel/__tests__/VCarousel.spec.ts +227 -0
- package/src/components/VCarousel/__tests__/VCarouselItem.spec.ts +33 -0
- package/src/components/VCarousel/__tests__/__snapshots__/VCarousel.spec.ts.snap +31 -0
- package/src/components/VCarousel/_variables.scss +8 -0
- package/src/components/VCarousel/index.ts +11 -0
- package/src/components/VCheckbox/VCheckbox.sass +9 -0
- package/src/components/VCheckbox/VCheckbox.ts +124 -0
- package/src/components/VCheckbox/VSimpleCheckbox.sass +16 -0
- package/src/components/VCheckbox/VSimpleCheckbox.ts +148 -0
- package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +379 -0
- package/src/components/VCheckbox/__tests__/VSimpleCheckbox.spec.ts +65 -0
- package/src/components/VCheckbox/__tests__/__snapshots__/VCheckbox.spec.ts.snap +170 -0
- package/src/components/VCheckbox/_variables.scss +4 -0
- package/src/components/VCheckbox/index.ts +10 -0
- package/src/components/VChip/VChip.sass +204 -0
- package/src/components/VChip/VChip.ts +204 -0
- package/src/components/VChip/__tests__/VChip.spec.ts +169 -0
- package/src/components/VChip/__tests__/__snapshots__/VChip.spec.ts.snap +22 -0
- package/src/components/VChip/_variables.scss +52 -0
- package/src/components/VChip/index.ts +4 -0
- package/src/components/VChipGroup/VChipGroup.sass +27 -0
- package/src/components/VChipGroup/VChipGroup.ts +55 -0
- package/src/components/VChipGroup/__tests__/VChipGroup.spec.ts +65 -0
- package/src/components/VChipGroup/__tests__/__snapshots__/VChipGroup.spec.ts.snap +53 -0
- package/src/components/VChipGroup/_variables.scss +6 -0
- package/src/components/VChipGroup/index.ts +4 -0
- package/src/components/VColorPicker/VColorPicker.sass +32 -0
- package/src/components/VColorPicker/VColorPicker.ts +178 -0
- package/src/components/VColorPicker/VColorPickerCanvas.sass +23 -0
- package/src/components/VColorPicker/VColorPickerCanvas.ts +173 -0
- package/src/components/VColorPicker/VColorPickerEdit.sass +31 -0
- package/src/components/VColorPicker/VColorPickerEdit.ts +185 -0
- package/src/components/VColorPicker/VColorPickerPreview.sass +66 -0
- package/src/components/VColorPicker/VColorPickerPreview.ts +113 -0
- package/src/components/VColorPicker/VColorPickerSwatches.sass +34 -0
- package/src/components/VColorPicker/VColorPickerSwatches.ts +113 -0
- package/src/components/VColorPicker/__tests__/VColorPicker.spec.ts +198 -0
- package/src/components/VColorPicker/__tests__/VColorPickerCanvas.spec.ts +111 -0
- package/src/components/VColorPicker/__tests__/VColorPickerEdit.spec.ts +147 -0
- package/src/components/VColorPicker/__tests__/VColorPickerPreview.spec.ts +143 -0
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +2247 -0
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerCanvas.spec.ts.snap +82 -0
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +314 -0
- package/src/components/VColorPicker/_variables.scss +25 -0
- package/src/components/VColorPicker/index.ts +6 -0
- package/src/components/VColorPicker/util/__tests__/index.spec.ts +81 -0
- package/src/components/VColorPicker/util/index.ts +168 -0
- package/src/components/VCombobox/VCombobox.ts +302 -0
- package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +722 -0
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +385 -0
- package/src/components/VCombobox/index.ts +4 -0
- package/src/components/VContent/VContent.ts +36 -0
- package/src/components/VContent/index.ts +5 -0
- package/src/components/VCounter/VCounter.sass +11 -0
- package/src/components/VCounter/VCounter.ts +40 -0
- package/src/components/VCounter/__tests__/VCounter.spec.ts +41 -0
- package/src/components/VCounter/__tests__/__snapshots__/VCounter.spec.ts.snap +7 -0
- package/src/components/VCounter/_variables.scss +5 -0
- package/src/components/VCounter/index.ts +4 -0
- package/src/components/VData/VData.ts +394 -0
- package/src/components/VData/__tests__/VData.spec.ts +578 -0
- package/src/components/VData/__tests__/__snapshots__/VData.spec.ts.snap +159 -0
- package/src/components/VData/index.ts +5 -0
- package/src/components/VDataIterator/VDataFooter.sass +71 -0
- package/src/components/VDataIterator/VDataFooter.ts +224 -0
- package/src/components/VDataIterator/VDataIterator.ts +370 -0
- package/src/components/VDataIterator/__tests__/VDataFooter.spec.ts +200 -0
- package/src/components/VDataIterator/__tests__/VDataIterator.spec.ts +318 -0
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataFooter.spec.ts.snap +460 -0
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataIterator.spec.ts.snap +438 -0
- package/src/components/VDataIterator/_variables.scss +13 -0
- package/src/components/VDataIterator/index.ts +10 -0
- package/src/components/VDataTable/MobileRow.ts +66 -0
- package/src/components/VDataTable/Row.ts +66 -0
- package/src/components/VDataTable/RowGroup.ts +67 -0
- package/src/components/VDataTable/VDataTable.sass +98 -0
- package/src/components/VDataTable/VDataTable.ts +661 -0
- package/src/components/VDataTable/VDataTableHeader.sass +80 -0
- package/src/components/VDataTable/VDataTableHeader.ts +42 -0
- package/src/components/VDataTable/VDataTableHeaderDesktop.ts +125 -0
- package/src/components/VDataTable/VDataTableHeaderMobile.ts +97 -0
- package/src/components/VDataTable/VEditDialog.sass +22 -0
- package/src/components/VDataTable/VEditDialog.ts +133 -0
- package/src/components/VDataTable/VSimpleTable.sass +179 -0
- package/src/components/VDataTable/VSimpleTable.ts +52 -0
- package/src/components/VDataTable/VVirtualTable.sass +13 -0
- package/src/components/VDataTable/VVirtualTable.ts +163 -0
- package/src/components/VDataTable/__tests__/MobileRow.spec.ts +127 -0
- package/src/components/VDataTable/__tests__/Row.spec.ts +129 -0
- package/src/components/VDataTable/__tests__/RowGroup.spec.ts +38 -0
- package/src/components/VDataTable/__tests__/VDataTable.spec.ts +1058 -0
- package/src/components/VDataTable/__tests__/VDataTableHeader.spec.ts +167 -0
- package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +231 -0
- package/src/components/VDataTable/__tests__/VSimpleTable.spec.ts +146 -0
- package/src/components/VDataTable/__tests__/VVirtualTable.spec.ts +51 -0
- package/src/components/VDataTable/__tests__/__snapshots__/MobileRow.spec.ts.snap +139 -0
- package/src/components/VDataTable/__tests__/__snapshots__/Row.spec.ts.snap +77 -0
- package/src/components/VDataTable/__tests__/__snapshots__/RowGroup.spec.ts.snap +13 -0
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +13237 -0
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTableHeader.spec.ts.snap +841 -0
- package/src/components/VDataTable/__tests__/__snapshots__/VEditDialog.spec.ts.snap +48 -0
- package/src/components/VDataTable/__tests__/__snapshots__/VSimpleTable.spec.ts.snap +95 -0
- package/src/components/VDataTable/__tests__/__snapshots__/VVirtualTable.spec.ts.snap +77 -0
- package/src/components/VDataTable/_variables.scss +24 -0
- package/src/components/VDataTable/index.ts +22 -0
- package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +78 -0
- package/src/components/VDataTable/mixins/__tests__/header.spec.ts +109 -0
- package/src/components/VDataTable/mixins/header.ts +74 -0
- package/src/components/VDatePicker/VDatePicker.ts +539 -0
- package/src/components/VDatePicker/VDatePickerDateTable.ts +154 -0
- package/src/components/VDatePicker/VDatePickerHeader.sass +46 -0
- package/src/components/VDatePicker/VDatePickerHeader.ts +164 -0
- package/src/components/VDatePicker/VDatePickerMonthTable.ts +58 -0
- package/src/components/VDatePicker/VDatePickerTable.sass +84 -0
- package/src/components/VDatePicker/VDatePickerTitle.sass +37 -0
- package/src/components/VDatePicker/VDatePickerTitle.ts +121 -0
- package/src/components/VDatePicker/VDatePickerYears.sass +30 -0
- package/src/components/VDatePicker/VDatePickerYears.ts +116 -0
- package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +782 -0
- package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +377 -0
- package/src/components/VDatePicker/__tests__/VDatePickerDateTable.spec.ts +304 -0
- package/src/components/VDatePicker/__tests__/VDatePickerHeader.spec.ts +228 -0
- package/src/components/VDatePicker/__tests__/VDatePickerMonthTable.spec.ts +242 -0
- package/src/components/VDatePicker/__tests__/VDatePickerTitle.spec.ts +148 -0
- package/src/components/VDatePicker/__tests__/VDatePickerYears.spec.ts +89 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.date.spec.ts.snap +4664 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.month.spec.ts.snap +1151 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerDateTable.spec.ts.snap +3387 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerHeader.spec.ts.snap +165 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerMonthTable.spec.ts.snap +783 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerTitle.spec.ts.snap +73 -0
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerYears.spec.ts.snap +609 -0
- package/src/components/VDatePicker/_variables.scss +42 -0
- package/src/components/VDatePicker/index.ts +26 -0
- package/src/components/VDatePicker/mixins/date-picker-table.ts +273 -0
- package/src/components/VDatePicker/util/__tests__/createNativeLocaleFormatter.spec.ts +34 -0
- package/src/components/VDatePicker/util/__tests__/monthChange.spec.ts +10 -0
- package/src/components/VDatePicker/util/__tests__/pad.spec.ts +18 -0
- package/src/components/VDatePicker/util/__tests__/sanitizeDateString.spec.ts +10 -0
- package/src/components/VDatePicker/util/createNativeLocaleFormatter.ts +43 -0
- package/src/components/VDatePicker/util/eventHelpers.ts +41 -0
- package/src/components/VDatePicker/util/index.ts +17 -0
- package/src/components/VDatePicker/util/isDateAllowed.ts +7 -0
- package/src/components/VDatePicker/util/monthChange.ts +17 -0
- package/src/components/VDatePicker/util/pad.ts +16 -0
- package/src/components/VDatePicker/util/sanitizeDateString.ts +8 -0
- package/src/components/VDialog/VDialog.sass +106 -0
- package/src/components/VDialog/VDialog.ts +335 -0
- package/src/components/VDialog/__tests__/VDialog.spec.ts +359 -0
- package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +51 -0
- package/src/components/VDialog/_variables.scss +13 -0
- package/src/components/VDialog/index.ts +4 -0
- package/src/components/VDivider/VDivider.sass +40 -0
- package/src/components/VDivider/VDivider.ts +40 -0
- package/src/components/VDivider/__tests__/VDivider.spec.ts +98 -0
- package/src/components/VDivider/__tests__/__snapshots__/VDivider.spec.ts.snap +8 -0
- package/src/components/VDivider/_variables.scss +5 -0
- package/src/components/VDivider/index.ts +4 -0
- package/src/components/VExpansionPanel/VExpansionPanel.sass +211 -0
- package/src/components/VExpansionPanel/VExpansionPanel.ts +98 -0
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +73 -0
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +120 -0
- package/src/components/VExpansionPanel/VExpansionPanels.ts +79 -0
- package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +178 -0
- package/src/components/VExpansionPanel/__tests__/VExpansionPanelHeader.spec.ts +41 -0
- package/src/components/VExpansionPanel/__tests__/VExpansionPanels.spec.ts +48 -0
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +37 -0
- package/src/components/VExpansionPanel/_variables.scss +13 -0
- package/src/components/VExpansionPanel/index.ts +15 -0
- package/src/components/VFileInput/VFileInput.sass +60 -0
- package/src/components/VFileInput/VFileInput.ts +302 -0
- package/src/components/VFileInput/__tests__/VFileInput.spec.ts +333 -0
- package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +627 -0
- package/src/components/VFileInput/_variables.scss +6 -0
- package/src/components/VFileInput/index.ts +4 -0
- package/src/components/VFooter/VFooter.sass +39 -0
- package/src/components/VFooter/VFooter.ts +116 -0
- package/src/components/VFooter/__tests__/VFooter.spec.ts +76 -0
- package/src/components/VFooter/_variables.scss +10 -0
- package/src/components/VFooter/index.ts +4 -0
- package/src/components/VForm/VForm.ts +170 -0
- package/src/components/VForm/__tests__/VForm.spec.ts +276 -0
- package/src/components/VForm/index.ts +4 -0
- package/src/components/VGrid/VCol.ts +139 -0
- package/src/components/VGrid/VContainer.ts +68 -0
- package/src/components/VGrid/VFlex.ts +5 -0
- package/src/components/VGrid/VGrid.sass +41 -0
- package/src/components/VGrid/VLayout.ts +5 -0
- package/src/components/VGrid/VRow.ts +138 -0
- package/src/components/VGrid/VSpacer.ts +4 -0
- package/src/components/VGrid/__tests__/VCol.spec.ts +151 -0
- package/src/components/VGrid/__tests__/VContainer.spec.ts +83 -0
- package/src/components/VGrid/__tests__/VFlex.spec.ts +28 -0
- package/src/components/VGrid/__tests__/VGrid.spec.ts +74 -0
- package/src/components/VGrid/__tests__/VLayout.spec.ts +28 -0
- package/src/components/VGrid/__tests__/__snapshots__/VContainer.spec.ts.snap +6 -0
- package/src/components/VGrid/__tests__/__snapshots__/VFlex.spec.ts.snap +6 -0
- package/src/components/VGrid/__tests__/__snapshots__/VLayout.spec.ts.snap +6 -0
- package/src/components/VGrid/_grid.sass +117 -0
- package/src/components/VGrid/_mixins.sass +72 -0
- package/src/components/VGrid/grid.ts +55 -0
- package/src/components/VGrid/index.ts +26 -0
- package/src/components/VHover/VHover.ts +79 -0
- package/src/components/VHover/__tests__/VHover.spec.ts +119 -0
- package/src/components/VHover/index.ts +4 -0
- package/src/components/VIcon/VIcon.sass +73 -0
- package/src/components/VIcon/VIcon.ts +298 -0
- package/src/components/VIcon/__tests__/VIcon.spec.ts +328 -0
- package/src/components/VIcon/__tests__/__snapshots__/VIcon.spec.ts.snap +74 -0
- package/src/components/VIcon/_variables.scss +4 -0
- package/src/components/VIcon/index.ts +4 -0
- package/src/components/VImg/VImg.sass +30 -0
- package/src/components/VImg/VImg.ts +312 -0
- package/src/components/VImg/__tests__/VImg.spec.ts +196 -0
- package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +203 -0
- package/src/components/VImg/_variables.scss +3 -0
- package/src/components/VImg/index.ts +4 -0
- package/src/components/VInput/VInput.sass +132 -0
- package/src/components/VInput/VInput.ts +348 -0
- package/src/components/VInput/__tests__/VInput.spec.ts +215 -0
- package/src/components/VInput/__tests__/__snapshots__/VInput.spec.ts.snap +193 -0
- package/src/components/VInput/_variables.scss +14 -0
- package/src/components/VInput/index.ts +4 -0
- package/src/components/VItemGroup/VItem.sass +4 -0
- package/src/components/VItemGroup/VItem.ts +88 -0
- package/src/components/VItemGroup/VItemGroup.sass +7 -0
- package/src/components/VItemGroup/VItemGroup.ts +285 -0
- package/src/components/VItemGroup/__tests__/VItem.spec.ts +72 -0
- package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +408 -0
- package/src/components/VItemGroup/__tests__/__snapshots__/VItem.spec.ts.snap +13 -0
- package/src/components/VItemGroup/_variables.scss +3 -0
- package/src/components/VItemGroup/index.ts +14 -0
- package/src/components/VLabel/VLabel.sass +14 -0
- package/src/components/VLabel/VLabel.ts +65 -0
- package/src/components/VLabel/__tests__/VLabel.spec.ts +277 -0
- package/src/components/VLabel/_variables.scss +5 -0
- package/src/components/VLabel/index.ts +4 -0
- package/src/components/VLazy/VLazy.ts +88 -0
- package/src/components/VLazy/__tests__/VLazy.spec.ts +70 -0
- package/src/components/VLazy/__tests__/__snapshots__/VLazy.spec.ts.snap +15 -0
- package/src/components/VLazy/index.ts +4 -0
- package/src/components/VList/VList.sass +98 -0
- package/src/components/VList/VList.ts +102 -0
- package/src/components/VList/VListGroup.sass +111 -0
- package/src/components/VList/VListGroup.ts +228 -0
- package/src/components/VList/VListItem.sass +268 -0
- package/src/components/VList/VListItem.ts +232 -0
- package/src/components/VList/VListItemAction.ts +23 -0
- package/src/components/VList/VListItemAvatar.ts +35 -0
- package/src/components/VList/VListItemGroup.sass +5 -0
- package/src/components/VList/VListItemGroup.ts +45 -0
- package/src/components/VList/VListItemIcon.ts +17 -0
- package/src/components/VList/__tests__/VList.spec.ts +86 -0
- package/src/components/VList/__tests__/VListGroup.spec.ts +201 -0
- package/src/components/VList/__tests__/VListItem.spec.ts +328 -0
- package/src/components/VList/__tests__/VListItemAction.spec.ts +80 -0
- package/src/components/VList/__tests__/VListItemAvatar.spec.ts +33 -0
- package/src/components/VList/__tests__/VListItemGroup.spec.ts +30 -0
- package/src/components/VList/__tests__/__snapshots__/VList.spec.ts.snap +36 -0
- package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +18 -0
- package/src/components/VList/__tests__/__snapshots__/VListItem.spec.ts.snap +16 -0
- package/src/components/VList/__tests__/__snapshots__/VListItemAction.spec.ts.snap +43 -0
- package/src/components/VList/__tests__/__snapshots__/VListItemAvatar.spec.ts.snap +8 -0
- package/src/components/VList/_mixins.sass +18 -0
- package/src/components/VList/_variables.scss +67 -0
- package/src/components/VList/index.ts +40 -0
- package/src/components/VMain/VMain.sass +22 -0
- package/src/components/VMain/VMain.ts +54 -0
- package/src/components/VMain/__tests__/VMain.spec.ts +95 -0
- package/src/components/VMain/__tests__/__snapshots__/VMain.spec.ts.snap +10 -0
- package/src/components/VMain/_variables.scss +6 -0
- package/src/components/VMain/index.ts +5 -0
- package/src/components/VMenu/VMenu.sass +70 -0
- package/src/components/VMenu/VMenu.ts +535 -0
- package/src/components/VMenu/__tests__/VMenu.spec.ts +445 -0
- package/src/components/VMenu/__tests__/__snapshots__/VMenu.spec.ts.snap +37 -0
- package/src/components/VMenu/_variables.scss +4 -0
- package/src/components/VMenu/index.ts +4 -0
- package/src/components/VMessages/VMessages.sass +25 -0
- package/src/components/VMessages/VMessages.ts +59 -0
- package/src/components/VMessages/__tests__/VMessages.spec.ts +117 -0
- package/src/components/VMessages/__tests__/__snapshots__/VMessages.spec.ts.snap +59 -0
- package/src/components/VMessages/_variables.scss +5 -0
- package/src/components/VMessages/index.ts +4 -0
- package/src/components/VNavigationDrawer/VNavigationDrawer.sass +127 -0
- package/src/components/VNavigationDrawer/VNavigationDrawer.ts +477 -0
- package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +552 -0
- package/src/components/VNavigationDrawer/_variables.scss +4 -0
- package/src/components/VNavigationDrawer/index.ts +4 -0
- package/src/components/VOtpInput/VOtpInput.sass +37 -0
- package/src/components/VOtpInput/VOtpInput.ts +357 -0
- package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +267 -0
- package/src/components/VOtpInput/_variables.scss +4 -0
- package/src/components/VOtpInput/index.ts +4 -0
- package/src/components/VOverflowBtn/VOverflowBtn.sass +151 -0
- package/src/components/VOverflowBtn/VOverflowBtn.ts +117 -0
- package/src/components/VOverflowBtn/__tests__/VOverflowBtn.spec.ts +129 -0
- package/src/components/VOverflowBtn/__tests__/__snapshots__/VOverflowBtn.spec.ts.snap +189 -0
- package/src/components/VOverflowBtn/_variables.scss +24 -0
- package/src/components/VOverflowBtn/index.ts +4 -0
- package/src/components/VOverlay/VOverlay.sass +42 -0
- package/src/components/VOverlay/VOverlay.ts +109 -0
- package/src/components/VOverlay/__tests__/VOverlay.spec.ts +38 -0
- package/src/components/VOverlay/_variables.scss +3 -0
- package/src/components/VOverlay/index.ts +5 -0
- package/src/components/VPagination/VPagination.sass +82 -0
- package/src/components/VPagination/VPagination.ts +272 -0
- package/src/components/VPagination/__tests__/VPagination.spec.ts +312 -0
- package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +584 -0
- package/src/components/VPagination/_variables.scss +16 -0
- package/src/components/VPagination/index.ts +4 -0
- package/src/components/VParallax/VParallax.sass +37 -0
- package/src/components/VParallax/VParallax.ts +108 -0
- package/src/components/VParallax/__tests__/VParallax.spec.ts +52 -0
- package/src/components/VParallax/__tests__/__snapshots__/VParallax.spec.ts.snap +46 -0
- package/src/components/VParallax/_variables.scss +4 -0
- package/src/components/VParallax/index.ts +4 -0
- package/src/components/VPicker/VPicker.sass +94 -0
- package/src/components/VPicker/VPicker.ts +95 -0
- package/src/components/VPicker/__tests__/VPicker.spec.ts +99 -0
- package/src/components/VPicker/__tests__/__snapshots__/VPicker.spec.ts.snap +81 -0
- package/src/components/VPicker/_variables.scss +8 -0
- package/src/components/VPicker/index.ts +4 -0
- package/src/components/VProgressCircular/VProgressCircular.sass +67 -0
- package/src/components/VProgressCircular/VProgressCircular.ts +164 -0
- package/src/components/VProgressCircular/__tests__/VProgressCircular.spec.ts +158 -0
- package/src/components/VProgressCircular/__tests__/__snapshots__/VProgressCircular.spec.ts.snap +298 -0
- package/src/components/VProgressCircular/_variables.scss +7 -0
- package/src/components/VProgressCircular/index.ts +4 -0
- package/src/components/VProgressLinear/VProgressLinear.sass +273 -0
- package/src/components/VProgressLinear/VProgressLinear.ts +291 -0
- package/src/components/VProgressLinear/__tests__/VProgressLinear.spec.ts +603 -0
- package/src/components/VProgressLinear/__tests__/__snapshots__/VProgressLinear.spec.ts.snap +328 -0
- package/src/components/VProgressLinear/_variables.scss +16 -0
- package/src/components/VProgressLinear/index.ts +4 -0
- package/src/components/VRadioGroup/VRadio.sass +21 -0
- package/src/components/VRadioGroup/VRadio.ts +193 -0
- package/src/components/VRadioGroup/VRadioGroup.sass +39 -0
- package/src/components/VRadioGroup/VRadioGroup.ts +111 -0
- package/src/components/VRadioGroup/__tests__/VRadio.spec.ts +156 -0
- package/src/components/VRadioGroup/__tests__/VRadioGroup.spec.ts +40 -0
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadio.spec.ts.snap +118 -0
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadioGroup.spec.ts.snap +57 -0
- package/src/components/VRadioGroup/_variables.scss +4 -0
- package/src/components/VRadioGroup/index.ts +11 -0
- package/src/components/VRangeSlider/VRangeSlider.sass +19 -0
- package/src/components/VRangeSlider/VRangeSlider.ts +272 -0
- package/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +216 -0
- package/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +123 -0
- package/src/components/VRangeSlider/index.ts +4 -0
- package/src/components/VRating/VRating.sass +28 -0
- package/src/components/VRating/VRating.ts +262 -0
- package/src/components/VRating/__tests__/VRating.spec.ts +284 -0
- package/src/components/VRating/__tests__/__snapshots__/VRating.spec.ts.snap +21 -0
- package/src/components/VRating/_variables.scss +5 -0
- package/src/components/VRating/index.ts +4 -0
- package/src/components/VResponsive/VResponsive.sass +23 -0
- package/src/components/VResponsive/VResponsive.ts +60 -0
- package/src/components/VResponsive/__tests__/VResponsive.spec.ts +52 -0
- package/src/components/VResponsive/__tests__/__snapshots__/VResponsive.spec.ts.snap +31 -0
- package/src/components/VResponsive/_variables.scss +3 -0
- package/src/components/VResponsive/index.ts +4 -0
- package/src/components/VSelect/VSelect.sass +164 -0
- package/src/components/VSelect/VSelect.ts +951 -0
- package/src/components/VSelect/VSelectList.ts +282 -0
- package/src/components/VSelect/__tests__/VSelect.spec.ts +567 -0
- package/src/components/VSelect/__tests__/VSelect2.spec.ts +560 -0
- package/src/components/VSelect/__tests__/VSelect3.spec.ts +510 -0
- package/src/components/VSelect/__tests__/VSelect4.spec.ts +438 -0
- package/src/components/VSelect/__tests__/VSelectList.spec.ts +144 -0
- package/src/components/VSelect/__tests__/__snapshots__/VSelect.spec.ts.snap +367 -0
- package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +209 -0
- package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +47 -0
- package/src/components/VSelect/__tests__/__snapshots__/VSelectList.spec.ts.snap +115 -0
- package/src/components/VSelect/_variables.scss +22 -0
- package/src/components/VSelect/index.ts +4 -0
- package/src/components/VSheet/VSheet.sass +15 -0
- package/src/components/VSheet/VSheet.ts +69 -0
- package/src/components/VSheet/__tests__/VSheet.spec.ts +48 -0
- package/src/components/VSheet/__tests__/__snapshots__/VSheet.spec.ts.snap +11 -0
- package/src/components/VSheet/_variables.scss +6 -0
- package/src/components/VSheet/index.ts +4 -0
- package/src/components/VSkeletonLoader/VSkeletonLoader.sass +377 -0
- package/src/components/VSkeletonLoader/VSkeletonLoader.ts +204 -0
- package/src/components/VSkeletonLoader/__tests__/VSkeletonLoader.spec.ts +145 -0
- package/src/components/VSkeletonLoader/__tests__/__snapshots__/VSkeletonLoader.spec.ts.snap +1039 -0
- package/src/components/VSkeletonLoader/_variables.scss +54 -0
- package/src/components/VSkeletonLoader/index.ts +4 -0
- package/src/components/VSlideGroup/VSlideGroup.sass +51 -0
- package/src/components/VSlideGroup/VSlideGroup.ts +542 -0
- package/src/components/VSlideGroup/VSlideItem.ts +16 -0
- package/src/components/VSlideGroup/__tests__/VSlideGroup.spec.ts +398 -0
- package/src/components/VSlideGroup/__tests__/__snapshots__/VSlideGroup.spec.ts.snap +26 -0
- package/src/components/VSlideGroup/_variables.scss +3 -0
- package/src/components/VSlideGroup/index.ts +14 -0
- package/src/components/VSlider/VSlider.sass +305 -0
- package/src/components/VSlider/VSlider.ts +611 -0
- package/src/components/VSlider/__tests__/VSlider.spec.ts +553 -0
- package/src/components/VSlider/__tests__/__snapshots__/VSlider.spec.ts.snap +802 -0
- package/src/components/VSlider/_variables.scss +26 -0
- package/src/components/VSlider/index.ts +4 -0
- package/src/components/VSnackbar/VSnackbar.sass +142 -0
- package/src/components/VSnackbar/VSnackbar.ts +214 -0
- package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +143 -0
- package/src/components/VSnackbar/_variables.scss +40 -0
- package/src/components/VSnackbar/index.ts +4 -0
- package/src/components/VSparkline/VSparkline.ts +384 -0
- package/src/components/VSparkline/__tests__/VSparkline.spec.ts +278 -0
- package/src/components/VSparkline/__tests__/__snapshots__/VSparkline.spec.ts.snap +1141 -0
- package/src/components/VSparkline/helpers/core.ts +51 -0
- package/src/components/VSparkline/helpers/math.ts +31 -0
- package/src/components/VSparkline/helpers/path.ts +38 -0
- package/src/components/VSparkline/index.ts +5 -0
- package/src/components/VSpeedDial/VSpeedDial.sass +79 -0
- package/src/components/VSpeedDial/VSpeedDial.ts +99 -0
- package/src/components/VSpeedDial/__tests__/VSpeedDial.spec.ts +93 -0
- package/src/components/VSpeedDial/__tests__/__snapshots__/VSpeedDial.spec.ts.snap +25 -0
- package/src/components/VSpeedDial/_variables.scss +5 -0
- package/src/components/VSpeedDial/index.ts +4 -0
- package/src/components/VStepper/VStepper.sass +236 -0
- package/src/components/VStepper/VStepper.ts +143 -0
- package/src/components/VStepper/VStepperContent.ts +167 -0
- package/src/components/VStepper/VStepperStep.ts +160 -0
- package/src/components/VStepper/__tests__/VStepper.spec.ts +34 -0
- package/src/components/VStepper/__tests__/VStepperContent.spec.ts +311 -0
- package/src/components/VStepper/__tests__/VStepperStep.spec.ts +162 -0
- package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +90 -0
- package/src/components/VStepper/_variables.scss +31 -0
- package/src/components/VStepper/index.ts +25 -0
- package/src/components/VSubheader/VSubheader.sass +15 -0
- package/src/components/VSubheader/VSubheader.ts +33 -0
- package/src/components/VSubheader/__tests__/VSubheader.spec.ts +62 -0
- package/src/components/VSubheader/__tests__/__snapshots__/VSubheader.spec.ts.snap +21 -0
- package/src/components/VSubheader/_variables.scss +6 -0
- package/src/components/VSubheader/index.ts +4 -0
- package/src/components/VSwitch/VSwitch.sass +133 -0
- package/src/components/VSwitch/VSwitch.ts +138 -0
- package/src/components/VSwitch/__tests__/VSwitch.spec.ts +106 -0
- package/src/components/VSwitch/__tests__/__snapshots__/VSwitch.spec.ts.snap +52 -0
- package/src/components/VSwitch/_variables.scss +30 -0
- package/src/components/VSwitch/index.ts +4 -0
- package/src/components/VSystemBar/VSystemBar.sass +44 -0
- package/src/components/VSystemBar/VSystemBar.ts +76 -0
- package/src/components/VSystemBar/__tests__/VSystemBar.spec.ts +128 -0
- package/src/components/VSystemBar/_variables.scss +9 -0
- package/src/components/VSystemBar/index.ts +4 -0
- package/src/components/VTabs/VTab.ts +136 -0
- package/src/components/VTabs/VTabItem.ts +24 -0
- package/src/components/VTabs/VTabs.sass +228 -0
- package/src/components/VTabs/VTabs.ts +338 -0
- package/src/components/VTabs/VTabsBar.ts +105 -0
- package/src/components/VTabs/VTabsItems.ts +39 -0
- package/src/components/VTabs/VTabsSlider.ts +20 -0
- package/src/components/VTabs/__tests__/VTab.spec.ts +127 -0
- package/src/components/VTabs/__tests__/VTabs.spec.ts +318 -0
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +102 -0
- package/src/components/VTabs/__tests__/VTabsSlider.spec.ts +32 -0
- package/src/components/VTabs/__tests__/__snapshots__/VTabs.spec.ts.snap +19 -0
- package/src/components/VTabs/_variables.scss +18 -0
- package/src/components/VTabs/index.ts +17 -0
- package/src/components/VTextField/VTextField.sass +526 -0
- package/src/components/VTextField/VTextField.ts +546 -0
- package/src/components/VTextField/__tests__/VTextField.spec.ts +992 -0
- package/src/components/VTextField/__tests__/__snapshots__/VTextField.spec.ts.snap +301 -0
- package/src/components/VTextField/_mixins.sass +18 -0
- package/src/components/VTextField/_variables.scss +51 -0
- package/src/components/VTextField/index.ts +4 -0
- package/src/components/VTextarea/VTextarea.sass +113 -0
- package/src/components/VTextarea/VTextarea.ts +117 -0
- package/src/components/VTextarea/__tests__/VTextarea.spec.ts +275 -0
- package/src/components/VTextarea/__tests__/__snapshots__/VTextarea.spec.ts.snap +121 -0
- package/src/components/VTextarea/_variables.scss +15 -0
- package/src/components/VTextarea/index.ts +4 -0
- package/src/components/VThemeProvider/VThemeProvider.ts +29 -0
- package/src/components/VThemeProvider/__tests__/VThemeProvider.spec.ts +80 -0
- package/src/components/VThemeProvider/index.ts +4 -0
- package/src/components/VTimePicker/SelectingTimes.ts +7 -0
- package/src/components/VTimePicker/VTimePicker.ts +489 -0
- package/src/components/VTimePicker/VTimePickerClock.sass +148 -0
- package/src/components/VTimePicker/VTimePickerClock.ts +278 -0
- package/src/components/VTimePicker/VTimePickerTitle.sass +65 -0
- package/src/components/VTimePicker/VTimePickerTitle.ts +83 -0
- package/src/components/VTimePicker/__tests__/VTimePicker.spec.ts +828 -0
- package/src/components/VTimePicker/__tests__/VTimePickerClock.spec.ts +323 -0
- package/src/components/VTimePicker/__tests__/VTimePickerTitle.spec.ts +189 -0
- package/src/components/VTimePicker/__tests__/__snapshots__/VTimePicker.spec.ts.snap +2761 -0
- package/src/components/VTimePicker/__tests__/__snapshots__/VTimePickerClock.spec.ts.snap +286 -0
- package/src/components/VTimePicker/__tests__/__snapshots__/VTimePickerTitle.spec.ts.snap +185 -0
- package/src/components/VTimePicker/_variables.scss +28 -0
- package/src/components/VTimePicker/index.ts +13 -0
- package/src/components/VTimeline/VTimeline.sass +167 -0
- package/src/components/VTimeline/VTimeline.ts +45 -0
- package/src/components/VTimeline/VTimelineItem.ts +115 -0
- package/src/components/VTimeline/__tests__/VTimeline.spec.ts +10 -0
- package/src/components/VTimeline/__tests__/VTimelineItem.spec.ts +66 -0
- package/src/components/VTimeline/__tests__/__snapshots__/VTimeline.spec.ts.snap +6 -0
- package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +74 -0
- package/src/components/VTimeline/_mixins.sass +43 -0
- package/src/components/VTimeline/_variables.scss +18 -0
- package/src/components/VTimeline/index.ts +11 -0
- package/src/components/VToolbar/VToolbar.sass +160 -0
- package/src/components/VToolbar/VToolbar.ts +167 -0
- package/src/components/VToolbar/__tests__/VToolbar.spec.ts +129 -0
- package/src/components/VToolbar/__tests__/__snapshots__/VToolbar.spec.ts.snap +31 -0
- package/src/components/VToolbar/_variables.scss +19 -0
- package/src/components/VToolbar/index.ts +22 -0
- package/src/components/VTooltip/VTooltip.sass +36 -0
- package/src/components/VTooltip/VTooltip.ts +223 -0
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +246 -0
- package/src/components/VTooltip/__tests__/__snapshots__/VTooltip.spec.ts.snap +110 -0
- package/src/components/VTooltip/_variables.scss +11 -0
- package/src/components/VTooltip/index.ts +4 -0
- package/src/components/VTreeview/VTreeview.sass +144 -0
- package/src/components/VTreeview/VTreeview.ts +442 -0
- package/src/components/VTreeview/VTreeviewNode.ts +356 -0
- package/src/components/VTreeview/__tests__/VTreeview.spec.ts +872 -0
- package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +185 -0
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +1058 -0
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +148 -0
- package/src/components/VTreeview/_mixins.sass +18 -0
- package/src/components/VTreeview/_variables.scss +10 -0
- package/src/components/VTreeview/index.ts +11 -0
- package/src/components/VTreeview/util/__tests__/filterTreeItems.spec.ts +20 -0
- package/src/components/VTreeview/util/filterTreeItems.ts +39 -0
- package/src/components/VVirtualScroll/VVirtualScroll.sass +15 -0
- package/src/components/VVirtualScroll/VVirtualScroll.ts +124 -0
- package/src/components/VVirtualScroll/__tests__/VVirtualScroll.spec.ts +108 -0
- package/src/components/VVirtualScroll/__tests__/__snapshots__/VVirtualScroll.spec.ts.snap +76 -0
- package/src/components/VVirtualScroll/index.ts +4 -0
- package/src/components/VWindow/VWindow.sass +108 -0
- package/src/components/VWindow/VWindow.ts +288 -0
- package/src/components/VWindow/VWindowItem.ts +157 -0
- package/src/components/VWindow/__tests__/VWindow.spec.ts +479 -0
- package/src/components/VWindow/__tests__/VWindowItem.spec.ts +344 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindow.spec.ts.snap +59 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindowItem.spec.ts.snap +36 -0
- package/src/components/VWindow/_variables.scss +5 -0
- package/src/components/VWindow/index.ts +11 -0
- package/src/components/index.ts +81 -0
- package/src/components/transitions/createTransition.ts +124 -0
- package/src/components/transitions/expand-transition.ts +86 -0
- package/src/components/transitions/index.ts +59 -0
- package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +118 -0
- package/src/directives/click-outside/__tests__/click-outside.spec.ts +111 -0
- package/src/directives/click-outside/index.ts +119 -0
- package/src/directives/color/__tests__/color.spec.ts +154 -0
- package/src/directives/color/index.ts +108 -0
- package/src/directives/index.ts +7 -0
- package/src/directives/intersect/__tests__/intersect.spec.ts +53 -0
- package/src/directives/intersect/index.ts +112 -0
- package/src/directives/mutate/__tests__/mutate.spec.ts +155 -0
- package/src/directives/mutate/index.ts +84 -0
- package/src/directives/resize/__tests__/resize.spec.ts +30 -0
- package/src/directives/resize/index.ts +60 -0
- package/src/directives/ripple/VRipple.sass +39 -0
- package/src/directives/ripple/__tests__/ripple.spec.ts +160 -0
- package/src/directives/ripple/index.ts +342 -0
- package/src/directives/scroll/__tests__/scroll.spec.ts +130 -0
- package/src/directives/scroll/index.ts +68 -0
- package/src/directives/touch/__tests__/touch.spec.ts +103 -0
- package/src/directives/touch/index.ts +135 -0
- package/src/entry-lib.ts +4 -0
- package/src/framework.ts +80 -0
- package/src/globals.d.ts +163 -0
- package/src/index.ts +19 -0
- package/src/install.ts +79 -0
- package/src/locale/__tests__/index.spec.ts +24 -0
- package/src/locale/af.ts +75 -0
- package/src/locale/ar.ts +75 -0
- package/src/locale/az.ts +75 -0
- package/src/locale/bg.ts +75 -0
- package/src/locale/ca.ts +75 -0
- package/src/locale/ckb.ts +75 -0
- package/src/locale/cs.ts +75 -0
- package/src/locale/da.ts +75 -0
- package/src/locale/de.ts +75 -0
- package/src/locale/el.ts +75 -0
- package/src/locale/en.ts +75 -0
- package/src/locale/es.ts +75 -0
- package/src/locale/et.ts +75 -0
- package/src/locale/fa.ts +75 -0
- package/src/locale/fi.ts +75 -0
- package/src/locale/fr.ts +75 -0
- package/src/locale/he.ts +75 -0
- package/src/locale/hr.ts +75 -0
- package/src/locale/hu.ts +75 -0
- package/src/locale/id.ts +75 -0
- package/src/locale/index.ts +42 -0
- package/src/locale/it.ts +75 -0
- package/src/locale/ja.ts +75 -0
- package/src/locale/ko.ts +75 -0
- package/src/locale/lt.ts +75 -0
- package/src/locale/lv.ts +75 -0
- package/src/locale/nl.ts +75 -0
- package/src/locale/no.ts +75 -0
- package/src/locale/pl.ts +75 -0
- package/src/locale/pt.ts +75 -0
- package/src/locale/ro.ts +75 -0
- package/src/locale/ru.ts +75 -0
- package/src/locale/sk.ts +75 -0
- package/src/locale/sl.ts +75 -0
- package/src/locale/sr-Cyrl.ts +75 -0
- package/src/locale/sr-Latn.ts +75 -0
- package/src/locale/sv.ts +75 -0
- package/src/locale/th.ts +75 -0
- package/src/locale/tr.ts +75 -0
- package/src/locale/uk.ts +75 -0
- package/src/locale/vi.ts +75 -0
- package/src/locale/zh-Hans.ts +75 -0
- package/src/locale/zh-Hant.ts +75 -0
- package/src/mixins/activatable/__tests__/__snapshots__/activatable.spec.ts.snap +20 -0
- package/src/mixins/activatable/__tests__/activatable.spec.ts +191 -0
- package/src/mixins/activatable/index.ts +224 -0
- package/src/mixins/applicationable/__tests__/applicationable.spec.ts +131 -0
- package/src/mixins/applicationable/index.ts +79 -0
- package/src/mixins/binds-attrs/index.ts +33 -0
- package/src/mixins/bootable/__tests__/bootable.spec.ts +90 -0
- package/src/mixins/bootable/index.ts +56 -0
- package/src/mixins/button-group/index.ts +26 -0
- package/src/mixins/colorable/__tests__/colorable.spec.ts +112 -0
- package/src/mixins/colorable/index.ts +118 -0
- package/src/mixins/comparable/index.ts +13 -0
- package/src/mixins/delayable/index.ts +50 -0
- package/src/mixins/dependent/__tests__/dependent.spec.ts +136 -0
- package/src/mixins/dependent/index.ts +89 -0
- package/src/mixins/detachable/__tests__/detachable.spec.ts +121 -0
- package/src/mixins/detachable/index.ts +175 -0
- package/src/mixins/elevatable/__tests__/elevatable.spec.ts +51 -0
- package/src/mixins/elevatable/index.ts +22 -0
- package/src/mixins/filterable/index.ts +13 -0
- package/src/mixins/groupable/index.ts +85 -0
- package/src/mixins/intersectable/__tests__/intersectable.spec.ts +45 -0
- package/src/mixins/intersectable/index.ts +54 -0
- package/src/mixins/loadable/index.ts +47 -0
- package/src/mixins/localable/index.ts +15 -0
- package/src/mixins/measurable/index.ts +42 -0
- package/src/mixins/menuable/__tests__/menuable.spec.ts +142 -0
- package/src/mixins/menuable/index.ts +431 -0
- package/src/mixins/mobile/__tests__/mobile.spec.ts +56 -0
- package/src/mixins/mobile/index.ts +53 -0
- package/src/mixins/mouse/__tests__/mouse.spec.ts +104 -0
- package/src/mixins/mouse/index.ts +124 -0
- package/src/mixins/overlayable/__tests__/overlayable.spec.ts +119 -0
- package/src/mixins/overlayable/index.ts +264 -0
- package/src/mixins/picker/index.ts +76 -0
- package/src/mixins/picker-button/index.ts +38 -0
- package/src/mixins/positionable/index.ts +54 -0
- package/src/mixins/proxyable/__tests__/proxyable.spec.ts +65 -0
- package/src/mixins/proxyable/index.ts +57 -0
- package/src/mixins/registrable/__tests__/registrable.spec.ts +31 -0
- package/src/mixins/registrable/index.ts +48 -0
- package/src/mixins/returnable/index.ts +34 -0
- package/src/mixins/rippleable/__tests__/__snapshots__/rippleable.spec.ts.snap +6 -0
- package/src/mixins/rippleable/__tests__/rippleable.spec.ts +29 -0
- package/src/mixins/rippleable/index.ts +41 -0
- package/src/mixins/roundable/__tests__/roundable.spec.ts +40 -0
- package/src/mixins/roundable/index.ts +36 -0
- package/src/mixins/routable/__tests__/routable.spec.ts +105 -0
- package/src/mixins/routable/index.ts +162 -0
- package/src/mixins/scrollable/__tests__/scrollable.spec.ts +144 -0
- package/src/mixins/scrollable/index.ts +104 -0
- package/src/mixins/selectable/__tests__/selectable.spec.ts +53 -0
- package/src/mixins/selectable/index.ts +171 -0
- package/src/mixins/sizeable/index.ts +32 -0
- package/src/mixins/ssr-bootable/index.ts +27 -0
- package/src/mixins/stackable/index.ts +65 -0
- package/src/mixins/themeable/index.ts +107 -0
- package/src/mixins/toggleable/index.ts +33 -0
- package/src/mixins/transitionable/index.ts +11 -0
- package/src/mixins/translatable/index.ts +60 -0
- package/src/mixins/validatable/__tests__/validatable.spec.ts +531 -0
- package/src/mixins/validatable/index.ts +283 -0
- package/src/presets/default/index.ts +70 -0
- package/src/services/application/__tests__/application.spec.ts +29 -0
- package/src/services/application/index.ts +55 -0
- package/src/services/breakpoint/__tests__/breakpoint.spec.ts +300 -0
- package/src/services/breakpoint/index.ts +194 -0
- package/src/services/goto/__tests__/easing-patterns.spec.ts +23 -0
- package/src/services/goto/__tests__/goto.spec.ts +214 -0
- package/src/services/goto/easing-patterns.ts +28 -0
- package/src/services/goto/index.ts +92 -0
- package/src/services/goto/util.ts +89 -0
- package/src/services/icons/__tests__/__snapshots__/icons.spec.ts.snap +77 -0
- package/src/services/icons/__tests__/icons.spec.ts +31 -0
- package/src/services/icons/index.ts +39 -0
- package/src/services/icons/presets/fa-svg.ts +23 -0
- package/src/services/icons/presets/fa.ts +39 -0
- package/src/services/icons/presets/fa4.ts +39 -0
- package/src/services/icons/presets/index.ts +15 -0
- package/src/services/icons/presets/md.ts +39 -0
- package/src/services/icons/presets/mdi-svg.ts +39 -0
- package/src/services/icons/presets/mdi.ts +39 -0
- package/src/services/index.ts +7 -0
- package/src/services/lang/__tests__/lang.spec.ts +70 -0
- package/src/services/lang/index.ts +88 -0
- package/src/services/presets/__tests__/__snapshots__/presets.spec.ts.snap +11 -0
- package/src/services/presets/__tests__/presets.spec.ts +51 -0
- package/src/services/presets/index.ts +44 -0
- package/src/services/service/index.ts +11 -0
- package/src/services/theme/__tests__/__snapshots__/theme-utils.spec.ts.snap +231 -0
- package/src/services/theme/__tests__/__snapshots__/theme.spec.ts.snap +5705 -0
- package/src/services/theme/__tests__/theme-utils.spec.ts +55 -0
- package/src/services/theme/__tests__/theme.spec.ts +284 -0
- package/src/services/theme/index.ts +256 -0
- package/src/services/theme/utils.ts +145 -0
- package/src/styles/components/_index.sass +1 -0
- package/src/styles/components/_selection-controls.sass +119 -0
- package/src/styles/elements/_blockquote.sass +4 -0
- package/src/styles/elements/_code.sass +23 -0
- package/src/styles/elements/_global.sass +23 -0
- package/src/styles/elements/_headings.sass +8 -0
- package/src/styles/elements/_index.sass +6 -0
- package/src/styles/elements/_lists.sass +3 -0
- package/src/styles/elements/_typography.sass +88 -0
- package/src/styles/generic/_animations.scss +13 -0
- package/src/styles/generic/_colors.scss +44 -0
- package/src/styles/generic/_elevation.scss +10 -0
- package/src/styles/generic/_index.scss +5 -0
- package/src/styles/generic/_reset.scss +281 -0
- package/src/styles/generic/_transitions.scss +317 -0
- package/src/styles/main.sass +7 -0
- package/src/styles/settings/_colors.scss +422 -0
- package/src/styles/settings/_dark.scss +153 -0
- package/src/styles/settings/_elevations.scss +101 -0
- package/src/styles/settings/_index.sass +10 -0
- package/src/styles/settings/_light.scss +134 -0
- package/src/styles/settings/_theme.scss +1 -0
- package/src/styles/settings/_utilities.scss +432 -0
- package/src/styles/settings/_variables.scss +266 -0
- package/src/styles/styles.sass +2 -0
- package/src/styles/tools/_bootable.sass +3 -0
- package/src/styles/tools/_display.sass +8 -0
- package/src/styles/tools/_elevation.sass +5 -0
- package/src/styles/tools/_functions.sass +70 -0
- package/src/styles/tools/_index.sass +18 -0
- package/src/styles/tools/_radius.sass +6 -0
- package/src/styles/tools/_rtl.sass +7 -0
- package/src/styles/tools/_sheet.sass +14 -0
- package/src/styles/tools/_states.sass +17 -0
- package/src/styles/tools/_theme.sass +5 -0
- package/src/styles/tools/_utilities.sass +61 -0
- package/src/styles/utilities/_display.sass +6 -0
- package/src/styles/utilities/_index.sass +42 -0
- package/src/styles/utilities/_screenreaders.sass +13 -0
- package/src/styles/utilities/_text.sass +8 -0
- package/src/styles/utilities/_transition.sass +4 -0
- package/src/util/__tests__/__snapshots__/helpers.spec.ts.snap +11 -0
- package/src/util/__tests__/colorUtils.spec.ts +162 -0
- package/src/util/__tests__/console.spec.ts +132 -0
- package/src/util/__tests__/dateTimeUtils.spec.ts +24 -0
- package/src/util/__tests__/dom.spec.ts +45 -0
- package/src/util/__tests__/helpers.spec.ts +470 -0
- package/src/util/__tests__/mergeData.spec.ts +104 -0
- package/src/util/color/transformCIELAB.ts +36 -0
- package/src/util/color/transformSRGB.ts +66 -0
- package/src/util/colorUtils.ts +249 -0
- package/src/util/colors.ts +339 -0
- package/src/util/console.ts +133 -0
- package/src/util/dateTimeUtils.ts +54 -0
- package/src/util/dedupeModelListeners.ts +18 -0
- package/src/util/dom.ts +24 -0
- package/src/util/helpers.ts +579 -0
- package/src/util/legacyEventsMixin.ts +34 -0
- package/src/util/make-directive-activatable.ts +55 -0
- package/src/util/mergeData.ts +166 -0
- package/src/util/mixins.ts +28 -0
- package/src/util/rebuildFunctionalSlots.ts +13 -0
- package/types/alacarte.d.ts +46 -0
- package/types/colors.d.ts +107 -0
- package/types/index.d.ts +308 -0
- package/types/lib.d.ts +378 -0
- package/types/services/application.d.ts +24 -0
- package/types/services/breakpoint.d.ts +42 -0
- package/types/services/goto.d.ts +30 -0
- package/types/services/icons.d.ts +68 -0
- package/types/services/index.d.ts +17 -0
- package/types/services/lang.d.ts +19 -0
- package/types/services/presets.d.ts +65 -0
- package/types/services/theme.d.ts +80 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function createUTCDate (year: number, month = 0, day = 1) {
|
|
2
|
+
let date
|
|
3
|
+
if (year < 100 && year >= 0) {
|
|
4
|
+
date = new Date(Date.UTC(year, month, day))
|
|
5
|
+
if (isFinite(date.getUTCFullYear())) {
|
|
6
|
+
date.setUTCFullYear(year)
|
|
7
|
+
}
|
|
8
|
+
} else {
|
|
9
|
+
date = new Date(Date.UTC(year, month, day))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return date
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function firstWeekOffset (year: number, firstDayOfWeek: number, firstDayOfYear: number) {
|
|
16
|
+
const firstWeekDayInFirstWeek = 7 + firstDayOfWeek - firstDayOfYear
|
|
17
|
+
const firstWeekDayOfYear = (7 + createUTCDate(year, 0, firstWeekDayInFirstWeek).getUTCDay() - firstDayOfWeek) % 7
|
|
18
|
+
|
|
19
|
+
return -firstWeekDayOfYear + firstWeekDayInFirstWeek - 1
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function dayOfYear (year: number, month: number, day: number, firstDayOfWeek: number) {
|
|
23
|
+
let dayOfYear = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334][month]
|
|
24
|
+
if (month > 1 && isLeapYear(year)) {
|
|
25
|
+
dayOfYear++
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return dayOfYear + day
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function weeksInYear (year: number, firstDayOfWeek: number, firstDayOfYear: number) {
|
|
32
|
+
const weekOffset = firstWeekOffset(year, firstDayOfWeek, firstDayOfYear)
|
|
33
|
+
const weekOffsetNext = firstWeekOffset(year + 1, firstDayOfWeek, firstDayOfYear)
|
|
34
|
+
const daysInYear = isLeapYear(year) ? 366 : 365
|
|
35
|
+
|
|
36
|
+
return (daysInYear - weekOffset + weekOffsetNext) / 7
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function weekNumber (year: number, month: number, day: number, firstDayOfWeek: number, localeFirstDayOfYear: number): number {
|
|
40
|
+
const weekOffset = firstWeekOffset(year, firstDayOfWeek, localeFirstDayOfYear)
|
|
41
|
+
const week = Math.ceil((dayOfYear(year, month, day, firstDayOfWeek) - weekOffset) / 7)
|
|
42
|
+
|
|
43
|
+
if (week < 1) {
|
|
44
|
+
return week + weeksInYear(year - 1, firstDayOfWeek, localeFirstDayOfYear)
|
|
45
|
+
} else if (week > weeksInYear(year, firstDayOfWeek, localeFirstDayOfYear)) {
|
|
46
|
+
return week - weeksInYear(year, firstDayOfWeek, localeFirstDayOfYear)
|
|
47
|
+
} else {
|
|
48
|
+
return week
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function isLeapYear (year: number): boolean {
|
|
53
|
+
return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VNodeData } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Removes duplicate `@input` listeners when
|
|
5
|
+
* using v-model with functional components
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/vuetifyjs/vuetify/issues/4460
|
|
8
|
+
*/
|
|
9
|
+
export default function dedupeModelListeners (data: VNodeData): void {
|
|
10
|
+
if (data.model && data.on && data.on.input) {
|
|
11
|
+
if (Array.isArray(data.on.input)) {
|
|
12
|
+
const i = data.on.input.indexOf(data.model.callback)
|
|
13
|
+
if (i > -1) data.on.input.splice(i, 1)
|
|
14
|
+
} else {
|
|
15
|
+
delete data.on.input
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/util/dom.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns:
|
|
3
|
+
* - 'null' if the node is not attached to the DOM
|
|
4
|
+
* - the root node (HTMLDocument | ShadowRoot) otherwise
|
|
5
|
+
*/
|
|
6
|
+
export function attachedRoot (node: Node): null | HTMLDocument | ShadowRoot {
|
|
7
|
+
/* istanbul ignore next */
|
|
8
|
+
if (typeof node.getRootNode !== 'function') {
|
|
9
|
+
// Shadow DOM not supported (IE11), lets find the root of this node
|
|
10
|
+
while (node.parentNode) node = node.parentNode
|
|
11
|
+
|
|
12
|
+
// The root parent is the document if the node is attached to the DOM
|
|
13
|
+
if (node !== document) return null
|
|
14
|
+
|
|
15
|
+
return document
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const root = node.getRootNode()
|
|
19
|
+
|
|
20
|
+
// The composed root node is the document if the node is attached to the DOM
|
|
21
|
+
if (root !== document && root.getRootNode({ composed: true }) !== document) return null
|
|
22
|
+
|
|
23
|
+
return root as HTMLDocument | ShadowRoot
|
|
24
|
+
}
|
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue'
|
|
2
|
+
import { VNode, VNodeDirective } from 'vue/types'
|
|
3
|
+
import { VuetifyIcon } from 'vuetify/types/services/icons'
|
|
4
|
+
import { DataTableCompareFunction, SelectItemKey, ItemGroup } from 'vuetify/types'
|
|
5
|
+
|
|
6
|
+
export function createSimpleFunctional (
|
|
7
|
+
c: string,
|
|
8
|
+
el = 'div',
|
|
9
|
+
name?: string
|
|
10
|
+
) {
|
|
11
|
+
return defineComponent({
|
|
12
|
+
name: name || c.replace(/__/g, '-'),
|
|
13
|
+
|
|
14
|
+
functional: true,
|
|
15
|
+
|
|
16
|
+
props: {
|
|
17
|
+
tag: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: el,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
render (): VNode {
|
|
24
|
+
const data = { ...this.$attrs }
|
|
25
|
+
|
|
26
|
+
data.class = (`${c} ${data.class || ''}`).trim()
|
|
27
|
+
|
|
28
|
+
return h(this.tag, data, this.$slots.default?.())
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type BindingConfig = Pick<VNodeDirective, 'arg' | 'modifiers' | 'value'>
|
|
34
|
+
export function directiveConfig (binding: BindingConfig, defaults = {}): VNodeDirective {
|
|
35
|
+
return {
|
|
36
|
+
...defaults,
|
|
37
|
+
...binding.modifiers,
|
|
38
|
+
value: binding.arg,
|
|
39
|
+
...(binding.value || {}),
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function addOnceEventListener (
|
|
44
|
+
el: EventTarget,
|
|
45
|
+
eventName: string,
|
|
46
|
+
cb: (event: Event) => void,
|
|
47
|
+
options: boolean | AddEventListenerOptions = false
|
|
48
|
+
): void {
|
|
49
|
+
const once = (event: Event) => {
|
|
50
|
+
cb(event)
|
|
51
|
+
el.removeEventListener(eventName, once, options)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
el.addEventListener(eventName, once, options)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let passiveSupported = false
|
|
58
|
+
try {
|
|
59
|
+
if (typeof window !== 'undefined') {
|
|
60
|
+
const testListenerOpts = Object.defineProperty({}, 'passive', {
|
|
61
|
+
get: () => {
|
|
62
|
+
passiveSupported = true
|
|
63
|
+
},
|
|
64
|
+
}) as EventListener & EventListenerOptions
|
|
65
|
+
|
|
66
|
+
window.addEventListener('testListener', testListenerOpts, testListenerOpts)
|
|
67
|
+
window.removeEventListener('testListener', testListenerOpts, testListenerOpts)
|
|
68
|
+
}
|
|
69
|
+
} catch (e) { console.warn(e) } /* eslint-disable-line no-console */
|
|
70
|
+
export { passiveSupported }
|
|
71
|
+
|
|
72
|
+
export function addPassiveEventListener (
|
|
73
|
+
el: EventTarget,
|
|
74
|
+
event: string,
|
|
75
|
+
cb: (event: any) => void,
|
|
76
|
+
options: {}
|
|
77
|
+
): void {
|
|
78
|
+
el.addEventListener(event, cb, passiveSupported ? options : false)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function getNestedValue (obj: any, path: (string | number)[], fallback?: any): any {
|
|
82
|
+
const last = path.length - 1
|
|
83
|
+
|
|
84
|
+
if (last < 0) return obj === undefined ? fallback : obj
|
|
85
|
+
|
|
86
|
+
for (let i = 0; i < last; i++) {
|
|
87
|
+
if (obj == null) {
|
|
88
|
+
return fallback
|
|
89
|
+
}
|
|
90
|
+
obj = obj[path[i]]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (obj == null) return fallback
|
|
94
|
+
|
|
95
|
+
return obj[path[last]] === undefined ? fallback : obj[path[last]]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function deepEqual (a: any, b: any): boolean {
|
|
99
|
+
if (a === b) return true
|
|
100
|
+
|
|
101
|
+
if (
|
|
102
|
+
a instanceof Date &&
|
|
103
|
+
b instanceof Date &&
|
|
104
|
+
a.getTime() !== b.getTime()
|
|
105
|
+
) {
|
|
106
|
+
// If the values are Date, compare them as timestamps
|
|
107
|
+
return false
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (a !== Object(a) || b !== Object(b)) {
|
|
111
|
+
// If the values aren't objects, they were already checked for equality
|
|
112
|
+
return false
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const props = Object.keys(a)
|
|
116
|
+
|
|
117
|
+
if (props.length !== Object.keys(b).length) {
|
|
118
|
+
// Different number of props, don't bother to check
|
|
119
|
+
return false
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return props.every(p => deepEqual(a[p], b[p]))
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function getObjectValueByPath (obj: any, path: string, fallback?: any): any {
|
|
126
|
+
// credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
|
|
127
|
+
if (obj == null || !path || typeof path !== 'string') return fallback
|
|
128
|
+
if (obj !== null && typeof obj === 'object' && !Array.isArray(obj) && path in obj && obj[path] !== undefined) {
|
|
129
|
+
return obj[path]
|
|
130
|
+
}
|
|
131
|
+
path = path.replace(/\[(\w+)\]/g, '.$1') // convert indexes to properties
|
|
132
|
+
path = path.replace(/^\./, '') // strip a leading dot
|
|
133
|
+
return getNestedValue(obj, path.split('.'), fallback)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function getPropertyFromItem (
|
|
137
|
+
item: object,
|
|
138
|
+
property: SelectItemKey,
|
|
139
|
+
fallback?: any
|
|
140
|
+
): any {
|
|
141
|
+
if (property == null) return item === undefined ? fallback : item
|
|
142
|
+
|
|
143
|
+
if (item !== Object(item)) return fallback === undefined ? item : fallback
|
|
144
|
+
|
|
145
|
+
if (typeof property === 'string') return getObjectValueByPath(item, property, fallback)
|
|
146
|
+
|
|
147
|
+
if (Array.isArray(property)) return getNestedValue(item, property, fallback)
|
|
148
|
+
|
|
149
|
+
if (typeof property !== 'function') return fallback
|
|
150
|
+
|
|
151
|
+
const value = property(item, fallback)
|
|
152
|
+
|
|
153
|
+
return typeof value === 'undefined' ? fallback : value
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function createRange (length: number): number[] {
|
|
157
|
+
return Array.from({ length }, (v, k) => k)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function getZIndex (el?: Element | null): number {
|
|
161
|
+
if (!el || el.nodeType !== Node.ELEMENT_NODE) return 0
|
|
162
|
+
|
|
163
|
+
const index = +window.getComputedStyle(el).getPropertyValue('z-index')
|
|
164
|
+
|
|
165
|
+
if (!index) return getZIndex(el.parentNode as Element)
|
|
166
|
+
return index
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function filterObjectOnKeys<T, K extends keyof T> (obj: T, keys: K[]): { [N in K]: T[N] } {
|
|
170
|
+
const filtered = {} as { [N in K]: T[N] }
|
|
171
|
+
|
|
172
|
+
for (let i = 0; i < keys.length; i++) {
|
|
173
|
+
const key = keys[i]
|
|
174
|
+
if (typeof obj[key] !== 'undefined') {
|
|
175
|
+
filtered[key] = obj[key]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return filtered
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function convertToUnit (str: string | number | null | undefined, unit = 'px'): string | undefined {
|
|
183
|
+
if (str == null || str === '') {
|
|
184
|
+
return undefined
|
|
185
|
+
} else if (isNaN(+str!)) {
|
|
186
|
+
return String(str)
|
|
187
|
+
} else {
|
|
188
|
+
return `${Number(str)}${unit}`
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function kebabCase (str: string): string {
|
|
193
|
+
return (str || '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function isObject (obj: any): obj is object {
|
|
197
|
+
return obj !== null && typeof obj === 'object'
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// KeyboardEvent.keyCode aliases
|
|
201
|
+
export const keyCodes = Object.freeze({
|
|
202
|
+
enter: 13,
|
|
203
|
+
tab: 9,
|
|
204
|
+
delete: 46,
|
|
205
|
+
esc: 27,
|
|
206
|
+
space: 32,
|
|
207
|
+
up: 38,
|
|
208
|
+
down: 40,
|
|
209
|
+
left: 37,
|
|
210
|
+
right: 39,
|
|
211
|
+
end: 35,
|
|
212
|
+
home: 36,
|
|
213
|
+
del: 46,
|
|
214
|
+
backspace: 8,
|
|
215
|
+
insert: 45,
|
|
216
|
+
pageup: 33,
|
|
217
|
+
pagedown: 34,
|
|
218
|
+
shift: 16,
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* This remaps internal names like '$cancel' or '$vuetify.icons.cancel'
|
|
223
|
+
* to the current name or component for that icon.
|
|
224
|
+
*/
|
|
225
|
+
export function remapInternalIcon (vm: Vue, iconName: string): VuetifyIcon {
|
|
226
|
+
// Look for custom component in the configuration
|
|
227
|
+
const component = vm.$vuetify.icons.component
|
|
228
|
+
|
|
229
|
+
// Look for overrides
|
|
230
|
+
if (iconName.startsWith('$')) {
|
|
231
|
+
// Get the target icon name
|
|
232
|
+
const iconPath = `$vuetify.icons.values.${iconName.split('$').pop()!.split('.').pop()}`
|
|
233
|
+
|
|
234
|
+
// Now look up icon indirection name,
|
|
235
|
+
// e.g. '$vuetify.icons.values.cancel'
|
|
236
|
+
|
|
237
|
+
const override = getObjectValueByPath(vm, iconPath, iconName)
|
|
238
|
+
|
|
239
|
+
if (typeof override === 'string') iconName = override
|
|
240
|
+
else return override
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (component == null) {
|
|
244
|
+
return iconName
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return {
|
|
248
|
+
component,
|
|
249
|
+
props: {
|
|
250
|
+
icon: iconName,
|
|
251
|
+
},
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function keys<O> (o: O) {
|
|
256
|
+
return Object.keys(o) as (keyof O)[]
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Camelize a hyphen-delimited string.
|
|
261
|
+
*/
|
|
262
|
+
const camelizeRE = /-(\w)/g
|
|
263
|
+
export const camelize = (str: string): string => {
|
|
264
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Returns the set difference of B and A, i.e. the set of elements in B but not in A
|
|
269
|
+
*/
|
|
270
|
+
export function arrayDiff (a: any[], b: any[]): any[] {
|
|
271
|
+
const diff: any[] = []
|
|
272
|
+
for (let i = 0; i < b.length; i++) {
|
|
273
|
+
if (a.indexOf(b[i]) < 0) diff.push(b[i])
|
|
274
|
+
}
|
|
275
|
+
return diff
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Makes the first character of a string uppercase
|
|
280
|
+
*/
|
|
281
|
+
export function upperFirst (str: string): string {
|
|
282
|
+
return str.charAt(0).toUpperCase() + str.slice(1)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function groupItems<T extends any = any> (
|
|
286
|
+
items: T[],
|
|
287
|
+
groupBy: string[],
|
|
288
|
+
groupDesc: boolean[]
|
|
289
|
+
): ItemGroup<T>[] {
|
|
290
|
+
const key = groupBy[0]
|
|
291
|
+
const groups: ItemGroup<T>[] = []
|
|
292
|
+
let current
|
|
293
|
+
for (let i = 0; i < items.length; i++) {
|
|
294
|
+
const item = items[i]
|
|
295
|
+
const val = getObjectValueByPath(item, key, null)
|
|
296
|
+
if (current !== val) {
|
|
297
|
+
current = val
|
|
298
|
+
groups.push({
|
|
299
|
+
name: val ?? '',
|
|
300
|
+
items: [],
|
|
301
|
+
})
|
|
302
|
+
}
|
|
303
|
+
groups[groups.length - 1].items.push(item)
|
|
304
|
+
}
|
|
305
|
+
return groups
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function wrapInArray<T> (v: T | T[] | null | undefined): T[] { return v != null ? Array.isArray(v) ? v : [v] : [] }
|
|
309
|
+
|
|
310
|
+
export function sortItems<T extends any = any> (
|
|
311
|
+
items: T[],
|
|
312
|
+
sortBy: string[],
|
|
313
|
+
sortDesc: boolean[],
|
|
314
|
+
locale: string,
|
|
315
|
+
customSorters?: Record<string, DataTableCompareFunction<T>>
|
|
316
|
+
): T[] {
|
|
317
|
+
if (sortBy === null || !sortBy.length) return items
|
|
318
|
+
const stringCollator = new Intl.Collator(locale, { sensitivity: 'accent', usage: 'sort' })
|
|
319
|
+
|
|
320
|
+
return items.sort((a, b) => {
|
|
321
|
+
for (let i = 0; i < sortBy.length; i++) {
|
|
322
|
+
const sortKey = sortBy[i]
|
|
323
|
+
|
|
324
|
+
let sortA = getObjectValueByPath(a, sortKey)
|
|
325
|
+
let sortB = getObjectValueByPath(b, sortKey)
|
|
326
|
+
|
|
327
|
+
if (sortDesc[i]) {
|
|
328
|
+
[sortA, sortB] = [sortB, sortA]
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (customSorters && customSorters[sortKey]) {
|
|
332
|
+
const customResult = customSorters[sortKey](sortA, sortB)
|
|
333
|
+
|
|
334
|
+
if (!customResult) continue
|
|
335
|
+
|
|
336
|
+
return customResult
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Check if both cannot be evaluated
|
|
340
|
+
if (sortA === null && sortB === null) {
|
|
341
|
+
continue
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Dates should be compared numerically
|
|
345
|
+
if (sortA instanceof Date && sortB instanceof Date) {
|
|
346
|
+
return sortA.getTime() - sortB.getTime()
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase())
|
|
350
|
+
|
|
351
|
+
if (sortA !== sortB) {
|
|
352
|
+
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB)
|
|
353
|
+
return stringCollator.compare(sortA, sortB)
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return 0
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export function defaultFilter (value: any, search: string | null, item: any) {
|
|
362
|
+
return value != null &&
|
|
363
|
+
search != null &&
|
|
364
|
+
typeof value !== 'boolean' &&
|
|
365
|
+
value.toString().toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) !== -1
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function searchItems<T extends any = any> (items: T[], search: string): T[] {
|
|
369
|
+
if (!search) return items
|
|
370
|
+
search = search.toString().toLowerCase()
|
|
371
|
+
if (search.trim() === '') return items
|
|
372
|
+
|
|
373
|
+
return items.filter((item: any) => Object.keys(item).some(key => defaultFilter(getObjectValueByPath(item, key), search, item)))
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Returns:
|
|
378
|
+
* - 'normal' for old style slots - `<template slot="default">`
|
|
379
|
+
* - 'scoped' for old style scoped slots (`<template slot="default" slot-scope="data">`) or bound v-slot (`#default="data"`)
|
|
380
|
+
* - 'v-slot' for unbound v-slot (`#default`) - only if the third param is true, otherwise counts as scoped
|
|
381
|
+
*/
|
|
382
|
+
export function getSlotType<T extends boolean = false> (vm: Vue, name: string, split?: T): (T extends true ? 'v-slot' : never) | 'normal' | 'scoped' | void {
|
|
383
|
+
return 'scoped'
|
|
384
|
+
|
|
385
|
+
if (vm.$slots.hasOwnProperty(name) && vm.$slots.hasOwnProperty(name) && (vm.$slots[name] as any).name) {
|
|
386
|
+
return split ? 'v-slot' as any : 'scoped'
|
|
387
|
+
}
|
|
388
|
+
if (vm.$slots.hasOwnProperty(name)) return 'normal'
|
|
389
|
+
if (vm.$slots.hasOwnProperty(name)) return 'scoped'
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export function debounce (fn: Function, delay: number) {
|
|
393
|
+
let timeoutId = 0 as any
|
|
394
|
+
return (...args: any[]) => {
|
|
395
|
+
clearTimeout(timeoutId)
|
|
396
|
+
timeoutId = setTimeout(() => fn(...args), delay)
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function throttle<T extends (...args: any[]) => any> (fn: T, limit: number) {
|
|
401
|
+
let throttling = false
|
|
402
|
+
return (...args: Parameters<T>): void | ReturnType<T> => {
|
|
403
|
+
if (!throttling) {
|
|
404
|
+
throttling = true
|
|
405
|
+
setTimeout(() => throttling = false, limit)
|
|
406
|
+
return fn(...args)
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export function getPrefixedScopedSlots (prefix: string, scopedSlots: any) {
|
|
412
|
+
return Object.keys(scopedSlots).filter(k => k.startsWith(prefix)).reduce((obj: any, k: string) => {
|
|
413
|
+
obj[k.replace(prefix, '')] = scopedSlots[k]
|
|
414
|
+
return obj
|
|
415
|
+
}, {})
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export function getSlot (vm: Vue, name = 'default', data?: object | (() => object), optional = false) {
|
|
419
|
+
const kebabName = kebabCase(name)
|
|
420
|
+
|
|
421
|
+
if (vm.$slots.hasOwnProperty(name)) {
|
|
422
|
+
return vm.$slots[name]!(data instanceof Function ? data() : data)
|
|
423
|
+
} else if (vm.$slots.hasOwnProperty(kebabName)) {
|
|
424
|
+
return vm.$slots[kebabName]!(data instanceof Function ? data() : data)
|
|
425
|
+
} else if (vm.$slots.hasOwnProperty(name) && (!data || optional)) {
|
|
426
|
+
return vm.$slots[name]
|
|
427
|
+
} else if (vm.$slots.hasOwnProperty(kebabName) && (!data || optional)) {
|
|
428
|
+
return vm.$slots[kebabName]
|
|
429
|
+
}
|
|
430
|
+
return undefined
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export function clamp (value: number, min = 0, max = 1) {
|
|
434
|
+
return Math.max(min, Math.min(max, value))
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export function padEnd (str: string, length: number, char = '0') {
|
|
438
|
+
return str + char.repeat(Math.max(0, length - str.length))
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export function chunk (str: string, size = 1) {
|
|
442
|
+
const chunked: string[] = []
|
|
443
|
+
let index = 0
|
|
444
|
+
while (index < str.length) {
|
|
445
|
+
chunked.push(str.substr(index, size))
|
|
446
|
+
index += size
|
|
447
|
+
}
|
|
448
|
+
return chunked
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function humanReadableFileSize (bytes: number, binary = false): string {
|
|
452
|
+
const base = binary ? 1024 : 1000
|
|
453
|
+
if (bytes < base) {
|
|
454
|
+
return `${bytes} B`
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const prefix = binary ? ['Ki', 'Mi', 'Gi'] : ['k', 'M', 'G']
|
|
458
|
+
let unit = -1
|
|
459
|
+
while (Math.abs(bytes) >= base && unit < prefix.length - 1) {
|
|
460
|
+
bytes /= base
|
|
461
|
+
++unit
|
|
462
|
+
}
|
|
463
|
+
return `${bytes.toFixed(1)} ${prefix[unit]}B`
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export function camelizeObjectKeys (obj: Record<string, any> | null | undefined) {
|
|
467
|
+
if (!obj) return {}
|
|
468
|
+
|
|
469
|
+
return Object.keys(obj).reduce((o: any, key: string) => {
|
|
470
|
+
o[camelize(key)] = obj[key]
|
|
471
|
+
return o
|
|
472
|
+
}, {})
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export function mergeDeep (
|
|
476
|
+
source: Dictionary<any> = {},
|
|
477
|
+
target: Dictionary<any> = {}
|
|
478
|
+
) {
|
|
479
|
+
for (const key in target) {
|
|
480
|
+
const sourceProperty = source[key]
|
|
481
|
+
const targetProperty = target[key]
|
|
482
|
+
|
|
483
|
+
// Only continue deep merging if
|
|
484
|
+
// both properties are objects
|
|
485
|
+
if (
|
|
486
|
+
isObject(sourceProperty) &&
|
|
487
|
+
isObject(targetProperty)
|
|
488
|
+
) {
|
|
489
|
+
source[key] = mergeDeep(sourceProperty, targetProperty)
|
|
490
|
+
|
|
491
|
+
continue
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
source[key] = targetProperty
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
return source
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export function fillArray<T> (length: number, obj: T) {
|
|
501
|
+
return Array(length).fill(obj)
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/** Polyfill for Event.prototype.composedPath */
|
|
505
|
+
export function composedPath (e: Event): EventTarget[] {
|
|
506
|
+
if (e.composedPath) return e.composedPath()
|
|
507
|
+
|
|
508
|
+
const path = []
|
|
509
|
+
let el = e.target as Element
|
|
510
|
+
|
|
511
|
+
while (el) {
|
|
512
|
+
path.push(el)
|
|
513
|
+
|
|
514
|
+
if (el.tagName === 'HTML') {
|
|
515
|
+
path.push(document)
|
|
516
|
+
path.push(window)
|
|
517
|
+
|
|
518
|
+
return path
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
el = el.parentElement!
|
|
522
|
+
}
|
|
523
|
+
return path
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export function normalizeAttrs (attrs) {
|
|
527
|
+
const keys = Object.keys(attrs).sort()
|
|
528
|
+
|
|
529
|
+
const obj = {}
|
|
530
|
+
|
|
531
|
+
for (let i = 0; i < keys.length; i++) {
|
|
532
|
+
obj[keys[i]] = attrs[keys[i]]
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
return obj
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Нормализует классы из различных форматов в объект
|
|
540
|
+
* @param classes - классы в виде строки, объекта или массива
|
|
541
|
+
* @returns объект с нормализованными классами
|
|
542
|
+
*/
|
|
543
|
+
export function normalizeClasses (
|
|
544
|
+
classes: string | Record<string, any> | Array<string | Record<string, any>> | undefined
|
|
545
|
+
): Record<string, any> {
|
|
546
|
+
if (!classes) return {}
|
|
547
|
+
|
|
548
|
+
if (typeof classes === 'object' && !Array.isArray(classes)) {
|
|
549
|
+
return classes
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
if (typeof classes === 'string') {
|
|
553
|
+
const trimmed = classes.trim()
|
|
554
|
+
if (!trimmed) return {}
|
|
555
|
+
|
|
556
|
+
return trimmed.split(/\s+/).reduce((acc, cls) => {
|
|
557
|
+
acc[cls] = true
|
|
558
|
+
return acc
|
|
559
|
+
}, {} as Record<string, any>)
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (Array.isArray(classes)) {
|
|
563
|
+
return classes.reduce((acc, cls) => {
|
|
564
|
+
if (typeof cls === 'string') {
|
|
565
|
+
const trimmed = cls.trim()
|
|
566
|
+
if (trimmed) {
|
|
567
|
+
trimmed.split(/\s+/).forEach(className => {
|
|
568
|
+
acc[className] = true
|
|
569
|
+
})
|
|
570
|
+
}
|
|
571
|
+
} else if (cls && typeof cls === 'object') {
|
|
572
|
+
Object.assign(acc, cls)
|
|
573
|
+
}
|
|
574
|
+
return acc
|
|
575
|
+
}, {} as Record<string, any>)
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return {}
|
|
579
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Legacy events mixin for Vue 3 migration
|
|
2
|
+
// Provides $on, $off, and $emitLegacy methods to maintain compatibility with Vue 2 code
|
|
3
|
+
|
|
4
|
+
export const legacyEventsMixin = {
|
|
5
|
+
methods: {
|
|
6
|
+
$emitLegacy (eventName: string, args?: any) {
|
|
7
|
+
if (!this.eventsLegacy || !this.eventsLegacy[eventName]) return
|
|
8
|
+
|
|
9
|
+
this.eventsLegacy[eventName].forEach((listener: Function) => listener(args))
|
|
10
|
+
},
|
|
11
|
+
$on (eventName: string, listener: Function) {
|
|
12
|
+
this.eventsLegacy ||= {}
|
|
13
|
+
this.eventsLegacy[eventName] ||= []
|
|
14
|
+
this.eventsLegacy[eventName].push(listener)
|
|
15
|
+
// console.warn("$on is not available")
|
|
16
|
+
},
|
|
17
|
+
$off (eventName: string, listener: Function) {
|
|
18
|
+
if (this.eventsLegacy && this.eventsLegacy[eventName]) {
|
|
19
|
+
this.eventsLegacy[eventName] = this.eventsLegacy[eventName].filter((_listener: Function) => _listener !== listener)
|
|
20
|
+
}
|
|
21
|
+
// console.warn('$off is not available')
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
$listeners () {
|
|
26
|
+
const names = Object.keys(this.$attrs).filter(name => name.startsWith('on'))
|
|
27
|
+
|
|
28
|
+
return names.reduce((listeners, name) => {
|
|
29
|
+
listeners[name] = this.$attrs[name]
|
|
30
|
+
return listeners
|
|
31
|
+
}, {})
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|