@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 U, unref as a, openBlock as y, createBlock as z, mergeProps as E, createCommentVNode as _, createElementBlock as P, normalizeClass as ne, toDisplayString as R, createElementVNode as A, renderSlot as O, normalizeProps as j, guardReactiveProps as T, withDirectives as ae, isRef as se, vModelText as ie, createTextVNode as le, createVNode as ue } from "vue";
2
- import { iconExists as N, Icon as ce, addIcon as de } from "@iconify/vue";
3
- function k(t) {
4
- return Array.isArray(t) ? t.filter((s) => isString(s)).join(" ") : t;
1
+ import { unref as u, toRefs as T, computed as o, h as pe, inject as me, defineComponent as Y, ref as G, openBlock as b, createBlock as M, mergeProps as E, createCommentVNode as B, watch as Q, useSlots as ge, createElementBlock as $, normalizeClass as he, toDisplayString as J, createElementVNode as D, renderSlot as z, normalizeProps as H, guardReactiveProps as q, withDirectives as be, isRef as ye, vModelText as Se, createTextVNode as _e, createVNode as Be } from "vue";
2
+ import { toReactive as we, useFocus as Ie, useElementVisibility as xe } from "@vueuse/core";
3
+ import { iconExists as N, Icon as $e, addIcon as Pe } from "@iconify/vue";
4
+ import { nanoid as Ve } from "nanoid";
5
+ function U(e, t) {
6
+ if (e && Object.keys(e).length && t) {
7
+ if (t.indexOf(".") === -1)
8
+ return e[t];
9
+ {
10
+ const r = t.split(".");
11
+ let a = e;
12
+ for (let i = 0, c = r.length; i < c; ++i) {
13
+ if (e == null)
14
+ return null;
15
+ a = a[r[i]];
16
+ }
17
+ return a;
18
+ }
19
+ } else
20
+ return null;
21
+ }
22
+ function A(e) {
23
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(u(e));
24
+ }
25
+ function ke(e) {
26
+ return typeof e == "string" || e instanceof String;
5
27
  }
6
- function pe(t, s) {
28
+ function j(e) {
29
+ return Array.isArray(e) ? e.filter((t) => ke(t)).join(" ") : e;
30
+ }
31
+ function Oe(e, t) {
7
32
  const {
8
- invalid: e,
9
- valid: l,
10
- hint: c,
11
- loading: m
12
- } = s, {
13
- hintLabel: n,
14
- modelValue: B,
15
- valid: f,
16
- validLabel: u,
17
- invalid: o,
18
- invalidLabel: r,
19
- ...d
20
- } = toRefs(t), i = resolveFieldData(d, "loading"), p = resolveFieldData(d, "loadingLabel"), v = computed(() => o.value ? !!(o.value && e || r != null && r.value && Array.isArray(r.value) && r.value.length > 0 || r != null && r.value && !isEmpty(r)) : !1), w = computed(
21
- () => !!(n && n.value || c)
22
- ), x = computed(
23
- () => !!(u && u.value || l)
24
- ), g = computed(
25
- () => !!(i != null && i.value && m || i != null && i.value && (p != null && p.value))
26
- ), V = computed(
27
- () => w.value || x.value || v.value || g.value
33
+ invalid: r,
34
+ valid: a,
35
+ hint: i,
36
+ loading: c
37
+ } = t, {
38
+ hintLabel: s,
39
+ modelValue: y,
40
+ valid: v,
41
+ validLabel: f,
42
+ invalid: n,
43
+ invalidLabel: l,
44
+ ...p
45
+ } = T(e), d = U(p, "loading"), m = U(p, "loadingLabel"), g = o(() => n.value ? !!(n.value && r || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !A(l)) : !1), I = o(
46
+ () => !!(s && s.value || i)
47
+ ), x = o(
48
+ () => !!(f && f.value || a)
49
+ ), h = o(
50
+ () => !!(d != null && d.value && c || d != null && d.value && (m != null && m.value))
51
+ ), V = o(
52
+ () => I.value || x.value || g.value || h.value
28
53
  );
29
54
  return {
30
- hasInvalid: v,
31
- hasHint: w,
55
+ hasInvalid: g,
56
+ hasHint: I,
32
57
  hasValid: x,
33
- hasLoading: g,
58
+ hasLoading: h,
34
59
  HintSlot: {
35
60
  name: "HintSlot",
36
61
  props: {
@@ -39,31 +64,31 @@ function pe(t, s) {
39
64
  default: () => ({})
40
65
  }
41
66
  },
42
- setup(I) {
43
- const $ = computed(() => {
44
- const b = toReactive({
45
- hintLabel: n,
46
- modelValue: B,
47
- valid: f,
48
- validLabel: u,
49
- invalid: o,
50
- invalidLabel: r,
51
- loading: i,
52
- loadingLabel: p,
53
- ...I.params
67
+ setup(k) {
68
+ const O = o(() => {
69
+ const S = we({
70
+ hintLabel: s,
71
+ modelValue: y,
72
+ valid: v,
73
+ validLabel: f,
74
+ invalid: n,
75
+ invalidLabel: l,
76
+ loading: d,
77
+ loadingLabel: m,
78
+ ...k.params
54
79
  });
55
- return o != null && o.value ? (e == null ? void 0 : e(b)) || k(r == null ? void 0 : r.value) || (n == null ? void 0 : n.value) : f != null && f.value ? (l == null ? void 0 : l(b)) || k(u == null ? void 0 : u.value) || (n == null ? void 0 : n.value) : i != null && i.value ? (m == null ? void 0 : m(b)) || k(p == null ? void 0 : p.value) || (n == null ? void 0 : n.value) : (c == null ? void 0 : c(b)) || k(n == null ? void 0 : n.value) || (n == null ? void 0 : n.value);
80
+ return n != null && n.value ? (r == null ? void 0 : r(S)) || j(l == null ? void 0 : l.value) || (s == null ? void 0 : s.value) : v != null && v.value ? (a == null ? void 0 : a(S)) || j(f == null ? void 0 : f.value) || (s == null ? void 0 : s.value) : d != null && d.value ? (c == null ? void 0 : c(S)) || j(m == null ? void 0 : m.value) || (s == null ? void 0 : s.value) : (i == null ? void 0 : i(S)) || j(s == null ? void 0 : s.value) || (s == null ? void 0 : s.value);
56
81
  });
57
82
  return {
58
83
  isVisible: V,
59
- hasInvalid: v,
84
+ hasInvalid: g,
60
85
  hasValid: x,
61
- hintContent: $
86
+ hintContent: O
62
87
  };
63
88
  },
64
89
  render() {
65
90
  if (this.isVisible)
66
- return h(
91
+ return pe(
67
92
  "small",
68
93
  {
69
94
  role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
@@ -74,7 +99,7 @@ function pe(t, s) {
74
99
  }
75
100
  };
76
101
  }
77
- const fe = {
102
+ const Ce = {
78
103
  /**
79
104
  * Color
80
105
  */
@@ -167,102 +192,180 @@ const fe = {
167
192
  modifiers: {
168
193
  type: [String, Array]
169
194
  }
170
- }, ve = {
195
+ };
196
+ var w = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(w || {}), X = /* @__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))(X || {}), P = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(P || {}), R = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(R || {}), Z = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(Z || {});
197
+ const Ne = Symbol.for("volver");
198
+ function je() {
199
+ return me(Ne);
200
+ }
201
+ function ee(e, t, r) {
202
+ return o(() => {
203
+ const a = {
204
+ [e]: !0
205
+ }, i = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
206
+ return i && Array.isArray(i) && i.forEach((c) => {
207
+ a[`${e}--${c}`] = !0;
208
+ }), r && Object.keys(r.value).forEach((c) => {
209
+ a[`${e}--${c}`] = u(r.value[c]);
210
+ }), a;
211
+ });
212
+ }
213
+ const Ee = {
171
214
  name: "VvIcon"
172
- }, K = /* @__PURE__ */ U({
173
- ...ve,
174
- props: fe,
175
- setup(t) {
176
- const s = t, e = ref(!0), l = useVolver(), { modifiers: c } = toRefs(s), m = useBemModifiers("vv-icon", c), n = computed(() => s.provider || (l == null ? void 0 : l.provider)), B = computed(() => {
177
- const o = s.name ?? "", r = `@${n.value}:${s.prefix}:${s.name}`;
178
- return N(o) ? o : N(r) ? r : (l == null ? void 0 : l.iconsCollections.find(
179
- (d) => {
180
- const i = `@${n.value}:${d.prefix}:${o}`;
181
- if (N(i))
182
- return i;
215
+ }, W = /* @__PURE__ */ Y({
216
+ ...Ee,
217
+ props: Ce,
218
+ setup(e) {
219
+ const t = e, r = G(!0), a = je(), { modifiers: i } = T(t), c = ee("vv-icon", i), s = o(() => t.provider || (a == null ? void 0 : a.provider)), y = o(() => {
220
+ const n = t.name ?? "", l = `@${s.value}:${t.prefix}:${t.name}`;
221
+ return N(n) ? n : N(l) ? l : (a == null ? void 0 : a.iconsCollections.find(
222
+ (p) => {
223
+ const d = `@${s.value}:${p.prefix}:${n}`;
224
+ if (N(d))
225
+ return d;
183
226
  }
184
- )) || o;
227
+ )) || n;
185
228
  });
186
- function f(o) {
187
- let r = null;
229
+ function v(n) {
230
+ let l = null;
188
231
  if (typeof window > "u") {
189
- const { JSDOM: v } = require("jsdom");
190
- r = new v().window;
232
+ const { JSDOM: g } = require("jsdom");
233
+ l = new g().window;
191
234
  }
192
- return (r ? new r.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
235
+ return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
193
236
  }
194
- function u(o) {
195
- const r = f(o), d = (r == null ? void 0 : r.innerHTML.trim()) || "";
196
- r && d && de(`@${n.value}:${s.prefix}:${s.name}`, {
197
- body: d,
237
+ function f(n) {
238
+ const l = v(n), p = (l == null ? void 0 : l.innerHTML.trim()) || "";
239
+ l && p && Pe(`@${s.value}:${t.prefix}:${t.name}`, {
240
+ body: p,
198
241
  // Set height and width from svg content
199
- height: r.viewBox.baseVal.height,
200
- width: r.viewBox.baseVal.width
242
+ height: l.viewBox.baseVal.height,
243
+ width: l.viewBox.baseVal.width
201
244
  });
202
245
  }
203
- return l && (s.src && !N(`@${n.value}:${s.prefix}:${s.name}`) ? (e.value = !1, l.fetchIcon(s.src).then((o) => {
204
- o && (u(o), e.value = !0);
205
- }).catch((o) => {
206
- throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
207
- })) : s.svg && u(s.svg)), (o, r) => a(e) ? (y(), z(a(ce), E({
246
+ return a && (t.src && !N(`@${s.value}:${t.prefix}:${t.name}`) ? (r.value = !1, a.fetchIcon(t.src).then((n) => {
247
+ n && (f(n), r.value = !0);
248
+ }).catch((n) => {
249
+ throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
250
+ })) : t.svg && f(t.svg)), (n, l) => u(r) ? (b(), M(u($e), E({
208
251
  key: 0,
209
- class: a(m)
252
+ class: u(c)
210
253
  }, {
211
- inline: o.inline,
212
- width: o.width,
213
- height: o.height,
214
- horizontalFlip: o.horizontalFlip,
215
- verticalFlip: o.verticalFlip,
216
- flip: o.flip,
217
- rotate: o.rotate,
218
- color: o.color,
219
- onLoad: o.onLoad,
220
- icon: a(B)
221
- }), null, 16, ["class"])) : _("", !0);
254
+ inline: n.inline,
255
+ width: n.width,
256
+ height: n.height,
257
+ horizontalFlip: n.horizontalFlip,
258
+ verticalFlip: n.verticalFlip,
259
+ flip: n.flip,
260
+ rotate: n.rotate,
261
+ color: n.color,
262
+ onLoad: n.onLoad,
263
+ icon: u(y)
264
+ }), null, 16, ["class"])) : B("", !0);
222
265
  }
223
- });
224
- var H = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(H || {}), W = /* @__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))(W || {}), M = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(M || {});
225
- const me = {
266
+ }), Ae = {
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(Z).includes(e)
284
+ },
285
+ /**
286
+ * Anchor rel
287
+ */
288
+ rel: {
289
+ type: String,
290
+ default: "noopener noreferrer"
291
+ }
292
+ }, Fe = {
293
+ /**
294
+ * Valid status
295
+ */
226
296
  valid: Boolean,
297
+ /**
298
+ * Valid label
299
+ */
227
300
  validLabel: [String, Array]
228
- }, ge = {
301
+ }, Le = {
302
+ /**
303
+ * Invalid status
304
+ */
229
305
  invalid: Boolean,
306
+ /**
307
+ * Invalid label
308
+ */
230
309
  invalidLabel: [String, Array]
231
- }, he = {
310
+ }, De = {
311
+ /**
312
+ * Loading status
313
+ */
232
314
  loading: Boolean,
233
- loadingLabel: String
234
- }, ye = {
315
+ /**
316
+ * Loading label
317
+ */
318
+ loadingLabel: {
319
+ type: String,
320
+ default: "Loading..."
321
+ }
322
+ }, te = {
235
323
  /**
236
324
  * Whether the form control is disabled
237
325
  */
238
326
  disabled: Boolean
239
- }, be = {
327
+ }, ze = {
328
+ /**
329
+ * Whether the item is active
330
+ */
331
+ active: Boolean
332
+ }, He = {
333
+ /**
334
+ * Whether the item is pressed
335
+ */
336
+ pressed: Boolean
337
+ }, re = {
338
+ /**
339
+ * The item label
340
+ */
341
+ label: [String, Number]
342
+ }, qe = {
240
343
  /**
241
344
  * The value is not editable
242
345
  */
243
346
  readonly: Boolean
244
- }, Se = {
347
+ }, Me = {
245
348
  /**
246
349
  * Component BEM modifiers
247
350
  */
248
351
  modifiers: [String, Array]
249
- }, _e = {
352
+ }, Re = {
250
353
  hintLabel: { type: String, default: "" }
251
- }, we = {
354
+ }, Te = {
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
- }, Be = {
363
+ }, Ke = {
261
364
  /**
262
365
  * Milliseconds to wait before emitting the input event
263
366
  */
264
367
  debounce: [Number, String]
265
- }, xe = {
368
+ }, Je = {
266
369
  /**
267
370
  * VvIcon name or props
268
371
  * @see VVIcon
@@ -273,64 +376,65 @@ const me = {
273
376
  */
274
377
  iconPosition: {
275
378
  type: String,
276
- default: M.before,
277
- validation: (t) => Object.values(M).includes(t)
379
+ default: P.before,
380
+ validation: (e) => Object.values(P).includes(e)
278
381
  }
279
- }, Pe = {
382
+ }, Ue = {
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
- }, Ve = {
388
+ }, We = {
286
389
  /**
287
390
  * If true the label will be floating
288
391
  */
289
392
  floating: Boolean
290
- }, Ie = {
393
+ }, Ye = {
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
- H.bottom;
298
- const $e = {
299
- ...Ie,
400
+ w.bottom;
401
+ const Ge = {
402
+ ...Ye,
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
- }, Ce = {
409
+ }, Qe = {
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
- }, Ne = {
415
+ }, Xe = {
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
- }, ke = {
319
- ...$e,
320
- ...Ce,
321
- ...Ne,
322
- ...Pe,
323
- ...ye,
324
- ...be,
325
- ...me,
326
- ...ge,
327
- ..._e,
328
- ...he,
329
- ...Se,
330
- ...we,
331
- ...Be,
332
- ...xe,
333
- ...Ve,
421
+ }, Ze = {
422
+ ...Ge,
423
+ ...Qe,
424
+ ...Xe,
425
+ ...Ue,
426
+ ...te,
427
+ ...qe,
428
+ ...Fe,
429
+ ...Le,
430
+ ...Re,
431
+ ...De,
432
+ ...Me,
433
+ ...Te,
434
+ ...Ke,
435
+ ...Je,
436
+ ...We,
437
+ ...re,
334
438
  /**
335
439
  * Input / Textarea minlength
336
440
  * Minimum length (number of characters) of value
@@ -358,20 +462,28 @@ const $e = {
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
+ ...te,
469
+ ...re,
470
+ ...He,
471
+ ...ze,
472
+ ...Ae,
362
473
  /**
363
- * <label> value for the Input / Textarea
474
+ * Button type
364
475
  */
365
- label: String
366
- }, Ee = {
476
+ type: R.button
477
+ });
478
+ const et = {
367
479
  hard: "hard",
368
480
  soft: "soft"
369
- }, Fe = {
481
+ }, tt = {
370
482
  true: !0,
371
483
  false: !1,
372
484
  default: "default"
373
- }, De = ["update:modelValue", "focus", "blur", "keyup"], Ae = {
374
- ...ke,
485
+ }, rt = ["update:modelValue", "focus", "blur", "keyup"], at = {
486
+ ...Ze,
375
487
  /**
376
488
  * Textarea value
377
489
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#value
@@ -391,157 +503,209 @@ const $e = {
391
503
  * Indicates how the control should wrap the value for form submission.
392
504
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#wrap
393
505
  */
394
- wrap: { type: String, default: Ee.soft },
506
+ wrap: { type: String, default: et.soft },
395
507
  /**
396
508
  * Specifies whether the <textarea> is subject to spell checking by the underlying browser/OS.
397
509
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#wrap
398
510
  */
399
- spellcheck: { type: [Boolean, String], default: Fe.default },
511
+ spellcheck: { type: [Boolean, String], default: tt.default },
400
512
  /**
401
513
  * If true, the textarea will be resizable
402
514
  */
403
515
  resizable: Boolean
404
- }, Oe = ["for"], je = { class: "vv-textarea__wrapper" }, Te = {
516
+ }, nt = (e) => o(() => String((e == null ? void 0 : e.value) || Ve()));
517
+ function lt(e, t, r = 0) {
518
+ let a;
519
+ return typeof r == "string" && (r = parseInt(r)), o({
520
+ get: () => e == null ? void 0 : e.value,
521
+ set: (i) => {
522
+ a && clearTimeout(a), a = setTimeout(() => {
523
+ t("update:modelValue", i);
524
+ }, r);
525
+ }
526
+ });
527
+ }
528
+ function ot(e, t) {
529
+ const r = o(
530
+ () => Boolean((e == null ? void 0 : e.value) && t.value === P.before)
531
+ ), a = o(
532
+ () => Boolean((e == null ? void 0 : e.value) && t.value === P.after)
533
+ ), i = o(
534
+ () => Boolean((e == null ? void 0 : e.value) && t.value === w.left)
535
+ ), c = o(
536
+ () => Boolean((e == null ? void 0 : e.value) && t.value === w.right)
537
+ ), s = o(
538
+ () => Boolean((e == null ? void 0 : e.value) && t.value === w.top)
539
+ ), y = o(
540
+ () => Boolean((e == null ? void 0 : e.value) && t.value === w.bottom)
541
+ );
542
+ return {
543
+ hasIcon: o(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
544
+ hasIconLeft: i,
545
+ hasIconRight: c,
546
+ hasIconTop: s,
547
+ hasIconBottom: y,
548
+ hasIconBefore: r,
549
+ hasIconAfter: a
550
+ };
551
+ }
552
+ function st(e, t) {
553
+ const { focused: r } = Ie(e);
554
+ return Q(r, (a) => {
555
+ t(a ? "focus" : "blur", u(e));
556
+ }), {
557
+ focused: r
558
+ };
559
+ }
560
+ function ut(e, t) {
561
+ const r = o(() => (u(e) ?? "").length), a = o(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && r.value < (t == null ? void 0 : t.lowerLimit) ? r.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && r.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - r.value : 0), i = o(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${r.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? a.value === 0 ? void 0 : a : r.value);
562
+ return {
563
+ length: r,
564
+ gap: a,
565
+ formatted: i
566
+ };
567
+ }
568
+ const it = ["for"], ct = { class: "vv-textarea__wrapper" }, dt = {
405
569
  key: 0,
406
570
  class: "vv-textarea__input-before"
407
- }, ze = { class: "vv-textarea__inner" }, He = ["id"], Me = {
571
+ }, ft = { class: "vv-textarea__inner" }, vt = ["id"], pt = {
408
572
  key: 1,
409
573
  class: "vv-textarea__input-after"
410
- }, qe = {
574
+ }, mt = {
411
575
  key: 2,
412
576
  class: "vv-textarea__limit"
413
- }, Re = {
577
+ }, gt = {
414
578
  name: "VvTextarea"
415
- }, We = /* @__PURE__ */ U({
416
- ...Re,
417
- props: Ae,
418
- emits: De,
419
- setup(t, { emit: s }) {
420
- const e = t, l = useSlots(), c = ref(), {
421
- id: m,
422
- icon: n,
423
- iconPosition: B,
424
- label: f,
425
- modelValue: u,
426
- count: o,
427
- valid: r,
428
- invalid: d,
429
- loading: i,
430
- modifiers: p
431
- } = toRefs(e), v = useUniqueId(m), w = computed(() => `${v.value}-hint`), x = computed(
432
- () => e.floating && isEmpty(e.placeholder) ? " " : e.placeholder
433
- ), g = useDebouncedInput(u, s, e.debounce), { hasIcon: V, hasIconBefore: I, hasIconAfter: $ } = useComponentIcon(
434
- n,
435
- B
436
- ), { focused: b } = useComponentFocus(c, s), J = useElementVisibility(c);
437
- watch(J, (S) => {
438
- S && e.autofocus && (b.value = !0);
579
+ }, _t = /* @__PURE__ */ Y({
580
+ ...gt,
581
+ props: at,
582
+ emits: rt,
583
+ setup(e, { emit: t }) {
584
+ const r = e, a = ge(), i = G(), {
585
+ id: c,
586
+ icon: s,
587
+ iconPosition: y,
588
+ label: v,
589
+ modelValue: f,
590
+ count: n,
591
+ valid: l,
592
+ invalid: p,
593
+ loading: d,
594
+ modifiers: m
595
+ } = T(r), g = nt(c), I = o(() => `${g.value}-hint`), x = o(
596
+ () => r.floating && A(r.placeholder) ? " " : r.placeholder
597
+ ), h = lt(f, t, r.debounce), { hasIcon: V, hasIconBefore: k, hasIconAfter: O } = ot(
598
+ s,
599
+ y
600
+ ), { focused: S } = st(i, t), ae = xe(i);
601
+ Q(ae, (_) => {
602
+ _ && r.autofocus && (S.value = !0);
439
603
  });
440
- const { formatted: L } = useTextCount(g, {
441
- mode: e.count,
442
- upperLimit: e.maxlength,
443
- lowerLimit: e.minlength
444
- }), G = computed(() => !e.disabled && !e.readonly), Q = computed(
445
- () => G.value ? e.tabindex : -1
446
- ), X = computed(() => !isEmpty(u)), Y = computed(() => {
447
- if (e.invalid === !0)
604
+ const { formatted: ne } = ut(h, {
605
+ mode: r.count,
606
+ upperLimit: r.maxlength,
607
+ lowerLimit: r.minlength
608
+ }), le = o(() => !r.disabled && !r.readonly), oe = o(
609
+ () => le.value ? r.tabindex : -1
610
+ ), se = o(() => !A(f)), ue = o(() => {
611
+ if (r.invalid === !0)
448
612
  return !0;
449
- if (e.valid === !0)
613
+ if (r.valid === !0)
450
614
  return !1;
451
- }), { HintSlot: Z, hasHint: ee, hasInvalid: q } = pe(e, l), te = useBemModifiers(
615
+ }), { HintSlot: ie, hasHint: ce, hasInvalid: K } = Oe(r, a), de = ee(
452
616
  "vv-textarea",
453
- p,
454
- computed(() => ({
455
- valid: r.value,
456
- invalid: d.value,
457
- loading: i.value,
458
- disabled: e.disabled,
459
- readonly: e.readonly,
460
- "icon-before": I.value,
461
- "icon-after": $.value,
462
- floating: e.floating && !isEmpty(e.label),
463
- dirty: X.value,
464
- focused: b.value,
465
- resizable: e.resizable
617
+ m,
618
+ o(() => ({
619
+ valid: l.value,
620
+ invalid: p.value,
621
+ loading: d.value,
622
+ disabled: r.disabled,
623
+ readonly: r.readonly,
624
+ "icon-before": k.value,
625
+ "icon-after": O.value,
626
+ floating: r.floating && !A(r.label),
627
+ dirty: se.value,
628
+ focused: S.value,
629
+ resizable: r.resizable
466
630
  }))
467
- ), oe = computed(
631
+ ), fe = o(
468
632
  () => ({
469
- name: e.name,
633
+ name: r.name,
470
634
  placeholder: x.value,
471
- tabindex: Q.value,
472
- disabled: e.disabled,
473
- readonly: e.readonly,
474
- required: e.required,
475
- autocomplete: e.autocomplete,
476
- minlength: e.minlength,
477
- maxlength: e.maxlength,
478
- cols: e.cols,
479
- rows: e.rows,
480
- wrap: e.wrap,
481
- spellcheck: e.spellcheck,
482
- "aria-invalid": Y.value,
483
- "aria-describedby": !q.value && ee.value ? w.value : void 0,
484
- "aria-errormessage": q.value ? w.value : void 0
635
+ tabindex: oe.value,
636
+ disabled: r.disabled,
637
+ readonly: r.readonly,
638
+ required: r.required,
639
+ autocomplete: r.autocomplete,
640
+ minlength: r.minlength,
641
+ maxlength: r.maxlength,
642
+ cols: r.cols,
643
+ rows: r.rows,
644
+ wrap: r.wrap,
645
+ spellcheck: r.spellcheck,
646
+ "aria-invalid": ue.value,
647
+ "aria-describedby": !K.value && ce.value ? I.value : void 0,
648
+ "aria-errormessage": K.value ? I.value : void 0
485
649
  })
486
- ), F = computed(() => ({
487
- valid: e.valid,
488
- invalid: e.invalid,
489
- modelValue: e.modelValue,
490
- hintLabel: e.hintLabel,
491
- maxlength: e.maxlength,
492
- minlength: e.minlength,
493
- clear: re
494
- })), re = () => {
495
- g.value = void 0;
650
+ ), F = o(() => ({
651
+ valid: r.valid,
652
+ invalid: r.invalid,
653
+ modelValue: r.modelValue,
654
+ hintLabel: r.hintLabel,
655
+ maxlength: r.maxlength,
656
+ minlength: r.minlength,
657
+ clear: ve
658
+ })), ve = () => {
659
+ h.value = void 0;
496
660
  };
497
- return (S, C) => (y(), P("div", {
498
- class: ne(a(te))
661
+ return (_, C) => (b(), $("div", {
662
+ class: he(u(de))
499
663
  }, [
500
- a(f) ? (y(), P("label", {
664
+ u(v) ? (b(), $("label", {
501
665
  key: 0,
502
- for: a(v),
666
+ for: u(g),
503
667
  class: "vv-textarea__label"
504
- }, R(a(f)), 9, Oe)) : _("", !0),
505
- A("div", je, [
506
- S.$slots.before ? (y(), P("div", Te, [
507
- O(S.$slots, "before", j(T(a(F))))
508
- ])) : _("", !0),
509
- A("div", ze, [
510
- a(I) ? (y(), z(K, E({
668
+ }, J(u(v)), 9, it)) : B("", !0),
669
+ D("div", ct, [
670
+ _.$slots.before ? (b(), $("div", dt, [
671
+ z(_.$slots, "before", H(q(u(F))))
672
+ ])) : B("", !0),
673
+ D("div", ft, [
674
+ u(k) ? (b(), M(W, E({
511
675
  key: 0,
512
676
  class: "vv-textarea__icon"
513
- }, a(V)), null, 16)) : _("", !0),
514
- ae(A("textarea", E({
515
- id: a(v),
677
+ }, u(V)), null, 16)) : B("", !0),
678
+ be(D("textarea", E({
679
+ id: u(g),
516
680
  ref_key: "textarea",
517
- ref: c,
518
- "onUpdate:modelValue": C[0] || (C[0] = (D) => se(g) ? g.value = D : null)
519
- }, a(oe), {
520
- onKeyup: C[1] || (C[1] = (D) => s("keyup", D))
521
- }), null, 16, He), [
522
- [ie, a(g)]
681
+ ref: i,
682
+ "onUpdate:modelValue": C[0] || (C[0] = (L) => ye(h) ? h.value = L : null)
683
+ }, u(fe), {
684
+ onKeyup: C[1] || (C[1] = (L) => t("keyup", L))
685
+ }), null, 16, vt), [
686
+ [Se, u(h)]
523
687
  ]),
524
- a($) ? (y(), z(K, E({
688
+ u(O) ? (b(), M(W, E({
525
689
  key: 1,
526
690
  class: "vv-textarea__icon vv-textarea__icon-after"
527
- }, a(V)), null, 16)) : _("", !0)
691
+ }, u(V)), null, 16)) : B("", !0)
528
692
  ]),
529
- S.$slots.after ? (y(), P("div", Me, [
530
- O(S.$slots, "after", j(T(a(F))))
531
- ])) : _("", !0),
532
- a(o) ? (y(), P("span", qe, [
533
- O(S.$slots, "count", j(T(a(F))), () => [
534
- le(R(a(L)), 1)
693
+ _.$slots.after ? (b(), $("div", pt, [
694
+ z(_.$slots, "after", H(q(u(F))))
695
+ ])) : B("", !0),
696
+ u(n) ? (b(), $("span", mt, [
697
+ z(_.$slots, "count", H(q(u(F))), () => [
698
+ _e(J(u(ne)), 1)
535
699
  ])
536
- ])) : _("", !0)
700
+ ])) : B("", !0)
537
701
  ]),
538
- ue(a(Z), {
539
- id: a(w),
702
+ Be(u(ie), {
703
+ id: u(I),
540
704
  class: "vv-textarea__hint"
541
705
  }, null, 8, ["id"])
542
706
  ], 2));
543
707
  }
544
708
  });
545
709
  export {
546
- We as default
710
+ _t as default
547
711
  };