@volverjs/ui-vue 0.0.3 → 0.0.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/LICENSE +1 -1
- package/README.md +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/package.json +60 -34
- package/src/Volver.ts +12 -5
- 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/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.stories.mdx +2 -1
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
|
@@ -1,36 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { unref as s, toRefs as U, computed as l, h as y, inject as Re, defineComponent as L, ref as j, openBlock as g, createBlock as P, mergeProps as $, createCommentVNode as O, watch as ve, useSlots as xe, createElementBlock as H, normalizeClass as Le, toDisplayString as ue, createElementVNode as Y, renderSlot as J, normalizeProps as G, guardReactiveProps as Q, withDirectives as Ne, isRef as Ve, vModelDynamic as ke, createTextVNode as Me, createVNode as $e } from "vue";
|
|
2
|
+
import { toReactive as Ue, useFocus as je, useElementVisibility as We } from "@vueuse/core";
|
|
3
|
+
import { iconExists as k, Icon as Fe, addIcon as qe } from "@iconify/vue";
|
|
4
|
+
import { nanoid as ze } from "nanoid";
|
|
5
|
+
function ce(e, t) {
|
|
6
|
+
if (e && Object.keys(e).length && t) {
|
|
7
|
+
if (t.indexOf(".") === -1)
|
|
8
|
+
return e[t];
|
|
9
|
+
{
|
|
10
|
+
const n = t.split(".");
|
|
11
|
+
let a = e;
|
|
12
|
+
for (let o = 0, p = n.length; o < p; ++o) {
|
|
13
|
+
if (e == null)
|
|
14
|
+
return null;
|
|
15
|
+
a = a[n[o]];
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
}
|
|
19
|
+
} else
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function R(e) {
|
|
23
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(s(e));
|
|
24
|
+
}
|
|
25
|
+
function Ke(e) {
|
|
26
|
+
return typeof e == "string" || e instanceof String;
|
|
27
|
+
}
|
|
28
|
+
function M(e) {
|
|
29
|
+
return Array.isArray(e) ? e.filter((t) => Ke(t)).join(" ") : e;
|
|
5
30
|
}
|
|
6
|
-
function
|
|
31
|
+
function Xe(e, t) {
|
|
7
32
|
const {
|
|
8
|
-
invalid:
|
|
9
|
-
valid:
|
|
10
|
-
hint:
|
|
11
|
-
loading:
|
|
12
|
-
} =
|
|
13
|
-
hintLabel:
|
|
14
|
-
modelValue:
|
|
15
|
-
valid:
|
|
16
|
-
validLabel:
|
|
17
|
-
invalid:
|
|
18
|
-
invalidLabel:
|
|
33
|
+
invalid: n,
|
|
34
|
+
valid: a,
|
|
35
|
+
hint: o,
|
|
36
|
+
loading: p
|
|
37
|
+
} = t, {
|
|
38
|
+
hintLabel: d,
|
|
39
|
+
modelValue: A,
|
|
40
|
+
valid: w,
|
|
41
|
+
validLabel: m,
|
|
42
|
+
invalid: i,
|
|
43
|
+
invalidLabel: u,
|
|
19
44
|
...S
|
|
20
|
-
} =
|
|
21
|
-
() => !!(
|
|
22
|
-
),
|
|
23
|
-
() => !!(
|
|
24
|
-
),
|
|
25
|
-
() => !!(
|
|
26
|
-
),
|
|
27
|
-
() =>
|
|
45
|
+
} = U(e), v = ce(S, "loading"), b = ce(S, "loadingLabel"), E = l(() => i.value ? !!(i.value && n || u != null && u.value && Array.isArray(u.value) && u.value.length > 0 || u != null && u.value && !R(u)) : !1), N = l(
|
|
46
|
+
() => !!(d && d.value || o)
|
|
47
|
+
), h = l(
|
|
48
|
+
() => !!(m && m.value || a)
|
|
49
|
+
), C = l(
|
|
50
|
+
() => !!(v != null && v.value && p || v != null && v.value && (b != null && b.value))
|
|
51
|
+
), W = l(
|
|
52
|
+
() => N.value || h.value || E.value || C.value
|
|
28
53
|
);
|
|
29
54
|
return {
|
|
30
|
-
hasInvalid:
|
|
31
|
-
hasHint:
|
|
32
|
-
hasValid:
|
|
33
|
-
hasLoading:
|
|
55
|
+
hasInvalid: E,
|
|
56
|
+
hasHint: N,
|
|
57
|
+
hasValid: h,
|
|
58
|
+
hasLoading: C,
|
|
34
59
|
HintSlot: {
|
|
35
60
|
name: "HintSlot",
|
|
36
61
|
props: {
|
|
@@ -39,31 +64,31 @@ function Oe(t, n) {
|
|
|
39
64
|
default: () => ({})
|
|
40
65
|
}
|
|
41
66
|
},
|
|
42
|
-
setup(
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
hintLabel:
|
|
46
|
-
modelValue:
|
|
47
|
-
valid:
|
|
48
|
-
validLabel:
|
|
49
|
-
invalid:
|
|
50
|
-
invalidLabel:
|
|
51
|
-
loading:
|
|
52
|
-
loadingLabel:
|
|
53
|
-
...
|
|
67
|
+
setup(B) {
|
|
68
|
+
const V = l(() => {
|
|
69
|
+
const D = Ue({
|
|
70
|
+
hintLabel: d,
|
|
71
|
+
modelValue: A,
|
|
72
|
+
valid: w,
|
|
73
|
+
validLabel: m,
|
|
74
|
+
invalid: i,
|
|
75
|
+
invalidLabel: u,
|
|
76
|
+
loading: v,
|
|
77
|
+
loadingLabel: b,
|
|
78
|
+
...B.params
|
|
54
79
|
});
|
|
55
|
-
return
|
|
80
|
+
return i != null && i.value ? (n == null ? void 0 : n(D)) || M(u == null ? void 0 : u.value) || (d == null ? void 0 : d.value) : w != null && w.value ? (a == null ? void 0 : a(D)) || M(m == null ? void 0 : m.value) || (d == null ? void 0 : d.value) : v != null && v.value ? (p == null ? void 0 : p(D)) || M(b == null ? void 0 : b.value) || (d == null ? void 0 : d.value) : (o == null ? void 0 : o(D)) || M(d == null ? void 0 : d.value) || (d == null ? void 0 : d.value);
|
|
56
81
|
});
|
|
57
82
|
return {
|
|
58
|
-
isVisible:
|
|
59
|
-
hasInvalid:
|
|
60
|
-
hasValid:
|
|
61
|
-
hintContent:
|
|
83
|
+
isVisible: W,
|
|
84
|
+
hasInvalid: E,
|
|
85
|
+
hasValid: h,
|
|
86
|
+
hintContent: V
|
|
62
87
|
};
|
|
63
88
|
},
|
|
64
89
|
render() {
|
|
65
90
|
if (this.isVisible)
|
|
66
|
-
return
|
|
91
|
+
return y(
|
|
67
92
|
"small",
|
|
68
93
|
{
|
|
69
94
|
role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
|
|
@@ -74,7 +99,7 @@ function Oe(t, n) {
|
|
|
74
99
|
}
|
|
75
100
|
};
|
|
76
101
|
}
|
|
77
|
-
const
|
|
102
|
+
const Ye = {
|
|
78
103
|
/**
|
|
79
104
|
* Color
|
|
80
105
|
*/
|
|
@@ -167,102 +192,180 @@ const He = {
|
|
|
167
192
|
modifiers: {
|
|
168
193
|
type: [String, Array]
|
|
169
194
|
}
|
|
170
|
-
}
|
|
195
|
+
};
|
|
196
|
+
var T = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(T || {}), fe = /* @__PURE__ */ ((e) => (e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e))(fe || {}), x = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(x || {}), te = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(te || {}), me = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(me || {});
|
|
197
|
+
const Je = Symbol.for("volver");
|
|
198
|
+
function Ge() {
|
|
199
|
+
return Re(Je);
|
|
200
|
+
}
|
|
201
|
+
function be(e, t, n) {
|
|
202
|
+
return l(() => {
|
|
203
|
+
const a = {
|
|
204
|
+
[e]: !0
|
|
205
|
+
}, o = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
|
|
206
|
+
return o && Array.isArray(o) && o.forEach((p) => {
|
|
207
|
+
a[`${e}--${p}`] = !0;
|
|
208
|
+
}), n && Object.keys(n.value).forEach((p) => {
|
|
209
|
+
a[`${e}--${p}`] = s(n.value[p]);
|
|
210
|
+
}), a;
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const Qe = {
|
|
171
214
|
name: "VvIcon"
|
|
172
|
-
},
|
|
173
|
-
...
|
|
174
|
-
props:
|
|
175
|
-
setup(
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
return
|
|
215
|
+
}, _ = /* @__PURE__ */ L({
|
|
216
|
+
...Qe,
|
|
217
|
+
props: Ye,
|
|
218
|
+
setup(e) {
|
|
219
|
+
const t = e, n = j(!0), a = Ge(), { modifiers: o } = U(t), p = be("vv-icon", o), d = l(() => t.provider || (a == null ? void 0 : a.provider)), A = l(() => {
|
|
220
|
+
const i = t.name ?? "", u = `@${d.value}:${t.prefix}:${t.name}`;
|
|
221
|
+
return k(i) ? i : k(u) ? u : (a == null ? void 0 : a.iconsCollections.find(
|
|
179
222
|
(S) => {
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
return
|
|
223
|
+
const v = `@${d.value}:${S.prefix}:${i}`;
|
|
224
|
+
if (k(v))
|
|
225
|
+
return v;
|
|
183
226
|
}
|
|
184
|
-
)) ||
|
|
227
|
+
)) || i;
|
|
185
228
|
});
|
|
186
|
-
function
|
|
187
|
-
let
|
|
229
|
+
function w(i) {
|
|
230
|
+
let u = null;
|
|
188
231
|
if (typeof window > "u") {
|
|
189
|
-
const { JSDOM:
|
|
190
|
-
|
|
232
|
+
const { JSDOM: E } = require("jsdom");
|
|
233
|
+
u = new E().window;
|
|
191
234
|
}
|
|
192
|
-
return (
|
|
235
|
+
return (u ? new u.DOMParser() : new window.DOMParser()).parseFromString(i, "text/html").querySelector("svg");
|
|
193
236
|
}
|
|
194
|
-
function
|
|
195
|
-
const
|
|
196
|
-
|
|
237
|
+
function m(i) {
|
|
238
|
+
const u = w(i), S = (u == null ? void 0 : u.innerHTML.trim()) || "";
|
|
239
|
+
u && S && qe(`@${d.value}:${t.prefix}:${t.name}`, {
|
|
197
240
|
body: S,
|
|
198
241
|
// Set height and width from svg content
|
|
199
|
-
height:
|
|
200
|
-
width:
|
|
242
|
+
height: u.viewBox.baseVal.height,
|
|
243
|
+
width: u.viewBox.baseVal.width
|
|
201
244
|
});
|
|
202
245
|
}
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
}).catch((
|
|
206
|
-
throw new Error(`During fetch icon: ${
|
|
207
|
-
})) :
|
|
246
|
+
return a && (t.src && !k(`@${d.value}:${t.prefix}:${t.name}`) ? (n.value = !1, a.fetchIcon(t.src).then((i) => {
|
|
247
|
+
i && (m(i), n.value = !0);
|
|
248
|
+
}).catch((i) => {
|
|
249
|
+
throw new Error(`During fetch icon: ${i == null ? void 0 : i.message}`);
|
|
250
|
+
})) : t.svg && m(t.svg)), (i, u) => s(n) ? (g(), P(s(Fe), $({
|
|
208
251
|
key: 0,
|
|
209
|
-
class:
|
|
252
|
+
class: s(p)
|
|
210
253
|
}, {
|
|
211
|
-
inline:
|
|
212
|
-
width:
|
|
213
|
-
height:
|
|
214
|
-
horizontalFlip:
|
|
215
|
-
verticalFlip:
|
|
216
|
-
flip:
|
|
217
|
-
rotate:
|
|
218
|
-
color:
|
|
219
|
-
onLoad:
|
|
220
|
-
icon:
|
|
221
|
-
}), null, 16, ["class"])) :
|
|
254
|
+
inline: i.inline,
|
|
255
|
+
width: i.width,
|
|
256
|
+
height: i.height,
|
|
257
|
+
horizontalFlip: i.horizontalFlip,
|
|
258
|
+
verticalFlip: i.verticalFlip,
|
|
259
|
+
flip: i.flip,
|
|
260
|
+
rotate: i.rotate,
|
|
261
|
+
color: i.color,
|
|
262
|
+
onLoad: i.onLoad,
|
|
263
|
+
icon: s(A)
|
|
264
|
+
}), null, 16, ["class"])) : O("", !0);
|
|
222
265
|
}
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
|
|
266
|
+
}), Ze = {
|
|
267
|
+
/**
|
|
268
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
269
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
270
|
+
*/
|
|
271
|
+
to: {
|
|
272
|
+
type: [String, Object]
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* Anchor href
|
|
276
|
+
*/
|
|
277
|
+
href: String,
|
|
278
|
+
/**
|
|
279
|
+
* Anchor target
|
|
280
|
+
*/
|
|
281
|
+
target: {
|
|
282
|
+
type: String,
|
|
283
|
+
validator: (e) => Object.values(me).includes(e)
|
|
284
|
+
},
|
|
285
|
+
/**
|
|
286
|
+
* Anchor rel
|
|
287
|
+
*/
|
|
288
|
+
rel: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: "noopener noreferrer"
|
|
291
|
+
}
|
|
292
|
+
}, et = {
|
|
293
|
+
/**
|
|
294
|
+
* Valid status
|
|
295
|
+
*/
|
|
226
296
|
valid: Boolean,
|
|
297
|
+
/**
|
|
298
|
+
* Valid label
|
|
299
|
+
*/
|
|
227
300
|
validLabel: [String, Array]
|
|
228
|
-
},
|
|
301
|
+
}, tt = {
|
|
302
|
+
/**
|
|
303
|
+
* Invalid status
|
|
304
|
+
*/
|
|
229
305
|
invalid: Boolean,
|
|
306
|
+
/**
|
|
307
|
+
* Invalid label
|
|
308
|
+
*/
|
|
230
309
|
invalidLabel: [String, Array]
|
|
231
|
-
},
|
|
310
|
+
}, nt = {
|
|
311
|
+
/**
|
|
312
|
+
* Loading status
|
|
313
|
+
*/
|
|
232
314
|
loading: Boolean,
|
|
233
|
-
|
|
234
|
-
|
|
315
|
+
/**
|
|
316
|
+
* Loading label
|
|
317
|
+
*/
|
|
318
|
+
loadingLabel: {
|
|
319
|
+
type: String,
|
|
320
|
+
default: "Loading..."
|
|
321
|
+
}
|
|
322
|
+
}, Se = {
|
|
235
323
|
/**
|
|
236
324
|
* Whether the form control is disabled
|
|
237
325
|
*/
|
|
238
326
|
disabled: Boolean
|
|
239
|
-
},
|
|
327
|
+
}, at = {
|
|
328
|
+
/**
|
|
329
|
+
* Whether the item is active
|
|
330
|
+
*/
|
|
331
|
+
active: Boolean
|
|
332
|
+
}, rt = {
|
|
333
|
+
/**
|
|
334
|
+
* Whether the item is pressed
|
|
335
|
+
*/
|
|
336
|
+
pressed: Boolean
|
|
337
|
+
}, he = {
|
|
338
|
+
/**
|
|
339
|
+
* The item label
|
|
340
|
+
*/
|
|
341
|
+
label: [String, Number]
|
|
342
|
+
}, lt = {
|
|
240
343
|
/**
|
|
241
344
|
* The value is not editable
|
|
242
345
|
*/
|
|
243
346
|
readonly: Boolean
|
|
244
|
-
},
|
|
347
|
+
}, ot = {
|
|
245
348
|
/**
|
|
246
349
|
* Component BEM modifiers
|
|
247
350
|
*/
|
|
248
351
|
modifiers: [String, Array]
|
|
249
|
-
},
|
|
352
|
+
}, st = {
|
|
250
353
|
hintLabel: { type: String, default: "" }
|
|
251
|
-
},
|
|
354
|
+
}, it = {
|
|
252
355
|
/**
|
|
253
356
|
* Show character limit
|
|
254
357
|
*/
|
|
255
358
|
count: {
|
|
256
359
|
type: [Boolean, String],
|
|
257
360
|
default: !1,
|
|
258
|
-
validator: (
|
|
361
|
+
validator: (e) => [!0, !1, "limit", "countdown"].includes(e)
|
|
259
362
|
}
|
|
260
|
-
},
|
|
363
|
+
}, ut = {
|
|
261
364
|
/**
|
|
262
365
|
* Milliseconds to wait before emitting the input event
|
|
263
366
|
*/
|
|
264
367
|
debounce: [Number, String]
|
|
265
|
-
},
|
|
368
|
+
}, ct = {
|
|
266
369
|
/**
|
|
267
370
|
* VvIcon name or props
|
|
268
371
|
* @see VVIcon
|
|
@@ -273,64 +376,65 @@ const xe = {
|
|
|
273
376
|
*/
|
|
274
377
|
iconPosition: {
|
|
275
378
|
type: String,
|
|
276
|
-
default:
|
|
277
|
-
validation: (
|
|
379
|
+
default: x.before,
|
|
380
|
+
validation: (e) => Object.values(x).includes(e)
|
|
278
381
|
}
|
|
279
|
-
},
|
|
382
|
+
}, dt = {
|
|
280
383
|
/**
|
|
281
384
|
* Global attribute tabindex
|
|
282
385
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
283
386
|
*/
|
|
284
387
|
tabindex: { type: [String, Number], default: 0 }
|
|
285
|
-
},
|
|
388
|
+
}, pt = {
|
|
286
389
|
/**
|
|
287
390
|
* If true the label will be floating
|
|
288
391
|
*/
|
|
289
392
|
floating: Boolean
|
|
290
|
-
},
|
|
393
|
+
}, vt = {
|
|
291
394
|
/**
|
|
292
395
|
* Global attribute id
|
|
293
396
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
294
397
|
*/
|
|
295
398
|
id: [String, Number]
|
|
296
399
|
};
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
...
|
|
400
|
+
T.bottom;
|
|
401
|
+
const ft = {
|
|
402
|
+
...vt,
|
|
300
403
|
/**
|
|
301
404
|
* Input / Textarea name
|
|
302
405
|
* Name of the form control. Submitted with the form as part of a name/value pair
|
|
303
406
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
304
407
|
*/
|
|
305
408
|
name: { type: String, required: !0 }
|
|
306
|
-
},
|
|
409
|
+
}, mt = {
|
|
307
410
|
/**
|
|
308
411
|
* Global attribute autofocus
|
|
309
412
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
310
413
|
*/
|
|
311
414
|
autofocus: Boolean
|
|
312
|
-
},
|
|
415
|
+
}, bt = {
|
|
313
416
|
/**
|
|
314
417
|
* Global attribute autocomplete
|
|
315
418
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
316
419
|
*/
|
|
317
420
|
autocomplete: { type: String, default: "off" }
|
|
318
|
-
},
|
|
319
|
-
...
|
|
320
|
-
...
|
|
321
|
-
...
|
|
322
|
-
...
|
|
323
|
-
...
|
|
324
|
-
...
|
|
325
|
-
...
|
|
326
|
-
...
|
|
327
|
-
|
|
328
|
-
...
|
|
329
|
-
...
|
|
330
|
-
...
|
|
331
|
-
...
|
|
332
|
-
...
|
|
333
|
-
...
|
|
421
|
+
}, St = {
|
|
422
|
+
...ft,
|
|
423
|
+
...mt,
|
|
424
|
+
...bt,
|
|
425
|
+
...dt,
|
|
426
|
+
...Se,
|
|
427
|
+
...lt,
|
|
428
|
+
...et,
|
|
429
|
+
...tt,
|
|
430
|
+
...st,
|
|
431
|
+
...nt,
|
|
432
|
+
...ot,
|
|
433
|
+
...it,
|
|
434
|
+
...ut,
|
|
435
|
+
...ct,
|
|
436
|
+
...pt,
|
|
437
|
+
...he,
|
|
334
438
|
/**
|
|
335
439
|
* Input / Textarea minlength
|
|
336
440
|
* Minimum length (number of characters) of value
|
|
@@ -358,12 +462,20 @@ const ze = {
|
|
|
358
462
|
* Available for all input types except color
|
|
359
463
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
|
|
360
464
|
*/
|
|
361
|
-
required: Boolean
|
|
465
|
+
required: Boolean
|
|
466
|
+
};
|
|
467
|
+
({
|
|
468
|
+
...Se,
|
|
469
|
+
...he,
|
|
470
|
+
...rt,
|
|
471
|
+
...at,
|
|
472
|
+
...Ze,
|
|
362
473
|
/**
|
|
363
|
-
*
|
|
474
|
+
* Button type
|
|
364
475
|
*/
|
|
365
|
-
|
|
366
|
-
}
|
|
476
|
+
type: te.button
|
|
477
|
+
});
|
|
478
|
+
const r = {
|
|
367
479
|
TEXT: "text",
|
|
368
480
|
PASSWORD: "password",
|
|
369
481
|
NUMBER: "number",
|
|
@@ -377,15 +489,15 @@ const ze = {
|
|
|
377
489
|
DATETIME_LOCAL: "datetime-local",
|
|
378
490
|
MONTH: "month",
|
|
379
491
|
WEEK: "week"
|
|
380
|
-
},
|
|
492
|
+
}, I = {
|
|
381
493
|
PASSWORD_SHOW: "eye-on",
|
|
382
494
|
PASSWORD_HIDE: "eye-off",
|
|
383
495
|
DATE: "calendar",
|
|
384
496
|
TIME: "time",
|
|
385
497
|
COLOR: "color",
|
|
386
498
|
SEARCH: "close"
|
|
387
|
-
},
|
|
388
|
-
...
|
|
499
|
+
}, ht = ["update:modelValue", "focus", "blur", "keyup"], gt = {
|
|
500
|
+
...St,
|
|
389
501
|
/**
|
|
390
502
|
* Input value
|
|
391
503
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -397,8 +509,8 @@ const ze = {
|
|
|
397
509
|
*/
|
|
398
510
|
type: {
|
|
399
511
|
type: String,
|
|
400
|
-
default:
|
|
401
|
-
validator: (
|
|
512
|
+
default: r.TEXT,
|
|
513
|
+
validator: (e) => Object.values(r).includes(e)
|
|
402
514
|
},
|
|
403
515
|
/**
|
|
404
516
|
* Minimum value
|
|
@@ -436,7 +548,7 @@ const ze = {
|
|
|
436
548
|
*/
|
|
437
549
|
iconShowPassword: {
|
|
438
550
|
type: String,
|
|
439
|
-
default:
|
|
551
|
+
default: I.PASSWORD_SHOW
|
|
440
552
|
},
|
|
441
553
|
/**
|
|
442
554
|
* VvIcon name for hide password button
|
|
@@ -444,7 +556,7 @@ const ze = {
|
|
|
444
556
|
*/
|
|
445
557
|
iconHidePassword: {
|
|
446
558
|
type: String,
|
|
447
|
-
default:
|
|
559
|
+
default: I.PASSWORD_HIDE
|
|
448
560
|
},
|
|
449
561
|
/**
|
|
450
562
|
* VvIcon name for clear button
|
|
@@ -452,7 +564,7 @@ const ze = {
|
|
|
452
564
|
*/
|
|
453
565
|
iconClear: {
|
|
454
566
|
type: String,
|
|
455
|
-
default:
|
|
567
|
+
default: I.SEARCH
|
|
456
568
|
},
|
|
457
569
|
/**
|
|
458
570
|
* Label for step up button
|
|
@@ -489,9 +601,9 @@ const ze = {
|
|
|
489
601
|
type: String,
|
|
490
602
|
default: "Clear"
|
|
491
603
|
}
|
|
492
|
-
},
|
|
604
|
+
}, de = L({
|
|
493
605
|
components: {
|
|
494
|
-
VvIcon:
|
|
606
|
+
VvIcon: _
|
|
495
607
|
},
|
|
496
608
|
props: {
|
|
497
609
|
disabled: {
|
|
@@ -508,33 +620,33 @@ const ze = {
|
|
|
508
620
|
},
|
|
509
621
|
iconShow: {
|
|
510
622
|
type: String,
|
|
511
|
-
default:
|
|
623
|
+
default: I.PASSWORD_SHOW
|
|
512
624
|
},
|
|
513
625
|
iconHide: {
|
|
514
626
|
type: String,
|
|
515
|
-
default:
|
|
627
|
+
default: I.PASSWORD_HIDE
|
|
516
628
|
}
|
|
517
629
|
},
|
|
518
630
|
emits: ["toggle-password"],
|
|
519
|
-
setup(
|
|
520
|
-
const
|
|
521
|
-
() =>
|
|
631
|
+
setup(e, { emit: t }) {
|
|
632
|
+
const n = j(!1), a = l(
|
|
633
|
+
() => n.value ? e.iconHide : e.iconShow
|
|
522
634
|
);
|
|
523
|
-
function
|
|
524
|
-
|
|
635
|
+
function o(p) {
|
|
636
|
+
p == null || p.stopPropagation(), e.disabled || (n.value = !n.value, t("toggle-password", n.value));
|
|
525
637
|
}
|
|
526
638
|
return {
|
|
527
|
-
active:
|
|
528
|
-
activeIcon:
|
|
529
|
-
onClick:
|
|
639
|
+
active: n,
|
|
640
|
+
activeIcon: a,
|
|
641
|
+
onClick: o
|
|
530
642
|
};
|
|
531
643
|
},
|
|
532
644
|
render() {
|
|
533
|
-
const
|
|
645
|
+
const e = y(_, {
|
|
534
646
|
name: this.activeIcon,
|
|
535
647
|
class: "vv-input-text__action-icon"
|
|
536
648
|
});
|
|
537
|
-
return
|
|
649
|
+
return y(
|
|
538
650
|
"button",
|
|
539
651
|
{
|
|
540
652
|
disabled: this.disabled,
|
|
@@ -543,12 +655,12 @@ const ze = {
|
|
|
543
655
|
type: "button",
|
|
544
656
|
onClick: this.onClick
|
|
545
657
|
},
|
|
546
|
-
|
|
658
|
+
e
|
|
547
659
|
);
|
|
548
660
|
}
|
|
549
|
-
}),
|
|
661
|
+
}), Z = L({
|
|
550
662
|
components: {
|
|
551
|
-
VvIcon:
|
|
663
|
+
VvIcon: _
|
|
552
664
|
},
|
|
553
665
|
props: {
|
|
554
666
|
disabled: {
|
|
@@ -560,22 +672,22 @@ const ze = {
|
|
|
560
672
|
},
|
|
561
673
|
mode: {
|
|
562
674
|
type: String,
|
|
563
|
-
validator: (
|
|
675
|
+
validator: (e) => ["up", "down"].includes(e),
|
|
564
676
|
default: "up"
|
|
565
677
|
}
|
|
566
678
|
},
|
|
567
679
|
emits: ["step-up", "step-down"],
|
|
568
|
-
setup(
|
|
569
|
-
const
|
|
680
|
+
setup(e, { emit: t }) {
|
|
681
|
+
const n = l(() => e.mode === "up");
|
|
570
682
|
return {
|
|
571
|
-
isUp:
|
|
572
|
-
onClick: (
|
|
573
|
-
|
|
683
|
+
isUp: n,
|
|
684
|
+
onClick: (o) => {
|
|
685
|
+
o == null || o.stopPropagation(), e.disabled || t(n.value ? "step-up" : "step-down");
|
|
574
686
|
}
|
|
575
687
|
};
|
|
576
688
|
},
|
|
577
689
|
render() {
|
|
578
|
-
return
|
|
690
|
+
return y("button", {
|
|
579
691
|
class: [
|
|
580
692
|
"vv-input-text__action-chevron",
|
|
581
693
|
this.isUp && "vv-input-text__action-chevron-up"
|
|
@@ -585,9 +697,9 @@ const ze = {
|
|
|
585
697
|
onClick: this.onClick
|
|
586
698
|
});
|
|
587
699
|
}
|
|
588
|
-
}),
|
|
700
|
+
}), pe = L({
|
|
589
701
|
components: {
|
|
590
|
-
VvIcon:
|
|
702
|
+
VvIcon: _
|
|
591
703
|
},
|
|
592
704
|
props: {
|
|
593
705
|
disabled: {
|
|
@@ -604,20 +716,20 @@ const ze = {
|
|
|
604
716
|
}
|
|
605
717
|
},
|
|
606
718
|
emits: ["clear"],
|
|
607
|
-
setup(
|
|
608
|
-
function
|
|
609
|
-
|
|
719
|
+
setup(e, { emit: t }) {
|
|
720
|
+
function n(a) {
|
|
721
|
+
a == null || a.stopPropagation(), e.disabled || t("clear");
|
|
610
722
|
}
|
|
611
723
|
return {
|
|
612
|
-
onClick:
|
|
724
|
+
onClick: n
|
|
613
725
|
};
|
|
614
726
|
},
|
|
615
727
|
render() {
|
|
616
|
-
const
|
|
728
|
+
const e = y(_, {
|
|
617
729
|
name: this.icon,
|
|
618
730
|
class: "vv-input-text__action-icon"
|
|
619
731
|
});
|
|
620
|
-
return
|
|
732
|
+
return y(
|
|
621
733
|
"button",
|
|
622
734
|
{
|
|
623
735
|
disabled: this.disabled,
|
|
@@ -626,51 +738,51 @@ const ze = {
|
|
|
626
738
|
type: "button",
|
|
627
739
|
onClick: this.onClick
|
|
628
740
|
},
|
|
629
|
-
|
|
741
|
+
e
|
|
630
742
|
);
|
|
631
743
|
}
|
|
632
744
|
});
|
|
633
|
-
function
|
|
745
|
+
function ee(e, t) {
|
|
634
746
|
return {
|
|
635
747
|
name: "VvInputTextActions",
|
|
636
748
|
components: {
|
|
637
|
-
VvIcon:
|
|
638
|
-
VvInputPasswordAction:
|
|
639
|
-
VvInputStepAction:
|
|
640
|
-
VvInputClearAction:
|
|
749
|
+
VvIcon: _,
|
|
750
|
+
VvInputPasswordAction: de,
|
|
751
|
+
VvInputStepAction: Z,
|
|
752
|
+
VvInputClearAction: pe
|
|
641
753
|
},
|
|
642
754
|
setup() {
|
|
643
755
|
return {
|
|
644
|
-
isDisabled:
|
|
645
|
-
labelStepUp:
|
|
646
|
-
labelStepDown:
|
|
647
|
-
labelShowPassword:
|
|
648
|
-
labelHidePassword:
|
|
649
|
-
labelClear:
|
|
650
|
-
iconShowPassword:
|
|
651
|
-
iconHidePassword:
|
|
756
|
+
isDisabled: l(() => t.disabled || t.readonly),
|
|
757
|
+
labelStepUp: t.labelStepUp,
|
|
758
|
+
labelStepDown: t.labelStepDown,
|
|
759
|
+
labelShowPassword: t.labelShowPassword,
|
|
760
|
+
labelHidePassword: t.labelHidePassword,
|
|
761
|
+
labelClear: t.labelClear,
|
|
762
|
+
iconShowPassword: t.iconShowPassword,
|
|
763
|
+
iconHidePassword: t.iconHidePassword
|
|
652
764
|
};
|
|
653
765
|
},
|
|
654
766
|
render() {
|
|
655
|
-
let
|
|
656
|
-
switch (
|
|
657
|
-
case
|
|
658
|
-
const { onClear:
|
|
659
|
-
|
|
660
|
-
|
|
767
|
+
let n = null;
|
|
768
|
+
switch (e) {
|
|
769
|
+
case r.SEARCH: {
|
|
770
|
+
const { onClear: a } = this.$attrs;
|
|
771
|
+
n = [
|
|
772
|
+
y(pe, {
|
|
661
773
|
disabled: this.isDisabled,
|
|
662
774
|
label: this.labelShowPassword,
|
|
663
|
-
onClear:
|
|
775
|
+
onClear: a
|
|
664
776
|
})
|
|
665
777
|
];
|
|
666
778
|
break;
|
|
667
779
|
}
|
|
668
|
-
case
|
|
669
|
-
const { onTogglePassword:
|
|
670
|
-
|
|
671
|
-
|
|
780
|
+
case r.PASSWORD: {
|
|
781
|
+
const { onTogglePassword: a } = this.$attrs;
|
|
782
|
+
n = [
|
|
783
|
+
y(de, {
|
|
672
784
|
disabled: this.isDisabled,
|
|
673
|
-
onTogglePassword:
|
|
785
|
+
onTogglePassword: a,
|
|
674
786
|
labelShow: this.labelShowPassword,
|
|
675
787
|
labelHide: this.labelHidePassword,
|
|
676
788
|
iconShow: this.iconShowPassword,
|
|
@@ -679,206 +791,258 @@ function X(t, n) {
|
|
|
679
791
|
];
|
|
680
792
|
break;
|
|
681
793
|
}
|
|
682
|
-
case
|
|
683
|
-
const { onStepUp:
|
|
684
|
-
|
|
685
|
-
|
|
794
|
+
case r.NUMBER: {
|
|
795
|
+
const { onStepUp: a, onStepDown: o } = this.$attrs;
|
|
796
|
+
n = [
|
|
797
|
+
y(Z, {
|
|
686
798
|
mode: "up",
|
|
687
|
-
disabled: this.isDisabled ||
|
|
799
|
+
disabled: this.isDisabled || t.max !== void 0 && t.modelValue === t.max,
|
|
688
800
|
label: this.labelStepUp,
|
|
689
|
-
onStepUp:
|
|
690
|
-
onStepDown:
|
|
801
|
+
onStepUp: a,
|
|
802
|
+
onStepDown: o
|
|
691
803
|
}),
|
|
692
|
-
|
|
804
|
+
y(Z, {
|
|
693
805
|
mode: "down",
|
|
694
|
-
disabled: this.isDisabled ||
|
|
806
|
+
disabled: this.isDisabled || t.min !== void 0 && t.modelValue === t.min,
|
|
695
807
|
label: this.labelStepDown,
|
|
696
|
-
onStepUp:
|
|
697
|
-
onStepDown:
|
|
808
|
+
onStepUp: a,
|
|
809
|
+
onStepDown: o
|
|
698
810
|
})
|
|
699
811
|
];
|
|
700
812
|
break;
|
|
701
813
|
}
|
|
702
814
|
}
|
|
703
|
-
return Array.isArray(
|
|
815
|
+
return Array.isArray(n) ? y("div", { class: "vv-input-text__actions-group" }, n) : n;
|
|
704
816
|
}
|
|
705
817
|
};
|
|
706
818
|
}
|
|
707
|
-
const
|
|
819
|
+
const yt = (e) => l(() => String((e == null ? void 0 : e.value) || ze()));
|
|
820
|
+
function wt(e, t, n = 0) {
|
|
821
|
+
let a;
|
|
822
|
+
return typeof n == "string" && (n = parseInt(n)), l({
|
|
823
|
+
get: () => e == null ? void 0 : e.value,
|
|
824
|
+
set: (o) => {
|
|
825
|
+
a && clearTimeout(a), a = setTimeout(() => {
|
|
826
|
+
t("update:modelValue", o);
|
|
827
|
+
}, n);
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
function Et(e, t) {
|
|
832
|
+
const { focused: n } = je(e);
|
|
833
|
+
return ve(n, (a) => {
|
|
834
|
+
t(a ? "focus" : "blur", s(e));
|
|
835
|
+
}), {
|
|
836
|
+
focused: n
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function It(e, t) {
|
|
840
|
+
const n = l(
|
|
841
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === x.before)
|
|
842
|
+
), a = l(
|
|
843
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === x.after)
|
|
844
|
+
), o = l(
|
|
845
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === T.left)
|
|
846
|
+
), p = l(
|
|
847
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === T.right)
|
|
848
|
+
), d = l(
|
|
849
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === T.top)
|
|
850
|
+
), A = l(
|
|
851
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === T.bottom)
|
|
852
|
+
);
|
|
853
|
+
return {
|
|
854
|
+
hasIcon: l(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
|
|
855
|
+
hasIconLeft: o,
|
|
856
|
+
hasIconRight: p,
|
|
857
|
+
hasIconTop: d,
|
|
858
|
+
hasIconBottom: A,
|
|
859
|
+
hasIconBefore: n,
|
|
860
|
+
hasIconAfter: a
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
function _t(e, t) {
|
|
864
|
+
const n = l(() => (s(e) ?? "").length), a = l(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && n.value < (t == null ? void 0 : t.lowerLimit) ? n.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && n.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - n.value : 0), o = l(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${n.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? a.value === 0 ? void 0 : a : n.value);
|
|
865
|
+
return {
|
|
866
|
+
length: n,
|
|
867
|
+
gap: a,
|
|
868
|
+
formatted: o
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
const At = ["for"], Dt = { class: "vv-input-text__wrapper" }, Ot = {
|
|
708
872
|
key: 0,
|
|
709
873
|
class: "vv-input-text__input-before"
|
|
710
|
-
},
|
|
874
|
+
}, Tt = { class: "vv-input-text__inner" }, Ct = ["id"], Pt = {
|
|
711
875
|
key: 1,
|
|
712
876
|
class: "vv-input-text__input-after"
|
|
713
|
-
},
|
|
877
|
+
}, Bt = {
|
|
714
878
|
key: 2,
|
|
715
879
|
class: "vv-input-text__limit"
|
|
716
|
-
},
|
|
880
|
+
}, Ht = {
|
|
717
881
|
name: "VvInputText"
|
|
718
|
-
},
|
|
719
|
-
...
|
|
720
|
-
props:
|
|
721
|
-
emits:
|
|
722
|
-
setup(
|
|
723
|
-
const
|
|
724
|
-
id:
|
|
725
|
-
icon:
|
|
726
|
-
iconPosition:
|
|
727
|
-
label:
|
|
728
|
-
modelValue:
|
|
729
|
-
count:
|
|
730
|
-
valid:
|
|
882
|
+
}, Vt = /* @__PURE__ */ L({
|
|
883
|
+
...Ht,
|
|
884
|
+
props: gt,
|
|
885
|
+
emits: ht,
|
|
886
|
+
setup(e, { emit: t }) {
|
|
887
|
+
const n = e, a = xe(), o = j(), {
|
|
888
|
+
id: p,
|
|
889
|
+
icon: d,
|
|
890
|
+
iconPosition: A,
|
|
891
|
+
label: w,
|
|
892
|
+
modelValue: m,
|
|
893
|
+
count: i,
|
|
894
|
+
valid: u,
|
|
731
895
|
invalid: S,
|
|
732
|
-
loading:
|
|
733
|
-
} =
|
|
734
|
-
() =>
|
|
735
|
-
),
|
|
736
|
-
|
|
737
|
-
|
|
896
|
+
loading: v
|
|
897
|
+
} = U(n), b = yt(p), E = l(() => `${b.value}-hint`), N = l(
|
|
898
|
+
() => n.floating && R(n.placeholder) ? " " : n.placeholder
|
|
899
|
+
), h = wt(m, t, n.debounce), { focused: C } = Et(o, t), W = We(o);
|
|
900
|
+
ve(W, (c) => {
|
|
901
|
+
c && n.autofocus && (C.value = !0);
|
|
738
902
|
});
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
},
|
|
742
|
-
() =>
|
|
743
|
-
),
|
|
744
|
-
|
|
745
|
-
},
|
|
746
|
-
|
|
747
|
-
},
|
|
748
|
-
|
|
749
|
-
}, { hasIcon:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
),
|
|
753
|
-
switch (
|
|
754
|
-
case
|
|
755
|
-
return { name:
|
|
756
|
-
case
|
|
757
|
-
case
|
|
758
|
-
case
|
|
759
|
-
case
|
|
760
|
-
return { name:
|
|
761
|
-
case
|
|
762
|
-
return { name:
|
|
903
|
+
const B = j(!1), V = l(() => n.type === r.PASSWORD), D = () => {
|
|
904
|
+
B.value = !B.value;
|
|
905
|
+
}, ge = l(
|
|
906
|
+
() => n.type === r.TIME || n.type === r.DATETIME_LOCAL || n.type === r.DATE || n.type === r.WEEK || n.type === r.MONTH
|
|
907
|
+
), ye = l(() => n.type === r.NUMBER), ne = () => {
|
|
908
|
+
z.value && (o.value.stepUp(), h.value = s(o).value);
|
|
909
|
+
}, ae = () => {
|
|
910
|
+
z.value && (o.value.stepDown(), h.value = s(o).value);
|
|
911
|
+
}, we = l(() => n.type === r.SEARCH), re = () => {
|
|
912
|
+
h.value = void 0;
|
|
913
|
+
}, { hasIcon: le, hasIconBefore: oe, hasIconAfter: F } = It(
|
|
914
|
+
d,
|
|
915
|
+
A
|
|
916
|
+
), q = l(() => {
|
|
917
|
+
switch (n.type) {
|
|
918
|
+
case r.COLOR:
|
|
919
|
+
return { name: I.COLOR };
|
|
920
|
+
case r.DATE:
|
|
921
|
+
case r.DATETIME_LOCAL:
|
|
922
|
+
case r.WEEK:
|
|
923
|
+
case r.MONTH:
|
|
924
|
+
return { name: I.DATE };
|
|
925
|
+
case r.TIME:
|
|
926
|
+
return { name: I.TIME };
|
|
763
927
|
default:
|
|
764
928
|
return "";
|
|
765
929
|
}
|
|
766
|
-
}), { formatted:
|
|
767
|
-
mode:
|
|
768
|
-
upperLimit:
|
|
769
|
-
lowerLimit:
|
|
770
|
-
}),
|
|
771
|
-
() =>
|
|
772
|
-
),
|
|
930
|
+
}), { formatted: Ee } = _t(h, {
|
|
931
|
+
mode: n.count,
|
|
932
|
+
upperLimit: n.maxlength,
|
|
933
|
+
lowerLimit: n.minlength
|
|
934
|
+
}), z = l(() => !n.disabled && !n.readonly), Ie = l(
|
|
935
|
+
() => z.value ? n.tabindex : -1
|
|
936
|
+
), se = l(() => !R(m)), _e = l(() => {
|
|
773
937
|
if (S.value === !0)
|
|
774
938
|
return !0;
|
|
775
|
-
if (
|
|
939
|
+
if (u.value === !0)
|
|
776
940
|
return !1;
|
|
777
|
-
}), { modifiers:
|
|
941
|
+
}), { modifiers: Ae } = U(n), De = be(
|
|
778
942
|
"vv-input-text",
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
valid:
|
|
943
|
+
Ae,
|
|
944
|
+
l(() => ({
|
|
945
|
+
valid: u.value,
|
|
782
946
|
invalid: S.value,
|
|
783
|
-
loading:
|
|
784
|
-
disabled:
|
|
785
|
-
readonly:
|
|
786
|
-
"icon-before":
|
|
787
|
-
"icon-after":
|
|
788
|
-
floating:
|
|
789
|
-
dirty:
|
|
790
|
-
focus:
|
|
947
|
+
loading: v.value,
|
|
948
|
+
disabled: n.disabled,
|
|
949
|
+
readonly: n.readonly,
|
|
950
|
+
"icon-before": oe.value,
|
|
951
|
+
"icon-after": F.value || !R(q),
|
|
952
|
+
floating: n.floating && !R(n.label),
|
|
953
|
+
dirty: se.value,
|
|
954
|
+
focus: C.value
|
|
791
955
|
}))
|
|
792
|
-
),
|
|
793
|
-
const
|
|
794
|
-
type:
|
|
795
|
-
name:
|
|
796
|
-
tabindex:
|
|
797
|
-
disabled:
|
|
798
|
-
readonly:
|
|
799
|
-
required:
|
|
800
|
-
autocomplete:
|
|
801
|
-
"aria-invalid":
|
|
802
|
-
"aria-describedby": !
|
|
803
|
-
"aria-errormessage":
|
|
956
|
+
), Oe = l(() => {
|
|
957
|
+
const c = (() => V.value && B.value || ge.value && !se.value && !C.value ? r.TEXT : n.type)(), f = {
|
|
958
|
+
type: c,
|
|
959
|
+
name: n.name,
|
|
960
|
+
tabindex: Ie.value,
|
|
961
|
+
disabled: n.disabled,
|
|
962
|
+
readonly: n.readonly,
|
|
963
|
+
required: n.required,
|
|
964
|
+
autocomplete: n.autocomplete,
|
|
965
|
+
"aria-invalid": _e.value,
|
|
966
|
+
"aria-describedby": !ie.value && Ce.value ? E.value : void 0,
|
|
967
|
+
"aria-errormessage": ie.value ? E.value : void 0
|
|
804
968
|
};
|
|
805
|
-
return (
|
|
806
|
-
}),
|
|
807
|
-
valid:
|
|
808
|
-
invalid:
|
|
809
|
-
modelValue:
|
|
810
|
-
togglePassword:
|
|
811
|
-
stepUp:
|
|
812
|
-
stepDown:
|
|
813
|
-
clear:
|
|
814
|
-
})), { HintSlot:
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
),
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
),
|
|
821
|
-
|
|
822
|
-
|
|
969
|
+
return (c === r.DATE || c === r.MONTH || c === r.WEEK || c === r.TIME || c === r.DATETIME_LOCAL || c === r.NUMBER) && (f.step = n.step, f.max = String(n.max), f.min = String(n.min)), (c === r.TEXT || c === r.SEARCH || c === r.URL || c === r.TEL || c === r.EMAIL || c === r.PASSWORD || c === r.NUMBER) && (f.placeholder = N.value), (c === r.TEXT || c === r.SEARCH || c === r.URL || c === r.TEL || c === r.EMAIL || c === r.PASSWORD) && (f.minlength = n.minlength, f.maxlength = n.maxlength, f.pattern = n.pattern), c === r.EMAIL && (f.multiple = n.multiple), f;
|
|
970
|
+
}), K = l(() => ({
|
|
971
|
+
valid: n.valid,
|
|
972
|
+
invalid: n.invalid,
|
|
973
|
+
modelValue: n.modelValue,
|
|
974
|
+
togglePassword: D,
|
|
975
|
+
stepUp: ne,
|
|
976
|
+
stepDown: ae,
|
|
977
|
+
clear: re
|
|
978
|
+
})), { HintSlot: Te, hasHint: Ce, hasInvalid: ie } = Xe(n, a), Pe = ee(
|
|
979
|
+
r.PASSWORD,
|
|
980
|
+
n
|
|
981
|
+
), Be = ee(
|
|
982
|
+
r.NUMBER,
|
|
983
|
+
n
|
|
984
|
+
), He = ee(
|
|
985
|
+
r.SEARCH,
|
|
986
|
+
n
|
|
823
987
|
);
|
|
824
|
-
return (
|
|
825
|
-
class:
|
|
988
|
+
return (c, f) => (g(), H("div", {
|
|
989
|
+
class: Le(s(De))
|
|
826
990
|
}, [
|
|
827
|
-
|
|
991
|
+
s(w) ? (g(), H("label", {
|
|
828
992
|
key: 0,
|
|
829
|
-
for:
|
|
993
|
+
for: s(b),
|
|
830
994
|
class: "vv-input-text__label"
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
])) :
|
|
836
|
-
|
|
837
|
-
|
|
995
|
+
}, ue(s(w)), 9, At)) : O("", !0),
|
|
996
|
+
Y("div", Dt, [
|
|
997
|
+
c.$slots.before ? (g(), H("div", Ot, [
|
|
998
|
+
J(c.$slots, "before", G(Q(s(K))))
|
|
999
|
+
])) : O("", !0),
|
|
1000
|
+
Y("div", Tt, [
|
|
1001
|
+
s(oe) ? (g(), P(_, $({
|
|
838
1002
|
key: 0,
|
|
839
1003
|
class: "vv-input-text__icon"
|
|
840
|
-
},
|
|
841
|
-
|
|
842
|
-
id:
|
|
1004
|
+
}, s(le)), null, 16)) : O("", !0),
|
|
1005
|
+
Ne(Y("input", $({
|
|
1006
|
+
id: s(b),
|
|
843
1007
|
ref_key: "input",
|
|
844
|
-
ref:
|
|
845
|
-
"onUpdate:modelValue":
|
|
846
|
-
},
|
|
847
|
-
onKeyup:
|
|
848
|
-
}), null, 16,
|
|
849
|
-
[
|
|
1008
|
+
ref: o,
|
|
1009
|
+
"onUpdate:modelValue": f[0] || (f[0] = (X) => Ve(h) ? h.value = X : null)
|
|
1010
|
+
}, s(Oe), {
|
|
1011
|
+
onKeyup: f[1] || (f[1] = (X) => t("keyup", X))
|
|
1012
|
+
}), null, 16, Ct), [
|
|
1013
|
+
[ke, s(h)]
|
|
850
1014
|
]),
|
|
851
|
-
|
|
1015
|
+
s(F) || s(q) ? (g(), P(_, $({
|
|
852
1016
|
key: 1,
|
|
853
1017
|
class: "vv-input-text__icon vv-input-text__icon-after"
|
|
854
|
-
},
|
|
1018
|
+
}, s(F) ? s(le) : s(q)), null, 16)) : s(V) ? (g(), P(s(Pe), {
|
|
855
1019
|
key: 2,
|
|
856
|
-
onTogglePassword:
|
|
857
|
-
})) :
|
|
1020
|
+
onTogglePassword: D
|
|
1021
|
+
})) : s(ye) ? (g(), P(s(Be), {
|
|
858
1022
|
key: 3,
|
|
859
|
-
onStepUp:
|
|
860
|
-
onStepDown:
|
|
861
|
-
})) :
|
|
1023
|
+
onStepUp: ne,
|
|
1024
|
+
onStepDown: ae
|
|
1025
|
+
})) : s(we) ? (g(), P(s(He), {
|
|
862
1026
|
key: 4,
|
|
863
|
-
onClear:
|
|
864
|
-
})) :
|
|
1027
|
+
onClear: re
|
|
1028
|
+
})) : O("", !0)
|
|
865
1029
|
]),
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
])) :
|
|
869
|
-
i
|
|
870
|
-
|
|
871
|
-
|
|
1030
|
+
c.$slots.after ? (g(), H("div", Pt, [
|
|
1031
|
+
J(c.$slots, "after", G(Q(s(K))))
|
|
1032
|
+
])) : O("", !0),
|
|
1033
|
+
s(i) ? (g(), H("span", Bt, [
|
|
1034
|
+
J(c.$slots, "count", G(Q(s(K))), () => [
|
|
1035
|
+
Me(ue(s(Ee)), 1)
|
|
872
1036
|
])
|
|
873
|
-
])) :
|
|
1037
|
+
])) : O("", !0)
|
|
874
1038
|
]),
|
|
875
|
-
|
|
876
|
-
id:
|
|
1039
|
+
$e(s(Te), {
|
|
1040
|
+
id: s(E),
|
|
877
1041
|
class: "vv-input-text__hint"
|
|
878
1042
|
}, null, 8, ["id"])
|
|
879
1043
|
], 2));
|
|
880
1044
|
}
|
|
881
1045
|
});
|
|
882
1046
|
export {
|
|
883
|
-
|
|
1047
|
+
Vt as default
|
|
884
1048
|
};
|