@volverjs/ui-vue 0.0.1-beta.6 → 0.0.1-beta.8
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/README.md +61 -2
- package/dist/components/VvButton/vv-button.es.js +56 -58
- package/dist/components/VvButton/vv-button.umd.js +1 -1
- package/dist/components/VvCheckGroup/vv-check-group.es.js +221 -203
- package/dist/components/VvCheckGroup/vv-check-group.umd.js +2 -2
- package/dist/components/VvInputText/VvInputText.d.ts +14 -0
- package/dist/components/VvInputText/VvInputText.vue.d.ts +36 -1
- package/dist/components/VvInputText/VvInputTextActions.d.ts +3 -0
- package/dist/components/VvInputText/vv-input-text.es.js +509 -380
- package/dist/components/VvInputText/vv-input-text.umd.js +2 -2
- package/dist/components/VvNativeSelect/vv-native-select.es.js +180 -161
- package/dist/components/VvNativeSelect/vv-native-select.umd.js +2 -2
- package/dist/components/VvRadioGroup/vv-radio-group.es.js +211 -193
- package/dist/components/VvRadioGroup/vv-radio-group.umd.js +2 -2
- package/dist/components/VvSelect/vv-select.es.js +189 -171
- package/dist/components/VvSelect/vv-select.umd.js +2 -2
- package/dist/components/VvTextarea/VvTextarea.d.ts +43 -22
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +140 -85
- package/dist/components/VvTextarea/vv-textarea.es.js +364 -288
- package/dist/components/VvTextarea/vv-textarea.umd.js +2 -2
- package/dist/composables/debouncedInput/useDebouncedInput.d.ts +2 -0
- package/dist/composables/icons/useComponentIcons.d.ts +6 -0
- package/dist/composables/textLimit/useTextLimit.d.ts +14 -0
- package/dist/composables/useModifiers.d.ts +3 -2
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +42 -0
- package/dist/stories/utils.d.ts +5 -0
- package/dist/ui-vue.es.js +417 -401
- package/dist/ui-vue.umd.js +2 -2
- package/package.json +3 -1
- 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/VvButton/VvButton.vue +1 -2
- package/src/components/VvInputText/VvInputText.ts +19 -2
- package/src/components/VvInputText/VvInputText.vue +123 -149
- package/src/components/VvInputText/VvInputTextActions.ts +151 -0
- package/src/components/VvTextarea/VvTextarea.ts +25 -16
- package/src/components/VvTextarea/VvTextarea.vue +89 -93
- package/src/components/common/HintSlot.ts +31 -13
- package/src/composables/debouncedInput/useDebouncedInput.ts +19 -0
- package/src/composables/icons/useComponentIcons.ts +35 -0
- package/src/composables/textLimit/useTextLimit.ts +44 -0
- package/src/composables/useModifiers.ts +47 -1
- package/src/props/index.ts +39 -0
- package/src/stories/InputText/InputTextMaxLength.stories.mdx +21 -0
- package/src/stories/Textarea/Textarea.stories.mdx +33 -51
- package/src/stories/Textarea/TextareaAutoclear.stories.mdx +23 -0
- package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +10 -2
- package/src/stories/Textarea/TextareaAutofocus.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaDebounce.stories.mdx +23 -0
- package/src/stories/Textarea/TextareaDisabled.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaError.stories.mdx +6 -3
- package/src/stories/Textarea/TextareaErrorLabel.stories.mdx +37 -0
- package/src/stories/Textarea/TextareaFloating.stories.mdx +7 -2
- package/src/stories/Textarea/TextareaHintLabel.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaIcon.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaIconPosition.stories.mdx +9 -1
- package/src/stories/Textarea/TextareaId.stories.mdx +19 -0
- package/src/stories/Textarea/TextareaLabel.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaLimit.stories.mdx +50 -0
- package/src/stories/Textarea/TextareaLoading.stories.mdx +6 -3
- package/src/stories/Textarea/TextareaLoadingLabel.stories.mdx +23 -0
- package/src/stories/Textarea/TextareaMaxLength.stories.mdx +6 -2
- package/src/stories/Textarea/TextareaMinLength.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaModifiers.stories.mdx +24 -0
- package/src/stories/Textarea/TextareaName.stories.mdx +23 -0
- package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaReadonly.stories.mdx +5 -1
- package/src/stories/Textarea/TextareaRequired.stories.mdx +22 -0
- package/src/stories/Textarea/TextareaResizable.stories.mdx +22 -0
- package/src/stories/Textarea/TextareaRowsCols.stories.mdx +9 -1
- package/src/stories/Textarea/TextareaValid.stories.mdx +7 -4
- package/src/stories/Textarea/TextareaValidLabel.stories.mdx +35 -0
- package/src/stories/stories.scss +11 -0
- package/src/stories/utils.ts +12 -0
- package/src/stories/volver-ui-vue.stories.mdx +7 -1
- package/dist/components/VvInputText/useInputNumber.d.ts +0 -16
- package/dist/components/VvInputText/useInputPassword.d.ts +0 -16
- package/src/components/VvInputText/useInputNumber.ts +0 -40
- package/src/components/VvInputText/useInputPassword.ts +0 -38
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { isRef as
|
|
2
|
-
import { useFocus as
|
|
3
|
-
const
|
|
1
|
+
import { isRef as z, provide as Z, computed as f, toRefs as j, unref as O, inject as M, toRef as T, watch as U, defineComponent as F, useAttrs as W, ref as J, openBlock as V, createElementBlock as E, mergeProps as S, createElementVNode as P, renderSlot as D, createTextVNode as K, toDisplayString as G, h as Q, useSlots as X, normalizeClass as Y, createCommentVNode as L, Fragment as ee, renderList as te, createBlock as re, createVNode as ne } from "vue";
|
|
2
|
+
import { useFocus as se, toReactive as oe, useVModel as ue } from "@vueuse/core";
|
|
3
|
+
const $ = {
|
|
4
4
|
valid: Boolean,
|
|
5
5
|
validLabel: [String, Array]
|
|
6
|
-
},
|
|
6
|
+
}, q = {
|
|
7
7
|
error: Boolean,
|
|
8
8
|
errorLabel: [String, Array]
|
|
9
|
-
},
|
|
9
|
+
}, ae = {
|
|
10
10
|
hintLabel: { type: String, default: "" }
|
|
11
|
-
},
|
|
11
|
+
}, le = {
|
|
12
12
|
options: { type: Array, default: () => [] },
|
|
13
13
|
optionLabel: { type: [String, Function], default: () => "label" },
|
|
14
14
|
optionValue: { type: [String, Function], default: () => "value" }
|
|
15
|
-
},
|
|
16
|
-
...G,
|
|
15
|
+
}, ie = ["update:modelValue"], ce = {
|
|
17
16
|
...$,
|
|
18
|
-
...
|
|
19
|
-
...
|
|
17
|
+
...q,
|
|
18
|
+
...le,
|
|
19
|
+
...ae,
|
|
20
20
|
modelValue: null,
|
|
21
21
|
label: { type: String, default: "" },
|
|
22
22
|
name: { type: String, default: "", required: !0 },
|
|
@@ -24,62 +24,62 @@ const G = {
|
|
|
24
24
|
readonly: { type: Boolean, default: !1 },
|
|
25
25
|
vertical: { type: Boolean, default: !1 }
|
|
26
26
|
};
|
|
27
|
-
function
|
|
27
|
+
function fe(e) {
|
|
28
28
|
if (Object.keys(e).some(
|
|
29
|
-
(t) => t !== "key" && !
|
|
29
|
+
(t) => t !== "key" && !z(e[t])
|
|
30
30
|
))
|
|
31
31
|
throw Error("One or more groupState props aren't ref.");
|
|
32
|
-
console.log("PRovide - ", e),
|
|
32
|
+
console.log("PRovide - ", e), Z(
|
|
33
33
|
e.key,
|
|
34
34
|
f(() => e)
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const { options: t, optionLabel:
|
|
37
|
+
function de(e) {
|
|
38
|
+
const { options: t, optionLabel: r, optionValue: s } = j(e);
|
|
39
39
|
return {
|
|
40
40
|
options: t,
|
|
41
|
-
getOptionLabel: (o) => typeof o != "object" && o !== null ? o : typeof
|
|
41
|
+
getOptionLabel: (o) => typeof o != "object" && o !== null ? o : typeof r.value == "function" ? r.value(o) : o[r.value],
|
|
42
42
|
getOptionValue: (o) => typeof o != "object" && o !== null ? o : typeof s.value == "function" ? s.value(o) : o[s.value]
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
equals(e, t,
|
|
47
|
-
return
|
|
45
|
+
const h = {
|
|
46
|
+
equals(e, t, r) {
|
|
47
|
+
return r ? this.resolveFieldData(e, r) === this.resolveFieldData(t, r) : this.deepEquals(e, t);
|
|
48
48
|
},
|
|
49
49
|
deepEquals(e, t) {
|
|
50
50
|
if (e === t)
|
|
51
51
|
return !0;
|
|
52
52
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
if (
|
|
53
|
+
const r = Array.isArray(e), s = Array.isArray(t);
|
|
54
|
+
let n, a, o;
|
|
55
|
+
if (r && s) {
|
|
56
|
+
if (a = e.length, a != t.length)
|
|
57
57
|
return !1;
|
|
58
|
-
for (
|
|
59
|
-
if (!this.deepEquals(e[
|
|
58
|
+
for (n = a; n-- !== 0; )
|
|
59
|
+
if (!this.deepEquals(e[n], t[n]))
|
|
60
60
|
return !1;
|
|
61
61
|
return !0;
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
63
|
+
if (r != s)
|
|
64
64
|
return !1;
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
65
|
+
const l = e instanceof Date, u = t instanceof Date;
|
|
66
|
+
if (l != u)
|
|
67
67
|
return !1;
|
|
68
|
-
if (
|
|
68
|
+
if (l && u)
|
|
69
69
|
return e.getTime() == t.getTime();
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const p = e instanceof RegExp, y = t instanceof RegExp;
|
|
71
|
+
if (p != y)
|
|
72
72
|
return !1;
|
|
73
|
-
if (
|
|
73
|
+
if (p && y)
|
|
74
74
|
return e.toString() == t.toString();
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
75
|
+
const c = Object.keys(e);
|
|
76
|
+
if (a = c.length, a !== Object.keys(t).length)
|
|
77
77
|
return !1;
|
|
78
|
-
for (
|
|
79
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
78
|
+
for (n = a; n-- !== 0; )
|
|
79
|
+
if (!Object.prototype.hasOwnProperty.call(t, c[n]))
|
|
80
80
|
return !1;
|
|
81
|
-
for (
|
|
82
|
-
if (o =
|
|
81
|
+
for (n = a; n-- !== 0; )
|
|
82
|
+
if (o = c[n], !this.deepEquals(e[o], t[o]))
|
|
83
83
|
return !1;
|
|
84
84
|
return !0;
|
|
85
85
|
}
|
|
@@ -90,12 +90,12 @@ const g = {
|
|
|
90
90
|
if (t.indexOf(".") === -1)
|
|
91
91
|
return e[t];
|
|
92
92
|
{
|
|
93
|
-
const
|
|
93
|
+
const r = t.split(".");
|
|
94
94
|
let s = e;
|
|
95
|
-
for (let
|
|
95
|
+
for (let n = 0, a = r.length; n < a; ++n) {
|
|
96
96
|
if (e == null)
|
|
97
97
|
return null;
|
|
98
|
-
s = s[n
|
|
98
|
+
s = s[r[n]];
|
|
99
99
|
}
|
|
100
100
|
return s;
|
|
101
101
|
}
|
|
@@ -106,20 +106,20 @@ const g = {
|
|
|
106
106
|
return !!(e && e.constructor && e.call && e.apply);
|
|
107
107
|
},
|
|
108
108
|
findIndexInList(e, t) {
|
|
109
|
-
let
|
|
109
|
+
let r = -1;
|
|
110
110
|
if (t) {
|
|
111
111
|
for (let s = 0; s < t.length; s++)
|
|
112
112
|
if (this.equals(t[s], e)) {
|
|
113
|
-
|
|
113
|
+
r = s;
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return r;
|
|
118
118
|
},
|
|
119
119
|
contains(e, t) {
|
|
120
120
|
if (e != null && t && t.length) {
|
|
121
|
-
for (const
|
|
122
|
-
if (this.equals(e,
|
|
121
|
+
for (const r of t)
|
|
122
|
+
if (this.equals(e, r))
|
|
123
123
|
return !0;
|
|
124
124
|
}
|
|
125
125
|
return !1;
|
|
@@ -132,52 +132,52 @@ const g = {
|
|
|
132
132
|
},
|
|
133
133
|
pickBy(e, t) {
|
|
134
134
|
return Object.fromEntries(
|
|
135
|
-
Object.entries(e).filter(([
|
|
135
|
+
Object.entries(e).filter(([r]) => t(r))
|
|
136
136
|
);
|
|
137
137
|
},
|
|
138
138
|
removeFromList(e, t) {
|
|
139
|
-
const
|
|
140
|
-
return
|
|
139
|
+
const r = this.findIndexInList(e, t);
|
|
140
|
+
return r > -1 ? t.filter((s, n) => n !== r) : t;
|
|
141
141
|
},
|
|
142
142
|
isString(e) {
|
|
143
143
|
return typeof e == "string" || e instanceof String;
|
|
144
144
|
},
|
|
145
145
|
propsToObject(e) {
|
|
146
|
-
return Object.keys(e).reduce((t,
|
|
147
|
-
var s,
|
|
148
|
-
return this.isFunction(e[
|
|
146
|
+
return Object.keys(e).reduce((t, r) => {
|
|
147
|
+
var s, n, a, o, l;
|
|
148
|
+
return this.isFunction(e[r]) ? t[r] = e[r]() : Array.isArray(e[r]) ? t[r] = e[r][0]() : (s = e[r]) != null && s.type && (Array.isArray(e[r].type) ? t[r] = ((n = e[r]) == null ? void 0 : n.default) || ((a = e[r]) == null ? void 0 : a.type[0]()) : t[r] = ((o = e[r]) == null ? void 0 : o.default) || ((l = e[r]) == null ? void 0 : l.type())), t;
|
|
149
149
|
}, {});
|
|
150
150
|
},
|
|
151
|
-
filterArray(e, t,
|
|
152
|
-
return e.filter((s) => t.some((
|
|
153
|
-
s[
|
|
154
|
-
r
|
|
151
|
+
filterArray(e, t, r) {
|
|
152
|
+
return e.filter((s) => t.some((n) => typeof n == "string" ? s[r] == n : this.equals(
|
|
153
|
+
s[r],
|
|
154
|
+
n[r]
|
|
155
155
|
)));
|
|
156
156
|
},
|
|
157
157
|
kebabCase(e) {
|
|
158
|
-
var t,
|
|
158
|
+
var t, r;
|
|
159
159
|
if (e)
|
|
160
|
-
return (
|
|
160
|
+
return (r = (t = e.match(
|
|
161
161
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
162
|
-
)) == null ? void 0 : t.join("-")) == null ? void 0 :
|
|
162
|
+
)) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
|
-
function
|
|
166
|
-
const
|
|
165
|
+
function I(e, t) {
|
|
166
|
+
const r = { [`${e}`]: !0 };
|
|
167
167
|
return {
|
|
168
|
-
bemCssClasses: f(() => Object.keys(t).reduce((
|
|
169
|
-
const o =
|
|
168
|
+
bemCssClasses: f(() => Object.keys(t).reduce((n, a) => {
|
|
169
|
+
const o = O(t[a]) || !1;
|
|
170
170
|
if (!o)
|
|
171
|
-
return
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
171
|
+
return n;
|
|
172
|
+
if (a === "modifiers") {
|
|
173
|
+
const l = Array.isArray(o) ? o : [o];
|
|
174
174
|
return {
|
|
175
|
-
...
|
|
176
|
-
...
|
|
177
|
-
(
|
|
178
|
-
...
|
|
179
|
-
[`${e}--${
|
|
180
|
-
|
|
175
|
+
...n,
|
|
176
|
+
...l.reduce(
|
|
177
|
+
(u, p) => ({
|
|
178
|
+
...u,
|
|
179
|
+
[`${e}--${h.kebabCase(
|
|
180
|
+
p
|
|
181
181
|
)}`]: !0
|
|
182
182
|
}),
|
|
183
183
|
{}
|
|
@@ -185,236 +185,254 @@ function S(e, t) {
|
|
|
185
185
|
};
|
|
186
186
|
} else
|
|
187
187
|
return {
|
|
188
|
-
...
|
|
189
|
-
[`${e}--${
|
|
188
|
+
...n,
|
|
189
|
+
[`${e}--${h.kebabCase(a)}`]: o
|
|
190
190
|
};
|
|
191
|
-
},
|
|
191
|
+
}, r) || {})
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
const
|
|
195
|
-
...G,
|
|
194
|
+
const w = Symbol("VV_RADIO_GROUP"), pe = {
|
|
196
195
|
...$,
|
|
196
|
+
...q,
|
|
197
197
|
value: null,
|
|
198
198
|
modelValue: { type: [Object, Number, Boolean, String] },
|
|
199
199
|
label: { type: String, default: "" },
|
|
200
200
|
disabled: Boolean,
|
|
201
201
|
readonly: Boolean
|
|
202
|
-
},
|
|
202
|
+
}, ye = [
|
|
203
203
|
"click",
|
|
204
204
|
"update:modelValue",
|
|
205
205
|
"change",
|
|
206
206
|
"focus",
|
|
207
207
|
"blur"
|
|
208
208
|
];
|
|
209
|
-
function
|
|
210
|
-
const t =
|
|
209
|
+
function ve(e) {
|
|
210
|
+
const t = M(e, void 0);
|
|
211
211
|
console.log("Inject - ", t);
|
|
212
|
-
const
|
|
213
|
-
function s(
|
|
212
|
+
const r = f(() => h.isNotEmpty(t));
|
|
213
|
+
function s(n, a, o) {
|
|
214
214
|
if (t != null && t.value) {
|
|
215
|
-
const
|
|
215
|
+
const l = O(t.value)[n];
|
|
216
216
|
return f({
|
|
217
217
|
get() {
|
|
218
|
-
return
|
|
218
|
+
return l == null ? void 0 : l.value;
|
|
219
219
|
},
|
|
220
|
-
set(
|
|
221
|
-
|
|
220
|
+
set(u) {
|
|
221
|
+
l.value = u;
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
} else {
|
|
225
|
-
const
|
|
225
|
+
const l = T(a, n);
|
|
226
226
|
return f({
|
|
227
227
|
get() {
|
|
228
|
-
return
|
|
228
|
+
return l.value;
|
|
229
229
|
},
|
|
230
|
-
set(
|
|
231
|
-
o && o(`update:${
|
|
230
|
+
set(u) {
|
|
231
|
+
o && o(`update:${n}`, u);
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
return {
|
|
237
237
|
group: t,
|
|
238
|
-
isInGroup:
|
|
238
|
+
isInGroup: r,
|
|
239
239
|
getGroupOrLocalRef: s
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const { group:
|
|
242
|
+
function me(e, t) {
|
|
243
|
+
const { group: r, isInGroup: s, getGroupOrLocalRef: n } = ve(w), { valid: a, error: o } = j(e), l = n("modelValue", e, t), u = n("readonly", e), p = n("disabled", e);
|
|
244
244
|
return {
|
|
245
|
-
group:
|
|
245
|
+
group: r,
|
|
246
246
|
isInGroup: s,
|
|
247
|
-
valid:
|
|
247
|
+
valid: a,
|
|
248
248
|
error: o,
|
|
249
|
-
modelValue:
|
|
250
|
-
readonly:
|
|
251
|
-
disabled:
|
|
249
|
+
modelValue: l,
|
|
250
|
+
readonly: u,
|
|
251
|
+
disabled: p
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const { focused:
|
|
256
|
-
return U(
|
|
254
|
+
function ge(e, t) {
|
|
255
|
+
const { focused: r } = se(e);
|
|
256
|
+
return U(r, (s) => {
|
|
257
257
|
t(s ? "focus" : "blur", e.value);
|
|
258
258
|
}), {
|
|
259
|
-
focused:
|
|
259
|
+
focused: r
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
const
|
|
262
|
+
const he = {
|
|
263
263
|
inheritAttrs: !1
|
|
264
|
-
},
|
|
265
|
-
...
|
|
264
|
+
}, Ae = /* @__PURE__ */ F({
|
|
265
|
+
...he,
|
|
266
266
|
__name: "VvRadio",
|
|
267
|
-
props:
|
|
268
|
-
emits:
|
|
267
|
+
props: pe,
|
|
268
|
+
emits: ye,
|
|
269
269
|
setup(e, { emit: t }) {
|
|
270
|
-
const
|
|
271
|
-
|
|
270
|
+
const r = e, s = W(), { disabled: n, readonly: a, modelValue: o, valid: l, error: u } = me(
|
|
271
|
+
r,
|
|
272
272
|
t
|
|
273
|
-
),
|
|
274
|
-
valid:
|
|
275
|
-
invalid:
|
|
276
|
-
}), { bemCssClasses:
|
|
273
|
+
), p = J(), y = f(() => Array.isArray(o.value) ? h.contains(r.value, o.value) : h.equals(r.value, o.value)), { focused: c } = ge(p, t), { bemCssClasses: A } = I("vv-input-radio", {
|
|
274
|
+
valid: l,
|
|
275
|
+
invalid: u
|
|
276
|
+
}), { bemCssClasses: i } = I(
|
|
277
277
|
"vv-input-radio__input",
|
|
278
278
|
{
|
|
279
|
-
checked:
|
|
280
|
-
disabled:
|
|
281
|
-
readonly:
|
|
279
|
+
checked: y,
|
|
280
|
+
disabled: n,
|
|
281
|
+
readonly: a
|
|
282
282
|
}
|
|
283
|
-
),
|
|
283
|
+
), d = f(() => {
|
|
284
284
|
const { class: m } = s;
|
|
285
285
|
return {
|
|
286
286
|
class: m,
|
|
287
|
-
...
|
|
287
|
+
...A.value
|
|
288
288
|
};
|
|
289
|
-
}),
|
|
290
|
-
"focus-visible":
|
|
291
|
-
...
|
|
289
|
+
}), g = f(() => ({
|
|
290
|
+
"focus-visible": c.value,
|
|
291
|
+
...i.value
|
|
292
292
|
})), v = f(() => {
|
|
293
|
-
const { id: m, name: k, style:
|
|
293
|
+
const { id: m, name: k, style: B } = s, N = h.pickBy(
|
|
294
294
|
s,
|
|
295
|
-
(
|
|
295
|
+
(x) => x.startsWith("data-")
|
|
296
296
|
);
|
|
297
297
|
return {
|
|
298
298
|
for: m || k,
|
|
299
|
-
style:
|
|
299
|
+
style: B,
|
|
300
300
|
...N
|
|
301
301
|
};
|
|
302
|
-
}),
|
|
302
|
+
}), b = f(() => {
|
|
303
303
|
const { id: m = "", name: k = "" } = s;
|
|
304
304
|
return {
|
|
305
305
|
type: "radio",
|
|
306
306
|
id: m || k,
|
|
307
307
|
name: k,
|
|
308
|
-
value:
|
|
309
|
-
disabled:
|
|
310
|
-
readonly:
|
|
311
|
-
checked:
|
|
312
|
-
...
|
|
308
|
+
value: r.value,
|
|
309
|
+
disabled: n.value,
|
|
310
|
+
readonly: a.value,
|
|
311
|
+
checked: y.value,
|
|
312
|
+
..._.value
|
|
313
313
|
};
|
|
314
|
-
}),
|
|
315
|
-
const { name: m } = s, k =
|
|
314
|
+
}), _ = f(() => {
|
|
315
|
+
const { name: m } = s, k = h.pickBy(
|
|
316
316
|
s,
|
|
317
|
-
(
|
|
317
|
+
(B) => B.startsWith("aria-")
|
|
318
318
|
);
|
|
319
319
|
return {
|
|
320
320
|
"aria-label": m,
|
|
321
|
-
"aria-checked":
|
|
321
|
+
"aria-checked": y.value,
|
|
322
322
|
...k
|
|
323
323
|
};
|
|
324
324
|
});
|
|
325
|
-
function
|
|
326
|
-
|
|
325
|
+
function C() {
|
|
326
|
+
y.value || t("change", r.value), o.value = r.value;
|
|
327
327
|
}
|
|
328
328
|
function H(m) {
|
|
329
|
-
|
|
329
|
+
n.value || (t("click", m), c.value = !0);
|
|
330
330
|
}
|
|
331
|
-
return (m, k) => (
|
|
332
|
-
|
|
331
|
+
return (m, k) => (V(), E("label", S({ class: O(d) }, O(v), { onClick: H }), [
|
|
332
|
+
P("input", S({
|
|
333
333
|
ref_key: "input",
|
|
334
|
-
ref:
|
|
335
|
-
class:
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
|
|
334
|
+
ref: p,
|
|
335
|
+
class: O(g)
|
|
336
|
+
}, O(b), { onInput: C }), null, 16),
|
|
337
|
+
D(m.$slots, "default", { value: O(o) }, () => [
|
|
338
|
+
K(G(m.label), 1)
|
|
339
339
|
])
|
|
340
340
|
], 16));
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
|
-
function
|
|
344
|
-
return Array.isArray(e) ? e.filter((t) =>
|
|
345
|
-
` +
|
|
343
|
+
function R(e) {
|
|
344
|
+
return Array.isArray(e) ? e.filter((t) => h.isString(t)).reduce((t, r) => t.length > 0 ? t + `
|
|
345
|
+
` + r : r, "") : e;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ce(e, t) {
|
|
348
348
|
return {
|
|
349
349
|
name: "HintSlot",
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
350
|
+
props: {
|
|
351
|
+
params: { type: Object, default: () => {
|
|
352
|
+
} }
|
|
353
|
+
},
|
|
354
|
+
setup(r) {
|
|
355
|
+
const s = j(e), {
|
|
356
|
+
error: n,
|
|
357
|
+
valid: a,
|
|
358
|
+
hint: o,
|
|
359
|
+
loading: l
|
|
356
360
|
} = t, {
|
|
357
361
|
hintLabel: u,
|
|
358
|
-
modelValue:
|
|
359
|
-
valid:
|
|
360
|
-
validLabel:
|
|
361
|
-
error:
|
|
362
|
-
errorLabel:
|
|
363
|
-
} =
|
|
364
|
-
|
|
362
|
+
modelValue: p,
|
|
363
|
+
valid: y,
|
|
364
|
+
validLabel: c,
|
|
365
|
+
error: A,
|
|
366
|
+
errorLabel: i
|
|
367
|
+
} = s, d = h.resolveFieldData(s, "loading"), g = h.resolveFieldData(
|
|
368
|
+
s,
|
|
365
369
|
"loadingLabel"
|
|
366
|
-
),
|
|
367
|
-
const
|
|
368
|
-
|
|
370
|
+
), v = f(() => A.value ? !!(A.value && n || (i == null ? void 0 : i.value) && Array.isArray(i.value) && i.value.length > 0 || (i == null ? void 0 : i.value) && h.isNotEmpty(i.value)) : !1), b = f(() => !!(u && u.value || o || a || c && c.value || v.value || (d == null ? void 0 : d.value) && l || (d == null ? void 0 : d.value) && (g == null ? void 0 : g.value))), _ = f(() => {
|
|
371
|
+
const C = oe({
|
|
372
|
+
hintLabel: u,
|
|
373
|
+
modelValue: p,
|
|
374
|
+
valid: y,
|
|
375
|
+
validLabel: c,
|
|
376
|
+
error: A,
|
|
377
|
+
errorLabel: i,
|
|
378
|
+
loading: d,
|
|
379
|
+
loadingLabel: g,
|
|
380
|
+
...r.params
|
|
381
|
+
});
|
|
382
|
+
return A != null && A.value ? (n == null ? void 0 : n(C)) || R(i == null ? void 0 : i.value) || (u == null ? void 0 : u.value) : y != null && y.value ? (a == null ? void 0 : a(C)) || R(c == null ? void 0 : c.value) || (u == null ? void 0 : u.value) : d != null && d.value ? (l == null ? void 0 : l(C)) || R(g == null ? void 0 : g.value) || (u == null ? void 0 : u.value) : (o == null ? void 0 : o(C)) || R(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
|
|
369
383
|
});
|
|
370
384
|
return {
|
|
371
|
-
hasHint:
|
|
372
|
-
hintContent:
|
|
385
|
+
hasHint: b,
|
|
386
|
+
hintContent: _
|
|
373
387
|
};
|
|
374
388
|
},
|
|
375
389
|
render() {
|
|
376
390
|
if (this.hasHint)
|
|
377
|
-
return
|
|
391
|
+
return Q(
|
|
392
|
+
"pre",
|
|
393
|
+
{ style: { "white-space": "pre" } },
|
|
394
|
+
this.hintContent
|
|
395
|
+
);
|
|
378
396
|
}
|
|
379
397
|
};
|
|
380
398
|
}
|
|
381
|
-
const
|
|
399
|
+
const Oe = ["textContent"], ke = { class: "vv-input-radio-group__wrapper" }, Ve = /* @__PURE__ */ F({
|
|
382
400
|
__name: "VvRadioGroup",
|
|
383
|
-
props:
|
|
384
|
-
emits:
|
|
401
|
+
props: ce,
|
|
402
|
+
emits: ie,
|
|
385
403
|
setup(e, { emit: t }) {
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
key:
|
|
389
|
-
modelValue:
|
|
390
|
-
disabled:
|
|
404
|
+
const r = e, s = X(), n = ue(r, "modelValue", t), { disabled: a, readonly: o, vertical: l, valid: u, error: p } = j(r);
|
|
405
|
+
fe({
|
|
406
|
+
key: w,
|
|
407
|
+
modelValue: n,
|
|
408
|
+
disabled: a,
|
|
391
409
|
readonly: o
|
|
392
410
|
});
|
|
393
|
-
const { getOptionLabel:
|
|
394
|
-
horizontal: f(() => !
|
|
395
|
-
valid:
|
|
396
|
-
invalid:
|
|
411
|
+
const { getOptionLabel: c, getOptionValue: A } = de(r), { bemCssClasses: i } = I("vv-input-radio-group", {
|
|
412
|
+
horizontal: f(() => !l.value),
|
|
413
|
+
valid: u,
|
|
414
|
+
invalid: p
|
|
397
415
|
});
|
|
398
|
-
function
|
|
416
|
+
function d(v, b) {
|
|
399
417
|
return {
|
|
400
|
-
id: `${
|
|
401
|
-
name:
|
|
402
|
-
label:
|
|
403
|
-
value:
|
|
418
|
+
id: `${r.name}_opt${b}`,
|
|
419
|
+
name: r.name,
|
|
420
|
+
label: c(v),
|
|
421
|
+
value: A(v)
|
|
404
422
|
};
|
|
405
423
|
}
|
|
406
|
-
const
|
|
407
|
-
return (v,
|
|
408
|
-
class:
|
|
424
|
+
const g = Ce(r, s);
|
|
425
|
+
return (v, b) => (V(), E("fieldset", {
|
|
426
|
+
class: Y(O(i))
|
|
409
427
|
}, [
|
|
410
|
-
v.label ? (
|
|
428
|
+
v.label ? (V(), E("legend", {
|
|
411
429
|
key: 0,
|
|
412
|
-
textContent:
|
|
413
|
-
}, null, 8,
|
|
414
|
-
|
|
415
|
-
v.options.length > 0 ? (
|
|
430
|
+
textContent: G(v.label)
|
|
431
|
+
}, null, 8, Oe)) : L("", !0),
|
|
432
|
+
P("div", ke, [
|
|
433
|
+
v.options.length > 0 ? (V(!0), E(ee, { key: 0 }, te(v.options, (_, C) => (V(), re(Ae, S({ key: C }, d(_, C)), null, 16))), 128)) : D(v.$slots, "default", { key: 1 })
|
|
416
434
|
]),
|
|
417
|
-
ne(
|
|
435
|
+
ne(O(g), { class: "vv-input-radio-group__hint" })
|
|
418
436
|
], 2));
|
|
419
437
|
}
|
|
420
438
|
});
|