@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,951 @@
|
|
|
1
|
+
// Styles
|
|
2
|
+
import '../VTextField/VTextField.sass'
|
|
3
|
+
import './VSelect.sass'
|
|
4
|
+
|
|
5
|
+
// Components
|
|
6
|
+
import VChip from '../VChip'
|
|
7
|
+
import VMenu from '../VMenu'
|
|
8
|
+
import VSelectList from './VSelectList'
|
|
9
|
+
|
|
10
|
+
// Extensions
|
|
11
|
+
import VInput from '../VInput'
|
|
12
|
+
import VTextField from '../VTextField/VTextField'
|
|
13
|
+
|
|
14
|
+
// Mixins
|
|
15
|
+
import Comparable from '../../mixins/comparable'
|
|
16
|
+
import Dependent from '../../mixins/dependent'
|
|
17
|
+
import Filterable from '../../mixins/filterable'
|
|
18
|
+
|
|
19
|
+
// Directives
|
|
20
|
+
import ClickOutside from '../../directives/click-outside'
|
|
21
|
+
|
|
22
|
+
// Utilities
|
|
23
|
+
import mergeData from '../../util/mergeData'
|
|
24
|
+
import { getPropertyFromItem, getObjectValueByPath, keyCodes, normalizeAttrs } from '../../util/helpers'
|
|
25
|
+
import { consoleError, breaking } from '../../util/console'
|
|
26
|
+
|
|
27
|
+
// Types
|
|
28
|
+
import mixins from '../../util/mixins'
|
|
29
|
+
import { VNode, VNodeDirective, PropType, VNodeData, withDirectives, h } from 'vue'
|
|
30
|
+
import { PropValidator } from 'vue/types/options'
|
|
31
|
+
import { SelectItemKey } from 'vuetify/types'
|
|
32
|
+
|
|
33
|
+
export const defaultMenuProps = {
|
|
34
|
+
closeOnClick: false,
|
|
35
|
+
closeOnContentClick: false,
|
|
36
|
+
disableKeys: true,
|
|
37
|
+
openOnClick: false,
|
|
38
|
+
maxHeight: 304,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Types
|
|
42
|
+
const baseMixins = mixins(
|
|
43
|
+
VTextField,
|
|
44
|
+
Comparable,
|
|
45
|
+
Dependent,
|
|
46
|
+
Filterable
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
interface options extends InstanceType<typeof baseMixins> {
|
|
50
|
+
$refs: {
|
|
51
|
+
menu: InstanceType<typeof VMenu>
|
|
52
|
+
content: HTMLElement
|
|
53
|
+
label: HTMLElement
|
|
54
|
+
input: HTMLInputElement
|
|
55
|
+
'prepend-inner': HTMLElement
|
|
56
|
+
'append-inner': HTMLElement
|
|
57
|
+
prefix: HTMLElement
|
|
58
|
+
suffix: HTMLElement
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* @vue/component */
|
|
63
|
+
export default baseMixins.extend({
|
|
64
|
+
name: 'v-select',
|
|
65
|
+
|
|
66
|
+
$_emitChangeEvent: true,
|
|
67
|
+
$_modelEvent: 'update:modelValue',
|
|
68
|
+
|
|
69
|
+
props: {
|
|
70
|
+
appendIcon: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '$dropdown',
|
|
73
|
+
},
|
|
74
|
+
attach: {
|
|
75
|
+
type: null as unknown as PropType<string | boolean | Element | VNode>,
|
|
76
|
+
default: false,
|
|
77
|
+
},
|
|
78
|
+
auto: Boolean,
|
|
79
|
+
cacheItems: Boolean,
|
|
80
|
+
chips: Boolean,
|
|
81
|
+
clearable: Boolean,
|
|
82
|
+
deletableChips: Boolean,
|
|
83
|
+
disableLookup: Boolean,
|
|
84
|
+
eager: Boolean,
|
|
85
|
+
hideSelected: Boolean,
|
|
86
|
+
items: {
|
|
87
|
+
type: Array,
|
|
88
|
+
default: () => [],
|
|
89
|
+
} as PropValidator<any[]>,
|
|
90
|
+
itemColor: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: 'primary',
|
|
93
|
+
},
|
|
94
|
+
itemDisabled: {
|
|
95
|
+
type: [String, Array, Function] as PropType<SelectItemKey>,
|
|
96
|
+
default: 'disabled',
|
|
97
|
+
},
|
|
98
|
+
itemText: {
|
|
99
|
+
type: [String, Array, Function] as PropType<SelectItemKey>,
|
|
100
|
+
default: 'text',
|
|
101
|
+
},
|
|
102
|
+
itemValue: {
|
|
103
|
+
type: [String, Array, Function] as PropType<SelectItemKey>,
|
|
104
|
+
default: 'value',
|
|
105
|
+
},
|
|
106
|
+
menuProps: {
|
|
107
|
+
type: [String, Array, Object],
|
|
108
|
+
default: () => defaultMenuProps,
|
|
109
|
+
},
|
|
110
|
+
minWidth: [String, Number],
|
|
111
|
+
multiple: Boolean,
|
|
112
|
+
openOnClear: Boolean,
|
|
113
|
+
returnObject: Boolean,
|
|
114
|
+
smallChips: Boolean,
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur', 'keydown', 'click', 'update:list-index', 'click:clear'],
|
|
118
|
+
|
|
119
|
+
data () {
|
|
120
|
+
return {
|
|
121
|
+
cachedItems: this.cacheItems ? this.items : [],
|
|
122
|
+
menuIsBooted: false,
|
|
123
|
+
isMenuActive: false,
|
|
124
|
+
lastItem: 20,
|
|
125
|
+
// As long as a value is defined, show it
|
|
126
|
+
// Otherwise, check if multiple
|
|
127
|
+
// to determine which default to provide
|
|
128
|
+
lazyValue: this.modelValue !== undefined
|
|
129
|
+
? this.modelValue
|
|
130
|
+
: this.multiple ? [] : undefined,
|
|
131
|
+
selectedIndex: -1,
|
|
132
|
+
selectedItems: [] as any[],
|
|
133
|
+
keyboardLookupPrefix: '',
|
|
134
|
+
keyboardLookupLastTime: 0,
|
|
135
|
+
detectedScopeId: null as string | null,
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
computed: {
|
|
140
|
+
/* All items that the select has */
|
|
141
|
+
allItems (): object[] {
|
|
142
|
+
return this.filterDuplicates(this.cachedItems.concat(this.items))
|
|
143
|
+
},
|
|
144
|
+
classes (): object {
|
|
145
|
+
return {
|
|
146
|
+
...VTextField.computed.classes.call(this),
|
|
147
|
+
'v-select': true,
|
|
148
|
+
'v-select--chips': this.hasChips,
|
|
149
|
+
'v-select--chips--small': this.smallChips,
|
|
150
|
+
'v-select--is-menu-active': this.isMenuActive,
|
|
151
|
+
'v-select--is-multi': this.multiple,
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
/* Used by other components to overwrite */
|
|
155
|
+
computedItems (): object[] {
|
|
156
|
+
return this.allItems
|
|
157
|
+
},
|
|
158
|
+
computedOwns (): string {
|
|
159
|
+
return `list-${this.$?.uid}`
|
|
160
|
+
},
|
|
161
|
+
computedCounterValue (): number {
|
|
162
|
+
const value = this.multiple
|
|
163
|
+
? this.selectedItems
|
|
164
|
+
: (this.getText(this.selectedItems[0]) ?? '').toString()
|
|
165
|
+
|
|
166
|
+
if (typeof this.counterValue === 'function') {
|
|
167
|
+
return this.counterValue(value)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return value.length
|
|
171
|
+
},
|
|
172
|
+
directives (): VNodeDirective[] | undefined {
|
|
173
|
+
return [
|
|
174
|
+
[
|
|
175
|
+
ClickOutside,
|
|
176
|
+
{
|
|
177
|
+
handler: () => this.isFocused && this.blur(),
|
|
178
|
+
closeConditional: this.closeConditional,
|
|
179
|
+
include: () => this.getOpenDependentElements(),
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
dynamicHeight () {
|
|
185
|
+
return 'auto'
|
|
186
|
+
},
|
|
187
|
+
hasChips (): boolean {
|
|
188
|
+
return this.chips || this.smallChips
|
|
189
|
+
},
|
|
190
|
+
hasSlot (): boolean {
|
|
191
|
+
return Boolean(this.hasChips || this.$slots.selection)
|
|
192
|
+
},
|
|
193
|
+
isDirty (): boolean {
|
|
194
|
+
return this.selectedItems.length > 0
|
|
195
|
+
},
|
|
196
|
+
listData (): object {
|
|
197
|
+
return {
|
|
198
|
+
id: this.computedOwns,
|
|
199
|
+
action: this.multiple,
|
|
200
|
+
color: this.itemColor,
|
|
201
|
+
dense: this.dense,
|
|
202
|
+
hideSelected: this.hideSelected,
|
|
203
|
+
items: this.virtualizedItems,
|
|
204
|
+
itemDisabled: this.itemDisabled,
|
|
205
|
+
itemText: this.itemText,
|
|
206
|
+
itemValue: this.itemValue,
|
|
207
|
+
noDataText: this.$vuetify.lang.t(this.noDataText),
|
|
208
|
+
selectedItems: this.selectedItems,
|
|
209
|
+
onSelect: this.selectItem,
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
listAttrs (): object {
|
|
213
|
+
const scopeIdAttrs: Record<string, any> = {}
|
|
214
|
+
|
|
215
|
+
// Используем detectedScopeId из mounted hook
|
|
216
|
+
if (this.detectedScopeId) {
|
|
217
|
+
scopeIdAttrs[this.detectedScopeId] = ''
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// scopeId успешно передается в VSelectList
|
|
221
|
+
|
|
222
|
+
return scopeIdAttrs
|
|
223
|
+
},
|
|
224
|
+
staticList (): VNode {
|
|
225
|
+
if (this.$slots['no-data'] || this.$slots['prepend-item'] || this.$slots['append-item']) {
|
|
226
|
+
consoleError('assert: staticList should not be called if slots are used')
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return h(VSelectList, {
|
|
230
|
+
...this.listData,
|
|
231
|
+
...this.listAttrs,
|
|
232
|
+
}, {
|
|
233
|
+
item: this.$slots.item,
|
|
234
|
+
})
|
|
235
|
+
},
|
|
236
|
+
virtualizedItems (): object[] {
|
|
237
|
+
return (this.$_menuProps as any).auto
|
|
238
|
+
? this.computedItems
|
|
239
|
+
: this.computedItems.slice(0, this.lastItem)
|
|
240
|
+
},
|
|
241
|
+
menuCanShow: () => true,
|
|
242
|
+
$_menuProps (): object {
|
|
243
|
+
let normalisedProps = typeof this.menuProps === 'string'
|
|
244
|
+
? this.menuProps.split(',')
|
|
245
|
+
: this.menuProps
|
|
246
|
+
|
|
247
|
+
if (Array.isArray(normalisedProps)) {
|
|
248
|
+
normalisedProps = normalisedProps.reduce((acc, p) => {
|
|
249
|
+
acc[p.trim()] = true
|
|
250
|
+
return acc
|
|
251
|
+
}, {})
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
...defaultMenuProps,
|
|
256
|
+
eager: this.eager,
|
|
257
|
+
modelValue: this.menuCanShow && this.isMenuActive,
|
|
258
|
+
nudgeBottom: normalisedProps.offsetY ? 1 : 0, // convert to int
|
|
259
|
+
auto: this.auto,
|
|
260
|
+
minWidth: this.minWidth,
|
|
261
|
+
...normalisedProps,
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
watch: {
|
|
267
|
+
internalValue: {
|
|
268
|
+
handler (val) {
|
|
269
|
+
this.initialValue = val
|
|
270
|
+
this.setSelectedItems()
|
|
271
|
+
|
|
272
|
+
if (this.multiple) {
|
|
273
|
+
this.$nextTick(() => {
|
|
274
|
+
this.$refs.menu?.updateDimensions()
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
if (this.hideSelected) {
|
|
278
|
+
this.$nextTick(() => {
|
|
279
|
+
this.onScroll()
|
|
280
|
+
})
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
deep: true,
|
|
284
|
+
},
|
|
285
|
+
isMenuActive (val) {
|
|
286
|
+
window.setTimeout(() => this.onMenuActiveChange(val))
|
|
287
|
+
},
|
|
288
|
+
items: {
|
|
289
|
+
immediate: true,
|
|
290
|
+
handler (val) {
|
|
291
|
+
if (this.cacheItems) {
|
|
292
|
+
// Breaks vue-test-utils if
|
|
293
|
+
// this isn't calculated
|
|
294
|
+
// on the next tick
|
|
295
|
+
this.$nextTick(() => {
|
|
296
|
+
this.cachedItems = this.filterDuplicates(this.cachedItems.concat(val))
|
|
297
|
+
})
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
this.setSelectedItems()
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
created () {
|
|
306
|
+
const breakingProps = [
|
|
307
|
+
['value', 'modelValue'],
|
|
308
|
+
['onInput', 'onUpdate:modelValue'],
|
|
309
|
+
]
|
|
310
|
+
|
|
311
|
+
/* istanbul ignore next */
|
|
312
|
+
breakingProps.forEach(([original, replacement]) => {
|
|
313
|
+
if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)
|
|
314
|
+
})
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
mounted () {
|
|
318
|
+
this.$nextTick(() => {
|
|
319
|
+
if (this.$el && this.$el.attributes) {
|
|
320
|
+
const attrs = this.$el.attributes
|
|
321
|
+
for (let i = 0; i < attrs.length; i++) {
|
|
322
|
+
const attr = attrs[i]
|
|
323
|
+
if (attr.name.startsWith('data-v-')) {
|
|
324
|
+
this.detectedScopeId = attr.name
|
|
325
|
+
// scopeId найден и сохранен для использования в dropdown
|
|
326
|
+
break
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
})
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
methods: {
|
|
334
|
+
/** @public */
|
|
335
|
+
blur (e?: Event) {
|
|
336
|
+
VTextField.methods.blur.call(this, e)
|
|
337
|
+
this.isMenuActive = false
|
|
338
|
+
this.isFocused = false
|
|
339
|
+
this.selectedIndex = -1
|
|
340
|
+
this.setMenuIndex(-1)
|
|
341
|
+
},
|
|
342
|
+
/** @public */
|
|
343
|
+
activateMenu () {
|
|
344
|
+
if (
|
|
345
|
+
!this.isInteractive ||
|
|
346
|
+
this.isMenuActive
|
|
347
|
+
) return
|
|
348
|
+
|
|
349
|
+
this.isMenuActive = true
|
|
350
|
+
},
|
|
351
|
+
clearableCallback () {
|
|
352
|
+
this.setValue(this.multiple ? [] : null)
|
|
353
|
+
this.setMenuIndex(-1)
|
|
354
|
+
this.$nextTick(() => this.$refs.input && this.$refs.input.focus())
|
|
355
|
+
|
|
356
|
+
if (this.openOnClear) this.isMenuActive = true
|
|
357
|
+
this.$emit('click:clear')
|
|
358
|
+
},
|
|
359
|
+
closeConditional (e: Event) {
|
|
360
|
+
if (!this.isMenuActive) return true
|
|
361
|
+
|
|
362
|
+
return (
|
|
363
|
+
!this.$.isUnmounted &&
|
|
364
|
+
|
|
365
|
+
// Click originates from outside the menu content
|
|
366
|
+
// Multiple selects don't close when an item is clicked
|
|
367
|
+
(!this.getContent() ||
|
|
368
|
+
!this.getContent().contains(e.target as Node)) &&
|
|
369
|
+
|
|
370
|
+
// Click originates from outside the element
|
|
371
|
+
this.$el &&
|
|
372
|
+
!this.$el.contains(e.target as Node) &&
|
|
373
|
+
e.target !== this.$el
|
|
374
|
+
)
|
|
375
|
+
},
|
|
376
|
+
filterDuplicates (arr: any[]) {
|
|
377
|
+
const uniqueValues = new Map()
|
|
378
|
+
for (let index = 0; index < arr.length; ++index) {
|
|
379
|
+
const item = arr[index]
|
|
380
|
+
|
|
381
|
+
// Do not return null values if existant (#14421)
|
|
382
|
+
if (item == null) {
|
|
383
|
+
continue
|
|
384
|
+
}
|
|
385
|
+
// Do not deduplicate headers or dividers (#12517)
|
|
386
|
+
if (item.header || item.divider) {
|
|
387
|
+
uniqueValues.set(item, item)
|
|
388
|
+
continue
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const val = this.getValue(item)
|
|
392
|
+
|
|
393
|
+
// TODO: comparator
|
|
394
|
+
!uniqueValues.has(val) && uniqueValues.set(val, item)
|
|
395
|
+
}
|
|
396
|
+
return Array.from(uniqueValues.values())
|
|
397
|
+
},
|
|
398
|
+
findExistingIndex (item: object) {
|
|
399
|
+
const itemValue = this.getValue(item)
|
|
400
|
+
|
|
401
|
+
return (this.internalValue || []).findIndex((i: object) => this.valueComparator(this.getValue(i), itemValue))
|
|
402
|
+
},
|
|
403
|
+
getContent () {
|
|
404
|
+
return this.$refs.menu && this.$refs.menu.$refs.content
|
|
405
|
+
},
|
|
406
|
+
genChipSelection (item: object, index: number) {
|
|
407
|
+
const isDisabled = (
|
|
408
|
+
this.isDisabled ||
|
|
409
|
+
this.getDisabled(item)
|
|
410
|
+
)
|
|
411
|
+
const isInteractive = !isDisabled && this.isInteractive
|
|
412
|
+
|
|
413
|
+
return h(VChip, {
|
|
414
|
+
class: 'v-chip--select',
|
|
415
|
+
tabindex: -1,
|
|
416
|
+
close: this.deletableChips && isInteractive,
|
|
417
|
+
disabled: isDisabled,
|
|
418
|
+
modelValue: index === this.selectedIndex,
|
|
419
|
+
small: this.smallChips,
|
|
420
|
+
onClick: (e: MouseEvent) => {
|
|
421
|
+
if (!isInteractive) return
|
|
422
|
+
|
|
423
|
+
e.stopPropagation()
|
|
424
|
+
|
|
425
|
+
this.selectedIndex = index
|
|
426
|
+
},
|
|
427
|
+
'onClick:close': () => this.onChipInput(item),
|
|
428
|
+
key: JSON.stringify(this.getValue(item)),
|
|
429
|
+
}, () => this.getText(item))
|
|
430
|
+
},
|
|
431
|
+
genCommaSelection (item: object, index: number, last: boolean) {
|
|
432
|
+
const color = index === this.selectedIndex && this.computedColor
|
|
433
|
+
const isDisabled = (
|
|
434
|
+
this.isDisabled ||
|
|
435
|
+
this.getDisabled(item)
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
return h('div', this.setTextColor(color, {
|
|
439
|
+
class: ['v-select__selection v-select__selection--comma', {
|
|
440
|
+
'v-select__selection--disabled': isDisabled,
|
|
441
|
+
}],
|
|
442
|
+
key: JSON.stringify(this.getValue(item)),
|
|
443
|
+
}), `${this.getText(item)}${last ? '' : ', '}`)
|
|
444
|
+
},
|
|
445
|
+
genDefaultSlot (): (VNode | VNode[] | null)[] {
|
|
446
|
+
const selections = this.genSelections()
|
|
447
|
+
const input = this.genInput()
|
|
448
|
+
|
|
449
|
+
// If the return is an empty array
|
|
450
|
+
// push the input
|
|
451
|
+
if (Array.isArray(selections)) {
|
|
452
|
+
selections.push(input)
|
|
453
|
+
// Otherwise push it into children
|
|
454
|
+
} else {
|
|
455
|
+
selections.children = selections.children || []
|
|
456
|
+
selections.children.push(input)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return [
|
|
460
|
+
this.genFieldset(),
|
|
461
|
+
withDirectives(h('div', {
|
|
462
|
+
class: 'v-select__slot',
|
|
463
|
+
}, [
|
|
464
|
+
this.genLabel(),
|
|
465
|
+
this.prefix ? this.genAffix('prefix') : null,
|
|
466
|
+
selections,
|
|
467
|
+
this.suffix ? this.genAffix('suffix') : null,
|
|
468
|
+
this.genClearIcon(),
|
|
469
|
+
this.genIconSlot(),
|
|
470
|
+
this.genHiddenInput(),
|
|
471
|
+
]), this.directives),
|
|
472
|
+
this.genMenu(),
|
|
473
|
+
this.genProgress(),
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
genIcon (
|
|
477
|
+
type: string,
|
|
478
|
+
cb?: (e: Event) => void,
|
|
479
|
+
extraData?: VNodeData
|
|
480
|
+
) {
|
|
481
|
+
const icon = VInput.methods.genIcon.call(this, type, cb, extraData)
|
|
482
|
+
|
|
483
|
+
if (type === 'append') {
|
|
484
|
+
// Don't allow the dropdown icon to be focused
|
|
485
|
+
const iconChild = icon.children![0]
|
|
486
|
+
const hasListeners = Object.keys(iconChild.props || {}).some(key => key.startsWith('on'))
|
|
487
|
+
iconChild.props = mergeData(iconChild.props || {}, {
|
|
488
|
+
tabindex: hasListeners ? '-1' : undefined,
|
|
489
|
+
'aria-hidden': 'true',
|
|
490
|
+
'aria-label': undefined,
|
|
491
|
+
})
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
return icon
|
|
495
|
+
},
|
|
496
|
+
genInput (): VNode {
|
|
497
|
+
const input = VTextField.methods.genInput.call(this)
|
|
498
|
+
|
|
499
|
+
delete input.props.name
|
|
500
|
+
|
|
501
|
+
input.props = mergeData(input.props, {
|
|
502
|
+
readonly: true,
|
|
503
|
+
type: 'text',
|
|
504
|
+
'aria-readonly': String(this.isReadonly),
|
|
505
|
+
'aria-activedescendant': getObjectValueByPath(this.$refs.menu, 'activeTile.id'),
|
|
506
|
+
autocomplete: getObjectValueByPath(input.data!, 'attrs.autocomplete', 'off'),
|
|
507
|
+
placeholder: (!this.isDirty && (this.persistentPlaceholder || this.isFocused || !this.hasLabel)) ? this.placeholder : undefined,
|
|
508
|
+
onKeypress: this.onKeyPress,
|
|
509
|
+
})
|
|
510
|
+
|
|
511
|
+
input.props = { ...input.props, value: null }
|
|
512
|
+
input.props = normalizeAttrs(input.props)
|
|
513
|
+
|
|
514
|
+
return input
|
|
515
|
+
},
|
|
516
|
+
genHiddenInput (): VNode {
|
|
517
|
+
let value = this.lazyValue
|
|
518
|
+
|
|
519
|
+
if (this.multiple && Array.isArray(value)) {
|
|
520
|
+
value = value.map(item => {
|
|
521
|
+
if (typeof item === 'object' && item !== null) {
|
|
522
|
+
return this.getValue(item)
|
|
523
|
+
}
|
|
524
|
+
return item
|
|
525
|
+
}).join(',')
|
|
526
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
527
|
+
value = this.getValue(value)
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return h('input', {
|
|
531
|
+
value,
|
|
532
|
+
type: 'hidden',
|
|
533
|
+
name: this.$attrs.name,
|
|
534
|
+
})
|
|
535
|
+
},
|
|
536
|
+
genInputSlot (): VNode {
|
|
537
|
+
const render = VTextField.methods.genInputSlot.call(this)
|
|
538
|
+
|
|
539
|
+
render.props = {
|
|
540
|
+
role: 'button',
|
|
541
|
+
'aria-haspopup': 'listbox',
|
|
542
|
+
'aria-expanded': String(this.isMenuActive),
|
|
543
|
+
'aria-owns': this.computedOwns,
|
|
544
|
+
...render.props,
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return render
|
|
548
|
+
},
|
|
549
|
+
genList (): VNode {
|
|
550
|
+
// If there's no slots, we can use a cached VNode to improve performance
|
|
551
|
+
if (this.$slots['no-data'] || this.$slots['prepend-item'] || this.$slots['append-item']) {
|
|
552
|
+
return this.genListWithSlot()
|
|
553
|
+
} else {
|
|
554
|
+
return this.staticList
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
genListWithSlot (): VNode {
|
|
558
|
+
const slots = Object.fromEntries(['prepend-item', 'no-data', 'append-item']
|
|
559
|
+
.filter(slotName => this.$slots[slotName])
|
|
560
|
+
.map(slotName => [
|
|
561
|
+
slotName,
|
|
562
|
+
this.$slots[slotName],
|
|
563
|
+
]
|
|
564
|
+
))
|
|
565
|
+
// Requires destructuring due to Vue
|
|
566
|
+
// modifying the `on` property when passed
|
|
567
|
+
// as a referenced object
|
|
568
|
+
return h(VSelectList, {
|
|
569
|
+
...this.listData,
|
|
570
|
+
...this.listAttrs,
|
|
571
|
+
}, { ...slots, item: this.$slots.item })
|
|
572
|
+
},
|
|
573
|
+
genMenu (): VNode {
|
|
574
|
+
const props = this.$_menuProps as any
|
|
575
|
+
props.activator = this.$refs['input-slot']
|
|
576
|
+
|
|
577
|
+
if ('attach' in props) void 0
|
|
578
|
+
else if (
|
|
579
|
+
// TODO: make this a computed property or helper or something
|
|
580
|
+
this.attach === '' || // If used as a boolean prop (<v-menu attach>)
|
|
581
|
+
this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
|
|
582
|
+
this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
|
|
583
|
+
) {
|
|
584
|
+
// Attach to root el so that
|
|
585
|
+
// menu covers prepend/append icons
|
|
586
|
+
props.attach = this.$el
|
|
587
|
+
} else {
|
|
588
|
+
props.attach = this.attach
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return h(VMenu, {
|
|
592
|
+
role: undefined,
|
|
593
|
+
...props,
|
|
594
|
+
'onUpdate:modelValue': (val: boolean) => {
|
|
595
|
+
this.isMenuActive = val
|
|
596
|
+
this.isFocused = val
|
|
597
|
+
},
|
|
598
|
+
onScroll: this.onScroll,
|
|
599
|
+
ref: 'menu',
|
|
600
|
+
}, () => [this.genList()])
|
|
601
|
+
},
|
|
602
|
+
genSelections (): VNode {
|
|
603
|
+
let length = this.selectedItems.length
|
|
604
|
+
|
|
605
|
+
const children = new Array(length)
|
|
606
|
+
|
|
607
|
+
let genSelection
|
|
608
|
+
if (this.$slots.selection) {
|
|
609
|
+
genSelection = this.genSlotSelection
|
|
610
|
+
} else if (this.hasChips) {
|
|
611
|
+
genSelection = this.genChipSelection
|
|
612
|
+
} else {
|
|
613
|
+
genSelection = this.genCommaSelection
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
while (length--) {
|
|
617
|
+
children[length] = genSelection(
|
|
618
|
+
this.selectedItems[length],
|
|
619
|
+
length,
|
|
620
|
+
length === children.length - 1
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return h('div', {
|
|
625
|
+
class: 'v-select__selections',
|
|
626
|
+
}, children)
|
|
627
|
+
},
|
|
628
|
+
genSlotSelection (item: object, index: number): VNode[] | undefined {
|
|
629
|
+
return this.$slots.selection!({
|
|
630
|
+
class: 'v-chip--select',
|
|
631
|
+
parent: this,
|
|
632
|
+
item,
|
|
633
|
+
index,
|
|
634
|
+
onSelect: (e: Event) => {
|
|
635
|
+
e.stopPropagation()
|
|
636
|
+
this.selectedIndex = index
|
|
637
|
+
},
|
|
638
|
+
selected: index === this.selectedIndex,
|
|
639
|
+
disabled: !this.isInteractive,
|
|
640
|
+
})
|
|
641
|
+
},
|
|
642
|
+
getMenuIndex () {
|
|
643
|
+
return this.$refs.menu ? (this.$refs.menu as { [key: string]: any }).listIndex : -1
|
|
644
|
+
},
|
|
645
|
+
getDisabled (item: object) {
|
|
646
|
+
return getPropertyFromItem(item, this.itemDisabled, false)
|
|
647
|
+
},
|
|
648
|
+
getText (item: object) {
|
|
649
|
+
return getPropertyFromItem(item, this.itemText, item)
|
|
650
|
+
},
|
|
651
|
+
getValue (item: object) {
|
|
652
|
+
return getPropertyFromItem(item, this.itemValue, this.getText(item))
|
|
653
|
+
},
|
|
654
|
+
onBlur (e?: Event) {
|
|
655
|
+
e && this.$emit('blur', e)
|
|
656
|
+
},
|
|
657
|
+
onChipInput (item: object) {
|
|
658
|
+
if (this.multiple) this.selectItem(item)
|
|
659
|
+
else this.setValue(null)
|
|
660
|
+
// If all items have been deleted,
|
|
661
|
+
// open `v-menu`
|
|
662
|
+
if (this.selectedItems.length === 0) {
|
|
663
|
+
this.isMenuActive = true
|
|
664
|
+
} else {
|
|
665
|
+
this.isMenuActive = false
|
|
666
|
+
}
|
|
667
|
+
this.selectedIndex = -1
|
|
668
|
+
},
|
|
669
|
+
onClick (e: MouseEvent) {
|
|
670
|
+
if (!this.isInteractive) return
|
|
671
|
+
|
|
672
|
+
if (!this.isAppendInner(e.target)) {
|
|
673
|
+
this.isMenuActive = true
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (!this.isFocused) {
|
|
677
|
+
this.isFocused = true
|
|
678
|
+
this.$emit('focus')
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
this.$emit('click', e)
|
|
682
|
+
},
|
|
683
|
+
onEscDown (e: Event) {
|
|
684
|
+
e.preventDefault()
|
|
685
|
+
if (this.isMenuActive) {
|
|
686
|
+
e.stopPropagation()
|
|
687
|
+
this.isMenuActive = false
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
onKeyPress (e: KeyboardEvent) {
|
|
691
|
+
if (
|
|
692
|
+
this.multiple ||
|
|
693
|
+
!this.isInteractive ||
|
|
694
|
+
this.disableLookup ||
|
|
695
|
+
e.key.length > 1 ||
|
|
696
|
+
e.ctrlKey || e.metaKey || e.altKey
|
|
697
|
+
) return
|
|
698
|
+
|
|
699
|
+
const KEYBOARD_LOOKUP_THRESHOLD = 1000 // milliseconds
|
|
700
|
+
const now = performance.now()
|
|
701
|
+
if (now - this.keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {
|
|
702
|
+
this.keyboardLookupPrefix = ''
|
|
703
|
+
}
|
|
704
|
+
this.keyboardLookupPrefix += e.key.toLowerCase()
|
|
705
|
+
this.keyboardLookupLastTime = now
|
|
706
|
+
|
|
707
|
+
const index = this.allItems.findIndex(item => {
|
|
708
|
+
const text = (this.getText(item) ?? '').toString()
|
|
709
|
+
|
|
710
|
+
return text.toLowerCase().startsWith(this.keyboardLookupPrefix)
|
|
711
|
+
})
|
|
712
|
+
const item = this.allItems[index]
|
|
713
|
+
if (index !== -1) {
|
|
714
|
+
this.lastItem = Math.max(this.lastItem, index + 5)
|
|
715
|
+
this.setValue(this.returnObject ? item : this.getValue(item))
|
|
716
|
+
this.$nextTick(() => this.$refs.menu.getTiles())
|
|
717
|
+
setTimeout(() => this.setMenuIndex(index))
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
onKeyDown (e: KeyboardEvent) {
|
|
721
|
+
if (this.isReadonly && e.keyCode !== keyCodes.tab) return
|
|
722
|
+
|
|
723
|
+
const keyCode = e.keyCode
|
|
724
|
+
const menu = this.$refs.menu
|
|
725
|
+
|
|
726
|
+
this.$emit('keydown', e)
|
|
727
|
+
|
|
728
|
+
if (!menu) return
|
|
729
|
+
|
|
730
|
+
// If menu is active, allow default
|
|
731
|
+
// listIndex change from menu
|
|
732
|
+
if (this.isMenuActive && [keyCodes.up, keyCodes.down, keyCodes.home, keyCodes.end, keyCodes.enter].includes(keyCode)) {
|
|
733
|
+
this.$nextTick(() => {
|
|
734
|
+
menu.changeListIndex(e)
|
|
735
|
+
this.$emit('update:list-index', menu.listIndex)
|
|
736
|
+
})
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// If enter, space, open menu
|
|
740
|
+
if ([
|
|
741
|
+
keyCodes.enter,
|
|
742
|
+
keyCodes.space,
|
|
743
|
+
].includes(keyCode)) this.activateMenu()
|
|
744
|
+
|
|
745
|
+
// If menu is not active, up/down/home/end can do
|
|
746
|
+
// one of 2 things. If multiple, opens the
|
|
747
|
+
// menu, if not, will cycle through all
|
|
748
|
+
// available options
|
|
749
|
+
if (
|
|
750
|
+
!this.isMenuActive &&
|
|
751
|
+
[keyCodes.up, keyCodes.down, keyCodes.home, keyCodes.end].includes(keyCode)
|
|
752
|
+
) return this.onUpDown(e)
|
|
753
|
+
|
|
754
|
+
// If escape deactivate the menu
|
|
755
|
+
if (keyCode === keyCodes.esc) return this.onEscDown(e)
|
|
756
|
+
|
|
757
|
+
// If tab - select item or close menu
|
|
758
|
+
if (keyCode === keyCodes.tab) return this.onTabDown(e)
|
|
759
|
+
|
|
760
|
+
// If space preventDefault
|
|
761
|
+
if (keyCode === keyCodes.space) return this.onSpaceDown(e)
|
|
762
|
+
},
|
|
763
|
+
onMenuActiveChange (val: boolean) {
|
|
764
|
+
// If menu is closing and mulitple
|
|
765
|
+
// or menuIndex is already set
|
|
766
|
+
// skip menu index recalculation
|
|
767
|
+
if (
|
|
768
|
+
(this.multiple && !val) ||
|
|
769
|
+
this.getMenuIndex() > -1
|
|
770
|
+
) return
|
|
771
|
+
|
|
772
|
+
const menu = this.$refs.menu
|
|
773
|
+
|
|
774
|
+
if (!menu || !this.isDirty) return
|
|
775
|
+
|
|
776
|
+
// When menu opens, set index of first active item
|
|
777
|
+
this.$refs.menu.getTiles()
|
|
778
|
+
for (let i = 0; i < menu.tiles.length; i++) {
|
|
779
|
+
if (menu.tiles[i].getAttribute('aria-selected') === 'true') {
|
|
780
|
+
this.setMenuIndex(i)
|
|
781
|
+
break
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
onMouseUp (e: MouseEvent) {
|
|
786
|
+
// eslint-disable-next-line sonarjs/no-collapsible-if
|
|
787
|
+
if (
|
|
788
|
+
this.hasMouseDown &&
|
|
789
|
+
e.which !== 3 &&
|
|
790
|
+
this.isInteractive
|
|
791
|
+
) {
|
|
792
|
+
// If append inner is present
|
|
793
|
+
// and the target is itself
|
|
794
|
+
// or inside, toggle menu
|
|
795
|
+
if (this.isAppendInner(e.target)) {
|
|
796
|
+
this.$nextTick(() => (this.isMenuActive = !this.isMenuActive))
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
VTextField.methods.onMouseUp.call(this, e)
|
|
801
|
+
},
|
|
802
|
+
onScroll () {
|
|
803
|
+
if (!this.isMenuActive) {
|
|
804
|
+
requestAnimationFrame(() => {
|
|
805
|
+
const content = this.getContent()
|
|
806
|
+
if (content) content.scrollTop = 0
|
|
807
|
+
})
|
|
808
|
+
} else {
|
|
809
|
+
if (this.lastItem > this.computedItems.length) return
|
|
810
|
+
|
|
811
|
+
const showMoreItems = (
|
|
812
|
+
this.getContent().scrollHeight -
|
|
813
|
+
(this.getContent().scrollTop +
|
|
814
|
+
this.getContent().clientHeight)
|
|
815
|
+
) < 200
|
|
816
|
+
|
|
817
|
+
if (showMoreItems) {
|
|
818
|
+
this.lastItem += 20
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
onSpaceDown (e: KeyboardEvent) {
|
|
823
|
+
e.preventDefault()
|
|
824
|
+
},
|
|
825
|
+
onTabDown (e: KeyboardEvent) {
|
|
826
|
+
const menu = this.$refs.menu
|
|
827
|
+
|
|
828
|
+
if (!menu) return
|
|
829
|
+
|
|
830
|
+
const activeTile = menu.activeTile
|
|
831
|
+
|
|
832
|
+
// An item that is selected by
|
|
833
|
+
// menu-index should toggled
|
|
834
|
+
if (
|
|
835
|
+
!this.multiple &&
|
|
836
|
+
activeTile &&
|
|
837
|
+
this.isMenuActive
|
|
838
|
+
) {
|
|
839
|
+
e.preventDefault()
|
|
840
|
+
e.stopPropagation()
|
|
841
|
+
|
|
842
|
+
activeTile.click()
|
|
843
|
+
} else {
|
|
844
|
+
// If we make it here,
|
|
845
|
+
// the user has no selected indexes
|
|
846
|
+
// and is probably tabbing out
|
|
847
|
+
this.blur(e)
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
onUpDown (e: KeyboardEvent) {
|
|
851
|
+
const menu = this.$refs.menu
|
|
852
|
+
|
|
853
|
+
if (!menu) return
|
|
854
|
+
|
|
855
|
+
e.preventDefault()
|
|
856
|
+
|
|
857
|
+
// Multiple selects do not cycle their value
|
|
858
|
+
// when pressing up or down, instead activate
|
|
859
|
+
// the menu
|
|
860
|
+
if (this.multiple) return this.activateMenu()
|
|
861
|
+
|
|
862
|
+
const keyCode = e.keyCode
|
|
863
|
+
|
|
864
|
+
// Cycle through available values to achieve
|
|
865
|
+
// select native behavior
|
|
866
|
+
menu.isBooted = true
|
|
867
|
+
|
|
868
|
+
window.requestAnimationFrame(() => {
|
|
869
|
+
menu.getTiles()
|
|
870
|
+
|
|
871
|
+
if (!menu.hasClickableTiles) return this.activateMenu()
|
|
872
|
+
|
|
873
|
+
switch (keyCode) {
|
|
874
|
+
case keyCodes.up:
|
|
875
|
+
menu.prevTile()
|
|
876
|
+
break
|
|
877
|
+
case keyCodes.down:
|
|
878
|
+
menu.nextTile()
|
|
879
|
+
break
|
|
880
|
+
case keyCodes.home:
|
|
881
|
+
menu.firstTile()
|
|
882
|
+
break
|
|
883
|
+
case keyCodes.end:
|
|
884
|
+
menu.lastTile()
|
|
885
|
+
break
|
|
886
|
+
}
|
|
887
|
+
this.selectItem(this.allItems[this.getMenuIndex()])
|
|
888
|
+
})
|
|
889
|
+
},
|
|
890
|
+
selectItem (item: object) {
|
|
891
|
+
if (!this.multiple) {
|
|
892
|
+
this.setValue(this.returnObject ? item : this.getValue(item))
|
|
893
|
+
this.isMenuActive = false
|
|
894
|
+
} else {
|
|
895
|
+
const internalValue = (this.internalValue || []).slice()
|
|
896
|
+
const i = this.findExistingIndex(item)
|
|
897
|
+
|
|
898
|
+
i !== -1 ? internalValue.splice(i, 1) : internalValue.push(item)
|
|
899
|
+
this.setValue(internalValue.map((i: object) => {
|
|
900
|
+
return this.returnObject ? i : this.getValue(i)
|
|
901
|
+
}))
|
|
902
|
+
|
|
903
|
+
// There is no item to re-highlight
|
|
904
|
+
// when selections are hidden
|
|
905
|
+
if (this.hideSelected) {
|
|
906
|
+
this.setMenuIndex(-1)
|
|
907
|
+
} else {
|
|
908
|
+
const index = this.computedItems.indexOf(item)
|
|
909
|
+
if (~index) {
|
|
910
|
+
this.$nextTick(() => this.$refs.menu.getTiles())
|
|
911
|
+
setTimeout(() => this.setMenuIndex(index))
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
setMenuIndex (index: number) {
|
|
917
|
+
this.$refs.menu && ((this.$refs.menu as { [key: string]: any }).listIndex = index)
|
|
918
|
+
},
|
|
919
|
+
setSelectedItems () {
|
|
920
|
+
const selectedItems = []
|
|
921
|
+
const values = !this.multiple || !Array.isArray(this.internalValue)
|
|
922
|
+
? [this.internalValue]
|
|
923
|
+
: this.internalValue
|
|
924
|
+
|
|
925
|
+
for (const value of values) {
|
|
926
|
+
const index = this.allItems.findIndex(v => this.valueComparator(
|
|
927
|
+
this.getValue(v),
|
|
928
|
+
this.getValue(value)
|
|
929
|
+
))
|
|
930
|
+
|
|
931
|
+
if (index > -1) {
|
|
932
|
+
selectedItems.push(this.allItems[index])
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
this.selectedItems = selectedItems
|
|
937
|
+
},
|
|
938
|
+
setValue (value: any) {
|
|
939
|
+
if (!this.valueComparator(value, this.internalValue)) {
|
|
940
|
+
this.internalValue = value
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
isAppendInner (target: any) {
|
|
944
|
+
// return true if append inner is present
|
|
945
|
+
// and the target is itself or inside
|
|
946
|
+
const appendInner = this.$refs['append-inner']
|
|
947
|
+
|
|
948
|
+
return appendInner && (appendInner === target || appendInner.contains(target))
|
|
949
|
+
},
|
|
950
|
+
},
|
|
951
|
+
})
|