@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-imports.d.ts +289 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +16 -50
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +170 -306
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +26 -60
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
- package/dist/components/VvCheckbox/index.d.ts +10 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
- package/dist/components/VvCombobox/index.d.ts +4 -4
- package/dist/components/VvDialog/VvDialog.es.js +66 -102
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +304 -407
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvProgress/VvProgress.es.js +17 -51
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +110 -249
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
- package/dist/components/VvRadio/index.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +200 -292
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
- package/dist/components/VvTooltip/index.d.ts +18 -0
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1179 -1371
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcons.d.ts +1 -1
- package/dist/composables/useDebouncedInput.d.ts +1 -1
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useTextCount.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1211 -1404
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +27 -20
- 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/VvAccordion/VvAccordion.vue +0 -3
- package/src/components/VvAccordion/index.ts +1 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
- package/src/components/VvBadge/VvBadge.vue +0 -1
- package/src/components/VvButton/VvButton.vue +0 -3
- package/src/components/VvButton/index.ts +2 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
- package/src/components/VvCard/VvCard.vue +0 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
- package/src/components/VvCheckbox/index.ts +1 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
- package/src/components/VvCombobox/VvCombobox.vue +0 -7
- package/src/components/VvDialog/VvDialog.vue +1 -2
- package/src/components/VvDropdown/VvDropdown.vue +0 -4
- package/src/components/VvIcon/VvIcon.vue +0 -2
- package/src/components/VvInputText/VvInputClearAction.ts +0 -1
- package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
- package/src/components/VvInputText/VvInputStepAction.ts +0 -1
- package/src/components/VvInputText/VvInputText.vue +1 -16
- package/src/components/VvInputText/VvInputTextActions.ts +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -2
- package/src/components/VvRadio/VvRadio.vue +0 -3
- package/src/components/VvRadio/index.ts +0 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
- package/src/components/VvSelect/VvSelect.vue +1 -14
- package/src/components/VvTextarea/VvTextarea.vue +1 -15
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/components/common/HintSlot.ts +1 -11
- package/src/composables/group/types/IAccordionGroupState.ts +0 -1
- package/src/composables/group/types/IButtonGroupState.ts +0 -1
- package/src/composables/group/types/IInputGroup.ts +0 -1
- package/src/composables/group/useInjectedGroupState.ts +1 -2
- package/src/composables/group/useProvideGroupState.ts +0 -1
- package/src/composables/useComponentFocus.ts +1 -2
- package/src/composables/useComponentIcons.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useModifiers.ts +1 -2
- package/src/composables/useOptions.ts +0 -1
- package/src/composables/useTextCount.ts +1 -1
- package/src/stories/Accordion/Accordion.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Badge/Badge.stories.mdx +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.stories.mdx +1 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
- package/src/stories/Card/Card.stories.mdx +1 -1
- package/src/stories/Card/CardSlots.stories.mdx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.stories.mdx +1 -1
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/InputText/InputText.stories.mdx +1 -1
- package/src/stories/Progress/Progress.stories.mdx +1 -1
- package/src/stories/Radio/Radio.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Select/Select.stories.mdx +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -1,163 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (Object.keys(t).some(
|
|
7
|
-
(e) => e !== "key" && !E(t[e])
|
|
8
|
-
))
|
|
9
|
-
throw Error("One or more groupState props aren't ref.");
|
|
10
|
-
ee(
|
|
11
|
-
t.key,
|
|
12
|
-
c(() => t)
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
function ke(t) {
|
|
16
|
-
const { options: e, labelKey: n, valueKey: a } = j(t);
|
|
17
|
-
return {
|
|
18
|
-
options: e,
|
|
19
|
-
getOptionLabel: (r) => typeof r != "object" && r !== null ? r : typeof n.value == "function" ? n.value(r) : r[n.value],
|
|
20
|
-
getOptionValue: (r) => typeof r != "object" && r !== null ? r : typeof a.value == "function" ? a.value(r) : r[a.value]
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function T(t, e, n) {
|
|
24
|
-
return n ? B(t, n) === B(e, n) : G(t, e);
|
|
25
|
-
}
|
|
26
|
-
function G(t, e) {
|
|
27
|
-
if (t === e)
|
|
28
|
-
return !0;
|
|
29
|
-
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
30
|
-
const n = Array.isArray(t), a = Array.isArray(e);
|
|
31
|
-
let o, u, r;
|
|
32
|
-
if (n && a) {
|
|
33
|
-
if (u = t.length, u != e.length)
|
|
34
|
-
return !1;
|
|
35
|
-
for (o = u; o-- !== 0; )
|
|
36
|
-
if (!G(t[o], e[o]))
|
|
37
|
-
return !1;
|
|
38
|
-
return !0;
|
|
39
|
-
}
|
|
40
|
-
if (n != a)
|
|
41
|
-
return !1;
|
|
42
|
-
const v = t instanceof Date, i = e instanceof Date;
|
|
43
|
-
if (v != i)
|
|
44
|
-
return !1;
|
|
45
|
-
if (v && i)
|
|
46
|
-
return t.getTime() == e.getTime();
|
|
47
|
-
const s = t instanceof RegExp, d = e instanceof RegExp;
|
|
48
|
-
if (s != d)
|
|
49
|
-
return !1;
|
|
50
|
-
if (s && d)
|
|
51
|
-
return t.toString() == e.toString();
|
|
52
|
-
const l = Object.keys(t);
|
|
53
|
-
if (u = l.length, u !== Object.keys(e).length)
|
|
54
|
-
return !1;
|
|
55
|
-
for (o = u; o-- !== 0; )
|
|
56
|
-
if (!Object.prototype.hasOwnProperty.call(e, l[o]))
|
|
57
|
-
return !1;
|
|
58
|
-
for (o = u; o-- !== 0; )
|
|
59
|
-
if (r = l[o], !G(t[r], e[r]))
|
|
60
|
-
return !1;
|
|
61
|
-
return !0;
|
|
62
|
-
}
|
|
63
|
-
return t !== t && e !== e;
|
|
1
|
+
import { defineComponent as R, openBlock as P, createElementBlock as B, normalizeClass as N, unref as c, withDirectives as U, createElementVNode as O, isRef as z, vModelCheckbox as J, renderSlot as H, createTextVNode as Q, toDisplayString as I, createVNode as w, createCommentVNode as W, Fragment as X, renderList as Y, createBlock as Z, mergeProps as L } from "vue";
|
|
2
|
+
import { nanoid as ee } from "nanoid";
|
|
3
|
+
const E = "VV_CHECK_GROUP";
|
|
4
|
+
function A(n) {
|
|
5
|
+
return Array.isArray(n) ? n.filter((m) => isString(m)).join(" ") : n;
|
|
64
6
|
}
|
|
65
|
-
function
|
|
66
|
-
if (t && Object.keys(t).length && e) {
|
|
67
|
-
if (e.indexOf(".") === -1)
|
|
68
|
-
return t[e];
|
|
69
|
-
{
|
|
70
|
-
const n = e.split(".");
|
|
71
|
-
let a = t;
|
|
72
|
-
for (let o = 0, u = n.length; o < u; ++o) {
|
|
73
|
-
if (t == null)
|
|
74
|
-
return null;
|
|
75
|
-
a = a[n[o]];
|
|
76
|
-
}
|
|
77
|
-
return a;
|
|
78
|
-
}
|
|
79
|
-
} else
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
function Ve(t, e) {
|
|
83
|
-
if (t != null && e && e.length) {
|
|
84
|
-
for (const n of e)
|
|
85
|
-
if (T(t, n))
|
|
86
|
-
return !0;
|
|
87
|
-
}
|
|
88
|
-
return !1;
|
|
89
|
-
}
|
|
90
|
-
function q(t) {
|
|
91
|
-
return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(f(t));
|
|
92
|
-
}
|
|
93
|
-
function Ce(t) {
|
|
94
|
-
return typeof t == "string" || t instanceof String;
|
|
95
|
-
}
|
|
96
|
-
function $(t) {
|
|
97
|
-
var e, n;
|
|
98
|
-
if (t)
|
|
99
|
-
return (n = (e = t.match(
|
|
100
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
101
|
-
)) == null ? void 0 : e.join("-")) == null ? void 0 : n.toLowerCase();
|
|
102
|
-
}
|
|
103
|
-
function z(t, e) {
|
|
104
|
-
const n = { [`${t}`]: !0 };
|
|
105
|
-
return {
|
|
106
|
-
bemCssClasses: c(() => Object.keys(e).reduce((o, u) => {
|
|
107
|
-
const r = f(e[u]) || !1;
|
|
108
|
-
if (!r)
|
|
109
|
-
return o;
|
|
110
|
-
if (u === "modifiers") {
|
|
111
|
-
const v = Array.isArray(r) ? r : r.split(" ");
|
|
112
|
-
return {
|
|
113
|
-
...o,
|
|
114
|
-
...v.reduce(
|
|
115
|
-
(i, s) => ({
|
|
116
|
-
...i,
|
|
117
|
-
[`${t}--${$(s)}`]: !0
|
|
118
|
-
}),
|
|
119
|
-
{}
|
|
120
|
-
)
|
|
121
|
-
};
|
|
122
|
-
} else
|
|
123
|
-
return {
|
|
124
|
-
...o,
|
|
125
|
-
[`${t}--${$(u)}`]: r
|
|
126
|
-
};
|
|
127
|
-
}, n) || {})
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function x(t) {
|
|
131
|
-
return Array.isArray(t) ? t.filter((e) => Ce(e)).join(" ") : t;
|
|
132
|
-
}
|
|
133
|
-
function Z(t, e) {
|
|
7
|
+
function $(n, m) {
|
|
134
8
|
const {
|
|
135
|
-
invalid:
|
|
136
|
-
valid:
|
|
137
|
-
hint:
|
|
138
|
-
loading:
|
|
139
|
-
} =
|
|
140
|
-
hintLabel:
|
|
141
|
-
modelValue:
|
|
142
|
-
valid:
|
|
143
|
-
validLabel:
|
|
144
|
-
invalid:
|
|
145
|
-
invalidLabel:
|
|
146
|
-
...
|
|
147
|
-
} =
|
|
148
|
-
() => !!(
|
|
149
|
-
),
|
|
150
|
-
() => !!(
|
|
151
|
-
),
|
|
152
|
-
() => !!(
|
|
153
|
-
),
|
|
154
|
-
() =>
|
|
9
|
+
invalid: e,
|
|
10
|
+
valid: f,
|
|
11
|
+
hint: r,
|
|
12
|
+
loading: d
|
|
13
|
+
} = m, {
|
|
14
|
+
hintLabel: a,
|
|
15
|
+
modelValue: b,
|
|
16
|
+
valid: v,
|
|
17
|
+
validLabel: t,
|
|
18
|
+
invalid: i,
|
|
19
|
+
invalidLabel: o,
|
|
20
|
+
...g
|
|
21
|
+
} = toRefs(n), l = resolveFieldData(g, "loading"), u = resolveFieldData(g, "loadingLabel"), p = computed(() => i.value ? !!(i.value && e || o != null && o.value && Array.isArray(o.value) && o.value.length > 0 || o != null && o.value && !isEmpty(o)) : !1), s = computed(
|
|
22
|
+
() => !!(a && a.value || r)
|
|
23
|
+
), V = computed(
|
|
24
|
+
() => !!(t && t.value || f)
|
|
25
|
+
), k = computed(
|
|
26
|
+
() => !!(l != null && l.value && d || l != null && l.value && (u != null && u.value))
|
|
27
|
+
), S = computed(
|
|
28
|
+
() => s.value || V.value || p.value || k.value
|
|
155
29
|
);
|
|
156
30
|
return {
|
|
157
|
-
hasInvalid:
|
|
158
|
-
hasHint:
|
|
159
|
-
hasValid:
|
|
160
|
-
hasLoading:
|
|
31
|
+
hasInvalid: p,
|
|
32
|
+
hasHint: s,
|
|
33
|
+
hasValid: V,
|
|
34
|
+
hasLoading: k,
|
|
161
35
|
HintSlot: {
|
|
162
36
|
name: "HintSlot",
|
|
163
37
|
props: {
|
|
@@ -166,31 +40,31 @@ function Z(t, e) {
|
|
|
166
40
|
default: () => ({})
|
|
167
41
|
}
|
|
168
42
|
},
|
|
169
|
-
setup(
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
hintLabel:
|
|
173
|
-
modelValue:
|
|
174
|
-
valid:
|
|
175
|
-
validLabel:
|
|
176
|
-
invalid:
|
|
177
|
-
invalidLabel:
|
|
178
|
-
loading:
|
|
179
|
-
loadingLabel:
|
|
180
|
-
...
|
|
43
|
+
setup(G) {
|
|
44
|
+
const x = computed(() => {
|
|
45
|
+
const _ = toReactive({
|
|
46
|
+
hintLabel: a,
|
|
47
|
+
modelValue: b,
|
|
48
|
+
valid: v,
|
|
49
|
+
validLabel: t,
|
|
50
|
+
invalid: i,
|
|
51
|
+
invalidLabel: o,
|
|
52
|
+
loading: l,
|
|
53
|
+
loadingLabel: u,
|
|
54
|
+
...G.params
|
|
181
55
|
});
|
|
182
|
-
return
|
|
56
|
+
return i != null && i.value ? (e == null ? void 0 : e(_)) || A(o == null ? void 0 : o.value) || (a == null ? void 0 : a.value) : v != null && v.value ? (f == null ? void 0 : f(_)) || A(t == null ? void 0 : t.value) || (a == null ? void 0 : a.value) : l != null && l.value ? (d == null ? void 0 : d(_)) || A(u == null ? void 0 : u.value) || (a == null ? void 0 : a.value) : (r == null ? void 0 : r(_)) || A(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
|
|
183
57
|
});
|
|
184
58
|
return {
|
|
185
|
-
isVisible:
|
|
186
|
-
hasInvalid:
|
|
187
|
-
hasValid:
|
|
188
|
-
hintContent:
|
|
59
|
+
isVisible: S,
|
|
60
|
+
hasInvalid: p,
|
|
61
|
+
hasValid: V,
|
|
62
|
+
hintContent: x
|
|
189
63
|
};
|
|
190
64
|
},
|
|
191
65
|
render() {
|
|
192
66
|
if (this.isVisible)
|
|
193
|
-
return
|
|
67
|
+
return h(
|
|
194
68
|
"small",
|
|
195
69
|
{
|
|
196
70
|
role: this.hasInvalid || this.hasValid ? "alert" : void 0
|
|
@@ -201,235 +75,205 @@ function Z(t, e) {
|
|
|
201
75
|
}
|
|
202
76
|
};
|
|
203
77
|
}
|
|
204
|
-
|
|
205
|
-
const e = ne(t, void 0), n = c(() => !q(e));
|
|
206
|
-
function a(o, u, r) {
|
|
207
|
-
if (e != null && e.value) {
|
|
208
|
-
const i = f(e.value)[o];
|
|
209
|
-
return c({
|
|
210
|
-
get() {
|
|
211
|
-
return i == null ? void 0 : i.value;
|
|
212
|
-
},
|
|
213
|
-
set(s) {
|
|
214
|
-
i.value = s;
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const v = re(u, o);
|
|
219
|
-
return c({
|
|
220
|
-
get() {
|
|
221
|
-
return v.value;
|
|
222
|
-
},
|
|
223
|
-
set(i) {
|
|
224
|
-
r && r(`update:${o}`, i);
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
return {
|
|
229
|
-
group: e,
|
|
230
|
-
isInGroup: n,
|
|
231
|
-
getGroupOrLocalRef: a
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
const U = {
|
|
78
|
+
const D = {
|
|
235
79
|
valid: Boolean,
|
|
236
80
|
validLabel: [String, Array]
|
|
237
|
-
},
|
|
81
|
+
}, F = {
|
|
238
82
|
invalid: Boolean,
|
|
239
83
|
invalidLabel: [String, Array]
|
|
240
|
-
},
|
|
84
|
+
}, M = {
|
|
241
85
|
disabled: Boolean
|
|
242
|
-
},
|
|
86
|
+
}, j = {
|
|
243
87
|
readonly: Boolean
|
|
244
|
-
},
|
|
88
|
+
}, K = {
|
|
245
89
|
hintLabel: { type: String, default: "" }
|
|
246
|
-
},
|
|
90
|
+
}, te = {
|
|
247
91
|
options: {
|
|
248
92
|
type: Array,
|
|
249
93
|
default: () => []
|
|
250
94
|
},
|
|
251
95
|
labelKey: { type: [String, Function], default: "label" },
|
|
252
96
|
valueKey: { type: [String, Function], default: "value" }
|
|
253
|
-
},
|
|
97
|
+
}, ae = {
|
|
254
98
|
tabindex: { type: [String, Number], default: 0 }
|
|
255
|
-
},
|
|
99
|
+
}, oe = {
|
|
256
100
|
id: [String, Number],
|
|
257
101
|
name: { type: String, required: !0 }
|
|
258
|
-
},
|
|
259
|
-
...
|
|
260
|
-
...
|
|
261
|
-
...
|
|
262
|
-
...
|
|
263
|
-
...
|
|
264
|
-
...
|
|
265
|
-
...
|
|
102
|
+
}, ne = {
|
|
103
|
+
...oe,
|
|
104
|
+
...ae,
|
|
105
|
+
...D,
|
|
106
|
+
...F,
|
|
107
|
+
...K,
|
|
108
|
+
...M,
|
|
109
|
+
...j,
|
|
266
110
|
value: [String, Number, Boolean],
|
|
267
111
|
modelValue: [Object, Number, Boolean, String],
|
|
268
112
|
label: String
|
|
269
|
-
},
|
|
270
|
-
...
|
|
271
|
-
...
|
|
272
|
-
...
|
|
273
|
-
...
|
|
274
|
-
...
|
|
275
|
-
...
|
|
113
|
+
}, re = {
|
|
114
|
+
...D,
|
|
115
|
+
...F,
|
|
116
|
+
...te,
|
|
117
|
+
...K,
|
|
118
|
+
...M,
|
|
119
|
+
...j,
|
|
276
120
|
modelValue: [String, Array],
|
|
277
121
|
label: String,
|
|
278
122
|
name: { type: String, required: !0 },
|
|
279
123
|
vertical: Boolean
|
|
280
|
-
},
|
|
281
|
-
...
|
|
124
|
+
}, le = {
|
|
125
|
+
...ne,
|
|
282
126
|
indeterminate: Boolean,
|
|
283
127
|
uncheckedValue: [String, Number, Boolean],
|
|
284
128
|
switch: Boolean
|
|
285
|
-
},
|
|
286
|
-
function
|
|
287
|
-
const { group:
|
|
129
|
+
}, ue = ["click", "update:modelValue", "change", "blur"];
|
|
130
|
+
function se(n, m) {
|
|
131
|
+
const { group: e, isInGroup: f, getGroupOrLocalRef: r } = useInjectedGroupState(E), { switch: d, indeterminate: a } = toRefs(n), b = r("modelValue", n, m), v = r("readonly", n), t = r("disabled", n), i = r("valid", n), o = r("invalid", n);
|
|
288
132
|
return {
|
|
289
|
-
propsSwitch:
|
|
290
|
-
indeterminate:
|
|
291
|
-
group:
|
|
292
|
-
isInGroup:
|
|
293
|
-
modelValue:
|
|
294
|
-
readonly:
|
|
295
|
-
disabled:
|
|
296
|
-
valid:
|
|
297
|
-
invalid:
|
|
133
|
+
propsSwitch: d,
|
|
134
|
+
indeterminate: a,
|
|
135
|
+
group: e,
|
|
136
|
+
isInGroup: f,
|
|
137
|
+
modelValue: b,
|
|
138
|
+
readonly: v,
|
|
139
|
+
disabled: t,
|
|
140
|
+
valid: i,
|
|
141
|
+
invalid: o
|
|
298
142
|
};
|
|
299
143
|
}
|
|
300
|
-
const
|
|
144
|
+
const ie = ["for"], ce = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], de = {
|
|
301
145
|
name: "VvCheckbox"
|
|
302
|
-
},
|
|
303
|
-
...
|
|
304
|
-
props:
|
|
305
|
-
emits:
|
|
306
|
-
setup(
|
|
307
|
-
const
|
|
308
|
-
disabled:
|
|
309
|
-
readonly:
|
|
310
|
-
valid:
|
|
311
|
-
invalid:
|
|
312
|
-
propsSwitch:
|
|
313
|
-
modelValue:
|
|
314
|
-
indeterminate:
|
|
315
|
-
isInGroup:
|
|
316
|
-
} =
|
|
317
|
-
() =>
|
|
318
|
-
),
|
|
319
|
-
if (
|
|
146
|
+
}, ve = /* @__PURE__ */ R({
|
|
147
|
+
...de,
|
|
148
|
+
props: le,
|
|
149
|
+
emits: ue,
|
|
150
|
+
setup(n, { emit: m }) {
|
|
151
|
+
const e = n, f = useSlots(), {
|
|
152
|
+
disabled: r,
|
|
153
|
+
readonly: d,
|
|
154
|
+
valid: a,
|
|
155
|
+
invalid: b,
|
|
156
|
+
propsSwitch: v,
|
|
157
|
+
modelValue: t,
|
|
158
|
+
indeterminate: i,
|
|
159
|
+
isInGroup: o
|
|
160
|
+
} = se(e, m), g = computed(() => String(e.id || ee())), l = computed(() => s.value ? -1 : e.tabindex), u = ref(), p = computed(
|
|
161
|
+
() => e.uncheckedValue !== void 0 && !o.value
|
|
162
|
+
), s = computed(() => r.value || d.value), V = computed(() => {
|
|
163
|
+
if (b.value === !0)
|
|
320
164
|
return !0;
|
|
321
|
-
if (
|
|
165
|
+
if (a.value === !0)
|
|
322
166
|
return !1;
|
|
323
|
-
}),
|
|
324
|
-
if (!
|
|
325
|
-
return ["string", "number", "boolean"].includes(typeof
|
|
326
|
-
}),
|
|
167
|
+
}), k = computed(() => p.value ? t.value === e.value : Array.isArray(t.value) ? contains(e.value, t.value) : equals(e.value, t.value)), S = computed(() => !!(i.value || !k.value && p.value && e.uncheckedValue !== t.value)), G = computed(() => {
|
|
168
|
+
if (!p.value)
|
|
169
|
+
return ["string", "number", "boolean"].includes(typeof e.value) ? e.value : !0;
|
|
170
|
+
}), x = computed({
|
|
327
171
|
get() {
|
|
328
|
-
return
|
|
172
|
+
return k.value;
|
|
329
173
|
},
|
|
330
|
-
set(
|
|
331
|
-
if (
|
|
332
|
-
|
|
333
|
-
else if (Array.isArray(
|
|
334
|
-
const
|
|
335
|
-
Array.isArray(
|
|
174
|
+
set(y) {
|
|
175
|
+
if (p.value)
|
|
176
|
+
t.value = y ? e.value : e.uncheckedValue;
|
|
177
|
+
else if (Array.isArray(t.value) || o.value) {
|
|
178
|
+
const C = new Set(
|
|
179
|
+
Array.isArray(t.value) ? t.value : t.value !== void 0 ? [t.value] : []
|
|
336
180
|
);
|
|
337
|
-
|
|
181
|
+
y ? C.add(e.value) : C.delete(e.value), t.value = [...C];
|
|
338
182
|
} else
|
|
339
|
-
|
|
340
|
-
|
|
183
|
+
t.value = y ? e.value : void 0;
|
|
184
|
+
m("change", y);
|
|
341
185
|
}
|
|
342
|
-
}), { bemCssClasses:
|
|
343
|
-
switch:
|
|
344
|
-
valid:
|
|
345
|
-
invalid:
|
|
346
|
-
disabled:
|
|
347
|
-
readonly:
|
|
348
|
-
indeterminate:
|
|
186
|
+
}), { bemCssClasses: _ } = useBemModifiers("vv-checkbox", {
|
|
187
|
+
switch: v,
|
|
188
|
+
valid: a,
|
|
189
|
+
invalid: b,
|
|
190
|
+
disabled: r,
|
|
191
|
+
readonly: d,
|
|
192
|
+
indeterminate: i
|
|
349
193
|
});
|
|
350
|
-
|
|
351
|
-
|
|
194
|
+
watchEffect(() => {
|
|
195
|
+
p.value && Array.isArray(t.value) && console.warn(
|
|
352
196
|
"[VvCheckbox] The model value is an array but the component is in binary mode."
|
|
353
197
|
);
|
|
354
|
-
}),
|
|
355
|
-
() =>
|
|
356
|
-
(
|
|
357
|
-
|
|
198
|
+
}), watch(
|
|
199
|
+
() => S.value,
|
|
200
|
+
(y) => {
|
|
201
|
+
y ? u.value.indeterminate = !0 : u.value.indeterminate = !1;
|
|
358
202
|
}
|
|
359
|
-
),
|
|
360
|
-
|
|
203
|
+
), onMounted(() => {
|
|
204
|
+
S.value && (u.value.indeterminate = !0);
|
|
361
205
|
});
|
|
362
|
-
const { HintSlot:
|
|
363
|
-
return (
|
|
364
|
-
class:
|
|
365
|
-
for:
|
|
206
|
+
const { HintSlot: q } = $(e, f);
|
|
207
|
+
return (y, C) => (P(), B("label", {
|
|
208
|
+
class: N(c(_)),
|
|
209
|
+
for: c(g)
|
|
366
210
|
}, [
|
|
367
|
-
|
|
368
|
-
id:
|
|
211
|
+
U(O("input", {
|
|
212
|
+
id: c(g),
|
|
369
213
|
ref_key: "input",
|
|
370
|
-
ref:
|
|
371
|
-
"onUpdate:modelValue":
|
|
214
|
+
ref: u,
|
|
215
|
+
"onUpdate:modelValue": C[0] || (C[0] = (T) => z(x) ? x.value = T : null),
|
|
372
216
|
type: "checkbox",
|
|
373
217
|
class: "vv-checkbox__input",
|
|
374
|
-
name:
|
|
375
|
-
disabled:
|
|
376
|
-
value:
|
|
377
|
-
tabindex:
|
|
378
|
-
"aria-invalid":
|
|
379
|
-
}, null, 8,
|
|
380
|
-
[
|
|
218
|
+
name: y.name,
|
|
219
|
+
disabled: c(s),
|
|
220
|
+
value: c(G),
|
|
221
|
+
tabindex: c(l),
|
|
222
|
+
"aria-invalid": c(V)
|
|
223
|
+
}, null, 8, ce), [
|
|
224
|
+
[J, c(x)]
|
|
381
225
|
]),
|
|
382
|
-
|
|
383
|
-
|
|
226
|
+
H(y.$slots, "default", { value: c(t) }, () => [
|
|
227
|
+
Q(I(y.label), 1)
|
|
384
228
|
]),
|
|
385
|
-
|
|
229
|
+
w(c(q), {
|
|
386
230
|
class: "vv-checkbox__hint",
|
|
387
|
-
params: { value:
|
|
231
|
+
params: { value: c(t) }
|
|
388
232
|
}, null, 8, ["params"])
|
|
389
|
-
], 10,
|
|
233
|
+
], 10, ie));
|
|
390
234
|
}
|
|
391
|
-
}),
|
|
235
|
+
}), pe = re, me = ["update:modelValue", "change"], fe = ["textContent"], he = { class: "vv-checkbox-group__wrapper" }, ye = {
|
|
392
236
|
name: "VvCheckboxGroup"
|
|
393
|
-
},
|
|
394
|
-
...
|
|
395
|
-
props:
|
|
396
|
-
emits:
|
|
397
|
-
setup(
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
const { getOptionLabel:
|
|
408
|
-
disabled:
|
|
409
|
-
readonly:
|
|
410
|
-
horizontal:
|
|
411
|
-
valid:
|
|
412
|
-
invalid:
|
|
413
|
-
}),
|
|
414
|
-
id: `${
|
|
415
|
-
name:
|
|
416
|
-
label:
|
|
417
|
-
value:
|
|
418
|
-
}), { HintSlot:
|
|
419
|
-
return (
|
|
420
|
-
class:
|
|
237
|
+
}, ge = /* @__PURE__ */ R({
|
|
238
|
+
...ye,
|
|
239
|
+
props: pe,
|
|
240
|
+
emits: me,
|
|
241
|
+
setup(n, { emit: m }) {
|
|
242
|
+
const e = n, f = useSlots(), r = useVModel(e, "modelValue", m), { disabled: d, readonly: a, vertical: b, valid: v, invalid: t } = toRefs(e), i = {
|
|
243
|
+
key: E,
|
|
244
|
+
modelValue: r,
|
|
245
|
+
disabled: d,
|
|
246
|
+
readonly: a,
|
|
247
|
+
valid: v,
|
|
248
|
+
invalid: t
|
|
249
|
+
};
|
|
250
|
+
useProvideGroupState(i);
|
|
251
|
+
const { getOptionLabel: o, getOptionValue: g } = useOptions(e), { bemCssClasses: l } = useBemModifiers("vv-checkbox-group", {
|
|
252
|
+
disabled: d,
|
|
253
|
+
readonly: a,
|
|
254
|
+
horizontal: computed(() => !b.value),
|
|
255
|
+
valid: v,
|
|
256
|
+
invalid: t
|
|
257
|
+
}), u = (s, V) => ({
|
|
258
|
+
id: `${e.name}_opt${V}`,
|
|
259
|
+
name: e.name,
|
|
260
|
+
label: o(s),
|
|
261
|
+
value: g(s)
|
|
262
|
+
}), { HintSlot: p } = $(e, f);
|
|
263
|
+
return (s, V) => (P(), B("fieldset", {
|
|
264
|
+
class: N(c(l))
|
|
421
265
|
}, [
|
|
422
|
-
|
|
266
|
+
s.label ? (P(), B("legend", {
|
|
423
267
|
key: 0,
|
|
424
|
-
textContent:
|
|
425
|
-
}, null, 8,
|
|
426
|
-
|
|
427
|
-
|
|
268
|
+
textContent: I(s.label)
|
|
269
|
+
}, null, 8, fe)) : W("", !0),
|
|
270
|
+
O("div", he, [
|
|
271
|
+
s.options.length > 0 ? (P(!0), B(X, { key: 0 }, Y(s.options, (k, S) => (P(), Z(ve, L({ key: S }, u(k, S)), null, 16))), 128)) : H(s.$slots, "default", { key: 1 })
|
|
428
272
|
]),
|
|
429
|
-
|
|
273
|
+
w(c(p), { class: "vv-checkbox-group__hint" })
|
|
430
274
|
], 2));
|
|
431
275
|
}
|
|
432
276
|
});
|
|
433
277
|
export {
|
|
434
|
-
|
|
278
|
+
ge as default
|
|
435
279
|
};
|