@volverjs/ui-vue 0.0.1 → 0.0.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +17 -0
  2. package/auto-imports.d.ts +289 -0
  3. package/dist/components/VvButton/VvButton.es.js +159 -147
  4. package/dist/components/VvButton/VvButton.umd.js +1 -1
  5. package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
  6. package/dist/components/VvButton/index.d.ts +4 -4
  7. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
  8. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  9. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
  10. package/dist/components/VvButtonGroup/index.d.ts +5 -5
  11. package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
  12. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  13. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
  14. package/dist/components/VvCombobox/index.d.ts +13 -1
  15. package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
  16. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  17. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
  18. package/dist/components/VvDropdown/index.d.ts +12 -0
  19. package/dist/components/VvInputText/VvInputText.es.js +221 -213
  20. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  21. package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
  22. package/dist/components/VvInputText/index.d.ts +5 -5
  23. package/dist/components/VvSelect/VvSelect.es.js +186 -167
  24. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  25. package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
  26. package/dist/components/VvSelect/index.d.ts +10 -17
  27. package/dist/components/VvTextarea/VvTextarea.es.js +241 -277
  28. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  29. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
  30. package/dist/components/VvTextarea/index.d.ts +5 -5
  31. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  32. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  33. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  34. package/dist/components/VvTooltip/index.d.ts +18 -0
  35. package/dist/components/index.es.js +1046 -976
  36. package/dist/components/index.umd.js +1 -1
  37. package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
  38. package/dist/composables/group/types/IGroupState.d.ts +1 -1
  39. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  40. package/dist/icons.es.js +3 -3
  41. package/dist/icons.umd.js +1 -1
  42. package/dist/index.es.js +1127 -1057
  43. package/dist/index.umd.js +1 -1
  44. package/dist/props/index.d.ts +35 -4
  45. package/dist/resolvers/unplugin.es.js +26 -24
  46. package/dist/resolvers/unplugin.umd.js +1 -1
  47. package/dist/stories/Button/Button.settings.d.ts +9 -11
  48. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
  49. package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
  50. package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
  51. package/dist/stories/InputText/InputText.settings.d.ts +23 -23
  52. package/dist/stories/Select/Select.settings.d.ts +42 -23
  53. package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
  54. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  55. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  56. package/dist/stories/argTypes.d.ts +50 -1
  57. package/package.json +31 -23
  58. package/src/assets/icons/detailed.json +1 -1
  59. package/src/assets/icons/normal.json +1 -1
  60. package/src/assets/icons/simple.json +1 -1
  61. package/src/components/VvButton/index.ts +28 -10
  62. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
  63. package/src/components/VvButtonGroup/index.ts +3 -6
  64. package/src/components/VvCombobox/VvCombobox.vue +45 -11
  65. package/src/components/VvCombobox/index.ts +6 -0
  66. package/src/components/VvDropdown/VvDropdown.vue +9 -6
  67. package/src/components/VvDropdown/index.ts +11 -1
  68. package/src/components/VvInputText/VvInputText.vue +10 -8
  69. package/src/components/VvSelect/VvSelect.vue +23 -1
  70. package/src/components/VvSelect/index.ts +8 -11
  71. package/src/components/VvTextarea/VvTextarea.vue +9 -21
  72. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  73. package/src/components/VvTooltip/index.ts +21 -0
  74. package/src/composables/group/types/IButtonGroupState.ts +1 -1
  75. package/src/composables/group/types/IGroupState.ts +1 -1
  76. package/src/composables/group/useInjectedGroupState.ts +3 -3
  77. package/src/composables/useTextCount.ts +1 -1
  78. package/src/props/index.ts +33 -15
  79. package/src/resolvers/unplugin.ts +22 -13
  80. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  81. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  82. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  83. package/src/stories/Badge/Badge.stories.mdx +1 -1
  84. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  85. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  86. package/src/stories/Button/Button.settings.ts +2 -7
  87. package/src/stories/Button/Button.stories.mdx +1 -1
  88. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  89. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  90. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
  91. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  92. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
  93. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
  94. package/src/stories/Card/Card.stories.mdx +1 -1
  95. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  96. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  97. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  98. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  99. package/src/stories/Combobox/Combobox.settings.ts +5 -0
  100. package/src/stories/Combobox/Combobox.stories.mdx +52 -1
  101. package/src/stories/Combobox/Combobox.test.ts +7 -0
  102. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  103. package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
  104. package/src/stories/Dropdown/Dropdown.stories.mdx +18 -1
  105. package/src/stories/Icon/Icon.stories.mdx +1 -1
  106. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  107. package/src/stories/InputText/InputText.stories.mdx +1 -1
  108. package/src/stories/Progress/Progress.stories.mdx +1 -1
  109. package/src/stories/Radio/Radio.stories.mdx +1 -1
  110. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  111. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  112. package/src/stories/Select/Select.settings.ts +9 -23
  113. package/src/stories/Select/Select.stories.mdx +61 -1
  114. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  115. package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
  116. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  117. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
  118. package/src/stories/argTypes.ts +46 -22
