@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,36 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { unref as v, toRefs as k, computed as c, h as ne, inject as oe, toRef as ae, defineComponent as D, useSlots as x, ref as le, openBlock as j, createElementBlock as B, normalizeClass as F, withDirectives as se, createElementVNode as H, isRef as K, vModelRadio as ue, renderSlot as q, createTextVNode as ie, toDisplayString as w, createVNode as M, provide as ce, createCommentVNode as de, Fragment as fe, renderList as ve, createBlock as pe, mergeProps as ye } from "vue";
|
|
2
|
+
import { toReactive as ge, useVModel as be } from "@vueuse/core";
|
|
3
|
+
import { nanoid as me } from "nanoid";
|
|
4
|
+
var E = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(E || {}), z = /* @__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))(z || {}), C = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(C || {}), I = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(I || {}), U = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(U || {});
|
|
5
|
+
const J = Symbol.for("radioGroup");
|
|
6
|
+
function W(e, t, r) {
|
|
7
|
+
return r ? R(e, r) === R(t, r) : G(e, t);
|
|
6
8
|
}
|
|
7
|
-
function
|
|
9
|
+
function G(e, t) {
|
|
10
|
+
if (e === t)
|
|
11
|
+
return !0;
|
|
12
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
13
|
+
const r = Array.isArray(e), s = Array.isArray(t);
|
|
14
|
+
let o, a, l;
|
|
15
|
+
if (r && s) {
|
|
16
|
+
if (a = e.length, a != t.length)
|
|
17
|
+
return !1;
|
|
18
|
+
for (o = a; o-- !== 0; )
|
|
19
|
+
if (!G(e[o], t[o]))
|
|
20
|
+
return !1;
|
|
21
|
+
return !0;
|
|
22
|
+
}
|
|
23
|
+
if (r != s)
|
|
24
|
+
return !1;
|
|
25
|
+
const i = e instanceof Date, n = t instanceof Date;
|
|
26
|
+
if (i != n)
|
|
27
|
+
return !1;
|
|
28
|
+
if (i && n)
|
|
29
|
+
return e.getTime() == t.getTime();
|
|
30
|
+
const d = e instanceof RegExp, f = t instanceof RegExp;
|
|
31
|
+
if (d != f)
|
|
32
|
+
return !1;
|
|
33
|
+
if (d && f)
|
|
34
|
+
return e.toString() == t.toString();
|
|
35
|
+
const u = Object.keys(e);
|
|
36
|
+
if (a = u.length, a !== Object.keys(t).length)
|
|
37
|
+
return !1;
|
|
38
|
+
for (o = a; o-- !== 0; )
|
|
39
|
+
if (!Object.prototype.hasOwnProperty.call(t, u[o]))
|
|
40
|
+
return !1;
|
|
41
|
+
for (o = a; o-- !== 0; )
|
|
42
|
+
if (l = u[o], !G(e[l], t[l]))
|
|
43
|
+
return !1;
|
|
44
|
+
return !0;
|
|
45
|
+
}
|
|
46
|
+
return e !== e && t !== t;
|
|
47
|
+
}
|
|
48
|
+
function R(e, t) {
|
|
49
|
+
if (e && Object.keys(e).length && t) {
|
|
50
|
+
if (t.indexOf(".") === -1)
|
|
51
|
+
return e[t];
|
|
52
|
+
{
|
|
53
|
+
const r = t.split(".");
|
|
54
|
+
let s = e;
|
|
55
|
+
for (let o = 0, a = r.length; o < a; ++o) {
|
|
56
|
+
if (e == null)
|
|
57
|
+
return null;
|
|
58
|
+
s = s[r[o]];
|
|
59
|
+
}
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
} else
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function he(e, t) {
|
|
66
|
+
if (e != null && t && t.length) {
|
|
67
|
+
for (const r of t)
|
|
68
|
+
if (W(e, r))
|
|
69
|
+
return !0;
|
|
70
|
+
}
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
function Y(e) {
|
|
74
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(v(e));
|
|
75
|
+
}
|
|
76
|
+
function Oe(e) {
|
|
77
|
+
return typeof e == "string" || e instanceof String;
|
|
78
|
+
}
|
|
79
|
+
function A(e) {
|
|
80
|
+
return Array.isArray(e) ? e.filter((t) => Oe(t)).join(" ") : e;
|
|
81
|
+
}
|
|
82
|
+
function Q(e, t) {
|
|
8
83
|
const {
|
|
9
|
-
invalid:
|
|
10
|
-
valid:
|
|
11
|
-
hint:
|
|
12
|
-
loading:
|
|
13
|
-
} =
|
|
14
|
-
hintLabel:
|
|
15
|
-
modelValue:
|
|
16
|
-
valid:
|
|
17
|
-
validLabel:
|
|
18
|
-
invalid:
|
|
19
|
-
invalidLabel:
|
|
20
|
-
...
|
|
21
|
-
} =
|
|
22
|
-
() => !!(
|
|
23
|
-
),
|
|
24
|
-
() => !!(
|
|
25
|
-
), _ =
|
|
26
|
-
() => !!(
|
|
27
|
-
),
|
|
28
|
-
() =>
|
|
84
|
+
invalid: r,
|
|
85
|
+
valid: s,
|
|
86
|
+
hint: o,
|
|
87
|
+
loading: a
|
|
88
|
+
} = t, {
|
|
89
|
+
hintLabel: l,
|
|
90
|
+
modelValue: i,
|
|
91
|
+
valid: n,
|
|
92
|
+
validLabel: d,
|
|
93
|
+
invalid: f,
|
|
94
|
+
invalidLabel: u,
|
|
95
|
+
...S
|
|
96
|
+
} = k(e), p = R(S, "loading"), g = R(S, "loadingLabel"), m = c(() => f.value ? !!(f.value && r || u != null && u.value && Array.isArray(u.value) && u.value.length > 0 || u != null && u.value && !Y(u)) : !1), y = c(
|
|
97
|
+
() => !!(l && l.value || o)
|
|
98
|
+
), b = c(
|
|
99
|
+
() => !!(d && d.value || s)
|
|
100
|
+
), _ = c(
|
|
101
|
+
() => !!(p != null && p.value && a || p != null && p.value && (g != null && g.value))
|
|
102
|
+
), V = c(
|
|
103
|
+
() => y.value || b.value || m.value || _.value
|
|
29
104
|
);
|
|
30
105
|
return {
|
|
31
|
-
hasInvalid:
|
|
32
|
-
hasHint:
|
|
33
|
-
hasValid:
|
|
106
|
+
hasInvalid: m,
|
|
107
|
+
hasHint: y,
|
|
108
|
+
hasValid: b,
|
|
34
109
|
hasLoading: _,
|
|
35
110
|
HintSlot: {
|
|
36
111
|
name: "HintSlot",
|
|
@@ -41,30 +116,30 @@ function H(e, p) {
|
|
|
41
116
|
}
|
|
42
117
|
},
|
|
43
118
|
setup(P) {
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
hintLabel:
|
|
47
|
-
modelValue:
|
|
48
|
-
valid:
|
|
49
|
-
validLabel:
|
|
50
|
-
invalid:
|
|
51
|
-
invalidLabel:
|
|
52
|
-
loading:
|
|
53
|
-
loadingLabel:
|
|
119
|
+
const h = c(() => {
|
|
120
|
+
const O = ge({
|
|
121
|
+
hintLabel: l,
|
|
122
|
+
modelValue: i,
|
|
123
|
+
valid: n,
|
|
124
|
+
validLabel: d,
|
|
125
|
+
invalid: f,
|
|
126
|
+
invalidLabel: u,
|
|
127
|
+
loading: p,
|
|
128
|
+
loadingLabel: g,
|
|
54
129
|
...P.params
|
|
55
130
|
});
|
|
56
|
-
return
|
|
131
|
+
return f != null && f.value ? (r == null ? void 0 : r(O)) || A(u == null ? void 0 : u.value) || (l == null ? void 0 : l.value) : n != null && n.value ? (s == null ? void 0 : s(O)) || A(d == null ? void 0 : d.value) || (l == null ? void 0 : l.value) : p != null && p.value ? (a == null ? void 0 : a(O)) || A(g == null ? void 0 : g.value) || (l == null ? void 0 : l.value) : (o == null ? void 0 : o(O)) || A(l == null ? void 0 : l.value) || (l == null ? void 0 : l.value);
|
|
57
132
|
});
|
|
58
133
|
return {
|
|
59
|
-
isVisible:
|
|
60
|
-
hasInvalid:
|
|
61
|
-
hasValid:
|
|
62
|
-
hintContent:
|
|
134
|
+
isVisible: V,
|
|
135
|
+
hasInvalid: m,
|
|
136
|
+
hasValid: b,
|
|
137
|
+
hintContent: h
|
|
63
138
|
};
|
|
64
139
|
},
|
|
65
140
|
render() {
|
|
66
141
|
if (this.isVisible)
|
|
67
|
-
return
|
|
142
|
+
return ne(
|
|
68
143
|
"small",
|
|
69
144
|
{
|
|
70
145
|
role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
|
|
@@ -75,30 +150,83 @@ function H(e, p) {
|
|
|
75
150
|
}
|
|
76
151
|
};
|
|
77
152
|
}
|
|
78
|
-
const
|
|
153
|
+
const Se = {
|
|
154
|
+
/**
|
|
155
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
156
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
157
|
+
*/
|
|
158
|
+
to: {
|
|
159
|
+
type: [String, Object]
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Anchor href
|
|
163
|
+
*/
|
|
164
|
+
href: String,
|
|
165
|
+
/**
|
|
166
|
+
* Anchor target
|
|
167
|
+
*/
|
|
168
|
+
target: {
|
|
169
|
+
type: String,
|
|
170
|
+
validator: (e) => Object.values(U).includes(e)
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Anchor rel
|
|
174
|
+
*/
|
|
175
|
+
rel: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: "noopener noreferrer"
|
|
178
|
+
}
|
|
179
|
+
}, T = {
|
|
180
|
+
/**
|
|
181
|
+
* Valid status
|
|
182
|
+
*/
|
|
79
183
|
valid: Boolean,
|
|
184
|
+
/**
|
|
185
|
+
* Valid label
|
|
186
|
+
*/
|
|
80
187
|
validLabel: [String, Array]
|
|
81
|
-
},
|
|
188
|
+
}, X = {
|
|
189
|
+
/**
|
|
190
|
+
* Invalid status
|
|
191
|
+
*/
|
|
82
192
|
invalid: Boolean,
|
|
193
|
+
/**
|
|
194
|
+
* Invalid label
|
|
195
|
+
*/
|
|
83
196
|
invalidLabel: [String, Array]
|
|
84
|
-
},
|
|
197
|
+
}, $ = {
|
|
85
198
|
/**
|
|
86
199
|
* Whether the form control is disabled
|
|
87
200
|
*/
|
|
88
201
|
disabled: Boolean
|
|
89
|
-
},
|
|
202
|
+
}, _e = {
|
|
203
|
+
/**
|
|
204
|
+
* Whether the item is active
|
|
205
|
+
*/
|
|
206
|
+
active: Boolean
|
|
207
|
+
}, Ve = {
|
|
208
|
+
/**
|
|
209
|
+
* Whether the item is pressed
|
|
210
|
+
*/
|
|
211
|
+
pressed: Boolean
|
|
212
|
+
}, N = {
|
|
213
|
+
/**
|
|
214
|
+
* The item label
|
|
215
|
+
*/
|
|
216
|
+
label: [String, Number]
|
|
217
|
+
}, Z = {
|
|
90
218
|
/**
|
|
91
219
|
* The value is not editable
|
|
92
220
|
*/
|
|
93
221
|
readonly: Boolean
|
|
94
|
-
},
|
|
222
|
+
}, L = {
|
|
95
223
|
/**
|
|
96
224
|
* Component BEM modifiers
|
|
97
225
|
*/
|
|
98
226
|
modifiers: [String, Array]
|
|
99
|
-
},
|
|
227
|
+
}, ee = {
|
|
100
228
|
hintLabel: { type: String, default: "" }
|
|
101
|
-
},
|
|
229
|
+
}, je = {
|
|
102
230
|
/**
|
|
103
231
|
* List of options, can be string[] or object[]
|
|
104
232
|
*/
|
|
@@ -119,38 +247,39 @@ const M = {
|
|
|
119
247
|
*/
|
|
120
248
|
disabledKey: { type: [String, Function], default: "disabled" }
|
|
121
249
|
};
|
|
122
|
-
|
|
123
|
-
const
|
|
250
|
+
C.before;
|
|
251
|
+
const ke = {
|
|
124
252
|
/**
|
|
125
253
|
* Global attribute tabindex
|
|
126
254
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
127
255
|
*/
|
|
128
256
|
tabindex: { type: [String, Number], default: 0 }
|
|
129
|
-
},
|
|
257
|
+
}, Ae = {
|
|
130
258
|
/**
|
|
131
259
|
* Global attribute id
|
|
132
260
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
133
261
|
*/
|
|
134
262
|
id: [String, Number]
|
|
135
263
|
};
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
...
|
|
264
|
+
E.bottom;
|
|
265
|
+
const Be = {
|
|
266
|
+
...Ae,
|
|
139
267
|
/**
|
|
140
268
|
* Input / Textarea name
|
|
141
269
|
* Name of the form control. Submitted with the form as part of a name/value pair
|
|
142
270
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
143
271
|
*/
|
|
144
272
|
name: { type: String, required: !0 }
|
|
145
|
-
},
|
|
146
|
-
...
|
|
147
|
-
...
|
|
148
|
-
...
|
|
149
|
-
...
|
|
150
|
-
...
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
...
|
|
273
|
+
}, Re = {
|
|
274
|
+
...Be,
|
|
275
|
+
...ke,
|
|
276
|
+
...T,
|
|
277
|
+
...X,
|
|
278
|
+
...ee,
|
|
279
|
+
...$,
|
|
280
|
+
...Z,
|
|
281
|
+
...L,
|
|
282
|
+
...N,
|
|
154
283
|
/**
|
|
155
284
|
* Input value
|
|
156
285
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -159,27 +288,20 @@ const re = {
|
|
|
159
288
|
/**
|
|
160
289
|
* Input value
|
|
161
290
|
*/
|
|
162
|
-
modelValue: [Object, Number, Boolean, String]
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
...
|
|
170
|
-
...
|
|
171
|
-
...
|
|
172
|
-
...q,
|
|
173
|
-
...K,
|
|
174
|
-
...w,
|
|
291
|
+
modelValue: [Object, Number, Boolean, String]
|
|
292
|
+
}, Pe = {
|
|
293
|
+
...T,
|
|
294
|
+
...X,
|
|
295
|
+
...je,
|
|
296
|
+
...ee,
|
|
297
|
+
...$,
|
|
298
|
+
...Z,
|
|
299
|
+
...L,
|
|
300
|
+
...N,
|
|
175
301
|
/**
|
|
176
302
|
* Input value
|
|
177
303
|
*/
|
|
178
304
|
modelValue: [String, Array],
|
|
179
|
-
/**
|
|
180
|
-
* Input label
|
|
181
|
-
*/
|
|
182
|
-
label: String,
|
|
183
305
|
/**
|
|
184
306
|
* Input name
|
|
185
307
|
*/
|
|
@@ -188,129 +310,204 @@ const re = {
|
|
|
188
310
|
* If true, the group will be displayed in a vertical column
|
|
189
311
|
*/
|
|
190
312
|
vertical: Boolean
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
313
|
+
};
|
|
314
|
+
({
|
|
315
|
+
...$,
|
|
316
|
+
...N,
|
|
317
|
+
...Ve,
|
|
318
|
+
..._e,
|
|
319
|
+
...Se,
|
|
320
|
+
/**
|
|
321
|
+
* Button type
|
|
322
|
+
*/
|
|
323
|
+
type: I.button
|
|
324
|
+
});
|
|
325
|
+
function Ee(e) {
|
|
326
|
+
const t = oe(e, void 0), r = c(() => !Y(t));
|
|
327
|
+
function s(o, a, l) {
|
|
328
|
+
if (t != null && t.value) {
|
|
329
|
+
const n = v(t.value)[o];
|
|
330
|
+
return c({
|
|
331
|
+
get() {
|
|
332
|
+
return n == null ? void 0 : n.value;
|
|
333
|
+
},
|
|
334
|
+
set(d) {
|
|
335
|
+
n.value = d;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
const i = ae(a, o);
|
|
340
|
+
return c({
|
|
341
|
+
get() {
|
|
342
|
+
return i.value;
|
|
343
|
+
},
|
|
344
|
+
set(n) {
|
|
345
|
+
l && l(`update:${o}`, n);
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
group: t,
|
|
351
|
+
isInGroup: r,
|
|
352
|
+
getGroupOrLocalRef: s
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const Ce = Re, Ie = ["click", "update:modelValue", "change", "blur"];
|
|
356
|
+
function Ge(e, t) {
|
|
357
|
+
const { id: r } = k(e), { group: s, isInGroup: o, getGroupOrLocalRef: a } = Ee(J), l = a("modelValue", e, t), i = a("readonly", e), n = a("disabled", e), d = a("valid", e), f = a("invalid", e);
|
|
194
358
|
return {
|
|
195
359
|
// local props
|
|
196
|
-
id:
|
|
360
|
+
id: r,
|
|
197
361
|
// global props
|
|
198
|
-
group:
|
|
199
|
-
isInGroup:
|
|
200
|
-
modelValue:
|
|
201
|
-
readonly:
|
|
202
|
-
disabled:
|
|
203
|
-
valid:
|
|
204
|
-
invalid:
|
|
362
|
+
group: s,
|
|
363
|
+
isInGroup: o,
|
|
364
|
+
modelValue: l,
|
|
365
|
+
readonly: i,
|
|
366
|
+
disabled: n,
|
|
367
|
+
valid: d,
|
|
368
|
+
invalid: f
|
|
205
369
|
};
|
|
206
370
|
}
|
|
207
|
-
const
|
|
371
|
+
const $e = (e) => c(() => String((e == null ? void 0 : e.value) || me()));
|
|
372
|
+
function te(e, t, r) {
|
|
373
|
+
return c(() => {
|
|
374
|
+
const s = {
|
|
375
|
+
[e]: !0
|
|
376
|
+
}, o = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
|
|
377
|
+
return o && Array.isArray(o) && o.forEach((a) => {
|
|
378
|
+
s[`${e}--${a}`] = !0;
|
|
379
|
+
}), r && Object.keys(r.value).forEach((a) => {
|
|
380
|
+
s[`${e}--${a}`] = v(r.value[a]);
|
|
381
|
+
}), s;
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const Ne = ["for"], De = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], xe = {
|
|
208
385
|
name: "VvRadio"
|
|
209
|
-
},
|
|
210
|
-
...
|
|
211
|
-
props:
|
|
212
|
-
emits:
|
|
213
|
-
setup(e, { emit:
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
386
|
+
}, Fe = /* @__PURE__ */ D({
|
|
387
|
+
...xe,
|
|
388
|
+
props: Ce,
|
|
389
|
+
emits: Ie,
|
|
390
|
+
setup(e, { emit: t }) {
|
|
391
|
+
const r = e, s = x(), { id: o, disabled: a, readonly: l, modelValue: i, valid: n, invalid: d } = Ge(r, t), f = $e(o), u = c(() => p.value ? -1 : r.tabindex), S = le(), p = c(() => a.value || l.value), g = c(() => {
|
|
392
|
+
if (d.value === !0)
|
|
216
393
|
return !0;
|
|
217
|
-
if (
|
|
394
|
+
if (n.value === !0)
|
|
218
395
|
return !1;
|
|
219
|
-
}),
|
|
220
|
-
() => Array.isArray(
|
|
221
|
-
),
|
|
222
|
-
() => ["string", "number", "boolean"].includes(typeof
|
|
223
|
-
),
|
|
396
|
+
}), m = c(
|
|
397
|
+
() => Array.isArray(i.value) ? he(r.value, i.value) : W(r.value, i.value)
|
|
398
|
+
), y = c(
|
|
399
|
+
() => ["string", "number", "boolean"].includes(typeof r.value) ? r.value : !0
|
|
400
|
+
), b = c({
|
|
224
401
|
get() {
|
|
225
|
-
return
|
|
402
|
+
return m.value ? y.value : null;
|
|
226
403
|
},
|
|
227
|
-
set(
|
|
228
|
-
Array.isArray(
|
|
404
|
+
set(h) {
|
|
405
|
+
Array.isArray(i.value) ? i.value = [r.value] : i.value = r.value, t("change", h);
|
|
229
406
|
}
|
|
230
|
-
}), { modifiers: _ } =
|
|
407
|
+
}), { modifiers: _ } = k(r), V = te(
|
|
231
408
|
"vv-radio",
|
|
232
409
|
_,
|
|
233
|
-
|
|
234
|
-
valid:
|
|
235
|
-
invalid:
|
|
236
|
-
disabled:
|
|
237
|
-
readonly:
|
|
410
|
+
c(() => ({
|
|
411
|
+
valid: n.value,
|
|
412
|
+
invalid: d.value,
|
|
413
|
+
disabled: a.value,
|
|
414
|
+
readonly: l.value
|
|
238
415
|
}))
|
|
239
|
-
), { HintSlot: P } =
|
|
240
|
-
return (
|
|
241
|
-
class:
|
|
242
|
-
for:
|
|
416
|
+
), { HintSlot: P } = Q(r, s);
|
|
417
|
+
return (h, O) => (j(), B("label", {
|
|
418
|
+
class: F(v(V)),
|
|
419
|
+
for: v(f)
|
|
243
420
|
}, [
|
|
244
|
-
|
|
245
|
-
id:
|
|
421
|
+
se(H("input", {
|
|
422
|
+
id: v(f),
|
|
246
423
|
ref_key: "input",
|
|
247
|
-
ref:
|
|
248
|
-
"onUpdate:modelValue":
|
|
424
|
+
ref: S,
|
|
425
|
+
"onUpdate:modelValue": O[0] || (O[0] = (re) => K(b) ? b.value = re : null),
|
|
249
426
|
type: "radio",
|
|
250
427
|
class: "vv-radio__input",
|
|
251
|
-
name:
|
|
252
|
-
disabled:
|
|
253
|
-
value:
|
|
254
|
-
tabindex:
|
|
255
|
-
"aria-invalid":
|
|
256
|
-
}, null, 8,
|
|
257
|
-
[
|
|
428
|
+
name: h.name,
|
|
429
|
+
disabled: v(p),
|
|
430
|
+
value: v(y),
|
|
431
|
+
tabindex: v(u),
|
|
432
|
+
"aria-invalid": v(g)
|
|
433
|
+
}, null, 8, De), [
|
|
434
|
+
[ue, v(b)]
|
|
258
435
|
]),
|
|
259
|
-
|
|
260
|
-
|
|
436
|
+
q(h.$slots, "default", { value: v(i) }, () => [
|
|
437
|
+
ie(w(h.label), 1)
|
|
261
438
|
]),
|
|
262
|
-
|
|
439
|
+
M(v(P), {
|
|
263
440
|
class: "vv-radio__hint",
|
|
264
|
-
params: { value:
|
|
441
|
+
params: { value: v(i) }
|
|
265
442
|
}, null, 8, ["params"])
|
|
266
|
-
], 10,
|
|
443
|
+
], 10, Ne));
|
|
267
444
|
}
|
|
268
|
-
}),
|
|
445
|
+
}), He = Pe, Ke = ["update:modelValue", "change"];
|
|
446
|
+
function qe(e) {
|
|
447
|
+
if (Object.keys(e).some(
|
|
448
|
+
(t) => t !== "key" && !K(e[t])
|
|
449
|
+
))
|
|
450
|
+
throw Error("One or more groupState props aren't ref.");
|
|
451
|
+
ce(
|
|
452
|
+
e.key,
|
|
453
|
+
c(() => e)
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
function we(e) {
|
|
457
|
+
const { options: t, labelKey: r, valueKey: s, disabledKey: o } = k(e);
|
|
458
|
+
return {
|
|
459
|
+
options: t,
|
|
460
|
+
getOptionLabel: (n) => typeof n != "object" && n !== null ? n : typeof r.value == "function" ? r.value(n) : n[r.value],
|
|
461
|
+
getOptionValue: (n) => typeof n != "object" && n !== null ? n : typeof s.value == "function" ? s.value(n) : n[s.value],
|
|
462
|
+
getOptionDisabled: (n) => typeof n != "object" && n !== null ? !1 : typeof o.value == "function" ? o.value(n) : n[o.value]
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
const Me = ["textContent"], ze = { class: "vv-radio-group__wrapper" }, Ue = {
|
|
269
466
|
name: "VvRadioGroup"
|
|
270
|
-
},
|
|
271
|
-
...
|
|
272
|
-
props:
|
|
273
|
-
emits:
|
|
274
|
-
setup(e, { emit:
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
key:
|
|
278
|
-
modelValue:
|
|
279
|
-
disabled:
|
|
280
|
-
readonly:
|
|
281
|
-
valid:
|
|
282
|
-
invalid:
|
|
467
|
+
}, Qe = /* @__PURE__ */ D({
|
|
468
|
+
...Ue,
|
|
469
|
+
props: He,
|
|
470
|
+
emits: Ke,
|
|
471
|
+
setup(e, { emit: t }) {
|
|
472
|
+
const r = e, s = x(), o = be(r, "modelValue", t), { disabled: a, readonly: l, vertical: i, valid: n, invalid: d, modifiers: f } = k(r);
|
|
473
|
+
qe({
|
|
474
|
+
key: J,
|
|
475
|
+
modelValue: o,
|
|
476
|
+
disabled: a,
|
|
477
|
+
readonly: l,
|
|
478
|
+
valid: n,
|
|
479
|
+
invalid: d
|
|
283
480
|
});
|
|
284
|
-
const { getOptionLabel:
|
|
481
|
+
const { getOptionLabel: u, getOptionValue: S } = we(r), p = te(
|
|
285
482
|
"vv-radio-group",
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
disabled:
|
|
289
|
-
readonly:
|
|
290
|
-
horizontal: !
|
|
291
|
-
valid:
|
|
292
|
-
invalid:
|
|
483
|
+
f,
|
|
484
|
+
c(() => ({
|
|
485
|
+
disabled: a.value,
|
|
486
|
+
readonly: l.value,
|
|
487
|
+
horizontal: !i.value,
|
|
488
|
+
valid: n.value,
|
|
489
|
+
invalid: d.value
|
|
293
490
|
}))
|
|
294
|
-
),
|
|
295
|
-
id: `${
|
|
296
|
-
name:
|
|
297
|
-
label:
|
|
298
|
-
value:
|
|
299
|
-
}), { HintSlot:
|
|
300
|
-
return (
|
|
301
|
-
class:
|
|
491
|
+
), g = (y, b) => ({
|
|
492
|
+
id: `${r.name}_opt${b}`,
|
|
493
|
+
name: r.name,
|
|
494
|
+
label: u(y),
|
|
495
|
+
value: S(y)
|
|
496
|
+
}), { HintSlot: m } = Q(r, s);
|
|
497
|
+
return (y, b) => (j(), B("fieldset", {
|
|
498
|
+
class: F(v(p))
|
|
302
499
|
}, [
|
|
303
|
-
|
|
500
|
+
y.label ? (j(), B("legend", {
|
|
304
501
|
key: 0,
|
|
305
|
-
textContent:
|
|
306
|
-
}, null, 8,
|
|
307
|
-
|
|
308
|
-
|
|
502
|
+
textContent: w(y.label)
|
|
503
|
+
}, null, 8, Me)) : de("", !0),
|
|
504
|
+
H("div", ze, [
|
|
505
|
+
y.options.length > 0 ? (j(!0), B(fe, { key: 0 }, ve(y.options, (_, V) => (j(), pe(Fe, ye({ key: V }, g(_, V)), null, 16))), 128)) : q(y.$slots, "default", { key: 1 })
|
|
309
506
|
]),
|
|
310
|
-
|
|
507
|
+
M(v(m), { class: "vv-radio-group__hint" })
|
|
311
508
|
], 2));
|
|
312
509
|
}
|
|
313
510
|
});
|
|
314
511
|
export {
|
|
315
|
-
|
|
512
|
+
Qe as default
|
|
316
513
|
};
|