@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31
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 +106 -10
- package/auto-imports.d.ts +7 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +22 -15
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
- package/dist/components/VvAccordion/index.d.ts +8 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
- 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 +78 -27
- 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 +204 -171
- 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 +250 -188
- 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 +6 -14
- package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
- 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 +118 -48
- 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 +78 -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 +291 -252
- 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 +81 -40
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
- package/dist/components/VvButtonGroup/index.d.ts +8 -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 +177 -120
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
- package/dist/components/VvCheckbox/index.d.ts +47 -14
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
- 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 +806 -581
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
- package/dist/components/VvCombobox/index.d.ts +62 -26
- package/dist/components/VvDialog/VvDialog.es.js +140 -153
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +138 -71
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- 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 +152 -39
- 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 +23 -96
- 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 +1777 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
- package/dist/components/VvInputFile/index.d.ts +200 -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 +1237 -324
- 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 +99 -29
- package/dist/components/VvNav/VvNav.es.js +135 -56
- 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 +91 -33
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +72 -26
- 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 +160 -103
- 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 +190 -107
- 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 +251 -238
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +191 -75
- 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 +232 -224
- 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 +79 -29
- 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 +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +3534 -1650
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +99 -4
- 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 +92 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/usePersistence.d.ts +2 -0
- 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 +99 -43
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +97 -38
- 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 +90 -16
- 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/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -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/Tab/Tab.settings.d.ts +2 -15
- package/dist/test/expect.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 +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +78 -78
- package/src/Volver.ts +31 -20
- 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 +121 -58
- package/src/components/VvAccordion/index.ts +8 -23
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
- package/src/components/VvAccordionGroup/index.ts +6 -6
- package/src/components/VvAction/VvAction.vue +17 -5
- package/src/components/VvAlert/index.ts +14 -9
- package/src/components/VvAlertGroup/index.ts +3 -15
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +17 -7
- package/src/components/VvButton/index.ts +9 -16
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
- package/src/components/VvCheckbox/index.ts +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
- package/src/components/VvCombobox/VvCombobox.vue +15 -12
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +395 -0
- package/src/components/VvInputFile/index.ts +135 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +141 -33
- package/src/components/VvInputText/index.ts +31 -16
- package/src/components/VvNav/VvNav.vue +4 -2
- package/src/components/VvRadio/index.ts +5 -5
- package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +5 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/alert/useAlert.ts +12 -9
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/group/useInjectedGroupState.ts +20 -16
- package/src/composables/group/useProvideGroupState.ts +10 -15
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/usePersistence.ts +76 -0
- package/src/composables/useUniqueId.ts +2 -2
- package/src/constants.ts +47 -32
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +108 -31
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/Accordion/Accordion.test.ts +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
- package/src/stories/Alert/Alert.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/stories/Button/Button.test.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
- package/src/stories/Card/Card.test.ts +1 -1
- package/src/stories/Checkbox/Checkbox.test.ts +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/Dialog/Dialog.test.ts +2 -2
- package/src/stories/Dropdown/Dropdown.test.ts +1 -1
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -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.test.ts +1 -1
- package/src/stories/Nav/Nav.test.ts +1 -1
- package/src/stories/Progress/Progress.test.ts +1 -1
- package/src/stories/Radio/Radio.test.ts +1 -1
- package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
- package/src/stories/Select/Select.test.ts +1 -1
- package/src/stories/Tab/Tab.settings.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +1 -1
- package/src/stories/Textarea/Textarea.test.ts +1 -1
- package/src/stories/Tooltip/Tooltip.test.ts +1 -1
- package/src/stories/argTypes.ts +1 -1
- package/src/test/expect.ts +2 -4
- package/src/types/alert.ts +11 -7
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +3 -3
- package/src/types/group.ts +22 -14
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +2 -3
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { computed, defineComponent, provide, h, Fragment, unref, toRefs, useAttrs, ref, onMounted, watch, nextTick, openBlock, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, mergeProps, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, createCommentVNode, vShow } from "vue";
|
|
2
2
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
3
|
-
import {
|
|
4
|
-
import { useMutationObserver, useVModel, onClickOutside, useFocusWithin, onKeyStroke } from "@vueuse/core";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { useMutationObserver, useVModel, onClickOutside, useFocusWithin, useElementHover, onKeyStroke } from "@vueuse/core";
|
|
5
5
|
import mitt from "mitt";
|
|
6
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
7
|
+
StorageType2["local"] = "local";
|
|
8
|
+
StorageType2["session"] = "session";
|
|
9
|
+
return StorageType2;
|
|
10
|
+
})(StorageType || {});
|
|
6
11
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
7
12
|
Strategy2["absolute"] = "absolute";
|
|
8
13
|
Strategy2["fixed"] = "fixed";
|
|
@@ -37,6 +42,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
37
42
|
ButtonType2["reset"] = "reset";
|
|
38
43
|
return ButtonType2;
|
|
39
44
|
})(ButtonType || {});
|
|
45
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
46
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
47
|
+
ActionTag2["routerLink"] = "router-link";
|
|
48
|
+
ActionTag2["a"] = "a";
|
|
49
|
+
ActionTag2["button"] = "button";
|
|
50
|
+
return ActionTag2;
|
|
51
|
+
})(ActionTag || {});
|
|
40
52
|
var DropdownRole = /* @__PURE__ */ ((DropdownRole2) => {
|
|
41
53
|
DropdownRole2["listbox"] = "listbox";
|
|
42
54
|
DropdownRole2["menu"] = "menu";
|
|
@@ -47,13 +59,6 @@ var DropdownItemRole = /* @__PURE__ */ ((DropdownItemRole2) => {
|
|
|
47
59
|
DropdownItemRole2["presentation"] = "presentation";
|
|
48
60
|
return DropdownItemRole2;
|
|
49
61
|
})(DropdownItemRole || {});
|
|
50
|
-
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
51
|
-
AnchorTarget2["_blank"] = "_blank";
|
|
52
|
-
AnchorTarget2["_self"] = "_self";
|
|
53
|
-
AnchorTarget2["_parent"] = "_parent";
|
|
54
|
-
AnchorTarget2["_top"] = "_top";
|
|
55
|
-
return AnchorTarget2;
|
|
56
|
-
})(AnchorTarget || {});
|
|
57
62
|
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
58
63
|
"dropdownTrigger"
|
|
59
64
|
);
|
|
@@ -75,10 +80,7 @@ const LinkProps = {
|
|
|
75
80
|
/**
|
|
76
81
|
* Anchor target
|
|
77
82
|
*/
|
|
78
|
-
target:
|
|
79
|
-
type: String,
|
|
80
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
81
|
-
},
|
|
83
|
+
target: String,
|
|
82
84
|
/**
|
|
83
85
|
* Anchor rel
|
|
84
86
|
*/
|
|
@@ -91,44 +93,65 @@ const DisabledProps = {
|
|
|
91
93
|
/**
|
|
92
94
|
* Whether the form control is disabled
|
|
93
95
|
*/
|
|
94
|
-
disabled:
|
|
96
|
+
disabled: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false
|
|
99
|
+
}
|
|
95
100
|
};
|
|
96
101
|
const ActiveProps = {
|
|
97
102
|
/**
|
|
98
103
|
* Whether the item is active
|
|
99
104
|
*/
|
|
100
|
-
active:
|
|
105
|
+
active: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
108
|
+
}
|
|
101
109
|
};
|
|
102
110
|
const CurrentProps = {
|
|
103
111
|
/**
|
|
104
112
|
* Whether the item is current
|
|
105
113
|
*/
|
|
106
|
-
current:
|
|
114
|
+
current: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false
|
|
117
|
+
}
|
|
107
118
|
};
|
|
108
119
|
const PressedProps = {
|
|
109
120
|
/**
|
|
110
121
|
* Whether the item is pressed
|
|
111
122
|
*/
|
|
112
|
-
pressed:
|
|
123
|
+
pressed: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
126
|
+
}
|
|
113
127
|
};
|
|
114
128
|
const LabelProps = {
|
|
115
129
|
/**
|
|
116
130
|
* The item label
|
|
117
131
|
*/
|
|
118
|
-
label:
|
|
132
|
+
label: {
|
|
133
|
+
type: [String, Number],
|
|
134
|
+
default: void 0
|
|
135
|
+
}
|
|
119
136
|
};
|
|
120
137
|
const ModifiersProps = {
|
|
121
138
|
/**
|
|
122
139
|
* Component BEM modifiers
|
|
123
140
|
*/
|
|
124
|
-
modifiers:
|
|
141
|
+
modifiers: {
|
|
142
|
+
type: [String, Array],
|
|
143
|
+
default: void 0
|
|
144
|
+
}
|
|
125
145
|
};
|
|
126
146
|
({
|
|
127
147
|
/**
|
|
128
148
|
* VvIcon name or props
|
|
129
149
|
* @see VVIcon
|
|
130
150
|
*/
|
|
131
|
-
icon: {
|
|
151
|
+
icon: {
|
|
152
|
+
type: [String, Object],
|
|
153
|
+
default: void 0
|
|
154
|
+
},
|
|
132
155
|
/**
|
|
133
156
|
* VvIcon position
|
|
134
157
|
*/
|
|
@@ -166,7 +189,8 @@ const DropdownProps = {
|
|
|
166
189
|
* Dropdown show / hide transition name
|
|
167
190
|
*/
|
|
168
191
|
transitionName: {
|
|
169
|
-
type: String
|
|
192
|
+
type: String,
|
|
193
|
+
default: void 0
|
|
170
194
|
},
|
|
171
195
|
/**
|
|
172
196
|
* Offset of the dropdown from the trigger
|
|
@@ -234,7 +258,8 @@ const DropdownProps = {
|
|
|
234
258
|
* Set dropdown width to the same as the trigger
|
|
235
259
|
*/
|
|
236
260
|
triggerWidth: {
|
|
237
|
-
type: Boolean
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: false
|
|
238
263
|
}
|
|
239
264
|
};
|
|
240
265
|
({
|
|
@@ -258,8 +283,23 @@ const DropdownProps = {
|
|
|
258
283
|
ariaLabel: {
|
|
259
284
|
type: String,
|
|
260
285
|
default: void 0
|
|
286
|
+
},
|
|
287
|
+
/**
|
|
288
|
+
* Default tag for the action
|
|
289
|
+
*/
|
|
290
|
+
defaultTag: {
|
|
291
|
+
type: String,
|
|
292
|
+
default: ActionTag.button
|
|
261
293
|
}
|
|
262
294
|
});
|
|
295
|
+
({
|
|
296
|
+
storageType: {
|
|
297
|
+
type: String,
|
|
298
|
+
default: StorageType.local,
|
|
299
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
300
|
+
},
|
|
301
|
+
storageKey: String
|
|
302
|
+
});
|
|
263
303
|
const VvDropdownProps = {
|
|
264
304
|
...IdProps,
|
|
265
305
|
...DropdownProps,
|
|
@@ -287,7 +327,7 @@ const VvDropdownProps = {
|
|
|
287
327
|
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
288
328
|
}
|
|
289
329
|
};
|
|
290
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
330
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
291
331
|
function useProvideDropdownTrigger({
|
|
292
332
|
reference,
|
|
293
333
|
id,
|
|
@@ -318,14 +358,14 @@ function useProvideDropdownTrigger({
|
|
|
318
358
|
}
|
|
319
359
|
function useProvideDropdownItem({
|
|
320
360
|
role,
|
|
321
|
-
|
|
361
|
+
...others
|
|
322
362
|
}) {
|
|
323
363
|
const itemRole = computed(
|
|
324
364
|
() => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
|
|
325
365
|
);
|
|
326
366
|
provide(INJECTION_KEY_DROPDOWN_ITEM, {
|
|
327
367
|
role: itemRole,
|
|
328
|
-
|
|
368
|
+
...others
|
|
329
369
|
});
|
|
330
370
|
return { itemRole };
|
|
331
371
|
}
|
|
@@ -375,8 +415,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
375
415
|
"leave",
|
|
376
416
|
"leave-cancelled"
|
|
377
417
|
],
|
|
378
|
-
setup(__props, { expose: __expose, emit }) {
|
|
418
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
379
419
|
const props = __props;
|
|
420
|
+
const emit = __emit;
|
|
380
421
|
const { id } = toRefs(props);
|
|
381
422
|
const hasId = useUniqueId(id);
|
|
382
423
|
const attrs = useAttrs();
|
|
@@ -590,7 +631,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
590
631
|
});
|
|
591
632
|
bus.on("click", toggle);
|
|
592
633
|
const { role, modifiers } = toRefs(props);
|
|
593
|
-
const { itemRole } = useProvideDropdownItem({ role, expanded });
|
|
594
634
|
const bemCssClasses = useModifiers(
|
|
595
635
|
"vv-dropdown",
|
|
596
636
|
modifiers,
|
|
@@ -659,6 +699,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
659
699
|
}
|
|
660
700
|
});
|
|
661
701
|
};
|
|
702
|
+
const hovered = useElementHover(floatingEl);
|
|
703
|
+
const { itemRole } = useProvideDropdownItem({
|
|
704
|
+
role,
|
|
705
|
+
expanded,
|
|
706
|
+
focused,
|
|
707
|
+
hovered
|
|
708
|
+
});
|
|
662
709
|
onKeyStroke("Escape", (e) => {
|
|
663
710
|
if (expanded.value) {
|
|
664
711
|
e.preventDefault();
|
|
@@ -712,50 +759,70 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
712
759
|
}
|
|
713
760
|
};
|
|
714
761
|
return (_ctx, _cache) => {
|
|
715
|
-
return openBlock(), createElementBlock(
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
762
|
+
return openBlock(), createElementBlock(
|
|
763
|
+
Fragment,
|
|
764
|
+
null,
|
|
765
|
+
[
|
|
766
|
+
createVNode(unref(VvDropdownTriggerProvider), null, {
|
|
767
|
+
default: withCtx(() => [
|
|
768
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
|
|
769
|
+
]),
|
|
770
|
+
_: 3
|
|
771
|
+
/* FORWARDED */
|
|
772
|
+
}),
|
|
773
|
+
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers), { persisted: "" }), {
|
|
774
|
+
default: withCtx(() => [
|
|
775
|
+
withDirectives(createElementVNode(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
ref_key: "floatingEl",
|
|
779
|
+
ref: floatingEl,
|
|
780
|
+
style: normalizeStyle(unref(dropdownPlacement)),
|
|
781
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
782
|
+
},
|
|
783
|
+
[
|
|
784
|
+
props.arrow ? (openBlock(), createElementBlock(
|
|
785
|
+
"div",
|
|
786
|
+
{
|
|
787
|
+
key: 0,
|
|
788
|
+
ref_key: "arrowEl",
|
|
789
|
+
ref: arrowEl,
|
|
790
|
+
style: normalizeStyle(unref(arrowPlacement)),
|
|
791
|
+
class: "vv-dropdown__arrow"
|
|
792
|
+
},
|
|
793
|
+
null,
|
|
794
|
+
4
|
|
795
|
+
/* STYLE */
|
|
796
|
+
)) : createCommentVNode("v-if", true),
|
|
797
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
|
|
798
|
+
createElementVNode("div", mergeProps(unref(attrs), {
|
|
799
|
+
id: unref(hasId),
|
|
800
|
+
ref_key: "listEl",
|
|
801
|
+
ref: listEl,
|
|
802
|
+
tabindex: !unref(expanded) ? -1 : void 0,
|
|
803
|
+
role: unref(role),
|
|
804
|
+
"aria-labelledby": unref(hasAriaLabelledby),
|
|
805
|
+
class: "vv-dropdown__list"
|
|
806
|
+
}), [
|
|
807
|
+
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
808
|
+
role: unref(itemRole)
|
|
809
|
+
})))
|
|
810
|
+
], 16, _hoisted_1),
|
|
811
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
812
|
+
],
|
|
813
|
+
6
|
|
814
|
+
/* CLASS, STYLE */
|
|
815
|
+
), [
|
|
816
|
+
[vShow, unref(expanded)]
|
|
817
|
+
])
|
|
818
|
+
]),
|
|
819
|
+
_: 3
|
|
820
|
+
/* FORWARDED */
|
|
821
|
+
}, 16, ["name"])
|
|
822
|
+
],
|
|
823
|
+
64
|
|
824
|
+
/* STABLE_FRAGMENT */
|
|
825
|
+
);
|
|
759
826
|
};
|
|
760
827
|
}
|
|
761
828
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@floating-ui/vue"),require("
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@floating-ui/vue"),require("uid"),require("@vueuse/core"),require("mitt")):"function"==typeof define&&define.amd?define(["vue","@floating-ui/vue","uid","@vueuse/core","mitt"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDropdown=t(e.vue,e.vue$1,e.uid,e.core,e.mitt)}(this,(function(e,t,o,r,l){"use strict";var a=(e=>(e.local="local",e.session="session",e))(a||{}),n=(e=>(e.absolute="absolute",e.fixed="fixed",e))(n||{}),u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),i=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(i||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),f=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(f||{}),p=(e=>(e.listbox="listbox",e.menu="menu",e))(p||{}),c=(e=>(e.option="option",e.presentation="presentation",e))(c||{});const v=Symbol.for("dropdownTrigger"),m=Symbol.for("dropdownItem"),b=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});d.before;const g={id:[String,Number]},h={placement:{type:String,default:u.bottom,validator:e=>Object.values(u).includes(e)||Object.values(i).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(n).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}};s.button,f.button,a.local;const y={...g,...h,...b,modelValue:{type:Boolean,default:void 0},reference:{type:Object,default:null},role:{type:String,default:p.menu,validator:e=>Object.values(p).includes(e)}};const x=["id","tabindex","role","aria-labelledby"];return e.defineComponent({name:"VvDropdown",inheritAttrs:!1,props:y,emits:["update:modelValue","beforeExpand","beforeCollapse","afterExpand","afterCollapse","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(a,{expose:i,emit:d}){const s=a,f=d,{id:b}=e.toRefs(s),g=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(b),h=e.useAttrs(),y=e.ref("auto"),w=e.ref("auto"),S=e.ref(null),k=e.ref(),E=e.ref(null),P=e.ref(null),B=e.computed({get:()=>s.reference??S.value,set:e=>{S.value=e}}),O=e.ref(!1);e.onMounted((()=>{r.useMutationObserver(k.value,(()=>{var e;O.value="true"===(null==(e=window.getComputedStyle(k.value).getPropertyValue("--dropdown-custom-position"))?void 0:e.trim())}),{attributeFilter:["style"],window:window})}));const $=e.computed((()=>{const e=[];if(s.autoPlacement?"boolean"==typeof s.autoPlacement?e.push(t.autoPlacement()):e.push(t.autoPlacement(s.autoPlacement)):s.flip&&("boolean"==typeof s.flip?e.push(t.flip({fallbackStrategy:"initialPlacement"})):e.push(t.flip(s.flip))),s.shift&&("boolean"==typeof s.shift?e.push(t.shift()):e.push(t.shift(s.shift))),s.size){const o=({availableWidth:e,availableHeight:t})=>{y.value=`${e}px`,w.value=`${t}px`};"boolean"==typeof s.size?e.push(t.size({apply:o})):e.push(t.size({...s.size,apply:o}))}return s.offset&&(e.push(t.offset(Number(s.offset))),["string","number"].includes(typeof s.offset)?e.push(t.offset(Number(s.offset))):e.push(t.offset(s.offset))),s.arrow&&e.push(t.arrow({element:E})),e})),{x:z,y:V,middlewareData:j,placement:C,strategy:A}=t.useFloating(B,k,{whileElementsMounted:(...e)=>t.autoUpdate(...e,{animationFrame:s.strategy===n.fixed}),placement:e.computed((()=>s.placement)),strategy:e.computed((()=>s.strategy)),middleware:$}),N=e.computed((()=>{var e;if(O.value)return;const t=s.triggerWidth&&B.value?`${null==(e=B.value)?void 0:e.offsetWidth}px`:void 0;return{position:A.value,top:`${V.value??0}px`,left:`${z.value??0}px`,maxWidth:t?void 0:y.value,maxHeight:w.value,width:t}})),D=e.computed((()=>C.value.split("-")[0])),_=e.computed((()=>{var e,t,o,r,l;if(O.value)return;const a={[u.top]:u.bottom,[u.right]:u.left,[u.bottom]:u.top,[u.left]:u.right}[D.value];return{left:void 0!==(null==(e=j.value.arrow)?void 0:e.x)?`${null==(t=j.value.arrow)?void 0:t.x}px`:void 0,top:void 0!==(null==(o=j.value.arrow)?void 0:o.y)?`${null==(r=j.value.arrow)?void 0:r.y}px`:void 0,[a]:-((null==(l=E.value)?void 0:l.offsetWidth)??0)/2+"px"}})),F=r.useVModel(s,"modelValue",f),R=e.ref(!1),T=e.computed({get:()=>F.value??R.value,set:e=>{void 0!==F.value?F.value=e:R.value=e}}),W=()=>{T.value=!0},q=()=>{T.value=!1},H=()=>{T.value=!T.value},K=e=>{B.value=e};i({toggle:H,show:W,hide:q,init:K,customPosition:O}),e.watch(T,(t=>{t&&s.autofocusFirst&&e.nextTick((()=>{const e=Y(k.value);e.length>0&&e[0].focus({preventScroll:!0})}))})),r.onClickOutside(k,(()=>{!s.keepOpen&&T.value&&(T.value=!1)}),{ignore:[B]});const M=e.computed((()=>{var e,t;return(null==(t=null==(e=B.value)?void 0:e.getAttribute)?void 0:t.call(e,"id"))??void 0})),L=e.computed((()=>({"aria-controls":g.value,"aria-haspopup":!0,"aria-expanded":T.value}))),{component:U,bus:I}=function({reference:t,id:o,expanded:r,aria:a}){const n=l(),u=e.defineComponent({name:"VvDropdownTriggerProvider",setup(){e.provide(v,{reference:t,id:o,expanded:r,aria:a,bus:n})},render(){var t,o;return e.h(e.Fragment,{},null==(o=(t=this.$slots).default)?void 0:o.call(t))}});return{bus:n,component:u}}({reference:B,id:g,expanded:T,aria:L});I.on("click",H);const{role:G,modifiers:J}=e.toRefs(s),Q=function(t,o,r){return e.computed((()=>{const l={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{l[`${t}--${o}`]=e.unref(r.value[o])})),l}))}("vv-dropdown",J,e.computed((()=>({arrow:s.arrow})))),{focused:X}=r.useFocusWithin(k);function Y(e){return e?[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))):[]}const Z=r.useElementHover(k),{itemRole:ee}=function({role:t,...o}){const r=e.computed((()=>t.value===p.listbox?c.option:c.presentation));return e.provide(m,{role:r,...o}),{itemRole:r}}({role:G,expanded:T,focused:X,hovered:Z});r.onKeyStroke("Escape",(e=>{T.value&&(e.preventDefault(),q())})),r.onKeyStroke("ArrowDown",(t=>{T.value&&X.value&&(t.preventDefault(),e.nextTick((()=>{if(X.value){const e=Y(k.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t<e.length-1?e[t+1].focus({preventScroll:!0}):e[0].focus({preventScroll:!0})}})))})),r.onKeyStroke("ArrowUp",(t=>{T.value&&X.value&&(t.preventDefault(),e.nextTick((()=>{if(X.value){const e=Y(k.value);if(0===e.length||!document.activeElement)return;const t=e.indexOf(document.activeElement);t>0?e[t-1].focus({preventScroll:!0}):e[e.length-1].focus({preventScroll:!0})}})))})),r.onKeyStroke([" ","Enter"],(e=>{const t=e.target;T.value&&X.value&&t&&(null==t||t.click())}));const te={"before-enter":()=>{f(T.value?"beforeExpand":"beforeCollapse"),f("before-enter")},"after-leave":()=>{f(T.value?"afterExpand":"afterCollapse"),f("after-leave")},enter:()=>{f("enter")},"after-enter":()=>{f("after-enter")},"enter-cancelled":()=>{f("enter-cancelled")},"before-leave":()=>{f("before-leave")},leave:()=>{f("leave")},"leave-cancelled":()=>{f("leave-cancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(U),null,{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({init:K,show:W,hide:q,toggle:H,expanded:e.unref(T),aria:e.unref(L)})))])),_:3}),e.createVNode(e.Transition,e.mergeProps({name:t.transitionName},e.toHandlers(te),{persisted:""}),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:k,style:e.normalizeStyle(e.unref(N)),class:e.normalizeClass(e.unref(Q))},[s.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowEl",ref:E,style:e.normalizeStyle(e.unref(_)),class:"vv-dropdown__arrow"},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(T)}))),e.createElementVNode("div",e.mergeProps(e.unref(h),{id:e.unref(g),ref_key:"listEl",ref:P,tabindex:e.unref(T)?void 0:-1,role:e.unref(G),"aria-labelledby":e.unref(M),class:"vv-dropdown__list"}),[e.renderSlot(t.$slots,"items",e.normalizeProps(e.guardReactiveProps({role:e.unref(ee)})))],16,x),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps({expanded:e.unref(T)})))],6),[[e.vShow,e.unref(T)]])])),_:3},16,["name"])],64))}})}));
|