@volverjs/ui-vue 0.0.3-beta.2 → 0.0.3-beta.4
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/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 +195 -254
- 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/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1168 -1360
- 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 +1203 -1396
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +2 -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/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/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/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +0 -1
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const VvRadioGroupProps: {
|
|
2
|
-
modelValue: (
|
|
2
|
+
modelValue: (StringConstructor | ArrayConstructor)[];
|
|
3
3
|
label: StringConstructor;
|
|
4
4
|
name: {
|
|
5
5
|
type: StringConstructor;
|
|
@@ -25,8 +25,8 @@ export declare const VvRadioGroupProps: {
|
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
27
|
invalid: BooleanConstructor;
|
|
28
|
-
invalidLabel: (
|
|
28
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[];
|
|
29
29
|
valid: BooleanConstructor;
|
|
30
|
-
validLabel: (
|
|
30
|
+
validLabel: (StringConstructor | ArrayConstructor)[];
|
|
31
31
|
};
|
|
32
32
|
export declare const VvRadioGroupEvents: string[];
|
|
@@ -1,99 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nanoid as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function K(e, r) {
|
|
6
|
-
if (e && Object.keys(e).length && r) {
|
|
7
|
-
if (r.indexOf(".") === -1)
|
|
8
|
-
return e[r];
|
|
9
|
-
{
|
|
10
|
-
const t = r.split(".");
|
|
11
|
-
let a = e;
|
|
12
|
-
for (let l = 0, d = t.length; l < d; ++l) {
|
|
13
|
-
if (e == null)
|
|
14
|
-
return null;
|
|
15
|
-
a = a[t[l]];
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
}
|
|
19
|
-
} else
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
function W(e) {
|
|
23
|
-
return ((r) => r == null || r === "" || Array.isArray(r) && r.length === 0 || !(r instanceof Date) && typeof r == "object" && Object.keys(r).length === 0)(c(e));
|
|
24
|
-
}
|
|
25
|
-
function Ae(e) {
|
|
26
|
-
return typeof e == "string" || e instanceof String;
|
|
27
|
-
}
|
|
28
|
-
function Z(e) {
|
|
29
|
-
var r, t;
|
|
30
|
-
if (e)
|
|
31
|
-
return (t = (r = e.match(
|
|
32
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
33
|
-
)) == null ? void 0 : r.join("-")) == null ? void 0 : t.toLowerCase();
|
|
34
|
-
}
|
|
35
|
-
function Y(e, r) {
|
|
36
|
-
const t = { [`${e}`]: !0 };
|
|
37
|
-
return {
|
|
38
|
-
bemCssClasses: i(() => Object.keys(r).reduce((l, d) => {
|
|
39
|
-
const n = c(r[d]) || !1;
|
|
40
|
-
if (!n)
|
|
41
|
-
return l;
|
|
42
|
-
if (d === "modifiers") {
|
|
43
|
-
const h = Array.isArray(n) ? n : n.split(" ");
|
|
44
|
-
return {
|
|
45
|
-
...l,
|
|
46
|
-
...h.reduce(
|
|
47
|
-
(p, v) => ({
|
|
48
|
-
...p,
|
|
49
|
-
[`${e}--${Z(v)}`]: !0
|
|
50
|
-
}),
|
|
51
|
-
{}
|
|
52
|
-
)
|
|
53
|
-
};
|
|
54
|
-
} else
|
|
55
|
-
return {
|
|
56
|
-
...l,
|
|
57
|
-
[`${e}--${Z(d)}`]: n
|
|
58
|
-
};
|
|
59
|
-
}, t) || {})
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function Be(e, r, t) {
|
|
63
|
-
const a = i(
|
|
64
|
-
() => !!(e != null && e.value && r.value === "left" || t != null && t.iconLeft)
|
|
65
|
-
), l = i(
|
|
66
|
-
() => !!(e != null && e.value && r.value === "right" || t != null && t.iconRight)
|
|
67
|
-
), d = i(
|
|
68
|
-
() => !!(e != null && e.value && r.value === "top" || t != null && t.iconTop)
|
|
69
|
-
), n = i(
|
|
70
|
-
() => !!(e != null && e.value && r.value === "bottom" || t != null && t.iconBottom)
|
|
71
|
-
);
|
|
72
|
-
return {
|
|
73
|
-
hasIcon: i(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
|
|
74
|
-
hasIconLeft: a,
|
|
75
|
-
hasIconRight: l,
|
|
76
|
-
hasIconTop: d,
|
|
77
|
-
hasIconBottom: n
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function Oe(e) {
|
|
81
|
-
const { options: r, labelKey: t, valueKey: a } = j(e);
|
|
82
|
-
return {
|
|
83
|
-
options: r,
|
|
84
|
-
getOptionLabel: (n) => typeof n != "object" && n !== null ? n : typeof t.value == "function" ? t.value(n) : n[t.value],
|
|
85
|
-
getOptionValue: (n) => typeof n != "object" && n !== null ? n : typeof a.value == "function" ? a.value(n) : n[a.value]
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function $e(e, r) {
|
|
89
|
-
const { focused: t } = be(e);
|
|
90
|
-
return J(t, (a) => {
|
|
91
|
-
r(a ? "focus" : "blur", c(e));
|
|
92
|
-
}), {
|
|
93
|
-
focused: t
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
const Ce = "ds", we = {
|
|
1
|
+
import { defineComponent as U, unref as l, openBlock as g, createBlock as k, mergeProps as N, createCommentVNode as F, createElementBlock as w, normalizeClass as te, toDisplayString as R, createElementVNode as j, renderSlot as q, normalizeProps as T, withDirectives as oe, isRef as ne, Fragment as re, renderList as ie, vModelSelect as se, createVNode as le } from "vue";
|
|
2
|
+
import { nanoid as ae } from "nanoid";
|
|
3
|
+
import { iconExists as O, Icon as ue, addIcon as ce } from "@iconify/vue";
|
|
4
|
+
const de = "ds", pe = {
|
|
97
5
|
color: String,
|
|
98
6
|
width: {
|
|
99
7
|
type: [String, Number]
|
|
@@ -124,90 +32,90 @@ const Ce = "ds", we = {
|
|
|
124
32
|
modifiers: {
|
|
125
33
|
type: [String, Array]
|
|
126
34
|
}
|
|
127
|
-
},
|
|
35
|
+
}, ve = {
|
|
128
36
|
name: "VvIcon"
|
|
129
|
-
}, G = /* @__PURE__ */
|
|
130
|
-
...
|
|
131
|
-
props:
|
|
132
|
-
setup(
|
|
133
|
-
const r =
|
|
134
|
-
modifiers:
|
|
135
|
-
}), n =
|
|
136
|
-
const
|
|
137
|
-
return
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
return
|
|
141
|
-
})) ||
|
|
37
|
+
}, G = /* @__PURE__ */ U({
|
|
38
|
+
...ve,
|
|
39
|
+
props: pe,
|
|
40
|
+
setup(c) {
|
|
41
|
+
const r = c, o = ref(!0), { modifiers: v } = toRefs(r), s = inject(de), { bemCssClasses: f } = useBemModifiers("vv-icon", {
|
|
42
|
+
modifiers: v
|
|
43
|
+
}), n = computed(() => r.provider || (s == null ? void 0 : s.provider)), b = computed(() => {
|
|
44
|
+
const e = r.name ?? "", t = `@${n.value}:${r.prefix}:${r.name}`;
|
|
45
|
+
return O(e) ? e : O(t) ? t : (s == null ? void 0 : s.iconsCollections.find((d) => {
|
|
46
|
+
const a = `@${n.value}:${d.prefix}:${e}`;
|
|
47
|
+
if (O(a))
|
|
48
|
+
return a;
|
|
49
|
+
})) || e;
|
|
142
50
|
});
|
|
143
|
-
function
|
|
144
|
-
let
|
|
51
|
+
function m(e) {
|
|
52
|
+
let t = null;
|
|
145
53
|
if (typeof window > "u") {
|
|
146
|
-
const { JSDOM:
|
|
147
|
-
|
|
54
|
+
const { JSDOM: y } = require("jsdom");
|
|
55
|
+
t = new y().window;
|
|
148
56
|
}
|
|
149
|
-
return (
|
|
57
|
+
return (t ? new t.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
|
|
150
58
|
}
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
body:
|
|
155
|
-
height:
|
|
156
|
-
width:
|
|
59
|
+
function u(e) {
|
|
60
|
+
const t = m(e), d = (t == null ? void 0 : t.innerHTML.trim()) || "";
|
|
61
|
+
t && d && ce(`@${n.value}:${r.prefix}:${r.name}`, {
|
|
62
|
+
body: d,
|
|
63
|
+
height: t.viewBox.baseVal.height,
|
|
64
|
+
width: t.viewBox.baseVal.width
|
|
157
65
|
});
|
|
158
66
|
}
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
}).catch((
|
|
162
|
-
throw new Error(`During fetch icon: ${
|
|
163
|
-
})) : r.svg &&
|
|
67
|
+
return s && (r.src && !O(`@${n.value}:${r.prefix}:${r.name}`) ? (o.value = !1, s.fetchIcon(r.src).then((e) => {
|
|
68
|
+
e && (u(e), o.value = !0);
|
|
69
|
+
}).catch((e) => {
|
|
70
|
+
throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
|
|
71
|
+
})) : r.svg && u(r.svg)), (e, t) => l(o) ? (g(), k(l(ue), N({
|
|
164
72
|
key: 0,
|
|
165
|
-
class:
|
|
73
|
+
class: l(f)
|
|
166
74
|
}, {
|
|
167
|
-
inline:
|
|
168
|
-
width:
|
|
169
|
-
height:
|
|
170
|
-
horizontalFlip:
|
|
171
|
-
verticalFlip:
|
|
172
|
-
flip:
|
|
173
|
-
rotate:
|
|
174
|
-
color:
|
|
175
|
-
onLoad:
|
|
176
|
-
icon:
|
|
177
|
-
}), null, 16, ["class"])) :
|
|
75
|
+
inline: e.inline,
|
|
76
|
+
width: e.width,
|
|
77
|
+
height: e.height,
|
|
78
|
+
horizontalFlip: e.horizontalFlip,
|
|
79
|
+
verticalFlip: e.verticalFlip,
|
|
80
|
+
flip: e.flip,
|
|
81
|
+
rotate: e.rotate,
|
|
82
|
+
color: e.color,
|
|
83
|
+
onLoad: e.onLoad,
|
|
84
|
+
icon: l(b)
|
|
85
|
+
}), null, 16, ["class"])) : F("", !0);
|
|
178
86
|
}
|
|
179
87
|
});
|
|
180
|
-
function
|
|
181
|
-
return Array.isArray(
|
|
88
|
+
function C(c) {
|
|
89
|
+
return Array.isArray(c) ? c.filter((r) => isString(r)).join(" ") : c;
|
|
182
90
|
}
|
|
183
|
-
function
|
|
91
|
+
function fe(c, r) {
|
|
184
92
|
const {
|
|
185
|
-
invalid:
|
|
186
|
-
valid:
|
|
187
|
-
hint:
|
|
188
|
-
loading:
|
|
93
|
+
invalid: o,
|
|
94
|
+
valid: v,
|
|
95
|
+
hint: s,
|
|
96
|
+
loading: f
|
|
189
97
|
} = r, {
|
|
190
98
|
hintLabel: n,
|
|
191
|
-
modelValue:
|
|
192
|
-
valid:
|
|
193
|
-
validLabel:
|
|
194
|
-
invalid:
|
|
195
|
-
invalidLabel:
|
|
196
|
-
...
|
|
197
|
-
} =
|
|
198
|
-
() => !!(n && n.value ||
|
|
199
|
-
), V =
|
|
200
|
-
() => !!(
|
|
201
|
-
),
|
|
202
|
-
() => !!(
|
|
203
|
-
),
|
|
204
|
-
() => $.value || V.value ||
|
|
99
|
+
modelValue: b,
|
|
100
|
+
valid: m,
|
|
101
|
+
validLabel: u,
|
|
102
|
+
invalid: e,
|
|
103
|
+
invalidLabel: t,
|
|
104
|
+
...d
|
|
105
|
+
} = toRefs(c), a = resolveFieldData(d, "loading"), p = resolveFieldData(d, "loadingLabel"), y = computed(() => e.value ? !!(e.value && o || t != null && t.value && Array.isArray(t.value) && t.value.length > 0 || t != null && t.value && !isEmpty(t)) : !1), $ = computed(
|
|
106
|
+
() => !!(n && n.value || s)
|
|
107
|
+
), V = computed(
|
|
108
|
+
() => !!(u && u.value || v)
|
|
109
|
+
), P = computed(
|
|
110
|
+
() => !!(a != null && a.value && f || a != null && a.value && (p != null && p.value))
|
|
111
|
+
), I = computed(
|
|
112
|
+
() => $.value || V.value || y.value || P.value
|
|
205
113
|
);
|
|
206
114
|
return {
|
|
207
|
-
hasInvalid:
|
|
115
|
+
hasInvalid: y,
|
|
208
116
|
hasHint: $,
|
|
209
117
|
hasValid: V,
|
|
210
|
-
hasLoading:
|
|
118
|
+
hasLoading: P,
|
|
211
119
|
HintSlot: {
|
|
212
120
|
name: "HintSlot",
|
|
213
121
|
props: {
|
|
@@ -216,31 +124,31 @@ function _e(e, r) {
|
|
|
216
124
|
default: () => ({})
|
|
217
125
|
}
|
|
218
126
|
},
|
|
219
|
-
setup(
|
|
220
|
-
const
|
|
221
|
-
const S =
|
|
127
|
+
setup(A) {
|
|
128
|
+
const _ = computed(() => {
|
|
129
|
+
const S = toReactive({
|
|
222
130
|
hintLabel: n,
|
|
223
|
-
modelValue:
|
|
224
|
-
valid:
|
|
225
|
-
validLabel:
|
|
226
|
-
invalid:
|
|
227
|
-
invalidLabel:
|
|
228
|
-
loading:
|
|
229
|
-
loadingLabel:
|
|
230
|
-
...
|
|
131
|
+
modelValue: b,
|
|
132
|
+
valid: m,
|
|
133
|
+
validLabel: u,
|
|
134
|
+
invalid: e,
|
|
135
|
+
invalidLabel: t,
|
|
136
|
+
loading: a,
|
|
137
|
+
loadingLabel: p,
|
|
138
|
+
...A.params
|
|
231
139
|
});
|
|
232
|
-
return
|
|
140
|
+
return e != null && e.value ? (o == null ? void 0 : o(S)) || C(t == null ? void 0 : t.value) || (n == null ? void 0 : n.value) : m != null && m.value ? (v == null ? void 0 : v(S)) || C(u == null ? void 0 : u.value) || (n == null ? void 0 : n.value) : a != null && a.value ? (f == null ? void 0 : f(S)) || C(p == null ? void 0 : p.value) || (n == null ? void 0 : n.value) : (s == null ? void 0 : s(S)) || C(n == null ? void 0 : n.value) || (n == null ? void 0 : n.value);
|
|
233
141
|
});
|
|
234
142
|
return {
|
|
235
|
-
isVisible:
|
|
236
|
-
hasInvalid:
|
|
143
|
+
isVisible: I,
|
|
144
|
+
hasInvalid: y,
|
|
237
145
|
hasValid: V,
|
|
238
|
-
hintContent:
|
|
146
|
+
hintContent: _
|
|
239
147
|
};
|
|
240
148
|
},
|
|
241
149
|
render() {
|
|
242
150
|
if (this.isVisible)
|
|
243
|
-
return
|
|
151
|
+
return h(
|
|
244
152
|
"small",
|
|
245
153
|
{
|
|
246
154
|
role: this.hasInvalid || this.hasValid ? "alert" : void 0
|
|
@@ -251,69 +159,69 @@ function _e(e, r) {
|
|
|
251
159
|
}
|
|
252
160
|
};
|
|
253
161
|
}
|
|
254
|
-
const
|
|
162
|
+
const me = {
|
|
255
163
|
valid: Boolean,
|
|
256
164
|
validLabel: [String, Array]
|
|
257
|
-
},
|
|
165
|
+
}, ge = {
|
|
258
166
|
invalid: Boolean,
|
|
259
167
|
invalidLabel: [String, Array]
|
|
260
|
-
},
|
|
168
|
+
}, he = {
|
|
261
169
|
loading: Boolean,
|
|
262
170
|
loadingLabel: String
|
|
263
|
-
},
|
|
171
|
+
}, ye = {
|
|
264
172
|
disabled: Boolean
|
|
265
|
-
},
|
|
173
|
+
}, Se = {
|
|
266
174
|
readonly: Boolean
|
|
267
|
-
},
|
|
175
|
+
}, be = {
|
|
268
176
|
modifiers: [String, Array]
|
|
269
|
-
},
|
|
177
|
+
}, Pe = {
|
|
270
178
|
hintLabel: { type: String, default: "" }
|
|
271
|
-
},
|
|
179
|
+
}, Ve = {
|
|
272
180
|
options: {
|
|
273
181
|
type: Array,
|
|
274
182
|
default: () => []
|
|
275
183
|
},
|
|
276
184
|
labelKey: { type: [String, Function], default: "label" },
|
|
277
185
|
valueKey: { type: [String, Function], default: "value" }
|
|
278
|
-
},
|
|
186
|
+
}, K = {
|
|
279
187
|
LEFT: "left",
|
|
280
188
|
RIGHT: "right"
|
|
281
|
-
},
|
|
189
|
+
}, Ie = {
|
|
282
190
|
icon: { type: [String, Object] },
|
|
283
191
|
iconPosition: {
|
|
284
192
|
type: String,
|
|
285
|
-
validation: (
|
|
286
|
-
default:
|
|
193
|
+
validation: (c) => Object.values(K).includes(c),
|
|
194
|
+
default: K.RIGHT
|
|
287
195
|
}
|
|
288
|
-
},
|
|
196
|
+
}, Be = {
|
|
289
197
|
tabindex: { type: [String, Number], default: 0 }
|
|
290
|
-
},
|
|
198
|
+
}, we = {
|
|
291
199
|
floating: Boolean
|
|
292
|
-
},
|
|
200
|
+
}, Fe = {
|
|
293
201
|
unselectable: { type: Boolean, default: !0 }
|
|
294
|
-
},
|
|
202
|
+
}, $e = {
|
|
295
203
|
id: [String, Number],
|
|
296
204
|
name: { type: String, required: !0 }
|
|
297
|
-
},
|
|
205
|
+
}, Ae = {
|
|
298
206
|
autofocus: Boolean
|
|
299
|
-
},
|
|
207
|
+
}, De = {
|
|
300
208
|
autocomplete: { type: String, default: "off" }
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
...
|
|
304
|
-
...Ge,
|
|
305
|
-
...Te,
|
|
209
|
+
}, Oe = {
|
|
210
|
+
...$e,
|
|
211
|
+
...Ae,
|
|
306
212
|
...De,
|
|
307
|
-
...
|
|
308
|
-
...
|
|
309
|
-
...
|
|
310
|
-
...
|
|
311
|
-
...
|
|
312
|
-
...
|
|
313
|
-
...
|
|
314
|
-
...
|
|
315
|
-
...
|
|
316
|
-
...
|
|
213
|
+
...Be,
|
|
214
|
+
...me,
|
|
215
|
+
...ge,
|
|
216
|
+
...Pe,
|
|
217
|
+
...he,
|
|
218
|
+
...ye,
|
|
219
|
+
...Se,
|
|
220
|
+
...be,
|
|
221
|
+
...Ve,
|
|
222
|
+
...Ie,
|
|
223
|
+
...we,
|
|
224
|
+
...Fe,
|
|
317
225
|
multiple: Boolean,
|
|
318
226
|
required: Boolean,
|
|
319
227
|
size: [String, Number],
|
|
@@ -323,112 +231,112 @@ const De = {
|
|
|
323
231
|
},
|
|
324
232
|
label: String,
|
|
325
233
|
placeholder: String
|
|
326
|
-
},
|
|
234
|
+
}, Ce = ["update:modelValue", "focus", "blur"], Ne = ["for"], _e = { class: "vv-select__wrapper" }, Ee = ["id"], Re = ["disabled", "hidden"], ke = ["disabled", "value"], He = {
|
|
327
235
|
name: "VvSelect"
|
|
328
|
-
},
|
|
329
|
-
...
|
|
330
|
-
props:
|
|
331
|
-
emits:
|
|
332
|
-
setup(
|
|
333
|
-
const
|
|
334
|
-
modifiers:
|
|
335
|
-
disabled:
|
|
336
|
-
readonly:
|
|
337
|
-
loading:
|
|
338
|
-
icon:
|
|
339
|
-
iconPosition:
|
|
340
|
-
invalid:
|
|
341
|
-
valid:
|
|
236
|
+
}, qe = /* @__PURE__ */ U({
|
|
237
|
+
...He,
|
|
238
|
+
props: Oe,
|
|
239
|
+
emits: Ce,
|
|
240
|
+
setup(c, { emit: r }) {
|
|
241
|
+
const o = c, v = useSlots(), s = ref(), { HintSlot: f, hasHint: n, hasInvalid: b } = fe(o, v), {
|
|
242
|
+
modifiers: m,
|
|
243
|
+
disabled: u,
|
|
244
|
+
readonly: e,
|
|
245
|
+
loading: t,
|
|
246
|
+
icon: d,
|
|
247
|
+
iconPosition: a,
|
|
248
|
+
invalid: p,
|
|
249
|
+
valid: y,
|
|
342
250
|
floating: $,
|
|
343
251
|
multiple: V
|
|
344
|
-
} =
|
|
345
|
-
|
|
346
|
-
|
|
252
|
+
} = toRefs(o), P = computed(() => String(o.id || ae())), I = computed(() => `${P.value}-hint`), { focused: A } = useComponentFocus(s, r), _ = useElementVisibility(s);
|
|
253
|
+
watch(_, (i) => {
|
|
254
|
+
i && o.autofocus && (A.value = !0);
|
|
347
255
|
});
|
|
348
|
-
const { hasIcon: S, hasIconLeft:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
),
|
|
352
|
-
if (
|
|
256
|
+
const { hasIcon: S, hasIconLeft: H, hasIconRight: M } = useComponentIcon(
|
|
257
|
+
d,
|
|
258
|
+
a
|
|
259
|
+
), J = computed(() => !isEmpty(o.modelValue)), z = computed(() => o.disabled || o.readonly), X = computed(() => z.value ? -1 : o.tabindex), L = computed(() => {
|
|
260
|
+
if (o.invalid === !0)
|
|
353
261
|
return !0;
|
|
354
|
-
if (
|
|
262
|
+
if (o.valid === !0)
|
|
355
263
|
return !1;
|
|
356
|
-
}), { bemCssClasses:
|
|
357
|
-
modifiers:
|
|
358
|
-
valid:
|
|
359
|
-
invalid:
|
|
360
|
-
loading:
|
|
361
|
-
disabled:
|
|
362
|
-
readonly:
|
|
363
|
-
iconLeft:
|
|
364
|
-
iconRight:
|
|
365
|
-
dirty:
|
|
366
|
-
focus:
|
|
264
|
+
}), { bemCssClasses: Q } = useBemModifiers("vv-select", {
|
|
265
|
+
modifiers: m,
|
|
266
|
+
valid: y,
|
|
267
|
+
invalid: p,
|
|
268
|
+
loading: t,
|
|
269
|
+
disabled: u,
|
|
270
|
+
readonly: e,
|
|
271
|
+
iconLeft: H,
|
|
272
|
+
iconRight: M,
|
|
273
|
+
dirty: J,
|
|
274
|
+
focus: A,
|
|
367
275
|
floating: $,
|
|
368
276
|
multiple: V
|
|
369
|
-
}),
|
|
370
|
-
name:
|
|
371
|
-
tabindex:
|
|
372
|
-
disabled:
|
|
373
|
-
required:
|
|
374
|
-
size:
|
|
375
|
-
autocomplete:
|
|
376
|
-
multiple:
|
|
377
|
-
"aria-invalid":
|
|
378
|
-
"aria-describedby": !
|
|
379
|
-
"aria-errormessage":
|
|
380
|
-
})), { getOptionLabel:
|
|
381
|
-
function
|
|
382
|
-
return typeof
|
|
277
|
+
}), W = computed(() => ({
|
|
278
|
+
name: o.name,
|
|
279
|
+
tabindex: X.value,
|
|
280
|
+
disabled: z.value,
|
|
281
|
+
required: o.required,
|
|
282
|
+
size: o.size,
|
|
283
|
+
autocomplete: o.autocomplete,
|
|
284
|
+
multiple: o.multiple,
|
|
285
|
+
"aria-invalid": L.value,
|
|
286
|
+
"aria-describedby": !b.value && n.value ? I.value : void 0,
|
|
287
|
+
"aria-errormessage": b.value ? I.value : void 0
|
|
288
|
+
})), { getOptionLabel: Y, getOptionValue: Z } = useOptions(o);
|
|
289
|
+
function x(i) {
|
|
290
|
+
return typeof i == "string" || i.disabled === void 0 ? u.value : i.disabled;
|
|
383
291
|
}
|
|
384
|
-
const
|
|
385
|
-
get: () =>
|
|
386
|
-
set: (
|
|
387
|
-
Array.isArray(
|
|
292
|
+
const E = computed({
|
|
293
|
+
get: () => o.modelValue,
|
|
294
|
+
set: (i) => {
|
|
295
|
+
Array.isArray(i) && (i = i.filter((D) => D !== void 0)), r("update:modelValue", i);
|
|
388
296
|
}
|
|
389
297
|
});
|
|
390
|
-
return (
|
|
391
|
-
class:
|
|
298
|
+
return (i, D) => (g(), w("div", {
|
|
299
|
+
class: te(l(Q))
|
|
392
300
|
}, [
|
|
393
|
-
|
|
301
|
+
i.label ? (g(), w("label", {
|
|
394
302
|
key: 0,
|
|
395
|
-
for:
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
q(
|
|
399
|
-
|
|
303
|
+
for: l(P)
|
|
304
|
+
}, R(i.label), 9, Ne)) : F("", !0),
|
|
305
|
+
j("div", _e, [
|
|
306
|
+
q(i.$slots, "before", {}, () => [
|
|
307
|
+
l(H) ? (g(), k(G, T(N({ key: 0 }, l(S))), null, 16)) : F("", !0)
|
|
400
308
|
]),
|
|
401
|
-
|
|
402
|
-
id:
|
|
309
|
+
oe(j("select", N({
|
|
310
|
+
id: l(P),
|
|
403
311
|
ref_key: "select",
|
|
404
|
-
ref:
|
|
405
|
-
"onUpdate:modelValue":
|
|
406
|
-
},
|
|
407
|
-
|
|
312
|
+
ref: s,
|
|
313
|
+
"onUpdate:modelValue": D[0] || (D[0] = (B) => ne(E) ? E.value = B : null)
|
|
314
|
+
}, l(W)), [
|
|
315
|
+
i.placeholder ? (g(), w("option", {
|
|
408
316
|
key: 0,
|
|
409
317
|
value: void 0,
|
|
410
|
-
disabled: !
|
|
411
|
-
hidden: !
|
|
412
|
-
},
|
|
413
|
-
(
|
|
414
|
-
key:
|
|
415
|
-
disabled:
|
|
416
|
-
value:
|
|
417
|
-
},
|
|
418
|
-
], 16,
|
|
419
|
-
[
|
|
318
|
+
disabled: !i.unselectable,
|
|
319
|
+
hidden: !i.unselectable
|
|
320
|
+
}, R(i.placeholder), 9, Re)) : F("", !0),
|
|
321
|
+
(g(!0), w(re, null, ie(i.options, (B, ee) => (g(), w("option", {
|
|
322
|
+
key: ee,
|
|
323
|
+
disabled: x(B),
|
|
324
|
+
value: l(Z)(B)
|
|
325
|
+
}, R(l(Y)(B)), 9, ke))), 128))
|
|
326
|
+
], 16, Ee), [
|
|
327
|
+
[se, l(E)]
|
|
420
328
|
]),
|
|
421
|
-
q(
|
|
422
|
-
|
|
329
|
+
q(i.$slots, "after", {}, () => [
|
|
330
|
+
l(M) ? (g(), k(G, T(N({ key: 0 }, l(S))), null, 16)) : F("", !0)
|
|
423
331
|
])
|
|
424
332
|
]),
|
|
425
|
-
|
|
426
|
-
id:
|
|
333
|
+
le(l(f), {
|
|
334
|
+
id: l(I),
|
|
427
335
|
class: "vv-select__hint"
|
|
428
336
|
}, null, 8, ["id"])
|
|
429
337
|
], 2));
|
|
430
338
|
}
|
|
431
339
|
});
|
|
432
340
|
export {
|
|
433
|
-
|
|
341
|
+
qe as default
|
|
434
342
|
};
|