@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.
Files changed (81) hide show
  1. package/dist/components/VvBadge/VvBadge.d.ts +1 -1
  2. package/dist/components/VvBadge/VvBadge.es.js +165 -12
  3. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  4. package/dist/components/VvBadge/VvBadge.vue.d.ts +4 -4
  5. package/dist/components/VvBreadcrumb/VvBreadcrumb.d.ts +1 -1
  6. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +4 -4
  7. package/dist/components/VvButton/VvButton.d.ts +2 -33
  8. package/dist/components/VvButton/VvButton.es.js +183 -198
  9. package/dist/components/VvButton/VvButton.umd.js +1 -1
  10. package/dist/components/VvButton/VvButton.vue.d.ts +9 -44
  11. package/dist/components/VvButton/useButtonGroupProps.d.ts +1 -6
  12. package/dist/components/VvButtonGroup/VvButtonGroup.d.ts +2 -26
  13. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +68 -78
  14. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  15. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +9 -69
  16. package/dist/components/VvDropdown/VvDropdown.d.ts +1 -1
  17. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +4 -4
  18. package/dist/components/VvInputText/VvInputText.d.ts +1 -1
  19. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  20. package/dist/components/VvProgress/VvProgress.d.ts +1 -1
  21. package/dist/components/VvProgress/VvProgress.vue.d.ts +4 -4
  22. package/dist/components/VvSelect/VvSelect.d.ts +5 -1
  23. package/dist/components/VvSelect/VvSelect.es.js +395 -207
  24. package/dist/components/VvSelect/VvSelect.umd.js +2 -2
  25. package/dist/components/VvSelect/VvSelect.vue.d.ts +12 -5
  26. package/dist/components/VvTextarea/VvTextarea.d.ts +1 -1
  27. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
  28. package/dist/components/index.es.js +579 -610
  29. package/dist/components/index.umd.js +2 -2
  30. package/dist/composables/group/types/IButtonGroupState.d.ts +4 -0
  31. package/dist/icons.es.js +3 -3
  32. package/dist/icons.umd.js +1 -1
  33. package/dist/index.es.js +553 -585
  34. package/dist/index.umd.js +2 -2
  35. package/dist/props/index.d.ts +2 -1
  36. package/dist/stories/RadioGroup/RadioOption.test.d.ts +4 -0
  37. package/dist/stories/RadioGroup/RadioProperty.test.d.ts +1 -1
  38. package/dist/stories/RadioGroup/RadioSlots.test.d.ts +6 -0
  39. package/package.json +2 -2
  40. package/src/assets/icons/detailed.json +1 -1
  41. package/src/assets/icons/normal.json +1 -1
  42. package/src/assets/icons/simple.json +1 -1
  43. package/src/components/VvBadge/VvBadge.ts +4 -2
  44. package/src/components/VvBadge/VvBadge.vue +8 -3
  45. package/src/components/VvButton/VvButton.ts +4 -34
  46. package/src/components/VvButton/VvButton.vue +3 -12
  47. package/src/components/VvButton/useButtonGroupProps.ts +3 -11
  48. package/src/components/VvButtonGroup/VvButtonGroup.ts +4 -17
  49. package/src/components/VvButtonGroup/VvButtonGroup.vue +5 -16
  50. package/src/components/VvSelect/VvSelect.ts +5 -1
  51. package/src/components/VvSelect/VvSelect.vue +7 -1
  52. package/src/composables/group/types/IButtonGroupState.ts +4 -0
  53. package/src/props/index.ts +3 -1
  54. package/src/stories/Badge/BadgeColor.stories.mdx +4 -4
  55. package/src/stories/Badge/BadgeModifiers.stories.mdx +65 -0
  56. package/src/stories/Button/ButtonActive.stories.mdx +27 -0
  57. package/src/stories/Button/ButtonDisabled.stories.mdx +28 -0
  58. package/src/stories/Button/ButtonIconPosition.stories.mdx +0 -1
  59. package/src/stories/Button/ButtonModifiers.stories.mdx +103 -46
  60. package/src/stories/Button/ButtonSelected.stories.mdx +30 -0
  61. package/src/stories/ButtonGroup/ButtonGroupAction.stories.mdx +2 -2
  62. package/src/stories/ButtonGroup/ButtonGroupActionQuiet.stories.mdx +2 -2
  63. package/src/stories/ButtonGroup/ButtonGroupBlock.stories.mdx +1 -1
  64. package/src/stories/ButtonGroup/ButtonGroupRounded.stories.mdx +1 -1
  65. package/src/stories/RadioGroup/RadioGroupHintLabel.stories.mdx +6 -6
  66. package/src/stories/RadioGroup/RadioGroupLabel.stories.mdx +7 -2
  67. package/src/stories/RadioGroup/RadioGroupOptionLabel.stories.mdx +7 -19
  68. package/src/stories/RadioGroup/RadioGroupOptionValue.stories.mdx +7 -19
  69. package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +3 -17
  70. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +10 -9
  71. package/src/stories/RadioGroup/RadioOption.test.ts +45 -0
  72. package/src/stories/RadioGroup/RadioProperty.test.ts +4 -4
  73. package/src/stories/RadioGroup/RadioSlots.test.ts +29 -0
  74. package/src/stories/Select/SelectNative.stories.mdx +45 -0
  75. package/src/stories/stories.scss +5 -27
  76. package/src/stories/Button/ButtonVariant.stories.mdx +0 -205
  77. package/src/stories/Button/test.js +0 -41
  78. package/src/stories/Radio/RadioTest.js +0 -90
  79. package/src/stories/RadioGroup/RadioOptionsTest.js +0 -78
  80. package/src/stories/RadioGroup/RadioPropertyTest.js +0 -131
  81. package/src/stories/RadioGroup/RadioSlotsTest.js +0 -20
