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

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