@volverjs/ui-vue 0.0.2 → 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.
Files changed (53) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvTextarea/VvTextarea.es.js +231 -275
  3. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  4. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  5. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  6. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  7. package/dist/components/VvTooltip/index.d.ts +18 -0
  8. package/dist/components/index.es.js +874 -874
  9. package/dist/components/index.umd.js +1 -1
  10. package/dist/icons.es.js +3 -3
  11. package/dist/icons.umd.js +1 -1
  12. package/dist/index.es.js +554 -554
  13. package/dist/index.umd.js +1 -1
  14. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  15. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  16. package/package.json +27 -20
  17. package/src/assets/icons/detailed.json +1 -1
  18. package/src/assets/icons/normal.json +1 -1
  19. package/src/assets/icons/simple.json +1 -1
  20. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  21. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  22. package/src/components/VvTooltip/index.ts +21 -0
  23. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  24. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  25. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  26. package/src/stories/Badge/Badge.stories.mdx +1 -1
  27. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  28. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  29. package/src/stories/Button/Button.stories.mdx +1 -1
  30. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  31. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  32. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  33. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  34. package/src/stories/Card/Card.stories.mdx +1 -1
  35. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  36. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  37. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  38. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  39. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  40. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  41. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  42. package/src/stories/Icon/Icon.stories.mdx +1 -1
  43. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  44. package/src/stories/InputText/InputText.stories.mdx +1 -1
  45. package/src/stories/Progress/Progress.stories.mdx +1 -1
  46. package/src/stories/Radio/Radio.stories.mdx +1 -1
  47. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  48. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  49. package/src/stories/Select/Select.stories.mdx +1 -1
  50. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  51. package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
  52. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  53. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
