@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
|
-
function
|
|
5
|
-
|
|
6
|
-
(e) => e !== "key" && !G(t[e])
|
|
7
|
-
))
|
|
8
|
-
throw Error("One or more groupState props aren't ref.");
|
|
9
|
-
W(
|
|
10
|
-
t.key,
|
|
11
|
-
c(() => t)
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
function ve(t) {
|
|
15
|
-
const { options: e, labelKey: r, valueKey: a } = B(t);
|
|
16
|
-
return {
|
|
17
|
-
options: e,
|
|
18
|
-
getOptionLabel: (n) => typeof n != "object" && n !== null ? n : typeof r.value == "function" ? r.value(n) : n[r.value],
|
|
19
|
-
getOptionValue: (n) => typeof n != "object" && n !== null ? n : typeof a.value == "function" ? a.value(n) : n[a.value]
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function F(t, e, r) {
|
|
23
|
-
return r ? R(t, r) === R(e, r) : j(t, e);
|
|
24
|
-
}
|
|
25
|
-
function j(t, e) {
|
|
26
|
-
if (t === e)
|
|
27
|
-
return !0;
|
|
28
|
-
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
29
|
-
const r = Array.isArray(t), a = Array.isArray(e);
|
|
30
|
-
let o, s, n;
|
|
31
|
-
if (r && a) {
|
|
32
|
-
if (s = t.length, s != e.length)
|
|
33
|
-
return !1;
|
|
34
|
-
for (o = s; o-- !== 0; )
|
|
35
|
-
if (!j(t[o], e[o]))
|
|
36
|
-
return !1;
|
|
37
|
-
return !0;
|
|
38
|
-
}
|
|
39
|
-
if (r != a)
|
|
40
|
-
return !1;
|
|
41
|
-
const d = t instanceof Date, l = e instanceof Date;
|
|
42
|
-
if (d != l)
|
|
43
|
-
return !1;
|
|
44
|
-
if (d && l)
|
|
45
|
-
return t.getTime() == e.getTime();
|
|
46
|
-
const u = t instanceof RegExp, y = e instanceof RegExp;
|
|
47
|
-
if (u != y)
|
|
48
|
-
return !1;
|
|
49
|
-
if (u && y)
|
|
50
|
-
return t.toString() == e.toString();
|
|
51
|
-
const i = Object.keys(t);
|
|
52
|
-
if (s = i.length, s !== Object.keys(e).length)
|
|
53
|
-
return !1;
|
|
54
|
-
for (o = s; o-- !== 0; )
|
|
55
|
-
if (!Object.prototype.hasOwnProperty.call(e, i[o]))
|
|
56
|
-
return !1;
|
|
57
|
-
for (o = s; o-- !== 0; )
|
|
58
|
-
if (n = i[o], !j(t[n], e[n]))
|
|
59
|
-
return !1;
|
|
60
|
-
return !0;
|
|
61
|
-
}
|
|
62
|
-
return t !== t && e !== e;
|
|
63
|
-
}
|
|
64
|
-
function R(t, e) {
|
|
65
|
-
if (t && Object.keys(t).length && e) {
|
|
66
|
-
if (e.indexOf(".") === -1)
|
|
67
|
-
return t[e];
|
|
68
|
-
{
|
|
69
|
-
const r = e.split(".");
|
|
70
|
-
let a = t;
|
|
71
|
-
for (let o = 0, s = r.length; o < s; ++o) {
|
|
72
|
-
if (t == null)
|
|
73
|
-
return null;
|
|
74
|
-
a = a[r[o]];
|
|
75
|
-
}
|
|
76
|
-
return a;
|
|
77
|
-
}
|
|
78
|
-
} else
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
function pe(t, e) {
|
|
82
|
-
if (t != null && e && e.length) {
|
|
83
|
-
for (const r of e)
|
|
84
|
-
if (F(t, r))
|
|
85
|
-
return !0;
|
|
86
|
-
}
|
|
87
|
-
return !1;
|
|
88
|
-
}
|
|
89
|
-
function M(t) {
|
|
90
|
-
return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(f(t));
|
|
91
|
-
}
|
|
92
|
-
function ye(t) {
|
|
93
|
-
return typeof t == "string" || t instanceof String;
|
|
94
|
-
}
|
|
95
|
-
function $(t) {
|
|
96
|
-
var e, r;
|
|
97
|
-
if (t)
|
|
98
|
-
return (r = (e = t.match(
|
|
99
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
100
|
-
)) == null ? void 0 : e.join("-")) == null ? void 0 : r.toLowerCase();
|
|
101
|
-
}
|
|
102
|
-
function q(t, e) {
|
|
103
|
-
const r = { [`${t}`]: !0 };
|
|
104
|
-
return {
|
|
105
|
-
bemCssClasses: c(() => Object.keys(e).reduce((o, s) => {
|
|
106
|
-
const n = f(e[s]) || !1;
|
|
107
|
-
if (!n)
|
|
108
|
-
return o;
|
|
109
|
-
if (s === "modifiers") {
|
|
110
|
-
const d = Array.isArray(n) ? n : n.split(" ");
|
|
111
|
-
return {
|
|
112
|
-
...o,
|
|
113
|
-
...d.reduce(
|
|
114
|
-
(l, u) => ({
|
|
115
|
-
...l,
|
|
116
|
-
[`${t}--${$(u)}`]: !0
|
|
117
|
-
}),
|
|
118
|
-
{}
|
|
119
|
-
)
|
|
120
|
-
};
|
|
121
|
-
} else
|
|
122
|
-
return {
|
|
123
|
-
...o,
|
|
124
|
-
[`${t}--${$(s)}`]: n
|
|
125
|
-
};
|
|
126
|
-
}, r) || {})
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
const z = "VV_RADIO_GROUP";
|
|
130
|
-
function k(t) {
|
|
131
|
-
return Array.isArray(t) ? t.filter((e) => ye(e)).join(" ") : t;
|
|
1
|
+
import { defineComponent as B, openBlock as S, createElementBlock as A, normalizeClass as O, unref as u, withDirectives as q, createElementVNode as G, isRef as U, vModelRadio as w, renderSlot as I, createTextVNode as z, toDisplayString as N, createVNode as D, createCommentVNode as K, Fragment as T, renderList as J, createBlock as Q, mergeProps as W } from "vue";
|
|
2
|
+
import { nanoid as X } from "nanoid";
|
|
3
|
+
const $ = "VV_RADIO_GROUP";
|
|
4
|
+
function C(a) {
|
|
5
|
+
return Array.isArray(a) ? a.filter((v) => isString(v)).join(" ") : a;
|
|
132
6
|
}
|
|
133
|
-
function
|
|
7
|
+
function H(a, v) {
|
|
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: t,
|
|
10
|
+
valid: p,
|
|
11
|
+
hint: n,
|
|
12
|
+
loading: i
|
|
13
|
+
} = v, {
|
|
14
|
+
hintLabel: e,
|
|
15
|
+
modelValue: y,
|
|
16
|
+
valid: d,
|
|
17
|
+
validLabel: r,
|
|
18
|
+
invalid: m,
|
|
19
|
+
invalidLabel: o,
|
|
20
|
+
..._
|
|
21
|
+
} = toRefs(a), l = resolveFieldData(_, "loading"), c = resolveFieldData(_, "loadingLabel"), V = computed(() => m.value ? !!(m.value && t || o != null && o.value && Array.isArray(o.value) && o.value.length > 0 || o != null && o.value && !isEmpty(o)) : !1), s = computed(
|
|
22
|
+
() => !!(e && e.value || n)
|
|
23
|
+
), g = computed(
|
|
24
|
+
() => !!(r && r.value || p)
|
|
25
|
+
), b = computed(
|
|
26
|
+
() => !!(l != null && l.value && i || l != null && l.value && (c != null && c.value))
|
|
27
|
+
), f = computed(
|
|
28
|
+
() => s.value || g.value || V.value || b.value
|
|
155
29
|
);
|
|
156
30
|
return {
|
|
157
|
-
hasInvalid:
|
|
158
|
-
hasHint:
|
|
159
|
-
hasValid:
|
|
160
|
-
hasLoading:
|
|
31
|
+
hasInvalid: V,
|
|
32
|
+
hasHint: s,
|
|
33
|
+
hasValid: g,
|
|
34
|
+
hasLoading: b,
|
|
161
35
|
HintSlot: {
|
|
162
36
|
name: "HintSlot",
|
|
163
37
|
props: {
|
|
@@ -166,31 +40,31 @@ function K(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(P) {
|
|
44
|
+
const k = computed(() => {
|
|
45
|
+
const R = toReactive({
|
|
46
|
+
hintLabel: e,
|
|
47
|
+
modelValue: y,
|
|
48
|
+
valid: d,
|
|
49
|
+
validLabel: r,
|
|
50
|
+
invalid: m,
|
|
51
|
+
invalidLabel: o,
|
|
52
|
+
loading: l,
|
|
53
|
+
loadingLabel: c,
|
|
54
|
+
...P.params
|
|
181
55
|
});
|
|
182
|
-
return
|
|
56
|
+
return m != null && m.value ? (t == null ? void 0 : t(R)) || C(o == null ? void 0 : o.value) || (e == null ? void 0 : e.value) : d != null && d.value ? (p == null ? void 0 : p(R)) || C(r == null ? void 0 : r.value) || (e == null ? void 0 : e.value) : l != null && l.value ? (i == null ? void 0 : i(R)) || C(c == null ? void 0 : c.value) || (e == null ? void 0 : e.value) : (n == null ? void 0 : n(R)) || C(e == null ? void 0 : e.value) || (e == null ? void 0 : e.value);
|
|
183
57
|
});
|
|
184
58
|
return {
|
|
185
|
-
isVisible:
|
|
186
|
-
hasInvalid:
|
|
187
|
-
hasValid:
|
|
188
|
-
hintContent:
|
|
59
|
+
isVisible: f,
|
|
60
|
+
hasInvalid: V,
|
|
61
|
+
hasValid: g,
|
|
62
|
+
hintContent: k
|
|
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,198 +75,167 @@ function K(t, e) {
|
|
|
201
75
|
}
|
|
202
76
|
};
|
|
203
77
|
}
|
|
204
|
-
const
|
|
78
|
+
const F = {
|
|
205
79
|
valid: Boolean,
|
|
206
80
|
validLabel: [String, Array]
|
|
207
|
-
},
|
|
81
|
+
}, j = {
|
|
208
82
|
invalid: Boolean,
|
|
209
83
|
invalidLabel: [String, Array]
|
|
210
|
-
},
|
|
84
|
+
}, x = {
|
|
211
85
|
disabled: Boolean
|
|
212
|
-
},
|
|
86
|
+
}, E = {
|
|
213
87
|
readonly: Boolean
|
|
214
|
-
},
|
|
88
|
+
}, M = {
|
|
215
89
|
hintLabel: { type: String, default: "" }
|
|
216
|
-
},
|
|
90
|
+
}, Y = {
|
|
217
91
|
options: {
|
|
218
92
|
type: Array,
|
|
219
93
|
default: () => []
|
|
220
94
|
},
|
|
221
95
|
labelKey: { type: [String, Function], default: "label" },
|
|
222
96
|
valueKey: { type: [String, Function], default: "value" }
|
|
223
|
-
},
|
|
97
|
+
}, Z = {
|
|
224
98
|
tabindex: { type: [String, Number], default: 0 }
|
|
225
|
-
},
|
|
99
|
+
}, L = {
|
|
226
100
|
id: [String, Number],
|
|
227
101
|
name: { type: String, required: !0 }
|
|
228
|
-
},
|
|
229
|
-
...
|
|
230
|
-
...ge,
|
|
231
|
-
...T,
|
|
102
|
+
}, ee = {
|
|
103
|
+
...L,
|
|
232
104
|
...Z,
|
|
233
|
-
...
|
|
234
|
-
...
|
|
235
|
-
...
|
|
105
|
+
...F,
|
|
106
|
+
...j,
|
|
107
|
+
...M,
|
|
108
|
+
...x,
|
|
109
|
+
...E,
|
|
236
110
|
value: [String, Number, Boolean],
|
|
237
111
|
modelValue: [Object, Number, Boolean, String],
|
|
238
112
|
label: String
|
|
239
|
-
},
|
|
240
|
-
...
|
|
241
|
-
...
|
|
242
|
-
...
|
|
243
|
-
...
|
|
244
|
-
...
|
|
245
|
-
...
|
|
113
|
+
}, te = {
|
|
114
|
+
...F,
|
|
115
|
+
...j,
|
|
116
|
+
...Y,
|
|
117
|
+
...M,
|
|
118
|
+
...x,
|
|
119
|
+
...E,
|
|
246
120
|
modelValue: [String, Array],
|
|
247
121
|
label: String,
|
|
248
122
|
name: { type: String, required: !0 },
|
|
249
123
|
vertical: Boolean
|
|
250
|
-
};
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
function a(o, s, n) {
|
|
254
|
-
if (e != null && e.value) {
|
|
255
|
-
const l = f(e.value)[o];
|
|
256
|
-
return c({
|
|
257
|
-
get() {
|
|
258
|
-
return l == null ? void 0 : l.value;
|
|
259
|
-
},
|
|
260
|
-
set(u) {
|
|
261
|
-
l.value = u;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
const d = L(s, o);
|
|
266
|
-
return c({
|
|
267
|
-
get() {
|
|
268
|
-
return d.value;
|
|
269
|
-
},
|
|
270
|
-
set(l) {
|
|
271
|
-
n && n(`update:${o}`, l);
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return {
|
|
276
|
-
group: e,
|
|
277
|
-
isInGroup: r,
|
|
278
|
-
getGroupOrLocalRef: a
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
const Ae = Ve, Oe = ["click", "update:modelValue", "change", "blur"];
|
|
282
|
-
function Se(t, e) {
|
|
283
|
-
const { group: r, isInGroup: a, getGroupOrLocalRef: o } = _e(z), s = o("modelValue", t, e), n = o("readonly", t), d = o("disabled", t), l = o("valid", t), u = o("invalid", t);
|
|
124
|
+
}, oe = ee, ae = ["click", "update:modelValue", "change", "blur"];
|
|
125
|
+
function ne(a, v) {
|
|
126
|
+
const { group: t, isInGroup: p, getGroupOrLocalRef: n } = useInjectedGroupState($), i = n("modelValue", a, v), e = n("readonly", a), y = n("disabled", a), d = n("valid", a), r = n("invalid", a);
|
|
284
127
|
return {
|
|
285
|
-
group:
|
|
286
|
-
isInGroup:
|
|
287
|
-
modelValue:
|
|
288
|
-
readonly:
|
|
289
|
-
disabled:
|
|
290
|
-
valid:
|
|
291
|
-
invalid:
|
|
128
|
+
group: t,
|
|
129
|
+
isInGroup: p,
|
|
130
|
+
modelValue: i,
|
|
131
|
+
readonly: e,
|
|
132
|
+
disabled: y,
|
|
133
|
+
valid: d,
|
|
134
|
+
invalid: r
|
|
292
135
|
};
|
|
293
136
|
}
|
|
294
|
-
const
|
|
137
|
+
const se = ["for"], re = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"], le = {
|
|
295
138
|
name: "VvRadio"
|
|
296
|
-
},
|
|
297
|
-
...
|
|
298
|
-
props:
|
|
299
|
-
emits:
|
|
300
|
-
setup(
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
),
|
|
305
|
-
if (l.value === !0)
|
|
306
|
-
return !0;
|
|
139
|
+
}, ue = /* @__PURE__ */ B({
|
|
140
|
+
...le,
|
|
141
|
+
props: oe,
|
|
142
|
+
emits: ae,
|
|
143
|
+
setup(a, { emit: v }) {
|
|
144
|
+
const t = a, p = useSlots(), { disabled: n, readonly: i, modelValue: e, valid: y, invalid: d } = ne(
|
|
145
|
+
t,
|
|
146
|
+
v
|
|
147
|
+
), r = computed(() => String(t.id || X())), m = computed(() => _.value ? -1 : t.tabindex), o = ref(), _ = computed(() => n.value || i.value), l = computed(() => {
|
|
307
148
|
if (d.value === !0)
|
|
149
|
+
return !0;
|
|
150
|
+
if (y.value === !0)
|
|
308
151
|
return !1;
|
|
309
|
-
}),
|
|
310
|
-
() => Array.isArray(
|
|
311
|
-
),
|
|
312
|
-
() => ["string", "number", "boolean"].includes(typeof
|
|
313
|
-
),
|
|
152
|
+
}), c = computed(
|
|
153
|
+
() => Array.isArray(e.value) ? contains(t.value, e.value) : equals(t.value, e.value)
|
|
154
|
+
), V = computed(
|
|
155
|
+
() => ["string", "number", "boolean"].includes(typeof t.value) ? t.value : !0
|
|
156
|
+
), s = computed({
|
|
314
157
|
get() {
|
|
315
|
-
return
|
|
158
|
+
return c.value ? V.value : null;
|
|
316
159
|
},
|
|
317
|
-
set(
|
|
318
|
-
Array.isArray(
|
|
160
|
+
set(f) {
|
|
161
|
+
Array.isArray(e.value) ? e.value = [t.value] : e.value = t.value, v("change", f);
|
|
319
162
|
}
|
|
320
|
-
}), { bemCssClasses:
|
|
321
|
-
valid:
|
|
322
|
-
invalid:
|
|
323
|
-
disabled:
|
|
324
|
-
readonly:
|
|
325
|
-
}), { HintSlot:
|
|
326
|
-
return (
|
|
327
|
-
class:
|
|
328
|
-
for:
|
|
163
|
+
}), { bemCssClasses: g } = useBemModifiers("vv-radio", {
|
|
164
|
+
valid: y,
|
|
165
|
+
invalid: d,
|
|
166
|
+
disabled: n,
|
|
167
|
+
readonly: i
|
|
168
|
+
}), { HintSlot: b } = H(t, p);
|
|
169
|
+
return (f, P) => (S(), A("label", {
|
|
170
|
+
class: O(u(g)),
|
|
171
|
+
for: u(r)
|
|
329
172
|
}, [
|
|
330
|
-
|
|
331
|
-
id:
|
|
173
|
+
q(G("input", {
|
|
174
|
+
id: u(r),
|
|
332
175
|
ref_key: "input",
|
|
333
|
-
ref:
|
|
334
|
-
"onUpdate:modelValue":
|
|
176
|
+
ref: o,
|
|
177
|
+
"onUpdate:modelValue": P[0] || (P[0] = (k) => U(s) ? s.value = k : null),
|
|
335
178
|
type: "radio",
|
|
336
179
|
class: "vv-radio__input",
|
|
337
|
-
name:
|
|
338
|
-
disabled:
|
|
339
|
-
value:
|
|
340
|
-
tabindex:
|
|
341
|
-
"aria-invalid":
|
|
342
|
-
}, null, 8,
|
|
343
|
-
[
|
|
180
|
+
name: f.name,
|
|
181
|
+
disabled: u(_),
|
|
182
|
+
value: u(V),
|
|
183
|
+
tabindex: u(m),
|
|
184
|
+
"aria-invalid": u(l)
|
|
185
|
+
}, null, 8, re), [
|
|
186
|
+
[w, u(s)]
|
|
344
187
|
]),
|
|
345
|
-
|
|
346
|
-
|
|
188
|
+
I(f.$slots, "default", { value: u(e) }, () => [
|
|
189
|
+
z(N(f.label), 1)
|
|
347
190
|
]),
|
|
348
|
-
|
|
191
|
+
D(u(b), {
|
|
349
192
|
class: "vv-radio__hint",
|
|
350
|
-
params: { value:
|
|
193
|
+
params: { value: u(e) }
|
|
351
194
|
}, null, 8, ["params"])
|
|
352
|
-
], 10,
|
|
195
|
+
], 10, se));
|
|
353
196
|
}
|
|
354
|
-
}),
|
|
197
|
+
}), ie = te, de = ["update:modelValue", "change"], ce = ["textContent"], ve = { class: "vv-radio-group__wrapper" }, pe = {
|
|
355
198
|
name: "VvRadioGroup"
|
|
356
|
-
},
|
|
357
|
-
...
|
|
358
|
-
props:
|
|
359
|
-
emits:
|
|
360
|
-
setup(
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const { getOptionLabel:
|
|
371
|
-
disabled:
|
|
372
|
-
readonly:
|
|
373
|
-
horizontal:
|
|
374
|
-
valid:
|
|
375
|
-
invalid:
|
|
376
|
-
}),
|
|
377
|
-
id: `${
|
|
378
|
-
name:
|
|
379
|
-
label:
|
|
380
|
-
value:
|
|
381
|
-
}), { HintSlot:
|
|
382
|
-
return (
|
|
383
|
-
class:
|
|
199
|
+
}, ye = /* @__PURE__ */ B({
|
|
200
|
+
...pe,
|
|
201
|
+
props: ie,
|
|
202
|
+
emits: de,
|
|
203
|
+
setup(a, { emit: v }) {
|
|
204
|
+
const t = a, p = useSlots(), n = useVModel(t, "modelValue", v), { disabled: i, readonly: e, vertical: y, valid: d, invalid: r } = toRefs(t), m = {
|
|
205
|
+
key: $,
|
|
206
|
+
modelValue: n,
|
|
207
|
+
disabled: i,
|
|
208
|
+
readonly: e,
|
|
209
|
+
valid: d,
|
|
210
|
+
invalid: r
|
|
211
|
+
};
|
|
212
|
+
useProvideGroupState(m);
|
|
213
|
+
const { getOptionLabel: o, getOptionValue: _ } = useOptions(t), { bemCssClasses: l } = useBemModifiers("vv-radio-group", {
|
|
214
|
+
disabled: i,
|
|
215
|
+
readonly: e,
|
|
216
|
+
horizontal: computed(() => !y.value),
|
|
217
|
+
valid: d,
|
|
218
|
+
invalid: r
|
|
219
|
+
}), c = (s, g) => ({
|
|
220
|
+
id: `${t.name}_opt${g}`,
|
|
221
|
+
name: t.name,
|
|
222
|
+
label: o(s),
|
|
223
|
+
value: _(s)
|
|
224
|
+
}), { HintSlot: V } = H(t, p);
|
|
225
|
+
return (s, g) => (S(), A("fieldset", {
|
|
226
|
+
class: O(u(l))
|
|
384
227
|
}, [
|
|
385
|
-
|
|
228
|
+
s.label ? (S(), A("legend", {
|
|
386
229
|
key: 0,
|
|
387
|
-
textContent: N(
|
|
388
|
-
}, null, 8,
|
|
389
|
-
|
|
390
|
-
|
|
230
|
+
textContent: N(s.label)
|
|
231
|
+
}, null, 8, ce)) : K("", !0),
|
|
232
|
+
G("div", ve, [
|
|
233
|
+
s.options.length > 0 ? (S(!0), A(T, { key: 0 }, J(s.options, (b, f) => (S(), Q(ue, W({ key: f }, c(b, f)), null, 16))), 128)) : I(s.$slots, "default", { key: 1 })
|
|
391
234
|
]),
|
|
392
|
-
|
|
235
|
+
D(u(V), { class: "vv-radio-group__hint" })
|
|
393
236
|
], 2));
|
|
394
237
|
}
|
|
395
238
|
});
|
|
396
239
|
export {
|
|
397
|
-
|
|
240
|
+
ye as default
|
|
398
241
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],S):(e=typeof globalThis<"u"?globalThis:e||self,e.VvRadioGroup=S(e.vue,e.nanoid))})(this,function(e,S){"use strict";const C="VV_RADIO_GROUP";function P(a){return Array.isArray(a)?a.filter(p=>isString(p)).join(" "):a}function A(a,p){const{invalid:o,valid:m,hint:r,loading:u}=p,{hintLabel:t,modelValue:y,valid:d,validLabel:l,invalid:f,invalidLabel:n,..._}=toRefs(a),i=resolveFieldData(_,"loading"),c=resolveFieldData(_,"loadingLabel"),V=computed(()=>f.value?!!(f.value&&o||n!=null&&n.value&&Array.isArray(n.value)&&n.value.length>0||n!=null&&n.value&&!isEmpty(n)):!1),s=computed(()=>!!(t&&t.value||r)),g=computed(()=>!!(l&&l.value||m)),b=computed(()=>!!(i!=null&&i.value&&u||i!=null&&i.value&&(c!=null&&c.value))),v=computed(()=>s.value||g.value||V.value||b.value);return{hasInvalid:V,hasHint:s,hasValid:g,hasLoading:b,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(k){const B=computed(()=>{const R=toReactive({hintLabel:t,modelValue:y,valid:d,validLabel:l,invalid:f,invalidLabel:n,loading:i,loadingLabel:c,...k.params});return f!=null&&f.value?(o==null?void 0:o(R))||P(n==null?void 0:n.value)||(t==null?void 0:t.value):d!=null&&d.value?(m==null?void 0:m(R))||P(l==null?void 0:l.value)||(t==null?void 0:t.value):i!=null&&i.value?(u==null?void 0:u(R))||P(c==null?void 0:c.value)||(t==null?void 0:t.value):(r==null?void 0:r(R))||P(t==null?void 0:t.value)||(t==null?void 0:t.value)});return{isVisible:v,hasInvalid:V,hasValid:g,hintContent:B}},render(){if(this.isVisible)return h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}const G={valid:Boolean,validLabel:[String,Array]},N={invalid:Boolean,invalidLabel:[String,Array]},O={disabled:Boolean},I={readonly:Boolean},D={hintLabel:{type:String,default:""}},E={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},$={...{id:[String,Number],name:{type:String,required:!0}},...{tabindex:{type:[String,Number],default:0}},...G,...N,...D,...O,...I,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String],label:String},x={...G,...N,...E,...D,...O,...I,modelValue:[String,Array],label:String,name:{type:String,required:!0},vertical:Boolean},H=$,j=["click","update:modelValue","change","blur"];function F(a,p){const{group:o,isInGroup:m,getGroupOrLocalRef:r}=useInjectedGroupState(C),u=r("modelValue",a,p),t=r("readonly",a),y=r("disabled",a),d=r("valid",a),l=r("invalid",a);return{group:o,isInGroup:m,modelValue:u,readonly:t,disabled:y,valid:d,invalid:l}}const q=["for"],M=["id","name","disabled","value","tabindex","aria-invalid"],T={name:"VvRadio"},z=e.defineComponent({...T,props:H,emits:j,setup(a,{emit:p}){const o=a,m=useSlots(),{disabled:r,readonly:u,modelValue:t,valid:y,invalid:d}=F(o,p),l=computed(()=>String(o.id||S.nanoid())),f=computed(()=>_.value?-1:o.tabindex),n=ref(),_=computed(()=>r.value||u.value),i=computed(()=>{if(d.value===!0)return!0;if(y.value===!0)return!1}),c=computed(()=>Array.isArray(t.value)?contains(o.value,t.value):equals(o.value,t.value)),V=computed(()=>["string","number","boolean"].includes(typeof o.value)?o.value:!0),s=computed({get(){return c.value?V.value:null},set(v){Array.isArray(t.value)?t.value=[o.value]:t.value=o.value,p("change",v)}}),{bemCssClasses:g}=useBemModifiers("vv-radio",{valid:y,invalid:d,disabled:r,readonly:u}),{HintSlot:b}=A(o,m);return(v,k)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(g)),for:e.unref(l)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(l),ref_key:"input",ref:n,"onUpdate:modelValue":k[0]||(k[0]=B=>e.isRef(s)?s.value=B:null),type:"radio",class:"vv-radio__input",name:v.name,disabled:e.unref(_),value:e.unref(V),tabindex:e.unref(f),"aria-invalid":e.unref(i)},null,8,M),[[e.vModelRadio,e.unref(s)]]),e.renderSlot(v.$slots,"default",{value:e.unref(t)},()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),e.createVNode(e.unref(b),{class:"vv-radio__hint",params:{value:e.unref(t)}},null,8,["params"])],10,q))}}),U=x,w=["update:modelValue","change"],K=["textContent"],J={class:"vv-radio-group__wrapper"},Q={name:"VvRadioGroup"};return e.defineComponent({...Q,props:U,emits:w,setup(a,{emit:p}){const o=a,m=useSlots(),r=useVModel(o,"modelValue",p),{disabled:u,readonly:t,vertical:y,valid:d,invalid:l}=toRefs(o),f={key:C,modelValue:r,disabled:u,readonly:t,valid:d,invalid:l};useProvideGroupState(f);const{getOptionLabel:n,getOptionValue:_}=useOptions(o),{bemCssClasses:i}=useBemModifiers("vv-radio-group",{disabled:u,readonly:t,horizontal:computed(()=>!y.value),valid:d,invalid:l}),c=(s,g)=>({id:`${o.name}_opt${g}`,name:o.name,label:n(s),value:_(s)}),{HintSlot:V}=A(o,m);return(s,g)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(i))},[s.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(s.label)},null,8,K)):e.createCommentVNode("",!0),e.createElementVNode("div",J,[s.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.options,(b,v)=>(e.openBlock(),e.createBlock(z,e.mergeProps({key:v},c(b,v)),null,16))),128)):e.renderSlot(s.$slots,"default",{key:1})]),e.createVNode(e.unref(V),{class:"vv-radio-group__hint"})],2))}})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Option } from '@/types/generic';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
-
modelValue: (
|
|
3
|
+
modelValue: (StringConstructor | ArrayConstructor)[];
|
|
4
4
|
label: StringConstructor;
|
|
5
5
|
name: {
|
|
6
6
|
type: StringConstructor;
|
|
@@ -26,11 +26,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
26
26
|
default: string;
|
|
27
27
|
};
|
|
28
28
|
invalid: BooleanConstructor;
|
|
29
|
-
invalidLabel: (
|
|
29
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
30
30
|
valid: BooleanConstructor;
|
|
31
|
-
validLabel: (
|
|
31
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
32
32
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
-
modelValue: (
|
|
33
|
+
modelValue: (StringConstructor | ArrayConstructor)[];
|
|
34
34
|
label: StringConstructor;
|
|
35
35
|
name: {
|
|
36
36
|
type: StringConstructor;
|
|
@@ -56,9 +56,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
56
56
|
default: string;
|
|
57
57
|
};
|
|
58
58
|
invalid: BooleanConstructor;
|
|
59
|
-
invalidLabel: (
|
|
59
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
60
60
|
valid: BooleanConstructor;
|
|
61
|
-
validLabel: (
|
|
61
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
62
62
|
}>> & {
|
|
63
63
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
64
64
|
}, {
|
|
@@ -67,10 +67,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
67
67
|
hintLabel: string;
|
|
68
68
|
invalid: boolean;
|
|
69
69
|
valid: boolean;
|
|
70
|
+
vertical: boolean;
|
|
70
71
|
options: (string | Option)[];
|
|
71
72
|
labelKey: string | Function;
|
|
72
73
|
valueKey: string | Function;
|
|
73
|
-
vertical: boolean;
|
|
74
74
|
}>, {
|
|
75
75
|
default: (_: {}) => any;
|
|
76
76
|
}>;
|