@volverjs/ui-vue 0.0.1 → 0.0.3-beta.2
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 +17 -0
- package/auto-imports.d.ts +289 -0
- package/dist/components/VvButton/VvButton.es.js +159 -147
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
- package/dist/components/VvButton/index.d.ts +4 -4
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
- package/dist/components/VvButtonGroup/index.d.ts +5 -5
- package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
- package/dist/components/VvCombobox/index.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
- package/dist/components/VvDropdown/index.d.ts +12 -0
- package/dist/components/VvInputText/VvInputText.es.js +221 -213
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvSelect/VvSelect.es.js +186 -167
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
- package/dist/components/VvSelect/index.d.ts +10 -17
- package/dist/components/VvTextarea/VvTextarea.es.js +241 -277
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
- package/dist/components/VvTextarea/index.d.ts +5 -5
- 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/index.es.js +1046 -976
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
- package/dist/composables/group/types/IGroupState.d.ts +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1127 -1057
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +35 -4
- package/dist/resolvers/unplugin.es.js +26 -24
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Button/Button.settings.d.ts +9 -11
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
- package/dist/stories/InputText/InputText.settings.d.ts +23 -23
- package/dist/stories/Select/Select.settings.d.ts +42 -23
- package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/stories/argTypes.d.ts +50 -1
- package/package.json +31 -23
- 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/index.ts +28 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
- package/src/components/VvButtonGroup/index.ts +3 -6
- package/src/components/VvCombobox/VvCombobox.vue +45 -11
- package/src/components/VvCombobox/index.ts +6 -0
- package/src/components/VvDropdown/VvDropdown.vue +9 -6
- package/src/components/VvDropdown/index.ts +11 -1
- package/src/components/VvInputText/VvInputText.vue +10 -8
- package/src/components/VvSelect/VvSelect.vue +23 -1
- package/src/components/VvSelect/index.ts +8 -11
- package/src/components/VvTextarea/VvTextarea.vue +9 -21
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/composables/group/types/IButtonGroupState.ts +1 -1
- package/src/composables/group/types/IGroupState.ts +1 -1
- package/src/composables/group/useInjectedGroupState.ts +3 -3
- package/src/composables/useTextCount.ts +1 -1
- package/src/props/index.ts +33 -15
- package/src/resolvers/unplugin.ts +22 -13
- 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.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.settings.ts +2 -7
- 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 +6 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -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 +5 -0
- package/src/stories/Combobox/Combobox.stories.mdx +52 -1
- package/src/stories/Combobox/Combobox.test.ts +7 -0
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +18 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -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 +9 -23
- package/src/stories/Select/Select.stories.mdx +61 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/stories/argTypes.ts +46 -22
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { unref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { iconExists as
|
|
5
|
-
function
|
|
1
|
+
import { unref as l, toRefs as Y, computed as s, h as g, watch as pe, defineComponent as H, ref as $, inject as Ce, openBlock as E, createBlock as P, mergeProps as B, createCommentVNode as O, useSlots as De, createElementBlock as z, normalizeClass as Pe, toDisplayString as ie, createElementVNode as le, renderSlot as X, normalizeProps as N, guardReactiveProps as K, withDirectives as _e, isRef as Oe, vModelDynamic as Re, createTextVNode as He, createVNode as Le } from "vue";
|
|
2
|
+
import { toReactive as xe, useFocus as Ve, useElementVisibility as Ne } from "@vueuse/core";
|
|
3
|
+
import { nanoid as ke } from "nanoid";
|
|
4
|
+
import { iconExists as k, Icon as Me, addIcon as Be } from "@iconify/vue";
|
|
5
|
+
function oe(n, t) {
|
|
6
6
|
if (n && Object.keys(n).length && t) {
|
|
7
7
|
if (t.indexOf(".") === -1)
|
|
8
8
|
return n[t];
|
|
9
9
|
{
|
|
10
10
|
const e = t.split(".");
|
|
11
|
-
let
|
|
12
|
-
for (let
|
|
11
|
+
let i = n;
|
|
12
|
+
for (let r = 0, p = e.length; r < p; ++r) {
|
|
13
13
|
if (n == null)
|
|
14
14
|
return null;
|
|
15
|
-
|
|
15
|
+
i = i[e[r]];
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return i;
|
|
18
18
|
}
|
|
19
19
|
} else
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
function R(n) {
|
|
23
|
-
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(
|
|
23
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(l(n));
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function $e(n) {
|
|
26
26
|
return typeof n == "string" || n instanceof String;
|
|
27
27
|
}
|
|
28
28
|
function se(n) {
|
|
@@ -32,37 +32,37 @@ function se(n) {
|
|
|
32
32
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
33
33
|
)) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return Array.isArray(n) ? n.filter((t) =>
|
|
35
|
+
function M(n) {
|
|
36
|
+
return Array.isArray(n) ? n.filter((t) => $e(t)).join(" ") : n;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ue(n, t) {
|
|
39
39
|
const {
|
|
40
40
|
invalid: e,
|
|
41
|
-
valid:
|
|
42
|
-
hint:
|
|
41
|
+
valid: i,
|
|
42
|
+
hint: r,
|
|
43
43
|
loading: p
|
|
44
44
|
} = t, {
|
|
45
45
|
hintLabel: u,
|
|
46
46
|
modelValue: w,
|
|
47
47
|
valid: h,
|
|
48
48
|
validLabel: m,
|
|
49
|
-
invalid:
|
|
49
|
+
invalid: o,
|
|
50
50
|
invalidLabel: c,
|
|
51
51
|
...b
|
|
52
|
-
} = Y(n), v =
|
|
53
|
-
() => !!(u && u.value ||
|
|
52
|
+
} = Y(n), v = oe(b, "loading"), S = oe(b, "loadingLabel"), T = s(() => o.value ? !!(o.value && e || c != null && c.value && Array.isArray(c.value) && c.value.length > 0 || c != null && c.value && !R(c)) : !1), y = s(
|
|
53
|
+
() => !!(u && u.value || r)
|
|
54
54
|
), C = s(
|
|
55
|
-
() => !!(m && m.value ||
|
|
56
|
-
), D = s(
|
|
57
|
-
() => !!(v != null && v.value && p || v != null && v.value && (S != null && S.value))
|
|
55
|
+
() => !!(m && m.value || i)
|
|
58
56
|
), L = s(
|
|
59
|
-
() =>
|
|
57
|
+
() => !!(v != null && v.value && p || v != null && v.value && (S != null && S.value))
|
|
58
|
+
), _ = s(
|
|
59
|
+
() => y.value || C.value || T.value || L.value
|
|
60
60
|
);
|
|
61
61
|
return {
|
|
62
62
|
hasInvalid: T,
|
|
63
63
|
hasHint: y,
|
|
64
64
|
hasValid: C,
|
|
65
|
-
hasLoading:
|
|
65
|
+
hasLoading: L,
|
|
66
66
|
HintSlot: {
|
|
67
67
|
name: "HintSlot",
|
|
68
68
|
props: {
|
|
@@ -72,25 +72,25 @@ function $e(n, t) {
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
setup(x) {
|
|
75
|
-
const
|
|
76
|
-
const
|
|
75
|
+
const V = s(() => {
|
|
76
|
+
const D = xe({
|
|
77
77
|
hintLabel: u,
|
|
78
78
|
modelValue: w,
|
|
79
79
|
valid: h,
|
|
80
80
|
validLabel: m,
|
|
81
|
-
invalid:
|
|
81
|
+
invalid: o,
|
|
82
82
|
invalidLabel: c,
|
|
83
83
|
loading: v,
|
|
84
84
|
loadingLabel: S,
|
|
85
85
|
...x.params
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return o != null && o.value ? (e == null ? void 0 : e(D)) || M(c == null ? void 0 : c.value) || (u == null ? void 0 : u.value) : h != null && h.value ? (i == null ? void 0 : i(D)) || M(m == null ? void 0 : m.value) || (u == null ? void 0 : u.value) : v != null && v.value ? (p == null ? void 0 : p(D)) || M(S == null ? void 0 : S.value) || (u == null ? void 0 : u.value) : (r == null ? void 0 : r(D)) || M(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
|
|
88
88
|
});
|
|
89
89
|
return {
|
|
90
|
-
isVisible:
|
|
90
|
+
isVisible: _,
|
|
91
91
|
hasInvalid: T,
|
|
92
92
|
hasValid: C,
|
|
93
|
-
hintContent:
|
|
93
|
+
hintContent: V
|
|
94
94
|
};
|
|
95
95
|
},
|
|
96
96
|
render() {
|
|
@@ -106,10 +106,10 @@ function $e(n, t) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
109
|
+
function We(n, t, e) {
|
|
110
|
+
const i = s(
|
|
111
111
|
() => !!(n != null && n.value && t.value === "left" || e != null && e.iconLeft)
|
|
112
|
-
),
|
|
112
|
+
), r = s(
|
|
113
113
|
() => !!(n != null && n.value && t.value === "right" || e != null && e.iconRight)
|
|
114
114
|
), p = s(
|
|
115
115
|
() => !!(n != null && n.value && t.value === "top" || e != null && e.iconTop)
|
|
@@ -118,50 +118,50 @@ function Ue(n, t, e) {
|
|
|
118
118
|
);
|
|
119
119
|
return {
|
|
120
120
|
hasIcon: s(() => typeof (n == null ? void 0 : n.value) == "string" ? { name: n == null ? void 0 : n.value } : n == null ? void 0 : n.value),
|
|
121
|
-
hasIconLeft:
|
|
122
|
-
hasIconRight:
|
|
121
|
+
hasIconLeft: i,
|
|
122
|
+
hasIconRight: r,
|
|
123
123
|
hasIconTop: p,
|
|
124
124
|
hasIconBottom: u
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
const { focused: e } =
|
|
129
|
-
return
|
|
130
|
-
t(
|
|
127
|
+
function Fe(n, t) {
|
|
128
|
+
const { focused: e } = Ve(n);
|
|
129
|
+
return pe(e, (i) => {
|
|
130
|
+
t(i ? "focus" : "blur", l(n));
|
|
131
131
|
}), {
|
|
132
132
|
focused: e
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let
|
|
135
|
+
function je(n, t, e = 0) {
|
|
136
|
+
let i;
|
|
137
137
|
return typeof e == "string" && (e = parseInt(e)), s({
|
|
138
138
|
get: () => n == null ? void 0 : n.value,
|
|
139
|
-
set: (
|
|
140
|
-
|
|
141
|
-
t("update:modelValue",
|
|
139
|
+
set: (r) => {
|
|
140
|
+
i && clearTimeout(i), i = setTimeout(() => {
|
|
141
|
+
t("update:modelValue", r);
|
|
142
142
|
}, e);
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
const e = s(() => (
|
|
146
|
+
function qe(n, t) {
|
|
147
|
+
const e = s(() => (l(n) ?? "").length), i = s(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && e.value < (t == null ? void 0 : t.lowerLimit) ? e.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && e.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - e.value : 0), r = s(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${e.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? i.value === 0 ? void 0 : i : e.value);
|
|
148
148
|
return {
|
|
149
149
|
length: e,
|
|
150
|
-
gap:
|
|
151
|
-
formatted:
|
|
150
|
+
gap: i,
|
|
151
|
+
formatted: r
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function ve(n, t) {
|
|
155
155
|
const e = { [`${n}`]: !0 };
|
|
156
156
|
return {
|
|
157
|
-
bemCssClasses: s(() => Object.keys(t).reduce((
|
|
158
|
-
const u =
|
|
157
|
+
bemCssClasses: s(() => Object.keys(t).reduce((r, p) => {
|
|
158
|
+
const u = l(t[p]) || !1;
|
|
159
159
|
if (!u)
|
|
160
|
-
return
|
|
160
|
+
return r;
|
|
161
161
|
if (p === "modifiers") {
|
|
162
162
|
const w = Array.isArray(u) ? u : u.split(" ");
|
|
163
163
|
return {
|
|
164
|
-
...
|
|
164
|
+
...r,
|
|
165
165
|
...w.reduce(
|
|
166
166
|
(h, m) => ({
|
|
167
167
|
...h,
|
|
@@ -172,13 +172,13 @@ function pe(n, t) {
|
|
|
172
172
|
};
|
|
173
173
|
} else
|
|
174
174
|
return {
|
|
175
|
-
...
|
|
175
|
+
...r,
|
|
176
176
|
[`${n}--${se(p)}`]: u
|
|
177
177
|
};
|
|
178
178
|
}, e) || {})
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const ze = "ds", Xe = {
|
|
182
182
|
color: String,
|
|
183
183
|
width: {
|
|
184
184
|
type: [String, Number]
|
|
@@ -209,120 +209,126 @@ const qe = "ds", ze = {
|
|
|
209
209
|
modifiers: {
|
|
210
210
|
type: [String, Array]
|
|
211
211
|
}
|
|
212
|
-
},
|
|
212
|
+
}, Ke = {
|
|
213
213
|
name: "VvIcon"
|
|
214
214
|
}, A = /* @__PURE__ */ H({
|
|
215
|
-
...
|
|
216
|
-
props:
|
|
215
|
+
...Ke,
|
|
216
|
+
props: Xe,
|
|
217
217
|
setup(n) {
|
|
218
|
-
const t = n, e =
|
|
219
|
-
modifiers:
|
|
220
|
-
}), u = s(() => t.provider || (
|
|
221
|
-
const
|
|
222
|
-
return
|
|
223
|
-
const v = `@${u.value}:${b.prefix}:${
|
|
224
|
-
if (
|
|
218
|
+
const t = n, e = $(!0), { modifiers: i } = Y(t), r = Ce(ze), { bemCssClasses: p } = ve("vv-icon", {
|
|
219
|
+
modifiers: i
|
|
220
|
+
}), u = s(() => t.provider || (r == null ? void 0 : r.provider)), w = s(() => {
|
|
221
|
+
const o = t.name ?? "", c = `@${u.value}:${t.prefix}:${t.name}`;
|
|
222
|
+
return k(o) ? o : k(c) ? c : (r == null ? void 0 : r.iconsCollections.find((b) => {
|
|
223
|
+
const v = `@${u.value}:${b.prefix}:${o}`;
|
|
224
|
+
if (k(v))
|
|
225
225
|
return v;
|
|
226
|
-
})) ||
|
|
226
|
+
})) || o;
|
|
227
227
|
});
|
|
228
|
-
function h(
|
|
228
|
+
function h(o) {
|
|
229
229
|
let c = null;
|
|
230
230
|
if (typeof window > "u") {
|
|
231
231
|
const { JSDOM: T } = require("jsdom");
|
|
232
232
|
c = new T().window;
|
|
233
233
|
}
|
|
234
|
-
return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(
|
|
234
|
+
return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
|
|
235
235
|
}
|
|
236
|
-
function m(
|
|
237
|
-
const c = h(
|
|
238
|
-
c && b &&
|
|
236
|
+
function m(o) {
|
|
237
|
+
const c = h(o), b = (c == null ? void 0 : c.innerHTML.trim()) || "";
|
|
238
|
+
c && b && Be(`@${u.value}:${t.prefix}:${t.name}`, {
|
|
239
239
|
body: b,
|
|
240
240
|
height: c.viewBox.baseVal.height,
|
|
241
241
|
width: c.viewBox.baseVal.width
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
}).catch((
|
|
247
|
-
throw new Error(`During fetch icon: ${
|
|
248
|
-
})) : t.svg && m(t.svg)), (
|
|
244
|
+
return r && (t.src && !k(`@${u.value}:${t.prefix}:${t.name}`) ? (e.value = !1, r.fetchIcon(t.src).then((o) => {
|
|
245
|
+
o && (m(o), e.value = !0);
|
|
246
|
+
}).catch((o) => {
|
|
247
|
+
throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
|
|
248
|
+
})) : t.svg && m(t.svg)), (o, c) => e.value ? (E(), P(l(Me), B({
|
|
249
249
|
key: 0,
|
|
250
|
-
class:
|
|
250
|
+
class: l(p)
|
|
251
251
|
}, {
|
|
252
|
-
inline:
|
|
253
|
-
width:
|
|
254
|
-
height:
|
|
255
|
-
horizontalFlip:
|
|
256
|
-
verticalFlip:
|
|
257
|
-
flip:
|
|
258
|
-
rotate:
|
|
259
|
-
color:
|
|
260
|
-
onLoad:
|
|
261
|
-
icon:
|
|
252
|
+
inline: o.inline,
|
|
253
|
+
width: o.width,
|
|
254
|
+
height: o.height,
|
|
255
|
+
horizontalFlip: o.horizontalFlip,
|
|
256
|
+
verticalFlip: o.verticalFlip,
|
|
257
|
+
flip: o.flip,
|
|
258
|
+
rotate: o.rotate,
|
|
259
|
+
color: o.color,
|
|
260
|
+
onLoad: o.onLoad,
|
|
261
|
+
icon: l(w)
|
|
262
262
|
}), null, 16, ["class"])) : O("", !0);
|
|
263
263
|
}
|
|
264
|
-
}),
|
|
264
|
+
}), Ze = {
|
|
265
265
|
valid: Boolean,
|
|
266
266
|
validLabel: [String, Array]
|
|
267
|
-
},
|
|
267
|
+
}, Ge = {
|
|
268
268
|
invalid: Boolean,
|
|
269
269
|
invalidLabel: [String, Array]
|
|
270
|
-
},
|
|
270
|
+
}, Ye = {
|
|
271
271
|
loading: Boolean,
|
|
272
272
|
loadingLabel: String
|
|
273
|
-
}, Ye = {
|
|
274
|
-
disabled: Boolean
|
|
275
273
|
}, Je = {
|
|
276
|
-
|
|
274
|
+
disabled: Boolean
|
|
277
275
|
}, Qe = {
|
|
278
|
-
|
|
276
|
+
readonly: Boolean
|
|
279
277
|
}, et = {
|
|
280
|
-
|
|
278
|
+
modifiers: [String, Array]
|
|
281
279
|
}, tt = {
|
|
280
|
+
hintLabel: { type: String, default: "" }
|
|
281
|
+
}, nt = {
|
|
282
282
|
count: {
|
|
283
283
|
type: [Boolean, String],
|
|
284
284
|
default: !1,
|
|
285
285
|
validator: (n) => [!0, !1, "limit", "countdown"].includes(n)
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, rt = {
|
|
288
288
|
debounce: [Number, String]
|
|
289
289
|
}, ue = {
|
|
290
290
|
LEFT: "left",
|
|
291
291
|
RIGHT: "right"
|
|
292
|
-
},
|
|
292
|
+
}, at = {
|
|
293
293
|
icon: { type: [String, Object] },
|
|
294
294
|
iconPosition: {
|
|
295
295
|
type: String,
|
|
296
296
|
validation: (n) => Object.values(ue).includes(n),
|
|
297
297
|
default: ue.RIGHT
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, it = {
|
|
300
300
|
tabindex: { type: [String, Number], default: 0 }
|
|
301
|
+
}, lt = {
|
|
302
|
+
floating: Boolean
|
|
301
303
|
}, ot = {
|
|
302
304
|
id: [String, Number],
|
|
303
305
|
name: { type: String, required: !0 }
|
|
304
|
-
},
|
|
306
|
+
}, st = {
|
|
307
|
+
autofocus: Boolean
|
|
308
|
+
}, ut = {
|
|
309
|
+
autocomplete: { type: String, default: "off" }
|
|
310
|
+
}, ct = {
|
|
305
311
|
...ot,
|
|
306
|
-
...
|
|
307
|
-
...
|
|
312
|
+
...st,
|
|
313
|
+
...ut,
|
|
314
|
+
...it,
|
|
308
315
|
...Je,
|
|
309
|
-
...
|
|
316
|
+
...Qe,
|
|
310
317
|
...Ze,
|
|
311
|
-
...et,
|
|
312
318
|
...Ge,
|
|
313
|
-
...Qe,
|
|
314
319
|
...tt,
|
|
320
|
+
...Ye,
|
|
321
|
+
...et,
|
|
315
322
|
...nt,
|
|
316
323
|
...rt,
|
|
317
|
-
|
|
318
|
-
|
|
324
|
+
...at,
|
|
325
|
+
...lt,
|
|
319
326
|
minlength: Number,
|
|
320
327
|
maxlength: Number,
|
|
321
328
|
placeholder: String,
|
|
322
329
|
required: Boolean,
|
|
323
|
-
label: String
|
|
324
|
-
|
|
325
|
-
}, r = {
|
|
330
|
+
label: String
|
|
331
|
+
}, a = {
|
|
326
332
|
TEXT: "text",
|
|
327
333
|
PASSWORD: "password",
|
|
328
334
|
NUMBER: "number",
|
|
@@ -336,20 +342,20 @@ const qe = "ds", ze = {
|
|
|
336
342
|
DATETIME_LOCAL: "datetime-local",
|
|
337
343
|
MONTH: "month",
|
|
338
344
|
WEEK: "week"
|
|
339
|
-
},
|
|
345
|
+
}, I = {
|
|
340
346
|
PASSWORD_SHOW: "eye-on",
|
|
341
347
|
PASSWORD_HIDE: "eye-off",
|
|
342
348
|
DATE: "calendar",
|
|
343
349
|
TIME: "time",
|
|
344
350
|
COLOR: "color",
|
|
345
351
|
SEARCH: "close"
|
|
346
|
-
},
|
|
347
|
-
...
|
|
352
|
+
}, dt = ["update:modelValue", "focus", "blur", "keyup"], pt = {
|
|
353
|
+
...ct,
|
|
348
354
|
modelValue: [String, Number],
|
|
349
355
|
type: {
|
|
350
356
|
type: String,
|
|
351
|
-
default:
|
|
352
|
-
validator: (n) => Object.values(
|
|
357
|
+
default: a.TEXT,
|
|
358
|
+
validator: (n) => Object.values(a).includes(n)
|
|
353
359
|
},
|
|
354
360
|
min: [Number, Date, String],
|
|
355
361
|
max: [Number, Date, String],
|
|
@@ -358,15 +364,15 @@ const qe = "ds", ze = {
|
|
|
358
364
|
multiple: Boolean,
|
|
359
365
|
iconShowPassword: {
|
|
360
366
|
type: String,
|
|
361
|
-
default:
|
|
367
|
+
default: I.PASSWORD_SHOW
|
|
362
368
|
},
|
|
363
369
|
iconHidePassword: {
|
|
364
370
|
type: String,
|
|
365
|
-
default:
|
|
371
|
+
default: I.PASSWORD_HIDE
|
|
366
372
|
},
|
|
367
373
|
iconClear: {
|
|
368
374
|
type: String,
|
|
369
|
-
default:
|
|
375
|
+
default: I.SEARCH
|
|
370
376
|
},
|
|
371
377
|
labelStepUp: {
|
|
372
378
|
type: String,
|
|
@@ -407,25 +413,25 @@ const qe = "ds", ze = {
|
|
|
407
413
|
},
|
|
408
414
|
iconShow: {
|
|
409
415
|
type: String,
|
|
410
|
-
default:
|
|
416
|
+
default: I.PASSWORD_SHOW
|
|
411
417
|
},
|
|
412
418
|
iconHide: {
|
|
413
419
|
type: String,
|
|
414
|
-
default:
|
|
420
|
+
default: I.PASSWORD_HIDE
|
|
415
421
|
}
|
|
416
422
|
},
|
|
417
423
|
emits: ["toggle-password"],
|
|
418
424
|
setup(n, { emit: t }) {
|
|
419
|
-
const e =
|
|
425
|
+
const e = $(!1), i = s(
|
|
420
426
|
() => e.value ? n.iconHide : n.iconShow
|
|
421
427
|
);
|
|
422
|
-
function
|
|
428
|
+
function r(p) {
|
|
423
429
|
p == null || p.stopPropagation(), n.disabled || (e.value = !e.value, t("toggle-password", e.value));
|
|
424
430
|
}
|
|
425
431
|
return {
|
|
426
432
|
active: e,
|
|
427
|
-
activeIcon:
|
|
428
|
-
onClick:
|
|
433
|
+
activeIcon: i,
|
|
434
|
+
onClick: r
|
|
429
435
|
};
|
|
430
436
|
},
|
|
431
437
|
render() {
|
|
@@ -468,8 +474,8 @@ const qe = "ds", ze = {
|
|
|
468
474
|
const e = s(() => n.mode === "up");
|
|
469
475
|
return {
|
|
470
476
|
isUp: e,
|
|
471
|
-
onClick: (
|
|
472
|
-
|
|
477
|
+
onClick: (r) => {
|
|
478
|
+
r == null || r.stopPropagation(), n.disabled || t(e.value ? "step-up" : "step-down");
|
|
473
479
|
}
|
|
474
480
|
};
|
|
475
481
|
},
|
|
@@ -504,8 +510,8 @@ const qe = "ds", ze = {
|
|
|
504
510
|
},
|
|
505
511
|
emits: ["clear"],
|
|
506
512
|
setup(n, { emit: t }) {
|
|
507
|
-
function e(
|
|
508
|
-
|
|
513
|
+
function e(i) {
|
|
514
|
+
i == null || i.stopPropagation(), n.disabled || t("clear");
|
|
509
515
|
}
|
|
510
516
|
return {
|
|
511
517
|
onClick: e
|
|
@@ -553,23 +559,23 @@ function G(n, t) {
|
|
|
553
559
|
render() {
|
|
554
560
|
let e = null;
|
|
555
561
|
switch (n) {
|
|
556
|
-
case
|
|
557
|
-
const { onClear:
|
|
562
|
+
case a.SEARCH: {
|
|
563
|
+
const { onClear: i } = this.$attrs;
|
|
558
564
|
e = [
|
|
559
565
|
g(de, {
|
|
560
566
|
disabled: this.isDisabled,
|
|
561
567
|
label: this.labelShowPassword,
|
|
562
|
-
onClear:
|
|
568
|
+
onClear: i
|
|
563
569
|
})
|
|
564
570
|
];
|
|
565
571
|
break;
|
|
566
572
|
}
|
|
567
|
-
case
|
|
568
|
-
const { onTogglePassword:
|
|
573
|
+
case a.PASSWORD: {
|
|
574
|
+
const { onTogglePassword: i } = this.$attrs;
|
|
569
575
|
e = [
|
|
570
576
|
g(ce, {
|
|
571
577
|
disabled: this.isDisabled,
|
|
572
|
-
onTogglePassword:
|
|
578
|
+
onTogglePassword: i,
|
|
573
579
|
labelShow: this.labelShowPassword,
|
|
574
580
|
labelHide: this.labelHidePassword,
|
|
575
581
|
iconShow: this.iconShowPassword,
|
|
@@ -578,22 +584,22 @@ function G(n, t) {
|
|
|
578
584
|
];
|
|
579
585
|
break;
|
|
580
586
|
}
|
|
581
|
-
case
|
|
582
|
-
const { onStepUp:
|
|
587
|
+
case a.NUMBER: {
|
|
588
|
+
const { onStepUp: i, onStepDown: r } = this.$attrs;
|
|
583
589
|
e = [
|
|
584
590
|
g(Z, {
|
|
585
591
|
mode: "up",
|
|
586
592
|
disabled: this.isDisabled || t.max !== void 0 && t.modelValue === t.max,
|
|
587
593
|
label: this.labelStepUp,
|
|
588
|
-
onStepUp:
|
|
589
|
-
onStepDown:
|
|
594
|
+
onStepUp: i,
|
|
595
|
+
onStepDown: r
|
|
590
596
|
}),
|
|
591
597
|
g(Z, {
|
|
592
598
|
mode: "down",
|
|
593
599
|
disabled: this.isDisabled || t.min !== void 0 && t.modelValue === t.min,
|
|
594
600
|
label: this.labelStepDown,
|
|
595
|
-
onStepUp:
|
|
596
|
-
onStepDown:
|
|
601
|
+
onStepUp: i,
|
|
602
|
+
onStepDown: r
|
|
597
603
|
})
|
|
598
604
|
];
|
|
599
605
|
break;
|
|
@@ -603,68 +609,72 @@ function G(n, t) {
|
|
|
603
609
|
}
|
|
604
610
|
};
|
|
605
611
|
}
|
|
606
|
-
const
|
|
612
|
+
const vt = ["for"], ft = { class: "vv-input-text__wrapper" }, mt = ["id"], St = {
|
|
607
613
|
key: 0,
|
|
608
614
|
class: "vv-input-text__limit"
|
|
609
|
-
},
|
|
615
|
+
}, ht = {
|
|
610
616
|
name: "VvInputText"
|
|
611
|
-
},
|
|
612
|
-
...
|
|
613
|
-
props:
|
|
614
|
-
emits:
|
|
617
|
+
}, Et = /* @__PURE__ */ H({
|
|
618
|
+
...ht,
|
|
619
|
+
props: pt,
|
|
620
|
+
emits: dt,
|
|
615
621
|
setup(n, { emit: t }) {
|
|
616
|
-
const e = n,
|
|
622
|
+
const e = n, i = De(), r = $(), {
|
|
617
623
|
icon: p,
|
|
618
624
|
iconPosition: u,
|
|
619
625
|
label: w,
|
|
620
626
|
modelValue: h,
|
|
621
627
|
count: m,
|
|
622
|
-
valid:
|
|
628
|
+
valid: o,
|
|
623
629
|
invalid: c,
|
|
624
630
|
loading: b
|
|
625
|
-
} = Y(e), v = s(() => String(e.id ||
|
|
631
|
+
} = Y(e), v = s(() => String(e.id || ke())), S = s(() => `${v.value}-hint`), T = s(
|
|
626
632
|
() => e.floating && R(e.placeholder) ? " " : e.placeholder
|
|
627
|
-
), y =
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
),
|
|
632
|
-
|
|
633
|
+
), y = je(h, t, e.debounce), { focused: C } = Fe(r, t), L = Ne(r);
|
|
634
|
+
pe(L, (d) => {
|
|
635
|
+
d && e.autofocus && (C.value = !0);
|
|
636
|
+
});
|
|
637
|
+
const _ = $(!1), x = s(() => e.type === a.PASSWORD), V = () => {
|
|
638
|
+
_.value = !_.value;
|
|
639
|
+
}, D = s(
|
|
640
|
+
() => e.type === a.TIME || e.type === a.DATETIME_LOCAL || e.type === a.DATE || e.type === a.WEEK || e.type === a.MONTH
|
|
641
|
+
), fe = s(() => e.type === a.NUMBER), J = () => {
|
|
642
|
+
F.value && (r.value.stepUp(), y.value = l(r).value);
|
|
633
643
|
}, Q = () => {
|
|
634
|
-
F.value && (
|
|
635
|
-
},
|
|
644
|
+
F.value && (r.value.stepDown(), y.value = l(r).value);
|
|
645
|
+
}, me = s(() => e.type === a.SEARCH), ee = () => {
|
|
636
646
|
y.value = void 0;
|
|
637
|
-
}, { hasIconLeft: te, hasIconRight: U, hasIcon: ne } =
|
|
647
|
+
}, { hasIconLeft: te, hasIconRight: U, hasIcon: ne } = We(
|
|
638
648
|
p,
|
|
639
649
|
u
|
|
640
650
|
), W = s(() => {
|
|
641
651
|
switch (e.type) {
|
|
642
|
-
case
|
|
643
|
-
return { name:
|
|
644
|
-
case
|
|
645
|
-
case
|
|
646
|
-
case
|
|
647
|
-
case
|
|
648
|
-
return { name:
|
|
649
|
-
case
|
|
650
|
-
return { name:
|
|
652
|
+
case a.COLOR:
|
|
653
|
+
return { name: I.COLOR };
|
|
654
|
+
case a.DATE:
|
|
655
|
+
case a.DATETIME_LOCAL:
|
|
656
|
+
case a.WEEK:
|
|
657
|
+
case a.MONTH:
|
|
658
|
+
return { name: I.DATE };
|
|
659
|
+
case a.TIME:
|
|
660
|
+
return { name: I.TIME };
|
|
651
661
|
default:
|
|
652
662
|
return "";
|
|
653
663
|
}
|
|
654
|
-
}), { formatted:
|
|
664
|
+
}), { formatted: Se } = qe(y, {
|
|
655
665
|
mode: e.count,
|
|
656
666
|
upperLimit: e.maxlength,
|
|
657
667
|
lowerLimit: e.minlength
|
|
658
|
-
}), F = s(() => !e.disabled && !e.readonly),
|
|
668
|
+
}), F = s(() => !e.disabled && !e.readonly), he = s(
|
|
659
669
|
() => F.value ? e.tabindex : -1
|
|
660
|
-
), re = s(() => !R(h)),
|
|
670
|
+
), re = s(() => !R(h)), ge = s(() => {
|
|
661
671
|
if (c.value === !0)
|
|
662
672
|
return !0;
|
|
663
|
-
if (
|
|
673
|
+
if (o.value === !0)
|
|
664
674
|
return !1;
|
|
665
|
-
}), { bemCssClasses:
|
|
675
|
+
}), { bemCssClasses: be } = ve("vv-input-text", {
|
|
666
676
|
modifiers: e.modifiers,
|
|
667
|
-
valid:
|
|
677
|
+
valid: o,
|
|
668
678
|
invalid: c,
|
|
669
679
|
loading: b,
|
|
670
680
|
disabled: e.disabled,
|
|
@@ -674,91 +684,89 @@ const ut = ["for"], ct = { class: "vv-input-text__wrapper" }, dt = ["id"], pt =
|
|
|
674
684
|
floating: e.floating && !R(e.label),
|
|
675
685
|
dirty: re,
|
|
676
686
|
focus: C
|
|
677
|
-
}),
|
|
678
|
-
const d = (() =>
|
|
687
|
+
}), ye = s(() => {
|
|
688
|
+
const d = (() => x.value && _.value || D.value && !re.value && !C.value ? a.TEXT : e.type)(), f = {
|
|
679
689
|
type: d,
|
|
680
690
|
name: e.name,
|
|
681
|
-
tabindex:
|
|
691
|
+
tabindex: he.value,
|
|
682
692
|
disabled: e.disabled,
|
|
683
693
|
readonly: e.readonly,
|
|
684
694
|
required: e.required,
|
|
685
695
|
autocomplete: e.autocomplete,
|
|
686
|
-
"aria-invalid":
|
|
687
|
-
"aria-describedby": !ae.value &&
|
|
696
|
+
"aria-invalid": ge.value,
|
|
697
|
+
"aria-describedby": !ae.value && Ee.value ? S.value : void 0,
|
|
688
698
|
"aria-errormessage": ae.value ? S.value : void 0
|
|
689
699
|
};
|
|
690
|
-
return (d ===
|
|
700
|
+
return (d === a.DATE || d === a.MONTH || d === a.WEEK || d === a.TIME || d === a.DATETIME_LOCAL || d === a.NUMBER) && (f.step = e.step, f.max = String(e.max), f.min = String(e.min)), (d === a.TEXT || d === a.SEARCH || d === a.URL || d === a.TEL || d === a.EMAIL || d === a.PASSWORD || d === a.NUMBER) && (f.placeholder = T.value), (d === a.TEXT || d === a.SEARCH || d === a.URL || d === a.TEL || d === a.EMAIL || d === a.PASSWORD) && (f.minlength = e.minlength, f.maxlength = e.maxlength, f.pattern = e.pattern), d === a.EMAIL && (f.multiple = e.multiple), f;
|
|
691
701
|
}), j = s(() => ({
|
|
692
702
|
valid: e.valid,
|
|
693
703
|
invalid: e.invalid,
|
|
694
704
|
modelValue: e.modelValue,
|
|
695
|
-
togglePassword:
|
|
705
|
+
togglePassword: V,
|
|
696
706
|
stepUp: J,
|
|
697
707
|
stepDown: Q,
|
|
698
708
|
clear: ee
|
|
699
|
-
})), { HintSlot:
|
|
700
|
-
|
|
709
|
+
})), { HintSlot: we, hasHint: Ee, hasInvalid: ae } = Ue(e, i), Ie = G(
|
|
710
|
+
a.PASSWORD,
|
|
701
711
|
e
|
|
702
|
-
),
|
|
703
|
-
|
|
712
|
+
), Ae = G(
|
|
713
|
+
a.NUMBER,
|
|
704
714
|
e
|
|
705
|
-
),
|
|
706
|
-
|
|
715
|
+
), Te = G(
|
|
716
|
+
a.SEARCH,
|
|
707
717
|
e
|
|
708
718
|
);
|
|
709
|
-
return
|
|
710
|
-
|
|
711
|
-
}), (d, f) => (I(), z("div", {
|
|
712
|
-
class: Pe(i(he))
|
|
719
|
+
return (d, f) => (E(), z("div", {
|
|
720
|
+
class: Pe(l(be))
|
|
713
721
|
}, [
|
|
714
|
-
|
|
722
|
+
l(w) ? (E(), z("label", {
|
|
715
723
|
key: 0,
|
|
716
|
-
for:
|
|
724
|
+
for: l(v),
|
|
717
725
|
class: "vv-input-text__label"
|
|
718
|
-
},
|
|
719
|
-
|
|
720
|
-
X(d.$slots, "before",
|
|
721
|
-
|
|
726
|
+
}, ie(l(w)), 9, vt)) : O("", !0),
|
|
727
|
+
le("div", ft, [
|
|
728
|
+
X(d.$slots, "before", N(K(l(j))), () => [
|
|
729
|
+
l(te) ? (E(), P(A, B({
|
|
722
730
|
key: 0,
|
|
723
731
|
class: "vv-input-text__icon-left"
|
|
724
|
-
},
|
|
732
|
+
}, l(ne)), null, 16)) : O("", !0)
|
|
725
733
|
]),
|
|
726
|
-
_e(
|
|
727
|
-
id:
|
|
734
|
+
_e(le("input", B({
|
|
735
|
+
id: l(v),
|
|
728
736
|
ref_key: "input",
|
|
729
|
-
ref:
|
|
737
|
+
ref: r,
|
|
730
738
|
"onUpdate:modelValue": f[0] || (f[0] = (q) => Oe(y) ? y.value = q : null)
|
|
731
|
-
},
|
|
739
|
+
}, l(ye), {
|
|
732
740
|
onKeyup: f[1] || (f[1] = (q) => t("keyup", q))
|
|
733
|
-
}), null, 16,
|
|
734
|
-
[Re,
|
|
741
|
+
}), null, 16, mt), [
|
|
742
|
+
[Re, l(y)]
|
|
735
743
|
]),
|
|
736
|
-
X(d.$slots, "after",
|
|
737
|
-
|
|
744
|
+
X(d.$slots, "after", N(K(l(j))), () => [
|
|
745
|
+
l(U) || l(W) ? (E(), P(A, N(B({ key: 0 }, l(U) ? l(ne) : l(W))), null, 16)) : l(x) ? (E(), P(l(Ie), {
|
|
738
746
|
key: 1,
|
|
739
|
-
onTogglePassword:
|
|
740
|
-
})) :
|
|
747
|
+
onTogglePassword: V
|
|
748
|
+
})) : l(fe) ? (E(), P(l(Ae), {
|
|
741
749
|
key: 2,
|
|
742
750
|
onStepUp: J,
|
|
743
751
|
onStepDown: Q
|
|
744
|
-
})) :
|
|
752
|
+
})) : l(me) ? (E(), P(l(Te), {
|
|
745
753
|
key: 3,
|
|
746
754
|
onClear: ee
|
|
747
755
|
})) : O("", !0)
|
|
748
756
|
]),
|
|
749
|
-
|
|
750
|
-
X(d.$slots, "count",
|
|
751
|
-
He(
|
|
757
|
+
l(m) ? (E(), z("span", St, [
|
|
758
|
+
X(d.$slots, "count", N(K(l(j))), () => [
|
|
759
|
+
He(ie(l(Se)), 1)
|
|
752
760
|
])
|
|
753
761
|
])) : O("", !0)
|
|
754
762
|
]),
|
|
755
|
-
Le(
|
|
756
|
-
id:
|
|
763
|
+
Le(l(we), {
|
|
764
|
+
id: l(S),
|
|
757
765
|
class: "vv-input-text__hint"
|
|
758
766
|
}, null, 8, ["id"])
|
|
759
767
|
], 2));
|
|
760
768
|
}
|
|
761
769
|
});
|
|
762
770
|
export {
|
|
763
|
-
|
|
771
|
+
Et as default
|
|
764
772
|
};
|