@volverjs/ui-vue 0.0.1-beta.11 → 0.0.1-beta.12
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/dist/components/VvBadge/VvBadge.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +165 -12
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +4 -4
- package/dist/components/VvBreadcrumb/VvBreadcrumb.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +4 -4
- package/dist/components/VvButton/VvButton.d.ts +2 -33
- package/dist/components/VvButton/VvButton.es.js +183 -198
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -44
- package/dist/components/VvButton/useButtonGroupProps.d.ts +1 -6
- package/dist/components/VvButtonGroup/VvButtonGroup.d.ts +2 -26
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +68 -78
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +9 -69
- package/dist/components/VvDropdown/VvDropdown.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +4 -4
- package/dist/components/VvInputText/VvInputText.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvProgress/VvProgress.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.d.ts +5 -1
- package/dist/components/VvSelect/VvSelect.es.js +395 -207
- package/dist/components/VvSelect/VvSelect.umd.js +2 -2
- package/dist/components/VvSelect/VvSelect.vue.d.ts +12 -5
- package/dist/components/VvTextarea/VvTextarea.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/index.es.js +579 -610
- package/dist/components/index.umd.js +2 -2
- package/dist/composables/group/types/IButtonGroupState.d.ts +4 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +553 -585
- package/dist/index.umd.js +2 -2
- package/dist/props/index.d.ts +2 -1
- package/dist/stories/RadioGroup/RadioOption.test.d.ts +4 -0
- package/dist/stories/RadioGroup/RadioProperty.test.d.ts +1 -1
- package/dist/stories/RadioGroup/RadioSlots.test.d.ts +6 -0
- package/package.json +2 -2
- 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/VvBadge/VvBadge.ts +4 -2
- package/src/components/VvBadge/VvBadge.vue +8 -3
- package/src/components/VvButton/VvButton.ts +4 -34
- package/src/components/VvButton/VvButton.vue +3 -12
- package/src/components/VvButton/useButtonGroupProps.ts +3 -11
- package/src/components/VvButtonGroup/VvButtonGroup.ts +4 -17
- package/src/components/VvButtonGroup/VvButtonGroup.vue +5 -16
- package/src/components/VvSelect/VvSelect.ts +5 -1
- package/src/components/VvSelect/VvSelect.vue +7 -1
- package/src/composables/group/types/IButtonGroupState.ts +4 -0
- package/src/props/index.ts +3 -1
- package/src/stories/Badge/BadgeColor.stories.mdx +4 -4
- package/src/stories/Badge/BadgeModifiers.stories.mdx +65 -0
- package/src/stories/Button/ButtonActive.stories.mdx +27 -0
- package/src/stories/Button/ButtonDisabled.stories.mdx +28 -0
- package/src/stories/Button/ButtonIconPosition.stories.mdx +0 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +103 -46
- package/src/stories/Button/ButtonSelected.stories.mdx +30 -0
- package/src/stories/ButtonGroup/ButtonGroupAction.stories.mdx +2 -2
- package/src/stories/ButtonGroup/ButtonGroupActionQuiet.stories.mdx +2 -2
- package/src/stories/ButtonGroup/ButtonGroupBlock.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupRounded.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupHintLabel.stories.mdx +6 -6
- package/src/stories/RadioGroup/RadioGroupLabel.stories.mdx +7 -2
- package/src/stories/RadioGroup/RadioGroupOptionLabel.stories.mdx +7 -19
- package/src/stories/RadioGroup/RadioGroupOptionValue.stories.mdx +7 -19
- package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +3 -17
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +10 -9
- package/src/stories/RadioGroup/RadioOption.test.ts +45 -0
- package/src/stories/RadioGroup/RadioProperty.test.ts +4 -4
- package/src/stories/RadioGroup/RadioSlots.test.ts +29 -0
- package/src/stories/Select/SelectNative.stories.mdx +45 -0
- package/src/stories/stories.scss +5 -27
- package/src/stories/Button/ButtonVariant.stories.mdx +0 -205
- package/src/stories/Button/test.js +0 -41
- package/src/stories/Radio/RadioTest.js +0 -90
- package/src/stories/RadioGroup/RadioOptionsTest.js +0 -78
- package/src/stories/RadioGroup/RadioPropertyTest.js +0 -131
- package/src/stories/RadioGroup/RadioSlotsTest.js +0 -20
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { toReactive as
|
|
3
|
-
import { v4 as
|
|
4
|
-
|
|
1
|
+
import { toRefs as q, computed as w, h as ce, unref as d, defineComponent as T, openBlock as S, createElementBlock as A, normalizeClass as z, createElementVNode as B, toDisplayString as E, createCommentVNode as _, Fragment as U, renderList as Y, createTextVNode as ee, ref as F, inject as de, createBlock as I, mergeProps as L, useSlots as te, renderSlot as G, createVNode as M, watch as fe, withKeys as Q, withDirectives as pe, vModelText as ye } from "vue";
|
|
2
|
+
import { toReactive as me, useFocus as ve, refDebounced as ge, onClickOutside as he } from "@vueuse/core";
|
|
3
|
+
import { v4 as Z } from "uuid";
|
|
4
|
+
import { iconExists as H, Icon as be, addIcon as Se } from "@iconify/vue";
|
|
5
|
+
const V = {
|
|
5
6
|
equals(t, r, e) {
|
|
6
7
|
return e ? this.resolveFieldData(t, e) === this.resolveFieldData(r, e) : this.deepEquals(t, r);
|
|
7
8
|
},
|
|
@@ -10,35 +11,35 @@ const m = {
|
|
|
10
11
|
return !0;
|
|
11
12
|
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
12
13
|
const e = Array.isArray(t), u = Array.isArray(r);
|
|
13
|
-
let
|
|
14
|
+
let s, o, c;
|
|
14
15
|
if (e && u) {
|
|
15
|
-
if (
|
|
16
|
+
if (o = t.length, o != r.length)
|
|
16
17
|
return !1;
|
|
17
|
-
for (
|
|
18
|
-
if (!this.deepEquals(t[
|
|
18
|
+
for (s = o; s-- !== 0; )
|
|
19
|
+
if (!this.deepEquals(t[s], r[s]))
|
|
19
20
|
return !1;
|
|
20
21
|
return !0;
|
|
21
22
|
}
|
|
22
23
|
if (e != u)
|
|
23
24
|
return !1;
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
25
|
+
const m = t instanceof Date, a = r instanceof Date;
|
|
26
|
+
if (m != a)
|
|
26
27
|
return !1;
|
|
27
|
-
if (
|
|
28
|
+
if (m && a)
|
|
28
29
|
return t.getTime() == r.getTime();
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
30
|
+
const h = t instanceof RegExp, i = r instanceof RegExp;
|
|
31
|
+
if (h != i)
|
|
31
32
|
return !1;
|
|
32
|
-
if (
|
|
33
|
+
if (h && i)
|
|
33
34
|
return t.toString() == r.toString();
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
35
|
+
const n = Object.keys(t);
|
|
36
|
+
if (o = n.length, o !== Object.keys(r).length)
|
|
36
37
|
return !1;
|
|
37
|
-
for (
|
|
38
|
-
if (!Object.prototype.hasOwnProperty.call(r,
|
|
38
|
+
for (s = o; s-- !== 0; )
|
|
39
|
+
if (!Object.prototype.hasOwnProperty.call(r, n[s]))
|
|
39
40
|
return !1;
|
|
40
|
-
for (
|
|
41
|
-
if (
|
|
41
|
+
for (s = o; s-- !== 0; )
|
|
42
|
+
if (c = n[s], !this.deepEquals(t[c], r[c]))
|
|
42
43
|
return !1;
|
|
43
44
|
return !0;
|
|
44
45
|
}
|
|
@@ -51,10 +52,10 @@ const m = {
|
|
|
51
52
|
{
|
|
52
53
|
const e = r.split(".");
|
|
53
54
|
let u = t;
|
|
54
|
-
for (let
|
|
55
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
55
56
|
if (t == null)
|
|
56
57
|
return null;
|
|
57
|
-
u = u[e[
|
|
58
|
+
u = u[e[s]];
|
|
58
59
|
}
|
|
59
60
|
return u;
|
|
60
61
|
}
|
|
@@ -96,21 +97,21 @@ const m = {
|
|
|
96
97
|
},
|
|
97
98
|
removeFromList(t, r) {
|
|
98
99
|
const e = this.findIndexInList(t, r);
|
|
99
|
-
return e > -1 ? r.filter((u,
|
|
100
|
+
return e > -1 ? r.filter((u, s) => s !== e) : r;
|
|
100
101
|
},
|
|
101
102
|
isString(t) {
|
|
102
103
|
return typeof t == "string" || t instanceof String;
|
|
103
104
|
},
|
|
104
105
|
propsToObject(t) {
|
|
105
106
|
return Object.keys(t).reduce((r, e) => {
|
|
106
|
-
var u,
|
|
107
|
-
return this.isFunction(t[e]) ? r[e] = t[e]() : Array.isArray(t[e]) ? r[e] = t[e][0]() : (u = t[e]) != null && u.type && (Array.isArray(t[e].type) ? r[e] = ((
|
|
107
|
+
var u, s, o, c, m;
|
|
108
|
+
return this.isFunction(t[e]) ? r[e] = t[e]() : Array.isArray(t[e]) ? r[e] = t[e][0]() : (u = t[e]) != null && u.type && (Array.isArray(t[e].type) ? r[e] = ((s = t[e]) == null ? void 0 : s.default) || ((o = t[e]) == null ? void 0 : o.type[0]()) : r[e] = ((c = t[e]) == null ? void 0 : c.default) || ((m = t[e]) == null ? void 0 : m.type())), r;
|
|
108
109
|
}, {});
|
|
109
110
|
},
|
|
110
111
|
filterArray(t, r, e) {
|
|
111
|
-
return t.filter((u) => r.some((
|
|
112
|
+
return t.filter((u) => r.some((s) => typeof s == "string" ? u[e] == s : this.equals(
|
|
112
113
|
u[e],
|
|
113
|
-
|
|
114
|
+
s[e]
|
|
114
115
|
)));
|
|
115
116
|
},
|
|
116
117
|
kebabCase(t) {
|
|
@@ -120,31 +121,31 @@ const m = {
|
|
|
120
121
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
121
122
|
)) == null ? void 0 : r.join("-")) == null ? void 0 : e.toLowerCase();
|
|
122
123
|
}
|
|
123
|
-
},
|
|
124
|
+
}, re = {
|
|
124
125
|
valid: Boolean,
|
|
125
126
|
validLabel: [String, Array]
|
|
126
|
-
},
|
|
127
|
+
}, ne = {
|
|
127
128
|
error: Boolean,
|
|
128
129
|
errorLabel: [String, Array]
|
|
129
|
-
},
|
|
130
|
+
}, se = {
|
|
130
131
|
loading: Boolean,
|
|
131
132
|
loadingLabel: String
|
|
132
|
-
},
|
|
133
|
+
}, J = {
|
|
133
134
|
disabled: Boolean
|
|
134
|
-
},
|
|
135
|
+
}, le = {
|
|
135
136
|
readonly: Boolean
|
|
136
|
-
},
|
|
137
|
+
}, X = {
|
|
137
138
|
modifiers: [String, Array]
|
|
138
|
-
},
|
|
139
|
+
}, oe = {
|
|
139
140
|
hintLabel: { type: String, default: "" }
|
|
140
|
-
},
|
|
141
|
-
...
|
|
142
|
-
...
|
|
143
|
-
...
|
|
144
|
-
...
|
|
145
|
-
...
|
|
146
|
-
...
|
|
147
|
-
...
|
|
141
|
+
}, Ve = {
|
|
142
|
+
...re,
|
|
143
|
+
...ne,
|
|
144
|
+
...oe,
|
|
145
|
+
...se,
|
|
146
|
+
...J,
|
|
147
|
+
...le,
|
|
148
|
+
...X,
|
|
148
149
|
modelValue: [String, Array, Object],
|
|
149
150
|
label: String,
|
|
150
151
|
labelNoResult: { type: String, default: "No results" },
|
|
@@ -166,13 +167,14 @@ const m = {
|
|
|
166
167
|
labelKey: { type: String, default: "label" },
|
|
167
168
|
valueKey: { type: String, default: "value" },
|
|
168
169
|
iconLeft: String,
|
|
169
|
-
iconRight: String
|
|
170
|
+
iconRight: String,
|
|
171
|
+
native: Boolean
|
|
170
172
|
};
|
|
171
|
-
function
|
|
172
|
-
return Array.isArray(t) ? t.filter((r) =>
|
|
173
|
+
function R(t) {
|
|
174
|
+
return Array.isArray(t) ? t.filter((r) => V.isString(r)).reduce((r, e) => r.length > 0 ? r + `
|
|
173
175
|
` + e : e, "") : t;
|
|
174
176
|
}
|
|
175
|
-
function
|
|
177
|
+
function ae(t, r) {
|
|
176
178
|
return {
|
|
177
179
|
name: "HintSlot",
|
|
178
180
|
props: {
|
|
@@ -182,43 +184,43 @@ function ye(t, r) {
|
|
|
182
184
|
}
|
|
183
185
|
},
|
|
184
186
|
setup(e) {
|
|
185
|
-
const u =
|
|
186
|
-
error:
|
|
187
|
-
valid:
|
|
188
|
-
hint:
|
|
189
|
-
loading:
|
|
187
|
+
const u = q(t), {
|
|
188
|
+
error: s,
|
|
189
|
+
valid: o,
|
|
190
|
+
hint: c,
|
|
191
|
+
loading: m
|
|
190
192
|
} = r, {
|
|
191
|
-
hintLabel:
|
|
192
|
-
modelValue:
|
|
193
|
-
valid:
|
|
194
|
-
validLabel:
|
|
195
|
-
error:
|
|
196
|
-
errorLabel:
|
|
197
|
-
} = u,
|
|
193
|
+
hintLabel: a,
|
|
194
|
+
modelValue: h,
|
|
195
|
+
valid: i,
|
|
196
|
+
validLabel: n,
|
|
197
|
+
error: v,
|
|
198
|
+
errorLabel: l
|
|
199
|
+
} = u, y = V.resolveFieldData(u, "loading"), b = V.resolveFieldData(
|
|
198
200
|
u,
|
|
199
201
|
"loadingLabel"
|
|
200
|
-
),
|
|
201
|
-
const
|
|
202
|
-
hintLabel:
|
|
203
|
-
modelValue:
|
|
204
|
-
valid:
|
|
205
|
-
validLabel:
|
|
206
|
-
error:
|
|
207
|
-
errorLabel:
|
|
208
|
-
loading:
|
|
209
|
-
loadingLabel:
|
|
202
|
+
), O = w(() => v.value ? !!(v.value && s || (l == null ? void 0 : l.value) && Array.isArray(l.value) && l.value.length > 0 || (l == null ? void 0 : l.value) && V.isNotEmpty(l.value)) : !1), $ = w(() => !!(a && a.value || c || o || n && n.value || O.value || (y == null ? void 0 : y.value) && m || (y == null ? void 0 : y.value) && (b == null ? void 0 : b.value))), f = w(() => {
|
|
203
|
+
const C = me({
|
|
204
|
+
hintLabel: a,
|
|
205
|
+
modelValue: h,
|
|
206
|
+
valid: i,
|
|
207
|
+
validLabel: n,
|
|
208
|
+
error: v,
|
|
209
|
+
errorLabel: l,
|
|
210
|
+
loading: y,
|
|
211
|
+
loadingLabel: b,
|
|
210
212
|
...e.params
|
|
211
213
|
});
|
|
212
|
-
return
|
|
214
|
+
return v != null && v.value ? (s == null ? void 0 : s(C)) || R(l == null ? void 0 : l.value) || (a == null ? void 0 : a.value) : i != null && i.value ? (o == null ? void 0 : o(C)) || R(n == null ? void 0 : n.value) || (a == null ? void 0 : a.value) : y != null && y.value ? (m == null ? void 0 : m(C)) || R(b == null ? void 0 : b.value) || (a == null ? void 0 : a.value) : (c == null ? void 0 : c(C)) || R(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
|
|
213
215
|
});
|
|
214
216
|
return {
|
|
215
|
-
hasHint:
|
|
216
|
-
hintContent:
|
|
217
|
+
hasHint: $,
|
|
218
|
+
hintContent: f
|
|
217
219
|
};
|
|
218
220
|
},
|
|
219
221
|
render() {
|
|
220
222
|
if (this.hasHint)
|
|
221
|
-
return
|
|
223
|
+
return ce(
|
|
222
224
|
"pre",
|
|
223
225
|
{ style: { "white-space": "pre" } },
|
|
224
226
|
this.hintContent
|
|
@@ -226,22 +228,22 @@ function ye(t, r) {
|
|
|
226
228
|
}
|
|
227
229
|
};
|
|
228
230
|
}
|
|
229
|
-
function
|
|
231
|
+
function x(t, r) {
|
|
230
232
|
const e = { [`${t}`]: !0 };
|
|
231
233
|
return {
|
|
232
|
-
bemCssClasses:
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
235
|
-
return
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
234
|
+
bemCssClasses: w(() => Object.keys(r).reduce((s, o) => {
|
|
235
|
+
const c = d(r[o]) || !1;
|
|
236
|
+
if (!c)
|
|
237
|
+
return s;
|
|
238
|
+
if (o === "modifiers") {
|
|
239
|
+
const m = Array.isArray(c) ? c : [c];
|
|
238
240
|
return {
|
|
239
|
-
...
|
|
240
|
-
...
|
|
241
|
-
(
|
|
242
|
-
...
|
|
243
|
-
[`${t}--${
|
|
244
|
-
|
|
241
|
+
...s,
|
|
242
|
+
...m.reduce(
|
|
243
|
+
(a, h) => ({
|
|
244
|
+
...a,
|
|
245
|
+
[`${t}--${V.kebabCase(
|
|
246
|
+
h
|
|
245
247
|
)}`]: !0
|
|
246
248
|
}),
|
|
247
249
|
{}
|
|
@@ -249,15 +251,15 @@ function Z(t, r) {
|
|
|
249
251
|
};
|
|
250
252
|
} else
|
|
251
253
|
return {
|
|
252
|
-
...
|
|
253
|
-
[`${t}--${
|
|
254
|
+
...s,
|
|
255
|
+
[`${t}--${V.kebabCase(o)}`]: c
|
|
254
256
|
};
|
|
255
257
|
}, e) || {})
|
|
256
258
|
};
|
|
257
259
|
}
|
|
258
|
-
const
|
|
259
|
-
...
|
|
260
|
-
...
|
|
260
|
+
const Ae = {
|
|
261
|
+
...J,
|
|
262
|
+
...X,
|
|
261
263
|
modelValue: [String, Array, Object],
|
|
262
264
|
labelNoResult: { type: String, default: "No results" },
|
|
263
265
|
options: {
|
|
@@ -269,179 +271,365 @@ const me = {
|
|
|
269
271
|
maxValues: [Number, String],
|
|
270
272
|
labelKey: { type: String, default: "label" },
|
|
271
273
|
valueKey: { type: String, default: "value" }
|
|
272
|
-
},
|
|
274
|
+
}, we = { key: 0 }, Oe = ["for"], je = ["id", "type", "value", "checked", "disabled"], Ce = /* @__PURE__ */ T({
|
|
273
275
|
__name: "VvDropdown",
|
|
274
|
-
props:
|
|
276
|
+
props: Ae,
|
|
275
277
|
emits: ["update:modelValue"],
|
|
276
278
|
setup(t, { emit: r }) {
|
|
277
|
-
const e = t, u =
|
|
278
|
-
modifiers:
|
|
279
|
-
disabled:
|
|
279
|
+
const e = t, u = Z(), { modifiers: s, disabled: o } = q(e), { bemCssClasses: c } = x("vv-dropdown", {
|
|
280
|
+
modifiers: s,
|
|
281
|
+
disabled: o
|
|
280
282
|
});
|
|
281
|
-
function
|
|
282
|
-
return Array.isArray(e.modelValue) ?
|
|
283
|
+
function m(n) {
|
|
284
|
+
return Array.isArray(e.modelValue) ? V.contains(n, e.modelValue) || V.contains(a(n), e.modelValue) : V.equals(n, e.modelValue) || V.equals(a(n), e.modelValue);
|
|
283
285
|
}
|
|
284
|
-
function
|
|
285
|
-
return typeof
|
|
286
|
+
function a(n) {
|
|
287
|
+
return typeof n == "string" ? n : String(n[e.valueKey]);
|
|
286
288
|
}
|
|
287
|
-
function
|
|
288
|
-
return typeof
|
|
289
|
+
function h(n) {
|
|
290
|
+
return typeof n == "string" ? n : n[e.labelKey];
|
|
289
291
|
}
|
|
290
|
-
function
|
|
291
|
-
var
|
|
292
|
-
const
|
|
293
|
-
let
|
|
294
|
-
if (
|
|
295
|
-
(
|
|
296
|
-
) : null) ||
|
|
297
|
-
if (typeof e.maxValues < "u" && e.maxValues >= 0 && ((
|
|
298
|
-
|
|
292
|
+
function i(n) {
|
|
293
|
+
var b, O;
|
|
294
|
+
const v = n.target;
|
|
295
|
+
let l = v.value;
|
|
296
|
+
if (l = (e.useObject ? (b = e.options) == null ? void 0 : b.find(
|
|
297
|
+
($) => $[e.valueKey] == l
|
|
298
|
+
) : null) || l, e.multiple) {
|
|
299
|
+
if (typeof e.maxValues < "u" && e.maxValues >= 0 && ((O = e.modelValue) == null ? void 0 : O.length) >= e.maxValues && (Array.isArray(e.modelValue) && !V.contains(l, e.modelValue) || e.maxValues == 0)) {
|
|
300
|
+
v.checked = !1;
|
|
299
301
|
return;
|
|
300
302
|
}
|
|
301
|
-
Array.isArray(e.modelValue) ?
|
|
303
|
+
Array.isArray(e.modelValue) ? l = V.contains(l, e.modelValue) ? V.removeFromList(l, e.modelValue) : [...e.modelValue, l] : l = [l];
|
|
302
304
|
}
|
|
303
|
-
r("update:modelValue",
|
|
305
|
+
r("update:modelValue", l);
|
|
304
306
|
}
|
|
305
|
-
return (
|
|
306
|
-
var
|
|
307
|
-
return
|
|
308
|
-
class:
|
|
307
|
+
return (n, v) => {
|
|
308
|
+
var l;
|
|
309
|
+
return S(), A("ul", {
|
|
310
|
+
class: z(d(c)),
|
|
309
311
|
role: "listbox"
|
|
310
312
|
}, [
|
|
311
|
-
(
|
|
312
|
-
B("label", null,
|
|
313
|
+
(l = n.options) != null && l.length ? _("", !0) : (S(), A("li", we, [
|
|
314
|
+
B("label", null, E(n.labelNoResult), 1)
|
|
313
315
|
])),
|
|
314
|
-
(
|
|
315
|
-
var
|
|
316
|
-
return
|
|
316
|
+
(S(!0), A(U, null, Y(n.options, (y, b) => {
|
|
317
|
+
var O;
|
|
318
|
+
return S(), A("li", { key: b }, [
|
|
317
319
|
B("label", {
|
|
318
|
-
for: `dropdown-${
|
|
320
|
+
for: `dropdown-${b}-${d(u)}`
|
|
319
321
|
}, [
|
|
320
322
|
B("input", {
|
|
321
|
-
id: `dropdown-${
|
|
322
|
-
type:
|
|
323
|
-
value:
|
|
324
|
-
checked:
|
|
325
|
-
disabled: typeof
|
|
326
|
-
onInput:
|
|
327
|
-
}, null, 40,
|
|
328
|
-
|
|
329
|
-
], 8,
|
|
323
|
+
id: `dropdown-${b}-${d(u)}`,
|
|
324
|
+
type: n.multiple ? "checkbox" : "radio",
|
|
325
|
+
value: a(y),
|
|
326
|
+
checked: m(y),
|
|
327
|
+
disabled: typeof y == "object" ? (O = y.disabled) != null ? O : d(o) : d(o),
|
|
328
|
+
onInput: i
|
|
329
|
+
}, null, 40, je),
|
|
330
|
+
ee(" " + E(h(y)), 1)
|
|
331
|
+
], 8, Oe)
|
|
330
332
|
]);
|
|
331
333
|
}), 128))
|
|
332
334
|
], 2);
|
|
333
335
|
};
|
|
334
336
|
}
|
|
335
|
-
}),
|
|
337
|
+
}), ke = {
|
|
338
|
+
...re,
|
|
339
|
+
...ne,
|
|
340
|
+
...oe,
|
|
341
|
+
...se,
|
|
342
|
+
...J,
|
|
343
|
+
...le,
|
|
344
|
+
...X,
|
|
345
|
+
modelValue: {
|
|
346
|
+
type: [String, Object],
|
|
347
|
+
required: !0
|
|
348
|
+
},
|
|
349
|
+
label: String,
|
|
350
|
+
placeholder: String,
|
|
351
|
+
options: {
|
|
352
|
+
type: Array,
|
|
353
|
+
required: !0
|
|
354
|
+
},
|
|
355
|
+
useObject: Boolean,
|
|
356
|
+
labelKey: { type: String, default: "label" },
|
|
357
|
+
valueKey: { type: String, default: "value" },
|
|
358
|
+
iconLeft: String,
|
|
359
|
+
iconRight: String,
|
|
360
|
+
modifiers: [String, Array]
|
|
361
|
+
}, $e = "ds", _e = {
|
|
362
|
+
color: String,
|
|
363
|
+
width: {
|
|
364
|
+
type: [String, Number]
|
|
365
|
+
},
|
|
366
|
+
height: {
|
|
367
|
+
type: [String, Number]
|
|
368
|
+
},
|
|
369
|
+
name: {
|
|
370
|
+
type: String,
|
|
371
|
+
required: !0
|
|
372
|
+
},
|
|
373
|
+
provider: {
|
|
374
|
+
type: String
|
|
375
|
+
},
|
|
376
|
+
prefix: {
|
|
377
|
+
type: String,
|
|
378
|
+
default: "normal"
|
|
379
|
+
},
|
|
380
|
+
src: String,
|
|
381
|
+
horizontalFlip: Boolean,
|
|
382
|
+
verticalFlip: Boolean,
|
|
383
|
+
flip: String,
|
|
384
|
+
mode: String,
|
|
385
|
+
inline: Boolean,
|
|
386
|
+
rotate: [Number, String],
|
|
387
|
+
onLoad: Function,
|
|
388
|
+
svg: String,
|
|
389
|
+
modifiers: {
|
|
390
|
+
type: [String, Array]
|
|
391
|
+
}
|
|
392
|
+
}, W = /* @__PURE__ */ T({
|
|
393
|
+
__name: "VvIcon",
|
|
394
|
+
props: _e,
|
|
395
|
+
setup(t) {
|
|
396
|
+
const r = t, e = F(!0), { modifiers: u } = q(r), s = de($e), { bemCssClasses: o } = x("vv-icon", {
|
|
397
|
+
modifiers: u
|
|
398
|
+
}), c = w(() => r.provider || (s == null ? void 0 : s.provider)), m = w(() => {
|
|
399
|
+
const i = r.name || "", n = `@${c.value}:${r.prefix}:${r.name}`;
|
|
400
|
+
return H(i) ? i : H(n) ? n : (s == null ? void 0 : s.iconsCollections.find((v) => {
|
|
401
|
+
const l = `@${c.value}:${v.prefix}:${i}`;
|
|
402
|
+
if (H(l))
|
|
403
|
+
return l;
|
|
404
|
+
})) || i;
|
|
405
|
+
});
|
|
406
|
+
function a(i) {
|
|
407
|
+
let n = null;
|
|
408
|
+
if (typeof window > "u") {
|
|
409
|
+
const { JSDOM: b } = require("jsdom");
|
|
410
|
+
n = new b().window;
|
|
411
|
+
}
|
|
412
|
+
return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(i, "text/html").querySelector("svg");
|
|
413
|
+
}
|
|
414
|
+
function h(i) {
|
|
415
|
+
const n = a(i), v = (n == null ? void 0 : n.innerHTML.trim()) || "";
|
|
416
|
+
n && v && Se(`@${c.value}:${r.prefix}:${r.name}`, {
|
|
417
|
+
body: v,
|
|
418
|
+
height: n.viewBox.baseVal.height,
|
|
419
|
+
width: n.viewBox.baseVal.width
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return s && (r.src ? (e.value = !1, s.fetchIcon(r.src).then((i) => {
|
|
423
|
+
i && (h(i), e.value = !0);
|
|
424
|
+
}).catch((i) => {
|
|
425
|
+
throw new Error(`During fetch icon: ${i == null ? void 0 : i.message}`);
|
|
426
|
+
})) : r.svg && h(r.svg)), (i, n) => e.value ? (S(), I(d(be), L({
|
|
427
|
+
key: 0,
|
|
428
|
+
class: d(o)
|
|
429
|
+
}, {
|
|
430
|
+
...i.$props,
|
|
431
|
+
provider: d(c),
|
|
432
|
+
icon: d(m)
|
|
433
|
+
}), null, 16, ["class"])) : _("", !0);
|
|
434
|
+
}
|
|
435
|
+
}), Be = ["for"], Ee = { class: "vv-select__wrapper" }, Ne = ["id", "value", "disabled"], De = {
|
|
436
|
+
key: 0,
|
|
437
|
+
value: "",
|
|
438
|
+
disabled: "",
|
|
439
|
+
selected: ""
|
|
440
|
+
}, Pe = ["disabled", "value"], Ke = /* @__PURE__ */ T({
|
|
441
|
+
__name: "VvNativeSelect",
|
|
442
|
+
props: ke,
|
|
443
|
+
emits: ["update:modelValue"],
|
|
444
|
+
setup(t, { emit: r }) {
|
|
445
|
+
const e = t, u = te(), s = ae(e, u), {
|
|
446
|
+
modifiers: o,
|
|
447
|
+
disabled: c,
|
|
448
|
+
readonly: m,
|
|
449
|
+
loading: a,
|
|
450
|
+
iconLeft: h,
|
|
451
|
+
iconRight: i,
|
|
452
|
+
error: n,
|
|
453
|
+
valid: v
|
|
454
|
+
} = q(e), l = Z(), { bemCssClasses: y } = x("vv-select", {
|
|
455
|
+
modifiers: o,
|
|
456
|
+
loading: a,
|
|
457
|
+
readonly: m,
|
|
458
|
+
iconLeft: h,
|
|
459
|
+
iconRight: i,
|
|
460
|
+
valid: v,
|
|
461
|
+
invalid: n,
|
|
462
|
+
dirty: w(() => V.isNotEmpty(e.modelValue))
|
|
463
|
+
});
|
|
464
|
+
function b(f) {
|
|
465
|
+
return typeof f == "string" ? f : f[e.valueKey];
|
|
466
|
+
}
|
|
467
|
+
function O(f) {
|
|
468
|
+
return typeof f == "string" ? f : f[e.labelKey];
|
|
469
|
+
}
|
|
470
|
+
function $(f) {
|
|
471
|
+
var N;
|
|
472
|
+
const C = f.target, k = (e.useObject ? (N = e.options) == null ? void 0 : N.find(
|
|
473
|
+
(D) => D[e.valueKey] == C.value
|
|
474
|
+
) : null) || C.value;
|
|
475
|
+
r("update:modelValue", k);
|
|
476
|
+
}
|
|
477
|
+
return (f, C) => {
|
|
478
|
+
var P;
|
|
479
|
+
return S(), A("div", {
|
|
480
|
+
class: z(d(y))
|
|
481
|
+
}, [
|
|
482
|
+
f.label ? (S(), A("label", {
|
|
483
|
+
key: 0,
|
|
484
|
+
for: d(l)
|
|
485
|
+
}, E(f.label), 9, Be)) : _("", !0),
|
|
486
|
+
B("div", Ee, [
|
|
487
|
+
G(f.$slots, "icon-left", {}, () => [
|
|
488
|
+
d(h) ? (S(), I(W, {
|
|
489
|
+
key: 0,
|
|
490
|
+
name: d(h)
|
|
491
|
+
}, null, 8, ["name"])) : _("", !0)
|
|
492
|
+
]),
|
|
493
|
+
B("select", {
|
|
494
|
+
id: d(l),
|
|
495
|
+
value: typeof f.modelValue == "string" ? f.modelValue : (P = f.modelValue) == null ? void 0 : P[f.valueKey],
|
|
496
|
+
disabled: d(c) || d(m),
|
|
497
|
+
onInput: $
|
|
498
|
+
}, [
|
|
499
|
+
f.placeholder ? (S(), A("option", De, E(f.placeholder), 1)) : _("", !0),
|
|
500
|
+
(S(!0), A(U, null, Y(f.options, (k, N) => {
|
|
501
|
+
var D;
|
|
502
|
+
return S(), A("option", {
|
|
503
|
+
key: N,
|
|
504
|
+
disabled: typeof k == "object" ? (D = k.disabled) != null ? D : d(c) : d(c),
|
|
505
|
+
value: b(k)
|
|
506
|
+
}, E(O(k)), 9, Pe);
|
|
507
|
+
}), 128))
|
|
508
|
+
], 40, Ne),
|
|
509
|
+
G(f.$slots, "icon-right", {}, () => [
|
|
510
|
+
d(i) ? (S(), I(W, {
|
|
511
|
+
key: 0,
|
|
512
|
+
name: d(i)
|
|
513
|
+
}, null, 8, ["name"])) : _("", !0)
|
|
514
|
+
])
|
|
515
|
+
]),
|
|
516
|
+
M(d(s), { class: "vv-select__hint" })
|
|
517
|
+
], 2);
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
}), Fe = ["id"], qe = {
|
|
336
521
|
key: 0,
|
|
337
522
|
for: "select"
|
|
338
|
-
},
|
|
523
|
+
}, Re = ["placeholder"], Le = /* @__PURE__ */ T({
|
|
339
524
|
__name: "VvSelect",
|
|
340
|
-
props:
|
|
525
|
+
props: Ve,
|
|
341
526
|
emits: ["update:modelValue", "change:search"],
|
|
342
527
|
setup(t, { emit: r }) {
|
|
343
|
-
const e = t, u =
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
|
|
528
|
+
const e = t, u = te(), s = ae(e, u), o = F(), c = F();
|
|
529
|
+
ve(c, { initialValue: !0 });
|
|
530
|
+
const m = Z(), a = F(""), h = ge(
|
|
531
|
+
a,
|
|
347
532
|
Number(e.debounceSearch)
|
|
348
|
-
),
|
|
349
|
-
modifiers:
|
|
350
|
-
disabled:
|
|
351
|
-
readonly:
|
|
352
|
-
loading:
|
|
353
|
-
iconLeft:
|
|
354
|
-
iconRight:
|
|
355
|
-
valid:
|
|
356
|
-
error:
|
|
357
|
-
} =
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
() => r("change:search",
|
|
533
|
+
), i = F(!1), {
|
|
534
|
+
modifiers: n,
|
|
535
|
+
disabled: v,
|
|
536
|
+
readonly: l,
|
|
537
|
+
loading: y,
|
|
538
|
+
iconLeft: b,
|
|
539
|
+
iconRight: O,
|
|
540
|
+
valid: $,
|
|
541
|
+
error: f
|
|
542
|
+
} = q(e);
|
|
543
|
+
fe(
|
|
544
|
+
h,
|
|
545
|
+
() => r("change:search", h.value)
|
|
361
546
|
);
|
|
362
|
-
const { bemCssClasses:
|
|
363
|
-
modifiers:
|
|
364
|
-
disabled:
|
|
365
|
-
loading:
|
|
366
|
-
readonly:
|
|
367
|
-
iconLeft:
|
|
368
|
-
iconRight:
|
|
369
|
-
valid:
|
|
370
|
-
invalid:
|
|
371
|
-
dirty:
|
|
372
|
-
}),
|
|
547
|
+
const { bemCssClasses: C } = x("vv-select", {
|
|
548
|
+
modifiers: n,
|
|
549
|
+
disabled: v,
|
|
550
|
+
loading: y,
|
|
551
|
+
readonly: l,
|
|
552
|
+
iconLeft: b,
|
|
553
|
+
iconRight: O,
|
|
554
|
+
valid: $,
|
|
555
|
+
invalid: f,
|
|
556
|
+
dirty: w(() => V.isNotEmpty(e.modelValue))
|
|
557
|
+
}), P = w(
|
|
373
558
|
() => {
|
|
374
|
-
var
|
|
375
|
-
return (
|
|
559
|
+
var p;
|
|
560
|
+
return (p = e.options) == null ? void 0 : p.every((g) => typeof g == "object");
|
|
376
561
|
}
|
|
377
|
-
),
|
|
378
|
-
() => e.searchable ?
|
|
379
|
-
),
|
|
380
|
-
var
|
|
381
|
-
return (
|
|
382
|
-
}),
|
|
383
|
-
var
|
|
384
|
-
if (e.multiple && ((
|
|
385
|
-
return
|
|
562
|
+
), k = w(
|
|
563
|
+
() => e.searchable ? N.value : e.options
|
|
564
|
+
), N = w(() => {
|
|
565
|
+
var p;
|
|
566
|
+
return (p = e.options) == null ? void 0 : p.filter((g) => typeof g == "string" ? g.toLowerCase().includes(h.value.toLowerCase().trim()) : g[e.labelKey].toLowerCase().includes(h.value.toLowerCase().trim()));
|
|
567
|
+
}), D = w(() => {
|
|
568
|
+
var g, j;
|
|
569
|
+
if (e.multiple && ((g = e.modelValue) == null ? void 0 : g.length) && Array.isArray(e.modelValue))
|
|
570
|
+
return P.value ? V.filterArray(
|
|
386
571
|
e.options,
|
|
387
572
|
e.modelValue,
|
|
388
573
|
e.valueKey
|
|
389
|
-
).map((
|
|
390
|
-
const
|
|
391
|
-
(
|
|
574
|
+
).map((K) => K[e.labelKey]).join(e.separator) : e.modelValue.join(e.separator);
|
|
575
|
+
const p = e.useObject ? e.modelValue : (j = e.options) == null ? void 0 : j.find(
|
|
576
|
+
(K) => typeof K == "object" ? K[e.valueKey] == e.modelValue : K == e.modelValue
|
|
392
577
|
);
|
|
393
|
-
return typeof
|
|
578
|
+
return typeof p == "object" ? p == null ? void 0 : p[e.labelKey] : p;
|
|
394
579
|
});
|
|
395
|
-
|
|
396
|
-
|
|
580
|
+
he(o, () => {
|
|
581
|
+
o.value.open = !1;
|
|
397
582
|
});
|
|
398
|
-
function
|
|
399
|
-
const
|
|
400
|
-
|
|
583
|
+
function ie(p) {
|
|
584
|
+
const g = p.target;
|
|
585
|
+
i.value = g.open;
|
|
401
586
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
587
|
+
function ue(p) {
|
|
588
|
+
o.value && !e.multiple && (o.value.open = !1), r("update:modelValue", p);
|
|
404
589
|
}
|
|
405
|
-
return (
|
|
406
|
-
|
|
407
|
-
|
|
590
|
+
return (p, g) => p.native ? (S(), I(Ke, L({ key: 1 }, e, {
|
|
591
|
+
"onUpdate:modelValue": g[4] || (g[4] = (j) => r("update:modelValue", j))
|
|
592
|
+
}), null, 16)) : (S(), A("div", {
|
|
593
|
+
key: 0,
|
|
594
|
+
id: d(m),
|
|
595
|
+
class: z(d(C))
|
|
408
596
|
}, [
|
|
409
|
-
|
|
597
|
+
p.label ? (S(), A("label", qe, E(p.label), 1)) : _("", !0),
|
|
410
598
|
B("details", {
|
|
411
599
|
ref_key: "dropdown",
|
|
412
|
-
ref:
|
|
600
|
+
ref: o,
|
|
413
601
|
role: "list",
|
|
414
602
|
class: "vv-select__wrapper",
|
|
415
|
-
onClick:
|
|
416
|
-
onKeyup:
|
|
417
|
-
onToggle:
|
|
603
|
+
onClick: g[2] || (g[2] = (j) => d(v) || d(l) ? j.preventDefault() : null),
|
|
604
|
+
onKeyup: g[3] || (g[3] = Q((j) => o.value.open = !1, ["esc"])),
|
|
605
|
+
onToggle: ie
|
|
418
606
|
}, [
|
|
419
607
|
B("summary", {
|
|
420
608
|
class: "vv-select__input",
|
|
421
609
|
"aria-haspopup": "listbox",
|
|
422
|
-
onKeyup:
|
|
610
|
+
onKeyup: g[1] || (g[1] = Q((j) => p.searchable ? j.preventDefault() : null, ["space"]))
|
|
423
611
|
}, [
|
|
424
|
-
|
|
612
|
+
p.searchable && i.value ? pe((S(), A("input", {
|
|
425
613
|
key: 0,
|
|
426
614
|
ref_key: "inputSearch",
|
|
427
|
-
ref:
|
|
428
|
-
"onUpdate:modelValue":
|
|
429
|
-
placeholder:
|
|
430
|
-
}, null, 8,
|
|
431
|
-
[
|
|
432
|
-
]) : (
|
|
433
|
-
|
|
615
|
+
ref: c,
|
|
616
|
+
"onUpdate:modelValue": g[0] || (g[0] = (j) => a.value = j),
|
|
617
|
+
placeholder: p.searchPlaceholder
|
|
618
|
+
}, null, 8, Re)), [
|
|
619
|
+
[ye, a.value]
|
|
620
|
+
]) : (S(), A(U, { key: 1 }, [
|
|
621
|
+
ee(E(d(D) || p.placeholder), 1)
|
|
434
622
|
], 64))
|
|
435
623
|
], 32),
|
|
436
|
-
|
|
624
|
+
M(Ce, L({
|
|
437
625
|
...e,
|
|
438
|
-
options:
|
|
439
|
-
}, { "onUpdate:modelValue":
|
|
626
|
+
options: d(k)
|
|
627
|
+
}, { "onUpdate:modelValue": ue }), null, 16)
|
|
440
628
|
], 544),
|
|
441
|
-
|
|
442
|
-
], 10,
|
|
629
|
+
M(d(s), { class: "vv-select__hint" })
|
|
630
|
+
], 10, Fe));
|
|
443
631
|
}
|
|
444
632
|
});
|
|
445
633
|
export {
|
|
446
|
-
|
|
634
|
+
Le as default
|
|
447
635
|
};
|