@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,41 @@
1
- import { defineComponent as B, openBlock as _, createElementBlock as C, unref as l, normalizeClass as P, withModifiers as M, createElementVNode as G, renderSlot as y, normalizeProps as g, guardReactiveProps as V, createTextVNode as S, toDisplayString as h, Fragment as I, renderList as N, createBlock as O, mergeProps as R, withCtx as $ } from "vue";
2
- import { nanoid as T } from "nanoid";
3
- const k = Symbol.for("accordionGroup"), x = {
1
+ import { unref as l, inject as M, computed as d, toRef as N, toRefs as k, defineComponent as R, useAttrs as D, ref as S, openBlock as g, createElementBlock as h, normalizeClass as B, withModifiers as L, createElementVNode as G, renderSlot as A, normalizeProps as V, guardReactiveProps as b, createTextVNode as C, toDisplayString as E, isRef as T, provide as z, watchEffect as F, Fragment as J, renderList as K, createBlock as U, mergeProps as Y, withCtx as O } from "vue";
2
+ import { nanoid as q } from "nanoid";
3
+ import { useToggle as x } from "@vueuse/core";
4
+ const I = Symbol.for("accordionGroup");
5
+ function H(t) {
6
+ return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(l(t));
7
+ }
8
+ function Q(t) {
9
+ const e = M(t, void 0), r = d(() => !H(e));
10
+ function s(o, c, v) {
11
+ if (e != null && e.value) {
12
+ const i = l(e.value)[o];
13
+ return d({
14
+ get() {
15
+ return i == null ? void 0 : i.value;
16
+ },
17
+ set(f) {
18
+ i.value = f;
19
+ }
20
+ });
21
+ }
22
+ const m = N(c, o);
23
+ return d({
24
+ get() {
25
+ return m.value;
26
+ },
27
+ set(i) {
28
+ v && v(`update:${o}`, i);
29
+ }
30
+ });
31
+ }
32
+ return {
33
+ group: e,
34
+ isInGroup: r,
35
+ getGroupOrLocalRef: s
36
+ };
37
+ }
38
+ const W = {
4
39
  /**
5
40
  * Accordion name
6
41
  */
@@ -28,97 +63,109 @@ const k = Symbol.for("accordionGroup"), x = {
28
63
  * If true, the accordion will be disabled
29
64
  */
30
65
  disabled: Boolean
31
- }, z = ["update:modelValue"];
32
- function D(s, c) {
33
- const { group: t, isInGroup: n, getGroupOrLocalRef: e } = useInjectedGroupState(
34
- k
35
- ), { title: m, content: v } = toRefs(s), p = e("modelValue", s, c), d = e("disabled", s), u = e("collapse", s), r = e("modifiers", s);
66
+ }, X = ["update:modelValue"];
67
+ function Z(t, e) {
68
+ const { group: r, isInGroup: s, getGroupOrLocalRef: o } = Q(
69
+ I
70
+ ), { title: c, content: v } = k(t), m = o("modelValue", t, e), i = o("disabled", t), f = o("collapse", t), n = o("modifiers", t);
36
71
  return {
37
72
  // group props
38
- modelValue: p,
39
- disabled: d,
40
- isInGroup: n,
41
- group: t,
42
- collapse: u,
43
- modifiers: r,
73
+ modelValue: m,
74
+ disabled: i,
75
+ isInGroup: s,
76
+ group: r,
77
+ collapse: f,
78
+ modifiers: n,
44
79
  // local props
45
- title: m,
80
+ title: c,
46
81
  content: v
47
82
  };
48
83
  }
49
- const L = ["id", "open"], j = ["aria-controls", "aria-expanded"], F = ["aria-hidden"], J = {
84
+ function P(t, e, r) {
85
+ return d(() => {
86
+ const s = {
87
+ [t]: !0
88
+ }, o = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
89
+ return o && Array.isArray(o) && o.forEach((c) => {
90
+ s[`${t}--${c}`] = !0;
91
+ }), r && Object.keys(r.value).forEach((c) => {
92
+ s[`${t}--${c}`] = l(r.value[c]);
93
+ }), s;
94
+ });
95
+ }
96
+ const w = ["id", "open"], ee = ["aria-controls", "aria-expanded"], oe = ["aria-hidden"], te = {
50
97
  name: "VvAccordion"
51
- }, K = /* @__PURE__ */ B({
52
- ...J,
53
- props: x,
54
- emits: z,
55
- setup(s, { emit: c }) {
56
- const t = s, n = useAttrs(), e = computed(
57
- () => t.name || (n == null ? void 0 : n.id) || T()
98
+ }, re = /* @__PURE__ */ R({
99
+ ...te,
100
+ props: W,
101
+ emits: X,
102
+ setup(t, { emit: e }) {
103
+ const r = t, s = D(), o = d(
104
+ () => r.name || (s == null ? void 0 : s.id) || q()
58
105
  ), {
59
- modifiers: m,
106
+ modifiers: c,
60
107
  title: v,
61
- content: p,
62
- disabled: d,
63
- collapse: u,
64
- modelValue: r,
65
- isInGroup: o
66
- } = D(t, c), b = ref(!1), a = computed({
67
- get: () => o.value ? u.value && Array.isArray(r.value) ? r.value.includes(e.value) : r.value === e.value : r.value === void 0 ? b.value : r.value,
68
- set: (i) => {
69
- if (o.value) {
70
- if (u.value && Array.isArray(r.value)) {
71
- if (i) {
72
- r.value.push(e.value);
108
+ content: m,
109
+ disabled: i,
110
+ collapse: f,
111
+ modelValue: n,
112
+ isInGroup: a
113
+ } = Z(r, e), $ = S(!1), u = d({
114
+ get: () => a.value ? f.value && Array.isArray(n.value) ? n.value.includes(o.value) : n.value === o.value : n.value === void 0 ? $.value : n.value,
115
+ set: (p) => {
116
+ if (a.value) {
117
+ if (f.value && Array.isArray(n.value)) {
118
+ if (p) {
119
+ n.value.push(o.value);
73
120
  return;
74
121
  }
75
- r.value = r.value.filter(
76
- (A) => A !== e.value
122
+ n.value = n.value.filter(
123
+ (_) => _ !== o.value
77
124
  );
78
125
  return;
79
126
  }
80
- r.value = i ? e.value : null;
127
+ n.value = p ? o.value : null;
81
128
  return;
82
129
  }
83
- if (r.value === void 0 && typeof i == "boolean") {
84
- b.value = i;
130
+ if (n.value === void 0 && typeof p == "boolean") {
131
+ $.value = p;
85
132
  return;
86
133
  }
87
- r.value = i;
134
+ n.value = p;
88
135
  }
89
- }), f = useBemModifiers(
136
+ }), y = P(
90
137
  "vv-accordion",
91
- m,
92
- computed(() => ({
93
- disabled: d.value
138
+ c,
139
+ d(() => ({
140
+ disabled: i.value
94
141
  }))
95
- ), E = useToggle(a);
96
- return (i, A) => (_(), C("details", {
97
- id: l(e),
98
- class: P(l(f)),
99
- open: l(a),
100
- onClick: A[0] || (A[0] = M((H) => l(E)(), ["prevent"]))
142
+ ), j = x(u);
143
+ return (p, _) => (g(), h("details", {
144
+ id: l(o),
145
+ class: B(l(y)),
146
+ open: l(u),
147
+ onClick: _[0] || (_[0] = L((ie) => l(j)(), ["prevent"]))
101
148
  }, [
102
149
  G("summary", {
103
- "aria-controls": l(e),
104
- "aria-expanded": l(a),
150
+ "aria-controls": l(o),
151
+ "aria-expanded": l(u),
105
152
  class: "vv-collapse__summary"
106
153
  }, [
107
- y(i.$slots, "summary", g(V({ open: l(a) })), () => [
108
- S(h(l(v)), 1)
154
+ A(p.$slots, "summary", V(b({ open: l(u) })), () => [
155
+ C(E(l(v)), 1)
109
156
  ])
110
- ], 8, j),
157
+ ], 8, ee),
111
158
  G("div", {
112
- "aria-hidden": !l(a),
159
+ "aria-hidden": !l(u),
113
160
  class: "vv-collapse__content"
114
161
  }, [
115
- y(i.$slots, "details", g(V({ open: l(a) })), () => [
116
- S(h(l(p)), 1)
162
+ A(p.$slots, "details", V(b({ open: l(u) })), () => [
163
+ C(E(l(m)), 1)
117
164
  ])
118
- ], 8, F)
119
- ], 10, L));
165
+ ], 8, oe)
166
+ ], 10, w));
120
167
  }
121
- }), U = {
168
+ }), ae = {
122
169
  /**
123
170
  * VModel
124
171
  */
@@ -147,60 +194,71 @@ const L = ["id", "open"], j = ["aria-controls", "aria-expanded"], F = ["aria-hid
147
194
  * If true, the accordion items will be disabled
148
195
  */
149
196
  disabled: Boolean
150
- }, Y = ["update:modelValue"], q = {
197
+ }, ne = ["update:modelValue"];
198
+ function le(t) {
199
+ if (Object.keys(t).some(
200
+ (e) => e !== "key" && !T(t[e])
201
+ ))
202
+ throw Error("One or more groupState props aren't ref.");
203
+ z(
204
+ t.key,
205
+ d(() => t)
206
+ );
207
+ }
208
+ const se = {
151
209
  name: "VvAccordionGroup"
152
- }, X = /* @__PURE__ */ B({
153
- ...q,
154
- props: U,
155
- emits: Y,
156
- setup(s, { emit: c }) {
157
- const t = s, { disabled: n, collapse: e, modifiers: m, itemModifiers: v, items: p } = toRefs(t);
158
- watchEffect(() => {
159
- typeof t.modelValue == "string" && e.value && console.warn(
210
+ }, ve = /* @__PURE__ */ R({
211
+ ...se,
212
+ props: ae,
213
+ emits: ne,
214
+ setup(t, { emit: e }) {
215
+ const r = t, { disabled: s, collapse: o, modifiers: c, itemModifiers: v, items: m } = k(r);
216
+ F(() => {
217
+ typeof r.modelValue == "string" && o.value && console.warn(
160
218
  "[VvAccordionGroup]: modelValue is a string but collapse is true."
161
219
  );
162
220
  });
163
- const d = ref([]), u = computed({
221
+ const i = S([]), f = d({
164
222
  get: () => {
165
- var o;
166
- return t.modelValue !== void 0 ? e.value ? t.modelValue : Array.isArray(t.modelValue) ? t.modelValue[0] : t.modelValue : e.value ? d.value : (o = d.value) == null ? void 0 : o[0];
223
+ var a;
224
+ return r.modelValue !== void 0 ? o.value ? r.modelValue : Array.isArray(r.modelValue) ? r.modelValue[0] : r.modelValue : o.value ? i.value : (a = i.value) == null ? void 0 : a[0];
167
225
  },
168
- set: (o) => {
169
- if (t.modelValue !== void 0)
170
- return (Array.isArray(t.modelValue) || e.value) && !Array.isArray(o) && (o = [o]), c("update:modelValue", o);
171
- d.value = Array.isArray(o) ? o : [o];
226
+ set: (a) => {
227
+ if (r.modelValue !== void 0)
228
+ return (Array.isArray(r.modelValue) || o.value) && !Array.isArray(a) && (a = [a]), e("update:modelValue", a);
229
+ i.value = Array.isArray(a) ? a : [a];
172
230
  }
173
231
  });
174
- useProvideGroupState({
175
- key: k,
176
- modelValue: u,
177
- disabled: n,
178
- collapse: e,
232
+ le({
233
+ key: I,
234
+ modelValue: f,
235
+ disabled: s,
236
+ collapse: o,
179
237
  modifiers: v
180
238
  });
181
- const r = useBemModifiers(
239
+ const n = P(
182
240
  "vv-accordion-group",
183
- m,
184
- computed(() => ({
185
- disabled: n.value
241
+ c,
242
+ d(() => ({
243
+ disabled: s.value
186
244
  }))
187
245
  );
188
- return (o, b) => (_(), C("div", {
189
- class: P(l(r))
246
+ return (a, $) => (g(), h("div", {
247
+ class: B(l(n))
190
248
  }, [
191
- y(o.$slots, "default", {}, () => [
192
- (_(!0), C(I, null, N(l(p), (a) => (_(), O(K, R({
193
- key: a.title
249
+ A(a.$slots, "default", {}, () => [
250
+ (g(!0), h(J, null, K(l(m), (u) => (g(), U(re, Y({
251
+ key: u.title
194
252
  }, {
195
- name: a.name,
196
- title: a.title,
197
- content: a.content
253
+ name: u.name,
254
+ title: u.title,
255
+ content: u.content
198
256
  }), {
199
- header: $((f) => [
200
- y(o.$slots, `header::${a.name}`, g(V(f)))
257
+ header: O((y) => [
258
+ A(a.$slots, `header::${u.name}`, V(b(y)))
201
259
  ]),
202
- details: $((f) => [
203
- y(o.$slots, `details::${a.name}`, g(V(f)))
260
+ details: O((y) => [
261
+ A(a.$slots, `details::${u.name}`, V(b(y)))
204
262
  ]),
205
263
  _: 2
206
264
  }, 1040))), 128))
@@ -209,5 +267,5 @@ const L = ["id", "open"], j = ["aria-controls", "aria-expanded"], F = ["aria-hid
209
267
  }
210
268
  });
211
269
  export {
212
- X as default
270
+ ve as default
213
271
  };
@@ -1 +1 @@
1
- (function(e,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],u):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAccordionGroup=u(e.vue,e.nanoid))})(this,function(e,u){"use strict";const V=Symbol.for("accordionGroup"),v={name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},modifiers:[String,Array],disabled:Boolean},S=["update:modelValue"];function h(s,f){const{group:n,isInGroup:l,getGroupOrLocalRef:o}=useInjectedGroupState(V),{title:m,content:p}=toRefs(s),y=o("modelValue",s,f),d=o("disabled",s),c=o("collapse",s),t=o("modifiers",s);return{modelValue:y,disabled:d,isInGroup:l,group:n,collapse:c,modifiers:t,title:m,content:p}}const C=["id","open"],B=["aria-controls","aria-expanded"],P=["aria-hidden"],G={name:"VvAccordion"},b=e.defineComponent({...G,props:v,emits:S,setup(s,{emit:f}){const n=s,l=useAttrs(),o=computed(()=>n.name||(l==null?void 0:l.id)||u.nanoid()),{modifiers:m,title:p,content:y,disabled:d,collapse:c,modelValue:t,isInGroup:r}=h(n,f),g=ref(!1),a=computed({get:()=>r.value?c.value&&Array.isArray(t.value)?t.value.includes(o.value):t.value===o.value:t.value===void 0?g.value:t.value,set:i=>{if(r.value){if(c.value&&Array.isArray(t.value)){if(i){t.value.push(o.value);return}t.value=t.value.filter(_=>_!==o.value);return}t.value=i?o.value:null;return}if(t.value===void 0&&typeof i=="boolean"){g.value=i;return}t.value=i}}),A=useBemModifiers("vv-accordion",m,computed(()=>({disabled:d.value}))),R=useToggle(a);return(i,_)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(o),class:e.normalizeClass(e.unref(A)),open:e.unref(a),onClick:_[0]||(_[0]=e.withModifiers(M=>e.unref(R)(),["prevent"]))},[e.createElementVNode("summary",{"aria-controls":e.unref(o),"aria-expanded":e.unref(a),class:"vv-collapse__summary"},[e.renderSlot(i.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(a)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)])],8,B),e.createElementVNode("div",{"aria-hidden":!e.unref(a),class:"vv-collapse__content"},[e.renderSlot(i.$slots,"details",e.normalizeProps(e.guardReactiveProps({open:e.unref(a)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)])],8,P)],10,C))}}),k={modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,modifiers:[String,Array],itemModifiers:{type:[String,Array],default:""},disabled:Boolean},E=["update:modelValue"],$={name:"VvAccordionGroup"};return e.defineComponent({...$,props:k,emits:E,setup(s,{emit:f}){const n=s,{disabled:l,collapse:o,modifiers:m,itemModifiers:p,items:y}=toRefs(n);watchEffect(()=>{typeof n.modelValue=="string"&&o.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")});const d=ref([]),c=computed({get:()=>{var r;return n.modelValue!==void 0?o.value?n.modelValue:Array.isArray(n.modelValue)?n.modelValue[0]:n.modelValue:o.value?d.value:(r=d.value)==null?void 0:r[0]},set:r=>{if(n.modelValue!==void 0)return(Array.isArray(n.modelValue)||o.value)&&!Array.isArray(r)&&(r=[r]),f("update:modelValue",r);d.value=Array.isArray(r)?r:[r]}});useProvideGroupState({key:V,modelValue:c,disabled:l,collapse:o,modifiers:p});const t=useBemModifiers("vv-accordion-group",m,computed(()=>({disabled:l.value})));return(r,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t))},[e.renderSlot(r.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),a=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:a.title},{name:a.name,title:a.title,content:a.content}),{header:e.withCtx(A=>[e.renderSlot(r.$slots,`header::${a.name}`,e.normalizeProps(e.guardReactiveProps(A)))]),details:e.withCtx(A=>[e.renderSlot(r.$slots,`details::${a.name}`,e.normalizeProps(e.guardReactiveProps(A)))]),_:2},1040))),128))])],2))}})});
1
+ (function(e,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("vue"),require("nanoid"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core"],y):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAccordionGroup=y(e.vue,e.nanoid,e.core))})(this,function(e,y,b){"use strict";const V=Symbol.for("accordionGroup");function k(t){return(o=>o==null||o===""||Array.isArray(o)&&o.length===0||!(o instanceof Date)&&typeof o=="object"&&Object.keys(o).length===0)(e.unref(t))}function C(t){const o=e.inject(t,void 0),n=e.computed(()=>!k(o));function l(r,d,u){if(o!=null&&o.value){const i=e.unref(o.value)[r];return e.computed({get(){return i==null?void 0:i.value},set(f){i.value=f}})}const m=e.toRef(d,r);return e.computed({get(){return m.value},set(i){u&&u(`update:${r}`,i)}})}return{group:o,isInGroup:n,getGroupOrLocalRef:l}}const G={name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},modifiers:[String,Array],disabled:Boolean},S=["update:modelValue"];function $(t,o){const{group:n,isInGroup:l,getGroupOrLocalRef:r}=C(V),{title:d,content:u}=e.toRefs(t),m=r("modelValue",t,o),i=r("disabled",t),f=r("collapse",t),s=r("modifiers",t);return{modelValue:m,disabled:i,isInGroup:l,group:n,collapse:f,modifiers:s,title:d,content:u}}function h(t,o,n){return e.computed(()=>{const l={[t]:!0},r=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return r&&Array.isArray(r)&&r.forEach(d=>{l[`${t}--${d}`]=!0}),n&&Object.keys(n.value).forEach(d=>{l[`${t}--${d}`]=e.unref(n.value[d])}),l})}const E=["id","open"],R=["aria-controls","aria-expanded"],B=["aria-hidden"],P={name:"VvAccordion"},O=e.defineComponent({...P,props:G,emits:S,setup(t,{emit:o}){const n=t,l=e.useAttrs(),r=e.computed(()=>n.name||(l==null?void 0:l.id)||y.nanoid()),{modifiers:d,title:u,content:m,disabled:i,collapse:f,modelValue:s,isInGroup:a}=$(n,o),g=e.ref(!1),c=e.computed({get:()=>a.value?f.value&&Array.isArray(s.value)?s.value.includes(r.value):s.value===r.value:s.value===void 0?g.value:s.value,set:p=>{if(a.value){if(f.value&&Array.isArray(s.value)){if(p){s.value.push(r.value);return}s.value=s.value.filter(_=>_!==r.value);return}s.value=p?r.value:null;return}if(s.value===void 0&&typeof p=="boolean"){g.value=p;return}s.value=p}}),A=h("vv-accordion",d,e.computed(()=>({disabled:i.value}))),N=b.useToggle(c);return(p,_)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(r),class:e.normalizeClass(e.unref(A)),open:e.unref(c),onClick:_[0]||(_[0]=e.withModifiers(D=>e.unref(N)(),["prevent"]))},[e.createElementVNode("summary",{"aria-controls":e.unref(r),"aria-expanded":e.unref(c),class:"vv-collapse__summary"},[e.renderSlot(p.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(c)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(u)),1)])],8,R),e.createElementVNode("div",{"aria-hidden":!e.unref(c),class:"vv-collapse__content"},[e.renderSlot(p.$slots,"details",e.normalizeProps(e.guardReactiveProps({open:e.unref(c)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)])],8,B)],10,E))}}),j={modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,modifiers:[String,Array],itemModifiers:{type:[String,Array],default:""},disabled:Boolean},I=["update:modelValue"];function z(t){if(Object.keys(t).some(o=>o!=="key"&&!e.isRef(t[o])))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed(()=>t))}const M={name:"VvAccordionGroup"};return e.defineComponent({...M,props:j,emits:I,setup(t,{emit:o}){const n=t,{disabled:l,collapse:r,modifiers:d,itemModifiers:u,items:m}=e.toRefs(n);e.watchEffect(()=>{typeof n.modelValue=="string"&&r.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")});const i=e.ref([]),f=e.computed({get:()=>{var a;return n.modelValue!==void 0?r.value?n.modelValue:Array.isArray(n.modelValue)?n.modelValue[0]:n.modelValue:r.value?i.value:(a=i.value)==null?void 0:a[0]},set:a=>{if(n.modelValue!==void 0)return(Array.isArray(n.modelValue)||r.value)&&!Array.isArray(a)&&(a=[a]),o("update:modelValue",a);i.value=Array.isArray(a)?a:[a]}});z({key:V,modelValue:f,disabled:l,collapse:r,modifiers:u});const s=h("vv-accordion-group",d,e.computed(()=>({disabled:l.value})));return(a,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(s))},[e.renderSlot(a.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),c=>(e.openBlock(),e.createBlock(O,e.mergeProps({key:c.title},{name:c.name,title:c.title,content:c.content}),{header:e.withCtx(A=>[e.renderSlot(a.$slots,`header::${c.name}`,e.normalizeProps(e.guardReactiveProps(A)))]),details:e.withCtx(A=>[e.renderSlot(a.$slots,`details::${c.name}`,e.normalizeProps(e.guardReactiveProps(A)))]),_:2},1040))),128))])],2))}})});
@@ -0,0 +1,170 @@
1
+ import { inject as v, defineComponent as D, ref as I, watch as L, computed as c, openBlock as P, createBlock as E, resolveDynamicComponent as R, unref as f, mergeProps as V, withCtx as B, renderSlot as x, createTextVNode as M, toDisplayString as w } from "vue";
2
+ var d = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(d || {}), _ = /* @__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))(_ || {}), p = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(p || {}), b = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(b || {}), n = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(n || {}), O = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(O || {});
3
+ const J = Symbol.for("volver"), K = Symbol.for("dropdownTrigger"), W = Symbol.for("dropdownAction"), Y = {
4
+ /**
5
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
6
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
7
+ */
8
+ to: {
9
+ type: [String, Object]
10
+ },
11
+ /**
12
+ * Anchor href
13
+ */
14
+ href: String,
15
+ /**
16
+ * Anchor target
17
+ */
18
+ target: {
19
+ type: String,
20
+ validator: (e) => Object.values(O).includes(e)
21
+ },
22
+ /**
23
+ * Anchor rel
24
+ */
25
+ rel: {
26
+ type: String,
27
+ default: "noopener noreferrer"
28
+ }
29
+ }, G = {
30
+ /**
31
+ * Whether the form control is disabled
32
+ */
33
+ disabled: Boolean
34
+ }, T = {
35
+ /**
36
+ * Whether the item is active
37
+ */
38
+ active: Boolean
39
+ }, $ = {
40
+ /**
41
+ * Whether the item is pressed
42
+ */
43
+ pressed: Boolean
44
+ }, z = {
45
+ /**
46
+ * The item label
47
+ */
48
+ label: [String, Number]
49
+ };
50
+ p.before;
51
+ d.bottom;
52
+ const A = {
53
+ ...G,
54
+ ...z,
55
+ ...$,
56
+ ...T,
57
+ ...Y,
58
+ /**
59
+ * Button type
60
+ */
61
+ type: {
62
+ type: String,
63
+ default: b.button,
64
+ validator: (e) => Object.values(b).includes(e)
65
+ }
66
+ }, F = ["click", "mouseover", "mouseleave"], q = A;
67
+ function H() {
68
+ return v(J);
69
+ }
70
+ function Q() {
71
+ return v(K, {});
72
+ }
73
+ function U() {
74
+ return v(W, {});
75
+ }
76
+ const X = {
77
+ name: "VvAction"
78
+ }, te = /* @__PURE__ */ D({
79
+ ...X,
80
+ props: q,
81
+ emits: F,
82
+ setup(e, { expose: k, emit: s }) {
83
+ const r = e, a = H(), l = I(null);
84
+ k({ $el: l });
85
+ const {
86
+ reference: m,
87
+ bus: o,
88
+ aria: u,
89
+ expanded: i
90
+ } = Q();
91
+ L(
92
+ () => l.value,
93
+ (t) => {
94
+ m && (m.value = t);
95
+ }
96
+ );
97
+ const g = c(() => r.pressed || (i == null ? void 0 : i.value)), { role: S } = U(), y = c(() => {
98
+ switch (!0) {
99
+ case r.disabled:
100
+ return n.button;
101
+ case r.to !== void 0:
102
+ return a != null && a.nuxt ? n.nuxtLink : n.routerLink;
103
+ case r.href !== void 0:
104
+ return n.a;
105
+ default:
106
+ return n.button;
107
+ }
108
+ }), h = c(() => {
109
+ const t = {
110
+ ...u == null ? void 0 : u.value,
111
+ "aria-pressed": g.value ? !0 : void 0,
112
+ role: S
113
+ };
114
+ switch (y.value) {
115
+ case n.a:
116
+ return {
117
+ ...t,
118
+ href: r.href,
119
+ target: r.target,
120
+ rel: r.rel
121
+ };
122
+ case n.routerLink:
123
+ case n.nuxtLink:
124
+ return {
125
+ ...t,
126
+ to: r.to,
127
+ target: r.target
128
+ };
129
+ default:
130
+ return {
131
+ ...t,
132
+ type: r.type,
133
+ disabled: r.disabled
134
+ };
135
+ }
136
+ }), j = (t) => {
137
+ if (r.disabled) {
138
+ t.preventDefault();
139
+ return;
140
+ }
141
+ o == null || o.emit("click", t), s("click", t);
142
+ }, N = (t) => {
143
+ o == null || o.emit("mouseover", t), s("mouseover", t);
144
+ }, C = (t) => {
145
+ o == null || o.emit("mouseleave", t), s("mouseleave", t);
146
+ };
147
+ return (t, Z) => (P(), E(R(f(y)), V(f(h), {
148
+ ref_key: "element",
149
+ ref: l,
150
+ class: {
151
+ active: t.active,
152
+ pressed: f(g),
153
+ disabled: t.disabled
154
+ },
155
+ onClickPassive: j,
156
+ onMouseoverPassive: N,
157
+ onMouseleavePassive: C
158
+ }), {
159
+ default: B(() => [
160
+ x(t.$slots, "default", {}, () => [
161
+ M(w(t.label), 1)
162
+ ])
163
+ ]),
164
+ _: 3
165
+ }, 16, ["class"]));
166
+ }
167
+ });
168
+ export {
169
+ te as default
170
+ };
@@ -0,0 +1 @@
1
+ (function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue")):typeof define=="function"&&define.amd?define(["vue"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.VvAction=a(t.vue))})(this,function(t){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),b=(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))(b||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),m=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(m||{});const _=Symbol.for("volver"),O=Symbol.for("dropdownTrigger"),h=Symbol.for("dropdownAction"),k={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(m).includes(e)},rel:{type:String,default:"noopener noreferrer"}},j={disabled:Boolean},S={active:Boolean},N={pressed:Boolean},C={label:[String,Number]};i.before,a.bottom;const D={...j,...C,...N,...S,...k,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)}},I=["click","mouseover","mouseleave"],L=D;function P(){return t.inject(_)}function V(){return t.inject(O,{})}function E(){return t.inject(h,{})}const R={name:"VvAction"};return t.defineComponent({...R,props:L,emits:I,setup(e,{expose:x,emit:u}){const o=e,c=P(),f=t.ref(null);x({$el:f});const{reference:g,bus:s,aria:d,expanded:p}=V();t.watch(()=>f.value,r=>{g&&(g.value=r)});const v=t.computed(()=>o.pressed||(p==null?void 0:p.value)),{role:B}=E(),y=t.computed(()=>{switch(!0){case o.disabled:return n.button;case o.to!==void 0:return c!=null&&c.nuxt?n.nuxtLink:n.routerLink;case o.href!==void 0:return n.a;default:return n.button}}),M=t.computed(()=>{const r={...d==null?void 0:d.value,"aria-pressed":v.value?!0:void 0,role:B};switch(y.value){case n.a:return{...r,href:o.href,target:o.target,rel:o.rel};case n.routerLink:case n.nuxtLink:return{...r,to:o.to,target:o.target};default:return{...r,type:o.type,disabled:o.disabled}}}),T=r=>{if(o.disabled){r.preventDefault();return}s==null||s.emit("click",r),u("click",r)},w=r=>{s==null||s.emit("mouseover",r),u("mouseover",r)},J=r=>{s==null||s.emit("mouseleave",r),u("mouseleave",r)};return(r,W)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(y)),t.mergeProps(t.unref(M),{ref_key:"element",ref:f,class:{active:r.active,pressed:t.unref(v),disabled:r.disabled},onClickPassive:T,onMouseoverPassive:w,onMouseleavePassive:J}),{default:t.withCtx(()=>[t.renderSlot(r.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(r.label),1)])]),_:3},16,["class"]))}})});
@@ -0,0 +1,63 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ type: {
3
+ type: StringConstructor;
4
+ default: import("@/constants").ButtonType;
5
+ validator: (value: import("@/constants").ButtonType) => boolean;
6
+ };
7
+ to: {
8
+ type: (StringConstructor | ObjectConstructor)[];
9
+ };
10
+ href: StringConstructor;
11
+ target: {
12
+ type: import("vue").PropType<import("@/constants").AnchorTarget>;
13
+ validator: (value: import("@/constants").AnchorTarget) => boolean;
14
+ };
15
+ rel: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ active: BooleanConstructor;
20
+ pressed: BooleanConstructor;
21
+ label: (StringConstructor | NumberConstructor)[];
22
+ disabled: BooleanConstructor;
23
+ }, {
24
+ $el: import("vue").Ref<HTMLElement | null>;
25
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ type: {
27
+ type: StringConstructor;
28
+ default: import("@/constants").ButtonType;
29
+ validator: (value: import("@/constants").ButtonType) => boolean;
30
+ };
31
+ to: {
32
+ type: (StringConstructor | ObjectConstructor)[];
33
+ };
34
+ href: StringConstructor;
35
+ target: {
36
+ type: import("vue").PropType<import("@/constants").AnchorTarget>;
37
+ validator: (value: import("@/constants").AnchorTarget) => boolean;
38
+ };
39
+ rel: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ active: BooleanConstructor;
44
+ pressed: BooleanConstructor;
45
+ label: (StringConstructor | NumberConstructor)[];
46
+ disabled: BooleanConstructor;
47
+ }>> & {
48
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
49
+ }, {
50
+ disabled: boolean;
51
+ type: string;
52
+ rel: string;
53
+ active: boolean;
54
+ pressed: boolean;
55
+ }>, {
56
+ default: (_: {}) => any;
57
+ }>;
58
+ export default _default;
59
+ type __VLS_WithTemplateSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -0,0 +1,24 @@
1
+ export declare const VvActionEvents: string[];
2
+ export declare const VvActionProps: {
3
+ type: {
4
+ type: StringConstructor;
5
+ default: import("../../constants").ButtonType;
6
+ validator: (value: import("../../constants").ButtonType) => boolean;
7
+ };
8
+ to: {
9
+ type: (StringConstructor | ObjectConstructor)[];
10
+ };
11
+ href: StringConstructor;
12
+ target: {
13
+ type: import("vue").PropType<import("../../constants").AnchorTarget>;
14
+ validator: (value: import("../../constants").AnchorTarget) => boolean;
15
+ };
16
+ rel: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ active: BooleanConstructor;
21
+ pressed: BooleanConstructor;
22
+ label: (StringConstructor | NumberConstructor)[];
23
+ disabled: BooleanConstructor;
24
+ };