@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.
- package/LICENSE +1 -1
- package/README.md +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/package.json +60 -34
- package/src/Volver.ts +12 -5
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.stories.mdx +2 -1
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
|
@@ -1,6 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { nanoid as
|
|
3
|
-
|
|
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
|
-
},
|
|
32
|
-
function
|
|
33
|
-
const { group:
|
|
34
|
-
|
|
35
|
-
), { title:
|
|
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:
|
|
39
|
-
disabled:
|
|
40
|
-
isInGroup:
|
|
41
|
-
group:
|
|
42
|
-
collapse:
|
|
43
|
-
modifiers:
|
|
73
|
+
modelValue: m,
|
|
74
|
+
disabled: i,
|
|
75
|
+
isInGroup: s,
|
|
76
|
+
group: r,
|
|
77
|
+
collapse: f,
|
|
78
|
+
modifiers: n,
|
|
44
79
|
// local props
|
|
45
|
-
title:
|
|
80
|
+
title: c,
|
|
46
81
|
content: v
|
|
47
82
|
};
|
|
48
83
|
}
|
|
49
|
-
|
|
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
|
-
},
|
|
52
|
-
...
|
|
53
|
-
props:
|
|
54
|
-
emits:
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
57
|
-
() =>
|
|
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:
|
|
106
|
+
modifiers: c,
|
|
60
107
|
title: v,
|
|
61
|
-
content:
|
|
62
|
-
disabled:
|
|
63
|
-
collapse:
|
|
64
|
-
modelValue:
|
|
65
|
-
isInGroup:
|
|
66
|
-
} =
|
|
67
|
-
get: () =>
|
|
68
|
-
set: (
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
if (
|
|
72
|
-
|
|
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
|
-
|
|
76
|
-
(
|
|
122
|
+
n.value = n.value.filter(
|
|
123
|
+
(_) => _ !== o.value
|
|
77
124
|
);
|
|
78
125
|
return;
|
|
79
126
|
}
|
|
80
|
-
|
|
127
|
+
n.value = p ? o.value : null;
|
|
81
128
|
return;
|
|
82
129
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
130
|
+
if (n.value === void 0 && typeof p == "boolean") {
|
|
131
|
+
$.value = p;
|
|
85
132
|
return;
|
|
86
133
|
}
|
|
87
|
-
|
|
134
|
+
n.value = p;
|
|
88
135
|
}
|
|
89
|
-
}),
|
|
136
|
+
}), y = P(
|
|
90
137
|
"vv-accordion",
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
disabled:
|
|
138
|
+
c,
|
|
139
|
+
d(() => ({
|
|
140
|
+
disabled: i.value
|
|
94
141
|
}))
|
|
95
|
-
),
|
|
96
|
-
return (
|
|
97
|
-
id: l(
|
|
98
|
-
class:
|
|
99
|
-
open: l(
|
|
100
|
-
onClick:
|
|
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(
|
|
104
|
-
"aria-expanded": l(
|
|
150
|
+
"aria-controls": l(o),
|
|
151
|
+
"aria-expanded": l(u),
|
|
105
152
|
class: "vv-collapse__summary"
|
|
106
153
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
154
|
+
A(p.$slots, "summary", V(b({ open: l(u) })), () => [
|
|
155
|
+
C(E(l(v)), 1)
|
|
109
156
|
])
|
|
110
|
-
], 8,
|
|
157
|
+
], 8, ee),
|
|
111
158
|
G("div", {
|
|
112
|
-
"aria-hidden": !l(
|
|
159
|
+
"aria-hidden": !l(u),
|
|
113
160
|
class: "vv-collapse__content"
|
|
114
161
|
}, [
|
|
115
|
-
|
|
116
|
-
|
|
162
|
+
A(p.$slots, "details", V(b({ open: l(u) })), () => [
|
|
163
|
+
C(E(l(m)), 1)
|
|
117
164
|
])
|
|
118
|
-
], 8,
|
|
119
|
-
], 10,
|
|
165
|
+
], 8, oe)
|
|
166
|
+
], 10, w));
|
|
120
167
|
}
|
|
121
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
153
|
-
...
|
|
154
|
-
props:
|
|
155
|
-
emits:
|
|
156
|
-
setup(
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
typeof
|
|
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
|
|
221
|
+
const i = S([]), f = d({
|
|
164
222
|
get: () => {
|
|
165
|
-
var
|
|
166
|
-
return
|
|
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: (
|
|
169
|
-
if (
|
|
170
|
-
return (Array.isArray(
|
|
171
|
-
|
|
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
|
-
|
|
175
|
-
key:
|
|
176
|
-
modelValue:
|
|
177
|
-
disabled:
|
|
178
|
-
collapse:
|
|
232
|
+
le({
|
|
233
|
+
key: I,
|
|
234
|
+
modelValue: f,
|
|
235
|
+
disabled: s,
|
|
236
|
+
collapse: o,
|
|
179
237
|
modifiers: v
|
|
180
238
|
});
|
|
181
|
-
const
|
|
239
|
+
const n = P(
|
|
182
240
|
"vv-accordion-group",
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
disabled:
|
|
241
|
+
c,
|
|
242
|
+
d(() => ({
|
|
243
|
+
disabled: s.value
|
|
186
244
|
}))
|
|
187
245
|
);
|
|
188
|
-
return (
|
|
189
|
-
class:
|
|
246
|
+
return (a, $) => (g(), h("div", {
|
|
247
|
+
class: B(l(n))
|
|
190
248
|
}, [
|
|
191
|
-
|
|
192
|
-
(
|
|
193
|
-
key:
|
|
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:
|
|
196
|
-
title:
|
|
197
|
-
content:
|
|
253
|
+
name: u.name,
|
|
254
|
+
title: u.title,
|
|
255
|
+
content: u.content
|
|
198
256
|
}), {
|
|
199
|
-
header:
|
|
200
|
-
|
|
257
|
+
header: O((y) => [
|
|
258
|
+
A(a.$slots, `header::${u.name}`, V(b(y)))
|
|
201
259
|
]),
|
|
202
|
-
details:
|
|
203
|
-
|
|
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
|
-
|
|
270
|
+
ve as default
|
|
213
271
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
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
|
+
};
|