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