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