@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
  3. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  5. package/dist/components/VvAccordion/index.d.ts +2 -2
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
  9. package/dist/components/VvAccordionGroup/index.d.ts +2 -2
  10. package/dist/components/VvBadge/VvBadge.es.js +16 -50
  11. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  12. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
  13. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  14. package/dist/components/VvButton/VvButton.es.js +170 -306
  15. package/dist/components/VvButton/VvButton.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
  17. package/dist/components/VvButton/index.d.ts +3 -3
  18. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
  19. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  20. package/dist/components/VvCard/VvCard.es.js +26 -60
  21. package/dist/components/VvCard/VvCard.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  23. package/dist/components/VvCard/index.d.ts +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
  27. package/dist/components/VvCheckbox/index.d.ts +10 -4
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  31. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  32. package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
  35. package/dist/components/VvCombobox/index.d.ts +4 -4
  36. package/dist/components/VvDialog/VvDialog.es.js +66 -102
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/index.d.ts +1 -1
  42. package/dist/components/VvIcon/VvIcon.es.js +30 -65
  43. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  44. package/dist/components/VvInputText/VvInputText.es.js +304 -407
  45. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  46. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  47. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  48. package/dist/components/VvInputText/index.d.ts +5 -5
  49. package/dist/components/VvProgress/VvProgress.es.js +17 -51
  50. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  51. package/dist/components/VvRadio/VvRadio.es.js +110 -249
  52. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  53. package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
  54. package/dist/components/VvRadio/index.d.ts +3 -3
  55. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
  56. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  57. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  58. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  59. package/dist/components/VvSelect/VvSelect.es.js +200 -292
  60. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  61. package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
  62. package/dist/components/VvSelect/index.d.ts +4 -4
  63. package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
  64. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  65. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
  66. package/dist/components/VvTextarea/index.d.ts +3 -3
  67. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  68. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  69. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  70. package/dist/components/VvTooltip/index.d.ts +18 -0
  71. package/dist/components/common/HintSlot.d.ts +1 -1
  72. package/dist/components/index.es.js +1179 -1371
  73. package/dist/components/index.umd.js +1 -1
  74. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  75. package/dist/composables/useComponentFocus.d.ts +1 -1
  76. package/dist/composables/useComponentIcons.d.ts +1 -1
  77. package/dist/composables/useDebouncedInput.d.ts +1 -1
  78. package/dist/composables/useModifiers.d.ts +1 -1
  79. package/dist/composables/useTextCount.d.ts +1 -1
  80. package/dist/icons.es.js +3 -3
  81. package/dist/icons.umd.js +1 -1
  82. package/dist/index.es.js +1211 -1404
  83. package/dist/index.umd.js +1 -1
  84. package/dist/props/index.d.ts +12 -12
  85. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  86. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  87. package/dist/utils/ObjectUtilities.d.ts +1 -1
  88. package/package.json +27 -20
  89. package/src/assets/icons/detailed.json +1 -1
  90. package/src/assets/icons/normal.json +1 -1
  91. package/src/assets/icons/simple.json +1 -1
  92. package/src/components/VvAccordion/VvAccordion.vue +0 -3
  93. package/src/components/VvAccordion/index.ts +1 -2
  94. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
  95. package/src/components/VvBadge/VvBadge.vue +0 -1
  96. package/src/components/VvButton/VvButton.vue +0 -3
  97. package/src/components/VvButton/index.ts +2 -10
  98. package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
  99. package/src/components/VvCard/VvCard.vue +0 -1
  100. package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
  101. package/src/components/VvCheckbox/index.ts +1 -2
  102. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
  103. package/src/components/VvCombobox/VvCombobox.vue +0 -7
  104. package/src/components/VvDialog/VvDialog.vue +1 -2
  105. package/src/components/VvDropdown/VvDropdown.vue +0 -4
  106. package/src/components/VvIcon/VvIcon.vue +0 -2
  107. package/src/components/VvInputText/VvInputClearAction.ts +0 -1
  108. package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
  109. package/src/components/VvInputText/VvInputStepAction.ts +0 -1
  110. package/src/components/VvInputText/VvInputText.vue +1 -16
  111. package/src/components/VvInputText/VvInputTextActions.ts +1 -1
  112. package/src/components/VvProgress/VvProgress.vue +0 -2
  113. package/src/components/VvRadio/VvRadio.vue +0 -3
  114. package/src/components/VvRadio/index.ts +0 -1
  115. package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
  116. package/src/components/VvSelect/VvSelect.vue +1 -14
  117. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  118. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  119. package/src/components/VvTooltip/index.ts +21 -0
  120. package/src/components/common/HintSlot.ts +1 -11
  121. package/src/composables/group/types/IAccordionGroupState.ts +0 -1
  122. package/src/composables/group/types/IButtonGroupState.ts +0 -1
  123. package/src/composables/group/types/IInputGroup.ts +0 -1
  124. package/src/composables/group/useInjectedGroupState.ts +1 -2
  125. package/src/composables/group/useProvideGroupState.ts +0 -1
  126. package/src/composables/useComponentFocus.ts +1 -2
  127. package/src/composables/useComponentIcons.ts +1 -1
  128. package/src/composables/useDebouncedInput.ts +1 -1
  129. package/src/composables/useModifiers.ts +1 -2
  130. package/src/composables/useOptions.ts +0 -1
  131. package/src/composables/useTextCount.ts +1 -1
  132. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  133. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  134. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  135. package/src/stories/Badge/Badge.stories.mdx +1 -1
  136. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
  137. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  138. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  139. package/src/stories/Button/Button.stories.mdx +1 -1
  140. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  141. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  142. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
  143. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  144. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  145. package/src/stories/Card/Card.stories.mdx +1 -1
  146. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  147. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  148. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  149. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  150. package/src/stories/Combobox/Combobox.settings.ts +0 -1
  151. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  152. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  153. package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
  154. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  155. package/src/stories/Icon/Icon.settings.ts +0 -1
  156. package/src/stories/Icon/Icon.stories.mdx +1 -1
  157. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  158. package/src/stories/InputText/InputText.settings.ts +0 -1
  159. package/src/stories/InputText/InputText.stories.mdx +1 -1
  160. package/src/stories/Progress/Progress.stories.mdx +1 -1
  161. package/src/stories/Radio/Radio.stories.mdx +1 -1
  162. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  163. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  164. package/src/stories/Select/Select.settings.ts +0 -1
  165. package/src/stories/Select/Select.stories.mdx +1 -1
  166. package/src/stories/Textarea/Textarea.settings.ts +0 -1
  167. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  168. package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
  169. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  170. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
  171. package/src/utils/ObjectUtilities.ts +1 -1
