@volverjs/ui-vue 0.0.1-beta.5 → 0.0.1-beta.8

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 (82) hide show
  1. package/README.md +61 -2
  2. package/dist/components/VvButton/vv-button.es.js +56 -58
  3. package/dist/components/VvButton/vv-button.umd.js +1 -1
  4. package/dist/components/VvCheckGroup/vv-check-group.es.js +221 -203
  5. package/dist/components/VvCheckGroup/vv-check-group.umd.js +2 -2
  6. package/dist/components/VvInputText/VvInputText.d.ts +14 -0
  7. package/dist/components/VvInputText/VvInputText.vue.d.ts +36 -1
  8. package/dist/components/VvInputText/VvInputTextActions.d.ts +3 -0
  9. package/dist/components/VvInputText/vv-input-text.es.js +509 -380
  10. package/dist/components/VvInputText/vv-input-text.umd.js +2 -2
  11. package/dist/components/VvNativeSelect/vv-native-select.es.js +180 -161
  12. package/dist/components/VvNativeSelect/vv-native-select.umd.js +2 -2
  13. package/dist/components/VvRadioGroup/vv-radio-group.es.js +211 -193
  14. package/dist/components/VvRadioGroup/vv-radio-group.umd.js +2 -2
  15. package/dist/components/VvSelect/vv-select.es.js +189 -171
  16. package/dist/components/VvSelect/vv-select.umd.js +2 -2
  17. package/dist/components/VvTextarea/VvTextarea.d.ts +43 -22
  18. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +140 -85
  19. package/dist/components/VvTextarea/vv-textarea.es.js +364 -288
  20. package/dist/components/VvTextarea/vv-textarea.umd.js +2 -2
  21. package/dist/composables/debouncedInput/useDebouncedInput.d.ts +2 -0
  22. package/dist/composables/icons/useComponentIcons.d.ts +6 -0
  23. package/dist/composables/textLimit/useTextLimit.d.ts +14 -0
  24. package/dist/composables/useModifiers.d.ts +3 -2
  25. package/dist/icons.es.js +3 -3
  26. package/dist/icons.umd.js +1 -1
  27. package/dist/props/index.d.ts +42 -0
  28. package/dist/stories/utils.d.ts +5 -0
  29. package/dist/ui-vue.es.js +417 -401
  30. package/dist/ui-vue.umd.js +2 -2
  31. package/package.json +3 -1
  32. package/src/assets/icons/detailed.json +1 -1
  33. package/src/assets/icons/normal.json +1 -1
  34. package/src/assets/icons/simple.json +1 -1
  35. package/src/components/VvButton/VvButton.vue +1 -2
  36. package/src/components/VvInputText/VvInputText.ts +19 -2
  37. package/src/components/VvInputText/VvInputText.vue +123 -149
  38. package/src/components/VvInputText/VvInputTextActions.ts +151 -0
  39. package/src/components/VvTextarea/VvTextarea.ts +25 -16
  40. package/src/components/VvTextarea/VvTextarea.vue +89 -93
  41. package/src/components/common/HintSlot.ts +31 -13
  42. package/src/composables/debouncedInput/useDebouncedInput.ts +19 -0
  43. package/src/composables/icons/useComponentIcons.ts +35 -0
  44. package/src/composables/textLimit/useTextLimit.ts +44 -0
  45. package/src/composables/useModifiers.ts +47 -1
  46. package/src/props/index.ts +39 -0
  47. package/src/stories/InputText/InputTextMaxLength.stories.mdx +21 -0
  48. package/src/stories/Textarea/Textarea.stories.mdx +33 -51
  49. package/src/stories/Textarea/TextareaAutoclear.stories.mdx +23 -0
  50. package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +10 -2
  51. package/src/stories/Textarea/TextareaAutofocus.stories.mdx +5 -1
  52. package/src/stories/Textarea/TextareaDebounce.stories.mdx +23 -0
  53. package/src/stories/Textarea/TextareaDisabled.stories.mdx +5 -1
  54. package/src/stories/Textarea/TextareaError.stories.mdx +6 -3
  55. package/src/stories/Textarea/TextareaErrorLabel.stories.mdx +37 -0
  56. package/src/stories/Textarea/TextareaFloating.stories.mdx +7 -2
  57. package/src/stories/Textarea/TextareaHintLabel.stories.mdx +5 -1
  58. package/src/stories/Textarea/TextareaIcon.stories.mdx +5 -1
  59. package/src/stories/Textarea/TextareaIconPosition.stories.mdx +9 -1
  60. package/src/stories/Textarea/TextareaId.stories.mdx +19 -0
  61. package/src/stories/Textarea/TextareaLabel.stories.mdx +5 -1
  62. package/src/stories/Textarea/TextareaLimit.stories.mdx +50 -0
  63. package/src/stories/Textarea/TextareaLoading.stories.mdx +6 -3
  64. package/src/stories/Textarea/TextareaLoadingLabel.stories.mdx +23 -0
  65. package/src/stories/Textarea/TextareaMaxLength.stories.mdx +6 -2
  66. package/src/stories/Textarea/TextareaMinLength.stories.mdx +5 -1
  67. package/src/stories/Textarea/TextareaModifiers.stories.mdx +24 -0
  68. package/src/stories/Textarea/TextareaName.stories.mdx +23 -0
  69. package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +5 -1
  70. package/src/stories/Textarea/TextareaReadonly.stories.mdx +5 -1
  71. package/src/stories/Textarea/TextareaRequired.stories.mdx +22 -0
  72. package/src/stories/Textarea/TextareaResizable.stories.mdx +22 -0
  73. package/src/stories/Textarea/TextareaRowsCols.stories.mdx +9 -1
  74. package/src/stories/Textarea/TextareaValid.stories.mdx +7 -4
  75. package/src/stories/Textarea/TextareaValidLabel.stories.mdx +35 -0
  76. package/src/stories/stories.scss +11 -0
  77. package/src/stories/utils.ts +12 -0
  78. package/src/stories/volver-ui-vue.stories.mdx +7 -1
  79. package/dist/components/VvInputText/useInputNumber.d.ts +0 -16
  80. package/dist/components/VvInputText/useInputPassword.d.ts +0 -16
  81. package/src/components/VvInputText/useInputNumber.ts +0 -40
  82. package/src/components/VvInputText/useInputPassword.ts +0 -38
