@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3
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/auto-imports.d.ts +289 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +16 -50
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +170 -306
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +26 -60
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
- package/dist/components/VvCheckbox/index.d.ts +10 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
- 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 +330 -487
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
- package/dist/components/VvCombobox/index.d.ts +4 -4
- package/dist/components/VvDialog/VvDialog.es.js +66 -102
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +304 -407
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvProgress/VvProgress.es.js +17 -51
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +110 -249
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
- package/dist/components/VvRadio/index.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
- 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 +200 -292
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
- package/dist/components/VvTooltip/index.d.ts +18 -0
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1179 -1371
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcons.d.ts +1 -1
- package/dist/composables/useDebouncedInput.d.ts +1 -1
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useTextCount.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1211 -1404
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +27 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +0 -3
- package/src/components/VvAccordion/index.ts +1 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
- package/src/components/VvBadge/VvBadge.vue +0 -1
- package/src/components/VvButton/VvButton.vue +0 -3
- package/src/components/VvButton/index.ts +2 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
- package/src/components/VvCard/VvCard.vue +0 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
- package/src/components/VvCheckbox/index.ts +1 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
- package/src/components/VvCombobox/VvCombobox.vue +0 -7
- package/src/components/VvDialog/VvDialog.vue +1 -2
- package/src/components/VvDropdown/VvDropdown.vue +0 -4
- package/src/components/VvIcon/VvIcon.vue +0 -2
- package/src/components/VvInputText/VvInputClearAction.ts +0 -1
- package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
- package/src/components/VvInputText/VvInputStepAction.ts +0 -1
- package/src/components/VvInputText/VvInputText.vue +1 -16
- package/src/components/VvInputText/VvInputTextActions.ts +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -2
- package/src/components/VvRadio/VvRadio.vue +0 -3
- package/src/components/VvRadio/index.ts +0 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
- package/src/components/VvSelect/VvSelect.vue +1 -14
- package/src/components/VvTextarea/VvTextarea.vue +1 -15
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/components/common/HintSlot.ts +1 -11
- package/src/composables/group/types/IAccordionGroupState.ts +0 -1
- package/src/composables/group/types/IButtonGroupState.ts +0 -1
- package/src/composables/group/types/IInputGroup.ts +0 -1
- package/src/composables/group/useInjectedGroupState.ts +1 -2
- package/src/composables/group/useProvideGroupState.ts +0 -1
- package/src/composables/useComponentFocus.ts +1 -2
- package/src/composables/useComponentIcons.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useModifiers.ts +1 -2
- package/src/composables/useOptions.ts +0 -1
- package/src/composables/useTextCount.ts +1 -1
- package/src/stories/Accordion/Accordion.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Badge/Badge.stories.mdx +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.stories.mdx +1 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
- package/src/stories/Card/Card.stories.mdx +1 -1
- package/src/stories/Card/CardSlots.stories.mdx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.stories.mdx +1 -1
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/InputText/InputText.stories.mdx +1 -1
- package/src/stories/Progress/Progress.stories.mdx +1 -1
- package/src/stories/Radio/Radio.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Select/Select.stories.mdx +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -1,215 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nanoid as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function X(n, t, e) {
|
|
6
|
-
return e ? Q(n, e) === Q(t, e) : se(n, t);
|
|
7
|
-
}
|
|
8
|
-
function se(n, t) {
|
|
9
|
-
if (n === t)
|
|
10
|
-
return !0;
|
|
11
|
-
if (n && t && typeof n == "object" && typeof t == "object") {
|
|
12
|
-
const e = Array.isArray(n), i = Array.isArray(t);
|
|
13
|
-
let r, u, l;
|
|
14
|
-
if (e && i) {
|
|
15
|
-
if (u = n.length, u != t.length)
|
|
16
|
-
return !1;
|
|
17
|
-
for (r = u; r-- !== 0; )
|
|
18
|
-
if (!se(n[r], t[r]))
|
|
19
|
-
return !1;
|
|
20
|
-
return !0;
|
|
21
|
-
}
|
|
22
|
-
if (e != i)
|
|
23
|
-
return !1;
|
|
24
|
-
const b = n instanceof Date, m = t instanceof Date;
|
|
25
|
-
if (b != m)
|
|
26
|
-
return !1;
|
|
27
|
-
if (b && m)
|
|
28
|
-
return n.getTime() == t.getTime();
|
|
29
|
-
const p = n instanceof RegExp, o = t instanceof RegExp;
|
|
30
|
-
if (p != o)
|
|
31
|
-
return !1;
|
|
32
|
-
if (p && o)
|
|
33
|
-
return n.toString() == t.toString();
|
|
34
|
-
const s = Object.keys(n);
|
|
35
|
-
if (u = s.length, u !== Object.keys(t).length)
|
|
36
|
-
return !1;
|
|
37
|
-
for (r = u; r-- !== 0; )
|
|
38
|
-
if (!Object.prototype.hasOwnProperty.call(t, s[r]))
|
|
39
|
-
return !1;
|
|
40
|
-
for (r = u; r-- !== 0; )
|
|
41
|
-
if (l = s[r], !se(n[l], t[l]))
|
|
42
|
-
return !1;
|
|
43
|
-
return !0;
|
|
44
|
-
}
|
|
45
|
-
return n !== n && t !== t;
|
|
46
|
-
}
|
|
47
|
-
function Q(n, t) {
|
|
48
|
-
if (n && Object.keys(n).length && t) {
|
|
49
|
-
if (t.indexOf(".") === -1)
|
|
50
|
-
return n[t];
|
|
51
|
-
{
|
|
52
|
-
const e = t.split(".");
|
|
53
|
-
let i = n;
|
|
54
|
-
for (let r = 0, u = e.length; r < u; ++r) {
|
|
55
|
-
if (n == null)
|
|
56
|
-
return null;
|
|
57
|
-
i = i[e[r]];
|
|
58
|
-
}
|
|
59
|
-
return i;
|
|
60
|
-
}
|
|
61
|
-
} else
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
function Qe(n, t) {
|
|
65
|
-
let e = -1;
|
|
66
|
-
if (t) {
|
|
67
|
-
for (let i = 0; i < t.length; i++)
|
|
68
|
-
if (X(t[i], n)) {
|
|
69
|
-
e = i;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return e;
|
|
74
|
-
}
|
|
75
|
-
function Z(n, t) {
|
|
76
|
-
if (n != null && t && t.length) {
|
|
77
|
-
for (const e of t)
|
|
78
|
-
if (X(n, e))
|
|
79
|
-
return !0;
|
|
80
|
-
}
|
|
81
|
-
return !1;
|
|
82
|
-
}
|
|
83
|
-
function fe(n) {
|
|
84
|
-
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(a(n));
|
|
85
|
-
}
|
|
86
|
-
function We(n, t) {
|
|
87
|
-
const e = Qe(n, t);
|
|
88
|
-
return e > -1 ? t.filter((i, r) => r !== e) : t;
|
|
89
|
-
}
|
|
90
|
-
function Ye(n) {
|
|
91
|
-
return typeof n == "string" || n instanceof String;
|
|
92
|
-
}
|
|
93
|
-
function Ve(n) {
|
|
94
|
-
var t, e;
|
|
95
|
-
if (n)
|
|
96
|
-
return (e = (t = n.match(
|
|
97
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
98
|
-
)) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
|
|
99
|
-
}
|
|
100
|
-
function ee(n, t) {
|
|
101
|
-
const e = { [`${n}`]: !0 };
|
|
102
|
-
return {
|
|
103
|
-
bemCssClasses: c(() => Object.keys(t).reduce((r, u) => {
|
|
104
|
-
const l = a(t[u]) || !1;
|
|
105
|
-
if (!l)
|
|
106
|
-
return r;
|
|
107
|
-
if (u === "modifiers") {
|
|
108
|
-
const b = Array.isArray(l) ? l : l.split(" ");
|
|
109
|
-
return {
|
|
110
|
-
...r,
|
|
111
|
-
...b.reduce(
|
|
112
|
-
(m, p) => ({
|
|
113
|
-
...m,
|
|
114
|
-
[`${n}--${Ve(p)}`]: !0
|
|
115
|
-
}),
|
|
116
|
-
{}
|
|
117
|
-
)
|
|
118
|
-
};
|
|
119
|
-
} else
|
|
120
|
-
return {
|
|
121
|
-
...r,
|
|
122
|
-
[`${n}--${Ve(u)}`]: l
|
|
123
|
-
};
|
|
124
|
-
}, e) || {})
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
function Oe(n, t, e) {
|
|
128
|
-
const i = c(
|
|
129
|
-
() => !!(n != null && n.value && t.value === "left" || e != null && e.iconLeft)
|
|
130
|
-
), r = c(
|
|
131
|
-
() => !!(n != null && n.value && t.value === "right" || e != null && e.iconRight)
|
|
132
|
-
), u = c(
|
|
133
|
-
() => !!(n != null && n.value && t.value === "top" || e != null && e.iconTop)
|
|
134
|
-
), l = c(
|
|
135
|
-
() => !!(n != null && n.value && t.value === "bottom" || e != null && e.iconBottom)
|
|
136
|
-
);
|
|
137
|
-
return {
|
|
138
|
-
hasIcon: c(() => typeof (n == null ? void 0 : n.value) == "string" ? { name: n == null ? void 0 : n.value } : n == null ? void 0 : n.value),
|
|
139
|
-
hasIconLeft: i,
|
|
140
|
-
hasIconRight: r,
|
|
141
|
-
hasIconTop: u,
|
|
142
|
-
hasIconBottom: l
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function pe(n) {
|
|
146
|
-
const { options: t, labelKey: e, valueKey: i } = T(n);
|
|
147
|
-
return {
|
|
148
|
-
options: t,
|
|
149
|
-
getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof e.value == "function" ? e.value(l) : l[e.value],
|
|
150
|
-
getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof i.value == "function" ? i.value(l) : l[i.value]
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function we(n, t) {
|
|
154
|
-
const { focused: e } = ze(n);
|
|
155
|
-
return ie(e, (i) => {
|
|
156
|
-
t(i ? "focus" : "blur", a(n));
|
|
157
|
-
}), {
|
|
158
|
-
focused: e
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
const Ce = {
|
|
1
|
+
import { defineComponent as J, openBlock as f, createElementBlock as P, unref as t, normalizeClass as te, createElementVNode as O, toDisplayString as A, createCommentVNode as B, Fragment as oe, renderList as ce, withModifiers as _e, createTextVNode as pe, createBlock as L, mergeProps as N, renderSlot as U, normalizeProps as ie, withDirectives as me, isRef as fe, vModelSelect as Ie, createVNode as ee, withKeys as ue, vModelText as Be } from "vue";
|
|
2
|
+
import { nanoid as le } from "nanoid";
|
|
3
|
+
import { iconExists as z, Icon as Ce, addIcon as ke } from "@iconify/vue";
|
|
4
|
+
const ve = {
|
|
162
5
|
valid: Boolean,
|
|
163
6
|
validLabel: [String, Array]
|
|
164
|
-
},
|
|
7
|
+
}, be = {
|
|
165
8
|
invalid: Boolean,
|
|
166
9
|
invalidLabel: [String, Array]
|
|
167
|
-
},
|
|
10
|
+
}, he = {
|
|
168
11
|
loading: Boolean,
|
|
169
12
|
loadingLabel: String
|
|
170
|
-
},
|
|
13
|
+
}, ne = {
|
|
171
14
|
disabled: Boolean
|
|
172
|
-
},
|
|
15
|
+
}, ge = {
|
|
173
16
|
readonly: Boolean
|
|
174
|
-
},
|
|
17
|
+
}, se = {
|
|
175
18
|
modifiers: [String, Array]
|
|
176
|
-
},
|
|
19
|
+
}, ye = {
|
|
177
20
|
hintLabel: { type: String, default: "" }
|
|
178
|
-
},
|
|
21
|
+
}, ae = {
|
|
179
22
|
options: {
|
|
180
23
|
type: Array,
|
|
181
24
|
default: () => []
|
|
182
25
|
},
|
|
183
26
|
labelKey: { type: [String, Function], default: "label" },
|
|
184
27
|
valueKey: { type: [String, Function], default: "value" }
|
|
185
|
-
},
|
|
28
|
+
}, de = {
|
|
186
29
|
LEFT: "left",
|
|
187
30
|
RIGHT: "right"
|
|
188
|
-
},
|
|
31
|
+
}, Ve = {
|
|
189
32
|
icon: { type: [String, Object] },
|
|
190
33
|
iconPosition: {
|
|
191
34
|
type: String,
|
|
192
|
-
validation: (
|
|
193
|
-
default:
|
|
35
|
+
validation: (y) => Object.values(de).includes(y),
|
|
36
|
+
default: de.RIGHT
|
|
194
37
|
}
|
|
195
|
-
},
|
|
38
|
+
}, Se = {
|
|
196
39
|
tabindex: { type: [String, Number], default: 0 }
|
|
197
|
-
},
|
|
40
|
+
}, $e = {
|
|
198
41
|
floating: Boolean
|
|
199
|
-
},
|
|
42
|
+
}, Pe = {
|
|
200
43
|
unselectable: { type: Boolean, default: !0 }
|
|
201
|
-
},
|
|
44
|
+
}, re = {
|
|
202
45
|
id: [String, Number],
|
|
203
46
|
name: { type: String, required: !0 }
|
|
204
|
-
},
|
|
47
|
+
}, Ne = {
|
|
205
48
|
autofocus: Boolean
|
|
206
|
-
},
|
|
49
|
+
}, Oe = {
|
|
207
50
|
autocomplete: { type: String, default: "off" }
|
|
208
|
-
},
|
|
209
|
-
...
|
|
210
|
-
...
|
|
211
|
-
...
|
|
212
|
-
...
|
|
51
|
+
}, Ae = {
|
|
52
|
+
...re,
|
|
53
|
+
...ae,
|
|
54
|
+
...ne,
|
|
55
|
+
...se,
|
|
213
56
|
modelValue: {
|
|
214
57
|
type: [String, Number, Boolean, Object, Array]
|
|
215
58
|
},
|
|
@@ -217,78 +60,78 @@ const Ce = {
|
|
|
217
60
|
multiple: Boolean,
|
|
218
61
|
maxValues: [Number, String],
|
|
219
62
|
unselectable: { type: Boolean, default: !0 }
|
|
220
|
-
},
|
|
63
|
+
}, De = ["id"], Re = {
|
|
221
64
|
key: 0,
|
|
222
65
|
role: "option"
|
|
223
|
-
},
|
|
66
|
+
}, Fe = ["aria-selected"], Le = ["for", "onClick"], Ee = ["id", "type", "value", "checked", "disabled", "name"], Ke = {
|
|
224
67
|
name: "VvDropdown"
|
|
225
|
-
},
|
|
226
|
-
...
|
|
227
|
-
props:
|
|
68
|
+
}, Me = /* @__PURE__ */ J({
|
|
69
|
+
...Ke,
|
|
70
|
+
props: Ae,
|
|
228
71
|
emits: ["update:modelValue"],
|
|
229
|
-
setup(
|
|
230
|
-
const e =
|
|
231
|
-
modifiers:
|
|
232
|
-
disabled:
|
|
72
|
+
setup(y, { emit: r }) {
|
|
73
|
+
const e = y, V = computed(() => String(e.id || le())), { modifiers: d, disabled: p } = toRefs(e), { getOptionLabel: s, getOptionValue: S } = useOptions(e), { bemCssClasses: g } = useBemModifiers("vv-dropdown", {
|
|
74
|
+
modifiers: d,
|
|
75
|
+
disabled: p
|
|
233
76
|
});
|
|
234
|
-
function
|
|
235
|
-
return Array.isArray(e.modelValue) ?
|
|
77
|
+
function c(n) {
|
|
78
|
+
return Array.isArray(e.modelValue) ? contains(n, e.modelValue) || contains(S(n), e.modelValue) : equals(n, e.modelValue) || equals(S(n), e.modelValue);
|
|
236
79
|
}
|
|
237
|
-
function o(
|
|
238
|
-
return typeof
|
|
80
|
+
function o(n) {
|
|
81
|
+
return typeof n == "string" || n.disabled === void 0 ? p.value : n.disabled;
|
|
239
82
|
}
|
|
240
|
-
function
|
|
241
|
-
var
|
|
83
|
+
function l(n) {
|
|
84
|
+
var v;
|
|
242
85
|
if (e.disabled)
|
|
243
86
|
return;
|
|
244
|
-
let
|
|
87
|
+
let i = n;
|
|
245
88
|
if (e.multiple)
|
|
246
89
|
if (Array.isArray(e.modelValue)) {
|
|
247
|
-
if (e.maxValues !== void 0 && e.maxValues >= 0 && ((
|
|
90
|
+
if (e.maxValues !== void 0 && e.maxValues >= 0 && ((v = e.modelValue) == null ? void 0 : v.length) >= e.maxValues && !contains(n, e.modelValue))
|
|
248
91
|
return;
|
|
249
|
-
|
|
92
|
+
i = contains(n, e.modelValue) ? removeFromList(n, e.modelValue) : [...e.modelValue, n];
|
|
250
93
|
} else
|
|
251
|
-
|
|
94
|
+
i = [n];
|
|
252
95
|
else
|
|
253
|
-
e.unselectable &&
|
|
254
|
-
|
|
96
|
+
e.unselectable && n === e.modelValue && (i = void 0);
|
|
97
|
+
r("update:modelValue", i);
|
|
255
98
|
}
|
|
256
|
-
return (
|
|
257
|
-
var
|
|
258
|
-
return
|
|
259
|
-
id:
|
|
260
|
-
class:
|
|
99
|
+
return (n, i) => {
|
|
100
|
+
var v;
|
|
101
|
+
return f(), P("ul", {
|
|
102
|
+
id: t(V),
|
|
103
|
+
class: te(t(g)),
|
|
261
104
|
role: "listbox"
|
|
262
105
|
}, [
|
|
263
|
-
(
|
|
264
|
-
|
|
106
|
+
(v = n.options) != null && v.length ? B("", !0) : (f(), P("li", Re, [
|
|
107
|
+
O("label", null, A(n.labelNoResults), 1)
|
|
265
108
|
])),
|
|
266
|
-
(
|
|
109
|
+
(f(!0), P(oe, null, ce(n.options, (m, $) => (f(), P("li", {
|
|
267
110
|
key: $,
|
|
268
111
|
role: "option",
|
|
269
|
-
"aria-selected":
|
|
112
|
+
"aria-selected": c(m)
|
|
270
113
|
}, [
|
|
271
|
-
|
|
272
|
-
for: `dropdown-${$}-${
|
|
273
|
-
onClick:
|
|
114
|
+
O("label", {
|
|
115
|
+
for: `dropdown-${$}-${t(V)}`,
|
|
116
|
+
onClick: _e((_) => l(t(S)(m)), ["prevent"])
|
|
274
117
|
}, [
|
|
275
|
-
|
|
276
|
-
id: `dropdown-${$}-${
|
|
277
|
-
type:
|
|
278
|
-
value:
|
|
279
|
-
checked:
|
|
280
|
-
disabled: o(
|
|
281
|
-
name:
|
|
118
|
+
O("input", {
|
|
119
|
+
id: `dropdown-${$}-${t(V)}`,
|
|
120
|
+
type: n.multiple ? "checkbox" : "radio",
|
|
121
|
+
value: t(S)(m),
|
|
122
|
+
checked: c(m),
|
|
123
|
+
disabled: o(m),
|
|
124
|
+
name: n.name,
|
|
282
125
|
tabindex: "-1",
|
|
283
126
|
"aria-hidden": "true"
|
|
284
|
-
}, null, 8,
|
|
285
|
-
|
|
286
|
-
], 8,
|
|
287
|
-
], 8,
|
|
288
|
-
], 10,
|
|
127
|
+
}, null, 8, Ee),
|
|
128
|
+
pe(" " + A(t(s)(m)), 1)
|
|
129
|
+
], 8, Le)
|
|
130
|
+
], 8, Fe))), 128))
|
|
131
|
+
], 10, De);
|
|
289
132
|
};
|
|
290
133
|
}
|
|
291
|
-
}),
|
|
134
|
+
}), Te = "ds", He = {
|
|
292
135
|
color: String,
|
|
293
136
|
width: {
|
|
294
137
|
type: [String, Number]
|
|
@@ -319,45 +162,45 @@ const Ce = {
|
|
|
319
162
|
modifiers: {
|
|
320
163
|
type: [String, Array]
|
|
321
164
|
}
|
|
322
|
-
},
|
|
165
|
+
}, je = {
|
|
323
166
|
name: "VvIcon"
|
|
324
|
-
},
|
|
325
|
-
...
|
|
326
|
-
props:
|
|
327
|
-
setup(
|
|
328
|
-
const
|
|
329
|
-
modifiers:
|
|
330
|
-
}),
|
|
331
|
-
const o =
|
|
332
|
-
return
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
335
|
-
return
|
|
167
|
+
}, G = /* @__PURE__ */ J({
|
|
168
|
+
...je,
|
|
169
|
+
props: He,
|
|
170
|
+
setup(y) {
|
|
171
|
+
const r = y, e = ref(!0), { modifiers: V } = toRefs(r), d = inject(Te), { bemCssClasses: p } = useBemModifiers("vv-icon", {
|
|
172
|
+
modifiers: V
|
|
173
|
+
}), s = computed(() => r.provider || (d == null ? void 0 : d.provider)), S = computed(() => {
|
|
174
|
+
const o = r.name ?? "", l = `@${s.value}:${r.prefix}:${r.name}`;
|
|
175
|
+
return z(o) ? o : z(l) ? l : (d == null ? void 0 : d.iconsCollections.find((n) => {
|
|
176
|
+
const i = `@${s.value}:${n.prefix}:${o}`;
|
|
177
|
+
if (z(i))
|
|
178
|
+
return i;
|
|
336
179
|
})) || o;
|
|
337
180
|
});
|
|
338
|
-
function
|
|
339
|
-
let
|
|
181
|
+
function g(o) {
|
|
182
|
+
let l = null;
|
|
340
183
|
if (typeof window > "u") {
|
|
341
|
-
const { JSDOM:
|
|
342
|
-
|
|
184
|
+
const { JSDOM: m } = require("jsdom");
|
|
185
|
+
l = new m().window;
|
|
343
186
|
}
|
|
344
|
-
return (
|
|
187
|
+
return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
|
|
345
188
|
}
|
|
346
|
-
function
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
body:
|
|
350
|
-
height:
|
|
351
|
-
width:
|
|
189
|
+
function c(o) {
|
|
190
|
+
const l = g(o), n = (l == null ? void 0 : l.innerHTML.trim()) || "";
|
|
191
|
+
l && n && ke(`@${s.value}:${r.prefix}:${r.name}`, {
|
|
192
|
+
body: n,
|
|
193
|
+
height: l.viewBox.baseVal.height,
|
|
194
|
+
width: l.viewBox.baseVal.width
|
|
352
195
|
});
|
|
353
196
|
}
|
|
354
|
-
return
|
|
355
|
-
o && (
|
|
197
|
+
return d && (r.src && !z(`@${s.value}:${r.prefix}:${r.name}`) ? (e.value = !1, d.fetchIcon(r.src).then((o) => {
|
|
198
|
+
o && (c(o), e.value = !0);
|
|
356
199
|
}).catch((o) => {
|
|
357
200
|
throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
|
|
358
|
-
})) :
|
|
201
|
+
})) : r.svg && c(r.svg)), (o, l) => t(e) ? (f(), L(t(Ce), N({
|
|
359
202
|
key: 0,
|
|
360
|
-
class:
|
|
203
|
+
class: t(p)
|
|
361
204
|
}, {
|
|
362
205
|
inline: o.inline,
|
|
363
206
|
width: o.width,
|
|
@@ -368,41 +211,41 @@ const Ce = {
|
|
|
368
211
|
rotate: o.rotate,
|
|
369
212
|
color: o.color,
|
|
370
213
|
onLoad: o.onLoad,
|
|
371
|
-
icon:
|
|
372
|
-
}), null, 16, ["class"])) :
|
|
214
|
+
icon: t(S)
|
|
215
|
+
}), null, 16, ["class"])) : B("", !0);
|
|
373
216
|
}
|
|
374
217
|
});
|
|
375
|
-
function
|
|
376
|
-
return Array.isArray(
|
|
218
|
+
function x(y) {
|
|
219
|
+
return Array.isArray(y) ? y.filter((r) => isString(r)).join(" ") : y;
|
|
377
220
|
}
|
|
378
|
-
function
|
|
221
|
+
function we(y, r) {
|
|
379
222
|
const {
|
|
380
223
|
invalid: e,
|
|
381
|
-
valid:
|
|
382
|
-
hint:
|
|
383
|
-
loading:
|
|
384
|
-
} =
|
|
385
|
-
hintLabel:
|
|
386
|
-
modelValue:
|
|
387
|
-
valid:
|
|
388
|
-
validLabel:
|
|
224
|
+
valid: V,
|
|
225
|
+
hint: d,
|
|
226
|
+
loading: p
|
|
227
|
+
} = r, {
|
|
228
|
+
hintLabel: s,
|
|
229
|
+
modelValue: S,
|
|
230
|
+
valid: g,
|
|
231
|
+
validLabel: c,
|
|
389
232
|
invalid: o,
|
|
390
|
-
invalidLabel:
|
|
391
|
-
...
|
|
392
|
-
} =
|
|
393
|
-
() => !!(
|
|
394
|
-
),
|
|
395
|
-
() => !!(
|
|
396
|
-
),
|
|
397
|
-
() => !!(
|
|
398
|
-
), C =
|
|
399
|
-
() => $.value ||
|
|
233
|
+
invalidLabel: l,
|
|
234
|
+
...n
|
|
235
|
+
} = toRefs(y), i = resolveFieldData(n, "loading"), v = resolveFieldData(n, "loadingLabel"), m = computed(() => o.value ? !!(o.value && e || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !isEmpty(l)) : !1), $ = computed(
|
|
236
|
+
() => !!(s && s.value || d)
|
|
237
|
+
), _ = computed(
|
|
238
|
+
() => !!(c && c.value || V)
|
|
239
|
+
), I = computed(
|
|
240
|
+
() => !!(i != null && i.value && p || i != null && i.value && (v != null && v.value))
|
|
241
|
+
), C = computed(
|
|
242
|
+
() => $.value || _.value || m.value || I.value
|
|
400
243
|
);
|
|
401
244
|
return {
|
|
402
|
-
hasInvalid:
|
|
245
|
+
hasInvalid: m,
|
|
403
246
|
hasHint: $,
|
|
404
|
-
hasValid:
|
|
405
|
-
hasLoading:
|
|
247
|
+
hasValid: _,
|
|
248
|
+
hasLoading: I,
|
|
406
249
|
HintSlot: {
|
|
407
250
|
name: "HintSlot",
|
|
408
251
|
props: {
|
|
@@ -412,30 +255,30 @@ function Fe(n, t) {
|
|
|
412
255
|
}
|
|
413
256
|
},
|
|
414
257
|
setup(D) {
|
|
415
|
-
const
|
|
416
|
-
const
|
|
417
|
-
hintLabel:
|
|
418
|
-
modelValue:
|
|
419
|
-
valid:
|
|
420
|
-
validLabel:
|
|
258
|
+
const R = computed(() => {
|
|
259
|
+
const w = toReactive({
|
|
260
|
+
hintLabel: s,
|
|
261
|
+
modelValue: S,
|
|
262
|
+
valid: g,
|
|
263
|
+
validLabel: c,
|
|
421
264
|
invalid: o,
|
|
422
|
-
invalidLabel:
|
|
423
|
-
loading:
|
|
424
|
-
loadingLabel:
|
|
265
|
+
invalidLabel: l,
|
|
266
|
+
loading: i,
|
|
267
|
+
loadingLabel: v,
|
|
425
268
|
...D.params
|
|
426
269
|
});
|
|
427
|
-
return o != null && o.value ? (e == null ? void 0 : e(
|
|
270
|
+
return o != null && o.value ? (e == null ? void 0 : e(w)) || x(l == null ? void 0 : l.value) || (s == null ? void 0 : s.value) : g != null && g.value ? (V == null ? void 0 : V(w)) || x(c == null ? void 0 : c.value) || (s == null ? void 0 : s.value) : i != null && i.value ? (p == null ? void 0 : p(w)) || x(v == null ? void 0 : v.value) || (s == null ? void 0 : s.value) : (d == null ? void 0 : d(w)) || x(s == null ? void 0 : s.value) || (s == null ? void 0 : s.value);
|
|
428
271
|
});
|
|
429
272
|
return {
|
|
430
273
|
isVisible: C,
|
|
431
|
-
hasInvalid:
|
|
432
|
-
hasValid:
|
|
433
|
-
hintContent:
|
|
274
|
+
hasInvalid: m,
|
|
275
|
+
hasValid: _,
|
|
276
|
+
hintContent: R
|
|
434
277
|
};
|
|
435
278
|
},
|
|
436
279
|
render() {
|
|
437
280
|
if (this.isVisible)
|
|
438
|
-
return
|
|
281
|
+
return h(
|
|
439
282
|
"small",
|
|
440
283
|
{
|
|
441
284
|
role: this.hasInvalid || this.hasValid ? "alert" : void 0
|
|
@@ -446,22 +289,22 @@ function Fe(n, t) {
|
|
|
446
289
|
}
|
|
447
290
|
};
|
|
448
291
|
}
|
|
449
|
-
const
|
|
450
|
-
...
|
|
451
|
-
...et,
|
|
452
|
-
...tt,
|
|
453
|
-
...Le,
|
|
454
|
-
...Ce,
|
|
455
|
-
..._e,
|
|
292
|
+
const qe = {
|
|
293
|
+
...re,
|
|
456
294
|
...Ne,
|
|
457
|
-
...
|
|
295
|
+
...Oe,
|
|
296
|
+
...Se,
|
|
458
297
|
...ve,
|
|
459
|
-
...
|
|
460
|
-
...
|
|
298
|
+
...be,
|
|
299
|
+
...ye,
|
|
300
|
+
...he,
|
|
301
|
+
...ne,
|
|
461
302
|
...ge,
|
|
462
|
-
...
|
|
463
|
-
...
|
|
464
|
-
...
|
|
303
|
+
...se,
|
|
304
|
+
...ae,
|
|
305
|
+
...Ve,
|
|
306
|
+
...$e,
|
|
307
|
+
...Pe,
|
|
465
308
|
multiple: Boolean,
|
|
466
309
|
required: Boolean,
|
|
467
310
|
size: [String, Number],
|
|
@@ -471,130 +314,130 @@ const pt = {
|
|
|
471
314
|
},
|
|
472
315
|
label: String,
|
|
473
316
|
placeholder: String
|
|
474
|
-
},
|
|
317
|
+
}, ze = ["update:modelValue", "focus", "blur"], xe = ["for"], Ue = { class: "vv-select__wrapper" }, Ge = ["id"], Je = ["disabled", "hidden"], Xe = ["disabled", "value"], Qe = {
|
|
475
318
|
name: "VvSelect"
|
|
476
|
-
},
|
|
477
|
-
...
|
|
478
|
-
props:
|
|
479
|
-
emits:
|
|
480
|
-
setup(
|
|
481
|
-
const e =
|
|
482
|
-
modifiers:
|
|
483
|
-
disabled:
|
|
319
|
+
}, We = /* @__PURE__ */ J({
|
|
320
|
+
...Qe,
|
|
321
|
+
props: qe,
|
|
322
|
+
emits: ze,
|
|
323
|
+
setup(y, { emit: r }) {
|
|
324
|
+
const e = y, V = useSlots(), d = ref(), { HintSlot: p, hasHint: s, hasInvalid: S } = we(e, V), {
|
|
325
|
+
modifiers: g,
|
|
326
|
+
disabled: c,
|
|
484
327
|
readonly: o,
|
|
485
|
-
loading:
|
|
486
|
-
icon:
|
|
487
|
-
iconPosition:
|
|
488
|
-
invalid:
|
|
489
|
-
valid:
|
|
328
|
+
loading: l,
|
|
329
|
+
icon: n,
|
|
330
|
+
iconPosition: i,
|
|
331
|
+
invalid: v,
|
|
332
|
+
valid: m,
|
|
490
333
|
floating: $,
|
|
491
|
-
multiple:
|
|
492
|
-
} =
|
|
493
|
-
|
|
494
|
-
|
|
334
|
+
multiple: _
|
|
335
|
+
} = toRefs(e), I = computed(() => String(e.id || le())), C = computed(() => `${I.value}-hint`), { focused: D } = useComponentFocus(d, r), R = useElementVisibility(d);
|
|
336
|
+
watch(R, (u) => {
|
|
337
|
+
u && e.autofocus && (D.value = !0);
|
|
495
338
|
});
|
|
496
|
-
const { hasIcon:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
),
|
|
339
|
+
const { hasIcon: w, hasIconLeft: E, hasIconRight: M } = useComponentIcon(
|
|
340
|
+
n,
|
|
341
|
+
i
|
|
342
|
+
), T = computed(() => !isEmpty(e.modelValue)), H = computed(() => e.disabled || e.readonly), j = computed(() => H.value ? -1 : e.tabindex), q = computed(() => {
|
|
500
343
|
if (e.invalid === !0)
|
|
501
344
|
return !0;
|
|
502
345
|
if (e.valid === !0)
|
|
503
346
|
return !1;
|
|
504
|
-
}), { bemCssClasses:
|
|
505
|
-
modifiers:
|
|
506
|
-
valid:
|
|
507
|
-
invalid:
|
|
508
|
-
loading:
|
|
509
|
-
disabled:
|
|
347
|
+
}), { bemCssClasses: X } = useBemModifiers("vv-select", {
|
|
348
|
+
modifiers: g,
|
|
349
|
+
valid: m,
|
|
350
|
+
invalid: v,
|
|
351
|
+
loading: l,
|
|
352
|
+
disabled: c,
|
|
510
353
|
readonly: o,
|
|
511
354
|
iconLeft: E,
|
|
512
|
-
iconRight:
|
|
513
|
-
dirty:
|
|
355
|
+
iconRight: M,
|
|
356
|
+
dirty: T,
|
|
514
357
|
focus: D,
|
|
515
358
|
floating: $,
|
|
516
|
-
multiple:
|
|
517
|
-
}),
|
|
359
|
+
multiple: _
|
|
360
|
+
}), Q = computed(() => ({
|
|
518
361
|
name: e.name,
|
|
519
|
-
tabindex:
|
|
520
|
-
disabled:
|
|
362
|
+
tabindex: j.value,
|
|
363
|
+
disabled: H.value,
|
|
521
364
|
required: e.required,
|
|
522
365
|
size: e.size,
|
|
523
366
|
autocomplete: e.autocomplete,
|
|
524
367
|
multiple: e.multiple,
|
|
525
368
|
"aria-invalid": q.value,
|
|
526
|
-
"aria-describedby": !
|
|
527
|
-
"aria-errormessage":
|
|
528
|
-
})), { getOptionLabel:
|
|
529
|
-
function
|
|
530
|
-
return typeof
|
|
369
|
+
"aria-describedby": !S.value && s.value ? C.value : void 0,
|
|
370
|
+
"aria-errormessage": S.value ? C.value : void 0
|
|
371
|
+
})), { getOptionLabel: W, getOptionValue: Y } = useOptions(e);
|
|
372
|
+
function Z(u) {
|
|
373
|
+
return typeof u == "string" || u.disabled === void 0 ? c.value : u.disabled;
|
|
531
374
|
}
|
|
532
|
-
const K =
|
|
375
|
+
const K = computed({
|
|
533
376
|
get: () => e.modelValue,
|
|
534
|
-
set: (
|
|
535
|
-
Array.isArray(
|
|
377
|
+
set: (u) => {
|
|
378
|
+
Array.isArray(u) && (u = u.filter((F) => F !== void 0)), r("update:modelValue", u);
|
|
536
379
|
}
|
|
537
380
|
});
|
|
538
|
-
return (
|
|
539
|
-
class:
|
|
381
|
+
return (u, F) => (f(), P("div", {
|
|
382
|
+
class: te(t(X))
|
|
540
383
|
}, [
|
|
541
|
-
|
|
384
|
+
u.label ? (f(), P("label", {
|
|
542
385
|
key: 0,
|
|
543
|
-
for:
|
|
544
|
-
},
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
386
|
+
for: t(I)
|
|
387
|
+
}, A(u.label), 9, xe)) : B("", !0),
|
|
388
|
+
O("div", Ue, [
|
|
389
|
+
U(u.$slots, "before", {}, () => [
|
|
390
|
+
t(E) ? (f(), L(G, ie(N({ key: 0 }, t(w))), null, 16)) : B("", !0)
|
|
548
391
|
]),
|
|
549
|
-
|
|
550
|
-
id:
|
|
392
|
+
me(O("select", N({
|
|
393
|
+
id: t(I),
|
|
551
394
|
ref_key: "select",
|
|
552
|
-
ref:
|
|
553
|
-
"onUpdate:modelValue":
|
|
554
|
-
},
|
|
555
|
-
|
|
395
|
+
ref: d,
|
|
396
|
+
"onUpdate:modelValue": F[0] || (F[0] = (a) => fe(K) ? K.value = a : null)
|
|
397
|
+
}, t(Q)), [
|
|
398
|
+
u.placeholder ? (f(), P("option", {
|
|
556
399
|
key: 0,
|
|
557
400
|
value: void 0,
|
|
558
|
-
disabled: !
|
|
559
|
-
hidden: !
|
|
560
|
-
},
|
|
561
|
-
(
|
|
562
|
-
key:
|
|
563
|
-
disabled:
|
|
564
|
-
value:
|
|
565
|
-
},
|
|
566
|
-
], 16,
|
|
567
|
-
[
|
|
401
|
+
disabled: !u.unselectable,
|
|
402
|
+
hidden: !u.unselectable
|
|
403
|
+
}, A(u.placeholder), 9, Je)) : B("", !0),
|
|
404
|
+
(f(!0), P(oe, null, ce(u.options, (a, b) => (f(), P("option", {
|
|
405
|
+
key: b,
|
|
406
|
+
disabled: Z(a),
|
|
407
|
+
value: t(Y)(a)
|
|
408
|
+
}, A(t(W)(a)), 9, Xe))), 128))
|
|
409
|
+
], 16, Ge), [
|
|
410
|
+
[Ie, t(K)]
|
|
568
411
|
]),
|
|
569
|
-
|
|
570
|
-
|
|
412
|
+
U(u.$slots, "after", {}, () => [
|
|
413
|
+
t(M) ? (f(), L(G, ie(N({ key: 0 }, t(w))), null, 16)) : B("", !0)
|
|
571
414
|
])
|
|
572
415
|
]),
|
|
573
|
-
|
|
574
|
-
id:
|
|
416
|
+
ee(t(p), {
|
|
417
|
+
id: t(C),
|
|
575
418
|
class: "vv-select__hint"
|
|
576
419
|
}, null, 8, ["id"])
|
|
577
420
|
], 2));
|
|
578
421
|
}
|
|
579
|
-
}),
|
|
422
|
+
}), Ye = [
|
|
580
423
|
"update:modelValue",
|
|
581
424
|
"change:search",
|
|
582
425
|
"focus",
|
|
583
426
|
"blur"
|
|
584
|
-
],
|
|
585
|
-
...
|
|
586
|
-
...
|
|
587
|
-
...Ce,
|
|
588
|
-
..._e,
|
|
589
|
-
...Ne,
|
|
590
|
-
...Pe,
|
|
427
|
+
], Ze = {
|
|
428
|
+
...re,
|
|
429
|
+
...Se,
|
|
591
430
|
...ve,
|
|
592
|
-
...
|
|
593
|
-
...
|
|
431
|
+
...be,
|
|
432
|
+
...ye,
|
|
433
|
+
...he,
|
|
434
|
+
...ne,
|
|
594
435
|
...ge,
|
|
595
|
-
...
|
|
596
|
-
...
|
|
597
|
-
...
|
|
436
|
+
...se,
|
|
437
|
+
...ae,
|
|
438
|
+
...Ve,
|
|
439
|
+
...$e,
|
|
440
|
+
...Pe,
|
|
598
441
|
modelValue: {
|
|
599
442
|
type: [String, Number, Boolean, Object, Array],
|
|
600
443
|
default: void 0
|
|
@@ -612,70 +455,70 @@ const pt = {
|
|
|
612
455
|
maxValues: [Number, String],
|
|
613
456
|
separator: { type: String, default: ", " },
|
|
614
457
|
native: Boolean
|
|
615
|
-
},
|
|
458
|
+
}, et = ["id"], tt = ["id", "for"], ot = ["tabindex"], lt = ["id", "placeholder"], nt = {
|
|
616
459
|
name: "VvCombobox"
|
|
617
|
-
},
|
|
618
|
-
...
|
|
619
|
-
props:
|
|
620
|
-
emits:
|
|
621
|
-
setup(
|
|
622
|
-
const e =
|
|
623
|
-
|
|
460
|
+
}, it = /* @__PURE__ */ J({
|
|
461
|
+
...nt,
|
|
462
|
+
props: Ze,
|
|
463
|
+
emits: Ye,
|
|
464
|
+
setup(y, { emit: r }) {
|
|
465
|
+
const e = y, V = useSlots(), { HintSlot: d } = we(e, V), p = ref(), s = ref(), { focused: S } = useComponentFocus(p, r), g = computed(() => String(e.id || le())), c = ref(""), o = refDebounced(
|
|
466
|
+
c,
|
|
624
467
|
Number(e.debounceSearch)
|
|
625
|
-
),
|
|
626
|
-
icon:
|
|
627
|
-
iconPosition:
|
|
628
|
-
modifiers:
|
|
629
|
-
disabled:
|
|
468
|
+
), l = ref(!1), {
|
|
469
|
+
icon: n,
|
|
470
|
+
iconPosition: i,
|
|
471
|
+
modifiers: v,
|
|
472
|
+
disabled: m,
|
|
630
473
|
readonly: $,
|
|
631
|
-
loading:
|
|
632
|
-
valid:
|
|
474
|
+
loading: _,
|
|
475
|
+
valid: I,
|
|
633
476
|
invalid: C,
|
|
634
477
|
floating: D
|
|
635
|
-
} =
|
|
636
|
-
|
|
478
|
+
} = toRefs(e);
|
|
479
|
+
watch(
|
|
637
480
|
o,
|
|
638
|
-
() =>
|
|
481
|
+
() => r("change:search", o.value)
|
|
639
482
|
);
|
|
640
|
-
const { hasIcon:
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
),
|
|
644
|
-
modifiers:
|
|
645
|
-
disabled:
|
|
646
|
-
loading:
|
|
483
|
+
const { hasIcon: R, hasIconLeft: w, hasIconRight: E } = useComponentIcon(
|
|
484
|
+
n,
|
|
485
|
+
i
|
|
486
|
+
), M = computed(() => !isEmpty(e.modelValue)), T = computed(() => m.value || $.value ? -1 : e.tabindex), { bemCssClasses: H } = useBemModifiers("vv-select", {
|
|
487
|
+
modifiers: v,
|
|
488
|
+
disabled: m,
|
|
489
|
+
loading: _,
|
|
647
490
|
readonly: $,
|
|
648
|
-
iconLeft:
|
|
491
|
+
iconLeft: w,
|
|
649
492
|
iconRight: E,
|
|
650
|
-
valid:
|
|
493
|
+
valid: I,
|
|
651
494
|
invalid: C,
|
|
652
|
-
dirty:
|
|
653
|
-
focus:
|
|
495
|
+
dirty: M,
|
|
496
|
+
focus: S,
|
|
654
497
|
floating: D
|
|
655
|
-
}),
|
|
656
|
-
() => e.searchable ?
|
|
657
|
-
), { getOptionLabel: q, getOptionValue:
|
|
658
|
-
var
|
|
659
|
-
return (
|
|
660
|
-
}),
|
|
661
|
-
let
|
|
662
|
-
return Array.isArray(e.modelValue) ?
|
|
663
|
-
(
|
|
498
|
+
}), j = computed(
|
|
499
|
+
() => e.searchable ? Q.value : e.options
|
|
500
|
+
), { getOptionLabel: q, getOptionValue: X } = useOptions(e), Q = computed(() => {
|
|
501
|
+
var a;
|
|
502
|
+
return (a = e.options) == null ? void 0 : a.filter((b) => q(b).toLowerCase().includes(o.value.toLowerCase().trim()));
|
|
503
|
+
}), W = computed(() => {
|
|
504
|
+
let a = [];
|
|
505
|
+
return Array.isArray(e.modelValue) ? a = e.modelValue : e.modelValue && (a = [e.modelValue]), e.options.filter(
|
|
506
|
+
(b) => a.includes(X(b))
|
|
664
507
|
);
|
|
665
|
-
}),
|
|
666
|
-
|
|
667
|
-
|
|
508
|
+
}), Y = computed(() => W.value.map((a) => q(a)).join(e.separator));
|
|
509
|
+
onClickOutside(p, () => {
|
|
510
|
+
p.value.open = !1;
|
|
668
511
|
});
|
|
669
|
-
function
|
|
670
|
-
const
|
|
671
|
-
|
|
512
|
+
function Z(a) {
|
|
513
|
+
const b = a.target;
|
|
514
|
+
l.value = b.open;
|
|
672
515
|
}
|
|
673
|
-
function K(
|
|
674
|
-
|
|
516
|
+
function K(a) {
|
|
517
|
+
p.value && !e.multiple && (p.value.open = !1), r("update:modelValue", a);
|
|
675
518
|
}
|
|
676
|
-
const
|
|
519
|
+
const u = computed(() => ({
|
|
677
520
|
name: e.name,
|
|
678
|
-
options:
|
|
521
|
+
options: j.value,
|
|
679
522
|
labelKey: e.labelKey,
|
|
680
523
|
valueKey: e.valueKey,
|
|
681
524
|
disabled: e.disabled,
|
|
@@ -684,21 +527,21 @@ const pt = {
|
|
|
684
527
|
maxValues: e.maxValues,
|
|
685
528
|
modelValue: e.modelValue,
|
|
686
529
|
unselectable: e.unselectable
|
|
687
|
-
})),
|
|
688
|
-
id:
|
|
530
|
+
})), F = computed(() => ({
|
|
531
|
+
id: g.value,
|
|
689
532
|
name: e.name,
|
|
690
|
-
tabindex:
|
|
691
|
-
valid:
|
|
533
|
+
tabindex: T.value,
|
|
534
|
+
valid: I.value,
|
|
692
535
|
validLabel: e.validLabel,
|
|
693
536
|
invalid: C.value,
|
|
694
537
|
invalidLabel: e.invalidLabel,
|
|
695
538
|
hintLabel: e.hintLabel,
|
|
696
|
-
loading:
|
|
539
|
+
loading: _.value,
|
|
697
540
|
loadingLabel: e.loadingLabel,
|
|
698
|
-
disabled:
|
|
541
|
+
disabled: m.value,
|
|
699
542
|
readonly: $.value,
|
|
700
543
|
modifiers: e.modifiers,
|
|
701
|
-
options:
|
|
544
|
+
options: j.value,
|
|
702
545
|
labelKey: e.labelKey,
|
|
703
546
|
valueKey: e.valueKey,
|
|
704
547
|
icon: e.icon,
|
|
@@ -710,66 +553,66 @@ const pt = {
|
|
|
710
553
|
placeholder: e.placeholder,
|
|
711
554
|
modelValue: e.modelValue
|
|
712
555
|
}));
|
|
713
|
-
return (
|
|
714
|
-
"onUpdate:modelValue":
|
|
715
|
-
}), null, 16)) : (
|
|
556
|
+
return (a, b) => a.native ? (f(), L(We, N({ key: 1 }, t(F), {
|
|
557
|
+
"onUpdate:modelValue": b[4] || (b[4] = (k) => r("update:modelValue", k))
|
|
558
|
+
}), null, 16)) : (f(), P("div", {
|
|
716
559
|
key: 0,
|
|
717
|
-
id:
|
|
718
|
-
class:
|
|
560
|
+
id: t(g),
|
|
561
|
+
class: te(t(H))
|
|
719
562
|
}, [
|
|
720
|
-
|
|
563
|
+
a.label ? (f(), P("label", {
|
|
721
564
|
key: 0,
|
|
722
|
-
id: `${
|
|
723
|
-
for:
|
|
724
|
-
},
|
|
725
|
-
|
|
565
|
+
id: `${t(g)}-label`,
|
|
566
|
+
for: a.searchable && t(l) ? `${t(g)}-input` : void 0
|
|
567
|
+
}, A(a.label), 9, tt)) : B("", !0),
|
|
568
|
+
O("details", {
|
|
726
569
|
ref_key: "dropdown",
|
|
727
|
-
ref:
|
|
570
|
+
ref: p,
|
|
728
571
|
class: "vv-select__wrapper",
|
|
729
|
-
onClick:
|
|
730
|
-
onKeyup:
|
|
731
|
-
onToggle:
|
|
572
|
+
onClick: b[2] || (b[2] = (k) => t(m) || t($) ? k.preventDefault() : null),
|
|
573
|
+
onKeyup: b[3] || (b[3] = ue((k) => t(p).open = !1, ["esc"])),
|
|
574
|
+
onToggle: Z
|
|
732
575
|
}, [
|
|
733
|
-
|
|
576
|
+
O("summary", {
|
|
734
577
|
class: "vv-select__input",
|
|
735
|
-
tabindex:
|
|
736
|
-
onKeyup:
|
|
578
|
+
tabindex: t(T),
|
|
579
|
+
onKeyup: b[1] || (b[1] = ue((k) => a.searchable ? k.preventDefault() : null, ["space"]))
|
|
737
580
|
}, [
|
|
738
|
-
|
|
739
|
-
|
|
581
|
+
U(a.$slots, "before", {}, () => [
|
|
582
|
+
t(w) ? (f(), L(G, N({
|
|
740
583
|
key: 0,
|
|
741
584
|
class: "vv-select__icon-left"
|
|
742
|
-
},
|
|
585
|
+
}, t(R)), null, 16)) : B("", !0)
|
|
743
586
|
]),
|
|
744
|
-
|
|
587
|
+
a.searchable && t(l) ? me((f(), P("input", {
|
|
745
588
|
key: 0,
|
|
746
|
-
id: `${
|
|
589
|
+
id: `${t(g)}-input`,
|
|
747
590
|
ref_key: "inputSearch",
|
|
748
|
-
ref:
|
|
749
|
-
"onUpdate:modelValue":
|
|
591
|
+
ref: s,
|
|
592
|
+
"onUpdate:modelValue": b[0] || (b[0] = (k) => fe(c) ? c.value = k : null),
|
|
750
593
|
role: "combobox",
|
|
751
594
|
type: "search",
|
|
752
|
-
placeholder:
|
|
753
|
-
}, null, 8,
|
|
754
|
-
[
|
|
755
|
-
]) : (
|
|
756
|
-
|
|
595
|
+
placeholder: a.searchPlaceholder
|
|
596
|
+
}, null, 8, lt)), [
|
|
597
|
+
[Be, t(c)]
|
|
598
|
+
]) : (f(), P(oe, { key: 1 }, [
|
|
599
|
+
pe(A(t(Y) || a.placeholder), 1)
|
|
757
600
|
], 64)),
|
|
758
|
-
|
|
759
|
-
|
|
601
|
+
U(a.$slots, "after", {}, () => [
|
|
602
|
+
t(E) ? (f(), L(G, N({
|
|
760
603
|
key: 0,
|
|
761
604
|
class: "vv-select__icon-right"
|
|
762
|
-
},
|
|
605
|
+
}, t(R)), null, 16)) : B("", !0)
|
|
763
606
|
])
|
|
764
|
-
], 40,
|
|
765
|
-
|
|
766
|
-
id: `${
|
|
767
|
-
},
|
|
607
|
+
], 40, ot),
|
|
608
|
+
ee(Me, N({
|
|
609
|
+
id: `${t(g)}-dropdown`
|
|
610
|
+
}, t(u), { "onUpdate:modelValue": K }), null, 16, ["id"])
|
|
768
611
|
], 544),
|
|
769
|
-
|
|
770
|
-
], 10,
|
|
612
|
+
ee(t(d), { class: "vv-select__hint" })
|
|
613
|
+
], 10, et));
|
|
771
614
|
}
|
|
772
615
|
});
|
|
773
616
|
export {
|
|
774
|
-
|
|
617
|
+
it as default
|
|
775
618
|
};
|