@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2
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/README.md +2 -2
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +19 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +276 -98
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
- package/dist/components/VvAction/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +213 -44
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +646 -360
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
- package/dist/components/VvButton/index.d.ts +13 -13
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +57 -38
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +5 -5
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
- package/dist/components/VvCombobox/index.d.ts +41 -10
- package/dist/components/VvDialog/VvDialog.es.js +387 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +40 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +113 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +986 -462
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +66 -13
- package/dist/components/VvProgress/VvProgress.es.js +216 -45
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +499 -238
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +631 -324
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +3 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
- package/dist/components/VvTextarea/index.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3522 -2231
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.es.js +264 -55
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.d.ts +3 -0
- package/dist/directives/v-contextmenu.es.js +42 -0
- package/dist/directives/v-contextmenu.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +222 -53
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.es.js +40 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +112 -3607
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +50 -18
- package/dist/resolvers/unplugin.d.ts +7 -1
- package/dist/resolvers/unplugin.es.js +77 -37
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +13 -1
- package/package.json +126 -40
- package/src/Volver.ts +49 -22
- 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 +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +7 -7
- package/src/components/VvAction/index.ts +1 -1
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +11 -11
- package/src/components/VvButton/index.ts +10 -9
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +44 -26
- package/src/components/VvCombobox/index.ts +1 -1
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +7 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
- package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
- package/src/components/VvDropdown/index.ts +3 -3
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +130 -37
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -6
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +4 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/directives/index.ts +3 -1
- package/src/directives/v-contextmenu.ts +40 -0
- package/src/directives/v-tooltip.ts +2 -2
- package/src/icons.ts +1 -1
- package/src/index.ts +0 -2
- package/src/props/index.ts +20 -10
- package/src/resolvers/unplugin.ts +15 -1
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +40 -0
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
- package/src/stories/argTypes.ts +12 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1,11 +1,66 @@
|
|
|
1
|
-
import { inject
|
|
2
|
-
import { iconExists
|
|
3
|
-
import { autoPlacement
|
|
4
|
-
import { nanoid
|
|
5
|
-
import { useVModel
|
|
6
|
-
import
|
|
7
|
-
var
|
|
8
|
-
|
|
1
|
+
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, h, Fragment, provide, useAttrs, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, useSlots, isRef, renderList, vModelSelect, createSlots, withModifiers, vModelText } from "vue";
|
|
2
|
+
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
|
+
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
4
|
+
import { nanoid } from "nanoid";
|
|
5
|
+
import { useVModel, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, toReactive, useElementVisibility, refDebounced } from "@vueuse/core";
|
|
6
|
+
import mitt from "mitt";
|
|
7
|
+
var Side = /* @__PURE__ */ ((Side2) => {
|
|
8
|
+
Side2["left"] = "left";
|
|
9
|
+
Side2["right"] = "right";
|
|
10
|
+
Side2["top"] = "top";
|
|
11
|
+
Side2["bottom"] = "bottom";
|
|
12
|
+
return Side2;
|
|
13
|
+
})(Side || {});
|
|
14
|
+
var Placement = /* @__PURE__ */ ((Placement2) => {
|
|
15
|
+
Placement2["topStart"] = "top-start";
|
|
16
|
+
Placement2["topEnd"] = "top-end";
|
|
17
|
+
Placement2["bottomStart"] = "bottom-start";
|
|
18
|
+
Placement2["bottomEnd"] = "bottom-end";
|
|
19
|
+
Placement2["leftStart"] = "left-start";
|
|
20
|
+
Placement2["leftEnd"] = "left-end";
|
|
21
|
+
Placement2["rightStart"] = "right-start";
|
|
22
|
+
Placement2["rightEnd"] = "right-end";
|
|
23
|
+
return Placement2;
|
|
24
|
+
})(Placement || {});
|
|
25
|
+
var Position = /* @__PURE__ */ ((Position2) => {
|
|
26
|
+
Position2["before"] = "before";
|
|
27
|
+
Position2["after"] = "after";
|
|
28
|
+
return Position2;
|
|
29
|
+
})(Position || {});
|
|
30
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
31
|
+
ButtonType2["button"] = "button";
|
|
32
|
+
ButtonType2["submit"] = "submit";
|
|
33
|
+
ButtonType2["reset"] = "reset";
|
|
34
|
+
return ButtonType2;
|
|
35
|
+
})(ButtonType || {});
|
|
36
|
+
var ActionRoles = /* @__PURE__ */ ((ActionRoles2) => {
|
|
37
|
+
ActionRoles2["button"] = "button";
|
|
38
|
+
ActionRoles2["link"] = "link";
|
|
39
|
+
ActionRoles2["menuitem"] = "menuitem";
|
|
40
|
+
return ActionRoles2;
|
|
41
|
+
})(ActionRoles || {});
|
|
42
|
+
var DropdownRole = /* @__PURE__ */ ((DropdownRole2) => {
|
|
43
|
+
DropdownRole2["listbox"] = "listbox";
|
|
44
|
+
DropdownRole2["menu"] = "menu";
|
|
45
|
+
return DropdownRole2;
|
|
46
|
+
})(DropdownRole || {});
|
|
47
|
+
var DropdownItemRole = /* @__PURE__ */ ((DropdownItemRole2) => {
|
|
48
|
+
DropdownItemRole2["option"] = "option";
|
|
49
|
+
DropdownItemRole2["presentation"] = "presentation";
|
|
50
|
+
return DropdownItemRole2;
|
|
51
|
+
})(DropdownItemRole || {});
|
|
52
|
+
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
53
|
+
AnchorTarget2["_blank"] = "_blank";
|
|
54
|
+
AnchorTarget2["_self"] = "_self";
|
|
55
|
+
AnchorTarget2["_parent"] = "_parent";
|
|
56
|
+
AnchorTarget2["_top"] = "_top";
|
|
57
|
+
return AnchorTarget2;
|
|
58
|
+
})(AnchorTarget || {});
|
|
59
|
+
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
60
|
+
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for("dropdownTrigger");
|
|
61
|
+
const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for("dropdownItem");
|
|
62
|
+
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for("dropdownAction");
|
|
63
|
+
const LinkProps = {
|
|
9
64
|
/**
|
|
10
65
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
11
66
|
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
@@ -22,7 +77,7 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
22
77
|
*/
|
|
23
78
|
target: {
|
|
24
79
|
type: String,
|
|
25
|
-
validator: (
|
|
80
|
+
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
26
81
|
},
|
|
27
82
|
/**
|
|
28
83
|
* Anchor rel
|
|
@@ -31,7 +86,8 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
31
86
|
type: String,
|
|
32
87
|
default: "noopener noreferrer"
|
|
33
88
|
}
|
|
34
|
-
}
|
|
89
|
+
};
|
|
90
|
+
const ValidProps = {
|
|
35
91
|
/**
|
|
36
92
|
* Valid status
|
|
37
93
|
*/
|
|
@@ -40,7 +96,8 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
40
96
|
* Valid label
|
|
41
97
|
*/
|
|
42
98
|
validLabel: [String, Array]
|
|
43
|
-
}
|
|
99
|
+
};
|
|
100
|
+
const InvalidProps = {
|
|
44
101
|
/**
|
|
45
102
|
* Invalid status
|
|
46
103
|
*/
|
|
@@ -49,7 +106,8 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
49
106
|
* Invalid label
|
|
50
107
|
*/
|
|
51
108
|
invalidLabel: [String, Array]
|
|
52
|
-
}
|
|
109
|
+
};
|
|
110
|
+
const LoadingProps = {
|
|
53
111
|
/**
|
|
54
112
|
* Loading status
|
|
55
113
|
*/
|
|
@@ -61,44 +119,53 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
61
119
|
type: String,
|
|
62
120
|
default: "Loading..."
|
|
63
121
|
}
|
|
64
|
-
}
|
|
122
|
+
};
|
|
123
|
+
const DisabledProps = {
|
|
65
124
|
/**
|
|
66
125
|
* Whether the form control is disabled
|
|
67
126
|
*/
|
|
68
127
|
disabled: Boolean
|
|
69
|
-
}
|
|
128
|
+
};
|
|
129
|
+
const SelectedProps = {
|
|
70
130
|
/**
|
|
71
131
|
* Whether the item is selected
|
|
72
132
|
*/
|
|
73
133
|
selected: Boolean
|
|
74
|
-
}
|
|
134
|
+
};
|
|
135
|
+
const ActiveProps = {
|
|
75
136
|
/**
|
|
76
137
|
* Whether the item is active
|
|
77
138
|
*/
|
|
78
139
|
active: Boolean
|
|
79
|
-
}
|
|
140
|
+
};
|
|
141
|
+
const PressedProps = {
|
|
80
142
|
/**
|
|
81
143
|
* Whether the item is pressed
|
|
82
144
|
*/
|
|
83
145
|
pressed: Boolean
|
|
84
|
-
}
|
|
146
|
+
};
|
|
147
|
+
const LabelProps = {
|
|
85
148
|
/**
|
|
86
149
|
* The item label
|
|
87
150
|
*/
|
|
88
151
|
label: [String, Number]
|
|
89
|
-
}
|
|
152
|
+
};
|
|
153
|
+
const ReadonlyProps = {
|
|
90
154
|
/**
|
|
91
155
|
* The value is not editable
|
|
92
156
|
*/
|
|
93
157
|
readonly: Boolean
|
|
94
|
-
}
|
|
158
|
+
};
|
|
159
|
+
const ModifiersProps = {
|
|
95
160
|
/**
|
|
96
161
|
* Component BEM modifiers
|
|
97
162
|
*/
|
|
98
163
|
modifiers: [String, Array]
|
|
99
|
-
}
|
|
164
|
+
};
|
|
165
|
+
const HintProps = {
|
|
100
166
|
hintLabel: { type: String, default: "" }
|
|
101
|
-
}
|
|
167
|
+
};
|
|
168
|
+
const OptionsProps = {
|
|
102
169
|
/**
|
|
103
170
|
* List of options, can be string[] or object[]
|
|
104
171
|
*/
|
|
@@ -118,7 +185,8 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
118
185
|
* Used when options are objects: key to use for option disabled
|
|
119
186
|
*/
|
|
120
187
|
disabledKey: { type: [String, Function], default: "disabled" }
|
|
121
|
-
}
|
|
188
|
+
};
|
|
189
|
+
const IconProps = {
|
|
122
190
|
/**
|
|
123
191
|
* VvIcon name or props
|
|
124
192
|
* @see VVIcon
|
|
@@ -129,39 +197,56 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
129
197
|
*/
|
|
130
198
|
iconPosition: {
|
|
131
199
|
type: String,
|
|
132
|
-
default:
|
|
133
|
-
validation: (
|
|
200
|
+
default: Position.before,
|
|
201
|
+
validation: (value) => Object.values(Position).includes(value)
|
|
134
202
|
}
|
|
135
|
-
}
|
|
203
|
+
};
|
|
204
|
+
const TabindexProps = {
|
|
136
205
|
/**
|
|
137
206
|
* Global attribute tabindex
|
|
138
207
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
139
208
|
*/
|
|
140
209
|
tabindex: { type: [String, Number], default: 0 }
|
|
141
|
-
}
|
|
210
|
+
};
|
|
211
|
+
const FloatingLabelProps = {
|
|
142
212
|
/**
|
|
143
213
|
* If true the label will be floating
|
|
144
214
|
*/
|
|
145
215
|
floating: Boolean
|
|
146
|
-
}
|
|
216
|
+
};
|
|
217
|
+
const UnselectableProps = {
|
|
147
218
|
/**
|
|
148
219
|
* If true the input will be unselectable
|
|
149
220
|
*/
|
|
150
|
-
unselectable: { type: Boolean, default:
|
|
151
|
-
}
|
|
221
|
+
unselectable: { type: Boolean, default: true }
|
|
222
|
+
};
|
|
223
|
+
const IdProps = {
|
|
152
224
|
/**
|
|
153
225
|
* Global attribute id
|
|
154
226
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
155
227
|
*/
|
|
156
228
|
id: [String, Number]
|
|
157
|
-
}
|
|
229
|
+
};
|
|
230
|
+
const DropdownProps = {
|
|
158
231
|
/**
|
|
159
232
|
* Dropdown placement
|
|
160
233
|
*/
|
|
161
234
|
placement: {
|
|
162
235
|
type: String,
|
|
163
|
-
default:
|
|
164
|
-
validator: (
|
|
236
|
+
default: Side.bottom,
|
|
237
|
+
validator: (value) => {
|
|
238
|
+
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
/**
|
|
242
|
+
* Dropdown strategy
|
|
243
|
+
*/
|
|
244
|
+
strategy: {
|
|
245
|
+
type: String,
|
|
246
|
+
default: "absolute",
|
|
247
|
+
validator: (value) => {
|
|
248
|
+
return ["fixed", "absolute"].includes(value);
|
|
249
|
+
}
|
|
165
250
|
},
|
|
166
251
|
/**
|
|
167
252
|
* Dropdown show / hide transition name
|
|
@@ -183,7 +268,7 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
183
268
|
*/
|
|
184
269
|
shift: {
|
|
185
270
|
type: [Boolean, Object],
|
|
186
|
-
default:
|
|
271
|
+
default: false
|
|
187
272
|
},
|
|
188
273
|
/**
|
|
189
274
|
* Flip dropdown position if there is no space in the default position
|
|
@@ -191,7 +276,7 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
191
276
|
*/
|
|
192
277
|
flip: {
|
|
193
278
|
type: [Boolean, Object],
|
|
194
|
-
default:
|
|
279
|
+
default: true
|
|
195
280
|
},
|
|
196
281
|
/**
|
|
197
282
|
* Size of the dropdown
|
|
@@ -207,7 +292,7 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
207
292
|
*/
|
|
208
293
|
autoPlacement: {
|
|
209
294
|
type: [Boolean, Object],
|
|
210
|
-
default:
|
|
295
|
+
default: false
|
|
211
296
|
},
|
|
212
297
|
/**
|
|
213
298
|
* Add arrow to the dropdown
|
|
@@ -215,21 +300,21 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
215
300
|
*/
|
|
216
301
|
arrow: {
|
|
217
302
|
type: Boolean,
|
|
218
|
-
default:
|
|
303
|
+
default: false
|
|
219
304
|
},
|
|
220
305
|
/**
|
|
221
306
|
* Close dropdown on click outside
|
|
222
307
|
*/
|
|
223
308
|
autoClose: {
|
|
224
309
|
type: Boolean,
|
|
225
|
-
default:
|
|
310
|
+
default: true
|
|
226
311
|
},
|
|
227
312
|
/**
|
|
228
313
|
* Autofocus first item on dropdown open
|
|
229
314
|
*/
|
|
230
315
|
autofocusFirst: {
|
|
231
316
|
type: Boolean,
|
|
232
|
-
default:
|
|
317
|
+
default: true
|
|
233
318
|
},
|
|
234
319
|
/**
|
|
235
320
|
* Set dropdown width to the same as the trigger
|
|
@@ -237,21 +322,24 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
237
322
|
triggerWidth: {
|
|
238
323
|
type: Boolean
|
|
239
324
|
}
|
|
240
|
-
}
|
|
241
|
-
|
|
325
|
+
};
|
|
326
|
+
const IdNameProps = {
|
|
327
|
+
...IdProps,
|
|
242
328
|
/**
|
|
243
329
|
* Input / Textarea name
|
|
244
330
|
* Name of the form control. Submitted with the form as part of a name/value pair
|
|
245
331
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
246
332
|
*/
|
|
247
|
-
name: { type: String, required:
|
|
248
|
-
}
|
|
333
|
+
name: { type: String, required: true }
|
|
334
|
+
};
|
|
335
|
+
const AutofocusProps = {
|
|
249
336
|
/**
|
|
250
337
|
* Global attribute autofocus
|
|
251
338
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
252
339
|
*/
|
|
253
340
|
autofocus: Boolean
|
|
254
|
-
}
|
|
341
|
+
};
|
|
342
|
+
const AutocompleteProps = {
|
|
255
343
|
/**
|
|
256
344
|
* Global attribute autocomplete
|
|
257
345
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
@@ -259,37 +347,42 @@ const Ut = Symbol.for("volver"), Jt = Symbol.for("dropdownTrigger"), it = Symbol
|
|
|
259
347
|
autocomplete: { type: String, default: "off" }
|
|
260
348
|
};
|
|
261
349
|
({
|
|
262
|
-
...
|
|
263
|
-
...
|
|
264
|
-
...
|
|
265
|
-
...
|
|
266
|
-
...
|
|
350
|
+
...DisabledProps,
|
|
351
|
+
...LabelProps,
|
|
352
|
+
...PressedProps,
|
|
353
|
+
...ActiveProps,
|
|
354
|
+
...LinkProps,
|
|
267
355
|
/**
|
|
268
356
|
* Button type
|
|
269
357
|
*/
|
|
270
|
-
type:
|
|
358
|
+
type: {
|
|
359
|
+
type: String,
|
|
360
|
+
default: ButtonType.button,
|
|
361
|
+
validator: (value) => Object.values(ButtonType).includes(value)
|
|
362
|
+
}
|
|
271
363
|
});
|
|
272
|
-
const
|
|
364
|
+
const VvComboboxEvents = [
|
|
273
365
|
"update:modelValue",
|
|
274
366
|
"change:search",
|
|
275
367
|
"focus",
|
|
276
368
|
"blur"
|
|
277
|
-
]
|
|
278
|
-
|
|
279
|
-
...
|
|
280
|
-
...
|
|
281
|
-
...
|
|
282
|
-
...
|
|
283
|
-
...
|
|
284
|
-
...
|
|
285
|
-
...
|
|
286
|
-
...
|
|
287
|
-
...
|
|
288
|
-
...
|
|
289
|
-
...
|
|
290
|
-
...
|
|
291
|
-
...
|
|
292
|
-
...
|
|
369
|
+
];
|
|
370
|
+
const VvComboboxProps = {
|
|
371
|
+
...IdNameProps,
|
|
372
|
+
...TabindexProps,
|
|
373
|
+
...ValidProps,
|
|
374
|
+
...InvalidProps,
|
|
375
|
+
...HintProps,
|
|
376
|
+
...LoadingProps,
|
|
377
|
+
...DisabledProps,
|
|
378
|
+
...ReadonlyProps,
|
|
379
|
+
...ModifiersProps,
|
|
380
|
+
...OptionsProps,
|
|
381
|
+
...IconProps,
|
|
382
|
+
...FloatingLabelProps,
|
|
383
|
+
...UnselectableProps,
|
|
384
|
+
...DropdownProps,
|
|
385
|
+
...LabelProps,
|
|
293
386
|
/**
|
|
294
387
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
295
388
|
*/
|
|
@@ -374,8 +467,8 @@ const ll = [
|
|
|
374
467
|
* Set dropdown width to the same as the trigger
|
|
375
468
|
*/
|
|
376
469
|
triggerWidth: {
|
|
377
|
-
...
|
|
378
|
-
default:
|
|
470
|
+
...DropdownProps.triggerWidth,
|
|
471
|
+
default: true
|
|
379
472
|
},
|
|
380
473
|
/**
|
|
381
474
|
* Dropdown modifiers
|
|
@@ -391,7 +484,8 @@ const ll = [
|
|
|
391
484
|
* Close dropdown on select (not multiple)
|
|
392
485
|
*/
|
|
393
486
|
autoClose: Boolean
|
|
394
|
-
}
|
|
487
|
+
};
|
|
488
|
+
const VvIconProps = {
|
|
395
489
|
/**
|
|
396
490
|
* Color
|
|
397
491
|
*/
|
|
@@ -415,7 +509,7 @@ const ll = [
|
|
|
415
509
|
*/
|
|
416
510
|
name: {
|
|
417
511
|
type: String,
|
|
418
|
-
required:
|
|
512
|
+
required: true
|
|
419
513
|
},
|
|
420
514
|
/**
|
|
421
515
|
* By default 'vv'
|
|
@@ -485,78 +579,126 @@ const ll = [
|
|
|
485
579
|
type: [String, Array]
|
|
486
580
|
}
|
|
487
581
|
};
|
|
488
|
-
function
|
|
489
|
-
return
|
|
582
|
+
function useVolver() {
|
|
583
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
490
584
|
}
|
|
491
|
-
function
|
|
492
|
-
return
|
|
493
|
-
const
|
|
494
|
-
[
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
585
|
+
function useModifiers(prefix, modifiers, others) {
|
|
586
|
+
return computed(() => {
|
|
587
|
+
const toReturn = {
|
|
588
|
+
[prefix]: true
|
|
589
|
+
};
|
|
590
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
591
|
+
if (modifiersArray) {
|
|
592
|
+
if (Array.isArray(modifiersArray)) {
|
|
593
|
+
modifiersArray.forEach((modifier) => {
|
|
594
|
+
if (modifier) {
|
|
595
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (others) {
|
|
601
|
+
Object.keys(others.value).forEach((key) => {
|
|
602
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
return toReturn;
|
|
501
606
|
});
|
|
502
607
|
}
|
|
503
|
-
const
|
|
608
|
+
const __default__$6 = {
|
|
504
609
|
name: "VvIcon"
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
610
|
+
};
|
|
611
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
612
|
+
...__default__$6,
|
|
613
|
+
props: VvIconProps,
|
|
614
|
+
setup(__props) {
|
|
615
|
+
const props = __props;
|
|
616
|
+
const show = ref(true);
|
|
617
|
+
const volver = useVolver();
|
|
618
|
+
const { modifiers } = toRefs(props);
|
|
619
|
+
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
620
|
+
const provider = computed(() => {
|
|
621
|
+
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
622
|
+
});
|
|
623
|
+
const icon = computed(() => {
|
|
624
|
+
const _name = props.name ?? "";
|
|
625
|
+
const iconName = `@${provider.value}:${props.prefix}:${props.name}`;
|
|
626
|
+
if (iconExists(_name)) {
|
|
627
|
+
return _name;
|
|
628
|
+
} else if (iconExists(iconName)) {
|
|
629
|
+
return iconName;
|
|
630
|
+
} else {
|
|
631
|
+
return (volver == null ? void 0 : volver.iconsCollections.find(
|
|
632
|
+
(iconsCollection) => {
|
|
633
|
+
const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
|
|
634
|
+
if (iconExists(icon2)) {
|
|
635
|
+
return icon2;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
)) || _name;
|
|
639
|
+
}
|
|
518
640
|
});
|
|
519
|
-
function
|
|
520
|
-
let
|
|
521
|
-
if (typeof window
|
|
522
|
-
const { JSDOM
|
|
523
|
-
|
|
641
|
+
function getSvgContent(svg) {
|
|
642
|
+
let dom = null;
|
|
643
|
+
if (typeof window === "undefined") {
|
|
644
|
+
const { JSDOM } = require("jsdom");
|
|
645
|
+
dom = new JSDOM().window;
|
|
524
646
|
}
|
|
525
|
-
|
|
647
|
+
const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
|
|
648
|
+
const svgDomString = domParser.parseFromString(svg, "text/html");
|
|
649
|
+
const svgEl = svgDomString.querySelector("svg");
|
|
650
|
+
return svgEl;
|
|
526
651
|
}
|
|
527
|
-
function
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
652
|
+
function addIconFromSvg(svg) {
|
|
653
|
+
const svgContentEl = getSvgContent(svg);
|
|
654
|
+
const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
|
|
655
|
+
if (svgContentEl && svgContent) {
|
|
656
|
+
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
657
|
+
body: svgContent,
|
|
658
|
+
// Set height and width from svg content
|
|
659
|
+
height: svgContentEl.viewBox.baseVal.height,
|
|
660
|
+
width: svgContentEl.viewBox.baseVal.width
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
if (volver) {
|
|
665
|
+
if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
|
|
666
|
+
show.value = false;
|
|
667
|
+
volver.fetchIcon(props.src).then((svg) => {
|
|
668
|
+
if (svg) {
|
|
669
|
+
addIconFromSvg(svg);
|
|
670
|
+
show.value = true;
|
|
671
|
+
}
|
|
672
|
+
}).catch((e) => {
|
|
673
|
+
throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
|
|
674
|
+
});
|
|
675
|
+
} else if (props.svg) {
|
|
676
|
+
addIconFromSvg(props.svg);
|
|
677
|
+
}
|
|
535
678
|
}
|
|
536
|
-
return
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
icon: o(b)
|
|
554
|
-
}), null, 16, ["class"])) : k("", !0);
|
|
679
|
+
return (_ctx, _cache) => {
|
|
680
|
+
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
681
|
+
key: 0,
|
|
682
|
+
class: unref(bemCssClasses)
|
|
683
|
+
}, {
|
|
684
|
+
inline: _ctx.inline,
|
|
685
|
+
width: _ctx.width,
|
|
686
|
+
height: _ctx.height,
|
|
687
|
+
horizontalFlip: _ctx.horizontalFlip,
|
|
688
|
+
verticalFlip: _ctx.verticalFlip,
|
|
689
|
+
flip: _ctx.flip,
|
|
690
|
+
rotate: _ctx.rotate,
|
|
691
|
+
color: _ctx.color,
|
|
692
|
+
onLoad: _ctx.onLoad,
|
|
693
|
+
icon: unref(icon)
|
|
694
|
+
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
695
|
+
};
|
|
555
696
|
}
|
|
556
|
-
})
|
|
557
|
-
|
|
558
|
-
...
|
|
559
|
-
...
|
|
697
|
+
});
|
|
698
|
+
const VvDropdownProps = {
|
|
699
|
+
...IdProps,
|
|
700
|
+
...ModifiersProps,
|
|
701
|
+
...DropdownProps,
|
|
560
702
|
/**
|
|
561
703
|
* Show / hide dropdown programmatically
|
|
562
704
|
*/
|
|
@@ -576,26 +718,28 @@ const sl = {
|
|
|
576
718
|
*/
|
|
577
719
|
role: {
|
|
578
720
|
type: String,
|
|
579
|
-
default:
|
|
580
|
-
validator: (
|
|
721
|
+
default: DropdownRole.menu,
|
|
722
|
+
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
581
723
|
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
724
|
+
};
|
|
725
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
|
|
726
|
+
function useProvideDropdownTrigger({
|
|
727
|
+
reference,
|
|
728
|
+
id,
|
|
729
|
+
expanded,
|
|
730
|
+
aria
|
|
588
731
|
}) {
|
|
589
|
-
const
|
|
732
|
+
const bus = mitt();
|
|
733
|
+
const component = defineComponent({
|
|
590
734
|
name: "VvDropdownTriggerProvider",
|
|
591
735
|
provide() {
|
|
592
736
|
return {
|
|
593
|
-
[
|
|
594
|
-
reference
|
|
595
|
-
id
|
|
596
|
-
expanded
|
|
597
|
-
aria
|
|
598
|
-
bus
|
|
737
|
+
[INJECTION_KEY_DROPDOWN_TRIGGER]: {
|
|
738
|
+
reference,
|
|
739
|
+
id,
|
|
740
|
+
expanded,
|
|
741
|
+
aria,
|
|
742
|
+
bus
|
|
599
743
|
}
|
|
600
744
|
};
|
|
601
745
|
},
|
|
@@ -603,281 +747,405 @@ function il({
|
|
|
603
747
|
return {};
|
|
604
748
|
},
|
|
605
749
|
render() {
|
|
606
|
-
var
|
|
607
|
-
return
|
|
750
|
+
var _a, _b;
|
|
751
|
+
return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
|
|
608
752
|
}
|
|
609
753
|
});
|
|
610
754
|
return {
|
|
611
|
-
bus
|
|
612
|
-
component
|
|
755
|
+
bus,
|
|
756
|
+
component
|
|
613
757
|
};
|
|
614
758
|
}
|
|
615
|
-
function
|
|
616
|
-
role
|
|
617
|
-
expanded
|
|
759
|
+
function useProvideDropdownItem({
|
|
760
|
+
role,
|
|
761
|
+
expanded
|
|
618
762
|
}) {
|
|
619
|
-
const
|
|
620
|
-
() =>
|
|
763
|
+
const itemRole = computed(
|
|
764
|
+
() => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
|
|
621
765
|
);
|
|
622
|
-
|
|
623
|
-
role:
|
|
624
|
-
expanded
|
|
625
|
-
})
|
|
766
|
+
provide(INJECTION_KEY_DROPDOWN_ITEM, {
|
|
767
|
+
role: itemRole,
|
|
768
|
+
expanded
|
|
769
|
+
});
|
|
770
|
+
return { itemRole };
|
|
626
771
|
}
|
|
627
|
-
function
|
|
628
|
-
expanded
|
|
772
|
+
function useProvideDropdownAction({
|
|
773
|
+
expanded
|
|
629
774
|
}) {
|
|
630
|
-
|
|
631
|
-
role:
|
|
632
|
-
expanded
|
|
775
|
+
provide(INJECTION_KEY_DROPDOWN_ACTION, {
|
|
776
|
+
role: ActionRoles.menuitem,
|
|
777
|
+
expanded
|
|
633
778
|
});
|
|
634
779
|
}
|
|
635
|
-
const
|
|
780
|
+
const _hoisted_1$3 = ["id", "tabindex", "role", "aria-labelledby"];
|
|
781
|
+
const __default__$5 = {
|
|
636
782
|
name: "VvDropdown",
|
|
637
|
-
inheritAttrs:
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
783
|
+
inheritAttrs: false
|
|
784
|
+
};
|
|
785
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
786
|
+
...__default__$5,
|
|
787
|
+
props: VvDropdownProps,
|
|
641
788
|
emits: ["update:modelValue"],
|
|
642
|
-
setup(
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
789
|
+
setup(__props, { expose, emit }) {
|
|
790
|
+
const props = __props;
|
|
791
|
+
const { id } = toRefs(props);
|
|
792
|
+
const hasId = useUniqueId(id);
|
|
793
|
+
const attrs = useAttrs();
|
|
794
|
+
const maxWidth = ref("auto");
|
|
795
|
+
const maxHeight = ref("auto");
|
|
796
|
+
const localReferenceEl = ref(null);
|
|
797
|
+
const floatingEl = ref(null);
|
|
798
|
+
const arrowEl = ref(null);
|
|
799
|
+
const listEl = ref(null);
|
|
800
|
+
const referenceEl = computed({
|
|
801
|
+
get: () => props.reference ?? localReferenceEl.value,
|
|
802
|
+
set: (newValue) => {
|
|
803
|
+
localReferenceEl.value = newValue;
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
const middleware = computed(() => {
|
|
807
|
+
const toReturn = [];
|
|
808
|
+
if (props.autoPlacement) {
|
|
809
|
+
if (typeof props.autoPlacement === "boolean") {
|
|
810
|
+
toReturn.push(autoPlacement());
|
|
811
|
+
} else {
|
|
812
|
+
toReturn.push(
|
|
813
|
+
autoPlacement(props.autoPlacement)
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
} else if (props.flip) {
|
|
817
|
+
if (typeof props.flip === "boolean") {
|
|
818
|
+
toReturn.push(flip());
|
|
819
|
+
} else {
|
|
820
|
+
toReturn.push(flip(props.flip));
|
|
821
|
+
}
|
|
647
822
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
823
|
+
if (props.shift) {
|
|
824
|
+
if (typeof props.shift === "boolean") {
|
|
825
|
+
toReturn.push(shift());
|
|
826
|
+
} else {
|
|
827
|
+
toReturn.push(shift(props.shift));
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
if (props.size) {
|
|
831
|
+
const apply = ({
|
|
832
|
+
availableWidth,
|
|
833
|
+
availableHeight
|
|
656
834
|
}) => {
|
|
657
|
-
|
|
835
|
+
maxWidth.value = `${availableWidth}px`;
|
|
836
|
+
maxHeight.value = `${availableHeight}px`;
|
|
658
837
|
};
|
|
659
|
-
typeof
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
838
|
+
if (typeof props.size === "boolean") {
|
|
839
|
+
toReturn.push(
|
|
840
|
+
size({
|
|
841
|
+
apply
|
|
842
|
+
})
|
|
843
|
+
);
|
|
844
|
+
} else {
|
|
845
|
+
toReturn.push(
|
|
846
|
+
size({
|
|
847
|
+
...props.size,
|
|
848
|
+
apply
|
|
849
|
+
})
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
if (props.offset) {
|
|
854
|
+
toReturn.push(offset(Number(props.offset)));
|
|
855
|
+
if (["string", "number"].includes(typeof props.offset)) {
|
|
856
|
+
toReturn.push(offset(Number(props.offset)));
|
|
857
|
+
} else {
|
|
858
|
+
toReturn.push(offset(props.offset));
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
if (props.arrow) {
|
|
862
|
+
toReturn.push(
|
|
863
|
+
arrow({
|
|
864
|
+
element: arrowEl
|
|
667
865
|
})
|
|
668
866
|
);
|
|
669
867
|
}
|
|
670
|
-
return
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}), { x: E, y: B, strategy: X, middlewareData: R, placement: Z } = Ht(
|
|
676
|
-
m,
|
|
677
|
-
y,
|
|
868
|
+
return toReturn;
|
|
869
|
+
});
|
|
870
|
+
const { x, y, strategy, middlewareData, placement } = useFloating(
|
|
871
|
+
referenceEl,
|
|
872
|
+
floatingEl,
|
|
678
873
|
{
|
|
679
|
-
whileElementsMounted:
|
|
680
|
-
placement:
|
|
681
|
-
|
|
874
|
+
whileElementsMounted: autoUpdate,
|
|
875
|
+
placement: computed(() => props.placement),
|
|
876
|
+
strategy: computed(() => props.strategy),
|
|
877
|
+
middleware
|
|
682
878
|
}
|
|
683
|
-
)
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
879
|
+
);
|
|
880
|
+
const dropdownPlacement = computed(() => ({
|
|
881
|
+
position: strategy.value,
|
|
882
|
+
top: `${y.value ?? 0}px`,
|
|
883
|
+
left: `${x.value ?? 0}px`,
|
|
884
|
+
maxWidth: maxWidth.value,
|
|
885
|
+
maxHeight: maxHeight.value,
|
|
886
|
+
width: props.triggerWidth && referenceEl.value ? `${referenceEl.value.offsetWidth}px` : void 0
|
|
887
|
+
}));
|
|
888
|
+
const side = computed(() => placement.value.split("-")[0]);
|
|
889
|
+
const staticSide = computed(
|
|
691
890
|
() => ({
|
|
692
891
|
top: "bottom",
|
|
693
892
|
right: "left",
|
|
694
893
|
bottom: "top",
|
|
695
894
|
left: "right"
|
|
696
|
-
})[
|
|
697
|
-
)
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
895
|
+
})[side.value] ?? "bottom"
|
|
896
|
+
);
|
|
897
|
+
const arrowPlacement = computed(() => {
|
|
898
|
+
var _a, _b, _c, _d;
|
|
899
|
+
if (["bottom", "top"].includes(staticSide.value)) {
|
|
900
|
+
return {
|
|
901
|
+
right: `${((_a = middlewareData.value.arrow) == null ? void 0 : _a.x) ?? 0}px`,
|
|
902
|
+
[staticSide.value]: `${-(((_b = arrowEl.value) == null ? void 0 : _b.offsetWidth) ?? 0) / 2}px`
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
return {
|
|
906
|
+
top: `${((_c = middlewareData.value.arrow) == null ? void 0 : _c.y) ?? 0}px`,
|
|
907
|
+
[staticSide.value]: `${-(((_d = arrowEl.value) == null ? void 0 : _d.offsetWidth) ?? 0) / 2}px`
|
|
705
908
|
};
|
|
706
|
-
})
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
909
|
+
});
|
|
910
|
+
const modelValue = useVModel(props, "modelValue", emit);
|
|
911
|
+
const localModelValue = ref(false);
|
|
912
|
+
const expanded = computed({
|
|
913
|
+
get: () => modelValue.value ?? localModelValue.value,
|
|
914
|
+
set: (newValue) => {
|
|
915
|
+
if (modelValue.value === void 0) {
|
|
916
|
+
localModelValue.value = newValue;
|
|
711
917
|
return;
|
|
712
918
|
}
|
|
713
|
-
|
|
919
|
+
modelValue.value = newValue;
|
|
714
920
|
}
|
|
715
|
-
})
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
h.value = !1;
|
|
719
|
-
}, ae = () => {
|
|
720
|
-
h.value = !h.value;
|
|
721
|
-
}, ce = (a) => {
|
|
722
|
-
m.value = a;
|
|
921
|
+
});
|
|
922
|
+
const show = () => {
|
|
923
|
+
expanded.value = true;
|
|
723
924
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
925
|
+
const hide = () => {
|
|
926
|
+
expanded.value = false;
|
|
927
|
+
};
|
|
928
|
+
const toggle = () => {
|
|
929
|
+
expanded.value = !expanded.value;
|
|
930
|
+
};
|
|
931
|
+
const init = (el) => {
|
|
932
|
+
referenceEl.value = el;
|
|
933
|
+
};
|
|
934
|
+
expose({ toggle, show, hide, init });
|
|
935
|
+
watch(expanded, (newValue) => {
|
|
936
|
+
if (newValue && props.autofocusFirst) {
|
|
937
|
+
nextTick(() => {
|
|
938
|
+
const focusableElements = getKeyboardFocusableElements(
|
|
939
|
+
floatingEl.value
|
|
940
|
+
);
|
|
941
|
+
if (focusableElements.length > 0) {
|
|
942
|
+
focusableElements[0].focus();
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
onClickOutside(
|
|
948
|
+
floatingEl,
|
|
733
949
|
() => {
|
|
734
|
-
|
|
950
|
+
if (props.autoClose) {
|
|
951
|
+
expanded.value = false;
|
|
952
|
+
}
|
|
735
953
|
},
|
|
736
|
-
{ ignore: [
|
|
954
|
+
{ ignore: [referenceEl] }
|
|
737
955
|
);
|
|
738
|
-
const
|
|
739
|
-
var
|
|
740
|
-
return ((
|
|
741
|
-
})
|
|
742
|
-
|
|
743
|
-
"aria-
|
|
744
|
-
"aria-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
956
|
+
const hasAriaLabelledby = computed(() => {
|
|
957
|
+
var _a, _b;
|
|
958
|
+
return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
|
|
959
|
+
});
|
|
960
|
+
const referenceAria = computed(() => ({
|
|
961
|
+
"aria-controls": hasId.value,
|
|
962
|
+
"aria-haspopup": true,
|
|
963
|
+
"aria-expanded": expanded.value
|
|
964
|
+
}));
|
|
965
|
+
const { component: VvDropdownTriggerProvider, bus } = useProvideDropdownTrigger({
|
|
966
|
+
reference: referenceEl,
|
|
967
|
+
id: hasId,
|
|
968
|
+
expanded,
|
|
969
|
+
aria: referenceAria
|
|
750
970
|
});
|
|
751
|
-
|
|
752
|
-
const { role
|
|
971
|
+
bus.on("click", toggle);
|
|
972
|
+
const { role, modifiers } = toRefs(props);
|
|
973
|
+
const { itemRole } = useProvideDropdownItem({ role, expanded });
|
|
974
|
+
const bemCssClasses = useModifiers(
|
|
753
975
|
"vv-dropdown",
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
arrow:
|
|
976
|
+
modifiers,
|
|
977
|
+
computed(() => ({
|
|
978
|
+
arrow: props.arrow
|
|
757
979
|
}))
|
|
758
|
-
)
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
980
|
+
);
|
|
981
|
+
const { focused } = useFocusWithin(floatingEl);
|
|
982
|
+
function getKeyboardFocusableElements(element) {
|
|
983
|
+
if (!element) {
|
|
984
|
+
return [];
|
|
985
|
+
}
|
|
986
|
+
return [
|
|
987
|
+
...element.querySelectorAll(
|
|
762
988
|
'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
|
|
763
989
|
)
|
|
764
990
|
].filter(
|
|
765
|
-
(
|
|
766
|
-
)
|
|
991
|
+
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
992
|
+
);
|
|
767
993
|
}
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
if (
|
|
771
|
-
const
|
|
772
|
-
|
|
994
|
+
const focusNext = () => {
|
|
995
|
+
nextTick(() => {
|
|
996
|
+
if (focused.value) {
|
|
997
|
+
const focusableElements = getKeyboardFocusableElements(
|
|
998
|
+
floatingEl.value
|
|
773
999
|
);
|
|
774
|
-
if (
|
|
1000
|
+
if (focusableElements.length === 0 || !document.activeElement) {
|
|
775
1001
|
return;
|
|
776
|
-
|
|
1002
|
+
}
|
|
1003
|
+
const activeElementIndex = focusableElements.indexOf(
|
|
777
1004
|
document.activeElement
|
|
778
1005
|
);
|
|
779
|
-
|
|
1006
|
+
if (activeElementIndex < focusableElements.length - 1) {
|
|
1007
|
+
focusableElements[activeElementIndex + 1].focus();
|
|
1008
|
+
} else {
|
|
1009
|
+
focusableElements[0].focus();
|
|
1010
|
+
}
|
|
780
1011
|
}
|
|
781
1012
|
});
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
1013
|
+
};
|
|
1014
|
+
const focusPrev = () => {
|
|
1015
|
+
nextTick(() => {
|
|
1016
|
+
if (focused.value) {
|
|
1017
|
+
const focusableElements = getKeyboardFocusableElements(
|
|
1018
|
+
floatingEl.value
|
|
787
1019
|
);
|
|
788
|
-
if (
|
|
1020
|
+
if (focusableElements.length === 0 || !document.activeElement) {
|
|
789
1021
|
return;
|
|
790
|
-
|
|
1022
|
+
}
|
|
1023
|
+
const activeElementIndex = focusableElements.indexOf(
|
|
791
1024
|
document.activeElement
|
|
792
1025
|
);
|
|
793
|
-
|
|
1026
|
+
if (activeElementIndex > 0) {
|
|
1027
|
+
focusableElements[activeElementIndex - 1].focus();
|
|
1028
|
+
} else {
|
|
1029
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
1030
|
+
}
|
|
794
1031
|
}
|
|
795
1032
|
});
|
|
796
1033
|
};
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
1034
|
+
onKeyStroke("Escape", (e) => {
|
|
1035
|
+
if (expanded.value) {
|
|
1036
|
+
e.preventDefault();
|
|
1037
|
+
hide();
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
onKeyStroke("ArrowDown", (e) => {
|
|
1041
|
+
if (expanded.value && focused.value) {
|
|
1042
|
+
e.preventDefault();
|
|
1043
|
+
focusNext();
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
onKeyStroke("ArrowUp", (e) => {
|
|
1047
|
+
if (expanded.value && focused.value) {
|
|
1048
|
+
e.preventDefault();
|
|
1049
|
+
focusPrev();
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
onKeyStroke([" ", "Enter"], (e) => {
|
|
1053
|
+
if (expanded.value && focused.value) {
|
|
1054
|
+
e.preventDefault();
|
|
1055
|
+
const activeElement = document.activeElement;
|
|
1056
|
+
activeElement.click();
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
return (_ctx, _cache) => {
|
|
1060
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1061
|
+
createVNode(unref(VvDropdownTriggerProvider), null, {
|
|
1062
|
+
default: withCtx(() => [
|
|
1063
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ init, show, hide, toggle, expanded: unref(expanded), aria: unref(referenceAria) })))
|
|
1064
|
+
]),
|
|
1065
|
+
_: 3
|
|
1066
|
+
}),
|
|
1067
|
+
createVNode(Transition, { name: _ctx.transitionName }, {
|
|
1068
|
+
default: withCtx(() => [
|
|
1069
|
+
withDirectives(createElementVNode("div", {
|
|
1070
|
+
ref_key: "floatingEl",
|
|
1071
|
+
ref: floatingEl,
|
|
1072
|
+
style: normalizeStyle(unref(dropdownPlacement)),
|
|
1073
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1074
|
+
}, [
|
|
1075
|
+
props.arrow ? (openBlock(), createElementBlock("div", {
|
|
1076
|
+
key: 0,
|
|
1077
|
+
ref_key: "arrowEl",
|
|
1078
|
+
ref: arrowEl,
|
|
1079
|
+
style: normalizeStyle(unref(arrowPlacement)),
|
|
1080
|
+
class: "vv-dropdown__arrow"
|
|
1081
|
+
}, null, 4)) : createCommentVNode("", true),
|
|
1082
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
|
|
1083
|
+
createElementVNode("ul", mergeProps(unref(attrs), {
|
|
1084
|
+
id: unref(hasId),
|
|
1085
|
+
ref_key: "listEl",
|
|
1086
|
+
ref: listEl,
|
|
1087
|
+
tabindex: !unref(expanded) ? -1 : void 0,
|
|
1088
|
+
role: unref(role),
|
|
1089
|
+
"aria-labelledby": unref(hasAriaLabelledby),
|
|
1090
|
+
class: "vv-dropdown__list"
|
|
1091
|
+
}), [
|
|
1092
|
+
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
1093
|
+
role: unref(itemRole)
|
|
1094
|
+
})))
|
|
1095
|
+
], 16, _hoisted_1$3),
|
|
1096
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
1097
|
+
], 6), [
|
|
1098
|
+
[vShow, unref(expanded)]
|
|
1099
|
+
])
|
|
1100
|
+
]),
|
|
1101
|
+
_: 3
|
|
1102
|
+
}, 8, ["name"])
|
|
1103
|
+
], 64);
|
|
1104
|
+
};
|
|
849
1105
|
}
|
|
850
1106
|
});
|
|
851
|
-
function
|
|
852
|
-
return
|
|
1107
|
+
function useInjectedDropdownItem() {
|
|
1108
|
+
return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
|
|
853
1109
|
}
|
|
854
|
-
const
|
|
1110
|
+
const __default__$4 = {
|
|
855
1111
|
name: "VvDropdownItem"
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1112
|
+
};
|
|
1113
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1114
|
+
...__default__$4,
|
|
1115
|
+
setup(__props) {
|
|
1116
|
+
const { role, expanded } = useInjectedDropdownItem();
|
|
1117
|
+
const element = ref(null);
|
|
1118
|
+
useProvideDropdownAction({ expanded });
|
|
1119
|
+
const hovered = useElementHover(element);
|
|
1120
|
+
const { focused } = useFocus(element);
|
|
1121
|
+
const { focused: focusedWithin } = useFocusWithin(element);
|
|
1122
|
+
watch(hovered, (newValue) => {
|
|
1123
|
+
if (newValue) {
|
|
1124
|
+
focused.value = true;
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
return (_ctx, _cache) => {
|
|
1128
|
+
return openBlock(), createElementBlock("li", mergeProps({ role: unref(role) }, {
|
|
1129
|
+
ref_key: "element",
|
|
1130
|
+
ref: element,
|
|
1131
|
+
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
1132
|
+
}), [
|
|
1133
|
+
renderSlot(_ctx.$slots, "default")
|
|
1134
|
+
], 16);
|
|
1135
|
+
};
|
|
871
1136
|
}
|
|
872
|
-
})
|
|
1137
|
+
});
|
|
1138
|
+
const _hoisted_1$2 = ["title"];
|
|
1139
|
+
const __default__$3 = {
|
|
873
1140
|
name: "VvDropdownOption"
|
|
874
|
-
}
|
|
875
|
-
|
|
1141
|
+
};
|
|
1142
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1143
|
+
...__default__$3,
|
|
876
1144
|
props: {
|
|
877
|
-
...
|
|
878
|
-
...
|
|
879
|
-
...
|
|
880
|
-
...
|
|
1145
|
+
...DisabledProps,
|
|
1146
|
+
...SelectedProps,
|
|
1147
|
+
...UnselectableProps,
|
|
1148
|
+
...ModifiersProps,
|
|
881
1149
|
deselectHintLabel: {
|
|
882
1150
|
type: String
|
|
883
1151
|
},
|
|
@@ -888,157 +1156,210 @@ const pl = {
|
|
|
888
1156
|
type: String
|
|
889
1157
|
}
|
|
890
1158
|
},
|
|
891
|
-
setup(
|
|
892
|
-
const
|
|
1159
|
+
setup(__props) {
|
|
1160
|
+
const props = __props;
|
|
1161
|
+
const { modifiers } = toRefs(props);
|
|
1162
|
+
const bemCssClasses = useModifiers(
|
|
893
1163
|
"vv-dropdown-option",
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
disabled:
|
|
897
|
-
selected:
|
|
898
|
-
unselectable:
|
|
1164
|
+
modifiers,
|
|
1165
|
+
computed(() => ({
|
|
1166
|
+
disabled: props.disabled,
|
|
1167
|
+
selected: props.selected,
|
|
1168
|
+
unselectable: props.unselectable && props.selected
|
|
899
1169
|
}))
|
|
900
1170
|
);
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1171
|
+
const hintLabel = computed(() => {
|
|
1172
|
+
if (props.selected) {
|
|
1173
|
+
return props.unselectable ? props.deselectHintLabel : props.selectedHintLabel;
|
|
1174
|
+
}
|
|
1175
|
+
if (!props.disabled) {
|
|
1176
|
+
return props.selectHintLabel;
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
return (_ctx, _cache) => {
|
|
1180
|
+
return openBlock(), createBlock(_sfc_main$4, {
|
|
1181
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
1182
|
+
tabindex: _ctx.disabled ? -1 : 0,
|
|
1183
|
+
"aria-selected": _ctx.selected,
|
|
1184
|
+
"aria-disabled": _ctx.disabled
|
|
1185
|
+
}, {
|
|
1186
|
+
default: withCtx(() => [
|
|
1187
|
+
renderSlot(_ctx.$slots, "default"),
|
|
1188
|
+
createElementVNode("span", {
|
|
1189
|
+
class: "vv-dropdown-option__hint",
|
|
1190
|
+
title: unref(hintLabel)
|
|
1191
|
+
}, [
|
|
1192
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
1193
|
+
createTextVNode(toDisplayString(unref(hintLabel)), 1)
|
|
1194
|
+
])
|
|
1195
|
+
], 8, _hoisted_1$2)
|
|
1196
|
+
]),
|
|
1197
|
+
_: 3
|
|
1198
|
+
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
1199
|
+
};
|
|
921
1200
|
}
|
|
922
1201
|
});
|
|
923
|
-
function
|
|
924
|
-
|
|
1202
|
+
function equals(obj1, obj2, field) {
|
|
1203
|
+
if (field)
|
|
1204
|
+
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
1205
|
+
else
|
|
1206
|
+
return deepEquals(obj1, obj2);
|
|
925
1207
|
}
|
|
926
|
-
function
|
|
927
|
-
if (
|
|
928
|
-
return
|
|
929
|
-
if (
|
|
930
|
-
const
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1208
|
+
function deepEquals(a, b) {
|
|
1209
|
+
if (a === b)
|
|
1210
|
+
return true;
|
|
1211
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
1212
|
+
const arrA = Array.isArray(a);
|
|
1213
|
+
const arrB = Array.isArray(b);
|
|
1214
|
+
let i, length, key;
|
|
1215
|
+
if (arrA && arrB) {
|
|
1216
|
+
length = a.length;
|
|
1217
|
+
if (length != b.length)
|
|
1218
|
+
return false;
|
|
1219
|
+
for (i = length; i-- !== 0; )
|
|
1220
|
+
if (!deepEquals(a[i], b[i]))
|
|
1221
|
+
return false;
|
|
1222
|
+
return true;
|
|
939
1223
|
}
|
|
940
|
-
if (
|
|
941
|
-
return
|
|
942
|
-
const
|
|
943
|
-
if (
|
|
944
|
-
return
|
|
945
|
-
if (
|
|
946
|
-
return
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
return
|
|
950
|
-
if (
|
|
951
|
-
return
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1224
|
+
if (arrA != arrB)
|
|
1225
|
+
return false;
|
|
1226
|
+
const dateA = a instanceof Date, dateB = b instanceof Date;
|
|
1227
|
+
if (dateA != dateB)
|
|
1228
|
+
return false;
|
|
1229
|
+
if (dateA && dateB)
|
|
1230
|
+
return a.getTime() == b.getTime();
|
|
1231
|
+
const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
|
|
1232
|
+
if (regexpA != regexpB)
|
|
1233
|
+
return false;
|
|
1234
|
+
if (regexpA && regexpB)
|
|
1235
|
+
return a.toString() == b.toString();
|
|
1236
|
+
const keys = Object.keys(a);
|
|
1237
|
+
length = keys.length;
|
|
1238
|
+
if (length !== Object.keys(b).length)
|
|
1239
|
+
return false;
|
|
1240
|
+
for (i = length; i-- !== 0; )
|
|
1241
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
1242
|
+
return false;
|
|
1243
|
+
for (i = length; i-- !== 0; ) {
|
|
1244
|
+
key = keys[i];
|
|
1245
|
+
if (!deepEquals(a[key], b[key]))
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
return true;
|
|
962
1249
|
}
|
|
963
|
-
return
|
|
1250
|
+
return a !== a && b !== b;
|
|
964
1251
|
}
|
|
965
|
-
function
|
|
966
|
-
if (
|
|
967
|
-
if (
|
|
968
|
-
return
|
|
969
|
-
{
|
|
970
|
-
const
|
|
971
|
-
let
|
|
972
|
-
for (let
|
|
973
|
-
if (
|
|
1252
|
+
function resolveFieldData(data, field) {
|
|
1253
|
+
if (data && Object.keys(data).length && field) {
|
|
1254
|
+
if (field.indexOf(".") === -1) {
|
|
1255
|
+
return data[field];
|
|
1256
|
+
} else {
|
|
1257
|
+
const fields = field.split(".");
|
|
1258
|
+
let value = data;
|
|
1259
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
1260
|
+
if (data == null) {
|
|
974
1261
|
return null;
|
|
975
|
-
|
|
1262
|
+
}
|
|
1263
|
+
value = value[fields[i]];
|
|
976
1264
|
}
|
|
977
|
-
return
|
|
1265
|
+
return value;
|
|
978
1266
|
}
|
|
979
|
-
} else
|
|
1267
|
+
} else {
|
|
980
1268
|
return null;
|
|
1269
|
+
}
|
|
981
1270
|
}
|
|
982
|
-
function
|
|
983
|
-
let
|
|
984
|
-
if (
|
|
985
|
-
for (let
|
|
986
|
-
if (
|
|
987
|
-
|
|
1271
|
+
function findIndexInList(value, list) {
|
|
1272
|
+
let index = -1;
|
|
1273
|
+
if (list) {
|
|
1274
|
+
for (let i = 0; i < list.length; i++) {
|
|
1275
|
+
if (equals(list[i], value)) {
|
|
1276
|
+
index = i;
|
|
988
1277
|
break;
|
|
989
1278
|
}
|
|
1279
|
+
}
|
|
990
1280
|
}
|
|
991
|
-
return
|
|
1281
|
+
return index;
|
|
992
1282
|
}
|
|
993
|
-
function
|
|
994
|
-
if (
|
|
995
|
-
for (const
|
|
996
|
-
if (
|
|
997
|
-
return
|
|
1283
|
+
function contains(value, list) {
|
|
1284
|
+
if (value != null && list && list.length) {
|
|
1285
|
+
for (const val of list) {
|
|
1286
|
+
if (equals(value, val)) {
|
|
1287
|
+
return true;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
998
1290
|
}
|
|
999
|
-
return
|
|
1291
|
+
return false;
|
|
1000
1292
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return ((
|
|
1293
|
+
function isEmpty(value) {
|
|
1294
|
+
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
1003
1295
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1296
|
+
function removeFromList(value, list) {
|
|
1297
|
+
const indexElToRemove = findIndexInList(value, list);
|
|
1298
|
+
if (indexElToRemove > -1) {
|
|
1299
|
+
return list.filter((el, elIndex) => elIndex !== indexElToRemove);
|
|
1300
|
+
} else {
|
|
1301
|
+
return list;
|
|
1302
|
+
}
|
|
1007
1303
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return typeof
|
|
1304
|
+
function isString(value) {
|
|
1305
|
+
return typeof value === "string" || value instanceof String;
|
|
1010
1306
|
}
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1307
|
+
function joinLines(errors) {
|
|
1308
|
+
if (Array.isArray(errors)) {
|
|
1309
|
+
return errors.filter((e) => isString(e)).join(" ");
|
|
1310
|
+
}
|
|
1311
|
+
return errors;
|
|
1013
1312
|
}
|
|
1014
|
-
function
|
|
1313
|
+
function HintSlotFactory(parentProps, parentSlots) {
|
|
1015
1314
|
const {
|
|
1016
|
-
invalid:
|
|
1017
|
-
valid:
|
|
1018
|
-
hint:
|
|
1019
|
-
loading:
|
|
1020
|
-
} =
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1315
|
+
invalid: invalidSlot,
|
|
1316
|
+
valid: validSlot,
|
|
1317
|
+
hint: hintSlot,
|
|
1318
|
+
loading: loadingSlot
|
|
1319
|
+
} = parentSlots;
|
|
1320
|
+
const {
|
|
1321
|
+
hintLabel,
|
|
1322
|
+
modelValue,
|
|
1323
|
+
valid,
|
|
1324
|
+
validLabel,
|
|
1325
|
+
invalid,
|
|
1326
|
+
invalidLabel,
|
|
1327
|
+
...otherProps
|
|
1328
|
+
} = toRefs(parentProps);
|
|
1329
|
+
const loading = resolveFieldData(otherProps, "loading");
|
|
1330
|
+
const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
|
|
1331
|
+
const hasInvalid = computed(() => {
|
|
1332
|
+
if (!invalid.value) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
if (invalid.value && invalidSlot) {
|
|
1336
|
+
return true;
|
|
1337
|
+
}
|
|
1338
|
+
if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
|
|
1339
|
+
return true;
|
|
1340
|
+
}
|
|
1341
|
+
if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
|
|
1342
|
+
return true;
|
|
1343
|
+
}
|
|
1344
|
+
return false;
|
|
1345
|
+
});
|
|
1346
|
+
const hasHint = computed(
|
|
1347
|
+
() => !!(hintLabel && hintLabel.value || hintSlot)
|
|
1348
|
+
);
|
|
1349
|
+
const hasValid = computed(
|
|
1350
|
+
() => !!(validLabel && validLabel.value || validSlot)
|
|
1351
|
+
);
|
|
1352
|
+
const hasLoading = computed(
|
|
1353
|
+
() => !!((loading == null ? void 0 : loading.value) && loadingSlot || (loading == null ? void 0 : loading.value) && (loadingLabel == null ? void 0 : loadingLabel.value))
|
|
1354
|
+
);
|
|
1355
|
+
const isVisible = computed(
|
|
1356
|
+
() => hasHint.value || hasValid.value || hasInvalid.value || hasLoading.value
|
|
1036
1357
|
);
|
|
1037
1358
|
return {
|
|
1038
|
-
hasInvalid
|
|
1039
|
-
hasHint
|
|
1040
|
-
hasValid
|
|
1041
|
-
hasLoading
|
|
1359
|
+
hasInvalid,
|
|
1360
|
+
hasHint,
|
|
1361
|
+
hasValid,
|
|
1362
|
+
hasLoading,
|
|
1042
1363
|
HintSlot: {
|
|
1043
1364
|
name: "HintSlot",
|
|
1044
1365
|
props: {
|
|
@@ -1047,58 +1368,66 @@ function _t(t, l) {
|
|
|
1047
1368
|
default: () => ({})
|
|
1048
1369
|
}
|
|
1049
1370
|
},
|
|
1050
|
-
setup(
|
|
1051
|
-
const
|
|
1052
|
-
const
|
|
1053
|
-
hintLabel
|
|
1054
|
-
modelValue
|
|
1055
|
-
valid
|
|
1056
|
-
validLabel
|
|
1057
|
-
invalid
|
|
1058
|
-
invalidLabel
|
|
1059
|
-
loading
|
|
1060
|
-
loadingLabel
|
|
1061
|
-
...
|
|
1371
|
+
setup(props) {
|
|
1372
|
+
const hintContent = computed(() => {
|
|
1373
|
+
const slotProps = toReactive({
|
|
1374
|
+
hintLabel,
|
|
1375
|
+
modelValue,
|
|
1376
|
+
valid,
|
|
1377
|
+
validLabel,
|
|
1378
|
+
invalid,
|
|
1379
|
+
invalidLabel,
|
|
1380
|
+
loading,
|
|
1381
|
+
loadingLabel,
|
|
1382
|
+
...props.params
|
|
1062
1383
|
});
|
|
1063
|
-
|
|
1384
|
+
if (invalid == null ? void 0 : invalid.value) {
|
|
1385
|
+
return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1386
|
+
}
|
|
1387
|
+
if (valid == null ? void 0 : valid.value)
|
|
1388
|
+
return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1389
|
+
if (loading == null ? void 0 : loading.value)
|
|
1390
|
+
return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1391
|
+
return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1064
1392
|
});
|
|
1065
1393
|
return {
|
|
1066
|
-
isVisible
|
|
1067
|
-
hasInvalid
|
|
1068
|
-
hasValid
|
|
1069
|
-
hintContent
|
|
1394
|
+
isVisible,
|
|
1395
|
+
hasInvalid,
|
|
1396
|
+
hasValid,
|
|
1397
|
+
hintContent
|
|
1070
1398
|
};
|
|
1071
1399
|
},
|
|
1072
1400
|
render() {
|
|
1073
|
-
if (this.isVisible)
|
|
1074
|
-
return
|
|
1401
|
+
if (this.isVisible) {
|
|
1402
|
+
return h(
|
|
1075
1403
|
"small",
|
|
1076
1404
|
{
|
|
1077
1405
|
role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
|
|
1078
1406
|
},
|
|
1079
1407
|
this.hintContent
|
|
1080
1408
|
);
|
|
1409
|
+
}
|
|
1081
1410
|
}
|
|
1082
1411
|
}
|
|
1083
1412
|
};
|
|
1084
1413
|
}
|
|
1085
|
-
const
|
|
1086
|
-
...
|
|
1087
|
-
...
|
|
1088
|
-
...
|
|
1089
|
-
...
|
|
1090
|
-
...
|
|
1091
|
-
...
|
|
1092
|
-
...
|
|
1093
|
-
...
|
|
1094
|
-
...
|
|
1095
|
-
...
|
|
1096
|
-
...
|
|
1097
|
-
...
|
|
1098
|
-
...
|
|
1099
|
-
...
|
|
1100
|
-
...
|
|
1101
|
-
...
|
|
1414
|
+
const VvSelectProps = {
|
|
1415
|
+
...IdNameProps,
|
|
1416
|
+
...AutofocusProps,
|
|
1417
|
+
...AutocompleteProps,
|
|
1418
|
+
...TabindexProps,
|
|
1419
|
+
...ValidProps,
|
|
1420
|
+
...InvalidProps,
|
|
1421
|
+
...HintProps,
|
|
1422
|
+
...LoadingProps,
|
|
1423
|
+
...DisabledProps,
|
|
1424
|
+
...ReadonlyProps,
|
|
1425
|
+
...ModifiersProps,
|
|
1426
|
+
...OptionsProps,
|
|
1427
|
+
...IconProps,
|
|
1428
|
+
...FloatingLabelProps,
|
|
1429
|
+
...UnselectableProps,
|
|
1430
|
+
...LabelProps,
|
|
1102
1431
|
/**
|
|
1103
1432
|
* This Boolean attribute indicates that multiple options can be selected in the list.
|
|
1104
1433
|
* If it is not specified, then only one option can be selected at a time.
|
|
@@ -1129,521 +1458,755 @@ const _l = {
|
|
|
1129
1458
|
* Select placeholder
|
|
1130
1459
|
*/
|
|
1131
1460
|
placeholder: String
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1461
|
+
};
|
|
1462
|
+
const VvSelectEmits = ["update:modelValue", "focus", "blur"];
|
|
1463
|
+
function useComponentFocus(inputTemplateRef, emit) {
|
|
1464
|
+
const { focused } = useFocus(inputTemplateRef);
|
|
1465
|
+
watch(focused, (newValue) => {
|
|
1466
|
+
emit(newValue ? "focus" : "blur", unref(inputTemplateRef));
|
|
1467
|
+
});
|
|
1468
|
+
return {
|
|
1469
|
+
focused
|
|
1139
1470
|
};
|
|
1140
1471
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const
|
|
1143
|
-
() => Boolean((
|
|
1144
|
-
)
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
() => Boolean((
|
|
1150
|
-
)
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
() => Boolean((t == null ? void 0 : t.value) && l.value === de.bottom)
|
|
1472
|
+
function useComponentIcon(icon, iconPosition) {
|
|
1473
|
+
const hasIconBefore = computed(
|
|
1474
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.before)
|
|
1475
|
+
);
|
|
1476
|
+
const hasIconAfter = computed(
|
|
1477
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.after)
|
|
1478
|
+
);
|
|
1479
|
+
const hasIconLeft = computed(
|
|
1480
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.left)
|
|
1481
|
+
);
|
|
1482
|
+
const hasIconRight = computed(
|
|
1483
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.right)
|
|
1154
1484
|
);
|
|
1485
|
+
const hasIconTop = computed(
|
|
1486
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.top)
|
|
1487
|
+
);
|
|
1488
|
+
const hasIconBottom = computed(
|
|
1489
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.bottom)
|
|
1490
|
+
);
|
|
1491
|
+
const hasIcon = computed(() => {
|
|
1492
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1493
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
1494
|
+
}
|
|
1495
|
+
return icon == null ? void 0 : icon.value;
|
|
1496
|
+
});
|
|
1155
1497
|
return {
|
|
1156
|
-
hasIcon
|
|
1157
|
-
hasIconLeft
|
|
1158
|
-
hasIconRight
|
|
1159
|
-
hasIconTop
|
|
1160
|
-
hasIconBottom
|
|
1161
|
-
hasIconBefore
|
|
1162
|
-
hasIconAfter
|
|
1498
|
+
hasIcon,
|
|
1499
|
+
hasIconLeft,
|
|
1500
|
+
hasIconRight,
|
|
1501
|
+
hasIconTop,
|
|
1502
|
+
hasIconBottom,
|
|
1503
|
+
hasIconBefore,
|
|
1504
|
+
hasIconAfter
|
|
1163
1505
|
};
|
|
1164
1506
|
}
|
|
1165
|
-
function
|
|
1166
|
-
const { options
|
|
1507
|
+
function useOptions(props) {
|
|
1508
|
+
const { options, labelKey, valueKey, disabledKey } = toRefs(props);
|
|
1509
|
+
const getOptionLabel = (option) => {
|
|
1510
|
+
if (typeof option !== "object" && option !== null)
|
|
1511
|
+
return option;
|
|
1512
|
+
return typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value];
|
|
1513
|
+
};
|
|
1514
|
+
const getOptionValue = (option) => {
|
|
1515
|
+
if (typeof option !== "object" && option !== null)
|
|
1516
|
+
return option;
|
|
1517
|
+
return typeof valueKey.value === "function" ? valueKey.value(option) : option[valueKey.value];
|
|
1518
|
+
};
|
|
1519
|
+
const getOptionDisabled = (option) => {
|
|
1520
|
+
if (typeof option !== "object" && option !== null)
|
|
1521
|
+
return false;
|
|
1522
|
+
return typeof disabledKey.value === "function" ? disabledKey.value(option) : option[disabledKey.value];
|
|
1523
|
+
};
|
|
1167
1524
|
return {
|
|
1168
|
-
options
|
|
1169
|
-
getOptionLabel
|
|
1170
|
-
getOptionValue
|
|
1171
|
-
getOptionDisabled
|
|
1525
|
+
options,
|
|
1526
|
+
getOptionLabel,
|
|
1527
|
+
getOptionValue,
|
|
1528
|
+
getOptionDisabled
|
|
1172
1529
|
};
|
|
1173
1530
|
}
|
|
1174
|
-
const
|
|
1531
|
+
const _hoisted_1$1 = ["for"];
|
|
1532
|
+
const _hoisted_2$1 = { class: "vv-select__wrapper" };
|
|
1533
|
+
const _hoisted_3$1 = {
|
|
1175
1534
|
key: 0,
|
|
1176
1535
|
class: "vv-select__input-before"
|
|
1177
|
-
}
|
|
1536
|
+
};
|
|
1537
|
+
const _hoisted_4$1 = { class: "vv-select__inner" };
|
|
1538
|
+
const _hoisted_5$1 = ["id"];
|
|
1539
|
+
const _hoisted_6$1 = ["disabled", "hidden"];
|
|
1540
|
+
const _hoisted_7$1 = ["disabled", "value"];
|
|
1541
|
+
const _hoisted_8$1 = {
|
|
1178
1542
|
key: 1,
|
|
1179
1543
|
class: "vv-select__input-after"
|
|
1180
|
-
}
|
|
1544
|
+
};
|
|
1545
|
+
const __default__$2 = {
|
|
1181
1546
|
name: "VvSelect"
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1547
|
+
};
|
|
1548
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1549
|
+
...__default__$2,
|
|
1550
|
+
props: VvSelectProps,
|
|
1551
|
+
emits: VvSelectEmits,
|
|
1552
|
+
setup(__props, { emit }) {
|
|
1553
|
+
const props = __props;
|
|
1554
|
+
const slots = useSlots();
|
|
1555
|
+
const select = ref();
|
|
1556
|
+
const { HintSlot, hasHint, hasInvalid } = HintSlotFactory(props, slots);
|
|
1557
|
+
const {
|
|
1558
|
+
id,
|
|
1559
|
+
modifiers,
|
|
1560
|
+
disabled,
|
|
1561
|
+
readonly,
|
|
1562
|
+
loading,
|
|
1563
|
+
icon,
|
|
1564
|
+
iconPosition,
|
|
1565
|
+
invalid,
|
|
1566
|
+
valid,
|
|
1567
|
+
floating,
|
|
1568
|
+
multiple
|
|
1569
|
+
} = toRefs(props);
|
|
1570
|
+
const hasId = useUniqueId(id);
|
|
1571
|
+
const hasDescribedBy = computed(() => `${hasId.value}-hint`);
|
|
1572
|
+
const { focused } = useComponentFocus(select, emit);
|
|
1573
|
+
const isVisible = useElementVisibility(select);
|
|
1574
|
+
watch(isVisible, (newValue) => {
|
|
1575
|
+
if (newValue && props.autofocus) {
|
|
1576
|
+
focused.value = true;
|
|
1577
|
+
}
|
|
1202
1578
|
});
|
|
1203
|
-
const { hasIcon
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
)
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
})
|
|
1579
|
+
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
1580
|
+
icon,
|
|
1581
|
+
iconPosition
|
|
1582
|
+
);
|
|
1583
|
+
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
1584
|
+
const isDisabled = computed(() => props.disabled || props.readonly);
|
|
1585
|
+
const hasTabindex = computed(() => {
|
|
1586
|
+
return isDisabled.value ? -1 : props.tabindex;
|
|
1587
|
+
});
|
|
1588
|
+
const isInvalid = computed(() => {
|
|
1589
|
+
if (props.invalid === true) {
|
|
1590
|
+
return true;
|
|
1591
|
+
}
|
|
1592
|
+
if (props.valid === true) {
|
|
1593
|
+
return false;
|
|
1594
|
+
}
|
|
1595
|
+
return void 0;
|
|
1596
|
+
});
|
|
1597
|
+
const bemCssClasses = useModifiers(
|
|
1212
1598
|
"vv-select",
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
valid:
|
|
1216
|
-
invalid:
|
|
1217
|
-
loading:
|
|
1218
|
-
disabled:
|
|
1219
|
-
readonly:
|
|
1220
|
-
"icon-before":
|
|
1221
|
-
"icon-after":
|
|
1222
|
-
dirty:
|
|
1223
|
-
focus:
|
|
1224
|
-
floating:
|
|
1225
|
-
multiple:
|
|
1599
|
+
modifiers,
|
|
1600
|
+
computed(() => ({
|
|
1601
|
+
valid: valid.value,
|
|
1602
|
+
invalid: invalid.value,
|
|
1603
|
+
loading: loading.value,
|
|
1604
|
+
disabled: disabled.value,
|
|
1605
|
+
readonly: readonly.value,
|
|
1606
|
+
"icon-before": hasIconBefore.value,
|
|
1607
|
+
"icon-after": hasIconAfter.value,
|
|
1608
|
+
dirty: isDirty.value,
|
|
1609
|
+
focus: focused.value,
|
|
1610
|
+
floating: floating.value,
|
|
1611
|
+
multiple: multiple.value
|
|
1226
1612
|
}))
|
|
1227
|
-
)
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1613
|
+
);
|
|
1614
|
+
const hasAttrs = computed(() => {
|
|
1615
|
+
return {
|
|
1616
|
+
name: props.name,
|
|
1617
|
+
tabindex: hasTabindex.value,
|
|
1618
|
+
disabled: isDisabled.value,
|
|
1619
|
+
required: props.required,
|
|
1620
|
+
size: props.size,
|
|
1621
|
+
autocomplete: props.autocomplete,
|
|
1622
|
+
multiple: props.multiple,
|
|
1623
|
+
"aria-invalid": isInvalid.value,
|
|
1624
|
+
"aria-describedby": !hasInvalid.value && hasHint.value ? hasDescribedBy.value : void 0,
|
|
1625
|
+
"aria-errormessage": hasInvalid.value ? hasDescribedBy.value : void 0
|
|
1626
|
+
};
|
|
1627
|
+
});
|
|
1628
|
+
const slotProps = computed(() => ({
|
|
1629
|
+
valid: props.valid,
|
|
1630
|
+
invalid: props.invalid,
|
|
1631
|
+
modelValue: props.modelValue
|
|
1632
|
+
}));
|
|
1633
|
+
const { getOptionLabel, getOptionValue, getOptionDisabled } = useOptions(props);
|
|
1634
|
+
const localModelValue = computed({
|
|
1635
|
+
get: () => {
|
|
1636
|
+
return props.modelValue;
|
|
1637
|
+
},
|
|
1638
|
+
set: (newValue) => {
|
|
1639
|
+
if (Array.isArray(newValue)) {
|
|
1640
|
+
newValue = newValue.filter((item) => item !== void 0);
|
|
1641
|
+
}
|
|
1642
|
+
emit("update:modelValue", newValue);
|
|
1246
1643
|
}
|
|
1247
1644
|
});
|
|
1248
|
-
return (
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
class: "vv-select__icon"
|
|
1263
|
-
}, o(q)), null, 16)) : k("", !0),
|
|
1264
|
-
Te(G("select", j({
|
|
1265
|
-
id: o(z),
|
|
1266
|
-
ref_key: "select",
|
|
1267
|
-
ref: n,
|
|
1268
|
-
"onUpdate:modelValue": L[0] || (L[0] = (I) => Ne(le) ? le.value = I : null)
|
|
1269
|
-
}, o(te)), [
|
|
1270
|
-
S.placeholder ? (p(), g("option", {
|
|
1645
|
+
return (_ctx, _cache) => {
|
|
1646
|
+
return openBlock(), createElementBlock("div", {
|
|
1647
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1648
|
+
}, [
|
|
1649
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
1650
|
+
key: 0,
|
|
1651
|
+
for: unref(hasId)
|
|
1652
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1$1)) : createCommentVNode("", true),
|
|
1653
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
1654
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
1655
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1656
|
+
])) : createCommentVNode("", true),
|
|
1657
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
1658
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
1271
1659
|
key: 0,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1660
|
+
class: "vv-select__icon"
|
|
1661
|
+
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
1662
|
+
withDirectives(createElementVNode("select", mergeProps({
|
|
1663
|
+
id: unref(hasId),
|
|
1664
|
+
ref_key: "select",
|
|
1665
|
+
ref: select,
|
|
1666
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
1667
|
+
}, unref(hasAttrs)), [
|
|
1668
|
+
_ctx.placeholder ? (openBlock(), createElementBlock("option", {
|
|
1669
|
+
key: 0,
|
|
1670
|
+
value: void 0,
|
|
1671
|
+
disabled: !_ctx.unselectable,
|
|
1672
|
+
hidden: !_ctx.unselectable
|
|
1673
|
+
}, toDisplayString(_ctx.placeholder), 9, _hoisted_6$1)) : createCommentVNode("", true),
|
|
1674
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
|
|
1675
|
+
return openBlock(), createElementBlock("option", {
|
|
1676
|
+
key: index,
|
|
1677
|
+
disabled: unref(getOptionDisabled)(option),
|
|
1678
|
+
value: unref(getOptionValue)(option)
|
|
1679
|
+
}, toDisplayString(unref(getOptionLabel)(option)), 9, _hoisted_7$1);
|
|
1680
|
+
}), 128))
|
|
1681
|
+
], 16, _hoisted_5$1), [
|
|
1682
|
+
[vModelSelect, unref(localModelValue)]
|
|
1683
|
+
]),
|
|
1684
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
1685
|
+
key: 1,
|
|
1686
|
+
class: "vv-select__icon vv-select__icon-after"
|
|
1687
|
+
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
1283
1688
|
]),
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
}, o(q)), null, 16)) : k("", !0)
|
|
1689
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
|
|
1690
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1691
|
+
])) : createCommentVNode("", true)
|
|
1288
1692
|
]),
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
class: "vv-select__hint"
|
|
1296
|
-
}, null, 8, ["id"])
|
|
1297
|
-
], 2));
|
|
1693
|
+
createVNode(unref(HintSlot), {
|
|
1694
|
+
id: unref(hasDescribedBy),
|
|
1695
|
+
class: "vv-select__hint"
|
|
1696
|
+
}, null, 8, ["id"])
|
|
1697
|
+
], 2);
|
|
1698
|
+
};
|
|
1298
1699
|
}
|
|
1299
|
-
})
|
|
1300
|
-
|
|
1700
|
+
});
|
|
1701
|
+
const VvBadgeProps = {
|
|
1702
|
+
...ModifiersProps,
|
|
1301
1703
|
value: [String, Number]
|
|
1302
|
-
}
|
|
1704
|
+
};
|
|
1705
|
+
const __default__$1 = {
|
|
1303
1706
|
name: "VvBadge"
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1707
|
+
};
|
|
1708
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1709
|
+
...__default__$1,
|
|
1710
|
+
props: VvBadgeProps,
|
|
1711
|
+
setup(__props) {
|
|
1712
|
+
const props = __props;
|
|
1713
|
+
const { modifiers } = toRefs(props);
|
|
1714
|
+
const bemCssClasses = useModifiers("vv-badge", modifiers);
|
|
1715
|
+
return (_ctx, _cache) => {
|
|
1716
|
+
return openBlock(), createElementBlock("span", {
|
|
1717
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
1718
|
+
role: "status"
|
|
1719
|
+
}, [
|
|
1720
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1721
|
+
createTextVNode(toDisplayString(_ctx.value), 1)
|
|
1722
|
+
])
|
|
1723
|
+
], 2);
|
|
1724
|
+
};
|
|
1317
1725
|
}
|
|
1318
|
-
})
|
|
1726
|
+
});
|
|
1727
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
1728
|
+
const volver = useVolver();
|
|
1729
|
+
const volverComponentDefaults = computed(() => {
|
|
1730
|
+
var _a;
|
|
1731
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
1732
|
+
return void 0;
|
|
1733
|
+
}
|
|
1734
|
+
return volver.defaults.value[componentName];
|
|
1735
|
+
});
|
|
1736
|
+
return computed(() => {
|
|
1737
|
+
if (volverComponentDefaults.value === void 0) {
|
|
1738
|
+
return props;
|
|
1739
|
+
}
|
|
1740
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
1741
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
1742
|
+
const simplifiedProps = props;
|
|
1743
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
1744
|
+
const propValue = simplifiedProps[key];
|
|
1745
|
+
acc[key] = propValue;
|
|
1746
|
+
if (key in componentDefaults) {
|
|
1747
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
1748
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
1749
|
+
if (typeArray.length) {
|
|
1750
|
+
const typeFunction = typeArray[0];
|
|
1751
|
+
if (typeFunction === propValue) {
|
|
1752
|
+
acc[key] = componentDefaults[key];
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
1757
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
1758
|
+
if (typeFunction() === propValue) {
|
|
1759
|
+
acc[key] = componentDefaults[key];
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
1763
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
1764
|
+
if (typeof defaultValue === "function") {
|
|
1765
|
+
defaultValue = defaultValue();
|
|
1766
|
+
}
|
|
1767
|
+
if (typeof defaultValue === "object") {
|
|
1768
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
1769
|
+
acc[key] = componentDefaults[key];
|
|
1770
|
+
}
|
|
1771
|
+
} else if (defaultValue === propValue) {
|
|
1772
|
+
acc[key] = componentDefaults[key];
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
return acc;
|
|
1777
|
+
}, {});
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
const _hoisted_1 = ["id"];
|
|
1781
|
+
const _hoisted_2 = ["id", "for"];
|
|
1782
|
+
const _hoisted_3 = ["id", "aria-controls", "aria-labelledby", "aria-describedby", "placeholder"];
|
|
1783
|
+
const _hoisted_4 = {
|
|
1319
1784
|
key: 0,
|
|
1320
1785
|
class: "vv-select__input-before"
|
|
1321
|
-
}
|
|
1786
|
+
};
|
|
1787
|
+
const _hoisted_5 = { class: "vv-select__inner" };
|
|
1788
|
+
const _hoisted_6 = ["aria-labelledby", "tabindex"];
|
|
1789
|
+
const _hoisted_7 = ["aria-label", "onClick"];
|
|
1790
|
+
const _hoisted_8 = {
|
|
1322
1791
|
key: 1,
|
|
1323
1792
|
class: "vv-select__input-after"
|
|
1324
|
-
}
|
|
1793
|
+
};
|
|
1794
|
+
const __default__ = {
|
|
1325
1795
|
name: "VvCombobox",
|
|
1326
|
-
components: { VvDropdown:
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1796
|
+
components: { VvDropdown: _sfc_main$5, VvDropdownOption: _sfc_main$3 }
|
|
1797
|
+
};
|
|
1798
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1799
|
+
...__default__,
|
|
1800
|
+
props: VvComboboxProps,
|
|
1801
|
+
emits: VvComboboxEvents,
|
|
1802
|
+
setup(__props, { emit }) {
|
|
1803
|
+
const props = __props;
|
|
1804
|
+
const slots = useSlots();
|
|
1805
|
+
const propsDefaults = useDefaults(
|
|
1806
|
+
"VvCombobox",
|
|
1807
|
+
VvComboboxProps,
|
|
1808
|
+
props
|
|
1809
|
+
);
|
|
1810
|
+
const { HintSlot } = HintSlotFactory(props, slots);
|
|
1811
|
+
const inputEl = ref(null);
|
|
1812
|
+
const inputSearchEl = ref(null);
|
|
1813
|
+
const wrapperEl = ref(null);
|
|
1814
|
+
const { focused } = useComponentFocus(inputEl, emit);
|
|
1815
|
+
const { focused: focusedWithin } = useFocusWithin(wrapperEl);
|
|
1816
|
+
watch(focused, (newValue) => {
|
|
1817
|
+
if (!props.autoOpen) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
if (newValue && !expanded.value) {
|
|
1821
|
+
expand();
|
|
1822
|
+
return;
|
|
1823
|
+
}
|
|
1824
|
+
if (!newValue && expanded.value && !focusedWithin.value) {
|
|
1825
|
+
collapse();
|
|
1340
1826
|
}
|
|
1341
|
-
}), Y(y, (r) => {
|
|
1342
|
-
!v.value && !r && m.value && B();
|
|
1343
1827
|
});
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1828
|
+
watch(focusedWithin, (newValue) => {
|
|
1829
|
+
if (!focused.value && !newValue && expanded.value) {
|
|
1830
|
+
collapse();
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
const searchText = ref("");
|
|
1834
|
+
const debouncedSearchText = refDebounced(
|
|
1835
|
+
searchText,
|
|
1836
|
+
Number(props.debounceSearch)
|
|
1347
1837
|
);
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
() =>
|
|
1838
|
+
watch(
|
|
1839
|
+
debouncedSearchText,
|
|
1840
|
+
() => emit("change:search", debouncedSearchText.value)
|
|
1351
1841
|
);
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
e.disabled || e.readonly || !m.value || (m.value = !1);
|
|
1842
|
+
const expanded = ref(false);
|
|
1843
|
+
const toggleExpanded = () => {
|
|
1844
|
+
if (props.disabled || props.readonly)
|
|
1845
|
+
return;
|
|
1846
|
+
expanded.value = !expanded.value;
|
|
1358
1847
|
};
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1848
|
+
const expand = () => {
|
|
1849
|
+
if (props.disabled || props.readonly || expanded.value)
|
|
1850
|
+
return;
|
|
1851
|
+
expanded.value = true;
|
|
1852
|
+
};
|
|
1853
|
+
const collapse = () => {
|
|
1854
|
+
if (props.disabled || props.readonly || !expanded.value)
|
|
1855
|
+
return;
|
|
1856
|
+
expanded.value = false;
|
|
1857
|
+
};
|
|
1858
|
+
watch(expanded, (newValue) => {
|
|
1859
|
+
if (searchable.value) {
|
|
1860
|
+
nextTick(() => {
|
|
1861
|
+
if (newValue) {
|
|
1862
|
+
if (inputSearchEl.value) {
|
|
1863
|
+
inputSearchEl.value.focus();
|
|
1864
|
+
}
|
|
1865
|
+
return;
|
|
1866
|
+
}
|
|
1867
|
+
searchText.value = "";
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1367
1870
|
});
|
|
1368
1871
|
const {
|
|
1369
|
-
id
|
|
1370
|
-
icon
|
|
1371
|
-
iconPosition
|
|
1372
|
-
modifiers
|
|
1373
|
-
disabled
|
|
1374
|
-
readonly
|
|
1375
|
-
loading
|
|
1376
|
-
valid
|
|
1377
|
-
invalid
|
|
1378
|
-
floating
|
|
1379
|
-
searchable
|
|
1380
|
-
} =
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1872
|
+
id,
|
|
1873
|
+
icon,
|
|
1874
|
+
iconPosition,
|
|
1875
|
+
modifiers,
|
|
1876
|
+
disabled,
|
|
1877
|
+
readonly,
|
|
1878
|
+
loading,
|
|
1879
|
+
valid,
|
|
1880
|
+
invalid,
|
|
1881
|
+
floating,
|
|
1882
|
+
searchable
|
|
1883
|
+
} = toRefs(props);
|
|
1884
|
+
const hasId = useUniqueId(id);
|
|
1885
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
1886
|
+
const hasDropdownId = computed(() => `${hasId.value}-dropdown`);
|
|
1887
|
+
const hasSearchId = computed(() => `${hasId.value}-search`);
|
|
1888
|
+
const hasLabelId = computed(() => `${hasId.value}-label`);
|
|
1889
|
+
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
1890
|
+
icon,
|
|
1891
|
+
iconPosition
|
|
1892
|
+
);
|
|
1893
|
+
const isDirty = computed(() => !isEmpty(props.modelValue));
|
|
1894
|
+
const hasTabindex = computed(() => {
|
|
1895
|
+
return disabled.value || readonly.value ? -1 : props.tabindex;
|
|
1896
|
+
});
|
|
1897
|
+
const bemCssClasses = useModifiers(
|
|
1384
1898
|
"vv-select",
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
disabled:
|
|
1388
|
-
loading:
|
|
1389
|
-
readonly:
|
|
1390
|
-
"icon-before": Boolean(
|
|
1391
|
-
"icon-after": Boolean(
|
|
1392
|
-
valid:
|
|
1393
|
-
invalid:
|
|
1394
|
-
dirty:
|
|
1395
|
-
focus:
|
|
1396
|
-
floating:
|
|
1899
|
+
modifiers,
|
|
1900
|
+
computed(() => ({
|
|
1901
|
+
disabled: disabled.value,
|
|
1902
|
+
loading: loading.value,
|
|
1903
|
+
readonly: readonly.value,
|
|
1904
|
+
"icon-before": Boolean(hasIconBefore.value),
|
|
1905
|
+
"icon-after": Boolean(hasIconAfter.value),
|
|
1906
|
+
valid: valid.value,
|
|
1907
|
+
invalid: invalid.value,
|
|
1908
|
+
dirty: isDirty.value,
|
|
1909
|
+
focus: focused.value,
|
|
1910
|
+
floating: floating.value
|
|
1397
1911
|
}))
|
|
1398
|
-
)
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1912
|
+
);
|
|
1913
|
+
const hasOptions = computed(
|
|
1914
|
+
() => props.searchable ? filteredOptions.value : props.options
|
|
1915
|
+
);
|
|
1916
|
+
const { getOptionLabel, getOptionValue, getOptionDisabled } = useOptions(props);
|
|
1917
|
+
const filteredOptions = computed(() => {
|
|
1918
|
+
var _a;
|
|
1919
|
+
return (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
1920
|
+
return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
|
|
1921
|
+
});
|
|
1403
1922
|
});
|
|
1404
|
-
function
|
|
1405
|
-
|
|
1923
|
+
function getOptionSelected(option) {
|
|
1924
|
+
if (Array.isArray(props.modelValue)) {
|
|
1925
|
+
return contains(option, props.modelValue) || contains(getOptionValue(option), props.modelValue);
|
|
1926
|
+
}
|
|
1927
|
+
return equals(option, props.modelValue) || equals(getOptionValue(option), props.modelValue);
|
|
1406
1928
|
}
|
|
1407
|
-
const
|
|
1408
|
-
let
|
|
1409
|
-
|
|
1410
|
-
|
|
1929
|
+
const selectedOptions = computed(() => {
|
|
1930
|
+
let selectedValues = [];
|
|
1931
|
+
if (Array.isArray(props.modelValue)) {
|
|
1932
|
+
selectedValues = props.modelValue;
|
|
1933
|
+
} else if (props.modelValue) {
|
|
1934
|
+
selectedValues = [props.modelValue];
|
|
1935
|
+
}
|
|
1936
|
+
return props.options.filter(
|
|
1937
|
+
(option) => selectedValues.includes(getOptionValue(option))
|
|
1411
1938
|
);
|
|
1412
|
-
}), ie = i(() => W.value.map((r) => I(r)).join(e.separator));
|
|
1413
|
-
Y(W, () => {
|
|
1414
|
-
!e.multiple && e.autoClose && B();
|
|
1415
1939
|
});
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
if (
|
|
1940
|
+
const hasValue = computed(() => {
|
|
1941
|
+
return selectedOptions.value.map((option) => getOptionLabel(option)).join(props.separator);
|
|
1942
|
+
});
|
|
1943
|
+
watch(selectedOptions, () => {
|
|
1944
|
+
if (!props.multiple && props.autoClose) {
|
|
1945
|
+
collapse();
|
|
1946
|
+
}
|
|
1947
|
+
});
|
|
1948
|
+
const onClickInput = () => {
|
|
1949
|
+
props.autoOpen ? expand() : toggleExpanded();
|
|
1950
|
+
};
|
|
1951
|
+
const onInput = (option) => {
|
|
1952
|
+
var _a;
|
|
1953
|
+
if (props.disabled || props.readonly) {
|
|
1421
1954
|
return;
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1955
|
+
}
|
|
1956
|
+
const value = getOptionValue(option);
|
|
1957
|
+
let toReturn = value;
|
|
1958
|
+
if (props.multiple) {
|
|
1959
|
+
if (Array.isArray(props.modelValue)) {
|
|
1960
|
+
const maxValues = Number(props.maxValues);
|
|
1961
|
+
if (props.maxValues !== void 0 && maxValues >= 0 && ((_a = props.modelValue) == null ? void 0 : _a.length) >= maxValues) {
|
|
1962
|
+
if (!contains(value, props.modelValue)) {
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
toReturn = contains(value, props.modelValue) ? removeFromList(value, props.modelValue) : [...props.modelValue, value];
|
|
1967
|
+
} else {
|
|
1968
|
+
toReturn = [value];
|
|
1969
|
+
}
|
|
1970
|
+
} else {
|
|
1971
|
+
if (props.autoClose) {
|
|
1972
|
+
collapse();
|
|
1973
|
+
}
|
|
1974
|
+
if (props.unselectable && value === props.modelValue) {
|
|
1975
|
+
toReturn = void 0;
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
emit("update:modelValue", toReturn);
|
|
1979
|
+
};
|
|
1980
|
+
const selectProps = computed(() => ({
|
|
1981
|
+
id: hasId.value,
|
|
1982
|
+
name: props.name,
|
|
1983
|
+
tabindex: hasTabindex.value,
|
|
1984
|
+
valid: valid.value,
|
|
1985
|
+
validLabel: propsDefaults.value.validLabel,
|
|
1986
|
+
invalid: invalid.value,
|
|
1987
|
+
invalidLabel: propsDefaults.value.invalidLabel,
|
|
1988
|
+
hintLabel: propsDefaults.value.hintLabel,
|
|
1989
|
+
loading: loading.value,
|
|
1990
|
+
loadingLabel: propsDefaults.value.loadingLabel,
|
|
1991
|
+
disabled: disabled.value,
|
|
1992
|
+
readonly: readonly.value,
|
|
1993
|
+
modifiers: props.modifiers,
|
|
1994
|
+
options: hasOptions.value,
|
|
1995
|
+
labelKey: props.labelKey,
|
|
1996
|
+
valueKey: props.valueKey,
|
|
1997
|
+
icon: props.icon,
|
|
1998
|
+
iconPosition: props.iconPosition,
|
|
1999
|
+
floating: props.floating,
|
|
2000
|
+
unselectable: props.unselectable,
|
|
2001
|
+
multiple: props.multiple,
|
|
2002
|
+
label: props.label,
|
|
2003
|
+
placeholder: props.placeholder,
|
|
2004
|
+
modelValue: props.modelValue
|
|
2005
|
+
}));
|
|
2006
|
+
const dropdownProps = computed(() => ({
|
|
2007
|
+
id: hasDropdownId.value,
|
|
2008
|
+
reference: wrapperEl.value,
|
|
2009
|
+
placement: props.placement,
|
|
2010
|
+
strategy: props.strategy,
|
|
2011
|
+
transitionName: props.transitionName,
|
|
2012
|
+
offset: props.offset,
|
|
2013
|
+
shift: props.shift,
|
|
2014
|
+
flip: props.flip,
|
|
2015
|
+
autoPlacement: props.autoPlacement,
|
|
2016
|
+
arrow: props.arrow,
|
|
2017
|
+
autoClose: props.autoClose,
|
|
2018
|
+
autofocusFirst: searchable.value ? false : props.autofocusFirst,
|
|
2019
|
+
triggerWidth: props.triggerWidth,
|
|
2020
|
+
modifiers: props.dropdownModifiers
|
|
1477
2021
|
}));
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
})
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
2022
|
+
const slotProps = computed(() => ({
|
|
2023
|
+
valid: props.valid,
|
|
2024
|
+
invalid: props.invalid,
|
|
2025
|
+
modelValue: props.modelValue
|
|
2026
|
+
}));
|
|
2027
|
+
onKeyStroke([" ", "Enter"], (e) => {
|
|
2028
|
+
if (props.autoOpen) {
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
if (!expanded.value && focused.value) {
|
|
2032
|
+
e.preventDefault();
|
|
2033
|
+
e.stopImmediatePropagation();
|
|
2034
|
+
toggleExpanded();
|
|
2035
|
+
}
|
|
2036
|
+
});
|
|
2037
|
+
return (_ctx, _cache) => {
|
|
2038
|
+
return !_ctx.native ? (openBlock(), createElementBlock("div", {
|
|
1488
2039
|
key: 0,
|
|
1489
|
-
id:
|
|
1490
|
-
|
|
1491
|
-
}, D(r.label), 9, Hl)) : k("", !0),
|
|
1492
|
-
G("div", {
|
|
1493
|
-
ref_key: "wrapperEl",
|
|
1494
|
-
ref: b,
|
|
1495
|
-
class: "vv-select__wrapper"
|
|
2040
|
+
id: unref(hasId),
|
|
2041
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1496
2042
|
}, [
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
2043
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
2044
|
+
key: 0,
|
|
2045
|
+
id: unref(hasLabelId),
|
|
2046
|
+
for: unref(searchable) ? unref(hasSearchId) : void 0
|
|
2047
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_2)) : createCommentVNode("", true),
|
|
2048
|
+
createElementVNode("div", {
|
|
2049
|
+
ref_key: "wrapperEl",
|
|
2050
|
+
ref: wrapperEl,
|
|
2051
|
+
class: "vv-select__wrapper"
|
|
2052
|
+
}, [
|
|
2053
|
+
createVNode(_sfc_main$5, mergeProps({
|
|
2054
|
+
modelValue: unref(expanded),
|
|
2055
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
2056
|
+
}, unref(dropdownProps), {
|
|
2057
|
+
role: unref(DropdownRole).listbox
|
|
2058
|
+
}), createSlots({
|
|
2059
|
+
default: withCtx(({ aria }) => [
|
|
2060
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
2061
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2062
|
+
])) : createCommentVNode("", true),
|
|
2063
|
+
createElementVNode("div", _hoisted_5, [
|
|
2064
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
2065
|
+
key: 0,
|
|
2066
|
+
class: "vv-select__icon"
|
|
2067
|
+
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
2068
|
+
createElementVNode("div", mergeProps({
|
|
2069
|
+
ref_key: "inputEl",
|
|
2070
|
+
ref: inputEl
|
|
2071
|
+
}, aria, {
|
|
2072
|
+
"aria-labelledby": unref(hasLabelId),
|
|
2073
|
+
class: "vv-select__input",
|
|
2074
|
+
role: "combobox",
|
|
2075
|
+
tabindex: unref(hasTabindex),
|
|
2076
|
+
onClickPassive: onClickInput
|
|
2077
|
+
}), [
|
|
2078
|
+
renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
2079
|
+
unref(hasValue) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2080
|
+
!_ctx.badges ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2081
|
+
createTextVNode(toDisplayString(unref(hasValue)), 1)
|
|
2082
|
+
], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(selectedOptions), (option, index) => {
|
|
2083
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
2084
|
+
key: index,
|
|
2085
|
+
modifiers: _ctx.badgeModifiers,
|
|
2086
|
+
class: "vv-select__badge"
|
|
2087
|
+
}, {
|
|
2088
|
+
default: withCtx(() => [
|
|
2089
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(option)) + " ", 1),
|
|
2090
|
+
_ctx.unselectable && !unref(readonly) && !unref(disabled) ? (openBlock(), createElementBlock("button", {
|
|
2091
|
+
key: 0,
|
|
2092
|
+
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
2093
|
+
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
2094
|
+
}, [
|
|
2095
|
+
createVNode(_sfc_main$6, { name: "close" })
|
|
2096
|
+
], 8, _hoisted_7)) : createCommentVNode("", true)
|
|
2097
|
+
]),
|
|
2098
|
+
_: 2
|
|
2099
|
+
}, 1032, ["modifiers"]);
|
|
2100
|
+
}), 128))
|
|
2101
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2102
|
+
createTextVNode(toDisplayString(_ctx.placeholder), 1)
|
|
1542
2103
|
], 64))
|
|
1543
|
-
]
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
2104
|
+
])
|
|
2105
|
+
], 16, _hoisted_6),
|
|
2106
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
2107
|
+
key: 1,
|
|
2108
|
+
class: "vv-select__icon vv-select__icon-after"
|
|
2109
|
+
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
2110
|
+
]),
|
|
2111
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
2112
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
2113
|
+
])) : createCommentVNode("", true)
|
|
2114
|
+
]),
|
|
2115
|
+
items: withCtx(() => [
|
|
2116
|
+
unref(filteredOptions).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(filteredOptions), (option, index) => {
|
|
2117
|
+
return openBlock(), createBlock(_sfc_main$3, mergeProps({
|
|
2118
|
+
disabled: unref(getOptionDisabled)(option),
|
|
2119
|
+
selected: getOptionSelected(option),
|
|
2120
|
+
unselectable: _ctx.unselectable,
|
|
2121
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
2122
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
2123
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
2124
|
+
}, {
|
|
2125
|
+
key: index,
|
|
2126
|
+
class: "vv-dropdown-option",
|
|
2127
|
+
onClickPassive: ($event) => onInput(option)
|
|
2128
|
+
}), {
|
|
2129
|
+
default: withCtx(() => [
|
|
2130
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
2131
|
+
option,
|
|
2132
|
+
selectedOptions: unref(selectedOptions),
|
|
2133
|
+
selected: getOptionSelected(option),
|
|
2134
|
+
disabled: unref(getOptionDisabled)(option)
|
|
2135
|
+
})), () => [
|
|
2136
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(option)), 1)
|
|
2137
|
+
])
|
|
2138
|
+
]),
|
|
2139
|
+
_: 2
|
|
2140
|
+
}, 1040, ["onClickPassive"]);
|
|
2141
|
+
}), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$3, {
|
|
1549
2142
|
key: 1,
|
|
1550
|
-
|
|
1551
|
-
},
|
|
2143
|
+
modifiers: "inert"
|
|
2144
|
+
}, {
|
|
2145
|
+
default: withCtx(() => [
|
|
2146
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
2147
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noOptionsLabel), 1)
|
|
2148
|
+
])
|
|
2149
|
+
]),
|
|
2150
|
+
_: 3
|
|
2151
|
+
})) : (openBlock(), createBlock(_sfc_main$3, {
|
|
2152
|
+
key: 2,
|
|
2153
|
+
modifiers: "inert"
|
|
2154
|
+
}, {
|
|
2155
|
+
default: withCtx(() => [
|
|
2156
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
2157
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noResultsLabel), 1)
|
|
2158
|
+
])
|
|
2159
|
+
]),
|
|
2160
|
+
_: 3
|
|
2161
|
+
}))
|
|
1552
2162
|
]),
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
])
|
|
1579
|
-
]),
|
|
1580
|
-
_: 2
|
|
1581
|
-
}, 1040, ["onClickPassive"]))), 128)) : r.options.length ? (p(), x(Pe, {
|
|
1582
|
-
key: 2,
|
|
1583
|
-
modifiers: "inert"
|
|
1584
|
-
}, {
|
|
1585
|
-
default: F(() => [
|
|
1586
|
-
O(r.$slots, "no-results", {}, () => [
|
|
1587
|
-
J(D(r.noResultsLabel), 1)
|
|
1588
|
-
])
|
|
2163
|
+
_: 2
|
|
2164
|
+
}, [
|
|
2165
|
+
unref(searchable) || _ctx.$slots["dropdown::before"] ? {
|
|
2166
|
+
name: "before",
|
|
2167
|
+
fn: withCtx(() => [
|
|
2168
|
+
renderSlot(_ctx.$slots, "dropdown::before"),
|
|
2169
|
+
unref(searchable) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
2170
|
+
key: 0,
|
|
2171
|
+
id: unref(hasSearchId),
|
|
2172
|
+
ref_key: "inputSearchEl",
|
|
2173
|
+
ref: inputSearchEl,
|
|
2174
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
2175
|
+
"aria-autocomplete": "list",
|
|
2176
|
+
"aria-controls": unref(hasDropdownId),
|
|
2177
|
+
"aria-labelledby": unref(hasLabelId),
|
|
2178
|
+
"aria-describedby": unref(hasHintId),
|
|
2179
|
+
autocomplete: "off",
|
|
2180
|
+
spellcheck: "false",
|
|
2181
|
+
type: "search",
|
|
2182
|
+
class: "vv-dropdown__search",
|
|
2183
|
+
placeholder: unref(propsDefaults).searchPlaceholder
|
|
2184
|
+
}, null, 8, _hoisted_3)), [
|
|
2185
|
+
[vShow, unref(expanded)],
|
|
2186
|
+
[vModelText, unref(searchText)]
|
|
2187
|
+
]) : createCommentVNode("", true)
|
|
1589
2188
|
]),
|
|
1590
|
-
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
O(r.$slots, "no-options", {}, () => [
|
|
1597
|
-
J(D(r.noOptionsLabel), 1)
|
|
1598
|
-
])
|
|
2189
|
+
key: "0"
|
|
2190
|
+
} : void 0,
|
|
2191
|
+
_ctx.$slots["dropdown::after"] ? {
|
|
2192
|
+
name: "after",
|
|
2193
|
+
fn: withCtx(() => [
|
|
2194
|
+
renderSlot(_ctx.$slots, "dropdown::after")
|
|
1599
2195
|
]),
|
|
1600
|
-
|
|
1601
|
-
}
|
|
1602
|
-
]),
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
ref_key: "inputSearchEl",
|
|
1613
|
-
ref: d,
|
|
1614
|
-
"onUpdate:modelValue": $[0] || ($[0] = (w) => Ne(u) ? u.value = w : null),
|
|
1615
|
-
"aria-autocomplete": "list",
|
|
1616
|
-
"aria-controls": o(ce),
|
|
1617
|
-
"aria-labelledby": o(te),
|
|
1618
|
-
"aria-describedby": o(ae),
|
|
1619
|
-
autocomplete: "off",
|
|
1620
|
-
spellcheck: "false",
|
|
1621
|
-
type: "search",
|
|
1622
|
-
class: "vv-dropdown__search",
|
|
1623
|
-
placeholder: r.searchPlaceholder
|
|
1624
|
-
}, null, 8, Fl)), [
|
|
1625
|
-
[lt, o(m)],
|
|
1626
|
-
[Ct, o(u)]
|
|
1627
|
-
]) : k("", !0)
|
|
1628
|
-
]),
|
|
1629
|
-
key: "0"
|
|
1630
|
-
} : void 0,
|
|
1631
|
-
r.$slots["dropdown::after"] ? {
|
|
1632
|
-
name: "after",
|
|
1633
|
-
fn: F(() => [
|
|
1634
|
-
O(r.$slots, "dropdown::after")
|
|
1635
|
-
]),
|
|
1636
|
-
key: "1"
|
|
1637
|
-
} : void 0
|
|
1638
|
-
]), 1040, ["modelValue", "role"])
|
|
1639
|
-
], 512),
|
|
1640
|
-
pe(o(n), {
|
|
1641
|
-
id: o(ae),
|
|
1642
|
-
class: "vv-select__hint"
|
|
1643
|
-
}, null, 8, ["id"])
|
|
1644
|
-
], 10, jl));
|
|
2196
|
+
key: "1"
|
|
2197
|
+
} : void 0
|
|
2198
|
+
]), 1040, ["modelValue", "role"])
|
|
2199
|
+
], 512),
|
|
2200
|
+
createVNode(unref(HintSlot), {
|
|
2201
|
+
id: unref(hasHintId),
|
|
2202
|
+
class: "vv-select__hint"
|
|
2203
|
+
}, null, 8, ["id"])
|
|
2204
|
+
], 10, _hoisted_1)) : (openBlock(), createBlock(_sfc_main$2, mergeProps({ key: 1 }, unref(selectProps), {
|
|
2205
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => emit("update:modelValue", $event))
|
|
2206
|
+
}), null, 16));
|
|
2207
|
+
};
|
|
1645
2208
|
}
|
|
1646
2209
|
});
|
|
1647
2210
|
export {
|
|
1648
|
-
|
|
2211
|
+
_sfc_main as default
|
|
1649
2212
|
};
|