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