@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,85 +1,85 @@
|
|
|
1
|
-
import { isRef as
|
|
2
|
-
import { useFocus as
|
|
1
|
+
import { isRef as Z, provide as M, computed as v, toRefs as S, unref as k, inject as T, toRef as U, watch as K, defineComponent as P, useAttrs as W, ref as J, openBlock as _, createElementBlock as B, mergeProps as F, createElementVNode as w, renderSlot as R, createTextVNode as L, toDisplayString as q, h as Q, useSlots as X, normalizeClass as Y, createCommentVNode as ee, Fragment as te, renderList as re, createBlock as ne, createVNode as se } from "vue";
|
|
2
|
+
import { useFocus as ue, toReactive as oe, useVModel as le } from "@vueuse/core";
|
|
3
3
|
const G = {
|
|
4
4
|
valid: Boolean,
|
|
5
5
|
validLabel: [String, Array]
|
|
6
|
-
},
|
|
6
|
+
}, $ = {
|
|
7
7
|
error: Boolean,
|
|
8
8
|
errorLabel: [String, Array]
|
|
9
|
-
},
|
|
9
|
+
}, ae = {
|
|
10
10
|
hintLabel: { type: String, default: "" }
|
|
11
|
-
},
|
|
11
|
+
}, ie = {
|
|
12
12
|
options: { type: Array, default: () => [] },
|
|
13
13
|
optionLabel: { type: [String, Function], default: () => "label" },
|
|
14
14
|
optionValue: { type: [String, Function], default: () => "value" }
|
|
15
|
-
},
|
|
15
|
+
}, ce = {
|
|
16
16
|
...G,
|
|
17
|
-
|
|
18
|
-
...
|
|
19
|
-
...
|
|
17
|
+
...$,
|
|
18
|
+
...ae,
|
|
19
|
+
...ie,
|
|
20
20
|
modelValue: { type: Array },
|
|
21
21
|
label: { type: String, default: "" },
|
|
22
22
|
name: { type: String, default: "", required: !0 },
|
|
23
23
|
disabled: { type: Boolean, default: !1 },
|
|
24
24
|
readonly: { type: Boolean, default: !1 },
|
|
25
25
|
vertical: { type: Boolean, default: !1 }
|
|
26
|
-
},
|
|
27
|
-
function
|
|
26
|
+
}, fe = ["update:modelValue", "change"], x = Symbol("VV_CHECK_GROUP");
|
|
27
|
+
function pe(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), M(
|
|
33
33
|
e.key,
|
|
34
|
-
|
|
34
|
+
v(() => e)
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const { options: t, optionLabel:
|
|
37
|
+
function de(e) {
|
|
38
|
+
const { options: t, optionLabel: r, optionValue: s } = S(e);
|
|
39
39
|
return {
|
|
40
40
|
options: t,
|
|
41
|
-
getOptionLabel: (u) => typeof u != "object" && u !== null ? u : typeof
|
|
41
|
+
getOptionLabel: (u) => typeof u != "object" && u !== null ? u : typeof r.value == "function" ? r.value(u) : u[r.value],
|
|
42
42
|
getOptionValue: (u) => typeof u != "object" && u !== null ? u : typeof s.value == "function" ? s.value(u) : u[s.value]
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
equals(e, t,
|
|
47
|
-
return
|
|
45
|
+
const m = {
|
|
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, l, u;
|
|
55
|
+
if (r && s) {
|
|
56
|
+
if (l = e.length, l != t.length)
|
|
57
57
|
return !1;
|
|
58
|
-
for (
|
|
59
|
-
if (!this.deepEquals(e[
|
|
58
|
+
for (n = l; 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 a = e instanceof Date, o = t instanceof Date;
|
|
66
|
+
if (a != o)
|
|
67
67
|
return !1;
|
|
68
|
-
if (
|
|
68
|
+
if (a && o)
|
|
69
69
|
return e.getTime() == t.getTime();
|
|
70
|
-
const i = e instanceof RegExp,
|
|
71
|
-
if (i !=
|
|
70
|
+
const i = e instanceof RegExp, y = t instanceof RegExp;
|
|
71
|
+
if (i != y)
|
|
72
72
|
return !1;
|
|
73
|
-
if (i &&
|
|
73
|
+
if (i && y)
|
|
74
74
|
return e.toString() == t.toString();
|
|
75
75
|
const p = Object.keys(e);
|
|
76
|
-
if (
|
|
76
|
+
if (l = p.length, l !== Object.keys(t).length)
|
|
77
77
|
return !1;
|
|
78
|
-
for (
|
|
79
|
-
if (!Object.prototype.hasOwnProperty.call(t, p[
|
|
78
|
+
for (n = l; n-- !== 0; )
|
|
79
|
+
if (!Object.prototype.hasOwnProperty.call(t, p[n]))
|
|
80
80
|
return !1;
|
|
81
|
-
for (
|
|
82
|
-
if (u = p[
|
|
81
|
+
for (n = l; n-- !== 0; )
|
|
82
|
+
if (u = p[n], !this.deepEquals(e[u], t[u]))
|
|
83
83
|
return !1;
|
|
84
84
|
return !0;
|
|
85
85
|
}
|
|
@@ -90,12 +90,12 @@ const y = {
|
|
|
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, l = r.length; n < l; ++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 y = {
|
|
|
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,51 +132,51 @@ const y = {
|
|
|
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, l, u, a;
|
|
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) || ((l = e[r]) == null ? void 0 : l.type[0]()) : t[r] = ((u = e[r]) == null ? void 0 : u.default) || ((a = e[r]) == null ? void 0 : a.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:
|
|
169
|
-
const u = k(t[
|
|
168
|
+
bemCssClasses: v(() => Object.keys(t).reduce((n, l) => {
|
|
169
|
+
const u = k(t[l]) || !1;
|
|
170
170
|
if (!u)
|
|
171
|
-
return
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
171
|
+
return n;
|
|
172
|
+
if (l === "modifiers") {
|
|
173
|
+
const a = Array.isArray(u) ? u : [u];
|
|
174
174
|
return {
|
|
175
|
-
...
|
|
176
|
-
...
|
|
177
|
-
(
|
|
178
|
-
...
|
|
179
|
-
[`${e}--${
|
|
175
|
+
...n,
|
|
176
|
+
...a.reduce(
|
|
177
|
+
(o, i) => ({
|
|
178
|
+
...o,
|
|
179
|
+
[`${e}--${m.kebabCase(
|
|
180
180
|
i
|
|
181
181
|
)}`]: !0
|
|
182
182
|
}),
|
|
@@ -185,15 +185,15 @@ function F(e, t) {
|
|
|
185
185
|
};
|
|
186
186
|
} else
|
|
187
187
|
return {
|
|
188
|
-
...
|
|
189
|
-
[`${e}--${
|
|
188
|
+
...n,
|
|
189
|
+
[`${e}--${m.kebabCase(l)}`]: u
|
|
190
190
|
};
|
|
191
|
-
},
|
|
191
|
+
}, r) || {})
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const ve = {
|
|
195
195
|
...G,
|
|
196
|
-
|
|
196
|
+
...$,
|
|
197
197
|
value: null,
|
|
198
198
|
modelValue: null,
|
|
199
199
|
binary: Boolean,
|
|
@@ -203,232 +203,250 @@ const de = {
|
|
|
203
203
|
label: String,
|
|
204
204
|
disabled: Boolean,
|
|
205
205
|
readonly: Boolean
|
|
206
|
-
},
|
|
206
|
+
}, ye = [
|
|
207
207
|
"click",
|
|
208
208
|
"update:modelValue",
|
|
209
209
|
"change",
|
|
210
210
|
"focus",
|
|
211
211
|
"blur"
|
|
212
212
|
];
|
|
213
|
-
function
|
|
213
|
+
function he(e) {
|
|
214
214
|
const t = T(e, void 0);
|
|
215
215
|
console.log("Inject - ", t);
|
|
216
|
-
const
|
|
217
|
-
function s(
|
|
216
|
+
const r = v(() => m.isNotEmpty(t));
|
|
217
|
+
function s(n, l, u) {
|
|
218
218
|
if (t != null && t.value) {
|
|
219
|
-
const
|
|
220
|
-
return
|
|
219
|
+
const a = k(t.value)[n];
|
|
220
|
+
return v({
|
|
221
221
|
get() {
|
|
222
|
-
return
|
|
222
|
+
return a == null ? void 0 : a.value;
|
|
223
223
|
},
|
|
224
|
-
set(
|
|
225
|
-
|
|
224
|
+
set(o) {
|
|
225
|
+
a.value = o;
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
} else {
|
|
229
|
-
const
|
|
230
|
-
return
|
|
229
|
+
const a = U(l, n);
|
|
230
|
+
return v({
|
|
231
231
|
get() {
|
|
232
|
-
return
|
|
232
|
+
return a.value;
|
|
233
233
|
},
|
|
234
|
-
set(
|
|
235
|
-
u && u(`update:${
|
|
234
|
+
set(o) {
|
|
235
|
+
u && u(`update:${n}`, o);
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
return {
|
|
241
241
|
group: t,
|
|
242
|
-
isInGroup:
|
|
242
|
+
isInGroup: r,
|
|
243
243
|
getGroupOrLocalRef: s
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
const { group:
|
|
246
|
+
function me(e, t) {
|
|
247
|
+
const { group: r, isInGroup: s, getGroupOrLocalRef: n } = he(x), { valid: l, error: u, switch: a } = S(e), o = n("modelValue", e, t), i = n("readonly", e), y = n("disabled", e);
|
|
248
248
|
return {
|
|
249
|
-
group:
|
|
249
|
+
group: r,
|
|
250
250
|
isInGroup: s,
|
|
251
|
-
valid:
|
|
251
|
+
valid: l,
|
|
252
252
|
error: u,
|
|
253
|
-
propsSwitch:
|
|
254
|
-
modelValue:
|
|
253
|
+
propsSwitch: a,
|
|
254
|
+
modelValue: o,
|
|
255
255
|
readonly: i,
|
|
256
|
-
disabled:
|
|
256
|
+
disabled: y
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
const { focused:
|
|
261
|
-
return K(
|
|
259
|
+
function ge(e, t) {
|
|
260
|
+
const { focused: r } = ue(e);
|
|
261
|
+
return K(r, (s) => {
|
|
262
262
|
t(s ? "focus" : "blur", e.value);
|
|
263
263
|
}), {
|
|
264
|
-
focused:
|
|
264
|
+
focused: r
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
const
|
|
267
|
+
const ke = {
|
|
268
268
|
inheritAttrs: !1
|
|
269
|
-
},
|
|
270
|
-
...
|
|
269
|
+
}, Ce = /* @__PURE__ */ P({
|
|
270
|
+
...ke,
|
|
271
271
|
__name: "VvCheck",
|
|
272
|
-
props:
|
|
273
|
-
emits:
|
|
272
|
+
props: ve,
|
|
273
|
+
emits: ye,
|
|
274
274
|
setup(e, { emit: t }) {
|
|
275
|
-
const
|
|
276
|
-
switch:
|
|
275
|
+
const r = e, s = W(), { disabled: n, readonly: l, valid: u, error: a, propsSwitch: o, modelValue: i } = me(r, t), y = J(), { focused: p } = ge(y, t), d = v(() => r.binary ? m.equals(i.value, r.trueValue) : Array.isArray(i.value) ? m.contains(r.value, i.value) : m.equals(r.value, i.value)), { bemCssClasses: f } = I("vv-input-checkbox", {
|
|
276
|
+
switch: o,
|
|
277
277
|
valid: u,
|
|
278
|
-
invalid:
|
|
279
|
-
}), { bemCssClasses:
|
|
278
|
+
invalid: a
|
|
279
|
+
}), { bemCssClasses: h } = I(
|
|
280
280
|
"vv-input-check__input",
|
|
281
281
|
{
|
|
282
|
-
checked:
|
|
283
|
-
disabled:
|
|
284
|
-
readonly:
|
|
282
|
+
checked: d,
|
|
283
|
+
disabled: n,
|
|
284
|
+
readonly: l
|
|
285
285
|
}
|
|
286
|
-
),
|
|
286
|
+
), c = v(() => ({
|
|
287
287
|
[s.class]: !0,
|
|
288
|
-
...
|
|
289
|
-
})),
|
|
290
|
-
...
|
|
288
|
+
...f.value
|
|
289
|
+
})), A = v(() => ({
|
|
290
|
+
...h.value,
|
|
291
291
|
"focus-visible": p.value
|
|
292
|
-
})),
|
|
293
|
-
const { id:
|
|
292
|
+
})), O = v(() => {
|
|
293
|
+
const { id: g, name: C, style: j } = s, N = m.pickBy(
|
|
294
294
|
s,
|
|
295
|
-
(
|
|
295
|
+
(z) => z.startsWith("data-")
|
|
296
296
|
);
|
|
297
297
|
return {
|
|
298
|
-
for:
|
|
299
|
-
style:
|
|
300
|
-
...
|
|
298
|
+
for: g || C,
|
|
299
|
+
style: j,
|
|
300
|
+
...N
|
|
301
301
|
};
|
|
302
|
-
}), b =
|
|
303
|
-
const { id:
|
|
302
|
+
}), b = v(() => {
|
|
303
|
+
const { id: g = "", name: C = "" } = s;
|
|
304
304
|
return {
|
|
305
305
|
type: "checkbox",
|
|
306
|
-
id:
|
|
307
|
-
name:
|
|
308
|
-
value:
|
|
309
|
-
disabled:
|
|
310
|
-
readonly:
|
|
311
|
-
checked:
|
|
312
|
-
...
|
|
306
|
+
id: g || C,
|
|
307
|
+
name: C,
|
|
308
|
+
value: r.value,
|
|
309
|
+
disabled: n.value,
|
|
310
|
+
readonly: l.value,
|
|
311
|
+
checked: d.value,
|
|
312
|
+
...V.value
|
|
313
313
|
};
|
|
314
|
-
}),
|
|
315
|
-
const { name:
|
|
314
|
+
}), V = v(() => {
|
|
315
|
+
const { name: g } = s, C = m.pickBy(
|
|
316
316
|
s,
|
|
317
|
-
(
|
|
317
|
+
(j) => j.startsWith("aria-")
|
|
318
318
|
);
|
|
319
319
|
return {
|
|
320
|
-
"aria-label":
|
|
321
|
-
"aria-checked":
|
|
322
|
-
...
|
|
320
|
+
"aria-label": g,
|
|
321
|
+
"aria-checked": d.value,
|
|
322
|
+
...C
|
|
323
323
|
};
|
|
324
324
|
});
|
|
325
|
-
function
|
|
326
|
-
if (
|
|
327
|
-
i.value =
|
|
325
|
+
function D() {
|
|
326
|
+
if (r.binary) {
|
|
327
|
+
i.value = d.value ? r.falseValue : r.trueValue;
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
330
|
if (i.value === null) {
|
|
331
|
-
i.value = [
|
|
331
|
+
i.value = [r.value];
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
334
|
if (Array.isArray(i.value)) {
|
|
335
|
-
i.value =
|
|
335
|
+
i.value = d.value ? m.removeFromList(r.value, i.value) : [...i.value, r.value];
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
console.warn("Cannot change value - VvCheck modelValue is not an array");
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
|
|
340
|
+
function H(g) {
|
|
341
|
+
n.value || (t("click", g), t("change", d.value ? r.value : null), p.value = !0);
|
|
342
342
|
}
|
|
343
|
-
return (
|
|
344
|
-
|
|
343
|
+
return (g, C) => (_(), B("label", F({ class: k(c) }, k(O), { onClick: H }), [
|
|
344
|
+
w("input", F({
|
|
345
345
|
ref_key: "input",
|
|
346
|
-
ref:
|
|
347
|
-
class: k(
|
|
348
|
-
}, k(b), { onInput:
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
ref: y,
|
|
347
|
+
class: k(A)
|
|
348
|
+
}, k(b), { onInput: D }), null, 16),
|
|
349
|
+
R(g.$slots, "default", { value: k(i) }, () => [
|
|
350
|
+
L(q(g.label), 1)
|
|
351
351
|
])
|
|
352
352
|
], 16));
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
|
-
function
|
|
356
|
-
return Array.isArray(e) ? e.filter((t) =>
|
|
357
|
-
` +
|
|
355
|
+
function E(e) {
|
|
356
|
+
return Array.isArray(e) ? e.filter((t) => m.isString(t)).reduce((t, r) => t.length > 0 ? t + `
|
|
357
|
+
` + r : r, "") : e;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ae(e, t) {
|
|
360
360
|
return {
|
|
361
361
|
name: "HintSlot",
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
362
|
+
props: {
|
|
363
|
+
params: { type: Object, default: () => {
|
|
364
|
+
} }
|
|
365
|
+
},
|
|
366
|
+
setup(r) {
|
|
367
|
+
const s = S(e), {
|
|
368
|
+
error: n,
|
|
369
|
+
valid: l,
|
|
370
|
+
hint: u,
|
|
371
|
+
loading: a
|
|
368
372
|
} = t, {
|
|
369
|
-
hintLabel:
|
|
370
|
-
modelValue:
|
|
371
|
-
valid:
|
|
372
|
-
validLabel:
|
|
373
|
-
error:
|
|
374
|
-
errorLabel:
|
|
375
|
-
} =
|
|
376
|
-
|
|
373
|
+
hintLabel: o,
|
|
374
|
+
modelValue: i,
|
|
375
|
+
valid: y,
|
|
376
|
+
validLabel: p,
|
|
377
|
+
error: d,
|
|
378
|
+
errorLabel: f
|
|
379
|
+
} = s, h = m.resolveFieldData(s, "loading"), c = m.resolveFieldData(
|
|
380
|
+
s,
|
|
377
381
|
"loadingLabel"
|
|
378
|
-
),
|
|
379
|
-
const
|
|
380
|
-
|
|
382
|
+
), A = v(() => d.value ? !!(d.value && n || (f == null ? void 0 : f.value) && Array.isArray(f.value) && f.value.length > 0 || (f == null ? void 0 : f.value) && m.isNotEmpty(f.value)) : !1), O = v(() => !!(o && o.value || u || l || p && p.value || A.value || (h == null ? void 0 : h.value) && a || (h == null ? void 0 : h.value) && (c == null ? void 0 : c.value))), b = v(() => {
|
|
383
|
+
const V = oe({
|
|
384
|
+
hintLabel: o,
|
|
385
|
+
modelValue: i,
|
|
386
|
+
valid: y,
|
|
387
|
+
validLabel: p,
|
|
388
|
+
error: d,
|
|
389
|
+
errorLabel: f,
|
|
390
|
+
loading: h,
|
|
391
|
+
loadingLabel: c,
|
|
392
|
+
...r.params
|
|
393
|
+
});
|
|
394
|
+
return d != null && d.value ? (n == null ? void 0 : n(V)) || E(f == null ? void 0 : f.value) || (o == null ? void 0 : o.value) : y != null && y.value ? (l == null ? void 0 : l(V)) || E(p == null ? void 0 : p.value) || (o == null ? void 0 : o.value) : h != null && h.value ? (a == null ? void 0 : a(V)) || E(c == null ? void 0 : c.value) || (o == null ? void 0 : o.value) : (u == null ? void 0 : u(V)) || E(o == null ? void 0 : o.value) || (o == null ? void 0 : o.value);
|
|
381
395
|
});
|
|
382
396
|
return {
|
|
383
|
-
hasHint:
|
|
397
|
+
hasHint: O,
|
|
384
398
|
hintContent: b
|
|
385
399
|
};
|
|
386
400
|
},
|
|
387
401
|
render() {
|
|
388
402
|
if (this.hasHint)
|
|
389
|
-
return Q(
|
|
403
|
+
return Q(
|
|
404
|
+
"pre",
|
|
405
|
+
{ style: { "white-space": "pre" } },
|
|
406
|
+
this.hintContent
|
|
407
|
+
);
|
|
390
408
|
}
|
|
391
409
|
};
|
|
392
410
|
}
|
|
393
|
-
const
|
|
411
|
+
const be = ["textContent"], Ve = { class: "vv-input-checkbox-group__wrapper" }, Ee = /* @__PURE__ */ P({
|
|
394
412
|
__name: "VvCheckGroup",
|
|
395
|
-
props:
|
|
396
|
-
emits:
|
|
413
|
+
props: ce,
|
|
414
|
+
emits: fe,
|
|
397
415
|
setup(e, { emit: t }) {
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
key:
|
|
401
|
-
modelValue:
|
|
402
|
-
disabled:
|
|
416
|
+
const r = e, s = X(), n = le(r, "modelValue", t), { disabled: l, readonly: u, error: a, valid: o } = S(r);
|
|
417
|
+
pe({
|
|
418
|
+
key: x,
|
|
419
|
+
modelValue: n,
|
|
420
|
+
disabled: l,
|
|
403
421
|
readonly: u
|
|
404
422
|
});
|
|
405
|
-
const { getOptionLabel:
|
|
423
|
+
const { getOptionLabel: y, getOptionValue: p } = de(r), { bemCssClasses: d } = I(
|
|
406
424
|
"vv-input-checkbox-group",
|
|
407
425
|
{
|
|
408
|
-
horizontal:
|
|
409
|
-
valid:
|
|
410
|
-
invalid:
|
|
426
|
+
horizontal: v(() => !r.vertical),
|
|
427
|
+
valid: o,
|
|
428
|
+
invalid: a
|
|
411
429
|
}
|
|
412
|
-
),
|
|
413
|
-
id: `${
|
|
414
|
-
name:
|
|
415
|
-
label:
|
|
416
|
-
value: p(
|
|
417
|
-
}),
|
|
418
|
-
return (
|
|
419
|
-
class: Y(k(
|
|
430
|
+
), f = (c, A) => ({
|
|
431
|
+
id: `${r.name}_opt${A}`,
|
|
432
|
+
name: r.name,
|
|
433
|
+
label: y(c),
|
|
434
|
+
value: p(c)
|
|
435
|
+
}), h = Ae(r, s);
|
|
436
|
+
return (c, A) => (_(), B("fieldset", {
|
|
437
|
+
class: Y(k(d))
|
|
420
438
|
}, [
|
|
421
|
-
|
|
439
|
+
c.label ? (_(), B("legend", {
|
|
422
440
|
key: 0,
|
|
423
|
-
textContent:
|
|
424
|
-
}, null, 8,
|
|
425
|
-
|
|
426
|
-
|
|
441
|
+
textContent: q(c.label)
|
|
442
|
+
}, null, 8, be)) : ee("", !0),
|
|
443
|
+
w("div", Ve, [
|
|
444
|
+
c.options.length > 0 ? (_(!0), B(te, { key: 0 }, re(c.options, (O, b) => (_(), ne(Ce, F({ key: b }, f(O, b)), null, 16))), 128)) : R(c.$slots, "default", { key: 1 })
|
|
427
445
|
]),
|
|
428
|
-
|
|
446
|
+
se(k(h), { class: "vv-input-checkbox-group__hint" })
|
|
429
447
|
], 2));
|
|
430
448
|
}
|
|
431
449
|
});
|
|
432
450
|
export {
|
|
433
|
-
|
|
451
|
+
Ee as default
|
|
434
452
|
};
|