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