@@ -1,112 +1,7 @@
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
- import { nanoid as te } from "nanoid";
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
- }
7
- function B(e, t) {
8
- if (e === t)
9
- return !0;
10
- if (e && t && typeof e == "object" && typeof t == "object") {
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
- return !1;
16
- for (o = l; o-- !== 0; )
17
- if (!B(e[o], t[o]))
18
- return !1;
19
- return !0;
20
- }
21
- if (r != c)
22
- return !1;
23
- const v = e instanceof Date, s = t instanceof Date;
24
- if (v != s)
25
- return !1;
26
- if (v && s)
27
- return e.getTime() == t.getTime();
28
- const a = e instanceof RegExp, n = t instanceof RegExp;
29
- if (a != n)
30
- return !1;
31
- if (a && n)
32
- return e.toString() == t.toString();
33
- const i = Object.keys(e);
34
- if (l = i.length, l !== Object.keys(t).length)
35
- return !1;
36
- for (o = l; o-- !== 0; )
37
- if (!Object.prototype.hasOwnProperty.call(t, i[o]))
38
- return !1;
39
- for (o = l; o-- !== 0; )
40
- if (u = i[o], !B(e[u], t[u]))
41
- return !1;
42
- return !0;
43
- }
44
- return e !== e && t !== t;
45
- }
46
- function E(e, t) {
47
- if (e && Object.keys(e).length && t) {
48
- if (t.indexOf(".") === -1)
49
- return e[t];
50
- {
51
- const r = t.split(".");
52
- let c = e;
53
- for (let o = 0, l = r.length; o < l; ++o) {
54
- if (e == null)
55
- return null;
56
- c = c[r[o]];
57
- }
58
- return c;
59
- }
60
- } else
61
- return null;
62
- }
63
- function I(e, t) {
64
- if (e != null && t && t.length) {
65
- for (const r of t)
66
- if (j(e, r))
67
- return !0;
68
- }
69
- return !1;
70
- }
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)(g(e));
73
- }
74
- function M(e) {
75
- var t, r;
76
- if (e)
77
- return (r = (t = e.match(
78
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
79
- )) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
80
- }
81
- const U = "ds";
82
- function Z(e, t) {
83
- const r = { [`${e}`]: !0 };
84
- return {
85
- bemCssClasses: d(() => Object.keys(t).reduce((o, l) => {
86
- const u = g(t[l]) || !1;
87
- if (!u)
88
- return o;
89
- if (l === "modifiers") {
90
- const v = Array.isArray(u) ? u : u.split(" ");
91
- return {
92
- ...o,
93
- ...v.reduce(
94
- (s, a) => ({
95
- ...s,
96
- [`${e}--${M(a)}`]: !0
97
- }),
98
- {}
99
- )
100
- };
101
- } else
102
- return {
103
- ...o,
104
- [`${e}--${M(l)}`]: u
105
- };
106
- }, r) || {})
107
- };
108
- }
109
- const se = {
1
+ import { defineComponent as I, unref as d, openBlock as g, createBlock as P, mergeProps as A, createCommentVNode as w, resolveDynamicComponent as E, withCtx as G, renderSlot as k, createElementBlock as O, toDisplayString as F, Fragment as j, createTextVNode as q } from "vue";
2
+ import { nanoid as U } from "nanoid";
3
+ import { iconExists as $, Icon as z, addIcon as H } from "@iconify/vue";
4
+ const M = "ds", J = {
110
5
  color: String,
111
6
  width: {
112
7
  type: [String, Number]
@@ -137,101 +32,70 @@ const se = {
137
32
  modifiers: {
138
33
  type: [String, Array]
139
34
  }
140
- }, le = {
35
+ }, X = {
141
36
  name: "VvIcon"
142
- }, G = /* @__PURE__ */ N({
143
- ...le,
144
- props: se,
145
- setup(e) {
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
- return y;
154
- })) || n;
37
+ }, B = /* @__PURE__ */ I({
38
+ ...X,
39
+ props: J,
40
+ setup(t) {
41
+ const r = t, o = ref(!0), { modifiers: m } = toRefs(r), i = inject(M), { bemCssClasses: u } = useBemModifiers("vv-icon", {
42
+ modifiers: m
43
+ }), f = computed(() => r.provider || (i == null ? void 0 : i.provider)), b = computed(() => {
44
+ const e = r.name ?? "", n = `@${f.value}:${r.prefix}:${r.name}`;
45
+ return $(e) ? e : $(n) ? n : (i == null ? void 0 : i.iconsCollections.find((c) => {
46
+ const p = `@${f.value}:${c.prefix}:${e}`;
47
+ if ($(p))
48
+ return p;
49
+ })) || e;
155
50
  });
156
- function s(n) {
157
- let i = null;
51
+ function a(e) {
52
+ let n = null;
158
53
  if (typeof window > "u") {
159
- const { JSDOM: S } = require("jsdom");
160
- i = new S().window;
54
+ const { JSDOM: y } = require("jsdom");
55
+ n = new y().window;
161
56
  }
162
- return (i ? new i.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
57
+ return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
163
58
  }
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
- body: p,
168
- height: i.viewBox.baseVal.height,
169
- width: i.viewBox.baseVal.width
59
+ function s(e) {
60
+ const n = a(e), c = (n == null ? void 0 : n.innerHTML.trim()) || "";
61
+ n && c && H(`@${f.value}:${r.prefix}:${r.name}`, {
62
+ body: c,
63
+ height: n.viewBox.baseVal.height,
64
+ width: n.viewBox.baseVal.width
170
65
  });
171
66
  }
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
- }).catch((n) => {
175
- throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
176
- })) : t.svg && a(t.svg)), (n, i) => r.value ? (h(), V(g(re), D({
67
+ return i && (r.src && !$(`@${f.value}:${r.prefix}:${r.name}`) ? (o.value = !1, i.fetchIcon(r.src).then((e) => {
68
+ e && (s(e), o.value = !0);
69
+ }).catch((e) => {
70
+ throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
71
+ })) : r.svg && s(r.svg)), (e, n) => d(o) ? (g(), P(d(z), A({
177
72
  key: 0,
178
- class: g(l)
73
+ class: d(u)
179
74
  }, {
180
- inline: n.inline,
181
- width: n.width,
182
- height: n.height,
183
- horizontalFlip: n.horizontalFlip,
184
- verticalFlip: n.verticalFlip,
185
- flip: n.flip,
186
- rotate: n.rotate,
187
- color: n.color,
188
- onLoad: n.onLoad,
189
- icon: g(v)
190
- }), null, 16, ["class"])) : $("", !0);
75
+ inline: e.inline,
76
+ width: e.width,
77
+ height: e.height,
78
+ horizontalFlip: e.horizontalFlip,
79
+ verticalFlip: e.verticalFlip,
80
+ flip: e.flip,
81
+ rotate: e.rotate,
82
+ color: e.color,
83
+ onLoad: e.onLoad,
84
+ icon: d(b)
85
+ }), null, 16, ["class"])) : w("", !0);
191
86
  }
192
- }), ie = {
87
+ }), x = {
193
88
  disabled: Boolean
194
- }, ae = {
89
+ }, K = {
195
90
  modifiers: [String, Array]
196
- }, ue = {
91
+ }, Q = {
197
92
  unselectable: { type: Boolean, default: !0 }
198
- };
199
- function ce(e) {
200
- const t = F(e, void 0), r = d(() => !oe(t));
201
- function c(o, l, u) {
202
- if (t != null && t.value) {
203
- const s = g(t.value)[o];
204
- return d({
205
- get() {
206
- return s == null ? void 0 : s.value;
207
- },
208
- set(a) {
209
- s.value = a;
210
- }
211
- });
212
- }
213
- const v = T(l, o);
214
- return d({
215
- get() {
216
- return v.value;
217
- },
218
- set(s) {
219
- u && u(`update:${o}`, s);
220
- }
221
- });
222
- }
223
- return {
224
- group: t,
225
- isInGroup: r,
226
- getGroupOrLocalRef: c
227
- };
228
- }
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 = {
232
- ...ae,
233
- ...ie,
234
- ...ue,
93
+ }, W = "VV_BUTTON_GROUP";
94
+ var S = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(S || {}), D = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(D || {}), v = /* @__PURE__ */ ((t) => (t.nuxtLink = "nuxt-link", t.routerLink = "router-link", t.a = "a", t.button = "button", t))(v || {}), N = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(N || {});
95
+ const Y = ["update:modelValue"], Z = {
96
+ ...K,
97
+ ...x,
98
+ ...Q,
235
99
  icon: {
236
100
  type: [String, Object],
237
101
  default: ""
@@ -239,7 +103,7 @@ const de = ["update:modelValue"], ve = {
239
103
  iconPosition: {
240
104
  type: String,
241
105
  default: "left",
242
- validator: (e) => e in k
106
+ validator: (t) => t in S
243
107
  },
244
108
  label: [String, Number],
245
109
  loading: Boolean,
@@ -254,7 +118,7 @@ const de = ["update:modelValue"], ve = {
254
118
  href: String,
255
119
  target: {
256
120
  type: String,
257
- validator: (e) => e in H
121
+ validator: (t) => t in N
258
122
  },
259
123
  active: Boolean,
260
124
  pressed: Boolean,
@@ -265,7 +129,7 @@ const de = ["update:modelValue"], ve = {
265
129
  type: {
266
130
  type: String,
267
131
  default: "button",
268
- validator: (e) => e in x
132
+ validator: (t) => t in D
269
133
  },
270
134
  toggle: {
271
135
  type: Boolean,
@@ -273,160 +137,160 @@ const de = ["update:modelValue"], ve = {
273
137
  },
274
138
  modelValue: String
275
139
  };
276
- function ge(e, t) {
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(
140
+ function T(t, r) {
141
+ var _;
142
+ const { group: o, isInGroup: m, getGroupOrLocalRef: i } = useInjectedGroupState(W), {
143
+ iconPosition: u,
144
+ icon: f,
145
+ label: b,
146
+ pressed: a,
147
+ modifiers: s
148
+ } = toRefs(t), e = i("modelValue", t, r), n = i("disabled", t), c = i("toggle", t), p = i(
285
149
  "unselectable",
286
- e
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];
150
+ t
151
+ ), h = ((_ = o == null ? void 0 : o.value) == null ? void 0 : _.multiple) ?? ref(!1), y = computed(() => {
152
+ var V;
153
+ const L = s != null && s.value ? Array.isArray(s.value) ? s.value : [s.value] : [], C = (V = o == null ? void 0 : o.value.itemModifiers) != null && V.value ? Array.isArray(o.value.itemModifiers.value) ? o.value.itemModifiers.value : [o.value.itemModifiers.value] : [];
154
+ return [...L, ...C];
291
155
  });
292
156
  return {
293
- group: r,
294
- isInGroup: c,
295
- modelValue: n,
296
- disabled: i,
297
- toggle: p,
298
- unselectable: y,
299
- multiple: b,
300
- modifiers: S,
301
- pressed: s,
302
- iconPosition: l,
303
- icon: u,
304
- label: v
157
+ group: o,
158
+ isInGroup: m,
159
+ modelValue: e,
160
+ disabled: n,
161
+ toggle: c,
162
+ unselectable: p,
163
+ multiple: h,
164
+ modifiers: y,
165
+ pressed: a,
166
+ iconPosition: u,
167
+ icon: f,
168
+ label: b
305
169
  };
306
170
  }
307
- const pe = {
171
+ const ee = {
308
172
  key: 1,
309
173
  class: "vv-button__label"
310
- }, me = {
174
+ }, te = {
311
175
  key: 1,
312
176
  class: "vv-button__label"
313
- }, ye = {
177
+ }, oe = {
314
178
  name: "VvButton"
315
- }, Ae = /* @__PURE__ */ N({
316
- ...ye,
317
- props: ve,
318
- emits: de,
319
- setup(e, { emit: t }) {
320
- const r = e, c = X(), o = K(), l = (c == null ? void 0 : c.name) || te(), {
321
- modifiers: u,
322
- iconPosition: v,
323
- icon: s,
324
- label: a,
325
- modelValue: n,
326
- disabled: i,
327
- toggle: p,
328
- unselectable: y
329
- } = ge(r, t), b = F(U), S = d(() => {
179
+ }, ie = /* @__PURE__ */ I({
180
+ ...oe,
181
+ props: Z,
182
+ emits: Y,
183
+ setup(t, { emit: r }) {
184
+ const o = t, m = useAttrs(), i = useSlots(), u = (m == null ? void 0 : m.name) || U(), {
185
+ modifiers: f,
186
+ iconPosition: b,
187
+ icon: a,
188
+ label: s,
189
+ modelValue: e,
190
+ disabled: n,
191
+ toggle: c,
192
+ unselectable: p
193
+ } = T(o, r), h = inject(M), y = computed(() => {
330
194
  switch (!0) {
331
- case i.value:
332
- return m.button;
333
- case r.to !== void 0:
334
- return b != null && b.nuxt ? m.nuxtLink : m.routerLink;
335
- case r.href !== void 0:
336
- return m.a;
195
+ case n.value:
196
+ return v.button;
197
+ case o.to !== void 0:
198
+ return h != null && h.nuxt ? v.nuxtLink : v.routerLink;
199
+ case o.href !== void 0:
200
+ return v.a;
337
201
  default:
338
- return m.button;
202
+ return v.button;
339
203
  }
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,
342
- active: r.active,
343
- pressed: A,
344
- disabled: i,
345
- reverse: d(
346
- () => [k.right, k.bottom].includes(
347
- v.value
204
+ }), _ = computed(() => c.value ? Array.isArray(e.value) ? contains(u, e.value) : equals(u, e.value) : o.pressed), { bemCssClasses: L } = useBemModifiers("vv-button", {
205
+ modifiers: f,
206
+ active: o.active,
207
+ pressed: _,
208
+ disabled: n,
209
+ reverse: computed(
210
+ () => [S.right, S.bottom].includes(
211
+ b.value
348
212
  )
349
213
  ),
350
- column: d(
351
- () => [k.top, k.bottom].includes(
352
- v.value
214
+ column: computed(
215
+ () => [S.top, S.bottom].includes(
216
+ b.value
353
217
  )
354
218
  ),
355
- iconOnly: d(
356
- () => (s == null ? void 0 : s.value) && !(a != null && a.value) && !o.default
219
+ iconOnly: computed(
220
+ () => (a == null ? void 0 : a.value) && !(s != null && s.value) && !i.default
357
221
  )
358
- }), L = d(
359
- () => typeof (s == null ? void 0 : s.value) == "string" ? { name: s == null ? void 0 : s.value } : s == null ? void 0 : s.value
360
- ), w = d(() => {
361
- const f = {
362
- class: C.value,
363
- "aria-pressed": A.value ? !0 : void 0
222
+ }), C = computed(
223
+ () => typeof (a == null ? void 0 : a.value) == "string" ? { name: a == null ? void 0 : a.value } : a == null ? void 0 : a.value
224
+ ), V = computed(() => {
225
+ const l = {
226
+ class: L.value,
227
+ "aria-pressed": _.value ? !0 : void 0
364
228
  };
365
- switch (S.value) {
366
- case m.a:
229
+ switch (y.value) {
230
+ case v.a:
367
231
  return {
368
- ...f,
232
+ ...l,
369
233
  role: "button",
370
- href: r.href,
371
- target: r.target,
372
- rel: r.rel
234
+ href: o.href,
235
+ target: o.target,
236
+ rel: o.rel
373
237
  };
374
- case m.routerLink:
375
- case m.nuxtLink:
238
+ case v.routerLink:
239
+ case v.nuxtLink:
376
240
  return {
377
- ...f,
241
+ ...l,
378
242
  role: "button",
379
- to: r.to,
380
- target: r.target
243
+ to: o.to,
244
+ target: o.target
381
245
  };
382
246
  default:
383
247
  return {
384
- ...f,
385
- type: r.type,
386
- disabled: i.value
248
+ ...l,
249
+ type: o.type,
250
+ disabled: n.value
387
251
  };
388
252
  }
389
- }), J = () => {
390
- if (p.value) {
391
- if (Array.isArray(n.value)) {
392
- if (I(l, n.value)) {
393
- y.value && (n.value = n.value.filter(
394
- (f) => f !== l
253
+ }), R = () => {
254
+ if (c.value) {
255
+ if (Array.isArray(e.value)) {
256
+ if (contains(u, e.value)) {
257
+ p.value && (e.value = e.value.filter(
258
+ (l) => l !== u
395
259
  ));
396
260
  return;
397
261
  }
398
- n.value.push(l);
262
+ e.value.push(u);
399
263
  return;
400
264
  }
401
- if (j(l, n.value) && y.value) {
402
- n.value = void 0;
265
+ if (equals(u, e.value) && p.value) {
266
+ e.value = void 0;
403
267
  return;
404
268
  }
405
- n.value = l;
269
+ e.value = u;
406
270
  }
407
271
  };
408
- return (f, he) => (h(), V(Q(g(S)), D(g(w), { onClickPassive: J }), {
409
- default: W(() => [
410
- _(f.$slots, "default", {}, () => [
411
- f.loading ? _(f.$slots, "loading", { key: 0 }, () => [
412
- f.loadingIcon ? (h(), V(G, {
272
+ return (l, ne) => (g(), P(E(d(y)), A(d(V), { onClickPassive: R }), {
273
+ default: G(() => [
274
+ k(l.$slots, "default", {}, () => [
275
+ l.loading ? k(l.$slots, "loading", { key: 0 }, () => [
276
+ l.loadingIcon ? (g(), P(B, {
413
277
  key: 0,
414
278
  class: "vv-button__loading-icon",
415
- name: f.loadingIcon
416
- }, null, 8, ["name"])) : $("", !0),
417
- f.loadingLabel ? (h(), P("span", pe, R(f.loadingLabel), 1)) : $("", !0)
418
- ]) : (h(), P(Y, { key: 1 }, [
419
- _(f.$slots, "before"),
420
- g(s) ? (h(), V(G, D({
279
+ name: l.loadingIcon
280
+ }, null, 8, ["name"])) : w("", !0),
281
+ l.loadingLabel ? (g(), O("span", ee, F(l.loadingLabel), 1)) : w("", !0)
282
+ ]) : (g(), O(j, { key: 1 }, [
283
+ k(l.$slots, "before"),
284
+ d(a) ? (g(), P(B, A({
421
285
  key: 0,
422
286
  class: "vv-button__icon"
423
- }, g(L)), null, 16)) : $("", !0),
424
- g(a) ? (h(), P("span", me, [
425
- _(f.$slots, "label", {}, () => [
426
- ee(R(g(a)), 1)
287
+ }, d(C)), null, 16)) : w("", !0),
288
+ d(s) ? (g(), O("span", te, [
289
+ k(l.$slots, "label", {}, () => [
290
+ q(F(d(s)), 1)
427
291
  ])
428
- ])) : $("", !0),
429
- _(f.$slots, "after")
292
+ ])) : w("", !0),
293
+ k(l.$slots, "after")
430
294
  ], 64))
431
295
  ])
432
296
  ]),
@@ -435,5 +299,5 @@ const pe = {
435
299
  }
436
300
  });
437
301
  export {
438
- Ae as default
302
+ ie as default
439
303
  };
@@ -1 +1 @@
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))}})});
1
+ (function(e,k){typeof exports=="object"&&typeof module<"u"?module.exports=k(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],k):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButton=k(e.vue,e.nanoid,e.vue$1))})(this,function(e,k,v){"use strict";const P="ds",N={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]}},E={name:"VvIcon"},C=e.defineComponent({...E,props:N,setup(n){const i=n,o=ref(!0),{modifiers:g}=toRefs(i),a=inject(P),{bemCssClasses:u}=useBemModifiers("vv-icon",{modifiers:g}),p=computed(()=>i.provider||(a==null?void 0:a.provider)),h=computed(()=>{const t=i.name??"",r=`@${p.value}:${i.prefix}:${i.name}`;return v.iconExists(t)?t:v.iconExists(r)?r:(a==null?void 0:a.iconsCollections.find(d=>{const m=`@${p.value}:${d.prefix}:${t}`;if(v.iconExists(m))return m}))||t});function l(t){let r=null;if(typeof window>"u"){const{JSDOM:S}=require("jsdom");r=new S().window}return(r?new r.DOMParser:new window.DOMParser).parseFromString(t,"text/html").querySelector("svg")}function c(t){const r=l(t),d=(r==null?void 0:r.innerHTML.trim())||"";r&&d&&v.addIcon(`@${p.value}:${i.prefix}:${i.name}`,{body:d,height:r.viewBox.baseVal.height,width:r.viewBox.baseVal.width})}return a&&(i.src&&!v.iconExists(`@${p.value}:${i.prefix}:${i.name}`)?(o.value=!1,a.fetchIcon(i.src).then(t=>{t&&(c(t),o.value=!0)}).catch(t=>{throw new Error(`During fetch icon: ${t==null?void 0:t.message}`)})):i.svg&&c(i.svg)),(t,r)=>e.unref(o)?(e.openBlock(),e.createBlock(e.unref(v.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:t.rotate,color:t.color,onLoad:t.onLoad,icon:e.unref(h)}),null,16,["class"])):e.createCommentVNode("",!0)}}),O={disabled:Boolean},A={modifiers:[String,Array]},F={unselectable:{type:Boolean,default:!0}},D="VV_BUTTON_GROUP";var b=(n=>(n.left="left",n.right="right",n.top="top",n.bottom="bottom",n))(b||{}),L=(n=>(n.button="button",n.submit="submit",n.reset="reset",n))(L||{}),f=(n=>(n.nuxtLink="nuxt-link",n.routerLink="router-link",n.a="a",n.button="button",n))(f||{}),$=(n=>(n._blank="_blank",n._self="_self",n._parent="_parent",n._top="_top",n))($||{});const I=["update:modelValue"],M={...A,...O,...F,icon:{type:[String,Object],default:""},iconPosition:{type:String,default:"left",validator:n=>n 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:n=>n in $},active:Boolean,pressed:Boolean,rel:{type:String,default:"noopener noreferrer"},type:{type:String,default:"button",validator:n=>n in L},toggle:{type:Boolean,default:!1},modelValue:String};function q(n,i){var V;const{group:o,isInGroup:g,getGroupOrLocalRef:a}=useInjectedGroupState(D),{iconPosition:u,icon:p,label:h,pressed:l,modifiers:c}=toRefs(n),t=a("modelValue",n,i),r=a("disabled",n),d=a("toggle",n),m=a("unselectable",n),y=((V=o==null?void 0:o.value)==null?void 0:V.multiple)??ref(!1),S=computed(()=>{var _;const w=c!=null&&c.value?Array.isArray(c.value)?c.value:[c.value]:[],B=(_=o==null?void 0:o.value.itemModifiers)!=null&&_.value?Array.isArray(o.value.itemModifiers.value)?o.value.itemModifiers.value:[o.value.itemModifiers.value]:[];return[...w,...B]});return{group:o,isInGroup:g,modelValue:t,disabled:r,toggle:d,unselectable:m,multiple:y,modifiers:S,pressed:l,iconPosition:u,icon:p,label:h}}const R={key:1,class:"vv-button__label"},j={key:1,class:"vv-button__label"},G={name:"VvButton"};return e.defineComponent({...G,props:M,emits:I,setup(n,{emit:i}){const o=n,g=useAttrs(),a=useSlots(),u=(g==null?void 0:g.name)||k.nanoid(),{modifiers:p,iconPosition:h,icon:l,label:c,modelValue:t,disabled:r,toggle:d,unselectable:m}=q(o,i),y=inject(P),S=computed(()=>{switch(!0){case r.value:return f.button;case o.to!==void 0:return y!=null&&y.nuxt?f.nuxtLink:f.routerLink;case o.href!==void 0:return f.a;default:return f.button}}),V=computed(()=>d.value?Array.isArray(t.value)?contains(u,t.value):equals(u,t.value):o.pressed),{bemCssClasses:w}=useBemModifiers("vv-button",{modifiers:p,active:o.active,pressed:V,disabled:r,reverse:computed(()=>[b.right,b.bottom].includes(h.value)),column:computed(()=>[b.top,b.bottom].includes(h.value)),iconOnly:computed(()=>(l==null?void 0:l.value)&&!(c!=null&&c.value)&&!a.default)}),B=computed(()=>typeof(l==null?void 0:l.value)=="string"?{name:l==null?void 0:l.value}:l==null?void 0:l.value),_=computed(()=>{const s={class:w.value,"aria-pressed":V.value?!0:void 0};switch(S.value){case f.a:return{...s,role:"button",href:o.href,target:o.target,rel:o.rel};case f.routerLink:case f.nuxtLink:return{...s,role:"button",to:o.to,target:o.target};default:return{...s,type:o.type,disabled:r.value}}}),U=()=>{if(d.value){if(Array.isArray(t.value)){if(contains(u,t.value)){m.value&&(t.value=t.value.filter(s=>s!==u));return}t.value.push(u);return}if(equals(u,t.value)&&m.value){t.value=void 0;return}t.value=u}};return(s,z)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(S)),e.mergeProps(e.unref(_),{onClickPassive:U}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[s.loading?e.renderSlot(s.$slots,"loading",{key:0},()=>[s.loadingIcon?(e.openBlock(),e.createBlock(C,{key:0,class:"vv-button__loading-icon",name:s.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),s.loadingLabel?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(s.loadingLabel),1)):e.createCommentVNode("",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(s.$slots,"before"),e.unref(l)?(e.openBlock(),e.createBlock(C,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(s.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)])])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"after")],64))])]),_:3},16))}})});