@volverjs/ui-vue 0.0.1 → 0.0.2

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 (82) hide show
  1. package/README.md +17 -0
  2. package/dist/components/VvButton/VvButton.es.js +159 -147
  3. package/dist/components/VvButton/VvButton.umd.js +1 -1
  4. package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
  5. package/dist/components/VvButton/index.d.ts +4 -4
  6. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
  7. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  8. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
  9. package/dist/components/VvButtonGroup/index.d.ts +5 -5
  10. package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
  11. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  12. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
  13. package/dist/components/VvCombobox/index.d.ts +13 -1
  14. package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
  15. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  16. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
  17. package/dist/components/VvDropdown/index.d.ts +12 -0
  18. package/dist/components/VvInputText/VvInputText.es.js +221 -213
  19. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  20. package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
  21. package/dist/components/VvInputText/index.d.ts +5 -5
  22. package/dist/components/VvSelect/VvSelect.es.js +186 -167
  23. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  24. package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
  25. package/dist/components/VvSelect/index.d.ts +10 -17
  26. package/dist/components/VvTextarea/VvTextarea.es.js +112 -104
  27. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  28. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
  29. package/dist/components/VvTextarea/index.d.ts +5 -5
  30. package/dist/components/index.es.js +1045 -975
  31. package/dist/components/index.umd.js +1 -1
  32. package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
  33. package/dist/composables/group/types/IGroupState.d.ts +1 -1
  34. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  35. package/dist/icons.es.js +3 -3
  36. package/dist/icons.umd.js +1 -1
  37. package/dist/index.es.js +1065 -995
  38. package/dist/index.umd.js +1 -1
  39. package/dist/props/index.d.ts +35 -4
  40. package/dist/resolvers/unplugin.es.js +26 -24
  41. package/dist/resolvers/unplugin.umd.js +1 -1
  42. package/dist/stories/Button/Button.settings.d.ts +9 -11
  43. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
  44. package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
  45. package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
  46. package/dist/stories/InputText/InputText.settings.d.ts +23 -23
  47. package/dist/stories/Select/Select.settings.d.ts +42 -23
  48. package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
  49. package/dist/stories/argTypes.d.ts +50 -1
  50. package/package.json +5 -4
  51. package/src/assets/icons/detailed.json +1 -1
  52. package/src/assets/icons/normal.json +1 -1
  53. package/src/assets/icons/simple.json +1 -1
  54. package/src/components/VvButton/index.ts +28 -10
  55. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
  56. package/src/components/VvButtonGroup/index.ts +3 -6
  57. package/src/components/VvCombobox/VvCombobox.vue +45 -11
  58. package/src/components/VvCombobox/index.ts +6 -0
  59. package/src/components/VvDropdown/VvDropdown.vue +9 -6
  60. package/src/components/VvDropdown/index.ts +11 -1
  61. package/src/components/VvInputText/VvInputText.vue +10 -8
  62. package/src/components/VvSelect/VvSelect.vue +23 -1
  63. package/src/components/VvSelect/index.ts +8 -11
  64. package/src/components/VvTextarea/VvTextarea.vue +10 -8
  65. package/src/composables/group/types/IButtonGroupState.ts +1 -1
  66. package/src/composables/group/types/IGroupState.ts +1 -1
  67. package/src/composables/group/useInjectedGroupState.ts +3 -3
  68. package/src/composables/useTextCount.ts +1 -1
  69. package/src/props/index.ts +33 -15
  70. package/src/resolvers/unplugin.ts +22 -13
  71. package/src/stories/Button/Button.settings.ts +2 -7
  72. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
  73. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
  74. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
  75. package/src/stories/Combobox/Combobox.settings.ts +5 -0
  76. package/src/stories/Combobox/Combobox.stories.mdx +51 -0
  77. package/src/stories/Combobox/Combobox.test.ts +7 -0
  78. package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
  79. package/src/stories/Dropdown/Dropdown.stories.mdx +17 -0
  80. package/src/stories/Select/Select.settings.ts +9 -23
  81. package/src/stories/Select/Select.stories.mdx +60 -0
  82. package/src/stories/argTypes.ts +46 -22
package/README.md CHANGED
@@ -117,6 +117,23 @@ export default defineConfig({
117
117
  })
