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.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
*/
|
|
6
6
|
|
|
7
|
-
import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, onScopeDispose, effectScope, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode,
|
|
7
|
+
import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, warn, onScopeDispose, effectScope, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode, toHandlers, Teleport, createTextVNode, onBeforeUpdate, vModelText, onUpdated, withModifiers } from 'vue';
|
|
8
8
|
|
|
9
9
|
const IN_BROWSER = typeof window !== 'undefined';
|
|
10
10
|
const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
|
|
@@ -167,6 +167,9 @@ const keyValues = Object.freeze({
|
|
|
167
167
|
function keys(o) {
|
|
168
168
|
return Object.keys(o);
|
|
169
169
|
}
|
|
170
|
+
function has(obj, key) {
|
|
171
|
+
return key.every(k => obj.hasOwnProperty(k));
|
|
172
|
+
}
|
|
170
173
|
function pick(obj, paths, exclude) {
|
|
171
174
|
const found = Object.create(null);
|
|
172
175
|
const rest = Object.create(null);
|
|
@@ -382,6 +385,7 @@ function focusChild(el, location) {
|
|
|
382
385
|
if (_el) _el.focus();else focusChild(el, location === 'next' ? 'first' : 'last');
|
|
383
386
|
}
|
|
384
387
|
}
|
|
388
|
+
function noop() {}
|
|
385
389
|
|
|
386
390
|
const block = ['top', 'bottom'];
|
|
387
391
|
const inline = ['start', 'end', 'left', 'right'];
|
|
@@ -534,79 +538,16 @@ function animate(el, keyframes, options) {
|
|
|
534
538
|
}
|
|
535
539
|
|
|
536
540
|
/* eslint-disable no-console */
|
|
537
|
-
// import Vuetify from '../framework'
|
|
538
|
-
|
|
539
|
-
function createMessage(message, vm, parent) {
|
|
540
|
-
// if (Vuetify.config.silent) return
|
|
541
541
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
__isVue: true,
|
|
545
|
-
$parent: parent,
|
|
546
|
-
$options: vm
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
if (vm) {
|
|
550
|
-
// Only show each message once per instance
|
|
551
|
-
vm.$_alreadyWarned = vm.$_alreadyWarned || [];
|
|
552
|
-
if (vm.$_alreadyWarned.includes(message)) return;
|
|
553
|
-
vm.$_alreadyWarned.push(message);
|
|
554
|
-
}
|
|
555
|
-
return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');
|
|
556
|
-
}
|
|
557
|
-
function consoleWarn(message, vm, parent) {
|
|
558
|
-
const newMessage = createMessage(message, vm, parent);
|
|
559
|
-
newMessage != null && console.warn(newMessage);
|
|
542
|
+
function consoleWarn(message) {
|
|
543
|
+
warn(`Vuetify: ${message}`);
|
|
560
544
|
}
|
|
561
|
-
function consoleError(message
|
|
562
|
-
|
|
563
|
-
newMessage != null && console.error(newMessage);
|
|
545
|
+
function consoleError(message) {
|
|
546
|
+
warn(`Vuetify error: ${message}`);
|
|
564
547
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
*/
|
|
569
|
-
|
|
570
|
-
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
571
|
-
const classify = str => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
|
|
572
|
-
function formatComponentName(vm, includeFile) {
|
|
573
|
-
if (vm.$root === vm) {
|
|
574
|
-
return '<Root>';
|
|
575
|
-
}
|
|
576
|
-
const options = typeof vm === 'function' && vm.cid != null ? vm.options : vm.__isVue ? vm.$options || vm.constructor.options : vm || {};
|
|
577
|
-
let name = options.name || options._componentTag;
|
|
578
|
-
const file = options.__file;
|
|
579
|
-
if (!name && file) {
|
|
580
|
-
const match = file.match(/([^/\\]+)\.vue$/);
|
|
581
|
-
name = match?.[1];
|
|
582
|
-
}
|
|
583
|
-
return (name ? `<${classify(name)}>` : `<Anonymous>`) + (file && includeFile !== false ? ` at ${file}` : '');
|
|
584
|
-
}
|
|
585
|
-
function generateComponentTrace(vm) {
|
|
586
|
-
if (vm.__isVue && vm.$parent) {
|
|
587
|
-
const tree = [];
|
|
588
|
-
let currentRecursiveSequence = 0;
|
|
589
|
-
while (vm) {
|
|
590
|
-
if (tree.length > 0) {
|
|
591
|
-
const last = tree[tree.length - 1];
|
|
592
|
-
if (last.constructor === vm.constructor) {
|
|
593
|
-
currentRecursiveSequence++;
|
|
594
|
-
vm = vm.$parent;
|
|
595
|
-
continue;
|
|
596
|
-
} else if (currentRecursiveSequence > 0) {
|
|
597
|
-
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
|
598
|
-
currentRecursiveSequence = 0;
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
tree.push(vm);
|
|
602
|
-
vm = vm.$parent;
|
|
603
|
-
}
|
|
604
|
-
return '\n\nfound in\n\n' + tree.map((vm, i) => `${i === 0 ? '---> ' : ' '.repeat(5 + i * 2)}${Array.isArray(vm)
|
|
605
|
-
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
|
606
|
-
? `${formatComponentName(vm[0])}... (${vm[1]} recursive calls)` : formatComponentName(vm)}`).join('\n');
|
|
607
|
-
} else {
|
|
608
|
-
return `\n\n(found in ${formatComponentName(vm)})`;
|
|
609
|
-
}
|
|
548
|
+
function deprecate(original, replacement) {
|
|
549
|
+
replacement = Array.isArray(replacement) ? replacement.slice(0, -1).map(s => `'${s}'`).join(', ') + ` or '${replacement.at(-1)}'` : `'${replacement}'`;
|
|
550
|
+
warn(`[Vuetify UPGRADE] '${original}' is deprecated, use ${replacement} instead.`);
|
|
610
551
|
}
|
|
611
552
|
|
|
612
553
|
// For converting XYZ to sRGB
|
|
@@ -680,7 +621,46 @@ function toXYZ(lab) {
|
|
|
680
621
|
function isCssColor(color) {
|
|
681
622
|
return !!color && /^(#|var\(--|(rgb|hsl)a?\()/.test(color);
|
|
682
623
|
}
|
|
683
|
-
|
|
624
|
+
const cssColorRe = /^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;
|
|
625
|
+
const mappers = {
|
|
626
|
+
rgb: (r, g, b, a) => ({
|
|
627
|
+
r,
|
|
628
|
+
g,
|
|
629
|
+
b,
|
|
630
|
+
a
|
|
631
|
+
}),
|
|
632
|
+
rgba: (r, g, b, a) => ({
|
|
633
|
+
r,
|
|
634
|
+
g,
|
|
635
|
+
b,
|
|
636
|
+
a
|
|
637
|
+
}),
|
|
638
|
+
hsl: (h, s, l, a) => HSLtoRGB({
|
|
639
|
+
h,
|
|
640
|
+
s,
|
|
641
|
+
l,
|
|
642
|
+
a
|
|
643
|
+
}),
|
|
644
|
+
hsla: (h, s, l, a) => HSLtoRGB({
|
|
645
|
+
h,
|
|
646
|
+
s,
|
|
647
|
+
l,
|
|
648
|
+
a
|
|
649
|
+
}),
|
|
650
|
+
hsv: (h, s, v, a) => HSVtoRGB({
|
|
651
|
+
h,
|
|
652
|
+
s,
|
|
653
|
+
v,
|
|
654
|
+
a
|
|
655
|
+
}),
|
|
656
|
+
hsva: (h, s, v, a) => HSVtoRGB({
|
|
657
|
+
h,
|
|
658
|
+
s,
|
|
659
|
+
v,
|
|
660
|
+
a
|
|
661
|
+
})
|
|
662
|
+
};
|
|
663
|
+
function parseColor(color) {
|
|
684
664
|
if (typeof color === 'number') {
|
|
685
665
|
if (isNaN(color) || color < 0 || color > 0xFFFFFF) {
|
|
686
666
|
// int can't have opacity
|
|
@@ -691,6 +671,22 @@ function parseColor$1(color) {
|
|
|
691
671
|
g: (color & 0xFF00) >> 8,
|
|
692
672
|
b: color & 0xFF
|
|
693
673
|
};
|
|
674
|
+
} else if (typeof color === 'string' && cssColorRe.test(color)) {
|
|
675
|
+
const {
|
|
676
|
+
groups
|
|
677
|
+
} = color.match(cssColorRe);
|
|
678
|
+
const {
|
|
679
|
+
fn,
|
|
680
|
+
values
|
|
681
|
+
} = groups;
|
|
682
|
+
const realValues = values.split(/,\s*/).map(v => {
|
|
683
|
+
if (v.endsWith('%') && ['hsl', 'hsla', 'hsv', 'hsva'].includes(fn)) {
|
|
684
|
+
return parseFloat(v) / 100;
|
|
685
|
+
} else {
|
|
686
|
+
return parseFloat(v);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
return mappers[fn](...realValues);
|
|
694
690
|
} else if (typeof color === 'string') {
|
|
695
691
|
let hex = color.startsWith('#') ? color.slice(1) : color;
|
|
696
692
|
if ([3, 4].includes(hex.length)) {
|
|
@@ -703,9 +699,16 @@ function parseColor$1(color) {
|
|
|
703
699
|
consoleWarn(`'${color}' is not a valid hex(a) color`);
|
|
704
700
|
}
|
|
705
701
|
return HexToRGB(hex);
|
|
706
|
-
} else {
|
|
707
|
-
|
|
702
|
+
} else if (typeof color === 'object') {
|
|
703
|
+
if (has(color, ['r', 'g', 'b'])) {
|
|
704
|
+
return color;
|
|
705
|
+
} else if (has(color, ['h', 's', 'l'])) {
|
|
706
|
+
return HSVtoRGB(HSLtoHSV(color));
|
|
707
|
+
} else if (has(color, ['h', 's', 'v'])) {
|
|
708
|
+
return HSVtoRGB(color);
|
|
709
|
+
}
|
|
708
710
|
}
|
|
711
|
+
throw new TypeError(`Invalid color: ${color == null ? color : String(color) || color.constructor.name}\nExpected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
|
|
709
712
|
}
|
|
710
713
|
|
|
711
714
|
/** Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV */
|
|
@@ -728,6 +731,9 @@ function HSVtoRGB(hsva) {
|
|
|
728
731
|
a
|
|
729
732
|
};
|
|
730
733
|
}
|
|
734
|
+
function HSLtoRGB(hsla) {
|
|
735
|
+
return HSVtoRGB(HSLtoHSV(hsla));
|
|
736
|
+
}
|
|
731
737
|
|
|
732
738
|
/** Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV */
|
|
733
739
|
function RGBtoHSV(rgba) {
|
|
@@ -866,7 +872,7 @@ function darken(value, amount) {
|
|
|
866
872
|
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
867
873
|
*/
|
|
868
874
|
function getLuma(color) {
|
|
869
|
-
const rgb = parseColor
|
|
875
|
+
const rgb = parseColor(color);
|
|
870
876
|
return toXYZ$1(rgb)[1];
|
|
871
877
|
}
|
|
872
878
|
|
|
@@ -882,6 +888,8 @@ function getContrast(first, second) {
|
|
|
882
888
|
return (light + 0.05) / (dark + 0.05);
|
|
883
889
|
}
|
|
884
890
|
|
|
891
|
+
// eslint-disable-line vue/prefer-import-from-vue
|
|
892
|
+
|
|
885
893
|
/**
|
|
886
894
|
* Creates a factory function for props definitions.
|
|
887
895
|
* This is used to define props in a composable then override
|
|
@@ -1166,6 +1174,7 @@ const deceleratedEasing = 'cubic-bezier(0.0, 0, 0.2, 1)'; // Entering
|
|
|
1166
1174
|
const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving
|
|
1167
1175
|
|
|
1168
1176
|
// Utilities
|
|
1177
|
+
|
|
1169
1178
|
function getCurrentInstance(name, message) {
|
|
1170
1179
|
const vm = getCurrentInstance$1();
|
|
1171
1180
|
if (!vm) {
|
|
@@ -1730,7 +1739,7 @@ function createTheme(options) {
|
|
|
1730
1739
|
for (const variation of ['lighten', 'darken']) {
|
|
1731
1740
|
const fn = variation === 'lighten' ? lighten : darken;
|
|
1732
1741
|
for (const amount of createRange(parsedOptions.variations[variation], 1)) {
|
|
1733
|
-
theme.colors[`${name}-${variation}-${amount}`] = RGBtoHex(fn(parseColor
|
|
1742
|
+
theme.colors[`${name}-${variation}-${amount}`] = RGBtoHex(fn(parseColor(color), amount));
|
|
1734
1743
|
}
|
|
1735
1744
|
}
|
|
1736
1745
|
}
|
|
@@ -1738,9 +1747,9 @@ function createTheme(options) {
|
|
|
1738
1747
|
for (const color of Object.keys(theme.colors)) {
|
|
1739
1748
|
if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
1740
1749
|
const onColor = `on-${color}`;
|
|
1741
|
-
const colorVal = parseColor
|
|
1742
|
-
const blackContrast = Math.abs(APCAcontrast(parseColor
|
|
1743
|
-
const whiteContrast = Math.abs(APCAcontrast(parseColor
|
|
1750
|
+
const colorVal = parseColor(theme.colors[color]);
|
|
1751
|
+
const blackContrast = Math.abs(APCAcontrast(parseColor(0), colorVal));
|
|
1752
|
+
const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), colorVal));
|
|
1744
1753
|
|
|
1745
1754
|
// TODO: warn about poor color selections
|
|
1746
1755
|
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
@@ -1872,14 +1881,14 @@ function genCssVariables(theme) {
|
|
|
1872
1881
|
const darkOverlay = theme.dark ? 1 : 2;
|
|
1873
1882
|
const variables = [];
|
|
1874
1883
|
for (const [key, value] of Object.entries(theme.colors)) {
|
|
1875
|
-
const rgb = parseColor
|
|
1884
|
+
const rgb = parseColor(value);
|
|
1876
1885
|
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
1877
1886
|
if (!key.startsWith('on-')) {
|
|
1878
1887
|
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
1879
1888
|
}
|
|
1880
1889
|
}
|
|
1881
1890
|
for (const [key, value] of Object.entries(theme.variables)) {
|
|
1882
|
-
const color = typeof value === 'string' && value.startsWith('#') ? parseColor
|
|
1891
|
+
const color = typeof value === 'string' && value.startsWith('#') ? parseColor(value) : undefined;
|
|
1883
1892
|
const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined;
|
|
1884
1893
|
variables.push(`--v-${key}: ${rgb ?? value}`);
|
|
1885
1894
|
}
|
|
@@ -2660,6 +2669,7 @@ function useAspectStyles(props) {
|
|
|
2660
2669
|
const makeVResponsiveProps = propsFactory({
|
|
2661
2670
|
aspectRatio: [String, Number],
|
|
2662
2671
|
contentClass: String,
|
|
2672
|
+
inline: Boolean,
|
|
2663
2673
|
...makeComponentProps(),
|
|
2664
2674
|
...makeDimensionProps()
|
|
2665
2675
|
}, 'v-responsive');
|
|
@@ -2677,7 +2687,9 @@ const VResponsive = genericComponent()({
|
|
|
2677
2687
|
dimensionStyles
|
|
2678
2688
|
} = useDimension(props);
|
|
2679
2689
|
useRender(() => createVNode("div", {
|
|
2680
|
-
"class": ['v-responsive',
|
|
2690
|
+
"class": ['v-responsive', {
|
|
2691
|
+
'v-responsive--inline': props.inline
|
|
2692
|
+
}, props.class],
|
|
2681
2693
|
"style": [dimensionStyles.value, props.style]
|
|
2682
2694
|
}, [createVNode("div", {
|
|
2683
2695
|
"class": "v-responsive__sizer",
|
|
@@ -2771,7 +2783,6 @@ const MaybeTransition = (props, _ref) => {
|
|
|
2771
2783
|
// Types
|
|
2772
2784
|
|
|
2773
2785
|
const makeVImgProps = propsFactory({
|
|
2774
|
-
aspectRatio: [String, Number],
|
|
2775
2786
|
alt: String,
|
|
2776
2787
|
cover: Boolean,
|
|
2777
2788
|
eager: Boolean,
|
|
@@ -2793,7 +2804,7 @@ const makeVImgProps = propsFactory({
|
|
|
2793
2804
|
default: ''
|
|
2794
2805
|
},
|
|
2795
2806
|
srcset: String,
|
|
2796
|
-
|
|
2807
|
+
...makeVResponsiveProps(),
|
|
2797
2808
|
...makeComponentProps(),
|
|
2798
2809
|
...makeTransitionProps()
|
|
2799
2810
|
}, 'v-img');
|
|
@@ -2985,25 +2996,27 @@ const VImg = genericComponent()({
|
|
|
2985
2996
|
}
|
|
2986
2997
|
});
|
|
2987
2998
|
}
|
|
2988
|
-
useRender(() =>
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
2999
|
+
useRender(() => {
|
|
3000
|
+
const [responsiveProps] = VResponsive.filterProps(props);
|
|
3001
|
+
return withDirectives(createVNode(VResponsive, mergeProps({
|
|
3002
|
+
"class": ['v-img', {
|
|
3003
|
+
'v-img--booting': !isBooted.value
|
|
3004
|
+
}, props.class],
|
|
3005
|
+
"style": props.style
|
|
3006
|
+
}, responsiveProps, {
|
|
3007
|
+
"aspectRatio": aspectRatio.value,
|
|
3008
|
+
"aria-label": props.alt,
|
|
3009
|
+
"role": props.alt ? 'img' : undefined
|
|
3010
|
+
}), {
|
|
3011
|
+
additional: () => createVNode(Fragment, null, [createVNode(__image, null, null), createVNode(__preloadImage, null, null), createVNode(__gradient, null, null), createVNode(__placeholder, null, null), createVNode(__error, null, null)]),
|
|
3012
|
+
default: slots.default
|
|
3013
|
+
}), [[resolveDirective("intersect"), {
|
|
3014
|
+
handler: init,
|
|
3015
|
+
options: props.options
|
|
3016
|
+
}, null, {
|
|
3017
|
+
once: true
|
|
3018
|
+
}]]);
|
|
3019
|
+
});
|
|
3007
3020
|
return {
|
|
3008
3021
|
currentSrc,
|
|
3009
3022
|
image,
|
|
@@ -3398,7 +3411,7 @@ function useScroll(props) {
|
|
|
3398
3411
|
watch(() => props.scrollTarget, scrollTarget => {
|
|
3399
3412
|
const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window;
|
|
3400
3413
|
if (!newTarget) {
|
|
3401
|
-
consoleWarn(`Unable to locate element with identifier ${scrollTarget}
|
|
3414
|
+
consoleWarn(`Unable to locate element with identifier ${scrollTarget}`);
|
|
3402
3415
|
return;
|
|
3403
3416
|
}
|
|
3404
3417
|
if (newTarget === target.value) return;
|
|
@@ -3880,26 +3893,26 @@ function getItemIndex(items, value) {
|
|
|
3880
3893
|
}
|
|
3881
3894
|
function getIds(items, modelValue) {
|
|
3882
3895
|
const ids = [];
|
|
3883
|
-
|
|
3884
|
-
const item = items
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
ids.push(item.id);
|
|
3888
|
-
}
|
|
3889
|
-
} else if (modelValue.includes(i)) {
|
|
3896
|
+
modelValue.forEach(value => {
|
|
3897
|
+
const item = items.find(item => deepEqual(value, item.value));
|
|
3898
|
+
const itemByIndex = items[value];
|
|
3899
|
+
if (item?.value != null) {
|
|
3890
3900
|
ids.push(item.id);
|
|
3901
|
+
} else if (itemByIndex != null) {
|
|
3902
|
+
ids.push(itemByIndex.id);
|
|
3891
3903
|
}
|
|
3892
|
-
}
|
|
3904
|
+
});
|
|
3893
3905
|
return ids;
|
|
3894
3906
|
}
|
|
3895
3907
|
function getValues(items, ids) {
|
|
3896
3908
|
const values = [];
|
|
3897
|
-
|
|
3898
|
-
const
|
|
3899
|
-
if (
|
|
3900
|
-
|
|
3909
|
+
ids.forEach(id => {
|
|
3910
|
+
const itemIndex = items.findIndex(item => item.id === id);
|
|
3911
|
+
if (~itemIndex) {
|
|
3912
|
+
const item = items[itemIndex];
|
|
3913
|
+
values.push(item.value != null ? item.value : itemIndex);
|
|
3901
3914
|
}
|
|
3902
|
-
}
|
|
3915
|
+
});
|
|
3903
3916
|
return values;
|
|
3904
3917
|
}
|
|
3905
3918
|
|
|
@@ -5569,10 +5582,17 @@ const makeVFieldProps = propsFactory({
|
|
|
5569
5582
|
default: '$clear'
|
|
5570
5583
|
},
|
|
5571
5584
|
active: Boolean,
|
|
5585
|
+
centerAffix: {
|
|
5586
|
+
type: Boolean,
|
|
5587
|
+
default: undefined
|
|
5588
|
+
},
|
|
5572
5589
|
color: String,
|
|
5573
5590
|
baseColor: String,
|
|
5574
5591
|
dirty: Boolean,
|
|
5575
|
-
disabled:
|
|
5592
|
+
disabled: {
|
|
5593
|
+
type: Boolean,
|
|
5594
|
+
default: null
|
|
5595
|
+
},
|
|
5576
5596
|
error: Boolean,
|
|
5577
5597
|
flat: Boolean,
|
|
5578
5598
|
label: String,
|
|
@@ -5640,6 +5660,7 @@ const VField = genericComponent()({
|
|
|
5640
5660
|
const labelRef = ref();
|
|
5641
5661
|
const floatingLabelRef = ref();
|
|
5642
5662
|
const controlRef = ref();
|
|
5663
|
+
const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
5643
5664
|
const {
|
|
5644
5665
|
backgroundColorClasses,
|
|
5645
5666
|
backgroundColorStyles
|
|
@@ -5705,6 +5726,7 @@ const VField = genericComponent()({
|
|
|
5705
5726
|
const hasClear = !!(props.clearable || slots.clear);
|
|
5706
5727
|
const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear);
|
|
5707
5728
|
const label = slots.label ? slots.label({
|
|
5729
|
+
...slotProps.value,
|
|
5708
5730
|
label: props.label,
|
|
5709
5731
|
props: {
|
|
5710
5732
|
for: id.value
|
|
@@ -5714,6 +5736,7 @@ const VField = genericComponent()({
|
|
|
5714
5736
|
"class": ['v-field', {
|
|
5715
5737
|
'v-field--active': isActive.value,
|
|
5716
5738
|
'v-field--appended': hasAppend,
|
|
5739
|
+
'v-field--center-affix': props.centerAffix ?? !isPlainOrUnderlined.value,
|
|
5717
5740
|
'v-field--disabled': props.disabled,
|
|
5718
5741
|
'v-field--dirty': props.dirty,
|
|
5719
5742
|
'v-field--error': props.error,
|
|
@@ -5799,7 +5822,7 @@ const VField = genericComponent()({
|
|
|
5799
5822
|
default: () => [label]
|
|
5800
5823
|
})]), createVNode("div", {
|
|
5801
5824
|
"class": "v-field__outline__end"
|
|
5802
|
-
}, null)]),
|
|
5825
|
+
}, null)]), isPlainOrUnderlined.value && hasLabel.value && createVNode(VFieldLabel, {
|
|
5803
5826
|
"ref": floatingLabelRef,
|
|
5804
5827
|
"floating": true,
|
|
5805
5828
|
"for": id.value
|
|
@@ -5917,12 +5940,9 @@ function createForm(props) {
|
|
|
5917
5940
|
}
|
|
5918
5941
|
function reset() {
|
|
5919
5942
|
items.value.forEach(item => item.reset());
|
|
5920
|
-
model.value = null;
|
|
5921
5943
|
}
|
|
5922
5944
|
function resetValidation() {
|
|
5923
5945
|
items.value.forEach(item => item.resetValidation());
|
|
5924
|
-
errors.value = [];
|
|
5925
|
-
model.value = null;
|
|
5926
5946
|
}
|
|
5927
5947
|
watch(items, () => {
|
|
5928
5948
|
let valid = 0;
|
|
@@ -5976,6 +5996,7 @@ function createForm(props) {
|
|
|
5976
5996
|
isDisabled,
|
|
5977
5997
|
isReadonly,
|
|
5978
5998
|
isValidating,
|
|
5999
|
+
isValid: model,
|
|
5979
6000
|
items,
|
|
5980
6001
|
validateOn: toRef(props, 'validateOn')
|
|
5981
6002
|
});
|
|
@@ -5984,6 +6005,7 @@ function createForm(props) {
|
|
|
5984
6005
|
isDisabled,
|
|
5985
6006
|
isReadonly,
|
|
5986
6007
|
isValidating,
|
|
6008
|
+
isValid: model,
|
|
5987
6009
|
items,
|
|
5988
6010
|
validate,
|
|
5989
6011
|
reset,
|
|
@@ -5999,7 +6021,10 @@ function useForm() {
|
|
|
5999
6021
|
// Types
|
|
6000
6022
|
|
|
6001
6023
|
const makeValidationProps = propsFactory({
|
|
6002
|
-
disabled:
|
|
6024
|
+
disabled: {
|
|
6025
|
+
type: Boolean,
|
|
6026
|
+
default: null
|
|
6027
|
+
},
|
|
6003
6028
|
error: Boolean,
|
|
6004
6029
|
errorMessages: {
|
|
6005
6030
|
type: [Array, String],
|
|
@@ -6011,7 +6036,10 @@ const makeValidationProps = propsFactory({
|
|
|
6011
6036
|
},
|
|
6012
6037
|
name: String,
|
|
6013
6038
|
label: String,
|
|
6014
|
-
readonly:
|
|
6039
|
+
readonly: {
|
|
6040
|
+
type: Boolean,
|
|
6041
|
+
default: null
|
|
6042
|
+
},
|
|
6015
6043
|
rules: {
|
|
6016
6044
|
type: Array,
|
|
6017
6045
|
default: () => []
|
|
@@ -6030,15 +6058,30 @@ function useValidation(props) {
|
|
|
6030
6058
|
const internalErrorMessages = ref([]);
|
|
6031
6059
|
const isPristine = shallowRef(true);
|
|
6032
6060
|
const isDirty = computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
|
|
6033
|
-
const isDisabled = computed(() => !!(props.disabled
|
|
6034
|
-
const isReadonly = computed(() => !!(props.readonly
|
|
6061
|
+
const isDisabled = computed(() => !!(props.disabled ?? form?.isDisabled.value));
|
|
6062
|
+
const isReadonly = computed(() => !!(props.readonly ?? form?.isReadonly.value));
|
|
6035
6063
|
const errorMessages = computed(() => {
|
|
6036
6064
|
return props.errorMessages.length ? wrapInArray(props.errorMessages).slice(0, Math.max(0, +props.maxErrors)) : internalErrorMessages.value;
|
|
6037
6065
|
});
|
|
6066
|
+
const validateOn = computed(() => {
|
|
6067
|
+
let value = (props.validateOn ?? form?.validateOn.value) || 'input';
|
|
6068
|
+
if (value === 'lazy') value = 'input lazy';
|
|
6069
|
+
const set = new Set(value?.split(' ') ?? []);
|
|
6070
|
+
return {
|
|
6071
|
+
blur: set.has('blur') || set.has('input'),
|
|
6072
|
+
input: set.has('input'),
|
|
6073
|
+
submit: set.has('submit'),
|
|
6074
|
+
lazy: set.has('lazy')
|
|
6075
|
+
};
|
|
6076
|
+
});
|
|
6038
6077
|
const isValid = computed(() => {
|
|
6039
|
-
if (props.error || errorMessages.
|
|
6078
|
+
if (props.error || props.errorMessages.length) return false;
|
|
6040
6079
|
if (!props.rules.length) return true;
|
|
6041
|
-
|
|
6080
|
+
if (isPristine.value) {
|
|
6081
|
+
return internalErrorMessages.value.length || validateOn.value.lazy ? null : true;
|
|
6082
|
+
} else {
|
|
6083
|
+
return !internalErrorMessages.value.length;
|
|
6084
|
+
}
|
|
6042
6085
|
});
|
|
6043
6086
|
const isValidating = shallowRef(false);
|
|
6044
6087
|
const validationClasses = computed(() => {
|
|
@@ -6061,11 +6104,13 @@ function useValidation(props) {
|
|
|
6061
6104
|
onBeforeUnmount(() => {
|
|
6062
6105
|
form?.unregister(uid.value);
|
|
6063
6106
|
});
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6107
|
+
onMounted(async () => {
|
|
6108
|
+
if (!validateOn.value.lazy) {
|
|
6109
|
+
await validate(true);
|
|
6110
|
+
}
|
|
6111
|
+
form?.update(uid.value, isValid.value, errorMessages.value);
|
|
6112
|
+
});
|
|
6113
|
+
useToggleScope(() => validateOn.value.input, () => {
|
|
6069
6114
|
watch(validationModel, () => {
|
|
6070
6115
|
if (validationModel.value != null) {
|
|
6071
6116
|
validate();
|
|
@@ -6077,7 +6122,7 @@ function useValidation(props) {
|
|
|
6077
6122
|
}
|
|
6078
6123
|
});
|
|
6079
6124
|
});
|
|
6080
|
-
useToggleScope(() => validateOn.value
|
|
6125
|
+
useToggleScope(() => validateOn.value.blur, () => {
|
|
6081
6126
|
watch(() => props.focused, val => {
|
|
6082
6127
|
if (!val) validate();
|
|
6083
6128
|
});
|
|
@@ -6086,14 +6131,19 @@ function useValidation(props) {
|
|
|
6086
6131
|
form?.update(uid.value, isValid.value, errorMessages.value);
|
|
6087
6132
|
});
|
|
6088
6133
|
function reset() {
|
|
6089
|
-
resetValidation();
|
|
6090
6134
|
model.value = null;
|
|
6135
|
+
nextTick(resetValidation);
|
|
6091
6136
|
}
|
|
6092
6137
|
function resetValidation() {
|
|
6093
6138
|
isPristine.value = true;
|
|
6094
|
-
|
|
6139
|
+
if (!validateOn.value.lazy) {
|
|
6140
|
+
validate(true);
|
|
6141
|
+
} else {
|
|
6142
|
+
internalErrorMessages.value = [];
|
|
6143
|
+
}
|
|
6095
6144
|
}
|
|
6096
6145
|
async function validate() {
|
|
6146
|
+
let silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6097
6147
|
const results = [];
|
|
6098
6148
|
isValidating.value = true;
|
|
6099
6149
|
for (const rule of props.rules) {
|
|
@@ -6112,7 +6162,7 @@ function useValidation(props) {
|
|
|
6112
6162
|
}
|
|
6113
6163
|
internalErrorMessages.value = results;
|
|
6114
6164
|
isValidating.value = false;
|
|
6115
|
-
isPristine.value =
|
|
6165
|
+
isPristine.value = silent;
|
|
6116
6166
|
return internalErrorMessages.value;
|
|
6117
6167
|
}
|
|
6118
6168
|
return {
|
|
@@ -6133,6 +6183,10 @@ function useValidation(props) {
|
|
|
6133
6183
|
const makeVInputProps = propsFactory({
|
|
6134
6184
|
id: String,
|
|
6135
6185
|
appendIcon: IconValue,
|
|
6186
|
+
centerAffix: {
|
|
6187
|
+
type: Boolean,
|
|
6188
|
+
default: true
|
|
6189
|
+
},
|
|
6136
6190
|
prependIcon: IconValue,
|
|
6137
6191
|
hideDetails: [Boolean, String],
|
|
6138
6192
|
hint: String,
|
|
@@ -6202,7 +6256,7 @@ const VInput = genericComponent()({
|
|
|
6202
6256
|
validate
|
|
6203
6257
|
}));
|
|
6204
6258
|
const messages = computed(() => {
|
|
6205
|
-
if (errorMessages.value.length > 0) {
|
|
6259
|
+
if (!isPristine.value && errorMessages.value.length > 0) {
|
|
6206
6260
|
return errorMessages.value;
|
|
6207
6261
|
} else if (props.hint && (props.persistentHint || props.focused)) {
|
|
6208
6262
|
return props.hint;
|
|
@@ -6216,7 +6270,9 @@ const VInput = genericComponent()({
|
|
|
6216
6270
|
const hasMessages = messages.value.length > 0;
|
|
6217
6271
|
const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
|
|
6218
6272
|
return createVNode("div", {
|
|
6219
|
-
"class": ['v-input', `v-input--${props.direction}`,
|
|
6273
|
+
"class": ['v-input', `v-input--${props.direction}`, {
|
|
6274
|
+
'v-input--center-affix': props.centerAffix
|
|
6275
|
+
}, densityClasses.value, validationClasses.value, props.class],
|
|
6220
6276
|
"style": props.style
|
|
6221
6277
|
}, [hasPrepend && createVNode("div", {
|
|
6222
6278
|
"key": "prepend",
|
|
@@ -6423,6 +6479,7 @@ const VTextField = genericComponent()({
|
|
|
6423
6479
|
if (!props.counter || typeof props.counter !== 'number' && typeof props.counter !== 'string') return undefined;
|
|
6424
6480
|
return props.counter;
|
|
6425
6481
|
});
|
|
6482
|
+
const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
6426
6483
|
function onIntersect(isIntersecting, entries) {
|
|
6427
6484
|
if (!props.autofocus || !isIntersecting) return;
|
|
6428
6485
|
entries[0].target?.focus?.();
|
|
@@ -6482,10 +6539,11 @@ const VTextField = genericComponent()({
|
|
|
6482
6539
|
"class": ['v-text-field', {
|
|
6483
6540
|
'v-text-field--prefixed': props.prefix,
|
|
6484
6541
|
'v-text-field--suffixed': props.suffix,
|
|
6485
|
-
'v-text-field--
|
|
6542
|
+
'v-text-field--plain-underlined': ['plain', 'underlined'].includes(props.variant)
|
|
6486
6543
|
}, props.class],
|
|
6487
6544
|
"style": props.style
|
|
6488
6545
|
}, rootAttrs, inputProps, {
|
|
6546
|
+
"centerAffix": !isPlainOrUnderlined.value,
|
|
6489
6547
|
"focused": isFocused.value
|
|
6490
6548
|
}), {
|
|
6491
6549
|
...slots,
|
|
@@ -6855,10 +6913,10 @@ const VCheckboxBtn = genericComponent()({
|
|
|
6855
6913
|
}
|
|
6856
6914
|
}
|
|
6857
6915
|
const falseIcon = computed(() => {
|
|
6858
|
-
return
|
|
6916
|
+
return indeterminate.value ? props.indeterminateIcon : props.falseIcon;
|
|
6859
6917
|
});
|
|
6860
6918
|
const trueIcon = computed(() => {
|
|
6861
|
-
return
|
|
6919
|
+
return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
|
|
6862
6920
|
});
|
|
6863
6921
|
useRender(() => createVNode(VSelectionControl, mergeProps(props, {
|
|
6864
6922
|
"modelValue": model.value,
|
|
@@ -6868,7 +6926,7 @@ const VCheckboxBtn = genericComponent()({
|
|
|
6868
6926
|
"type": "checkbox",
|
|
6869
6927
|
"falseIcon": falseIcon.value,
|
|
6870
6928
|
"trueIcon": trueIcon.value,
|
|
6871
|
-
"aria-checked":
|
|
6929
|
+
"aria-checked": indeterminate.value ? 'mixed' : undefined
|
|
6872
6930
|
}), slots));
|
|
6873
6931
|
return {};
|
|
6874
6932
|
}
|
|
@@ -7828,7 +7886,9 @@ const VListGroupActivator = defineComponent({
|
|
|
7828
7886
|
}
|
|
7829
7887
|
});
|
|
7830
7888
|
const makeVListGroupProps = propsFactory({
|
|
7889
|
+
/* @deprecated */
|
|
7831
7890
|
activeColor: String,
|
|
7891
|
+
baseColor: String,
|
|
7832
7892
|
color: String,
|
|
7833
7893
|
collapseIcon: {
|
|
7834
7894
|
type: IconValue,
|
|
@@ -7877,6 +7937,7 @@ const VListGroup = genericComponent()({
|
|
|
7877
7937
|
VListItem: {
|
|
7878
7938
|
active: isOpen.value,
|
|
7879
7939
|
activeColor: props.activeColor,
|
|
7940
|
+
baseColor: props.baseColor,
|
|
7880
7941
|
color: props.color,
|
|
7881
7942
|
prependIcon: props.prependIcon || props.subgroup && toggleIcon.value,
|
|
7882
7943
|
appendIcon: props.appendIcon || !props.subgroup && toggleIcon.value,
|
|
@@ -7931,9 +7992,11 @@ const makeVListItemProps = propsFactory({
|
|
|
7931
7992
|
default: undefined
|
|
7932
7993
|
},
|
|
7933
7994
|
activeClass: String,
|
|
7995
|
+
/* @deprecated */
|
|
7934
7996
|
activeColor: String,
|
|
7935
7997
|
appendAvatar: String,
|
|
7936
7998
|
appendIcon: IconValue,
|
|
7999
|
+
baseColor: String,
|
|
7937
8000
|
disabled: Boolean,
|
|
7938
8001
|
lines: String,
|
|
7939
8002
|
link: {
|
|
@@ -7996,8 +8059,9 @@ const VListItem = genericComponent()({
|
|
|
7996
8059
|
const isLink = computed(() => props.link !== false && link.isLink.value);
|
|
7997
8060
|
const isClickable = computed(() => !props.disabled && props.link !== false && (props.link || link.isClickable.value || props.value != null && !!list));
|
|
7998
8061
|
const roundedProps = computed(() => props.rounded || props.nav);
|
|
8062
|
+
const color = computed(() => props.color ?? props.activeColor);
|
|
7999
8063
|
const variantProps = computed(() => ({
|
|
8000
|
-
color: isActive.value ?
|
|
8064
|
+
color: isActive.value ? color.value ?? props.baseColor : props.baseColor,
|
|
8001
8065
|
variant: props.variant
|
|
8002
8066
|
}));
|
|
8003
8067
|
watch(() => link.isActive?.value, val => {
|
|
@@ -8054,7 +8118,6 @@ const VListItem = genericComponent()({
|
|
|
8054
8118
|
}
|
|
8055
8119
|
useRender(() => {
|
|
8056
8120
|
const Tag = isLink.value ? 'a' : props.tag;
|
|
8057
|
-
const hasColor = !list || isSelected.value || isActive.value;
|
|
8058
8121
|
const hasTitle = slots.title || props.title;
|
|
8059
8122
|
const hasSubtitle = slots.subtitle || props.subtitle;
|
|
8060
8123
|
const hasAppendMedia = !!(props.appendAvatar || props.appendIcon);
|
|
@@ -8062,6 +8125,9 @@ const VListItem = genericComponent()({
|
|
|
8062
8125
|
const hasPrependMedia = !!(props.prependAvatar || props.prependIcon);
|
|
8063
8126
|
const hasPrepend = !!(hasPrependMedia || slots.prepend);
|
|
8064
8127
|
list?.updateHasPrepend(hasPrepend);
|
|
8128
|
+
if (props.activeColor) {
|
|
8129
|
+
deprecate('active-color', ['color', 'base-color']);
|
|
8130
|
+
}
|
|
8065
8131
|
return withDirectives(createVNode(Tag, {
|
|
8066
8132
|
"class": ['v-list-item', {
|
|
8067
8133
|
'v-list-item--active': isActive.value,
|
|
@@ -8070,10 +8136,10 @@ const VListItem = genericComponent()({
|
|
|
8070
8136
|
'v-list-item--nav': props.nav,
|
|
8071
8137
|
'v-list-item--prepend': !hasPrepend && list?.hasPrepend.value,
|
|
8072
8138
|
[`${props.activeClass}`]: props.activeClass && isActive.value
|
|
8073
|
-
}, themeClasses.value, borderClasses.value,
|
|
8074
|
-
"style": [
|
|
8139
|
+
}, themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, elevationClasses.value, lineClasses.value, roundedClasses.value, variantClasses.value, props.class],
|
|
8140
|
+
"style": [colorStyles.value, dimensionStyles.value, props.style],
|
|
8075
8141
|
"href": link.href.value,
|
|
8076
|
-
"tabindex": isClickable.value ? 0 : undefined,
|
|
8142
|
+
"tabindex": isClickable.value ? list ? -2 : 0 : undefined,
|
|
8077
8143
|
"onClick": onClick,
|
|
8078
8144
|
"onKeydown": isClickable.value && !isLink.value && onKeyDown
|
|
8079
8145
|
}, {
|
|
@@ -8224,9 +8290,7 @@ const VListChildren = genericComponent()({
|
|
|
8224
8290
|
if (type === 'subheader') {
|
|
8225
8291
|
return slots.subheader?.({
|
|
8226
8292
|
props: itemProps
|
|
8227
|
-
}) ?? createVNode(VListSubheader, itemProps,
|
|
8228
|
-
default: slots.subheader
|
|
8229
|
-
});
|
|
8293
|
+
}) ?? createVNode(VListSubheader, itemProps, null);
|
|
8230
8294
|
}
|
|
8231
8295
|
const slotsWithItem = {
|
|
8232
8296
|
subtitle: slots.subtitle ? slotProps => slots.subtitle?.({
|
|
@@ -8241,10 +8305,6 @@ const VListChildren = genericComponent()({
|
|
|
8241
8305
|
...slotProps,
|
|
8242
8306
|
item
|
|
8243
8307
|
}) : undefined,
|
|
8244
|
-
default: slots.default ? slotProps => slots.default?.({
|
|
8245
|
-
...slotProps,
|
|
8246
|
-
item
|
|
8247
|
-
}) : undefined,
|
|
8248
8308
|
title: slots.title ? slotProps => slots.title?.({
|
|
8249
8309
|
...slotProps,
|
|
8250
8310
|
item
|
|
@@ -8268,7 +8328,9 @@ const VListChildren = genericComponent()({
|
|
|
8268
8328
|
default: () => createVNode(VListChildren, {
|
|
8269
8329
|
"items": children
|
|
8270
8330
|
}, slots)
|
|
8271
|
-
}) : slots.item ? slots.item(
|
|
8331
|
+
}) : slots.item ? slots.item({
|
|
8332
|
+
props: itemProps
|
|
8333
|
+
}) : createVNode(VListItem, itemProps, slotsWithItem);
|
|
8272
8334
|
});
|
|
8273
8335
|
}
|
|
8274
8336
|
});
|
|
@@ -8300,8 +8362,8 @@ const makeItemsProps = propsFactory({
|
|
|
8300
8362
|
default: 'props'
|
|
8301
8363
|
},
|
|
8302
8364
|
returnObject: Boolean
|
|
8303
|
-
}, '
|
|
8304
|
-
function transformItem$
|
|
8365
|
+
}, 'list-items');
|
|
8366
|
+
function transformItem$3(props, item) {
|
|
8305
8367
|
const title = getPropertyFromItem(item, props.itemTitle, item);
|
|
8306
8368
|
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue, title);
|
|
8307
8369
|
const children = getPropertyFromItem(item, props.itemChildren);
|
|
@@ -8315,33 +8377,36 @@ function transformItem$1(props, item) {
|
|
|
8315
8377
|
title: String(_props.title ?? ''),
|
|
8316
8378
|
value: _props.value,
|
|
8317
8379
|
props: _props,
|
|
8318
|
-
children: Array.isArray(children) ? transformItems$
|
|
8380
|
+
children: Array.isArray(children) ? transformItems$3(props, children) : undefined,
|
|
8319
8381
|
raw: item
|
|
8320
8382
|
};
|
|
8321
8383
|
}
|
|
8322
|
-
function transformItems$
|
|
8384
|
+
function transformItems$3(props, items) {
|
|
8323
8385
|
const array = [];
|
|
8324
8386
|
for (const item of items) {
|
|
8325
|
-
array.push(transformItem$
|
|
8387
|
+
array.push(transformItem$3(props, item));
|
|
8326
8388
|
}
|
|
8327
8389
|
return array;
|
|
8328
8390
|
}
|
|
8329
8391
|
function useItems(props) {
|
|
8330
|
-
const items = computed(() => transformItems$
|
|
8392
|
+
const items = computed(() => transformItems$3(props, props.items));
|
|
8393
|
+
return useTransformItems(items, value => transformItem$3(props, value));
|
|
8394
|
+
}
|
|
8395
|
+
function useTransformItems(items, transform) {
|
|
8331
8396
|
function transformIn(value) {
|
|
8332
8397
|
return value.map(v => {
|
|
8333
8398
|
const existingItem = items.value.find(item => deepEqual(v, item.value));
|
|
8334
8399
|
// Nullish existingItem means value is a custom input value from combobox
|
|
8335
|
-
// In this case, use transformItem to create an
|
|
8336
|
-
return existingItem ??
|
|
8400
|
+
// In this case, use transformItem to create an { value: unknown } based on value
|
|
8401
|
+
return existingItem ?? transform(v);
|
|
8337
8402
|
});
|
|
8338
8403
|
}
|
|
8339
8404
|
function transformOut(value) {
|
|
8340
8405
|
return value.map(_ref => {
|
|
8341
8406
|
let {
|
|
8342
|
-
|
|
8407
|
+
value
|
|
8343
8408
|
} = _ref;
|
|
8344
|
-
return
|
|
8409
|
+
return value;
|
|
8345
8410
|
});
|
|
8346
8411
|
}
|
|
8347
8412
|
return {
|
|
@@ -8356,7 +8421,7 @@ function useItems(props) {
|
|
|
8356
8421
|
function isPrimitive(value) {
|
|
8357
8422
|
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
8358
8423
|
}
|
|
8359
|
-
function transformItem(props, item) {
|
|
8424
|
+
function transformItem$2(props, item) {
|
|
8360
8425
|
const type = getPropertyFromItem(item, props.itemType, 'item');
|
|
8361
8426
|
const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle);
|
|
8362
8427
|
const value = getPropertyFromItem(item, props.itemValue, undefined);
|
|
@@ -8372,24 +8437,26 @@ function transformItem(props, item) {
|
|
|
8372
8437
|
title: _props.title,
|
|
8373
8438
|
value: _props.value,
|
|
8374
8439
|
props: _props,
|
|
8375
|
-
children: type === 'item' && children ? transformItems(props, children) : undefined,
|
|
8440
|
+
children: type === 'item' && children ? transformItems$2(props, children) : undefined,
|
|
8376
8441
|
raw: item
|
|
8377
8442
|
};
|
|
8378
8443
|
}
|
|
8379
|
-
function transformItems(props, items) {
|
|
8444
|
+
function transformItems$2(props, items) {
|
|
8380
8445
|
const array = [];
|
|
8381
8446
|
for (const item of items) {
|
|
8382
|
-
array.push(transformItem(props, item));
|
|
8447
|
+
array.push(transformItem$2(props, item));
|
|
8383
8448
|
}
|
|
8384
8449
|
return array;
|
|
8385
8450
|
}
|
|
8386
8451
|
function useListItems(props) {
|
|
8387
|
-
const items = computed(() => transformItems(props, props.items));
|
|
8452
|
+
const items = computed(() => transformItems$2(props, props.items));
|
|
8388
8453
|
return {
|
|
8389
8454
|
items
|
|
8390
8455
|
};
|
|
8391
8456
|
}
|
|
8392
8457
|
const makeVListProps = propsFactory({
|
|
8458
|
+
baseColor: String,
|
|
8459
|
+
/* @deprecated */
|
|
8393
8460
|
activeColor: String,
|
|
8394
8461
|
activeClass: String,
|
|
8395
8462
|
bgColor: String,
|
|
@@ -8464,16 +8531,19 @@ const VList = genericComponent()({
|
|
|
8464
8531
|
} = useNested(props);
|
|
8465
8532
|
const lineClasses = computed(() => props.lines ? `v-list--${props.lines}-line` : undefined);
|
|
8466
8533
|
const activeColor = toRef(props, 'activeColor');
|
|
8534
|
+
const baseColor = toRef(props, 'baseColor');
|
|
8467
8535
|
const color = toRef(props, 'color');
|
|
8468
8536
|
createList();
|
|
8469
8537
|
provideDefaults({
|
|
8470
8538
|
VListGroup: {
|
|
8471
8539
|
activeColor,
|
|
8540
|
+
baseColor,
|
|
8472
8541
|
color
|
|
8473
8542
|
},
|
|
8474
8543
|
VListItem: {
|
|
8475
8544
|
activeClass: toRef(props, 'activeClass'),
|
|
8476
8545
|
activeColor,
|
|
8546
|
+
baseColor,
|
|
8477
8547
|
color,
|
|
8478
8548
|
density: toRef(props, 'density'),
|
|
8479
8549
|
disabled: toRef(props, 'disabled'),
|
|
@@ -9498,14 +9568,14 @@ const parseDisplayOptions = function () {
|
|
|
9498
9568
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultDisplayOptions;
|
|
9499
9569
|
return mergeDeep(defaultDisplayOptions, options);
|
|
9500
9570
|
};
|
|
9501
|
-
function getClientWidth(
|
|
9502
|
-
return IN_BROWSER && !
|
|
9571
|
+
function getClientWidth(ssr) {
|
|
9572
|
+
return IN_BROWSER && !ssr ? window.innerWidth : typeof ssr === 'object' && ssr.clientWidth || 0;
|
|
9503
9573
|
}
|
|
9504
|
-
function getClientHeight(
|
|
9505
|
-
return IN_BROWSER && !
|
|
9574
|
+
function getClientHeight(ssr) {
|
|
9575
|
+
return IN_BROWSER && !ssr ? window.innerHeight : typeof ssr === 'object' && ssr.clientHeight || 0;
|
|
9506
9576
|
}
|
|
9507
|
-
function getPlatform(
|
|
9508
|
-
const userAgent = IN_BROWSER && !
|
|
9577
|
+
function getPlatform(ssr) {
|
|
9578
|
+
const userAgent = IN_BROWSER && !ssr ? window.navigator.userAgent : 'ssr';
|
|
9509
9579
|
function match(regexp) {
|
|
9510
9580
|
return Boolean(userAgent.match(regexp));
|
|
9511
9581
|
}
|
|
@@ -10329,10 +10399,10 @@ const VSelect = genericComponent()({
|
|
|
10329
10399
|
'v-select--active-menu': menu.value,
|
|
10330
10400
|
'v-select--chips': !!props.chips,
|
|
10331
10401
|
[`v-select--${props.multiple ? 'multiple' : 'single'}`]: true,
|
|
10332
|
-
'v-select--selected': model.value.length
|
|
10402
|
+
'v-select--selected': model.value.length,
|
|
10403
|
+
'v-select--selection-slot': !!slots.selection
|
|
10333
10404
|
}, props.class],
|
|
10334
10405
|
"style": props.style,
|
|
10335
|
-
"appendInnerIcon": props.menuIcon,
|
|
10336
10406
|
"readonly": true,
|
|
10337
10407
|
"placeholder": placeholder,
|
|
10338
10408
|
"onClick:clear": onClear,
|
|
@@ -10364,25 +10434,21 @@ const VSelect = genericComponent()({
|
|
|
10364
10434
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
10365
10435
|
"title": t(props.noDataText)
|
|
10366
10436
|
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
}
|
|
10376
|
-
return createVNode(VListItem, mergeProps({
|
|
10377
|
-
"key": index
|
|
10378
|
-
}, item.props, {
|
|
10379
|
-
"onClick": () => select(item)
|
|
10380
|
-
}), {
|
|
10437
|
+
const itemProps = mergeProps(item.props, {
|
|
10438
|
+
key: index,
|
|
10439
|
+
onClick: () => select(item)
|
|
10440
|
+
});
|
|
10441
|
+
return slots.item?.({
|
|
10442
|
+
item,
|
|
10443
|
+
index,
|
|
10444
|
+
props: itemProps
|
|
10445
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
10381
10446
|
prepend: _ref2 => {
|
|
10382
10447
|
let {
|
|
10383
10448
|
isSelected
|
|
10384
10449
|
} = _ref2;
|
|
10385
10450
|
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
10451
|
+
"key": item.value,
|
|
10386
10452
|
"modelValue": isSelected,
|
|
10387
10453
|
"ripple": false,
|
|
10388
10454
|
"tabindex": "-1"
|
|
@@ -10439,7 +10505,16 @@ const VSelect = genericComponent()({
|
|
|
10439
10505
|
}, [item.title, props.multiple && index < selections.value.length - 1 && createVNode("span", {
|
|
10440
10506
|
"class": "v-select__selection-comma"
|
|
10441
10507
|
}, [createTextVNode(",")])])]);
|
|
10442
|
-
})])
|
|
10508
|
+
})]),
|
|
10509
|
+
'append-inner': function () {
|
|
10510
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10511
|
+
args[_key] = arguments[_key];
|
|
10512
|
+
}
|
|
10513
|
+
return createVNode(Fragment, null, [slots['append-inner']?.(...args), props.menuIcon ? createVNode(VIcon, {
|
|
10514
|
+
"class": "v-select__menu-icon",
|
|
10515
|
+
"icon": props.menuIcon
|
|
10516
|
+
}, null) : undefined]);
|
|
10517
|
+
}
|
|
10443
10518
|
});
|
|
10444
10519
|
});
|
|
10445
10520
|
return forwardRefs({
|
|
@@ -10451,6 +10526,8 @@ const VSelect = genericComponent()({
|
|
|
10451
10526
|
});
|
|
10452
10527
|
|
|
10453
10528
|
/* eslint-disable max-statements */
|
|
10529
|
+
/* eslint-disable no-labels */
|
|
10530
|
+
|
|
10454
10531
|
|
|
10455
10532
|
// Types
|
|
10456
10533
|
|
|
@@ -10520,23 +10597,24 @@ function useFilter(props, items, query, options) {
|
|
|
10520
10597
|
const strQuery = computed(() => typeof query?.value !== 'string' && typeof query?.value !== 'number' ? '' : String(query.value));
|
|
10521
10598
|
const filteredItems = ref([]);
|
|
10522
10599
|
const filteredMatches = ref(new Map());
|
|
10600
|
+
const transformedItems = computed(() => options?.transform ? unref(items).map(options?.transform) : unref(items));
|
|
10523
10601
|
watchEffect(() => {
|
|
10524
10602
|
filteredItems.value = [];
|
|
10525
10603
|
filteredMatches.value = new Map();
|
|
10526
|
-
const
|
|
10527
|
-
const results = filterItems(transformedItems, strQuery.value, {
|
|
10604
|
+
const results = filterItems(transformedItems.value, strQuery.value, {
|
|
10528
10605
|
customKeyFilter: props.customKeyFilter,
|
|
10529
10606
|
default: props.customFilter,
|
|
10530
|
-
filterKeys:
|
|
10607
|
+
filterKeys: props.filterKeys,
|
|
10531
10608
|
filterMode: props.filterMode,
|
|
10532
10609
|
noFilter: props.noFilter
|
|
10533
10610
|
});
|
|
10611
|
+
const originalItems = unref(items);
|
|
10534
10612
|
results.forEach(_ref => {
|
|
10535
10613
|
let {
|
|
10536
10614
|
index,
|
|
10537
10615
|
matches
|
|
10538
10616
|
} = _ref;
|
|
10539
|
-
const item =
|
|
10617
|
+
const item = originalItems[index];
|
|
10540
10618
|
filteredItems.value.push(item);
|
|
10541
10619
|
filteredMatches.value.set(item.value, matches);
|
|
10542
10620
|
});
|
|
@@ -10565,8 +10643,9 @@ function highlightResult$1(text, matches, length) {
|
|
|
10565
10643
|
}, [text.substr(matches + length)])]) : text;
|
|
10566
10644
|
}
|
|
10567
10645
|
const makeVAutocompleteProps = propsFactory({
|
|
10568
|
-
|
|
10569
|
-
|
|
10646
|
+
autoSelectFirst: {
|
|
10647
|
+
type: [Boolean, String]
|
|
10648
|
+
},
|
|
10570
10649
|
search: String,
|
|
10571
10650
|
...makeFilterProps({
|
|
10572
10651
|
filterKeys: ['title']
|
|
@@ -10598,6 +10677,7 @@ const VAutocomplete = genericComponent()({
|
|
|
10598
10677
|
const vTextFieldRef = ref();
|
|
10599
10678
|
const isFocused = shallowRef(false);
|
|
10600
10679
|
const isPristine = shallowRef(true);
|
|
10680
|
+
const listHasFocus = ref(false);
|
|
10601
10681
|
const vMenuRef = ref();
|
|
10602
10682
|
const _menu = useProxiedModel(props, 'menu');
|
|
10603
10683
|
const menu = computed({
|
|
@@ -10641,6 +10721,10 @@ const VAutocomplete = genericComponent()({
|
|
|
10641
10721
|
});
|
|
10642
10722
|
const selected = computed(() => selections.value.map(selection => selection.props.value));
|
|
10643
10723
|
const selection = computed(() => selections.value[selectionIndex.value]);
|
|
10724
|
+
const highlightFirst = computed(() => {
|
|
10725
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
10726
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
10727
|
+
});
|
|
10644
10728
|
const listRef = ref();
|
|
10645
10729
|
function onClear(e) {
|
|
10646
10730
|
if (props.openOnClear) {
|
|
@@ -10652,6 +10736,13 @@ const VAutocomplete = genericComponent()({
|
|
|
10652
10736
|
if (props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value) return;
|
|
10653
10737
|
menu.value = true;
|
|
10654
10738
|
}
|
|
10739
|
+
function onMousedownMenuIcon(e) {
|
|
10740
|
+
if (isFocused.value) {
|
|
10741
|
+
e.preventDefault();
|
|
10742
|
+
e.stopPropagation();
|
|
10743
|
+
}
|
|
10744
|
+
menu.value = !menu.value;
|
|
10745
|
+
}
|
|
10655
10746
|
function onKeydown(e) {
|
|
10656
10747
|
if (props.readonly || form?.isReadonly.value) return;
|
|
10657
10748
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
@@ -10666,10 +10757,16 @@ const VAutocomplete = genericComponent()({
|
|
|
10666
10757
|
menu.value = false;
|
|
10667
10758
|
}
|
|
10668
10759
|
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
|
10760
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
|
|
10761
|
+
select(filteredItems.value[0]);
|
|
10762
|
+
}
|
|
10669
10763
|
isPristine.value = true;
|
|
10670
10764
|
}
|
|
10671
10765
|
if (e.key === 'ArrowDown') {
|
|
10672
10766
|
listRef.value?.focus('next');
|
|
10767
|
+
if (highlightFirst.value) {
|
|
10768
|
+
listRef.value?.focus('next');
|
|
10769
|
+
}
|
|
10673
10770
|
} else if (e.key === 'ArrowUp') {
|
|
10674
10771
|
listRef.value?.focus('prev');
|
|
10675
10772
|
}
|
|
@@ -10717,6 +10814,12 @@ const VAutocomplete = genericComponent()({
|
|
|
10717
10814
|
}
|
|
10718
10815
|
function onFocusin(e) {
|
|
10719
10816
|
isFocused.value = true;
|
|
10817
|
+
setTimeout(() => {
|
|
10818
|
+
listHasFocus.value = true;
|
|
10819
|
+
});
|
|
10820
|
+
}
|
|
10821
|
+
function onFocusout(e) {
|
|
10822
|
+
listHasFocus.value = false;
|
|
10720
10823
|
}
|
|
10721
10824
|
const isSelecting = shallowRef(false);
|
|
10722
10825
|
function select(item) {
|
|
@@ -10738,14 +10841,22 @@ const VAutocomplete = genericComponent()({
|
|
|
10738
10841
|
nextTick(() => isSelecting.value = false);
|
|
10739
10842
|
}
|
|
10740
10843
|
}
|
|
10741
|
-
watch(isFocused, val => {
|
|
10844
|
+
watch(isFocused, (val, oldVal) => {
|
|
10845
|
+
if (val === oldVal) return;
|
|
10742
10846
|
if (val) {
|
|
10743
10847
|
isSelecting.value = true;
|
|
10744
10848
|
search.value = props.multiple ? '' : String(selections.value.at(-1)?.props.title ?? '');
|
|
10745
10849
|
isPristine.value = true;
|
|
10746
10850
|
nextTick(() => isSelecting.value = false);
|
|
10747
10851
|
} else {
|
|
10748
|
-
if (!props.multiple && !search.value) model.value = [];
|
|
10852
|
+
if (!props.multiple && !search.value) model.value = [];else if (highlightFirst.value && !listHasFocus.value && !selections.value.some(_ref2 => {
|
|
10853
|
+
let {
|
|
10854
|
+
value
|
|
10855
|
+
} = _ref2;
|
|
10856
|
+
return value === displayItems.value[0].value;
|
|
10857
|
+
})) {
|
|
10858
|
+
select(displayItems.value[0]);
|
|
10859
|
+
}
|
|
10749
10860
|
menu.value = false;
|
|
10750
10861
|
search.value = '';
|
|
10751
10862
|
selectionIndex.value = -1;
|
|
@@ -10776,10 +10887,10 @@ const VAutocomplete = genericComponent()({
|
|
|
10776
10887
|
"class": ['v-autocomplete', `v-autocomplete--${props.multiple ? 'multiple' : 'single'}`, {
|
|
10777
10888
|
'v-autocomplete--active-menu': menu.value,
|
|
10778
10889
|
'v-autocomplete--chips': !!props.chips,
|
|
10890
|
+
'v-autocomplete--selection-slot': !!slots.selection,
|
|
10779
10891
|
'v-autocomplete--selecting-index': selectionIndex.value > -1
|
|
10780
10892
|
}, props.class],
|
|
10781
10893
|
"style": props.style,
|
|
10782
|
-
"appendInnerIcon": props.menuIcon,
|
|
10783
10894
|
"readonly": props.readonly,
|
|
10784
10895
|
"placeholder": isDirty ? undefined : props.placeholder,
|
|
10785
10896
|
"onClick:clear": onClear,
|
|
@@ -10805,36 +10916,40 @@ const VAutocomplete = genericComponent()({
|
|
|
10805
10916
|
"selected": selected.value,
|
|
10806
10917
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
10807
10918
|
"onMousedown": e => e.preventDefault(),
|
|
10808
|
-
"onFocusin": onFocusin
|
|
10919
|
+
"onFocusin": onFocusin,
|
|
10920
|
+
"onFocusout": onFocusout
|
|
10809
10921
|
}, {
|
|
10810
10922
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
10811
10923
|
"title": t(props.noDataText)
|
|
10812
|
-
}, null)), slots['prepend-item']?.(), displayItems.value.map(item =>
|
|
10813
|
-
item,
|
|
10814
|
-
|
|
10924
|
+
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
10925
|
+
const itemProps = mergeProps(item.props, {
|
|
10926
|
+
key: index,
|
|
10927
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
10815
10928
|
onClick: () => select(item)
|
|
10816
|
-
})
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10929
|
+
});
|
|
10930
|
+
return slots.item?.({
|
|
10931
|
+
item,
|
|
10932
|
+
index,
|
|
10933
|
+
props: itemProps
|
|
10934
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
10935
|
+
prepend: _ref3 => {
|
|
10936
|
+
let {
|
|
10937
|
+
isSelected
|
|
10938
|
+
} = _ref3;
|
|
10939
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
10940
|
+
"key": item.value,
|
|
10941
|
+
"modelValue": isSelected,
|
|
10942
|
+
"ripple": false,
|
|
10943
|
+
"tabindex": "-1"
|
|
10944
|
+
}, null) : undefined, item.props.prependIcon && createVNode(VIcon, {
|
|
10945
|
+
"icon": item.props.prependIcon
|
|
10946
|
+
}, null)]);
|
|
10947
|
+
},
|
|
10948
|
+
title: () => {
|
|
10949
|
+
return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
10950
|
+
}
|
|
10951
|
+
});
|
|
10952
|
+
}), slots['append-item']?.()]
|
|
10838
10953
|
})]
|
|
10839
10954
|
}), selections.value.map((item, index) => {
|
|
10840
10955
|
function onChipClose(e) {
|
|
@@ -10883,7 +10998,18 @@ const VAutocomplete = genericComponent()({
|
|
|
10883
10998
|
}, [item.title, props.multiple && index < selections.value.length - 1 && createVNode("span", {
|
|
10884
10999
|
"class": "v-autocomplete__selection-comma"
|
|
10885
11000
|
}, [createTextVNode(",")])])]);
|
|
10886
|
-
})])
|
|
11001
|
+
})]),
|
|
11002
|
+
'append-inner': function () {
|
|
11003
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11004
|
+
args[_key] = arguments[_key];
|
|
11005
|
+
}
|
|
11006
|
+
return createVNode(Fragment, null, [slots['append-inner']?.(...args), props.menuIcon ? createVNode(VIcon, {
|
|
11007
|
+
"class": "v-autocomplete__menu-icon",
|
|
11008
|
+
"icon": props.menuIcon,
|
|
11009
|
+
"onMousedown": onMousedownMenuIcon,
|
|
11010
|
+
"onClick": noop
|
|
11011
|
+
}, null) : undefined]);
|
|
11012
|
+
}
|
|
10887
11013
|
});
|
|
10888
11014
|
});
|
|
10889
11015
|
return forwardRefs({
|
|
@@ -11244,7 +11370,7 @@ const VBottomNavigation = genericComponent()({
|
|
|
11244
11370
|
const makeVBreadcrumbsDividerProps = propsFactory({
|
|
11245
11371
|
divider: [Number, String],
|
|
11246
11372
|
...makeComponentProps()
|
|
11247
|
-
}, 'v-
|
|
11373
|
+
}, 'v-breadcrumbs-divider');
|
|
11248
11374
|
const VBreadcrumbsDivider = genericComponent()({
|
|
11249
11375
|
name: 'VBreadcrumbsDivider',
|
|
11250
11376
|
props: makeVBreadcrumbsDividerProps(),
|
|
@@ -11332,7 +11458,7 @@ const makeVBreadcrumbsProps = propsFactory({
|
|
|
11332
11458
|
...makeTagProps({
|
|
11333
11459
|
tag: 'ul'
|
|
11334
11460
|
})
|
|
11335
|
-
}, 'v-
|
|
11461
|
+
}, 'v-breadcrumbs');
|
|
11336
11462
|
const VBreadcrumbs = genericComponent()({
|
|
11337
11463
|
name: 'VBreadcrumbs',
|
|
11338
11464
|
props: makeVBreadcrumbsProps(),
|
|
@@ -11681,6 +11807,7 @@ const VCard = genericComponent()({
|
|
|
11681
11807
|
});
|
|
11682
11808
|
|
|
11683
11809
|
// Types
|
|
11810
|
+
|
|
11684
11811
|
const handleGesture = wrapper => {
|
|
11685
11812
|
const {
|
|
11686
11813
|
touchstartX,
|
|
@@ -12461,27 +12588,6 @@ const VColorPickerCanvas = defineComponent({
|
|
|
12461
12588
|
|
|
12462
12589
|
// Types
|
|
12463
12590
|
|
|
12464
|
-
function has(obj, key) {
|
|
12465
|
-
return key.every(k => obj.hasOwnProperty(k));
|
|
12466
|
-
}
|
|
12467
|
-
function parseColor(color) {
|
|
12468
|
-
if (!color) return null;
|
|
12469
|
-
let hsva = null;
|
|
12470
|
-
if (typeof color === 'string') {
|
|
12471
|
-
const hex = parseHex(color);
|
|
12472
|
-
hsva = HexToHSV(hex);
|
|
12473
|
-
}
|
|
12474
|
-
if (typeof color === 'object') {
|
|
12475
|
-
if (has(color, ['r', 'g', 'b'])) {
|
|
12476
|
-
hsva = RGBtoHSV(color);
|
|
12477
|
-
} else if (has(color, ['h', 's', 'l'])) {
|
|
12478
|
-
hsva = HSLtoHSV(color);
|
|
12479
|
-
} else if (has(color, ['h', 's', 'v'])) {
|
|
12480
|
-
hsva = color;
|
|
12481
|
-
}
|
|
12482
|
-
}
|
|
12483
|
-
return hsva;
|
|
12484
|
-
}
|
|
12485
12591
|
function stripAlpha(color, stripAlpha) {
|
|
12486
12592
|
if (stripAlpha) {
|
|
12487
12593
|
const {
|
|
@@ -12730,6 +12836,7 @@ const VColorPickerEdit = defineComponent({
|
|
|
12730
12836
|
});
|
|
12731
12837
|
|
|
12732
12838
|
/* eslint-disable max-statements */
|
|
12839
|
+
// Composables
|
|
12733
12840
|
|
|
12734
12841
|
// Types
|
|
12735
12842
|
|
|
@@ -12744,9 +12851,15 @@ function getPosition(e, position) {
|
|
|
12744
12851
|
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];
|
|
12745
12852
|
}
|
|
12746
12853
|
const makeSliderProps = propsFactory({
|
|
12747
|
-
disabled:
|
|
12854
|
+
disabled: {
|
|
12855
|
+
type: Boolean,
|
|
12856
|
+
default: null
|
|
12857
|
+
},
|
|
12748
12858
|
error: Boolean,
|
|
12749
|
-
readonly:
|
|
12859
|
+
readonly: {
|
|
12860
|
+
type: Boolean,
|
|
12861
|
+
default: null
|
|
12862
|
+
},
|
|
12750
12863
|
max: {
|
|
12751
12864
|
type: [Number, String],
|
|
12752
12865
|
default: 100
|
|
@@ -13124,7 +13237,7 @@ const VSliderThumb = genericComponent()({
|
|
|
13124
13237
|
"aria-valuemin": props.min,
|
|
13125
13238
|
"aria-valuemax": props.max,
|
|
13126
13239
|
"aria-valuenow": props.modelValue,
|
|
13127
|
-
"aria-readonly": readonly.value,
|
|
13240
|
+
"aria-readonly": !!readonly.value,
|
|
13128
13241
|
"aria-orientation": direction.value,
|
|
13129
13242
|
"onKeydown": !readonly.value ? onKeydown : undefined
|
|
13130
13243
|
}, [createVNode("div", {
|
|
@@ -13376,8 +13489,8 @@ const VSlider = genericComponent()({
|
|
|
13376
13489
|
}, [createVNode("input", {
|
|
13377
13490
|
"id": id.value,
|
|
13378
13491
|
"name": props.name || id.value,
|
|
13379
|
-
"disabled": props.disabled,
|
|
13380
|
-
"readonly": props.readonly,
|
|
13492
|
+
"disabled": !!props.disabled,
|
|
13493
|
+
"readonly": !!props.readonly,
|
|
13381
13494
|
"tabindex": "-1",
|
|
13382
13495
|
"value": model.value
|
|
13383
13496
|
}, null), createVNode(VSliderTrack, {
|
|
@@ -13832,13 +13945,15 @@ const VColorPickerSwatches = defineComponent({
|
|
|
13832
13945
|
}, [createVNode("div", null, [props.swatches.map(swatch => createVNode("div", {
|
|
13833
13946
|
"class": "v-color-picker-swatches__swatch"
|
|
13834
13947
|
}, [swatch.map(color => {
|
|
13835
|
-
const
|
|
13948
|
+
const rgba = parseColor(color);
|
|
13949
|
+
const hsva = RGBtoHSV(rgba);
|
|
13950
|
+
const background = RGBtoCSS(rgba);
|
|
13836
13951
|
return createVNode("div", {
|
|
13837
13952
|
"class": "v-color-picker-swatches__color",
|
|
13838
13953
|
"onClick": () => hsva && emit('update:color', hsva)
|
|
13839
13954
|
}, [createVNode("div", {
|
|
13840
13955
|
"style": {
|
|
13841
|
-
background
|
|
13956
|
+
background
|
|
13842
13957
|
}
|
|
13843
13958
|
}, [props.color && deepEqual(props.color, hsva) ? createVNode(VIcon, {
|
|
13844
13959
|
"size": "x-small",
|
|
@@ -13899,8 +14014,13 @@ const VColorPicker = defineComponent({
|
|
|
13899
14014
|
const mode = useProxiedModel(props, 'mode');
|
|
13900
14015
|
const lastPickedColor = ref(null);
|
|
13901
14016
|
const currentColor = useProxiedModel(props, 'modelValue', undefined, v => {
|
|
13902
|
-
let c
|
|
13903
|
-
|
|
14017
|
+
let c;
|
|
14018
|
+
try {
|
|
14019
|
+
c = RGBtoHSV(parseColor(v));
|
|
14020
|
+
} catch (err) {
|
|
14021
|
+
consoleWarn(err);
|
|
14022
|
+
return null;
|
|
14023
|
+
}
|
|
13904
14024
|
if (lastPickedColor.value) {
|
|
13905
14025
|
c = {
|
|
13906
14026
|
...c,
|
|
@@ -13999,8 +14119,9 @@ function highlightResult(text, matches, length) {
|
|
|
13999
14119
|
}, [text.substr(matches + length)])]) : text;
|
|
14000
14120
|
}
|
|
14001
14121
|
const makeVComboboxProps = propsFactory({
|
|
14002
|
-
|
|
14003
|
-
|
|
14122
|
+
autoSelectFirst: {
|
|
14123
|
+
type: [Boolean, String]
|
|
14124
|
+
},
|
|
14004
14125
|
delimiters: Array,
|
|
14005
14126
|
...makeFilterProps({
|
|
14006
14127
|
filterKeys: ['title']
|
|
@@ -14036,6 +14157,7 @@ const VCombobox = genericComponent()({
|
|
|
14036
14157
|
const vTextFieldRef = ref();
|
|
14037
14158
|
const isFocused = shallowRef(false);
|
|
14038
14159
|
const isPristine = shallowRef(true);
|
|
14160
|
+
const listHasFocus = ref(false);
|
|
14039
14161
|
const vMenuRef = ref();
|
|
14040
14162
|
const _menu = useProxiedModel(props, 'menu');
|
|
14041
14163
|
const menu = computed({
|
|
@@ -14070,14 +14192,14 @@ const VCombobox = genericComponent()({
|
|
|
14070
14192
|
set: val => {
|
|
14071
14193
|
_search.value = val;
|
|
14072
14194
|
if (!props.multiple) {
|
|
14073
|
-
model.value = [transformItem$
|
|
14195
|
+
model.value = [transformItem$3(props, val)];
|
|
14074
14196
|
}
|
|
14075
14197
|
if (val && props.multiple && props.delimiters?.length) {
|
|
14076
14198
|
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
|
14077
14199
|
if (values.length > 1) {
|
|
14078
14200
|
values.forEach(v => {
|
|
14079
14201
|
v = v.trim();
|
|
14080
|
-
if (v) select(transformItem$
|
|
14202
|
+
if (v) select(transformItem$3(props, v));
|
|
14081
14203
|
});
|
|
14082
14204
|
_search.value = '';
|
|
14083
14205
|
}
|
|
@@ -14118,6 +14240,10 @@ const VCombobox = genericComponent()({
|
|
|
14118
14240
|
});
|
|
14119
14241
|
const selected = computed(() => selections.value.map(selection => selection.props.value));
|
|
14120
14242
|
const selection = computed(() => selections.value[selectionIndex.value]);
|
|
14243
|
+
const highlightFirst = computed(() => {
|
|
14244
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
14245
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
14246
|
+
});
|
|
14121
14247
|
const listRef = ref();
|
|
14122
14248
|
function onClear(e) {
|
|
14123
14249
|
cleared = true;
|
|
@@ -14129,6 +14255,13 @@ const VCombobox = genericComponent()({
|
|
|
14129
14255
|
if (props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value) return;
|
|
14130
14256
|
menu.value = true;
|
|
14131
14257
|
}
|
|
14258
|
+
function onMousedownMenuIcon(e) {
|
|
14259
|
+
if (isFocused.value) {
|
|
14260
|
+
e.preventDefault();
|
|
14261
|
+
e.stopPropagation();
|
|
14262
|
+
}
|
|
14263
|
+
menu.value = !menu.value;
|
|
14264
|
+
}
|
|
14132
14265
|
function onKeydown(e) {
|
|
14133
14266
|
if (props.readonly || form?.isReadonly.value) return;
|
|
14134
14267
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
@@ -14143,6 +14276,9 @@ const VCombobox = genericComponent()({
|
|
|
14143
14276
|
menu.value = false;
|
|
14144
14277
|
}
|
|
14145
14278
|
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
|
14279
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
|
|
14280
|
+
select(filteredItems.value[0]);
|
|
14281
|
+
}
|
|
14146
14282
|
isPristine.value = true;
|
|
14147
14283
|
}
|
|
14148
14284
|
if (e.key === 'ArrowDown') {
|
|
@@ -14183,7 +14319,7 @@ const VCombobox = genericComponent()({
|
|
|
14183
14319
|
}
|
|
14184
14320
|
}
|
|
14185
14321
|
if (e.key === 'Enter' && search.value) {
|
|
14186
|
-
select(transformItem$
|
|
14322
|
+
select(transformItem$3(props, search.value));
|
|
14187
14323
|
search.value = '';
|
|
14188
14324
|
}
|
|
14189
14325
|
}
|
|
@@ -14217,17 +14353,31 @@ const VCombobox = genericComponent()({
|
|
|
14217
14353
|
}
|
|
14218
14354
|
function onFocusin(e) {
|
|
14219
14355
|
isFocused.value = true;
|
|
14356
|
+
setTimeout(() => {
|
|
14357
|
+
listHasFocus.value = true;
|
|
14358
|
+
});
|
|
14359
|
+
}
|
|
14360
|
+
function onFocusout(e) {
|
|
14361
|
+
listHasFocus.value = false;
|
|
14220
14362
|
}
|
|
14221
14363
|
watch(filteredItems, val => {
|
|
14222
14364
|
if (!val.length && props.hideNoData) menu.value = false;
|
|
14223
14365
|
});
|
|
14224
|
-
watch(isFocused, val => {
|
|
14225
|
-
if (val) return;
|
|
14366
|
+
watch(isFocused, (val, oldVal) => {
|
|
14367
|
+
if (val || val === oldVal) return;
|
|
14226
14368
|
selectionIndex.value = -1;
|
|
14227
14369
|
menu.value = false;
|
|
14228
|
-
if (!
|
|
14229
|
-
|
|
14230
|
-
|
|
14370
|
+
if (highlightFirst.value && !listHasFocus.value && !selections.value.some(_ref2 => {
|
|
14371
|
+
let {
|
|
14372
|
+
value
|
|
14373
|
+
} = _ref2;
|
|
14374
|
+
return value === displayItems.value[0].value;
|
|
14375
|
+
})) {
|
|
14376
|
+
select(displayItems.value[0]);
|
|
14377
|
+
} else if (props.multiple && search.value) {
|
|
14378
|
+
model.value = [...model.value, transformItem$3(props, search.value)];
|
|
14379
|
+
search.value = '';
|
|
14380
|
+
}
|
|
14231
14381
|
});
|
|
14232
14382
|
useRender(() => {
|
|
14233
14383
|
const hasChips = !!(props.chips || slots.chip);
|
|
@@ -14248,11 +14398,11 @@ const VCombobox = genericComponent()({
|
|
|
14248
14398
|
"class": ['v-combobox', {
|
|
14249
14399
|
'v-combobox--active-menu': menu.value,
|
|
14250
14400
|
'v-combobox--chips': !!props.chips,
|
|
14401
|
+
'v-combobox--selection-slot': !!slots.selection,
|
|
14251
14402
|
'v-combobox--selecting-index': selectionIndex.value > -1,
|
|
14252
14403
|
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
|
14253
14404
|
}, props.class],
|
|
14254
14405
|
"style": props.style,
|
|
14255
|
-
"appendInnerIcon": props.items.length ? props.menuIcon : undefined,
|
|
14256
14406
|
"readonly": props.readonly,
|
|
14257
14407
|
"placeholder": isDirty ? undefined : props.placeholder,
|
|
14258
14408
|
"onClick:clear": onClear,
|
|
@@ -14278,36 +14428,40 @@ const VCombobox = genericComponent()({
|
|
|
14278
14428
|
"selected": selected.value,
|
|
14279
14429
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
14280
14430
|
"onMousedown": e => e.preventDefault(),
|
|
14281
|
-
"onFocusin": onFocusin
|
|
14431
|
+
"onFocusin": onFocusin,
|
|
14432
|
+
"onFocusout": onFocusout
|
|
14282
14433
|
}, {
|
|
14283
14434
|
default: () => [!displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
|
14284
14435
|
"title": t(props.noDataText)
|
|
14285
|
-
}, null)), slots['prepend-item']?.(), displayItems.value.map(item =>
|
|
14286
|
-
item,
|
|
14287
|
-
|
|
14436
|
+
}, null)), slots['prepend-item']?.(), displayItems.value.map((item, index) => {
|
|
14437
|
+
const itemProps = mergeProps(item.props, {
|
|
14438
|
+
key: index,
|
|
14439
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
14288
14440
|
onClick: () => select(item)
|
|
14289
|
-
})
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14441
|
+
});
|
|
14442
|
+
return slots.item?.({
|
|
14443
|
+
item,
|
|
14444
|
+
index,
|
|
14445
|
+
props: itemProps
|
|
14446
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
14447
|
+
prepend: _ref3 => {
|
|
14448
|
+
let {
|
|
14449
|
+
isSelected
|
|
14450
|
+
} = _ref3;
|
|
14451
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
14452
|
+
"key": item.value,
|
|
14453
|
+
"modelValue": isSelected,
|
|
14454
|
+
"ripple": false,
|
|
14455
|
+
"tabindex": "-1"
|
|
14456
|
+
}, null) : undefined, item.props.prependIcon && createVNode(VIcon, {
|
|
14457
|
+
"icon": item.props.prependIcon
|
|
14458
|
+
}, null)]);
|
|
14459
|
+
},
|
|
14460
|
+
title: () => {
|
|
14461
|
+
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
14462
|
+
}
|
|
14463
|
+
});
|
|
14464
|
+
}), slots['append-item']?.()]
|
|
14311
14465
|
})]
|
|
14312
14466
|
}), selections.value.map((item, index) => {
|
|
14313
14467
|
function onChipClose(e) {
|
|
@@ -14356,7 +14510,18 @@ const VCombobox = genericComponent()({
|
|
|
14356
14510
|
}, [item.title, props.multiple && index < selections.value.length - 1 && createVNode("span", {
|
|
14357
14511
|
"class": "v-combobox__selection-comma"
|
|
14358
14512
|
}, [createTextVNode(",")])])]);
|
|
14359
|
-
})])
|
|
14513
|
+
})]),
|
|
14514
|
+
'append-inner': function () {
|
|
14515
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14516
|
+
args[_key] = arguments[_key];
|
|
14517
|
+
}
|
|
14518
|
+
return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
|
|
14519
|
+
"class": "v-combobox__menu-icon",
|
|
14520
|
+
"icon": props.menuIcon,
|
|
14521
|
+
"onMousedown": onMousedownMenuIcon,
|
|
14522
|
+
"onClick": noop
|
|
14523
|
+
}, null) : undefined]);
|
|
14524
|
+
}
|
|
14360
14525
|
});
|
|
14361
14526
|
});
|
|
14362
14527
|
return forwardRefs({
|
|
@@ -14787,6 +14952,7 @@ const VFileInput = genericComponent()({
|
|
|
14787
14952
|
const vFieldRef = ref();
|
|
14788
14953
|
const inputRef = ref();
|
|
14789
14954
|
const isActive = computed(() => isFocused.value || props.active);
|
|
14955
|
+
const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
14790
14956
|
function onFocus() {
|
|
14791
14957
|
if (inputRef.value !== document.activeElement) {
|
|
14792
14958
|
inputRef.value?.focus();
|
|
@@ -14830,10 +14996,15 @@ const VFileInput = genericComponent()({
|
|
|
14830
14996
|
"ref": vInputRef,
|
|
14831
14997
|
"modelValue": model.value,
|
|
14832
14998
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
14833
|
-
"class": ['v-file-input',
|
|
14999
|
+
"class": ['v-file-input', {
|
|
15000
|
+
'v-file-input--chips': !!props.chips,
|
|
15001
|
+
'v-file-input--selection-slot': !!slots.selection,
|
|
15002
|
+
'v-text-field--plain-underlined': isPlainOrUnderlined.value
|
|
15003
|
+
}, props.class],
|
|
14834
15004
|
"style": props.style,
|
|
14835
15005
|
"onClick:prepend": onClickPrepend
|
|
14836
15006
|
}, rootAttrs, inputProps, {
|
|
15007
|
+
"centerAffix": !isPlainOrUnderlined.value,
|
|
14837
15008
|
"focused": isFocused.value
|
|
14838
15009
|
}), {
|
|
14839
15010
|
...slots,
|
|
@@ -15385,9 +15556,6 @@ const VItemGroup = genericComponent()({
|
|
|
15385
15556
|
});
|
|
15386
15557
|
|
|
15387
15558
|
// Composables
|
|
15388
|
-
|
|
15389
|
-
// Types
|
|
15390
|
-
|
|
15391
15559
|
const VItem = genericComponent()({
|
|
15392
15560
|
name: 'VItem',
|
|
15393
15561
|
props: makeGroupItemProps(),
|
|
@@ -16804,15 +16972,15 @@ const VRangeSlider = genericComponent()({
|
|
|
16804
16972
|
}, [createVNode("input", {
|
|
16805
16973
|
"id": `${id.value}_start`,
|
|
16806
16974
|
"name": props.name || id.value,
|
|
16807
|
-
"disabled": props.disabled,
|
|
16808
|
-
"readonly": props.readonly,
|
|
16975
|
+
"disabled": !!props.disabled,
|
|
16976
|
+
"readonly": !!props.readonly,
|
|
16809
16977
|
"tabindex": "-1",
|
|
16810
16978
|
"value": model.value[0]
|
|
16811
16979
|
}, null), createVNode("input", {
|
|
16812
16980
|
"id": `${id.value}_stop`,
|
|
16813
16981
|
"name": props.name || id.value,
|
|
16814
|
-
"disabled": props.disabled,
|
|
16815
|
-
"readonly": props.readonly,
|
|
16982
|
+
"disabled": !!props.disabled,
|
|
16983
|
+
"readonly": !!props.readonly,
|
|
16816
16984
|
"tabindex": "-1",
|
|
16817
16985
|
"value": model.value[1]
|
|
16818
16986
|
}, null), createVNode(VSliderTrack, {
|
|
@@ -18089,6 +18257,11 @@ const VTextarea = genericComponent()({
|
|
|
18089
18257
|
}
|
|
18090
18258
|
}
|
|
18091
18259
|
const sizerRef = ref();
|
|
18260
|
+
const rows = ref(+props.rows);
|
|
18261
|
+
const isPlainOrUnderlined = computed(() => ['plain', 'underlined'].includes(props.variant));
|
|
18262
|
+
watchEffect(() => {
|
|
18263
|
+
if (!props.autoGrow) rows.value = +props.rows;
|
|
18264
|
+
});
|
|
18092
18265
|
function calculateInputHeight() {
|
|
18093
18266
|
if (!props.autoGrow) return;
|
|
18094
18267
|
nextTick(() => {
|
|
@@ -18100,7 +18273,9 @@ const VTextarea = genericComponent()({
|
|
|
18100
18273
|
const lineHeight = parseFloat(style.lineHeight);
|
|
18101
18274
|
const minHeight = Math.max(parseFloat(props.rows) * lineHeight + padding, parseFloat(fieldStyle.getPropertyValue('--v-input-control-height')));
|
|
18102
18275
|
const maxHeight = parseFloat(props.maxRows) * lineHeight + padding || Infinity;
|
|
18103
|
-
|
|
18276
|
+
const newHeight = clamp(height ?? 0, minHeight, maxHeight);
|
|
18277
|
+
rows.value = Math.floor((newHeight - padding) / lineHeight);
|
|
18278
|
+
controlHeight.value = convertToUnit(newHeight);
|
|
18104
18279
|
});
|
|
18105
18280
|
}
|
|
18106
18281
|
onMounted(calculateInputHeight);
|
|
@@ -18140,10 +18315,11 @@ const VTextarea = genericComponent()({
|
|
|
18140
18315
|
'v-text-field--suffixed': props.suffix,
|
|
18141
18316
|
'v-textarea--auto-grow': props.autoGrow,
|
|
18142
18317
|
'v-textarea--no-resize': props.noResize || props.autoGrow,
|
|
18143
|
-
'v-text-field--
|
|
18318
|
+
'v-text-field--plain-underlined': isPlainOrUnderlined.value
|
|
18144
18319
|
}, props.class],
|
|
18145
18320
|
"style": props.style
|
|
18146
18321
|
}, rootAttrs, inputProps, {
|
|
18322
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18147
18323
|
"focused": isFocused.value
|
|
18148
18324
|
}), {
|
|
18149
18325
|
...slots,
|
|
@@ -18167,6 +18343,7 @@ const VTextarea = genericComponent()({
|
|
|
18167
18343
|
"role": "textbox"
|
|
18168
18344
|
}, fieldProps, {
|
|
18169
18345
|
"active": isActive.value || isDirty.value,
|
|
18346
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18170
18347
|
"dirty": isDirty.value || props.dirty,
|
|
18171
18348
|
"disabled": isDisabled.value,
|
|
18172
18349
|
"focused": isFocused.value,
|
|
@@ -18786,11 +18963,83 @@ const VVirtualScroll = genericComponent()({
|
|
|
18786
18963
|
}
|
|
18787
18964
|
});
|
|
18788
18965
|
|
|
18789
|
-
// Composables
|
|
18790
|
-
|
|
18791
18966
|
// Types
|
|
18792
18967
|
|
|
18793
|
-
const
|
|
18968
|
+
const makeVBottomSheetProps = propsFactory({
|
|
18969
|
+
inset: Boolean,
|
|
18970
|
+
...makeVDialogProps({
|
|
18971
|
+
contentClass: 'v-bottom-sheet__content',
|
|
18972
|
+
transition: 'bottom-sheet-transition'
|
|
18973
|
+
})
|
|
18974
|
+
}, 'v-bottom-sheet');
|
|
18975
|
+
const VBottomSheet = genericComponent()({
|
|
18976
|
+
name: 'VBottomSheet',
|
|
18977
|
+
props: makeVBottomSheetProps(),
|
|
18978
|
+
emits: {
|
|
18979
|
+
'update:modelValue': value => true
|
|
18980
|
+
},
|
|
18981
|
+
setup(props, _ref) {
|
|
18982
|
+
let {
|
|
18983
|
+
slots
|
|
18984
|
+
} = _ref;
|
|
18985
|
+
const isActive = useProxiedModel(props, 'modelValue');
|
|
18986
|
+
useRender(() => {
|
|
18987
|
+
const [dialogProps] = VDialog.filterProps(props);
|
|
18988
|
+
return createVNode(VDialog, mergeProps(dialogProps, {
|
|
18989
|
+
"modelValue": isActive.value,
|
|
18990
|
+
"onUpdate:modelValue": $event => isActive.value = $event,
|
|
18991
|
+
"class": ['v-bottom-sheet', {
|
|
18992
|
+
'v-bottom-sheet--inset': props.inset
|
|
18993
|
+
}]
|
|
18994
|
+
}), slots);
|
|
18995
|
+
});
|
|
18996
|
+
return {};
|
|
18997
|
+
}
|
|
18998
|
+
});
|
|
18999
|
+
|
|
19000
|
+
// Utilities
|
|
19001
|
+
|
|
19002
|
+
// Types
|
|
19003
|
+
|
|
19004
|
+
// Composables
|
|
19005
|
+
const makeDataIteratorItemProps = propsFactory({
|
|
19006
|
+
items: {
|
|
19007
|
+
type: Array,
|
|
19008
|
+
default: () => []
|
|
19009
|
+
},
|
|
19010
|
+
itemValue: {
|
|
19011
|
+
type: [String, Array, Function],
|
|
19012
|
+
default: 'value'
|
|
19013
|
+
},
|
|
19014
|
+
returnObject: Boolean
|
|
19015
|
+
}, 'v-data-iterator-item');
|
|
19016
|
+
function transformItem$1(props, item) {
|
|
19017
|
+
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue);
|
|
19018
|
+
return {
|
|
19019
|
+
type: 'item',
|
|
19020
|
+
value,
|
|
19021
|
+
raw: item
|
|
19022
|
+
};
|
|
19023
|
+
}
|
|
19024
|
+
function transformItems$1(props, items) {
|
|
19025
|
+
const array = [];
|
|
19026
|
+
for (const item of items) {
|
|
19027
|
+
array.push(transformItem$1(props, item));
|
|
19028
|
+
}
|
|
19029
|
+
return array;
|
|
19030
|
+
}
|
|
19031
|
+
function useDataIteratorItems(props) {
|
|
19032
|
+
const items = computed(() => transformItems$1(props, props.items));
|
|
19033
|
+
return {
|
|
19034
|
+
items
|
|
19035
|
+
};
|
|
19036
|
+
}
|
|
19037
|
+
|
|
19038
|
+
// Composables
|
|
19039
|
+
|
|
19040
|
+
// Types
|
|
19041
|
+
|
|
19042
|
+
const makeDataTablePaginateProps = propsFactory({
|
|
18794
19043
|
page: {
|
|
18795
19044
|
type: [Number, String],
|
|
18796
19045
|
default: 1
|
|
@@ -18836,38 +19085,605 @@ function providePagination(options) {
|
|
|
18836
19085
|
itemsPerPage.value = value;
|
|
18837
19086
|
page.value = 1;
|
|
18838
19087
|
}
|
|
18839
|
-
|
|
18840
|
-
page,
|
|
18841
|
-
|
|
18842
|
-
|
|
18843
|
-
|
|
18844
|
-
|
|
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
|
-
|
|
19088
|
+
function nextPage() {
|
|
19089
|
+
page.value = clamp(page.value + 1, 1, pageCount.value);
|
|
19090
|
+
}
|
|
19091
|
+
function prevPage() {
|
|
19092
|
+
page.value = clamp(page.value - 1, 1, pageCount.value);
|
|
19093
|
+
}
|
|
19094
|
+
function setPage(value) {
|
|
19095
|
+
page.value = clamp(value, 1, pageCount.value);
|
|
19096
|
+
}
|
|
19097
|
+
const data = {
|
|
19098
|
+
page,
|
|
19099
|
+
itemsPerPage,
|
|
19100
|
+
startIndex,
|
|
19101
|
+
stopIndex,
|
|
19102
|
+
pageCount,
|
|
19103
|
+
itemsLength,
|
|
19104
|
+
nextPage,
|
|
19105
|
+
prevPage,
|
|
19106
|
+
setPage,
|
|
19107
|
+
setItemsPerPage
|
|
19108
|
+
};
|
|
19109
|
+
provide(VDataTablePaginationSymbol, data);
|
|
19110
|
+
return data;
|
|
19111
|
+
}
|
|
19112
|
+
function usePagination() {
|
|
19113
|
+
const data = inject$1(VDataTablePaginationSymbol);
|
|
19114
|
+
if (!data) throw new Error('Missing pagination!');
|
|
19115
|
+
return data;
|
|
19116
|
+
}
|
|
19117
|
+
function usePaginatedItems(options) {
|
|
19118
|
+
const {
|
|
19119
|
+
items,
|
|
19120
|
+
startIndex,
|
|
19121
|
+
stopIndex,
|
|
19122
|
+
itemsPerPage
|
|
19123
|
+
} = options;
|
|
19124
|
+
const paginatedItems = computed(() => {
|
|
19125
|
+
if (itemsPerPage.value <= 0) return items.value;
|
|
19126
|
+
return items.value.slice(startIndex.value, stopIndex.value);
|
|
19127
|
+
});
|
|
19128
|
+
return {
|
|
19129
|
+
paginatedItems
|
|
19130
|
+
};
|
|
19131
|
+
}
|
|
19132
|
+
|
|
19133
|
+
// Composables
|
|
19134
|
+
|
|
19135
|
+
// Types
|
|
19136
|
+
|
|
19137
|
+
const makeDataTableSortProps = propsFactory({
|
|
19138
|
+
sortBy: {
|
|
19139
|
+
type: Array,
|
|
19140
|
+
default: () => []
|
|
19141
|
+
},
|
|
19142
|
+
customKeySort: Object,
|
|
19143
|
+
multiSort: Boolean,
|
|
19144
|
+
mustSort: Boolean
|
|
19145
|
+
}, 'v-data-table-sort');
|
|
19146
|
+
const VDataTableSortSymbol = Symbol.for('vuetify:data-table-sort');
|
|
19147
|
+
function createSort(props) {
|
|
19148
|
+
const sortBy = useProxiedModel(props, 'sortBy');
|
|
19149
|
+
const mustSort = toRef(props, 'mustSort');
|
|
19150
|
+
const multiSort = toRef(props, 'multiSort');
|
|
19151
|
+
return {
|
|
19152
|
+
sortBy,
|
|
19153
|
+
mustSort,
|
|
19154
|
+
multiSort
|
|
19155
|
+
};
|
|
19156
|
+
}
|
|
19157
|
+
function provideSort(options) {
|
|
19158
|
+
const {
|
|
19159
|
+
sortBy,
|
|
19160
|
+
mustSort,
|
|
19161
|
+
multiSort,
|
|
19162
|
+
page
|
|
19163
|
+
} = options;
|
|
19164
|
+
const toggleSort = column => {
|
|
19165
|
+
let newSortBy = sortBy.value.map(x => ({
|
|
19166
|
+
...x
|
|
19167
|
+
})) ?? [];
|
|
19168
|
+
const item = newSortBy.find(x => x.key === column.key);
|
|
19169
|
+
if (!item) {
|
|
19170
|
+
if (multiSort.value) newSortBy = [...newSortBy, {
|
|
19171
|
+
key: column.key,
|
|
19172
|
+
order: 'asc'
|
|
19173
|
+
}];else newSortBy = [{
|
|
19174
|
+
key: column.key,
|
|
19175
|
+
order: 'asc'
|
|
19176
|
+
}];
|
|
19177
|
+
} else if (item.order === 'desc') {
|
|
19178
|
+
if (mustSort.value) {
|
|
19179
|
+
item.order = 'asc';
|
|
19180
|
+
} else {
|
|
19181
|
+
newSortBy = newSortBy.filter(x => x.key !== column.key);
|
|
19182
|
+
}
|
|
19183
|
+
} else {
|
|
19184
|
+
item.order = 'desc';
|
|
19185
|
+
}
|
|
19186
|
+
sortBy.value = newSortBy;
|
|
19187
|
+
if (page) page.value = 1;
|
|
19188
|
+
};
|
|
19189
|
+
function isSorted(column) {
|
|
19190
|
+
return !!sortBy.value.find(item => item.key === column.key);
|
|
19191
|
+
}
|
|
19192
|
+
const data = {
|
|
19193
|
+
sortBy,
|
|
19194
|
+
toggleSort,
|
|
19195
|
+
isSorted
|
|
19196
|
+
};
|
|
19197
|
+
provide(VDataTableSortSymbol, data);
|
|
19198
|
+
return data;
|
|
19199
|
+
}
|
|
19200
|
+
function useSort() {
|
|
19201
|
+
const data = inject$1(VDataTableSortSymbol);
|
|
19202
|
+
if (!data) throw new Error('Missing sort!');
|
|
19203
|
+
return data;
|
|
19204
|
+
}
|
|
19205
|
+
function useSortedItems(props, items, sortBy) {
|
|
19206
|
+
const locale = useLocale();
|
|
19207
|
+
const sortedItems = computed(() => {
|
|
19208
|
+
if (!sortBy.value.length) return items.value;
|
|
19209
|
+
return sortItems(items.value, sortBy.value, locale.current.value, props.customKeySort);
|
|
19210
|
+
});
|
|
19211
|
+
return {
|
|
19212
|
+
sortedItems
|
|
19213
|
+
};
|
|
19214
|
+
}
|
|
19215
|
+
function sortItems(items, sortByItems, locale, customSorters) {
|
|
19216
|
+
const stringCollator = new Intl.Collator(locale, {
|
|
19217
|
+
sensitivity: 'accent',
|
|
19218
|
+
usage: 'sort'
|
|
19219
|
+
});
|
|
19220
|
+
return [...items].sort((a, b) => {
|
|
19221
|
+
for (let i = 0; i < sortByItems.length; i++) {
|
|
19222
|
+
const sortKey = sortByItems[i].key;
|
|
19223
|
+
const sortOrder = sortByItems[i].order ?? 'asc';
|
|
19224
|
+
if (sortOrder === false) continue;
|
|
19225
|
+
let sortA = getObjectValueByPath(a.raw, sortKey);
|
|
19226
|
+
let sortB = getObjectValueByPath(b.raw, sortKey);
|
|
19227
|
+
if (sortOrder === 'desc') {
|
|
19228
|
+
[sortA, sortB] = [sortB, sortA];
|
|
19229
|
+
}
|
|
19230
|
+
if (customSorters?.[sortKey]) {
|
|
19231
|
+
const customResult = customSorters[sortKey](sortA, sortB);
|
|
19232
|
+
if (!customResult) continue;
|
|
19233
|
+
return customResult;
|
|
19234
|
+
}
|
|
19235
|
+
|
|
19236
|
+
// Check if both cannot be evaluated
|
|
19237
|
+
if (sortA == null || sortB == null) {
|
|
19238
|
+
continue;
|
|
19239
|
+
}
|
|
19240
|
+
|
|
19241
|
+
// Dates should be compared numerically
|
|
19242
|
+
if (sortA instanceof Date && sortB instanceof Date) {
|
|
19243
|
+
return sortA.getTime() - sortB.getTime();
|
|
19244
|
+
}
|
|
19245
|
+
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase());
|
|
19246
|
+
if (sortA !== sortB) {
|
|
19247
|
+
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB);
|
|
19248
|
+
return stringCollator.compare(sortA, sortB);
|
|
19249
|
+
}
|
|
19250
|
+
}
|
|
19251
|
+
return 0;
|
|
19252
|
+
});
|
|
19253
|
+
}
|
|
19254
|
+
|
|
19255
|
+
// Utilities
|
|
19256
|
+
|
|
19257
|
+
// Types
|
|
19258
|
+
|
|
19259
|
+
const makeDataTableExpandProps = propsFactory({
|
|
19260
|
+
expandOnClick: Boolean,
|
|
19261
|
+
showExpand: Boolean,
|
|
19262
|
+
expanded: {
|
|
19263
|
+
type: Array,
|
|
19264
|
+
default: () => []
|
|
19265
|
+
}
|
|
19266
|
+
}, 'v-data-table-expand');
|
|
19267
|
+
const VDataTableExpandedKey = Symbol.for('vuetify:datatable:expanded');
|
|
19268
|
+
function provideExpanded(props) {
|
|
19269
|
+
const expandOnClick = toRef(props, 'expandOnClick');
|
|
19270
|
+
const expanded = useProxiedModel(props, 'expanded', props.expanded, v => {
|
|
19271
|
+
return new Set(v);
|
|
19272
|
+
}, v => {
|
|
19273
|
+
return [...v.values()];
|
|
19274
|
+
});
|
|
19275
|
+
function expand(item, value) {
|
|
19276
|
+
const newExpanded = new Set(expanded.value);
|
|
19277
|
+
if (!value) {
|
|
19278
|
+
newExpanded.delete(item.value);
|
|
19279
|
+
} else {
|
|
19280
|
+
newExpanded.add(item.value);
|
|
19281
|
+
}
|
|
19282
|
+
expanded.value = newExpanded;
|
|
19283
|
+
}
|
|
19284
|
+
function isExpanded(item) {
|
|
19285
|
+
return expanded.value.has(item.value);
|
|
19286
|
+
}
|
|
19287
|
+
function toggleExpand(item) {
|
|
19288
|
+
expand(item, !isExpanded(item));
|
|
19289
|
+
}
|
|
19290
|
+
const data = {
|
|
19291
|
+
expand,
|
|
19292
|
+
expanded,
|
|
19293
|
+
expandOnClick,
|
|
19294
|
+
isExpanded,
|
|
19295
|
+
toggleExpand
|
|
19296
|
+
};
|
|
19297
|
+
provide(VDataTableExpandedKey, data);
|
|
19298
|
+
return data;
|
|
19299
|
+
}
|
|
19300
|
+
function useExpanded() {
|
|
19301
|
+
const data = inject$1(VDataTableExpandedKey);
|
|
19302
|
+
if (!data) throw new Error('foo');
|
|
19303
|
+
return data;
|
|
19304
|
+
}
|
|
19305
|
+
|
|
19306
|
+
// Composables
|
|
19307
|
+
|
|
19308
|
+
// Types
|
|
19309
|
+
|
|
19310
|
+
const makeDataTableGroupProps = propsFactory({
|
|
19311
|
+
groupBy: {
|
|
19312
|
+
type: Array,
|
|
19313
|
+
default: () => []
|
|
19314
|
+
}
|
|
19315
|
+
}, 'data-table-group');
|
|
19316
|
+
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
19317
|
+
function createGroupBy(props) {
|
|
19318
|
+
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19319
|
+
return {
|
|
19320
|
+
groupBy
|
|
19321
|
+
};
|
|
19322
|
+
}
|
|
19323
|
+
function provideGroupBy(options) {
|
|
19324
|
+
const {
|
|
19325
|
+
groupBy,
|
|
19326
|
+
sortBy
|
|
19327
|
+
} = options;
|
|
19328
|
+
const opened = ref(new Set());
|
|
19329
|
+
const sortByWithGroups = computed(() => {
|
|
19330
|
+
return groupBy.value.map(val => ({
|
|
19331
|
+
...val,
|
|
19332
|
+
order: val.order ?? false
|
|
19333
|
+
})).concat(sortBy.value);
|
|
19334
|
+
});
|
|
19335
|
+
function isGroupOpen(group) {
|
|
19336
|
+
return opened.value.has(group.id);
|
|
19337
|
+
}
|
|
19338
|
+
function toggleGroup(group) {
|
|
19339
|
+
const newOpened = new Set(opened.value);
|
|
19340
|
+
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
19341
|
+
opened.value = newOpened;
|
|
19342
|
+
}
|
|
19343
|
+
function extractRows(items) {
|
|
19344
|
+
function dive(group) {
|
|
19345
|
+
const arr = [];
|
|
19346
|
+
for (const item of group.items) {
|
|
19347
|
+
if ('type' in item && item.type === 'group') {
|
|
19348
|
+
arr.push(...dive(item));
|
|
19349
|
+
} else {
|
|
19350
|
+
arr.push(item);
|
|
19351
|
+
}
|
|
19352
|
+
}
|
|
19353
|
+
return arr;
|
|
19354
|
+
}
|
|
19355
|
+
return dive({
|
|
19356
|
+
type: 'group',
|
|
19357
|
+
items,
|
|
19358
|
+
id: 'dummy',
|
|
19359
|
+
key: 'dummy',
|
|
19360
|
+
value: 'dummy',
|
|
19361
|
+
depth: 0
|
|
19362
|
+
});
|
|
19363
|
+
}
|
|
19364
|
+
|
|
19365
|
+
// onBeforeMount(() => {
|
|
19366
|
+
// for (const key of groupedItems.value.keys()) {
|
|
19367
|
+
// opened.value.add(key)
|
|
19368
|
+
// }
|
|
19369
|
+
// })
|
|
19370
|
+
|
|
19371
|
+
const data = {
|
|
19372
|
+
sortByWithGroups,
|
|
19373
|
+
toggleGroup,
|
|
19374
|
+
opened,
|
|
19375
|
+
groupBy,
|
|
19376
|
+
extractRows,
|
|
19377
|
+
isGroupOpen
|
|
19378
|
+
};
|
|
19379
|
+
provide(VDataTableGroupSymbol, data);
|
|
19380
|
+
return data;
|
|
19381
|
+
}
|
|
19382
|
+
function useGroupBy() {
|
|
19383
|
+
const data = inject$1(VDataTableGroupSymbol);
|
|
19384
|
+
if (!data) throw new Error('Missing group!');
|
|
19385
|
+
return data;
|
|
19386
|
+
}
|
|
19387
|
+
function groupItemsByProperty(items, groupBy) {
|
|
19388
|
+
if (!items.length) return [];
|
|
19389
|
+
const groups = new Map();
|
|
19390
|
+
for (const item of items) {
|
|
19391
|
+
const value = getObjectValueByPath(item.raw, groupBy);
|
|
19392
|
+
if (!groups.has(value)) {
|
|
19393
|
+
groups.set(value, []);
|
|
19394
|
+
}
|
|
19395
|
+
groups.get(value).push(item);
|
|
19396
|
+
}
|
|
19397
|
+
return groups;
|
|
19398
|
+
}
|
|
19399
|
+
function groupItems(items, groupBy) {
|
|
19400
|
+
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19401
|
+
let prefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root';
|
|
19402
|
+
if (!groupBy.length) return [];
|
|
19403
|
+
const groupedItems = groupItemsByProperty(items, groupBy[0]);
|
|
19404
|
+
const groups = [];
|
|
19405
|
+
const rest = groupBy.slice(1);
|
|
19406
|
+
groupedItems.forEach((items, value) => {
|
|
19407
|
+
const key = groupBy[0];
|
|
19408
|
+
const id = `${prefix}_${key}_${value}`;
|
|
19409
|
+
groups.push({
|
|
19410
|
+
depth,
|
|
19411
|
+
id,
|
|
19412
|
+
key,
|
|
19413
|
+
value,
|
|
19414
|
+
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
19415
|
+
type: 'group'
|
|
19416
|
+
});
|
|
19417
|
+
});
|
|
19418
|
+
return groups;
|
|
19419
|
+
}
|
|
19420
|
+
function flattenItems(items, opened) {
|
|
19421
|
+
const flatItems = [];
|
|
19422
|
+
for (const item of items) {
|
|
19423
|
+
// TODO: make this better
|
|
19424
|
+
if ('type' in item && item.type === 'group') {
|
|
19425
|
+
if (item.value != null) {
|
|
19426
|
+
flatItems.push(item);
|
|
19427
|
+
}
|
|
19428
|
+
if (opened.has(item.id) || item.value == null) {
|
|
19429
|
+
flatItems.push(...flattenItems(item.items, opened));
|
|
19430
|
+
}
|
|
19431
|
+
} else {
|
|
19432
|
+
flatItems.push(item);
|
|
19433
|
+
}
|
|
19434
|
+
}
|
|
19435
|
+
return flatItems;
|
|
19436
|
+
}
|
|
19437
|
+
function useGroupedItems(items, groupBy, opened) {
|
|
19438
|
+
const flatItems = computed(() => {
|
|
19439
|
+
if (!groupBy.value.length) return items.value;
|
|
19440
|
+
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
19441
|
+
return flattenItems(groupedItems, opened.value);
|
|
19442
|
+
});
|
|
19443
|
+
return {
|
|
19444
|
+
flatItems
|
|
19445
|
+
};
|
|
19446
|
+
}
|
|
19447
|
+
|
|
19448
|
+
// Composables
|
|
19449
|
+
|
|
19450
|
+
// Types
|
|
19451
|
+
|
|
19452
|
+
const makeDataTableSelectProps = propsFactory({
|
|
19453
|
+
showSelect: Boolean,
|
|
19454
|
+
modelValue: {
|
|
19455
|
+
type: Array,
|
|
19456
|
+
default: () => []
|
|
19457
|
+
}
|
|
19458
|
+
}, 'v-data-table-select');
|
|
19459
|
+
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
19460
|
+
function provideSelection(props, allItems) {
|
|
19461
|
+
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
19462
|
+
return new Set(v);
|
|
19463
|
+
}, v => {
|
|
19464
|
+
return [...v.values()];
|
|
19465
|
+
});
|
|
19466
|
+
function isSelected(items) {
|
|
19467
|
+
return wrapInArray(items).every(item => selected.value.has(item.value));
|
|
19468
|
+
}
|
|
19469
|
+
function isSomeSelected(items) {
|
|
19470
|
+
return wrapInArray(items).some(item => selected.value.has(item.value));
|
|
19471
|
+
}
|
|
19472
|
+
function select(items, value) {
|
|
19473
|
+
const newSelected = new Set(selected.value);
|
|
19474
|
+
for (const item of items) {
|
|
19475
|
+
if (value) newSelected.add(item.value);else newSelected.delete(item.value);
|
|
19476
|
+
}
|
|
19477
|
+
selected.value = newSelected;
|
|
19478
|
+
}
|
|
19479
|
+
function toggleSelect(item) {
|
|
19480
|
+
select([item], !isSelected([item]));
|
|
19481
|
+
}
|
|
19482
|
+
function selectAll(value) {
|
|
19483
|
+
select(allItems.value, value);
|
|
19484
|
+
}
|
|
19485
|
+
const someSelected = computed(() => selected.value.size > 0);
|
|
19486
|
+
const allSelected = computed(() => isSelected(allItems.value));
|
|
19487
|
+
const data = {
|
|
19488
|
+
toggleSelect,
|
|
19489
|
+
select,
|
|
19490
|
+
selectAll,
|
|
19491
|
+
isSelected,
|
|
19492
|
+
isSomeSelected,
|
|
19493
|
+
someSelected,
|
|
19494
|
+
allSelected
|
|
19495
|
+
};
|
|
19496
|
+
provide(VDataTableSelectionSymbol, data);
|
|
19497
|
+
return data;
|
|
19498
|
+
}
|
|
19499
|
+
function useSelection() {
|
|
19500
|
+
const data = inject$1(VDataTableSelectionSymbol);
|
|
19501
|
+
if (!data) throw new Error('Missing selection!');
|
|
19502
|
+
return data;
|
|
19503
|
+
}
|
|
19504
|
+
|
|
19505
|
+
// Utilities
|
|
19506
|
+
|
|
19507
|
+
// Types
|
|
19508
|
+
|
|
19509
|
+
function useOptions(_ref) {
|
|
19510
|
+
let {
|
|
19511
|
+
page,
|
|
19512
|
+
itemsPerPage,
|
|
19513
|
+
sortBy,
|
|
19514
|
+
groupBy,
|
|
19515
|
+
search
|
|
19516
|
+
} = _ref;
|
|
19517
|
+
const vm = getCurrentInstance('VDataTable');
|
|
19518
|
+
const options = computed(() => ({
|
|
19519
|
+
page: page.value,
|
|
19520
|
+
itemsPerPage: itemsPerPage.value,
|
|
19521
|
+
sortBy: sortBy.value,
|
|
19522
|
+
groupBy: groupBy.value,
|
|
19523
|
+
search: search.value
|
|
19524
|
+
}));
|
|
19525
|
+
|
|
19526
|
+
// Reset page when searching
|
|
19527
|
+
watch(() => search?.value, () => {
|
|
19528
|
+
page.value = 1;
|
|
19529
|
+
});
|
|
19530
|
+
let oldOptions = null;
|
|
19531
|
+
watch(options, () => {
|
|
19532
|
+
if (deepEqual(oldOptions, options.value)) return;
|
|
19533
|
+
vm.emit('update:options', options.value);
|
|
19534
|
+
oldOptions = options.value;
|
|
19535
|
+
}, {
|
|
19536
|
+
deep: true,
|
|
19537
|
+
immediate: true
|
|
19538
|
+
});
|
|
19539
|
+
}
|
|
19540
|
+
|
|
19541
|
+
// Types
|
|
19542
|
+
|
|
19543
|
+
const makeVDataIteratorProps = propsFactory({
|
|
19544
|
+
search: String,
|
|
19545
|
+
loading: Boolean,
|
|
19546
|
+
...makeComponentProps(),
|
|
19547
|
+
...makeDataIteratorItemProps(),
|
|
19548
|
+
...makeDataTableSelectProps(),
|
|
19549
|
+
...makeDataTableSortProps(),
|
|
19550
|
+
...makeDataTablePaginateProps({
|
|
19551
|
+
itemsPerPage: 5
|
|
19552
|
+
}),
|
|
19553
|
+
...makeDataTableExpandProps(),
|
|
19554
|
+
...makeDataTableGroupProps(),
|
|
19555
|
+
...makeFilterProps(),
|
|
19556
|
+
...makeTagProps()
|
|
19557
|
+
}, 'v-data-iterator');
|
|
19558
|
+
const VDataIterator = genericComponent()({
|
|
19559
|
+
name: 'VDataIterator',
|
|
19560
|
+
props: makeVDataIteratorProps(),
|
|
19561
|
+
emits: {
|
|
19562
|
+
'update:modelValue': value => true,
|
|
19563
|
+
'update:groupBy': value => true,
|
|
19564
|
+
'update:page': value => true,
|
|
19565
|
+
'update:itemsPerPage': value => true,
|
|
19566
|
+
'update:sortBy': value => true,
|
|
19567
|
+
'update:options': value => true,
|
|
19568
|
+
'update:expanded': value => true
|
|
19569
|
+
},
|
|
19570
|
+
setup(props, _ref) {
|
|
19571
|
+
let {
|
|
19572
|
+
slots
|
|
19573
|
+
} = _ref;
|
|
19574
|
+
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19575
|
+
const search = toRef(props, 'search');
|
|
19576
|
+
const {
|
|
19577
|
+
items
|
|
19578
|
+
} = useDataIteratorItems(props);
|
|
19579
|
+
const {
|
|
19580
|
+
filteredItems
|
|
19581
|
+
} = useFilter(props, items, search, {
|
|
19582
|
+
transform: item => item.raw
|
|
19583
|
+
});
|
|
19584
|
+
const {
|
|
19585
|
+
sortBy,
|
|
19586
|
+
multiSort,
|
|
19587
|
+
mustSort
|
|
19588
|
+
} = createSort(props);
|
|
19589
|
+
const {
|
|
19590
|
+
page,
|
|
19591
|
+
itemsPerPage
|
|
19592
|
+
} = createPagination(props);
|
|
19593
|
+
const {
|
|
19594
|
+
toggleSort
|
|
19595
|
+
} = provideSort({
|
|
19596
|
+
sortBy,
|
|
19597
|
+
multiSort,
|
|
19598
|
+
mustSort,
|
|
19599
|
+
page
|
|
19600
|
+
});
|
|
19601
|
+
const {
|
|
19602
|
+
sortByWithGroups,
|
|
19603
|
+
opened,
|
|
19604
|
+
extractRows,
|
|
19605
|
+
isGroupOpen,
|
|
19606
|
+
toggleGroup
|
|
19607
|
+
} = provideGroupBy({
|
|
19608
|
+
groupBy,
|
|
19609
|
+
sortBy
|
|
19610
|
+
});
|
|
19611
|
+
const {
|
|
19612
|
+
sortedItems
|
|
19613
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
19614
|
+
const {
|
|
19615
|
+
flatItems
|
|
19616
|
+
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
19617
|
+
const itemsLength = computed(() => flatItems.value.length);
|
|
19618
|
+
const {
|
|
19619
|
+
startIndex,
|
|
19620
|
+
stopIndex,
|
|
19621
|
+
pageCount,
|
|
19622
|
+
prevPage,
|
|
19623
|
+
nextPage,
|
|
19624
|
+
setItemsPerPage,
|
|
19625
|
+
setPage
|
|
19626
|
+
} = providePagination({
|
|
19627
|
+
page,
|
|
19628
|
+
itemsPerPage,
|
|
19629
|
+
itemsLength
|
|
19630
|
+
});
|
|
19631
|
+
const {
|
|
19632
|
+
paginatedItems
|
|
19633
|
+
} = usePaginatedItems({
|
|
19634
|
+
items: flatItems,
|
|
19635
|
+
startIndex,
|
|
19636
|
+
stopIndex,
|
|
19637
|
+
itemsPerPage
|
|
19638
|
+
});
|
|
19639
|
+
const paginatedItemsWithoutGroups = computed(() => extractRows(paginatedItems.value));
|
|
19640
|
+
const {
|
|
19641
|
+
isSelected,
|
|
19642
|
+
select,
|
|
19643
|
+
selectAll,
|
|
19644
|
+
toggleSelect
|
|
19645
|
+
} = provideSelection(props, paginatedItemsWithoutGroups);
|
|
19646
|
+
const {
|
|
19647
|
+
isExpanded,
|
|
19648
|
+
toggleExpand
|
|
19649
|
+
} = provideExpanded(props);
|
|
19650
|
+
useOptions({
|
|
19651
|
+
page,
|
|
19652
|
+
itemsPerPage,
|
|
19653
|
+
sortBy,
|
|
19654
|
+
groupBy,
|
|
19655
|
+
search
|
|
19656
|
+
});
|
|
19657
|
+
const slotProps = computed(() => ({
|
|
19658
|
+
page: page.value,
|
|
19659
|
+
itemsPerPage: itemsPerPage.value,
|
|
19660
|
+
sortBy: sortBy.value,
|
|
19661
|
+
pageCount: pageCount.value,
|
|
19662
|
+
toggleSort,
|
|
19663
|
+
prevPage,
|
|
19664
|
+
nextPage,
|
|
19665
|
+
setPage,
|
|
19666
|
+
setItemsPerPage,
|
|
19667
|
+
isSelected,
|
|
19668
|
+
select,
|
|
19669
|
+
selectAll,
|
|
19670
|
+
toggleSelect,
|
|
19671
|
+
isExpanded,
|
|
19672
|
+
toggleExpand,
|
|
19673
|
+
isGroupOpen,
|
|
19674
|
+
toggleGroup,
|
|
19675
|
+
items: paginatedItems.value,
|
|
19676
|
+
groupedItems: flatItems.value
|
|
19677
|
+
}));
|
|
19678
|
+
useRender(() => createVNode(props.tag, {
|
|
19679
|
+
"class": ['v-data-iterator', props.class],
|
|
19680
|
+
"style": props.style
|
|
19681
|
+
}, {
|
|
19682
|
+
default: () => [slots.header?.(slotProps.value), !paginatedItems.value.length ? slots['no-data']?.() : slots.default?.(slotProps.value), slots.footer?.(slotProps.value)]
|
|
19683
|
+
}));
|
|
19684
|
+
return {};
|
|
19685
|
+
}
|
|
19686
|
+
});
|
|
18871
19687
|
|
|
18872
19688
|
// Types
|
|
18873
19689
|
|
|
@@ -19088,285 +19904,104 @@ function createHeaders(props, options) {
|
|
|
19088
19904
|
row: flat[index].row
|
|
19089
19905
|
});
|
|
19090
19906
|
}
|
|
19091
|
-
if (options?.showSelect?.value) {
|
|
19092
|
-
const index = flat.findIndex(_ref2 => {
|
|
19093
|
-
let {
|
|
19094
|
-
column
|
|
19095
|
-
} = _ref2;
|
|
19096
|
-
return column.key === 'data-table-select';
|
|
19097
|
-
});
|
|
19098
|
-
if (index < 0) flat.unshift({
|
|
19099
|
-
column: {
|
|
19100
|
-
...defaultActionHeader,
|
|
19101
|
-
key: 'data-table-select',
|
|
19102
|
-
rowspan: rowCount
|
|
19103
|
-
},
|
|
19104
|
-
row: 0
|
|
19105
|
-
});else flat.splice(index, 1, {
|
|
19106
|
-
column: {
|
|
19107
|
-
...defaultActionHeader,
|
|
19108
|
-
...flat[index].column
|
|
19109
|
-
},
|
|
19110
|
-
row: flat[index].row
|
|
19111
|
-
});
|
|
19112
|
-
}
|
|
19113
|
-
if (options?.showExpand?.value) {
|
|
19114
|
-
const index = flat.findIndex(_ref3 => {
|
|
19115
|
-
let {
|
|
19116
|
-
column
|
|
19117
|
-
} = _ref3;
|
|
19118
|
-
return column.key === 'data-table-expand';
|
|
19119
|
-
});
|
|
19120
|
-
if (index < 0) flat.push({
|
|
19121
|
-
column: {
|
|
19122
|
-
...defaultActionHeader,
|
|
19123
|
-
key: 'data-table-expand',
|
|
19124
|
-
rowspan: rowCount
|
|
19125
|
-
},
|
|
19126
|
-
row: 0
|
|
19127
|
-
});else flat.splice(index, 1, {
|
|
19128
|
-
column: {
|
|
19129
|
-
...defaultActionHeader,
|
|
19130
|
-
...flat[index].column
|
|
19131
|
-
},
|
|
19132
|
-
row: flat[index].row
|
|
19133
|
-
});
|
|
19134
|
-
}
|
|
19135
|
-
const fixedRows = createRange(rowCount).map(() => []);
|
|
19136
|
-
const fixedOffsets = createRange(rowCount).fill(0);
|
|
19137
|
-
let count = 0;
|
|
19138
|
-
flat.forEach(_ref4 => {
|
|
19139
|
-
let {
|
|
19140
|
-
column,
|
|
19141
|
-
row
|
|
19142
|
-
} = _ref4;
|
|
19143
|
-
const id = column.key ?? `data-table-column-${count++}`;
|
|
19144
|
-
for (let i = row; i <= row + (column.rowspan ?? 1) - 1; i++) {
|
|
19145
|
-
fixedRows[i].push({
|
|
19146
|
-
...column,
|
|
19147
|
-
key: id,
|
|
19148
|
-
fixedOffset: fixedOffsets[i],
|
|
19149
|
-
sortable: column.sortable ?? !!column.key
|
|
19150
|
-
});
|
|
19151
|
-
fixedOffsets[i] += column.width ?? 0;
|
|
19152
|
-
}
|
|
19153
|
-
});
|
|
19154
|
-
fixedRows.forEach(row => {
|
|
19155
|
-
for (let i = row.length; i--; i >= 0) {
|
|
19156
|
-
if (row[i].fixed) {
|
|
19157
|
-
row[i].lastFixed = true;
|
|
19158
|
-
return;
|
|
19159
|
-
}
|
|
19160
|
-
}
|
|
19161
|
-
});
|
|
19162
|
-
const seen = new Set();
|
|
19163
|
-
headers.value = fixedRows.map(row => {
|
|
19164
|
-
const filtered = [];
|
|
19165
|
-
for (const column of row) {
|
|
19166
|
-
if (!seen.has(column.key)) {
|
|
19167
|
-
seen.add(column.key);
|
|
19168
|
-
filtered.push(column);
|
|
19169
|
-
}
|
|
19170
|
-
}
|
|
19171
|
-
return filtered;
|
|
19172
|
-
});
|
|
19173
|
-
columns.value = fixedRows.at(-1) ?? [];
|
|
19174
|
-
}, {
|
|
19175
|
-
deep: true,
|
|
19176
|
-
immediate: true
|
|
19177
|
-
});
|
|
19178
|
-
const data = {
|
|
19179
|
-
headers,
|
|
19180
|
-
columns
|
|
19181
|
-
};
|
|
19182
|
-
provide(VDataTableHeadersSymbol, data);
|
|
19183
|
-
return data;
|
|
19184
|
-
}
|
|
19185
|
-
function useHeaders() {
|
|
19186
|
-
const data = inject$1(VDataTableHeadersSymbol);
|
|
19187
|
-
if (!data) throw new Error('Missing headers!');
|
|
19188
|
-
return data;
|
|
19189
|
-
}
|
|
19190
|
-
|
|
19191
|
-
// Composables
|
|
19192
|
-
|
|
19193
|
-
// Types
|
|
19194
|
-
|
|
19195
|
-
const makeDataTableSelectProps = propsFactory({
|
|
19196
|
-
showSelect: Boolean,
|
|
19197
|
-
modelValue: {
|
|
19198
|
-
type: Array,
|
|
19199
|
-
default: () => []
|
|
19200
|
-
}
|
|
19201
|
-
}, 'v-data-table-select');
|
|
19202
|
-
const VDataTableSelectionSymbol = Symbol.for('vuetify:data-table-selection');
|
|
19203
|
-
function provideSelection(props, allItems) {
|
|
19204
|
-
const selected = useProxiedModel(props, 'modelValue', props.modelValue, v => {
|
|
19205
|
-
return new Set(v);
|
|
19206
|
-
}, v => {
|
|
19207
|
-
return [...v.values()];
|
|
19208
|
-
});
|
|
19209
|
-
function isSelected(items) {
|
|
19210
|
-
return items.every(item => selected.value.has(item.value));
|
|
19211
|
-
}
|
|
19212
|
-
function isSomeSelected(items) {
|
|
19213
|
-
return items.some(item => selected.value.has(item.value));
|
|
19214
|
-
}
|
|
19215
|
-
function select(items, value) {
|
|
19216
|
-
const newSelected = new Set(selected.value);
|
|
19217
|
-
for (const item of items) {
|
|
19218
|
-
if (value) newSelected.add(item.value);else newSelected.delete(item.value);
|
|
19219
|
-
}
|
|
19220
|
-
selected.value = newSelected;
|
|
19221
|
-
}
|
|
19222
|
-
function toggleSelect(item) {
|
|
19223
|
-
select([item], !isSelected([item]));
|
|
19224
|
-
}
|
|
19225
|
-
function selectAll(value) {
|
|
19226
|
-
select(allItems.value, value);
|
|
19227
|
-
}
|
|
19228
|
-
const someSelected = computed(() => selected.value.size > 0);
|
|
19229
|
-
const allSelected = computed(() => isSelected(allItems.value));
|
|
19230
|
-
const data = {
|
|
19231
|
-
toggleSelect,
|
|
19232
|
-
select,
|
|
19233
|
-
selectAll,
|
|
19234
|
-
isSelected,
|
|
19235
|
-
isSomeSelected,
|
|
19236
|
-
someSelected,
|
|
19237
|
-
allSelected
|
|
19238
|
-
};
|
|
19239
|
-
provide(VDataTableSelectionSymbol, data);
|
|
19240
|
-
return data;
|
|
19241
|
-
}
|
|
19242
|
-
function useSelection() {
|
|
19243
|
-
const data = inject$1(VDataTableSelectionSymbol);
|
|
19244
|
-
if (!data) throw new Error('Missing selection!');
|
|
19245
|
-
return data;
|
|
19246
|
-
}
|
|
19247
|
-
|
|
19248
|
-
// Composables
|
|
19249
|
-
|
|
19250
|
-
// Types
|
|
19251
|
-
|
|
19252
|
-
const makeDataTableSortProps = propsFactory({
|
|
19253
|
-
sortBy: {
|
|
19254
|
-
type: Array,
|
|
19255
|
-
default: () => []
|
|
19256
|
-
},
|
|
19257
|
-
multiSort: Boolean,
|
|
19258
|
-
mustSort: Boolean
|
|
19259
|
-
}, 'v-data-table-sort');
|
|
19260
|
-
const VDataTableSortSymbol = Symbol.for('vuetify:data-table-sort');
|
|
19261
|
-
function createSort(props) {
|
|
19262
|
-
const sortBy = useProxiedModel(props, 'sortBy');
|
|
19263
|
-
const mustSort = toRef(props, 'mustSort');
|
|
19264
|
-
const multiSort = toRef(props, 'multiSort');
|
|
19265
|
-
return {
|
|
19266
|
-
sortBy,
|
|
19267
|
-
mustSort,
|
|
19268
|
-
multiSort
|
|
19269
|
-
};
|
|
19270
|
-
}
|
|
19271
|
-
function provideSort(options) {
|
|
19272
|
-
const {
|
|
19273
|
-
sortBy,
|
|
19274
|
-
mustSort,
|
|
19275
|
-
multiSort,
|
|
19276
|
-
page
|
|
19277
|
-
} = options;
|
|
19278
|
-
const toggleSort = key => {
|
|
19279
|
-
let newSortBy = sortBy.value.map(x => ({
|
|
19280
|
-
...x
|
|
19281
|
-
})) ?? [];
|
|
19282
|
-
const item = newSortBy.find(x => x.key === key);
|
|
19283
|
-
if (!item) {
|
|
19284
|
-
if (multiSort.value) newSortBy = [...newSortBy, {
|
|
19285
|
-
key,
|
|
19286
|
-
order: 'asc'
|
|
19287
|
-
}];else newSortBy = [{
|
|
19288
|
-
key,
|
|
19289
|
-
order: 'asc'
|
|
19290
|
-
}];
|
|
19291
|
-
} else if (item.order === 'desc') {
|
|
19292
|
-
if (mustSort.value) {
|
|
19293
|
-
item.order = 'asc';
|
|
19294
|
-
} else {
|
|
19295
|
-
newSortBy = newSortBy.filter(x => x.key !== key);
|
|
19296
|
-
}
|
|
19297
|
-
} else {
|
|
19298
|
-
item.order = 'desc';
|
|
19907
|
+
if (options?.showSelect?.value) {
|
|
19908
|
+
const index = flat.findIndex(_ref2 => {
|
|
19909
|
+
let {
|
|
19910
|
+
column
|
|
19911
|
+
} = _ref2;
|
|
19912
|
+
return column.key === 'data-table-select';
|
|
19913
|
+
});
|
|
19914
|
+
if (index < 0) flat.unshift({
|
|
19915
|
+
column: {
|
|
19916
|
+
...defaultActionHeader,
|
|
19917
|
+
key: 'data-table-select',
|
|
19918
|
+
rowspan: rowCount
|
|
19919
|
+
},
|
|
19920
|
+
row: 0
|
|
19921
|
+
});else flat.splice(index, 1, {
|
|
19922
|
+
column: {
|
|
19923
|
+
...defaultActionHeader,
|
|
19924
|
+
...flat[index].column
|
|
19925
|
+
},
|
|
19926
|
+
row: flat[index].row
|
|
19927
|
+
});
|
|
19299
19928
|
}
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19929
|
+
if (options?.showExpand?.value) {
|
|
19930
|
+
const index = flat.findIndex(_ref3 => {
|
|
19931
|
+
let {
|
|
19932
|
+
column
|
|
19933
|
+
} = _ref3;
|
|
19934
|
+
return column.key === 'data-table-expand';
|
|
19935
|
+
});
|
|
19936
|
+
if (index < 0) flat.push({
|
|
19937
|
+
column: {
|
|
19938
|
+
...defaultActionHeader,
|
|
19939
|
+
key: 'data-table-expand',
|
|
19940
|
+
rowspan: rowCount
|
|
19941
|
+
},
|
|
19942
|
+
row: 0
|
|
19943
|
+
});else flat.splice(index, 1, {
|
|
19944
|
+
column: {
|
|
19945
|
+
...defaultActionHeader,
|
|
19946
|
+
...flat[index].column
|
|
19947
|
+
},
|
|
19948
|
+
row: flat[index].row
|
|
19949
|
+
});
|
|
19950
|
+
}
|
|
19951
|
+
const fixedRows = createRange(rowCount).map(() => []);
|
|
19952
|
+
const fixedOffsets = createRange(rowCount).fill(0);
|
|
19953
|
+
flat.forEach(_ref4 => {
|
|
19954
|
+
let {
|
|
19955
|
+
column,
|
|
19956
|
+
row
|
|
19957
|
+
} = _ref4;
|
|
19958
|
+
const key = column.key;
|
|
19959
|
+
for (let i = row; i <= row + (column.rowspan ?? 1) - 1; i++) {
|
|
19960
|
+
fixedRows[i].push({
|
|
19961
|
+
...column,
|
|
19962
|
+
key,
|
|
19963
|
+
fixedOffset: fixedOffsets[i],
|
|
19964
|
+
sortable: column.sortable ?? !!column.key
|
|
19965
|
+
});
|
|
19966
|
+
fixedOffsets[i] += column.width ?? 0;
|
|
19967
|
+
}
|
|
19968
|
+
});
|
|
19969
|
+
fixedRows.forEach(row => {
|
|
19970
|
+
for (let i = row.length; i--; i >= 0) {
|
|
19971
|
+
if (row[i].fixed) {
|
|
19972
|
+
row[i].lastFixed = true;
|
|
19973
|
+
return;
|
|
19974
|
+
}
|
|
19975
|
+
}
|
|
19976
|
+
});
|
|
19977
|
+
const seen = new Set();
|
|
19978
|
+
headers.value = fixedRows.map(row => {
|
|
19979
|
+
const filtered = [];
|
|
19980
|
+
for (const column of row) {
|
|
19981
|
+
if (!seen.has(column.key)) {
|
|
19982
|
+
seen.add(column.key);
|
|
19983
|
+
filtered.push(column);
|
|
19984
|
+
}
|
|
19985
|
+
}
|
|
19986
|
+
return filtered;
|
|
19987
|
+
});
|
|
19988
|
+
columns.value = fixedRows.at(-1) ?? [];
|
|
19989
|
+
}, {
|
|
19990
|
+
deep: true,
|
|
19991
|
+
immediate: true
|
|
19992
|
+
});
|
|
19303
19993
|
const data = {
|
|
19304
|
-
|
|
19305
|
-
|
|
19994
|
+
headers,
|
|
19995
|
+
columns
|
|
19306
19996
|
};
|
|
19307
|
-
provide(
|
|
19997
|
+
provide(VDataTableHeadersSymbol, data);
|
|
19308
19998
|
return data;
|
|
19309
19999
|
}
|
|
19310
|
-
function
|
|
19311
|
-
const data = inject$1(
|
|
19312
|
-
if (!data) throw new Error('Missing
|
|
20000
|
+
function useHeaders() {
|
|
20001
|
+
const data = inject$1(VDataTableHeadersSymbol);
|
|
20002
|
+
if (!data) throw new Error('Missing headers!');
|
|
19313
20003
|
return data;
|
|
19314
20004
|
}
|
|
19315
|
-
function useSortedItems(items, sortBy, columns) {
|
|
19316
|
-
// TODO: Put this in separate prop customKeySort to match filter composable?
|
|
19317
|
-
const customSorters = computed(() => {
|
|
19318
|
-
return columns.value.reduce((obj, item) => {
|
|
19319
|
-
if (item.sort) obj[item.key] = item.sort;
|
|
19320
|
-
return obj;
|
|
19321
|
-
}, {});
|
|
19322
|
-
});
|
|
19323
|
-
const sortedItems = computed(() => {
|
|
19324
|
-
if (!sortBy.value.length) return items.value;
|
|
19325
|
-
return sortItems(items.value, sortBy.value, 'en', customSorters.value);
|
|
19326
|
-
});
|
|
19327
|
-
return {
|
|
19328
|
-
sortedItems
|
|
19329
|
-
};
|
|
19330
|
-
}
|
|
19331
|
-
function sortItems(items, sortByItems, locale, customSorters) {
|
|
19332
|
-
const stringCollator = new Intl.Collator(locale, {
|
|
19333
|
-
sensitivity: 'accent',
|
|
19334
|
-
usage: 'sort'
|
|
19335
|
-
});
|
|
19336
|
-
return [...items].sort((a, b) => {
|
|
19337
|
-
for (let i = 0; i < sortByItems.length; i++) {
|
|
19338
|
-
const sortKey = sortByItems[i].key;
|
|
19339
|
-
const sortOrder = sortByItems[i].order;
|
|
19340
|
-
if (sortOrder === false) continue;
|
|
19341
|
-
let sortA = getObjectValueByPath(a.raw, sortKey);
|
|
19342
|
-
let sortB = getObjectValueByPath(b.raw, sortKey);
|
|
19343
|
-
if (sortOrder === 'desc') {
|
|
19344
|
-
[sortA, sortB] = [sortB, sortA];
|
|
19345
|
-
}
|
|
19346
|
-
if (customSorters?.[sortKey]) {
|
|
19347
|
-
const customResult = customSorters[sortKey](sortA, sortB);
|
|
19348
|
-
if (!customResult) continue;
|
|
19349
|
-
return customResult;
|
|
19350
|
-
}
|
|
19351
|
-
|
|
19352
|
-
// Check if both cannot be evaluated
|
|
19353
|
-
if (sortA == null || sortB == null) {
|
|
19354
|
-
continue;
|
|
19355
|
-
}
|
|
19356
|
-
|
|
19357
|
-
// Dates should be compared numerically
|
|
19358
|
-
if (sortA instanceof Date && sortB instanceof Date) {
|
|
19359
|
-
return sortA.getTime() - sortB.getTime();
|
|
19360
|
-
}
|
|
19361
|
-
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase());
|
|
19362
|
-
if (sortA !== sortB) {
|
|
19363
|
-
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB);
|
|
19364
|
-
return stringCollator.compare(sortA, sortB);
|
|
19365
|
-
}
|
|
19366
|
-
}
|
|
19367
|
-
return 0;
|
|
19368
|
-
});
|
|
19369
|
-
}
|
|
19370
20005
|
|
|
19371
20006
|
// Types
|
|
19372
20007
|
|
|
@@ -19394,7 +20029,8 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19394
20029
|
} = _ref;
|
|
19395
20030
|
const {
|
|
19396
20031
|
toggleSort,
|
|
19397
|
-
sortBy
|
|
20032
|
+
sortBy,
|
|
20033
|
+
isSorted
|
|
19398
20034
|
} = useSort();
|
|
19399
20035
|
const {
|
|
19400
20036
|
someSelected,
|
|
@@ -19409,7 +20045,7 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19409
20045
|
loaderClasses
|
|
19410
20046
|
} = useLoader(props);
|
|
19411
20047
|
const getFixedStyles = (column, y) => {
|
|
19412
|
-
if (!props.sticky && !column.fixed) return
|
|
20048
|
+
if (!props.sticky && !column.fixed) return undefined;
|
|
19413
20049
|
return {
|
|
19414
20050
|
position: 'sticky',
|
|
19415
20051
|
zIndex: column.fixed ? 4 : props.sticky ? 3 : undefined,
|
|
@@ -19419,8 +20055,8 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19419
20055
|
top: props.sticky ? `calc(var(--v-table-header-height) * ${y})` : undefined
|
|
19420
20056
|
};
|
|
19421
20057
|
};
|
|
19422
|
-
function getSortIcon(
|
|
19423
|
-
const item = sortBy.value.find(item => item.key ===
|
|
20058
|
+
function getSortIcon(column) {
|
|
20059
|
+
const item = sortBy.value.find(item => item.key === column.key);
|
|
19424
20060
|
if (!item) return props.sortAscIcon;
|
|
19425
20061
|
return item.order === 'asc' ? props.sortAscIcon : props.sortDescIcon;
|
|
19426
20062
|
}
|
|
@@ -19432,6 +20068,7 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19432
20068
|
headers: headers.value,
|
|
19433
20069
|
columns: columns.value,
|
|
19434
20070
|
toggleSort,
|
|
20071
|
+
isSorted,
|
|
19435
20072
|
sortBy: sortBy.value,
|
|
19436
20073
|
someSelected: someSelected.value,
|
|
19437
20074
|
allSelected: allSelected.value,
|
|
@@ -19445,14 +20082,13 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19445
20082
|
x,
|
|
19446
20083
|
y
|
|
19447
20084
|
} = _ref2;
|
|
19448
|
-
const isSorted = !!sortBy.value.find(x => x.key === column.key);
|
|
19449
20085
|
const noPadding = column.key === 'data-table-select' || column.key === 'data-table-expand';
|
|
19450
20086
|
return createVNode(VDataTableColumn, {
|
|
19451
20087
|
"tag": "th",
|
|
19452
20088
|
"align": column.align,
|
|
19453
20089
|
"class": ['v-data-table__th', {
|
|
19454
20090
|
'v-data-table__th--sortable': column.sortable,
|
|
19455
|
-
'v-data-table__th--sorted': isSorted
|
|
20091
|
+
'v-data-table__th--sorted': isSorted(column)
|
|
19456
20092
|
}, loaderClasses.value],
|
|
19457
20093
|
"style": {
|
|
19458
20094
|
width: convertToUnit(column.width),
|
|
@@ -19461,7 +20097,7 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19461
20097
|
},
|
|
19462
20098
|
"colspan": column.colspan,
|
|
19463
20099
|
"rowspan": column.rowspan,
|
|
19464
|
-
"onClick": column.sortable ? () => toggleSort(column
|
|
20100
|
+
"onClick": column.sortable ? () => toggleSort(column) : undefined,
|
|
19465
20101
|
"lastFixed": column.lastFixed,
|
|
19466
20102
|
"noPadding": noPadding
|
|
19467
20103
|
}, {
|
|
@@ -19469,7 +20105,13 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19469
20105
|
const columnSlotName = `column.${column.key}`;
|
|
19470
20106
|
const columnSlotProps = {
|
|
19471
20107
|
column,
|
|
19472
|
-
selectAll
|
|
20108
|
+
selectAll,
|
|
20109
|
+
isSorted,
|
|
20110
|
+
toggleSort,
|
|
20111
|
+
sortBy: sortBy.value,
|
|
20112
|
+
someSelected: someSelected.value,
|
|
20113
|
+
allSelected: allSelected.value,
|
|
20114
|
+
getSortIcon
|
|
19473
20115
|
};
|
|
19474
20116
|
if (slots[columnSlotName]) return slots[columnSlotName](columnSlotProps);
|
|
19475
20117
|
if (column.key === 'data-table-select') {
|
|
@@ -19484,8 +20126,8 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19484
20126
|
}, [createVNode("span", null, [column.title]), column.sortable && createVNode(VIcon, {
|
|
19485
20127
|
"key": "icon",
|
|
19486
20128
|
"class": "v-data-table-header__sort-icon",
|
|
19487
|
-
"icon": getSortIcon(column
|
|
19488
|
-
}, null), props.multiSort && isSorted && createVNode("div", {
|
|
20129
|
+
"icon": getSortIcon(column)
|
|
20130
|
+
}, null), props.multiSort && isSorted(column) && createVNode("div", {
|
|
19489
20131
|
"key": "badge",
|
|
19490
20132
|
"class": ['v-data-table-header__sort-badge', ...backgroundColorClasses.value],
|
|
19491
20133
|
"style": backgroundColorStyles.value
|
|
@@ -19507,149 +20149,12 @@ const VDataTableHeaders = genericComponent()({
|
|
|
19507
20149
|
"active": true,
|
|
19508
20150
|
"color": typeof props.loading === 'boolean' ? undefined : props.loading,
|
|
19509
20151
|
"indeterminate": true
|
|
19510
|
-
}, {
|
|
19511
|
-
default: slots.loader
|
|
19512
|
-
})])])]);
|
|
19513
|
-
});
|
|
19514
|
-
}
|
|
19515
|
-
});
|
|
19516
|
-
|
|
19517
|
-
// Utilities
|
|
19518
|
-
const makeDataTableGroupProps = propsFactory({
|
|
19519
|
-
groupBy: {
|
|
19520
|
-
type: Array,
|
|
19521
|
-
default: () => []
|
|
19522
|
-
}
|
|
19523
|
-
}, 'data-table-group');
|
|
19524
|
-
const VDataTableGroupSymbol = Symbol.for('vuetify:data-table-group');
|
|
19525
|
-
function createGroupBy(props) {
|
|
19526
|
-
const groupBy = useProxiedModel(props, 'groupBy');
|
|
19527
|
-
return {
|
|
19528
|
-
groupBy
|
|
19529
|
-
};
|
|
19530
|
-
}
|
|
19531
|
-
function provideGroupBy(options) {
|
|
19532
|
-
const {
|
|
19533
|
-
groupBy,
|
|
19534
|
-
sortBy
|
|
19535
|
-
} = options;
|
|
19536
|
-
const opened = ref(new Set());
|
|
19537
|
-
const sortByWithGroups = computed(() => {
|
|
19538
|
-
return groupBy.value.map(val => ({
|
|
19539
|
-
...val,
|
|
19540
|
-
order: val.order ?? false
|
|
19541
|
-
})).concat(sortBy.value);
|
|
19542
|
-
});
|
|
19543
|
-
function isGroupOpen(group) {
|
|
19544
|
-
return opened.value.has(group.id);
|
|
19545
|
-
}
|
|
19546
|
-
function toggleGroup(group) {
|
|
19547
|
-
const newOpened = new Set(opened.value);
|
|
19548
|
-
if (!isGroupOpen(group)) newOpened.add(group.id);else newOpened.delete(group.id);
|
|
19549
|
-
opened.value = newOpened;
|
|
19550
|
-
}
|
|
19551
|
-
function extractRows(items) {
|
|
19552
|
-
function dive(group) {
|
|
19553
|
-
const arr = [];
|
|
19554
|
-
for (const item of group.items) {
|
|
19555
|
-
if (item.type === 'item') arr.push(item);else {
|
|
19556
|
-
arr.push(...dive(item));
|
|
19557
|
-
}
|
|
19558
|
-
}
|
|
19559
|
-
return arr;
|
|
19560
|
-
}
|
|
19561
|
-
return dive({
|
|
19562
|
-
type: 'group-header',
|
|
19563
|
-
items,
|
|
19564
|
-
id: 'dummy',
|
|
19565
|
-
key: 'dummy',
|
|
19566
|
-
value: 'dummy',
|
|
19567
|
-
depth: 0
|
|
19568
|
-
});
|
|
19569
|
-
}
|
|
19570
|
-
|
|
19571
|
-
// onBeforeMount(() => {
|
|
19572
|
-
// for (const key of groupedItems.value.keys()) {
|
|
19573
|
-
// opened.value.add(key)
|
|
19574
|
-
// }
|
|
19575
|
-
// })
|
|
19576
|
-
|
|
19577
|
-
const data = {
|
|
19578
|
-
sortByWithGroups,
|
|
19579
|
-
toggleGroup,
|
|
19580
|
-
opened,
|
|
19581
|
-
groupBy,
|
|
19582
|
-
extractRows,
|
|
19583
|
-
isGroupOpen
|
|
19584
|
-
};
|
|
19585
|
-
provide(VDataTableGroupSymbol, data);
|
|
19586
|
-
return data;
|
|
19587
|
-
}
|
|
19588
|
-
function useGroupBy() {
|
|
19589
|
-
const data = inject$1(VDataTableGroupSymbol);
|
|
19590
|
-
if (!data) throw new Error('Missing group!');
|
|
19591
|
-
return data;
|
|
19592
|
-
}
|
|
19593
|
-
function groupItemsByProperty(items, groupBy) {
|
|
19594
|
-
if (!items.length) return [];
|
|
19595
|
-
const groups = new Map();
|
|
19596
|
-
for (const item of items) {
|
|
19597
|
-
const value = getObjectValueByPath(item.raw, groupBy);
|
|
19598
|
-
if (!groups.has(value)) {
|
|
19599
|
-
groups.set(value, []);
|
|
19600
|
-
}
|
|
19601
|
-
groups.get(value).push(item);
|
|
19602
|
-
}
|
|
19603
|
-
return groups;
|
|
19604
|
-
}
|
|
19605
|
-
function groupItems(items, groupBy) {
|
|
19606
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19607
|
-
let prefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'root';
|
|
19608
|
-
if (!groupBy.length) return [];
|
|
19609
|
-
const groupedItems = groupItemsByProperty(items, groupBy[0]);
|
|
19610
|
-
const groups = [];
|
|
19611
|
-
const rest = groupBy.slice(1);
|
|
19612
|
-
groupedItems.forEach((items, value) => {
|
|
19613
|
-
const key = groupBy[0];
|
|
19614
|
-
const id = `${prefix}_${key}_${value}`;
|
|
19615
|
-
groups.push({
|
|
19616
|
-
depth,
|
|
19617
|
-
id,
|
|
19618
|
-
key,
|
|
19619
|
-
value,
|
|
19620
|
-
items: rest.length ? groupItems(items, rest, depth + 1, id) : items,
|
|
19621
|
-
type: 'group-header'
|
|
20152
|
+
}, {
|
|
20153
|
+
default: slots.loader
|
|
20154
|
+
})])])]);
|
|
19622
20155
|
});
|
|
19623
|
-
});
|
|
19624
|
-
return groups;
|
|
19625
|
-
}
|
|
19626
|
-
function flattenItems(items, opened) {
|
|
19627
|
-
const flatItems = [];
|
|
19628
|
-
for (const item of items) {
|
|
19629
|
-
// TODO: make this better
|
|
19630
|
-
if (item.type === 'group-header') {
|
|
19631
|
-
if (item.value != null) {
|
|
19632
|
-
flatItems.push(item);
|
|
19633
|
-
}
|
|
19634
|
-
if (opened.has(item.id) || item.value == null) {
|
|
19635
|
-
flatItems.push(...flattenItems(item.items, opened));
|
|
19636
|
-
}
|
|
19637
|
-
} else {
|
|
19638
|
-
flatItems.push(item);
|
|
19639
|
-
}
|
|
19640
20156
|
}
|
|
19641
|
-
|
|
19642
|
-
}
|
|
19643
|
-
function useGroupedItems(items, groupBy, opened) {
|
|
19644
|
-
const flatItems = computed(() => {
|
|
19645
|
-
if (!groupBy.value.length) return items.value;
|
|
19646
|
-
const groupedItems = groupItems(items.value, groupBy.value.map(item => item.key));
|
|
19647
|
-
return flattenItems(groupedItems, opened.value);
|
|
19648
|
-
});
|
|
19649
|
-
return {
|
|
19650
|
-
flatItems
|
|
19651
|
-
};
|
|
19652
|
-
}
|
|
20157
|
+
});
|
|
19653
20158
|
|
|
19654
20159
|
// Types
|
|
19655
20160
|
|
|
@@ -19730,57 +20235,6 @@ const VDataTableGroupHeaderRow = genericComponent()({
|
|
|
19730
20235
|
}
|
|
19731
20236
|
});
|
|
19732
20237
|
|
|
19733
|
-
// Utilities
|
|
19734
|
-
|
|
19735
|
-
// Types
|
|
19736
|
-
|
|
19737
|
-
const makeDataTableExpandProps = propsFactory({
|
|
19738
|
-
expandOnClick: Boolean,
|
|
19739
|
-
showExpand: Boolean,
|
|
19740
|
-
expanded: {
|
|
19741
|
-
type: Array,
|
|
19742
|
-
default: () => []
|
|
19743
|
-
}
|
|
19744
|
-
}, 'v-data-table-expand');
|
|
19745
|
-
const VDataTableExpandedKey = Symbol.for('vuetify:datatable:expanded');
|
|
19746
|
-
function provideExpanded(props) {
|
|
19747
|
-
const expandOnClick = toRef(props, 'expandOnClick');
|
|
19748
|
-
const expanded = useProxiedModel(props, 'expanded', props.expanded, v => {
|
|
19749
|
-
return new Set(v);
|
|
19750
|
-
}, v => {
|
|
19751
|
-
return [...v.values()];
|
|
19752
|
-
});
|
|
19753
|
-
function expand(item, value) {
|
|
19754
|
-
const newExpanded = new Set(expanded.value);
|
|
19755
|
-
if (!value) {
|
|
19756
|
-
newExpanded.delete(item.value);
|
|
19757
|
-
} else {
|
|
19758
|
-
newExpanded.add(item.value);
|
|
19759
|
-
}
|
|
19760
|
-
expanded.value = newExpanded;
|
|
19761
|
-
}
|
|
19762
|
-
function isExpanded(item) {
|
|
19763
|
-
return expanded.value.has(item.value);
|
|
19764
|
-
}
|
|
19765
|
-
function toggleExpand(item) {
|
|
19766
|
-
expand(item, !isExpanded(item));
|
|
19767
|
-
}
|
|
19768
|
-
const data = {
|
|
19769
|
-
expand,
|
|
19770
|
-
expanded,
|
|
19771
|
-
expandOnClick,
|
|
19772
|
-
isExpanded,
|
|
19773
|
-
toggleExpand
|
|
19774
|
-
};
|
|
19775
|
-
provide(VDataTableExpandedKey, data);
|
|
19776
|
-
return data;
|
|
19777
|
-
}
|
|
19778
|
-
function useExpanded() {
|
|
19779
|
-
const data = inject$1(VDataTableExpandedKey);
|
|
19780
|
-
if (!data) throw new Error('foo');
|
|
19781
|
-
return data;
|
|
19782
|
-
}
|
|
19783
|
-
|
|
19784
20238
|
// Types
|
|
19785
20239
|
|
|
19786
20240
|
const makeVDataTableRowProps = propsFactory({
|
|
@@ -19917,7 +20371,7 @@ const VDataTableRows = genericComponent()({
|
|
|
19917
20371
|
}, [slots['no-data']?.() ?? t(props.noDataText)])]);
|
|
19918
20372
|
}
|
|
19919
20373
|
return createVNode(Fragment, null, [props.items.map((item, index) => {
|
|
19920
|
-
if (item.type === 'group
|
|
20374
|
+
if (item.type === 'group') {
|
|
19921
20375
|
return slots['group-header'] ? slots['group-header']({
|
|
19922
20376
|
index,
|
|
19923
20377
|
item,
|
|
@@ -19961,85 +20415,49 @@ const VDataTableRows = genericComponent()({
|
|
|
19961
20415
|
}
|
|
19962
20416
|
});
|
|
19963
20417
|
|
|
19964
|
-
//
|
|
20418
|
+
// Utilities
|
|
19965
20419
|
|
|
19966
20420
|
// Types
|
|
19967
20421
|
|
|
20422
|
+
// Composables
|
|
19968
20423
|
const makeDataTableItemProps = propsFactory({
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
20424
|
+
items: {
|
|
20425
|
+
type: Array,
|
|
20426
|
+
default: () => []
|
|
20427
|
+
},
|
|
20428
|
+
itemValue: {
|
|
20429
|
+
type: [String, Array, Function],
|
|
20430
|
+
default: 'value'
|
|
20431
|
+
},
|
|
20432
|
+
returnObject: Boolean
|
|
19974
20433
|
}, 'v-data-table-item');
|
|
19975
|
-
function
|
|
19976
|
-
const
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
20434
|
+
function transformItem(props, item, columns) {
|
|
20435
|
+
const value = props.returnObject ? item : getPropertyFromItem(item, props.itemValue);
|
|
20436
|
+
const itemColumns = columns.reduce((obj, column) => {
|
|
20437
|
+
obj[column.key] = getPropertyFromItem(item, column.value ?? column.key);
|
|
20438
|
+
return obj;
|
|
20439
|
+
}, {});
|
|
20440
|
+
return {
|
|
20441
|
+
type: 'item',
|
|
20442
|
+
value,
|
|
20443
|
+
columns: itemColumns,
|
|
20444
|
+
raw: item
|
|
20445
|
+
};
|
|
20446
|
+
}
|
|
20447
|
+
function transformItems(props, items, columns) {
|
|
20448
|
+
const array = [];
|
|
20449
|
+
for (const item of items) {
|
|
20450
|
+
array.push(transformItem(props, item, columns));
|
|
19985
20451
|
}
|
|
19986
|
-
|
|
20452
|
+
return array;
|
|
19987
20453
|
}
|
|
19988
20454
|
function useDataTableItems(props, columns) {
|
|
19989
|
-
const
|
|
19990
|
-
items
|
|
19991
|
-
} = useItems(props);
|
|
19992
|
-
const dataTableItems = computed(() => items.value.map(item => {
|
|
19993
|
-
return {
|
|
19994
|
-
...item,
|
|
19995
|
-
type: 'item',
|
|
19996
|
-
columns: columns.value.reduce((obj, column) => {
|
|
19997
|
-
add(obj, column.key, getPropertyFromItem(item.raw, column.value ?? column.key));
|
|
19998
|
-
return obj;
|
|
19999
|
-
}, {})
|
|
20000
|
-
};
|
|
20001
|
-
}));
|
|
20455
|
+
const items = computed(() => transformItems(props, props.items, columns.value));
|
|
20002
20456
|
return {
|
|
20003
|
-
items
|
|
20457
|
+
items
|
|
20004
20458
|
};
|
|
20005
20459
|
}
|
|
20006
20460
|
|
|
20007
|
-
// Utilities
|
|
20008
|
-
|
|
20009
|
-
// Types
|
|
20010
|
-
|
|
20011
|
-
function useOptions(_ref) {
|
|
20012
|
-
let {
|
|
20013
|
-
page,
|
|
20014
|
-
itemsPerPage,
|
|
20015
|
-
sortBy,
|
|
20016
|
-
groupBy,
|
|
20017
|
-
search
|
|
20018
|
-
} = _ref;
|
|
20019
|
-
const vm = getCurrentInstance('VDataTable');
|
|
20020
|
-
const options = computed(() => ({
|
|
20021
|
-
page: page.value,
|
|
20022
|
-
itemsPerPage: itemsPerPage.value,
|
|
20023
|
-
sortBy: sortBy.value,
|
|
20024
|
-
groupBy: groupBy.value,
|
|
20025
|
-
search: search.value
|
|
20026
|
-
}));
|
|
20027
|
-
|
|
20028
|
-
// Reset page when searching
|
|
20029
|
-
watch(() => search?.value, () => {
|
|
20030
|
-
page.value = 1;
|
|
20031
|
-
});
|
|
20032
|
-
let oldOptions = null;
|
|
20033
|
-
watch(options, () => {
|
|
20034
|
-
if (deepEqual(oldOptions, options.value)) return;
|
|
20035
|
-
vm.emit('update:options', options.value);
|
|
20036
|
-
oldOptions = options.value;
|
|
20037
|
-
}, {
|
|
20038
|
-
deep: true,
|
|
20039
|
-
immediate: true
|
|
20040
|
-
});
|
|
20041
|
-
}
|
|
20042
|
-
|
|
20043
20461
|
// Types
|
|
20044
20462
|
|
|
20045
20463
|
const makeDataTableProps = propsFactory({
|
|
@@ -20091,7 +20509,8 @@ const VDataTable = genericComponent()({
|
|
|
20091
20509
|
itemsPerPage
|
|
20092
20510
|
} = createPagination(props);
|
|
20093
20511
|
const {
|
|
20094
|
-
columns
|
|
20512
|
+
columns,
|
|
20513
|
+
headers
|
|
20095
20514
|
} = createHeaders(props, {
|
|
20096
20515
|
groupBy,
|
|
20097
20516
|
showSelect: toRef(props, 'showSelect'),
|
|
@@ -20100,14 +20519,15 @@ const VDataTable = genericComponent()({
|
|
|
20100
20519
|
const {
|
|
20101
20520
|
items
|
|
20102
20521
|
} = useDataTableItems(props, columns);
|
|
20103
|
-
const filterKeys = computed(() => columns.value.map(c => 'columns.' + c.key));
|
|
20104
20522
|
const search = toRef(props, 'search');
|
|
20105
20523
|
const {
|
|
20106
20524
|
filteredItems
|
|
20107
20525
|
} = useFilter(props, items, search, {
|
|
20108
|
-
|
|
20526
|
+
transform: item => item.columns
|
|
20109
20527
|
});
|
|
20110
|
-
|
|
20528
|
+
const {
|
|
20529
|
+
toggleSort
|
|
20530
|
+
} = provideSort({
|
|
20111
20531
|
sortBy,
|
|
20112
20532
|
multiSort,
|
|
20113
20533
|
mustSort,
|
|
@@ -20116,21 +20536,25 @@ const VDataTable = genericComponent()({
|
|
|
20116
20536
|
const {
|
|
20117
20537
|
sortByWithGroups,
|
|
20118
20538
|
opened,
|
|
20119
|
-
extractRows
|
|
20539
|
+
extractRows,
|
|
20540
|
+
isGroupOpen,
|
|
20541
|
+
toggleGroup
|
|
20120
20542
|
} = provideGroupBy({
|
|
20121
20543
|
groupBy,
|
|
20122
20544
|
sortBy
|
|
20123
20545
|
});
|
|
20124
20546
|
const {
|
|
20125
20547
|
sortedItems
|
|
20126
|
-
} = useSortedItems(filteredItems, sortByWithGroups
|
|
20548
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
20127
20549
|
const {
|
|
20128
20550
|
flatItems
|
|
20129
20551
|
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
20130
20552
|
const itemsLength = computed(() => flatItems.value.length);
|
|
20131
20553
|
const {
|
|
20132
20554
|
startIndex,
|
|
20133
|
-
stopIndex
|
|
20555
|
+
stopIndex,
|
|
20556
|
+
pageCount,
|
|
20557
|
+
setItemsPerPage
|
|
20134
20558
|
} = providePagination({
|
|
20135
20559
|
page,
|
|
20136
20560
|
itemsPerPage,
|
|
@@ -20145,8 +20569,18 @@ const VDataTable = genericComponent()({
|
|
|
20145
20569
|
itemsPerPage
|
|
20146
20570
|
});
|
|
20147
20571
|
const paginatedItemsWithoutGroups = computed(() => extractRows(paginatedItems.value));
|
|
20148
|
-
|
|
20149
|
-
|
|
20572
|
+
const {
|
|
20573
|
+
isSelected,
|
|
20574
|
+
select,
|
|
20575
|
+
selectAll,
|
|
20576
|
+
toggleSelect,
|
|
20577
|
+
someSelected,
|
|
20578
|
+
allSelected
|
|
20579
|
+
} = provideSelection(props, paginatedItemsWithoutGroups);
|
|
20580
|
+
const {
|
|
20581
|
+
isExpanded,
|
|
20582
|
+
toggleExpand
|
|
20583
|
+
} = provideExpanded(props);
|
|
20150
20584
|
useOptions({
|
|
20151
20585
|
page,
|
|
20152
20586
|
itemsPerPage,
|
|
@@ -20157,9 +20591,33 @@ const VDataTable = genericComponent()({
|
|
|
20157
20591
|
provideDefaults({
|
|
20158
20592
|
VDataTableRows: {
|
|
20159
20593
|
hideNoData: toRef(props, 'hideNoData'),
|
|
20160
|
-
noDataText: toRef(props, 'noDataText')
|
|
20594
|
+
noDataText: toRef(props, 'noDataText'),
|
|
20595
|
+
loading: toRef(props, 'loading'),
|
|
20596
|
+
loadingText: toRef(props, 'loadingText')
|
|
20161
20597
|
}
|
|
20162
20598
|
});
|
|
20599
|
+
const slotProps = computed(() => ({
|
|
20600
|
+
page: page.value,
|
|
20601
|
+
itemsPerPage: itemsPerPage.value,
|
|
20602
|
+
sortBy: sortBy.value,
|
|
20603
|
+
pageCount: pageCount.value,
|
|
20604
|
+
toggleSort,
|
|
20605
|
+
setItemsPerPage,
|
|
20606
|
+
someSelected: someSelected.value,
|
|
20607
|
+
allSelected: allSelected.value,
|
|
20608
|
+
isSelected,
|
|
20609
|
+
select,
|
|
20610
|
+
selectAll,
|
|
20611
|
+
toggleSelect,
|
|
20612
|
+
isExpanded,
|
|
20613
|
+
toggleExpand,
|
|
20614
|
+
isGroupOpen,
|
|
20615
|
+
toggleGroup,
|
|
20616
|
+
items: paginatedItems.value,
|
|
20617
|
+
groupedItems: flatItems.value,
|
|
20618
|
+
columns: columns.value,
|
|
20619
|
+
headers: headers.value
|
|
20620
|
+
}));
|
|
20163
20621
|
useRender(() => {
|
|
20164
20622
|
const [dataTableFooterProps] = VDataTableFooter.filterProps(props);
|
|
20165
20623
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
@@ -20167,19 +20625,18 @@ const VDataTable = genericComponent()({
|
|
|
20167
20625
|
const [tableProps] = VTable.filterProps(props);
|
|
20168
20626
|
return createVNode(VTable, mergeProps({
|
|
20169
20627
|
"class": ['v-data-table', {
|
|
20170
|
-
'v-data-table--show-select': props.showSelect
|
|
20628
|
+
'v-data-table--show-select': props.showSelect,
|
|
20629
|
+
'v-data-table--loading': props.loading
|
|
20171
20630
|
}, props.class],
|
|
20172
20631
|
"style": props.style
|
|
20173
20632
|
}, tableProps), {
|
|
20174
|
-
top: slots.top,
|
|
20175
|
-
default: slots.default
|
|
20176
|
-
columns
|
|
20177
|
-
}), createVNode("thead", null, [createVNode(VDataTableHeaders, dataTableHeadersProps, slots)]), slots.thead?.(), createVNode("tbody", null, [slots.body ? slots.body() : createVNode(VDataTableRows, mergeProps(dataTableRowsProps, {
|
|
20633
|
+
top: () => slots.top?.(slotProps.value),
|
|
20634
|
+
default: () => slots.default ? slots.default(slotProps.value) : createVNode(Fragment, null, [slots.colgroup?.(slotProps.value), createVNode("thead", null, [createVNode(VDataTableHeaders, dataTableHeadersProps, slots)]), slots.thead?.(slotProps.value), createVNode("tbody", null, [slots.body ? slots.body(slotProps.value) : createVNode(VDataTableRows, mergeProps(dataTableRowsProps, {
|
|
20178
20635
|
"items": paginatedItems.value
|
|
20179
|
-
}), slots)]), slots.tbody?.(), slots.tfoot?.()])
|
|
20180
|
-
bottom: slots.bottom
|
|
20636
|
+
}), slots)]), slots.tbody?.(slotProps.value), slots.tfoot?.(slotProps.value)]),
|
|
20637
|
+
bottom: () => slots.bottom ? slots.bottom(slotProps.value) : createVNode(Fragment, null, [createVNode(VDataTableFooter, dataTableFooterProps, {
|
|
20181
20638
|
prepend: slots['footer.prepend']
|
|
20182
|
-
}))
|
|
20639
|
+
})])
|
|
20183
20640
|
});
|
|
20184
20641
|
});
|
|
20185
20642
|
return {};
|
|
@@ -20268,6 +20725,7 @@ function useVirtual(props, items) {
|
|
|
20268
20725
|
|
|
20269
20726
|
const makeVDataTableVirtualProps = propsFactory({
|
|
20270
20727
|
...makeDataTableProps(),
|
|
20728
|
+
...makeDataTableGroupProps(),
|
|
20271
20729
|
...makeDataTableVirtualProps(),
|
|
20272
20730
|
...makeFilterProps()
|
|
20273
20731
|
}, 'v-data-table-virtual');
|
|
@@ -20296,7 +20754,8 @@ const VDataTableVirtual = genericComponent()({
|
|
|
20296
20754
|
mustSort
|
|
20297
20755
|
} = createSort(props);
|
|
20298
20756
|
const {
|
|
20299
|
-
columns
|
|
20757
|
+
columns,
|
|
20758
|
+
headers
|
|
20300
20759
|
} = createHeaders(props, {
|
|
20301
20760
|
groupBy,
|
|
20302
20761
|
showSelect: toRef(props, 'showSelect'),
|
|
@@ -20305,14 +20764,15 @@ const VDataTableVirtual = genericComponent()({
|
|
|
20305
20764
|
const {
|
|
20306
20765
|
items
|
|
20307
20766
|
} = useDataTableItems(props, columns);
|
|
20308
|
-
const filterKeys = computed(() => columns.value.map(c => 'columns.' + c.key));
|
|
20309
20767
|
const search = toRef(props, 'search');
|
|
20310
20768
|
const {
|
|
20311
20769
|
filteredItems
|
|
20312
20770
|
} = useFilter(props, items, search, {
|
|
20313
|
-
|
|
20771
|
+
transform: item => item.columns
|
|
20314
20772
|
});
|
|
20315
|
-
|
|
20773
|
+
const {
|
|
20774
|
+
toggleSort
|
|
20775
|
+
} = provideSort({
|
|
20316
20776
|
sortBy,
|
|
20317
20777
|
multiSort,
|
|
20318
20778
|
mustSort
|
|
@@ -20320,20 +20780,32 @@ const VDataTableVirtual = genericComponent()({
|
|
|
20320
20780
|
const {
|
|
20321
20781
|
sortByWithGroups,
|
|
20322
20782
|
opened,
|
|
20323
|
-
extractRows
|
|
20783
|
+
extractRows,
|
|
20784
|
+
isGroupOpen,
|
|
20785
|
+
toggleGroup
|
|
20324
20786
|
} = provideGroupBy({
|
|
20325
20787
|
groupBy,
|
|
20326
20788
|
sortBy
|
|
20327
20789
|
});
|
|
20328
20790
|
const {
|
|
20329
20791
|
sortedItems
|
|
20330
|
-
} = useSortedItems(filteredItems, sortByWithGroups
|
|
20792
|
+
} = useSortedItems(props, filteredItems, sortByWithGroups);
|
|
20331
20793
|
const {
|
|
20332
20794
|
flatItems
|
|
20333
20795
|
} = useGroupedItems(sortedItems, groupBy, opened);
|
|
20334
20796
|
const allRows = computed(() => extractRows(flatItems.value));
|
|
20335
|
-
|
|
20336
|
-
|
|
20797
|
+
const {
|
|
20798
|
+
isSelected,
|
|
20799
|
+
select,
|
|
20800
|
+
selectAll,
|
|
20801
|
+
toggleSelect,
|
|
20802
|
+
someSelected,
|
|
20803
|
+
allSelected
|
|
20804
|
+
} = provideSelection(props, allRows);
|
|
20805
|
+
const {
|
|
20806
|
+
isExpanded,
|
|
20807
|
+
toggleExpand
|
|
20808
|
+
} = provideExpanded(props);
|
|
20337
20809
|
const {
|
|
20338
20810
|
containerRef,
|
|
20339
20811
|
paddingTop,
|
|
@@ -20356,20 +20828,42 @@ const VDataTableVirtual = genericComponent()({
|
|
|
20356
20828
|
provideDefaults({
|
|
20357
20829
|
VDataTableRows: {
|
|
20358
20830
|
hideNoData: toRef(props, 'hideNoData'),
|
|
20359
|
-
noDataText: toRef(props, 'noDataText')
|
|
20831
|
+
noDataText: toRef(props, 'noDataText'),
|
|
20832
|
+
loading: toRef(props, 'loading'),
|
|
20833
|
+
loadingText: toRef(props, 'loadingText')
|
|
20360
20834
|
}
|
|
20361
20835
|
});
|
|
20836
|
+
const slotProps = computed(() => ({
|
|
20837
|
+
sortBy: sortBy.value,
|
|
20838
|
+
toggleSort,
|
|
20839
|
+
someSelected: someSelected.value,
|
|
20840
|
+
allSelected: allSelected.value,
|
|
20841
|
+
isSelected,
|
|
20842
|
+
select,
|
|
20843
|
+
selectAll,
|
|
20844
|
+
toggleSelect,
|
|
20845
|
+
isExpanded,
|
|
20846
|
+
toggleExpand,
|
|
20847
|
+
isGroupOpen,
|
|
20848
|
+
toggleGroup,
|
|
20849
|
+
items: items.value,
|
|
20850
|
+
groupedItems: flatItems.value,
|
|
20851
|
+
columns: columns.value,
|
|
20852
|
+
headers: headers.value
|
|
20853
|
+
}));
|
|
20362
20854
|
useRender(() => {
|
|
20363
20855
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
20364
20856
|
const [dataTableRowsProps] = VDataTableRows.filterProps(props);
|
|
20365
20857
|
const [tableProps] = VTable.filterProps(props);
|
|
20366
20858
|
return createVNode(VTable, mergeProps({
|
|
20367
|
-
"class": ['v-data-table',
|
|
20859
|
+
"class": ['v-data-table', {
|
|
20860
|
+
'v-data-table--loading': props.loading
|
|
20861
|
+
}, props.class],
|
|
20368
20862
|
"style": [{
|
|
20369
20863
|
'--v-table-row-height': convertToUnit(itemHeight.value)
|
|
20370
20864
|
}, props.style]
|
|
20371
20865
|
}, tableProps), {
|
|
20372
|
-
top: slots.top,
|
|
20866
|
+
top: () => slots.top?.(slotProps.value),
|
|
20373
20867
|
wrapper: () => createVNode("div", {
|
|
20374
20868
|
"ref": containerRef,
|
|
20375
20869
|
"onScroll": handleScroll,
|
|
@@ -20404,7 +20898,7 @@ const VDataTableVirtual = genericComponent()({
|
|
|
20404
20898
|
border: 0
|
|
20405
20899
|
}
|
|
20406
20900
|
}, null)])])])]),
|
|
20407
|
-
bottom: slots.bottom
|
|
20901
|
+
bottom: () => slots.bottom?.(slotProps.value)
|
|
20408
20902
|
});
|
|
20409
20903
|
});
|
|
20410
20904
|
}
|
|
@@ -20452,9 +20946,9 @@ const VDataTableServer = genericComponent()({
|
|
|
20452
20946
|
itemsPerPage
|
|
20453
20947
|
} = createPagination(props);
|
|
20454
20948
|
const itemsLength = computed(() => parseInt(props.itemsLength, 10));
|
|
20455
|
-
provideExpanded(props);
|
|
20456
20949
|
const {
|
|
20457
|
-
columns
|
|
20950
|
+
columns,
|
|
20951
|
+
headers
|
|
20458
20952
|
} = createHeaders(props, {
|
|
20459
20953
|
groupBy,
|
|
20460
20954
|
showSelect: toRef(props, 'showSelect'),
|
|
@@ -20472,12 +20966,17 @@ const VDataTableServer = genericComponent()({
|
|
|
20472
20966
|
page
|
|
20473
20967
|
});
|
|
20474
20968
|
const {
|
|
20475
|
-
opened
|
|
20969
|
+
opened,
|
|
20970
|
+
isGroupOpen,
|
|
20971
|
+
toggleGroup
|
|
20476
20972
|
} = provideGroupBy({
|
|
20477
20973
|
groupBy,
|
|
20478
20974
|
sortBy
|
|
20479
20975
|
});
|
|
20480
|
-
|
|
20976
|
+
const {
|
|
20977
|
+
pageCount,
|
|
20978
|
+
setItemsPerPage
|
|
20979
|
+
} = providePagination({
|
|
20481
20980
|
page,
|
|
20482
20981
|
itemsPerPage,
|
|
20483
20982
|
itemsLength
|
|
@@ -20485,7 +20984,18 @@ const VDataTableServer = genericComponent()({
|
|
|
20485
20984
|
const {
|
|
20486
20985
|
flatItems
|
|
20487
20986
|
} = useGroupedItems(items, groupBy, opened);
|
|
20488
|
-
|
|
20987
|
+
const {
|
|
20988
|
+
isSelected,
|
|
20989
|
+
select,
|
|
20990
|
+
selectAll,
|
|
20991
|
+
toggleSelect,
|
|
20992
|
+
someSelected,
|
|
20993
|
+
allSelected
|
|
20994
|
+
} = provideSelection(props, items);
|
|
20995
|
+
const {
|
|
20996
|
+
isExpanded,
|
|
20997
|
+
toggleExpand
|
|
20998
|
+
} = provideExpanded(props);
|
|
20489
20999
|
useOptions({
|
|
20490
21000
|
page,
|
|
20491
21001
|
itemsPerPage,
|
|
@@ -20505,6 +21015,28 @@ const VDataTableServer = genericComponent()({
|
|
|
20505
21015
|
loadingText: toRef(props, 'loadingText')
|
|
20506
21016
|
}
|
|
20507
21017
|
});
|
|
21018
|
+
const slotProps = computed(() => ({
|
|
21019
|
+
page: page.value,
|
|
21020
|
+
itemsPerPage: itemsPerPage.value,
|
|
21021
|
+
sortBy: sortBy.value,
|
|
21022
|
+
pageCount: pageCount.value,
|
|
21023
|
+
toggleSort,
|
|
21024
|
+
setItemsPerPage,
|
|
21025
|
+
someSelected: someSelected.value,
|
|
21026
|
+
allSelected: allSelected.value,
|
|
21027
|
+
isSelected,
|
|
21028
|
+
select,
|
|
21029
|
+
selectAll,
|
|
21030
|
+
toggleSelect,
|
|
21031
|
+
isExpanded,
|
|
21032
|
+
toggleExpand,
|
|
21033
|
+
isGroupOpen,
|
|
21034
|
+
toggleGroup,
|
|
21035
|
+
items: items.value,
|
|
21036
|
+
groupedItems: flatItems.value,
|
|
21037
|
+
columns: columns.value,
|
|
21038
|
+
headers: headers.value
|
|
21039
|
+
}));
|
|
20508
21040
|
useRender(() => {
|
|
20509
21041
|
const [dataTableFooterProps] = VDataTableFooter.filterProps(props);
|
|
20510
21042
|
const [dataTableHeadersProps] = VDataTableHeaders.filterProps(props);
|
|
@@ -20516,23 +21048,21 @@ const VDataTableServer = genericComponent()({
|
|
|
20516
21048
|
}, props.class],
|
|
20517
21049
|
"style": props.style
|
|
20518
21050
|
}, tableProps), {
|
|
20519
|
-
top: slots.top,
|
|
20520
|
-
default: slots.default
|
|
20521
|
-
columns
|
|
20522
|
-
}), createVNode("thead", {
|
|
21051
|
+
top: () => slots.top?.(slotProps.value),
|
|
21052
|
+
default: () => slots.default ? slots.default(slotProps.value) : createVNode(Fragment, null, [slots.colgroup?.(slotProps.value), createVNode("thead", {
|
|
20523
21053
|
"class": "v-data-table__thead",
|
|
20524
21054
|
"role": "rowgroup"
|
|
20525
21055
|
}, [createVNode(VDataTableHeaders, mergeProps(dataTableHeadersProps, {
|
|
20526
21056
|
"sticky": props.fixedHeader
|
|
20527
|
-
}), slots)]), slots.thead?.(), createVNode("tbody", {
|
|
21057
|
+
}), slots)]), slots.thead?.(slotProps.value), createVNode("tbody", {
|
|
20528
21058
|
"class": "v-data-table__tbody",
|
|
20529
21059
|
"role": "rowgroup"
|
|
20530
|
-
}, [slots.body ? slots.body() : createVNode(VDataTableRows, mergeProps(dataTableRowsProps, {
|
|
21060
|
+
}, [slots.body ? slots.body(slotProps.value) : createVNode(VDataTableRows, mergeProps(dataTableRowsProps, {
|
|
20531
21061
|
"items": flatItems.value
|
|
20532
|
-
}), slots)]), slots.tbody?.(), slots.tfoot?.()])
|
|
20533
|
-
bottom: slots.bottom
|
|
21062
|
+
}), slots)]), slots.tbody?.(slotProps.value), slots.tfoot?.(slotProps.value)]),
|
|
21063
|
+
bottom: () => slots.bottom ? slots.bottom(slotProps.value) : createVNode(VDataTableFooter, dataTableFooterProps, {
|
|
20534
21064
|
prepend: slots['footer.prepend']
|
|
20535
|
-
})
|
|
21065
|
+
})
|
|
20536
21066
|
});
|
|
20537
21067
|
});
|
|
20538
21068
|
}
|
|
@@ -20896,6 +21426,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
20896
21426
|
VBannerActions: VBannerActions,
|
|
20897
21427
|
VBannerText: VBannerText,
|
|
20898
21428
|
VBottomNavigation: VBottomNavigation,
|
|
21429
|
+
VBottomSheet: VBottomSheet,
|
|
20899
21430
|
VBreadcrumbs: VBreadcrumbs,
|
|
20900
21431
|
VBreadcrumbsDivider: VBreadcrumbsDivider,
|
|
20901
21432
|
VBreadcrumbsItem: VBreadcrumbsItem,
|
|
@@ -20922,6 +21453,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
20922
21453
|
VComponentIcon: VComponentIcon,
|
|
20923
21454
|
VContainer: VContainer,
|
|
20924
21455
|
VCounter: VCounter,
|
|
21456
|
+
VDataIterator: VDataIterator,
|
|
20925
21457
|
VDataTable: VDataTable,
|
|
20926
21458
|
VDataTableFooter: VDataTableFooter,
|
|
20927
21459
|
VDataTableRow: VDataTableRow,
|
|
@@ -21650,7 +22182,7 @@ function createVuetify$1() {
|
|
|
21650
22182
|
date
|
|
21651
22183
|
};
|
|
21652
22184
|
}
|
|
21653
|
-
const version$1 = "3.
|
|
22185
|
+
const version$1 = "3.3.0";
|
|
21654
22186
|
createVuetify$1.version = version$1;
|
|
21655
22187
|
|
|
21656
22188
|
// Vue's inject() can only be used in setup
|
|
@@ -21662,7 +22194,7 @@ function inject(key) {
|
|
|
21662
22194
|
}
|
|
21663
22195
|
}
|
|
21664
22196
|
|
|
21665
|
-
const version = "3.
|
|
22197
|
+
const version = "3.3.0";
|
|
21666
22198
|
|
|
21667
22199
|
const createVuetify = function () {
|
|
21668
22200
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|