vuetify 3.2.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_component-variables-labs.sass +1 -0
- package/dist/json/attributes.json +2503 -2151
- package/dist/json/importMap-labs.json +12 -4
- package/dist/json/importMap.json +28 -28
- package/dist/json/tags.json +107 -9
- package/dist/json/web-types.json +10785 -7110
- package/dist/vuetify-labs.css +263 -153
- package/dist/vuetify-labs.d.ts +35870 -16257
- package/dist/vuetify-labs.esm.js +1466 -934
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +1465 -933
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +246 -168
- package/dist/vuetify.d.ts +27883 -14061
- package/dist/vuetify.esm.js +477 -300
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +476 -299
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +811 -806
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/{index.d.ts → index.d.mts} +5 -1
- package/lib/blueprints/{md1.d.ts → md1.d.mts} +5 -1
- package/lib/blueprints/{md2.d.ts → md2.d.mts} +5 -1
- package/lib/blueprints/{md3.d.ts → md3.d.mts} +5 -1
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/{index.d.ts → index.d.mts} +284 -69
- package/lib/components/VApp/{index.d.ts → index.d.mts} +80 -19
- package/lib/components/VAppBar/{index.d.ts → index.d.mts} +391 -119
- package/lib/components/VAutocomplete/VAutocomplete.css +15 -9
- package/lib/components/VAutocomplete/VAutocomplete.mjs +82 -34
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +15 -11
- package/lib/components/VAutocomplete/index.d.mts +2048 -0
- package/lib/components/VAvatar/{index.d.ts → index.d.mts} +85 -30
- package/lib/components/VBadge/_variables.scss +1 -1
- package/lib/components/VBadge/{index.d.ts → index.d.mts} +105 -42
- package/lib/components/VBanner/{index.d.ts → index.d.mts} +282 -63
- package/lib/components/VBottomNavigation/{index.d.ts → index.d.mts} +93 -45
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/{index.d.ts → index.d.mts} +348 -212
- package/lib/components/VBtn/{index.d.ts → index.d.mts} +139 -53
- package/lib/components/VBtnGroup/{index.d.ts → index.d.mts} +84 -27
- package/lib/components/VBtnToggle/{index.d.ts → index.d.mts} +88 -35
- package/lib/components/VCalendar/util/props.mjs.map +1 -1
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/{index.d.ts → index.d.mts} +957 -419
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/{index.d.ts → index.d.mts} +616 -111
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +3 -3
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/{index.d.ts → index.d.mts} +408 -141
- package/lib/components/VChip/VChip.css +4 -2
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +3 -2
- package/lib/components/VChip/{index.d.ts → index.d.mts} +376 -85
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +470 -0
- package/lib/components/VCode/{index.d.ts → index.d.mts} +78 -17
- package/lib/components/VColorPicker/VColorPicker.mjs +9 -4
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +5 -4
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/{index.d.ts → index.d.mts} +241 -109
- package/lib/components/VColorPicker/util/index.mjs +2 -22
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +15 -9
- package/lib/components/VCombobox/VCombobox.mjs +82 -37
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +15 -11
- package/lib/components/VCombobox/index.d.mts +2060 -0
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/{index.d.ts → index.d.mts} +105 -45
- package/lib/components/VDefaultsProvider/{index.d.ts → index.d.mts} +82 -20
- package/lib/components/VDialog/{index.d.ts → index.d.mts} +571 -305
- package/lib/components/VDivider/{index.d.ts → index.d.mts} +81 -21
- package/lib/components/VExpansionPanel/{index.d.ts → index.d.mts} +374 -110
- package/lib/components/VField/VField.css +49 -16
- package/lib/components/VField/VField.mjs +12 -2
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +40 -11
- package/lib/components/VField/_variables.scss +8 -2
- package/lib/components/VField/index.d.mts +682 -0
- package/lib/components/VFileInput/VFileInput.css +3 -0
- package/lib/components/VFileInput/VFileInput.mjs +7 -1
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +6 -1
- package/lib/components/VFileInput/{index.d.ts → index.d.mts} +1033 -399
- package/lib/components/VFooter/{index.d.ts → index.d.mts} +85 -29
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.d.mts +993 -0
- package/lib/components/VGrid/{index.d.ts → index.d.mts} +334 -100
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/{index.d.ts → index.d.mts} +120 -37
- package/lib/components/VIcon/{index.d.ts → index.d.mts} +322 -81
- package/lib/components/VImg/VImg.css +2 -4
- package/lib/components/VImg/VImg.mjs +25 -24
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +4 -3
- package/lib/components/VImg/{index.d.ts → index.d.mts} +177 -40
- package/lib/components/VInput/VInput.css +10 -4
- package/lib/components/VInput/VInput.mjs +9 -3
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +7 -2
- package/lib/components/VInput/_variables.scss +1 -0
- package/lib/components/VInput/{index.d.ts → index.d.mts} +237 -93
- package/lib/components/VItemGroup/VItem.mjs +1 -1
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +781 -0
- package/lib/components/VKbd/{index.d.ts → index.d.mts} +78 -17
- package/lib/components/VLabel/{index.d.ts → index.d.mts} +79 -18
- package/lib/components/VLayout/{index.d.ts → index.d.mts} +161 -42
- package/lib/components/VLazy/{index.d.ts → index.d.mts} +82 -27
- package/lib/components/VList/VList.mjs +6 -1
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListChildren.mjs +4 -8
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +3 -0
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListItem.mjs +11 -6
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/{index.d.ts → index.d.mts} +1245 -619
- package/lib/components/VLocaleProvider/{index.d.ts → index.d.mts} +80 -19
- package/lib/components/VMain/{index.d.ts → index.d.mts} +79 -19
- package/lib/components/VMenu/{index.d.ts → index.d.mts} +567 -299
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/{index.d.ts → index.d.mts} +87 -34
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +2 -0
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +2 -0
- package/lib/components/VNavigationDrawer/{index.d.ts → index.d.mts} +139 -57
- package/lib/components/VOverlay/{index.d.ts → index.d.mts} +159 -75
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/{index.d.ts → index.d.mts} +229 -125
- package/lib/components/VParallax/{index.d.ts → index.d.mts} +118 -18
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/{index.d.ts → index.d.mts} +148 -45
- package/lib/components/VProgressLinear/{index.d.ts → index.d.mts} +119 -52
- package/lib/components/VRadio/{index.d.ts → index.d.mts} +139 -40
- package/lib/components/VRadioGroup/{index.d.ts → index.d.mts} +265 -93
- package/lib/components/VRangeSlider/VRangeSlider.mjs +4 -4
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/{index.d.ts → index.d.mts} +313 -132
- package/lib/components/VRating/{index.d.ts → index.d.mts} +108 -49
- package/lib/components/VResponsive/VResponsive.css +13 -5
- package/lib/components/VResponsive/VResponsive.mjs +4 -1
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.sass +12 -4
- package/lib/components/VResponsive/{index.d.ts → index.d.mts} +99 -16
- package/lib/components/VSelect/VSelect.css +15 -9
- package/lib/components/VSelect/VSelect.mjs +23 -18
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +14 -11
- package/lib/components/VSelect/index.d.mts +1986 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +403 -0
- package/lib/components/VSelectionControlGroup/{index.d.ts → index.d.mts} +90 -38
- package/lib/components/VSheet/{index.d.ts → index.d.mts} +81 -21
- package/lib/components/VSlideGroup/{index.d.ts → index.d.mts} +236 -61
- package/lib/components/VSlider/VSlider.mjs +2 -2
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.mjs +1 -1
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/{index.d.ts → index.d.mts} +308 -126
- package/lib/components/VSlider/slider.mjs +8 -2
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/{index.d.ts → index.d.mts} +566 -297
- package/lib/components/VSwitch/VSwitch.css +3 -3
- package/lib/components/VSwitch/VSwitch.sass +4 -3
- package/lib/components/VSwitch/{index.d.ts → index.d.mts} +284 -101
- package/lib/components/VSystemBar/{index.d.ts → index.d.mts} +84 -27
- package/lib/components/VTable/{index.d.ts → index.d.mts} +122 -26
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/{index.d.ts → index.d.mts} +203 -113
- package/lib/components/VTextField/VTextField.css +9 -1
- package/lib/components/VTextField/VTextField.mjs +4 -2
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +8 -1
- package/lib/components/VTextField/index.d.mts +2735 -0
- package/lib/components/VTextarea/VTextarea.mjs +13 -4
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/{index.d.ts → index.d.mts} +933 -393
- package/lib/components/VThemeProvider/{index.d.ts → index.d.mts} +80 -20
- package/lib/components/VTimeline/{index.d.ts → index.d.mts} +201 -62
- package/lib/components/VToolbar/{index.d.ts → index.d.mts} +325 -73
- package/lib/components/VTooltip/{index.d.ts → index.d.mts} +568 -297
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.mts +634 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.d.mts +229 -0
- package/lib/components/VWindow/{index.d.ts → index.d.mts} +271 -68
- package/lib/components/{index.d.ts → index.d.mts} +27847 -14031
- package/lib/components/index.mjs +2 -3
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/{index.d.ts → index.d.mts} +1330 -355
- package/lib/composables/display.mjs +6 -6
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/filter.mjs +5 -4
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/form.mjs +2 -3
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRefs.mjs.map +1 -1
- package/lib/composables/group.mjs +13 -13
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/{items.mjs → list-items.mjs} +9 -6
- package/lib/composables/list-items.mjs.map +1 -0
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/scroll.mjs +2 -2
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/validation.mjs +44 -16
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/framework.mjs.map +1 -1
- package/lib/{index.d.ts → index.d.mts} +16 -10
- package/lib/labs/VBottomSheet/VBottomSheet.css +33 -0
- package/lib/labs/VBottomSheet/VBottomSheet.mjs +40 -0
- package/lib/labs/VBottomSheet/VBottomSheet.mjs.map +1 -0
- package/lib/labs/VBottomSheet/VBottomSheet.sass +37 -0
- package/lib/labs/VBottomSheet/_variables.scss +5 -0
- package/lib/labs/VBottomSheet/index.d.mts +871 -0
- package/lib/labs/VBottomSheet/index.mjs +2 -0
- package/lib/labs/VBottomSheet/index.mjs.map +1 -0
- package/lib/labs/VDataIterator/VDataIterator.mjs +160 -0
- package/lib/labs/VDataIterator/VDataIterator.mjs.map +1 -0
- package/lib/labs/VDataIterator/composables/items.mjs +37 -0
- package/lib/labs/VDataIterator/composables/items.mjs.map +1 -0
- package/lib/labs/VDataIterator/index.d.mts +704 -0
- package/lib/labs/VDataIterator/index.mjs +2 -0
- package/lib/labs/VDataIterator/index.mjs.map +1 -0
- package/lib/labs/VDataTable/VDataTable.mjs +58 -20
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableFooter.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableGroupHeaderRow.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableHeaders.mjs +17 -10
- package/lib/labs/VDataTable/VDataTableHeaders.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +50 -14
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +50 -13
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/expand.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/group.mjs +8 -6
- package/lib/labs/VDataTable/composables/group.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/headers.mjs +2 -3
- package/lib/labs/VDataTable/composables/headers.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/items.mjs +31 -32
- package/lib/labs/VDataTable/composables/items.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/paginate.mjs +14 -2
- package/lib/labs/VDataTable/composables/paginate.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/select.mjs +3 -3
- package/lib/labs/VDataTable/composables/select.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/sort.mjs +17 -17
- package/lib/labs/VDataTable/composables/sort.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/virtual.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.mts +9681 -0
- package/lib/labs/VDataTable/index.mjs +1 -1
- package/lib/labs/VDataTable/index.mjs.map +1 -1
- package/lib/labs/VDataTable/types.mjs.map +1 -1
- package/lib/labs/VInfiniteScroll/VInfiniteScroll.mjs.map +1 -1
- package/lib/labs/VInfiniteScroll/{index.d.ts → index.d.mts} +161 -54
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/{index.d.ts → index.d.mts} +92 -31
- package/lib/labs/components.d.mts +11806 -0
- package/lib/labs/components.mjs +2 -0
- package/lib/labs/components.mjs.map +1 -1
- package/lib/labs/date/date.mjs.map +1 -1
- package/lib/labs/date/index.d.mts +70 -0
- package/lib/labs/date/index.mjs +1 -1
- package/lib/labs/date/index.mjs.map +1 -1
- package/lib/styles/settings/_variables.scss +3 -3
- package/lib/util/colorUtils.mjs +68 -3
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/console.mjs +12 -81
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs +4 -18
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/propsFactory.mjs +2 -0
- package/lib/util/propsFactory.mjs.map +1 -1
- package/package.json +13 -9
- package/lib/components/VAutocomplete/index.d.ts +0 -2050
- package/lib/components/VBottomSheet/VBottomSheet.mjs +0 -29
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +0 -1
- package/lib/components/VBottomSheet/VBottomSheet.sass +0 -23
- package/lib/components/VBottomSheet/_variables.scss +0 -3
- package/lib/components/VBottomSheet/index.mjs +0 -4
- package/lib/components/VBottomSheet/index.mjs.map +0 -1
- package/lib/components/VChipGroup/index.d.ts +0 -280
- package/lib/components/VCombobox/index.d.ts +0 -2086
- package/lib/components/VData/VData.mjs +0 -374
- package/lib/components/VData/VData.mjs.map +0 -1
- package/lib/components/VData/index.mjs +0 -4
- package/lib/components/VData/index.mjs.map +0 -1
- package/lib/components/VDataIterator/VDataFooter.mjs +0 -194
- package/lib/components/VDataIterator/VDataFooter.mjs.map +0 -1
- package/lib/components/VDataIterator/VDataFooter.sass +0 -71
- package/lib/components/VDataIterator/VDataIterator.mjs +0 -316
- package/lib/components/VDataIterator/VDataIterator.mjs.map +0 -1
- package/lib/components/VDataIterator/_variables.scss +0 -13
- package/lib/components/VDataIterator/index.mjs +0 -10
- package/lib/components/VDataIterator/index.mjs.map +0 -1
- package/lib/components/VField/index.d.ts +0 -563
- package/lib/components/VForm/index.d.ts +0 -284
- package/lib/components/VItemGroup/index.d.ts +0 -396
- package/lib/components/VSelect/index.d.ts +0 -1981
- package/lib/components/VSelectionControl/index.d.ts +0 -387
- package/lib/components/VTextField/index.d.ts +0 -2061
- package/lib/components/VValidation/index.d.ts +0 -243
- package/lib/components/VVirtualScroll/index.d.ts +0 -197
- package/lib/composables/items.mjs.map +0 -1
- package/lib/labs/VDataTable/index.d.ts +0 -5415
- package/lib/labs/components.d.ts +0 -5945
- package/lib/labs/date/index.d.ts +0 -38
- /package/lib/components/VNoSsr/{index.d.ts → index.d.mts} +0 -0
- /package/lib/directives/{index.d.ts → index.d.mts} +0 -0
- /package/lib/iconsets/{fa-svg.d.ts → fa-svg.d.mts} +0 -0
- /package/lib/iconsets/{fa.d.ts → fa.d.mts} +0 -0
- /package/lib/iconsets/{fa4.d.ts → fa4.d.mts} +0 -0
- /package/lib/iconsets/{md.d.ts → md.d.mts} +0 -0
- /package/lib/iconsets/{mdi-svg.d.ts → mdi-svg.d.mts} +0 -0
- /package/lib/iconsets/{mdi.d.ts → mdi.d.mts} +0 -0
- /package/lib/labs/date/adapters/{vuetify.d.ts → vuetify.d.mts} +0 -0
- /package/lib/locale/adapters/{vue-i18n.d.ts → vue-i18n.d.mts} +0 -0
- /package/lib/locale/adapters/{vuetify.d.ts → vuetify.d.mts} +0 -0
- /package/lib/locale/{index.d.ts → index.d.mts} +0 -0
package/dist/vuetify-labs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.
|
|
2
|
+
* Vuetify v3.3.0
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
function keys(o) {
|
|
172
172
|
return Object.keys(o);
|
|
173
173
|
}
|
|
174
|
+
function has(obj, key) {
|
|
175
|
+
return key.every(k => obj.hasOwnProperty(k));
|
|
176
|
+
}
|
|
174
177
|
function pick(obj, paths, exclude) {
|
|
175
178
|
const found = Object.create(null);
|
|
176
179
|
const rest = Object.create(null);
|
|
@@ -386,6 +389,7 @@
|
|
|
386
389
|
if (_el) _el.focus();else focusChild(el, location === 'next' ? 'first' : 'last');
|
|
387
390
|
}
|
|
388
391
|
}
|
|
392
|
+
function noop() {}
|
|
389
393
|
|
|
390
394
|
const block = ['top', 'bottom'];
|
|
391
395
|
const inline = ['start', 'end', 'left', 'right'];
|
|
@@ -538,79 +542,16 @@
|
|
|
538
542
|
}
|
|
539
543
|
|
|
540
544
|
/* eslint-disable no-console */
|
|
541
|
-
// import Vuetify from '../framework'
|
|
542
|
-
|
|
543
|
-
function createMessage(message, vm, parent) {
|
|
544
|
-
// if (Vuetify.config.silent) return
|
|
545
545
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
__isVue: true,
|
|
549
|
-
$parent: parent,
|
|
550
|
-
$options: vm
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
if (vm) {
|
|
554
|
-
// Only show each message once per instance
|
|
555
|
-
vm.$_alreadyWarned = vm.$_alreadyWarned || [];
|
|
556
|
-
if (vm.$_alreadyWarned.includes(message)) return;
|
|
557
|
-
vm.$_alreadyWarned.push(message);
|
|
558
|
-
}
|
|
559
|
-
return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');
|
|
560
|
-
}
|
|
561
|
-
function consoleWarn(message, vm, parent) {
|
|
562
|
-
const newMessage = createMessage(message, vm, parent);
|
|
563
|
-
newMessage != null && console.warn(newMessage);
|
|
546
|
+
function consoleWarn(message) {
|
|
547
|
+
vue.warn(`Vuetify: ${message}`);
|
|
564
548
|
}
|
|
565
|
-
function consoleError(message
|
|
566
|
-
|
|
567
|
-
newMessage != null && console.error(newMessage);
|
|
549
|
+
function consoleError(message) {
|
|
550
|
+
vue.warn(`Vuetify error: ${message}`);
|
|
568
551
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
*/
|
|
573
|
-
|
|
574
|
-
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
575
|
-
const classify = str => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
|
|
576
|
-
function formatComponentName(vm, includeFile) {
|
|
577
|
-
if (vm.$root === vm) {
|
|
578
|
-
return '<Root>';
|
|
579
|
-
}
|
|
580
|
-
const options = typeof vm === 'function' && vm.cid != null ? vm.options : vm.__isVue ? vm.$options || vm.constructor.options : vm || {};
|
|
581
|
-
let name = options.name || options._componentTag;
|
|
582
|
-
const file = options.__file;
|
|
583
|
-
if (!name && file) {
|
|
584
|
-
const match = file.match(/([^/\\]+)\.vue$/);
|
|
585
|
-
name = match?.[1];
|
|
586
|
-
}
|
|
587
|
-
return (name ? `<${classify(name)}>` : `<Anonymous>`) + (file && includeFile !== false ? ` at ${file}` : '');
|
|
588
|
-
}
|
|
589
|
-
function generateComponentTrace(vm) {
|
|
590
|
-
if (vm.__isVue && vm.$parent) {
|
|
591
|
-
const tree = [];
|
|
592
|
-
let currentRecursiveSequence = 0;
|
|
593
|
-
while (vm) {
|
|
594
|
-
if (tree.length > 0) {
|
|
595
|
-
const last = tree[tree.length - 1];
|
|
596
|
-
if (last.constructor === vm.constructor) {
|
|
597
|
-
currentRecursiveSequence++;
|
|
598
|
-
vm = vm.$parent;
|
|
599
|
-
continue;
|
|
600
|
-
} else if (currentRecursiveSequence > 0) {
|
|
601
|
-
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
|
602
|
-
currentRecursiveSequence = 0;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
tree.push(vm);
|
|
606
|
-
vm = vm.$parent;
|
|
607
|
-
}
|
|
608
|
-
return '\n\nfound in\n\n' + tree.map((vm, i) => `${i === 0 ? '---> ' : ' '.repeat(5 + i * 2)}${Array.isArray(vm)
|
|
609
|
-
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
610
|
-
? `${formatComponentName(vm[0])}... (${vm[1]} recursive calls)` : formatComponentName(vm)}`).join('\n');
|
|
611
|
-
} else {
|
|
612
|
-
return `\n\n(found in ${formatComponentName(vm)})`;
|
|
613
|
-
}
|
|
552
|
+
function deprecate(original, replacement) {
|
|
553
|
+
replacement = Array.isArray(replacement) ? replacement.slice(0, -1).map(s => `'${s}'`).join(', ') + ` or '${replacement.at(-1)}'` : `'${replacement}'`;
|
|
554
|
+
vue.warn(`[Vuetify UPGRADE] '${original}' is deprecated, use ${replacement} instead.`);
|
|
614
555
|
}
|
|
615
556
|
|
|
616
557
|
// For converting XYZ to sRGB
|
|
@@ -684,7 +625,46 @@
|
|
|
684
625
|
function isCssColor(color) {
|
|
685
626
|
return !!color && /^(#|var\(--|(rgb|hsl)a?\()/.test(color);
|
|
686
627
|
}
|
|
687
|
-
|
|
628
|
+
const cssColorRe = /^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;
|
|
629
|
+
const mappers = {
|
|
630
|
+
rgb: (r, g, b, a) => ({
|
|
631
|
+
r,
|
|
632
|
+
g,
|
|
633
|
+
b,
|
|
634
|
+
a
|
|
635
|
+
}),
|
|
636
|
+
rgba: (r, g, b, a) => ({
|
|
637
|
+
r,
|
|
638
|
+
g,
|
|
639
|
+
b,
|
|
640
|
+
a
|
|
641
|
+
}),
|
|
642
|
+
hsl: (h, s, l, a) => HSLtoRGB({
|
|
643
|
+
h,
|
|
644
|
+
s,
|
|
645
|
+
l,
|
|
646
|
+
a
|
|
647
|
+
}),
|
|
648
|
+
hsla: (h, s, l, a) => HSLtoRGB({
|
|
649
|
+
h,
|
|
650
|
+
s,
|
|
651
|
+
l,
|
|
652
|
+
a
|
|
653
|
+
}),
|
|
654
|
+
hsv: (h, s, v, a) => HSVtoRGB({
|
|
655
|
+
h,
|
|
656
|
+
s,
|
|
657
|
+
v,
|
|
658
|
+
a
|
|
659
|
+
}),
|
|
660
|
+
hsva: (h, s, v, a) => HSVtoRGB({
|
|
661
|
+
h,
|
|
662
|
+
s,
|
|
663
|
+
v,
|
|
664
|
+
a
|
|
665
|
+
})
|
|
666
|
+
};
|
|
667
|
+
function parseColor(color) {
|
|
688
668
|
if (typeof color === 'number') {
|
|
689
669
|
if (isNaN(color) || color < 0 || color > 0xFFFFFF) {
|
|
690
670
|
// int can't have opacity
|
|
@@ -695,6 +675,22 @@
|
|
|
695
675
|
g: (color & 0xFF00) >> 8,
|
|
696
676
|
b: color & 0xFF
|
|
697
677
|
};
|
|
678
|
+
} else if (typeof color === 'string' && cssColorRe.test(color)) {
|
|
679
|
+
const {
|
|
680
|
+
groups
|
|
681
|
+
} = color.match(cssColorRe);
|
|
682
|
+
const {
|
|
683
|
+
fn,
|
|
684
|
+
values
|
|
685
|
+
} = groups;
|
|
686
|
+
const realValues = values.split(/,\s*/).map(v => {
|
|
687
|
+
if (v.endsWith('%') && ['hsl', 'hsla', 'hsv', 'hsva'].includes(fn)) {
|
|
688
|
+
return parseFloat(v) / 100;
|
|
689
|
+
} else {
|
|
690
|
+
return parseFloat(v);
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
return mappers[fn](...realValues);
|
|
698
694
|
} else if (typeof color === 'string') {
|
|
699
695
|
let hex = color.startsWith('#') ? color.slice(1) : color;
|
|
700
696
|
if ([3, 4].includes(hex.length)) {
|
|
@@ -707,9 +703,16 @@
|
|
|
707
703
|
consoleWarn(`'${color}' is not a valid hex(a) color`);
|
|
708
704
|
}
|
|
709
705
|
return HexToRGB(hex);
|
|
710
|
-
} else {
|
|
711
|
-
|
|
706
|
+
} else if (typeof color === 'object') {
|
|
707
|
+
if (has(color, ['r', 'g', 'b'])) {
|
|
708
|
+
return color;
|
|
709
|
+
} else if (has(color, ['h', 's', 'l'])) {
|
|
710
|
+
return HSVtoRGB(HSLtoHSV(color));
|
|
711
|
+
} else if (has(color, ['h', 's', 'v'])) {
|
|
712
|
+
return HSVtoRGB(color);
|
|
713
|
+
}
|
|
712
714
|
}
|
|
715
|
+
throw new TypeError(`Invalid color: ${color == null ? color : String(color) || color.constructor.name}\nExpected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
|
|
713
716
|
}
|
|
714
717
|
|
|
715
718
|
/** Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV */
|
|
@@ -732,6 +735,9 @@
|
|
|
732
735
|
a
|
|
733
736
|
};
|
|
734
737
|
}
|
|
738
|
+
function HSLtoRGB(hsla) {
|
|
739
|
+
return HSVtoRGB(HSLtoHSV(hsla));
|
|
740
|
+
}
|
|
735
741
|
|
|
736
742
|
/** Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV */
|
|
737
743
|
function RGBtoHSV(rgba) {
|
|
@@ -870,7 +876,7 @@
|
|
|
870
876
|
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
871
877
|
*/
|
|
872
878
|
function getLuma(color) {
|
|
873
|
-
const rgb = parseColor
|
|
879
|
+
const rgb = parseColor(color);
|
|
874
880
|
return toXYZ$1(rgb)[1];
|
|
875
881
|
}
|
|
876
882
|
|
|
@@ -886,6 +892,8 @@
|
|
|
886
892
|
return (light + 0.05) / (dark + 0.05);
|
|
887
893
|
}
|
|
888
894
|
|
|
895
|
+
// eslint-disable-line vue/prefer-import-from-vue
|
|
896
|
+
|
|
889
897
|
/**
|
|
890
898
|
* Creates a factory function for props definitions.
|
|
891
899
|
* This is used to define props in a composable then override
|
|
@@ -1170,6 +1178,7 @@
|
|
|
1170
1178
|
const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving
|
|
1171
1179
|
|
|
1172
1180
|
// Utilities
|
|
1181
|
+
|
|
1173
1182
|
function getCurrentInstance(name, message) {
|
|
1174
1183
|
const vm = vue.getCurrentInstance();
|
|
1175
1184
|
if (!vm) {
|
|
@@ -1734,7 +1743,7 @@
|
|
|
1734
1743
|
for (const variation of ['lighten', 'darken']) {
|
|
1735
1744
|
const fn = variation === 'lighten' ? lighten : darken;
|
|
1736
1745
|
for (const amount of createRange(parsedOptions.variations[variation], 1)) {
|
|
1737
|
-
theme.colors[`${name}-${variation}-${amount}`] = RGBtoHex(fn(parseColor
|
|
1746
|
+
theme.colors[`${name}-${variation}-${amount}`] = RGBtoHex(fn(parseColor(color), amount));
|
|
1738
1747
|
}
|
|
1739
1748
|
}
|
|
1740
1749
|
}
|
|
@@ -1742,9 +1751,9 @@
|
|
|
1742
1751
|
for (const color of Object.keys(theme.colors)) {
|
|
1743
1752
|
if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
1744
1753
|
const onColor = `on-${color}`;
|
|
1745
|
-
const colorVal = parseColor
|
|
1746
|
-
const blackContrast = Math.abs(APCAcontrast(parseColor
|
|
1747
|
-
const whiteContrast = Math.abs(APCAcontrast(parseColor
|
|
1754
|
+
const colorVal = parseColor(theme.colors[color]);
|
|
1755
|
+
const blackContrast = Math.abs(APCAcontrast(parseColor(0), colorVal));
|
|
1756
|
+
const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), colorVal));
|
|
1748
1757
|
|
|
1749
1758
|
// TODO: warn about poor color selections
|
|
1750
1759
|
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
@@ -1876,14 +1885,14 @@
|
|
|
1876
1885
|
const darkOverlay = theme.dark ? 1 : 2;
|
|
1877
1886
|
const variables = [];
|
|
1878
1887
|
for (const [key, value] of Object.entries(theme.colors)) {
|
|
1879
|
-
const rgb = parseColor
|
|
1888
|
+
const rgb = parseColor(value);
|
|
1880
1889
|
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
1881
1890
|
if (!key.startsWith('on-')) {
|
|
1882
1891
|
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
1883
1892
|
}
|
|
1884
1893
|
}
|
|
1885
1894
|
for (const [key, value] of Object.entries(theme.variables)) {
|
|
1886
|
-
const color = typeof value === 'string' && value.startsWith('#') ? parseColor
|
|
1895
|
+
const color = typeof value === 'string' && value.startsWith('#') ? parseColor(value) : undefined;
|
|
1887
1896
|
const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined;
|
|
1888
1897
|
variables.push(`--v-${key}: ${rgb ?? value}`);
|
|
1889
1898
|
}
|
|
@@ -2664,6 +2673,7 @@
|
|
|
2664
2673
|
const makeVResponsiveProps = propsFactory({
|
|
2665
2674
|
aspectRatio: [String, Number],
|
|
2666
2675
|
contentClass: String,
|
|
2676
|
+
inline: Boolean,
|
|
2667
2677
|
...makeComponentProps(),
|
|
2668
2678
|
...makeDimensionProps()
|
|
2669
2679
|
}, 'v-responsive');
|
|
@@ -2681,7 +2691,9 @@
|
|
|
2681
2691
|
dimensionStyles
|
|
2682
2692
|
} = useDimension(props);
|
|
2683
2693
|
useRender(() => vue.createVNode("div", {
|
|
2684
|
-
"class": ['v-responsive',
|
|
2694
|
+
"class": ['v-responsive', {
|
|
2695
|
+
'v-responsive--inline': props.inline
|
|
2696
|
+
}, props.class],
|
|
2685
2697
|
"style": [dimensionStyles.value, props.style]
|
|
2686
2698
|
}, [vue.createVNode("div", {
|
|
2687
2699
|
"class": "v-responsive__sizer",
|
|
@@ -2775,7 +2787,6 @@
|
|
|
2775
2787
|
// Types
|
|
2776
2788
|
|
|
2777
2789
|
const makeVImgProps = propsFactory({
|
|
2778
|
-
aspectRatio: [String, Number],
|
|
2779
2790
|
alt: String,
|
|
2780
2791
|
cover: Boolean,
|
|
2781
2792
|
eager: Boolean,
|
|
@@ -2797,7 +2808,7 @@
|
|
|
2797
2808
|
default: ''
|
|
2798
2809
|
},
|
|
2799
2810
|
srcset: String,
|
|
2800
|
-
|
|
2811
|
+
...makeVResponsiveProps(),
|
|
2801
2812
|
...makeComponentProps(),
|
|
2802
2813
|
...makeTransitionProps()
|
|
2803
2814
|
}, 'v-img');
|
|
@@ -2989,25 +3000,27 @@
|
|
|
2989
3000
|
}
|
|
2990
3001
|
});
|
|
2991
3002
|
}
|
|
2992
|
-
useRender(() =>
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3003
|
+
useRender(() => {
|
|
3004
|
+
const [responsiveProps] = VResponsive.filterProps(props);
|
|
3005
|
+
return vue.withDirectives(vue.createVNode(VResponsive, vue.mergeProps({
|
|
3006
|
+
"class": ['v-img', {
|
|
3007
|
+
'v-img--booting': !isBooted.value
|
|
3008
|
+
}, props.class],
|
|
3009
|
+
"style": props.style
|
|
3010
|
+
}, responsiveProps, {
|
|
3011
|
+
"aspectRatio": aspectRatio.value,
|
|
3012
|
+
"aria-label": props.alt,
|
|
3013
|
+
"role": props.alt ? 'img' : undefined
|
|
3014
|
+
}), {
|
|
3015
|
+
additional: () => vue.createVNode(vue.Fragment, null, [vue.createVNode(__image, null, null), vue.createVNode(__preloadImage, null, null), vue.createVNode(__gradient, null, null), vue.createVNode(__placeholder, null, null), vue.createVNode(__error, null, null)]),
|
|
3016
|
+
default: slots.default
|
|
3017
|
+
}), [[vue.resolveDirective("intersect"), {
|
|
3018
|
+
handler: init,
|
|
3019
|
+
options: props.options
|
|
3020
|
+
}, null, {
|
|
3021
|
+
once: true
|
|
3022
|
+
}]]);
|
|
3023
|
+
});
|
|
3011
3024
|
return {
|
|
3012
3025
|
currentSrc,
|
|
3013
3026
|
image,
|
|
@@ -3402,7 +3415,7 @@
|
|
|
3402
3415
|
vue.watch(() => props.scrollTarget, scrollTarget => {
|
|
3403
3416
|
const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window;
|
|
3404
3417
|
if (!newTarget) {
|
|
3405
|
-
consoleWarn(`Unable to locate element with identifier ${scrollTarget}
|
|
3418
|
+
consoleWarn(`Unable to locate element with identifier ${scrollTarget}`);
|
|
3406
3419
|
return;
|
|
3407
3420
|
}
|
|
3408
3421
|
if (newTarget === target.value) return;
|
|
@@ -3884,26 +3897,26 @@
|
|
|
3884
3897
|
}
|
|
3885
3898
|
function getIds(items, modelValue) {
|
|
3886
3899
|
const ids = [];
|
|
3887
|
-
|
|
3888
|
-
const item = items
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
ids.push(item.id);
|
|
3892
|
-
}
|
|
3893
|
-
} else if (modelValue.includes(i)) {
|
|
3900
|
+
modelValue.forEach(value => {
|
|
3901
|
+
const item = items.find(item => deepEqual(value, item.value));
|
|
3902
|
+
const itemByIndex = items[value];
|
|
3903
|
+
if (item?.value != null) {
|
|
3894
3904
|
ids.push(item.id);
|
|
3905
|
+
} else if (itemByIndex != null) {
|
|
3906
|
+
ids.push(itemByIndex.id);
|
|
3895
3907
|
}
|
|
3896
|
-
}
|
|
3908
|
+
});
|
|
3897
3909
|
return ids;
|
|
3898
3910
|
}
|
|
3899
3911
|
function getValues(items, ids) {
|
|
3900
3912
|
const values = [];
|
|
3901
|
-
|
|
3902
|
-
const
|
|
3903
|
-
if (
|
|
3904
|
-
|
|
3913
|
+
ids.forEach(id => {
|
|
3914
|
+
const itemIndex = items.findIndex(item => item.id === id);
|
|
3915
|
+
if (~itemIndex) {
|
|
3916
|
+
const item = items[itemIndex];
|
|
3917
|
+
values.push(item.value != null ? item.value : itemIndex);
|
|
3905
3918
|
}
|
|
3906
|
-
}
|
|
3919
|
+
});
|
|
3907
3920
|
return values;
|
|
3908
3921
|
}
|
|
3909
3922
|
|
|
@@ -5573,10 +5586,17 @@
|
|
|
5573
5586
|
default: '$clear'
|
|
5574
5587
|
},
|
|
5575
5588
|
active: Boolean,
|
|
5589
|
+
centerAffix: {
|
|
5590
|
+
type: Boolean,
|
|
5591
|
+
default: undefined
|
|
5592
|
+
},
|
|
5576
5593
|
color: String,
|
|
5577
5594
|
baseColor: String,
|
|
5578
5595
|
dirty: Boolean,
|
|
5579
|
-
disabled:
|
|
5596
|
+
disabled: {
|
|
5597
|
+
type: Boolean,
|
|
5598
|
+
default: null
|
|
5599
|
+
},
|
|
5580
5600
|
error: Boolean,
|
|
5581
5601
|
flat: Boolean,
|
|
5582
5602
|
label: String,
|
|
@@ -5644,6 +5664,7 @@
|
|
|
5644
5664
|
const labelRef = vue.ref();
|
|
5645
5665
|
const floatingLabelRef = vue.ref();
|
|
5646
5666
|
const controlRef = vue.ref();
|
|
5667
|
+
const isPlainOrUnderlined = vue.computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
5647
5668
|
const {
|
|
5648
5669
|
backgroundColorClasses,
|
|
5649
5670
|
backgroundColorStyles
|
|
@@ -5709,6 +5730,7 @@
|
|
|
5709
5730
|
const hasClear = !!(props.clearable || slots.clear);
|
|
5710
5731
|
const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear);
|
|
5711
5732
|
const label = slots.label ? slots.label({
|
|
5733
|
+
...slotProps.value,
|
|
5712
5734
|
label: props.label,
|
|
5713
5735
|
props: {
|
|
5714
5736
|
for: id.value
|
|
@@ -5718,6 +5740,7 @@
|
|
|
5718
5740
|
"class": ['v-field', {
|
|
5719
5741
|
'v-field--active': isActive.value,
|
|
5720
5742
|
'v-field--appended': hasAppend,
|
|
5743
|
+
'v-field--center-affix': props.centerAffix ?? !isPlainOrUnderlined.value,
|
|
5721
5744
|
'v-field--disabled': props.disabled,
|
|
5722
5745
|
'v-field--dirty': props.dirty,
|
|
5723
5746
|
'v-field--error': props.error,
|
|
@@ -5803,7 +5826,7 @@
|
|
|
5803
5826
|
default: () => [label]
|
|
5804
5827
|
})]), vue.createVNode("div", {
|
|
5805
5828
|
"class": "v-field__outline__end"
|
|
5806
|
-
}, null)]),
|
|
5829
|
+
}, null)]), isPlainOrUnderlined.value && hasLabel.value && vue.createVNode(VFieldLabel, {
|
|
5807
5830
|
"ref": floatingLabelRef,
|
|
5808
5831
|
"floating": true,
|
|
5809
5832
|
"for": id.value
|
|
@@ -5921,12 +5944,9 @@
|
|
|
5921
5944
|
}
|
|
5922
5945
|
function reset() {
|
|
5923
5946
|
items.value.forEach(item => item.reset());
|
|
5924
|
-
model.value = null;
|
|
5925
5947
|
}
|
|
5926
5948
|
function resetValidation() {
|
|
5927
5949
|
items.value.forEach(item => item.resetValidation());
|
|
5928
|
-
errors.value = [];
|
|
5929
|
-
model.value = null;
|
|
5930
5950
|
}
|
|
5931
5951
|
vue.watch(items, () => {
|
|
5932
5952
|
let valid = 0;
|
|
@@ -5980,6 +6000,7 @@
|
|
|
5980
6000
|
isDisabled,
|
|
5981
6001
|
isReadonly,
|
|
5982
6002
|
isValidating,
|
|
6003
|
+
isValid: model,
|
|
5983
6004
|
items,
|
|
5984
6005
|
validateOn: vue.toRef(props, 'validateOn')
|
|
5985
6006
|
});
|
|
@@ -5988,6 +6009,7 @@
|
|
|
5988
6009
|
isDisabled,
|
|
5989
6010
|
isReadonly,
|
|
5990
6011
|
isValidating,
|
|
6012
|
+
isValid: model,
|
|
5991
6013
|
items,
|
|
5992
6014
|
validate,
|
|
5993
6015
|
reset,
|
|
@@ -6003,7 +6025,10 @@
|
|
|
6003
6025
|
// Types
|
|
6004
6026
|
|
|
6005
6027
|
const makeValidationProps = propsFactory({
|
|
6006
|
-
disabled:
|
|
6028
|
+
disabled: {
|
|
6029
|
+
type: Boolean,
|
|
6030
|
+
default: null
|
|
6031
|
+
},
|
|
6007
6032
|
error: Boolean,
|
|
6008
6033
|
errorMessages: {
|
|
6009
6034
|
type: [Array, String],
|
|
@@ -6015,7 +6040,10 @@
|
|
|
6015
6040
|
},
|
|
6016
6041
|
name: String,
|
|
6017
6042
|
label: String,
|
|
6018
|
-
readonly:
|
|
6043
|
+
readonly: {
|
|
6044
|
+
type: Boolean,
|
|
6045
|
+
default: null
|
|
6046
|
+
},
|
|
6019
6047
|
rules: {
|
|
6020
6048
|
type: Array,
|
|
6021
6049
|
default: () => []
|
|
@@ -6034,15 +6062,30 @@
|
|
|
6034
6062
|
const internalErrorMessages = vue.ref([]);
|
|
6035
6063
|
const isPristine = vue.shallowRef(true);
|
|
6036
6064
|
const isDirty = vue.computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
6037
|
-
const isDisabled = vue.computed(() => !!(props.disabled
|
|
6038
|
-
const isReadonly = vue.computed(() => !!(props.readonly
|
|
6065
|
+
const isDisabled = vue.computed(() => !!(props.disabled ?? form?.isDisabled.value));
|
|
6066
|
+
const isReadonly = vue.computed(() => !!(props.readonly ?? form?.isReadonly.value));
|
|
6039
6067
|
const errorMessages = vue.computed(() => {
|
|
6040
6068
|
return props.errorMessages.length ? wrapInArray(props.errorMessages).slice(0, Math.max(0, +props.maxErrors)) : internalErrorMessages.value;
|
|
6041
6069
|
});
|
|
6070
|
+
const validateOn = vue.computed(() => {
|
|
6071
|
+
let value = (props.validateOn ?? form?.validateOn.value) || 'input';
|
|
6072
|
+
if (value === 'lazy') value = 'input lazy';
|
|
6073
|
+
const set = new Set(value?.split(' ') ?? []);
|
|
6074
|
+
return {
|
|
6075
|
+
blur: set.has('blur') || set.has('input'),
|
|
6076
|
+
input: set.has('input'),
|
|
6077
|
+
submit: set.has('submit'),
|
|
6078
|
+
lazy: set.has('lazy')
|
|
6079
|
+
};
|
|
6080
|
+
});
|
|
6042
6081
|
const isValid = vue.computed(() => {
|
|
6043
|
-
if (props.error || errorMessages.
|
|
6082
|
+
if (props.error || props.errorMessages.length) return false;
|
|
6044
6083
|
if (!props.rules.length) return true;
|
|
6045
|
-
|
|
6084
|
+
if (isPristine.value) {
|
|
6085
|
+
return internalErrorMessages.value.length || validateOn.value.lazy ? null : true;
|
|
6086
|
+
} else {
|
|
6087
|
+
return !internalErrorMessages.value.length;
|
|
6088
|
+
}
|
|
6046
6089
|
});
|
|
6047
6090
|
const isValidating = vue.shallowRef(false);
|
|
6048
6091
|
const validationClasses = vue.computed(() => {
|
|
@@ -6065,11 +6108,13 @@
|
|
|
6065
6108
|
vue.onBeforeUnmount(() => {
|
|
6066
6109
|
form?.unregister(uid.value);
|
|
6067
6110
|
});
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6111
|
+
vue.onMounted(async () => {
|
|
6112
|
+
if (!validateOn.value.lazy) {
|
|
6113
|
+
await validate(true);
|
|
6114
|
+
}
|
|
6115
|
+
form?.update(uid.value, isValid.value, errorMessages.value);
|
|
6116
|
+
});
|
|
6117
|
+
useToggleScope(() => validateOn.value.input, () => {
|
|
6073
6118
|
vue.watch(validationModel, () => {
|
|
6074
6119
|
if (validationModel.value != null) {
|
|
6075
6120
|
validate();
|
|
@@ -6081,7 +6126,7 @@
|
|
|
6081
6126
|
}
|
|
6082
6127
|
});
|
|
6083
6128
|
});
|
|
6084
|
-
useToggleScope(() => validateOn.value
|
|
6129
|
+
useToggleScope(() => validateOn.value.blur, () => {
|
|
6085
6130
|
vue.watch(() => props.focused, val => {
|
|
6086
6131
|
if (!val) validate();
|
|
6087
6132
|
});
|
|
@@ -6090,14 +6135,19 @@
|
|
|
6090
6135
|
form?.update(uid.value, isValid.value, errorMessages.value);
|
|
6091
6136
|
});
|
|
6092
6137
|
function reset() {
|
|
6093
|
-
resetValidation();
|
|
6094
6138
|
model.value = null;
|
|
6139
|
+
vue.nextTick(resetValidation);
|
|
6095
6140
|
}
|
|
6096
6141
|
function resetValidation() {
|
|
6097
6142
|
isPristine.value = true;
|
|
6098
|
-
|
|
6143
|
+
if (!validateOn.value.lazy) {
|
|
6144
|
+
validate(true);
|
|
6145
|
+
} else {
|
|
6146
|
+
internalErrorMessages.value = [];
|
|
6147
|
+
}
|
|
6099
6148
|
}
|
|
6100
6149
|
async function validate() {
|
|
6150
|
+
let silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6101
6151
|
const results = [];
|
|
6102
6152
|
isValidating.value = true;
|
|
6103
6153
|
for (const rule of props.rules) {
|
|
@@ -6116,7 +6166,7 @@
|
|
|
6116
6166
|
}
|
|
6117
6167
|
internalErrorMessages.value = results;
|
|
6118
6168
|
isValidating.value = false;
|
|
6119
|
-
isPristine.value =
|
|
6169
|
+
isPristine.value = silent;
|
|
6120
6170
|
return internalErrorMessages.value;
|
|
6121
6171
|
}
|
|
6122
6172
|
return {
|
|
@@ -6137,6 +6187,10 @@
|
|
|
6137
6187
|
const makeVInputProps = propsFactory({
|
|
6138
6188
|
id: String,
|
|
6139
6189
|
appendIcon: IconValue,
|
|
6190
|
+
centerAffix: {
|
|
6191
|
+
type: Boolean,
|
|
6192
|
+
default: true
|
|
6193
|
+
},
|
|
6140
6194
|
prependIcon: IconValue,
|
|
6141
6195
|
hideDetails: [Boolean, String],
|
|
6142
6196
|
hint: String,
|
|
@@ -6206,7 +6260,7 @@
|
|
|
6206
6260
|
validate
|
|
6207
6261
|
}));
|
|
6208
6262
|
const messages = vue.computed(() => {
|
|
6209
|
-
if (errorMessages.value.length > 0) {
|
|
6263
|
+
if (!isPristine.value && errorMessages.value.length > 0) {
|
|
6210
6264
|
return errorMessages.value;
|
|
6211
6265
|
} else if (props.hint && (props.persistentHint || props.focused)) {
|
|
6212
6266
|
return props.hint;
|
|
@@ -6220,7 +6274,9 @@
|
|
|
6220
6274
|
const hasMessages = messages.value.length > 0;
|
|
6221
6275
|
const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
|
|
6222
6276
|
return vue.createVNode("div", {
|
|
6223
|
-
"class": ['v-input', `v-input--${props.direction}`,
|
|
6277
|
+
"class": ['v-input', `v-input--${props.direction}`, {
|
|
6278
|
+
'v-input--center-affix': props.centerAffix
|
|
6279
|
+
}, densityClasses.value, validationClasses.value, props.class],
|
|
6224
6280
|
"style": props.style
|
|
6225
6281
|
}, [hasPrepend && vue.createVNode("div", {
|
|
6226
6282
|
"key": "prepend",
|
|
@@ -6427,6 +6483,7 @@
|
|
|
6427
6483
|
if (!props.counter || typeof props.counter !== 'number' && typeof props.counter !== 'string') return undefined;
|
|
6428
6484
|
return props.counter;
|
|
6429
6485
|
});
|
|
6486
|
+
const isPlainOrUnderlined = vue.computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
6430
6487
|
function onIntersect(isIntersecting, entries) {
|
|
6431
6488
|
if (!props.autofocus || !isIntersecting) return;
|
|
6432
6489
|
entries[0].target?.focus?.();
|
|
@@ -6486,10 +6543,11 @@
|
|
|
6486
6543
|
"class": ['v-text-field', {
|
|
6487
6544
|
'v-text-field--prefixed': props.prefix,
|
|
6488
6545
|
'v-text-field--suffixed': props.suffix,
|
|
6489
|
-
'v-text-field--
|
|
6546
|
+
'v-text-field--plain-underlined': ['plain', 'underlined'].includes(props.variant)
|
|
6490
6547
|
}, props.class],
|
|
6491
6548
|
"style": props.style
|
|
6492
6549
|
}, rootAttrs, inputProps, {
|
|
6550
|
+
"centerAffix": !isPlainOrUnderlined.value,
|
|
6493
6551
|
"focused": isFocused.value
|
|
6494
6552
|
}), {
|
|
6495
6553
|
...slots,
|
|
@@ -6859,10 +6917,10 @@
|
|
|
6859
6917
|
}
|
|
6860
6918
|
}
|
|
6861
6919
|
const falseIcon = vue.computed(() => {
|
|
6862
|
-
return
|
|
6920
|
+
return indeterminate.value ? props.indeterminateIcon : props.falseIcon;
|
|
6863
6921
|
});
|
|
6864
6922
|
const trueIcon = vue.computed(() => {
|
|
6865
|
-
return
|
|
6923
|
+
return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
|
|
6866
6924
|
});
|
|
6867
6925
|
useRender(() => vue.createVNode(VSelectionControl, vue.mergeProps(props, {
|
|
6868
6926
|
"modelValue": model.value,
|
|
@@ -6872,7 +6930,7 @@
|
|
|
6872
6930
|
"type": "checkbox",
|
|
6873
6931
|
"falseIcon": falseIcon.value,
|
|
6874
6932
|
"trueIcon": trueIcon.value,
|
|
6875
|
-
"aria-checked":
|
|
6933
|
+
"aria-checked": indeterminate.value ? 'mixed' : undefined
|
|
6876
6934
|
}), slots));
|
|
6877
6935
|
return {};
|
|
6878
6936
|
}
|
|
@@ -7832,7 +7890,9 @@
|
|
|
7832
7890
|
}
|
|
7833
7891
|
});
|
|
7834
7892
|
const makeVListGroupProps = propsFactory({
|
|
7893
|
+
/* @deprecated */
|
|
7835
7894
|
activeColor: String,
|
|
7895
|
+
baseColor: String,
|
|
7836
7896
|
color: String,
|
|
7837
7897
|
collapseIcon: {
|
|
7838
7898
|
type: IconValue,
|
|
@@ -7881,6 +7941,7 @@
|
|
|
7881
7941
|
VListItem: {
|
|
7882
7942
|
active: isOpen.value,
|
|
7883
7943
|
activeColor: props.activeColor,
|
|
7944
|
+
baseColor: props.baseColor,
|
|
7884
7945
|
color: props.color,
|
|
7885
7946
|
prependIcon: props.prependIcon || props.subgroup && toggleIcon.value,
|
|
7886
7947
|
appendIcon: props.appendIcon || !props.subgroup && toggleIcon.value,
|
|
@@ -7935,9 +7996,11 @@
|
|
|
7935
7996
|
default: undefined
|
|
7936
7997
|
},
|
|
7937
7998
|
activeClass: String,
|
|
7999
|
+
/* @deprecated */
|
|
7938
8000
|
activeColor: String,
|
|
7939
8001
|
appendAvatar: String,
|
|
7940
8002
|
appendIcon: IconValue,
|
|
8003
|
+
baseColor: String,
|
|
7941
8004
|
disabled: Boolean,
|
|
7942
8005
|
lines: String,
|
|
7943
8006
|
link: {
|
|
@@ -8000,8 +8063,9 @@
|
|
|
8000
8063
|
const isLink = vue.computed(() => props.link !== false && link.isLink.value);
|
|
8001
8064
|
const isClickable = vue.computed(() => !props.disabled && props.link !== false && (props.link || link.isClickable.value || props.value != null && !!list));
|
|
8002
8065
|
const roundedProps = vue.computed(() => props.rounded || props.nav);
|
|
8066
|
+
const color = vue.computed(() => props.color ?? props.activeColor);
|
|
8003
8067
|
const variantProps = vue.computed(() => ({
|
|
8004
|
-
color: isActive.value ?
|
|
8068
|
+
color: isActive.value ? color.value ?? props.baseColor : props.baseColor,
|
|
8005
8069
|
variant: props.variant
|
|
8006
8070
|
}));
|
|
8007
8071
|
vue.watch(() => link.isActive?.value, val => {
|
|
@@ -8058,7 +8122,6 @@
|
|
|
8058
8122
|
}
|
|
8059
8123
|
useRender(() => {
|
|
8060
8124
|
const Tag = isLink.value ? 'a' : props.tag;
|
|
8061
|
-
const hasColor = !list || isSelected.value || isActive.value;
|
|
8062
8125
|
const hasTitle = slots.title || props.title;
|
|
8063
8126
|
const hasSubtitle = slots.subtitle || props.subtitle;
|
|
8064
8127
|
const hasAppendMedia = !!(props.appendAvatar || props.appendIcon);
|
|
@@ -8066,6 +8129,9 @@
|
|
|
8066
8129
|
const hasPrependMedia = !!(props.prependAvatar || props.prependIcon);
|
|
8067
8130
|
const hasPrepend = !!(hasPrependMedia || slots.prepend);
|
|
8068
8131
|
list?.updateHasPrepend(hasPrepend);
|
|
8132
|
+
if (props.activeColor) {
|
|
8133
|
+
deprecate('active-color', ['color', 'base-color']);
|
|
8134
|
+
}
|
|
8069
8135
|
return vue.withDirectives(vue.createVNode(Tag, {
|
|
8070
8136
|
"class": ['v-list-item', {
|
|
8071
8137
|
'v-list-item--active': isActive.value,
|
|
@@ -8074,10 +8140,10 @@
|
|
|
8074
8140
|
'v-list-item--nav': props.nav,
|
|
8075
8141
|
'v-list-item--prepend': !hasPrepend && list?.hasPrepend.value,
|
|
8076
8142
|
[`${props.activeClass}`]: props.activeClass && isActive.value
|
|
8077
|
-
}, themeClasses.value, borderClasses.value,
|
|
8078
|
-
"style": [
|
|
8143
|
+
}, themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, elevationClasses.value, lineClasses.value, roundedClasses.value, variantClasses.value, props.class],
|
|
8144
|
+
"style": [colorStyles.value, dimensionStyles.value, props.style],
|
|
8079
8145
|
"href": link.href.value,
|
|
8080
|
-
"tabindex": isClickable.value ? 0 : undefined,
|
|
8146
|
+
"tabindex": isClickable.value ? list ? -2 : 0 : undefined,
|
|
8081
8147
|
"onClick": onClick,
|
|
8082
8148
|
"onKeydown": isClickable.value && !isLink.value && onKeyDown
|
|
8083
8149
|
}, {
|
|
@@ -8228,9 +8294,7 @@
|
|
|
8228
8294
|
if (type === 'subheader') {
|
|
8229
8295
|
return slots.subheader?.({
|
|
8230
8296
|
props: itemProps
|
|
8231
|
-
}) ?? vue.createVNode(VListSubheader, itemProps,
|
|
8232
|
-
default: slots.subheader
|
|
8233
|
-
});
|
|
8297
|
+
}) ?? vue.createVNode(VListSubheader, itemProps, null);
|
|
8234
8298
|
}
|
|
8235
8299
|
const slotsWithItem = {
|
|
8236
8300
|
subtitle: slots.subtitle ? slotProps => slots.subtitle?.({
|
|
@@ -8245,10 +8309,6 @@
|
|
|
8245
8309
|
...slotProps,
|
|
8246
8310
|
item
|
|
8247
8311
|
}) : undefined,
|
|
8248
|
-
default: slots.default ? slotProps => slots.default?.({
|
|
8249
|
-
...slotProps,
|
|
8250
|
-
item
|
|
8251
|
-
}) : undefined,
|
|
8252
8312
|
title: slots.title ? slotProps => slots.title?.({
|
|
8253
8313
|
...slotProps,
|
|
8254
8314
|
item
|
|
@@ -8272,7 +8332,9 @@
|
|
|
8272
8332
|
default: () => vue.createVNode(VListChildren, {
|
|
8273
8333
|
"items": children
|
|
8274
8334
|
}, slots)
|
|
8275
|
-
}) : slots.item ? slots.item(
|
|
8335
|
+
}) : slots.item ? slots.item({
|
|
8336
|
+
props: itemProps
|
|
8337
|
+
}) : vue.createVNode(VListItem, itemProps, slotsWithItem);
|
|
8276
8338
|
});
|
|
8277
8339
|
}
|
|
8278
8340
|
});
|
|
@@ -8304,8 +8366,8 @@
|
|
|
8304
8366
|
default: 'props'
|
|
8305
8367
|
},
|
|
8306
8368
|
returnObject: Boolean
|
|
8307
|
-
}, '
|
|
8308
|
-
function transformItem$
|
|
8369
|
+
}, 'list-items');
|
|
8370
|
+
function transformItem$3(props, item) {
|
|
8309
8371
|
const title = getPropertyFromItem(item, props.itemTitle, item);
|
|
8310
8372
|
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue, title);
|
|
8311
8373
|
const children = getPropertyFromItem(item, props.itemChildren);
|
|
@@ -8319,33 +8381,36 @@
|
|
|
8319
8381
|
title: String(_props.title ?? ''),
|
|
8320
8382
|
value: _props.value,
|
|
8321
8383
|
props: _props,
|
|
8322
|
-
children: Array.isArray(children) ? transformItems$
|
|
8384
|
+
children: Array.isArray(children) ? transformItems$3(props, children) : undefined,
|
|
8323
8385
|
raw: item
|
|
8324
8386
|
};
|
|
8325
8387
|
}
|
|
8326
|
-
function transformItems$
|
|
8388
|
+
function transformItems$3(props, items) {
|
|
8327
8389
|
const array = [];
|
|
8328
8390
|
for (const item of items) {
|
|
8329
|
-
array.push(transformItem$
|
|
8391
|
+
array.push(transformItem$3(props, item));
|
|
8330
8392
|
}
|
|
8331
8393
|
return array;
|
|
8332
8394
|
}
|
|
8333
8395
|
function useItems(props) {
|
|
8334
|
-
const items = vue.computed(() => transformItems$
|
|
8396
|
+
const items = vue.computed(() => transformItems$3(props, props.items));
|
|
8397
|
+
return useTransformItems(items, value => transformItem$3(props, value));
|
|
8398
|
+
}
|
|
8399
|
+
function useTransformItems(items, transform) {
|
|
8335
8400
|
function transformIn(value) {
|
|
8336
8401
|
return value.map(v => {
|
|
8337
8402
|
const existingItem = items.value.find(item => deepEqual(v, item.value));
|
|
8338
8403
|
// Nullish existingItem means value is a custom input value from combobox
|
|
8339
|
-
// In this case, use transformItem to create an
|
|
8340
|
-
return existingItem ??
|
|
8404
|
+
// In this case, use transformItem to create an { value: unknown } based on value
|
|
8405
|
+
return existingItem ?? transform(v);
|
|
8341
8406
|
});
|
|
8342
8407
|
}
|
|
8343
8408
|
function transformOut(value) {
|
|
8344
8409
|
return value.map(_ref => {
|
|
8345
8410
|
let {
|
|
8346
|
-
|
|
8411
|
+
value
|
|
8347
8412
|
} = _ref;
|
|
8348
|
-
return
|
|
8413
|
+
return value;
|
|
8349
8414
|
});
|
|
8350
8415
|
}
|
|
8351
8416
|
return {
|
|
@@ -8360,7 +8425,7 @@
|
|
|
8360
8425
|
function isPrimitive(value) {
|
|
8361
8426
|
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
8362
8427
|
}
|
|
8363
|
-
function transformItem(props, item) {
|
|
8428
|
+
function transformItem$2(props, item) {
|
|
8364
8429
|
const type = getPropertyFromItem(item, props.itemType, 'item');
|
|
8365
8430
|
const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle);
|
|
8366
8431
|
const value = getPropertyFromItem(item, props.itemValue, undefined);
|
|
@@ -8376,24 +8441,26 @@
|
|
|
8376
8441
|
title: _props.title,
|
|
8377
8442
|
value: _props.value,
|
|
8378
8443
|
props: _props,
|
|
8379
|
-
children: type === 'item' && children ? transformItems(props, children) : undefined,
|
|
8444
|
+
children: type === 'item' && children ? transformItems$2(props, children) : undefined,
|
|
8380
8445
|
raw: item
|
|
8381
8446
|
};
|
|
8382
8447
|
}
|
|
8383
|
-
function transformItems(props, items) {
|
|
8448
|
+
function transformItems$2(props, items) {
|
|
8384
8449
|
const array = [];
|
|
8385
8450
|
for (const item of items) {
|
|
8386
|
-
array.push(transformItem(props, item));
|
|
8451
|
+
array.push(transformItem$2(props, item));
|
|
8387
8452
|
}
|
|
8388
8453
|
return array;
|
|
8389
8454
|
}
|
|
8390
8455
|
function useListItems(props) {
|
|
8391
|
-
const items = vue.computed(() => transformItems(props, props.items));
|
|
8456
|
+
const items = vue.computed(() => transformItems$2(props, props.items));
|
|
8392
8457
|
return {
|
|
8393
8458
|
items
|
|
8394
8459
|
};
|
|
8395
8460
|
}
|
|
8396
8461
|
const makeVListProps = propsFactory({
|
|
8462
|
+
baseColor: String,
|
|
8463
|
+
/* @deprecated */
|
|
8397
8464
|
activeColor: String,
|
|
8398
8465
|
activeClass: String,
|
|
8399
8466
|
bgColor: String,
|
|
@@ -8468,16 +8535,19 @@
|
|
|
8468
8535
|
} = useNested(props);
|
|
8469
8536
|
const lineClasses = vue.computed(() => props.lines ? `v-list--${props.lines}-line` : undefined);
|
|
8470
8537
|
const activeColor = vue.toRef(props, 'activeColor');
|
|
8538
|
+
const baseColor = vue.toRef(props, 'baseColor');
|
|
8471
8539
|
const color = vue.toRef(props, 'color');
|
|
8472
8540
|
createList();
|
|
8473
8541
|
provideDefaults({
|
|
8474
8542
|
VListGroup: {
|
|
8475
8543
|
activeColor,
|
|
8544
|
+
baseColor,
|
|
8476
8545
|
color
|
|
8477
8546
|
},
|
|
8478
8547
|
VListItem: {
|
|
8479
8548
|
activeClass: vue.toRef(props, 'activeClass'),
|
|
8480
8549
|
activeColor,
|
|
8550
|
+
baseColor,
|
|
8481
8551
|
color,
|
|
8482
8552
|
density: vue.toRef(props, 'density'),
|
|
8483
8553
|
disabled: vue.toRef(props, 'disabled'),
|
|
@@ -9502,14 +9572,14 @@
|
|
|
9502
9572
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultDisplayOptions;
|
|
9503
9573
|
return mergeDeep(defaultDisplayOptions, options);
|
|
9504
9574
|
};
|
|
9505
|
-
function getClientWidth(
|
|
9506
|
-
return IN_BROWSER && !
|
|
9575
|
+
function getClientWidth(ssr) {
|
|
9576
|
+
return IN_BROWSER && !ssr ? window.innerWidth : typeof ssr === 'object' && ssr.clientWidth || 0;
|
|
9507
9577
|
}
|
|
9508
|
-
function getClientHeight(
|
|
9509
|
-
return IN_BROWSER && !
|
|
9578
|
+
function getClientHeight(ssr) {
|
|
9579
|
+
return IN_BROWSER && !ssr ? window.innerHeight : typeof ssr === 'object' && ssr.clientHeight || 0;
|
|
9510
9580
|
}
|
|
9511
|
-
function getPlatform(
|
|
9512
|
-
const userAgent = IN_BROWSER && !
|
|
9581
|
+
function getPlatform(ssr) {
|
|
9582
|
+
const userAgent = IN_BROWSER && !ssr ? window.navigator.userAgent : 'ssr';
|
|
9513
9583
|
function match(regexp) {
|
|
9514
9584
|
return Boolean(userAgent.match(regexp));
|
|
9515
9585
|
}
|
|
@@ -10333,10 +10403,10 @@
|
|
|
10333
10403
|
'v-select--active-menu': menu.value,
|
|
10334
10404
|
'v-select--chips': !!props.chips,
|
|
10335
10405
|
[`v-select--${props.multiple ? 'multiple' : 'single'}`]: true,
|
|
10336
|
-
'v-select--selected': model.value.length
|
|
10406
|
+
'v-select--selected': model.value.length,
|
|
10407
|
+
'v-select--selection-slot': !!slots.selection
|
|
10337
10408
|
}, props.class],
|
|
10338
10409
|
"style": props.style,
|
|
10339
|
-
"appendInnerIcon": props.menuIcon,
|
|
10340
10410
|
"readonly": true,
|
|
10341
10411
|
"placeholder": placeholder,
|
|
10342
10412
|
"onClick:clear": onClear,
|
|
@@ -10368,25 +10438,21 @@
|
|
|
10368
10438
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
10369
10439
|
"title": t(props.noDataText)
|
|
10370
10440
|
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
}
|
|
10380
|
-
return vue.createVNode(VListItem, vue.mergeProps({
|
|
10381
|
-
"key": index
|
|
10382
|
-
}, item.props, {
|
|
10383
|
-
"onClick": () => select(item)
|
|
10384
|
-
}), {
|
|
10441
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
10442
|
+
key: index,
|
|
10443
|
+
onClick: () => select(item)
|
|
10444
|
+
});
|
|
10445
|
+
return slots.item?.({
|
|
10446
|
+
item,
|
|
10447
|
+
index,
|
|
10448
|
+
props: itemProps
|
|
10449
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
10385
10450
|
prepend: _ref2 => {
|
|
10386
10451
|
let {
|
|
10387
10452
|
isSelected
|
|
10388
10453
|
} = _ref2;
|
|
10389
10454
|
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
10455
|
+
"key": item.value,
|
|
10390
10456
|
"modelValue": isSelected,
|
|
10391
10457
|
"ripple": false,
|
|
10392
10458
|
"tabindex": "-1"
|
|
@@ -10443,7 +10509,16 @@
|
|
|
10443
10509
|
}, [item.title, props.multiple && index < selections.value.length - 1 && vue.createVNode("span", {
|
|
10444
10510
|
"class": "v-select__selection-comma"
|
|
10445
10511
|
}, [vue.createTextVNode(",")])])]);
|
|
10446
|
-
})])
|
|
10512
|
+
})]),
|
|
10513
|
+
'append-inner': function () {
|
|
10514
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10515
|
+
args[_key] = arguments[_key];
|
|
10516
|
+
}
|
|
10517
|
+
return vue.createVNode(vue.Fragment, null, [slots['append-inner']?.(...args), props.menuIcon ? vue.createVNode(VIcon, {
|
|
10518
|
+
"class": "v-select__menu-icon",
|
|
10519
|
+
"icon": props.menuIcon
|
|
10520
|
+
}, null) : undefined]);
|
|
10521
|
+
}
|
|
10447
10522
|
});
|
|
10448
10523
|
});
|
|
10449
10524
|
return forwardRefs({
|
|
@@ -10455,6 +10530,8 @@
|
|
|
10455
10530
|
});
|
|
10456
10531
|
|
|
10457
10532
|
/* eslint-disable max-statements */
|
|
10533
|
+
/* eslint-disable no-labels */
|
|
10534
|
+
|
|
10458
10535
|
|
|
10459
10536
|
// Types
|
|
10460
10537
|
|
|
@@ -10524,23 +10601,24 @@
|
|
|
10524
10601
|
const strQuery = vue.computed(() => typeof query?.value !== 'string' && typeof query?.value !== 'number' ? '' : String(query.value));
|
|
10525
10602
|
const filteredItems = vue.ref([]);
|
|
10526
10603
|
const filteredMatches = vue.ref(new Map());
|
|
10604
|
+
const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(options?.transform) : vue.unref(items));
|
|
10527
10605
|
vue.watchEffect(() => {
|
|
10528
10606
|
filteredItems.value = [];
|
|
10529
10607
|
filteredMatches.value = new Map();
|
|
10530
|
-
const
|
|
10531
|
-
const results = filterItems(transformedItems, strQuery.value, {
|
|
10608
|
+
const results = filterItems(transformedItems.value, strQuery.value, {
|
|
10532
10609
|
customKeyFilter: props.customKeyFilter,
|
|
10533
10610
|
default: props.customFilter,
|
|
10534
|
-
filterKeys:
|
|
10611
|
+
filterKeys: props.filterKeys,
|
|
10535
10612
|
filterMode: props.filterMode,
|
|
10536
10613
|
noFilter: props.noFilter
|
|
10537
10614
|
});
|
|
10615
|
+
const originalItems = vue.unref(items);
|
|
10538
10616
|
results.forEach(_ref => {
|
|
10539
10617
|
let {
|
|
10540
10618
|
index,
|
|
10541
10619
|
matches
|
|
10542
10620
|
} = _ref;
|
|
10543
|
-
const item =
|
|
10621
|
+
const item = originalItems[index];
|
|
10544
10622
|
filteredItems.value.push(item);
|
|
10545
10623
|
filteredMatches.value.set(item.value, matches);
|
|
10546
10624
|
});
|
|
@@ -10569,8 +10647,9 @@
|
|
|
10569
10647
|
}, [text.substr(matches + length)])]) : text;
|
|
10570
10648
|
}
|
|
10571
10649
|
const makeVAutocompleteProps = propsFactory({
|
|
10572
|
-
|
|
10573
|
-
|
|
10650
|
+
autoSelectFirst: {
|
|
10651
|
+
type: [Boolean, String]
|
|
10652
|
+
},
|
|
10574
10653
|
search: String,
|
|
10575
10654
|
...makeFilterProps({
|
|
10576
10655
|
filterKeys: ['title']
|
|
@@ -10602,6 +10681,7 @@
|
|
|
10602
10681
|
const vTextFieldRef = vue.ref();
|
|
10603
10682
|
const isFocused = vue.shallowRef(false);
|
|
10604
10683
|
const isPristine = vue.shallowRef(true);
|
|
10684
|
+
const listHasFocus = vue.ref(false);
|
|
10605
10685
|
const vMenuRef = vue.ref();
|
|
10606
10686
|
const _menu = useProxiedModel(props, 'menu');
|
|
10607
10687
|
const menu = vue.computed({
|
|
@@ -10645,6 +10725,10 @@
|
|
|
10645
10725
|
});
|
|
10646
10726
|
const selected = vue.computed(() => selections.value.map(selection => selection.props.value));
|
|
10647
10727
|
const selection = vue.computed(() => selections.value[selectionIndex.value]);
|
|
10728
|
+
const highlightFirst = vue.computed(() => {
|
|
10729
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
10730
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
10731
|
+
});
|
|
10648
10732
|
const listRef = vue.ref();
|
|
10649
10733
|
function onClear(e) {
|
|
10650
10734
|
if (props.openOnClear) {
|
|
@@ -10656,6 +10740,13 @@
|
|
|
10656
10740
|
if (props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value) return;
|
|
10657
10741
|
menu.value = true;
|
|
10658
10742
|
}
|
|
10743
|
+
function onMousedownMenuIcon(e) {
|
|
10744
|
+
if (isFocused.value) {
|
|
10745
|
+
e.preventDefault();
|
|
10746
|
+
e.stopPropagation();
|
|
10747
|
+
}
|
|
10748
|
+
menu.value = !menu.value;
|
|
10749
|
+
}
|
|
10659
10750
|
function onKeydown(e) {
|
|
10660
10751
|
if (props.readonly || form?.isReadonly.value) return;
|
|
10661
10752
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
@@ -10670,10 +10761,16 @@
|
|
|
10670
10761
|
menu.value = false;
|
|
10671
10762
|
}
|
|
10672
10763
|
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
|
10764
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
|
|
10765
|
+
select(filteredItems.value[0]);
|
|
10766
|
+
}
|
|
10673
10767
|
isPristine.value = true;
|
|
10674
10768
|
}
|
|
10675
10769
|
if (e.key === 'ArrowDown') {
|
|
10676
10770
|
listRef.value?.focus('next');
|
|
10771
|
+
if (highlightFirst.value) {
|
|
10772
|
+
listRef.value?.focus('next');
|
|
10773
|
+
}
|
|
10677
10774
|
} else if (e.key === 'ArrowUp') {
|
|
10678
10775
|
listRef.value?.focus('prev');
|
|
10679
10776
|
}
|
|
@@ -10721,6 +10818,12 @@
|
|
|
10721
10818
|
}
|
|
10722
10819
|
function onFocusin(e) {
|
|
10723
10820
|
isFocused.value = true;
|
|
10821
|
+
setTimeout(() => {
|
|
10822
|
+
listHasFocus.value = true;
|
|
10823
|
+
});
|
|
10824
|
+
}
|
|
10825
|
+
function onFocusout(e) {
|
|
10826
|
+
listHasFocus.value = false;
|
|
10724
10827
|
}
|
|
10725
10828
|
const isSelecting = vue.shallowRef(false);
|
|
10726
10829
|
function select(item) {
|
|
@@ -10742,14 +10845,22 @@
|
|
|
10742
10845
|
vue.nextTick(() => isSelecting.value = false);
|
|
10743
10846
|
}
|
|
10744
10847
|
}
|
|
10745
|
-
vue.watch(isFocused, val => {
|
|
10848
|
+
vue.watch(isFocused, (val, oldVal) => {
|
|
10849
|
+
if (val === oldVal) return;
|
|
10746
10850
|
if (val) {
|
|
10747
10851
|
isSelecting.value = true;
|
|
10748
10852
|
search.value = props.multiple ? '' : String(selections.value.at(-1)?.props.title ?? '');
|
|
10749
10853
|
isPristine.value = true;
|
|
10750
10854
|
vue.nextTick(() => isSelecting.value = false);
|
|
10751
10855
|
} else {
|
|
10752
|
-
if (!props.multiple && !search.value) model.value = [];
|
|
10856
|
+
if (!props.multiple && !search.value) model.value = [];else if (highlightFirst.value && !listHasFocus.value && !selections.value.some(_ref2 => {
|
|
10857
|
+
let {
|
|
10858
|
+
value
|
|
10859
|
+
} = _ref2;
|
|
10860
|
+
return value === displayItems.value[0].value;
|
|
10861
|
+
})) {
|
|
10862
|
+
select(displayItems.value[0]);
|
|
10863
|
+
}
|
|
10753
10864
|
menu.value = false;
|
|
10754
10865
|
search.value = '';
|
|
10755
10866
|
selectionIndex.value = -1;
|
|
@@ -10780,10 +10891,10 @@
|
|
|
10780
10891
|
"class": ['v-autocomplete', `v-autocomplete--${props.multiple ? 'multiple' : 'single'}`, {
|
|
10781
10892
|
'v-autocomplete--active-menu': menu.value,
|
|
10782
10893
|
'v-autocomplete--chips': !!props.chips,
|
|
10894
|
+
'v-autocomplete--selection-slot': !!slots.selection,
|
|
10783
10895
|
'v-autocomplete--selecting-index': selectionIndex.value > -1
|
|
10784
10896
|
}, props.class],
|
|
10785
10897
|
"style": props.style,
|
|
10786
|
-
"appendInnerIcon": props.menuIcon,
|
|
10787
10898
|
"readonly": props.readonly,
|
|
10788
10899
|
"placeholder": isDirty ? undefined : props.placeholder,
|
|
10789
10900
|
"onClick:clear": onClear,
|
|
@@ -10809,36 +10920,40 @@
|
|
|
10809
10920
|
"selected": selected.value,
|
|
10810
10921
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
10811
10922
|
"onMousedown": e => e.preventDefault(),
|
|
10812
|
-
"onFocusin": onFocusin
|
|
10923
|
+
"onFocusin": onFocusin,
|
|
10924
|
+
"onFocusout": onFocusout
|
|
10813
10925
|
}, {
|
|
10814
10926
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
10815
10927
|
"title": t(props.noDataText)
|
|
10816
|
-
}, null)), slots['prepend-item']?.(), displayItems.value.map(item =>
|
|
10817
|
-
item,
|
|
10818
|
-
|
|
10928
|
+
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
10929
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
10930
|
+
key: index,
|
|
10931
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
10819
10932
|
onClick: () => select(item)
|
|
10820
|
-
})
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10933
|
+
});
|
|
10934
|
+
return slots.item?.({
|
|
10935
|
+
item,
|
|
10936
|
+
index,
|
|
10937
|
+
props: itemProps
|
|
10938
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
10939
|
+
prepend: _ref3 => {
|
|
10940
|
+
let {
|
|
10941
|
+
isSelected
|
|
10942
|
+
} = _ref3;
|
|
10943
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
10944
|
+
"key": item.value,
|
|
10945
|
+
"modelValue": isSelected,
|
|
10946
|
+
"ripple": false,
|
|
10947
|
+
"tabindex": "-1"
|
|
10948
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
10949
|
+
"icon": item.props.prependIcon
|
|
10950
|
+
}, null)]);
|
|
10951
|
+
},
|
|
10952
|
+
title: () => {
|
|
10953
|
+
return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
10954
|
+
}
|
|
10955
|
+
});
|
|
10956
|
+
}), slots['append-item']?.()]
|
|
10842
10957
|
})]
|
|
10843
10958
|
}), selections.value.map((item, index) => {
|
|
10844
10959
|
function onChipClose(e) {
|
|
@@ -10887,7 +11002,18 @@
|
|
|
10887
11002
|
}, [item.title, props.multiple && index < selections.value.length - 1 && vue.createVNode("span", {
|
|
10888
11003
|
"class": "v-autocomplete__selection-comma"
|
|
10889
11004
|
}, [vue.createTextVNode(",")])])]);
|
|
10890
|
-
})])
|
|
11005
|
+
})]),
|
|
11006
|
+
'append-inner': function () {
|
|
11007
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11008
|
+
args[_key] = arguments[_key];
|
|
11009
|
+
}
|
|
11010
|
+
return vue.createVNode(vue.Fragment, null, [slots['append-inner']?.(...args), props.menuIcon ? vue.createVNode(VIcon, {
|
|
11011
|
+
"class": "v-autocomplete__menu-icon",
|
|
11012
|
+
"icon": props.menuIcon,
|
|
11013
|
+
"onMousedown": onMousedownMenuIcon,
|
|
11014
|
+
"onClick": noop
|
|
11015
|
+
}, null) : undefined]);
|
|
11016
|
+
}
|
|
10891
11017
|
});
|
|
10892
11018
|
});
|
|
10893
11019
|
return forwardRefs({
|
|
@@ -11248,7 +11374,7 @@
|
|
|
11248
11374
|
const makeVBreadcrumbsDividerProps = propsFactory({
|
|
11249
11375
|
divider: [Number, String],
|
|
11250
11376
|
...makeComponentProps()
|
|
11251
|
-
}, 'v-
|
|
11377
|
+
}, 'v-breadcrumbs-divider');
|
|
11252
11378
|
const VBreadcrumbsDivider = genericComponent()({
|
|
11253
11379
|
name: 'VBreadcrumbsDivider',
|
|
11254
11380
|
props: makeVBreadcrumbsDividerProps(),
|
|
@@ -11336,7 +11462,7 @@
|
|
|
11336
11462
|
...makeTagProps({
|
|
11337
11463
|
tag: 'ul'
|
|
11338
11464
|
})
|
|
11339
|
-
}, 'v-
|
|
11465
|
+
}, 'v-breadcrumbs');
|
|
11340
11466
|
const VBreadcrumbs = genericComponent()({
|
|
11341
11467
|
name: 'VBreadcrumbs',
|
|
11342
11468
|
props: makeVBreadcrumbsProps(),
|
|
@@ -11685,6 +11811,7 @@
|
|
|
11685
11811
|
});
|
|
11686
11812
|
|
|
11687
11813
|
// Types
|
|
11814
|
+
|
|
11688
11815
|
const handleGesture = wrapper => {
|
|
11689
11816
|
const {
|
|
11690
11817
|
touchstartX,
|
|
@@ -12465,27 +12592,6 @@
|
|
|
12465
12592
|
|
|
12466
12593
|
// Types
|
|
12467
12594
|
|
|
12468
|
-
function has(obj, key) {
|
|
12469
|
-
return key.every(k => obj.hasOwnProperty(k));
|
|
12470
|
-
}
|
|
12471
|
-
function parseColor(color) {
|
|
12472
|
-
if (!color) return null;
|
|
12473
|
-
let hsva = null;
|
|
12474
|
-
if (typeof color === 'string') {
|
|
12475
|
-
const hex = parseHex(color);
|
|
12476
|
-
hsva = HexToHSV(hex);
|
|
12477
|
-
}
|
|
12478
|
-
if (typeof color === 'object') {
|
|
12479
|
-
if (has(color, ['r', 'g', 'b'])) {
|
|
12480
|
-
hsva = RGBtoHSV(color);
|
|
12481
|
-
} else if (has(color, ['h', 's', 'l'])) {
|
|
12482
|
-
hsva = HSLtoHSV(color);
|
|
12483
|
-
} else if (has(color, ['h', 's', 'v'])) {
|
|
12484
|
-
hsva = color;
|
|
12485
|
-
}
|
|
12486
|
-
}
|
|
12487
|
-
return hsva;
|
|
12488
|
-
}
|
|
12489
12595
|
function stripAlpha(color, stripAlpha) {
|
|
12490
12596
|
if (stripAlpha) {
|
|
12491
12597
|
const {
|
|
@@ -12734,6 +12840,7 @@
|
|
|
12734
12840
|
});
|
|
12735
12841
|
|
|
12736
12842
|
/* eslint-disable max-statements */
|
|
12843
|
+
// Composables
|
|
12737
12844
|
|
|
12738
12845
|
// Types
|
|
12739
12846
|
|
|
@@ -12748,9 +12855,15 @@
|
|
|
12748
12855
|
if ('touches' in e && e.touches.length) return e.touches[0][position];else if ('changedTouches' in e && e.changedTouches.length) return e.changedTouches[0][position];else return e[position];
|
|
12749
12856
|
}
|
|
12750
12857
|
const makeSliderProps = propsFactory({
|
|
12751
|
-
disabled:
|
|
12858
|
+
disabled: {
|
|
12859
|
+
type: Boolean,
|
|
12860
|
+
default: null
|
|
12861
|
+
},
|
|
12752
12862
|
error: Boolean,
|
|
12753
|
-
readonly:
|
|
12863
|
+
readonly: {
|
|
12864
|
+
type: Boolean,
|
|
12865
|
+
default: null
|
|
12866
|
+
},
|
|
12754
12867
|
max: {
|
|
12755
12868
|
type: [Number, String],
|
|
12756
12869
|
default: 100
|
|
@@ -13128,7 +13241,7 @@
|
|
|
13128
13241
|
"aria-valuemin": props.min,
|
|
13129
13242
|
"aria-valuemax": props.max,
|
|
13130
13243
|
"aria-valuenow": props.modelValue,
|
|
13131
|
-
"aria-readonly": readonly.value,
|
|
13244
|
+
"aria-readonly": !!readonly.value,
|
|
13132
13245
|
"aria-orientation": direction.value,
|
|
13133
13246
|
"onKeydown": !readonly.value ? onKeydown : undefined
|
|
13134
13247
|
}, [vue.createVNode("div", {
|
|
@@ -13380,8 +13493,8 @@
|
|
|
13380
13493
|
}, [vue.createVNode("input", {
|
|
13381
13494
|
"id": id.value,
|
|
13382
13495
|
"name": props.name || id.value,
|
|
13383
|
-
"disabled": props.disabled,
|
|
13384
|
-
"readonly": props.readonly,
|
|
13496
|
+
"disabled": !!props.disabled,
|
|
13497
|
+
"readonly": !!props.readonly,
|
|
13385
13498
|
"tabindex": "-1",
|
|
13386
13499
|
"value": model.value
|
|
13387
13500
|
}, null), vue.createVNode(VSliderTrack, {
|
|
@@ -13836,13 +13949,15 @@
|
|
|
13836
13949
|
}, [vue.createVNode("div", null, [props.swatches.map(swatch => vue.createVNode("div", {
|
|
13837
13950
|
"class": "v-color-picker-swatches__swatch"
|
|
13838
13951
|
}, [swatch.map(color => {
|
|
13839
|
-
const
|
|
13952
|
+
const rgba = parseColor(color);
|
|
13953
|
+
const hsva = RGBtoHSV(rgba);
|
|
13954
|
+
const background = RGBtoCSS(rgba);
|
|
13840
13955
|
return vue.createVNode("div", {
|
|
13841
13956
|
"class": "v-color-picker-swatches__color",
|
|
13842
13957
|
"onClick": () => hsva && emit('update:color', hsva)
|
|
13843
13958
|
}, [vue.createVNode("div", {
|
|
13844
13959
|
"style": {
|
|
13845
|
-
background
|
|
13960
|
+
background
|
|
13846
13961
|
}
|
|
13847
13962
|
}, [props.color && deepEqual(props.color, hsva) ? vue.createVNode(VIcon, {
|
|
13848
13963
|
"size": "x-small",
|
|
@@ -13903,8 +14018,13 @@
|
|
|
13903
14018
|
const mode = useProxiedModel(props, 'mode');
|
|
13904
14019
|
const lastPickedColor = vue.ref(null);
|
|
13905
14020
|
const currentColor = useProxiedModel(props, 'modelValue', undefined, v => {
|
|
13906
|
-
let c
|
|
13907
|
-
|
|
14021
|
+
let c;
|
|
14022
|
+
try {
|
|
14023
|
+
c = RGBtoHSV(parseColor(v));
|
|
14024
|
+
} catch (err) {
|
|
14025
|
+
consoleWarn(err);
|
|
14026
|
+
return null;
|
|
14027
|
+
}
|
|
13908
14028
|
if (lastPickedColor.value) {
|
|
13909
14029
|
c = {
|
|
13910
14030
|
...c,
|
|
@@ -14003,8 +14123,9 @@
|
|
|
14003
14123
|
}, [text.substr(matches + length)])]) : text;
|
|
14004
14124
|
}
|
|
14005
14125
|
const makeVComboboxProps = propsFactory({
|
|
14006
|
-
|
|
14007
|
-
|
|
14126
|
+
autoSelectFirst: {
|
|
14127
|
+
type: [Boolean, String]
|
|
14128
|
+
},
|
|
14008
14129
|
delimiters: Array,
|
|
14009
14130
|
...makeFilterProps({
|
|
14010
14131
|
filterKeys: ['title']
|
|
@@ -14040,6 +14161,7 @@
|
|
|
14040
14161
|
const vTextFieldRef = vue.ref();
|
|
14041
14162
|
const isFocused = vue.shallowRef(false);
|
|
14042
14163
|
const isPristine = vue.shallowRef(true);
|
|
14164
|
+
const listHasFocus = vue.ref(false);
|
|
14043
14165
|
const vMenuRef = vue.ref();
|
|
14044
14166
|
const _menu = useProxiedModel(props, 'menu');
|
|
14045
14167
|
const menu = vue.computed({
|
|
@@ -14074,14 +14196,14 @@
|
|
|
14074
14196
|
set: val => {
|
|
14075
14197
|
_search.value = val;
|
|
14076
14198
|
if (!props.multiple) {
|
|
14077
|
-
model.value = [transformItem$
|
|
14199
|
+
model.value = [transformItem$3(props, val)];
|
|
14078
14200
|
}
|
|
14079
14201
|
if (val && props.multiple && props.delimiters?.length) {
|
|
14080
14202
|
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
|
14081
14203
|
if (values.length > 1) {
|
|
14082
14204
|
values.forEach(v => {
|
|
14083
14205
|
v = v.trim();
|
|
14084
|
-
if (v) select(transformItem$
|
|
14206
|
+
if (v) select(transformItem$3(props, v));
|
|
14085
14207
|
});
|
|
14086
14208
|
_search.value = '';
|
|
14087
14209
|
}
|
|
@@ -14122,6 +14244,10 @@
|
|
|
14122
14244
|
});
|
|
14123
14245
|
const selected = vue.computed(() => selections.value.map(selection => selection.props.value));
|
|
14124
14246
|
const selection = vue.computed(() => selections.value[selectionIndex.value]);
|
|
14247
|
+
const highlightFirst = vue.computed(() => {
|
|
14248
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
14249
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
14250
|
+
});
|
|
14125
14251
|
const listRef = vue.ref();
|
|
14126
14252
|
function onClear(e) {
|
|
14127
14253
|
cleared = true;
|
|
@@ -14133,6 +14259,13 @@
|
|
|
14133
14259
|
if (props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value) return;
|
|
14134
14260
|
menu.value = true;
|
|
14135
14261
|
}
|
|
14262
|
+
function onMousedownMenuIcon(e) {
|
|
14263
|
+
if (isFocused.value) {
|
|
14264
|
+
e.preventDefault();
|
|
14265
|
+
e.stopPropagation();
|
|
14266
|
+
}
|
|
14267
|
+
menu.value = !menu.value;
|
|
14268
|
+
}
|
|
14136
14269
|
function onKeydown(e) {
|
|
14137
14270
|
if (props.readonly || form?.isReadonly.value) return;
|
|
14138
14271
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
@@ -14147,6 +14280,9 @@
|
|
|
14147
14280
|
menu.value = false;
|
|
14148
14281
|
}
|
|
14149
14282
|
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
|
14283
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
|
|
14284
|
+
select(filteredItems.value[0]);
|
|
14285
|
+
}
|
|
14150
14286
|
isPristine.value = true;
|
|
14151
14287
|
}
|
|
14152
14288
|
if (e.key === 'ArrowDown') {
|
|
@@ -14187,7 +14323,7 @@
|
|
|
14187
14323
|
}
|
|
14188
14324
|
}
|
|
14189
14325
|
if (e.key === 'Enter' && search.value) {
|
|
14190
|
-
select(transformItem$
|
|
14326
|
+
select(transformItem$3(props, search.value));
|
|
14191
14327
|
search.value = '';
|
|
14192
14328
|
}
|
|
14193
14329
|
}
|
|
@@ -14221,17 +14357,31 @@
|
|
|
14221
14357
|
}
|
|
14222
14358
|
function onFocusin(e) {
|
|
14223
14359
|
isFocused.value = true;
|
|
14360
|
+
setTimeout(() => {
|
|
14361
|
+
listHasFocus.value = true;
|
|
14362
|
+
});
|
|
14363
|
+
}
|
|
14364
|
+
function onFocusout(e) {
|
|
14365
|
+
listHasFocus.value = false;
|
|
14224
14366
|
}
|
|
14225
14367
|
vue.watch(filteredItems, val => {
|
|
14226
14368
|
if (!val.length && props.hideNoData) menu.value = false;
|
|
14227
14369
|
});
|
|
14228
|
-
vue.watch(isFocused, val => {
|
|
14229
|
-
if (val) return;
|
|
14370
|
+
vue.watch(isFocused, (val, oldVal) => {
|
|
14371
|
+
if (val || val === oldVal) return;
|
|
14230
14372
|
selectionIndex.value = -1;
|
|
14231
14373
|
menu.value = false;
|
|
14232
|
-
if (!
|
|
14233
|
-
|
|
14234
|
-
|
|
14374
|
+
if (highlightFirst.value && !listHasFocus.value && !selections.value.some(_ref2 => {
|
|
14375
|
+
let {
|
|
14376
|
+
value
|
|
14377
|
+
} = _ref2;
|
|
14378
|
+
return value === displayItems.value[0].value;
|
|
14379
|
+
})) {
|
|
14380
|
+
select(displayItems.value[0]);
|
|
14381
|
+
} else if (props.multiple && search.value) {
|
|
14382
|
+
model.value = [...model.value, transformItem$3(props, search.value)];
|
|
14383
|
+
search.value = '';
|
|
14384
|
+
}
|
|
14235
14385
|
});
|
|
14236
14386
|
useRender(() => {
|
|
14237
14387
|
const hasChips = !!(props.chips || slots.chip);
|
|
@@ -14252,11 +14402,11 @@
|
|
|
14252
14402
|
"class": ['v-combobox', {
|
|
14253
14403
|
'v-combobox--active-menu': menu.value,
|
|
14254
14404
|
'v-combobox--chips': !!props.chips,
|
|
14405
|
+
'v-combobox--selection-slot': !!slots.selection,
|
|
14255
14406
|
'v-combobox--selecting-index': selectionIndex.value > -1,
|
|
14256
14407
|
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
|
14257
14408
|
}, props.class],
|
|
14258
14409
|
"style": props.style,
|
|
14259
|
-
"appendInnerIcon": props.items.length ? props.menuIcon : undefined,
|
|
14260
14410
|
"readonly": props.readonly,
|
|
14261
14411
|
"placeholder": isDirty ? undefined : props.placeholder,
|
|
14262
14412
|
"onClick:clear": onClear,
|
|
@@ -14282,36 +14432,40 @@
|
|
|
14282
14432
|
"selected": selected.value,
|
|
14283
14433
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
14284
14434
|
"onMousedown": e => e.preventDefault(),
|
|
14285
|
-
"onFocusin": onFocusin
|
|
14435
|
+
"onFocusin": onFocusin,
|
|
14436
|
+
"onFocusout": onFocusout
|
|
14286
14437
|
}, {
|
|
14287
14438
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
14288
14439
|
"title": t(props.noDataText)
|
|
14289
|
-
}, null)), slots['prepend-item']?.(), displayItems.value.map(item =>
|
|
14290
|
-
item,
|
|
14291
|
-
|
|
14440
|
+
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
14441
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
14442
|
+
key: index,
|
|
14443
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
14292
14444
|
onClick: () => select(item)
|
|
14293
|
-
})
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14445
|
+
});
|
|
14446
|
+
return slots.item?.({
|
|
14447
|
+
item,
|
|
14448
|
+
index,
|
|
14449
|
+
props: itemProps
|
|
14450
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
14451
|
+
prepend: _ref3 => {
|
|
14452
|
+
let {
|
|
14453
|
+
isSelected
|
|
14454
|
+
} = _ref3;
|
|
14455
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
14456
|
+
"key": item.value,
|
|
14457
|
+
"modelValue": isSelected,
|
|
14458
|
+
"ripple": false,
|
|
14459
|
+
"tabindex": "-1"
|
|
14460
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
14461
|
+
"icon": item.props.prependIcon
|
|
14462
|
+
}, null)]);
|
|
14463
|
+
},
|
|
14464
|
+
title: () => {
|
|
14465
|
+
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
14466
|
+
}
|
|
14467
|
+
});
|
|
14468
|
+
}), slots['append-item']?.()]
|
|
14315
14469
|
})]
|
|
14316
14470
|
}), selections.value.map((item, index) => {
|
|
14317
14471
|
function onChipClose(e) {
|
|
@@ -14360,7 +14514,18 @@
|
|
|
14360
14514
|
}, [item.title, props.multiple && index < selections.value.length - 1 && vue.createVNode("span", {
|
|
14361
14515
|
"class": "v-combobox__selection-comma"
|
|
14362
14516
|
}, [vue.createTextVNode(",")])])]);
|
|
14363
|
-
})])
|
|
14517
|
+
})]),
|
|
14518
|
+
'append-inner': function () {
|
|
14519
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14520
|
+
args[_key] = arguments[_key];
|
|
14521
|
+
}
|
|
14522
|
+
return vue.createVNode(vue.Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? vue.createVNode(VIcon, {
|
|
14523
|
+
"class": "v-combobox__menu-icon",
|
|
14524
|
+
"icon": props.menuIcon,
|
|
14525
|
+
"onMousedown": onMousedownMenuIcon,
|
|
14526
|
+
"onClick": noop
|
|
14527
|
+
}, null) : undefined]);
|
|
14528
|
+
}
|
|
14364
14529
|
});
|
|
14365
14530
|
});
|
|
14366
14531
|
return forwardRefs({
|
|
@@ -14791,6 +14956,7 @@
|
|
|
14791
14956
|
const vFieldRef = vue.ref();
|
|
14792
14957
|
const inputRef = vue.ref();
|
|
14793
14958
|
const isActive = vue.computed(() => isFocused.value || props.active);
|
|
14959
|
+
const isPlainOrUnderlined = vue.computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
14794
14960
|
function onFocus() {
|
|
14795
14961
|
if (inputRef.value !== document.activeElement) {
|
|
14796
14962
|
inputRef.value?.focus();
|
|
@@ -14834,10 +15000,15 @@
|
|
|
14834
15000
|
"ref": vInputRef,
|
|
14835
15001
|
"modelValue": model.value,
|
|
14836
15002
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
14837
|
-
"class": ['v-file-input',
|
|
15003
|
+
"class": ['v-file-input', {
|
|
15004
|
+
'v-file-input--chips': !!props.chips,
|
|
15005
|
+
'v-file-input--selection-slot': !!slots.selection,
|
|
15006
|
+
'v-text-field--plain-underlined': isPlainOrUnderlined.value
|
|
15007
|
+
}, props.class],
|
|
14838
15008
|
"style": props.style,
|
|
14839
15009
|
"onClick:prepend": onClickPrepend
|
|
14840
15010
|
}, rootAttrs, inputProps, {
|
|
15011
|
+
"centerAffix": !isPlainOrUnderlined.value,
|
|
14841
15012
|
"focused": isFocused.value
|
|
14842
15013
|
}), {
|
|
14843
15014
|
...slots,
|
|
@@ -15389,9 +15560,6 @@
|
|
|
15389
15560
|
});
|
|
15390
15561
|
|
|
15391
15562
|
// Composables
|
|
15392
|
-
|
|
15393
|
-
// Types
|
|
15394
|
-
|
|
15395
15563
|
const VItem = genericComponent()({
|
|
15396
15564
|
name: 'VItem',
|
|
15397
15565
|
props: makeGroupItemProps(),
|
|
@@ -16808,15 +16976,15 @@
|
|
|
16808
16976
|
}, [vue.createVNode("input", {
|
|
16809
16977
|
"id": `${id.value}_start`,
|
|
16810
16978
|
"name": props.name || id.value,
|
|
16811
|
-
"disabled": props.disabled,
|
|
16812
|
-
"readonly": props.readonly,
|
|
16979
|
+
"disabled": !!props.disabled,
|
|
16980
|
+
"readonly": !!props.readonly,
|
|
16813
16981
|
"tabindex": "-1",
|
|
16814
16982
|
"value": model.value[0]
|
|
16815
16983
|
}, null), vue.createVNode("input", {
|
|
16816
16984
|
"id": `${id.value}_stop`,
|
|
16817
16985
|
"name": props.name || id.value,
|
|
16818
|
-
"disabled": props.disabled,
|
|
16819
|
-
"readonly": props.readonly,
|
|
16986
|
+
"disabled": !!props.disabled,
|
|
16987
|
+
"readonly": !!props.readonly,
|
|
16820
16988
|
"tabindex": "-1",
|
|
16821
16989
|
"value": model.value[1]
|
|
16822
16990
|
}, null), vue.createVNode(VSliderTrack, {
|
|
@@ -18093,6 +18261,11 @@
|
|
|
18093
18261
|
}
|
|
18094
18262
|
}
|
|
18095
18263
|
const sizerRef = vue.ref();
|
|
18264
|
+
const rows = vue.ref(+props.rows);
|
|
18265
|
+
const isPlainOrUnderlined = vue.computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
18266
|
+
vue.watchEffect(() => {
|
|
18267
|
+
if (!props.autoGrow) rows.value = +props.rows;
|
|
18268
|
+
});
|
|
18096
18269
|
function calculateInputHeight() {
|
|
18097
18270
|
if (!props.autoGrow) return;
|
|
18098
18271
|
vue.nextTick(() => {
|
|
@@ -18104,7 +18277,9 @@
|
|
|
18104
18277
|
const lineHeight = parseFloat(style.lineHeight);
|
|
18105
18278
|
const minHeight = Math.max(parseFloat(props.rows) * lineHeight + padding, parseFloat(fieldStyle.getPropertyValue('--v-input-control-height')));
|
|
18106
18279
|
const maxHeight = parseFloat(props.maxRows) * lineHeight + padding || Infinity;
|
|
18107
|
-
|
|
18280
|
+
const newHeight = clamp(height ?? 0, minHeight, maxHeight);
|
|
18281
|
+
rows.value = Math.floor((newHeight - padding) / lineHeight);
|
|
18282
|
+
controlHeight.value = convertToUnit(newHeight);
|
|
18108
18283
|
});
|
|
18109
18284
|
}
|
|
18110
18285
|
vue.onMounted(calculateInputHeight);
|
|
@@ -18144,10 +18319,11 @@
|
|
|
18144
18319
|
'v-text-field--suffixed': props.suffix,
|
|
18145
18320
|
'v-textarea--auto-grow': props.autoGrow,
|
|
18146
18321
|
'v-textarea--no-resize': props.noResize || props.autoGrow,
|
|
18147
|
-
'v-text-field--
|
|
18322
|
+
'v-text-field--plain-underlined': isPlainOrUnderlined.value
|
|
18148
18323
|
}, props.class],
|
|
18149
18324
|
"style": props.style
|
|
18150
18325
|
}, rootAttrs, inputProps, {
|
|
18326
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18151
18327
|
"focused": isFocused.value
|
|
18152
18328
|
}), {
|
|
18153
18329
|
...slots,
|
|
@@ -18171,6 +18347,7 @@
|
|
|
18171
18347
|
"role": "textbox"
|
|
18172
18348
|
}, fieldProps, {
|
|
18173
18349
|
"active": isActive.value || isDirty.value,
|
|
18350
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18174
18351
|
"dirty": isDirty.value || props.dirty,
|
|
18175
18352
|
"disabled": isDisabled.value,
|
|
18176
18353
|
"focused": isFocused.value,
|
|
@@ -18790,11 +18967,83 @@
|
|
|
18790
18967
|
}
|
|
18791
18968
|
});
|
|
18792
18969
|
|
|
18793
|
-
// Composables
|
|
18794
|
-
|
|
18795
18970
|
// Types
|
|
18796
18971
|
|
|
18797
|
-
const
|
|
18972
|
+
const makeVBottomSheetProps = propsFactory({
|
|
18973
|
+
inset: Boolean,
|
|
18974
|
+
...makeVDialogProps({
|
|
18975
|
+
contentClass: 'v-bottom-sheet__content',
|
|
18976
|
+
transition: 'bottom-sheet-transition'
|
|
18977
|
+
})
|
|
18978
|
+
}, 'v-bottom-sheet');
|
|
18979
|
+
const VBottomSheet = genericComponent()({
|
|
18980
|
+
name: 'VBottomSheet',
|
|
18981
|
+
props: makeVBottomSheetProps(),
|
|
18982
|
+
emits: {
|
|
18983
|
+
'update:modelValue': value => true
|
|
18984
|
+
},
|
|
18985
|
+
setup(props, _ref) {
|
|
18986
|
+
let {
|
|
18987
|
+
slots
|
|
18988
|
+
} = _ref;
|
|
18989
|
+
const isActive = useProxiedModel(props, 'modelValue');
|
|
18990
|
+
useRender(() => {
|
|
18991
|
+
const [dialogProps] = VDialog.filterProps(props);
|
|
18992
|
+
return vue.createVNode(VDialog, vue.mergeProps(dialogProps, {
|
|
18993
|
+
"modelValue": isActive.value,
|
|
18994
|
+
"onUpdate:modelValue": $event => isActive.value = $event,
|
|
18995
|
+
"class": ['v-bottom-sheet', {
|
|
18996
|
+
'v-bottom-sheet--inset': props.inset
|
|
18997
|
+
}]
|
|
18998
|
+
}), slots);
|
|
18999
|
+
});
|
|
19000
|
+
return {};
|
|
19001
|
+
}
|
|
19002
|
+
});
|
|
19003
|
+
|
|
19004
|
+
// Utilities
|
|
19005
|
+
|
|
19006
|
+
// Types
|
|
19007
|
+
|
|
19008
|
+
// Composables
|
|
19009
|
+
const makeDataIteratorItemProps = propsFactory({
|
|
19010
|
+
items: {
|
|
19011
|
+
type: Array,
|
|
19012
|
+
default: () => []
|
|
19013
|
+
},
|
|
19014
|
+
itemValue: {
|
|
19015
|
+
type: [String, Array, Function],
|
|
19016
|
+
default: 'value'
|
|
19017
|
+
},
|
|
19018
|
+
returnObject: Boolean
|
|
19019
|
+
}, 'v-data-iterator-item');
|
|
19020
|
+
function transformItem$1(props, item) {
|
|
19021
|
+
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue);
|
|
19022
|
+
return {
|
|
19023
|
+
type: 'item',
|
|
19024
|
+
value,
|
|
19025
|
+
raw: item
|
|
19026
|
+
};
|
|
19027
|
+
}
|
|
19028
|
+
function transformItems$1(props, items) {
|
|
19029
|
+
const array = [];
|
|
19030
|
+
for (const item of items) {
|
|
19031
|
+
array.push(transformItem$1(props, item));
|
|
19032
|
+
}
|
|
19033
|
+
return array;
|
|
19034
|
+
}
|
|
19035
|
+
function useDataIteratorItems(props) {
|
|
19036
|
+
const items = vue.computed(() => transformItems$1(props, props.items));
|
|
19037
|
+
return {
|
|
19038
|
+
items
|
|
19039
|
+
};
|
|
19040
|
+
}
|
|
19041
|
+
|
|
19042
|
+
// Composables
|
|
19043
|
+
|
|
19044
|
+
// Types
|
|
19045
|
+
|
|
19046
|
+
const makeDataTablePaginateProps = propsFactory({
|
|
18798
19047
|
page: {
|
|
18799
19048
|
type: [Number, String],
|
|
18800
19049
|
default: 1
|
|
@@ -18840,38 +19089,605 @@
|
|
|
18840
19089
|
itemsPerPage.value = value;
|
|
18841
19090
|
page.value = 1;
|
|
18842
19091
|
}
|
|
18843
|
-
|
|
18844
|
-
page,
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
}
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
|
|
18864
|
-
|
|
18865
|
-
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
19092
|
+
function nextPage() {
|
|
19093
|
+
page.value = clamp(page.value + 1, 1, pageCount.value);
|
|
19094
|
+
}
|
|
19095
|
+
function prevPage() {
|
|
19096
|
+
page.value = clamp(page.value - 1, 1, pageCount.value);
|
|
19097
|
+
}
|
|
19098
|
+
function setPage(value) {
|
|
19099
|
+
page.value = clamp(value, 1, pageCount.value);
|
|
19100
|
+
}
|
|
19101
|
+
const data = {
|
|
19102
|
+
page,
|
|
19103
|
+
itemsPerPage,
|
|
19104
|
+
startIndex,
|
|
19105
|
+
stopIndex,
|
|
19106
|
+
pageCount,
|
|
19107
|
+
itemsLength,
|
|
19108
|
+
nextPage,
|
|
19109
|
+
prevPage,
|
|
19110
|
+
setPage,
|
|
19111
|
+
setItemsPerPage
|
|
19112
|
+
};
|
|
19113
|
+
vue.provide(VDataTablePaginationSymbol, data);
|
|
19114
|
+
return data;
|
|
19115
|
+
}
|
|
19116
|
+
function usePagination() {
|
|
19117
|
+
const data = vue.inject(VDataTablePaginationSymbol);
|
|
19118
|
+
if (!data) throw new Error('Missing pagination!');
|
|
19119
|
+
return data;
|
|
19120
|
+
}
|
|
19121
|
+
function usePaginatedItems(options) {
|
|
19122
|
+
const {
|
|
19123
|
+
items,
|
|
19124
|
+
startIndex,
|
|
19125
|
+
stopIndex,
|
|
19126
|
+
itemsPerPage
|
|
19127
|
+
} = options;
|
|
19128
|
+
const paginatedItems = vue.computed(() => {
|
|
19129
|
+
if (itemsPerPage.value <= 0) return items.value;
|
|
19130
|
+
return items.value.slice(startIndex.value, stopIndex.value);
|
|
19131
|
+
});
|
|
19132
|
+
return {
|
|
19133
|
+
paginatedItems
|
|
19134
|
+
};
|
|
19135
|
+
}
|
|
19136
|
+
|
|
19137
|
+
// Composables
|
|
19138
|
+
|
|
19139
|
+
// Types
|
|
19140
|
+
|
|
19141
|
+
const makeDataTableSortProps = propsFactory({
|
|
19142
|
+
sortBy: {
|
|
19143
|
+
type: Array,
|
|
19144
|
+
default: () => []
|
|
19145
|
+
},
|
|
19146
|
+
customKeySort: Object,
|
|
19147
|
+
multiSort: Boolean,
|
|
19148
|
+
mustSort: Boolean
|
|
19149
|
+
}, 'v-data-table-sort');
|
|
19150
|
+
const VDataTableSortSymbol = Symbol.for('vuetify:data-table-sort');
|
|
19151
|
+
function createSort(props) {
|
|
19152
|
+
const sortBy = useProxiedModel(props, 'sortBy');
|
|
19153
|
+
const mustSort = vue.toRef(props, 'mustSort');
|
|
19154
|
+
const multiSort = vue.toRef(props, 'multiSort');
|
|
19155
|
+
return {
|
|
19156
|
+
sortBy,
|
|
19157
|
+
mustSort,
|
|
19158
|
+
multiSort
|
|
19159
|
+
};
|
|
19160
|
+
}
|
|
19161
|
+
function provideSort(options) {
|
|
19162
|
+
const {
|
|
19163
|
+
sortBy,
|
|
19164
|
+
mustSort,
|
|
19165
|
+
multiSort,
|
|
19166
|
+
page
|
|
19167
|
+
} = options;
|
|
19168
|
+
const toggleSort = column => {
|
|
19169
|
+
let newSortBy = sortBy.value.map(x => ({
|
|
19170
|
+
...x
|
|
19171
|
+
})) ?? [];
|
|
19172
|
+
const item = newSortBy.find(x => x.key === column.key);
|
|
19173
|
+
if (!item) {
|
|
19174
|
+
if (multiSort.value) newSortBy = [...newSortBy, {
|
|
19175
|
+
key: column.key,
|
|
19176
|
+
order: 'asc'
|
|
19177
|
+
}];else newSortBy = [{
|
|
19178
|
+
key: column.key,
|
|
19179
|
+
order: 'asc'
|
|
19180
|
+
}];
|
|
19181
|
+
} else if (item.order === 'desc') {
|
|
19182
|
+
if (mustSort.value) {
|
|
19183
|
+
item.order = 'asc';
|
|
19184
|
+
} else {
|
|
19185
|
+
newSortBy = newSortBy.filter(x => x.key !== column.key);
|
|
19186
|
+
}
|
|
19187
|
+
} else {
|
|
19188
|
+
item.order = 'desc';
|
|
19189
|
+
}
|
|
19190
|
+
sortBy.value = newSortBy;
|
|
19191
|
+
if (page) page.value = 1;
|
|
19192
|
+
};
|
|
19193
|
+
function isSorted(column) {
|
|
19194
|
+
return !!sortBy.value.find(item => item.key === column.key);
|
|
19195
|
+
}
|
|
19196
|
+
const data = {
|
|
19197
|
+
sortBy,
|
|
19198
|
+
toggleSort,
|
|
19199
|
+
isSorted
|
|
19200
|
+
};
|
|
19201
|
+
vue.provide(VDataTableSortSymbol, data);
|
|
19202
|
+
return data;
|
|
19203
|
+
}
|
|
19204
|
+
function useSort() {
|
|
19205
|
+
const data = vue.inject(VDataTableSortSymbol);
|
|
19206
|
+
if (!data) throw new Error('Missing sort!');
|
|
19207
|
+
return data;
|
|
19208
|
+
}
|
|
19209
|
+
function useSortedItems(props, items, sortBy) {
|
|
19210
|
+
const locale = useLocale();
|
|
19211
|
+
const sortedItems = vue.computed(() => {
|
|
19212
|
+
if (!sortBy.value.length) return items.value;
|
|
19213
|
+
return sortItems(items.value, sortBy.value, locale.current.value, props.customKeySort);
|
|
19214
|
+
});
|
|
19215
|
+
return {
|
|
19216
|
+
sortedItems
|
|
19217
|
+
};
|
|
19218
|
+
}
|
|
19219
|
+
function sortItems(items, sortByItems, locale, customSorters) {
|
|
19220
|
+
const stringCollator = new Intl.Collator(locale, {
|
|
19221
|
+
sensitivity: 'accent',
|
|
19222
|
+
usage: 'sort'
|
|
19223
|
+
});
|
|
19224
|
+
return [...items].sort((a, b) => {
|
|
19225
|
+
for (let i = 0; i < sortByItems.length; i++) {
|
|
19226
|
+
const sortKey = sortByItems[i].key;
|
|
19227
|
+
const sortOrder = sortByItems[i].order ?? 'asc';
|
|
19228
|
+
if (sortOrder === false) continue;
|
|
19229
|
+
let sortA = getObjectValueByPath(a.raw, sortKey);
|
|
19230
|
+
let sortB = getObjectValueByPath(b.raw, sortKey);
|
|
19231
|
+
if (sortOrder === 'desc') {
|
|
19232
|
+
[sortA, sortB] = [sortB, sortA];
|
|
19233
|
+
}
|
|
19234
|
+
if (customSorters?.[sortKey]) {
|
|
19235
|
+
const customResult = customSorters[sortKey](sortA, sortB);
|
|
19236
|
+
if (!customResult) continue;
|
|
19237
|
+
return customResult;
|
|
19238
|
+
}
|
|
19239
|
+
|
|
19240
|
+
// Check if both cannot be evaluated
|
|
19241
|
+
if (sortA == null || sortB == null) {
|
|
19242
|
+
continue;
|
|
19243
|
+
}
|
|
19244
|
+
|
|
19245
|
+
// Dates should be compared numerically
|
|
19246
|
+
if (sortA instanceof Date && sortB instanceof Date) {
|
|
19247
|
+
return sortA.getTime() - sortB.getTime();
|
|
19248
|
+
}
|
|
19249
|
+
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase());
|
|
19250
|
+
if (sortA !== sortB) {
|
|
19251
|
+
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB);
|
|
19252
|
+
return stringCollator.compare(sortA, sortB);
|
|
19253
|
+
}
|
|
19254
|
+
}
|
|
19255
|
+
return 0;
|
|
19256
|
+
});
|
|
19257
|
+
}
|
|
19258
|
+
|
|
19259
|
+
// Utilities
|
|
19260
|
+
|
|
19261
|
+
// Types
|
|
19262
|
+
|
|
19263
|
+
const makeDataTableExpandProps = propsFactory({
|
|
19264
|
+
expandOnClick: Boolean,
|
|
19265
|
+
showExpand: Boolean,
|
|
19266
|
+
expanded: {
|
|
19267
|
+
type: Array,
|
|
19268
|
+
default: () => []
|
|
19269
|
+
}
|
|
19270
|
+
}, 'v-data-table-expand');
|
|
19271
|
+
const VDataTableExpandedKey = Symbol.for('vuetify:datatable:expanded');
|
|
19272
|
+
function provideExpanded(props) {
|
|
19273
|
+
const expandOnClick = vue.toRef(props, 'expandOnClick');
|
|
19274
|
+
const expanded = useProxiedModel(props, 'expanded', props.expanded, v => {
|
|
19275
|
+
return new Set(v);
|
|
19276
|
+
}, v => {
|
|
19277
|
+
return [...v.values()];
|
|
19278
|
+
});
|
|
19279
|
+
function expand(item, value) {
|
|
19280
|
+
const newExpanded = new Set(expanded.value);
|
|
19281
|
+
if (!value) {
|
|
19282
|
+
newExpanded.delete(item.value);
|
|
19283
|
+
} else {
|
|
19284
|
+
newExpanded.add(item.value);
|
|
19285
|
+
}
|
|
19286
|
+
expanded.value = newExpanded;
|
|
19287
|
+
}
|
|
19288
|
+
function isExpanded(item) {
|
|
19289
|
+
return expanded.value.has(item.value);
|
|
19290
|
+
}
|
|
19291
|
+
function toggleExpand(item) {
|
|
19292
|
+
expand(item, !isExpanded(item));
|
|
19293
|
+
}
|
|
19294
|
+
const data = {
|
|
19295
|
+
expand,
|
|
19296
|
+
expanded,
|
|
19297
|
+
expandOnClick,
|
|
19298
|
+
isExpanded,
|
|
19299
|
+
toggleExpand
|
|
19300
|
+
};
|
|
19301
|
+
vue.provide(VDataTableExpandedKey, data);
|
|
19302
|
+
return data;
|
|
19303
|
+
}
|
|
19304
|
+
function useExpanded() {
|
|
19305
|
+
const data = vue.inject(VDataTableExpandedKey);
|
|
19306
|
+
if (!data) throw new Error('foo');
|
|
19307
|
+
return data;
|
|
19308
|
+
}
|
|
19309
|
+
|
|
19310
|
+
// Composables
|
|
19311
|
+
|
|
19312
|
+
// Types
|
|
19313
|
+
|
|
19314
|
+
const makeDataTableGroupProps = propsFactory({
|
|
19315
|
+
groupBy: {
|
|
19316
|
+
type: Array,
|
|
19317
|
+
default: () => []
|
|
19318
|
+
}
|
|
19319
|
+
}, 'data-table-group');
|
|
19320
|
+
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
19321
|
+
function createGroupBy(props) {
|
|
19322
|
+
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19323
|
+
return {
|
|
19324
|
+
groupBy
|
|
19325
|
+
};
|
|
19326
|
+
}
|
|
19327
|
+
function provideGroupBy(options) {
|
|
19328
|
+
const {
|
|
19329
|
+
groupBy,
|
|
19330
|
+
sortBy
|
|
19331
|
+
} = options;
|
|
19332
|
+
const opened = vue.ref(new Set());
|
|
19333
|
+
const sortByWithGroups = vue.computed(() => {
|
|
19334
|
+
return groupBy.value.map(val => ({
|
|
19335
|
+
...val,
|
|
19336
|
+
order: val.order ?? false
|
|
19337
|
+
})).concat(sortBy.value);
|
|
19338
|
+
});
|
|
19339
|
+
function isGroupOpen(group) {
|
|
19340
|
+
return opened.value.has(group.id);
|
|
19341
|
+
}
|
|
19342
|
+
function toggleGroup(group) {
|
|
19343
|
+
const newOpened = new Set(opened.value);
|
|
19344
|
+
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
19345
|
+
opened.value = newOpened;
|
|
19346
|
+
}
|
|
19347
|
+
function extractRows(items) {
|
|
19348
|
+
function dive(group) {
|
|
19349
|
+
const arr = [];
|
|
19350
|
+
for (const item of group.items) {
|
|
19351
|
+
if ('type' in item && item.type === 'group') {
|
|
19352
|
+
arr.push(...dive(item));
|
|
19353
|
+
} else {
|
|
19354
|
+
arr.push(item);
|
|
19355
|
+
}
|
|
19356
|
+
}
|
|
19357
|
+
return arr;
|
|
19358
|
+
}
|
|
19359
|
+
return dive({
|
|
19360
|
+
type: 'group',
|
|
19361
|
+
items,
|
|
19362
|
+
id: 'dummy',
|
|
19363
|
+
key: 'dummy',
|
|
19364
|
+
value: 'dummy',
|
|
19365
|
+
depth: 0
|
|
19366
|
+
});
|
|
19367
|
+
}
|
|
19368
|
+
|
|
19369
|
+
// onBeforeMount(() => {
|
|
19370
|
+
// for (const key of groupedItems.value.keys()) {
|
|
19371
|
+
// opened.value.add(key)
|
|
19372
|
+
// }
|
|
19373
|
+
// })
|
|
19374
|
+
|
|
19375
|
+
const data = {
|
|
19376
|
+
sortByWithGroups,
|
|
19377
|
+
toggleGroup,
|
|
19378
|
+
opened,
|
|
19379
|
+
groupBy,
|
|
19380
|
+
extractRows,
|
|
19381
|
+
isGroupOpen
|
|
19382
|
+
};
|
|
19383
|
+
vue.provide(VDataTableGroupSymbol, data);
|
|
19384
|
+
return data;
|
|
19385
|
+
}
|
|
19386
|
+
function useGroupBy() {
|
|
19387
|
+
const data = vue.inject(VDataTableGroupSymbol);
|
|
19388
|
+
if (!data) throw new Error('Missing group!');
|
|
19389
|
+
return data;
|
|
19390
|
+
}
|
|
19391
|
+
function groupItemsByProperty(items, groupBy) {
|
|
19392
|
+
if (!items.length) return [];
|
|
19393
|
+
const groups = new Map();
|
|
19394
|
+
for (const item of items) {
|
|
19395
|
+
const value = getObjectValueByPath(item.raw, groupBy);
|
|
19396
|
+
if (!groups.has(value)) {
|
|
19397
|
+
groups.set(value, []);
|
|
19398
|
+
}
|
|
19399
|
+
groups.get(value).push(item);
|
|
19400
|
+
}
|
|
19401
|
+
return groups;
|
|
19402
|
+
}
|
|
19403
|
+
function groupItems(items, groupBy) {
|
|
19404
|
+
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19405
|
+
let prefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root';
|
|
19406
|
+
if (!groupBy.length) return [];
|
|
19407
|
+
const groupedItems = groupItemsByProperty(items, groupBy[0]);
|
|
19408
|
+
const groups = [];
|
|
19409
|
+
const rest = groupBy.slice(1);
|
|
19410
|
+
groupedItems.forEach((items, value) => {
|
|
19411
|
+
const key = groupBy[0];
|
|
19412
|
+
const id = `${prefix}_${key}_${value}`;
|
|
19413
|
+
groups.push({
|
|
19414
|
+
depth,
|
|
19415
|
+
id,
|
|
19416
|
+
key,
|
|
19417
|
+
value,
|
|
19418
|
+
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
19419
|
+
type: 'group'
|
|
19420
|
+
});
|
|
19421
|
+
});
|
|
19422
|
+
return groups;
|
|
19423
|
+
}
|
|
19424
|
+
function flattenItems(items, opened) {
|
|
19425
|
+
const flatItems = [];
|
|
19426
|
+
for (const item of items) {
|
|
19427
|
+
// TODO: make this better
|
|
19428
|
+
if ('type' in item && item.type === 'group') {
|
|
19429
|
+
if (item.value != null) {
|
|
19430
|
+
flatItems.push(item);
|
|
19431
|
+
}
|
|
19432
|
+
if (opened.has(item.id) || item.value == null) {
|
|
19433
|
+
flatItems.push(...flattenItems(item.items, opened));
|
|
19434
|
+
}
|
|
19435
|
+
} else {
|
|
19436
|
+
flatItems.push(item);
|
|
19437
|
+
}
|
|
19438
|
+
}
|
|
19439
|
+
return flatItems;
|
|
19440
|
+
}
|
|
19441
|
+
function useGroupedItems(items, groupBy, opened) {
|
|
19442
|
+
const flatItems = vue.computed(() => {
|
|
19443
|
+
if (!groupBy.value.length) return items.value;
|
|
19444
|
+
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
19445
|
+
return flattenItems(groupedItems, opened.value);
|
|
19446
|
+
});
|
|
19447
|
+
return {
|
|
19448
|
+
flatItems
|
|
19449
|
+
};
|
|
19450
|
+
}
|
|
19451
|
+
|
|
19452
|
+
// Composables
|
|
19453
|
+
|
|
19454
|
+
// Types
|
|
19455
|
+
|
|
19456
|
+
const makeDataTableSelectProps = propsFactory({
|
|
19457
|
+
showSelect: Boolean,
|
|
19458
|
+
modelValue: {
|
|
19459
|
+
type: Array,
|
|
19460
|
+
default: () => []
|
|
19461
|
+
}
|
|
19462
|
+
}, 'v-data-table-select');
|
|
19463
|
+
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
19464
|
+
function provideSelection(props, allItems) {
|
|
19465
|
+
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
19466
|
+
return new Set(v);
|
|
19467
|
+
}, v => {
|
|
19468
|
+
return [...v.values()];
|
|
19469
|
+
});
|
|
19470
|
+
function isSelected(items) {
|
|
19471
|
+
return wrapInArray(items).every(item => selected.value.has(item.value));
|
|
19472
|
+
}
|
|
19473
|
+
function isSomeSelected(items) {
|
|
19474
|
+
return wrapInArray(items).some(item => selected.value.has(item.value));
|
|
19475
|
+
}
|
|
19476
|
+
function select(items, value) {
|
|
19477
|
+
const newSelected = new Set(selected.value);
|
|
19478
|
+
for (const item of items) {
|
|
19479
|
+
if (value) newSelected.add(item.value);else newSelected.delete(item.value);
|
|
19480
|
+
}
|
|
19481
|
+
selected.value = newSelected;
|
|
19482
|
+
}
|
|
19483
|
+
function toggleSelect(item) {
|
|
19484
|
+
select([item], !isSelected([item]));
|
|
19485
|
+
}
|
|
19486
|
+
function selectAll(value) {
|
|
19487
|
+
select(allItems.value, value);
|
|
19488
|
+
}
|
|
19489
|
+
const someSelected = vue.computed(() => selected.value.size > 0);
|
|
19490
|
+
const allSelected = vue.computed(() => isSelected(allItems.value));
|
|
19491
|
+
const data = {
|
|
19492
|
+
toggleSelect,
|
|
19493
|
+
select,
|
|
19494
|
+
selectAll,
|
|
19495
|
+
isSelected,
|
|
19496
|
+
isSomeSelected,
|
|
19497
|
+
someSelected,
|
|
19498
|
+
allSelected
|
|
19499
|
+
};
|
|
19500
|
+
vue.provide(VDataTableSelectionSymbol, data);
|
|
19501
|
+
return data;
|
|
19502
|
+
}
|
|
19503
|
+
function useSelection() {
|
|
19504
|
+
const data = vue.inject(VDataTableSelectionSymbol);
|
|
19505
|
+
if (!data) throw new Error('Missing selection!');
|
|
19506
|
+
return data;
|
|
19507
|
+
}
|
|
19508
|
+
|
|
19509
|
+
// Utilities
|
|
19510
|
+
|
|
19511
|
+
// Types
|
|
19512
|
+
|
|
19513
|
+
function useOptions(_ref) {
|
|
19514
|
+
let {
|
|
19515
|
+
page,
|
|
19516
|
+
itemsPerPage,
|
|
19517
|
+
sortBy,
|
|
19518
|
+
groupBy,
|
|
19519
|
+
search
|
|
19520
|
+
} = _ref;
|
|
19521
|
+
const vm = getCurrentInstance('VDataTable');
|
|
19522
|
+
const options = vue.computed(() => ({
|
|
19523
|
+
page: page.value,
|
|
19524
|
+
itemsPerPage: itemsPerPage.value,
|
|
19525
|
+
sortBy: sortBy.value,
|
|
19526
|
+
groupBy: groupBy.value,
|
|
19527
|
+
search: search.value
|
|
19528
|
+
}));
|
|
19529
|
+
|
|
19530
|
+
// Reset page when searching
|
|
19531
|
+
vue.watch(() => search?.value, () => {
|
|
19532
|
+
page.value = 1;
|
|
19533
|
+
});
|
|
19534
|
+
let oldOptions = null;
|
|
19535
|
+
vue.watch(options, () => {
|
|
19536
|
+
if (deepEqual(oldOptions, options.value)) return;
|
|
19537
|
+
vm.emit('update:options', options.value);
|
|
19538
|
+
oldOptions = options.value;
|
|
19539
|
+
}, {
|
|
19540
|
+
deep: true,
|
|
19541
|
+
immediate: true
|
|
19542
|
+
});
|
|
19543
|
+
}
|
|
19544
|
+
|
|
19545
|
+
// Types
|
|
19546
|
+
|
|
19547
|
+
const makeVDataIteratorProps = propsFactory({
|
|
19548
|
+
search: String,
|
|
19549
|
+
loading: Boolean,
|
|
19550
|
+
...makeComponentProps(),
|
|
19551
|
+
...makeDataIteratorItemProps(),
|
|
19552
|
+
...makeDataTableSelectProps(),
|
|
19553
|
+
...makeDataTableSortProps(),
|
|
19554
|
+
...makeDataTablePaginateProps({
|
|
19555
|
+
itemsPerPage: 5
|
|
19556
|
+
}),
|
|
19557
|
+
...makeDataTableExpandProps(),
|
|
19558
|
+
...makeDataTableGroupProps(),
|
|
19559
|
+
...makeFilterProps(),
|
|
19560
|
+
...makeTagProps()
|
|
19561
|
+
}, 'v-data-iterator');
|
|
19562
|
+
const VDataIterator = genericComponent()({
|
|
19563
|
+
name: 'VDataIterator',
|
|
19564
|
+
props: makeVDataIteratorProps(),
|
|
19565
|
+
emits: {
|
|
19566
|
+
'update:modelValue': value => true,
|
|
19567
|
+
'update:groupBy': value => true,
|
|
19568
|
+
'update:page': value => true,
|
|
19569
|
+
'update:itemsPerPage': value => true,
|
|
19570
|
+
'update:sortBy': value => true,
|
|
19571
|
+
'update:options': value => true,
|
|
19572
|
+
'update:expanded': value => true
|
|
19573
|
+
},
|
|
19574
|
+
setup(props, _ref) {
|
|
19575
|
+
let {
|
|
19576
|
+
slots
|
|
19577
|
+
} = _ref;
|
|
19578
|
+
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19579
|
+
const search = vue.toRef(props, 'search');
|
|
19580
|
+
const {
|
|
19581
|
+
items
|
|
19582
|
+
} = useDataIteratorItems(props);
|
|
19583
|
+
const {
|
|
19584
|
+
filteredItems
|
|
19585
|
+
} = useFilter(props, items, search, {
|
|
19586
|
+
transform: item => item.raw
|
|
19587
|
+
});
|
|
19588
|
+
const {
|
|
19589
|
+
sortBy,
|
|
19590
|
+
multiSort,
|
|
19591
|
+
mustSort
|
|
19592
|
+
} = createSort(props);
|
|
19593
|
+
const {
|
|
19594
|
+
page,
|
|
19595
|
+
itemsPerPage
|
|
19596
|
+
} = createPagination(props);
|
|
19597
|
+
const {
|
|
19598
|
+
toggleSort
|
|
19599
|
+
} = provideSort({
|
|
19600
|
+
sortBy,
|
|
19601
|
+
multiSort,
|
|
19602
|
+
mustSort,
|
|
19603
|
+
page
|
|
19604
|
+
});
|
|
19605
|
+
const {
|
|
19606
|
+
sortByWithGroups,
|
|
19607
|
+
opened,
|
|
19608
|
+
extractRows,
|
|
19609
|
+
isGroupOpen,
|
|
19610
|
+
toggleGroup
|
|
19611
|
+
} = provideGroupBy({
|
|
19612
|
+
groupBy,
|
|
19613
|
+
sortBy
|
|
19614
|
+
});
|
|
19615
|
+
const {
|
|
19616
|
+
sortedItems
|
|
19617
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
19618
|
+
const {
|
|
19619
|
+
flatItems
|
|
19620
|
+
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
19621
|
+
const itemsLength = vue.computed(() => flatItems.value.length);
|
|
19622
|
+
const {
|
|
19623
|
+
startIndex,
|
|
19624
|
+
stopIndex,
|
|
19625
|
+
pageCount,
|
|
19626
|
+
prevPage,
|
|
19627
|
+
nextPage,
|
|
19628
|
+
setItemsPerPage,
|
|
19629
|
+
setPage
|
|
19630
|
+
} = providePagination({
|
|
19631
|
+
page,
|
|
19632
|
+
itemsPerPage,
|
|
19633
|
+
itemsLength
|
|
19634
|
+
});
|
|
19635
|
+
const {
|
|
19636
|
+
paginatedItems
|
|
19637
|
+
} = usePaginatedItems({
|
|
19638
|
+
items: flatItems,
|
|
19639
|
+
startIndex,
|
|
19640
|
+
stopIndex,
|
|
19641
|
+
itemsPerPage
|
|
19642
|
+
});
|
|
19643
|
+
const paginatedItemsWithoutGroups = vue.computed(() => extractRows(paginatedItems.value));
|
|
19644
|
+
const {
|
|
19645
|
+
isSelected,
|
|
19646
|
+
select,
|
|
19647
|
+
selectAll,
|
|
19648
|
+
toggleSelect
|
|
19649
|
+
} = provideSelection(props, paginatedItemsWithoutGroups);
|
|
19650
|
+
const {
|
|
19651
|
+
isExpanded,
|
|
19652
|
+
toggleExpand
|
|
19653
|
+
} = provideExpanded(props);
|
|
19654
|
+
useOptions({
|
|
19655
|
+
page,
|
|
19656
|
+
itemsPerPage,
|
|
19657
|
+
sortBy,
|
|
19658
|
+
groupBy,
|
|
19659
|
+
search
|
|
19660
|
+
});
|
|
19661
|
+
const slotProps = vue.computed(() => ({
|
|
19662
|
+
page: page.value,
|
|
19663
|
+
itemsPerPage: itemsPerPage.value,
|
|
19664
|
+
sortBy: sortBy.value,
|
|
19665
|
+
pageCount: pageCount.value,
|
|
19666
|
+
toggleSort,
|
|
19667
|
+
prevPage,
|
|
19668
|
+
nextPage,
|
|
19669
|
+
setPage,
|
|
19670
|
+
setItemsPerPage,
|
|
19671
|
+
isSelected,
|
|
19672
|
+
select,
|
|
19673
|
+
selectAll,
|
|
19674
|
+
toggleSelect,
|
|
19675
|
+
isExpanded,
|
|
19676
|
+
toggleExpand,
|
|
19677
|
+
isGroupOpen,
|
|
19678
|
+
toggleGroup,
|
|
19679
|
+
items: paginatedItems.value,
|
|
19680
|
+
groupedItems: flatItems.value
|
|
19681
|
+
}));
|
|
19682
|
+
useRender(() => vue.createVNode(props.tag, {
|
|
19683
|
+
"class": ['v-data-iterator', props.class],
|
|
19684
|
+
"style": props.style
|
|
19685
|
+
}, {
|
|
19686
|
+
default: () => [slots.header?.(slotProps.value), !paginatedItems.value.length ? slots['no-data']?.() : slots.default?.(slotProps.value), slots.footer?.(slotProps.value)]
|
|
19687
|
+
}));
|
|
19688
|
+
return {};
|
|
19689
|
+
}
|
|
19690
|
+
});
|
|
18875
19691
|
|
|
18876
19692
|
// Types
|
|
18877
19693
|
|
|
@@ -19092,285 +19908,104 @@
|
|
|
19092
19908
|
row: flat[index].row
|
|
19093
19909
|
});
|
|
19094
19910
|
}
|
|
19095
|
-
if (options?.showSelect?.value) {
|
|
19096
|
-
const index = flat.findIndex(_ref2 => {
|
|
19097
|
-
let {
|
|
19098
|
-
column
|
|
19099
|
-
} = _ref2;
|
|
19100
|
-
return column.key === 'data-table-select';
|
|
19101
|
-
});
|
|
19102
|
-
if (index < 0) flat.unshift({
|
|
19103
|
-
column: {
|
|
19104
|
-
...defaultActionHeader,
|
|
19105
|
-
key: 'data-table-select',
|
|
19106
|
-
rowspan: rowCount
|
|
19107
|
-
},
|
|
19108
|
-
row: 0
|
|
19109
|
-
});else flat.splice(index, 1, {
|
|
19110
|
-
column: {
|
|
19111
|
-
...defaultActionHeader,
|
|
19112
|
-
...flat[index].column
|
|
19113
|
-
},
|
|
19114
|
-
row: flat[index].row
|
|
19115
|
-
});
|
|
19116
|
-
}
|
|
19117
|
-
if (options?.showExpand?.value) {
|
|
19118
|
-
const index = flat.findIndex(_ref3 => {
|
|
19119
|
-
let {
|
|
19120
|
-
column
|
|
19121
|
-
} = _ref3;
|
|
19122
|
-
return column.key === 'data-table-expand';
|
|
19123
|
-
});
|
|
19124
|
-
if (index < 0) flat.push({
|
|
19125
|
-
column: {
|
|
19126
|
-
...defaultActionHeader,
|
|
19127
|
-
key: 'data-table-expand',
|
|
19128
|
-
rowspan: rowCount
|
|
19129
|
-
},
|
|
19130
|
-
row: 0
|
|
19131
|
-
});else flat.splice(index, 1, {
|
|
19132
|
-
column: {
|
|
19133
|
-
...defaultActionHeader,
|
|
19134
|
-
...flat[index].column
|
|
19135
|
-
},
|
|
19136
|
-
row: flat[index].row
|
|
19137
|
-
});
|
|
19138
|
-
}
|
|
19139
|
-
const fixedRows = createRange(rowCount).map(() => []);
|
|
19140
|
-
const fixedOffsets = createRange(rowCount).fill(0);
|
|
19141
|
-
let count = 0;
|
|
19142
|
-
flat.forEach(_ref4 => {
|
|
19143
|
-
let {
|
|
19144
|
-
column,
|
|
19145
|
-
row
|
|
19146
|
-
} = _ref4;
|
|
19147
|
-
const id = column.key ?? `data-table-column-${count++}`;
|
|
19148
|
-
for (let i = row; i <= row + (column.rowspan ?? 1) - 1; i++) {
|
|
19149
|
-
fixedRows[i].push({
|
|
19150
|
-
...column,
|
|
19151
|
-
key: id,
|
|
19152
|
-
fixedOffset: fixedOffsets[i],
|
|
19153
|
-
sortable: column.sortable ?? !!column.key
|
|
19154
|
-
});
|
|
19155
|
-
fixedOffsets[i] += column.width ?? 0;
|
|
19156
|
-
}
|
|
19157
|
-
});
|
|
19158
|
-
fixedRows.forEach(row => {
|
|
19159
|
-
for (let i = row.length; i--; i >= 0) {
|
|
19160
|
-
if (row[i].fixed) {
|
|
19161
|
-
row[i].lastFixed = true;
|
|
19162
|
-
return;
|
|
19163
|
-
}
|
|
19164
|
-
}
|
|
19165
|
-
});
|
|
19166
|
-
const seen = new Set();
|
|
19167
|
-
headers.value = fixedRows.map(row => {
|
|
19168
|
-
const filtered = [];
|
|
19169
|
-
for (const column of row) {
|
|
19170
|
-
if (!seen.has(column.key)) {
|
|
19171
|
-
seen.add(column.key);
|
|
19172
|
-
filtered.push(column);
|
|
19173
|
-
}
|
|
19174
|
-
}
|
|
19175
|
-
return filtered;
|
|
19176
|
-
});
|
|
19177
|
-
columns.value = fixedRows.at(-1) ?? [];
|
|
19178
|
-
}, {
|
|
19179
|
-
deep: true,
|
|
19180
|
-
immediate: true
|
|
19181
|
-
});
|
|
19182
|
-
const data = {
|
|
19183
|
-
headers,
|
|
19184
|
-
columns
|
|
19185
|
-
};
|
|
19186
|
-
vue.provide(VDataTableHeadersSymbol, data);
|
|
19187
|
-
return data;
|
|
19188
|
-
}
|
|
19189
|
-
function useHeaders() {
|
|
19190
|
-
const data = vue.inject(VDataTableHeadersSymbol);
|
|
19191
|
-
if (!data) throw new Error('Missing headers!');
|
|
19192
|
-
return data;
|
|
19193
|
-
}
|
|
19194
|
-
|
|
19195
|
-
// Composables
|
|
19196
|
-
|
|
19197
|
-
// Types
|
|
19198
|
-
|
|
19199
|
-
const makeDataTableSelectProps = propsFactory({
|
|
19200
|
-
showSelect: Boolean,
|
|
19201
|
-
modelValue: {
|
|
19202
|
-
type: Array,
|
|
19203
|
-
default: () => []
|
|
19204
|
-
}
|
|
19205
|
-
}, 'v-data-table-select');
|
|
19206
|
-
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
19207
|
-
function provideSelection(props, allItems) {
|
|
19208
|
-
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
19209
|
-
return new Set(v);
|
|
19210
|
-
}, v => {
|
|
19211
|
-
return [...v.values()];
|
|
19212
|
-
});
|
|
19213
|
-
function isSelected(items) {
|
|
19214
|
-
return items.every(item => selected.value.has(item.value));
|
|
19215
|
-
}
|
|
19216
|
-
function isSomeSelected(items) {
|
|
19217
|
-
return items.some(item => selected.value.has(item.value));
|
|
19218
|
-
}
|
|
19219
|
-
function select(items, value) {
|
|
19220
|
-
const newSelected = new Set(selected.value);
|
|
19221
|
-
for (const item of items) {
|
|
19222
|
-
if (value) newSelected.add(item.value);else newSelected.delete(item.value);
|
|
19223
|
-
}
|
|
19224
|
-
selected.value = newSelected;
|
|
19225
|
-
}
|
|
19226
|
-
function toggleSelect(item) {
|
|
19227
|
-
select([item], !isSelected([item]));
|
|
19228
|
-
}
|
|
19229
|
-
function selectAll(value) {
|
|
19230
|
-
select(allItems.value, value);
|
|
19231
|
-
}
|
|
19232
|
-
const someSelected = vue.computed(() => selected.value.size > 0);
|
|
19233
|
-
const allSelected = vue.computed(() => isSelected(allItems.value));
|
|
19234
|
-
const data = {
|
|
19235
|
-
toggleSelect,
|
|
19236
|
-
select,
|
|
19237
|
-
selectAll,
|
|
19238
|
-
isSelected,
|
|
19239
|
-
isSomeSelected,
|
|
19240
|
-
someSelected,
|
|
19241
|
-
allSelected
|
|
19242
|
-
};
|
|
19243
|
-
vue.provide(VDataTableSelectionSymbol, data);
|
|
19244
|
-
return data;
|
|
19245
|
-
}
|
|
19246
|
-
function useSelection() {
|
|
19247
|
-
const data = vue.inject(VDataTableSelectionSymbol);
|
|
19248
|
-
if (!data) throw new Error('Missing selection!');
|
|
19249
|
-
return data;
|
|
19250
|
-
}
|
|
19251
|
-
|
|
19252
|
-
// Composables
|
|
19253
|
-
|
|
19254
|
-
// Types
|
|
19255
|
-
|
|
19256
|
-
const makeDataTableSortProps = propsFactory({
|
|
19257
|
-
sortBy: {
|
|
19258
|
-
type: Array,
|
|
19259
|
-
default: () => []
|
|
19260
|
-
},
|
|
19261
|
-
multiSort: Boolean,
|
|
19262
|
-
mustSort: Boolean
|
|
19263
|
-
}, 'v-data-table-sort');
|
|
19264
|
-
const VDataTableSortSymbol = Symbol.for('vuetify:data-table-sort');
|
|
19265
|
-
function createSort(props) {
|
|
19266
|
-
const sortBy = useProxiedModel(props, 'sortBy');
|
|
19267
|
-
const mustSort = vue.toRef(props, 'mustSort');
|
|
19268
|
-
const multiSort = vue.toRef(props, 'multiSort');
|
|
19269
|
-
return {
|
|
19270
|
-
sortBy,
|
|
19271
|
-
mustSort,
|
|
19272
|
-
multiSort
|
|
19273
|
-
};
|
|
19274
|
-
}
|
|
19275
|
-
function provideSort(options) {
|
|
19276
|
-
const {
|
|
19277
|
-
sortBy,
|
|
19278
|
-
mustSort,
|
|
19279
|
-
multiSort,
|
|
19280
|
-
page
|
|
19281
|
-
} = options;
|
|
19282
|
-
const toggleSort = key => {
|
|
19283
|
-
let newSortBy = sortBy.value.map(x => ({
|
|
19284
|
-
...x
|
|
19285
|
-
})) ?? [];
|
|
19286
|
-
const item = newSortBy.find(x => x.key === key);
|
|
19287
|
-
if (!item) {
|
|
19288
|
-
if (multiSort.value) newSortBy = [...newSortBy, {
|
|
19289
|
-
key,
|
|
19290
|
-
order: 'asc'
|
|
19291
|
-
}];else newSortBy = [{
|
|
19292
|
-
key,
|
|
19293
|
-
order: 'asc'
|
|
19294
|
-
}];
|
|
19295
|
-
} else if (item.order === 'desc') {
|
|
19296
|
-
if (mustSort.value) {
|
|
19297
|
-
item.order = 'asc';
|
|
19298
|
-
} else {
|
|
19299
|
-
newSortBy = newSortBy.filter(x => x.key !== key);
|
|
19300
|
-
}
|
|
19301
|
-
} else {
|
|
19302
|
-
item.order = 'desc';
|
|
19911
|
+
if (options?.showSelect?.value) {
|
|
19912
|
+
const index = flat.findIndex(_ref2 => {
|
|
19913
|
+
let {
|
|
19914
|
+
column
|
|
19915
|
+
} = _ref2;
|
|
19916
|
+
return column.key === 'data-table-select';
|
|
19917
|
+
});
|
|
19918
|
+
if (index < 0) flat.unshift({
|
|
19919
|
+
column: {
|
|
19920
|
+
...defaultActionHeader,
|
|
19921
|
+
key: 'data-table-select',
|
|
19922
|
+
rowspan: rowCount
|
|
19923
|
+
},
|
|
19924
|
+
row: 0
|
|
19925
|
+
});else flat.splice(index, 1, {
|
|
19926
|
+
column: {
|
|
19927
|
+
...defaultActionHeader,
|
|
19928
|
+
...flat[index].column
|
|
19929
|
+
},
|
|
19930
|
+
row: flat[index].row
|
|
19931
|
+
});
|
|
19303
19932
|
}
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19933
|
+
if (options?.showExpand?.value) {
|
|
19934
|
+
const index = flat.findIndex(_ref3 => {
|
|
19935
|
+
let {
|
|
19936
|
+
column
|
|
19937
|
+
} = _ref3;
|
|
19938
|
+
return column.key === 'data-table-expand';
|
|
19939
|
+
});
|
|
19940
|
+
if (index < 0) flat.push({
|
|
19941
|
+
column: {
|
|
19942
|
+
...defaultActionHeader,
|
|
19943
|
+
key: 'data-table-expand',
|
|
19944
|
+
rowspan: rowCount
|
|
19945
|
+
},
|
|
19946
|
+
row: 0
|
|
19947
|
+
});else flat.splice(index, 1, {
|
|
19948
|
+
column: {
|
|
19949
|
+
...defaultActionHeader,
|
|
19950
|
+
...flat[index].column
|
|
19951
|
+
},
|
|
19952
|
+
row: flat[index].row
|
|
19953
|
+
});
|
|
19954
|
+
}
|
|
19955
|
+
const fixedRows = createRange(rowCount).map(() => []);
|
|
19956
|
+
const fixedOffsets = createRange(rowCount).fill(0);
|
|
19957
|
+
flat.forEach(_ref4 => {
|
|
19958
|
+
let {
|
|
19959
|
+
column,
|
|
19960
|
+
row
|
|
19961
|
+
} = _ref4;
|
|
19962
|
+
const key = column.key;
|
|
19963
|
+
for (let i = row; i <= row + (column.rowspan ?? 1) - 1; i++) {
|
|
19964
|
+
fixedRows[i].push({
|
|
19965
|
+
...column,
|
|
19966
|
+
key,
|
|
19967
|
+
fixedOffset: fixedOffsets[i],
|
|
19968
|
+
sortable: column.sortable ?? !!column.key
|
|
19969
|
+
});
|
|
19970
|
+
fixedOffsets[i] += column.width ?? 0;
|
|
19971
|
+
}
|
|
19972
|
+
});
|
|
19973
|
+
fixedRows.forEach(row => {
|
|
19974
|
+
for (let i = row.length; i--; i >= 0) {
|
|
19975
|
+
if (row[i].fixed) {
|
|
19976
|
+
row[i].lastFixed = true;
|
|
19977
|
+
return;
|
|
19978
|
+
}
|
|
19979
|
+
}
|
|
19980
|
+
});
|
|
19981
|
+
const seen = new Set();
|
|
19982
|
+
headers.value = fixedRows.map(row => {
|
|
19983
|
+
const filtered = [];
|
|
19984
|
+
for (const column of row) {
|
|
19985
|
+
if (!seen.has(column.key)) {
|
|
19986
|
+
seen.add(column.key);
|
|
19987
|
+
filtered.push(column);
|
|
19988
|
+
}
|
|
19989
|
+
}
|
|
19990
|
+
return filtered;
|
|
19991
|
+
});
|
|
19992
|
+
columns.value = fixedRows.at(-1) ?? [];
|
|
19993
|
+
}, {
|
|
19994
|
+
deep: true,
|
|
19995
|
+
immediate: true
|
|
19996
|
+
});
|
|
19307
19997
|
const data = {
|
|
19308
|
-
|
|
19309
|
-
|
|
19998
|
+
headers,
|
|
19999
|
+
columns
|
|
19310
20000
|
};
|
|
19311
|
-
vue.provide(
|
|
20001
|
+
vue.provide(VDataTableHeadersSymbol, data);
|
|
19312
20002
|
return data;
|
|
19313
20003
|
}
|
|
19314
|
-
function
|
|
19315
|
-
const data = vue.inject(
|
|
19316
|
-
if (!data) throw new Error('Missing
|
|
20004
|
+
function useHeaders() {
|
|
20005
|
+
const data = vue.inject(VDataTableHeadersSymbol);
|
|
20006
|
+
if (!data) throw new Error('Missing headers!');
|
|
19317
20007
|
return data;
|
|
19318
20008
|
}
|
|
19319
|
-
function useSortedItems(items, sortBy, columns) {
|
|
19320
|
-
// TODO: Put this in separate prop customKeySort to match filter composable?
|
|
19321
|
-
const customSorters = vue.computed(() => {
|
|
19322
|
-
return columns.value.reduce((obj, item) => {
|
|
19323
|
-
if (item.sort) obj[item.key] = item.sort;
|
|
19324
|
-
return obj;
|
|
19325
|
-
}, {});
|
|
19326
|
-
});
|
|
19327
|
-
const sortedItems = vue.computed(() => {
|
|
19328
|
-
if (!sortBy.value.length) return items.value;
|
|
19329
|
-
return sortItems(items.value, sortBy.value, 'en', customSorters.value);
|
|
19330
|
-
});
|
|
19331
|
-
return {
|
|
19332
|
-
sortedItems
|
|
19333
|
-
};
|
|
19334
|
-
}
|
|
19335
|
-
function sortItems(items, sortByItems, locale, customSorters) {
|
|
19336
|
-
const stringCollator = new Intl.Collator(locale, {
|
|
19337
|
-
sensitivity: 'accent',
|
|
19338
|
-
usage: 'sort'
|
|
19339
|
-
});
|
|
19340
|
-
return [...items].sort((a, b) => {
|
|
19341
|
-
for (let i = 0; i < sortByItems.length; i++) {
|
|
19342
|
-
const sortKey = sortByItems[i].key;
|
|
19343
|
-
const sortOrder = sortByItems[i].order;
|
|
19344
|
-
if (sortOrder === false) continue;
|
|
19345
|
-
let sortA = getObjectValueByPath(a.raw, sortKey);
|
|
19346
|
-
let sortB = getObjectValueByPath(b.raw, sortKey);
|
|
19347
|
-
if (sortOrder === 'desc') {
|
|
19348
|
-
[sortA, sortB] = [sortB, sortA];
|
|
19349
|
-
}
|
|
19350
|
-
if (customSorters?.[sortKey]) {
|
|
19351
|
-
const customResult = customSorters[sortKey](sortA, sortB);
|
|
19352
|
-
if (!customResult) continue;
|
|
19353
|
-
return customResult;
|
|
19354
|
-
}
|
|
19355
|
-
|
|
19356
|
-
// Check if both cannot be evaluated
|
|
19357
|
-
if (sortA == null || sortB == null) {
|
|
19358
|
-
continue;
|
|
19359
|
-
}
|
|
19360
|
-
|
|
19361
|
-
// Dates should be compared numerically
|
|
19362
|
-
if (sortA instanceof Date && sortB instanceof Date) {
|
|
19363
|
-
return sortA.getTime() - sortB.getTime();
|
|
19364
|
-
}
|
|
19365
|
-
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase());
|
|
19366
|
-
if (sortA !== sortB) {
|
|
19367
|
-
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB);
|
|
19368
|
-
return stringCollator.compare(sortA, sortB);
|
|
19369
|
-
}
|
|
19370
|
-
}
|
|
19371
|
-
return 0;
|
|
19372
|
-
});
|
|
19373
|
-
}
|
|
19374
20009
|
|
|
19375
20010
|
// Types
|
|
19376
20011
|
|
|
@@ -19398,7 +20033,8 @@
|
|
|
19398
20033
|
} = _ref;
|
|
19399
20034
|
const {
|
|
19400
20035
|
toggleSort,
|
|
19401
|
-
sortBy
|
|
20036
|
+
sortBy,
|
|
20037
|
+
isSorted
|
|
19402
20038
|
} = useSort();
|
|
19403
20039
|
const {
|
|
19404
20040
|
someSelected,
|
|
@@ -19413,7 +20049,7 @@
|
|
|
19413
20049
|
loaderClasses
|
|
19414
20050
|
} = useLoader(props);
|
|
19415
20051
|
const getFixedStyles = (column, y) => {
|
|
19416
|
-
if (!props.sticky && !column.fixed) return
|
|
20052
|
+
if (!props.sticky && !column.fixed) return undefined;
|
|
19417
20053
|
return {
|
|
19418
20054
|
position: 'sticky',
|
|
19419
20055
|
zIndex: column.fixed ? 4 : props.sticky ? 3 : undefined,
|
|
@@ -19423,8 +20059,8 @@
|
|
|
19423
20059
|
top: props.sticky ? `calc(var(--v-table-header-height) * ${y})` : undefined
|
|
19424
20060
|
};
|
|
19425
20061
|
};
|
|
19426
|
-
function getSortIcon(
|
|
19427
|
-
const item = sortBy.value.find(item => item.key ===
|
|
20062
|
+
function getSortIcon(column) {
|
|
20063
|
+
const item = sortBy.value.find(item => item.key === column.key);
|
|
19428
20064
|
if (!item) return props.sortAscIcon;
|
|
19429
20065
|
return item.order === 'asc' ? props.sortAscIcon : props.sortDescIcon;
|
|
19430
20066
|
}
|
|
@@ -19436,6 +20072,7 @@
|
|
|
19436
20072
|
headers: headers.value,
|
|
19437
20073
|
columns: columns.value,
|
|
19438
20074
|
toggleSort,
|
|
20075
|
+
isSorted,
|
|
19439
20076
|
sortBy: sortBy.value,
|
|
19440
20077
|
someSelected: someSelected.value,
|
|
19441
20078
|
allSelected: allSelected.value,
|
|
@@ -19449,14 +20086,13 @@
|
|
|
19449
20086
|
x,
|
|
19450
20087
|
y
|
|
19451
20088
|
} = _ref2;
|
|
19452
|
-
const isSorted = !!sortBy.value.find(x => x.key === column.key);
|
|
19453
20089
|
const noPadding = column.key === 'data-table-select' || column.key === 'data-table-expand';
|
|
19454
20090
|
return vue.createVNode(VDataTableColumn, {
|
|
19455
20091
|
"tag": "th",
|
|
19456
20092
|
"align": column.align,
|
|
19457
20093
|
"class": ['v-data-table__th', {
|
|
19458
20094
|
'v-data-table__th--sortable': column.sortable,
|
|
19459
|
-
'v-data-table__th--sorted': isSorted
|
|
20095
|
+
'v-data-table__th--sorted': isSorted(column)
|
|
19460
20096
|
}, loaderClasses.value],
|
|
19461
20097
|
"style": {
|
|
19462
20098
|
width: convertToUnit(column.width),
|
|
@@ -19465,7 +20101,7 @@
|
|
|
19465
20101
|
},
|
|
19466
20102
|
"colspan": column.colspan,
|
|
19467
20103
|
"rowspan": column.rowspan,
|
|
19468
|
-
"onClick": column.sortable ? () => toggleSort(column
|
|
20104
|
+
"onClick": column.sortable ? () => toggleSort(column) : undefined,
|
|
19469
20105
|
"lastFixed": column.lastFixed,
|
|
19470
20106
|
"noPadding": noPadding
|
|
19471
20107
|
}, {
|
|
@@ -19473,7 +20109,13 @@
|
|
|
19473
20109
|
const columnSlotName = `column.${column.key}`;
|
|
19474
20110
|
const columnSlotProps = {
|
|
19475
20111
|
column,
|
|
19476
|
-
selectAll
|
|
20112
|
+
selectAll,
|
|
20113
|
+
isSorted,
|
|
20114
|
+
toggleSort,
|
|
20115
|
+
sortBy: sortBy.value,
|
|
20116
|
+
someSelected: someSelected.value,
|
|
20117
|
+
allSelected: allSelected.value,
|
|
20118
|
+
getSortIcon
|
|
19477
20119
|
};
|
|
19478
20120
|
if (slots[columnSlotName]) return slots[columnSlotName](columnSlotProps);
|
|
19479
20121
|
if (column.key === 'data-table-select') {
|
|
@@ -19488,8 +20130,8 @@
|
|
|
19488
20130
|
}, [vue.createVNode("span", null, [column.title]), column.sortable && vue.createVNode(VIcon, {
|
|
19489
20131
|
"key": "icon",
|
|
19490
20132
|
"class": "v-data-table-header__sort-icon",
|
|
19491
|
-
"icon": getSortIcon(column
|
|
19492
|
-
}, null), props.multiSort && isSorted && vue.createVNode("div", {
|
|
20133
|
+
"icon": getSortIcon(column)
|
|
20134
|
+
}, null), props.multiSort && isSorted(column) && vue.createVNode("div", {
|
|
19493
20135
|
"key": "badge",
|
|
19494
20136
|
"class": ['v-data-table-header__sort-badge', ...backgroundColorClasses.value],
|
|
19495
20137
|
"style": backgroundColorStyles.value
|
|
@@ -19511,149 +20153,12 @@
|
|
|
19511
20153
|
"active": true,
|
|
19512
20154
|
"color": typeof props.loading === 'boolean' ? undefined : props.loading,
|
|
19513
20155
|
"indeterminate": true
|
|
19514
|
-
}, {
|
|
19515
|
-
default: slots.loader
|
|
19516
|
-
})])])]);
|
|
19517
|
-
});
|
|
19518
|
-
}
|
|
19519
|
-
});
|
|
19520
|
-
|
|
19521
|
-
// Utilities
|
|
19522
|
-
const makeDataTableGroupProps = propsFactory({
|
|
19523
|
-
groupBy: {
|
|
19524
|
-
type: Array,
|
|
19525
|
-
default: () => []
|
|
19526
|
-
}
|
|
19527
|
-
}, 'data-table-group');
|
|
19528
|
-
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
19529
|
-
function createGroupBy(props) {
|
|
19530
|
-
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19531
|
-
return {
|
|
19532
|
-
groupBy
|
|
19533
|
-
};
|
|
19534
|
-
}
|
|
19535
|
-
function provideGroupBy(options) {
|
|
19536
|
-
const {
|
|
19537
|
-
groupBy,
|
|
19538
|
-
sortBy
|
|
19539
|
-
} = options;
|
|
19540
|
-
const opened = vue.ref(new Set());
|
|
19541
|
-
const sortByWithGroups = vue.computed(() => {
|
|
19542
|
-
return groupBy.value.map(val => ({
|
|
19543
|
-
...val,
|
|
19544
|
-
order: val.order ?? false
|
|
19545
|
-
})).concat(sortBy.value);
|
|
19546
|
-
});
|
|
19547
|
-
function isGroupOpen(group) {
|
|
19548
|
-
return opened.value.has(group.id);
|
|
19549
|
-
}
|
|
19550
|
-
function toggleGroup(group) {
|
|
19551
|
-
const newOpened = new Set(opened.value);
|
|
19552
|
-
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
19553
|
-
opened.value = newOpened;
|
|
19554
|
-
}
|
|
19555
|
-
function extractRows(items) {
|
|
19556
|
-
function dive(group) {
|
|
19557
|
-
const arr = [];
|
|
19558
|
-
for (const item of group.items) {
|
|
19559
|
-
if (item.type === 'item') arr.push(item);else {
|
|
19560
|
-
arr.push(...dive(item));
|
|
19561
|
-
}
|
|
19562
|
-
}
|
|
19563
|
-
return arr;
|
|
19564
|
-
}
|
|
19565
|
-
return dive({
|
|
19566
|
-
type: 'group-header',
|
|
19567
|
-
items,
|
|
19568
|
-
id: 'dummy',
|
|
19569
|
-
key: 'dummy',
|
|
19570
|
-
value: 'dummy',
|
|
19571
|
-
depth: 0
|
|
19572
|
-
});
|
|
19573
|
-
}
|
|
19574
|
-
|
|
19575
|
-
// onBeforeMount(() => {
|
|
19576
|
-
// for (const key of groupedItems.value.keys()) {
|
|
19577
|
-
// opened.value.add(key)
|
|
19578
|
-
// }
|
|
19579
|
-
// })
|
|
19580
|
-
|
|
19581
|
-
const data = {
|
|
19582
|
-
sortByWithGroups,
|
|
19583
|
-
toggleGroup,
|
|
19584
|
-
opened,
|
|
19585
|
-
groupBy,
|
|
19586
|
-
extractRows,
|
|
19587
|
-
isGroupOpen
|
|
19588
|
-
};
|
|
19589
|
-
vue.provide(VDataTableGroupSymbol, data);
|
|
19590
|
-
return data;
|
|
19591
|
-
}
|
|
19592
|
-
function useGroupBy() {
|
|
19593
|
-
const data = vue.inject(VDataTableGroupSymbol);
|
|
19594
|
-
if (!data) throw new Error('Missing group!');
|
|
19595
|
-
return data;
|
|
19596
|
-
}
|
|
19597
|
-
function groupItemsByProperty(items, groupBy) {
|
|
19598
|
-
if (!items.length) return [];
|
|
19599
|
-
const groups = new Map();
|
|
19600
|
-
for (const item of items) {
|
|
19601
|
-
const value = getObjectValueByPath(item.raw, groupBy);
|
|
19602
|
-
if (!groups.has(value)) {
|
|
19603
|
-
groups.set(value, []);
|
|
19604
|
-
}
|
|
19605
|
-
groups.get(value).push(item);
|
|
19606
|
-
}
|
|
19607
|
-
return groups;
|
|
19608
|
-
}
|
|
19609
|
-
function groupItems(items, groupBy) {
|
|
19610
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19611
|
-
let prefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root';
|
|
19612
|
-
if (!groupBy.length) return [];
|
|
19613
|
-
const groupedItems = groupItemsByProperty(items, groupBy[0]);
|
|
19614
|
-
const groups = [];
|
|
19615
|
-
const rest = groupBy.slice(1);
|
|
19616
|
-
groupedItems.forEach((items, value) => {
|
|
19617
|
-
const key = groupBy[0];
|
|
19618
|
-
const id = `${prefix}_${key}_${value}`;
|
|
19619
|
-
groups.push({
|
|
19620
|
-
depth,
|
|
19621
|
-
id,
|
|
19622
|
-
key,
|
|
19623
|
-
value,
|
|
19624
|
-
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
19625
|
-
type: 'group-header'
|
|
20156
|
+
}, {
|
|
20157
|
+
default: slots.loader
|
|
20158
|
+
})])])]);
|
|
19626
20159
|
});
|
|
19627
|
-
});
|
|
19628
|
-
return groups;
|
|
19629
|
-
}
|
|
19630
|
-
function flattenItems(items, opened) {
|
|
19631
|
-
const flatItems = [];
|
|
19632
|
-
for (const item of items) {
|
|
19633
|
-
// TODO: make this better
|
|
19634
|
-
if (item.type === 'group-header') {
|
|
19635
|
-
if (item.value != null) {
|
|
19636
|
-
flatItems.push(item);
|
|
19637
|
-
}
|
|
19638
|
-
if (opened.has(item.id) || item.value == null) {
|
|
19639
|
-
flatItems.push(...flattenItems(item.items, opened));
|
|
19640
|
-
}
|
|
19641
|
-
} else {
|
|
19642
|
-
flatItems.push(item);
|
|
19643
|
-
}
|
|
19644
20160
|
}
|
|
19645
|
-
|
|
19646
|
-
}
|
|
19647
|
-
function useGroupedItems(items, groupBy, opened) {
|
|
19648
|
-
const flatItems = vue.computed(() => {
|
|
19649
|
-
if (!groupBy.value.length) return items.value;
|
|
19650
|
-
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
19651
|
-
return flattenItems(groupedItems, opened.value);
|
|
19652
|
-
});
|
|
19653
|
-
return {
|
|
19654
|
-
flatItems
|
|
19655
|
-
};
|
|
19656
|
-
}
|
|
20161
|
+
});
|
|
19657
20162
|
|
|
19658
20163
|
// Types
|
|
19659
20164
|
|
|
@@ -19734,57 +20239,6 @@
|
|
|
19734
20239
|
}
|
|
19735
20240
|
});
|
|
19736
20241
|
|
|
19737
|
-
// Utilities
|
|
19738
|
-
|
|
19739
|
-
// Types
|
|
19740
|
-
|
|
19741
|
-
const makeDataTableExpandProps = propsFactory({
|
|
19742
|
-
expandOnClick: Boolean,
|
|
19743
|
-
showExpand: Boolean,
|
|
19744
|
-
expanded: {
|
|
19745
|
-
type: Array,
|
|
19746
|
-
default: () => []
|
|
19747
|
-
}
|
|
19748
|
-
}, 'v-data-table-expand');
|
|
19749
|
-
const VDataTableExpandedKey = Symbol.for('vuetify:datatable:expanded');
|
|
19750
|
-
function provideExpanded(props) {
|
|
19751
|
-
const expandOnClick = vue.toRef(props, 'expandOnClick');
|
|
19752
|
-
const expanded = useProxiedModel(props, 'expanded', props.expanded, v => {
|
|
19753
|
-
return new Set(v);
|
|
19754
|
-
}, v => {
|
|
19755
|
-
return [...v.values()];
|
|
19756
|
-
});
|
|
19757
|
-
function expand(item, value) {
|
|
19758
|
-
const newExpanded = new Set(expanded.value);
|
|
19759
|
-
if (!value) {
|
|
19760
|
-
newExpanded.delete(item.value);
|
|
19761
|
-
} else {
|
|
19762
|
-
newExpanded.add(item.value);
|
|
19763
|
-
}
|
|
19764
|
-
expanded.value = newExpanded;
|
|
19765
|
-
}
|
|
19766
|
-
function isExpanded(item) {
|
|
19767
|
-
return expanded.value.has(item.value);
|
|
19768
|
-
}
|
|
19769
|
-
function toggleExpand(item) {
|
|
19770
|
-
expand(item, !isExpanded(item));
|
|
19771
|
-
}
|
|
19772
|
-
const data = {
|
|
19773
|
-
expand,
|
|
19774
|
-
expanded,
|
|
19775
|
-
expandOnClick,
|
|
19776
|
-
isExpanded,
|
|
19777
|
-
toggleExpand
|
|
19778
|
-
};
|
|
19779
|
-
vue.provide(VDataTableExpandedKey, data);
|
|
19780
|
-
return data;
|
|
19781
|
-
}
|
|
19782
|
-
function useExpanded() {
|
|
19783
|
-
const data = vue.inject(VDataTableExpandedKey);
|
|
19784
|
-
if (!data) throw new Error('foo');
|
|
19785
|
-
return data;
|
|
19786
|
-
}
|
|
19787
|
-
|
|
19788
20242
|
// Types
|
|
19789
20243
|
|
|
19790
20244
|
const makeVDataTableRowProps = propsFactory({
|
|
@@ -19921,7 +20375,7 @@
|
|
|
19921
20375
|
}, [slots['no-data']?.() ?? t(props.noDataText)])]);
|
|
19922
20376
|
}
|
|
19923
20377
|
return vue.createVNode(vue.Fragment, null, [props.items.map((item, index) => {
|
|
19924
|
-
if (item.type === 'group
|
|
20378
|
+
if (item.type === 'group') {
|
|
19925
20379
|
return slots['group-header'] ? slots['group-header']({
|
|
19926
20380
|
index,
|
|
19927
20381
|
item,
|
|
@@ -19965,85 +20419,49 @@
|
|
|
19965
20419
|
}
|
|
19966
20420
|
});
|
|
19967
20421
|
|
|
19968
|
-
//
|
|
20422
|
+
// Utilities
|
|
19969
20423
|
|
|
19970
20424
|
// Types
|
|
19971
20425
|
|
|
20426
|
+
// Composables
|
|
19972
20427
|
const makeDataTableItemProps = propsFactory({
|
|
19973
|
-
|
|
19974
|
-
|
|
19975
|
-
|
|
19976
|
-
|
|
19977
|
-
|
|
20428
|
+
items: {
|
|
20429
|
+
type: Array,
|
|
20430
|
+
default: () => []
|
|
20431
|
+
},
|
|
20432
|
+
itemValue: {
|
|
20433
|
+
type: [String, Array, Function],
|
|
20434
|
+
default: 'value'
|
|
20435
|
+
},
|
|
20436
|
+
returnObject: Boolean
|
|
19978
20437
|
}, 'v-data-table-item');
|
|
19979
|
-
function
|
|
19980
|
-
const
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
20438
|
+
function transformItem(props, item, columns) {
|
|
20439
|
+
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue);
|
|
20440
|
+
const itemColumns = columns.reduce((obj, column) => {
|
|
20441
|
+
obj[column.key] = getPropertyFromItem(item, column.value ?? column.key);
|
|
20442
|
+
return obj;
|
|
20443
|
+
}, {});
|
|
20444
|
+
return {
|
|
20445
|
+
type: 'item',
|
|
20446
|
+
value,
|
|
20447
|
+
columns: itemColumns,
|
|
20448
|
+
raw: item
|
|
20449
|
+
};
|
|
20450
|
+
}
|
|
20451
|
+
function transformItems(props, items, columns) {
|
|
20452
|
+
const array = [];
|
|
20453
|
+
for (const item of items) {
|
|
20454
|
+
array.push(transformItem(props, item, columns));
|
|
19989
20455
|
}
|
|
19990
|
-
|
|
20456
|
+
return array;
|
|
19991
20457
|
}
|
|
19992
20458
|
function useDataTableItems(props, columns) {
|
|
19993
|
-
const
|
|
19994
|
-
items
|
|
19995
|
-
} = useItems(props);
|
|
19996
|
-
const dataTableItems = vue.computed(() => items.value.map(item => {
|
|
19997
|
-
return {
|
|
19998
|
-
...item,
|
|
19999
|
-
type: 'item',
|
|
20000
|
-
columns: columns.value.reduce((obj, column) => {
|
|
20001
|
-
add(obj, column.key, getPropertyFromItem(item.raw, column.value ?? column.key));
|
|
20002
|
-
return obj;
|
|
20003
|
-
}, {})
|
|
20004
|
-
};
|
|
20005
|
-
}));
|
|
20459
|
+
const items = vue.computed(() => transformItems(props, props.items, columns.value));
|
|
20006
20460
|
return {
|
|
20007
|
-
items
|
|
20461
|
+
items
|
|
20008
20462
|
};
|
|
20009
20463
|
}
|
|
20010
20464
|
|
|
20011
|
-
// Utilities
|
|
20012
|
-
|
|
20013
|
-
// Types
|
|
20014
|
-
|
|
20015
|
-
function useOptions(_ref) {
|
|
20016
|
-
let {
|
|
20017
|
-
page,
|
|
20018
|
-
itemsPerPage,
|
|
20019
|
-
sortBy,
|
|
20020
|
-
groupBy,
|
|
20021
|
-
search
|
|
20022
|
-
} = _ref;
|
|
20023
|
-
const vm = getCurrentInstance('VDataTable');
|
|
20024
|
-
const options = vue.computed(() => ({
|
|
20025
|
-
page: page.value,
|
|
20026
|
-
itemsPerPage: itemsPerPage.value,
|
|
20027
|
-
sortBy: sortBy.value,
|
|
20028
|
-
groupBy: groupBy.value,
|
|
20029
|
-
search: search.value
|
|
20030
|
-
}));
|
|
20031
|
-
|
|
20032
|
-
// Reset page when searching
|
|
20033
|
-
vue.watch(() => search?.value, () => {
|
|
20034
|
-
page.value = 1;
|
|
20035
|
-
});
|
|
20036
|
-
let oldOptions = null;
|
|
20037
|
-
vue.watch(options, () => {
|
|
20038
|
-
if (deepEqual(oldOptions, options.value)) return;
|
|
20039
|
-
vm.emit('update:options', options.value);
|
|
20040
|
-
oldOptions = options.value;
|
|
20041
|
-
}, {
|
|
20042
|
-
deep: true,
|
|
20043
|
-
immediate: true
|
|
20044
|
-
});
|
|
20045
|
-
}
|
|
20046
|
-
|
|
20047
20465
|
// Types
|
|
20048
20466
|
|
|
20049
20467
|
const makeDataTableProps = propsFactory({
|
|
@@ -20095,7 +20513,8 @@
|
|
|
20095
20513
|
itemsPerPage
|
|
20096
20514
|
} = createPagination(props);
|
|
20097
20515
|
const {
|
|
20098
|
-
columns
|
|
20516
|
+
columns,
|
|
20517
|
+
headers
|
|
20099
20518
|
} = createHeaders(props, {
|
|
20100
20519
|
groupBy,
|
|
20101
20520
|
showSelect: vue.toRef(props, 'showSelect'),
|
|
@@ -20104,14 +20523,15 @@
|
|
|
20104
20523
|
const {
|
|
20105
20524
|
items
|
|
20106
20525
|
} = useDataTableItems(props, columns);
|
|
20107
|
-
const filterKeys = vue.computed(() => columns.value.map(c => 'columns.' + c.key));
|
|
20108
20526
|
const search = vue.toRef(props, 'search');
|
|
20109
20527
|
const {
|
|
20110
20528
|
filteredItems
|
|
20111
20529
|
} = useFilter(props, items, search, {
|
|
20112
|
-
|
|
20530
|
+
transform: item => item.columns
|
|
20113
20531
|
});
|
|
20114
|
-
|
|
20532
|
+
const {
|
|
20533
|
+
toggleSort
|
|
20534
|
+
} = provideSort({
|
|
20115
20535
|
sortBy,
|
|
20116
20536
|
multiSort,
|
|
20117
20537
|
mustSort,
|
|
@@ -20120,21 +20540,25 @@
|
|
|
20120
20540
|
const {
|
|
20121
20541
|
sortByWithGroups,
|
|
20122
20542
|
opened,
|
|
20123
|
-
extractRows
|
|
20543
|
+
extractRows,
|
|
20544
|
+
isGroupOpen,
|
|
20545
|
+
toggleGroup
|
|
20124
20546
|
} = provideGroupBy({
|
|
20125
20547
|
groupBy,
|
|
20126
20548
|
sortBy
|
|
20127
20549
|
});
|
|
20128
20550
|
const {
|
|
20129
20551
|
sortedItems
|
|
20130
|
-
} = useSortedItems(filteredItems, sortByWithGroups
|
|
20552
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
20131
20553
|
const {
|
|
20132
20554
|
flatItems
|
|
20133
20555
|
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
20134
20556
|
const itemsLength = vue.computed(() => flatItems.value.length);
|
|
20135
20557
|
const {
|
|
20136
20558
|
startIndex,
|
|
20137
|
-
stopIndex
|
|
20559
|
+
stopIndex,
|
|
20560
|
+
pageCount,
|
|
20561
|
+
setItemsPerPage
|
|
20138
20562
|
} = providePagination({
|
|
20139
20563
|
page,
|
|
20140
20564
|
itemsPerPage,
|
|
@@ -20149,8 +20573,18 @@
|
|
|
20149
20573
|
itemsPerPage
|
|
20150
20574
|
});
|
|
20151
20575
|
const paginatedItemsWithoutGroups = vue.computed(() => extractRows(paginatedItems.value));
|
|
20152
|
-
|
|
20153
|
-
|
|
20576
|
+
const {
|
|
20577
|
+
isSelected,
|
|
20578
|
+
select,
|
|
20579
|
+
selectAll,
|
|
20580
|
+
toggleSelect,
|
|
20581
|
+
someSelected,
|
|
20582
|
+
allSelected
|
|
20583
|
+
} = provideSelection(props, paginatedItemsWithoutGroups);
|
|
20584
|
+
const {
|
|
20585
|
+
isExpanded,
|
|
20586
|
+
toggleExpand
|
|
20587
|
+
} = provideExpanded(props);
|
|
20154
20588
|
useOptions({
|
|
20155
20589
|
page,
|
|
20156
20590
|
itemsPerPage,
|
|
@@ -20161,9 +20595,33 @@
|
|
|
20161
20595
|
provideDefaults({
|
|
20162
20596
|
VDataTableRows: {
|
|
20163
20597
|
hideNoData: vue.toRef(props, 'hideNoData'),
|
|
20164
|
-
noDataText: vue.toRef(props, 'noDataText')
|
|
20598
|
+
noDataText: vue.toRef(props, 'noDataText'),
|
|
20599
|
+
loading: vue.toRef(props, 'loading'),
|
|
20600
|
+
loadingText: vue.toRef(props, 'loadingText')
|
|
20165
20601
|
}
|
|
20166
20602
|
});
|
|
20603
|
+
const slotProps = vue.computed(() => ({
|
|
20604
|
+
page: page.value,
|
|
20605
|
+
itemsPerPage: itemsPerPage.value,
|
|
20606
|
+
sortBy: sortBy.value,
|
|
20607
|
+
pageCount: pageCount.value,
|
|
20608
|
+
toggleSort,
|
|
20609
|
+
setItemsPerPage,
|
|
20610
|
+
someSelected: someSelected.value,
|
|
20611
|
+
allSelected: allSelected.value,
|
|
20612
|
+
isSelected,
|
|
20613
|
+
select,
|
|
20614
|
+
selectAll,
|
|
20615
|
+
toggleSelect,
|
|
20616
|
+
isExpanded,
|
|
20617
|
+
toggleExpand,
|
|
20618
|
+
isGroupOpen,
|
|
20619
|
+
toggleGroup,
|
|
20620
|
+
items: paginatedItems.value,
|
|
20621
|
+
groupedItems: flatItems.value,
|
|
20622
|
+
columns: columns.value,
|
|
20623
|
+
headers: headers.value
|
|
20624
|
+
}));
|
|
20167
20625
|
useRender(() => {
|
|
20168
20626
|
const [dataTableFooterProps] = VDataTableFooter.filterProps(props);
|
|
20169
20627
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
@@ -20171,19 +20629,18 @@
|
|
|
20171
20629
|
const [tableProps] = VTable.filterProps(props);
|
|
20172
20630
|
return vue.createVNode(VTable, vue.mergeProps({
|
|
20173
20631
|
"class": ['v-data-table', {
|
|
20174
|
-
'v-data-table--show-select': props.showSelect
|
|
20632
|
+
'v-data-table--show-select': props.showSelect,
|
|
20633
|
+
'v-data-table--loading': props.loading
|
|
20175
20634
|
}, props.class],
|
|
20176
20635
|
"style": props.style
|
|
20177
20636
|
}, tableProps), {
|
|
20178
|
-
top: slots.top,
|
|
20179
|
-
default: slots.default
|
|
20180
|
-
columns
|
|
20181
|
-
}), vue.createVNode("thead", null, [vue.createVNode(VDataTableHeaders, dataTableHeadersProps, slots)]), slots.thead?.(), vue.createVNode("tbody", null, [slots.body ? slots.body() : vue.createVNode(VDataTableRows, vue.mergeProps(dataTableRowsProps, {
|
|
20637
|
+
top: () => slots.top?.(slotProps.value),
|
|
20638
|
+
default: () => slots.default ? slots.default(slotProps.value) : vue.createVNode(vue.Fragment, null, [slots.colgroup?.(slotProps.value), vue.createVNode("thead", null, [vue.createVNode(VDataTableHeaders, dataTableHeadersProps, slots)]), slots.thead?.(slotProps.value), vue.createVNode("tbody", null, [slots.body ? slots.body(slotProps.value) : vue.createVNode(VDataTableRows, vue.mergeProps(dataTableRowsProps, {
|
|
20182
20639
|
"items": paginatedItems.value
|
|
20183
|
-
}), slots)]), slots.tbody?.(), slots.tfoot?.()])
|
|
20184
|
-
bottom: slots.bottom
|
|
20640
|
+
}), slots)]), slots.tbody?.(slotProps.value), slots.tfoot?.(slotProps.value)]),
|
|
20641
|
+
bottom: () => slots.bottom ? slots.bottom(slotProps.value) : vue.createVNode(vue.Fragment, null, [vue.createVNode(VDataTableFooter, dataTableFooterProps, {
|
|
20185
20642
|
prepend: slots['footer.prepend']
|
|
20186
|
-
}))
|
|
20643
|
+
})])
|
|
20187
20644
|
});
|
|
20188
20645
|
});
|
|
20189
20646
|
return {};
|
|
@@ -20272,6 +20729,7 @@
|
|
|
20272
20729
|
|
|
20273
20730
|
const makeVDataTableVirtualProps = propsFactory({
|
|
20274
20731
|
...makeDataTableProps(),
|
|
20732
|
+
...makeDataTableGroupProps(),
|
|
20275
20733
|
...makeDataTableVirtualProps(),
|
|
20276
20734
|
...makeFilterProps()
|
|
20277
20735
|
}, 'v-data-table-virtual');
|
|
@@ -20300,7 +20758,8 @@
|
|
|
20300
20758
|
mustSort
|
|
20301
20759
|
} = createSort(props);
|
|
20302
20760
|
const {
|
|
20303
|
-
columns
|
|
20761
|
+
columns,
|
|
20762
|
+
headers
|
|
20304
20763
|
} = createHeaders(props, {
|
|
20305
20764
|
groupBy,
|
|
20306
20765
|
showSelect: vue.toRef(props, 'showSelect'),
|
|
@@ -20309,14 +20768,15 @@
|
|
|
20309
20768
|
const {
|
|
20310
20769
|
items
|
|
20311
20770
|
} = useDataTableItems(props, columns);
|
|
20312
|
-
const filterKeys = vue.computed(() => columns.value.map(c => 'columns.' + c.key));
|
|
20313
20771
|
const search = vue.toRef(props, 'search');
|
|
20314
20772
|
const {
|
|
20315
20773
|
filteredItems
|
|
20316
20774
|
} = useFilter(props, items, search, {
|
|
20317
|
-
|
|
20775
|
+
transform: item => item.columns
|
|
20318
20776
|
});
|
|
20319
|
-
|
|
20777
|
+
const {
|
|
20778
|
+
toggleSort
|
|
20779
|
+
} = provideSort({
|
|
20320
20780
|
sortBy,
|
|
20321
20781
|
multiSort,
|
|
20322
20782
|
mustSort
|
|
@@ -20324,20 +20784,32 @@
|
|
|
20324
20784
|
const {
|
|
20325
20785
|
sortByWithGroups,
|
|
20326
20786
|
opened,
|
|
20327
|
-
extractRows
|
|
20787
|
+
extractRows,
|
|
20788
|
+
isGroupOpen,
|
|
20789
|
+
toggleGroup
|
|
20328
20790
|
} = provideGroupBy({
|
|
20329
20791
|
groupBy,
|
|
20330
20792
|
sortBy
|
|
20331
20793
|
});
|
|
20332
20794
|
const {
|
|
20333
20795
|
sortedItems
|
|
20334
|
-
} = useSortedItems(filteredItems, sortByWithGroups
|
|
20796
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
20335
20797
|
const {
|
|
20336
20798
|
flatItems
|
|
20337
20799
|
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
20338
20800
|
const allRows = vue.computed(() => extractRows(flatItems.value));
|
|
20339
|
-
|
|
20340
|
-
|
|
20801
|
+
const {
|
|
20802
|
+
isSelected,
|
|
20803
|
+
select,
|
|
20804
|
+
selectAll,
|
|
20805
|
+
toggleSelect,
|
|
20806
|
+
someSelected,
|
|
20807
|
+
allSelected
|
|
20808
|
+
} = provideSelection(props, allRows);
|
|
20809
|
+
const {
|
|
20810
|
+
isExpanded,
|
|
20811
|
+
toggleExpand
|
|
20812
|
+
} = provideExpanded(props);
|
|
20341
20813
|
const {
|
|
20342
20814
|
containerRef,
|
|
20343
20815
|
paddingTop,
|
|
@@ -20360,20 +20832,42 @@
|
|
|
20360
20832
|
provideDefaults({
|
|
20361
20833
|
VDataTableRows: {
|
|
20362
20834
|
hideNoData: vue.toRef(props, 'hideNoData'),
|
|
20363
|
-
noDataText: vue.toRef(props, 'noDataText')
|
|
20835
|
+
noDataText: vue.toRef(props, 'noDataText'),
|
|
20836
|
+
loading: vue.toRef(props, 'loading'),
|
|
20837
|
+
loadingText: vue.toRef(props, 'loadingText')
|
|
20364
20838
|
}
|
|
20365
20839
|
});
|
|
20840
|
+
const slotProps = vue.computed(() => ({
|
|
20841
|
+
sortBy: sortBy.value,
|
|
20842
|
+
toggleSort,
|
|
20843
|
+
someSelected: someSelected.value,
|
|
20844
|
+
allSelected: allSelected.value,
|
|
20845
|
+
isSelected,
|
|
20846
|
+
select,
|
|
20847
|
+
selectAll,
|
|
20848
|
+
toggleSelect,
|
|
20849
|
+
isExpanded,
|
|
20850
|
+
toggleExpand,
|
|
20851
|
+
isGroupOpen,
|
|
20852
|
+
toggleGroup,
|
|
20853
|
+
items: items.value,
|
|
20854
|
+
groupedItems: flatItems.value,
|
|
20855
|
+
columns: columns.value,
|
|
20856
|
+
headers: headers.value
|
|
20857
|
+
}));
|
|
20366
20858
|
useRender(() => {
|
|
20367
20859
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
20368
20860
|
const [dataTableRowsProps] = VDataTableRows.filterProps(props);
|
|
20369
20861
|
const [tableProps] = VTable.filterProps(props);
|
|
20370
20862
|
return vue.createVNode(VTable, vue.mergeProps({
|
|
20371
|
-
"class": ['v-data-table',
|
|
20863
|
+
"class": ['v-data-table', {
|
|
20864
|
+
'v-data-table--loading': props.loading
|
|
20865
|
+
}, props.class],
|
|
20372
20866
|
"style": [{
|
|
20373
20867
|
'--v-table-row-height': convertToUnit(itemHeight.value)
|
|
20374
20868
|
}, props.style]
|
|
20375
20869
|
}, tableProps), {
|
|
20376
|
-
top: slots.top,
|
|
20870
|
+
top: () => slots.top?.(slotProps.value),
|
|
20377
20871
|
wrapper: () => vue.createVNode("div", {
|
|
20378
20872
|
"ref": containerRef,
|
|
20379
20873
|
"onScroll": handleScroll,
|
|
@@ -20408,7 +20902,7 @@
|
|
|
20408
20902
|
border: 0
|
|
20409
20903
|
}
|
|
20410
20904
|
}, null)])])])]),
|
|
20411
|
-
bottom: slots.bottom
|
|
20905
|
+
bottom: () => slots.bottom?.(slotProps.value)
|
|
20412
20906
|
});
|
|
20413
20907
|
});
|
|
20414
20908
|
}
|
|
@@ -20456,9 +20950,9 @@
|
|
|
20456
20950
|
itemsPerPage
|
|
20457
20951
|
} = createPagination(props);
|
|
20458
20952
|
const itemsLength = vue.computed(() => parseInt(props.itemsLength, 10));
|
|
20459
|
-
provideExpanded(props);
|
|
20460
20953
|
const {
|
|
20461
|
-
columns
|
|
20954
|
+
columns,
|
|
20955
|
+
headers
|
|
20462
20956
|
} = createHeaders(props, {
|
|
20463
20957
|
groupBy,
|
|
20464
20958
|
showSelect: vue.toRef(props, 'showSelect'),
|
|
@@ -20476,12 +20970,17 @@
|
|
|
20476
20970
|
page
|
|
20477
20971
|
});
|
|
20478
20972
|
const {
|
|
20479
|
-
opened
|
|
20973
|
+
opened,
|
|
20974
|
+
isGroupOpen,
|
|
20975
|
+
toggleGroup
|
|
20480
20976
|
} = provideGroupBy({
|
|
20481
20977
|
groupBy,
|
|
20482
20978
|
sortBy
|
|
20483
20979
|
});
|
|
20484
|
-
|
|
20980
|
+
const {
|
|
20981
|
+
pageCount,
|
|
20982
|
+
setItemsPerPage
|
|
20983
|
+
} = providePagination({
|
|
20485
20984
|
page,
|
|
20486
20985
|
itemsPerPage,
|
|
20487
20986
|
itemsLength
|
|
@@ -20489,7 +20988,18 @@
|
|
|
20489
20988
|
const {
|
|
20490
20989
|
flatItems
|
|
20491
20990
|
} = useGroupedItems(items, groupBy, opened);
|
|
20492
|
-
|
|
20991
|
+
const {
|
|
20992
|
+
isSelected,
|
|
20993
|
+
select,
|
|
20994
|
+
selectAll,
|
|
20995
|
+
toggleSelect,
|
|
20996
|
+
someSelected,
|
|
20997
|
+
allSelected
|
|
20998
|
+
} = provideSelection(props, items);
|
|
20999
|
+
const {
|
|
21000
|
+
isExpanded,
|
|
21001
|
+
toggleExpand
|
|
21002
|
+
} = provideExpanded(props);
|
|
20493
21003
|
useOptions({
|
|
20494
21004
|
page,
|
|
20495
21005
|
itemsPerPage,
|
|
@@ -20509,6 +21019,28 @@
|
|
|
20509
21019
|
loadingText: vue.toRef(props, 'loadingText')
|
|
20510
21020
|
}
|
|
20511
21021
|
});
|
|
21022
|
+
const slotProps = vue.computed(() => ({
|
|
21023
|
+
page: page.value,
|
|
21024
|
+
itemsPerPage: itemsPerPage.value,
|
|
21025
|
+
sortBy: sortBy.value,
|
|
21026
|
+
pageCount: pageCount.value,
|
|
21027
|
+
toggleSort,
|
|
21028
|
+
setItemsPerPage,
|
|
21029
|
+
someSelected: someSelected.value,
|
|
21030
|
+
allSelected: allSelected.value,
|
|
21031
|
+
isSelected,
|
|
21032
|
+
select,
|
|
21033
|
+
selectAll,
|
|
21034
|
+
toggleSelect,
|
|
21035
|
+
isExpanded,
|
|
21036
|
+
toggleExpand,
|
|
21037
|
+
isGroupOpen,
|
|
21038
|
+
toggleGroup,
|
|
21039
|
+
items: items.value,
|
|
21040
|
+
groupedItems: flatItems.value,
|
|
21041
|
+
columns: columns.value,
|
|
21042
|
+
headers: headers.value
|
|
21043
|
+
}));
|
|
20512
21044
|
useRender(() => {
|
|
20513
21045
|
const [dataTableFooterProps] = VDataTableFooter.filterProps(props);
|
|
20514
21046
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
@@ -20520,23 +21052,21 @@
|
|
|
20520
21052
|
}, props.class],
|
|
20521
21053
|
"style": props.style
|
|
20522
21054
|
}, tableProps), {
|
|
20523
|
-
top: slots.top,
|
|
20524
|
-
default: slots.default
|
|
20525
|
-
columns
|
|
20526
|
-
}), vue.createVNode("thead", {
|
|
21055
|
+
top: () => slots.top?.(slotProps.value),
|
|
21056
|
+
default: () => slots.default ? slots.default(slotProps.value) : vue.createVNode(vue.Fragment, null, [slots.colgroup?.(slotProps.value), vue.createVNode("thead", {
|
|
20527
21057
|
"class": "v-data-table__thead",
|
|
20528
21058
|
"role": "rowgroup"
|
|
20529
21059
|
}, [vue.createVNode(VDataTableHeaders, vue.mergeProps(dataTableHeadersProps, {
|
|
20530
21060
|
"sticky": props.fixedHeader
|
|
20531
|
-
}), slots)]), slots.thead?.(), vue.createVNode("tbody", {
|
|
21061
|
+
}), slots)]), slots.thead?.(slotProps.value), vue.createVNode("tbody", {
|
|
20532
21062
|
"class": "v-data-table__tbody",
|
|
20533
21063
|
"role": "rowgroup"
|
|
20534
|
-
}, [slots.body ? slots.body() : vue.createVNode(VDataTableRows, vue.mergeProps(dataTableRowsProps, {
|
|
21064
|
+
}, [slots.body ? slots.body(slotProps.value) : vue.createVNode(VDataTableRows, vue.mergeProps(dataTableRowsProps, {
|
|
20535
21065
|
"items": flatItems.value
|
|
20536
|
-
}), slots)]), slots.tbody?.(), slots.tfoot?.()])
|
|
20537
|
-
bottom: slots.bottom
|
|
21066
|
+
}), slots)]), slots.tbody?.(slotProps.value), slots.tfoot?.(slotProps.value)]),
|
|
21067
|
+
bottom: () => slots.bottom ? slots.bottom(slotProps.value) : vue.createVNode(VDataTableFooter, dataTableFooterProps, {
|
|
20538
21068
|
prepend: slots['footer.prepend']
|
|
20539
|
-
})
|
|
21069
|
+
})
|
|
20540
21070
|
});
|
|
20541
21071
|
});
|
|
20542
21072
|
}
|
|
@@ -20900,6 +21430,7 @@
|
|
|
20900
21430
|
VBannerActions: VBannerActions,
|
|
20901
21431
|
VBannerText: VBannerText,
|
|
20902
21432
|
VBottomNavigation: VBottomNavigation,
|
|
21433
|
+
VBottomSheet: VBottomSheet,
|
|
20903
21434
|
VBreadcrumbs: VBreadcrumbs,
|
|
20904
21435
|
VBreadcrumbsDivider: VBreadcrumbsDivider,
|
|
20905
21436
|
VBreadcrumbsItem: VBreadcrumbsItem,
|
|
@@ -20926,6 +21457,7 @@
|
|
|
20926
21457
|
VComponentIcon: VComponentIcon,
|
|
20927
21458
|
VContainer: VContainer,
|
|
20928
21459
|
VCounter: VCounter,
|
|
21460
|
+
VDataIterator: VDataIterator,
|
|
20929
21461
|
VDataTable: VDataTable,
|
|
20930
21462
|
VDataTableFooter: VDataTableFooter,
|
|
20931
21463
|
VDataTableRow: VDataTableRow,
|
|
@@ -21654,7 +22186,7 @@
|
|
|
21654
22186
|
date
|
|
21655
22187
|
};
|
|
21656
22188
|
}
|
|
21657
|
-
const version$1 = "3.
|
|
22189
|
+
const version$1 = "3.3.0";
|
|
21658
22190
|
createVuetify$1.version = version$1;
|
|
21659
22191
|
|
|
21660
22192
|
// Vue's inject() can only be used in setup
|
|
@@ -21666,7 +22198,7 @@
|
|
|
21666
22198
|
}
|
|
21667
22199
|
}
|
|
21668
22200
|
|
|
21669
|
-
const version = "3.
|
|
22201
|
+
const version = "3.3.0";
|
|
21670
22202
|
|
|
21671
22203
|
const createVuetify = function () {
|
|
21672
22204
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|