@@ -1,68 +1,68 @@
1
- import { unref as s, toRefs as j, computed as i, h as le, watch as oe, defineComponent as J, ref as U, inject as ie, openBlock as w, createBlock as E, mergeProps as k, createCommentVNode as P, useSlots as ue, onMounted as se, createElementBlock as D, normalizeClass as ce, toDisplayString as z, createElementVNode as M, renderSlot as O, normalizeProps as _, guardReactiveProps as R, 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 } from "@vueuse/core";
4
- import { iconExists as B, Icon as be, addIcon as Se } 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 A(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 we(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 V(r) {
36
- return Array.isArray(r) ? r.filter((t) => we(t)).join(" ") : r;
35
+ function A(n) {
36
+ return Array.isArray(n) ? n.filter((t) => he(t)).join(" ") : n;
37
37
  }
38
- function Ie(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 && !A(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
- ), C = 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: {
@@ -71,23 +71,23 @@ function Ie(r, t) {
71
71
  default: () => ({})
72
72
  }
73
73
  },
74
- setup($) {
75
- const N = 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,
85
- ...$.params
74
+ setup(x) {
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
+ ...x.params
86
86
  });
87
- return n != null && n.value ? (e == null ? void 0 : e(S)) || V(o == null ? void 0 : o.value) || (a == null ? void 0 : a.value) : m != null && m.value ? (u == null ? void 0 : u(S)) || V(f == null ? void 0 : f.value) || (a == null ? void 0 : a.value) : c != null && c.value ? (d == null ? void 0 : d(S)) || V(v == null ? void 0 : v.value) || (a == null ? void 0 : a.value) : (l == null ? void 0 : l(S)) || V(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: C,
90
+ isVisible: V,
91
91
  hasInvalid: y,
92
92
  hasValid: b,
93
93
  hintContent: N
@@ -95,7 +95,7 @@ function Ie(r, t) {
95
95
  },
96
96
  render() {
97
97
  if (this.isVisible)
98
- return le(
98
+ return ne(
99
99
  "small",
100
100
  {
101
101
  role: this.hasInvalid || this.hasValid ? "alert" : void 0
@@ -106,79 +106,7 @@ function Ie(r, t) {
106
106
  }
107
107
  };
108
108
  }
109
- function Pe(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 Ce(r, t) {
128
- const { focused: e } = ye(r);
129
- return oe(e, (u) => {
130
- t(u ? "focus" : "blur", s(r));
131
- }), {
132
- focused: e
133
- };
134
- }
135
- function $e(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 xe(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" ? `${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 W(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,187 +137,225 @@ const _e = "ds", Be = {
209
137
  modifiers: {
210
138
  type: [String, Array]
211
139
  }
212
- }, Ve = {
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__ */ J({
215
- ...Ve,
216
- props: Be,
217
- setup(r) {
218
- const t = r, e = U(!0), { modifiers: u } = j(t), l = ie(_e), { bemCssClasses: d } = W("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 && Se(`@${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(), E(s(be), 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)
262
- }), null, 16, ["class"])) : P("", !0);
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)
218
+ }), null, 16, ["class"])) : C("", !0);
263
219
  }
264
- }), ke = {
220
+ }), $e = {
265
221
  valid: Boolean,
266
222
  validLabel: [String, Array]
267
- }, Ae = {
223
+ }, Ce = {
268
224
  invalid: Boolean,
269
225
  invalidLabel: [String, Array]
270
- }, Ne = {
226
+ }, Ve = {
271
227
  loading: Boolean,
272
228
  loadingLabel: String
273
- }, Te = {
229
+ }, xe = {
274
230
  disabled: Boolean
275
- }, Fe = {
231
+ }, Ie = {
276
232
  readonly: Boolean
277
- }, Le = {
233
+ }, _e = {
278
234
  modifiers: [String, Array]
279
- }, De = {
235
+ }, Be = {
280
236
  hintLabel: { type: String, default: "" }
281
- }, Oe = {
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
- }, Ee = {
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
- }, je = {
255
+ }, Ee = {
300
256
  tabindex: { type: [String, Number], default: 0 }
301
- }, He = {
257
+ }, Fe = {
258
+ floating: Boolean
259
+ }, De = {
302
260
  id: [String, Number],
303
261
  name: { type: String, required: !0 }
304
- }, ze = {
305
- ...He,
306
- ...je,
307
- ...Te,
308
- ...Fe,
309
- ...ke,
310
- ...Ae,
262
+ }, Oe = {
263
+ autofocus: Boolean
264
+ }, Re = {
265
+ autocomplete: { type: String, default: "off" }
266
+ }, Te = {
311
267
  ...De,
312
- ...Ne,
313
- ...Le,
314
268
  ...Oe,
315
269
  ...Re,
316
270
  ...Ee,
317
- autofocus: Boolean,
318
- autocomplete: { type: String, default: "off" },
271
+ ...xe,
272
+ ...Ie,
273
+ ...$e,
274
+ ...Ce,
275
+ ...Be,
276
+ ...Ve,
277
+ ..._e,
278
+ ...Ae,
279
+ ...ke,
280
+ ...Ne,
281
+ ...Fe,
319
282
  minlength: Number,
320
283
  maxlength: Number,
321
284
  placeholder: String,
322
285
  required: Boolean,
323
- label: String,
324
- floating: Boolean
325
- }, Me = {
286
+ label: String
287
+ }, je = {
326
288
  hard: "hard",
327
289
  soft: "soft"
328
- }, qe = {
290
+ }, He = {
329
291
  true: !0,
330
292
  false: !1,
331
293
  default: "default"
332
- }, Ze = ["update:modelValue", "focus", "blur", "keyup"], Ge = {
333
- ...ze,
294
+ }, ze = ["update:modelValue", "focus", "blur", "keyup"], Me = {
295
+ ...Te,
334
296
  modelValue: String,
335
297
  cols: { type: [String, Number], default: 20 },
336
298
  rows: { type: [String, Number], default: 2 },
337
- wrap: { type: String, default: Me.soft },
338
- spellcheck: { type: [Boolean, String], default: qe.default },
299
+ wrap: { type: String, default: je.soft },
300
+ spellcheck: { type: [Boolean, String], default: He.default },
339
301
  resizable: Boolean
340
- }, Ke = ["for"], Je = { class: "vv-textarea__wrapper" }, Ue = ["id"], We = {
302
+ }, qe = ["for"], Le = { class: "vv-textarea__wrapper" }, Ze = ["id"], Ge = {
341
303
  key: 0,
342
304
  class: "vv-textarea__limit"
343
- }, Xe = {
305
+ }, Ke = {
344
306
  name: "VvTextarea"
345
- }, rt = /* @__PURE__ */ J({
346
- ...Xe,
347
- props: Ge,
348
- emits: Ze,
349
- setup(r, { emit: t }) {
350
- const e = r, u = ue(), l = U(), {
351
- icon: d,
352
- iconPosition: a,
353
- label: h,
354
- modelValue: m,
355
- count: f,
356
- valid: n,
357
- invalid: o,
358
- loading: g
359
- } = j(e), c = i(() => String(e.id || he())), v = i(() => `${c.value}-hint`), y = i(
360
- () => e.floating && A(e.placeholder) ? " " : e.placeholder
361
- ), p = $e(m, t, e.debounce), { hasIcon: b, hasIconLeft: I, hasIconRight: C } = Pe(
362
- d,
363
- a
364
- ), { focused: $ } = Ce(l, t), { formatted: N } = xe(p, {
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);
329
+ });
330
+ const { formatted: S } = useTextCount(h, {
365
331
  mode: e.count,
366
332
  upperLimit: e.maxlength,
367
333
  lowerLimit: e.minlength
368
- }), S = i(() => !e.disabled && !e.readonly), X = i(
369
- () => S.value ? e.tabindex : -1
370
- ), Q = i(() => !A(m)), Y = i(() => {
334
+ }), J = computed(() => !e.disabled && !e.readonly), U = computed(
335
+ () => J.value ? e.tabindex : -1
336
+ ), W = computed(() => !isEmpty(f)), X = computed(() => {
371
337
  if (e.invalid === !0)
372
338
  return !0;
373
339
  if (e.valid === !0)
374
340
  return !1;
375
- }), { HintSlot: ee, hasHint: te, hasInvalid: H } = Ie(e, u), { bemCssClasses: re } = W("vv-textarea", {
341
+ }), { HintSlot: Q, hasHint: Y, hasInvalid: j } = ye(e, c), { bemCssClasses: ee } = useBemModifiers("vv-textarea", {
376
342
  modifiers: e.modifiers,
377
- valid: n,
378
- invalid: o,
379
- loading: g,
343
+ valid: o,
344
+ invalid: s,
345
+ loading: m,
380
346
  disabled: e.disabled,
381
347
  readonly: e.readonly,
382
- iconLeft: I,
383
- iconRight: C,
384
- floating: e.floating && !A(e.label),
385
- dirty: Q,
386
- focused: $,
348
+ iconLeft: w,
349
+ iconRight: V,
350
+ floating: e.floating && !isEmpty(e.label),
351
+ dirty: W,
352
+ focused: x,
387
353
  resizable: e.resizable
388
- }), ne = i(
354
+ }), te = computed(
389
355
  () => ({
390
356
  name: e.name,
391
357
  placeholder: y.value,
392
- tabindex: X.value,
358
+ tabindex: U.value,
393
359
  disabled: e.disabled,
394
360
  readonly: e.readonly,
395
361
  required: e.required,
@@ -400,64 +366,62 @@ const _e = "ds", Be = {
400
366
  rows: e.rows,
401
367
  wrap: e.wrap,
402
368
  spellcheck: e.spellcheck,
403
- "aria-invalid": Y.value,
404
- "aria-describedby": !H.value && te.value ? v.value : void 0,
405
- "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
406
372
  })
407
- ), T = i(() => ({
373
+ ), E = computed(() => ({
408
374
  valid: e.valid,
409
375
  invalid: e.invalid,
410
376
  modelValue: e.modelValue,
411
377
  hintLabel: e.hintLabel,
412
378
  maxlength: e.maxlength,
413
379
  minlength: e.minlength,
414
- clear: ae
415
- })), ae = () => {
416
- p.value = void 0;
380
+ clear: oe
381
+ })), oe = () => {
382
+ h.value = void 0;
417
383
  };
418
- return se(() => {
419
- e.autofocus && ($.value = !0);
420
- }), (F, x) => (w(), D("div", {
421
- class: ce(s(re))
384
+ return ($, I) => (P(), D("div", {
385
+ class: ie(a(ee))
422
386
  }, [
423
- s(h) ? (w(), D("label", {
387
+ a(g) ? (P(), D("label", {
424
388
  key: 0,
425
- for: s(c),
389
+ for: a(l),
426
390
  class: "vv-textarea__label"
427
- }, z(s(h)), 9, Ke)) : P("", !0),
428
- M("div", Je, [
429
- O(F.$slots, "before", _(R(s(T))), () => [
430
- s(I) ? (w(), E(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({
431
395
  key: 0,
432
396
  class: "vv-textarea__icon-left"
433
- }, s(b)), null, 16)) : P("", !0)
397
+ }, a(b)), null, 16)) : C("", !0)
434
398
  ]),
435
- de(M("textarea", k({
436
- id: s(c),
399
+ ae(z("textarea", k({
400
+ id: a(l),
437
401
  ref_key: "textarea",
438
- ref: l,
439
- "onUpdate:modelValue": x[0] || (x[0] = (L) => fe(p) ? p.value = L : null)
440
- }, s(ne), {
441
- onKeyup: x[1] || (x[1] = (L) => t("keyup", L))
442
- }), null, 16, Ue), [
443
- [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)]
444
408
  ]),
445
- O(F.$slots, "after", _(R(s(T))), () => [
446
- s(C) ? (w(), E(G, _(k({ key: 0 }, s(b))), null, 16)) : P("", !0)
409
+ O($.$slots, "after", _(R(a(E))), () => [
410
+ a(V) ? (P(), T(L, _(k({ key: 0 }, a(b))), null, 16)) : C("", !0)
447
411
  ]),
448
- s(f) ? (w(), D("span", We, [
449
- O(F.$slots, "count", _(R(s(T))), () => [
450
- me(z(s(N)), 1)
412
+ a(d) ? (P(), D("span", Ge, [
413
+ O($.$slots, "count", _(R(a(E))), () => [
414
+ ce(H(a(S)), 1)
451
415
  ])
452
- ])) : P("", !0)
416
+ ])) : C("", !0)
453
417
  ]),
454
- ge(s(ee), {
455
- id: s(v),
418
+ de(a(Q), {
419
+ id: a(p),
456
420
  class: "vv-textarea__hint"
457
421
  }, null, 8, ["id"])
458
422
  ], 2));
459
423
  }
460
424
  });
461
425
  export {
462
- rt as default
426
+ Qe as default
463
427
  };