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