@volverjs/ui-vue 0.0.10-beta.4 → 0.0.10-beta.40
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 +226 -126
- 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 +1215 -955
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +600 -680
- package/dist/components/VvCombobox/index.d.ts +454 -24
- 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 +224 -125
- 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 +301 -267
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +229 -203
- package/dist/components/VvSelect/index.d.ts +181 -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 +4241 -2261
- 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/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/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 +631 -619
- package/src/components/VvCombobox/index.ts +189 -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 +242 -241
- package/src/components/VvSelect/index.ts +81 -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 +51 -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 +391 -383
- package/src/stories/Combobox/Combobox.stories.ts +108 -107
- package/src/stories/Combobox/Combobox.test.ts +89 -91
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +25 -24
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +23 -22
- package/src/stories/Combobox/ComboboxOptions.stories.ts +85 -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 +67 -66
- package/src/stories/Select/Select.test.ts +65 -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
|
/**
|
|
@@ -387,374 +568,24 @@ const ActionProps = {
|
|
|
387
568
|
* Button aria-label
|
|
388
569
|
*/
|
|
389
570
|
ariaLabel: {
|
|
390
|
-
type: String,
|
|
391
|
-
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,
|
|
416
|
-
/**
|
|
417
|
-
* Dropdown show / hide transition name
|
|
418
|
-
*/
|
|
419
|
-
transitionName: {
|
|
420
|
-
type: String,
|
|
421
|
-
default: "vv-dropdown--mobile-fade-block"
|
|
422
|
-
},
|
|
423
|
-
/**
|
|
424
|
-
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
425
|
-
*/
|
|
426
|
-
modelValue: {
|
|
427
|
-
type: [String, Number, Boolean, Object, Array],
|
|
428
|
-
default: void 0
|
|
429
|
-
},
|
|
430
|
-
/**
|
|
431
|
-
* Label for no search results
|
|
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
|
|
468
|
-
*/
|
|
469
|
-
searchFunction: {
|
|
470
|
-
type: Function,
|
|
471
|
-
default: void 0
|
|
472
|
-
},
|
|
473
|
-
/**
|
|
474
|
-
* On searchable select is the input search placeholder
|
|
475
|
-
*/
|
|
476
|
-
searchPlaceholder: {
|
|
477
|
-
type: String,
|
|
478
|
-
default: "Search..."
|
|
479
|
-
},
|
|
480
|
-
/**
|
|
481
|
-
* The input search debounce time in ms
|
|
482
|
-
*/
|
|
483
|
-
debounceSearch: {
|
|
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: {
|
|
539
|
-
type: Boolean,
|
|
540
|
-
default: false
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
const VvIconProps = {
|
|
544
|
-
/**
|
|
545
|
-
* Color
|
|
546
|
-
*/
|
|
547
|
-
color: String,
|
|
548
|
-
/**
|
|
549
|
-
* Width
|
|
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
|
|
568
|
-
},
|
|
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: {
|
|
575
|
-
type: String
|
|
576
|
-
},
|
|
577
|
-
/**
|
|
578
|
-
* The name of icon set.
|
|
579
|
-
* Icon default options prefix: simple | normal | detailed
|
|
580
|
-
*/
|
|
581
|
-
prefix: {
|
|
582
|
-
type: String,
|
|
583
|
-
default: "normal"
|
|
584
|
-
},
|
|
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,
|
|
571
|
+
type: String,
|
|
572
|
+
default: void 0
|
|
573
|
+
},
|
|
629
574
|
/**
|
|
630
|
-
*
|
|
631
|
-
* @values string | string[]
|
|
575
|
+
* Default tag for the action
|
|
632
576
|
*/
|
|
633
|
-
|
|
634
|
-
type:
|
|
577
|
+
defaultTag: {
|
|
578
|
+
type: String,
|
|
579
|
+
default: ActionTag.button
|
|
635
580
|
}
|
|
636
581
|
};
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
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
|
-
}
|
|
582
|
+
({
|
|
583
|
+
storageType: {
|
|
584
|
+
type: String,
|
|
585
|
+
default: StorageType.local,
|
|
586
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
587
|
+
},
|
|
588
|
+
storageKey: String
|
|
758
589
|
});
|
|
759
590
|
const VvDropdownProps = {
|
|
760
591
|
...IdProps,
|
|
@@ -783,7 +614,34 @@ const VvDropdownProps = {
|
|
|
783
614
|
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
784
615
|
}
|
|
785
616
|
};
|
|
786
|
-
const
|
|
617
|
+
const VvDropdownItemProps = {
|
|
618
|
+
focusOnHover: {
|
|
619
|
+
type: Boolean,
|
|
620
|
+
default: false
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
const VvDropdownOptionProps = {
|
|
624
|
+
...DisabledProps,
|
|
625
|
+
...SelectedProps,
|
|
626
|
+
...UnselectableProps,
|
|
627
|
+
...ModifiersProps,
|
|
628
|
+
deselectHintLabel: {
|
|
629
|
+
type: String
|
|
630
|
+
},
|
|
631
|
+
selectHintLabel: {
|
|
632
|
+
type: String
|
|
633
|
+
},
|
|
634
|
+
selectedHintLabel: {
|
|
635
|
+
type: String
|
|
636
|
+
},
|
|
637
|
+
focusOnHover: {
|
|
638
|
+
type: Boolean,
|
|
639
|
+
default: false
|
|
640
|
+
}
|
|
641
|
+
};
|
|
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(".");
|
|
@@ -1632,7 +1530,16 @@ const VvSelectProps = {
|
|
|
1632
1530
|
*/
|
|
1633
1531
|
placeholder: String
|
|
1634
1532
|
};
|
|
1635
|
-
|
|
1533
|
+
function useVvSelectProps() {
|
|
1534
|
+
return {
|
|
1535
|
+
...VvSelectProps,
|
|
1536
|
+
options: {
|
|
1537
|
+
...VvSelectProps.options,
|
|
1538
|
+
type: Array,
|
|
1539
|
+
default: () => []
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1636
1543
|
function useDefaults(componentName, propsDefinition, props) {
|
|
1637
1544
|
const volver = useVolver();
|
|
1638
1545
|
const volverComponentDefaults = computed(() => {
|
|
@@ -1696,30 +1603,30 @@ function useComponentFocus(inputTemplateRef, emit) {
|
|
|
1696
1603
|
};
|
|
1697
1604
|
}
|
|
1698
1605
|
function useComponentIcon(icon, iconPosition) {
|
|
1606
|
+
const hasIcon = computed(() => {
|
|
1607
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1608
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
1609
|
+
}
|
|
1610
|
+
return icon == null ? void 0 : icon.value;
|
|
1611
|
+
});
|
|
1699
1612
|
const hasIconBefore = computed(
|
|
1700
|
-
() =>
|
|
1613
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
1701
1614
|
);
|
|
1702
1615
|
const hasIconAfter = computed(
|
|
1703
|
-
() =>
|
|
1616
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
1704
1617
|
);
|
|
1705
1618
|
const hasIconLeft = computed(
|
|
1706
|
-
() =>
|
|
1619
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
1707
1620
|
);
|
|
1708
1621
|
const hasIconRight = computed(
|
|
1709
|
-
() =>
|
|
1622
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
1710
1623
|
);
|
|
1711
1624
|
const hasIconTop = computed(
|
|
1712
|
-
() =>
|
|
1625
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
1713
1626
|
);
|
|
1714
1627
|
const hasIconBottom = computed(
|
|
1715
|
-
() =>
|
|
1628
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
1716
1629
|
);
|
|
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
1630
|
return {
|
|
1724
1631
|
hasIcon,
|
|
1725
1632
|
hasIconLeft,
|
|
@@ -1733,26 +1640,33 @@ function useComponentIcon(icon, iconPosition) {
|
|
|
1733
1640
|
function useOptions(props) {
|
|
1734
1641
|
const { options, labelKey, valueKey, disabledKey } = toRefs(props);
|
|
1735
1642
|
const getOptionLabel = (option) => {
|
|
1736
|
-
if (typeof option
|
|
1643
|
+
if (typeof option === "string") {
|
|
1737
1644
|
return option;
|
|
1645
|
+
}
|
|
1738
1646
|
return String(
|
|
1739
1647
|
typeof labelKey.value === "function" ? labelKey.value(option) : get(option, labelKey.value)
|
|
1740
1648
|
);
|
|
1741
1649
|
};
|
|
1742
1650
|
const getOptionValue = (option) => {
|
|
1743
|
-
if (typeof option
|
|
1651
|
+
if (typeof option === "string") {
|
|
1744
1652
|
return option;
|
|
1653
|
+
}
|
|
1745
1654
|
return typeof valueKey.value === "function" ? valueKey.value(option) : get(option, valueKey.value);
|
|
1746
1655
|
};
|
|
1747
1656
|
const isOptionDisabled = (option) => {
|
|
1748
|
-
if (typeof option
|
|
1657
|
+
if (typeof option === "string") {
|
|
1749
1658
|
return false;
|
|
1659
|
+
}
|
|
1750
1660
|
return typeof disabledKey.value === "function" ? disabledKey.value(option) : get(option, disabledKey.value);
|
|
1751
1661
|
};
|
|
1752
1662
|
const getOptionGrouped = (option) => {
|
|
1753
|
-
if (typeof option
|
|
1663
|
+
if (typeof option == "string") {
|
|
1754
1664
|
return [];
|
|
1755
|
-
|
|
1665
|
+
}
|
|
1666
|
+
if (typeof option === "object" && option && "options" in option) {
|
|
1667
|
+
return option.options;
|
|
1668
|
+
}
|
|
1669
|
+
return [];
|
|
1756
1670
|
};
|
|
1757
1671
|
return {
|
|
1758
1672
|
options,
|
|
@@ -1783,14 +1697,16 @@ const __default__$4 = {
|
|
|
1783
1697
|
};
|
|
1784
1698
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1785
1699
|
...__default__$4,
|
|
1786
|
-
props:
|
|
1787
|
-
emits:
|
|
1788
|
-
setup(__props, { emit }) {
|
|
1700
|
+
props: useVvSelectProps(),
|
|
1701
|
+
emits: ["update:modelValue", "focus", "blur"],
|
|
1702
|
+
setup(__props, { emit: __emit }) {
|
|
1789
1703
|
const props = __props;
|
|
1704
|
+
const emit = __emit;
|
|
1790
1705
|
const slots = useSlots();
|
|
1706
|
+
const VvSelectProps2 = useVvSelectProps();
|
|
1791
1707
|
const propsDefaults = useDefaults(
|
|
1792
1708
|
"VvSelect",
|
|
1793
|
-
|
|
1709
|
+
VvSelectProps2,
|
|
1794
1710
|
props
|
|
1795
1711
|
);
|
|
1796
1712
|
const select = ref();
|
|
@@ -1822,10 +1738,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1822
1738
|
focused.value = true;
|
|
1823
1739
|
}
|
|
1824
1740
|
});
|
|
1825
|
-
const {
|
|
1826
|
-
icon,
|
|
1827
|
-
iconPosition
|
|
1828
|
-
);
|
|
1741
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
1829
1742
|
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
1830
1743
|
const isDisabled = computed(() => props.disabled || props.readonly);
|
|
1831
1744
|
const hasTabindex = computed(() => {
|
|
@@ -1844,28 +1757,28 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1844
1757
|
"vv-select",
|
|
1845
1758
|
modifiers,
|
|
1846
1759
|
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
|
|
1760
|
+
"valid": valid.value,
|
|
1761
|
+
"invalid": invalid.value,
|
|
1762
|
+
"loading": loading.value,
|
|
1763
|
+
"disabled": disabled.value,
|
|
1764
|
+
"readonly": readonly.value,
|
|
1765
|
+
"icon-before": hasIconBefore.value !== void 0,
|
|
1766
|
+
"icon-after": hasIconAfter.value !== void 0,
|
|
1767
|
+
"dirty": isDirty.value,
|
|
1768
|
+
"focus": focused.value,
|
|
1769
|
+
"floating": floating.value,
|
|
1770
|
+
"multiple": multiple.value
|
|
1858
1771
|
}))
|
|
1859
1772
|
);
|
|
1860
1773
|
const hasAttrs = computed(() => {
|
|
1861
1774
|
return {
|
|
1862
|
-
name: props.name,
|
|
1863
|
-
tabindex: hasTabindex.value,
|
|
1864
|
-
disabled: isDisabled.value,
|
|
1865
|
-
required: props.required,
|
|
1866
|
-
size: props.size,
|
|
1867
|
-
autocomplete: props.autocomplete,
|
|
1868
|
-
multiple: props.multiple,
|
|
1775
|
+
"name": props.name,
|
|
1776
|
+
"tabindex": hasTabindex.value,
|
|
1777
|
+
"disabled": isDisabled.value,
|
|
1778
|
+
"required": props.required,
|
|
1779
|
+
"size": props.size,
|
|
1780
|
+
"autocomplete": props.autocomplete,
|
|
1781
|
+
"multiple": props.multiple,
|
|
1869
1782
|
"aria-invalid": isInvalid.value,
|
|
1870
1783
|
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
1871
1784
|
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
@@ -1893,107 +1806,142 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1893
1806
|
emit("update:modelValue", newValue);
|
|
1894
1807
|
}
|
|
1895
1808
|
});
|
|
1896
|
-
|
|
1897
|
-
|
|
1809
|
+
function isGroup(option) {
|
|
1810
|
+
var _a;
|
|
1811
|
+
if (typeof option === "string") {
|
|
1898
1812
|
return false;
|
|
1899
|
-
|
|
1900
|
-
|
|
1813
|
+
}
|
|
1814
|
+
return (_a = option.options) == null ? void 0 : _a.length;
|
|
1815
|
+
}
|
|
1901
1816
|
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
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
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
|
-
|
|
1817
|
+
return openBlock(), createElementBlock(
|
|
1818
|
+
"div",
|
|
1819
|
+
{
|
|
1820
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1821
|
+
},
|
|
1822
|
+
[
|
|
1823
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
1824
|
+
key: 0,
|
|
1825
|
+
for: unref(hasId)
|
|
1826
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1$2)) : createCommentVNode("v-if", true),
|
|
1827
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
1828
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
1829
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1830
|
+
])) : createCommentVNode("v-if", true),
|
|
1831
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
1832
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
1833
|
+
_sfc_main$9,
|
|
1834
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
|
|
1835
|
+
null,
|
|
1836
|
+
16
|
|
1837
|
+
/* FULL_PROPS */
|
|
1838
|
+
)) : createCommentVNode("v-if", true),
|
|
1839
|
+
withDirectives(createElementVNode("select", mergeProps({
|
|
1840
|
+
id: unref(hasId),
|
|
1841
|
+
ref_key: "select",
|
|
1842
|
+
ref: select,
|
|
1843
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
1844
|
+
}, unref(hasAttrs)), [
|
|
1845
|
+
_ctx.placeholder ? (openBlock(), createElementBlock("option", {
|
|
1846
|
+
key: 0,
|
|
1847
|
+
value: void 0,
|
|
1848
|
+
disabled: !_ctx.unselectable,
|
|
1849
|
+
hidden: !_ctx.unselectable
|
|
1850
|
+
}, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("v-if", true),
|
|
1851
|
+
(openBlock(true), createElementBlock(
|
|
1852
|
+
Fragment,
|
|
1853
|
+
null,
|
|
1854
|
+
renderList(_ctx.options, (option, index) => {
|
|
1855
|
+
return openBlock(), createElementBlock(
|
|
1856
|
+
Fragment,
|
|
1857
|
+
null,
|
|
1858
|
+
[
|
|
1859
|
+
!isGroup(option) ? (openBlock(), createElementBlock("option", {
|
|
1860
|
+
key: index,
|
|
1861
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1862
|
+
value: unref(getOptionValue)(option)
|
|
1863
|
+
}, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1)) : (openBlock(), createElementBlock("optgroup", {
|
|
1864
|
+
key: `group-${index}`,
|
|
1865
|
+
disabled: unref(isOptionDisabled)(option),
|
|
1866
|
+
label: unref(getOptionLabel)(option)
|
|
1867
|
+
}, [
|
|
1868
|
+
(openBlock(true), createElementBlock(
|
|
1869
|
+
Fragment,
|
|
1870
|
+
null,
|
|
1871
|
+
renderList(unref(getOptionGrouped)(option), (item, i) => {
|
|
1872
|
+
return openBlock(), createElementBlock("option", {
|
|
1873
|
+
key: `group-${index}-item-${i}`,
|
|
1874
|
+
disabled: unref(isOptionDisabled)(item),
|
|
1875
|
+
value: unref(getOptionValue)(item)
|
|
1876
|
+
}, toDisplayString(unref(getOptionLabel)(item)), 9, _hoisted_9$1);
|
|
1877
|
+
}),
|
|
1878
|
+
128
|
|
1879
|
+
/* KEYED_FRAGMENT */
|
|
1880
|
+
))
|
|
1881
|
+
], 8, _hoisted_8$1))
|
|
1882
|
+
],
|
|
1883
|
+
64
|
|
1884
|
+
/* STABLE_FRAGMENT */
|
|
1885
|
+
);
|
|
1886
|
+
}),
|
|
1887
|
+
256
|
|
1888
|
+
/* UNKEYED_FRAGMENT */
|
|
1889
|
+
))
|
|
1890
|
+
], 16, _hoisted_5$1), [
|
|
1891
|
+
[vModelSelect, unref(localModelValue)]
|
|
1892
|
+
]),
|
|
1893
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
1894
|
+
_sfc_main$9,
|
|
1895
|
+
mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
|
|
1896
|
+
null,
|
|
1897
|
+
16
|
|
1898
|
+
/* FULL_PROPS */
|
|
1899
|
+
)) : createCommentVNode("v-if", true)
|
|
1900
|
+
]),
|
|
1901
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
1902
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1903
|
+
])) : createCommentVNode("v-if", true)
|
|
1904
|
+
]),
|
|
1905
|
+
createVNode(unref(HintSlot), {
|
|
1906
|
+
id: unref(hasHintId),
|
|
1907
|
+
class: "vv-select__hint"
|
|
1908
|
+
}, createSlots({
|
|
1909
|
+
_: 2
|
|
1910
|
+
/* DYNAMIC */
|
|
1911
|
+
}, [
|
|
1912
|
+
_ctx.$slots.hint ? {
|
|
1913
|
+
name: "hint",
|
|
1914
|
+
fn: withCtx(() => [
|
|
1915
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1916
|
+
]),
|
|
1917
|
+
key: "0"
|
|
1918
|
+
} : void 0,
|
|
1919
|
+
_ctx.$slots.loading ? {
|
|
1920
|
+
name: "loading",
|
|
1921
|
+
fn: withCtx(() => [
|
|
1922
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1923
|
+
]),
|
|
1924
|
+
key: "1"
|
|
1925
|
+
} : void 0,
|
|
1926
|
+
_ctx.$slots.valid ? {
|
|
1927
|
+
name: "valid",
|
|
1928
|
+
fn: withCtx(() => [
|
|
1929
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1930
|
+
]),
|
|
1931
|
+
key: "2"
|
|
1932
|
+
} : void 0,
|
|
1933
|
+
_ctx.$slots.invalid ? {
|
|
1934
|
+
name: "invalid",
|
|
1935
|
+
fn: withCtx(() => [
|
|
1936
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1937
|
+
]),
|
|
1938
|
+
key: "3"
|
|
1939
|
+
} : void 0
|
|
1940
|
+
]), 1032, ["id"])
|
|
1941
|
+
],
|
|
1942
|
+
2
|
|
1943
|
+
/* CLASS */
|
|
1944
|
+
);
|
|
1997
1945
|
};
|
|
1998
1946
|
}
|
|
1999
1947
|
});
|
|
@@ -2012,14 +1960,23 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2012
1960
|
const { modifiers } = toRefs(props);
|
|
2013
1961
|
const bemCssClasses = useModifiers("vv-badge", modifiers);
|
|
2014
1962
|
return (_ctx, _cache) => {
|
|
2015
|
-
return openBlock(), createElementBlock(
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
1963
|
+
return openBlock(), createElementBlock(
|
|
1964
|
+
"span",
|
|
1965
|
+
{
|
|
1966
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1967
|
+
},
|
|
1968
|
+
[
|
|
1969
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1970
|
+
createTextVNode(
|
|
1971
|
+
toDisplayString(_ctx.value),
|
|
1972
|
+
1
|
|
1973
|
+
/* TEXT */
|
|
1974
|
+
)
|
|
1975
|
+
])
|
|
1976
|
+
],
|
|
1977
|
+
2
|
|
1978
|
+
/* CLASS */
|
|
1979
|
+
);
|
|
2023
1980
|
};
|
|
2024
1981
|
}
|
|
2025
1982
|
});
|
|
@@ -2032,8 +1989,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2032
1989
|
...__default__$2,
|
|
2033
1990
|
props: VvActionProps,
|
|
2034
1991
|
emits: VvActionEvents,
|
|
2035
|
-
setup(__props, { expose: __expose, emit }) {
|
|
1992
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2036
1993
|
const props = __props;
|
|
1994
|
+
const emit = __emit;
|
|
1995
|
+
const instance = getCurrentInstance();
|
|
2037
1996
|
const volver = useVolver();
|
|
2038
1997
|
const element = ref(null);
|
|
2039
1998
|
__expose({ $el: element });
|
|
@@ -2064,7 +2023,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2064
2023
|
case props.href !== void 0:
|
|
2065
2024
|
return ActionTag.a;
|
|
2066
2025
|
default:
|
|
2067
|
-
return
|
|
2026
|
+
return props.defaultTag;
|
|
2068
2027
|
}
|
|
2069
2028
|
});
|
|
2070
2029
|
const hasProps = computed(() => {
|
|
@@ -2089,30 +2048,44 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2089
2048
|
to: props.to,
|
|
2090
2049
|
target: props.target
|
|
2091
2050
|
};
|
|
2092
|
-
|
|
2051
|
+
case ActionTag.button:
|
|
2093
2052
|
return {
|
|
2094
2053
|
...toReturn,
|
|
2095
2054
|
type: props.type,
|
|
2096
2055
|
disabled: props.disabled
|
|
2097
2056
|
};
|
|
2057
|
+
default:
|
|
2058
|
+
return toReturn;
|
|
2098
2059
|
}
|
|
2099
2060
|
});
|
|
2100
|
-
|
|
2061
|
+
function onClick(e) {
|
|
2062
|
+
var _a;
|
|
2101
2063
|
if (props.disabled) {
|
|
2102
2064
|
e.preventDefault();
|
|
2103
2065
|
return;
|
|
2104
2066
|
}
|
|
2067
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick) {
|
|
2068
|
+
emit("click", e);
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2105
2071
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2072
|
+
}
|
|
2073
|
+
function onMouseover(e) {
|
|
2074
|
+
var _a;
|
|
2075
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
2076
|
+
emit("mouseover", e);
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2109
2079
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2080
|
+
}
|
|
2081
|
+
function onMouseleave(e) {
|
|
2082
|
+
var _a;
|
|
2083
|
+
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
2084
|
+
emit("mouseleave", e);
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2113
2087
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
|
|
2114
|
-
|
|
2115
|
-
};
|
|
2088
|
+
}
|
|
2116
2089
|
return (_ctx, _cache) => {
|
|
2117
2090
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
2118
2091
|
ref_key: "element",
|
|
@@ -2129,23 +2102,28 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2129
2102
|
}), {
|
|
2130
2103
|
default: withCtx(() => [
|
|
2131
2104
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2132
|
-
createTextVNode(
|
|
2105
|
+
createTextVNode(
|
|
2106
|
+
toDisplayString(_ctx.label),
|
|
2107
|
+
1
|
|
2108
|
+
/* TEXT */
|
|
2109
|
+
)
|
|
2133
2110
|
])
|
|
2134
2111
|
]),
|
|
2135
2112
|
_: 3
|
|
2113
|
+
/* FORWARDED */
|
|
2136
2114
|
}, 16, ["class"]);
|
|
2137
2115
|
};
|
|
2138
2116
|
}
|
|
2139
2117
|
});
|
|
2140
2118
|
function useInjectedGroupState(groupKey) {
|
|
2141
2119
|
const group = inject(groupKey, void 0);
|
|
2142
|
-
const isInGroup = computed(() =>
|
|
2120
|
+
const isInGroup = computed(() => group !== void 0);
|
|
2143
2121
|
function getGroupOrLocalRef(propName, props, emit) {
|
|
2144
|
-
|
|
2145
|
-
|
|
2122
|
+
const groupPropValue = group == null ? void 0 : group[propName];
|
|
2123
|
+
if (groupPropValue) {
|
|
2146
2124
|
return computed({
|
|
2147
2125
|
get() {
|
|
2148
|
-
return groupPropValue
|
|
2126
|
+
return groupPropValue.value;
|
|
2149
2127
|
},
|
|
2150
2128
|
set(value) {
|
|
2151
2129
|
groupPropValue.value = value;
|
|
@@ -2158,8 +2136,9 @@ function useInjectedGroupState(groupKey) {
|
|
|
2158
2136
|
return propRef.value;
|
|
2159
2137
|
},
|
|
2160
2138
|
set(value) {
|
|
2161
|
-
if (emit)
|
|
2139
|
+
if (emit) {
|
|
2162
2140
|
emit(`update:${propName}`, value);
|
|
2141
|
+
}
|
|
2163
2142
|
}
|
|
2164
2143
|
});
|
|
2165
2144
|
}
|
|
@@ -2176,10 +2155,7 @@ const VvButtonProps = {
|
|
|
2176
2155
|
...ModifiersProps,
|
|
2177
2156
|
...UnselectableProps,
|
|
2178
2157
|
...LoadingProps,
|
|
2179
|
-
|
|
2180
|
-
* Button icon
|
|
2181
|
-
*/
|
|
2182
|
-
icon: [String, Object],
|
|
2158
|
+
...IconProps,
|
|
2183
2159
|
/**
|
|
2184
2160
|
* Button icon position
|
|
2185
2161
|
*/
|
|
@@ -2226,14 +2202,11 @@ function useGroupProps(props, emit) {
|
|
|
2226
2202
|
const { id, iconPosition, icon, label, pressed } = toRefs(props);
|
|
2227
2203
|
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
2228
2204
|
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);
|
|
2205
|
+
const unselectable = getGroupOrLocalRef("unselectable", props);
|
|
2206
|
+
const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
|
|
2234
2207
|
const modifiers = computed(() => {
|
|
2235
2208
|
let localModifiers = props.modifiers;
|
|
2236
|
-
let groupModifiers = group == null ? void 0 : group.
|
|
2209
|
+
let groupModifiers = group == null ? void 0 : group.modifiers.value;
|
|
2237
2210
|
const toReturn = /* @__PURE__ */ new Set();
|
|
2238
2211
|
if (localModifiers) {
|
|
2239
2212
|
if (!Array.isArray(localModifiers)) {
|
|
@@ -2250,10 +2223,7 @@ function useGroupProps(props, emit) {
|
|
|
2250
2223
|
return Array.from(toReturn);
|
|
2251
2224
|
});
|
|
2252
2225
|
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
|
-
}
|
|
2226
|
+
() => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
|
|
2257
2227
|
);
|
|
2258
2228
|
return {
|
|
2259
2229
|
// group props
|
|
@@ -2282,14 +2252,16 @@ const _hoisted_2$1 = {
|
|
|
2282
2252
|
class: "vv-button__label"
|
|
2283
2253
|
};
|
|
2284
2254
|
const __default__$1 = {
|
|
2285
|
-
name: "VvButton"
|
|
2255
|
+
name: "VvButton",
|
|
2256
|
+
inheritAttrs: false
|
|
2286
2257
|
};
|
|
2287
2258
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2288
2259
|
...__default__$1,
|
|
2289
2260
|
props: VvButtonProps,
|
|
2290
2261
|
emits: VvButtonEvents,
|
|
2291
|
-
setup(__props, { expose: __expose, emit }) {
|
|
2262
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2292
2263
|
const props = __props;
|
|
2264
|
+
const emit = __emit;
|
|
2293
2265
|
const attrs = useAttrs();
|
|
2294
2266
|
const slots = useSlots();
|
|
2295
2267
|
const {
|
|
@@ -2324,10 +2296,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2324
2296
|
"vv-button",
|
|
2325
2297
|
modifiers,
|
|
2326
2298
|
computed(() => ({
|
|
2327
|
-
reverse: [Side.right, Side.bottom].includes(
|
|
2299
|
+
"reverse": [Side.right, Side.bottom].includes(
|
|
2328
2300
|
iconPosition.value
|
|
2329
2301
|
),
|
|
2330
|
-
column: [Side.top, Side.bottom].includes(
|
|
2302
|
+
"column": [Side.top, Side.bottom].includes(
|
|
2331
2303
|
iconPosition.value
|
|
2332
2304
|
),
|
|
2333
2305
|
"icon-only": Boolean(
|
|
@@ -2335,13 +2307,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2335
2307
|
)
|
|
2336
2308
|
}))
|
|
2337
2309
|
);
|
|
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
|
-
);
|
|
2310
|
+
const { hasIcon } = useComponentIcon(icon);
|
|
2341
2311
|
const toggleValue = computed(() => {
|
|
2342
2312
|
return props.value !== void 0 ? props.value : name.value;
|
|
2343
2313
|
});
|
|
2344
|
-
const
|
|
2314
|
+
const hasListeners = computed(() => {
|
|
2315
|
+
if (!toggle.value) {
|
|
2316
|
+
return void 0;
|
|
2317
|
+
}
|
|
2318
|
+
return {
|
|
2319
|
+
onClick
|
|
2320
|
+
};
|
|
2321
|
+
});
|
|
2322
|
+
function onClick() {
|
|
2345
2323
|
if (toggle.value) {
|
|
2346
2324
|
if (Array.isArray(modelValue.value)) {
|
|
2347
2325
|
if (contains(toggleValue.value, modelValue.value)) {
|
|
@@ -2361,9 +2339,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2361
2339
|
}
|
|
2362
2340
|
modelValue.value = toggleValue.value;
|
|
2363
2341
|
}
|
|
2364
|
-
}
|
|
2342
|
+
}
|
|
2365
2343
|
return (_ctx, _cache) => {
|
|
2366
2344
|
return openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
2345
|
+
...unref(attrs),
|
|
2346
|
+
...unref(hasListeners),
|
|
2367
2347
|
disabled: unref(disabled),
|
|
2368
2348
|
pressed: unref(pressed),
|
|
2369
2349
|
active: _ctx.active,
|
|
@@ -2377,8 +2357,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2377
2357
|
id: unref(hasId),
|
|
2378
2358
|
ref_key: "element",
|
|
2379
2359
|
ref: element,
|
|
2380
|
-
class: unref(bemCssClasses)
|
|
2381
|
-
onClick
|
|
2360
|
+
class: unref(bemCssClasses)
|
|
2382
2361
|
}), {
|
|
2383
2362
|
default: withCtx(() => [
|
|
2384
2363
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -2387,28 +2366,204 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2387
2366
|
key: 0,
|
|
2388
2367
|
class: "vv-button__loading-icon",
|
|
2389
2368
|
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
|
-
|
|
2369
|
+
}, null, 8, ["name"])) : createCommentVNode("v-if", true),
|
|
2370
|
+
_ctx.loadingLabel ? (openBlock(), createElementBlock(
|
|
2371
|
+
"span",
|
|
2372
|
+
_hoisted_1$1,
|
|
2373
|
+
toDisplayString(_ctx.loadingLabel),
|
|
2374
|
+
1
|
|
2375
|
+
/* TEXT */
|
|
2376
|
+
)) : createCommentVNode("v-if", true)
|
|
2377
|
+
]) : (openBlock(), createElementBlock(
|
|
2378
|
+
Fragment,
|
|
2379
|
+
{ key: 1 },
|
|
2380
|
+
[
|
|
2381
|
+
renderSlot(_ctx.$slots, "before"),
|
|
2382
|
+
unref(hasIcon) ? (openBlock(), createBlock(
|
|
2383
|
+
_sfc_main$9,
|
|
2384
|
+
mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
|
|
2385
|
+
null,
|
|
2386
|
+
16
|
|
2387
|
+
/* FULL_PROPS */
|
|
2388
|
+
)) : createCommentVNode("v-if", true),
|
|
2389
|
+
unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2$1, [
|
|
2390
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
2391
|
+
createTextVNode(
|
|
2392
|
+
toDisplayString(unref(label)),
|
|
2393
|
+
1
|
|
2394
|
+
/* TEXT */
|
|
2395
|
+
)
|
|
2396
|
+
])
|
|
2397
|
+
])) : createCommentVNode("v-if", true),
|
|
2398
|
+
renderSlot(_ctx.$slots, "after")
|
|
2399
|
+
],
|
|
2400
|
+
64
|
|
2401
|
+
/* STABLE_FRAGMENT */
|
|
2402
|
+
))
|
|
2405
2403
|
])
|
|
2406
2404
|
]),
|
|
2407
2405
|
_: 3
|
|
2406
|
+
/* FORWARDED */
|
|
2408
2407
|
}, 16, ["id", "class"]);
|
|
2409
2408
|
};
|
|
2410
2409
|
}
|
|
2411
2410
|
});
|
|
2411
|
+
const VvComboboxProps = {
|
|
2412
|
+
...IdNameProps,
|
|
2413
|
+
...TabindexProps,
|
|
2414
|
+
...ValidProps,
|
|
2415
|
+
...InvalidProps,
|
|
2416
|
+
...HintProps,
|
|
2417
|
+
...LoadingProps,
|
|
2418
|
+
...DisabledProps,
|
|
2419
|
+
...ReadonlyProps,
|
|
2420
|
+
...ModifiersProps,
|
|
2421
|
+
...OptionsProps,
|
|
2422
|
+
...IconProps,
|
|
2423
|
+
...FloatingLabelProps,
|
|
2424
|
+
...UnselectableProps,
|
|
2425
|
+
...DropdownProps,
|
|
2426
|
+
...LabelProps,
|
|
2427
|
+
/**
|
|
2428
|
+
* Dropdown show / hide transition name
|
|
2429
|
+
*/
|
|
2430
|
+
transitionName: {
|
|
2431
|
+
type: String,
|
|
2432
|
+
default: "vv-dropdown--mobile-fade-block"
|
|
2433
|
+
},
|
|
2434
|
+
/**
|
|
2435
|
+
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
2436
|
+
*/
|
|
2437
|
+
modelValue: {
|
|
2438
|
+
type: [String, Number, Boolean, Object, Array],
|
|
2439
|
+
default: void 0
|
|
2440
|
+
},
|
|
2441
|
+
/**
|
|
2442
|
+
* Label for no search results
|
|
2443
|
+
*/
|
|
2444
|
+
noResultsLabel: { type: String, default: "No results" },
|
|
2445
|
+
/**
|
|
2446
|
+
* Label for no options available
|
|
2447
|
+
*/
|
|
2448
|
+
noOptionsLabel: { type: String, default: "No options available" },
|
|
2449
|
+
/**
|
|
2450
|
+
* Label for selected option hint
|
|
2451
|
+
*/
|
|
2452
|
+
selectedHintLabel: { type: String, default: "Selected" },
|
|
2453
|
+
/**
|
|
2454
|
+
* Label for deselect action button
|
|
2455
|
+
*/
|
|
2456
|
+
deselectActionLabel: { type: String, default: "Deselect" },
|
|
2457
|
+
/**
|
|
2458
|
+
* Label for select option hint
|
|
2459
|
+
*/
|
|
2460
|
+
selectHintLabel: { type: String, default: "Press enter to select" },
|
|
2461
|
+
/**
|
|
2462
|
+
* Label for deselected option hint
|
|
2463
|
+
*/
|
|
2464
|
+
deselectHintLabel: { type: String, default: "Press enter to remove" },
|
|
2465
|
+
/**
|
|
2466
|
+
* Label close button
|
|
2467
|
+
*/
|
|
2468
|
+
closeLabel: { type: String, default: "Close" },
|
|
2469
|
+
/**
|
|
2470
|
+
* Select input placeholder
|
|
2471
|
+
*/
|
|
2472
|
+
placeholder: String,
|
|
2473
|
+
/**
|
|
2474
|
+
* Use input text to search on options
|
|
2475
|
+
*/
|
|
2476
|
+
searchable: Boolean,
|
|
2477
|
+
/**
|
|
2478
|
+
* Search function to filter options
|
|
2479
|
+
*/
|
|
2480
|
+
searchFunction: {
|
|
2481
|
+
type: Function,
|
|
2482
|
+
default: void 0
|
|
2483
|
+
},
|
|
2484
|
+
/**
|
|
2485
|
+
* On searchable select is the input search placeholder
|
|
2486
|
+
*/
|
|
2487
|
+
searchPlaceholder: {
|
|
2488
|
+
type: String,
|
|
2489
|
+
default: "Search..."
|
|
2490
|
+
},
|
|
2491
|
+
/**
|
|
2492
|
+
* The input search debounce time in ms
|
|
2493
|
+
*/
|
|
2494
|
+
debounceSearch: {
|
|
2495
|
+
type: [Number, String],
|
|
2496
|
+
default: 0
|
|
2497
|
+
},
|
|
2498
|
+
/**
|
|
2499
|
+
* Manage modelValue as string[] or object[]
|
|
2500
|
+
*/
|
|
2501
|
+
multiple: Boolean,
|
|
2502
|
+
/**
|
|
2503
|
+
* The max number of selected values
|
|
2504
|
+
*/
|
|
2505
|
+
maxValues: [Number, String],
|
|
2506
|
+
/**
|
|
2507
|
+
* The select label separator visible to the user
|
|
2508
|
+
*/
|
|
2509
|
+
separator: { type: String, default: ", " },
|
|
2510
|
+
/**
|
|
2511
|
+
* Show native select
|
|
2512
|
+
*/
|
|
2513
|
+
native: Boolean,
|
|
2514
|
+
/**
|
|
2515
|
+
* Show badges
|
|
2516
|
+
*/
|
|
2517
|
+
badges: Boolean,
|
|
2518
|
+
/**
|
|
2519
|
+
* Badge modifiers
|
|
2520
|
+
*/
|
|
2521
|
+
badgeModifiers: {
|
|
2522
|
+
type: [String, Array],
|
|
2523
|
+
default: "action sm"
|
|
2524
|
+
},
|
|
2525
|
+
/**
|
|
2526
|
+
* Set dropdown width to the same as the trigger
|
|
2527
|
+
*/
|
|
2528
|
+
triggerWidth: {
|
|
2529
|
+
...DropdownProps.triggerWidth,
|
|
2530
|
+
default: true
|
|
2531
|
+
},
|
|
2532
|
+
/**
|
|
2533
|
+
* Dropdown modifiers
|
|
2534
|
+
*/
|
|
2535
|
+
dropdownModifiers: {
|
|
2536
|
+
type: [String, Array],
|
|
2537
|
+
default: "mobile"
|
|
2538
|
+
},
|
|
2539
|
+
/**
|
|
2540
|
+
* Open dropdown on focus
|
|
2541
|
+
*/
|
|
2542
|
+
autoOpen: {
|
|
2543
|
+
type: Boolean,
|
|
2544
|
+
default: false
|
|
2545
|
+
},
|
|
2546
|
+
/**
|
|
2547
|
+
* Keep open dropdown on single select
|
|
2548
|
+
*/
|
|
2549
|
+
keepOpen: {
|
|
2550
|
+
type: Boolean,
|
|
2551
|
+
default: false
|
|
2552
|
+
}
|
|
2553
|
+
};
|
|
2554
|
+
function useVvComboboxProps() {
|
|
2555
|
+
return {
|
|
2556
|
+
...VvComboboxProps,
|
|
2557
|
+
options: {
|
|
2558
|
+
...VvComboboxProps.options,
|
|
2559
|
+
type: Array
|
|
2560
|
+
},
|
|
2561
|
+
searchFunction: {
|
|
2562
|
+
...VvComboboxProps.searchFunction,
|
|
2563
|
+
type: Function
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
}
|
|
2412
2567
|
const _hoisted_1 = ["id"];
|
|
2413
2568
|
const _hoisted_2 = ["id", "for"];
|
|
2414
2569
|
const _hoisted_3 = ["id", "aria-controls", "placeholder"];
|
|
@@ -2417,7 +2572,7 @@ const _hoisted_4 = {
|
|
|
2417
2572
|
class: "vv-select__input-before"
|
|
2418
2573
|
};
|
|
2419
2574
|
const _hoisted_5 = { class: "vv-select__inner" };
|
|
2420
|
-
const _hoisted_6 = ["aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2575
|
+
const _hoisted_6 = ["aria-controls", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
2421
2576
|
const _hoisted_7 = {
|
|
2422
2577
|
key: 0,
|
|
2423
2578
|
class: "vv-select__value"
|
|
@@ -2438,22 +2593,25 @@ const __default__ = {
|
|
|
2438
2593
|
};
|
|
2439
2594
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2440
2595
|
...__default__,
|
|
2441
|
-
props:
|
|
2442
|
-
emits:
|
|
2443
|
-
setup(__props, { emit }) {
|
|
2596
|
+
props: useVvComboboxProps(),
|
|
2597
|
+
emits: ["update:modelValue", "update:search", "change:search", "focus", "blur"],
|
|
2598
|
+
setup(__props, { emit: __emit }) {
|
|
2444
2599
|
const props = __props;
|
|
2600
|
+
const emit = __emit;
|
|
2445
2601
|
const slots = useSlots();
|
|
2602
|
+
const VvComboboxProps2 = useVvComboboxProps();
|
|
2446
2603
|
const propsDefaults = useDefaults(
|
|
2447
2604
|
"VvCombobox",
|
|
2448
|
-
|
|
2605
|
+
VvComboboxProps2,
|
|
2449
2606
|
props
|
|
2450
2607
|
);
|
|
2451
|
-
|
|
2608
|
+
function isGroup(option) {
|
|
2609
|
+
var _a;
|
|
2452
2610
|
if (typeof option === "string") {
|
|
2453
2611
|
return false;
|
|
2454
2612
|
}
|
|
2455
|
-
return
|
|
2456
|
-
}
|
|
2613
|
+
return (_a = option.options) == null ? void 0 : _a.length;
|
|
2614
|
+
}
|
|
2457
2615
|
const {
|
|
2458
2616
|
HintSlot,
|
|
2459
2617
|
hasHintLabelOrSlot,
|
|
@@ -2487,27 +2645,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2487
2645
|
searchText,
|
|
2488
2646
|
computed(() => Number(props.debounceSearch))
|
|
2489
2647
|
);
|
|
2490
|
-
watch(
|
|
2491
|
-
debouncedSearchText
|
|
2492
|
-
|
|
2493
|
-
);
|
|
2648
|
+
watch(debouncedSearchText, () => {
|
|
2649
|
+
emit("update:search", debouncedSearchText.value);
|
|
2650
|
+
emit("change:search", debouncedSearchText.value);
|
|
2651
|
+
});
|
|
2494
2652
|
const expanded = ref(false);
|
|
2495
|
-
|
|
2653
|
+
function toggleExpanded() {
|
|
2496
2654
|
if (props.disabled || props.readonly)
|
|
2497
2655
|
return;
|
|
2498
2656
|
expanded.value = !expanded.value;
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2657
|
+
}
|
|
2658
|
+
function expand() {
|
|
2501
2659
|
if (props.disabled || props.readonly || expanded.value)
|
|
2502
2660
|
return;
|
|
2503
2661
|
expanded.value = true;
|
|
2504
|
-
}
|
|
2505
|
-
|
|
2662
|
+
}
|
|
2663
|
+
function collapse() {
|
|
2506
2664
|
if (props.disabled || props.readonly || !expanded.value)
|
|
2507
2665
|
return;
|
|
2508
2666
|
expanded.value = false;
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2667
|
+
}
|
|
2668
|
+
function onAfterExpand() {
|
|
2511
2669
|
if (propsDefaults.value.searchable) {
|
|
2512
2670
|
if (inputSearchEl.value) {
|
|
2513
2671
|
inputSearchEl.value.focus({
|
|
@@ -2515,12 +2673,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2515
2673
|
});
|
|
2516
2674
|
}
|
|
2517
2675
|
}
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2676
|
+
}
|
|
2677
|
+
function onAfterCollapse() {
|
|
2520
2678
|
if (propsDefaults.value.searchable) {
|
|
2521
2679
|
searchText.value = "";
|
|
2522
2680
|
}
|
|
2523
|
-
}
|
|
2681
|
+
}
|
|
2524
2682
|
const {
|
|
2525
2683
|
id,
|
|
2526
2684
|
icon,
|
|
@@ -2541,10 +2699,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2541
2699
|
const localLoading = ref(false);
|
|
2542
2700
|
const isLoading = computed(() => localLoading.value || loading.value);
|
|
2543
2701
|
const dropdownEl = ref();
|
|
2544
|
-
const {
|
|
2545
|
-
icon,
|
|
2546
|
-
iconPosition
|
|
2547
|
-
);
|
|
2702
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
2548
2703
|
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
2549
2704
|
const hasTabindex = computed(() => {
|
|
2550
2705
|
return disabled.value || readonly.value ? -1 : props.tabindex;
|
|
@@ -2553,17 +2708,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2553
2708
|
"vv-select",
|
|
2554
2709
|
modifiers,
|
|
2555
2710
|
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
|
|
2711
|
+
"disabled": disabled.value,
|
|
2712
|
+
"loading": isLoading.value,
|
|
2713
|
+
"readonly": readonly.value,
|
|
2714
|
+
"icon-before": hasIconBefore.value !== void 0,
|
|
2715
|
+
"icon-after": hasIconAfter.value !== void 0,
|
|
2716
|
+
"valid": valid.value,
|
|
2717
|
+
"invalid": invalid.value,
|
|
2718
|
+
"dirty": isDirty.value,
|
|
2719
|
+
"focus": focused.value || focusedWithin.value || expanded.value,
|
|
2720
|
+
"floating": floating.value,
|
|
2721
|
+
"badges": props.badges
|
|
2567
2722
|
}))
|
|
2568
2723
|
);
|
|
2569
2724
|
const {
|
|
@@ -2612,10 +2767,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2612
2767
|
const hasValue = computed(() => {
|
|
2613
2768
|
return selectedOptions.value.map((option) => getOptionLabel(option)).join(props.separator);
|
|
2614
2769
|
});
|
|
2615
|
-
|
|
2770
|
+
function onClickInput() {
|
|
2616
2771
|
props.autoOpen ? expand() : toggleExpanded();
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2772
|
+
}
|
|
2773
|
+
function onInput(option) {
|
|
2619
2774
|
var _a;
|
|
2620
2775
|
if (props.disabled || props.readonly) {
|
|
2621
2776
|
return;
|
|
@@ -2649,7 +2804,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2649
2804
|
}
|
|
2650
2805
|
}
|
|
2651
2806
|
emit("update:modelValue", toReturn);
|
|
2652
|
-
}
|
|
2807
|
+
}
|
|
2653
2808
|
const selectProps = computed(() => ({
|
|
2654
2809
|
id: hasId.value,
|
|
2655
2810
|
name: props.name,
|
|
@@ -2720,208 +2875,307 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2720
2875
|
key: 0,
|
|
2721
2876
|
id: unref(hasLabelId),
|
|
2722
2877
|
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)
|
|
2878
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
2879
|
+
createElementVNode(
|
|
2880
|
+
"div",
|
|
2881
|
+
{
|
|
2882
|
+
ref_key: "wrapperEl",
|
|
2883
|
+
ref: wrapperEl,
|
|
2884
|
+
class: "vv-select__wrapper"
|
|
2885
|
+
},
|
|
2886
|
+
[
|
|
2887
|
+
createVNode(_sfc_main$8, mergeProps({
|
|
2888
|
+
ref_key: "dropdownEl",
|
|
2889
|
+
ref: dropdownEl,
|
|
2890
|
+
modelValue: unref(expanded),
|
|
2891
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
2892
|
+
}, unref(dropdownProps), {
|
|
2893
|
+
role: unref(DropdownRole).listbox,
|
|
2894
|
+
onAfterExpand,
|
|
2895
|
+
onAfterCollapse
|
|
2896
|
+
}), createSlots({
|
|
2897
|
+
default: withCtx(({ aria }) => [
|
|
2898
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
2899
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2900
|
+
])) : createCommentVNode("v-if", true),
|
|
2901
|
+
createElementVNode("div", _hoisted_5, [
|
|
2902
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
2903
|
+
_sfc_main$9,
|
|
2904
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-select__icon" }),
|
|
2905
|
+
null,
|
|
2906
|
+
16
|
|
2907
|
+
/* FULL_PROPS */
|
|
2908
|
+
)) : createCommentVNode("v-if", true),
|
|
2909
|
+
createElementVNode("div", mergeProps({
|
|
2910
|
+
ref_key: "inputEl",
|
|
2911
|
+
ref: inputEl
|
|
2912
|
+
}, aria, {
|
|
2913
|
+
class: "vv-select__input",
|
|
2914
|
+
role: "combobox",
|
|
2915
|
+
"aria-controls": unref(hasDropdownId),
|
|
2916
|
+
"aria-expanded": unref(expanded),
|
|
2917
|
+
"aria-labelledby": unref(hasLabelId),
|
|
2918
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2919
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2920
|
+
tabindex: unref(hasTabindex),
|
|
2921
|
+
onClickPassive: onClickInput
|
|
2922
|
+
}), [
|
|
2923
|
+
renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
2924
|
+
unref(hasValue) ? (openBlock(), createElementBlock(
|
|
2925
|
+
Fragment,
|
|
2926
|
+
{ key: 0 },
|
|
2927
|
+
[
|
|
2928
|
+
!_ctx.badges ? (openBlock(), createElementBlock(
|
|
2929
|
+
"div",
|
|
2930
|
+
_hoisted_7,
|
|
2931
|
+
toDisplayString(unref(hasValue)),
|
|
2932
|
+
1
|
|
2933
|
+
/* TEXT */
|
|
2934
|
+
)) : (openBlock(true), createElementBlock(
|
|
2935
|
+
Fragment,
|
|
2936
|
+
{ key: 1 },
|
|
2937
|
+
renderList(unref(selectedOptions), (option, index) => {
|
|
2938
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
2939
|
+
key: index,
|
|
2940
|
+
modifiers: _ctx.badgeModifiers,
|
|
2941
|
+
class: "vv-select__badge"
|
|
2942
|
+
}, {
|
|
2943
|
+
default: withCtx(() => [
|
|
2944
|
+
createTextVNode(
|
|
2945
|
+
toDisplayString(unref(getOptionLabel)(option)) + " ",
|
|
2946
|
+
1
|
|
2947
|
+
/* TEXT */
|
|
2948
|
+
),
|
|
2949
|
+
_ctx.unselectable && !unref(readonly) && !unref(disabled) ? (openBlock(), createElementBlock("button", {
|
|
2950
|
+
key: 0,
|
|
2951
|
+
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
2952
|
+
type: "button",
|
|
2953
|
+
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
2954
|
+
}, [
|
|
2955
|
+
createVNode(_sfc_main$9, { name: "close" })
|
|
2956
|
+
], 8, _hoisted_8)) : createCommentVNode("v-if", true)
|
|
2957
|
+
]),
|
|
2958
|
+
_: 2
|
|
2959
|
+
/* DYNAMIC */
|
|
2960
|
+
}, 1032, ["modifiers"]);
|
|
2961
|
+
}),
|
|
2962
|
+
128
|
|
2963
|
+
/* KEYED_FRAGMENT */
|
|
2964
|
+
))
|
|
2965
|
+
],
|
|
2966
|
+
64
|
|
2967
|
+
/* STABLE_FRAGMENT */
|
|
2968
|
+
)) : (openBlock(), createElementBlock(
|
|
2969
|
+
Fragment,
|
|
2970
|
+
{ key: 1 },
|
|
2971
|
+
[
|
|
2972
|
+
createTextVNode(
|
|
2973
|
+
toDisplayString(_ctx.placeholder),
|
|
2974
|
+
1
|
|
2975
|
+
/* TEXT */
|
|
2976
|
+
)
|
|
2977
|
+
],
|
|
2978
|
+
64
|
|
2979
|
+
/* STABLE_FRAGMENT */
|
|
2980
|
+
))
|
|
2875
2981
|
])
|
|
2876
|
-
]),
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2982
|
+
], 16, _hoisted_6),
|
|
2983
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
2984
|
+
_sfc_main$9,
|
|
2985
|
+
mergeProps({ key: 1 }, unref(hasIconAfter), { class: "vv-select__icon vv-select__icon-after" }),
|
|
2986
|
+
null,
|
|
2987
|
+
16
|
|
2988
|
+
/* FULL_PROPS */
|
|
2989
|
+
)) : createCommentVNode("v-if", true)
|
|
2990
|
+
]),
|
|
2991
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
2992
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2993
|
+
])) : createCommentVNode("v-if", true)
|
|
2994
|
+
]),
|
|
2995
|
+
items: withCtx(() => {
|
|
2883
2996
|
var _a;
|
|
2884
2997
|
return [
|
|
2885
|
-
((_a = unref(
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2998
|
+
!unref(disabled) && ((_a = unref(filteredOptions)) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(
|
|
2999
|
+
Fragment,
|
|
3000
|
+
{ key: 0 },
|
|
3001
|
+
renderList(unref(filteredOptions), (option, index) => {
|
|
3002
|
+
return openBlock(), createElementBlock(
|
|
3003
|
+
Fragment,
|
|
3004
|
+
{ key: index },
|
|
3005
|
+
[
|
|
3006
|
+
isGroup(option) ? (openBlock(), createElementBlock(
|
|
3007
|
+
Fragment,
|
|
3008
|
+
{ key: 0 },
|
|
3009
|
+
[
|
|
3010
|
+
createVNode(_sfc_main$5, {
|
|
3011
|
+
label: unref(getOptionLabel)(option)
|
|
3012
|
+
}, null, 8, ["label"]),
|
|
3013
|
+
(openBlock(true), createElementBlock(
|
|
3014
|
+
Fragment,
|
|
3015
|
+
null,
|
|
3016
|
+
renderList(unref(getOptionGrouped)(
|
|
3017
|
+
option
|
|
3018
|
+
), (item, i) => {
|
|
3019
|
+
return openBlock(), createBlock(_sfc_main$6, mergeProps({ ref_for: true }, {
|
|
3020
|
+
selected: isOptionSelected(item),
|
|
3021
|
+
disabled: unref(isOptionDisabled)(item),
|
|
3022
|
+
unselectable: _ctx.unselectable,
|
|
3023
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3024
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3025
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3026
|
+
}, {
|
|
3027
|
+
key: i,
|
|
3028
|
+
class: "vv-dropdown-option",
|
|
3029
|
+
"focus-on-hover": "",
|
|
3030
|
+
onClickPassive: ($event) => onInput(item)
|
|
3031
|
+
}), {
|
|
3032
|
+
default: withCtx(() => [
|
|
3033
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3034
|
+
option,
|
|
3035
|
+
selectedOptions: unref(selectedOptions),
|
|
3036
|
+
selected: isOptionSelected(item),
|
|
3037
|
+
disabled: unref(isOptionDisabled)(item)
|
|
3038
|
+
}), () => [
|
|
3039
|
+
createTextVNode(
|
|
3040
|
+
toDisplayString(unref(getOptionLabel)(item)),
|
|
3041
|
+
1
|
|
3042
|
+
/* TEXT */
|
|
3043
|
+
)
|
|
3044
|
+
])
|
|
3045
|
+
]),
|
|
3046
|
+
_: 2
|
|
3047
|
+
/* DYNAMIC */
|
|
3048
|
+
}, 1040, ["onClickPassive"]);
|
|
3049
|
+
}),
|
|
3050
|
+
128
|
|
3051
|
+
/* KEYED_FRAGMENT */
|
|
3052
|
+
))
|
|
3053
|
+
],
|
|
3054
|
+
64
|
|
3055
|
+
/* STABLE_FRAGMENT */
|
|
3056
|
+
)) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
3057
|
+
key: 1,
|
|
3058
|
+
ref_for: true
|
|
3059
|
+
}, {
|
|
3060
|
+
selected: isOptionSelected(option),
|
|
3061
|
+
disabled: unref(isOptionDisabled)(option),
|
|
3062
|
+
unselectable: _ctx.unselectable,
|
|
3063
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3064
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3065
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3066
|
+
}, {
|
|
3067
|
+
class: "vv-dropdown-option",
|
|
3068
|
+
"focus-on-hover": "",
|
|
3069
|
+
onClickPassive: ($event) => onInput(option)
|
|
3070
|
+
}), {
|
|
3071
|
+
default: withCtx(() => [
|
|
3072
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
3073
|
+
option,
|
|
3074
|
+
selectedOptions: unref(selectedOptions),
|
|
3075
|
+
selected: isOptionSelected(option),
|
|
3076
|
+
disabled: unref(isOptionDisabled)(option)
|
|
3077
|
+
}), () => [
|
|
3078
|
+
createTextVNode(
|
|
3079
|
+
toDisplayString(unref(getOptionLabel)(option)),
|
|
3080
|
+
1
|
|
3081
|
+
/* TEXT */
|
|
3082
|
+
)
|
|
3083
|
+
])
|
|
3084
|
+
]),
|
|
3085
|
+
_: 2
|
|
3086
|
+
/* DYNAMIC */
|
|
3087
|
+
}, 1040, ["onClickPassive"]))
|
|
3088
|
+
],
|
|
3089
|
+
64
|
|
3090
|
+
/* STABLE_FRAGMENT */
|
|
3091
|
+
);
|
|
3092
|
+
}),
|
|
3093
|
+
128
|
|
3094
|
+
/* KEYED_FRAGMENT */
|
|
3095
|
+
)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$6, {
|
|
3096
|
+
key: 1,
|
|
3097
|
+
modifiers: "inert"
|
|
3098
|
+
}, {
|
|
3099
|
+
default: withCtx(() => [
|
|
3100
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
3101
|
+
createTextVNode(
|
|
3102
|
+
toDisplayString(unref(propsDefaults).noOptionsLabel),
|
|
3103
|
+
1
|
|
3104
|
+
/* TEXT */
|
|
3105
|
+
)
|
|
3106
|
+
])
|
|
3107
|
+
]),
|
|
3108
|
+
_: 3
|
|
3109
|
+
/* FORWARDED */
|
|
3110
|
+
})) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$6, {
|
|
3111
|
+
key: 2,
|
|
3112
|
+
modifiers: "inert"
|
|
3113
|
+
}, {
|
|
3114
|
+
default: withCtx(() => [
|
|
3115
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
3116
|
+
createTextVNode(
|
|
3117
|
+
toDisplayString(unref(propsDefaults).noResultsLabel),
|
|
3118
|
+
1
|
|
3119
|
+
/* TEXT */
|
|
3120
|
+
)
|
|
3121
|
+
])
|
|
3122
|
+
]),
|
|
3123
|
+
_: 3
|
|
3124
|
+
/* FORWARDED */
|
|
3125
|
+
})) : createCommentVNode("v-if", true)
|
|
2891
3126
|
];
|
|
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)
|
|
3127
|
+
}),
|
|
3128
|
+
after: withCtx(() => [
|
|
3129
|
+
renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
|
|
3130
|
+
var _a;
|
|
3131
|
+
return [
|
|
3132
|
+
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
3133
|
+
key: 0,
|
|
3134
|
+
label: unref(propsDefaults).closeLabel,
|
|
3135
|
+
modifiers: "secondary",
|
|
3136
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
3137
|
+
}, null, 8, ["label"])) : createCommentVNode("v-if", true)
|
|
3138
|
+
];
|
|
3139
|
+
})
|
|
2916
3140
|
]),
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
3141
|
+
_: 2
|
|
3142
|
+
/* DYNAMIC */
|
|
3143
|
+
}, [
|
|
3144
|
+
unref(propsDefaults).searchable || _ctx.$slots["dropdown::before"] ? {
|
|
3145
|
+
name: "before",
|
|
3146
|
+
fn: withCtx(() => [
|
|
3147
|
+
renderSlot(_ctx.$slots, "dropdown::before"),
|
|
3148
|
+
unref(propsDefaults).searchable && !unref(disabled) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3149
|
+
key: 0,
|
|
3150
|
+
id: unref(hasSearchId),
|
|
3151
|
+
ref_key: "inputSearchEl",
|
|
3152
|
+
ref: inputSearchEl,
|
|
3153
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
3154
|
+
"aria-autocomplete": "list",
|
|
3155
|
+
"aria-controls": unref(hasDropdownId),
|
|
3156
|
+
autocomplete: "off",
|
|
3157
|
+
spellcheck: "false",
|
|
3158
|
+
type: "search",
|
|
3159
|
+
class: "vv-dropdown__search",
|
|
3160
|
+
placeholder: unref(propsDefaults).searchPlaceholder
|
|
3161
|
+
}, null, 8, _hoisted_3)), [
|
|
3162
|
+
[vModelText, unref(searchText)]
|
|
3163
|
+
]) : createCommentVNode("v-if", true)
|
|
3164
|
+
]),
|
|
3165
|
+
key: "0"
|
|
3166
|
+
} : void 0
|
|
3167
|
+
]), 1040, ["modelValue", "role"])
|
|
3168
|
+
],
|
|
3169
|
+
512
|
|
3170
|
+
/* NEED_PATCH */
|
|
3171
|
+
),
|
|
2921
3172
|
createVNode(unref(HintSlot), {
|
|
2922
3173
|
id: unref(hasHintId),
|
|
2923
3174
|
class: "vv-select__hint"
|
|
2924
|
-
}, createSlots({
|
|
3175
|
+
}, createSlots({
|
|
3176
|
+
_: 2
|
|
3177
|
+
/* DYNAMIC */
|
|
3178
|
+
}, [
|
|
2925
3179
|
_ctx.$slots.hint ? {
|
|
2926
3180
|
name: "hint",
|
|
2927
3181
|
fn: withCtx(() => [
|
|
@@ -2951,9 +3205,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2951
3205
|
key: "3"
|
|
2952
3206
|
} : void 0
|
|
2953
3207
|
]), 1032, ["id"])
|
|
2954
|
-
], 10, _hoisted_1)) : (openBlock(), createBlock(
|
|
2955
|
-
|
|
2956
|
-
|
|
3208
|
+
], 10, _hoisted_1)) : (openBlock(), createBlock(
|
|
3209
|
+
_sfc_main$4,
|
|
3210
|
+
mergeProps({ key: 1 }, unref(selectProps), {
|
|
3211
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
|
|
3212
|
+
}),
|
|
3213
|
+
null,
|
|
3214
|
+
16
|
|
3215
|
+
/* FULL_PROPS */
|
|
3216
|
+
));
|
|
2957
3217
|
};
|
|
2958
3218
|
}
|
|
2959
3219
|
});
|