118
118
  ```
119
119
 
120
+ ## Roadmap
121
+
122
+ The following features are planned for the next releases:
123
+
124
+ - [ ] `VvAvatar` component;
125
+ - [ ] Alerts, notifications and toasts with `VvAlert` and `VvToast` component;
126
+ - [ ] Loaders with `VvLoader` and `VvSkeleton`;
127
+ - [ ] `VvTooltip` component;
128
+ - [ ] Redesign `VvCombobox` for better accessibility;
129
+ - [ ] Rewrite `VvDropdown` component and get it applicable to any element;
130
+ - [ ] Menus, navigation and tabs with `VvNav`;
131
+ - [ ] Input masks for `VvInputText` component;
132
+ - [ ] `VvTable` component with sort, filters, pagination and cell editing;
133
+ - [ ] Multiple uploads, image crop and file previews with `VvInputFile`;
134
+ - [ ] Carousel and galleries with `VvCarousel` component;
135
+ - [ ] Calendar and date picker with `VvCalendar` component.
136
+
120
137
  ## Documentation
121
138
 
122
139
  To learn more about `@volverjs/ui-vue`, check [its documentation](https://volverjs.github.io/ui-vue).
@@ -1,99 +1,99 @@
1
- import { unref as v, computed as g, defineComponent as I, ref as G, toRefs as M, inject as P, openBlock as b, createBlock as A, mergeProps as C, createCommentVNode as $, toRef as T, useAttrs as X, useSlots as K, resolveDynamicComponent as Q, withCtx as W, renderSlot as _, createElementBlock as O, toDisplayString as j, Fragment as Y, createTextVNode as ee } from "vue";
1
+ import { unref as g, computed as d, defineComponent as N, ref as q, toRefs as z, inject as F, openBlock as h, createBlock as V, mergeProps as D, createCommentVNode as $, toRef as T, useAttrs as X, useSlots as K, resolveDynamicComponent as Q, withCtx as W, renderSlot as _, createElementBlock as P, toDisplayString as R, Fragment as Y, createTextVNode as ee } from "vue";
2
2
  import { nanoid as te } from "nanoid";
3
- import { iconExists as w, Icon as ne, addIcon as re } from "@iconify/vue";
4
- function V(e, t, r) {
5
- return r ? B(e, r) === B(t, r) : L(e, t);
3
+ import { iconExists as O, Icon as re, addIcon as ne } from "@iconify/vue";
4
+ function j(e, t, r) {
5
+ return r ? E(e, r) === E(t, r) : B(e, t);
6
6
  }
7
- function L(e, t) {
7
+ function B(e, t) {
8
8
  if (e === t)
9
9
  return !0;
10
10
  if (e && t && typeof e == "object" && typeof t == "object") {
11
- const r = Array.isArray(e), u = Array.isArray(t);
12
- let o, i, a;
13
- if (r && u) {
14
- if (i = e.length, i != t.length)
11
+ const r = Array.isArray(e), c = Array.isArray(t);
12
+ let o, l, u;
13
+ if (r && c) {
14
+ if (l = e.length, l != t.length)
15
15
  return !1;
16
- for (o = i; o-- !== 0; )
17
- if (!L(e[o], t[o]))
16
+ for (o = l; o-- !== 0; )
17
+ if (!B(e[o], t[o]))
18
18
  return !1;
19
19
  return !0;
20
20
  }
21
- if (r != u)
21
+ if (r != c)
22
22
  return !1;
23
- const d = e instanceof Date, s = t instanceof Date;
24
- if (d != s)
23
+ const v = e instanceof Date, s = t instanceof Date;
24
+ if (v != s)
25
25
  return !1;
26
- if (d && s)
26
+ if (v && s)
27
27
  return e.getTime() == t.getTime();
28
- const c = e instanceof RegExp, n = t instanceof RegExp;
29
- if (c != n)
28
+ const a = e instanceof RegExp, n = t instanceof RegExp;
29
+ if (a != n)
30
30
  return !1;
31
- if (c && n)
31
+ if (a && n)
32
32
  return e.toString() == t.toString();
33
- const l = Object.keys(e);
34
- if (i = l.length, i !== Object.keys(t).length)
33
+ const i = Object.keys(e);
34
+ if (l = i.length, l !== Object.keys(t).length)
35
35
  return !1;
36
- for (o = i; o-- !== 0; )
37
- if (!Object.prototype.hasOwnProperty.call(t, l[o]))
36
+ for (o = l; o-- !== 0; )
37
+ if (!Object.prototype.hasOwnProperty.call(t, i[o]))
38
38
  return !1;
39
- for (o = i; o-- !== 0; )
40
- if (a = l[o], !L(e[a], t[a]))
39
+ for (o = l; o-- !== 0; )
40
+ if (u = i[o], !B(e[u], t[u]))
41
41
  return !1;
42
42
  return !0;
43
43
  }
44
44
  return e !== e && t !== t;
45
45
  }
46
- function B(e, t) {
46
+ function E(e, t) {
47
47
  if (e && Object.keys(e).length && t) {
48
48
  if (t.indexOf(".") === -1)
49
49
  return e[t];
50
50
  {
51
51
  const r = t.split(".");
52
- let u = e;
53
- for (let o = 0, i = r.length; o < i; ++o) {
52
+ let c = e;
53
+ for (let o = 0, l = r.length; o < l; ++o) {
54
54
  if (e == null)
55
55
  return null;
56
- u = u[r[o]];
56
+ c = c[r[o]];
57
57
  }
58
- return u;
58
+ return c;
59
59
  }
60
60
  } else
61
61
  return null;
62
62
  }
63
- function F(e, t) {
63
+ function I(e, t) {
64
64
  if (e != null && t && t.length) {
65
65
  for (const r of t)
66
- if (V(e, r))
66
+ if (j(e, r))
67
67
  return !0;
68
68
  }
69
69
  return !1;
70
70
  }
71
71
  function oe(e) {
72
- return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(v(e));
72
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(g(e));
73
73
  }
74
- function R(e) {
74
+ function M(e) {
75
75
  var t, r;
76
76
  if (e)
77
77
  return (r = (t = e.match(
78
78
  /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
79
79
  )) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
80
80
  }
81
- const N = "ds";
82
- function q(e, t) {
81
+ const U = "ds";
82
+ function Z(e, t) {
83
83
  const r = { [`${e}`]: !0 };
84
84
  return {
85
- bemCssClasses: g(() => Object.keys(t).reduce((o, i) => {
86
- const a = v(t[i]) || !1;
87
- if (!a)
85
+ bemCssClasses: d(() => Object.keys(t).reduce((o, l) => {
86
+ const u = g(t[l]) || !1;
87
+ if (!u)
88
88
  return o;
89
- if (i === "modifiers") {
90
- const d = Array.isArray(a) ? a : a.split(" ");
89
+ if (l === "modifiers") {
90
+ const v = Array.isArray(u) ? u : u.split(" ");
91
91
  return {
92
92
  ...o,
93
- ...d.reduce(
94
- (s, c) => ({
93
+ ...v.reduce(
94
+ (s, a) => ({
95
95
  ...s,
96
- [`${e}--${R(c)}`]: !0
96
+ [`${e}--${M(a)}`]: !0
97
97
  }),
98
98
  {}
99
99
  )
@@ -101,7 +101,7 @@ function q(e, t) {
101
101
  } else
102
102
  return {
103
103
  ...o,
104
- [`${e}--${R(i)}`]: a
104
+ [`${e}--${M(l)}`]: u
105
105
  };
106
106
  }, r) || {})
107
107
  };
@@ -137,45 +137,45 @@ const se = {
137
137
  modifiers: {
138
138
  type: [String, Array]
139
139
  }
140
- }, ie = {
140
+ }, le = {
141
141
  name: "VvIcon"
142
- }, E = /* @__PURE__ */ I({
143
- ...ie,
142
+ }, G = /* @__PURE__ */ N({
143
+ ...le,
144
144
  props: se,
145
145
  setup(e) {
146
- const t = e, r = G(!0), { modifiers: u } = M(t), o = P(N), { bemCssClasses: i } = q("vv-icon", {
147
- modifiers: u
148
- }), a = g(() => t.provider || (o == null ? void 0 : o.provider)), d = g(() => {
149
- const n = t.name ?? "", l = `@${a.value}:${t.prefix}:${t.name}`;
150
- return w(n) ? n : w(l) ? l : (o == null ? void 0 : o.iconsCollections.find((p) => {
151
- const y = `@${a.value}:${p.prefix}:${n}`;
152
- if (w(y))
146
+ const t = e, r = q(!0), { modifiers: c } = z(t), o = F(U), { bemCssClasses: l } = Z("vv-icon", {
147
+ modifiers: c
148
+ }), u = d(() => t.provider || (o == null ? void 0 : o.provider)), v = d(() => {
149
+ const n = t.name ?? "", i = `@${u.value}:${t.prefix}:${t.name}`;
150
+ return O(n) ? n : O(i) ? i : (o == null ? void 0 : o.iconsCollections.find((p) => {
151
+ const y = `@${u.value}:${p.prefix}:${n}`;
152
+ if (O(y))
153
153
  return y;
154
154
  })) || n;
155
155
  });
156
156
  function s(n) {
157
- let l = null;
157
+ let i = null;
158
158
  if (typeof window > "u") {
159
- const { JSDOM: h } = require("jsdom");
160
- l = new h().window;
159
+ const { JSDOM: S } = require("jsdom");
160
+ i = new S().window;
161
161
  }
162
- return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
162
+ return (i ? new i.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
163
163
  }
164
- function c(n) {
165
- const l = s(n), p = (l == null ? void 0 : l.innerHTML.trim()) || "";
166
- l && p && re(`@${a.value}:${t.prefix}:${t.name}`, {
164
+ function a(n) {
165
+ const i = s(n), p = (i == null ? void 0 : i.innerHTML.trim()) || "";
166
+ i && p && ne(`@${u.value}:${t.prefix}:${t.name}`, {
167
167
  body: p,
168
- height: l.viewBox.baseVal.height,
169
- width: l.viewBox.baseVal.width
168
+ height: i.viewBox.baseVal.height,
169
+ width: i.viewBox.baseVal.width
170
170
  });
171
171
  }
172
- return o && (t.src && !w(`@${a.value}:${t.prefix}:${t.name}`) ? (r.value = !1, o.fetchIcon(t.src).then((n) => {
173
- n && (c(n), r.value = !0);
172
+ return o && (t.src && !O(`@${u.value}:${t.prefix}:${t.name}`) ? (r.value = !1, o.fetchIcon(t.src).then((n) => {
173
+ n && (a(n), r.value = !0);
174
174
  }).catch((n) => {
175
175
  throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
176
- })) : t.svg && c(t.svg)), (n, l) => r.value ? (b(), A(v(ne), C({
176
+ })) : t.svg && a(t.svg)), (n, i) => r.value ? (h(), V(g(re), D({
177
177
  key: 0,
178
- class: v(i)
178
+ class: g(l)
179
179
  }, {
180
180
  inline: n.inline,
181
181
  width: n.width,
@@ -186,49 +186,52 @@ const se = {
186
186
  rotate: n.rotate,
187
187
  color: n.color,
188
188
  onLoad: n.onLoad,
189
- icon: v(d)
189
+ icon: g(v)
190
190
  }), null, 16, ["class"])) : $("", !0);
191
191
  }
192
- }), le = {
192
+ }), ie = {
193
193
  disabled: Boolean
194
194
  }, ae = {
195
195
  modifiers: [String, Array]
196
+ }, ue = {
197
+ unselectable: { type: Boolean, default: !0 }
196
198
  };
197
- function ue(e) {
198
- const t = P(e, void 0), r = g(() => !oe(t));
199
- function u(o, i, a) {
199
+ function ce(e) {
200
+ const t = F(e, void 0), r = d(() => !oe(t));
201
+ function c(o, l, u) {
200
202
  if (t != null && t.value) {
201
- const s = v(t.value)[o];
202
- return g({
203
+ const s = g(t.value)[o];
204
+ return d({
203
205
  get() {
204
206
  return s == null ? void 0 : s.value;
205
207
  },
206
- set(c) {
207
- s.value = c;
208
+ set(a) {
209
+ s.value = a;
208
210
  }
209
211
  });
210
212
  }
211
- const d = T(i, o);
212
- return g({
213
+ const v = T(l, o);
214
+ return d({
213
215
  get() {
214
- return d.value;
216
+ return v.value;
215
217
  },
216
218
  set(s) {
217
- a && a(`update:${o}`, s);
219
+ u && u(`update:${o}`, s);
218
220
  }
219
221
  });
220
222
  }
221
223
  return {
222
224
  group: t,
223
225
  isInGroup: r,
224
- getGroupOrLocalRef: u
226
+ getGroupOrLocalRef: c
225
227
  };
226
228
  }
227
- const ce = "VV_BUTTON_GROUP";
228
- var k = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(k || {}), z = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(z || {}), m = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(m || {}), U = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(U || {});
229
- const fe = ["update:modelValue"], de = {
229
+ const fe = "VV_BUTTON_GROUP";
230
+ var k = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(k || {}), x = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(x || {}), m = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(m || {}), H = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(H || {});
231
+ const de = ["update:modelValue"], ve = {
230
232
  ...ae,
231
- ...le,
233
+ ...ie,
234
+ ...ue,
232
235
  icon: {
233
236
  type: [String, Object],
234
237
  default: ""
@@ -251,7 +254,7 @@ const fe = ["update:modelValue"], de = {
251
254
  href: String,
252
255
  target: {
253
256
  type: String,
254
- validator: (e) => e in U
257
+ validator: (e) => e in H
255
258
  },
256
259
  active: Boolean,
257
260
  pressed: Boolean,
@@ -262,95 +265,104 @@ const fe = ["update:modelValue"], de = {
262
265
  type: {
263
266
  type: String,
264
267
  default: "button",
265
- validator: (e) => e in z
268
+ validator: (e) => e in x
266
269
  },
267
270
  toggle: {
268
271
  type: Boolean,
269
272
  default: !1
270
273
  },
271
- modelValue: String,
272
- unselectable: { type: Boolean, default: !0 }
274
+ modelValue: String
273
275
  };
274
276
  function ge(e, t) {
275
- var h;
276
- const { group: r, isInGroup: u, getGroupOrLocalRef: o } = ue(ce), { iconPosition: i, icon: a, label: d, pressed: s } = M(e), c = o("modelValue", e, t), n = o("disabled", e), l = o("toggle", e), p = o(
277
+ var A;
278
+ const { group: r, isInGroup: c, getGroupOrLocalRef: o } = ce(fe), {
279
+ iconPosition: l,
280
+ icon: u,
281
+ label: v,
282
+ pressed: s,
283
+ modifiers: a
284
+ } = z(e), n = o("modelValue", e, t), i = o("disabled", e), p = o("toggle", e), y = o(
277
285
  "unselectable",
278
286
  e
279
- ), y = o("modifiers", e), S = ((h = r == null ? void 0 : r.value) == null ? void 0 : h.multiple) ?? G(!1);
287
+ ), b = ((A = r == null ? void 0 : r.value) == null ? void 0 : A.multiple) ?? q(!1), S = d(() => {
288
+ var w;
289
+ const C = a != null && a.value ? Array.isArray(a.value) ? a.value : [a.value] : [], L = (w = r == null ? void 0 : r.value.itemModifiers) != null && w.value ? Array.isArray(r.value.itemModifiers.value) ? r.value.itemModifiers.value : [r.value.itemModifiers.value] : [];
290
+ return [...C, ...L];
291
+ });
280
292
  return {
281
- modelValue: c,
282
- disabled: n,
283
- toggle: l,
284
- isInGroup: u,
285
293
  group: r,
286
- modifiers: y,
287
- multiple: S,
288
- unselectable: p,
294
+ isInGroup: c,
295
+ modelValue: n,
296
+ disabled: i,
297
+ toggle: p,
298
+ unselectable: y,
299
+ multiple: b,
300
+ modifiers: S,
289
301
  pressed: s,
290
- iconPosition: i,
291
- icon: a,
292
- label: d
302
+ iconPosition: l,
303
+ icon: u,
304
+ label: v
293
305
  };
294
306
  }
295
- const ve = {
307
+ const pe = {
296
308
  key: 1,
297
309
  class: "vv-button__label"
298
- }, pe = {
310
+ }, me = {
299
311
  key: 1,
300
312
  class: "vv-button__label"
301
- }, me = {
313
+ }, ye = {
302
314
  name: "VvButton"
303
- }, ke = /* @__PURE__ */ I({
304
- ...me,
305
- props: de,
306
- emits: fe,
315
+ }, Ae = /* @__PURE__ */ N({
316
+ ...ye,
317
+ props: ve,
318
+ emits: de,
307
319
  setup(e, { emit: t }) {
308
- const r = e, u = X(), o = K(), i = (u == null ? void 0 : u.name) || te(), {
309
- modifiers: a,
310
- iconPosition: d,
320
+ const r = e, c = X(), o = K(), l = (c == null ? void 0 : c.name) || te(), {
321
+ modifiers: u,
322
+ iconPosition: v,
311
323
  icon: s,
312
- label: c,
324
+ label: a,
313
325
  modelValue: n,
314
- disabled: l,
326
+ disabled: i,
315
327
  toggle: p,
316
328
  unselectable: y
317
- } = ge(r, t), S = P(N), h = g(() => {
329
+ } = ge(r, t), b = F(U), S = d(() => {
318
330
  switch (!0) {
319
- case l.value:
331
+ case i.value:
320
332
  return m.button;
321
333
  case r.to !== void 0:
322
- return S != null && S.nuxt ? m.nuxtLink : m.routerLink;
334
+ return b != null && b.nuxt ? m.nuxtLink : m.routerLink;
323
335
  case r.href !== void 0:
324
336
  return m.a;
325
337
  default:
326
338
  return m.button;
327
339
  }
328
- }), D = g(() => p.value ? Array.isArray(n.value) ? F(i, n.value) : V(i, n.value) : r.pressed), { bemCssClasses: Z } = q("vv-button", {
329
- modifiers: a,
340
+ }), A = d(() => p.value ? Array.isArray(n.value) ? I(l, n.value) : j(l, n.value) : r.pressed), { bemCssClasses: C } = Z("vv-button", {
341
+ modifiers: u,
330
342
  active: r.active,
331
- pressed: D,
332
- disabled: l,
333
- reverse: g(
343
+ pressed: A,
344
+ disabled: i,
345
+ reverse: d(
334
346
  () => [k.right, k.bottom].includes(
335
- d.value
347
+ v.value
336
348
  )
337
349
  ),
338
- column: g(
350
+ column: d(
339
351
  () => [k.top, k.bottom].includes(
340
- d.value
352
+ v.value
341
353
  )
342
354
  ),
343
- iconOnly: g(
344
- () => (s == null ? void 0 : s.value) && !(c != null && c.value) && !o.default
355
+ iconOnly: d(
356
+ () => (s == null ? void 0 : s.value) && !(a != null && a.value) && !o.default
345
357
  )
346
- }), x = g(
358
+ }), L = d(
347
359
  () => typeof (s == null ? void 0 : s.value) == "string" ? { name: s == null ? void 0 : s.value } : s == null ? void 0 : s.value
348
- ), H = g(() => {
360
+ ), w = d(() => {
349
361
  const f = {
350
- class: Z.value,
351
- "aria-pressed": D.value ? !0 : void 0
362
+ class: C.value,
363
+ "aria-pressed": A.value ? !0 : void 0
352
364
  };
353
- switch (h.value) {
365
+ switch (S.value) {
354
366
  case m.a:
355
367
  return {
356
368
  ...f,
@@ -371,47 +383,47 @@ const ve = {
371
383
  return {
372
384
  ...f,
373
385
  type: r.type,
374
- disabled: l.value
386
+ disabled: i.value
375
387
  };
376
388
  }
377
389
  }), J = () => {
378
390
  if (p.value) {
379
391
  if (Array.isArray(n.value)) {
380
- if (F(i, n.value)) {
392
+ if (I(l, n.value)) {
381
393
  y.value && (n.value = n.value.filter(
382
- (f) => f !== i
394
+ (f) => f !== l
383
395
  ));
384
396
  return;
385
397
  }
386
- n.value.push(i);
398
+ n.value.push(l);
387
399
  return;
388
400
  }
389
- if (V(i, n.value) && y.value) {
401
+ if (j(l, n.value) && y.value) {
390
402
  n.value = void 0;
391
403
  return;
392
404
  }
393
- n.value = i;
405
+ n.value = l;
394
406
  }
395
407
  };
396
- return (f, ye) => (b(), A(Q(v(h)), C(v(H), { onClickPassive: J }), {
408
+ return (f, he) => (h(), V(Q(g(S)), D(g(w), { onClickPassive: J }), {
397
409
  default: W(() => [
398
410
  _(f.$slots, "default", {}, () => [
399
411
  f.loading ? _(f.$slots, "loading", { key: 0 }, () => [
400
- f.loadingIcon ? (b(), A(E, {
412
+ f.loadingIcon ? (h(), V(G, {
401
413
  key: 0,
402
414
  class: "vv-button__loading-icon",
403
415
  name: f.loadingIcon
404
416
  }, null, 8, ["name"])) : $("", !0),
405
- f.loadingLabel ? (b(), O("span", ve, j(f.loadingLabel), 1)) : $("", !0)
406
- ]) : (b(), O(Y, { key: 1 }, [
417
+ f.loadingLabel ? (h(), P("span", pe, R(f.loadingLabel), 1)) : $("", !0)
418
+ ]) : (h(), P(Y, { key: 1 }, [
407
419
  _(f.$slots, "before"),
408
- v(s) ? (b(), A(E, C({
420
+ g(s) ? (h(), V(G, D({
409
421
  key: 0,
410
422
  class: "vv-button__icon"
411
- }, v(x)), null, 16)) : $("", !0),
412
- v(c) ? (b(), O("span", pe, [
423
+ }, g(L)), null, 16)) : $("", !0),
424
+ g(a) ? (h(), P("span", me, [
413
425
  _(f.$slots, "label", {}, () => [
414
- ee(j(v(c)), 1)
426
+ ee(R(g(a)), 1)
415
427
  ])
416
428
  ])) : $("", !0),
417
429
  _(f.$slots, "after")
@@ -423,5 +435,5 @@ const ve = {
423
435
  }
424
436
  });
425
437
  export {
426
- ke as default
438
+ Ae as default
427
439
  };
@@ -1 +1 @@
1
- (function(e,_){typeof exports=="object"&&typeof module<"u"?module.exports=_(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],_):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButton=_(e.vue,e.nanoid,e.vue$1))})(this,function(e,_,b){"use strict";function C(t,n,o){return o?B(t,o)===B(n,o):w(t,n)}function w(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){const o=Array.isArray(t),u=Array.isArray(n);let s,l,c;if(o&&u){if(l=t.length,l!=n.length)return!1;for(s=l;s--!==0;)if(!w(t[s],n[s]))return!1;return!0}if(o!=u)return!1;const p=t instanceof Date,i=n instanceof Date;if(p!=i)return!1;if(p&&i)return t.getTime()==n.getTime();const f=t instanceof RegExp,r=n instanceof RegExp;if(f!=r)return!1;if(f&&r)return t.toString()==n.toString();const a=Object.keys(t);if(l=a.length,l!==Object.keys(n).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[s]))return!1;for(s=l;s--!==0;)if(c=a[s],!w(t[c],n[c]))return!1;return!0}return t!==t&&n!==n}function B(t,n){if(t&&Object.keys(t).length&&n){if(n.indexOf(".")===-1)return t[n];{const o=n.split(".");let u=t;for(let s=0,l=o.length;s<l;++s){if(t==null)return null;u=u[o[s]]}return u}}else return null}function V(t,n){if(t!=null&&n&&n.length){for(const o of n)if(C(t,o))return!0}return!1}function E(t){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(t))}function v(t){var n,o;if(t)return(o=(n=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:n.join("-"))==null?void 0:o.toLowerCase()}const A="ds";function $(t,n){const o={[`${t}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(n).reduce((s,l)=>{const c=e.unref(n[l])||!1;if(!c)return s;if(l==="modifiers"){const p=Array.isArray(c)?c:c.split(" ");return{...s,...p.reduce((i,f)=>({...i,[`${t}--${v(f)}`]:!0}),{})}}else return{...s,[`${t}--${v(l)}`]:c}},o)||{})}}const D={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}},R={name:"VvIcon"},O=e.defineComponent({...R,props:D,setup(t){const n=t,o=e.ref(!0),{modifiers:u}=e.toRefs(n),s=e.inject(A),{bemCssClasses:l}=$("vv-icon",{modifiers:u}),c=e.computed(()=>n.provider||(s==null?void 0:s.provider)),p=e.computed(()=>{const r=n.name??"",a=`@${c.value}:${n.prefix}:${n.name}`;return b.iconExists(r)?r:b.iconExists(a)?a:(s==null?void 0:s.iconsCollections.find(m=>{const y=`@${c.value}:${m.prefix}:${r}`;if(b.iconExists(y))return y}))||r});function i(r){let a=null;if(typeof window>"u"){const{JSDOM:h}=require("jsdom");a=new h().window}return(a?new a.DOMParser:new window.DOMParser).parseFromString(r,"text/html").querySelector("svg")}function f(r){const a=i(r),m=(a==null?void 0:a.innerHTML.trim())||"";a&&m&&b.addIcon(`@${c.value}:${n.prefix}:${n.name}`,{body:m,height:a.viewBox.baseVal.height,width:a.viewBox.baseVal.width})}return s&&(n.src&&!b.iconExists(`@${c.value}:${n.prefix}:${n.name}`)?(o.value=!1,s.fetchIcon(n.src).then(r=>{r&&(f(r),o.value=!0)}).catch(r=>{throw new Error(`During fetch icon: ${r==null?void 0:r.message}`)})):n.svg&&f(n.svg)),(r,a)=>o.value?(e.openBlock(),e.createBlock(e.unref(b.Icon),e.mergeProps({key:0,class:e.unref(l)},{inline:r.inline,width:r.width,height:r.height,horizontalFlip:r.horizontalFlip,verticalFlip:r.verticalFlip,flip:r.flip,rotate:r.rotate,color:r.color,onLoad:r.onLoad,icon:e.unref(p)}),null,16,["class"])):e.createCommentVNode("",!0)}}),F={disabled:Boolean},I={modifiers:[String,Array]};function N(t){const n=e.inject(t,void 0),o=e.computed(()=>!E(n));function u(s,l,c){if(n!=null&&n.value){const i=e.unref(n.value)[s];return e.computed({get(){return i==null?void 0:i.value},set(f){i.value=f}})}const p=e.toRef(l,s);return e.computed({get(){return p.value},set(i){c&&c(`update:${s}`,i)}})}return{group:n,isInGroup:o,getGroupOrLocalRef:u}}const q="VV_BUTTON_GROUP";var S=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(S||{}),P=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(P||{}),g=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(g||{}),L=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(L||{});const G=["update:modelValue"],x={...I,...F,icon:{type:[String,Object],default:""},iconPosition:{type:String,default:"left",validator:t=>t in S},label:[String,Number],loading:Boolean,loadingIcon:{type:String,default:"eos-icons:bubble-loading"},loadingLabel:{type:String,default:"Loading..."},to:{type:[String,Object]},href:String,target:{type:String,validator:t=>t in L},active:Boolean,pressed:Boolean,rel:{type:String,default:"noopener noreferrer"},type:{type:String,default:"button",validator:t=>t in P},toggle:{type:Boolean,default:!1},modelValue:String,unselectable:{type:Boolean,default:!0}};function M(t,n){var h;const{group:o,isInGroup:u,getGroupOrLocalRef:s}=N(q),{iconPosition:l,icon:c,label:p,pressed:i}=e.toRefs(t),f=s("modelValue",t,n),r=s("disabled",t),a=s("toggle",t),m=s("unselectable",t),y=s("modifiers",t),k=((h=o==null?void 0:o.value)==null?void 0:h.multiple)??e.ref(!1);return{modelValue:f,disabled:r,toggle:a,isInGroup:u,group:o,modifiers:y,multiple:k,unselectable:m,pressed:i,iconPosition:l,icon:c,label:p}}const z={key:1,class:"vv-button__label"},U={key:1,class:"vv-button__label"},Z={name:"VvButton"};return e.defineComponent({...Z,props:x,emits:G,setup(t,{emit:n}){const o=t,u=e.useAttrs(),s=e.useSlots(),l=(u==null?void 0:u.name)||_.nanoid(),{modifiers:c,iconPosition:p,icon:i,label:f,modelValue:r,disabled:a,toggle:m,unselectable:y}=M(o,n),k=e.inject(A),h=e.computed(()=>{switch(!0){case a.value:return g.button;case o.to!==void 0:return k!=null&&k.nuxt?g.nuxtLink:g.routerLink;case o.href!==void 0:return g.a;default:return g.button}}),j=e.computed(()=>m.value?Array.isArray(r.value)?V(l,r.value):C(l,r.value):o.pressed),{bemCssClasses:T}=$("vv-button",{modifiers:c,active:o.active,pressed:j,disabled:a,reverse:e.computed(()=>[S.right,S.bottom].includes(p.value)),column:e.computed(()=>[S.top,S.bottom].includes(p.value)),iconOnly:e.computed(()=>(i==null?void 0:i.value)&&!(f!=null&&f.value)&&!s.default)}),H=e.computed(()=>typeof(i==null?void 0:i.value)=="string"?{name:i==null?void 0:i.value}:i==null?void 0:i.value),J=e.computed(()=>{const d={class:T.value,"aria-pressed":j.value?!0:void 0};switch(h.value){case g.a:return{...d,role:"button",href:o.href,target:o.target,rel:o.rel};case g.routerLink:case g.nuxtLink:return{...d,role:"button",to:o.to,target:o.target};default:return{...d,type:o.type,disabled:a.value}}}),X=()=>{if(m.value){if(Array.isArray(r.value)){if(V(l,r.value)){y.value&&(r.value=r.value.filter(d=>d!==l));return}r.value.push(l);return}if(C(l,r.value)&&y.value){r.value=void 0;return}r.value=l}};return(d,Q)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(h)),e.mergeProps(e.unref(J),{onClickPassive:X}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{},()=>[d.loading?e.renderSlot(d.$slots,"loading",{key:0},()=>[d.loadingIcon?(e.openBlock(),e.createBlock(O,{key:0,class:"vv-button__loading-icon",name:d.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),d.loadingLabel?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(d.loadingLabel),1)):e.createCommentVNode("",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(d.$slots,"before"),e.unref(i)?(e.openBlock(),e.createBlock(O,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(H)),null,16)):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("span",U,[e.renderSlot(d.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(f)),1)])])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"after")],64))])]),_:3},16))}})});
1
+ (function(e,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],v):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButton=v(e.vue,e.nanoid,e.vue$1))})(this,function(e,v,h){"use strict";function V(t,n,r){return r?$(t,r)===$(n,r):C(t,n)}function C(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){const r=Array.isArray(t),f=Array.isArray(n);let s,l,u;if(r&&f){if(l=t.length,l!=n.length)return!1;for(s=l;s--!==0;)if(!C(t[s],n[s]))return!1;return!0}if(r!=f)return!1;const p=t instanceof Date,i=n instanceof Date;if(p!=i)return!1;if(p&&i)return t.getTime()==n.getTime();const c=t instanceof RegExp,o=n instanceof RegExp;if(c!=o)return!1;if(c&&o)return t.toString()==n.toString();const a=Object.keys(t);if(l=a.length,l!==Object.keys(n).length)return!1;for(s=l;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[s]))return!1;for(s=l;s--!==0;)if(u=a[s],!C(t[u],n[u]))return!1;return!0}return t!==t&&n!==n}function $(t,n){if(t&&Object.keys(t).length&&n){if(n.indexOf(".")===-1)return t[n];{const r=n.split(".");let f=t;for(let s=0,l=r.length;s<l;++s){if(t==null)return null;f=f[r[s]]}return f}}else return null}function O(t,n){if(t!=null&&n&&n.length){for(const r of n)if(V(t,r))return!0}return!1}function F(t){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(t))}function P(t){var n,r;if(t)return(r=(n=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:n.join("-"))==null?void 0:r.toLowerCase()}const L="ds";function j(t,n){const r={[`${t}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(n).reduce((s,l)=>{const u=e.unref(n[l])||!1;if(!u)return s;if(l==="modifiers"){const p=Array.isArray(u)?u:u.split(" ");return{...s,...p.reduce((i,c)=>({...i,[`${t}--${P(c)}`]:!0}),{})}}else return{...s,[`${t}--${P(l)}`]:u}},r)||{})}}const I={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}},N={name:"VvIcon"},E=e.defineComponent({...N,props:I,setup(t){const n=t,r=e.ref(!0),{modifiers:f}=e.toRefs(n),s=e.inject(L),{bemCssClasses:l}=j("vv-icon",{modifiers:f}),u=e.computed(()=>n.provider||(s==null?void 0:s.provider)),p=e.computed(()=>{const o=n.name??"",a=`@${u.value}:${n.prefix}:${n.name}`;return h.iconExists(o)?o:h.iconExists(a)?a:(s==null?void 0:s.iconsCollections.find(m=>{const y=`@${u.value}:${m.prefix}:${o}`;if(h.iconExists(y))return y}))||o});function i(o){let a=null;if(typeof window>"u"){const{JSDOM:k}=require("jsdom");a=new k().window}return(a?new a.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function c(o){const a=i(o),m=(a==null?void 0:a.innerHTML.trim())||"";a&&m&&h.addIcon(`@${u.value}:${n.prefix}:${n.name}`,{body:m,height:a.viewBox.baseVal.height,width:a.viewBox.baseVal.width})}return s&&(n.src&&!h.iconExists(`@${u.value}:${n.prefix}:${n.name}`)?(r.value=!1,s.fetchIcon(n.src).then(o=>{o&&(c(o),r.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):n.svg&&c(n.svg)),(o,a)=>r.value?(e.openBlock(),e.createBlock(e.unref(h.Icon),e.mergeProps({key:0,class:e.unref(l)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(p)}),null,16,["class"])):e.createCommentVNode("",!0)}}),M={disabled:Boolean},q={modifiers:[String,Array]},G={unselectable:{type:Boolean,default:!0}};function x(t){const n=e.inject(t,void 0),r=e.computed(()=>!F(n));function f(s,l,u){if(n!=null&&n.value){const i=e.unref(n.value)[s];return e.computed({get(){return i==null?void 0:i.value},set(c){i.value=c}})}const p=e.toRef(l,s);return e.computed({get(){return p.value},set(i){u&&u(`update:${s}`,i)}})}return{group:n,isInGroup:r,getGroupOrLocalRef:f}}const z="VV_BUTTON_GROUP";var b=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(b||{}),D=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(D||{}),g=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(g||{}),R=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(R||{});const U=["update:modelValue"],Z={...q,...M,...G,icon:{type:[String,Object],default:""},iconPosition:{type:String,default:"left",validator:t=>t in b},label:[String,Number],loading:Boolean,loadingIcon:{type:String,default:"eos-icons:bubble-loading"},loadingLabel:{type:String,default:"Loading..."},to:{type:[String,Object]},href:String,target:{type:String,validator:t=>t in R},active:Boolean,pressed:Boolean,rel:{type:String,default:"noopener noreferrer"},type:{type:String,default:"button",validator:t=>t in D},toggle:{type:Boolean,default:!1},modelValue:String};function T(t,n){var _;const{group:r,isInGroup:f,getGroupOrLocalRef:s}=x(z),{iconPosition:l,icon:u,label:p,pressed:i,modifiers:c}=e.toRefs(t),o=s("modelValue",t,n),a=s("disabled",t),m=s("toggle",t),y=s("unselectable",t),S=((_=r==null?void 0:r.value)==null?void 0:_.multiple)??e.ref(!1),k=e.computed(()=>{var A;const w=c!=null&&c.value?Array.isArray(c.value)?c.value:[c.value]:[],B=(A=r==null?void 0:r.value.itemModifiers)!=null&&A.value?Array.isArray(r.value.itemModifiers.value)?r.value.itemModifiers.value:[r.value.itemModifiers.value]:[];return[...w,...B]});return{group:r,isInGroup:f,modelValue:o,disabled:a,toggle:m,unselectable:y,multiple:S,modifiers:k,pressed:i,iconPosition:l,icon:u,label:p}}const H={key:1,class:"vv-button__label"},J={key:1,class:"vv-button__label"},X={name:"VvButton"};return e.defineComponent({...X,props:Z,emits:U,setup(t,{emit:n}){const r=t,f=e.useAttrs(),s=e.useSlots(),l=(f==null?void 0:f.name)||v.nanoid(),{modifiers:u,iconPosition:p,icon:i,label:c,modelValue:o,disabled:a,toggle:m,unselectable:y}=T(r,n),S=e.inject(L),k=e.computed(()=>{switch(!0){case a.value:return g.button;case r.to!==void 0:return S!=null&&S.nuxt?g.nuxtLink:g.routerLink;case r.href!==void 0:return g.a;default:return g.button}}),_=e.computed(()=>m.value?Array.isArray(o.value)?O(l,o.value):V(l,o.value):r.pressed),{bemCssClasses:w}=j("vv-button",{modifiers:u,active:r.active,pressed:_,disabled:a,reverse:e.computed(()=>[b.right,b.bottom].includes(p.value)),column:e.computed(()=>[b.top,b.bottom].includes(p.value)),iconOnly:e.computed(()=>(i==null?void 0:i.value)&&!(c!=null&&c.value)&&!s.default)}),B=e.computed(()=>typeof(i==null?void 0:i.value)=="string"?{name:i==null?void 0:i.value}:i==null?void 0:i.value),A=e.computed(()=>{const d={class:w.value,"aria-pressed":_.value?!0:void 0};switch(k.value){case g.a:return{...d,role:"button",href:r.href,target:r.target,rel:r.rel};case g.routerLink:case g.nuxtLink:return{...d,role:"button",to:r.to,target:r.target};default:return{...d,type:r.type,disabled:a.value}}}),K=()=>{if(m.value){if(Array.isArray(o.value)){if(O(l,o.value)){y.value&&(o.value=o.value.filter(d=>d!==l));return}o.value.push(l);return}if(V(l,o.value)&&y.value){o.value=void 0;return}o.value=l}};return(d,W)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(A),{onClickPassive:K}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{},()=>[d.loading?e.renderSlot(d.$slots,"loading",{key:0},()=>[d.loadingIcon?(e.openBlock(),e.createBlock(E,{key:0,class:"vv-button__loading-icon",name:d.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),d.loadingLabel?(e.openBlock(),e.createElementBlock("span",H,e.toDisplayString(d.loadingLabel),1)):e.createCommentVNode("",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(d.$slots,"before"),e.unref(i)?(e.openBlock(),e.createBlock(E,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(B)),null,16)):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("span",J,[e.renderSlot(d.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)])])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"after")],64))])]),_:3},16))}})});
@@ -2,10 +2,6 @@ import { ButtonIconPosition } from '@/components/VvButton';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
3
  icon: {
4
4
  type: (ObjectConstructor | StringConstructor)[];
5
- /**
6
- * @description The tag defined by props.
7
- * @returns {string} The tag.
8
- */
9
5
  default: string;
10
6
  };
11
7
  iconPosition: {
@@ -56,10 +52,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
56
52
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
57
53
  icon: {
58
54
  type: (ObjectConstructor | StringConstructor)[];
59
- /**
60
- * @description The tag defined by props.
61
- * @returns {string} The tag.
62
- */
63
55
  default: string;
64
56
  };
65
57
  iconPosition: {
@@ -117,14 +117,14 @@ export type VvButtonPropsTypes = ExtractPropTypes<typeof VvButtonProps>;
117
117
  * Merges local and group props
118
118
  */
119
119
  export declare function useGroupProps(props: VvButtonPropsTypes, emit: (event: (typeof VvButtonEvents)[number], value: unknown) => void): {
120
+ group: Ref<IButtonGroupState> | undefined;
121
+ isInGroup: import("vue").ComputedRef<boolean>;
120
122
  modelValue: Ref<string | string[] | undefined>;
121
123
  disabled: Ref<boolean>;
122
124
  toggle: Ref<boolean>;
123
- isInGroup: import("vue").ComputedRef<boolean>;
124
- group: Ref<IButtonGroupState> | undefined;
125
- modifiers: Ref<string | string[]>;
126
- multiple: Ref<boolean>;
127
125
  unselectable: Ref<boolean>;
126
+ multiple: Ref<boolean>;
127
+ modifiers: import("vue").ComputedRef<string[]>;
128
128
  pressed: Ref<boolean>;
129
129
  iconPosition: Ref<ButtonIconPosition>;
130
130
  icon: Ref<string | Record<string, any>>;