@volverjs/ui-vue 0.0.3 → 0.0.4

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 (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -1,36 +1,61 @@
1
- import { defineComponent as ie, unref as i, openBlock as g, createBlock as C, mergeProps as V, createCommentVNode as _, createElementBlock as O, normalizeClass as Ee, toDisplayString as ne, createElementVNode as W, renderSlot as F, normalizeProps as j, guardReactiveProps as q, withDirectives as Ae, isRef as Ie, vModelDynamic as _e, createTextVNode as De, createVNode as Ce } from "vue";
2
- import { iconExists as x, Icon as Te, addIcon as Pe } from "@iconify/vue";
3
- function B(t) {
4
- return Array.isArray(t) ? t.filter((n) => isString(n)).join(" ") : t;
1
+ import { unref as s, toRefs as U, computed as l, h as y, inject as Re, defineComponent as L, ref as j, openBlock as g, createBlock as P, mergeProps as $, createCommentVNode as O, watch as ve, useSlots as xe, createElementBlock as H, normalizeClass as Le, toDisplayString as ue, createElementVNode as Y, renderSlot as J, normalizeProps as G, guardReactiveProps as Q, withDirectives as Ne, isRef as Ve, vModelDynamic as ke, createTextVNode as Me, createVNode as $e } from "vue";
2
+ import { toReactive as Ue, useFocus as je, useElementVisibility as We } from "@vueuse/core";
3
+ import { iconExists as k, Icon as Fe, addIcon as qe } from "@iconify/vue";
4
+ import { nanoid as ze } from "nanoid";
5
+ function ce(e, t) {
6
+ if (e && Object.keys(e).length && t) {
7
+ if (t.indexOf(".") === -1)
8
+ return e[t];
9
+ {
10
+ const n = t.split(".");
11
+ let a = e;
12
+ for (let o = 0, p = n.length; o < p; ++o) {
13
+ if (e == null)
14
+ return null;
15
+ a = a[n[o]];
16
+ }
17
+ return a;
18
+ }
19
+ } else
20
+ return null;
21
+ }
22
+ function R(e) {
23
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(s(e));
24
+ }
25
+ function Ke(e) {
26
+ return typeof e == "string" || e instanceof String;
27
+ }
28
+ function M(e) {
29
+ return Array.isArray(e) ? e.filter((t) => Ke(t)).join(" ") : e;
5
30
  }
6
- function Oe(t, n) {
31
+ function Xe(e, t) {
7
32
  const {
8
- invalid: e,
9
- valid: l,
10
- hint: d,
11
- loading: v
12
- } = n, {
13
- hintLabel: u,
14
- modelValue: T,
15
- valid: y,
16
- validLabel: f,
17
- invalid: s,
18
- invalidLabel: a,
33
+ invalid: n,
34
+ valid: a,
35
+ hint: o,
36
+ loading: p
37
+ } = t, {
38
+ hintLabel: d,
39
+ modelValue: A,
40
+ valid: w,
41
+ validLabel: m,
42
+ invalid: i,
43
+ invalidLabel: u,
19
44
  ...S
20
- } = toRefs(t), c = resolveFieldData(S, "loading"), m = resolveFieldData(S, "loadingLabel"), w = computed(() => s.value ? !!(s.value && e || a != null && a.value && Array.isArray(a.value) && a.value.length > 0 || a != null && a.value && !isEmpty(a)) : !1), H = computed(
21
- () => !!(u && u.value || d)
22
- ), b = computed(
23
- () => !!(f && f.value || l)
24
- ), D = computed(
25
- () => !!(c != null && c.value && v || c != null && c.value && (m != null && m.value))
26
- ), N = computed(
27
- () => H.value || b.value || w.value || D.value
45
+ } = U(e), v = ce(S, "loading"), b = ce(S, "loadingLabel"), E = l(() => i.value ? !!(i.value && n || u != null && u.value && Array.isArray(u.value) && u.value.length > 0 || u != null && u.value && !R(u)) : !1), N = l(
46
+ () => !!(d && d.value || o)
47
+ ), h = l(
48
+ () => !!(m && m.value || a)
49
+ ), C = l(
50
+ () => !!(v != null && v.value && p || v != null && v.value && (b != null && b.value))
51
+ ), W = l(
52
+ () => N.value || h.value || E.value || C.value
28
53
  );
29
54
  return {
30
- hasInvalid: w,
31
- hasHint: H,
32
- hasValid: b,
33
- hasLoading: D,
55
+ hasInvalid: E,
56
+ hasHint: N,
57
+ hasValid: h,
58
+ hasLoading: C,
34
59
  HintSlot: {
35
60
  name: "HintSlot",
36
61
  props: {
@@ -39,31 +64,31 @@ function Oe(t, n) {
39
64
  default: () => ({})
40
65
  }
41
66
  },
42
- setup(P) {
43
- const R = computed(() => {
44
- const I = toReactive({
45
- hintLabel: u,
46
- modelValue: T,
47
- valid: y,
48
- validLabel: f,
49
- invalid: s,
50
- invalidLabel: a,
51
- loading: c,
52
- loadingLabel: m,
53
- ...P.params
67
+ setup(B) {
68
+ const V = l(() => {
69
+ const D = Ue({
70
+ hintLabel: d,
71
+ modelValue: A,
72
+ valid: w,
73
+ validLabel: m,
74
+ invalid: i,
75
+ invalidLabel: u,
76
+ loading: v,
77
+ loadingLabel: b,
78
+ ...B.params
54
79
  });
55
- return s != null && s.value ? (e == null ? void 0 : e(I)) || B(a == null ? void 0 : a.value) || (u == null ? void 0 : u.value) : y != null && y.value ? (l == null ? void 0 : l(I)) || B(f == null ? void 0 : f.value) || (u == null ? void 0 : u.value) : c != null && c.value ? (v == null ? void 0 : v(I)) || B(m == null ? void 0 : m.value) || (u == null ? void 0 : u.value) : (d == null ? void 0 : d(I)) || B(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
80
+ return i != null && i.value ? (n == null ? void 0 : n(D)) || M(u == null ? void 0 : u.value) || (d == null ? void 0 : d.value) : w != null && w.value ? (a == null ? void 0 : a(D)) || M(m == null ? void 0 : m.value) || (d == null ? void 0 : d.value) : v != null && v.value ? (p == null ? void 0 : p(D)) || M(b == null ? void 0 : b.value) || (d == null ? void 0 : d.value) : (o == null ? void 0 : o(D)) || M(d == null ? void 0 : d.value) || (d == null ? void 0 : d.value);
56
81
  });
57
82
  return {
58
- isVisible: N,
59
- hasInvalid: w,
60
- hasValid: b,
61
- hintContent: R
83
+ isVisible: W,
84
+ hasInvalid: E,
85
+ hasValid: h,
86
+ hintContent: V
62
87
  };
63
88
  },
64
89
  render() {
65
90
  if (this.isVisible)
66
- return h(
91
+ return y(
67
92
  "small",
68
93
  {
69
94
  role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
@@ -74,7 +99,7 @@ function Oe(t, n) {
74
99
  }
75
100
  };
76
101
  }
77
- const He = {
102
+ const Ye = {
78
103
  /**
79
104
  * Color
80
105
  */
@@ -167,102 +192,180 @@ const He = {
167
192
  modifiers: {
168
193
  type: [String, Array]
169
194
  }
170
- }, Re = {
195
+ };
196
+ var T = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(T || {}), fe = /* @__PURE__ */ ((e) => (e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e))(fe || {}), x = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(x || {}), te = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(te || {}), me = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(me || {});
197
+ const Je = Symbol.for("volver");
198
+ function Ge() {
199
+ return Re(Je);
200
+ }
201
+ function be(e, t, n) {
202
+ return l(() => {
203
+ const a = {
204
+ [e]: !0
205
+ }, o = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
206
+ return o && Array.isArray(o) && o.forEach((p) => {
207
+ a[`${e}--${p}`] = !0;
208
+ }), n && Object.keys(n.value).forEach((p) => {
209
+ a[`${e}--${p}`] = s(n.value[p]);
210
+ }), a;
211
+ });
212
+ }
213
+ const Qe = {
171
214
  name: "VvIcon"
172
- }, A = /* @__PURE__ */ ie({
173
- ...Re,
174
- props: He,
175
- setup(t) {
176
- const n = t, e = ref(!0), l = useVolver(), { modifiers: d } = toRefs(n), v = useBemModifiers("vv-icon", d), u = computed(() => n.provider || (l == null ? void 0 : l.provider)), T = computed(() => {
177
- const s = n.name ?? "", a = `@${u.value}:${n.prefix}:${n.name}`;
178
- return x(s) ? s : x(a) ? a : (l == null ? void 0 : l.iconsCollections.find(
215
+ }, _ = /* @__PURE__ */ L({
216
+ ...Qe,
217
+ props: Ye,
218
+ setup(e) {
219
+ const t = e, n = j(!0), a = Ge(), { modifiers: o } = U(t), p = be("vv-icon", o), d = l(() => t.provider || (a == null ? void 0 : a.provider)), A = l(() => {
220
+ const i = t.name ?? "", u = `@${d.value}:${t.prefix}:${t.name}`;
221
+ return k(i) ? i : k(u) ? u : (a == null ? void 0 : a.iconsCollections.find(
179
222
  (S) => {
180
- const c = `@${u.value}:${S.prefix}:${s}`;
181
- if (x(c))
182
- return c;
223
+ const v = `@${d.value}:${S.prefix}:${i}`;
224
+ if (k(v))
225
+ return v;
183
226
  }
184
- )) || s;
227
+ )) || i;
185
228
  });
186
- function y(s) {
187
- let a = null;
229
+ function w(i) {
230
+ let u = null;
188
231
  if (typeof window > "u") {
189
- const { JSDOM: w } = require("jsdom");
190
- a = new w().window;
232
+ const { JSDOM: E } = require("jsdom");
233
+ u = new E().window;
191
234
  }
192
- return (a ? new a.DOMParser() : new window.DOMParser()).parseFromString(s, "text/html").querySelector("svg");
235
+ return (u ? new u.DOMParser() : new window.DOMParser()).parseFromString(i, "text/html").querySelector("svg");
193
236
  }
194
- function f(s) {
195
- const a = y(s), S = (a == null ? void 0 : a.innerHTML.trim()) || "";
196
- a && S && Pe(`@${u.value}:${n.prefix}:${n.name}`, {
237
+ function m(i) {
238
+ const u = w(i), S = (u == null ? void 0 : u.innerHTML.trim()) || "";
239
+ u && S && qe(`@${d.value}:${t.prefix}:${t.name}`, {
197
240
  body: S,
198
241
  // Set height and width from svg content
199
- height: a.viewBox.baseVal.height,
200
- width: a.viewBox.baseVal.width
242
+ height: u.viewBox.baseVal.height,
243
+ width: u.viewBox.baseVal.width
201
244
  });
202
245
  }
203
- return l && (n.src && !x(`@${u.value}:${n.prefix}:${n.name}`) ? (e.value = !1, l.fetchIcon(n.src).then((s) => {
204
- s && (f(s), e.value = !0);
205
- }).catch((s) => {
206
- throw new Error(`During fetch icon: ${s == null ? void 0 : s.message}`);
207
- })) : n.svg && f(n.svg)), (s, a) => i(e) ? (g(), C(i(Te), V({
246
+ return a && (t.src && !k(`@${d.value}:${t.prefix}:${t.name}`) ? (n.value = !1, a.fetchIcon(t.src).then((i) => {
247
+ i && (m(i), n.value = !0);
248
+ }).catch((i) => {
249
+ throw new Error(`During fetch icon: ${i == null ? void 0 : i.message}`);
250
+ })) : t.svg && m(t.svg)), (i, u) => s(n) ? (g(), P(s(Fe), $({
208
251
  key: 0,
209
- class: i(v)
252
+ class: s(p)
210
253
  }, {
211
- inline: s.inline,
212
- width: s.width,
213
- height: s.height,
214
- horizontalFlip: s.horizontalFlip,
215
- verticalFlip: s.verticalFlip,
216
- flip: s.flip,
217
- rotate: s.rotate,
218
- color: s.color,
219
- onLoad: s.onLoad,
220
- icon: i(T)
221
- }), null, 16, ["class"])) : _("", !0);
254
+ inline: i.inline,
255
+ width: i.width,
256
+ height: i.height,
257
+ horizontalFlip: i.horizontalFlip,
258
+ verticalFlip: i.verticalFlip,
259
+ flip: i.flip,
260
+ rotate: i.rotate,
261
+ color: i.color,
262
+ onLoad: i.onLoad,
263
+ icon: s(A)
264
+ }), null, 16, ["class"])) : O("", !0);
222
265
  }
223
- });
224
- var K = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(K || {}), le = /* @__PURE__ */ ((t) => (t.topStart = "top-start", t.topEnd = "top-end", t.bottomStart = "bottom-start", t.bottomEnd = "bottom-end", t.leftStart = "left-start", t.leftEnd = "left-end", t.rightStart = "right-start", t.rightEnd = "right-end", t))(le || {}), Y = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(Y || {});
225
- const xe = {
266
+ }), Ze = {
267
+ /**
268
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
269
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
270
+ */
271
+ to: {
272
+ type: [String, Object]
273
+ },
274
+ /**
275
+ * Anchor href
276
+ */
277
+ href: String,
278
+ /**
279
+ * Anchor target
280
+ */
281
+ target: {
282
+ type: String,
283
+ validator: (e) => Object.values(me).includes(e)
284
+ },
285
+ /**
286
+ * Anchor rel
287
+ */
288
+ rel: {
289
+ type: String,
290
+ default: "noopener noreferrer"
291
+ }
292
+ }, et = {
293
+ /**
294
+ * Valid status
295
+ */
226
296
  valid: Boolean,
297
+ /**
298
+ * Valid label
299
+ */
227
300
  validLabel: [String, Array]
228
- }, Be = {
301
+ }, tt = {
302
+ /**
303
+ * Invalid status
304
+ */
229
305
  invalid: Boolean,
306
+ /**
307
+ * Invalid label
308
+ */
230
309
  invalidLabel: [String, Array]
231
- }, Ve = {
310
+ }, nt = {
311
+ /**
312
+ * Loading status
313
+ */
232
314
  loading: Boolean,
233
- loadingLabel: String
234
- }, Ne = {
315
+ /**
316
+ * Loading label
317
+ */
318
+ loadingLabel: {
319
+ type: String,
320
+ default: "Loading..."
321
+ }
322
+ }, Se = {
235
323
  /**
236
324
  * Whether the form control is disabled
237
325
  */
238
326
  disabled: Boolean
239
- }, Me = {
327
+ }, at = {
328
+ /**
329
+ * Whether the item is active
330
+ */
331
+ active: Boolean
332
+ }, rt = {
333
+ /**
334
+ * Whether the item is pressed
335
+ */
336
+ pressed: Boolean
337
+ }, he = {
338
+ /**
339
+ * The item label
340
+ */
341
+ label: [String, Number]
342
+ }, lt = {
240
343
  /**
241
344
  * The value is not editable
242
345
  */
243
346
  readonly: Boolean
244
- }, ke = {
347
+ }, ot = {
245
348
  /**
246
349
  * Component BEM modifiers
247
350
  */
248
351
  modifiers: [String, Array]
249
- }, $e = {
352
+ }, st = {
250
353
  hintLabel: { type: String, default: "" }
251
- }, Le = {
354
+ }, it = {
252
355
  /**
253
356
  * Show character limit
254
357
  */
255
358
  count: {
256
359
  type: [Boolean, String],
257
360
  default: !1,
258
- validator: (t) => [!0, !1, "limit", "countdown"].includes(t)
361
+ validator: (e) => [!0, !1, "limit", "countdown"].includes(e)
259
362
  }
260
- }, Ue = {
363
+ }, ut = {
261
364
  /**
262
365
  * Milliseconds to wait before emitting the input event
263
366
  */
264
367
  debounce: [Number, String]
265
- }, We = {
368
+ }, ct = {
266
369
  /**
267
370
  * VvIcon name or props
268
371
  * @see VVIcon
@@ -273,64 +376,65 @@ const xe = {
273
376
  */
274
377
  iconPosition: {
275
378
  type: String,
276
- default: Y.before,
277
- validation: (t) => Object.values(Y).includes(t)
379
+ default: x.before,
380
+ validation: (e) => Object.values(x).includes(e)
278
381
  }
279
- }, Fe = {
382
+ }, dt = {
280
383
  /**
281
384
  * Global attribute tabindex
282
385
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
283
386
  */
284
387
  tabindex: { type: [String, Number], default: 0 }
285
- }, je = {
388
+ }, pt = {
286
389
  /**
287
390
  * If true the label will be floating
288
391
  */
289
392
  floating: Boolean
290
- }, qe = {
393
+ }, vt = {
291
394
  /**
292
395
  * Global attribute id
293
396
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
294
397
  */
295
398
  id: [String, Number]
296
399
  };
297
- K.bottom;
298
- const ze = {
299
- ...qe,
400
+ T.bottom;
401
+ const ft = {
402
+ ...vt,
300
403
  /**
301
404
  * Input / Textarea name
302
405
  * Name of the form control. Submitted with the form as part of a name/value pair
303
406
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
304
407
  */
305
408
  name: { type: String, required: !0 }
306
- }, Xe = {
409
+ }, mt = {
307
410
  /**
308
411
  * Global attribute autofocus
309
412
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
310
413
  */
311
414
  autofocus: Boolean
312
- }, Ke = {
415
+ }, bt = {
313
416
  /**
314
417
  * Global attribute autocomplete
315
418
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
316
419
  */
317
420
  autocomplete: { type: String, default: "off" }
318
- }, Ye = {
319
- ...ze,
320
- ...Xe,
321
- ...Ke,
322
- ...Fe,
323
- ...Ne,
324
- ...Me,
325
- ...xe,
326
- ...Be,
327
- ...$e,
328
- ...Ve,
329
- ...ke,
330
- ...Le,
331
- ...Ue,
332
- ...We,
333
- ...je,
421
+ }, St = {
422
+ ...ft,
423
+ ...mt,
424
+ ...bt,
425
+ ...dt,
426
+ ...Se,
427
+ ...lt,
428
+ ...et,
429
+ ...tt,
430
+ ...st,
431
+ ...nt,
432
+ ...ot,
433
+ ...it,
434
+ ...ut,
435
+ ...ct,
436
+ ...pt,
437
+ ...he,
334
438
  /**
335
439
  * Input / Textarea minlength
336
440
  * Minimum length (number of characters) of value
@@ -358,12 +462,20 @@ const ze = {
358
462
  * Available for all input types except color
359
463
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
360
464
  */
361
- required: Boolean,
465
+ required: Boolean
466
+ };
467
+ ({
468
+ ...Se,
469
+ ...he,
470
+ ...rt,
471
+ ...at,
472
+ ...Ze,
362
473
  /**
363
- * <label> value for the Input / Textarea
474
+ * Button type
364
475
  */
365
- label: String
366
- }, o = {
476
+ type: te.button
477
+ });
478
+ const r = {
367
479
  TEXT: "text",
368
480
  PASSWORD: "password",
369
481
  NUMBER: "number",
@@ -377,15 +489,15 @@ const ze = {
377
489
  DATETIME_LOCAL: "datetime-local",
378
490
  MONTH: "month",
379
491
  WEEK: "week"
380
- }, E = {
492
+ }, I = {
381
493
  PASSWORD_SHOW: "eye-on",
382
494
  PASSWORD_HIDE: "eye-off",
383
495
  DATE: "calendar",
384
496
  TIME: "time",
385
497
  COLOR: "color",
386
498
  SEARCH: "close"
387
- }, Je = ["update:modelValue", "focus", "blur", "keyup"], Ge = {
388
- ...Ye,
499
+ }, ht = ["update:modelValue", "focus", "blur", "keyup"], gt = {
500
+ ...St,
389
501
  /**
390
502
  * Input value
391
503
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
@@ -397,8 +509,8 @@ const ze = {
397
509
  */
398
510
  type: {
399
511
  type: String,
400
- default: o.TEXT,
401
- validator: (t) => Object.values(o).includes(t)
512
+ default: r.TEXT,
513
+ validator: (e) => Object.values(r).includes(e)
402
514
  },
403
515
  /**
404
516
  * Minimum value
@@ -436,7 +548,7 @@ const ze = {
436
548
  */
437
549
  iconShowPassword: {
438
550
  type: String,
439
- default: E.PASSWORD_SHOW
551
+ default: I.PASSWORD_SHOW
440
552
  },
441
553
  /**
442
554
  * VvIcon name for hide password button
@@ -444,7 +556,7 @@ const ze = {
444
556
  */
445
557
  iconHidePassword: {
446
558
  type: String,
447
- default: E.PASSWORD_HIDE
559
+ default: I.PASSWORD_HIDE
448
560
  },
449
561
  /**
450
562
  * VvIcon name for clear button
@@ -452,7 +564,7 @@ const ze = {
452
564
  */
453
565
  iconClear: {
454
566
  type: String,
455
- default: E.SEARCH
567
+ default: I.SEARCH
456
568
  },
457
569
  /**
458
570
  * Label for step up button
@@ -489,9 +601,9 @@ const ze = {
489
601
  type: String,
490
602
  default: "Clear"
491
603
  }
492
- }, se = defineComponent({
604
+ }, de = L({
493
605
  components: {
494
- VvIcon: A
606
+ VvIcon: _
495
607
  },
496
608
  props: {
497
609
  disabled: {
@@ -508,33 +620,33 @@ const ze = {
508
620
  },
509
621
  iconShow: {
510
622
  type: String,
511
- default: E.PASSWORD_SHOW
623
+ default: I.PASSWORD_SHOW
512
624
  },
513
625
  iconHide: {
514
626
  type: String,
515
- default: E.PASSWORD_HIDE
627
+ default: I.PASSWORD_HIDE
516
628
  }
517
629
  },
518
630
  emits: ["toggle-password"],
519
- setup(t, { emit: n }) {
520
- const e = ref(!1), l = computed(
521
- () => e.value ? t.iconHide : t.iconShow
631
+ setup(e, { emit: t }) {
632
+ const n = j(!1), a = l(
633
+ () => n.value ? e.iconHide : e.iconShow
522
634
  );
523
- function d(v) {
524
- v == null || v.stopPropagation(), t.disabled || (e.value = !e.value, n("toggle-password", e.value));
635
+ function o(p) {
636
+ p == null || p.stopPropagation(), e.disabled || (n.value = !n.value, t("toggle-password", n.value));
525
637
  }
526
638
  return {
527
- active: e,
528
- activeIcon: l,
529
- onClick: d
639
+ active: n,
640
+ activeIcon: a,
641
+ onClick: o
530
642
  };
531
643
  },
532
644
  render() {
533
- const t = h(A, {
645
+ const e = y(_, {
534
646
  name: this.activeIcon,
535
647
  class: "vv-input-text__action-icon"
536
648
  });
537
- return h(
649
+ return y(
538
650
  "button",
539
651
  {
540
652
  disabled: this.disabled,
@@ -543,12 +655,12 @@ const ze = {
543
655
  type: "button",
544
656
  onClick: this.onClick
545
657
  },
546
- t
658
+ e
547
659
  );
548
660
  }
549
- }), z = defineComponent({
661
+ }), Z = L({
550
662
  components: {
551
- VvIcon: A
663
+ VvIcon: _
552
664
  },
553
665
  props: {
554
666
  disabled: {
@@ -560,22 +672,22 @@ const ze = {
560
672
  },
561
673
  mode: {
562
674
  type: String,
563
- validator: (t) => ["up", "down"].includes(t),
675
+ validator: (e) => ["up", "down"].includes(e),
564
676
  default: "up"
565
677
  }
566
678
  },
567
679
  emits: ["step-up", "step-down"],
568
- setup(t, { emit: n }) {
569
- const e = computed(() => t.mode === "up");
680
+ setup(e, { emit: t }) {
681
+ const n = l(() => e.mode === "up");
570
682
  return {
571
- isUp: e,
572
- onClick: (d) => {
573
- d == null || d.stopPropagation(), t.disabled || n(e.value ? "step-up" : "step-down");
683
+ isUp: n,
684
+ onClick: (o) => {
685
+ o == null || o.stopPropagation(), e.disabled || t(n.value ? "step-up" : "step-down");
574
686
  }
575
687
  };
576
688
  },
577
689
  render() {
578
- return h("button", {
690
+ return y("button", {
579
691
  class: [
580
692
  "vv-input-text__action-chevron",
581
693
  this.isUp && "vv-input-text__action-chevron-up"
@@ -585,9 +697,9 @@ const ze = {
585
697
  onClick: this.onClick
586
698
  });
587
699
  }
588
- }), ae = defineComponent({
700
+ }), pe = L({
589
701
  components: {
590
- VvIcon: A
702
+ VvIcon: _
591
703
  },
592
704
  props: {
593
705
  disabled: {
@@ -604,20 +716,20 @@ const ze = {
604
716
  }
605
717
  },
606
718
  emits: ["clear"],
607
- setup(t, { emit: n }) {
608
- function e(l) {
609
- l == null || l.stopPropagation(), t.disabled || n("clear");
719
+ setup(e, { emit: t }) {
720
+ function n(a) {
721
+ a == null || a.stopPropagation(), e.disabled || t("clear");
610
722
  }
611
723
  return {
612
- onClick: e
724
+ onClick: n
613
725
  };
614
726
  },
615
727
  render() {
616
- const t = h(A, {
728
+ const e = y(_, {
617
729
  name: this.icon,
618
730
  class: "vv-input-text__action-icon"
619
731
  });
620
- return h(
732
+ return y(
621
733
  "button",
622
734
  {
623
735
  disabled: this.disabled,
@@ -626,51 +738,51 @@ const ze = {
626
738
  type: "button",
627
739
  onClick: this.onClick
628
740
  },
629
- t
741
+ e
630
742
  );
631
743
  }
632
744
  });
633
- function X(t, n) {
745
+ function ee(e, t) {
634
746
  return {
635
747
  name: "VvInputTextActions",
636
748
  components: {
637
- VvIcon: A,
638
- VvInputPasswordAction: se,
639
- VvInputStepAction: z,
640
- VvInputClearAction: ae
749
+ VvIcon: _,
750
+ VvInputPasswordAction: de,
751
+ VvInputStepAction: Z,
752
+ VvInputClearAction: pe
641
753
  },
642
754
  setup() {
643
755
  return {
644
- isDisabled: computed(() => n.disabled || n.readonly),
645
- labelStepUp: n.labelStepUp,
646
- labelStepDown: n.labelStepDown,
647
- labelShowPassword: n.labelShowPassword,
648
- labelHidePassword: n.labelHidePassword,
649
- labelClear: n.labelClear,
650
- iconShowPassword: n.iconShowPassword,
651
- iconHidePassword: n.iconHidePassword
756
+ isDisabled: l(() => t.disabled || t.readonly),
757
+ labelStepUp: t.labelStepUp,
758
+ labelStepDown: t.labelStepDown,
759
+ labelShowPassword: t.labelShowPassword,
760
+ labelHidePassword: t.labelHidePassword,
761
+ labelClear: t.labelClear,
762
+ iconShowPassword: t.iconShowPassword,
763
+ iconHidePassword: t.iconHidePassword
652
764
  };
653
765
  },
654
766
  render() {
655
- let e = null;
656
- switch (t) {
657
- case o.SEARCH: {
658
- const { onClear: l } = this.$attrs;
659
- e = [
660
- h(ae, {
767
+ let n = null;
768
+ switch (e) {
769
+ case r.SEARCH: {
770
+ const { onClear: a } = this.$attrs;
771
+ n = [
772
+ y(pe, {
661
773
  disabled: this.isDisabled,
662
774
  label: this.labelShowPassword,
663
- onClear: l
775
+ onClear: a
664
776
  })
665
777
  ];
666
778
  break;
667
779
  }
668
- case o.PASSWORD: {
669
- const { onTogglePassword: l } = this.$attrs;
670
- e = [
671
- h(se, {
780
+ case r.PASSWORD: {
781
+ const { onTogglePassword: a } = this.$attrs;
782
+ n = [
783
+ y(de, {
672
784
  disabled: this.isDisabled,
673
- onTogglePassword: l,
785
+ onTogglePassword: a,
674
786
  labelShow: this.labelShowPassword,
675
787
  labelHide: this.labelHidePassword,
676
788
  iconShow: this.iconShowPassword,
@@ -679,206 +791,258 @@ function X(t, n) {
679
791
  ];
680
792
  break;
681
793
  }
682
- case o.NUMBER: {
683
- const { onStepUp: l, onStepDown: d } = this.$attrs;
684
- e = [
685
- h(z, {
794
+ case r.NUMBER: {
795
+ const { onStepUp: a, onStepDown: o } = this.$attrs;
796
+ n = [
797
+ y(Z, {
686
798
  mode: "up",
687
- disabled: this.isDisabled || n.max !== void 0 && n.modelValue === n.max,
799
+ disabled: this.isDisabled || t.max !== void 0 && t.modelValue === t.max,
688
800
  label: this.labelStepUp,
689
- onStepUp: l,
690
- onStepDown: d
801
+ onStepUp: a,
802
+ onStepDown: o
691
803
  }),
692
- h(z, {
804
+ y(Z, {
693
805
  mode: "down",
694
- disabled: this.isDisabled || n.min !== void 0 && n.modelValue === n.min,
806
+ disabled: this.isDisabled || t.min !== void 0 && t.modelValue === t.min,
695
807
  label: this.labelStepDown,
696
- onStepUp: l,
697
- onStepDown: d
808
+ onStepUp: a,
809
+ onStepDown: o
698
810
  })
699
811
  ];
700
812
  break;
701
813
  }
702
814
  }
703
- return Array.isArray(e) ? h("div", { class: "vv-input-text__actions-group" }, e) : e;
815
+ return Array.isArray(n) ? y("div", { class: "vv-input-text__actions-group" }, n) : n;
704
816
  }
705
817
  };
706
818
  }
707
- const Qe = ["for"], Ze = { class: "vv-input-text__wrapper" }, et = {
819
+ const yt = (e) => l(() => String((e == null ? void 0 : e.value) || ze()));
820
+ function wt(e, t, n = 0) {
821
+ let a;
822
+ return typeof n == "string" && (n = parseInt(n)), l({
823
+ get: () => e == null ? void 0 : e.value,
824
+ set: (o) => {
825
+ a && clearTimeout(a), a = setTimeout(() => {
826
+ t("update:modelValue", o);
827
+ }, n);
828
+ }
829
+ });
830
+ }
831
+ function Et(e, t) {
832
+ const { focused: n } = je(e);
833
+ return ve(n, (a) => {
834
+ t(a ? "focus" : "blur", s(e));
835
+ }), {
836
+ focused: n
837
+ };
838
+ }
839
+ function It(e, t) {
840
+ const n = l(
841
+ () => Boolean((e == null ? void 0 : e.value) && t.value === x.before)
842
+ ), a = l(
843
+ () => Boolean((e == null ? void 0 : e.value) && t.value === x.after)
844
+ ), o = l(
845
+ () => Boolean((e == null ? void 0 : e.value) && t.value === T.left)
846
+ ), p = l(
847
+ () => Boolean((e == null ? void 0 : e.value) && t.value === T.right)
848
+ ), d = l(
849
+ () => Boolean((e == null ? void 0 : e.value) && t.value === T.top)
850
+ ), A = l(
851
+ () => Boolean((e == null ? void 0 : e.value) && t.value === T.bottom)
852
+ );
853
+ return {
854
+ hasIcon: l(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
855
+ hasIconLeft: o,
856
+ hasIconRight: p,
857
+ hasIconTop: d,
858
+ hasIconBottom: A,
859
+ hasIconBefore: n,
860
+ hasIconAfter: a
861
+ };
862
+ }
863
+ function _t(e, t) {
864
+ const n = l(() => (s(e) ?? "").length), a = l(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && n.value < (t == null ? void 0 : t.lowerLimit) ? n.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && n.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - n.value : 0), o = l(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${n.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? a.value === 0 ? void 0 : a : n.value);
865
+ return {
866
+ length: n,
867
+ gap: a,
868
+ formatted: o
869
+ };
870
+ }
871
+ const At = ["for"], Dt = { class: "vv-input-text__wrapper" }, Ot = {
708
872
  key: 0,
709
873
  class: "vv-input-text__input-before"
710
- }, tt = { class: "vv-input-text__inner" }, ot = ["id"], nt = {
874
+ }, Tt = { class: "vv-input-text__inner" }, Ct = ["id"], Pt = {
711
875
  key: 1,
712
876
  class: "vv-input-text__input-after"
713
- }, st = {
877
+ }, Bt = {
714
878
  key: 2,
715
879
  class: "vv-input-text__limit"
716
- }, at = {
880
+ }, Ht = {
717
881
  name: "VvInputText"
718
- }, rt = /* @__PURE__ */ ie({
719
- ...at,
720
- props: Ge,
721
- emits: Je,
722
- setup(t, { emit: n }) {
723
- const e = t, l = useSlots(), d = ref(), {
724
- id: v,
725
- icon: u,
726
- iconPosition: T,
727
- label: y,
728
- modelValue: f,
729
- count: s,
730
- valid: a,
882
+ }, Vt = /* @__PURE__ */ L({
883
+ ...Ht,
884
+ props: gt,
885
+ emits: ht,
886
+ setup(e, { emit: t }) {
887
+ const n = e, a = xe(), o = j(), {
888
+ id: p,
889
+ icon: d,
890
+ iconPosition: A,
891
+ label: w,
892
+ modelValue: m,
893
+ count: i,
894
+ valid: u,
731
895
  invalid: S,
732
- loading: c
733
- } = toRefs(e), m = useUniqueId(v), w = computed(() => `${m.value}-hint`), H = computed(
734
- () => e.floating && isEmpty(e.placeholder) ? " " : e.placeholder
735
- ), b = useDebouncedInput(f, n, e.debounce), { focused: D } = useComponentFocus(d, n), N = useElementVisibility(d);
736
- watch(N, (r) => {
737
- r && e.autofocus && (D.value = !0);
896
+ loading: v
897
+ } = U(n), b = yt(p), E = l(() => `${b.value}-hint`), N = l(
898
+ () => n.floating && R(n.placeholder) ? " " : n.placeholder
899
+ ), h = wt(m, t, n.debounce), { focused: C } = Et(o, t), W = We(o);
900
+ ve(W, (c) => {
901
+ c && n.autofocus && (C.value = !0);
738
902
  });
739
- const P = ref(!1), R = computed(() => e.type === o.PASSWORD), I = () => {
740
- P.value = !P.value;
741
- }, re = computed(
742
- () => e.type === o.TIME || e.type === o.DATETIME_LOCAL || e.type === o.DATE || e.type === o.WEEK || e.type === o.MONTH
743
- ), ue = computed(() => e.type === o.NUMBER), J = () => {
744
- $.value && (d.value.stepUp(), b.value = unref(d).value);
745
- }, G = () => {
746
- $.value && (d.value.stepDown(), b.value = unref(d).value);
747
- }, de = computed(() => e.type === o.SEARCH), Q = () => {
748
- b.value = void 0;
749
- }, { hasIcon: Z, hasIconBefore: ee, hasIconAfter: M } = useComponentIcon(
750
- u,
751
- T
752
- ), k = computed(() => {
753
- switch (e.type) {
754
- case o.COLOR:
755
- return { name: E.COLOR };
756
- case o.DATE:
757
- case o.DATETIME_LOCAL:
758
- case o.WEEK:
759
- case o.MONTH:
760
- return { name: E.DATE };
761
- case o.TIME:
762
- return { name: E.TIME };
903
+ const B = j(!1), V = l(() => n.type === r.PASSWORD), D = () => {
904
+ B.value = !B.value;
905
+ }, ge = l(
906
+ () => n.type === r.TIME || n.type === r.DATETIME_LOCAL || n.type === r.DATE || n.type === r.WEEK || n.type === r.MONTH
907
+ ), ye = l(() => n.type === r.NUMBER), ne = () => {
908
+ z.value && (o.value.stepUp(), h.value = s(o).value);
909
+ }, ae = () => {
910
+ z.value && (o.value.stepDown(), h.value = s(o).value);
911
+ }, we = l(() => n.type === r.SEARCH), re = () => {
912
+ h.value = void 0;
913
+ }, { hasIcon: le, hasIconBefore: oe, hasIconAfter: F } = It(
914
+ d,
915
+ A
916
+ ), q = l(() => {
917
+ switch (n.type) {
918
+ case r.COLOR:
919
+ return { name: I.COLOR };
920
+ case r.DATE:
921
+ case r.DATETIME_LOCAL:
922
+ case r.WEEK:
923
+ case r.MONTH:
924
+ return { name: I.DATE };
925
+ case r.TIME:
926
+ return { name: I.TIME };
763
927
  default:
764
928
  return "";
765
929
  }
766
- }), { formatted: ce } = useTextCount(b, {
767
- mode: e.count,
768
- upperLimit: e.maxlength,
769
- lowerLimit: e.minlength
770
- }), $ = computed(() => !e.disabled && !e.readonly), pe = computed(
771
- () => $.value ? e.tabindex : -1
772
- ), te = computed(() => !isEmpty(f)), ve = computed(() => {
930
+ }), { formatted: Ee } = _t(h, {
931
+ mode: n.count,
932
+ upperLimit: n.maxlength,
933
+ lowerLimit: n.minlength
934
+ }), z = l(() => !n.disabled && !n.readonly), Ie = l(
935
+ () => z.value ? n.tabindex : -1
936
+ ), se = l(() => !R(m)), _e = l(() => {
773
937
  if (S.value === !0)
774
938
  return !0;
775
- if (a.value === !0)
939
+ if (u.value === !0)
776
940
  return !1;
777
- }), { modifiers: fe } = toRefs(e), me = useBemModifiers(
941
+ }), { modifiers: Ae } = U(n), De = be(
778
942
  "vv-input-text",
779
- fe,
780
- computed(() => ({
781
- valid: a.value,
943
+ Ae,
944
+ l(() => ({
945
+ valid: u.value,
782
946
  invalid: S.value,
783
- loading: c.value,
784
- disabled: e.disabled,
785
- readonly: e.readonly,
786
- "icon-before": ee.value,
787
- "icon-after": M.value || !isEmpty(k),
788
- floating: e.floating && !isEmpty(e.label),
789
- dirty: te.value,
790
- focus: D.value
947
+ loading: v.value,
948
+ disabled: n.disabled,
949
+ readonly: n.readonly,
950
+ "icon-before": oe.value,
951
+ "icon-after": F.value || !R(q),
952
+ floating: n.floating && !R(n.label),
953
+ dirty: se.value,
954
+ focus: C.value
791
955
  }))
792
- ), he = computed(() => {
793
- const r = (() => R.value && P.value || re.value && !te.value && !D.value ? o.TEXT : e.type)(), p = {
794
- type: r,
795
- name: e.name,
796
- tabindex: pe.value,
797
- disabled: e.disabled,
798
- readonly: e.readonly,
799
- required: e.required,
800
- autocomplete: e.autocomplete,
801
- "aria-invalid": ve.value,
802
- "aria-describedby": !oe.value && be.value ? w.value : void 0,
803
- "aria-errormessage": oe.value ? w.value : void 0
956
+ ), Oe = l(() => {
957
+ const c = (() => V.value && B.value || ge.value && !se.value && !C.value ? r.TEXT : n.type)(), f = {
958
+ type: c,
959
+ name: n.name,
960
+ tabindex: Ie.value,
961
+ disabled: n.disabled,
962
+ readonly: n.readonly,
963
+ required: n.required,
964
+ autocomplete: n.autocomplete,
965
+ "aria-invalid": _e.value,
966
+ "aria-describedby": !ie.value && Ce.value ? E.value : void 0,
967
+ "aria-errormessage": ie.value ? E.value : void 0
804
968
  };
805
- return (r === o.DATE || r === o.MONTH || r === o.WEEK || r === o.TIME || r === o.DATETIME_LOCAL || r === o.NUMBER) && (p.step = e.step, p.max = String(e.max), p.min = String(e.min)), (r === o.TEXT || r === o.SEARCH || r === o.URL || r === o.TEL || r === o.EMAIL || r === o.PASSWORD || r === o.NUMBER) && (p.placeholder = H.value), (r === o.TEXT || r === o.SEARCH || r === o.URL || r === o.TEL || r === o.EMAIL || r === o.PASSWORD) && (p.minlength = e.minlength, p.maxlength = e.maxlength, p.pattern = e.pattern), r === o.EMAIL && (p.multiple = e.multiple), p;
806
- }), L = computed(() => ({
807
- valid: e.valid,
808
- invalid: e.invalid,
809
- modelValue: e.modelValue,
810
- togglePassword: I,
811
- stepUp: J,
812
- stepDown: G,
813
- clear: Q
814
- })), { HintSlot: Se, hasHint: be, hasInvalid: oe } = Oe(e, l), ge = X(
815
- o.PASSWORD,
816
- e
817
- ), ye = X(
818
- o.NUMBER,
819
- e
820
- ), we = X(
821
- o.SEARCH,
822
- e
969
+ return (c === r.DATE || c === r.MONTH || c === r.WEEK || c === r.TIME || c === r.DATETIME_LOCAL || c === r.NUMBER) && (f.step = n.step, f.max = String(n.max), f.min = String(n.min)), (c === r.TEXT || c === r.SEARCH || c === r.URL || c === r.TEL || c === r.EMAIL || c === r.PASSWORD || c === r.NUMBER) && (f.placeholder = N.value), (c === r.TEXT || c === r.SEARCH || c === r.URL || c === r.TEL || c === r.EMAIL || c === r.PASSWORD) && (f.minlength = n.minlength, f.maxlength = n.maxlength, f.pattern = n.pattern), c === r.EMAIL && (f.multiple = n.multiple), f;
970
+ }), K = l(() => ({
971
+ valid: n.valid,
972
+ invalid: n.invalid,
973
+ modelValue: n.modelValue,
974
+ togglePassword: D,
975
+ stepUp: ne,
976
+ stepDown: ae,
977
+ clear: re
978
+ })), { HintSlot: Te, hasHint: Ce, hasInvalid: ie } = Xe(n, a), Pe = ee(
979
+ r.PASSWORD,
980
+ n
981
+ ), Be = ee(
982
+ r.NUMBER,
983
+ n
984
+ ), He = ee(
985
+ r.SEARCH,
986
+ n
823
987
  );
824
- return (r, p) => (g(), O("div", {
825
- class: Ee(i(me))
988
+ return (c, f) => (g(), H("div", {
989
+ class: Le(s(De))
826
990
  }, [
827
- i(y) ? (g(), O("label", {
991
+ s(w) ? (g(), H("label", {
828
992
  key: 0,
829
- for: i(m),
993
+ for: s(b),
830
994
  class: "vv-input-text__label"
831
- }, ne(i(y)), 9, Qe)) : _("", !0),
832
- W("div", Ze, [
833
- r.$slots.before ? (g(), O("div", et, [
834
- F(r.$slots, "before", j(q(i(L))))
835
- ])) : _("", !0),
836
- W("div", tt, [
837
- i(ee) ? (g(), C(A, V({
995
+ }, ue(s(w)), 9, At)) : O("", !0),
996
+ Y("div", Dt, [
997
+ c.$slots.before ? (g(), H("div", Ot, [
998
+ J(c.$slots, "before", G(Q(s(K))))
999
+ ])) : O("", !0),
1000
+ Y("div", Tt, [
1001
+ s(oe) ? (g(), P(_, $({
838
1002
  key: 0,
839
1003
  class: "vv-input-text__icon"
840
- }, i(Z)), null, 16)) : _("", !0),
841
- Ae(W("input", V({
842
- id: i(m),
1004
+ }, s(le)), null, 16)) : O("", !0),
1005
+ Ne(Y("input", $({
1006
+ id: s(b),
843
1007
  ref_key: "input",
844
- ref: d,
845
- "onUpdate:modelValue": p[0] || (p[0] = (U) => Ie(b) ? b.value = U : null)
846
- }, i(he), {
847
- onKeyup: p[1] || (p[1] = (U) => n("keyup", U))
848
- }), null, 16, ot), [
849
- [_e, i(b)]
1008
+ ref: o,
1009
+ "onUpdate:modelValue": f[0] || (f[0] = (X) => Ve(h) ? h.value = X : null)
1010
+ }, s(Oe), {
1011
+ onKeyup: f[1] || (f[1] = (X) => t("keyup", X))
1012
+ }), null, 16, Ct), [
1013
+ [ke, s(h)]
850
1014
  ]),
851
- i(M) || i(k) ? (g(), C(A, V({
1015
+ s(F) || s(q) ? (g(), P(_, $({
852
1016
  key: 1,
853
1017
  class: "vv-input-text__icon vv-input-text__icon-after"
854
- }, i(M) ? i(Z) : i(k)), null, 16)) : i(R) ? (g(), C(i(ge), {
1018
+ }, s(F) ? s(le) : s(q)), null, 16)) : s(V) ? (g(), P(s(Pe), {
855
1019
  key: 2,
856
- onTogglePassword: I
857
- })) : i(ue) ? (g(), C(i(ye), {
1020
+ onTogglePassword: D
1021
+ })) : s(ye) ? (g(), P(s(Be), {
858
1022
  key: 3,
859
- onStepUp: J,
860
- onStepDown: G
861
- })) : i(de) ? (g(), C(i(we), {
1023
+ onStepUp: ne,
1024
+ onStepDown: ae
1025
+ })) : s(we) ? (g(), P(s(He), {
862
1026
  key: 4,
863
- onClear: Q
864
- })) : _("", !0)
1027
+ onClear: re
1028
+ })) : O("", !0)
865
1029
  ]),
866
- r.$slots.after ? (g(), O("div", nt, [
867
- F(r.$slots, "after", j(q(i(L))))
868
- ])) : _("", !0),
869
- i(s) ? (g(), O("span", st, [
870
- F(r.$slots, "count", j(q(i(L))), () => [
871
- De(ne(i(ce)), 1)
1030
+ c.$slots.after ? (g(), H("div", Pt, [
1031
+ J(c.$slots, "after", G(Q(s(K))))
1032
+ ])) : O("", !0),
1033
+ s(i) ? (g(), H("span", Bt, [
1034
+ J(c.$slots, "count", G(Q(s(K))), () => [
1035
+ Me(ue(s(Ee)), 1)
872
1036
  ])
873
- ])) : _("", !0)
1037
+ ])) : O("", !0)
874
1038
  ]),
875
- Ce(i(Se), {
876
- id: i(w),
1039
+ $e(s(Te), {
1040
+ id: s(E),
877
1041
  class: "vv-input-text__hint"
878
1042
  }, null, 8, ["id"])
879
1043
  ], 2));
880
1044
  }
881
1045
  });
882
1046
  export {
883
- rt as default
1047
+ Vt as default
884
1048
  };