@@ -1,85 +1,85 @@
1
- import { isRef as z, provide as Z, computed as f, toRefs as B, unref as k, inject as T, toRef as U, watch as K, defineComponent as I, useAttrs as M, ref as W, openBlock as _, createElementBlock as E, mergeProps as j, createElementVNode as P, renderSlot as q, createTextVNode as J, toDisplayString as w, h as Q, useSlots as X, normalizeClass as Y, createCommentVNode as L, Fragment as ee, renderList as te, createBlock as ne, createVNode as re } from "vue";
2
- import { useFocus as se, useVModel as ue } from "@vueuse/core";
1
+ import { isRef as Z, provide as M, computed as v, toRefs as S, unref as k, inject as T, toRef as U, watch as K, defineComponent as P, useAttrs as W, ref as J, openBlock as _, createElementBlock as B, mergeProps as F, createElementVNode as w, renderSlot as R, createTextVNode as L, toDisplayString as q, h as Q, useSlots as X, normalizeClass as Y, createCommentVNode as ee, Fragment as te, renderList as re, createBlock as ne, createVNode as se } from "vue";
2
+ import { useFocus as ue, toReactive as oe, useVModel as le } from "@vueuse/core";
3
3
  const G = {
4
4
  valid: Boolean,
5
5
  validLabel: [String, Array]
6
- }, R = {
6
+ }, $ = {
7
7
  error: Boolean,
8
8
  errorLabel: [String, Array]
9
- }, le = {
9
+ }, ae = {
10
10
  hintLabel: { type: String, default: "" }
11
- }, oe = {
11
+ }, ie = {
12
12
  options: { type: Array, default: () => [] },
13
13
  optionLabel: { type: [String, Function], default: () => "label" },
14
14
  optionValue: { type: [String, Function], default: () => "value" }
15
- }, ae = {
15
+ }, ce = {
16
16
  ...G,
17
- ...R,
18
- ...le,
19
- ...oe,
17
+ ...$,
18
+ ...ae,
19
+ ...ie,
20
20
  modelValue: { type: Array },
21
21
  label: { type: String, default: "" },
22
22
  name: { type: String, default: "", required: !0 },
23
23
  disabled: { type: Boolean, default: !1 },
24
24
  readonly: { type: Boolean, default: !1 },
25
25
  vertical: { type: Boolean, default: !1 }
26
- }, ie = ["update:modelValue", "change"], $ = Symbol("VV_CHECK_GROUP");
27
- function ce(e) {
26
+ }, fe = ["update:modelValue", "change"], x = Symbol("VV_CHECK_GROUP");
27
+ function pe(e) {
28
28
  if (Object.keys(e).some(
29
- (t) => t !== "key" && !z(e[t])
29
+ (t) => t !== "key" && !Z(e[t])
30
30
  ))
31
31
  throw Error("One or more groupState props aren't ref.");
32
- console.log("PRovide - ", e), Z(
32
+ console.log("PRovide - ", e), M(
33
33
  e.key,
34
- f(() => e)
34
+ v(() => e)
35
35
  );
36
36
  }
37
- function fe(e) {
38
- const { options: t, optionLabel: n, optionValue: s } = B(e);
37
+ function de(e) {
38
+ const { options: t, optionLabel: r, optionValue: s } = S(e);
39
39
  return {
40
40
  options: t,
41
- getOptionLabel: (u) => typeof u != "object" && u !== null ? u : typeof n.value == "function" ? n.value(u) : u[n.value],
41
+ getOptionLabel: (u) => typeof u != "object" && u !== null ? u : typeof r.value == "function" ? r.value(u) : u[r.value],
42
42
  getOptionValue: (u) => typeof u != "object" && u !== null ? u : typeof s.value == "function" ? s.value(u) : u[s.value]
43
43
  };
44
44
  }
45
- const y = {
46
- equals(e, t, n) {
47
- return n ? this.resolveFieldData(e, n) === this.resolveFieldData(t, n) : this.deepEquals(e, t);
45
+ const m = {
46
+ equals(e, t, r) {
47
+ return r ? this.resolveFieldData(e, r) === this.resolveFieldData(t, r) : this.deepEquals(e, t);
48
48
  },
49
49
  deepEquals(e, t) {
50
50
  if (e === t)
51
51
  return !0;
52
52
  if (e && t && typeof e == "object" && typeof t == "object") {
53
- const n = Array.isArray(e), s = Array.isArray(t);
54
- let r, o, u;
55
- if (n && s) {
56
- if (o = e.length, o != t.length)
53
+ const r = Array.isArray(e), s = Array.isArray(t);
54
+ let n, l, u;
55
+ if (r && s) {
56
+ if (l = e.length, l != t.length)
57
57
  return !1;
58
- for (r = o; r-- !== 0; )
59
- if (!this.deepEquals(e[r], t[r]))
58
+ for (n = l; n-- !== 0; )
59
+ if (!this.deepEquals(e[n], t[n]))
60
60
  return !1;
61
61
  return !0;
62
62
  }
63
- if (n != s)
63
+ if (r != s)
64
64
  return !1;
65
- const l = e instanceof Date, c = t instanceof Date;
66
- if (l != c)
65
+ const a = e instanceof Date, o = t instanceof Date;
66
+ if (a != o)
67
67
  return !1;
68
- if (l && c)
68
+ if (a && o)
69
69
  return e.getTime() == t.getTime();
70
- const i = e instanceof RegExp, d = t instanceof RegExp;
71
- if (i != d)
70
+ const i = e instanceof RegExp, y = t instanceof RegExp;
71
+ if (i != y)
72
72
  return !1;
73
- if (i && d)
73
+ if (i && y)
74
74
  return e.toString() == t.toString();
75
75
  const p = Object.keys(e);
76
- if (o = p.length, o !== Object.keys(t).length)
76
+ if (l = p.length, l !== Object.keys(t).length)
77
77
  return !1;
78
- for (r = o; r-- !== 0; )
79
- if (!Object.prototype.hasOwnProperty.call(t, p[r]))
78
+ for (n = l; n-- !== 0; )
79
+ if (!Object.prototype.hasOwnProperty.call(t, p[n]))
80
80
  return !1;
81
- for (r = o; r-- !== 0; )
82
- if (u = p[r], !this.deepEquals(e[u], t[u]))
81
+ for (n = l; n-- !== 0; )
82
+ if (u = p[n], !this.deepEquals(e[u], t[u]))
83
83
  return !1;
84
84
  return !0;
85
85
  }
@@ -90,12 +90,12 @@ const y = {
90
90
  if (t.indexOf(".") === -1)
91
91
  return e[t];
92
92
  {
93
- const n = t.split(".");
93
+ const r = t.split(".");
94
94
  let s = e;
95
- for (let r = 0, o = n.length; r < o; ++r) {
95
+ for (let n = 0, l = r.length; n < l; ++n) {
96
96
  if (e == null)
97
97
  return null;
98
- s = s[n[r]];
98
+ s = s[r[n]];
99
99
  }
100
100
  return s;
101
101
  }
@@ -106,20 +106,20 @@ const y = {
106
106
  return !!(e && e.constructor && e.call && e.apply);
107
107
  },
108
108
  findIndexInList(e, t) {
109
- let n = -1;
109
+ let r = -1;
110
110
  if (t) {
111
111
  for (let s = 0; s < t.length; s++)
112
112
  if (this.equals(t[s], e)) {
113
- n = s;
113
+ r = s;
114
114
  break;
115
115
  }
116
116
  }
117
- return n;
117
+ return r;
118
118
  },
119
119
  contains(e, t) {
120
120
  if (e != null && t && t.length) {
121
- for (const n of t)
122
- if (this.equals(e, n))
121
+ for (const r of t)
122
+ if (this.equals(e, r))
123
123
  return !0;
124
124
  }
125
125
  return !1;
@@ -132,51 +132,51 @@ const y = {
132
132
  },
133
133
  pickBy(e, t) {
134
134
  return Object.fromEntries(
135
- Object.entries(e).filter(([n]) => t(n))
135
+ Object.entries(e).filter(([r]) => t(r))
136
136
  );
137
137
  },
138
138
  removeFromList(e, t) {
139
- const n = this.findIndexInList(e, t);
140
- return n > -1 ? t.filter((s, r) => r !== n) : t;
139
+ const r = this.findIndexInList(e, t);
140
+ return r > -1 ? t.filter((s, n) => n !== r) : t;
141
141
  },
142
142
  isString(e) {
143
143
  return typeof e == "string" || e instanceof String;
144
144
  },
145
145
  propsToObject(e) {
146
- return Object.keys(e).reduce((t, n) => {
147
- var s, r, o, u, l;
148
- return this.isFunction(e[n]) ? t[n] = e[n]() : Array.isArray(e[n]) ? t[n] = e[n][0]() : (s = e[n]) != null && s.type && (Array.isArray(e[n].type) ? t[n] = ((r = e[n]) == null ? void 0 : r.default) || ((o = e[n]) == null ? void 0 : o.type[0]()) : t[n] = ((u = e[n]) == null ? void 0 : u.default) || ((l = e[n]) == null ? void 0 : l.type())), t;
146
+ return Object.keys(e).reduce((t, r) => {
147
+ var s, n, l, u, a;
148
+ return this.isFunction(e[r]) ? t[r] = e[r]() : Array.isArray(e[r]) ? t[r] = e[r][0]() : (s = e[r]) != null && s.type && (Array.isArray(e[r].type) ? t[r] = ((n = e[r]) == null ? void 0 : n.default) || ((l = e[r]) == null ? void 0 : l.type[0]()) : t[r] = ((u = e[r]) == null ? void 0 : u.default) || ((a = e[r]) == null ? void 0 : a.type())), t;
149
149
  }, {});
150
150
  },
151
- filterArray(e, t, n) {
152
- return e.filter((s) => t.some((r) => typeof r == "string" ? s[n] == r : this.equals(
153
- s[n],
154
- r[n]
151
+ filterArray(e, t, r) {
152
+ return e.filter((s) => t.some((n) => typeof n == "string" ? s[r] == n : this.equals(
153
+ s[r],
154
+ n[r]
155
155
  )));
156
156
  },
157
157
  kebabCase(e) {
158
- var t, n;
158
+ var t, r;
159
159
  if (e)
160
- return (n = (t = e.match(
160
+ return (r = (t = e.match(
161
161
  /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
162
- )) == null ? void 0 : t.join("-")) == null ? void 0 : n.toLowerCase();
162
+ )) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
163
163
  }
164
164
  };
165
- function F(e, t) {
166
- const n = { [`${e}`]: !0 };
165
+ function I(e, t) {
166
+ const r = { [`${e}`]: !0 };
167
167
  return {
168
- bemCssClasses: f(() => Object.keys(t).reduce((r, o) => {
169
- const u = k(t[o]) || !1;
168
+ bemCssClasses: v(() => Object.keys(t).reduce((n, l) => {
169
+ const u = k(t[l]) || !1;
170
170
  if (!u)
171
- return r;
172
- if (o === "modifiers") {
173
- const l = Array.isArray(u) ? u : [u];
171
+ return n;
172
+ if (l === "modifiers") {
173
+ const a = Array.isArray(u) ? u : [u];
174
174
  return {
175
- ...r,
176
- ...l.reduce(
177
- (c, i) => ({
178
- ...c,
179
- [`${e}--${y.kebabCase(
175
+ ...n,
176
+ ...a.reduce(
177
+ (o, i) => ({
178
+ ...o,
179
+ [`${e}--${m.kebabCase(
180
180
  i
181
181
  )}`]: !0
182
182
  }),
@@ -185,15 +185,15 @@ function F(e, t) {
185
185
  };
186
186
  } else
187
187
  return {
188
- ...r,
189
- [`${e}--${y.kebabCase(o)}`]: u
188
+ ...n,
189
+ [`${e}--${m.kebabCase(l)}`]: u
190
190
  };
191
- }, n) || {})
191
+ }, r) || {})
192
192
  };
193
193
  }
194
- const de = {
194
+ const ve = {
195
195
  ...G,
196
- ...R,
196
+ ...$,
197
197
  value: null,
198
198
  modelValue: null,
199
199
  binary: Boolean,
@@ -203,232 +203,250 @@ const de = {
203
203
  label: String,
204
204
  disabled: Boolean,
205
205
  readonly: Boolean
206
- }, pe = [
206
+ }, ye = [
207
207
  "click",
208
208
  "update:modelValue",
209
209
  "change",
210
210
  "focus",
211
211
  "blur"
212
212
  ];
213
- function ve(e) {
213
+ function he(e) {
214
214
  const t = T(e, void 0);
215
215
  console.log("Inject - ", t);
216
- const n = f(() => y.isNotEmpty(t));
217
- function s(r, o, u) {
216
+ const r = v(() => m.isNotEmpty(t));
217
+ function s(n, l, u) {
218
218
  if (t != null && t.value) {
219
- const l = k(t.value)[r];
220
- return f({
219
+ const a = k(t.value)[n];
220
+ return v({
221
221
  get() {
222
- return l == null ? void 0 : l.value;
222
+ return a == null ? void 0 : a.value;
223
223
  },
224
- set(c) {
225
- l.value = c;
224
+ set(o) {
225
+ a.value = o;
226
226
  }
227
227
  });
228
228
  } else {
229
- const l = U(o, r);
230
- return f({
229
+ const a = U(l, n);
230
+ return v({
231
231
  get() {
232
- return l.value;
232
+ return a.value;
233
233
  },
234
- set(c) {
235
- u && u(`update:${r}`, c);
234
+ set(o) {
235
+ u && u(`update:${n}`, o);
236
236
  }
237
237
  });
238
238
  }
239
239
  }
240
240
  return {
241
241
  group: t,
242
- isInGroup: n,
242
+ isInGroup: r,
243
243
  getGroupOrLocalRef: s
244
244
  };
245
245
  }
246
- function ye(e, t) {
247
- const { group: n, isInGroup: s, getGroupOrLocalRef: r } = ve($), { valid: o, error: u, switch: l } = B(e), c = r("modelValue", e, t), i = r("readonly", e), d = r("disabled", e);
246
+ function me(e, t) {
247
+ const { group: r, isInGroup: s, getGroupOrLocalRef: n } = he(x), { valid: l, error: u, switch: a } = S(e), o = n("modelValue", e, t), i = n("readonly", e), y = n("disabled", e);
248
248
  return {
249
- group: n,
249
+ group: r,
250
250
  isInGroup: s,
251
- valid: o,
251
+ valid: l,
252
252
  error: u,
253
- propsSwitch: l,
254
- modelValue: c,
253
+ propsSwitch: a,
254
+ modelValue: o,
255
255
  readonly: i,
256
- disabled: d
256
+ disabled: y
257
257
  };
258
258
  }
259
- function he(e, t) {
260
- const { focused: n } = se(e);
261
- return K(n, (s) => {
259
+ function ge(e, t) {
260
+ const { focused: r } = ue(e);
261
+ return K(r, (s) => {
262
262
  t(s ? "focus" : "blur", e.value);
263
263
  }), {
264
- focused: n
264
+ focused: r
265
265
  };
266
266
  }
267
- const me = {
267
+ const ke = {
268
268
  inheritAttrs: !1
269
- }, ge = /* @__PURE__ */ I({
270
- ...me,
269
+ }, Ce = /* @__PURE__ */ P({
270
+ ...ke,
271
271
  __name: "VvCheck",
272
- props: de,
273
- emits: pe,
272
+ props: ve,
273
+ emits: ye,
274
274
  setup(e, { emit: t }) {
275
- const n = e, s = M(), { disabled: r, readonly: o, valid: u, error: l, propsSwitch: c, modelValue: i } = ye(n, t), d = W(), { focused: p } = he(d, t), a = f(() => n.binary ? y.equals(i.value, n.trueValue) : Array.isArray(i.value) ? y.contains(n.value, i.value) : y.equals(n.value, i.value)), { bemCssClasses: v } = F("vv-input-checkbox", {
276
- switch: c,
275
+ const r = e, s = W(), { disabled: n, readonly: l, valid: u, error: a, propsSwitch: o, modelValue: i } = me(r, t), y = J(), { focused: p } = ge(y, t), d = v(() => r.binary ? m.equals(i.value, r.trueValue) : Array.isArray(i.value) ? m.contains(r.value, i.value) : m.equals(r.value, i.value)), { bemCssClasses: f } = I("vv-input-checkbox", {
276
+ switch: o,
277
277
  valid: u,
278
- invalid: l
279
- }), { bemCssClasses: g } = F(
278
+ invalid: a
279
+ }), { bemCssClasses: h } = I(
280
280
  "vv-input-check__input",
281
281
  {
282
- checked: a,
283
- disabled: r,
284
- readonly: o
282
+ checked: d,
283
+ disabled: n,
284
+ readonly: l
285
285
  }
286
- ), h = f(() => ({
286
+ ), c = v(() => ({
287
287
  [s.class]: !0,
288
- ...v.value
289
- })), V = f(() => ({
290
- ...g.value,
288
+ ...f.value
289
+ })), A = v(() => ({
290
+ ...h.value,
291
291
  "focus-visible": p.value
292
- })), C = f(() => {
293
- const { id: m, name: A, style: S } = s, H = y.pickBy(
292
+ })), O = v(() => {
293
+ const { id: g, name: C, style: j } = s, N = m.pickBy(
294
294
  s,
295
- (N) => N.startsWith("data-")
295
+ (z) => z.startsWith("data-")
296
296
  );
297
297
  return {
298
- for: m || A,
299
- style: S,
300
- ...H
298
+ for: g || C,
299
+ style: j,
300
+ ...N
301
301
  };
302
- }), b = f(() => {
303
- const { id: m = "", name: A = "" } = s;
302
+ }), b = v(() => {
303
+ const { id: g = "", name: C = "" } = s;
304
304
  return {
305
305
  type: "checkbox",
306
- id: m || A,
307
- name: A,
308
- value: n.value,
309
- disabled: r.value,
310
- readonly: o.value,
311
- checked: a.value,
312
- ...O.value
306
+ id: g || C,
307
+ name: C,
308
+ value: r.value,
309
+ disabled: n.value,
310
+ readonly: l.value,
311
+ checked: d.value,
312
+ ...V.value
313
313
  };
314
- }), O = f(() => {
315
- const { name: m } = s, A = y.pickBy(
314
+ }), V = v(() => {
315
+ const { name: g } = s, C = m.pickBy(
316
316
  s,
317
- (S) => S.startsWith("aria-")
317
+ (j) => j.startsWith("aria-")
318
318
  );
319
319
  return {
320
- "aria-label": m,
321
- "aria-checked": a.value,
322
- ...A
320
+ "aria-label": g,
321
+ "aria-checked": d.value,
322
+ ...C
323
323
  };
324
324
  });
325
- function x() {
326
- if (n.binary) {
327
- i.value = a.value ? n.falseValue : n.trueValue;
325
+ function D() {
326
+ if (r.binary) {
327
+ i.value = d.value ? r.falseValue : r.trueValue;
328
328
  return;
329
329
  }
330
330
  if (i.value === null) {
331
- i.value = [n.value];
331
+ i.value = [r.value];
332
332
  return;
333
333
  }
334
334
  if (Array.isArray(i.value)) {
335
- i.value = a.value ? y.removeFromList(n.value, i.value) : [...i.value, n.value];
335
+ i.value = d.value ? m.removeFromList(r.value, i.value) : [...i.value, r.value];
336
336
  return;
337
337
  }
338
338
  console.warn("Cannot change value - VvCheck modelValue is not an array");
339
339
  }
340
- function D(m) {
341
- r.value || (t("click", m), t("change", a.value ? n.value : null), p.value = !0);
340
+ function H(g) {
341
+ n.value || (t("click", g), t("change", d.value ? r.value : null), p.value = !0);
342
342
  }
343
- return (m, A) => (_(), E("label", j({ class: k(h) }, k(C), { onClick: D }), [
344
- P("input", j({
343
+ return (g, C) => (_(), B("label", F({ class: k(c) }, k(O), { onClick: H }), [
344
+ w("input", F({
345
345
  ref_key: "input",
346
- ref: d,
347
- class: k(V)
348
- }, k(b), { onInput: x }), null, 16),
349
- q(m.$slots, "default", { value: k(i) }, () => [
350
- J(w(m.label), 1)
346
+ ref: y,
347
+ class: k(A)
348
+ }, k(b), { onInput: D }), null, 16),
349
+ R(g.$slots, "default", { value: k(i) }, () => [
350
+ L(q(g.label), 1)
351
351
  ])
352
352
  ], 16));
353
353
  }
354
354
  });
355
- function ke(e) {
356
- return Array.isArray(e) ? e.filter((t) => y.isString(t)).reduce((t, n) => t.length > 0 ? t + `
357
- ` + n : n, "") : e;
355
+ function E(e) {
356
+ return Array.isArray(e) ? e.filter((t) => m.isString(t)).reduce((t, r) => t.length > 0 ? t + `
357
+ ` + r : r, "") : e;
358
358
  }
359
- function Ce(e, t) {
359
+ function Ae(e, t) {
360
360
  return {
361
361
  name: "HintSlot",
362
- setup() {
363
- const n = B(e), {
364
- error: s,
365
- valid: r,
366
- hint: o,
367
- loading: u
362
+ props: {
363
+ params: { type: Object, default: () => {
364
+ } }
365
+ },
366
+ setup(r) {
367
+ const s = S(e), {
368
+ error: n,
369
+ valid: l,
370
+ hint: u,
371
+ loading: a
368
372
  } = t, {
369
- hintLabel: l,
370
- modelValue: c,
371
- valid: i,
372
- validLabel: d,
373
- error: p,
374
- errorLabel: a
375
- } = n, v = y.resolveFieldData(n, "loading"), g = y.resolveFieldData(
376
- n,
373
+ hintLabel: o,
374
+ modelValue: i,
375
+ valid: y,
376
+ validLabel: p,
377
+ error: d,
378
+ errorLabel: f
379
+ } = s, h = m.resolveFieldData(s, "loading"), c = m.resolveFieldData(
380
+ s,
377
381
  "loadingLabel"
378
- ), h = f(() => p.value ? !!(p.value && s || (a == null ? void 0 : a.value) && Array.isArray(a.value) && a.value.length > 0 || (a == null ? void 0 : a.value) && y.isNotEmpty(a.value)) : !1), V = f(() => !!(l && l.value || o || r || d && d.value || h.value || (v == null ? void 0 : v.value) && u || (v == null ? void 0 : v.value) && (g == null ? void 0 : g.value))), C = f(() => Array.isArray(a == null ? void 0 : a.value) ? ke((a == null ? void 0 : a.value) || "") : a == null ? void 0 : a.value), b = f(() => {
379
- const O = { modelValue: c, error: p, valid: i };
380
- return p != null && p.value ? (s == null ? void 0 : s(O)) || (C == null ? void 0 : C.value) || (l == null ? void 0 : l.value) : i != null && i.value ? (r == null ? void 0 : r(O)) || (d == null ? void 0 : d.value) || (l == null ? void 0 : l.value) : v != null && v.value ? (u == null ? void 0 : u(O)) || (g == null ? void 0 : g.value) || (l == null ? void 0 : l.value) : (o == null ? void 0 : o(O)) || (l == null ? void 0 : l.value) || (l == null ? void 0 : l.value);
382
+ ), A = v(() => d.value ? !!(d.value && n || (f == null ? void 0 : f.value) && Array.isArray(f.value) && f.value.length > 0 || (f == null ? void 0 : f.value) && m.isNotEmpty(f.value)) : !1), O = v(() => !!(o && o.value || u || l || p && p.value || A.value || (h == null ? void 0 : h.value) && a || (h == null ? void 0 : h.value) && (c == null ? void 0 : c.value))), b = v(() => {
383
+ const V = oe({
384
+ hintLabel: o,
385
+ modelValue: i,
386
+ valid: y,
387
+ validLabel: p,
388
+ error: d,
389
+ errorLabel: f,
390
+ loading: h,
391
+ loadingLabel: c,
392
+ ...r.params
393
+ });
394
+ return d != null && d.value ? (n == null ? void 0 : n(V)) || E(f == null ? void 0 : f.value) || (o == null ? void 0 : o.value) : y != null && y.value ? (l == null ? void 0 : l(V)) || E(p == null ? void 0 : p.value) || (o == null ? void 0 : o.value) : h != null && h.value ? (a == null ? void 0 : a(V)) || E(c == null ? void 0 : c.value) || (o == null ? void 0 : o.value) : (u == null ? void 0 : u(V)) || E(o == null ? void 0 : o.value) || (o == null ? void 0 : o.value);
381
395
  });
382
396
  return {
383
- hasHint: V,
397
+ hasHint: O,
384
398
  hintContent: b
385
399
  };
386
400
  },
387
401
  render() {
388
402
  if (this.hasHint)
389
- return Q("span", null, this.hintContent);
403
+ return Q(
404
+ "pre",
405
+ { style: { "white-space": "pre" } },
406
+ this.hintContent
407
+ );
390
408
  }
391
409
  };
392
410
  }
393
- const Ae = ["textContent"], Ve = { class: "vv-input-checkbox-group__wrapper" }, _e = /* @__PURE__ */ I({
411
+ const be = ["textContent"], Ve = { class: "vv-input-checkbox-group__wrapper" }, Ee = /* @__PURE__ */ P({
394
412
  __name: "VvCheckGroup",
395
- props: ae,
396
- emits: ie,
413
+ props: ce,
414
+ emits: fe,
397
415
  setup(e, { emit: t }) {
398
- const n = e, s = X(), r = ue(n, "modelValue", t), { disabled: o, readonly: u, error: l, valid: c } = B(n);
399
- ce({
400
- key: $,
401
- modelValue: r,
402
- disabled: o,
416
+ const r = e, s = X(), n = le(r, "modelValue", t), { disabled: l, readonly: u, error: a, valid: o } = S(r);
417
+ pe({
418
+ key: x,
419
+ modelValue: n,
420
+ disabled: l,
403
421
  readonly: u
404
422
  });
405
- const { getOptionLabel: d, getOptionValue: p } = fe(n), { bemCssClasses: a } = F(
423
+ const { getOptionLabel: y, getOptionValue: p } = de(r), { bemCssClasses: d } = I(
406
424
  "vv-input-checkbox-group",
407
425
  {
408
- horizontal: f(() => !n.vertical),
409
- valid: c,
410
- invalid: l
426
+ horizontal: v(() => !r.vertical),
427
+ valid: o,
428
+ invalid: a
411
429
  }
412
- ), v = (h, V) => ({
413
- id: `${n.name}_opt${V}`,
414
- name: n.name,
415
- label: d(h),
416
- value: p(h)
417
- }), g = Ce(n, s);
418
- return (h, V) => (_(), E("fieldset", {
419
- class: Y(k(a))
430
+ ), f = (c, A) => ({
431
+ id: `${r.name}_opt${A}`,
432
+ name: r.name,
433
+ label: y(c),
434
+ value: p(c)
435
+ }), h = Ae(r, s);
436
+ return (c, A) => (_(), B("fieldset", {
437
+ class: Y(k(d))
420
438
  }, [
421
- h.label ? (_(), E("legend", {
439
+ c.label ? (_(), B("legend", {
422
440
  key: 0,
423
- textContent: w(h.label)
424
- }, null, 8, Ae)) : L("", !0),
425
- P("div", Ve, [
426
- h.options.length > 0 ? (_(!0), E(ee, { key: 0 }, te(h.options, (C, b) => (_(), ne(ge, j({ key: b }, v(C, b)), null, 16))), 128)) : q(h.$slots, "default", { key: 1 })
441
+ textContent: q(c.label)
442
+ }, null, 8, be)) : ee("", !0),
443
+ w("div", Ve, [
444
+ c.options.length > 0 ? (_(!0), B(te, { key: 0 }, re(c.options, (O, b) => (_(), ne(Ce, F({ key: b }, f(O, b)), null, 16))), 128)) : R(c.$slots, "default", { key: 1 })
427
445
  ]),
428
- re(k(g), { class: "vv-input-checkbox-group__hint" })
446
+ se(k(h), { class: "vv-input-checkbox-group__hint" })
429
447
  ], 2));
430
448
  }
431
449
  });
432
450
  export {
433
- _e as default
451
+ Ee as default
434
452
  };