@volverjs/ui-vue 0.0.10-beta.4 → 0.0.10-beta.41
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/LICENSE +1 -1
- package/README.md +146 -49
- package/auto-imports.d.ts +7 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +27 -20
- package/dist/Volver.d.ts +11 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +190 -101
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +30 -8
- package/dist/components/VvAccordion/index.d.ts +8 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +450 -170
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
- package/dist/components/VvAccordionGroup/index.d.ts +14 -6
- package/dist/components/VvAction/VvAction.es.js +84 -33
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
- package/dist/components/VvAction/index.d.ts +25 -9
- package/dist/components/VvAlert/VvAlert.es.js +228 -193
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
- package/dist/components/VvAlert/index.d.ts +17 -9
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +549 -485
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
- package/dist/components/VvAlertGroup/index.d.ts +7 -15
- package/dist/components/VvAvatar/VvAvatar.es.js +65 -22
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +128 -49
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +77 -28
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +307 -262
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
- package/dist/components/VvButton/index.d.ts +51 -29
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +95 -40
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +31 -11
- package/dist/components/VvButtonGroup/index.d.ts +11 -2
- package/dist/components/VvCard/VvCard.es.js +86 -36
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +315 -251
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +106 -34
- package/dist/components/VvCheckbox/index.d.ts +47 -14
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +238 -129
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +1377 -1059
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +606 -680
- package/dist/components/VvCombobox/index.d.ts +488 -26
- package/dist/components/VvDialog/VvDialog.es.js +180 -176
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +13 -4
- package/dist/components/VvDialog/index.d.ts +5 -0
- package/dist/components/VvDropdown/VvDropdown.es.js +165 -94
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +111 -81
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
- package/dist/components/VvDropdown/index.d.ts +52 -10
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +163 -53
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +24 -97
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1789 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +391 -0
- package/dist/components/VvInputFile/index.d.ts +210 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +1489 -563
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
- package/dist/components/VvInputText/index.d.ts +105 -30
- package/dist/components/VvNav/VvNav.es.js +160 -75
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNav/index.d.ts +5 -2
- package/dist/components/VvNavItem/VvNavItem.es.js +100 -39
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +73 -27
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +313 -250
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
- package/dist/components/VvRadio/index.d.ts +50 -17
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +236 -128
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +367 -300
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +232 -203
- package/dist/components/VvSelect/index.d.ts +195 -15
- package/dist/components/VvTab/VvTab.es.js +222 -97
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
- package/dist/components/VvTab/index.d.ts +4 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +258 -248
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +83 -30
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
- package/dist/components/VvTooltip/index.d.ts +5 -2
- package/dist/components/common/HintSlot.d.ts +4 -5
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +4575 -2534
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +101 -6
- package/dist/composables/alert/useInjectAlert.d.ts +1 -6
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
- package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
- package/dist/composables/group/useProvideGroupState.d.ts +3 -3
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +94 -5
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useOptions.d.ts +4 -4
- package/dist/composables/usePersistence.d.ts +3 -0
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/constants.d.ts +34 -32
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +104 -45
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +1 -1
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +101 -39
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +267 -267
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +92 -18
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +272 -81
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +87 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Accordion/Accordion.settings.d.ts +2 -57
- package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +2 -66
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -127
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1437 -495
- package/dist/stories/Alert/Alert.settings.d.ts +2 -109
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
- package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +2 -85
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +2 -2
- package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +2 -38
- package/dist/stories/Badge/Badge.settings.d.ts +2 -26
- package/dist/stories/Badge/Badge.test.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +2 -18
- package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
- package/dist/stories/Button/Button.settings.d.ts +2 -194
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +2 -40
- package/dist/stories/Card/Card.settings.d.ts +2 -63
- package/dist/stories/Checkbox/Checkbox.settings.d.ts +2 -132
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -141
- package/dist/stories/Combobox/Combobox.settings.d.ts +2 -609
- package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
- package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +1 -0
- package/dist/stories/Dialog/Dialog.settings.d.ts +2 -47
- package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +2 -205
- package/dist/stories/Icon/Icon.settings.d.ts +3 -68
- package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/InputText/InputText.settings.d.ts +2 -438
- package/dist/stories/Nav/Nav.settings.d.ts +2 -10
- package/dist/stories/Progress/Progress.settings.d.ts +2 -27
- package/dist/stories/Radio/Radio.settings.d.ts +1 -110
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -141
- package/dist/stories/Select/Select.settings.d.ts +2 -246
- package/dist/stories/Select/Select.stories.d.ts +1 -0
- package/dist/stories/Tab/Tab.settings.d.ts +2 -15
- package/dist/stories/Textarea/Textarea.settings.d.ts +2 -287
- package/dist/stories/argTypes.d.ts +27 -866
- package/dist/test/expect.d.ts +1 -1
- package/dist/test/options.d.ts +1 -1
- package/dist/test/sleep.d.ts +1 -1
- package/dist/types/alert.d.ts +9 -7
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/generic.d.ts +1 -2
- package/dist/types/group.d.ts +37 -15
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +2 -2
- package/dist/utils/ObjectUtilities.d.ts +7 -8
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +239 -246
- package/src/Volver.ts +245 -234
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +163 -100
- package/src/components/VvAccordion/index.ts +64 -79
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +223 -105
- package/src/components/VvAccordionGroup/index.ts +42 -42
- package/src/components/VvAction/VvAction.vue +144 -130
- package/src/components/VvAlert/VvAlert.vue +72 -70
- package/src/components/VvAlert/index.ts +149 -147
- package/src/components/VvAlertGroup/VvAlertGroup.vue +57 -56
- package/src/components/VvAlertGroup/index.ts +101 -117
- package/src/components/VvAvatar/VvAvatar.vue +20 -14
- package/src/components/VvAvatar/index.ts +5 -5
- package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
- package/src/components/VvAvatarGroup/index.ts +21 -21
- package/src/components/VvBadge/VvBadge.vue +15 -14
- package/src/components/VvBadge/index.ts +2 -2
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +50 -48
- package/src/components/VvBreadcrumb/index.ts +3 -9
- package/src/components/VvButton/VvButton.vue +163 -152
- package/src/components/VvButton/index.ts +103 -110
- package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -64
- package/src/components/VvButtonGroup/index.ts +22 -21
- package/src/components/VvCard/VvCard.vue +30 -30
- package/src/components/VvCard/index.ts +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +185 -183
- package/src/components/VvCheckbox/index.ts +44 -44
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -87
- package/src/components/VvCombobox/VvCombobox.vue +639 -619
- package/src/components/VvCombobox/index.ts +206 -164
- package/src/components/VvDialog/VvDialog.vue +141 -129
- package/src/components/VvDialog/index.ts +38 -36
- package/src/components/VvDropdown/VvDropdown.vue +466 -445
- package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
- package/src/components/VvDropdown/VvDropdownItem.vue +30 -26
- package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
- package/src/components/VvDropdown/VvDropdownOption.vue +47 -64
- package/src/components/VvDropdown/index.ts +61 -27
- package/src/components/VvIcon/README.md +1 -1
- package/src/components/VvIcon/VvIcon.vue +133 -133
- package/src/components/VvIcon/index.ts +84 -97
- package/src/components/VvInputFile/VvInputFile.vue +402 -0
- package/src/components/VvInputFile/index.ts +141 -0
- package/src/components/VvInputText/VvInputClearAction.ts +51 -47
- package/src/components/VvInputText/VvInputPasswordAction.ts +66 -62
- package/src/components/VvInputText/VvInputStepAction.ts +43 -43
- package/src/components/VvInputText/VvInputText.vue +638 -516
- package/src/components/VvInputText/VvInputTextActions.ts +86 -86
- package/src/components/VvInputText/index.ts +200 -185
- package/src/components/VvNav/VvNav.vue +40 -36
- package/src/components/VvNav/VvNavItem.vue +12 -12
- package/src/components/VvNav/VvNavSeparator.vue +6 -6
- package/src/components/VvNav/index.ts +2 -2
- package/src/components/VvProgress/VvProgress.vue +27 -27
- package/src/components/VvProgress/index.ts +28 -28
- package/src/components/VvRadio/VvRadio.vue +115 -112
- package/src/components/VvRadio/index.ts +28 -28
- package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -90
- package/src/components/VvSelect/VvSelect.vue +262 -241
- package/src/components/VvSelect/index.ts +88 -63
- package/src/components/VvTab/VvTab.vue +79 -69
- package/src/components/VvTab/index.ts +12 -12
- package/src/components/VvTextarea/VvTextarea.vue +218 -219
- package/src/components/VvTextarea/index.ts +35 -35
- package/src/components/VvTooltip/VvTooltip.vue +22 -16
- package/src/components/VvTooltip/index.ts +12 -12
- package/src/components/common/HintSlot.ts +149 -150
- package/src/components/index.ts +10 -0
- package/src/composables/alert/useAlert.ts +76 -73
- package/src/composables/alert/useInjectAlert.ts +1 -1
- package/src/composables/alert/useProvideAlert.ts +10 -10
- package/src/composables/dropdown/useInjectDropdown.ts +6 -6
- package/src/composables/dropdown/useProvideDropdown.ts +63 -63
- package/src/composables/group/useInjectedGroupState.ts +46 -42
- package/src/composables/group/useProvideGroupState.ts +9 -15
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +68 -0
- package/src/composables/useComponentFocus.ts +9 -9
- package/src/composables/useComponentIcon.ts +36 -35
- package/src/composables/useDebouncedInput.ts +25 -25
- package/src/composables/useDefaults.ts +77 -76
- package/src/composables/useModifiers.ts +29 -29
- package/src/composables/useOptions.ts +52 -43
- package/src/composables/usePersistence.ts +74 -0
- package/src/composables/useTextCount.ts +44 -44
- package/src/composables/useUniqueId.ts +3 -2
- package/src/composables/useVolver.ts +1 -1
- package/src/constants.ts +97 -82
- package/src/directives/index.ts +3 -6
- package/src/directives/v-contextmenu.ts +34 -34
- package/src/directives/v-tooltip.ts +18 -9
- package/src/index.ts +6 -4
- package/src/props/index.ts +457 -380
- package/src/resolvers/unplugin.ts +146 -136
- package/src/shims.d.ts +4 -5
- package/src/stories/Accordion/Accordion.settings.ts +51 -50
- package/src/stories/Accordion/Accordion.stories.ts +21 -21
- package/src/stories/Accordion/Accordion.test.ts +56 -54
- package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +70 -67
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +41 -39
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -45
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +35 -35
- package/src/stories/Alert/Alert.settings.ts +117 -116
- package/src/stories/Alert/Alert.stories.ts +30 -30
- package/src/stories/Alert/Alert.test.ts +78 -80
- package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
- package/src/stories/Alert/AlertSlots.stories.ts +35 -35
- package/src/stories/AlertGroup/AlertGroup.settings.ts +107 -105
- package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
- package/src/stories/AlertGroup/AlertGroup.test.ts +67 -69
- package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +58 -58
- package/src/stories/Avatar/Avatar.settings.ts +29 -29
- package/src/stories/Avatar/Avatar.stories.ts +23 -23
- package/src/stories/Avatar/Avatar.test.ts +22 -24
- package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
- package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
- package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
- package/src/stories/AvatarGroup/AvatarGroup.settings.ts +54 -53
- package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -26
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
- package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
- package/src/stories/Badge/Badge.settings.ts +21 -20
- package/src/stories/Badge/Badge.stories.ts +24 -24
- package/src/stories/Badge/Badge.test.ts +8 -8
- package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +196 -0
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +35 -34
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +23 -23
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
- package/src/stories/Button/Button.settings.ts +146 -150
- package/src/stories/Button/Button.stories.ts +19 -19
- package/src/stories/Button/Button.test.ts +41 -42
- package/src/stories/Button/ButtonIcon.stories.ts +42 -42
- package/src/stories/Button/ButtonLink.stories.ts +24 -24
- package/src/stories/Button/ButtonLoading.stories.ts +22 -22
- package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
- package/src/stories/Button/ButtonSlots.stories.ts +47 -47
- package/src/stories/Button/ButtonState.stories.ts +23 -23
- package/src/stories/Button/ButtonToggle.stories.ts +30 -30
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +33 -24
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +20 -20
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -26
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
- package/src/stories/Card/Card.settings.ts +49 -48
- package/src/stories/Card/Card.stories.ts +22 -22
- package/src/stories/Card/Card.test.ts +14 -16
- package/src/stories/Card/CardSlots.stories.ts +42 -42
- package/src/stories/Checkbox/Checkbox.settings.ts +36 -35
- package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
- package/src/stories/Checkbox/Checkbox.test.ts +63 -66
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +18 -18
- package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
- package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -67
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
- package/src/stories/Combobox/Combobox.settings.ts +407 -384
- package/src/stories/Combobox/Combobox.stories.ts +116 -107
- package/src/stories/Combobox/Combobox.test.ts +91 -91
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +25 -24
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +32 -22
- package/src/stories/Combobox/ComboboxOptions.stories.ts +81 -84
- package/src/stories/Combobox/ComboboxSlots.stories.ts +56 -55
- package/src/stories/Dialog/Dialog.settings.ts +49 -40
- package/src/stories/Dialog/Dialog.stories.ts +28 -28
- package/src/stories/Dialog/Dialog.test.ts +49 -54
- package/src/stories/Dialog/DialogModifiers.stories.ts +42 -0
- package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
- package/src/stories/Dropdown/Dropdown.settings.ts +63 -62
- package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
- package/src/stories/Dropdown/Dropdown.test.ts +9 -13
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
- package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
- package/src/stories/Dropdown/DropdownSlots.stories.ts +50 -50
- package/src/stories/Icon/Icon.settings.ts +66 -65
- package/src/stories/Icon/Icon.stories.ts +28 -29
- package/src/stories/Icon/IconsCollection.stories.ts +22 -22
- package/src/stories/InputFile/InputFile.settings.ts +37 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/InputText/InputText.settings.ts +246 -244
- package/src/stories/InputText/InputText.stories.ts +67 -67
- package/src/stories/InputText/InputText.test.ts +118 -121
- package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
- package/src/stories/InputText/InputTextLength.stories.ts +33 -33
- package/src/stories/InputText/InputTextMask.stories.ts +91 -91
- package/src/stories/InputText/InputTextMinMax.stories.ts +30 -30
- package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
- package/src/stories/InputText/InputTextType.stories.ts +70 -70
- package/src/stories/Nav/Nav.settings.ts +27 -27
- package/src/stories/Nav/Nav.stories.ts +18 -18
- package/src/stories/Nav/Nav.test.ts +10 -12
- package/src/stories/Nav/NavModifiers.stories.ts +25 -25
- package/src/stories/Progress/Progress.settings.ts +24 -23
- package/src/stories/Progress/Progress.stories.ts +23 -23
- package/src/stories/Progress/Progress.test.ts +4 -4
- package/src/stories/Radio/Radio.settings.ts +9 -9
- package/src/stories/Radio/Radio.stories.ts +47 -47
- package/src/stories/Radio/Radio.test.ts +54 -57
- package/src/stories/Radio/RadioSlots.stories.ts +15 -15
- package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
- package/src/stories/RadioGroup/RadioGroup.stories.ts +51 -52
- package/src/stories/RadioGroup/RadioGroup.test.ts +63 -67
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +35 -35
- package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
- package/src/stories/Select/Select.settings.ts +71 -70
- package/src/stories/Select/Select.stories.ts +75 -66
- package/src/stories/Select/Select.test.ts +67 -70
- package/src/stories/Select/SelectIconPosition.stories.ts +27 -26
- package/src/stories/Select/SelectOptions.stories.ts +55 -55
- package/src/stories/Select/SelectSlots.stories.ts +21 -20
- package/src/stories/Tab/Tab.settings.ts +34 -34
- package/src/stories/Tab/Tab.stories.ts +17 -17
- package/src/stories/Tab/Tab.test.ts +17 -19
- package/src/stories/Textarea/Textarea.settings.ts +79 -77
- package/src/stories/Textarea/Textarea.stories.ts +63 -63
- package/src/stories/Textarea/Textarea.test.ts +70 -73
- package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
- package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
- package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
- package/src/stories/Tooltip/Tooltip.settings.ts +16 -17
- package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
- package/src/stories/Tooltip/Tooltip.test.ts +53 -54
- package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
- package/src/stories/argTypes.ts +506 -505
- package/src/test/expect.ts +72 -77
- package/src/test/options.ts +17 -16
- package/src/test/sleep.ts +3 -2
- package/src/test/types.d.ts +11 -11
- package/src/types/alert.ts +21 -17
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +2 -3
- package/src/types/group.ts +34 -26
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +13 -14
- package/src/utils/ObjectUtilities.ts +192 -188
- package/src/workers/blurhash.ts +9 -0
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, isRef, useSlots, renderList, vModelSelect, createSlots, resolveDynamicComponent, toRef, withModifiers, vModelText } from "vue";
|
|
1
|
+
import { inject, computed, unref, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, isRef, useSlots, renderList, vModelSelect, createSlots, getCurrentInstance, resolveDynamicComponent, toRef, withModifiers, vModelText } from "vue";
|
|
2
2
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
3
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
4
4
|
import { uid } from "uid";
|
|
5
|
-
import { useMutationObserver, useVModel, onClickOutside, useFocusWithin,
|
|
5
|
+
import { useMutationObserver, useVModel, onClickOutside, useFocusWithin, useElementHover, onKeyStroke, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
|
|
6
6
|
import mitt from "mitt";
|
|
7
7
|
import { get } from "ts-dot-prop";
|
|
8
|
+
const VvIconPropsDefaults = {
|
|
9
|
+
prefix: "normal"
|
|
10
|
+
/* normal */
|
|
11
|
+
};
|
|
12
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
13
|
+
StorageType2["local"] = "local";
|
|
14
|
+
StorageType2["session"] = "session";
|
|
15
|
+
return StorageType2;
|
|
16
|
+
})(StorageType || {});
|
|
8
17
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
9
18
|
Strategy2["absolute"] = "absolute";
|
|
10
19
|
Strategy2["fixed"] = "fixed";
|
|
@@ -62,15 +71,10 @@ var DropdownItemRole = /* @__PURE__ */ ((DropdownItemRole2) => {
|
|
|
62
71
|
DropdownItemRole2["presentation"] = "presentation";
|
|
63
72
|
return DropdownItemRole2;
|
|
64
73
|
})(DropdownItemRole || {});
|
|
65
|
-
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
66
|
-
AnchorTarget2["_blank"] = "_blank";
|
|
67
|
-
AnchorTarget2["_self"] = "_self";
|
|
68
|
-
AnchorTarget2["_parent"] = "_parent";
|
|
69
|
-
AnchorTarget2["_top"] = "_top";
|
|
70
|
-
return AnchorTarget2;
|
|
71
|
-
})(AnchorTarget || {});
|
|
72
74
|
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
73
|
-
const INJECTION_KEY_BUTTON_GROUP = Symbol.for(
|
|
75
|
+
const INJECTION_KEY_BUTTON_GROUP = Symbol.for(
|
|
76
|
+
"buttonGroup"
|
|
77
|
+
);
|
|
74
78
|
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
75
79
|
"dropdownTrigger"
|
|
76
80
|
);
|
|
@@ -80,6 +84,145 @@ const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
|
|
|
80
84
|
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
|
|
81
85
|
"dropdownAction"
|
|
82
86
|
);
|
|
87
|
+
function useVolver() {
|
|
88
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
89
|
+
}
|
|
90
|
+
function useModifiers(prefix, modifiers, others) {
|
|
91
|
+
return computed(() => {
|
|
92
|
+
const toReturn = {
|
|
93
|
+
[prefix]: true
|
|
94
|
+
};
|
|
95
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
96
|
+
if (modifiersArray) {
|
|
97
|
+
if (Array.isArray(modifiersArray)) {
|
|
98
|
+
modifiersArray.forEach((modifier) => {
|
|
99
|
+
if (modifier) {
|
|
100
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (others) {
|
|
106
|
+
Object.keys(others.value).forEach((key) => {
|
|
107
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return toReturn;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const __default__$9 = {
|
|
114
|
+
name: "VvIcon"
|
|
115
|
+
};
|
|
116
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
117
|
+
...__default__$9,
|
|
118
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
119
|
+
name: {},
|
|
120
|
+
color: {},
|
|
121
|
+
width: {},
|
|
122
|
+
height: {},
|
|
123
|
+
provider: {},
|
|
124
|
+
prefix: {},
|
|
125
|
+
src: {},
|
|
126
|
+
horizontalFlip: { type: Boolean },
|
|
127
|
+
verticalFlip: { type: Boolean },
|
|
128
|
+
flip: {},
|
|
129
|
+
mode: {},
|
|
130
|
+
inline: { type: Boolean },
|
|
131
|
+
rotate: {},
|
|
132
|
+
onLoad: { type: Function },
|
|
133
|
+
svg: {},
|
|
134
|
+
modifiers: {}
|
|
135
|
+
}, VvIconPropsDefaults),
|
|
136
|
+
setup(__props) {
|
|
137
|
+
const props = __props;
|
|
138
|
+
const hasRotate = computed(() => {
|
|
139
|
+
if (typeof props.rotate === "string") {
|
|
140
|
+
return Number.parseFloat(props.rotate);
|
|
141
|
+
}
|
|
142
|
+
return props.rotate;
|
|
143
|
+
});
|
|
144
|
+
const show = ref(true);
|
|
145
|
+
const volver = useVolver();
|
|
146
|
+
const { modifiers } = toRefs(props);
|
|
147
|
+
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
148
|
+
const provider = computed(() => {
|
|
149
|
+
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
150
|
+
});
|
|
151
|
+
const icon = computed(() => {
|
|
152
|
+
const name = props.name ?? "";
|
|
153
|
+
const iconName = `@${provider.value}:${props.prefix}:${name}`;
|
|
154
|
+
if (iconExists(iconName)) {
|
|
155
|
+
return iconName;
|
|
156
|
+
}
|
|
157
|
+
const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
|
|
158
|
+
(iconsCollection2) => {
|
|
159
|
+
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
160
|
+
return iconExists(icon2);
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
if (iconsCollection) {
|
|
164
|
+
return `@${provider.value}:${iconsCollection.prefix}:${name}`;
|
|
165
|
+
}
|
|
166
|
+
return name;
|
|
167
|
+
});
|
|
168
|
+
function getSvgContent(svg) {
|
|
169
|
+
let dom;
|
|
170
|
+
if (typeof window === "undefined") {
|
|
171
|
+
const { JSDOM } = require("jsdom");
|
|
172
|
+
dom = new JSDOM().window;
|
|
173
|
+
}
|
|
174
|
+
const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
|
|
175
|
+
const svgDomString = domParser.parseFromString(svg, "text/html");
|
|
176
|
+
const svgEl = svgDomString.querySelector("svg");
|
|
177
|
+
return svgEl;
|
|
178
|
+
}
|
|
179
|
+
function addIconFromSvg(svg) {
|
|
180
|
+
const svgContentEl = getSvgContent(svg);
|
|
181
|
+
const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
|
|
182
|
+
if (svgContentEl && svgContent) {
|
|
183
|
+
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
184
|
+
body: svgContent,
|
|
185
|
+
// Set height and width from svg content
|
|
186
|
+
height: svgContentEl.viewBox.baseVal.height,
|
|
187
|
+
width: svgContentEl.viewBox.baseVal.width
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (volver) {
|
|
192
|
+
if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
|
|
193
|
+
show.value = false;
|
|
194
|
+
volver.fetchIcon(props.src).then((svg) => {
|
|
195
|
+
if (svg) {
|
|
196
|
+
addIconFromSvg(svg);
|
|
197
|
+
show.value = true;
|
|
198
|
+
}
|
|
199
|
+
}).catch((e) => {
|
|
200
|
+
throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (props.svg) {
|
|
205
|
+
addIconFromSvg(props.svg);
|
|
206
|
+
}
|
|
207
|
+
return (_ctx, _cache) => {
|
|
208
|
+
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
209
|
+
key: 0,
|
|
210
|
+
class: unref(bemCssClasses)
|
|
211
|
+
}, {
|
|
212
|
+
inline: _ctx.inline,
|
|
213
|
+
width: _ctx.width,
|
|
214
|
+
height: _ctx.height,
|
|
215
|
+
horizontalFlip: _ctx.horizontalFlip,
|
|
216
|
+
verticalFlip: _ctx.verticalFlip,
|
|
217
|
+
flip: _ctx.flip,
|
|
218
|
+
rotate: unref(hasRotate),
|
|
219
|
+
color: _ctx.color,
|
|
220
|
+
onLoad: _ctx.onLoad,
|
|
221
|
+
icon: unref(icon)
|
|
222
|
+
}), null, 16, ["class"])) : createCommentVNode("v-if", true);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
});
|
|
83
226
|
const LinkProps = {
|
|
84
227
|
/**
|
|
85
228
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
@@ -95,10 +238,7 @@ const LinkProps = {
|
|
|
95
238
|
/**
|
|
96
239
|
* Anchor target
|
|
97
240
|
*/
|
|
98
|
-
target:
|
|
99
|
-
type: String,
|
|
100
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
101
|
-
},
|
|
241
|
+
target: String,
|
|
102
242
|
/**
|
|
103
243
|
* Anchor rel
|
|
104
244
|
*/
|
|
@@ -111,27 +251,33 @@ const ValidProps = {
|
|
|
111
251
|
/**
|
|
112
252
|
* Valid status
|
|
113
253
|
*/
|
|
114
|
-
valid: Boolean,
|
|
254
|
+
valid: { type: Boolean, default: false },
|
|
115
255
|
/**
|
|
116
256
|
* Valid label
|
|
117
257
|
*/
|
|
118
|
-
validLabel: [String, Array]
|
|
258
|
+
validLabel: { type: [String, Array], default: void 0 }
|
|
119
259
|
};
|
|
120
260
|
const InvalidProps = {
|
|
121
261
|
/**
|
|
122
262
|
* Invalid status
|
|
123
263
|
*/
|
|
124
|
-
invalid:
|
|
264
|
+
invalid: {
|
|
265
|
+
type: Boolean,
|
|
266
|
+
default: false
|
|
267
|
+
},
|
|
125
268
|
/**
|
|
126
269
|
* Invalid label
|
|
127
270
|
*/
|
|
128
|
-
invalidLabel: [String, Array]
|
|
271
|
+
invalidLabel: { type: [String, Array], default: void 0 }
|
|
129
272
|
};
|
|
130
273
|
const LoadingProps = {
|
|
131
274
|
/**
|
|
132
275
|
* Loading status
|
|
133
276
|
*/
|
|
134
|
-
loading:
|
|
277
|
+
loading: {
|
|
278
|
+
type: Boolean,
|
|
279
|
+
default: false
|
|
280
|
+
},
|
|
135
281
|
/**
|
|
136
282
|
* Loading label
|
|
137
283
|
*/
|
|
@@ -144,49 +290,73 @@ const DisabledProps = {
|
|
|
144
290
|
/**
|
|
145
291
|
* Whether the form control is disabled
|
|
146
292
|
*/
|
|
147
|
-
disabled:
|
|
293
|
+
disabled: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: false
|
|
296
|
+
}
|
|
148
297
|
};
|
|
149
298
|
const SelectedProps = {
|
|
150
299
|
/**
|
|
151
300
|
* Whether the item is selected
|
|
152
301
|
*/
|
|
153
|
-
selected:
|
|
302
|
+
selected: {
|
|
303
|
+
type: Boolean,
|
|
304
|
+
default: false
|
|
305
|
+
}
|
|
154
306
|
};
|
|
155
307
|
const ActiveProps = {
|
|
156
308
|
/**
|
|
157
309
|
* Whether the item is active
|
|
158
310
|
*/
|
|
159
|
-
active:
|
|
311
|
+
active: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
default: false
|
|
314
|
+
}
|
|
160
315
|
};
|
|
161
316
|
const CurrentProps = {
|
|
162
317
|
/**
|
|
163
318
|
* Whether the item is current
|
|
164
319
|
*/
|
|
165
|
-
current:
|
|
320
|
+
current: {
|
|
321
|
+
type: Boolean,
|
|
322
|
+
default: false
|
|
323
|
+
}
|
|
166
324
|
};
|
|
167
325
|
const PressedProps = {
|
|
168
326
|
/**
|
|
169
327
|
* Whether the item is pressed
|
|
170
328
|
*/
|
|
171
|
-
pressed:
|
|
329
|
+
pressed: {
|
|
330
|
+
type: Boolean,
|
|
331
|
+
default: false
|
|
332
|
+
}
|
|
172
333
|
};
|
|
173
334
|
const LabelProps = {
|
|
174
335
|
/**
|
|
175
336
|
* The item label
|
|
176
337
|
*/
|
|
177
|
-
label:
|
|
338
|
+
label: {
|
|
339
|
+
type: [String, Number],
|
|
340
|
+
default: void 0
|
|
341
|
+
}
|
|
178
342
|
};
|
|
179
343
|
const ReadonlyProps = {
|
|
180
344
|
/**
|
|
181
345
|
* The value is not editable
|
|
182
346
|
*/
|
|
183
|
-
readonly:
|
|
347
|
+
readonly: {
|
|
348
|
+
type: Boolean,
|
|
349
|
+
default: false
|
|
350
|
+
}
|
|
184
351
|
};
|
|
185
352
|
const ModifiersProps = {
|
|
186
353
|
/**
|
|
187
354
|
* Component BEM modifiers
|
|
188
355
|
*/
|
|
189
|
-
modifiers:
|
|
356
|
+
modifiers: {
|
|
357
|
+
type: [String, Array],
|
|
358
|
+
default: void 0
|
|
359
|
+
}
|
|
190
360
|
};
|
|
191
361
|
const HintProps = {
|
|
192
362
|
hintLabel: { type: String, default: "" }
|
|
@@ -217,7 +387,10 @@ const IconProps = {
|
|
|
217
387
|
* VvIcon name or props
|
|
218
388
|
* @see VVIcon
|
|
219
389
|
*/
|
|
220
|
-
icon: {
|
|
390
|
+
icon: {
|
|
391
|
+
type: [String, Object],
|
|
392
|
+
default: void 0
|
|
393
|
+
},
|
|
221
394
|
/**
|
|
222
395
|
* VvIcon position
|
|
223
396
|
*/
|
|
@@ -238,7 +411,10 @@ const FloatingLabelProps = {
|
|
|
238
411
|
/**
|
|
239
412
|
* If true the label will be floating
|
|
240
413
|
*/
|
|
241
|
-
floating:
|
|
414
|
+
floating: {
|
|
415
|
+
type: Boolean,
|
|
416
|
+
default: false
|
|
417
|
+
}
|
|
242
418
|
};
|
|
243
419
|
const UnselectableProps = {
|
|
244
420
|
/**
|
|
@@ -274,7 +450,8 @@ const DropdownProps = {
|
|
|
274
450
|
* Dropdown show / hide transition name
|
|
275
451
|
*/
|
|
276
452
|
transitionName: {
|
|
277
|
-
type: String
|
|
453
|
+
type: String,
|
|
454
|
+
default: void 0
|
|
278
455
|
},
|
|
279
456
|
/**
|
|
280
457
|
* Offset of the dropdown from the trigger
|
|
@@ -342,7 +519,8 @@ const DropdownProps = {
|
|
|
342
519
|
* Set dropdown width to the same as the trigger
|
|
343
520
|
*/
|
|
344
521
|
triggerWidth: {
|
|
345
|
-
type: Boolean
|
|
522
|
+
type: Boolean,
|
|
523
|
+
default: false
|
|
346
524
|
}
|
|
347
525
|
};
|
|
348
526
|
const IdNameProps = {
|
|
@@ -359,7 +537,10 @@ const AutofocusProps = {
|
|
|
359
537
|
* Global attribute autofocus
|
|
360
538
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
361
539
|
*/
|
|
362
|
-
autofocus:
|
|
540
|
+
autofocus: {
|
|
541
|
+
type: Boolean,
|
|
542
|
+
default: false
|
|
543
|
+
}
|
|
363
544
|
};
|
|
364
545
|
const AutocompleteProps = {
|
|
365
546
|
/**
|
|
@@ -389,401 +570,78 @@ const ActionProps = {
|
|
|
389
570
|
ariaLabel: {
|
|
390
571
|
type: String,
|
|
391
572
|
default: void 0
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
const VvComboboxEvents = [
|
|
395
|
-
"update:modelValue",
|
|
396
|
-
"change:search",
|
|
397
|
-
"focus",
|
|
398
|
-
"blur"
|
|
399
|
-
];
|
|
400
|
-
const VvComboboxProps = {
|
|
401
|
-
...IdNameProps,
|
|
402
|
-
...TabindexProps,
|
|
403
|
-
...ValidProps,
|
|
404
|
-
...InvalidProps,
|
|
405
|
-
...HintProps,
|
|
406
|
-
...LoadingProps,
|
|
407
|
-
...DisabledProps,
|
|
408
|
-
...ReadonlyProps,
|
|
409
|
-
...ModifiersProps,
|
|
410
|
-
...OptionsProps,
|
|
411
|
-
...IconProps,
|
|
412
|
-
...FloatingLabelProps,
|
|
413
|
-
...UnselectableProps,
|
|
414
|
-
...DropdownProps,
|
|
415
|
-
...LabelProps,
|
|
573
|
+
},
|
|
416
574
|
/**
|
|
417
|
-
*
|
|
575
|
+
* Default tag for the action
|
|
418
576
|
*/
|
|
419
|
-
|
|
577
|
+
defaultTag: {
|
|
420
578
|
type: String,
|
|
421
|
-
default:
|
|
579
|
+
default: ActionTag.button
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
({
|
|
583
|
+
storageType: {
|
|
584
|
+
type: String,
|
|
585
|
+
default: StorageType.local,
|
|
586
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
422
587
|
},
|
|
588
|
+
storageKey: String
|
|
589
|
+
});
|
|
590
|
+
const VvDropdownProps = {
|
|
591
|
+
...IdProps,
|
|
592
|
+
...DropdownProps,
|
|
593
|
+
...ModifiersProps,
|
|
423
594
|
/**
|
|
424
|
-
*
|
|
595
|
+
* Show / hide dropdown programmatically
|
|
425
596
|
*/
|
|
426
597
|
modelValue: {
|
|
427
|
-
type:
|
|
598
|
+
type: Boolean,
|
|
428
599
|
default: void 0
|
|
429
600
|
},
|
|
430
601
|
/**
|
|
431
|
-
*
|
|
432
|
-
*/
|
|
433
|
-
noResultsLabel: { type: String, default: "No results" },
|
|
434
|
-
/**
|
|
435
|
-
* Label for no options available
|
|
436
|
-
*/
|
|
437
|
-
noOptionsLabel: { type: String, default: "No options available" },
|
|
438
|
-
/**
|
|
439
|
-
* Label for selected option hint
|
|
440
|
-
*/
|
|
441
|
-
selectedHintLabel: { type: String, default: "Selected" },
|
|
442
|
-
/**
|
|
443
|
-
* Label for deselect action button
|
|
444
|
-
*/
|
|
445
|
-
deselectActionLabel: { type: String, default: "Deselect" },
|
|
446
|
-
/**
|
|
447
|
-
* Label for select option hint
|
|
448
|
-
*/
|
|
449
|
-
selectHintLabel: { type: String, default: "Press enter to select" },
|
|
450
|
-
/**
|
|
451
|
-
* Label for deselected option hint
|
|
452
|
-
*/
|
|
453
|
-
deselectHintLabel: { type: String, default: "Press enter to remove" },
|
|
454
|
-
/**
|
|
455
|
-
* Label close button
|
|
456
|
-
*/
|
|
457
|
-
closeLabel: { type: String, default: "Close" },
|
|
458
|
-
/**
|
|
459
|
-
* Select input placeholder
|
|
460
|
-
*/
|
|
461
|
-
placeholder: String,
|
|
462
|
-
/**
|
|
463
|
-
* Use input text to search on options
|
|
464
|
-
*/
|
|
465
|
-
searchable: Boolean,
|
|
466
|
-
/**
|
|
467
|
-
* Search function to filter options
|
|
602
|
+
* Dropdown trigger element
|
|
468
603
|
*/
|
|
469
|
-
|
|
470
|
-
type:
|
|
471
|
-
default:
|
|
604
|
+
reference: {
|
|
605
|
+
type: Object,
|
|
606
|
+
default: null
|
|
472
607
|
},
|
|
473
608
|
/**
|
|
474
|
-
*
|
|
609
|
+
* Dropdown role
|
|
475
610
|
*/
|
|
476
|
-
|
|
611
|
+
role: {
|
|
477
612
|
type: String,
|
|
478
|
-
default:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
type: [Number, String],
|
|
485
|
-
default: 0
|
|
486
|
-
},
|
|
487
|
-
/**
|
|
488
|
-
* Manage modelValue as string[] or object[]
|
|
489
|
-
*/
|
|
490
|
-
multiple: Boolean,
|
|
491
|
-
/**
|
|
492
|
-
* The max number of selected values
|
|
493
|
-
*/
|
|
494
|
-
maxValues: [Number, String],
|
|
495
|
-
/**
|
|
496
|
-
* The select label separator visible to the user
|
|
497
|
-
*/
|
|
498
|
-
separator: { type: String, default: ", " },
|
|
499
|
-
/**
|
|
500
|
-
* Show native select
|
|
501
|
-
*/
|
|
502
|
-
native: Boolean,
|
|
503
|
-
/**
|
|
504
|
-
* Show badges
|
|
505
|
-
*/
|
|
506
|
-
badges: Boolean,
|
|
507
|
-
/**
|
|
508
|
-
* Badge modifiers
|
|
509
|
-
*/
|
|
510
|
-
badgeModifiers: {
|
|
511
|
-
type: [String, Array],
|
|
512
|
-
default: "action sm"
|
|
513
|
-
},
|
|
514
|
-
/**
|
|
515
|
-
* Set dropdown width to the same as the trigger
|
|
516
|
-
*/
|
|
517
|
-
triggerWidth: {
|
|
518
|
-
...DropdownProps.triggerWidth,
|
|
519
|
-
default: true
|
|
520
|
-
},
|
|
521
|
-
/**
|
|
522
|
-
* Dropdown modifiers
|
|
523
|
-
*/
|
|
524
|
-
dropdownModifiers: {
|
|
525
|
-
type: [String, Array],
|
|
526
|
-
default: "mobile"
|
|
527
|
-
},
|
|
528
|
-
/**
|
|
529
|
-
* Open dropdown on focus
|
|
530
|
-
*/
|
|
531
|
-
autoOpen: {
|
|
532
|
-
type: Boolean,
|
|
533
|
-
default: false
|
|
534
|
-
},
|
|
535
|
-
/**
|
|
536
|
-
* Keep open dropdown on single select
|
|
537
|
-
*/
|
|
538
|
-
keepOpen: {
|
|
613
|
+
default: DropdownRole.menu,
|
|
614
|
+
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
const VvDropdownItemProps = {
|
|
618
|
+
focusOnHover: {
|
|
539
619
|
type: Boolean,
|
|
540
620
|
default: false
|
|
541
621
|
}
|
|
542
622
|
};
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
*/
|
|
551
|
-
width: {
|
|
552
|
-
type: [String, Number]
|
|
553
|
-
},
|
|
554
|
-
/**
|
|
555
|
-
* Height
|
|
556
|
-
*/
|
|
557
|
-
height: {
|
|
558
|
-
type: [String, Number]
|
|
559
|
-
},
|
|
560
|
-
/**
|
|
561
|
-
* Icon name
|
|
562
|
-
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
563
|
-
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
564
|
-
*/
|
|
565
|
-
name: {
|
|
566
|
-
type: String,
|
|
567
|
-
required: true
|
|
623
|
+
const VvDropdownOptionProps = {
|
|
624
|
+
...DisabledProps,
|
|
625
|
+
...SelectedProps,
|
|
626
|
+
...UnselectableProps,
|
|
627
|
+
...ModifiersProps,
|
|
628
|
+
deselectHintLabel: {
|
|
629
|
+
type: String
|
|
568
630
|
},
|
|
569
|
-
|
|
570
|
-
* By default 'vv'
|
|
571
|
-
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
572
|
-
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
573
|
-
*/
|
|
574
|
-
provider: {
|
|
631
|
+
selectHintLabel: {
|
|
575
632
|
type: String
|
|
576
633
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
* Icon default options prefix: simple | normal | detailed
|
|
580
|
-
*/
|
|
581
|
-
prefix: {
|
|
582
|
-
type: String,
|
|
583
|
-
default: "normal"
|
|
634
|
+
selectedHintLabel: {
|
|
635
|
+
type: String
|
|
584
636
|
},
|
|
585
|
-
|
|
586
|
-
* Url remote SVG icon
|
|
587
|
-
*/
|
|
588
|
-
src: String,
|
|
589
|
-
/**
|
|
590
|
-
* Horizontal flip
|
|
591
|
-
*/
|
|
592
|
-
horizontalFlip: Boolean,
|
|
593
|
-
/**
|
|
594
|
-
* Vertical flip
|
|
595
|
-
*/
|
|
596
|
-
verticalFlip: Boolean,
|
|
597
|
-
/**
|
|
598
|
-
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
599
|
-
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
600
|
-
*/
|
|
601
|
-
flip: String,
|
|
602
|
-
/**
|
|
603
|
-
* Icon render mode
|
|
604
|
-
* 'style' = 'bg' or 'mask', depending on icon content
|
|
605
|
-
* 'bg' = span with style using `background`
|
|
606
|
-
* 'mask' = span with style using `mask`
|
|
607
|
-
* 'svg' = svg
|
|
608
|
-
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
609
|
-
*/
|
|
610
|
-
mode: String,
|
|
611
|
-
/**
|
|
612
|
-
* Toggles inline or block mode
|
|
613
|
-
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
614
|
-
*/
|
|
615
|
-
inline: Boolean,
|
|
616
|
-
/**
|
|
617
|
-
* rotates icon
|
|
618
|
-
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
619
|
-
*/
|
|
620
|
-
rotate: [Number, String],
|
|
621
|
-
/**
|
|
622
|
-
* A callback that is called when icon data has been loaded
|
|
623
|
-
*/
|
|
624
|
-
onLoad: Function,
|
|
625
|
-
/**
|
|
626
|
-
* SVG icon string
|
|
627
|
-
*/
|
|
628
|
-
svg: String,
|
|
629
|
-
/**
|
|
630
|
-
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
631
|
-
* @values string | string[]
|
|
632
|
-
*/
|
|
633
|
-
modifiers: {
|
|
634
|
-
type: [String, Array]
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
function useVolver() {
|
|
638
|
-
return inject(INJECTION_KEY_VOLVER);
|
|
639
|
-
}
|
|
640
|
-
function useModifiers(prefix, modifiers, others) {
|
|
641
|
-
return computed(() => {
|
|
642
|
-
const toReturn = {
|
|
643
|
-
[prefix]: true
|
|
644
|
-
};
|
|
645
|
-
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
646
|
-
if (modifiersArray) {
|
|
647
|
-
if (Array.isArray(modifiersArray)) {
|
|
648
|
-
modifiersArray.forEach((modifier) => {
|
|
649
|
-
if (modifier) {
|
|
650
|
-
toReturn[`${prefix}--${modifier}`] = true;
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
if (others) {
|
|
656
|
-
Object.keys(others.value).forEach((key) => {
|
|
657
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
return toReturn;
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
const __default__$9 = {
|
|
664
|
-
name: "VvIcon"
|
|
665
|
-
};
|
|
666
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
667
|
-
...__default__$9,
|
|
668
|
-
props: VvIconProps,
|
|
669
|
-
setup(__props) {
|
|
670
|
-
const props = __props;
|
|
671
|
-
const hasRotate = computed(() => {
|
|
672
|
-
if (typeof props.rotate === "string") {
|
|
673
|
-
return parseFloat(props.rotate);
|
|
674
|
-
}
|
|
675
|
-
return props.rotate;
|
|
676
|
-
});
|
|
677
|
-
const show = ref(true);
|
|
678
|
-
const volver = useVolver();
|
|
679
|
-
const { modifiers } = toRefs(props);
|
|
680
|
-
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
681
|
-
const provider = computed(() => {
|
|
682
|
-
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
683
|
-
});
|
|
684
|
-
const icon = computed(() => {
|
|
685
|
-
const name = props.name ?? "";
|
|
686
|
-
const iconName = `@${provider.value}:${props.prefix}:${name}`;
|
|
687
|
-
if (iconExists(iconName)) {
|
|
688
|
-
return iconName;
|
|
689
|
-
}
|
|
690
|
-
const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
|
|
691
|
-
(iconsCollection2) => {
|
|
692
|
-
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
693
|
-
return iconExists(icon2);
|
|
694
|
-
}
|
|
695
|
-
);
|
|
696
|
-
if (iconsCollection) {
|
|
697
|
-
return `@${provider.value}:${iconsCollection.prefix}:${name}`;
|
|
698
|
-
}
|
|
699
|
-
return name;
|
|
700
|
-
});
|
|
701
|
-
function getSvgContent(svg) {
|
|
702
|
-
let dom;
|
|
703
|
-
if (typeof window === "undefined") {
|
|
704
|
-
const { JSDOM } = require("jsdom");
|
|
705
|
-
dom = new JSDOM().window;
|
|
706
|
-
}
|
|
707
|
-
const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
|
|
708
|
-
const svgDomString = domParser.parseFromString(svg, "text/html");
|
|
709
|
-
const svgEl = svgDomString.querySelector("svg");
|
|
710
|
-
return svgEl;
|
|
711
|
-
}
|
|
712
|
-
function addIconFromSvg(svg) {
|
|
713
|
-
const svgContentEl = getSvgContent(svg);
|
|
714
|
-
const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
|
|
715
|
-
if (svgContentEl && svgContent) {
|
|
716
|
-
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
717
|
-
body: svgContent,
|
|
718
|
-
// Set height and width from svg content
|
|
719
|
-
height: svgContentEl.viewBox.baseVal.height,
|
|
720
|
-
width: svgContentEl.viewBox.baseVal.width
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
if (volver) {
|
|
725
|
-
if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
|
|
726
|
-
show.value = false;
|
|
727
|
-
volver.fetchIcon(props.src).then((svg) => {
|
|
728
|
-
if (svg) {
|
|
729
|
-
addIconFromSvg(svg);
|
|
730
|
-
show.value = true;
|
|
731
|
-
}
|
|
732
|
-
}).catch((e) => {
|
|
733
|
-
throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
if (props.svg) {
|
|
738
|
-
addIconFromSvg(props.svg);
|
|
739
|
-
}
|
|
740
|
-
return (_ctx, _cache) => {
|
|
741
|
-
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
742
|
-
key: 0,
|
|
743
|
-
class: unref(bemCssClasses)
|
|
744
|
-
}, {
|
|
745
|
-
inline: _ctx.inline,
|
|
746
|
-
width: _ctx.width,
|
|
747
|
-
height: _ctx.height,
|
|
748
|
-
horizontalFlip: _ctx.horizontalFlip,
|
|
749
|
-
verticalFlip: _ctx.verticalFlip,
|
|
750
|
-
flip: _ctx.flip,
|
|
751
|
-
rotate: unref(hasRotate),
|
|
752
|
-
color: _ctx.color,
|
|
753
|
-
onLoad: _ctx.onLoad,
|
|
754
|
-
icon: unref(icon)
|
|
755
|
-
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
});
|
|
759
|
-
const VvDropdownProps = {
|
|
760
|
-
...IdProps,
|
|
761
|
-
...DropdownProps,
|
|
762
|
-
...ModifiersProps,
|
|
763
|
-
/**
|
|
764
|
-
* Show / hide dropdown programmatically
|
|
765
|
-
*/
|
|
766
|
-
modelValue: {
|
|
637
|
+
focusOnHover: {
|
|
767
638
|
type: Boolean,
|
|
768
|
-
default:
|
|
769
|
-
},
|
|
770
|
-
/**
|
|
771
|
-
* Dropdown trigger element
|
|
772
|
-
*/
|
|
773
|
-
reference: {
|
|
774
|
-
type: Object,
|
|
775
|
-
default: null
|
|
776
|
-
},
|
|
777
|
-
/**
|
|
778
|
-
* Dropdown role
|
|
779
|
-
*/
|
|
780
|
-
role: {
|
|
781
|
-
type: String,
|
|
782
|
-
default: DropdownRole.menu,
|
|
783
|
-
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
639
|
+
default: false
|
|
784
640
|
}
|
|
785
641
|
};
|
|
786
|
-
|
|
642
|
+
function useUniqueId(id) {
|
|
643
|
+
return computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
644
|
+
}
|
|
787
645
|
function useProvideDropdownTrigger({
|
|
788
646
|
reference,
|
|
789
647
|
id,
|
|
@@ -814,14 +672,14 @@ function useProvideDropdownTrigger({
|
|
|
814
672
|
}
|
|
815
673
|
function useProvideDropdownItem({
|
|
816
674
|
role,
|
|
817
|
-
|
|
675
|
+
...others
|
|
818
676
|
}) {
|
|
819
677
|
const itemRole = computed(
|
|
820
678
|
() => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
|
|
821
679
|
);
|
|
822
680
|
provide(INJECTION_KEY_DROPDOWN_ITEM, {
|
|
823
681
|
role: itemRole,
|
|
824
|
-
|
|
682
|
+
...others
|
|
825
683
|
});
|
|
826
684
|
return { itemRole };
|
|
827
685
|
}
|
|
@@ -843,6 +701,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
843
701
|
props: VvDropdownProps,
|
|
844
702
|
emits: [
|
|
845
703
|
"update:modelValue",
|
|
704
|
+
"beforeEnter",
|
|
705
|
+
"afterLeave",
|
|
846
706
|
"beforeExpand",
|
|
847
707
|
"beforeCollapse",
|
|
848
708
|
"afterExpand",
|
|
@@ -850,14 +710,15 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
850
710
|
"before-enter",
|
|
851
711
|
"after-leave",
|
|
852
712
|
"enter",
|
|
853
|
-
"
|
|
854
|
-
"
|
|
855
|
-
"
|
|
713
|
+
"afterEnter",
|
|
714
|
+
"enterCancelled",
|
|
715
|
+
"beforeLeave",
|
|
856
716
|
"leave",
|
|
857
|
-
"
|
|
717
|
+
"leaveCancelled"
|
|
858
718
|
],
|
|
859
|
-
setup(__props, { expose: __expose, emit }) {
|
|
719
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
860
720
|
const props = __props;
|
|
721
|
+
const emit = __emit;
|
|
861
722
|
const { id } = toRefs(props);
|
|
862
723
|
const hasId = useUniqueId(id);
|
|
863
724
|
const attrs = useAttrs();
|
|
@@ -1012,18 +873,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1012
873
|
modelValue.value = newValue;
|
|
1013
874
|
}
|
|
1014
875
|
});
|
|
1015
|
-
|
|
876
|
+
function show() {
|
|
1016
877
|
expanded.value = true;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
878
|
+
}
|
|
879
|
+
function hide() {
|
|
1019
880
|
expanded.value = false;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
881
|
+
}
|
|
882
|
+
function toggle() {
|
|
1022
883
|
expanded.value = !expanded.value;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
884
|
+
}
|
|
885
|
+
function init(el) {
|
|
1025
886
|
referenceEl.value = el;
|
|
1026
|
-
}
|
|
887
|
+
}
|
|
1027
888
|
__expose({
|
|
1028
889
|
toggle,
|
|
1029
890
|
show,
|
|
@@ -1071,7 +932,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1071
932
|
});
|
|
1072
933
|
bus.on("click", toggle);
|
|
1073
934
|
const { role, modifiers } = toRefs(props);
|
|
1074
|
-
const { itemRole } = useProvideDropdownItem({ role, expanded });
|
|
1075
935
|
const bemCssClasses = useModifiers(
|
|
1076
936
|
"vv-dropdown",
|
|
1077
937
|
modifiers,
|
|
@@ -1092,7 +952,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1092
952
|
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
1093
953
|
);
|
|
1094
954
|
}
|
|
1095
|
-
|
|
955
|
+
function focusNext() {
|
|
1096
956
|
nextTick(() => {
|
|
1097
957
|
if (focused.value) {
|
|
1098
958
|
const focusableElements = getKeyboardFocusableElements(
|
|
@@ -1115,8 +975,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1115
975
|
}
|
|
1116
976
|
}
|
|
1117
977
|
});
|
|
1118
|
-
}
|
|
1119
|
-
|
|
978
|
+
}
|
|
979
|
+
function focusPrev() {
|
|
1120
980
|
nextTick(() => {
|
|
1121
981
|
if (focused.value) {
|
|
1122
982
|
const focusableElements = getKeyboardFocusableElements(
|
|
@@ -1139,7 +999,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1139
999
|
}
|
|
1140
1000
|
}
|
|
1141
1001
|
});
|
|
1142
|
-
}
|
|
1002
|
+
}
|
|
1003
|
+
const hovered = useElementHover(floatingEl);
|
|
1004
|
+
const { itemRole } = useProvideDropdownItem({
|
|
1005
|
+
role,
|
|
1006
|
+
expanded,
|
|
1007
|
+
focused,
|
|
1008
|
+
hovered
|
|
1009
|
+
});
|
|
1143
1010
|
onKeyStroke("Escape", (e) => {
|
|
1144
1011
|
if (expanded.value) {
|
|
1145
1012
|
e.preventDefault();
|
|
@@ -1167,76 +1034,96 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1167
1034
|
const dropdownTransitionHandlers = {
|
|
1168
1035
|
"before-enter": () => {
|
|
1169
1036
|
emit(expanded.value ? "beforeExpand" : "beforeCollapse");
|
|
1170
|
-
emit("
|
|
1037
|
+
emit("beforeEnter");
|
|
1171
1038
|
},
|
|
1172
1039
|
"after-leave": () => {
|
|
1173
1040
|
emit(expanded.value ? "afterExpand" : "afterCollapse");
|
|
1174
|
-
emit("
|
|
1041
|
+
emit("afterLeave");
|
|
1175
1042
|
},
|
|
1176
|
-
enter: () => {
|
|
1043
|
+
"enter": () => {
|
|
1177
1044
|
emit("enter");
|
|
1178
1045
|
},
|
|
1179
1046
|
"after-enter": () => {
|
|
1180
|
-
emit("
|
|
1047
|
+
emit("afterEnter");
|
|
1181
1048
|
},
|
|
1182
1049
|
"enter-cancelled": () => {
|
|
1183
|
-
emit("
|
|
1050
|
+
emit("enterCancelled");
|
|
1184
1051
|
},
|
|
1185
1052
|
"before-leave": () => {
|
|
1186
|
-
emit("
|
|
1053
|
+
emit("beforeLeave");
|
|
1187
1054
|
},
|
|
1188
|
-
leave: () => {
|
|
1055
|
+
"leave": () => {
|
|
1189
1056
|
emit("leave");
|
|
1190
1057
|
},
|
|
1191
1058
|
"leave-cancelled": () => {
|
|
1192
|
-
emit("
|
|
1059
|
+
emit("leaveCancelled");
|
|
1193
1060
|
}
|
|
1194
1061
|
};
|
|
1195
1062
|
return (_ctx, _cache) => {
|
|
1196
|
-
return openBlock(), createElementBlock(
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1063
|
+
return openBlock(), createElementBlock(
|
|
1064
|
+
Fragment,
|
|
1065
|
+
null,
|
|
1066
|
+
[
|
|
1067
|
+
createVNode(unref(VvDropdownTriggerProvider), null, {
|
|
1068
|
+
default: withCtx(() => [
|
|
1069
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
|
|
1070
|
+
]),
|
|
1071
|
+
_: 3
|
|
1072
|
+
/* FORWARDED */
|
|
1073
|
+
}),
|
|
1074
|
+
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers), { persisted: "" }), {
|
|
1075
|
+
default: withCtx(() => [
|
|
1076
|
+
withDirectives(createElementVNode(
|
|
1077
|
+
"div",
|
|
1078
|
+
{
|
|
1079
|
+
ref_key: "floatingEl",
|
|
1080
|
+
ref: floatingEl,
|
|
1081
|
+
style: normalizeStyle(unref(dropdownPlacement)),
|
|
1082
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1083
|
+
},
|
|
1084
|
+
[
|
|
1085
|
+
props.arrow ? (openBlock(), createElementBlock(
|
|
1086
|
+
"div",
|
|
1087
|
+
{
|
|
1088
|
+
key: 0,
|
|
1089
|
+
ref_key: "arrowEl",
|
|
1090
|
+
ref: arrowEl,
|
|
1091
|
+
style: normalizeStyle(unref(arrowPlacement)),
|
|
1092
|
+
class: "vv-dropdown__arrow"
|
|
1093
|
+
},
|
|
1094
|
+
null,
|
|
1095
|
+
4
|
|
1096
|
+
/* STYLE */
|
|
1097
|
+
)) : createCommentVNode("v-if", true),
|
|
1098
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
|
|
1099
|
+
createElementVNode("div", mergeProps(unref(attrs), {
|
|
1100
|
+
id: unref(hasId),
|
|
1101
|
+
ref_key: "listEl",
|
|
1102
|
+
ref: listEl,
|
|
1103
|
+
tabindex: !unref(expanded) ? -1 : void 0,
|
|
1104
|
+
role: unref(role),
|
|
1105
|
+
"aria-labelledby": unref(hasAriaLabelledby),
|
|
1106
|
+
class: "vv-dropdown__list"
|
|
1107
|
+
}), [
|
|
1108
|
+
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
1109
|
+
role: unref(itemRole)
|
|
1110
|
+
})))
|
|
1111
|
+
], 16, _hoisted_1$5),
|
|
1112
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
1113
|
+
],
|
|
1114
|
+
6
|
|
1115
|
+
/* CLASS, STYLE */
|
|
1116
|
+
), [
|
|
1117
|
+
[vShow, unref(expanded)]
|
|
1118
|
+
])
|
|
1119
|
+
]),
|
|
1120
|
+
_: 3
|
|
1121
|
+
/* FORWARDED */
|
|
1122
|
+
}, 16, ["name"])
|
|
1123
|
+
],
|
|
1124
|
+
64
|
|
1125
|
+
/* STABLE_FRAGMENT */
|
|
1126
|
+
);
|
|
1240
1127
|
};
|
|
1241
1128
|
}
|
|
1242
1129
|
});
|
|
@@ -1254,7 +1141,9 @@ const __default__$7 = {
|
|
|
1254
1141
|
};
|
|
1255
1142
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1256
1143
|
...__default__$7,
|
|
1144
|
+
props: VvDropdownItemProps,
|
|
1257
1145
|
setup(__props) {
|
|
1146
|
+
const props = __props;
|
|
1258
1147
|
const { role, expanded } = useInjectedDropdownItem();
|
|
1259
1148
|
const element = ref(null);
|
|
1260
1149
|
useProvideDropdownAction({ expanded });
|
|
@@ -1262,18 +1151,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1262
1151
|
const { focused } = useFocus(element);
|
|
1263
1152
|
const { focused: focusedWithin } = useFocusWithin(element);
|
|
1264
1153
|
watch(hovered, (newValue) => {
|
|
1265
|
-
if (newValue) {
|
|
1154
|
+
if (newValue && props.focusOnHover) {
|
|
1266
1155
|
focused.value = true;
|
|
1267
1156
|
}
|
|
1268
1157
|
});
|
|
1269
1158
|
return (_ctx, _cache) => {
|
|
1270
|
-
return openBlock(), createElementBlock(
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1159
|
+
return openBlock(), createElementBlock(
|
|
1160
|
+
"div",
|
|
1161
|
+
mergeProps({ role: unref(role) }, {
|
|
1162
|
+
ref_key: "element",
|
|
1163
|
+
ref: element,
|
|
1164
|
+
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
1165
|
+
}),
|
|
1166
|
+
[
|
|
1167
|
+
renderSlot(_ctx.$slots, "default")
|
|
1168
|
+
],
|
|
1169
|
+
16
|
|
1170
|
+
/* FULL_PROPS */
|
|
1171
|
+
);
|
|
1277
1172
|
};
|
|
1278
1173
|
}
|
|
1279
1174
|
});
|
|
@@ -1283,21 +1178,7 @@ const __default__$6 = {
|
|
|
1283
1178
|
};
|
|
1284
1179
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1285
1180
|
...__default__$6,
|
|
1286
|
-
props:
|
|
1287
|
-
...DisabledProps,
|
|
1288
|
-
...SelectedProps,
|
|
1289
|
-
...UnselectableProps,
|
|
1290
|
-
...ModifiersProps,
|
|
1291
|
-
deselectHintLabel: {
|
|
1292
|
-
type: String
|
|
1293
|
-
},
|
|
1294
|
-
selectHintLabel: {
|
|
1295
|
-
type: String
|
|
1296
|
-
},
|
|
1297
|
-
selectedHintLabel: {
|
|
1298
|
-
type: String
|
|
1299
|
-
}
|
|
1300
|
-
},
|
|
1181
|
+
props: VvDropdownOptionProps,
|
|
1301
1182
|
setup(__props) {
|
|
1302
1183
|
const props = __props;
|
|
1303
1184
|
const { modifiers } = toRefs(props);
|
|
@@ -1317,13 +1198,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1317
1198
|
if (!props.disabled) {
|
|
1318
1199
|
return props.selectHintLabel;
|
|
1319
1200
|
}
|
|
1201
|
+
return "";
|
|
1320
1202
|
});
|
|
1321
1203
|
return (_ctx, _cache) => {
|
|
1322
1204
|
return openBlock(), createBlock(_sfc_main$7, {
|
|
1323
1205
|
class: normalizeClass(unref(bemCssClasses)),
|
|
1324
1206
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
1325
1207
|
"aria-selected": _ctx.selected,
|
|
1326
|
-
"aria-disabled": _ctx.disabled
|
|
1208
|
+
"aria-disabled": _ctx.disabled,
|
|
1209
|
+
"focus-on-hover": _ctx.focusOnHover
|
|
1327
1210
|
}, {
|
|
1328
1211
|
default: withCtx(() => [
|
|
1329
1212
|
renderSlot(_ctx.$slots, "default"),
|
|
@@ -1332,12 +1215,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1332
1215
|
title: unref(hintLabel)
|
|
1333
1216
|
}, [
|
|
1334
1217
|
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
1335
|
-
createTextVNode(
|
|
1218
|
+
createTextVNode(
|
|
1219
|
+
toDisplayString(unref(hintLabel)),
|
|
1220
|
+
1
|
|
1221
|
+
/* TEXT */
|
|
1222
|
+
)
|
|
1336
1223
|
])
|
|
1337
1224
|
], 8, _hoisted_1$4)
|
|
1338
1225
|
]),
|
|
1339
1226
|
_: 3
|
|
1340
|
-
|
|
1227
|
+
/* FORWARDED */
|
|
1228
|
+
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled", "focus-on-hover"]);
|
|
1341
1229
|
};
|
|
1342
1230
|
}
|
|
1343
1231
|
});
|
|
@@ -1357,7 +1245,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1357
1245
|
setup(__props) {
|
|
1358
1246
|
const props = __props;
|
|
1359
1247
|
return (_ctx, _cache) => {
|
|
1360
|
-
return openBlock(), createElementBlock(
|
|
1248
|
+
return openBlock(), createElementBlock(
|
|
1249
|
+
"li",
|
|
1250
|
+
_hoisted_1$3,
|
|
1251
|
+
toDisplayString(props.label),
|
|
1252
|
+
1
|
|
1253
|
+
/* TEXT */
|
|
1254
|
+
);
|
|
1361
1255
|
};
|
|
1362
1256
|
}
|
|
1363
1257
|
});
|
|
@@ -1376,32 +1270,36 @@ function deepEquals(a, b) {
|
|
|
1376
1270
|
let i, length, key;
|
|
1377
1271
|
if (arrA && arrB) {
|
|
1378
1272
|
length = a.length;
|
|
1379
|
-
if (length
|
|
1273
|
+
if (length !== b.length)
|
|
1380
1274
|
return false;
|
|
1381
|
-
for (i = length; i-- !== 0; )
|
|
1275
|
+
for (i = length; i-- !== 0; ) {
|
|
1382
1276
|
if (!deepEquals(a[i], b[i]))
|
|
1383
1277
|
return false;
|
|
1278
|
+
}
|
|
1384
1279
|
return true;
|
|
1385
1280
|
}
|
|
1386
|
-
if (arrA
|
|
1281
|
+
if (arrA !== arrB)
|
|
1387
1282
|
return false;
|
|
1388
|
-
const dateA = a instanceof Date
|
|
1389
|
-
|
|
1283
|
+
const dateA = a instanceof Date;
|
|
1284
|
+
const dateB = b instanceof Date;
|
|
1285
|
+
if (dateA !== dateB)
|
|
1390
1286
|
return false;
|
|
1391
1287
|
if (dateA && dateB)
|
|
1392
|
-
return a.getTime()
|
|
1393
|
-
const regexpA = a instanceof RegExp
|
|
1394
|
-
|
|
1288
|
+
return a.getTime() === b.getTime();
|
|
1289
|
+
const regexpA = a instanceof RegExp;
|
|
1290
|
+
const regexpB = b instanceof RegExp;
|
|
1291
|
+
if (regexpA !== regexpB)
|
|
1395
1292
|
return false;
|
|
1396
1293
|
if (regexpA && regexpB)
|
|
1397
|
-
return a.toString()
|
|
1294
|
+
return a.toString() === b.toString();
|
|
1398
1295
|
const keys = Object.keys(a);
|
|
1399
1296
|
length = keys.length;
|
|
1400
1297
|
if (length !== Object.keys(b).length)
|
|
1401
1298
|
return false;
|
|
1402
|
-
for (i = length; i-- !== 0; )
|
|
1299
|
+
for (i = length; i-- !== 0; ) {
|
|
1403
1300
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
1404
1301
|
return false;
|
|
1302
|
+
}
|
|
1405
1303
|
for (i = length; i-- !== 0; ) {
|
|
1406
1304
|
key = keys[i];
|
|
1407
1305
|
if (!deepEquals(a[key], b[key]))
|
|
@@ -1409,11 +1307,11 @@ function deepEquals(a, b) {
|
|
|
1409
1307
|
}
|
|
1410
1308
|
return true;
|
|
1411
1309
|
}
|
|
1412
|
-
return a
|
|
1310
|
+
return Number.isNaN(a) && Number.isNaN(b);
|
|
1413
1311
|
}
|
|
1414
1312
|
function resolveFieldData(data, field) {
|
|
1415
1313
|
if (data && Object.keys(data).length && field) {
|
|
1416
|
-
if (field.
|
|
1314
|
+
if (!field.includes(".")) {
|
|
1417
1315
|
return data[field];
|
|
1418
1316
|
} else {
|
|
1419
1317
|
const fields = field.split(".");
|
|
@@ -1430,18 +1328,6 @@ function resolveFieldData(data, field) {
|
|
|
1430
1328
|
return null;
|
|
1431
1329
|
}
|
|
1432
1330
|
}
|
|
1433
|
-
function findIndexInList(value, list) {
|
|
1434
|
-
let index = -1;
|
|
1435
|
-
if (list) {
|
|
1436
|
-
for (let i = 0; i < list.length; i++) {
|
|
1437
|
-
if (equals(list[i], value)) {
|
|
1438
|
-
index = i;
|
|
1439
|
-
break;
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
return index;
|
|
1444
|
-
}
|
|
1445
1331
|
function contains(value, list) {
|
|
1446
1332
|
if (value != null && list && list.length) {
|
|
1447
1333
|
for (const val of list) {
|
|
@@ -1452,17 +1338,6 @@ function contains(value, list) {
|
|
|
1452
1338
|
}
|
|
1453
1339
|
return false;
|
|
1454
1340
|
}
|
|
1455
|
-
function isEmpty(value) {
|
|
1456
|
-
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
1457
|
-
}
|
|
1458
|
-
function removeFromList(value, list) {
|
|
1459
|
-
const indexElToRemove = findIndexInList(value, list);
|
|
1460
|
-
if (indexElToRemove > -1) {
|
|
1461
|
-
return list.filter((el, elIndex) => elIndex !== indexElToRemove);
|
|
1462
|
-
} else {
|
|
1463
|
-
return list;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
1341
|
function isString(value) {
|
|
1467
1342
|
return typeof value === "string" || value instanceof String;
|
|
1468
1343
|
}
|
|
@@ -1627,12 +1502,28 @@ const VvSelectProps = {
|
|
|
1627
1502
|
type: [String, Number, Boolean, Object, Array],
|
|
1628
1503
|
default: void 0
|
|
1629
1504
|
},
|
|
1505
|
+
/**
|
|
1506
|
+
* Select first option automatically
|
|
1507
|
+
*/
|
|
1508
|
+
autoselectFirst: {
|
|
1509
|
+
type: Boolean,
|
|
1510
|
+
default: false
|
|
1511
|
+
},
|
|
1630
1512
|
/**
|
|
1631
1513
|
* Select placeholder
|
|
1632
1514
|
*/
|
|
1633
1515
|
placeholder: String
|
|
1634
1516
|
};
|
|
1635
|
-
|
|
1517
|
+
function useVvSelectProps() {
|
|
1518
|
+
return {
|
|
1519
|
+
...VvSelectProps,
|
|
1520
|
+
options: {
|
|
1521
|
+
...VvSelectProps.options,
|
|
1522
|
+
type: Array,
|
|
1523
|
+
default: () => []
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1636
1527
|
function useDefaults(componentName, propsDefinition, props) {
|
|
1637
1528
|
const volver = useVolver();
|
|
1638
1529
|
const volverComponentDefaults = computed(() => {
|
|
@@ -1696,30 +1587,30 @@ function useComponentFocus(inputTemplateRef, emit) {
|
|
|
1696
1587
|
};
|
|
1697
1588
|
}
|
|
1698
1589
|
function useComponentIcon(icon, iconPosition) {
|
|
1590
|
+
const hasIcon = computed(() => {
|
|
1591
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1592
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
1593
|
+
}
|
|
1594
|
+
return icon == null ? void 0 : icon.value;
|
|
1595
|
+
});
|
|
1699
1596
|
const hasIconBefore = computed(
|
|
1700
|
-
() =>
|
|
1597
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
1701
1598
|
);
|
|
1702
1599
|
const hasIconAfter = computed(
|
|
1703
|
-
() =>
|
|
1600
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
1704
1601
|
);
|
|
1705
1602
|
const hasIconLeft = computed(
|
|
1706
|
-
() =>
|
|
1603
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
1707
1604
|
);
|
|
1708
1605
|
const hasIconRight = computed(
|
|
1709
|
-
() =>
|
|
1606
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
1710
1607
|
);
|
|
1711
1608
|
const hasIconTop = computed(
|
|
1712
|
-
() =>
|
|
1609
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
1713
1610
|
);
|
|
1714
1611
|
const hasIconBottom = computed(
|
|
1715
|
-
() =>
|
|
1612
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
1716
1613
|
);
|
|
1717
|
-
const hasIcon = computed(() => {
|
|
1718
|
-
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1719
|
-
return { name: icon == null ? void 0 : icon.value };
|
|
1720
|
-
}
|
|
1721
|
-
return icon == null ? void 0 : icon.value;
|
|
1722
|
-
});
|
|
1723
1614
|
return {
|
|
1724
1615
|
hasIcon,
|
|
1725
1616
|
hasIconLeft,
|
|
@@ -1733,26 +1624,42 @@ function useComponentIcon(icon, iconPosition) {
|
|
|
1733
1624
|
function useOptions(props) {
|
|
1734
1625
|
const { options, labelKey, valueKey, disabledKey } = toRefs(props);
|
|
1735
1626
|
const getOptionLabel = (option) => {
|
|
1736
|
-
if (typeof option
|
|
1627
|
+
if (typeof option === "string") {
|
|
1737
1628
|
return option;
|
|
1629
|
+
}
|
|
1630
|
+
if (typeof labelKey.value === "function") {
|
|
1631
|
+
return labelKey.value(option);
|
|
1632
|
+
}
|
|
1738
1633
|
return String(
|
|
1739
|
-
|
|
1634
|
+
labelKey.value ? get(option, labelKey.value) : option
|
|
1740
1635
|
);
|
|
1741
1636
|
};
|
|
1742
1637
|
const getOptionValue = (option) => {
|
|
1743
|
-
if (typeof option
|
|
1638
|
+
if (typeof option === "string") {
|
|
1744
1639
|
return option;
|
|
1745
|
-
|
|
1640
|
+
}
|
|
1641
|
+
if (typeof valueKey.value === "function") {
|
|
1642
|
+
return valueKey.value(option);
|
|
1643
|
+
}
|
|
1644
|
+
return valueKey.value ? get(option, valueKey.value) : option;
|
|
1746
1645
|
};
|
|
1747
1646
|
const isOptionDisabled = (option) => {
|
|
1748
|
-
if (typeof option
|
|
1647
|
+
if (typeof option === "string") {
|
|
1749
1648
|
return false;
|
|
1750
|
-
|
|
1649
|
+
}
|
|
1650
|
+
if (typeof disabledKey.value === "function") {
|
|
1651
|
+
return disabledKey.value(option);
|
|
1652
|
+
}
|
|
1653
|
+
return disabledKey.value ? get(option, disabledKey.value) : false;
|
|
1751
1654
|
};
|
|
1752
1655
|
const getOptionGrouped = (option) => {
|
|
1753
|
-
if (typeof option
|
|
1656
|
+
if (typeof option == "string") {
|
|
1754
1657
|
return [];
|
|
1755
|
-
|
|
1658
|
+
}
|
|
1659
|
+
if (typeof option === "object" && option && "options" in option) {
|
|
1660
|
+
return option.options;
|
|
1661
|
+
}
|
|
1662
|
+
return [];
|
|
1756
1663
|
};
|
|
1757
1664
|
return {
|
|
1758
1665
|
options,
|
|
@@ -1783,23 +1690,33 @@ const __default__$4 = {
|
|
|
1783
1690
|
};
|
|
1784
1691
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1785
1692
|
...__default__$4,
|
|
1786
|
-
props:
|
|
1787
|
-
emits:
|
|
1788
|
-
setup(__props, { emit }) {
|
|
1693
|
+
props: useVvSelectProps(),
|
|
1694
|
+
emits: ["update:modelValue", "focus", "blur"],
|
|
1695
|
+
setup(__props, { emit: __emit }) {
|
|
1789
1696
|
const props = __props;
|
|
1697
|
+
const emit = __emit;
|
|
1790
1698
|
const slots = useSlots();
|
|
1699
|
+
const VvSelectProps2 = useVvSelectProps();
|
|
1791
1700
|
const propsDefaults = useDefaults(
|
|
1792
1701
|
"VvSelect",
|
|
1793
|
-
|
|
1702
|
+
VvSelectProps2,
|
|
1794
1703
|
props
|
|
1795
1704
|
);
|
|
1796
|
-
const
|
|
1705
|
+
const selectEl = ref();
|
|
1797
1706
|
const {
|
|
1798
1707
|
HintSlot,
|
|
1799
1708
|
hasHintLabelOrSlot,
|
|
1800
1709
|
hasInvalidLabelOrSlot,
|
|
1801
1710
|
hintSlotScope
|
|
1802
1711
|
} = HintSlotFactory(propsDefaults, slots);
|
|
1712
|
+
const { focused } = useComponentFocus(selectEl, emit);
|
|
1713
|
+
function isGroup(option) {
|
|
1714
|
+
var _a;
|
|
1715
|
+
if (typeof option === "string") {
|
|
1716
|
+
return false;
|
|
1717
|
+
}
|
|
1718
|
+
return (_a = option.options) == null ? void 0 : _a.length;
|
|
1719
|
+
}
|
|
1803
1720
|
const {
|
|
1804
1721
|
id,
|
|
1805
1722
|
modifiers,
|
|
@@ -1815,22 +1732,38 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1815
1732
|
} = toRefs(props);
|
|
1816
1733
|
const hasId = useUniqueId(id);
|
|
1817
1734
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
1818
|
-
const
|
|
1819
|
-
const
|
|
1735
|
+
const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
|
|
1736
|
+
const hasTabindex = computed(() => {
|
|
1737
|
+
return isDisabledOrReadonly.value ? -1 : props.tabindex;
|
|
1738
|
+
});
|
|
1739
|
+
const localModelValue = computed({
|
|
1740
|
+
get: () => {
|
|
1741
|
+
return props.modelValue;
|
|
1742
|
+
},
|
|
1743
|
+
set: (newValue) => {
|
|
1744
|
+
if (Array.isArray(newValue)) {
|
|
1745
|
+
newValue = newValue.filter((item) => item !== void 0);
|
|
1746
|
+
if (newValue.length === 0 && !props.unselectable) {
|
|
1747
|
+
selectEl.value.value = props.modelValue;
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
emit("update:modelValue", newValue);
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
const isDirty = computed(() => {
|
|
1755
|
+
if (Array.isArray(localModelValue.value)) {
|
|
1756
|
+
return localModelValue.value.length > 0;
|
|
1757
|
+
}
|
|
1758
|
+
return localModelValue.value !== void 0 && localModelValue.value !== null;
|
|
1759
|
+
});
|
|
1760
|
+
const isVisible = useElementVisibility(selectEl);
|
|
1820
1761
|
watch(isVisible, (newValue) => {
|
|
1821
1762
|
if (newValue && props.autofocus) {
|
|
1822
1763
|
focused.value = true;
|
|
1823
1764
|
}
|
|
1824
1765
|
});
|
|
1825
|
-
const {
|
|
1826
|
-
icon,
|
|
1827
|
-
iconPosition
|
|
1828
|
-
);
|
|
1829
|
-
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
1830
|
-
const isDisabled = computed(() => props.disabled || props.readonly);
|
|
1831
|
-
const hasTabindex = computed(() => {
|
|
1832
|
-
return isDisabled.value ? -1 : props.tabindex;
|
|
1833
|
-
});
|
|
1766
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
1834
1767
|
const isInvalid = computed(() => {
|
|
1835
1768
|
if (props.invalid === true) {
|
|
1836
1769
|
return true;
|
|
@@ -1844,28 +1777,44 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1844
1777
|
"vv-select",
|
|
1845
1778
|
modifiers,
|
|
1846
1779
|
computed(() => ({
|
|
1847
|
-
valid: valid.value,
|
|
1848
|
-
invalid: invalid.value,
|
|
1849
|
-
loading: loading.value,
|
|
1850
|
-
disabled: disabled.value,
|
|
1851
|
-
readonly: readonly.value,
|
|
1852
|
-
"icon-before": hasIconBefore.value,
|
|
1853
|
-
"icon-after": hasIconAfter.value,
|
|
1854
|
-
dirty: isDirty.value,
|
|
1855
|
-
focus: focused.value,
|
|
1856
|
-
floating: floating.value,
|
|
1857
|
-
multiple: multiple.value
|
|
1780
|
+
"valid": valid.value,
|
|
1781
|
+
"invalid": invalid.value,
|
|
1782
|
+
"loading": loading.value,
|
|
1783
|
+
"disabled": disabled.value,
|
|
1784
|
+
"readonly": readonly.value,
|
|
1785
|
+
"icon-before": hasIconBefore.value !== void 0,
|
|
1786
|
+
"icon-after": hasIconAfter.value !== void 0,
|
|
1787
|
+
"dirty": isDirty.value,
|
|
1788
|
+
"focus": focused.value,
|
|
1789
|
+
"floating": floating.value,
|
|
1790
|
+
"multiple": multiple.value
|
|
1858
1791
|
}))
|
|
1859
1792
|
);
|
|
1793
|
+
const {
|
|
1794
|
+
getOptionLabel,
|
|
1795
|
+
getOptionValue,
|
|
1796
|
+
isOptionDisabled,
|
|
1797
|
+
getOptionGrouped
|
|
1798
|
+
} = useOptions(props);
|
|
1799
|
+
watch(
|
|
1800
|
+
() => props.options,
|
|
1801
|
+
(newValue) => {
|
|
1802
|
+
if ((newValue == null ? void 0 : newValue.length) && props.autoselectFirst && !isDirty.value) {
|
|
1803
|
+
const firstOptionValue = getOptionValue(newValue[0]);
|
|
1804
|
+
localModelValue.value = props.multiple ? [firstOptionValue] : firstOptionValue;
|
|
1805
|
+
}
|
|
1806
|
+
},
|
|
1807
|
+
{ immediate: true }
|
|
1808
|
+
);
|
|
1860
1809
|
const hasAttrs = computed(() => {
|
|
1861
1810
|
return {
|
|
1862
|
-
name: props.name,
|
|
1863
|
-
tabindex: hasTabindex.value,
|
|
1864
|
-
disabled:
|
|
1865
|
-
required: props.required,
|
|
1866
|
-
size: props.size,
|
|
1867
|
-
autocomplete: props.autocomplete,
|
|
1868
|
-
multiple: props.multiple,
|
|
1811
|
+
"name": props.name,
|
|
1812
|
+
"tabindex": hasTabindex.value,
|
|
1813
|
+
"disabled": isDisabledOrReadonly.value,
|
|
1814
|
+
"required": props.required,
|
|
1815
|
+
"size": props.size,
|
|
1816
|
+
"autocomplete": props.autocomplete,
|
|
1817
|
+
"multiple": props.multiple,
|
|
1869
1818
|
"aria-invalid": isInvalid.value,
|
|
1870
1819
|
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
1871
1820
|
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
@@ -1876,124 +1825,136 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1876
1825
|
invalid: props.invalid,
|
|
1877
1826
|
modelValue: props.modelValue
|
|
1878
1827
|
}));
|
|
1879
|
-
const {
|
|
1880
|
-
getOptionLabel,
|
|
1881
|
-
getOptionValue,
|
|
1882
|
-
isOptionDisabled,
|
|
1883
|
-
getOptionGrouped
|
|
1884
|
-
} = useOptions(props);
|
|
1885
|
-
const localModelValue = computed({
|
|
1886
|
-
get: () => {
|
|
1887
|
-
return props.modelValue;
|
|
1888
|
-
},
|
|
1889
|
-
set: (newValue) => {
|
|
1890
|
-
if (Array.isArray(newValue)) {
|
|
1891
|
-
newValue = newValue.filter((item) => item !== void 0);
|
|
1892
|
-
}
|
|
1893
|
-
emit("update:modelValue", newValue);
|
|
1894
|
-
}
|
|
1895
|
-
});
|
|
1896
|
-
const isGroup = (option) => {
|
|
1897
|
-
if (typeof option === "string")
|
|
1898
|
-
return false;
|
|
1899
|
-
return option && option.options && option.options.length > 0;
|
|
1900
|
-
};
|
|
1901
1828
|
return (_ctx, _cache) => {
|
|
1902
|
-
return openBlock(), createElementBlock(
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1829
|
+
return openBlock(), createElementBlock(
|
|
1830
|
+
"div",
|
|
1831
|
+
{
|
|
1832
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1833
|
+
},
|
|
1834
|
+
[
|
|
1835
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
1836
|
+
key: 0,
|
|
1837
|
+
for: unref(hasId)
|
|
1838
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1$2)) : createCommentVNode("v-if", true),
|
|
1839
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
1840
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
1841
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1842
|
+
])) : createCommentVNode("v-if", true),
|
|
1843
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
1844
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
1845
|
+
_sfc_main$9,
|
|
1846
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
|
|
1847
|
+
null,
|
|
1848
|
+
16
|
|
1849
|
+
/* FULL_PROPS */
|
|
1850
|
+
)) : createCommentVNode("v-if", true),
|
|
1851
|
+
withDirectives(createElementVNode("select", mergeProps({
|
|
1852
|
+
id: unref(hasId),
|
|
1853
|
+
ref_key: "selectEl",
|
|
1854
|
+
ref: selectEl
|
|
1855
|
+
}, unref(hasAttrs), {
|
|
1856
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
1857
|
+
}), [
|
|
1858
|
+
_ctx.placeholder ? (openBlock(), createElementBlock("option", {
|
|
1859
|
+
key: 0,
|
|
1860
|
+
value: void 0,
|
|
1861
|
+
disabled: !_ctx.unselectable,
|
|
1862
|
+
hidden: !_ctx.unselectable
|
|
1863
|
+
}, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("v-if", true),
|
|
1864
|
+
(openBlock(true), createElementBlock(
|
|
1865
|
+
Fragment,
|
|
1866
|
+
null,
|
|
1867
|
+
renderList(_ctx.options, (option, index) => {
|
|
1868
|
+
return openBlock(), createElementBlock(
|
|
1869
|
+
Fragment,
|
|
1870
|
+
null,
|
|
1871
|
+
[
|
|
1872
|
+
!isGroup(option) ? (openBlock(), createElementBlock("option", {
|
|
1873
|
+
key: index,
|
|
1874
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1875
|
+
value: unref(getOptionValue)(option)
|
|
1876
|
+
}, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1)) : (openBlock(), createElementBlock("optgroup", {
|
|
1877
|
+
key: `group-${index}`,
|
|
1878
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1879
|
+
label: unref(getOptionLabel)(option)
|
|
1880
|
+
}, [
|
|
1881
|
+
(openBlock(true), createElementBlock(
|
|
1882
|
+
Fragment,
|
|
1883
|
+
null,
|
|
1884
|
+
renderList(unref(getOptionGrouped)(option), (item, i) => {
|
|
1885
|
+
return openBlock(), createElementBlock("option", {
|
|
1886
|
+
key: `group-${index}-item-${i}`,
|
|
1887
|
+
disabled: unref(isOptionDisabled)(item),
|
|
1888
|
+
value: unref(getOptionValue)(item)
|
|
1889
|
+
}, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9$1);
|
|
1890
|
+
}),
|
|
1891
|
+
128
|
|
1892
|
+
/* KEYED_FRAGMENT */
|
|
1893
|
+
))
|
|
1894
|
+
], 8, _hoisted_8$1))
|
|
1895
|
+
],
|
|
1896
|
+
64
|
|
1897
|
+
/* STABLE_FRAGMENT */
|
|
1898
|
+
);
|
|
1899
|
+
}),
|
|
1900
|
+
256
|
|
1901
|
+
/* UNKEYED_FRAGMENT */
|
|
1902
|
+
))
|
|
1903
|
+
], 16, _hoisted_5$1), [
|
|
1904
|
+
[vModelSelect, unref(localModelValue)]
|
|
1905
|
+
]),
|
|
1906
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
1907
|
+
_sfc_main$9,
|
|
1908
|
+
mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
|
|
1909
|
+
null,
|
|
1910
|
+
16
|
|
1911
|
+
/* FULL_PROPS */
|
|
1912
|
+
)) : createCommentVNode("v-if", true)
|
|
1953
1913
|
]),
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
1914
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
1915
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1916
|
+
])) : createCommentVNode("v-if", true)
|
|
1958
1917
|
]),
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
]
|
|
1996
|
-
|
|
1918
|
+
createVNode(unref(HintSlot), {
|
|
1919
|
+
id: unref(hasHintId),
|
|
1920
|
+
class: "vv-select__hint"
|
|
1921
|
+
}, createSlots({
|
|
1922
|
+
_: 2
|
|
1923
|
+
/* DYNAMIC */
|
|
1924
|
+
}, [
|
|
1925
|
+
_ctx.$slots.hint ? {
|
|
1926
|
+
name: "hint",
|
|
1927
|
+
fn: withCtx(() => [
|
|
1928
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1929
|
+
]),
|
|
1930
|
+
key: "0"
|
|
1931
|
+
} : void 0,
|
|
1932
|
+
_ctx.$slots.loading ? {
|
|
1933
|
+
name: "loading",
|
|
1934
|
+
fn: withCtx(() => [
|
|
1935
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1936
|
+
]),
|
|
1937
|
+
key: "1"
|
|
1938
|
+
} : void 0,
|
|
1939
|
+
_ctx.$slots.valid ? {
|
|
1940
|
+
name: "valid",
|
|
1941
|
+
fn: withCtx(() => [
|
|
1942
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1943
|
+
]),
|
|
1944
|
+
key: "2"
|
|
1945
|
+
} : void 0,
|
|
1946
|
+
_ctx.$slots.invalid ? {
|
|
1947
|
+
name: "invalid",
|
|
1948
|
+
fn: withCtx(() => [
|
|
1949
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1950
|
+
]),
|
|
1951
|
+
key: "3"
|
|
1952
|
+
} : void 0
|
|
1953
|
+
]), 1032, ["id"])
|
|
1954
|
+
],
|
|
1955
|
+
2
|
|
1956
|
+
/* CLASS */
|
|
1957
|
+
);
|
|
1997
1958
|
};
|
|
1998
1959
|
}
|
|
1999
1960
|
});
|
|
@@ -2012,14 +1973,23 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2012
1973
|
const { modifiers } = toRefs(props);
|
|
2013
1974
|
const bemCssClasses = useModifiers("vv-badge", modifiers);
|
|
2014
1975
|
return (_ctx, _cache) => {
|
|
2015
|
-
return openBlock(), createElementBlock(
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
1976
|
+
return openBlock(), createElementBlock(
|
|
1977
|
+
"span",
|
|
1978
|
+
{
|
|
1979
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1980
|
+
},
|
|
1981
|
+
[
|
|
1982
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1983
|
+
createTextVNode(
|
|
1984
|
+
toDisplayString(_ctx.value),
|
|
1985
|
+
1
|
|
1986
|
+
/* TEXT */
|
|
1987
|
+
)
|
|
1988
|
+
])
|
|
1989
|
+
],
|
|
1990
|
+
2
|
|
1991
|
+
/* CLASS */
|
|
1992
|
+
);
|
|
2023
1993
|
};
|
|
2024
1994
|
}
|
|
2025
1995
|
});
|
|
@@ -2032,8 +2002,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2032
2002
|
...__default__$2,
|
|
2033
2003
|
props: VvActionProps,
|
|
2034
2004
|
emits: VvActionEvents,
|
|
2035
|
-
setup(__props, { expose: __expose, emit }) {
|
|
2005
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2036
2006
|
const props = __props;
|
|
2007
|
+
const emit = __emit;
|
|
2008
|
+
const instance = getCurrentInstance();
|
|
2037
2009
|
const volver = useVolver();
|
|
2038
2010
|
const element = ref(null);
|
|
2039
2011
|
__expose({ $el: element });
|
|
@@ -2064,7 +2036,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2064
2036
|
case props.href !== void 0:
|
|
2065
2037
|
return ActionTag.a;
|
|
2066
2038
|
default:
|
|
2067
|
-
return
|
|
2039
|
+
return props.defaultTag;
|
|
2068
2040
|
}
|
|
2069
2041
|
});
|
|
2070
2042
|
const hasProps = computed(() => {
|
|
@@ -2089,30 +2061,44 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2089
2061
|
to: props.to,
|
|
2090
2062
|
target: props.target
|
|
2091
2063
|
};
|
|
2092
|
-
|
|
2064
|
+
case ActionTag.button:
|
|
2093
2065
|
return {
|
|
2094
2066
|
...toReturn,
|
|
2095
2067
|
type: props.type,
|
|
2096
2068
|
disabled: props.disabled
|
|
2097
2069
|
};
|
|
2070
|
+
default:
|
|
2071
|
+
return toReturn;
|
|
2098
2072
|
}
|
|
2099
2073
|
});
|
|
2100
|
-
|
|
2074
|
+
function onClick(e) {
|
|
2075
|
+
var _a;
|
|
2101
2076
|
if (props.disabled) {
|
|
2102
2077
|
e.preventDefault();
|
|
2103
2078
|
return;
|
|
2104
2079
|
}
|
|
2080
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
|
|
2081
|
+
emit("click", e);
|
|
2082
|
+
return;
|
|
2083
|
+
}
|
|
2105
2084
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2085
|
+
}
|
|
2086
|
+
function onMouseover(e) {
|
|
2087
|
+
var _a;
|
|
2088
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
2089
|
+
emit("mouseover", e);
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2109
2092
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2093
|
+
}
|
|
2094
|
+
function onMouseleave(e) {
|
|
2095
|
+
var _a;
|
|
2096
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
2097
|
+
emit("mouseleave", e);
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2113
2100
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
|
|
2114
|
-
|
|
2115
|
-
};
|
|
2101
|
+
}
|
|
2116
2102
|
return (_ctx, _cache) => {
|
|
2117
2103
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
2118
2104
|
ref_key: "element",
|
|
@@ -2129,23 +2115,28 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2129
2115
|
}), {
|
|
2130
2116
|
default: withCtx(() => [
|
|
2131
2117
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2132
|
-
createTextVNode(
|
|
2118
|
+
createTextVNode(
|
|
2119
|
+
toDisplayString(_ctx.label),
|
|
2120
|
+
1
|
|
2121
|
+
/* TEXT */
|
|
2122
|
+
)
|
|
2133
2123
|
])
|
|
2134
2124
|
]),
|
|
2135
2125
|
_: 3
|
|
2126
|
+
/* FORWARDED */
|
|
2136
2127
|
}, 16, ["class"]);
|
|
2137
2128
|
};
|
|
2138
2129
|
}
|
|
2139
2130
|
});
|
|
2140
2131
|
function useInjectedGroupState(groupKey) {
|
|
2141
2132
|
const group = inject(groupKey, void 0);
|
|
2142
|
-
const isInGroup = computed(() =>
|
|
2133
|
+
const isInGroup = computed(() => group !== void 0);
|
|
2143
2134
|
function getGroupOrLocalRef(propName, props, emit) {
|
|
2144
|
-
|
|
2145
|
-
|
|
2135
|
+
const groupPropValue = group == null ? void 0 : group[propName];
|
|
2136
|
+
if (groupPropValue) {
|
|
2146
2137
|
return computed({
|
|
2147
2138
|
get() {
|
|
2148
|
-
return groupPropValue
|
|
2139
|
+
return groupPropValue.value;
|
|
2149
2140
|
},
|
|
2150
2141
|
set(value) {
|
|
2151
2142
|
groupPropValue.value = value;
|
|
@@ -2158,8 +2149,9 @@ function useInjectedGroupState(groupKey) {
|
|
|
2158
2149
|
return propRef.value;
|
|
2159
2150
|
},
|
|
2160
2151
|
set(value) {
|
|
2161
|
-
if (emit)
|
|
2152
|
+
if (emit) {
|
|
2162
2153
|
emit(`update:${propName}`, value);
|
|
2154
|
+
}
|
|
2163
2155
|
}
|
|
2164
2156
|
});
|
|
2165
2157
|
}
|
|
@@ -2176,10 +2168,7 @@ const VvButtonProps = {
|
|
|
2176
2168
|
...ModifiersProps,
|
|
2177
2169
|
...UnselectableProps,
|
|
2178
2170
|
...LoadingProps,
|
|
2179
|
-
|
|
2180
|
-
* Button icon
|
|
2181
|
-
*/
|
|
2182
|
-
icon: [String, Object],
|
|
2171
|
+
...IconProps,
|
|
2183
2172
|
/**
|
|
2184
2173
|
* Button icon position
|
|
2185
2174
|
*/
|
|
@@ -2226,14 +2215,11 @@ function useGroupProps(props, emit) {
|
|
|
2226
2215
|
const { id, iconPosition, icon, label, pressed } = toRefs(props);
|
|
2227
2216
|
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
2228
2217
|
const toggle = getGroupOrLocalRef("toggle", props);
|
|
2229
|
-
const unselectable = getGroupOrLocalRef(
|
|
2230
|
-
|
|
2231
|
-
props
|
|
2232
|
-
);
|
|
2233
|
-
const multiple = computed(() => (group == null ? void 0 : group.value.multiple.value) ?? false);
|
|
2218
|
+
const unselectable = getGroupOrLocalRef("unselectable", props);
|
|
2219
|
+
const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
|
|
2234
2220
|
const modifiers = computed(() => {
|
|
2235
2221
|
let localModifiers = props.modifiers;
|
|
2236
|
-
let groupModifiers = group == null ? void 0 : group.
|
|
2222
|
+
let groupModifiers = group == null ? void 0 : group.modifiers.value;
|
|
2237
2223
|
const toReturn = /* @__PURE__ */ new Set();
|
|
2238
2224
|
if (localModifiers) {
|
|
2239
2225
|
if (!Array.isArray(localModifiers)) {
|
|
@@ -2250,10 +2236,7 @@ function useGroupProps(props, emit) {
|
|
|
2250
2236
|
return Array.from(toReturn);
|
|
2251
2237
|
});
|
|
2252
2238
|
const disabled = computed(
|
|
2253
|
-
() =>
|
|
2254
|
-
var _a;
|
|
2255
|
-
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
2256
|
-
}
|
|
2239
|
+
() => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
|
|
2257
2240
|
);
|
|
2258
2241
|
return {
|
|
2259
2242
|
// group props
|
|
@@ -2282,14 +2265,16 @@ const _hoisted_2$1 = {
|
|
|
2282
2265
|
class: "vv-button__label"
|
|
2283
2266
|
};
|
|
2284
2267
|
const __default__$1 = {
|
|
2285
|
-
name: "VvButton"
|
|
2268
|
+
name: "VvButton",
|
|
2269
|
+
inheritAttrs: false
|
|
2286
2270
|
};
|
|
2287
2271
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2288
2272
|
...__default__$1,
|
|
2289
2273
|
props: VvButtonProps,
|
|
2290
2274
|
emits: VvButtonEvents,
|
|
2291
|
-
setup(__props, { expose: __expose, emit }) {
|
|
2275
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2292
2276
|
const props = __props;
|
|
2277
|
+
const emit = __emit;
|
|
2293
2278
|
const attrs = useAttrs();
|
|
2294
2279
|
const slots = useSlots();
|
|
2295
2280
|
const {
|
|
@@ -2324,10 +2309,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2324
2309
|
"vv-button",
|
|
2325
2310
|
modifiers,
|
|
2326
2311
|
computed(() => ({
|
|
2327
|
-
reverse: [Side.right, Side.bottom].includes(
|
|
2312
|
+
"reverse": [Side.right, Side.bottom].includes(
|
|
2328
2313
|
iconPosition.value
|
|
2329
2314
|
),
|
|
2330
|
-
column: [Side.top, Side.bottom].includes(
|
|
2315
|
+
"column": [Side.top, Side.bottom].includes(
|
|
2331
2316
|
iconPosition.value
|
|
2332
2317
|
),
|
|
2333
2318
|
"icon-only": Boolean(
|
|
@@ -2335,13 +2320,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2335
2320
|
)
|
|
2336
2321
|
}))
|
|
2337
2322
|
);
|
|
2338
|
-
const
|
|
2339
|
-
() => typeof (icon == null ? void 0 : icon.value) === "string" ? { name: icon == null ? void 0 : icon.value } : icon == null ? void 0 : icon.value
|
|
2340
|
-
);
|
|
2323
|
+
const { hasIcon } = useComponentIcon(icon);
|
|
2341
2324
|
const toggleValue = computed(() => {
|
|
2342
2325
|
return props.value !== void 0 ? props.value : name.value;
|
|
2343
2326
|
});
|
|
2344
|
-
const
|
|
2327
|
+
const hasListeners = computed(() => {
|
|
2328
|
+
if (!toggle.value) {
|
|
2329
|
+
return void 0;
|
|
2330
|
+
}
|
|
2331
|
+
return {
|
|
2332
|
+
onClick
|
|
2333
|
+
};
|
|
2334
|
+
});
|
|
2335
|
+
function onClick() {
|
|
2345
2336
|
if (toggle.value) {
|
|
2346
2337
|
if (Array.isArray(modelValue.value)) {
|
|
2347
2338
|
if (contains(toggleValue.value, modelValue.value)) {
|
|
@@ -2361,9 +2352,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2361
2352
|
}
|
|
2362
2353
|
modelValue.value = toggleValue.value;
|
|
2363
2354
|
}
|
|
2364
|
-
}
|
|
2355
|
+
}
|
|
2365
2356
|
return (_ctx, _cache) => {
|
|
2366
2357
|
return openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
2358
|
+
...unref(attrs),
|
|
2359
|
+
...unref(hasListeners),
|
|
2367
2360
|
disabled: unref(disabled),
|
|
2368
2361
|
pressed: unref(pressed),
|
|
2369
2362
|
active: _ctx.active,
|
|
@@ -2377,8 +2370,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2377
2370
|
id: unref(hasId),
|
|
2378
2371
|
ref_key: "element",
|
|
2379
2372
|
ref: element,
|
|
2380
|
-
class: unref(bemCssClasses)
|
|
2381
|
-
onClick
|
|
2373
|
+
class: unref(bemCssClasses)
|
|
2382
2374
|
}), {
|
|
2383
2375
|
default: withCtx(() => [
|
|
2384
2376
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -2387,28 +2379,222 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2387
2379
|
key: 0,
|
|
2388
2380
|
class: "vv-button__loading-icon",
|
|
2389
2381
|
name: _ctx.loadingIcon
|
|
2390
|
-
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
2391
|
-
_ctx.loadingLabel ? (openBlock(), createElementBlock(
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2382
|
+
}, null, 8, ["name"])) : createCommentVNode("v-if", true),
|
|
2383
|
+
_ctx.loadingLabel ? (openBlock(), createElementBlock(
|
|
2384
|
+
"span",
|
|
2385
|
+
_hoisted_1$1,
|
|
2386
|
+
toDisplayString(_ctx.loadingLabel),
|
|
2387
|
+
1
|
|
2388
|
+
/* TEXT */
|
|
2389
|
+
)) : createCommentVNode("v-if", true)
|
|
2390
|
+
]) : (openBlock(), createElementBlock(
|
|
2391
|
+
Fragment,
|
|
2392
|
+
{ key: 1 },
|
|
2393
|
+
[
|
|
2394
|
+
renderSlot(_ctx.$slots, "before"),
|
|
2395
|
+
unref(hasIcon) ? (openBlock(), createBlock(
|
|
2396
|
+
_sfc_main$9,
|
|
2397
|
+
mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
|
|
2398
|
+
null,
|
|
2399
|
+
16
|
|
2400
|
+
/* FULL_PROPS */
|
|
2401
|
+
)) : createCommentVNode("v-if", true),
|
|
2402
|
+
unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
|
|
2403
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
2404
|
+
createTextVNode(
|
|
2405
|
+
toDisplayString(unref(label)),
|
|
2406
|
+
1
|
|
2407
|
+
/* TEXT */
|
|
2408
|
+
)
|
|
2409
|
+
])
|
|
2410
|
+
])) : createCommentVNode("v-if", true),
|
|
2411
|
+
renderSlot(_ctx.$slots, "after")
|
|
2412
|
+
],
|
|
2413
|
+
64
|
|
2414
|
+
/* STABLE_FRAGMENT */
|
|
2415
|
+
))
|
|
2405
2416
|
])
|
|
2406
2417
|
]),
|
|
2407
2418
|
_: 3
|
|
2419
|
+
/* FORWARDED */
|
|
2408
2420
|
}, 16, ["id", "class"]);
|
|
2409
2421
|
};
|
|
2410
2422
|
}
|
|
2411
2423
|
});
|
|
2424
|
+
const VvComboboxProps = {
|
|
2425
|
+
...IdNameProps,
|
|
2426
|
+
...TabindexProps,
|
|
2427
|
+
...ValidProps,
|
|
2428
|
+
...InvalidProps,
|
|
2429
|
+
...HintProps,
|
|
2430
|
+
...LoadingProps,
|
|
2431
|
+
...DisabledProps,
|
|
2432
|
+
...ReadonlyProps,
|
|
2433
|
+
...ModifiersProps,
|
|
2434
|
+
...OptionsProps,
|
|
2435
|
+
...IconProps,
|
|
2436
|
+
...FloatingLabelProps,
|
|
2437
|
+
...DropdownProps,
|
|
2438
|
+
...LabelProps,
|
|
2439
|
+
/**
|
|
2440
|
+
* Dropdown show / hide transition name
|
|
2441
|
+
*/
|
|
2442
|
+
transitionName: {
|
|
2443
|
+
type: String,
|
|
2444
|
+
default: "vv-dropdown--mobile-fade-block"
|
|
2445
|
+
},
|
|
2446
|
+
/**
|
|
2447
|
+
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
2448
|
+
*/
|
|
2449
|
+
modelValue: {
|
|
2450
|
+
type: [String, Number, Boolean, Object, Array],
|
|
2451
|
+
default: void 0
|
|
2452
|
+
},
|
|
2453
|
+
/**
|
|
2454
|
+
* Label for no search results
|
|
2455
|
+
*/
|
|
2456
|
+
noResultsLabel: { type: String, default: "No results" },
|
|
2457
|
+
/**
|
|
2458
|
+
* Label for no options available
|
|
2459
|
+
*/
|
|
2460
|
+
noOptionsLabel: { type: String, default: "No options available" },
|
|
2461
|
+
/**
|
|
2462
|
+
* Label for selected option hint
|
|
2463
|
+
*/
|
|
2464
|
+
selectedHintLabel: { type: String, default: "Selected" },
|
|
2465
|
+
/**
|
|
2466
|
+
* Label for deselect action button
|
|
2467
|
+
*/
|
|
2468
|
+
deselectActionLabel: { type: String, default: "Deselect" },
|
|
2469
|
+
/**
|
|
2470
|
+
* Label for select option hint
|
|
2471
|
+
*/
|
|
2472
|
+
selectHintLabel: { type: String, default: "Press enter to select" },
|
|
2473
|
+
/**
|
|
2474
|
+
* Label for deselected option hint
|
|
2475
|
+
*/
|
|
2476
|
+
deselectHintLabel: { type: String, default: "Press enter to remove" },
|
|
2477
|
+
/**
|
|
2478
|
+
* Label close button
|
|
2479
|
+
*/
|
|
2480
|
+
closeLabel: { type: String, default: "Close" },
|
|
2481
|
+
/**
|
|
2482
|
+
* Select input placeholder
|
|
2483
|
+
*/
|
|
2484
|
+
placeholder: String,
|
|
2485
|
+
/**
|
|
2486
|
+
* Use input text to search on options
|
|
2487
|
+
*/
|
|
2488
|
+
searchable: Boolean,
|
|
2489
|
+
/**
|
|
2490
|
+
* Search function to filter options
|
|
2491
|
+
*/
|
|
2492
|
+
searchFunction: {
|
|
2493
|
+
type: Function,
|
|
2494
|
+
default: void 0
|
|
2495
|
+
},
|
|
2496
|
+
/**
|
|
2497
|
+
* On searchable select is the input search placeholder
|
|
2498
|
+
*/
|
|
2499
|
+
searchPlaceholder: {
|
|
2500
|
+
type: String,
|
|
2501
|
+
default: "Search..."
|
|
2502
|
+
},
|
|
2503
|
+
/**
|
|
2504
|
+
* The input search debounce time in ms
|
|
2505
|
+
*/
|
|
2506
|
+
debounceSearch: {
|
|
2507
|
+
type: [Number, String],
|
|
2508
|
+
default: 0
|
|
2509
|
+
},
|
|
2510
|
+
/**
|
|
2511
|
+
* Manage modelValue as string[] or object[]
|
|
2512
|
+
*/
|
|
2513
|
+
multiple: Boolean,
|
|
2514
|
+
/**
|
|
2515
|
+
* The min number of selected values
|
|
2516
|
+
*/
|
|
2517
|
+
minValues: {
|
|
2518
|
+
type: [Number, String],
|
|
2519
|
+
default: 0
|
|
2520
|
+
},
|
|
2521
|
+
/**
|
|
2522
|
+
* The max number of selected values
|
|
2523
|
+
*/
|
|
2524
|
+
maxValues: [Number, String],
|
|
2525
|
+
/**
|
|
2526
|
+
* If true the input will be unselectable
|
|
2527
|
+
* @deprecated use minValues instead
|
|
2528
|
+
*/
|
|
2529
|
+
unselectable: { type: Boolean, default: true },
|
|
2530
|
+
/**
|
|
2531
|
+
* The select label separator visible to the user
|
|
2532
|
+
*/
|
|
2533
|
+
separator: { type: String, default: ", " },
|
|
2534
|
+
/**
|
|
2535
|
+
* Show native select
|
|
2536
|
+
*/
|
|
2537
|
+
native: Boolean,
|
|
2538
|
+
/**
|
|
2539
|
+
* Show badges
|
|
2540
|
+
*/
|
|
2541
|
+
badges: Boolean,
|
|
2542
|
+
/**
|
|
2543
|
+
* Badge modifiers
|
|
2544
|
+
*/
|
|
2545
|
+
badgeModifiers: {
|
|
2546
|
+
type: [String, Array],
|
|
2547
|
+
default: "action sm"
|
|
2548
|
+
},
|
|
2549
|
+
/**
|
|
2550
|
+
* Set dropdown width to the same as the trigger
|
|
2551
|
+
*/
|
|
2552
|
+
triggerWidth: {
|
|
2553
|
+
...DropdownProps.triggerWidth,
|
|
2554
|
+
default: true
|
|
2555
|
+
},
|
|
2556
|
+
/**
|
|
2557
|
+
* Dropdown modifiers
|
|
2558
|
+
*/
|
|
2559
|
+
dropdownModifiers: {
|
|
2560
|
+
type: [String, Array],
|
|
2561
|
+
default: "mobile"
|
|
2562
|
+
},
|
|
2563
|
+
/**
|
|
2564
|
+
* Open dropdown on focus
|
|
2565
|
+
*/
|
|
2566
|
+
autoOpen: {
|
|
2567
|
+
type: Boolean,
|
|
2568
|
+
default: false
|
|
2569
|
+
},
|
|
2570
|
+
/**
|
|
2571
|
+
* Select first option automatically
|
|
2572
|
+
*/
|
|
2573
|
+
autoselectFirst: {
|
|
2574
|
+
type: Boolean,
|
|
2575
|
+
default: false
|
|
2576
|
+
},
|
|
2577
|
+
/**
|
|
2578
|
+
* Keep open dropdown on single select
|
|
2579
|
+
*/
|
|
2580
|
+
keepOpen: {
|
|
2581
|
+
type: Boolean,
|
|
2582
|
+
default: false
|
|
2583
|
+
}
|
|
2584
|
+
};
|
|
2585
|
+
function useVvComboboxProps() {
|
|
2586
|
+
return {
|
|
2587
|
+
...VvComboboxProps,
|
|
2588
|
+
options: {
|
|
2589
|
+
...VvComboboxProps.options,
|
|
2590
|
+
type: Array
|
|
2591
|
+
},
|
|
2592
|
+
searchFunction: {
|
|
2593
|
+
...VvComboboxProps.searchFunction,
|
|
2594
|
+
type: Function
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
}
|
|
2412
2598
|
const _hoisted_1 = ["id"];
|
|
2413
2599
|
const _hoisted_2 = ["id", "for"];
|
|
2414
2600
|
const _hoisted_3 = ["id", "aria-controls", "placeholder"];
|
|
@@ -2417,7 +2603,7 @@ const _hoisted_4 = {
|
|
|
2417
2603
|
class: "vv-select__input-before"
|
|
2418
2604
|
};
|
|
2419
2605
|
const _hoisted_5 = { class: "vv-select__inner" };
|
|
2420
|
-
const _hoisted_6 = ["aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2606
|
+
const _hoisted_6 = ["aria-controls", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2421
2607
|
const _hoisted_7 = {
|
|
2422
2608
|
key: 0,
|
|
2423
2609
|
class: "vv-select__value"
|
|
@@ -2438,31 +2624,28 @@ const __default__ = {
|
|
|
2438
2624
|
};
|
|
2439
2625
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2440
2626
|
...__default__,
|
|
2441
|
-
props:
|
|
2442
|
-
emits:
|
|
2443
|
-
setup(__props, { emit }) {
|
|
2627
|
+
props: useVvComboboxProps(),
|
|
2628
|
+
emits: ["update:modelValue", "update:search", "change:search", "focus", "blur"],
|
|
2629
|
+
setup(__props, { emit: __emit }) {
|
|
2444
2630
|
const props = __props;
|
|
2631
|
+
const emit = __emit;
|
|
2445
2632
|
const slots = useSlots();
|
|
2633
|
+
const VvComboboxProps2 = useVvComboboxProps();
|
|
2446
2634
|
const propsDefaults = useDefaults(
|
|
2447
2635
|
"VvCombobox",
|
|
2448
|
-
|
|
2636
|
+
VvComboboxProps2,
|
|
2449
2637
|
props
|
|
2450
2638
|
);
|
|
2451
|
-
const
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
return option.options && option.options.length > 0;
|
|
2456
|
-
};
|
|
2639
|
+
const inputEl = ref(null);
|
|
2640
|
+
const inputSearchEl = ref(null);
|
|
2641
|
+
const wrapperEl = ref(null);
|
|
2642
|
+
const dropdownEl = ref(null);
|
|
2457
2643
|
const {
|
|
2458
2644
|
HintSlot,
|
|
2459
2645
|
hasHintLabelOrSlot,
|
|
2460
2646
|
hasInvalidLabelOrSlot,
|
|
2461
2647
|
hintSlotScope
|
|
2462
2648
|
} = HintSlotFactory(propsDefaults, slots);
|
|
2463
|
-
const inputEl = ref(null);
|
|
2464
|
-
const inputSearchEl = ref(null);
|
|
2465
|
-
const wrapperEl = ref(null);
|
|
2466
2649
|
const { focused } = useComponentFocus(inputEl, emit);
|
|
2467
2650
|
const { focused: focusedWithin } = useFocusWithin(wrapperEl);
|
|
2468
2651
|
watch(focused, (newValue) => {
|
|
@@ -2487,27 +2670,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2487
2670
|
searchText,
|
|
2488
2671
|
computed(() => Number(props.debounceSearch))
|
|
2489
2672
|
);
|
|
2490
|
-
watch(
|
|
2491
|
-
debouncedSearchText
|
|
2492
|
-
|
|
2493
|
-
);
|
|
2673
|
+
watch(debouncedSearchText, () => {
|
|
2674
|
+
emit("update:search", debouncedSearchText.value);
|
|
2675
|
+
emit("change:search", debouncedSearchText.value);
|
|
2676
|
+
});
|
|
2494
2677
|
const expanded = ref(false);
|
|
2495
|
-
|
|
2496
|
-
if (
|
|
2678
|
+
function toggleExpanded() {
|
|
2679
|
+
if (isDisabledOrReadonly.value)
|
|
2497
2680
|
return;
|
|
2498
2681
|
expanded.value = !expanded.value;
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
if (
|
|
2682
|
+
}
|
|
2683
|
+
function expand() {
|
|
2684
|
+
if (isDisabledOrReadonly.value || expanded.value)
|
|
2502
2685
|
return;
|
|
2503
2686
|
expanded.value = true;
|
|
2504
|
-
}
|
|
2505
|
-
|
|
2506
|
-
if (
|
|
2687
|
+
}
|
|
2688
|
+
function collapse() {
|
|
2689
|
+
if (isDisabledOrReadonly.value || !expanded.value)
|
|
2507
2690
|
return;
|
|
2508
2691
|
expanded.value = false;
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2692
|
+
}
|
|
2693
|
+
function onAfterExpand() {
|
|
2511
2694
|
if (propsDefaults.value.searchable) {
|
|
2512
2695
|
if (inputSearchEl.value) {
|
|
2513
2696
|
inputSearchEl.value.focus({
|
|
@@ -2515,12 +2698,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2515
2698
|
});
|
|
2516
2699
|
}
|
|
2517
2700
|
}
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2701
|
+
}
|
|
2702
|
+
function onAfterCollapse() {
|
|
2520
2703
|
if (propsDefaults.value.searchable) {
|
|
2521
2704
|
searchText.value = "";
|
|
2522
2705
|
}
|
|
2523
|
-
}
|
|
2706
|
+
}
|
|
2707
|
+
function isGroup(option) {
|
|
2708
|
+
var _a;
|
|
2709
|
+
if (typeof option === "string") {
|
|
2710
|
+
return false;
|
|
2711
|
+
}
|
|
2712
|
+
return (_a = option.options) == null ? void 0 : _a.length;
|
|
2713
|
+
}
|
|
2524
2714
|
const {
|
|
2525
2715
|
id,
|
|
2526
2716
|
icon,
|
|
@@ -2538,32 +2728,68 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2538
2728
|
const hasDropdownId = computed(() => `${hasId.value}-dropdown`);
|
|
2539
2729
|
const hasSearchId = computed(() => `${hasId.value}-search`);
|
|
2540
2730
|
const hasLabelId = computed(() => `${hasId.value}-label`);
|
|
2541
|
-
const
|
|
2542
|
-
const isLoading = computed(() => localLoading.value || loading.value);
|
|
2543
|
-
const dropdownEl = ref();
|
|
2544
|
-
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
2545
|
-
icon,
|
|
2546
|
-
iconPosition
|
|
2547
|
-
);
|
|
2548
|
-
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
2731
|
+
const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
|
|
2549
2732
|
const hasTabindex = computed(() => {
|
|
2550
|
-
return
|
|
2733
|
+
return isDisabledOrReadonly.value ? -1 : props.tabindex;
|
|
2734
|
+
});
|
|
2735
|
+
const localModelValue = computed({
|
|
2736
|
+
get: () => {
|
|
2737
|
+
if (Array.isArray(props.modelValue)) {
|
|
2738
|
+
return new Set(props.modelValue);
|
|
2739
|
+
}
|
|
2740
|
+
return props.modelValue !== void 0 && props.modelValue !== null ? /* @__PURE__ */ new Set([props.modelValue]) : /* @__PURE__ */ new Set();
|
|
2741
|
+
},
|
|
2742
|
+
set: (value) => {
|
|
2743
|
+
emit("update:modelValue", props.multiple ? [...value] : [...value].pop());
|
|
2744
|
+
}
|
|
2745
|
+
});
|
|
2746
|
+
const sizeOfModelValue = computed(() => localModelValue.value.size);
|
|
2747
|
+
const isDirty = computed(() => sizeOfModelValue.value > 0);
|
|
2748
|
+
const hasMaxValues = computed(() => {
|
|
2749
|
+
if (!props.multiple) {
|
|
2750
|
+
return 1;
|
|
2751
|
+
}
|
|
2752
|
+
if (props.maxValues === void 0) {
|
|
2753
|
+
return Infinity;
|
|
2754
|
+
}
|
|
2755
|
+
return Number(props.maxValues);
|
|
2756
|
+
});
|
|
2757
|
+
const isUnselectable = computed(() => {
|
|
2758
|
+
if (isDisabledOrReadonly.value) {
|
|
2759
|
+
return false;
|
|
2760
|
+
}
|
|
2761
|
+
if (!props.unselectable) {
|
|
2762
|
+
return false;
|
|
2763
|
+
}
|
|
2764
|
+
return sizeOfModelValue.value > Number(props.minValues);
|
|
2765
|
+
});
|
|
2766
|
+
const isSelectable = computed(() => {
|
|
2767
|
+
if (isDisabledOrReadonly.value) {
|
|
2768
|
+
return false;
|
|
2769
|
+
}
|
|
2770
|
+
if (!props.multiple) {
|
|
2771
|
+
return true;
|
|
2772
|
+
}
|
|
2773
|
+
return sizeOfModelValue.value < hasMaxValues.value;
|
|
2551
2774
|
});
|
|
2775
|
+
const localLoading = ref(false);
|
|
2776
|
+
const isLoading = computed(() => localLoading.value || loading.value);
|
|
2777
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
2552
2778
|
const bemCssClasses = useModifiers(
|
|
2553
2779
|
"vv-select",
|
|
2554
2780
|
modifiers,
|
|
2555
2781
|
computed(() => ({
|
|
2556
|
-
disabled: disabled.value,
|
|
2557
|
-
loading: isLoading.value,
|
|
2558
|
-
readonly: readonly.value,
|
|
2559
|
-
"icon-before":
|
|
2560
|
-
"icon-after":
|
|
2561
|
-
valid: valid.value,
|
|
2562
|
-
invalid: invalid.value,
|
|
2563
|
-
dirty: isDirty.value,
|
|
2564
|
-
focus: focused.value,
|
|
2565
|
-
floating: floating.value,
|
|
2566
|
-
badges: props.badges
|
|
2782
|
+
"disabled": disabled.value,
|
|
2783
|
+
"loading": isLoading.value,
|
|
2784
|
+
"readonly": readonly.value,
|
|
2785
|
+
"icon-before": hasIconBefore.value !== void 0,
|
|
2786
|
+
"icon-after": hasIconAfter.value !== void 0,
|
|
2787
|
+
"valid": valid.value,
|
|
2788
|
+
"invalid": invalid.value,
|
|
2789
|
+
"dirty": isDirty.value,
|
|
2790
|
+
"focus": focused.value || focusedWithin.value || expanded.value,
|
|
2791
|
+
"floating": floating.value,
|
|
2792
|
+
"badges": props.badges
|
|
2567
2793
|
}))
|
|
2568
2794
|
);
|
|
2569
2795
|
const {
|
|
@@ -2572,6 +2798,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2572
2798
|
getOptionGrouped,
|
|
2573
2799
|
isOptionDisabled
|
|
2574
2800
|
} = useOptions(props);
|
|
2801
|
+
function isOptionDisabledOrNotSelectable(option) {
|
|
2802
|
+
return isOptionDisabled(option) || !isSelectable.value && !isOptionSelected(option);
|
|
2803
|
+
}
|
|
2575
2804
|
const filteredOptions = computedAsync(async () => {
|
|
2576
2805
|
var _a;
|
|
2577
2806
|
if (propsDefaults.value.searchFunction) {
|
|
@@ -2590,10 +2819,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2590
2819
|
});
|
|
2591
2820
|
});
|
|
2592
2821
|
function isOptionSelected(option) {
|
|
2593
|
-
|
|
2594
|
-
return contains(option, props.modelValue) || contains(getOptionValue(option), props.modelValue);
|
|
2595
|
-
}
|
|
2596
|
-
return equals(option, props.modelValue) || equals(getOptionValue(option), props.modelValue);
|
|
2822
|
+
return localModelValue.value.has(getOptionValue(option));
|
|
2597
2823
|
}
|
|
2598
2824
|
const selectedOptions = computed(() => {
|
|
2599
2825
|
const options = props.options.reduce(
|
|
@@ -2612,44 +2838,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2612
2838
|
const hasValue = computed(() => {
|
|
2613
2839
|
return selectedOptions.value.map((option) => getOptionLabel(option)).join(props.separator);
|
|
2614
2840
|
});
|
|
2615
|
-
|
|
2841
|
+
function onClickInput() {
|
|
2616
2842
|
props.autoOpen ? expand() : toggleExpanded();
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
if (
|
|
2621
|
-
|
|
2843
|
+
}
|
|
2844
|
+
function onInput(option) {
|
|
2845
|
+
const isSelected = isOptionSelected(option);
|
|
2846
|
+
if (isSelected && isUnselectable.value) {
|
|
2847
|
+
localModelValue.value.delete(getOptionValue(option));
|
|
2848
|
+
} else if (!isSelected && isSelectable.value) {
|
|
2849
|
+
localModelValue.value.add(getOptionValue(option));
|
|
2622
2850
|
}
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
if (Array.isArray(props.modelValue)) {
|
|
2627
|
-
const maxValues = Number(props.maxValues);
|
|
2628
|
-
if (props.maxValues !== void 0 && maxValues >= 0 && ((_a = props.modelValue) == null ? void 0 : _a.length) >= maxValues) {
|
|
2629
|
-
if (!contains(value, props.modelValue)) {
|
|
2630
|
-
return;
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
toReturn = contains(value, props.modelValue) ? removeFromList(value, props.modelValue) : [...props.modelValue, value];
|
|
2634
|
-
} else {
|
|
2635
|
-
toReturn = [value];
|
|
2636
|
-
}
|
|
2637
|
-
} else {
|
|
2638
|
-
if (!props.keepOpen) {
|
|
2639
|
-
collapse();
|
|
2640
|
-
}
|
|
2641
|
-
if (Array.isArray(props.modelValue)) {
|
|
2642
|
-
if (props.unselectable && props.modelValue.includes(value)) {
|
|
2643
|
-
toReturn = [];
|
|
2644
|
-
} else {
|
|
2645
|
-
toReturn = [value];
|
|
2646
|
-
}
|
|
2647
|
-
} else if (props.unselectable && value === props.modelValue) {
|
|
2648
|
-
toReturn = void 0;
|
|
2649
|
-
}
|
|
2851
|
+
localModelValue.value = new Set(localModelValue.value);
|
|
2852
|
+
if (!props.multiple && !props.keepOpen) {
|
|
2853
|
+
collapse();
|
|
2650
2854
|
}
|
|
2651
|
-
|
|
2652
|
-
|
|
2855
|
+
}
|
|
2856
|
+
watch(
|
|
2857
|
+
() => props.options,
|
|
2858
|
+
(newValue) => {
|
|
2859
|
+
if ((newValue == null ? void 0 : newValue.length) && props.autoselectFirst && !isDirty.value) {
|
|
2860
|
+
onInput(newValue[0]);
|
|
2861
|
+
}
|
|
2862
|
+
},
|
|
2863
|
+
{ immediate: true }
|
|
2864
|
+
);
|
|
2653
2865
|
const selectProps = computed(() => ({
|
|
2654
2866
|
id: hasId.value,
|
|
2655
2867
|
name: props.name,
|
|
@@ -2670,7 +2882,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2670
2882
|
icon: propsDefaults.value.icon,
|
|
2671
2883
|
iconPosition: propsDefaults.value.iconPosition,
|
|
2672
2884
|
floating: propsDefaults.value.floating,
|
|
2673
|
-
unselectable:
|
|
2885
|
+
unselectable: isUnselectable.value,
|
|
2886
|
+
autoselectFirst: propsDefaults.value.autoselectFirst,
|
|
2674
2887
|
multiple: propsDefaults.value.multiple,
|
|
2675
2888
|
label: propsDefaults.value.label,
|
|
2676
2889
|
placeholder: propsDefaults.value.placeholder,
|
|
@@ -2720,208 +2933,307 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2720
2933
|
key: 0,
|
|
2721
2934
|
id: unref(hasLabelId),
|
|
2722
2935
|
for: unref(propsDefaults).searchable ? unref(hasSearchId) : void 0
|
|
2723
|
-
}, toDisplayString(_ctx.label), 9, _hoisted_2)) : createCommentVNode("", true),
|
|
2724
|
-
createElementVNode(
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
"
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
unref(
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
disabled: unref(isOptionDisabled)(item)
|
|
2827
|
-
})), () => [
|
|
2828
|
-
createTextVNode(toDisplayString(unref(getOptionLabel)(item)), 1)
|
|
2829
|
-
])
|
|
2830
|
-
]),
|
|
2831
|
-
_: 2
|
|
2832
|
-
}, 1040, ["onClickPassive"]);
|
|
2833
|
-
}), 128))
|
|
2834
|
-
], 64)) : (openBlock(), createBlock(_sfc_main$6, mergeProps({ key: 1 }, {
|
|
2835
|
-
selected: isOptionSelected(option),
|
|
2836
|
-
disabled: unref(isOptionDisabled)(option),
|
|
2837
|
-
unselectable: _ctx.unselectable,
|
|
2838
|
-
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
2839
|
-
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
2840
|
-
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
2841
|
-
}, {
|
|
2842
|
-
class: "vv-dropdown-option",
|
|
2843
|
-
onClickPassive: ($event) => onInput(option)
|
|
2844
|
-
}), {
|
|
2845
|
-
default: withCtx(() => [
|
|
2846
|
-
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
2847
|
-
option,
|
|
2848
|
-
selectedOptions: unref(selectedOptions),
|
|
2849
|
-
selected: isOptionSelected(option),
|
|
2850
|
-
disabled: unref(isOptionDisabled)(option)
|
|
2851
|
-
})), () => [
|
|
2852
|
-
createTextVNode(toDisplayString(unref(getOptionLabel)(option)), 1)
|
|
2853
|
-
])
|
|
2854
|
-
]),
|
|
2855
|
-
_: 2
|
|
2856
|
-
}, 1040, ["onClickPassive"]))
|
|
2857
|
-
], 64);
|
|
2858
|
-
}), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$6, {
|
|
2859
|
-
key: 1,
|
|
2860
|
-
modifiers: "inert"
|
|
2861
|
-
}, {
|
|
2862
|
-
default: withCtx(() => [
|
|
2863
|
-
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
2864
|
-
createTextVNode(toDisplayString(unref(propsDefaults).noOptionsLabel), 1)
|
|
2865
|
-
])
|
|
2866
|
-
]),
|
|
2867
|
-
_: 3
|
|
2868
|
-
})) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$6, {
|
|
2869
|
-
key: 2,
|
|
2870
|
-
modifiers: "inert"
|
|
2871
|
-
}, {
|
|
2872
|
-
default: withCtx(() => [
|
|
2873
|
-
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
2874
|
-
createTextVNode(toDisplayString(unref(propsDefaults).noResultsLabel), 1)
|
|
2936
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
2937
|
+
createElementVNode(
|
|
2938
|
+
"div",
|
|
2939
|
+
{
|
|
2940
|
+
ref_key: "wrapperEl",
|
|
2941
|
+
ref: wrapperEl,
|
|
2942
|
+
class: "vv-select__wrapper"
|
|
2943
|
+
},
|
|
2944
|
+
[
|
|
2945
|
+
createVNode(_sfc_main$8, mergeProps({
|
|
2946
|
+
ref_key: "dropdownEl",
|
|
2947
|
+
ref: dropdownEl,
|
|
2948
|
+
modelValue: unref(expanded),
|
|
2949
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
2950
|
+
}, unref(dropdownProps), {
|
|
2951
|
+
role: unref(DropdownRole).listbox,
|
|
2952
|
+
onAfterExpand,
|
|
2953
|
+
onAfterCollapse
|
|
2954
|
+
}), createSlots({
|
|
2955
|
+
default: withCtx(({ aria }) => [
|
|
2956
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
2957
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2958
|
+
])) : createCommentVNode("v-if", true),
|
|
2959
|
+
createElementVNode("div", _hoisted_5, [
|
|
2960
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
2961
|
+
_sfc_main$9,
|
|
2962
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
|
|
2963
|
+
null,
|
|
2964
|
+
16
|
|
2965
|
+
/* FULL_PROPS */
|
|
2966
|
+
)) : createCommentVNode("v-if", true),
|
|
2967
|
+
createElementVNode("div", mergeProps({
|
|
2968
|
+
ref_key: "inputEl",
|
|
2969
|
+
ref: inputEl
|
|
2970
|
+
}, aria, {
|
|
2971
|
+
class: "vv-select__input",
|
|
2972
|
+
role: "combobox",
|
|
2973
|
+
"aria-controls": unref(hasDropdownId),
|
|
2974
|
+
"aria-expanded": unref(expanded),
|
|
2975
|
+
"aria-labelledby": unref(hasLabelId),
|
|
2976
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2977
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2978
|
+
tabindex: unref(hasTabindex),
|
|
2979
|
+
onClickPassive: onClickInput
|
|
2980
|
+
}), [
|
|
2981
|
+
renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
2982
|
+
unref(hasValue) ? (openBlock(), createElementBlock(
|
|
2983
|
+
Fragment,
|
|
2984
|
+
{ key: 0 },
|
|
2985
|
+
[
|
|
2986
|
+
!_ctx.badges ? (openBlock(), createElementBlock(
|
|
2987
|
+
"div",
|
|
2988
|
+
_hoisted_7,
|
|
2989
|
+
toDisplayString(unref(hasValue)),
|
|
2990
|
+
1
|
|
2991
|
+
/* TEXT */
|
|
2992
|
+
)) : (openBlock(true), createElementBlock(
|
|
2993
|
+
Fragment,
|
|
2994
|
+
{ key: 1 },
|
|
2995
|
+
renderList(unref(selectedOptions), (option, index) => {
|
|
2996
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
2997
|
+
key: index,
|
|
2998
|
+
modifiers: _ctx.badgeModifiers,
|
|
2999
|
+
class: "vv-select__badge"
|
|
3000
|
+
}, {
|
|
3001
|
+
default: withCtx(() => [
|
|
3002
|
+
createTextVNode(
|
|
3003
|
+
toDisplayString(unref(getOptionLabel)(option)) + " ",
|
|
3004
|
+
1
|
|
3005
|
+
/* TEXT */
|
|
3006
|
+
),
|
|
3007
|
+
unref(isUnselectable) ? (openBlock(), createElementBlock("button", {
|
|
3008
|
+
key: 0,
|
|
3009
|
+
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
3010
|
+
type: "button",
|
|
3011
|
+
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
3012
|
+
}, [
|
|
3013
|
+
createVNode(_sfc_main$9, { name: "close" })
|
|
3014
|
+
], 8, _hoisted_8)) : createCommentVNode("v-if", true)
|
|
3015
|
+
]),
|
|
3016
|
+
_: 2
|
|
3017
|
+
/* DYNAMIC */
|
|
3018
|
+
}, 1032, ["modifiers"]);
|
|
3019
|
+
}),
|
|
3020
|
+
128
|
|
3021
|
+
/* KEYED_FRAGMENT */
|
|
3022
|
+
))
|
|
3023
|
+
],
|
|
3024
|
+
64
|
|
3025
|
+
/* STABLE_FRAGMENT */
|
|
3026
|
+
)) : (openBlock(), createElementBlock(
|
|
3027
|
+
Fragment,
|
|
3028
|
+
{ key: 1 },
|
|
3029
|
+
[
|
|
3030
|
+
createTextVNode(
|
|
3031
|
+
toDisplayString(_ctx.placeholder),
|
|
3032
|
+
1
|
|
3033
|
+
/* TEXT */
|
|
3034
|
+
)
|
|
3035
|
+
],
|
|
3036
|
+
64
|
|
3037
|
+
/* STABLE_FRAGMENT */
|
|
3038
|
+
))
|
|
2875
3039
|
])
|
|
2876
|
-
]),
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
3040
|
+
], 16, _hoisted_6),
|
|
3041
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
3042
|
+
_sfc_main$9,
|
|
3043
|
+
mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
|
|
3044
|
+
null,
|
|
3045
|
+
16
|
|
3046
|
+
/* FULL_PROPS */
|
|
3047
|
+
)) : createCommentVNode("v-if", true)
|
|
3048
|
+
]),
|
|
3049
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
3050
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3051
|
+
])) : createCommentVNode("v-if", true)
|
|
3052
|
+
]),
|
|
3053
|
+
items: withCtx(() => {
|
|
2883
3054
|
var _a;
|
|
2884
3055
|
return [
|
|
2885
|
-
((_a = unref(
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
3056
|
+
!unref(disabled) && ((_a = unref(filteredOptions)) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(
|
|
3057
|
+
Fragment,
|
|
3058
|
+
{ key: 0 },
|
|
3059
|
+
renderList(unref(filteredOptions), (option, index) => {
|
|
3060
|
+
return openBlock(), createElementBlock(
|
|
3061
|
+
Fragment,
|
|
3062
|
+
{ key: index },
|
|
3063
|
+
[
|
|
3064
|
+
isGroup(option) ? (openBlock(), createElementBlock(
|
|
3065
|
+
Fragment,
|
|
3066
|
+
{ key: 0 },
|
|
3067
|
+
[
|
|
3068
|
+
createVNode(_sfc_main$5, {
|
|
3069
|
+
label: unref(getOptionLabel)(option)
|
|
3070
|
+
}, null, 8, ["label"]),
|
|
3071
|
+
(openBlock(true), createElementBlock(
|
|
3072
|
+
Fragment,
|
|
3073
|
+
null,
|
|
3074
|
+
renderList(unref(getOptionGrouped)(
|
|
3075
|
+
option
|
|
3076
|
+
), (item, i) => {
|
|
3077
|
+
return openBlock(), createBlock(_sfc_main$6, mergeProps({ ref_for: true }, {
|
|
3078
|
+
selected: isOptionSelected(item),
|
|
3079
|
+
disabled: isOptionDisabledOrNotSelectable(item),
|
|
3080
|
+
unselectable: unref(isUnselectable),
|
|
3081
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3082
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3083
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3084
|
+
}, {
|
|
3085
|
+
key: i,
|
|
3086
|
+
class: "vv-dropdown-option",
|
|
3087
|
+
"focus-on-hover": "",
|
|
3088
|
+
onClickPassive: ($event) => onInput(item)
|
|
3089
|
+
}), {
|
|
3090
|
+
default: withCtx(() => [
|
|
3091
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3092
|
+
option,
|
|
3093
|
+
selectedOptions: unref(selectedOptions),
|
|
3094
|
+
selected: isOptionSelected(item),
|
|
3095
|
+
disabled: isOptionDisabledOrNotSelectable(item)
|
|
3096
|
+
}), () => [
|
|
3097
|
+
createTextVNode(
|
|
3098
|
+
toDisplayString(unref(getOptionLabel)(item)),
|
|
3099
|
+
1
|
|
3100
|
+
/* TEXT */
|
|
3101
|
+
)
|
|
3102
|
+
])
|
|
3103
|
+
]),
|
|
3104
|
+
_: 2
|
|
3105
|
+
/* DYNAMIC */
|
|
3106
|
+
}, 1040, ["onClickPassive"]);
|
|
3107
|
+
}),
|
|
3108
|
+
128
|
|
3109
|
+
/* KEYED_FRAGMENT */
|
|
3110
|
+
))
|
|
3111
|
+
],
|
|
3112
|
+
64
|
|
3113
|
+
/* STABLE_FRAGMENT */
|
|
3114
|
+
)) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
3115
|
+
key: 1,
|
|
3116
|
+
ref_for: true
|
|
3117
|
+
}, {
|
|
3118
|
+
selected: isOptionSelected(option),
|
|
3119
|
+
disabled: isOptionDisabledOrNotSelectable(option),
|
|
3120
|
+
unselectable: unref(isUnselectable),
|
|
3121
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3122
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3123
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3124
|
+
}, {
|
|
3125
|
+
class: "vv-dropdown-option",
|
|
3126
|
+
"focus-on-hover": "",
|
|
3127
|
+
onClickPassive: ($event) => onInput(option)
|
|
3128
|
+
}), {
|
|
3129
|
+
default: withCtx(() => [
|
|
3130
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3131
|
+
option,
|
|
3132
|
+
selectedOptions: unref(selectedOptions),
|
|
3133
|
+
selected: isOptionSelected(option),
|
|
3134
|
+
disabled: isOptionDisabledOrNotSelectable(option)
|
|
3135
|
+
}), () => [
|
|
3136
|
+
createTextVNode(
|
|
3137
|
+
toDisplayString(unref(getOptionLabel)(option)),
|
|
3138
|
+
1
|
|
3139
|
+
/* TEXT */
|
|
3140
|
+
)
|
|
3141
|
+
])
|
|
3142
|
+
]),
|
|
3143
|
+
_: 2
|
|
3144
|
+
/* DYNAMIC */
|
|
3145
|
+
}, 1040, ["onClickPassive"]))
|
|
3146
|
+
],
|
|
3147
|
+
64
|
|
3148
|
+
/* STABLE_FRAGMENT */
|
|
3149
|
+
);
|
|
3150
|
+
}),
|
|
3151
|
+
128
|
|
3152
|
+
/* KEYED_FRAGMENT */
|
|
3153
|
+
)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$6, {
|
|
3154
|
+
key: 1,
|
|
3155
|
+
modifiers: "inert"
|
|
3156
|
+
}, {
|
|
3157
|
+
default: withCtx(() => [
|
|
3158
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
3159
|
+
createTextVNode(
|
|
3160
|
+
toDisplayString(unref(propsDefaults).noOptionsLabel),
|
|
3161
|
+
1
|
|
3162
|
+
/* TEXT */
|
|
3163
|
+
)
|
|
3164
|
+
])
|
|
3165
|
+
]),
|
|
3166
|
+
_: 3
|
|
3167
|
+
/* FORWARDED */
|
|
3168
|
+
})) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$6, {
|
|
3169
|
+
key: 2,
|
|
3170
|
+
modifiers: "inert"
|
|
3171
|
+
}, {
|
|
3172
|
+
default: withCtx(() => [
|
|
3173
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
3174
|
+
createTextVNode(
|
|
3175
|
+
toDisplayString(unref(propsDefaults).noResultsLabel),
|
|
3176
|
+
1
|
|
3177
|
+
/* TEXT */
|
|
3178
|
+
)
|
|
3179
|
+
])
|
|
3180
|
+
]),
|
|
3181
|
+
_: 3
|
|
3182
|
+
/* FORWARDED */
|
|
3183
|
+
})) : createCommentVNode("v-if", true)
|
|
2891
3184
|
];
|
|
2892
|
-
})
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
2906
|
-
"aria-autocomplete": "list",
|
|
2907
|
-
"aria-controls": unref(hasDropdownId),
|
|
2908
|
-
autocomplete: "off",
|
|
2909
|
-
spellcheck: "false",
|
|
2910
|
-
type: "search",
|
|
2911
|
-
class: "vv-dropdown__search",
|
|
2912
|
-
placeholder: unref(propsDefaults).searchPlaceholder
|
|
2913
|
-
}, null, 8, _hoisted_3)), [
|
|
2914
|
-
[vModelText, unref(searchText)]
|
|
2915
|
-
]) : createCommentVNode("", true)
|
|
3185
|
+
}),
|
|
3186
|
+
after: withCtx(() => [
|
|
3187
|
+
renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
|
|
3188
|
+
var _a;
|
|
3189
|
+
return [
|
|
3190
|
+
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
3191
|
+
key: 0,
|
|
3192
|
+
label: unref(propsDefaults).closeLabel,
|
|
3193
|
+
modifiers: "secondary",
|
|
3194
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
3195
|
+
}, null, 8, ["label"])) : createCommentVNode("v-if", true)
|
|
3196
|
+
];
|
|
3197
|
+
})
|
|
2916
3198
|
]),
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
3199
|
+
_: 2
|
|
3200
|
+
/* DYNAMIC */
|
|
3201
|
+
}, [
|
|
3202
|
+
unref(propsDefaults).searchable || _ctx.$slots["dropdown::before"] ? {
|
|
3203
|
+
name: "before",
|
|
3204
|
+
fn: withCtx(() => [
|
|
3205
|
+
renderSlot(_ctx.$slots, "dropdown::before"),
|
|
3206
|
+
unref(propsDefaults).searchable && !unref(disabled) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3207
|
+
key: 0,
|
|
3208
|
+
id: unref(hasSearchId),
|
|
3209
|
+
ref_key: "inputSearchEl",
|
|
3210
|
+
ref: inputSearchEl,
|
|
3211
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
3212
|
+
"aria-autocomplete": "list",
|
|
3213
|
+
"aria-controls": unref(hasDropdownId),
|
|
3214
|
+
autocomplete: "off",
|
|
3215
|
+
spellcheck: "false",
|
|
3216
|
+
type: "search",
|
|
3217
|
+
class: "vv-dropdown__search",
|
|
3218
|
+
placeholder: unref(propsDefaults).searchPlaceholder
|
|
3219
|
+
}, null, 8, _hoisted_3)), [
|
|
3220
|
+
[vModelText, unref(searchText)]
|
|
3221
|
+
]) : createCommentVNode("v-if", true)
|
|
3222
|
+
]),
|
|
3223
|
+
key: "0"
|
|
3224
|
+
} : void 0
|
|
3225
|
+
]), 1040, ["modelValue", "role"])
|
|
3226
|
+
],
|
|
3227
|
+
512
|
|
3228
|
+
/* NEED_PATCH */
|
|
3229
|
+
),
|
|
2921
3230
|
createVNode(unref(HintSlot), {
|
|
2922
3231
|
id: unref(hasHintId),
|
|
2923
3232
|
class: "vv-select__hint"
|
|
2924
|
-
}, createSlots({
|
|
3233
|
+
}, createSlots({
|
|
3234
|
+
_: 2
|
|
3235
|
+
/* DYNAMIC */
|
|
3236
|
+
}, [
|
|
2925
3237
|
_ctx.$slots.hint ? {
|
|
2926
3238
|
name: "hint",
|
|
2927
3239
|
fn: withCtx(() => [
|
|
@@ -2951,9 +3263,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2951
3263
|
key: "3"
|
|
2952
3264
|
} : void 0
|
|
2953
3265
|
]), 1032, ["id"])
|
|
2954
|
-
], 10, _hoisted_1)) : (openBlock(), createBlock(
|
|
2955
|
-
|
|
2956
|
-
|
|
3266
|
+
], 10, _hoisted_1)) : (openBlock(), createBlock(
|
|
3267
|
+
_sfc_main$4,
|
|
3268
|
+
mergeProps({ key: 1 }, unref(selectProps), {
|
|
3269
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
|
|
3270
|
+
}),
|
|
3271
|
+
null,
|
|
3272
|
+
16
|
|
3273
|
+
/* FULL_PROPS */
|
|
3274
|
+
));
|
|
2957
3275
|
};
|
|
2958
3276
|
}
|
|
2959
3277
|
});
|