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