@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,6 +1,8 @@
1
- import { defineComponent as X, unref as i, openBlock as f, createBlock as z, mergeProps as N, createCommentVNode as S, createElementBlock as b, normalizeClass as ie, toDisplayString as E, createElementVNode as k, renderSlot as J, normalizeProps as W, guardReactiveProps as G, withDirectives as ae, isRef as le, Fragment as ue, renderList as de, vModelSelect as ce, createVNode as pe } from "vue";
2
- import { iconExists as D, Icon as ve, addIcon as fe } from "@iconify/vue";
3
- const me = {
1
+ import { inject as ye, computed as u, unref as c, defineComponent as T, ref as x, toRefs as C, openBlock as b, createBlock as M, mergeProps as N, createCommentVNode as B, h as be, watch as ee, useSlots as me, createElementBlock as S, normalizeClass as he, toDisplayString as q, createElementVNode as H, renderSlot as Y, normalizeProps as G, guardReactiveProps as Q, withDirectives as Se, isRef as Be, Fragment as _e, renderList as Oe, vModelSelect as Ie, createVNode as Ve } from "vue";
2
+ import { iconExists as D, Icon as je, addIcon as $e } from "@iconify/vue";
3
+ import { toReactive as Pe, useFocus as we, useElementVisibility as Ae } from "@vueuse/core";
4
+ import { nanoid as Fe } from "nanoid";
5
+ const ke = {
4
6
  /**
5
7
  * Color
6
8
  */
@@ -93,91 +95,132 @@ const me = {
93
95
  modifiers: {
94
96
  type: [String, Array]
95
97
  }
96
- }, ge = {
98
+ };
99
+ var _ = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(_ || {}), te = /* @__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))(te || {}), P = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(P || {}), K = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(K || {}), re = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(re || {});
100
+ const De = Symbol.for("volver");
101
+ function Ee() {
102
+ return ye(De);
103
+ }
104
+ function oe(e, t, r) {
105
+ return u(() => {
106
+ const n = {
107
+ [e]: !0
108
+ }, i = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
109
+ return i && Array.isArray(i) && i.forEach((d) => {
110
+ n[`${e}--${d}`] = !0;
111
+ }), r && Object.keys(r.value).forEach((d) => {
112
+ n[`${e}--${d}`] = c(r.value[d]);
113
+ }), n;
114
+ });
115
+ }
116
+ const Ne = {
97
117
  name: "VvIcon"
98
- }, Q = /* @__PURE__ */ X({
99
- ...ge,
100
- props: me,
118
+ }, X = /* @__PURE__ */ T({
119
+ ...Ne,
120
+ props: ke,
101
121
  setup(e) {
102
- const s = e, r = ref(!0), u = useVolver(), { modifiers: c } = toRefs(s), m = useBemModifiers("vv-icon", c), n = computed(() => s.provider || (u == null ? void 0 : u.provider)), B = computed(() => {
103
- const t = s.name ?? "", o = `@${n.value}:${s.prefix}:${s.name}`;
104
- return D(t) ? t : D(o) ? o : (u == null ? void 0 : u.iconsCollections.find(
105
- (p) => {
106
- const l = `@${n.value}:${p.prefix}:${t}`;
107
- if (D(l))
108
- return l;
122
+ const t = e, r = x(!0), n = Ee(), { modifiers: i } = C(t), d = oe("vv-icon", i), a = u(() => t.provider || (n == null ? void 0 : n.provider)), m = u(() => {
123
+ const o = t.name ?? "", l = `@${a.value}:${t.prefix}:${t.name}`;
124
+ return D(o) ? o : D(l) ? l : (n == null ? void 0 : n.iconsCollections.find(
125
+ (g) => {
126
+ const v = `@${a.value}:${g.prefix}:${o}`;
127
+ if (D(v))
128
+ return v;
109
129
  }
110
- )) || t;
130
+ )) || o;
111
131
  });
112
- function g(t) {
113
- let o = null;
132
+ function s(o) {
133
+ let l = null;
114
134
  if (typeof window > "u") {
115
- const { JSDOM: y } = require("jsdom");
116
- o = new y().window;
135
+ const { JSDOM: h } = require("jsdom");
136
+ l = new h().window;
117
137
  }
118
- return (o ? new o.DOMParser() : new window.DOMParser()).parseFromString(t, "text/html").querySelector("svg");
138
+ return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
119
139
  }
120
- function d(t) {
121
- const o = g(t), p = (o == null ? void 0 : o.innerHTML.trim()) || "";
122
- o && p && fe(`@${n.value}:${s.prefix}:${s.name}`, {
123
- body: p,
140
+ function p(o) {
141
+ const l = s(o), g = (l == null ? void 0 : l.innerHTML.trim()) || "";
142
+ l && g && $e(`@${a.value}:${t.prefix}:${t.name}`, {
143
+ body: g,
124
144
  // Set height and width from svg content
125
- height: o.viewBox.baseVal.height,
126
- width: o.viewBox.baseVal.width
145
+ height: l.viewBox.baseVal.height,
146
+ width: l.viewBox.baseVal.width
127
147
  });
128
148
  }
129
- return u && (s.src && !D(`@${n.value}:${s.prefix}:${s.name}`) ? (r.value = !1, u.fetchIcon(s.src).then((t) => {
130
- t && (d(t), r.value = !0);
131
- }).catch((t) => {
132
- throw new Error(`During fetch icon: ${t == null ? void 0 : t.message}`);
133
- })) : s.svg && d(s.svg)), (t, o) => i(r) ? (f(), z(i(ve), N({
149
+ return n && (t.src && !D(`@${a.value}:${t.prefix}:${t.name}`) ? (r.value = !1, n.fetchIcon(t.src).then((o) => {
150
+ o && (p(o), r.value = !0);
151
+ }).catch((o) => {
152
+ throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
153
+ })) : t.svg && p(t.svg)), (o, l) => c(r) ? (b(), M(c(je), N({
134
154
  key: 0,
135
- class: i(m)
155
+ class: c(d)
136
156
  }, {
137
- inline: t.inline,
138
- width: t.width,
139
- height: t.height,
140
- horizontalFlip: t.horizontalFlip,
141
- verticalFlip: t.verticalFlip,
142
- flip: t.flip,
143
- rotate: t.rotate,
144
- color: t.color,
145
- onLoad: t.onLoad,
146
- icon: i(B)
147
- }), null, 16, ["class"])) : S("", !0);
157
+ inline: o.inline,
158
+ width: o.width,
159
+ height: o.height,
160
+ horizontalFlip: o.horizontalFlip,
161
+ verticalFlip: o.verticalFlip,
162
+ flip: o.flip,
163
+ rotate: o.rotate,
164
+ color: o.color,
165
+ onLoad: o.onLoad,
166
+ icon: c(m)
167
+ }), null, 16, ["class"])) : B("", !0);
148
168
  }
149
169
  });
150
- function C(e) {
151
- return Array.isArray(e) ? e.filter((s) => isString(s)).join(" ") : e;
170
+ function Z(e, t) {
171
+ if (e && Object.keys(e).length && t) {
172
+ if (t.indexOf(".") === -1)
173
+ return e[t];
174
+ {
175
+ const r = t.split(".");
176
+ let n = e;
177
+ for (let i = 0, d = r.length; i < d; ++i) {
178
+ if (e == null)
179
+ return null;
180
+ n = n[r[i]];
181
+ }
182
+ return n;
183
+ }
184
+ } else
185
+ return null;
186
+ }
187
+ function ne(e) {
188
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(c(e));
189
+ }
190
+ function Ce(e) {
191
+ return typeof e == "string" || e instanceof String;
152
192
  }
153
- function ye(e, s) {
193
+ function E(e) {
194
+ return Array.isArray(e) ? e.filter((t) => Ce(t)).join(" ") : e;
195
+ }
196
+ function ze(e, t) {
154
197
  const {
155
198
  invalid: r,
156
- valid: u,
157
- hint: c,
158
- loading: m
159
- } = s, {
160
- hintLabel: n,
161
- modelValue: B,
162
- valid: g,
163
- validLabel: d,
164
- invalid: t,
165
- invalidLabel: o,
166
- ...p
167
- } = toRefs(e), l = resolveFieldData(p, "loading"), v = resolveFieldData(p, "loadingLabel"), y = computed(() => t.value ? !!(t.value && r || o != null && o.value && Array.isArray(o.value) && o.value.length > 0 || o != null && o.value && !isEmpty(o)) : !1), $ = computed(
168
- () => !!(n && n.value || c)
169
- ), V = computed(
170
- () => !!(d && d.value || u)
171
- ), F = computed(
172
- () => !!(l != null && l.value && m || l != null && l.value && (v != null && v.value))
173
- ), P = computed(
174
- () => $.value || V.value || y.value || F.value
199
+ valid: n,
200
+ hint: i,
201
+ loading: d
202
+ } = t, {
203
+ hintLabel: a,
204
+ modelValue: m,
205
+ valid: s,
206
+ validLabel: p,
207
+ invalid: o,
208
+ invalidLabel: l,
209
+ ...g
210
+ } = C(e), v = Z(g, "loading"), y = Z(g, "loadingLabel"), h = u(() => o.value ? !!(o.value && r || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !ne(l)) : !1), w = u(
211
+ () => !!(a && a.value || i)
212
+ ), I = u(
213
+ () => !!(p && p.value || n)
214
+ ), A = u(
215
+ () => !!(v != null && v.value && d || v != null && v.value && (y != null && y.value))
216
+ ), V = u(
217
+ () => w.value || I.value || h.value || A.value
175
218
  );
176
219
  return {
177
- hasInvalid: y,
178
- hasHint: $,
179
- hasValid: V,
180
- hasLoading: F,
220
+ hasInvalid: h,
221
+ hasHint: w,
222
+ hasValid: I,
223
+ hasLoading: A,
181
224
  HintSlot: {
182
225
  name: "HintSlot",
183
226
  props: {
@@ -186,31 +229,31 @@ function ye(e, s) {
186
229
  default: () => ({})
187
230
  }
188
231
  },
189
- setup(w) {
190
- const O = computed(() => {
191
- const _ = toReactive({
192
- hintLabel: n,
193
- modelValue: B,
194
- valid: g,
195
- validLabel: d,
196
- invalid: t,
197
- invalidLabel: o,
198
- loading: l,
199
- loadingLabel: v,
200
- ...w.params
232
+ setup(j) {
233
+ const F = u(() => {
234
+ const O = Pe({
235
+ hintLabel: a,
236
+ modelValue: m,
237
+ valid: s,
238
+ validLabel: p,
239
+ invalid: o,
240
+ invalidLabel: l,
241
+ loading: v,
242
+ loadingLabel: y,
243
+ ...j.params
201
244
  });
202
- return t != null && t.value ? (r == null ? void 0 : r(_)) || C(o == null ? void 0 : o.value) || (n == null ? void 0 : n.value) : g != null && g.value ? (u == null ? void 0 : u(_)) || C(d == null ? void 0 : d.value) || (n == null ? void 0 : n.value) : l != null && l.value ? (m == null ? void 0 : m(_)) || C(v == null ? void 0 : v.value) || (n == null ? void 0 : n.value) : (c == null ? void 0 : c(_)) || C(n == null ? void 0 : n.value) || (n == null ? void 0 : n.value);
245
+ return o != null && o.value ? (r == null ? void 0 : r(O)) || E(l == null ? void 0 : l.value) || (a == null ? void 0 : a.value) : s != null && s.value ? (n == null ? void 0 : n(O)) || E(p == null ? void 0 : p.value) || (a == null ? void 0 : a.value) : v != null && v.value ? (d == null ? void 0 : d(O)) || E(y == null ? void 0 : y.value) || (a == null ? void 0 : a.value) : (i == null ? void 0 : i(O)) || E(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
203
246
  });
204
247
  return {
205
- isVisible: P,
206
- hasInvalid: y,
207
- hasValid: V,
208
- hintContent: O
248
+ isVisible: V,
249
+ hasInvalid: h,
250
+ hasValid: I,
251
+ hintContent: F
209
252
  };
210
253
  },
211
254
  render() {
212
255
  if (this.isVisible)
213
- return h(
256
+ return be(
214
257
  "small",
215
258
  {
216
259
  role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
@@ -221,34 +264,95 @@ function ye(e, s) {
221
264
  }
222
265
  };
223
266
  }
224
- var M = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(M || {}), Y = /* @__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))(Y || {}), q = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(q || {});
225
- const he = {
267
+ const qe = {
268
+ /**
269
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
270
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
271
+ */
272
+ to: {
273
+ type: [String, Object]
274
+ },
275
+ /**
276
+ * Anchor href
277
+ */
278
+ href: String,
279
+ /**
280
+ * Anchor target
281
+ */
282
+ target: {
283
+ type: String,
284
+ validator: (e) => Object.values(re).includes(e)
285
+ },
286
+ /**
287
+ * Anchor rel
288
+ */
289
+ rel: {
290
+ type: String,
291
+ default: "noopener noreferrer"
292
+ }
293
+ }, He = {
294
+ /**
295
+ * Valid status
296
+ */
226
297
  valid: Boolean,
298
+ /**
299
+ * Valid label
300
+ */
227
301
  validLabel: [String, Array]
228
- }, be = {
302
+ }, Me = {
303
+ /**
304
+ * Invalid status
305
+ */
229
306
  invalid: Boolean,
307
+ /**
308
+ * Invalid label
309
+ */
230
310
  invalidLabel: [String, Array]
231
- }, Se = {
311
+ }, Ke = {
312
+ /**
313
+ * Loading status
314
+ */
232
315
  loading: Boolean,
233
- loadingLabel: String
234
- }, Be = {
316
+ /**
317
+ * Loading label
318
+ */
319
+ loadingLabel: {
320
+ type: String,
321
+ default: "Loading..."
322
+ }
323
+ }, le = {
235
324
  /**
236
325
  * Whether the form control is disabled
237
326
  */
238
327
  disabled: Boolean
239
- }, _e = {
328
+ }, Re = {
329
+ /**
330
+ * Whether the item is active
331
+ */
332
+ active: Boolean
333
+ }, Le = {
334
+ /**
335
+ * Whether the item is pressed
336
+ */
337
+ pressed: Boolean
338
+ }, ae = {
339
+ /**
340
+ * The item label
341
+ */
342
+ label: [String, Number]
343
+ }, Ue = {
240
344
  /**
241
345
  * The value is not editable
242
346
  */
243
347
  readonly: Boolean
244
- }, Ve = {
348
+ }, Je = {
245
349
  /**
246
350
  * Component BEM modifiers
247
351
  */
248
352
  modifiers: [String, Array]
249
- }, Pe = {
353
+ }, We = {
250
354
  hintLabel: { type: String, default: "" }
251
- }, we = {
355
+ }, Ye = {
252
356
  /**
253
357
  * List of options, can be string[] or object[]
254
358
  */
@@ -268,7 +372,7 @@ const he = {
268
372
  * Used when options are objects: key to use for option disabled
269
373
  */
270
374
  disabledKey: { type: [String, Function], default: "disabled" }
271
- }, Ie = {
375
+ }, Ge = {
272
376
  /**
273
377
  * VvIcon name or props
274
378
  * @see VVIcon
@@ -279,69 +383,82 @@ const he = {
279
383
  */
280
384
  iconPosition: {
281
385
  type: String,
282
- default: q.before,
283
- validation: (e) => Object.values(q).includes(e)
386
+ default: P.before,
387
+ validation: (e) => Object.values(P).includes(e)
284
388
  }
285
- }, $e = {
389
+ }, Qe = {
286
390
  /**
287
391
  * Global attribute tabindex
288
392
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
289
393
  */
290
394
  tabindex: { type: [String, Number], default: 0 }
291
- }, Fe = {
395
+ }, Xe = {
292
396
  /**
293
397
  * If true the label will be floating
294
398
  */
295
399
  floating: Boolean
296
- }, Oe = {
400
+ }, Ze = {
297
401
  /**
298
402
  * If true the input will be unselectable
299
403
  */
300
404
  unselectable: { type: Boolean, default: !0 }
301
- }, Ae = {
405
+ }, Te = {
302
406
  /**
303
407
  * Global attribute id
304
408
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
305
409
  */
306
410
  id: [String, Number]
307
411
  };
308
- M.bottom;
309
- const De = {
310
- ...Ae,
412
+ _.bottom;
413
+ const xe = {
414
+ ...Te,
311
415
  /**
312
416
  * Input / Textarea name
313
417
  * Name of the form control. Submitted with the form as part of a name/value pair
314
418
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
315
419
  */
316
420
  name: { type: String, required: !0 }
317
- }, Ce = {
421
+ }, et = {
318
422
  /**
319
423
  * Global attribute autofocus
320
424
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
321
425
  */
322
426
  autofocus: Boolean
323
- }, Ne = {
427
+ }, tt = {
324
428
  /**
325
429
  * Global attribute autocomplete
326
430
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
327
431
  */
328
432
  autocomplete: { type: String, default: "off" }
329
- }, je = {
330
- ...De,
331
- ...Ce,
332
- ...Ne,
333
- ...$e,
334
- ...he,
335
- ...be,
336
- ...Pe,
337
- ...Se,
338
- ...Be,
339
- ..._e,
340
- ...Ve,
341
- ...we,
342
- ...Ie,
343
- ...Fe,
344
- ...Oe,
433
+ };
434
+ ({
435
+ ...le,
436
+ ...ae,
437
+ ...Le,
438
+ ...Re,
439
+ ...qe,
440
+ /**
441
+ * Button type
442
+ */
443
+ type: K.button
444
+ });
445
+ const rt = {
446
+ ...xe,
447
+ ...et,
448
+ ...tt,
449
+ ...Qe,
450
+ ...He,
451
+ ...Me,
452
+ ...We,
453
+ ...Ke,
454
+ ...le,
455
+ ...Ue,
456
+ ...Je,
457
+ ...Ye,
458
+ ...Ge,
459
+ ...Xe,
460
+ ...Ze,
461
+ ...ae,
345
462
  /**
346
463
  * This Boolean attribute indicates that multiple options can be selected in the list.
347
464
  * If it is not specified, then only one option can be selected at a time.
@@ -368,140 +485,178 @@ const De = {
368
485
  type: [String, Number, Boolean, Object, Array],
369
486
  default: void 0
370
487
  },
371
- /**
372
- * <label> value for the select
373
- */
374
- label: String,
375
488
  /**
376
489
  * Select placeholder
377
490
  */
378
491
  placeholder: String
379
- }, Ee = ["update:modelValue", "focus", "blur"], ke = ["for"], ze = { class: "vv-select__wrapper" }, Me = {
492
+ }, ot = ["update:modelValue", "focus", "blur"], nt = (e) => u(() => String((e == null ? void 0 : e.value) || Fe()));
493
+ function lt(e, t) {
494
+ const { focused: r } = we(e);
495
+ return ee(r, (n) => {
496
+ t(n ? "focus" : "blur", c(e));
497
+ }), {
498
+ focused: r
499
+ };
500
+ }
501
+ function at(e, t) {
502
+ const r = u(
503
+ () => Boolean((e == null ? void 0 : e.value) && t.value === P.before)
504
+ ), n = u(
505
+ () => Boolean((e == null ? void 0 : e.value) && t.value === P.after)
506
+ ), i = u(
507
+ () => Boolean((e == null ? void 0 : e.value) && t.value === _.left)
508
+ ), d = u(
509
+ () => Boolean((e == null ? void 0 : e.value) && t.value === _.right)
510
+ ), a = u(
511
+ () => Boolean((e == null ? void 0 : e.value) && t.value === _.top)
512
+ ), m = u(
513
+ () => Boolean((e == null ? void 0 : e.value) && t.value === _.bottom)
514
+ );
515
+ return {
516
+ hasIcon: u(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
517
+ hasIconLeft: i,
518
+ hasIconRight: d,
519
+ hasIconTop: a,
520
+ hasIconBottom: m,
521
+ hasIconBefore: r,
522
+ hasIconAfter: n
523
+ };
524
+ }
525
+ function st(e) {
526
+ const { options: t, labelKey: r, valueKey: n, disabledKey: i } = C(e);
527
+ return {
528
+ options: t,
529
+ getOptionLabel: (s) => typeof s != "object" && s !== null ? s : typeof r.value == "function" ? r.value(s) : s[r.value],
530
+ getOptionValue: (s) => typeof s != "object" && s !== null ? s : typeof n.value == "function" ? n.value(s) : s[n.value],
531
+ getOptionDisabled: (s) => typeof s != "object" && s !== null ? !1 : typeof i.value == "function" ? i.value(s) : s[i.value]
532
+ };
533
+ }
534
+ const ut = ["for"], it = { class: "vv-select__wrapper" }, ct = {
380
535
  key: 0,
381
536
  class: "vv-select__input-before"
382
- }, qe = { class: "vv-select__inner" }, He = ["id"], Re = ["disabled", "hidden"], Ke = ["disabled", "value"], Te = {
537
+ }, dt = { class: "vv-select__inner" }, ft = ["id"], vt = ["disabled", "hidden"], pt = ["disabled", "value"], gt = {
383
538
  key: 1,
384
539
  class: "vv-select__input-after"
385
- }, Ue = {
540
+ }, yt = {
386
541
  name: "VvSelect"
387
- }, Ge = /* @__PURE__ */ X({
388
- ...Ue,
389
- props: je,
390
- emits: Ee,
391
- setup(e, { emit: s }) {
392
- const r = e, u = useSlots(), c = ref(), { HintSlot: m, hasHint: n, hasInvalid: B } = ye(r, u), {
393
- id: g,
394
- modifiers: d,
395
- disabled: t,
396
- readonly: o,
397
- loading: p,
398
- icon: l,
399
- iconPosition: v,
400
- invalid: y,
401
- valid: $,
402
- floating: V,
403
- multiple: F
404
- } = toRefs(r), P = useUniqueId(g), w = computed(() => `${P.value}-hint`), { focused: O } = useComponentFocus(c, s), _ = useElementVisibility(c);
405
- watch(_, (a) => {
406
- a && r.autofocus && (O.value = !0);
542
+ }, Bt = /* @__PURE__ */ T({
543
+ ...yt,
544
+ props: rt,
545
+ emits: ot,
546
+ setup(e, { emit: t }) {
547
+ const r = e, n = me(), i = x(), { HintSlot: d, hasHint: a, hasInvalid: m } = ze(r, n), {
548
+ id: s,
549
+ modifiers: p,
550
+ disabled: o,
551
+ readonly: l,
552
+ loading: g,
553
+ icon: v,
554
+ iconPosition: y,
555
+ invalid: h,
556
+ valid: w,
557
+ floating: I,
558
+ multiple: A
559
+ } = C(r), V = nt(s), j = u(() => `${V.value}-hint`), { focused: F } = lt(i, t), O = Ae(i);
560
+ ee(O, (f) => {
561
+ f && r.autofocus && (F.value = !0);
407
562
  });
408
- const { hasIcon: H, hasIconBefore: R, hasIconAfter: K } = useComponentIcon(
409
- l,
410
- v
411
- ), Z = computed(() => !isEmpty(r.modelValue)), T = computed(() => r.disabled || r.readonly), x = computed(() => T.value ? -1 : r.tabindex), L = computed(() => {
563
+ const { hasIcon: R, hasIconBefore: L, hasIconAfter: U } = at(
564
+ v,
565
+ y
566
+ ), se = u(() => !ne(r.modelValue)), J = u(() => r.disabled || r.readonly), ue = u(() => J.value ? -1 : r.tabindex), ie = u(() => {
412
567
  if (r.invalid === !0)
413
568
  return !0;
414
569
  if (r.valid === !0)
415
570
  return !1;
416
- }), ee = useBemModifiers(
571
+ }), ce = oe(
417
572
  "vv-select",
418
- d,
419
- computed(() => ({
420
- valid: $.value,
421
- invalid: y.value,
422
- loading: p.value,
423
- disabled: t.value,
424
- readonly: o.value,
425
- "icon-before": R.value,
426
- "icon-after": K.value,
427
- dirty: Z.value,
428
- focus: O.value,
429
- floating: V.value,
430
- multiple: F.value
573
+ p,
574
+ u(() => ({
575
+ valid: w.value,
576
+ invalid: h.value,
577
+ loading: g.value,
578
+ disabled: o.value,
579
+ readonly: l.value,
580
+ "icon-before": L.value,
581
+ "icon-after": U.value,
582
+ dirty: se.value,
583
+ focus: F.value,
584
+ floating: I.value,
585
+ multiple: A.value
431
586
  }))
432
- ), te = computed(() => ({
587
+ ), de = u(() => ({
433
588
  name: r.name,
434
- tabindex: x.value,
435
- disabled: T.value,
589
+ tabindex: ue.value,
590
+ disabled: J.value,
436
591
  required: r.required,
437
592
  size: r.size,
438
593
  autocomplete: r.autocomplete,
439
594
  multiple: r.multiple,
440
- "aria-invalid": L.value,
441
- "aria-describedby": !B.value && n.value ? w.value : void 0,
442
- "aria-errormessage": B.value ? w.value : void 0
443
- })), U = computed(() => ({
595
+ "aria-invalid": ie.value,
596
+ "aria-describedby": !m.value && a.value ? j.value : void 0,
597
+ "aria-errormessage": m.value ? j.value : void 0
598
+ })), W = u(() => ({
444
599
  valid: r.valid,
445
600
  invalid: r.invalid,
446
601
  modelValue: r.modelValue
447
- })), { getOptionLabel: oe, getOptionValue: re, getOptionDisabled: ne } = useOptions(r), j = computed({
602
+ })), { getOptionLabel: fe, getOptionValue: ve, getOptionDisabled: pe } = st(r), z = u({
448
603
  get: () => r.modelValue,
449
- set: (a) => {
450
- Array.isArray(a) && (a = a.filter((A) => A !== void 0)), s("update:modelValue", a);
604
+ set: (f) => {
605
+ Array.isArray(f) && (f = f.filter((k) => k !== void 0)), t("update:modelValue", f);
451
606
  }
452
607
  });
453
- return (a, A) => (f(), b("div", {
454
- class: ie(i(ee))
608
+ return (f, k) => (b(), S("div", {
609
+ class: he(c(ce))
455
610
  }, [
456
- a.label ? (f(), b("label", {
611
+ f.label ? (b(), S("label", {
457
612
  key: 0,
458
- for: i(P)
459
- }, E(a.label), 9, ke)) : S("", !0),
460
- k("div", ze, [
461
- a.$slots.before ? (f(), b("div", Me, [
462
- J(a.$slots, "before", W(G(i(U))))
463
- ])) : S("", !0),
464
- k("div", qe, [
465
- i(R) ? (f(), z(Q, N({
613
+ for: c(V)
614
+ }, q(f.label), 9, ut)) : B("", !0),
615
+ H("div", it, [
616
+ f.$slots.before ? (b(), S("div", ct, [
617
+ Y(f.$slots, "before", G(Q(c(W))))
618
+ ])) : B("", !0),
619
+ H("div", dt, [
620
+ c(L) ? (b(), M(X, N({
466
621
  key: 0,
467
622
  class: "vv-select__icon"
468
- }, i(H)), null, 16)) : S("", !0),
469
- ae(k("select", N({
470
- id: i(P),
623
+ }, c(R)), null, 16)) : B("", !0),
624
+ Se(H("select", N({
625
+ id: c(V),
471
626
  ref_key: "select",
472
- ref: c,
473
- "onUpdate:modelValue": A[0] || (A[0] = (I) => le(j) ? j.value = I : null)
474
- }, i(te)), [
475
- a.placeholder ? (f(), b("option", {
627
+ ref: i,
628
+ "onUpdate:modelValue": k[0] || (k[0] = ($) => Be(z) ? z.value = $ : null)
629
+ }, c(de)), [
630
+ f.placeholder ? (b(), S("option", {
476
631
  key: 0,
477
632
  value: void 0,
478
- disabled: !a.unselectable,
479
- hidden: !a.unselectable
480
- }, E(a.placeholder), 9, Re)) : S("", !0),
481
- (f(!0), b(ue, null, de(a.options, (I, se) => (f(), b("option", {
482
- key: se,
483
- disabled: i(ne)(I),
484
- value: i(re)(I)
485
- }, E(i(oe)(I)), 9, Ke))), 128))
486
- ], 16, He), [
487
- [ce, i(j)]
633
+ disabled: !f.unselectable,
634
+ hidden: !f.unselectable
635
+ }, q(f.placeholder), 9, vt)) : B("", !0),
636
+ (b(!0), S(_e, null, Oe(f.options, ($, ge) => (b(), S("option", {
637
+ key: ge,
638
+ disabled: c(pe)($),
639
+ value: c(ve)($)
640
+ }, q(c(fe)($)), 9, pt))), 128))
641
+ ], 16, ft), [
642
+ [Ie, c(z)]
488
643
  ]),
489
- i(K) ? (f(), z(Q, N({
644
+ c(U) ? (b(), M(X, N({
490
645
  key: 1,
491
646
  class: "vv-select__icon vv-select__icon-after"
492
- }, i(H)), null, 16)) : S("", !0)
647
+ }, c(R)), null, 16)) : B("", !0)
493
648
  ]),
494
- a.$slots.after ? (f(), b("div", Te, [
495
- J(a.$slots, "after", W(G(i(U))))
496
- ])) : S("", !0)
649
+ f.$slots.after ? (b(), S("div", gt, [
650
+ Y(f.$slots, "after", G(Q(c(W))))
651
+ ])) : B("", !0)
497
652
  ]),
498
- pe(i(m), {
499
- id: i(w),
653
+ Ve(c(d), {
654
+ id: c(j),
500
655
  class: "vv-select__hint"
501
656
  }, null, 8, ["id"])
502
657
  ], 2));
503
658
  }
504
659
  });
505
660
  export {
506
- Ge as default
661
+ Bt as default
507
662
  };