@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,222 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nanoid as
|
|
3
|
-
|
|
4
|
-
function E(t, e, r) {
|
|
5
|
-
return r ? B(t, r) === B(e, r) : O(t, e);
|
|
6
|
-
}
|
|
7
|
-
function O(t, e) {
|
|
8
|
-
if (t === e)
|
|
9
|
-
return !0;
|
|
10
|
-
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
11
|
-
const r = Array.isArray(t), c = Array.isArray(e);
|
|
12
|
-
let n, a, u;
|
|
13
|
-
if (r && c) {
|
|
14
|
-
if (a = t.length, a != e.length)
|
|
15
|
-
return !1;
|
|
16
|
-
for (n = a; n-- !== 0; )
|
|
17
|
-
if (!O(t[n], e[n]))
|
|
18
|
-
return !1;
|
|
19
|
-
return !0;
|
|
20
|
-
}
|
|
21
|
-
if (r != c)
|
|
22
|
-
return !1;
|
|
23
|
-
const d = t instanceof Date, l = e instanceof Date;
|
|
24
|
-
if (d != l)
|
|
25
|
-
return !1;
|
|
26
|
-
if (d && l)
|
|
27
|
-
return t.getTime() == e.getTime();
|
|
28
|
-
const s = t instanceof RegExp, f = e instanceof RegExp;
|
|
29
|
-
if (s != f)
|
|
30
|
-
return !1;
|
|
31
|
-
if (s && f)
|
|
32
|
-
return t.toString() == e.toString();
|
|
33
|
-
const o = Object.keys(t);
|
|
34
|
-
if (a = o.length, a !== Object.keys(e).length)
|
|
35
|
-
return !1;
|
|
36
|
-
for (n = a; n-- !== 0; )
|
|
37
|
-
if (!Object.prototype.hasOwnProperty.call(e, o[n]))
|
|
38
|
-
return !1;
|
|
39
|
-
for (n = a; n-- !== 0; )
|
|
40
|
-
if (u = o[n], !O(t[u], e[u]))
|
|
41
|
-
return !1;
|
|
42
|
-
return !0;
|
|
43
|
-
}
|
|
44
|
-
return t !== t && e !== e;
|
|
45
|
-
}
|
|
46
|
-
function B(t, e) {
|
|
47
|
-
if (t && Object.keys(t).length && e) {
|
|
48
|
-
if (e.indexOf(".") === -1)
|
|
49
|
-
return t[e];
|
|
50
|
-
{
|
|
51
|
-
const r = e.split(".");
|
|
52
|
-
let c = t;
|
|
53
|
-
for (let n = 0, a = r.length; n < a; ++n) {
|
|
54
|
-
if (t == null)
|
|
55
|
-
return null;
|
|
56
|
-
c = c[r[n]];
|
|
57
|
-
}
|
|
58
|
-
return c;
|
|
59
|
-
}
|
|
60
|
-
} else
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
function ue(t, e) {
|
|
64
|
-
if (t != null && e && e.length) {
|
|
65
|
-
for (const r of e)
|
|
66
|
-
if (E(t, r))
|
|
67
|
-
return !0;
|
|
68
|
-
}
|
|
69
|
-
return !1;
|
|
70
|
-
}
|
|
71
|
-
function I(t) {
|
|
72
|
-
return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(v(t));
|
|
73
|
-
}
|
|
74
|
-
function se(t) {
|
|
75
|
-
return typeof t == "string" || t instanceof String;
|
|
76
|
-
}
|
|
77
|
-
function P(t) {
|
|
78
|
-
var e, r;
|
|
79
|
-
if (t)
|
|
80
|
-
return (r = (e = t.match(
|
|
81
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
82
|
-
)) == null ? void 0 : e.join("-")) == null ? void 0 : r.toLowerCase();
|
|
83
|
-
}
|
|
84
|
-
function ae(t, e) {
|
|
85
|
-
const r = { [`${t}`]: !0 };
|
|
86
|
-
return {
|
|
87
|
-
bemCssClasses: i(() => Object.keys(e).reduce((n, a) => {
|
|
88
|
-
const u = v(e[a]) || !1;
|
|
89
|
-
if (!u)
|
|
90
|
-
return n;
|
|
91
|
-
if (a === "modifiers") {
|
|
92
|
-
const d = Array.isArray(u) ? u : u.split(" ");
|
|
93
|
-
return {
|
|
94
|
-
...n,
|
|
95
|
-
...d.reduce(
|
|
96
|
-
(l, s) => ({
|
|
97
|
-
...l,
|
|
98
|
-
[`${t}--${P(s)}`]: !0
|
|
99
|
-
}),
|
|
100
|
-
{}
|
|
101
|
-
)
|
|
102
|
-
};
|
|
103
|
-
} else
|
|
104
|
-
return {
|
|
105
|
-
...n,
|
|
106
|
-
[`${t}--${P(a)}`]: u
|
|
107
|
-
};
|
|
108
|
-
}, r) || {})
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function oe(t) {
|
|
112
|
-
const e = D(t, void 0), r = i(() => !I(e));
|
|
113
|
-
function c(n, a, u) {
|
|
114
|
-
if (e != null && e.value) {
|
|
115
|
-
const l = v(e.value)[n];
|
|
116
|
-
return i({
|
|
117
|
-
get() {
|
|
118
|
-
return l == null ? void 0 : l.value;
|
|
119
|
-
},
|
|
120
|
-
set(s) {
|
|
121
|
-
l.value = s;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
const d = H(a, n);
|
|
126
|
-
return i({
|
|
127
|
-
get() {
|
|
128
|
-
return d.value;
|
|
129
|
-
},
|
|
130
|
-
set(l) {
|
|
131
|
-
u && u(`update:${n}`, l);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
group: e,
|
|
137
|
-
isInGroup: r,
|
|
138
|
-
getGroupOrLocalRef: c
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
const le = {
|
|
1
|
+
import { defineComponent as I, openBlock as N, createElementBlock as H, normalizeClass as w, unref as i, withDirectives as E, createElementVNode as G, isRef as D, vModelCheckbox as j, renderSlot as O, createTextVNode as M, toDisplayString as F, createVNode as T } from "vue";
|
|
2
|
+
import { nanoid as U } from "nanoid";
|
|
3
|
+
const q = {
|
|
142
4
|
valid: Boolean,
|
|
143
5
|
validLabel: [String, Array]
|
|
144
|
-
},
|
|
6
|
+
}, K = {
|
|
145
7
|
invalid: Boolean,
|
|
146
8
|
invalidLabel: [String, Array]
|
|
147
|
-
},
|
|
9
|
+
}, z = {
|
|
148
10
|
disabled: Boolean
|
|
149
|
-
},
|
|
11
|
+
}, $ = {
|
|
150
12
|
readonly: Boolean
|
|
151
|
-
},
|
|
13
|
+
}, J = {
|
|
152
14
|
hintLabel: { type: String, default: "" }
|
|
153
|
-
},
|
|
15
|
+
}, Q = {
|
|
154
16
|
tabindex: { type: [String, Number], default: 0 }
|
|
155
|
-
},
|
|
17
|
+
}, W = {
|
|
156
18
|
id: [String, Number],
|
|
157
19
|
name: { type: String, required: !0 }
|
|
158
|
-
},
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
...
|
|
162
|
-
...
|
|
163
|
-
...
|
|
164
|
-
...
|
|
165
|
-
|
|
20
|
+
}, X = {
|
|
21
|
+
...W,
|
|
22
|
+
...Q,
|
|
23
|
+
...q,
|
|
24
|
+
...K,
|
|
25
|
+
...J,
|
|
26
|
+
...z,
|
|
27
|
+
...$,
|
|
166
28
|
value: [String, Number, Boolean],
|
|
167
29
|
modelValue: [Object, Number, Boolean, String],
|
|
168
30
|
label: String
|
|
169
|
-
},
|
|
170
|
-
...
|
|
31
|
+
}, Y = "VV_CHECK_GROUP", Z = {
|
|
32
|
+
...X,
|
|
171
33
|
indeterminate: Boolean,
|
|
172
34
|
uncheckedValue: [String, Number, Boolean],
|
|
173
35
|
switch: Boolean
|
|
174
|
-
},
|
|
175
|
-
function
|
|
176
|
-
const { group:
|
|
36
|
+
}, L = ["click", "update:modelValue", "change", "blur"];
|
|
37
|
+
function ee(u, m) {
|
|
38
|
+
const { group: t, isInGroup: p, getGroupOrLocalRef: r } = useInjectedGroupState(Y), { switch: d, indeterminate: a } = toRefs(u), y = r("modelValue", u, m), f = r("readonly", u), e = r("disabled", u), s = r("valid", u), n = r("invalid", u);
|
|
177
39
|
return {
|
|
178
|
-
propsSwitch:
|
|
179
|
-
indeterminate:
|
|
180
|
-
group:
|
|
181
|
-
isInGroup:
|
|
182
|
-
modelValue:
|
|
183
|
-
readonly:
|
|
184
|
-
disabled:
|
|
185
|
-
valid:
|
|
186
|
-
invalid:
|
|
40
|
+
propsSwitch: d,
|
|
41
|
+
indeterminate: a,
|
|
42
|
+
group: t,
|
|
43
|
+
isInGroup: p,
|
|
44
|
+
modelValue: y,
|
|
45
|
+
readonly: f,
|
|
46
|
+
disabled: e,
|
|
47
|
+
valid: s,
|
|
48
|
+
invalid: n
|
|
187
49
|
};
|
|
188
50
|
}
|
|
189
|
-
function
|
|
190
|
-
return Array.isArray(
|
|
51
|
+
function A(u) {
|
|
52
|
+
return Array.isArray(u) ? u.filter((m) => isString(m)).join(" ") : u;
|
|
191
53
|
}
|
|
192
|
-
function
|
|
54
|
+
function te(u, m) {
|
|
193
55
|
const {
|
|
194
|
-
invalid:
|
|
195
|
-
valid:
|
|
196
|
-
hint:
|
|
197
|
-
loading:
|
|
198
|
-
} =
|
|
199
|
-
hintLabel:
|
|
200
|
-
modelValue:
|
|
201
|
-
valid:
|
|
202
|
-
validLabel:
|
|
203
|
-
invalid:
|
|
204
|
-
invalidLabel:
|
|
205
|
-
...
|
|
206
|
-
} =
|
|
207
|
-
() => !!(
|
|
208
|
-
), C =
|
|
209
|
-
() => !!(
|
|
210
|
-
),
|
|
211
|
-
() => !!(
|
|
212
|
-
),
|
|
213
|
-
() =>
|
|
56
|
+
invalid: t,
|
|
57
|
+
valid: p,
|
|
58
|
+
hint: r,
|
|
59
|
+
loading: d
|
|
60
|
+
} = m, {
|
|
61
|
+
hintLabel: a,
|
|
62
|
+
modelValue: y,
|
|
63
|
+
valid: f,
|
|
64
|
+
validLabel: e,
|
|
65
|
+
invalid: s,
|
|
66
|
+
invalidLabel: n,
|
|
67
|
+
...k
|
|
68
|
+
} = toRefs(u), o = resolveFieldData(k, "loading"), l = resolveFieldData(k, "loadingLabel"), v = computed(() => s.value ? !!(s.value && t || n != null && n.value && Array.isArray(n.value) && n.value.length > 0 || n != null && n.value && !isEmpty(n)) : !1), S = computed(
|
|
69
|
+
() => !!(a && a.value || r)
|
|
70
|
+
), C = computed(
|
|
71
|
+
() => !!(e && e.value || p)
|
|
72
|
+
), x = computed(
|
|
73
|
+
() => !!(o != null && o.value && d || o != null && o.value && (l != null && l.value))
|
|
74
|
+
), g = computed(
|
|
75
|
+
() => S.value || C.value || v.value || x.value
|
|
214
76
|
);
|
|
215
77
|
return {
|
|
216
|
-
hasInvalid:
|
|
217
|
-
hasHint:
|
|
78
|
+
hasInvalid: v,
|
|
79
|
+
hasHint: S,
|
|
218
80
|
hasValid: C,
|
|
219
|
-
hasLoading:
|
|
81
|
+
hasLoading: x,
|
|
220
82
|
HintSlot: {
|
|
221
83
|
name: "HintSlot",
|
|
222
84
|
props: {
|
|
@@ -225,31 +87,31 @@ function be(t, e) {
|
|
|
225
87
|
default: () => ({})
|
|
226
88
|
}
|
|
227
89
|
},
|
|
228
|
-
setup(
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
hintLabel:
|
|
232
|
-
modelValue:
|
|
233
|
-
valid:
|
|
234
|
-
validLabel:
|
|
235
|
-
invalid:
|
|
236
|
-
invalidLabel:
|
|
237
|
-
loading:
|
|
238
|
-
loadingLabel:
|
|
239
|
-
...
|
|
90
|
+
setup(P) {
|
|
91
|
+
const _ = computed(() => {
|
|
92
|
+
const b = toReactive({
|
|
93
|
+
hintLabel: a,
|
|
94
|
+
modelValue: y,
|
|
95
|
+
valid: f,
|
|
96
|
+
validLabel: e,
|
|
97
|
+
invalid: s,
|
|
98
|
+
invalidLabel: n,
|
|
99
|
+
loading: o,
|
|
100
|
+
loadingLabel: l,
|
|
101
|
+
...P.params
|
|
240
102
|
});
|
|
241
|
-
return
|
|
103
|
+
return s != null && s.value ? (t == null ? void 0 : t(b)) || A(n == null ? void 0 : n.value) || (a == null ? void 0 : a.value) : f != null && f.value ? (p == null ? void 0 : p(b)) || A(e == null ? void 0 : e.value) || (a == null ? void 0 : a.value) : o != null && o.value ? (d == null ? void 0 : d(b)) || A(l == null ? void 0 : l.value) || (a == null ? void 0 : a.value) : (r == null ? void 0 : r(b)) || A(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
|
|
242
104
|
});
|
|
243
105
|
return {
|
|
244
|
-
isVisible:
|
|
245
|
-
hasInvalid:
|
|
106
|
+
isVisible: g,
|
|
107
|
+
hasInvalid: v,
|
|
246
108
|
hasValid: C,
|
|
247
|
-
hintContent:
|
|
109
|
+
hintContent: _
|
|
248
110
|
};
|
|
249
111
|
},
|
|
250
112
|
render() {
|
|
251
113
|
if (this.isVisible)
|
|
252
|
-
return
|
|
114
|
+
return h(
|
|
253
115
|
"small",
|
|
254
116
|
{
|
|
255
117
|
role: this.hasInvalid || this.hasValid ? "alert" : void 0
|
|
@@ -260,98 +122,98 @@ function be(t, e) {
|
|
|
260
122
|
}
|
|
261
123
|
};
|
|
262
124
|
}
|
|
263
|
-
const
|
|
125
|
+
const ae = ["for"], ne = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], ue = {
|
|
264
126
|
name: "VvCheckbox"
|
|
265
|
-
},
|
|
266
|
-
...
|
|
267
|
-
props:
|
|
268
|
-
emits:
|
|
269
|
-
setup(
|
|
270
|
-
const
|
|
271
|
-
disabled:
|
|
272
|
-
readonly:
|
|
273
|
-
valid:
|
|
274
|
-
invalid:
|
|
275
|
-
propsSwitch:
|
|
276
|
-
modelValue:
|
|
277
|
-
indeterminate:
|
|
278
|
-
isInGroup:
|
|
279
|
-
} =
|
|
280
|
-
() =>
|
|
281
|
-
),
|
|
282
|
-
if (
|
|
127
|
+
}, le = /* @__PURE__ */ I({
|
|
128
|
+
...ue,
|
|
129
|
+
props: Z,
|
|
130
|
+
emits: L,
|
|
131
|
+
setup(u, { emit: m }) {
|
|
132
|
+
const t = u, p = useSlots(), {
|
|
133
|
+
disabled: r,
|
|
134
|
+
readonly: d,
|
|
135
|
+
valid: a,
|
|
136
|
+
invalid: y,
|
|
137
|
+
propsSwitch: f,
|
|
138
|
+
modelValue: e,
|
|
139
|
+
indeterminate: s,
|
|
140
|
+
isInGroup: n
|
|
141
|
+
} = ee(t, m), k = computed(() => String(t.id || U())), o = computed(() => S.value ? -1 : t.tabindex), l = ref(), v = computed(
|
|
142
|
+
() => t.uncheckedValue !== void 0 && !n.value
|
|
143
|
+
), S = computed(() => r.value || d.value), C = computed(() => {
|
|
144
|
+
if (y.value === !0)
|
|
283
145
|
return !0;
|
|
284
|
-
if (
|
|
146
|
+
if (a.value === !0)
|
|
285
147
|
return !1;
|
|
286
|
-
}),
|
|
287
|
-
if (!
|
|
288
|
-
return ["string", "number", "boolean"].includes(typeof
|
|
289
|
-
}),
|
|
148
|
+
}), x = computed(() => v.value ? e.value === t.value : Array.isArray(e.value) ? contains(t.value, e.value) : equals(t.value, e.value)), g = computed(() => !!(s.value || !x.value && v.value && t.uncheckedValue !== e.value)), P = computed(() => {
|
|
149
|
+
if (!v.value)
|
|
150
|
+
return ["string", "number", "boolean"].includes(typeof t.value) ? t.value : !0;
|
|
151
|
+
}), _ = computed({
|
|
290
152
|
get() {
|
|
291
|
-
return
|
|
153
|
+
return x.value;
|
|
292
154
|
},
|
|
293
|
-
set(
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
else if (Array.isArray(
|
|
297
|
-
const
|
|
298
|
-
Array.isArray(
|
|
155
|
+
set(c) {
|
|
156
|
+
if (v.value)
|
|
157
|
+
e.value = c ? t.value : t.uncheckedValue;
|
|
158
|
+
else if (Array.isArray(e.value) || n.value) {
|
|
159
|
+
const V = new Set(
|
|
160
|
+
Array.isArray(e.value) ? e.value : e.value !== void 0 ? [e.value] : []
|
|
299
161
|
);
|
|
300
|
-
|
|
162
|
+
c ? V.add(t.value) : V.delete(t.value), e.value = [...V];
|
|
301
163
|
} else
|
|
302
|
-
|
|
303
|
-
|
|
164
|
+
e.value = c ? t.value : void 0;
|
|
165
|
+
m("change", c);
|
|
304
166
|
}
|
|
305
|
-
}), { bemCssClasses:
|
|
306
|
-
switch:
|
|
307
|
-
valid:
|
|
308
|
-
invalid:
|
|
309
|
-
disabled:
|
|
310
|
-
readonly:
|
|
311
|
-
indeterminate:
|
|
167
|
+
}), { bemCssClasses: b } = useBemModifiers("vv-checkbox", {
|
|
168
|
+
switch: f,
|
|
169
|
+
valid: a,
|
|
170
|
+
invalid: y,
|
|
171
|
+
disabled: r,
|
|
172
|
+
readonly: d,
|
|
173
|
+
indeterminate: s
|
|
312
174
|
});
|
|
313
|
-
|
|
314
|
-
|
|
175
|
+
watchEffect(() => {
|
|
176
|
+
v.value && Array.isArray(e.value) && console.warn(
|
|
315
177
|
"[VvCheckbox] The model value is an array but the component is in binary mode."
|
|
316
178
|
);
|
|
317
|
-
}),
|
|
318
|
-
() =>
|
|
319
|
-
(
|
|
320
|
-
|
|
179
|
+
}), watch(
|
|
180
|
+
() => g.value,
|
|
181
|
+
(c) => {
|
|
182
|
+
c ? l.value.indeterminate = !0 : l.value.indeterminate = !1;
|
|
321
183
|
}
|
|
322
|
-
),
|
|
323
|
-
|
|
184
|
+
), onMounted(() => {
|
|
185
|
+
g.value && (l.value.indeterminate = !0);
|
|
324
186
|
});
|
|
325
|
-
const { HintSlot:
|
|
326
|
-
return (
|
|
327
|
-
class:
|
|
328
|
-
for:
|
|
187
|
+
const { HintSlot: B } = te(t, p);
|
|
188
|
+
return (c, V) => (N(), H("label", {
|
|
189
|
+
class: w(i(b)),
|
|
190
|
+
for: i(k)
|
|
329
191
|
}, [
|
|
330
|
-
|
|
331
|
-
id:
|
|
192
|
+
E(G("input", {
|
|
193
|
+
id: i(k),
|
|
332
194
|
ref_key: "input",
|
|
333
|
-
ref:
|
|
334
|
-
"onUpdate:modelValue":
|
|
195
|
+
ref: l,
|
|
196
|
+
"onUpdate:modelValue": V[0] || (V[0] = (R) => D(_) ? _.value = R : null),
|
|
335
197
|
type: "checkbox",
|
|
336
198
|
class: "vv-checkbox__input",
|
|
337
|
-
name:
|
|
338
|
-
disabled:
|
|
339
|
-
value:
|
|
340
|
-
tabindex:
|
|
341
|
-
"aria-invalid":
|
|
342
|
-
}, null, 8,
|
|
343
|
-
[
|
|
199
|
+
name: c.name,
|
|
200
|
+
disabled: i(S),
|
|
201
|
+
value: i(P),
|
|
202
|
+
tabindex: i(o),
|
|
203
|
+
"aria-invalid": i(C)
|
|
204
|
+
}, null, 8, ne), [
|
|
205
|
+
[j, i(_)]
|
|
344
206
|
]),
|
|
345
|
-
|
|
346
|
-
|
|
207
|
+
O(c.$slots, "default", { value: i(e) }, () => [
|
|
208
|
+
M(F(c.label), 1)
|
|
347
209
|
]),
|
|
348
|
-
|
|
210
|
+
T(i(B), {
|
|
349
211
|
class: "vv-checkbox__hint",
|
|
350
|
-
params: { value:
|
|
212
|
+
params: { value: i(e) }
|
|
351
213
|
}, null, 8, ["params"])
|
|
352
|
-
], 10,
|
|
214
|
+
], 10, ae));
|
|
353
215
|
}
|
|
354
216
|
});
|
|
355
217
|
export {
|
|
356
|
-
|
|
218
|
+
le as default
|
|
357
219
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,P){typeof exports=="object"&&typeof module<"u"?module.exports=P(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],P):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCheckbox=P(e.vue,e.nanoid))})(this,function(e,P){"use strict";const I={...{id:[String,Number],name:{type:String,required:!0}},...{tabindex:{type:[String,Number],default:0}},...{valid:Boolean,validLabel:[String,Array]},...{invalid:Boolean,invalidLabel:[String,Array]},...{hintLabel:{type:String,default:""}},...{disabled:Boolean},...{readonly:Boolean},value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String],label:String},R="VV_CHECK_GROUP",N={...I,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean},H=["click","update:modelValue","change","blur"];function w(o,f){const{group:n,isInGroup:p,getGroupOrLocalRef:u}=useInjectedGroupState(R),{switch:c,indeterminate:a}=toRefs(o),y=u("modelValue",o,f),m=u("readonly",o),t=u("disabled",o),i=u("valid",o),r=u("invalid",o);return{propsSwitch:c,indeterminate:a,group:n,isInGroup:p,modelValue:y,readonly:m,disabled:t,valid:i,invalid:r}}function A(o){return Array.isArray(o)?o.filter(f=>isString(f)).join(" "):o}function D(o,f){const{invalid:n,valid:p,hint:u,loading:c}=f,{hintLabel:a,modelValue:y,valid:m,validLabel:t,invalid:i,invalidLabel:r,...k}=toRefs(o),s=resolveFieldData(k,"loading"),l=resolveFieldData(k,"loadingLabel"),v=computed(()=>i.value?!!(i.value&&n||r!=null&&r.value&&Array.isArray(r.value)&&r.value.length>0||r!=null&&r.value&&!isEmpty(r)):!1),x=computed(()=>!!(a&&a.value||u)),S=computed(()=>!!(t&&t.value||p)),C=computed(()=>!!(s!=null&&s.value&&c||s!=null&&s.value&&(l!=null&&l.value))),g=computed(()=>x.value||S.value||v.value||C.value);return{hasInvalid:v,hasHint:x,hasValid:S,hasLoading:C,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(B){const _=computed(()=>{const b=toReactive({hintLabel:a,modelValue:y,valid:m,validLabel:t,invalid:i,invalidLabel:r,loading:s,loadingLabel:l,...B.params});return i!=null&&i.value?(n==null?void 0:n(b))||A(r==null?void 0:r.value)||(a==null?void 0:a.value):m!=null&&m.value?(p==null?void 0:p(b))||A(t==null?void 0:t.value)||(a==null?void 0:a.value):s!=null&&s.value?(c==null?void 0:c(b))||A(l==null?void 0:l.value)||(a==null?void 0:a.value):(u==null?void 0:u(b))||A(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:g,hasInvalid:v,hasValid:S,hintContent:_}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const E=["for"],G=["id","name","disabled","value","tabindex","aria-invalid"],j={name:"VvCheckbox"};return e.defineComponent({...j,props:N,emits:H,setup(o,{emit:f}){const n=o,p=useSlots(),{disabled:u,readonly:c,valid:a,invalid:y,propsSwitch:m,modelValue:t,indeterminate:i,isInGroup:r}=w(n,f),k=computed(()=>String(n.id||P.nanoid())),s=computed(()=>x.value?-1:n.tabindex),l=ref(),v=computed(()=>n.uncheckedValue!==void 0&&!r.value),x=computed(()=>u.value||c.value),S=computed(()=>{if(y.value===!0)return!0;if(a.value===!0)return!1}),C=computed(()=>v.value?t.value===n.value:Array.isArray(t.value)?contains(n.value,t.value):equals(n.value,t.value)),g=computed(()=>!!(i.value||!C.value&&v.value&&n.uncheckedValue!==t.value)),B=computed(()=>{if(!v.value)return["string","number","boolean"].includes(typeof n.value)?n.value:!0}),_=computed({get(){return C.value},set(d){if(v.value)t.value=d?n.value:n.uncheckedValue;else if(Array.isArray(t.value)||r.value){const V=new Set(Array.isArray(t.value)?t.value:t.value!==void 0?[t.value]:[]);d?V.add(n.value):V.delete(n.value),t.value=[...V]}else t.value=d?n.value:void 0;f("change",d)}}),{bemCssClasses:b}=useBemModifiers("vv-checkbox",{switch:m,valid:a,invalid:y,disabled:u,readonly:c,indeterminate:i});watchEffect(()=>{v.value&&Array.isArray(t.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")}),watch(()=>g.value,d=>{d?l.value.indeterminate=!0:l.value.indeterminate=!1}),onMounted(()=>{g.value&&(l.value.indeterminate=!0)});const{HintSlot:T}=D(n,p);return(d,V)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(b)),for:e.unref(k)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(k),ref_key:"input",ref:l,"onUpdate:modelValue":V[0]||(V[0]=O=>e.isRef(_)?_.value=O:null),type:"checkbox",class:"vv-checkbox__input",name:d.name,disabled:e.unref(x),value:e.unref(B),tabindex:e.unref(s),"aria-invalid":e.unref(S)},null,8,G),[[e.vModelCheckbox,e.unref(_)]]),e.renderSlot(d.$slots,"default",{value:e.unref(t)},()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),e.createVNode(e.unref(T),{class:"vv-checkbox__hint",params:{value:e.unref(t)}},null,8,["params"])],10,E))}})});
|
|
@@ -3,7 +3,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
3
3
|
uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
4
4
|
switch: BooleanConstructor;
|
|
5
5
|
value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
6
|
-
modelValue: (
|
|
6
|
+
modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
7
7
|
label: StringConstructor;
|
|
8
8
|
readonly: BooleanConstructor;
|
|
9
9
|
disabled: BooleanConstructor;
|
|
@@ -12,9 +12,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
default: string;
|
|
13
13
|
};
|
|
14
14
|
invalid: BooleanConstructor;
|
|
15
|
-
invalidLabel: (
|
|
15
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
16
16
|
valid: BooleanConstructor;
|
|
17
|
-
validLabel: (
|
|
17
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
18
18
|
tabindex: {
|
|
19
19
|
type: (StringConstructor | NumberConstructor)[];
|
|
20
20
|
default: number;
|
|
@@ -29,7 +29,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
29
29
|
uncheckedValue: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
30
30
|
switch: BooleanConstructor;
|
|
31
31
|
value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
32
|
-
modelValue: (
|
|
32
|
+
modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
33
33
|
label: StringConstructor;
|
|
34
34
|
readonly: BooleanConstructor;
|
|
35
35
|
disabled: BooleanConstructor;
|
|
@@ -38,9 +38,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
38
38
|
default: string;
|
|
39
39
|
};
|
|
40
40
|
invalid: BooleanConstructor;
|
|
41
|
-
invalidLabel: (
|
|
41
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
42
42
|
valid: BooleanConstructor;
|
|
43
|
-
validLabel: (
|
|
43
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
44
44
|
tabindex: {
|
|
45
45
|
type: (StringConstructor | NumberConstructor)[];
|
|
46
46
|
default: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ExtractPropTypes, Ref } from 'vue';
|
|
2
2
|
import type { IInputGroupState } from '@/composables/group/types/IInputGroup';
|
|
3
3
|
export declare const VvCheckboxProps: {
|
|
4
4
|
/**
|
|
@@ -14,18 +14,24 @@ export declare const VvCheckboxProps: {
|
|
|
14
14
|
*/
|
|
15
15
|
switch: BooleanConstructor;
|
|
16
16
|
value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
17
|
-
modelValue: (
|
|
17
|
+
modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
18
18
|
label: StringConstructor;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the input will be displayed as a switch
|
|
21
|
+
*/
|
|
19
22
|
readonly: BooleanConstructor;
|
|
20
23
|
disabled: BooleanConstructor;
|
|
21
24
|
hintLabel: {
|
|
25
|
+
/**
|
|
26
|
+
* Merges local and group props
|
|
27
|
+
*/
|
|
22
28
|
type: StringConstructor;
|
|
23
29
|
default: string;
|
|
24
30
|
};
|
|
25
31
|
invalid: BooleanConstructor;
|
|
26
|
-
invalidLabel: (
|
|
32
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
27
33
|
valid: BooleanConstructor;
|
|
28
|
-
validLabel: (
|
|
34
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
29
35
|
tabindex: {
|
|
30
36
|
type: (StringConstructor | NumberConstructor)[];
|
|
31
37
|
default: number;
|