@@ -1,68 +1,68 @@
1
- import { unref as s, toRefs as j, computed as i, h as ie, watch as J, defineComponent as U, ref as W, inject as ue, openBlock as w, createBlock as R, mergeProps as k, createCommentVNode as C, useSlots as se, createElementBlock as D, normalizeClass as ce, toDisplayString as z, createElementVNode as M, renderSlot as O, normalizeProps as _, guardReactiveProps as E, withDirectives as de, isRef as fe, vModelText as ve, createTextVNode as me, createVNode as ge } from "vue";
2
- import { nanoid as he } from "nanoid";
3
- import { toReactive as pe, useFocus as ye, useElementVisibility as be } from "@vueuse/core";
4
- import { iconExists as B, Icon as Se, addIcon as we } from "@iconify/vue";
5
- function q(r, t) {
6
- if (r && Object.keys(r).length && t) {
1
+ import { unref as a, toRefs as G, computed as v, h as ne, defineComponent as K, ref as re, inject as se, openBlock as P, createBlock as T, mergeProps as k, createCommentVNode as C, createElementBlock as D, normalizeClass as ie, toDisplayString as H, createElementVNode as z, renderSlot as O, normalizeProps as _, guardReactiveProps as R, withDirectives as ae, isRef as le, vModelText as ue, createTextVNode as ce, createVNode as de } from "vue";
2
+ import { nanoid as pe } from "nanoid";
3
+ import { toReactive as fe } from "@vueuse/core";
4
+ import { iconExists as B, Icon as me, addIcon as ve } from "@iconify/vue";
5
+ function M(n, t) {
6
+ if (n && Object.keys(n).length && t) {
7
7
  if (t.indexOf(".") === -1)
8
- return r[t];
8
+ return n[t];
9
9
  {
10
10
  const e = t.split(".");
11
- let u = r;
12
- for (let l = 0, d = e.length; l < d; ++l) {
13
- if (r == null)
11
+ let c = n;
12
+ for (let i = 0, u = e.length; i < u; ++i) {
13
+ if (n == null)
14
14
  return null;
15
- u = u[e[l]];
15
+ c = c[e[i]];
16
16
  }
17
- return u;
17
+ return c;
18
18
  }
19
19
  } else
20
20
  return null;
21
21
  }
22
- function N(r) {
23
- return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(s(r));
22
+ function ge(n) {
23
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(a(n));
24
24
  }
25
- function Ie(r) {
26
- return typeof r == "string" || r instanceof String;
25
+ function he(n) {
26
+ return typeof n == "string" || n instanceof String;
27
27
  }
28
- function Z(r) {
28
+ function q(n) {
29
29
  var t, e;
30
- if (r)
31
- return (e = (t = r.match(
30
+ if (n)
31
+ return (e = (t = n.match(
32
32
  /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
33
33
  )) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
34
34
  }
35
- function A(r) {
36
- return Array.isArray(r) ? r.filter((t) => Ie(t)).join(" ") : r;
35
+ function A(n) {
36
+ return Array.isArray(n) ? n.filter((t) => he(t)).join(" ") : n;
37
37
  }
38
- function Pe(r, t) {
38
+ function ye(n, t) {
39
39
  const {
40
40
  invalid: e,
41
- valid: u,
42
- hint: l,
43
- loading: d
41
+ valid: c,
42
+ hint: i,
43
+ loading: u
44
44
  } = t, {
45
- hintLabel: a,
46
- modelValue: h,
47
- valid: m,
48
- validLabel: f,
49
- invalid: n,
50
- invalidLabel: o,
51
- ...g
52
- } = j(r), c = q(g, "loading"), v = q(g, "loadingLabel"), y = i(() => n.value ? !!(n.value && e || o != null && o.value && Array.isArray(o.value) && o.value.length > 0 || o != null && o.value && !N(o)) : !1), p = i(
53
- () => !!(a && a.value || l)
54
- ), b = i(
55
- () => !!(f && f.value || u)
56
- ), I = i(
57
- () => !!(c != null && c.value && d || c != null && c.value && (v != null && v.value))
58
- ), $ = i(
59
- () => p.value || b.value || y.value || I.value
45
+ hintLabel: r,
46
+ modelValue: g,
47
+ valid: f,
48
+ validLabel: d,
49
+ invalid: o,
50
+ invalidLabel: s,
51
+ ...m
52
+ } = G(n), l = M(m, "loading"), p = M(m, "loadingLabel"), y = v(() => o.value ? !!(o.value && e || s != null && s.value && Array.isArray(s.value) && s.value.length > 0 || s != null && s.value && !ge(s)) : !1), h = v(
53
+ () => !!(r && r.value || i)
54
+ ), b = v(
55
+ () => !!(d && d.value || c)
56
+ ), w = v(
57
+ () => !!(l != null && l.value && u || l != null && l.value && (p != null && p.value))
58
+ ), V = v(
59
+ () => h.value || b.value || y.value || w.value
60
60
  );
61
61
  return {
62
62
  hasInvalid: y,
63
- hasHint: p,
63
+ hasHint: h,
64
64
  hasValid: b,
65
- hasLoading: I,
65
+ hasLoading: w,
66
66
  HintSlot: {
67
67
  name: "HintSlot",
68
68
  props: {
@@ -72,30 +72,30 @@ function Pe(r, t) {
72
72
  }
73
73
  },
74
74
  setup(x) {
75
- const F = i(() => {
76
- const S = pe({
77
- hintLabel: a,
78
- modelValue: h,
79
- valid: m,
80
- validLabel: f,
81
- invalid: n,
82
- invalidLabel: o,
83
- loading: c,
84
- loadingLabel: v,
75
+ const N = v(() => {
76
+ const S = fe({
77
+ hintLabel: r,
78
+ modelValue: g,
79
+ valid: f,
80
+ validLabel: d,
81
+ invalid: o,
82
+ invalidLabel: s,
83
+ loading: l,
84
+ loadingLabel: p,
85
85
  ...x.params
86
86
  });
87
- return n != null && n.value ? (e == null ? void 0 : e(S)) || A(o == null ? void 0 : o.value) || (a == null ? void 0 : a.value) : m != null && m.value ? (u == null ? void 0 : u(S)) || A(f == null ? void 0 : f.value) || (a == null ? void 0 : a.value) : c != null && c.value ? (d == null ? void 0 : d(S)) || A(v == null ? void 0 : v.value) || (a == null ? void 0 : a.value) : (l == null ? void 0 : l(S)) || A(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
87
+ return o != null && o.value ? (e == null ? void 0 : e(S)) || A(s == null ? void 0 : s.value) || (r == null ? void 0 : r.value) : f != null && f.value ? (c == null ? void 0 : c(S)) || A(d == null ? void 0 : d.value) || (r == null ? void 0 : r.value) : l != null && l.value ? (u == null ? void 0 : u(S)) || A(p == null ? void 0 : p.value) || (r == null ? void 0 : r.value) : (i == null ? void 0 : i(S)) || A(r == null ? void 0 : r.value) || (r == null ? void 0 : r.value);
88
88
  });
89
89
  return {
90
- isVisible: $,
90
+ isVisible: V,
91
91
  hasInvalid: y,
92
92
  hasValid: b,
93
- hintContent: F
93
+ hintContent: N
94
94
  };
95
95
  },
96
96
  render() {
97
97
  if (this.isVisible)
98
- return ie(
98
+ return ne(
99
99
  "small",
100
100
  {
101
101
  role: this.hasInvalid || this.hasValid ? "alert" : void 0
@@ -106,79 +106,7 @@ function Pe(r, t) {
106
106
  }
107
107
  };
108
108
  }
109
- function Ce(r, t, e) {
110
- const u = i(
111
- () => !!(r != null && r.value && t.value === "left" || e != null && e.iconLeft)
112
- ), l = i(
113
- () => !!(r != null && r.value && t.value === "right" || e != null && e.iconRight)
114
- ), d = i(
115
- () => !!(r != null && r.value && t.value === "top" || e != null && e.iconTop)
116
- ), a = i(
117
- () => !!(r != null && r.value && t.value === "bottom" || e != null && e.iconBottom)
118
- );
119
- return {
120
- hasIcon: i(() => typeof (r == null ? void 0 : r.value) == "string" ? { name: r == null ? void 0 : r.value } : r == null ? void 0 : r.value),
121
- hasIconLeft: u,
122
- hasIconRight: l,
123
- hasIconTop: d,
124
- hasIconBottom: a
125
- };
126
- }
127
- function $e(r, t) {
128
- const { focused: e } = ye(r);
129
- return J(e, (u) => {
130
- t(u ? "focus" : "blur", s(r));
131
- }), {
132
- focused: e
133
- };
134
- }
135
- function xe(r, t, e = 0) {
136
- let u;
137
- return typeof e == "string" && (e = parseInt(e)), i({
138
- get: () => r == null ? void 0 : r.value,
139
- set: (l) => {
140
- u && clearTimeout(u), u = setTimeout(() => {
141
- t("update:modelValue", l);
142
- }, e);
143
- }
144
- });
145
- }
146
- function Ve(r, t) {
147
- const e = i(() => (s(r) ?? "").length), u = i(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && e.value < (t == null ? void 0 : t.lowerLimit) ? e.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && e.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - e.value : 0), l = i(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${e.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? u.value === 0 ? void 0 : u : e.value);
148
- return {
149
- length: e,
150
- gap: u,
151
- formatted: l
152
- };
153
- }
154
- function X(r, t) {
155
- const e = { [`${r}`]: !0 };
156
- return {
157
- bemCssClasses: i(() => Object.keys(t).reduce((l, d) => {
158
- const a = s(t[d]) || !1;
159
- if (!a)
160
- return l;
161
- if (d === "modifiers") {
162
- const h = Array.isArray(a) ? a : a.split(" ");
163
- return {
164
- ...l,
165
- ...h.reduce(
166
- (m, f) => ({
167
- ...m,
168
- [`${r}--${Z(f)}`]: !0
169
- }),
170
- {}
171
- )
172
- };
173
- } else
174
- return {
175
- ...l,
176
- [`${r}--${Z(d)}`]: a
177
- };
178
- }, e) || {})
179
- };
180
- }
181
- const _e = "ds", Be = {
109
+ const be = "ds", Se = {
182
110
  color: String,
183
111
  width: {
184
112
  type: [String, Number]
@@ -209,197 +137,225 @@ const _e = "ds", Be = {
209
137
  modifiers: {
210
138
  type: [String, Array]
211
139
  }
212
- }, Ae = {
140
+ };
141
+ function Pe(n, t) {
142
+ const e = { [`${n}`]: !0 };
143
+ return {
144
+ bemCssClasses: v(() => Object.keys(t).reduce((i, u) => {
145
+ const r = a(t[u]) || !1;
146
+ if (!r)
147
+ return i;
148
+ if (u === "modifiers") {
149
+ const g = Array.isArray(r) ? r : r.split(" ");
150
+ return {
151
+ ...i,
152
+ ...g.reduce(
153
+ (f, d) => ({
154
+ ...f,
155
+ [`${n}--${q(d)}`]: !0
156
+ }),
157
+ {}
158
+ )
159
+ };
160
+ } else
161
+ return {
162
+ ...i,
163
+ [`${n}--${q(u)}`]: r
164
+ };
165
+ }, e) || {})
166
+ };
167
+ }
168
+ const we = {
213
169
  name: "VvIcon"
214
- }, G = /* @__PURE__ */ U({
215
- ...Ae,
216
- props: Be,
217
- setup(r) {
218
- const t = r, e = W(!0), { modifiers: u } = j(t), l = ue(_e), { bemCssClasses: d } = X("vv-icon", {
219
- modifiers: u
220
- }), a = i(() => t.provider || (l == null ? void 0 : l.provider)), h = i(() => {
221
- const n = t.name ?? "", o = `@${a.value}:${t.prefix}:${t.name}`;
222
- return B(n) ? n : B(o) ? o : (l == null ? void 0 : l.iconsCollections.find((g) => {
223
- const c = `@${a.value}:${g.prefix}:${n}`;
224
- if (B(c))
225
- return c;
226
- })) || n;
170
+ }, L = /* @__PURE__ */ K({
171
+ ...we,
172
+ props: Se,
173
+ setup(n) {
174
+ const t = n, e = re(!0), { modifiers: c } = G(t), i = se(be), { bemCssClasses: u } = Pe("vv-icon", {
175
+ modifiers: c
176
+ }), r = v(() => t.provider || (i == null ? void 0 : i.provider)), g = v(() => {
177
+ const o = t.name ?? "", s = `@${r.value}:${t.prefix}:${t.name}`;
178
+ return B(o) ? o : B(s) ? s : (i == null ? void 0 : i.iconsCollections.find((m) => {
179
+ const l = `@${r.value}:${m.prefix}:${o}`;
180
+ if (B(l))
181
+ return l;
182
+ })) || o;
227
183
  });
228
- function m(n) {
229
- let o = null;
184
+ function f(o) {
185
+ let s = null;
230
186
  if (typeof window > "u") {
231
187
  const { JSDOM: y } = require("jsdom");
232
- o = new y().window;
188
+ s = new y().window;
233
189
  }
234
- return (o ? new o.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
190
+ return (s ? new s.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
235
191
  }
236
- function f(n) {
237
- const o = m(n), g = (o == null ? void 0 : o.innerHTML.trim()) || "";
238
- o && g && we(`@${a.value}:${t.prefix}:${t.name}`, {
239
- body: g,
240
- height: o.viewBox.baseVal.height,
241
- width: o.viewBox.baseVal.width
192
+ function d(o) {
193
+ const s = f(o), m = (s == null ? void 0 : s.innerHTML.trim()) || "";
194
+ s && m && ve(`@${r.value}:${t.prefix}:${t.name}`, {
195
+ body: m,
196
+ height: s.viewBox.baseVal.height,
197
+ width: s.viewBox.baseVal.width
242
198
  });
243
199
  }
244
- return l && (t.src && !B(`@${a.value}:${t.prefix}:${t.name}`) ? (e.value = !1, l.fetchIcon(t.src).then((n) => {
245
- n && (f(n), e.value = !0);
246
- }).catch((n) => {
247
- throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
248
- })) : t.svg && f(t.svg)), (n, o) => e.value ? (w(), R(s(Se), k({
200
+ return i && (t.src && !B(`@${r.value}:${t.prefix}:${t.name}`) ? (e.value = !1, i.fetchIcon(t.src).then((o) => {
201
+ o && (d(o), e.value = !0);
202
+ }).catch((o) => {
203
+ throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
204
+ })) : t.svg && d(t.svg)), (o, s) => e.value ? (P(), T(a(me), k({
249
205
  key: 0,
250
- class: s(d)
206
+ class: a(u)
251
207
  }, {
252
- inline: n.inline,
253
- width: n.width,
254
- height: n.height,
255
- horizontalFlip: n.horizontalFlip,
256
- verticalFlip: n.verticalFlip,
257
- flip: n.flip,
258
- rotate: n.rotate,
259
- color: n.color,
260
- onLoad: n.onLoad,
261
- icon: s(h)
208
+ inline: o.inline,
209
+ width: o.width,
210
+ height: o.height,
211
+ horizontalFlip: o.horizontalFlip,
212
+ verticalFlip: o.verticalFlip,
213
+ flip: o.flip,
214
+ rotate: o.rotate,
215
+ color: o.color,
216
+ onLoad: o.onLoad,
217
+ icon: a(g)
262
218
  }), null, 16, ["class"])) : C("", !0);
263
219
  }
264
- }), ke = {
220
+ }), $e = {
265
221
  valid: Boolean,
266
222
  validLabel: [String, Array]
267
- }, Ne = {
223
+ }, Ce = {
268
224
  invalid: Boolean,
269
225
  invalidLabel: [String, Array]
270
- }, Fe = {
226
+ }, Ve = {
271
227
  loading: Boolean,
272
228
  loadingLabel: String
273
- }, Le = {
229
+ }, xe = {
274
230
  disabled: Boolean
275
- }, Te = {
231
+ }, Ie = {
276
232
  readonly: Boolean
277
- }, De = {
233
+ }, _e = {
278
234
  modifiers: [String, Array]
279
- }, Oe = {
235
+ }, Be = {
280
236
  hintLabel: { type: String, default: "" }
281
- }, Ee = {
237
+ }, Ae = {
282
238
  count: {
283
239
  type: [Boolean, String],
284
240
  default: !1,
285
- validator: (r) => [!0, !1, "limit", "countdown"].includes(r)
241
+ validator: (n) => [!0, !1, "limit", "countdown"].includes(n)
286
242
  }
287
- }, Re = {
243
+ }, ke = {
288
244
  debounce: [Number, String]
289
- }, K = {
245
+ }, Z = {
290
246
  LEFT: "left",
291
247
  RIGHT: "right"
292
- }, je = {
248
+ }, Ne = {
293
249
  icon: { type: [String, Object] },
294
250
  iconPosition: {
295
251
  type: String,
296
- validation: (r) => Object.values(K).includes(r),
297
- default: K.RIGHT
252
+ validation: (n) => Object.values(Z).includes(n),
253
+ default: Z.RIGHT
298
254
  }
299
- }, He = {
255
+ }, Ee = {
300
256
  tabindex: { type: [String, Number], default: 0 }
301
- }, ze = {
257
+ }, Fe = {
302
258
  floating: Boolean
303
- }, Me = {
259
+ }, De = {
304
260
  id: [String, Number],
305
261
  name: { type: String, required: !0 }
306
- }, qe = {
262
+ }, Oe = {
307
263
  autofocus: Boolean
308
- }, Ze = {
264
+ }, Re = {
309
265
  autocomplete: { type: String, default: "off" }
310
- }, Ge = {
311
- ...Me,
312
- ...qe,
313
- ...Ze,
314
- ...He,
315
- ...Le,
316
- ...Te,
266
+ }, Te = {
267
+ ...De,
268
+ ...Oe,
269
+ ...Re,
270
+ ...Ee,
271
+ ...xe,
272
+ ...Ie,
273
+ ...$e,
274
+ ...Ce,
275
+ ...Be,
276
+ ...Ve,
277
+ ..._e,
278
+ ...Ae,
317
279
  ...ke,
318
280
  ...Ne,
319
- ...Oe,
320
281
  ...Fe,
321
- ...De,
322
- ...Ee,
323
- ...Re,
324
- ...je,
325
- ...ze,
326
282
  minlength: Number,
327
283
  maxlength: Number,
328
284
  placeholder: String,
329
285
  required: Boolean,
330
286
  label: String
331
- }, Ke = {
287
+ }, je = {
332
288
  hard: "hard",
333
289
  soft: "soft"
334
- }, Je = {
290
+ }, He = {
335
291
  true: !0,
336
292
  false: !1,
337
293
  default: "default"
338
- }, Ue = ["update:modelValue", "focus", "blur", "keyup"], We = {
339
- ...Ge,
294
+ }, ze = ["update:modelValue", "focus", "blur", "keyup"], Me = {
295
+ ...Te,
340
296
  modelValue: String,
341
297
  cols: { type: [String, Number], default: 20 },
342
298
  rows: { type: [String, Number], default: 2 },
343
- wrap: { type: String, default: Ke.soft },
344
- spellcheck: { type: [Boolean, String], default: Je.default },
299
+ wrap: { type: String, default: je.soft },
300
+ spellcheck: { type: [Boolean, String], default: He.default },
345
301
  resizable: Boolean
346
- }, Xe = ["for"], Qe = { class: "vv-textarea__wrapper" }, Ye = ["id"], et = {
302
+ }, qe = ["for"], Le = { class: "vv-textarea__wrapper" }, Ze = ["id"], Ge = {
347
303
  key: 0,
348
304
  class: "vv-textarea__limit"
349
- }, tt = {
305
+ }, Ke = {
350
306
  name: "VvTextarea"
351
- }, ot = /* @__PURE__ */ U({
352
- ...tt,
353
- props: We,
354
- emits: Ue,
355
- setup(r, { emit: t }) {
356
- const e = r, u = se(), l = W(), {
357
- icon: d,
358
- iconPosition: a,
359
- label: h,
360
- modelValue: m,
361
- count: f,
362
- valid: n,
363
- invalid: o,
364
- loading: g
365
- } = j(e), c = i(() => String(e.id || he())), v = i(() => `${c.value}-hint`), y = i(
366
- () => e.floating && N(e.placeholder) ? " " : e.placeholder
367
- ), p = xe(m, t, e.debounce), { hasIcon: b, hasIconLeft: I, hasIconRight: $ } = Ce(
368
- d,
369
- a
370
- ), { focused: x } = $e(l, t), F = be(l);
371
- J(F, (P) => {
372
- P && e.autofocus && (x.value = !0);
307
+ }, Qe = /* @__PURE__ */ K({
308
+ ...Ke,
309
+ props: Me,
310
+ emits: ze,
311
+ setup(n, { emit: t }) {
312
+ const e = n, c = useSlots(), i = ref(), {
313
+ icon: u,
314
+ iconPosition: r,
315
+ label: g,
316
+ modelValue: f,
317
+ count: d,
318
+ valid: o,
319
+ invalid: s,
320
+ loading: m
321
+ } = toRefs(e), l = computed(() => String(e.id || pe())), p = computed(() => `${l.value}-hint`), y = computed(
322
+ () => e.floating && isEmpty(e.placeholder) ? " " : e.placeholder
323
+ ), h = useDebouncedInput(f, t, e.debounce), { hasIcon: b, hasIconLeft: w, hasIconRight: V } = useComponentIcon(
324
+ u,
325
+ r
326
+ ), { focused: x } = useComponentFocus(i, t), N = useElementVisibility(i);
327
+ watch(N, ($) => {
328
+ $ && e.autofocus && (x.value = !0);
373
329
  });
374
- const { formatted: S } = Ve(p, {
330
+ const { formatted: S } = useTextCount(h, {
375
331
  mode: e.count,
376
332
  upperLimit: e.maxlength,
377
333
  lowerLimit: e.minlength
378
- }), Q = i(() => !e.disabled && !e.readonly), Y = i(
379
- () => Q.value ? e.tabindex : -1
380
- ), ee = i(() => !N(m)), te = i(() => {
334
+ }), J = computed(() => !e.disabled && !e.readonly), U = computed(
335
+ () => J.value ? e.tabindex : -1
336
+ ), W = computed(() => !isEmpty(f)), X = computed(() => {
381
337
  if (e.invalid === !0)
382
338
  return !0;
383
339
  if (e.valid === !0)
384
340
  return !1;
385
- }), { HintSlot: re, hasHint: ne, hasInvalid: H } = Pe(e, u), { bemCssClasses: ae } = X("vv-textarea", {
341
+ }), { HintSlot: Q, hasHint: Y, hasInvalid: j } = ye(e, c), { bemCssClasses: ee } = useBemModifiers("vv-textarea", {
386
342
  modifiers: e.modifiers,
387
- valid: n,
388
- invalid: o,
389
- loading: g,
343
+ valid: o,
344
+ invalid: s,
345
+ loading: m,
390
346
  disabled: e.disabled,
391
347
  readonly: e.readonly,
392
- iconLeft: I,
393
- iconRight: $,
394
- floating: e.floating && !N(e.label),
395
- dirty: ee,
348
+ iconLeft: w,
349
+ iconRight: V,
350
+ floating: e.floating && !isEmpty(e.label),
351
+ dirty: W,
396
352
  focused: x,
397
353
  resizable: e.resizable
398
- }), le = i(
354
+ }), te = computed(
399
355
  () => ({
400
356
  name: e.name,
401
357
  placeholder: y.value,
402
- tabindex: Y.value,
358
+ tabindex: U.value,
403
359
  disabled: e.disabled,
404
360
  readonly: e.readonly,
405
361
  required: e.required,
@@ -410,11 +366,11 @@ const _e = "ds", Be = {
410
366
  rows: e.rows,
411
367
  wrap: e.wrap,
412
368
  spellcheck: e.spellcheck,
413
- "aria-invalid": te.value,
414
- "aria-describedby": !H.value && ne.value ? v.value : void 0,
415
- "aria-errormessage": H.value ? v.value : void 0
369
+ "aria-invalid": X.value,
370
+ "aria-describedby": !j.value && Y.value ? p.value : void 0,
371
+ "aria-errormessage": j.value ? p.value : void 0
416
372
  })
417
- ), L = i(() => ({
373
+ ), E = computed(() => ({
418
374
  valid: e.valid,
419
375
  invalid: e.invalid,
420
376
  modelValue: e.modelValue,
@@ -423,49 +379,49 @@ const _e = "ds", Be = {
423
379
  minlength: e.minlength,
424
380
  clear: oe
425
381
  })), oe = () => {
426
- p.value = void 0;
382
+ h.value = void 0;
427
383
  };
428
- return (P, V) => (w(), D("div", {
429
- class: ce(s(ae))
384
+ return ($, I) => (P(), D("div", {
385
+ class: ie(a(ee))
430
386
  }, [
431
- s(h) ? (w(), D("label", {
387
+ a(g) ? (P(), D("label", {
432
388
  key: 0,
433
- for: s(c),
389
+ for: a(l),
434
390
  class: "vv-textarea__label"
435
- }, z(s(h)), 9, Xe)) : C("", !0),
436
- M("div", Qe, [
437
- O(P.$slots, "before", _(E(s(L))), () => [
438
- s(I) ? (w(), R(G, k({
391
+ }, H(a(g)), 9, qe)) : C("", !0),
392
+ z("div", Le, [
393
+ O($.$slots, "before", _(R(a(E))), () => [
394
+ a(w) ? (P(), T(L, k({
439
395
  key: 0,
440
396
  class: "vv-textarea__icon-left"
441
- }, s(b)), null, 16)) : C("", !0)
397
+ }, a(b)), null, 16)) : C("", !0)
442
398
  ]),
443
- de(M("textarea", k({
444
- id: s(c),
399
+ ae(z("textarea", k({
400
+ id: a(l),
445
401
  ref_key: "textarea",
446
- ref: l,
447
- "onUpdate:modelValue": V[0] || (V[0] = (T) => fe(p) ? p.value = T : null)
448
- }, s(le), {
449
- onKeyup: V[1] || (V[1] = (T) => t("keyup", T))
450
- }), null, 16, Ye), [
451
- [ve, s(p)]
402
+ ref: i,
403
+ "onUpdate:modelValue": I[0] || (I[0] = (F) => le(h) ? h.value = F : null)
404
+ }, a(te), {
405
+ onKeyup: I[1] || (I[1] = (F) => t("keyup", F))
406
+ }), null, 16, Ze), [
407
+ [ue, a(h)]
452
408
  ]),
453
- O(P.$slots, "after", _(E(s(L))), () => [
454
- s($) ? (w(), R(G, _(k({ key: 0 }, s(b))), null, 16)) : C("", !0)
409
+ O($.$slots, "after", _(R(a(E))), () => [
410
+ a(V) ? (P(), T(L, _(k({ key: 0 }, a(b))), null, 16)) : C("", !0)
455
411
  ]),
456
- s(f) ? (w(), D("span", et, [
457
- O(P.$slots, "count", _(E(s(L))), () => [
458
- me(z(s(S)), 1)
412
+ a(d) ? (P(), D("span", Ge, [
413
+ O($.$slots, "count", _(R(a(E))), () => [
414
+ ce(H(a(S)), 1)
459
415
  ])
460
416
  ])) : C("", !0)
461
417
  ]),
462
- ge(s(re), {
463
- id: s(v),
418
+ de(a(Q), {
419
+ id: a(p),
464
420
  class: "vv-textarea__hint"
465
421
  }, null, 8, ["id"])
466
422
  ], 2));
467
423
  }
468
424
  });
469
425
  export {
470
- ot as default
426
+ Qe as default
471
427
  };