@8wave/ai-elements 0.124.0-beta.6 → 0.124.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkChatbotFilePreview-Dk748hZ0.js → PkChatbotFilePreview-DuvRnOes.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-Dk748hZ0.js.map → PkChatbotFilePreview-DuvRnOes.js.map} +1 -1
- package/dist/_chunks/{PkEditorRadioButtons-DWNs2pp4.js → PkEditorRadioButtons-Cif9q08d.js} +2 -2
- package/dist/_chunks/{PkEditorRadioButtons-DWNs2pp4.js.map → PkEditorRadioButtons-Cif9q08d.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-CC2W-RXG.js → PkFilePreview-D_piCsAW.js} +203 -203
- package/dist/_chunks/{PkFilePreview-CC2W-RXG.js.map → PkFilePreview-D_piCsAW.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-DYU2CUZS.js → PkFilePreviewDialog-Bq0ipzrJ.js} +3 -3
- package/dist/_chunks/{PkFilePreviewDialog-DYU2CUZS.js.map → PkFilePreviewDialog-Bq0ipzrJ.js.map} +1 -1
- package/dist/_chunks/{PkHeldImage-BUHSVQzX.js → PkHeldImage-EMuOT-Iv.js} +2 -2
- package/dist/_chunks/{PkHeldImage-BUHSVQzX.js.map → PkHeldImage-EMuOT-Iv.js.map} +1 -1
- package/dist/_chunks/{PkLazyImg-B7PfEr4P.js → PkLazyImg-CLCyyzuo.js} +2 -2
- package/dist/_chunks/{PkLazyImg-B7PfEr4P.js.map → PkLazyImg-CLCyyzuo.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CeWyL_2B.js → PkStreamingMarkdown-CHwrLP75.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-CeWyL_2B.js.map → PkStreamingMarkdown-CHwrLP75.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-BMj7-urz.js → PkToolChatFile-DO4zjMJr.js} +4 -4
- package/dist/_chunks/{PkToolChatFile-BMj7-urz.js.map → PkToolChatFile-DO4zjMJr.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-D98zUqNQ.js → PkToolRequestGeolocation-C9PSITRU.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-D98zUqNQ.js.map → PkToolRequestGeolocation-C9PSITRU.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-DwcRnUcd.js → PkToolRequestOAuthConnection-CWi5SeCi.js} +3 -3
- package/dist/_chunks/{PkToolRequestOAuthConnection-DwcRnUcd.js.map → PkToolRequestOAuthConnection-CWi5SeCi.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-1zhZDa0R.js → PkToolShareDocument-Buzu27rQ.js} +6 -6
- package/dist/_chunks/{PkToolShareDocument-1zhZDa0R.js.map → PkToolShareDocument-Buzu27rQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BoJC-NtV.js → PkToolShowArtifact-B2-3-k2F.js} +4 -4
- package/dist/_chunks/{PkToolShowArtifact-BoJC-NtV.js.map → PkToolShowArtifact-B2-3-k2F.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-Dvp1SwBY.js → PkToolShowCalendarEvent-mVY2FS24.js} +4 -4
- package/dist/_chunks/{PkToolShowCalendarEvent-Dvp1SwBY.js.map → PkToolShowCalendarEvent-mVY2FS24.js.map} +1 -1
- package/dist/_chunks/{PkToolShowComparison-BPfyn08U.js → PkToolShowComparison-7NCImocZ.js} +4 -4
- package/dist/_chunks/{PkToolShowComparison-BPfyn08U.js.map → PkToolShowComparison-7NCImocZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CErVBzjl.js → PkToolShowContactForm-DbOZHB_G.js} +5 -5
- package/dist/_chunks/{PkToolShowContactForm-CErVBzjl.js.map → PkToolShowContactForm-DbOZHB_G.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-C1Q5jhbk.js → PkToolShowDiagram-BHd-C_cx.js} +4 -4
- package/dist/_chunks/{PkToolShowDiagram-C1Q5jhbk.js.map → PkToolShowDiagram-BHd-C_cx.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-Ckxmf4jc.js → PkToolShowEmail-B9F7dnif.js} +4 -4
- package/dist/_chunks/{PkToolShowEmail-Ckxmf4jc.js.map → PkToolShowEmail-B9F7dnif.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-B7Q79XAb.js → PkToolShowForm-o2LuWDNq.js} +6 -6
- package/dist/_chunks/{PkToolShowForm-B7Q79XAb.js.map → PkToolShowForm-o2LuWDNq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CxeQcE6A.js → PkToolShowImageGallery-DAcW2Dau.js} +3 -3
- package/dist/_chunks/{PkToolShowImageGallery-CxeQcE6A.js.map → PkToolShowImageGallery-DAcW2Dau.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-Drq1nnwN.js → PkToolShowLocation-CLS9HQIJ.js} +4 -4
- package/dist/_chunks/{PkToolShowLocation-Drq1nnwN.js.map → PkToolShowLocation-CLS9HQIJ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMessage-h2LUBvO4.js → PkToolShowMessage-BoKDMyvU.js} +4 -4
- package/dist/_chunks/{PkToolShowMessage-h2LUBvO4.js.map → PkToolShowMessage-BoKDMyvU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-DDqYsHNq.js → PkToolShowProductList-OYwQCHar.js} +4 -4
- package/dist/_chunks/{PkToolShowProductList-DDqYsHNq.js.map → PkToolShowProductList-OYwQCHar.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-C8GfpW7f.js → PkToolShowQrCode-e6DxEcWY.js} +4 -4
- package/dist/_chunks/{PkToolShowQrCode-C8GfpW7f.js.map → PkToolShowQrCode-e6DxEcWY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CTc2s510.js → PkToolShowSources-CUNneZCp.js} +4 -4
- package/dist/_chunks/{PkToolShowSources-CTc2s510.js.map → PkToolShowSources-CUNneZCp.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-vui8vph1.js → PkToolShowSuggestedReply-BTE7TZ4Z.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-vui8vph1.js.map → PkToolShowSuggestedReply-BTE7TZ4Z.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-C2kh6pVN.js → PkToolShowVideo-bTWeXtZd.js} +3 -3
- package/dist/_chunks/{PkToolShowVideo-C2kh6pVN.js.map → PkToolShowVideo-bTWeXtZd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-7_f5k1pX.js → PkToolShowWeather-Nr7POGAS.js} +2 -2
- package/dist/_chunks/{PkToolShowWeather-7_f5k1pX.js.map → PkToolShowWeather-Nr7POGAS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-By7zBIVa.js → PkToolShowWebPages-DNbdkSSz.js} +4 -4
- package/dist/_chunks/{PkToolShowWebPages-By7zBIVa.js.map → PkToolShowWebPages-DNbdkSSz.js.map} +1 -1
- package/dist/_chunks/{VvButtonLocalized-DCJiCUYU.js → VvButtonLocalized-KEhD3ono.js} +2 -2
- package/dist/_chunks/{VvButtonLocalized-DCJiCUYU.js.map → VvButtonLocalized-KEhD3ono.js.map} +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-tzyEhJUc.js → VvCheckboxGroup.es-D67JvxVf.js} +2 -2
- package/dist/_chunks/{VvCheckboxGroup.es-tzyEhJUc.js.map → VvCheckboxGroup.es-D67JvxVf.js.map} +1 -1
- package/dist/_chunks/{VvCombobox.es-D8QFCY85.js → VvCombobox.es-Bb9Dbtdg.js} +457 -457
- package/dist/_chunks/{VvCombobox.es-D8QFCY85.js.map → VvCombobox.es-Bb9Dbtdg.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-CaN-GUXU.js → VvInputText.es-CWgEXnVy.js} +396 -396
- package/dist/_chunks/{VvInputText.es-CaN-GUXU.js.map → VvInputText.es-CWgEXnVy.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es-D73Elvh0.js → VvRadioGroup.es-B3UbDh0z.js} +2 -2
- package/dist/_chunks/{VvRadioGroup.es-D73Elvh0.js.map → VvRadioGroup.es-B3UbDh0z.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-8ZE8Zjm9.js → VvSelect.es-BZkBK0gK.js} +170 -170
- package/dist/_chunks/{VvSelect.es-8ZE8Zjm9.js.map → VvSelect.es-BZkBK0gK.js.map} +1 -1
- package/dist/_chunks/{VvTextarea.es-BNgA61wM.js → VvTextarea.es-C8vAvoJh.js} +139 -139
- package/dist/_chunks/{VvTextarea.es-BNgA61wM.js.map → VvTextarea.es-C8vAvoJh.js.map} +1 -1
- package/dist/_chunks/{dist-m75acBC9.js → dist-B3-I_01H.js} +67 -15
- package/dist/_chunks/dist-B3-I_01H.js.map +1 -0
- package/dist/_chunks/{index.es-fkUmGg9G.js → index.es-C7ON2BA3.js} +38 -38
- package/dist/_chunks/{index.es-fkUmGg9G.js.map → index.es-C7ON2BA3.js.map} +1 -1
- package/dist/_chunks/{index.es-DRbDRAW5.js → index.es-CYAq7LJb.js} +10 -10
- package/dist/_chunks/{index.es-DRbDRAW5.js.map → index.es-CYAq7LJb.js.map} +1 -1
- package/dist/_chunks/{utils-DAQfsk2H.js → utils-BHvRrCzW.js} +6 -2
- package/dist/_chunks/utils-BHvRrCzW.js.map +1 -0
- package/dist/ai-elements.es.js +2747 -2727
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/_chunks/utils-BuxgMuKv.js.map +1 -1
- package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +9 -0
- package/dist-vue/packages/components/src/chat/PkPageControlBar.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +8 -0
- package/package.json +1 -1
- package/dist/_chunks/dist-m75acBC9.js.map +0 -1
- package/dist/_chunks/utils-DAQfsk2H.js.map +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { A as e, B as t, D as n, Dt as r, E as i, Et as a, F as o, G as s, H as c, K as l, L as u, M as d, Ot as ee, P as f, Q as p, S as te, St as m, Tt as ne, V as re, Y as ie, _ as h, b as g, d as ae, et as oe, f as se, g as
|
|
2
|
-
import { a as
|
|
3
|
-
import { b as
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as
|
|
1
|
+
import { A as e, B as t, D as n, Dt as r, E as i, Et as a, F as o, G as s, H as c, K as l, L as u, M as d, Ot as ee, P as f, Q as p, S as te, St as m, Tt as ne, V as re, Y as ie, _ as h, b as g, d as ae, et as oe, f as se, g as ce, gt as _, h as v, k as le, kt as y, l as ue, nt as de, ot as fe, pt as pe, q as me, r as he, t as ge, tt as b, ut as _e, v as x, w as S, wt as C, x as w, xt as ve, y as T, z as E } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
2
|
+
import { a as D, i as ye, t as O } from "./iconify-oSMMdRMF.js";
|
|
3
|
+
import { b as be, c as xe, d as Se, f as Ce, h as we, n as k, r as A, u as Te, x as Ee } from "./dist-B3-I_01H.js";
|
|
4
|
+
import { a as De, c as Oe, i as ke, l as Ae, n as j, o as M, r as je, s as Me, t as N } from "./floating-ui.vue-HobyB7z6.js";
|
|
5
|
+
import { t as Ne } from "./esm-DrTdMB4T.js";
|
|
6
6
|
// ../../node_modules/.pnpm/@volverjs+ui-vue@0.0.25_@json-render+core@0.19.0_zod@4.6.7__@volverjs+style@0.1.32_@vue_6457cdc65e61a009108dae6427ee3925/node_modules/@volverjs/ui-vue/dist/components/VvInputText/VvInputText.es.js
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (typeof e != "string" || !
|
|
7
|
+
le(), he(), fe(), ne();
|
|
8
|
+
var P = (e) => e.toString().padStart(2, "0"), F = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
9
|
+
function Pe(e) {
|
|
10
|
+
if (typeof e != "string" || !F.test(e)) return !1;
|
|
11
11
|
let t = new Date(e);
|
|
12
12
|
return !Number.isNaN(t.getTime()) && t.toISOString() === e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (typeof e == "string" && !
|
|
14
|
+
function Fe(e, t = "date", n) {
|
|
15
|
+
if (typeof e == "string" && !Pe(e)) return "";
|
|
16
16
|
let r = new Date(e);
|
|
17
17
|
if (Number.isNaN(r.getTime())) return "";
|
|
18
|
-
let i = `${r.getFullYear()}-${
|
|
19
|
-
if (t === "month" || (i += `-${
|
|
20
|
-
let a = n ? `${
|
|
18
|
+
let i = `${r.getFullYear()}-${P(r.getMonth() + 1)}`;
|
|
19
|
+
if (t === "month" || (i += `-${P(r.getDate())}`, t === "date")) return i;
|
|
20
|
+
let a = n ? `${P(r.getHours())}:${P(r.getMinutes())}:${P(r.getSeconds())}` : `${P(r.getHours())}:${P(r.getMinutes())}`;
|
|
21
21
|
return t === "time" ? a : `${i}T${a}`;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
23
|
+
var Ie = /^\d{4}-\d{2}-\d{2}$/, Le = /^\d{4}-\d{2}$/, I = /^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/, L = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2})?$/;
|
|
24
|
+
function R(e, t = "date") {
|
|
25
25
|
if (!e?.trim()) return null;
|
|
26
26
|
let n = /* @__PURE__ */ new Date(), r = n.getFullYear(), i = n.getMonth(), a = n.getDate();
|
|
27
27
|
if (t === "date") {
|
|
28
|
-
if (!
|
|
28
|
+
if (!Ie.test(e)) throw Error("Invalid date format. Expected: YYYY-MM-DD");
|
|
29
29
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
30
30
|
}
|
|
31
31
|
if (t === "month") {
|
|
32
|
-
if (!
|
|
32
|
+
if (!Le.test(e)) throw Error("Invalid month format. Expected: YYYY-MM");
|
|
33
33
|
return /* @__PURE__ */ new Date(`${e}-01T00:00:00`);
|
|
34
34
|
}
|
|
35
35
|
if (t === "time") {
|
|
36
|
-
if (!
|
|
37
|
-
return e.length === 8 ? /* @__PURE__ */ new Date(`${r}-${
|
|
36
|
+
if (!I.test(e)) throw Error("Invalid time format. Expected: HH:mm or HH:mm:ss");
|
|
37
|
+
return e.length === 8 ? /* @__PURE__ */ new Date(`${r}-${P(i + 1)}-${P(a)}T${e}`) : /* @__PURE__ */ new Date(`${r}-${P(i + 1)}-${P(a)}T${e}:00`);
|
|
38
38
|
}
|
|
39
|
-
if (!
|
|
39
|
+
if (!L.test(e)) throw Error("Invalid datetime format. Expected: YYYY-MM-DDThh:mm or YYYY-MM-DDThh:mm:ss");
|
|
40
40
|
return e.length === 16 ? /* @__PURE__ */ new Date(`${e}:00`) : /* @__PURE__ */ new Date(`${e}`);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(
|
|
42
|
+
function z(e) {
|
|
43
|
+
return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(C(e));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function B(e) {
|
|
46
46
|
return typeof e == "string";
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return Array.isArray(e) ? e.filter((e) =>
|
|
48
|
+
function Re(e) {
|
|
49
|
+
return Array.isArray(e) ? e.filter((e) => B(e)).join(" ") : e;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let r =
|
|
51
|
+
function ze(e, t) {
|
|
52
|
+
let r = v(() => _e(e) ? e.value : e), i = v(() => Re(r.value.invalidLabel)), a = v(() => Re(r.value.validLabel)), o = v(() => r.value.loadingLabel), s = v(() => r.value.hintLabel), c = v(() => !!(r.value.loading && (t.loading || o.value))), l = v(() => !c.value && !!(r.value.invalid && (t.invalid || i.value))), u = v(() => !c.value && !l.value && !!(r.value.valid && (t.valid || a.value))), d = v(() => !c.value && !l.value && !u.value && !!(t.hint || s.value)), ee = v(() => l.value || u.value || c.value || d.value);
|
|
53
53
|
return {
|
|
54
54
|
hasInvalidLabelOrSlot: l,
|
|
55
55
|
hasHintLabelOrSlot: d,
|
|
56
56
|
hasValidLabelOrSlot: u,
|
|
57
57
|
hasLoadingLabelOrSlot: c,
|
|
58
|
-
hintSlotScope:
|
|
58
|
+
hintSlotScope: v(() => ({
|
|
59
59
|
modelValue: r.value.modelValue,
|
|
60
60
|
valid: r.value.valid,
|
|
61
61
|
invalid: r.value.invalid,
|
|
62
62
|
loading: r.value.loading
|
|
63
63
|
})),
|
|
64
|
-
HintSlot:
|
|
64
|
+
HintSlot: S({
|
|
65
65
|
name: "HintSlot",
|
|
66
66
|
props: { tag: {
|
|
67
67
|
type: String,
|
|
@@ -90,27 +90,27 @@ function Re(e, t) {
|
|
|
90
90
|
})
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
var
|
|
93
|
+
var V = /* @__PURE__ */ (function(e) {
|
|
94
94
|
return e.local = "local", e.session = "session", e;
|
|
95
|
-
})({}),
|
|
95
|
+
})({}), Be = /* @__PURE__ */ (function(e) {
|
|
96
96
|
return e.absolute = "absolute", e.fixed = "fixed", e;
|
|
97
|
-
})({}),
|
|
97
|
+
})({}), H = /* @__PURE__ */ (function(e) {
|
|
98
98
|
return e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e;
|
|
99
|
-
})({}),
|
|
99
|
+
})({}), Ve = /* @__PURE__ */ (function(e) {
|
|
100
100
|
return 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;
|
|
101
|
-
})({}),
|
|
101
|
+
})({}), U = /* @__PURE__ */ (function(e) {
|
|
102
102
|
return e.before = "before", e.after = "after", e;
|
|
103
|
-
})({}), Ve = /* @__PURE__ */ (function(e) {
|
|
104
|
-
return e.button = "button", e.submit = "submit", e.reset = "reset", e;
|
|
105
103
|
})({}), He = /* @__PURE__ */ (function(e) {
|
|
104
|
+
return e.button = "button", e.submit = "submit", e.reset = "reset", e;
|
|
105
|
+
})({}), Ue = /* @__PURE__ */ (function(e) {
|
|
106
106
|
return e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e;
|
|
107
|
-
})({}),
|
|
107
|
+
})({}), W = /* @__PURE__ */ (function(e) {
|
|
108
108
|
return e.button = "button", e.link = "link", e.menuitem = "menuitem", e;
|
|
109
|
-
})({}),
|
|
109
|
+
})({}), G = /* @__PURE__ */ (function(e) {
|
|
110
110
|
return e.listbox = "listbox", e.menu = "menu", e;
|
|
111
|
-
})({}),
|
|
111
|
+
})({}), We = /* @__PURE__ */ (function(e) {
|
|
112
112
|
return e.option = "option", e.presentation = "presentation", e;
|
|
113
|
-
})({}),
|
|
113
|
+
})({}), Ge = /* @__PURE__ */ Symbol.for("volver"), Ke = /* @__PURE__ */ Symbol.for("dropdownTrigger"), K = /* @__PURE__ */ Symbol.for("dropdownItem"), qe = /* @__PURE__ */ Symbol.for("dropdownAction"), q = {
|
|
114
114
|
showPassword: "eye-on",
|
|
115
115
|
hidePassword: "eye-off",
|
|
116
116
|
showDatePicker: "calendar",
|
|
@@ -237,8 +237,8 @@ var nt = { pressed: {
|
|
|
237
237
|
},
|
|
238
238
|
iconPosition: {
|
|
239
239
|
type: String,
|
|
240
|
-
default:
|
|
241
|
-
validator: (e) => Object.values(
|
|
240
|
+
default: U.before,
|
|
241
|
+
validator: (e) => Object.values(U).includes(e)
|
|
242
242
|
}
|
|
243
243
|
}, ut = { tabindex: {
|
|
244
244
|
type: [String, Number],
|
|
@@ -252,13 +252,13 @@ var nt = { pressed: {
|
|
|
252
252
|
} }, pt = { id: [String, Number] }, mt = {
|
|
253
253
|
placement: {
|
|
254
254
|
type: String,
|
|
255
|
-
default:
|
|
256
|
-
validator: (e) => Object.values(
|
|
255
|
+
default: H.bottom,
|
|
256
|
+
validator: (e) => Object.values(H).includes(e) || Object.values(Ve).includes(e)
|
|
257
257
|
},
|
|
258
258
|
strategy: {
|
|
259
259
|
type: String,
|
|
260
260
|
default: void 0,
|
|
261
|
-
validator: (e) => Object.values(
|
|
261
|
+
validator: (e) => Object.values(Be).includes(e)
|
|
262
262
|
},
|
|
263
263
|
transitionName: {
|
|
264
264
|
type: String,
|
|
@@ -382,12 +382,12 @@ var nt = { pressed: {
|
|
|
382
382
|
...Y,
|
|
383
383
|
...tt,
|
|
384
384
|
...Ye
|
|
385
|
-
},
|
|
385
|
+
}, He.button, Ue.button;
|
|
386
386
|
var yt = {
|
|
387
387
|
storageType: {
|
|
388
388
|
type: String,
|
|
389
|
-
default:
|
|
390
|
-
validator: (e) => Object.values(
|
|
389
|
+
default: V.local,
|
|
390
|
+
validator: (e) => Object.values(V).includes(e)
|
|
391
391
|
},
|
|
392
392
|
storageKey: String
|
|
393
393
|
}, bt = {
|
|
@@ -404,8 +404,8 @@ var yt = {
|
|
|
404
404
|
},
|
|
405
405
|
role: {
|
|
406
406
|
type: String,
|
|
407
|
-
default:
|
|
408
|
-
validator: (e) => Object.values(
|
|
407
|
+
default: G.menu,
|
|
408
|
+
validator: (e) => Object.values(G).includes(e)
|
|
409
409
|
}
|
|
410
410
|
}, xt = { focusOnHover: {
|
|
411
411
|
type: Boolean,
|
|
@@ -424,11 +424,11 @@ var yt = {
|
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
426
|
function Ct(e) {
|
|
427
|
-
let t =
|
|
428
|
-
return
|
|
427
|
+
let t = me();
|
|
428
|
+
return v(() => String(e?.value || t));
|
|
429
429
|
}
|
|
430
430
|
function wt(e, t) {
|
|
431
|
-
let n = globalThis.HTMLElement !== void 0 && "popover" in globalThis.HTMLElement.prototype, r =
|
|
431
|
+
let n = globalThis.HTMLElement !== void 0 && "popover" in globalThis.HTMLElement.prototype, r = v(() => n && m(t)), i = v(() => r.value ? "manual" : void 0);
|
|
432
432
|
function a() {
|
|
433
433
|
return (n && e.value?.matches(":popover-open")) ?? !1;
|
|
434
434
|
}
|
|
@@ -450,13 +450,13 @@ function wt(e, t) {
|
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
function Tt({ reference: e, id: r, expanded: i, aria: a }) {
|
|
453
|
-
let o =
|
|
453
|
+
let o = Ae();
|
|
454
454
|
return {
|
|
455
455
|
bus: o,
|
|
456
|
-
component:
|
|
456
|
+
component: S({
|
|
457
457
|
name: "VvDropdownTriggerProvider",
|
|
458
458
|
setup() {
|
|
459
|
-
t(
|
|
459
|
+
t(Ke, {
|
|
460
460
|
reference: e,
|
|
461
461
|
id: r,
|
|
462
462
|
expanded: i,
|
|
@@ -471,25 +471,25 @@ function Tt({ reference: e, id: r, expanded: i, aria: a }) {
|
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
473
|
function Et({ role: e, ...n }) {
|
|
474
|
-
let r =
|
|
475
|
-
return t(
|
|
474
|
+
let r = v(() => e.value === G.listbox ? We.option : We.presentation);
|
|
475
|
+
return t(K, {
|
|
476
476
|
role: r,
|
|
477
477
|
...n
|
|
478
478
|
}), { itemRole: r };
|
|
479
479
|
}
|
|
480
480
|
function Dt({ expanded: e }) {
|
|
481
481
|
t(qe, {
|
|
482
|
-
role:
|
|
482
|
+
role: _(W.menuitem),
|
|
483
483
|
expanded: e
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
function Ot(e, t, n) {
|
|
487
|
-
return
|
|
487
|
+
return v(() => {
|
|
488
488
|
let r = { [e]: !0 }, i = typeof t?.value == "string" ? t.value.split(" ") : t?.value;
|
|
489
489
|
return i && Array.isArray(i) && i.forEach((t) => {
|
|
490
490
|
t && (r[`${e}--${t}`] = !0);
|
|
491
491
|
}), n && Object.keys(n.value).forEach((t) => {
|
|
492
|
-
r[`${e}--${t}`] =
|
|
492
|
+
r[`${e}--${t}`] = C(n.value[t]);
|
|
493
493
|
}), r;
|
|
494
494
|
});
|
|
495
495
|
}
|
|
@@ -498,7 +498,7 @@ var kt = ["popover"], At = [
|
|
|
498
498
|
"tabindex",
|
|
499
499
|
"role",
|
|
500
500
|
"aria-labelledby"
|
|
501
|
-
], jt = /* @__PURE__ */
|
|
501
|
+
], jt = /* @__PURE__ */ S({
|
|
502
502
|
name: "VvDropdown",
|
|
503
503
|
inheritAttrs: !1,
|
|
504
504
|
props: bt,
|
|
@@ -520,164 +520,164 @@ var kt = ["popover"], At = [
|
|
|
520
520
|
"leaveCancelled"
|
|
521
521
|
],
|
|
522
522
|
setup(e, { expose: t, emit: n }) {
|
|
523
|
-
let d = e, m = n, { id: ne } =
|
|
523
|
+
let d = e, m = n, { id: ne } = ve(d), re = Ct(ne), ie = l(), h = _(), g = _(), ae = _(), le = _(), y = v({
|
|
524
524
|
get: () => d.reference ?? h.value,
|
|
525
525
|
set: (e) => {
|
|
526
526
|
h.value = e;
|
|
527
527
|
}
|
|
528
|
-
}), { isTopLayer:
|
|
528
|
+
}), { isTopLayer: fe, popover: pe, show: me, hide: he } = wt(g, () => d.topLayer), _e = v(() => fe.value ? Be.fixed : d.strategy), S = _(!1);
|
|
529
529
|
u(() => {
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
we(g.value, () => {
|
|
531
|
+
S.value = globalThis.getComputedStyle(g.value).getPropertyValue("--dropdown-custom-position")?.trim() === "true";
|
|
532
532
|
}, {
|
|
533
533
|
attributeFilter: ["style"],
|
|
534
534
|
window: globalThis.window
|
|
535
535
|
});
|
|
536
536
|
});
|
|
537
|
-
function
|
|
537
|
+
function w(e, t, n) {
|
|
538
538
|
return typeof e == "boolean" ? t() : n(e);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function D(e) {
|
|
541
541
|
return !e.width && !e.height;
|
|
542
542
|
}
|
|
543
|
-
let
|
|
543
|
+
let ye = {
|
|
544
544
|
name: "uncap",
|
|
545
545
|
fn({ elements: e, rects: t, middlewareData: n }) {
|
|
546
546
|
let { style: r } = e.floating, i = t.floating.height >= Number.parseFloat(r.maxHeight) - 1 || t.floating.width >= Number.parseFloat(r.maxWidth) - 1;
|
|
547
|
-
return n.uncap || !i ||
|
|
547
|
+
return n.uncap || !i || D(t.floating) ? {} : (r.maxHeight = "", r.maxWidth = "", {
|
|
548
548
|
data: { uncapped: !0 },
|
|
549
549
|
reset: { rects: !0 }
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, O = v(() => {
|
|
553
553
|
let e = [];
|
|
554
|
-
d.size && e.push(
|
|
554
|
+
d.size && e.push(ye), d.offset && e.push(["string", "number"].includes(typeof d.offset) ? M(Number(d.offset)) : M(d.offset));
|
|
555
555
|
let t = typeof d.size == "object" ? d.size.padding : void 0;
|
|
556
|
-
if (d.autoPlacement ? e.push(
|
|
556
|
+
if (d.autoPlacement ? e.push(w(d.autoPlacement, () => je(), (e) => je(e))) : d.flip && e.push(w(d.flip, () => De({
|
|
557
557
|
fallbackStrategy: "initialPlacement",
|
|
558
558
|
padding: t
|
|
559
|
-
}), (e) =>
|
|
559
|
+
}), (e) => De({
|
|
560
560
|
padding: t,
|
|
561
561
|
...e
|
|
562
|
-
}))), d.shift && e.push(
|
|
562
|
+
}))), d.shift && e.push(w(d.shift, () => Me(), (e) => Me(e))), d.size) {
|
|
563
563
|
let t = ({ availableWidth: e, availableHeight: t, elements: n, rects: r }) => {
|
|
564
|
-
if (
|
|
564
|
+
if (D(r.floating) || S.value) return;
|
|
565
565
|
let { style: i } = n.floating;
|
|
566
|
-
i.maxWidth = d.triggerWidth &&
|
|
566
|
+
i.maxWidth = d.triggerWidth && y.value ? "" : `${Math.max(0, e)}px`, i.maxHeight = `${Math.max(0, t)}px`;
|
|
567
567
|
};
|
|
568
|
-
e.push(
|
|
568
|
+
e.push(w(d.size, () => Oe({ apply: t }), (e) => Oe({
|
|
569
569
|
...e,
|
|
570
570
|
apply: (n) => (t(n), e?.apply?.(n))
|
|
571
571
|
})));
|
|
572
572
|
}
|
|
573
|
-
return d.arrow && e.push(
|
|
574
|
-
}), { x:
|
|
575
|
-
placement:
|
|
576
|
-
strategy:
|
|
577
|
-
middleware:
|
|
578
|
-
}),
|
|
579
|
-
if (
|
|
580
|
-
let e = d.triggerWidth &&
|
|
573
|
+
return d.arrow && e.push(N({ element: ae })), e;
|
|
574
|
+
}), { x: be, y: Se, middlewareData: Te, placement: Ae, strategy: Ne, update: P } = j(y, g, {
|
|
575
|
+
placement: v(() => d.placement),
|
|
576
|
+
strategy: _e,
|
|
577
|
+
middleware: O
|
|
578
|
+
}), F = v(() => {
|
|
579
|
+
if (S.value) return;
|
|
580
|
+
let e = d.triggerWidth && y.value ? `${y.value?.offsetWidth}px` : void 0;
|
|
581
581
|
return {
|
|
582
|
-
position:
|
|
583
|
-
top: `${
|
|
584
|
-
left: `${
|
|
582
|
+
position: Ne.value,
|
|
583
|
+
top: `${Se.value ?? 0}px`,
|
|
584
|
+
left: `${be.value ?? 0}px`,
|
|
585
585
|
width: e
|
|
586
586
|
};
|
|
587
|
-
}),
|
|
588
|
-
if (
|
|
587
|
+
}), Pe = v(() => Ae.value.split("-")[0]), Fe = v(() => {
|
|
588
|
+
if (S.value) return;
|
|
589
589
|
let e = {
|
|
590
|
-
[
|
|
591
|
-
[
|
|
592
|
-
[
|
|
593
|
-
[
|
|
594
|
-
}[
|
|
590
|
+
[H.top]: H.bottom,
|
|
591
|
+
[H.right]: H.left,
|
|
592
|
+
[H.bottom]: H.top,
|
|
593
|
+
[H.left]: H.right
|
|
594
|
+
}[Pe.value];
|
|
595
595
|
return {
|
|
596
|
-
left:
|
|
597
|
-
top:
|
|
596
|
+
left: Te.value.arrow?.x === void 0 ? void 0 : `${Te.value.arrow?.x}px`,
|
|
597
|
+
top: Te.value.arrow?.y === void 0 ? void 0 : `${Te.value.arrow?.y}px`,
|
|
598
598
|
[e]: `${-(ae.value?.offsetWidth ?? 0) / 2}px`
|
|
599
599
|
};
|
|
600
|
-
}),
|
|
601
|
-
get: () =>
|
|
600
|
+
}), Ie = Ee(d, "modelValue", m), Le = _(!1), I = v({
|
|
601
|
+
get: () => Ie.value ?? Le.value,
|
|
602
602
|
set: (e) => {
|
|
603
|
-
|
|
603
|
+
Ie.value === void 0 ? Le.value = e : Ie.value = e;
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
606
|
p([
|
|
607
|
-
|
|
608
|
-
|
|
607
|
+
I,
|
|
608
|
+
y,
|
|
609
609
|
g,
|
|
610
|
-
|
|
610
|
+
_e
|
|
611
611
|
], ([e, t, n, r], i, a) => {
|
|
612
|
-
e && t && n && a(
|
|
612
|
+
e && t && n && a(ke(t, n, P, { animationFrame: r === Be.fixed }));
|
|
613
613
|
}, {
|
|
614
614
|
flush: "post",
|
|
615
615
|
immediate: !0
|
|
616
|
-
}),
|
|
617
|
-
|
|
616
|
+
}), we(le, () => {
|
|
617
|
+
I.value && P();
|
|
618
618
|
}, {
|
|
619
619
|
childList: !0,
|
|
620
620
|
subtree: !0,
|
|
621
621
|
characterData: !0
|
|
622
622
|
}), oe(() => {
|
|
623
|
-
|
|
623
|
+
I.value && me();
|
|
624
624
|
});
|
|
625
|
+
function L() {
|
|
626
|
+
I.value = !0;
|
|
627
|
+
}
|
|
625
628
|
function R() {
|
|
626
|
-
|
|
629
|
+
I.value = !1;
|
|
627
630
|
}
|
|
628
631
|
function z() {
|
|
629
|
-
|
|
632
|
+
I.value = !I.value;
|
|
630
633
|
}
|
|
631
|
-
function B() {
|
|
632
|
-
|
|
634
|
+
function B(e) {
|
|
635
|
+
y.value = e;
|
|
633
636
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
!d.keepOpen && L.value && (L.value = !1);
|
|
639
|
-
}, { ignore: [b] });
|
|
640
|
-
let Le = y(() => b.value?.getAttribute?.("id") ?? void 0), Re = y(() => ({
|
|
637
|
+
k(g, () => {
|
|
638
|
+
!d.keepOpen && I.value && (I.value = !1);
|
|
639
|
+
}, { ignore: [y] });
|
|
640
|
+
let Re = v(() => y.value?.getAttribute?.("id") ?? void 0), ze = v(() => ({
|
|
641
641
|
"aria-controls": re.value,
|
|
642
642
|
"aria-haspopup": !0,
|
|
643
|
-
"aria-expanded":
|
|
644
|
-
})), { component:
|
|
645
|
-
reference:
|
|
643
|
+
"aria-expanded": I.value
|
|
644
|
+
})), { component: V, bus: Ve } = Tt({
|
|
645
|
+
reference: y,
|
|
646
646
|
id: re,
|
|
647
|
-
expanded:
|
|
648
|
-
aria:
|
|
647
|
+
expanded: I,
|
|
648
|
+
aria: ze
|
|
649
649
|
});
|
|
650
|
-
|
|
651
|
-
let { role:
|
|
652
|
-
function
|
|
650
|
+
Ve.on("click", z);
|
|
651
|
+
let { role: U, modifiers: He } = ve(d), Ue = Ot("vv-dropdown", He, v(() => ({ arrow: d.arrow }))), { focused: W } = Ce(g);
|
|
652
|
+
function G(e) {
|
|
653
653
|
return e ? [...e.querySelectorAll("a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])")].filter((e) => !e.hasAttribute("disabled") && !e.getAttribute("aria-hidden")) : [];
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function We() {
|
|
656
656
|
o(() => {
|
|
657
|
-
let e =
|
|
657
|
+
let e = G(g.value);
|
|
658
658
|
e.length > 0 && e[0].focus({ preventScroll: !0 });
|
|
659
659
|
});
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Ge() {
|
|
662
662
|
o(() => {
|
|
663
|
-
let e =
|
|
663
|
+
let e = G(le.value);
|
|
664
664
|
e.length > 0 && e[0].focus({ preventScroll: !0 });
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Ke() {
|
|
668
668
|
o(() => {
|
|
669
|
-
if (
|
|
670
|
-
let e =
|
|
669
|
+
if (W.value) {
|
|
670
|
+
let e = G(g.value);
|
|
671
671
|
if (e.length === 0 || !document.activeElement) return;
|
|
672
672
|
let t = e.indexOf(document.activeElement);
|
|
673
673
|
t < e.length - 1 ? e[t + 1].focus({ preventScroll: !0 }) : e[0].focus({ preventScroll: !0 });
|
|
674
674
|
}
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function K() {
|
|
678
678
|
o(() => {
|
|
679
|
-
if (
|
|
680
|
-
let e =
|
|
679
|
+
if (W.value) {
|
|
680
|
+
let e = G(g.value);
|
|
681
681
|
if (e.length === 0 || !document.activeElement) return;
|
|
682
682
|
let t = e.indexOf(document.activeElement);
|
|
683
683
|
if (t > 0) {
|
|
@@ -688,41 +688,41 @@ var kt = ["popover"], At = [
|
|
|
688
688
|
}
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
|
-
p(
|
|
692
|
-
e && d.autofocusFirst &&
|
|
691
|
+
p(I, (e) => {
|
|
692
|
+
e && d.autofocusFirst && We();
|
|
693
693
|
}), t({
|
|
694
|
-
toggle:
|
|
695
|
-
show:
|
|
696
|
-
hide:
|
|
697
|
-
init:
|
|
698
|
-
focusFirst:
|
|
699
|
-
focusFirstListElement:
|
|
700
|
-
focusNext:
|
|
701
|
-
focusPrev:
|
|
702
|
-
customPosition:
|
|
694
|
+
toggle: z,
|
|
695
|
+
show: L,
|
|
696
|
+
hide: R,
|
|
697
|
+
init: B,
|
|
698
|
+
focusFirst: We,
|
|
699
|
+
focusFirstListElement: Ge,
|
|
700
|
+
focusNext: Ke,
|
|
701
|
+
focusPrev: K,
|
|
702
|
+
customPosition: S
|
|
703
703
|
});
|
|
704
704
|
let { itemRole: qe } = Et({
|
|
705
|
-
role:
|
|
706
|
-
expanded:
|
|
707
|
-
focused:
|
|
708
|
-
hovered:
|
|
705
|
+
role: U,
|
|
706
|
+
expanded: I,
|
|
707
|
+
focused: W,
|
|
708
|
+
hovered: xe(g)
|
|
709
709
|
});
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}),
|
|
713
|
-
|
|
714
|
-
}),
|
|
715
|
-
|
|
716
|
-
}),
|
|
710
|
+
A("Escape", (e) => {
|
|
711
|
+
I.value && (e.preventDefault(), R());
|
|
712
|
+
}), A("ArrowDown", (e) => {
|
|
713
|
+
I.value && W.value && (e.preventDefault(), Ke());
|
|
714
|
+
}), A("ArrowUp", (e) => {
|
|
715
|
+
I.value && W.value && (e.preventDefault(), K());
|
|
716
|
+
}), A([" ", "Enter"], (e) => {
|
|
717
717
|
let t = e.target;
|
|
718
|
-
|
|
718
|
+
I.value && W.value && t && t?.click();
|
|
719
719
|
});
|
|
720
720
|
let q = {
|
|
721
721
|
"before-enter": () => {
|
|
722
722
|
m("beforeExpand"), m("beforeEnter");
|
|
723
723
|
},
|
|
724
724
|
"after-leave": () => {
|
|
725
|
-
|
|
725
|
+
I.value || he(), m("afterCollapse"), m("afterLeave");
|
|
726
726
|
},
|
|
727
727
|
enter: () => {
|
|
728
728
|
m("enter");
|
|
@@ -743,105 +743,105 @@ var kt = ["popover"], At = [
|
|
|
743
743
|
m("leaveCancelled");
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
|
-
return (e, t) => (
|
|
747
|
-
default:
|
|
748
|
-
init:
|
|
749
|
-
show:
|
|
750
|
-
hide:
|
|
751
|
-
toggle:
|
|
752
|
-
expanded:
|
|
753
|
-
aria:
|
|
746
|
+
return (e, t) => (E(), T(se, null, [te(C(V), null, {
|
|
747
|
+
default: b(() => [c(e.$slots, "default", r(i({
|
|
748
|
+
init: B,
|
|
749
|
+
show: L,
|
|
750
|
+
hide: R,
|
|
751
|
+
toggle: z,
|
|
752
|
+
expanded: C(I),
|
|
753
|
+
aria: C(ze)
|
|
754
754
|
})))]),
|
|
755
755
|
_: 3
|
|
756
|
-
}), te(
|
|
757
|
-
default:
|
|
756
|
+
}), te(ge, f({ name: e.transitionName }, s(q), { persisted: "" }), {
|
|
757
|
+
default: b(() => [de(ce("div", {
|
|
758
758
|
ref_key: "floatingEl",
|
|
759
759
|
ref: g,
|
|
760
|
-
popover:
|
|
761
|
-
style: ee(
|
|
762
|
-
class: a(
|
|
760
|
+
popover: C(pe),
|
|
761
|
+
style: ee(C(F)),
|
|
762
|
+
class: a(C(Ue))
|
|
763
763
|
}, [
|
|
764
|
-
d.arrow ? (
|
|
764
|
+
d.arrow ? (E(), T("div", {
|
|
765
765
|
key: 0,
|
|
766
766
|
ref_key: "arrowEl",
|
|
767
767
|
ref: ae,
|
|
768
|
-
style: ee(
|
|
768
|
+
style: ee(C(Fe)),
|
|
769
769
|
class: "vv-dropdown__arrow"
|
|
770
|
-
}, null, 4)) :
|
|
770
|
+
}, null, 4)) : x("v-if", !0),
|
|
771
771
|
c(e.$slots, "before", r(i({
|
|
772
|
-
show:
|
|
773
|
-
hide:
|
|
774
|
-
toggle:
|
|
775
|
-
expanded:
|
|
772
|
+
show: L,
|
|
773
|
+
hide: R,
|
|
774
|
+
toggle: z,
|
|
775
|
+
expanded: C(I)
|
|
776
776
|
}))),
|
|
777
|
-
|
|
778
|
-
id:
|
|
777
|
+
ce("div", f(C(ie), {
|
|
778
|
+
id: C(re),
|
|
779
779
|
ref_key: "listEl",
|
|
780
|
-
ref:
|
|
781
|
-
tabindex:
|
|
782
|
-
role:
|
|
783
|
-
"aria-labelledby":
|
|
780
|
+
ref: le,
|
|
781
|
+
tabindex: C(I) ? void 0 : -1,
|
|
782
|
+
role: C(U),
|
|
783
|
+
"aria-labelledby": C(Re),
|
|
784
784
|
class: "vv-dropdown__list"
|
|
785
785
|
}), [c(e.$slots, "items", r(i({
|
|
786
|
-
show:
|
|
787
|
-
hide:
|
|
788
|
-
toggle:
|
|
789
|
-
expanded:
|
|
790
|
-
role:
|
|
786
|
+
show: L,
|
|
787
|
+
hide: R,
|
|
788
|
+
toggle: z,
|
|
789
|
+
expanded: C(I),
|
|
790
|
+
role: C(qe)
|
|
791
791
|
})))], 16, At),
|
|
792
792
|
c(e.$slots, "after", r(i({
|
|
793
|
-
show:
|
|
794
|
-
hide:
|
|
795
|
-
toggle:
|
|
796
|
-
expanded:
|
|
793
|
+
show: L,
|
|
794
|
+
hide: R,
|
|
795
|
+
toggle: z,
|
|
796
|
+
expanded: C(I)
|
|
797
797
|
})))
|
|
798
|
-
], 14, kt), [[
|
|
798
|
+
], 14, kt), [[ue, C(I)]])]),
|
|
799
799
|
_: 3
|
|
800
800
|
}, 16, ["name"])], 64));
|
|
801
801
|
}
|
|
802
802
|
});
|
|
803
803
|
function Mt() {
|
|
804
|
-
return e(
|
|
804
|
+
return e(K, {});
|
|
805
805
|
}
|
|
806
|
-
var Nt = /* @__PURE__ */
|
|
806
|
+
var Nt = /* @__PURE__ */ S({
|
|
807
807
|
name: "VvDropdownItem",
|
|
808
808
|
props: xt,
|
|
809
809
|
setup(e) {
|
|
810
|
-
let t = e, { role: n, expanded: r } = Mt(), i =
|
|
810
|
+
let t = e, { role: n, expanded: r } = Mt(), i = _(null);
|
|
811
811
|
Dt({ expanded: r });
|
|
812
|
-
let a =
|
|
812
|
+
let a = xe(i), { focused: o } = Se(i), { focused: s } = Ce(i);
|
|
813
813
|
return p(a, (e) => {
|
|
814
814
|
e && t.focusOnHover && (o.value = !0);
|
|
815
|
-
}), (e, t) => (
|
|
815
|
+
}), (e, t) => (E(), T("div", f({ role: C(n) }, {
|
|
816
816
|
ref_key: "element",
|
|
817
817
|
ref: i,
|
|
818
|
-
class: ["vv-dropdown__item", { "focus-visible":
|
|
818
|
+
class: ["vv-dropdown__item", { "focus-visible": C(o) || C(s) }]
|
|
819
819
|
}), [c(e.$slots, "default")], 16));
|
|
820
820
|
}
|
|
821
|
-
}), Pt = ["title"], Ft = /* @__PURE__ */
|
|
821
|
+
}), Pt = ["title"], Ft = /* @__PURE__ */ S({
|
|
822
822
|
name: "VvDropdownOption",
|
|
823
823
|
props: St,
|
|
824
824
|
setup(e) {
|
|
825
|
-
let t = e, { modifiers: n } =
|
|
825
|
+
let t = e, { modifiers: n } = ve(t), o = Ot("vv-dropdown-option", n, v(() => ({
|
|
826
826
|
disabled: t.disabled,
|
|
827
827
|
selected: t.selected,
|
|
828
828
|
unselectable: t.unselectable && t.selected
|
|
829
|
-
}))), s =
|
|
830
|
-
return (e, t) => (
|
|
831
|
-
class: a(
|
|
829
|
+
}))), s = v(() => t.selected ? t.unselectable ? t.deselectHintLabel : t.selectedHintLabel : t.disabled ? "" : t.selectHintLabel);
|
|
830
|
+
return (e, t) => (E(), h(Nt, {
|
|
831
|
+
class: a(C(o)),
|
|
832
832
|
tabindex: e.disabled ? -1 : 0,
|
|
833
833
|
"aria-selected": e.selected,
|
|
834
834
|
"aria-disabled": e.disabled,
|
|
835
835
|
"focus-on-hover": e.focusOnHover
|
|
836
836
|
}, {
|
|
837
|
-
default:
|
|
837
|
+
default: b(() => [c(e.$slots, "default"), ce("span", {
|
|
838
838
|
class: "vv-dropdown-option__hint",
|
|
839
|
-
title:
|
|
839
|
+
title: C(s)
|
|
840
840
|
}, [c(e.$slots, "hint", r(i({
|
|
841
841
|
disabled: e.disabled,
|
|
842
842
|
selected: e.selected,
|
|
843
843
|
unselectable: e.unselectable
|
|
844
|
-
})), () => [
|
|
844
|
+
})), () => [w(y(C(s)), 1)])], 8, Pt)]),
|
|
845
845
|
_: 3
|
|
846
846
|
}, 8, [
|
|
847
847
|
"class",
|
|
@@ -853,9 +853,9 @@ var Nt = /* @__PURE__ */ C({
|
|
|
853
853
|
}
|
|
854
854
|
});
|
|
855
855
|
function It() {
|
|
856
|
-
return e(
|
|
856
|
+
return e(Ge, void 0);
|
|
857
857
|
}
|
|
858
|
-
var Q = /* @__PURE__ */
|
|
858
|
+
var Q = /* @__PURE__ */ S({
|
|
859
859
|
name: "VvIcon",
|
|
860
860
|
props: /* @__PURE__ */ d({
|
|
861
861
|
name: {},
|
|
@@ -876,12 +876,12 @@ var Q = /* @__PURE__ */ C({
|
|
|
876
876
|
modifiers: {}
|
|
877
877
|
}, Je),
|
|
878
878
|
setup(e) {
|
|
879
|
-
let t = e, n =
|
|
879
|
+
let t = e, n = v(() => typeof t.rotate == "string" ? Number.parseFloat(t.rotate) : t.rotate), r = _(!0), i = It(), { modifiers: a } = ve(t), o = Ot("vv-icon", a), s = v(() => t.provider || i?.iconsProvider), c = v(() => {
|
|
880
880
|
let e = t.name ?? "", n = `@${s.value}:${t.prefix}:${e}`;
|
|
881
|
-
if (
|
|
881
|
+
if (D(n)) return n;
|
|
882
882
|
let r = i?.iconsCollections.find((t) => {
|
|
883
883
|
let n = `@${s.value}:${t.prefix}:${e}`;
|
|
884
|
-
return
|
|
884
|
+
return D(n);
|
|
885
885
|
});
|
|
886
886
|
return r ? `@${s.value}:${r.prefix}:${e}` : e;
|
|
887
887
|
});
|
|
@@ -890,19 +890,19 @@ var Q = /* @__PURE__ */ C({
|
|
|
890
890
|
}
|
|
891
891
|
function u(e) {
|
|
892
892
|
let n = l(e), r = n?.innerHTML.trim() || "";
|
|
893
|
-
n && r &&
|
|
893
|
+
n && r && ye(`@${s.value}:${t.prefix}:${t.name}`, {
|
|
894
894
|
body: r,
|
|
895
895
|
height: n.viewBox.baseVal.height,
|
|
896
896
|
width: n.viewBox.baseVal.width
|
|
897
897
|
});
|
|
898
898
|
}
|
|
899
|
-
return i && t.src && !
|
|
899
|
+
return i && t.src && !D(`@${s.value}:${t.prefix}:${t.name}`) && (r.value = !1, i.fetchIcon(t.src).then((e) => {
|
|
900
900
|
e && u(e), r.value = !0;
|
|
901
901
|
}).catch((e) => {
|
|
902
902
|
throw r.value = !0, /* @__PURE__ */ Error(`Error during fetch icon: ${e?.message}`);
|
|
903
|
-
})), t.svg && u(t.svg), (t, i) =>
|
|
903
|
+
})), t.svg && u(t.svg), (t, i) => C(r) ? (E(), h(C(O), f({
|
|
904
904
|
key: 0,
|
|
905
|
-
class:
|
|
905
|
+
class: C(o)
|
|
906
906
|
}, {
|
|
907
907
|
inline: e.inline,
|
|
908
908
|
width: e.width,
|
|
@@ -910,10 +910,10 @@ var Q = /* @__PURE__ */ C({
|
|
|
910
910
|
horizontalFlip: e.horizontalFlip,
|
|
911
911
|
verticalFlip: e.verticalFlip,
|
|
912
912
|
flip: e.flip,
|
|
913
|
-
rotate:
|
|
913
|
+
rotate: C(n),
|
|
914
914
|
color: e.color,
|
|
915
|
-
icon:
|
|
916
|
-
}, { onLoad: e.onLoad }), null, 16, ["class", "onLoad"])) :
|
|
915
|
+
icon: C(c)
|
|
916
|
+
}, { onLoad: e.onLoad }), null, 16, ["class", "onLoad"])) : x("v-if", !0);
|
|
917
917
|
}
|
|
918
918
|
}), $ = {
|
|
919
919
|
TEXT: "text",
|
|
@@ -1053,18 +1053,18 @@ var Q = /* @__PURE__ */ C({
|
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
1055
|
function zt(e, t) {
|
|
1056
|
-
let n =
|
|
1056
|
+
let n = v(() => typeof e?.value == "string" ? { name: e?.value } : e?.value), r = v(() => t?.value === U.before ? n.value : void 0), i = v(() => t?.value === U.after ? n.value : void 0);
|
|
1057
1057
|
return {
|
|
1058
1058
|
hasIcon: n,
|
|
1059
|
-
hasIconLeft:
|
|
1060
|
-
hasIconRight:
|
|
1061
|
-
hasIconTop:
|
|
1062
|
-
hasIconBottom:
|
|
1059
|
+
hasIconLeft: v(() => t?.value === H.left ? n.value : void 0),
|
|
1060
|
+
hasIconRight: v(() => t?.value === H.right ? n.value : void 0),
|
|
1061
|
+
hasIconTop: v(() => t?.value === H.top ? n.value : void 0),
|
|
1062
|
+
hasIconBottom: v(() => t?.value === H.bottom ? n.value : void 0),
|
|
1063
1063
|
hasIconBefore: r,
|
|
1064
1064
|
hasIconAfter: i
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
|
-
var Bt =
|
|
1067
|
+
var Bt = S({
|
|
1068
1068
|
components: { VvIcon: Q },
|
|
1069
1069
|
props: {
|
|
1070
1070
|
inputType: {
|
|
@@ -1086,7 +1086,7 @@ var Bt = C({
|
|
|
1086
1086
|
},
|
|
1087
1087
|
emits: ["clear"],
|
|
1088
1088
|
setup(e, { emit: t }) {
|
|
1089
|
-
let { hasIcon: n } = zt(
|
|
1089
|
+
let { hasIcon: n } = zt(v(() => e.icon));
|
|
1090
1090
|
function r(n) {
|
|
1091
1091
|
n?.stopPropagation(), e.disabled || t("clear");
|
|
1092
1092
|
}
|
|
@@ -1108,7 +1108,7 @@ var Bt = C({
|
|
|
1108
1108
|
onClick: this.onClick
|
|
1109
1109
|
}, e);
|
|
1110
1110
|
}
|
|
1111
|
-
}), Vt =
|
|
1111
|
+
}), Vt = S({
|
|
1112
1112
|
components: { VvIcon: Q },
|
|
1113
1113
|
props: {
|
|
1114
1114
|
inputType: {
|
|
@@ -1138,7 +1138,7 @@ var Bt = C({
|
|
|
1138
1138
|
},
|
|
1139
1139
|
emits: ["toggle-password"],
|
|
1140
1140
|
setup(e, { emit: t }) {
|
|
1141
|
-
let n =
|
|
1141
|
+
let n = _(!1), r = v(() => n.value ? e.iconHide : e.iconShow), { hasIcon: i } = zt(r);
|
|
1142
1142
|
function a(r) {
|
|
1143
1143
|
r?.stopPropagation(), e.disabled || (n.value = !n.value, t("toggle-password", n.value));
|
|
1144
1144
|
}
|
|
@@ -1162,7 +1162,7 @@ var Bt = C({
|
|
|
1162
1162
|
onClick: this.onClick
|
|
1163
1163
|
}, e);
|
|
1164
1164
|
}
|
|
1165
|
-
}), Ht =
|
|
1165
|
+
}), Ht = S({
|
|
1166
1166
|
components: { VvIcon: Q },
|
|
1167
1167
|
props: {
|
|
1168
1168
|
inputType: {
|
|
@@ -1182,7 +1182,7 @@ var Bt = C({
|
|
|
1182
1182
|
},
|
|
1183
1183
|
emits: ["step-up", "step-down"],
|
|
1184
1184
|
setup(e, { emit: t }) {
|
|
1185
|
-
let n =
|
|
1185
|
+
let n = v(() => e.mode === "up");
|
|
1186
1186
|
return {
|
|
1187
1187
|
isUp: n,
|
|
1188
1188
|
onClick: (r) => {
|
|
@@ -1216,7 +1216,7 @@ function Ut(e, t, r) {
|
|
|
1216
1216
|
setup() {
|
|
1217
1217
|
return {
|
|
1218
1218
|
isDirty: r,
|
|
1219
|
-
isDisabled:
|
|
1219
|
+
isDisabled: v(() => t.disabled || t.readonly),
|
|
1220
1220
|
labelStepUp: t.labelStepUp,
|
|
1221
1221
|
labelStepDown: t.labelStepDown,
|
|
1222
1222
|
labelShowPassword: t.labelShowPassword,
|
|
@@ -1285,10 +1285,10 @@ function Wt(e, t, n) {
|
|
|
1285
1285
|
return r;
|
|
1286
1286
|
}
|
|
1287
1287
|
function Gt(e, t, n) {
|
|
1288
|
-
let r = It(), i =
|
|
1288
|
+
let r = It(), i = v(() => {
|
|
1289
1289
|
if (r?.defaults.value?.[e]) return r.defaults.value[e];
|
|
1290
1290
|
});
|
|
1291
|
-
return
|
|
1291
|
+
return v(() => {
|
|
1292
1292
|
if (i.value === void 0) return n;
|
|
1293
1293
|
let e = i.value, r = t, a = n;
|
|
1294
1294
|
return Object.keys(r).reduce((t, n) => {
|
|
@@ -1298,7 +1298,7 @@ function Gt(e, t, n) {
|
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
function Kt(e, t, n = 0, { getter: r = (e) => e, setter: i = (e) => e } = {}) {
|
|
1301
|
-
let a, o, s =
|
|
1301
|
+
let a, o, s = v(() => {
|
|
1302
1302
|
let e = m(n) ?? 0, t = typeof e == "string" ? Number.parseInt(e) : e;
|
|
1303
1303
|
return Number.isNaN(t) ? 0 : t;
|
|
1304
1304
|
});
|
|
@@ -1310,8 +1310,8 @@ function Kt(e, t, n = 0, { getter: r = (e) => e, setter: i = (e) => e } = {}) {
|
|
|
1310
1310
|
let e = i(o.value);
|
|
1311
1311
|
return c(), t("update:modelValue", e), e;
|
|
1312
1312
|
}
|
|
1313
|
-
return
|
|
1314
|
-
model:
|
|
1313
|
+
return pe(c), {
|
|
1314
|
+
model: v({
|
|
1315
1315
|
get: () => r(e?.value),
|
|
1316
1316
|
set: (e) => {
|
|
1317
1317
|
s.value <= 0 ? (c(), t("update:modelValue", i(e))) : (o = { value: e }, a && clearTimeout(a), a = setTimeout(l, s.value));
|
|
@@ -1322,34 +1322,34 @@ function Kt(e, t, n = 0, { getter: r = (e) => e, setter: i = (e) => e } = {}) {
|
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
1324
|
function qt(e, t) {
|
|
1325
|
-
let { focused: n } =
|
|
1325
|
+
let { focused: n } = Se(e);
|
|
1326
1326
|
return p(n, (n) => {
|
|
1327
|
-
t(n ? "focus" : "blur",
|
|
1327
|
+
t(n ? "focus" : "blur", C(e));
|
|
1328
1328
|
}), { focused: n };
|
|
1329
1329
|
}
|
|
1330
1330
|
function Jt(e, t) {
|
|
1331
|
-
let n =
|
|
1331
|
+
let n = v(() => (C(e) ?? "").length), r = v(() => t?.lowerLimit !== void 0 && n.value < t?.lowerLimit ? n.value - t.lowerLimit : t?.upperLimit === void 0 ? 0 : t.upperLimit - n.value);
|
|
1332
1332
|
return {
|
|
1333
1333
|
length: n,
|
|
1334
1334
|
gap: r,
|
|
1335
|
-
formatted:
|
|
1335
|
+
formatted: v(() => t?.mode === !1 ? "" : t?.mode === "limit" && t?.upperLimit ? `${n.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : t?.mode === "countdown" ? r.value === 0 ? void 0 : r.value : n.value)
|
|
1336
1336
|
};
|
|
1337
1337
|
}
|
|
1338
|
-
function Yt(e, t =
|
|
1339
|
-
let r =
|
|
1338
|
+
function Yt(e, t = V.local, n) {
|
|
1339
|
+
let r = _();
|
|
1340
1340
|
n && (r.value = n);
|
|
1341
1341
|
let i;
|
|
1342
1342
|
return u(() => {
|
|
1343
1343
|
e && p(e, (e, n) => {
|
|
1344
|
-
let a =
|
|
1345
|
-
n && n !== e && a.removeItem(n), e ? (i =
|
|
1346
|
-
}, { immediate: !0 }),
|
|
1344
|
+
let a = C(t) === V.session ? sessionStorage : localStorage;
|
|
1345
|
+
n && n !== e && a.removeItem(n), e ? (i = be(e, i?.value ?? r.value, a), i.value && (r.value = i.value)) : i = void 0;
|
|
1346
|
+
}, { immediate: !0 }), _e(t) && p(t, (t, n) => {
|
|
1347
1347
|
if (e?.value) {
|
|
1348
1348
|
if (t) {
|
|
1349
|
-
let n = t ===
|
|
1350
|
-
i =
|
|
1349
|
+
let n = t === V.session ? sessionStorage : localStorage;
|
|
1350
|
+
i = be(e.value, i?.value ?? r.value, n);
|
|
1351
1351
|
}
|
|
1352
|
-
n && n !== t && (n ===
|
|
1352
|
+
n && n !== t && (n === V.session ? sessionStorage : localStorage).removeItem(e.value);
|
|
1353
1353
|
}
|
|
1354
1354
|
});
|
|
1355
1355
|
}), p(r, (e) => {
|
|
@@ -1371,16 +1371,16 @@ var Xt = ["for"], Zt = {
|
|
|
1371
1371
|
}, tn = {
|
|
1372
1372
|
key: 6,
|
|
1373
1373
|
class: "vv-input-text__limit"
|
|
1374
|
-
}, nn = { class: "flex-1" }, rn = ["title", "onClick"], an = /* @__PURE__ */
|
|
1374
|
+
}, nn = { class: "flex-1" }, rn = ["title", "onClick"], an = /* @__PURE__ */ S({
|
|
1375
1375
|
name: "VvInputText",
|
|
1376
1376
|
props: Rt,
|
|
1377
1377
|
emits: Lt,
|
|
1378
1378
|
setup(e, { expose: t, emit: n }) {
|
|
1379
|
-
let o = e, s = n, l = ie(), d = It(), ee = Gt("VvInputText", Rt, o), { count: m, debounce: ne, icon: oe, iconPosition:
|
|
1380
|
-
let e = Number(
|
|
1379
|
+
let o = e, s = n, l = ie(), d = It(), ee = Gt("VvInputText", Rt, o), { count: m, debounce: ne, icon: oe, iconPosition: le, iconRemoveSuggestion: ue, id: de, invalid: fe, label: pe, labelRemoveSuggestion: me, loading: he, maxlength: ge, minlength: _e, modelValue: S, step: D, storageType: ye, type: O, unit: be, valid: xe } = ve(o), Se = Ct(de), Ce = v(() => `${Se.value}-hint`), we = v(() => o.floating && z(o.placeholder) ? " " : o.placeholder), { model: k, flush: A } = Kt(S, s, ne), Ee = v(() => {
|
|
1380
|
+
let e = Number(D.value);
|
|
1381
1381
|
return !Number.isNaN(e) && e % 60 != 0;
|
|
1382
|
-
}),
|
|
1383
|
-
if (!o.iMask) return { mask:
|
|
1382
|
+
}), De = /^-0?[.,]?[0*]?$/, Oe = /./, ke = /^-$|^$/, Ae = _(!1), j = _(), M = _(), { el: je, mask: Me, typed: N, masked: P, unmasked: F } = Ne(v(() => {
|
|
1383
|
+
if (!o.iMask) return { mask: Oe };
|
|
1384
1384
|
if (o.iMask.mask === Number) {
|
|
1385
1385
|
let e = { ...o.iMask };
|
|
1386
1386
|
return o.min && (e.min = Number(o.min)), o.max && (e.max = Number(o.max)), e;
|
|
@@ -1389,127 +1389,127 @@ var Xt = ["for"], Zt = {
|
|
|
1389
1389
|
}), {
|
|
1390
1390
|
emit: s,
|
|
1391
1391
|
onAccept: () => {
|
|
1392
|
-
if (
|
|
1393
|
-
if (s("update:masked",
|
|
1394
|
-
|
|
1392
|
+
if (Ae.value) {
|
|
1393
|
+
if (s("update:masked", P.value), O.value === $.NUMBER) {
|
|
1394
|
+
Ie();
|
|
1395
1395
|
return;
|
|
1396
1396
|
}
|
|
1397
|
-
if (
|
|
1398
|
-
|
|
1397
|
+
if (O.value === $.DATETIME_LOCAL || O.value === $.DATE || O.value === $.TIME || O.value === $.MONTH) {
|
|
1398
|
+
I();
|
|
1399
1399
|
return;
|
|
1400
1400
|
}
|
|
1401
|
-
!
|
|
1401
|
+
!k.value && !F.value || (k.value = F.value);
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
1404
|
});
|
|
1405
|
-
function
|
|
1406
|
-
if (
|
|
1407
|
-
if (
|
|
1408
|
-
|
|
1409
|
-
} else
|
|
1405
|
+
function Ie() {
|
|
1406
|
+
if (ke.test(F.value)) {
|
|
1407
|
+
if (k.value === null || k.value === void 0) return;
|
|
1408
|
+
k.value = void 0;
|
|
1409
|
+
} else De.test(F.value) ? k.value = 0 : typeof N.value == "number" ? k.value = N.value : k.value = Number(N.value);
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1412
|
-
let t = new Date(
|
|
1413
|
-
if ((
|
|
1414
|
-
if (
|
|
1415
|
-
|
|
1416
|
-
} else
|
|
1411
|
+
function Le(e) {
|
|
1412
|
+
let t = new Date(j.value || M.value);
|
|
1413
|
+
if ((O.value === $.DATETIME_LOCAL || O.value === $.DATE || O.value === $.MONTH) && (t.setFullYear(e.getFullYear()), t.setMonth(e.getMonth())), (O.value === $.DATETIME_LOCAL || O.value === $.DATE) && t.setDate(e.getDate()), (O.value === $.DATETIME_LOCAL || O.value === $.TIME) && (t.setHours(e.getHours()), t.setMinutes(e.getMinutes()), t.setSeconds(e.getSeconds())), j.value instanceof Date) {
|
|
1414
|
+
if (k.value?.getTime() === t.getTime()) return;
|
|
1415
|
+
k.value = t;
|
|
1416
|
+
} else k.value = t.toISOString();
|
|
1417
1417
|
}
|
|
1418
|
-
function
|
|
1419
|
-
let e =
|
|
1420
|
-
if (!
|
|
1421
|
-
if (!
|
|
1422
|
-
if (
|
|
1423
|
-
|
|
1418
|
+
function I() {
|
|
1419
|
+
let e = O.value;
|
|
1420
|
+
if (!N.value) {
|
|
1421
|
+
if (!k.value) return;
|
|
1422
|
+
if (j.value) {
|
|
1423
|
+
k.value = void 0;
|
|
1424
1424
|
return;
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1426
|
+
k.value = "";
|
|
1427
1427
|
return;
|
|
1428
1428
|
}
|
|
1429
|
-
if (!(
|
|
1430
|
-
|
|
1429
|
+
if (!(N.value instanceof Date) && !j.value && !M.value) {
|
|
1430
|
+
k.value = N.value;
|
|
1431
1431
|
return;
|
|
1432
1432
|
}
|
|
1433
|
-
let t =
|
|
1434
|
-
t instanceof Date || (t =
|
|
1433
|
+
let t = N.value;
|
|
1434
|
+
t instanceof Date || (t = R(N.value, e)), j.value || M.value ? Le(t) : k.value = Fe(t, e, Ee.value);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
if (e == null)
|
|
1438
|
-
else if (o.iMask?.mask === Date)
|
|
1439
|
-
else if (!(
|
|
1436
|
+
function L(e) {
|
|
1437
|
+
if (e == null) N.value = "", F.value = "";
|
|
1438
|
+
else if (o.iMask?.mask === Date) N.value = e instanceof Date ? e : new Date(e);
|
|
1439
|
+
else if (!(O.value === $.NUMBER && De.test(F.value) && e === 0)) {
|
|
1440
1440
|
if (dt.value) {
|
|
1441
|
-
if (e instanceof Date ||
|
|
1442
|
-
if (e instanceof Date ? (
|
|
1441
|
+
if (e instanceof Date || Pe(e)) {
|
|
1442
|
+
if (e instanceof Date ? (j.value = e, M.value = void 0) : (M.value = e, j.value = void 0), ft.value) {
|
|
1443
1443
|
let t = new Date(e);
|
|
1444
|
-
|
|
1444
|
+
N.value = Fe(t, ft.value, Ee.value), F.value = N.value;
|
|
1445
1445
|
}
|
|
1446
1446
|
return;
|
|
1447
1447
|
}
|
|
1448
|
-
|
|
1448
|
+
j.value = void 0, M.value = void 0;
|
|
1449
1449
|
}
|
|
1450
|
-
|
|
1450
|
+
N.value = e, F.value = `${N.value}`;
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
u(() => {
|
|
1454
|
-
|
|
1454
|
+
Me.value && (Ae.value = !0, L(o.modelValue));
|
|
1455
1455
|
}), p(() => o.modelValue, (e) => {
|
|
1456
|
-
|
|
1456
|
+
Me.value && L(e);
|
|
1457
1457
|
}), p(() => o.masked, (e) => {
|
|
1458
|
-
|
|
1458
|
+
P.value = e ?? "";
|
|
1459
1459
|
});
|
|
1460
|
-
let
|
|
1460
|
+
let B = je, Re = _(), V = _(), Be = _();
|
|
1461
1461
|
t({
|
|
1462
|
-
$input:
|
|
1463
|
-
$inner:
|
|
1464
|
-
$wrapper:
|
|
1465
|
-
flush:
|
|
1462
|
+
$input: B,
|
|
1463
|
+
$inner: Re,
|
|
1464
|
+
$wrapper: V,
|
|
1465
|
+
flush: A
|
|
1466
1466
|
});
|
|
1467
|
-
let { focused:
|
|
1468
|
-
function
|
|
1469
|
-
e ?
|
|
1470
|
-
}
|
|
1471
|
-
function Ve() {
|
|
1472
|
-
ee.value.selectOnFocus && V.value && V.value.select(), Z.value.size && ze.value?.show();
|
|
1467
|
+
let { focused: H } = qt(B, s), Ve = v(() => H.value && !o.disabled && !o.readonly);
|
|
1468
|
+
function U(e) {
|
|
1469
|
+
e ? He() : Ue();
|
|
1473
1470
|
}
|
|
1474
1471
|
function He() {
|
|
1475
|
-
|
|
1476
|
-
|
|
1472
|
+
ee.value.selectOnFocus && B.value && B.value.select(), Z.value.size && Be.value?.show();
|
|
1473
|
+
}
|
|
1474
|
+
function Ue() {
|
|
1475
|
+
let e = A() ?? k.value;
|
|
1476
|
+
if (!X.value || z(e)) return;
|
|
1477
1477
|
let t = o.maxSuggestions;
|
|
1478
1478
|
X.value.size >= t && !X.value.has(e) && (X.value = new Set([...X.value].slice(X.value.size - t + 1))), X.value.add(e);
|
|
1479
1479
|
}
|
|
1480
|
-
p(
|
|
1481
|
-
let
|
|
1482
|
-
p(
|
|
1483
|
-
e && o.autofocus && !o.disabled && !o.readonly && (
|
|
1480
|
+
p(Ve, U);
|
|
1481
|
+
let W = Te(B);
|
|
1482
|
+
p(W, (e) => {
|
|
1483
|
+
e && o.autofocus && !o.disabled && !o.readonly && (H.value = !0);
|
|
1484
1484
|
});
|
|
1485
|
-
let
|
|
1486
|
-
function
|
|
1487
|
-
|
|
1485
|
+
let G = _(!1), We = v(() => o.type === $.PASSWORD);
|
|
1486
|
+
function Ge() {
|
|
1487
|
+
G.value = !G.value;
|
|
1488
1488
|
}
|
|
1489
|
-
let
|
|
1489
|
+
let Ke = v(() => dt.value), K = v(() => o.type === $.NUMBER);
|
|
1490
1490
|
function qe() {
|
|
1491
1491
|
if (!Y.value) {
|
|
1492
1492
|
if (o.iMask) {
|
|
1493
|
-
|
|
1493
|
+
N.value = Number(N.value) + Number(D?.value ?? 1);
|
|
1494
1494
|
return;
|
|
1495
1495
|
}
|
|
1496
|
-
|
|
1496
|
+
B.value.stepUp(), k.value = Number(B.value.value);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
function Je() {
|
|
1500
1500
|
if (!Y.value) {
|
|
1501
1501
|
if (o.iMask) {
|
|
1502
|
-
|
|
1502
|
+
N.value = Number(N.value) - Number(D?.value ?? 1);
|
|
1503
1503
|
return;
|
|
1504
1504
|
}
|
|
1505
|
-
|
|
1505
|
+
B.value.stepDown(), k.value = Number(B.value.value);
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
|
-
let Ye =
|
|
1508
|
+
let Ye = v(() => o.type === $.SEARCH);
|
|
1509
1509
|
function Xe() {
|
|
1510
|
-
|
|
1510
|
+
k.value = "", s("clear");
|
|
1511
1511
|
}
|
|
1512
|
-
let { hasIconBefore: Ze, hasIconAfter: Qe } = zt(oe,
|
|
1512
|
+
let { hasIconBefore: Ze, hasIconAfter: Qe } = zt(oe, le), J = v(() => {
|
|
1513
1513
|
if (Qe.value !== void 0) return Qe.value;
|
|
1514
1514
|
switch (o.type) {
|
|
1515
1515
|
case $.COLOR: return { name: q.showColorPicker };
|
|
@@ -1519,69 +1519,69 @@ var Xt = ["for"], Zt = {
|
|
|
1519
1519
|
case $.MONTH: return { name: q.showDatePicker };
|
|
1520
1520
|
case $.TIME: return { name: q.showTimePicker };
|
|
1521
1521
|
}
|
|
1522
|
-
}), { hasIcon: $e } = zt(
|
|
1522
|
+
}), { hasIcon: $e } = zt(ue), { formatted: et } = Jt(k, {
|
|
1523
1523
|
mode: m.value,
|
|
1524
|
-
upperLimit: Number(
|
|
1525
|
-
lowerLimit: Number(
|
|
1526
|
-
}), Y =
|
|
1527
|
-
if (
|
|
1528
|
-
if (
|
|
1529
|
-
}), X = Yt(
|
|
1524
|
+
upperLimit: Number(ge?.value),
|
|
1525
|
+
lowerLimit: Number(_e?.value)
|
|
1526
|
+
}), Y = v(() => o.disabled || o.readonly), tt = v(() => Y.value ? -1 : o.tabindex), nt = v(() => !z(S?.value)), rt = v(() => {
|
|
1527
|
+
if (fe.value === !0) return !0;
|
|
1528
|
+
if (xe.value === !0) return !1;
|
|
1529
|
+
}), X = Yt(v(() => o.storageKey ?? (d?.experimentalFeatures.forceInputSuggestions ? o.name : void 0)), ye, /* @__PURE__ */ new Set()), Z = v(() => {
|
|
1530
1530
|
let e = /* @__PURE__ */ new Map();
|
|
1531
1531
|
if (X.value) for (let t of X.value) e.set(t, { isFromStorage: !0 });
|
|
1532
1532
|
if (o.suggestions) for (let t of o.suggestions) e.set(t, { isFromStorage: !1 });
|
|
1533
1533
|
return e;
|
|
1534
|
-
}), it =
|
|
1534
|
+
}), it = v(() => Z.value.size === 0 ? [] : [...Z.value.entries()].filter(([e]) => z(k.value) || `${e}`.toLowerCase().includes(`${k.value}`.toLowerCase()) && e !== k.value).reverse().map(([e]) => e)), at = v(() => Z.value.size > 0);
|
|
1535
1535
|
function ot(e) {
|
|
1536
|
-
|
|
1536
|
+
k.value = e, Be.value?.hide(), s("suggestion:selected", e);
|
|
1537
1537
|
}
|
|
1538
1538
|
function st(e) {
|
|
1539
1539
|
Z.value.get(e)?.isFromStorage && (X.value?.delete(e), s("suggestion:removed", e));
|
|
1540
1540
|
}
|
|
1541
|
-
let { modifiers: ct } =
|
|
1542
|
-
valid:
|
|
1543
|
-
invalid:
|
|
1544
|
-
loading:
|
|
1541
|
+
let { modifiers: ct } = ve(o), lt = Ot("vv-input-text", ct, v(() => ({
|
|
1542
|
+
valid: xe.value,
|
|
1543
|
+
invalid: fe.value,
|
|
1544
|
+
loading: he.value,
|
|
1545
1545
|
disabled: o.disabled,
|
|
1546
1546
|
required: o.required,
|
|
1547
1547
|
readonly: o.readonly,
|
|
1548
1548
|
"icon-before": !!Ze.value,
|
|
1549
1549
|
"icon-after": !!J.value,
|
|
1550
|
-
floating: o.floating && !
|
|
1550
|
+
floating: o.floating && !z(o.label),
|
|
1551
1551
|
dirty: nt.value,
|
|
1552
|
-
focus:
|
|
1552
|
+
focus: Ve.value && !Y.value,
|
|
1553
1553
|
"auto-width": o.autoWidth
|
|
1554
|
-
}))), ut =
|
|
1554
|
+
}))), ut = v(() => [
|
|
1555
1555
|
$.TEXT,
|
|
1556
1556
|
$.SEARCH,
|
|
1557
1557
|
$.URL,
|
|
1558
1558
|
$.TEL,
|
|
1559
1559
|
$.EMAIL,
|
|
1560
1560
|
$.PASSWORD
|
|
1561
|
-
].includes(
|
|
1561
|
+
].includes(O.value)), dt = v(() => [
|
|
1562
1562
|
$.DATE,
|
|
1563
1563
|
$.MONTH,
|
|
1564
1564
|
$.WEEK,
|
|
1565
1565
|
$.TIME,
|
|
1566
1566
|
$.DATETIME_LOCAL
|
|
1567
|
-
].includes(
|
|
1567
|
+
].includes(O.value)), ft = v(() => dt.value && O.value !== $.WEEK ? O.value : void 0), pt = v(() => [
|
|
1568
1568
|
$.TEXT,
|
|
1569
1569
|
$.SEARCH,
|
|
1570
1570
|
$.URL,
|
|
1571
1571
|
$.TEL,
|
|
1572
1572
|
$.EMAIL,
|
|
1573
1573
|
$.PASSWORD
|
|
1574
|
-
].includes(
|
|
1574
|
+
].includes(O.value)), mt = {
|
|
1575
1575
|
[$.DATE]: "9999-12-31",
|
|
1576
1576
|
[$.DATETIME_LOCAL]: "9999-12-31T23:59:59.999",
|
|
1577
1577
|
[$.MONTH]: "9999-12",
|
|
1578
1578
|
[$.WEEK]: "9999-W52"
|
|
1579
1579
|
};
|
|
1580
1580
|
function ht(e) {
|
|
1581
|
-
if (!
|
|
1581
|
+
if (!z(e)) return (e instanceof Date || typeof e == "string" && Pe(e)) && ft.value ? Fe(e, ft.value, Ee.value) || void 0 : String(e);
|
|
1582
1582
|
}
|
|
1583
|
-
let gt =
|
|
1584
|
-
let e =
|
|
1583
|
+
let gt = v(() => {
|
|
1584
|
+
let e = We.value && G.value || Ke.value && !nt.value && !H.value || o.iMask ? $.TEXT : o.type, t = {
|
|
1585
1585
|
type: e,
|
|
1586
1586
|
name: o.name,
|
|
1587
1587
|
tabindex: tt.value,
|
|
@@ -1597,132 +1597,132 @@ var Xt = ["for"], Zt = {
|
|
|
1597
1597
|
inputMode: o.inputMode
|
|
1598
1598
|
};
|
|
1599
1599
|
return (dt.value || e === $.NUMBER) && (t.step = o.step, t.max = ht(o.max) ?? mt[e], t.min = ht(o.min)), (ut.value || e === $.TEXT || e === $.NUMBER) && (t.placeholder = we.value), pt.value && (t.minlength = o.minlength, t.maxlength = o.maxlength, t.pattern = o.pattern), e === $.EMAIL && (t.multiple = o.multiple), t;
|
|
1600
|
-
}), _t =
|
|
1600
|
+
}), _t = v(() => ({
|
|
1601
1601
|
valid: o.valid,
|
|
1602
1602
|
invalid: o.invalid,
|
|
1603
1603
|
modelValue: o.modelValue,
|
|
1604
|
-
togglePassword:
|
|
1604
|
+
togglePassword: Ge,
|
|
1605
1605
|
stepUp: qe,
|
|
1606
1606
|
stepDown: Je,
|
|
1607
1607
|
clear: Xe
|
|
1608
|
-
})), { HintSlot: vt, hasHintLabelOrSlot: yt, hasInvalidLabelOrSlot: bt, hintSlotScope: xt } =
|
|
1608
|
+
})), { HintSlot: vt, hasHintLabelOrSlot: yt, hasInvalidLabelOrSlot: bt, hintSlotScope: xt } = ze(ee, l), St = Ut($.PASSWORD, o, nt), wt = Ut($.NUMBER, o, nt), Tt = Ut($.SEARCH, o, nt);
|
|
1609
1609
|
function Et() {
|
|
1610
|
-
Y.value || (
|
|
1610
|
+
Y.value || (H.value = !0);
|
|
1611
1611
|
}
|
|
1612
|
-
let Dt =
|
|
1613
|
-
if (o.autoWidth) return { width:
|
|
1612
|
+
let Dt = v(() => {
|
|
1613
|
+
if (o.autoWidth) return { width: k.value === void 0 ? void 0 : `${String(k.value).length + 1}ch` };
|
|
1614
1614
|
});
|
|
1615
1615
|
function kt(e) {
|
|
1616
1616
|
switch (e.code) {
|
|
1617
1617
|
case "ArrowUp":
|
|
1618
|
-
|
|
1618
|
+
K.value && (qe(), e.preventDefault());
|
|
1619
1619
|
break;
|
|
1620
1620
|
case "ArrowDown":
|
|
1621
|
-
|
|
1621
|
+
K.value && (Je(), e.preventDefault());
|
|
1622
1622
|
break;
|
|
1623
1623
|
case "Enter":
|
|
1624
|
-
case "NumpadEnter":
|
|
1624
|
+
case "NumpadEnter": A();
|
|
1625
1625
|
}
|
|
1626
1626
|
s("keydown", e);
|
|
1627
1627
|
}
|
|
1628
|
-
return (e, t) => (
|
|
1629
|
-
|
|
1628
|
+
return (e, t) => (E(), T("div", { class: a(C(lt)) }, [
|
|
1629
|
+
C(pe) ? (E(), T("label", {
|
|
1630
1630
|
key: 0,
|
|
1631
|
-
for:
|
|
1631
|
+
for: C(Se),
|
|
1632
1632
|
class: "vv-input-text__label"
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1633
|
+
}, y(C(pe)), 9, Xt)) : x("v-if", !0),
|
|
1634
|
+
ce("div", {
|
|
1635
1635
|
ref_key: "wrapperEl",
|
|
1636
|
-
ref:
|
|
1636
|
+
ref: V,
|
|
1637
1637
|
class: "vv-input-text__wrapper"
|
|
1638
1638
|
}, [
|
|
1639
|
-
e.$slots.before ? (
|
|
1640
|
-
|
|
1639
|
+
e.$slots.before ? (E(), T("div", Zt, [c(e.$slots, "before", r(i(C(_t))))])) : x("v-if", !0),
|
|
1640
|
+
ce("div", {
|
|
1641
1641
|
ref_key: "innerEl",
|
|
1642
|
-
ref:
|
|
1642
|
+
ref: Re,
|
|
1643
1643
|
class: "vv-input-text__inner",
|
|
1644
1644
|
onClick: ae(Et, ["stop"])
|
|
1645
1645
|
}, [
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
id:
|
|
1646
|
+
C(Ze) ? (E(), h(Q, f({ key: 0 }, C(Ze), { class: "vv-input-text__icon" }), null, 16)) : x("v-if", !0),
|
|
1647
|
+
ce("input", f({
|
|
1648
|
+
id: C(Se),
|
|
1649
1649
|
ref_key: "inputEl",
|
|
1650
|
-
ref:
|
|
1651
|
-
},
|
|
1652
|
-
style:
|
|
1650
|
+
ref: B
|
|
1651
|
+
}, C(gt), {
|
|
1652
|
+
style: C(Dt),
|
|
1653
1653
|
onKeyup: t[0] ||= (e) => s("keyup", e),
|
|
1654
1654
|
onKeydown: kt,
|
|
1655
1655
|
onKeypress: t[1] ||= (e) => s("keypress", e)
|
|
1656
1656
|
}), null, 16, Qt),
|
|
1657
|
-
(
|
|
1657
|
+
(C(be) || e.$slots.unit) && C(nt) ? (E(), T("div", $t, [c(e.$slots, "unit", r(i(C(_t))), () => [w(y(C(be)), 1)])])) : x("v-if", !0)
|
|
1658
1658
|
], 512),
|
|
1659
|
-
|
|
1659
|
+
C(J) ? (E(), h(Q, f({ key: 1 }, C(J), { class: "vv-input-text__icon vv-input-text__icon-after" }), null, 16)) : C(We) && !e.hideActions && !C(Y) ? (E(), h(C(St), {
|
|
1660
1660
|
key: 2,
|
|
1661
|
-
onTogglePassword:
|
|
1662
|
-
})) :
|
|
1661
|
+
onTogglePassword: Ge
|
|
1662
|
+
})) : C(K) && !e.hideActions && !C(Y) ? (E(), h(C(wt), {
|
|
1663
1663
|
key: 3,
|
|
1664
1664
|
onStepUp: qe,
|
|
1665
1665
|
onStepDown: Je
|
|
1666
|
-
})) :
|
|
1666
|
+
})) : C(Ye) && !e.hideActions && !C(Y) ? (E(), h(C(Tt), {
|
|
1667
1667
|
key: 4,
|
|
1668
1668
|
onClear: Xe
|
|
1669
|
-
})) :
|
|
1670
|
-
e.$slots.after ? (
|
|
1671
|
-
|
|
1669
|
+
})) : x("v-if", !0),
|
|
1670
|
+
e.$slots.after ? (E(), T("div", en, [c(e.$slots, "after", r(i(C(_t))))])) : x("v-if", !0),
|
|
1671
|
+
C(m) ? (E(), T("span", tn, [c(e.$slots, "count", r(i(C(_t))), () => [w(y(C(et)), 1)])])) : x("v-if", !0)
|
|
1672
1672
|
], 512),
|
|
1673
|
-
te(
|
|
1674
|
-
id:
|
|
1673
|
+
te(C(vt), {
|
|
1674
|
+
id: C(Ce),
|
|
1675
1675
|
class: "vv-input-text__hint"
|
|
1676
1676
|
}, g({ _: 2 }, [
|
|
1677
1677
|
e.$slots.hint ? {
|
|
1678
1678
|
name: "hint",
|
|
1679
|
-
fn:
|
|
1679
|
+
fn: b(() => [c(e.$slots, "hint", r(i(C(xt))))]),
|
|
1680
1680
|
key: "0"
|
|
1681
1681
|
} : void 0,
|
|
1682
1682
|
e.$slots.loading ? {
|
|
1683
1683
|
name: "loading",
|
|
1684
|
-
fn:
|
|
1684
|
+
fn: b(() => [c(e.$slots, "loading", r(i(C(xt))))]),
|
|
1685
1685
|
key: "1"
|
|
1686
1686
|
} : void 0,
|
|
1687
1687
|
e.$slots.valid ? {
|
|
1688
1688
|
name: "valid",
|
|
1689
|
-
fn:
|
|
1689
|
+
fn: b(() => [c(e.$slots, "valid", r(i(C(xt))))]),
|
|
1690
1690
|
key: "2"
|
|
1691
1691
|
} : void 0,
|
|
1692
1692
|
e.$slots.invalid ? {
|
|
1693
1693
|
name: "invalid",
|
|
1694
|
-
fn:
|
|
1694
|
+
fn: b(() => [c(e.$slots, "invalid", r(i(C(xt))))]),
|
|
1695
1695
|
key: "3"
|
|
1696
1696
|
} : void 0
|
|
1697
1697
|
]), 1032, ["id"]),
|
|
1698
|
-
|
|
1698
|
+
C(at) ? (E(), h(jt, {
|
|
1699
1699
|
key: 1,
|
|
1700
1700
|
ref_key: "suggestionsDropdownEl",
|
|
1701
|
-
ref:
|
|
1702
|
-
reference:
|
|
1701
|
+
ref: Be,
|
|
1702
|
+
reference: C(V),
|
|
1703
1703
|
"autofocus-first": !1,
|
|
1704
1704
|
"trigger-width": !0,
|
|
1705
|
-
"top-layer":
|
|
1705
|
+
"top-layer": C(ee).topLayer
|
|
1706
1706
|
}, {
|
|
1707
|
-
items:
|
|
1707
|
+
items: b(() => [(E(!0), T(se, null, re(C(it), (t) => (E(), h(Ft, {
|
|
1708
1708
|
key: String(t),
|
|
1709
1709
|
onClick: ae((e) => ot(t), ["stop"])
|
|
1710
1710
|
}, {
|
|
1711
|
-
default:
|
|
1711
|
+
default: b(() => [ce("div", nn, [c(e.$slots, "suggestion", f({ ref_for: !0 }, { value: t }), () => [w(y(t), 1)])]), C(Z).get(t)?.isFromStorage && C($e) ? (E(), T("button", {
|
|
1712
1712
|
key: 0,
|
|
1713
1713
|
type: "button",
|
|
1714
1714
|
tabindex: "-1",
|
|
1715
1715
|
class: "cursor-pointer",
|
|
1716
|
-
title:
|
|
1716
|
+
title: C(me),
|
|
1717
1717
|
onClick: ae((e) => st(t), ["stop"])
|
|
1718
|
-
}, [te(Q, f({ ref_for: !0 },
|
|
1718
|
+
}, [te(Q, f({ ref_for: !0 }, C($e)), null, 16)], 8, rn)) : x("v-if", !0)]),
|
|
1719
1719
|
_: 2
|
|
1720
1720
|
}, 1032, ["onClick"]))), 128))]),
|
|
1721
1721
|
_: 3
|
|
1722
|
-
}, 8, ["reference", "top-layer"])) :
|
|
1722
|
+
}, 8, ["reference", "top-layer"])) : x("v-if", !0)
|
|
1723
1723
|
], 2));
|
|
1724
1724
|
}
|
|
1725
1725
|
});
|
|
1726
1726
|
export { an as default };
|
|
1727
1727
|
|
|
1728
|
-
//# sourceMappingURL=VvInputText.es-
|
|
1728
|
+
//# sourceMappingURL=VvInputText.es-CWgEXnVy.js.map
|