@@ -1,7 +1,8 @@
1
- import { toRefs as K, computed as S, h as W, unref as v, defineComponent as q, openBlock as j, createElementBlock as C, normalizeClass as F, createElementVNode as B, toDisplayString as N, createCommentVNode as x, Fragment as R, renderList as X, createTextVNode as T, useSlots as Y, ref as E, watch as ee, withKeys as P, withDirectives as te, vModelText as re, createVNode as $, mergeProps as ne } from "vue";
2
- import { toReactive as se, useFocus as le, refDebounced as oe, onClickOutside as ae } from "@vueuse/core";
3
- import { v4 as H } from "uuid";
4
- const m = {
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 n, s, i;
14
+ let s, o, c;
14
15
  if (e && u) {
15
- if (s = t.length, s != r.length)
16
+ if (o = t.length, o != r.length)
16
17
  return !1;
17
- for (n = s; n-- !== 0; )
18
- if (!this.deepEquals(t[n], r[n]))
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 p = t instanceof Date, o = r instanceof Date;
25
- if (p != o)
25
+ const m = t instanceof Date, a = r instanceof Date;
26
+ if (m != a)
26
27
  return !1;
27
- if (p && o)
28
+ if (m && a)
28
29
  return t.getTime() == r.getTime();
29
- const g = t instanceof RegExp, b = r instanceof RegExp;
30
- if (g != b)
30
+ const h = t instanceof RegExp, i = r instanceof RegExp;
31
+ if (h != i)
31
32
  return !1;
32
- if (g && b)
33
+ if (h && i)
33
34
  return t.toString() == r.toString();
34
- const l = Object.keys(t);
35
- if (s = l.length, s !== Object.keys(r).length)
35
+ const n = Object.keys(t);
36
+ if (o = n.length, o !== Object.keys(r).length)
36
37
  return !1;
37
- for (n = s; n-- !== 0; )
38
- if (!Object.prototype.hasOwnProperty.call(r, l[n]))
38
+ for (s = o; s-- !== 0; )
39
+ if (!Object.prototype.hasOwnProperty.call(r, n[s]))
39
40
  return !1;
40
- for (n = s; n-- !== 0; )
41
- if (i = l[n], !this.deepEquals(t[i], r[i]))
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 n = 0, s = e.length; n < s; ++n) {
55
+ for (let s = 0, o = e.length; s < o; ++s) {
55
56
  if (t == null)
56
57
  return null;
57
- u = u[e[n]];
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, n) => n !== e) : r;
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, n, s, i, p;
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] = ((n = t[e]) == null ? void 0 : n.default) || ((s = t[e]) == null ? void 0 : s.type[0]()) : r[e] = ((i = t[e]) == null ? void 0 : i.default) || ((p = t[e]) == null ? void 0 : p.type())), r;
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((n) => typeof n == "string" ? u[e] == n : this.equals(
112
+ return t.filter((u) => r.some((s) => typeof s == "string" ? u[e] == s : this.equals(
112
113
  u[e],
113
- n[e]
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
- }, ue = {
124
+ }, re = {
124
125
  valid: Boolean,
125
126
  validLabel: [String, Array]
126
- }, ie = {
127
+ }, ne = {
127
128
  error: Boolean,
128
129
  errorLabel: [String, Array]
129
- }, ce = {
130
+ }, se = {
130
131
  loading: Boolean,
131
132
  loadingLabel: String
132
- }, I = {
133
+ }, J = {
133
134
  disabled: Boolean
134
- }, de = {
135
+ }, le = {
135
136
  readonly: Boolean
136
- }, M = {
137
+ }, X = {
137
138
  modifiers: [String, Array]
138
- }, fe = {
139
+ }, oe = {
139
140
  hintLabel: { type: String, default: "" }
140
- }, pe = {
141
- ...ue,
142
- ...ie,
143
- ...fe,
144
- ...ce,
145
- ...I,
146
- ...de,
147
- ...M,
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 D(t) {
172
- return Array.isArray(t) ? t.filter((r) => m.isString(r)).reduce((r, e) => r.length > 0 ? 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 ye(t, r) {
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 = K(t), {
186
- error: n,
187
- valid: s,
188
- hint: i,
189
- loading: p
187
+ const u = q(t), {
188
+ error: s,
189
+ valid: o,
190
+ hint: c,
191
+ loading: m
190
192
  } = r, {
191
- hintLabel: o,
192
- modelValue: g,
193
- valid: b,
194
- validLabel: l,
195
- error: h,
196
- errorLabel: a
197
- } = u, d = m.resolveFieldData(u, "loading"), y = m.resolveFieldData(
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
- ), V = S(() => h.value ? !!(h.value && n || (a == null ? void 0 : a.value) && Array.isArray(a.value) && a.value.length > 0 || (a == null ? void 0 : a.value) && m.isNotEmpty(a.value)) : !1), k = S(() => !!(o && o.value || i || s || l && l.value || V.value || (d == null ? void 0 : d.value) && p || (d == null ? void 0 : d.value) && (y == null ? void 0 : y.value))), _ = S(() => {
201
- const O = se({
202
- hintLabel: o,
203
- modelValue: g,
204
- valid: b,
205
- validLabel: l,
206
- error: h,
207
- errorLabel: a,
208
- loading: d,
209
- loadingLabel: y,
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 h != null && h.value ? (n == null ? void 0 : n(O)) || D(a == null ? void 0 : a.value) || (o == null ? void 0 : o.value) : b != null && b.value ? (s == null ? void 0 : s(O)) || D(l == null ? void 0 : l.value) || (o == null ? void 0 : o.value) : d != null && d.value ? (p == null ? void 0 : p(O)) || D(y == null ? void 0 : y.value) || (o == null ? void 0 : o.value) : (i == null ? void 0 : i(O)) || D(o == null ? void 0 : o.value) || (o == null ? void 0 : o.value);
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: k,
216
- hintContent: _
217
+ hasHint: $,
218
+ hintContent: f
217
219
  };
218
220
  },
219
221
  render() {
220
222
  if (this.hasHint)
221
- return W(
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 Z(t, r) {
231
+ function x(t, r) {
230
232
  const e = { [`${t}`]: !0 };
231
233
  return {
232
- bemCssClasses: S(() => Object.keys(r).reduce((n, s) => {
233
- const i = v(r[s]) || !1;
234
- if (!i)
235
- return n;
236
- if (s === "modifiers") {
237
- const p = Array.isArray(i) ? i : [i];
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
- ...n,
240
- ...p.reduce(
241
- (o, g) => ({
242
- ...o,
243
- [`${t}--${m.kebabCase(
244
- g
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
- ...n,
253
- [`${t}--${m.kebabCase(s)}`]: i
254
+ ...s,
255
+ [`${t}--${V.kebabCase(o)}`]: c
254
256
  };
255
257
  }, e) || {})
256
258
  };
257
259
  }
258
- const me = {
259
- ...I,
260
- ...M,
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
- }, ge = { key: 0 }, he = ["for"], ve = ["id", "type", "value", "checked", "disabled"], be = /* @__PURE__ */ q({
274
+ }, we = { key: 0 }, Oe = ["for"], je = ["id", "type", "value", "checked", "disabled"], Ce = /* @__PURE__ */ T({
273
275
  __name: "VvDropdown",
274
- props: me,
276
+ props: Ae,
275
277
  emits: ["update:modelValue"],
276
278
  setup(t, { emit: r }) {
277
- const e = t, u = H(), { modifiers: n, disabled: s } = K(e), { bemCssClasses: i } = Z("vv-dropdown", {
278
- modifiers: n,
279
- disabled: s
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 p(l) {
282
- return Array.isArray(e.modelValue) ? m.contains(l, e.modelValue) || m.contains(o(l), e.modelValue) : m.equals(l, e.modelValue) || m.equals(o(l), 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 o(l) {
285
- return typeof l == "string" ? l : String(l[e.valueKey]);
286
+ function a(n) {
287
+ return typeof n == "string" ? n : String(n[e.valueKey]);
286
288
  }
287
- function g(l) {
288
- return typeof l == "string" ? l : l[e.labelKey];
289
+ function h(n) {
290
+ return typeof n == "string" ? n : n[e.labelKey];
289
291
  }
290
- function b(l) {
291
- var y, V;
292
- const h = l.target;
293
- let a = h.value;
294
- if (a = (e.useObject ? (y = e.options) == null ? void 0 : y.find(
295
- (k) => k[e.valueKey] == a
296
- ) : null) || a, e.multiple) {
297
- if (typeof e.maxValues < "u" && e.maxValues >= 0 && ((V = e.modelValue) == null ? void 0 : V.length) >= e.maxValues && (Array.isArray(e.modelValue) && !m.contains(a, e.modelValue) || e.maxValues == 0)) {
298
- h.checked = !1;
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) ? a = m.contains(a, e.modelValue) ? m.removeFromList(a, e.modelValue) : [...e.modelValue, a] : a = [a];
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", a);
305
+ r("update:modelValue", l);
304
306
  }
305
- return (l, h) => {
306
- var a;
307
- return j(), C("ul", {
308
- class: F(v(i)),
307
+ return (n, v) => {
308
+ var l;
309
+ return S(), A("ul", {
310
+ class: z(d(c)),
309
311
  role: "listbox"
310
312
  }, [
311
- (a = l.options) != null && a.length ? x("", !0) : (j(), C("li", ge, [
312
- B("label", null, N(l.labelNoResult), 1)
313
+ (l = n.options) != null && l.length ? _("", !0) : (S(), A("li", we, [
314
+ B("label", null, E(n.labelNoResult), 1)
313
315
  ])),
314
- (j(!0), C(R, null, X(l.options, (d, y) => {
315
- var V;
316
- return j(), C("li", { key: y }, [
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-${y}-${v(u)}`
320
+ for: `dropdown-${b}-${d(u)}`
319
321
  }, [
320
322
  B("input", {
321
- id: `dropdown-${y}-${v(u)}`,
322
- type: l.multiple ? "checkbox" : "radio",
323
- value: o(d),
324
- checked: p(d),
325
- disabled: typeof d == "object" ? (V = d.disabled) != null ? V : v(s) : v(s),
326
- onInput: b
327
- }, null, 40, ve),
328
- T(" " + N(g(d)), 1)
329
- ], 8, he)
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
- }), Ve = ["id"], Ae = {
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
- }, Se = ["placeholder"], ke = /* @__PURE__ */ q({
523
+ }, Re = ["placeholder"], Le = /* @__PURE__ */ T({
339
524
  __name: "VvSelect",
340
- props: pe,
525
+ props: Ve,
341
526
  emits: ["update:modelValue", "change:search"],
342
527
  setup(t, { emit: r }) {
343
- const e = t, u = Y(), n = ye(e, u), s = E(), i = E();
344
- le(i, { initialValue: !0 });
345
- const p = H(), o = E(""), g = oe(
346
- o,
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
- ), b = E(!1), {
349
- modifiers: l,
350
- disabled: h,
351
- readonly: a,
352
- loading: d,
353
- iconLeft: y,
354
- iconRight: V,
355
- valid: k,
356
- error: _
357
- } = K(e);
358
- ee(
359
- g,
360
- () => r("change:search", g.value)
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: O } = Z("vv-select", {
363
- modifiers: l,
364
- disabled: h,
365
- loading: d,
366
- readonly: a,
367
- iconLeft: y,
368
- iconRight: V,
369
- valid: k,
370
- invalid: _,
371
- dirty: S(() => m.isNotEmpty(e.modelValue))
372
- }), z = S(
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 c;
375
- return (c = e.options) == null ? void 0 : c.every((f) => typeof f == "object");
559
+ var p;
560
+ return (p = e.options) == null ? void 0 : p.every((g) => typeof g == "object");
376
561
  }
377
- ), U = S(
378
- () => e.searchable ? L.value : e.options
379
- ), L = S(() => {
380
- var c;
381
- return (c = e.options) == null ? void 0 : c.filter((f) => typeof f == "string" ? f.toLowerCase().includes(g.value.toLowerCase().trim()) : f[e.labelKey].toLowerCase().includes(g.value.toLowerCase().trim()));
382
- }), G = S(() => {
383
- var f, A;
384
- if (e.multiple && ((f = e.modelValue) == null ? void 0 : f.length) && Array.isArray(e.modelValue))
385
- return z.value ? m.filterArray(
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((w) => w[e.labelKey]).join(e.separator) : e.modelValue.join(e.separator);
390
- const c = e.useObject ? e.modelValue : (A = e.options) == null ? void 0 : A.find(
391
- (w) => typeof w == "object" ? w[e.valueKey] == e.modelValue : w == e.modelValue
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 c == "object" ? c == null ? void 0 : c[e.labelKey] : c;
578
+ return typeof p == "object" ? p == null ? void 0 : p[e.labelKey] : p;
394
579
  });
395
- ae(s, () => {
396
- s.value.open = !1;
580
+ he(o, () => {
581
+ o.value.open = !1;
397
582
  });
398
- function J(c) {
399
- const f = c.target;
400
- b.value = f.open;
583
+ function ie(p) {
584
+ const g = p.target;
585
+ i.value = g.open;
401
586
  }
402
- function Q(c) {
403
- s.value && !e.multiple && (s.value.open = !1), r("update:modelValue", c);
587
+ function ue(p) {
588
+ o.value && !e.multiple && (o.value.open = !1), r("update:modelValue", p);
404
589
  }
405
- return (c, f) => (j(), C("div", {
406
- id: v(p),
407
- class: F(v(O))
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
- c.label ? (j(), C("label", Ae, N(c.label), 1)) : x("", !0),
597
+ p.label ? (S(), A("label", qe, E(p.label), 1)) : _("", !0),
410
598
  B("details", {
411
599
  ref_key: "dropdown",
412
- ref: s,
600
+ ref: o,
413
601
  role: "list",
414
602
  class: "vv-select__wrapper",
415
- onClick: f[2] || (f[2] = (A) => v(h) || v(a) ? A.preventDefault() : null),
416
- onKeyup: f[3] || (f[3] = P((A) => s.value.open = !1, ["esc"])),
417
- onToggle: J
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: f[1] || (f[1] = P((A) => c.searchable ? A.preventDefault() : null, ["space"]))
610
+ onKeyup: g[1] || (g[1] = Q((j) => p.searchable ? j.preventDefault() : null, ["space"]))
423
611
  }, [
424
- c.searchable && b.value ? te((j(), C("input", {
612
+ p.searchable && i.value ? pe((S(), A("input", {
425
613
  key: 0,
426
614
  ref_key: "inputSearch",
427
- ref: i,
428
- "onUpdate:modelValue": f[0] || (f[0] = (A) => o.value = A),
429
- placeholder: c.searchPlaceholder
430
- }, null, 8, Se)), [
431
- [re, o.value]
432
- ]) : (j(), C(R, { key: 1 }, [
433
- T(N(v(G) || c.placeholder), 1)
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
- $(be, ne({
624
+ M(Ce, L({
437
625
  ...e,
438
- options: v(U)
439
- }, { "onUpdate:modelValue": Q }), null, 16)
626
+ options: d(k)
627
+ }, { "onUpdate:modelValue": ue }), null, 16)
440
628
  ], 544),
441
- $(v(n), { class: "vv-select__hint" })
442
- ], 10, Ve));
629
+ M(d(s), { class: "vv-select__hint" })
630
+ ], 10, Fe));
443
631
  }
444
632
  });
445
633
  export {
446
- ke as default
634
+ Le as default
447
635
  };