@signal24/vue-foundation 4.19.2 → 4.19.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.
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
interface IComputedOption {
|
|
2
|
-
value: string;
|
|
3
|
-
label: string;
|
|
4
|
-
}
|
|
5
1
|
type __VLS_Props = {
|
|
6
2
|
modelValue: string | null | undefined;
|
|
7
3
|
nullTitle?: string;
|
|
@@ -9,7 +5,7 @@ type __VLS_Props = {
|
|
|
9
5
|
options: {
|
|
10
6
|
[K: string]: string;
|
|
11
7
|
} | string[];
|
|
12
|
-
formatter?: (
|
|
8
|
+
formatter?: (title: string) => string;
|
|
13
9
|
};
|
|
14
10
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
11
|
"update:modelValue": (value: string | null) => any;
|
|
@@ -27,6 +27,7 @@ declare const _default: <T, V = T>(__VLS_props: NonNullable<Awaited<typeof __VLS
|
|
|
27
27
|
debug?: boolean;
|
|
28
28
|
required?: boolean;
|
|
29
29
|
showCreateTextOnNewItem?: boolean;
|
|
30
|
+
autoNext?: boolean;
|
|
30
31
|
}> & import("vue").PublicProps;
|
|
31
32
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
32
33
|
addRemoteOption: (option: T) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Tt = Object.defineProperty;
|
|
2
2
|
var St = (e, t, n) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var O = (e, t, n) => St(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { defineComponent as N, ref as T, computed as M, watch as A, onMounted as V, openBlock as E, createElementBlock as
|
|
4
|
+
import { defineComponent as N, ref as T, computed as M, watch as A, onMounted as V, openBlock as E, createElementBlock as b, createElementVNode as F, toDisplayString as U, withDirectives as Q, createCommentVNode as D, Fragment as J, renderList as he, vModelSelect as xt, getCurrentInstance as pe, withModifiers as ye, normalizeStyle as Ct, normalizeClass as $, renderSlot as G, reactive as Lt, h as ee, Teleport as Mt, markRaw as It, onBeforeUnmount as ge, resolveDirective as Ht, createBlock as qe, createSlots as Ot, withCtx as ue, createTextVNode as ce, vModelText as At, onActivated as ze, onDeactivated as Ye } from "vue";
|
|
5
5
|
import { compact as Ke, debounce as Ft, isEqual as Xe, startCase as Dt, upperFirst as Bt, cloneDeep as $t, remove as Vt, last as _t } from "lodash";
|
|
6
6
|
import { escapeHtml as Nt } from "@vue/shared";
|
|
7
7
|
import { escapeHtml as Uo } from "@vue/shared";
|
|
@@ -26,31 +26,31 @@ const Ut = {
|
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
27
|
setup(e, { emit: t }) {
|
|
28
28
|
const n = e, o = t, i = T(null), l = M(() => i.value ? i.value.map((g) => {
|
|
29
|
-
const
|
|
30
|
-
return n.preprocesor ? n.preprocesor(
|
|
29
|
+
const k = g;
|
|
30
|
+
return n.preprocesor ? n.preprocesor(k) : n.displayKey ? k[n.displayKey] : "";
|
|
31
31
|
}) : null), u = T(n.modelValue ?? null);
|
|
32
|
-
A(() => n.loadFn,
|
|
32
|
+
A(() => n.loadFn, a), A(
|
|
33
33
|
() => n.modelValue,
|
|
34
34
|
() => u.value = n.modelValue
|
|
35
35
|
), A(u, () => o("update:modelValue", u.value));
|
|
36
|
-
async function
|
|
36
|
+
async function a() {
|
|
37
37
|
i.value = await n.loadFn();
|
|
38
38
|
}
|
|
39
|
-
return V(
|
|
39
|
+
return V(a), (d, g) => l.value ? Q((E(), b("select", {
|
|
40
40
|
key: 1,
|
|
41
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
41
|
+
"onUpdate:modelValue": g[0] || (g[0] = (k) => u.value = k)
|
|
42
42
|
}, [
|
|
43
|
-
n.nullText ? (E(),
|
|
44
|
-
(E(!0),
|
|
43
|
+
n.nullText ? (E(), b("option", jt, U(n.nullText), 1)) : D("", !0),
|
|
44
|
+
(E(!0), b(J, null, he(l.value, (k, f) => {
|
|
45
45
|
var w;
|
|
46
|
-
return E(),
|
|
46
|
+
return E(), b("option", {
|
|
47
47
|
key: f,
|
|
48
48
|
value: (w = i.value) == null ? void 0 : w[f]
|
|
49
|
-
}, U(
|
|
49
|
+
}, U(k), 9, Pt);
|
|
50
50
|
}), 128))
|
|
51
51
|
], 512)), [
|
|
52
|
-
[
|
|
53
|
-
]) : (E(),
|
|
52
|
+
[xt, u.value]
|
|
53
|
+
]) : (E(), b("select", Ut, [
|
|
54
54
|
F("option", null, U(n.loadingText || "Loading..."), 1)
|
|
55
55
|
]));
|
|
56
56
|
}
|
|
@@ -65,25 +65,25 @@ const Ut = {
|
|
|
65
65
|
V(u);
|
|
66
66
|
function u() {
|
|
67
67
|
if (!l) return;
|
|
68
|
-
const g = l.vnode.el, { styles:
|
|
69
|
-
o.value =
|
|
68
|
+
const g = l.vnode.el, { styles: k, classes: f } = a(g, n);
|
|
69
|
+
o.value = k, i.value = f;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const f = t.anchor instanceof HTMLElement ? {} : t.anchor, w =
|
|
71
|
+
function a(g, k) {
|
|
72
|
+
const f = t.anchor instanceof HTMLElement ? {} : t.anchor, w = k.getBoundingClientRect(), m = g.getBoundingClientRect();
|
|
73
73
|
f.matchWidth && (m.width = w.width), f.matchHeight && (m.height = w.height);
|
|
74
|
-
const
|
|
74
|
+
const r = f.class ? Array.isArray(f.class) ? f.class : [f.class] : [];
|
|
75
75
|
let c, S;
|
|
76
76
|
if (f.y === "center")
|
|
77
|
-
c = w.top + w.height / 2 - m.height / 2,
|
|
77
|
+
c = w.top + w.height / 2 - m.height / 2, r.push("anchored-center-y");
|
|
78
78
|
else {
|
|
79
|
-
const
|
|
80
|
-
c =
|
|
79
|
+
const C = (w.bottom + m.height < window.innerHeight || f.y === "below") && f.y !== "above";
|
|
80
|
+
c = C ? w.bottom : w.top - m.height, r.push(C ? "anchored-top" : "anchored-bottom");
|
|
81
81
|
}
|
|
82
82
|
if (f.x === "center")
|
|
83
|
-
S = w.left + w.width / 2 - m.width / 2,
|
|
83
|
+
S = w.left + w.width / 2 - m.width / 2, r.push("anchored-center-x");
|
|
84
84
|
else {
|
|
85
|
-
const
|
|
86
|
-
S =
|
|
85
|
+
const C = (w.left + m.width < window.innerWidth || f.x === "left") && f.x !== "right";
|
|
86
|
+
S = C ? w.left : w.right - m.width, r.push(C ? "anchored-left" : "anchored-right");
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
89
|
styles: {
|
|
@@ -92,7 +92,7 @@ const Ut = {
|
|
|
92
92
|
...f.matchWidth ? { width: `${m.width}px` } : {},
|
|
93
93
|
...f.matchHeight ? { height: `${m.height}px` } : {}
|
|
94
94
|
},
|
|
95
|
-
classes:
|
|
95
|
+
classes: r
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
function d() {
|
|
@@ -102,9 +102,9 @@ const Ut = {
|
|
|
102
102
|
setTimeout(() => {
|
|
103
103
|
window.addEventListener("click", d);
|
|
104
104
|
}, 10);
|
|
105
|
-
}), (g,
|
|
105
|
+
}), (g, k) => (E(), b("div", {
|
|
106
106
|
class: $(["vf-overlay-anchor", i.value]),
|
|
107
|
-
style:
|
|
107
|
+
style: Ct(o.value),
|
|
108
108
|
onClick: ye(d, ["stop"])
|
|
109
109
|
}, [
|
|
110
110
|
G(g.$slots, "default")
|
|
@@ -122,13 +122,13 @@ const _ = Lt([]), ho = N({
|
|
|
122
122
|
function we(e, t, n) {
|
|
123
123
|
const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
|
|
124
124
|
o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
|
|
125
|
-
const i = String(++zt), l = It(e), u = ee(l, t),
|
|
125
|
+
const i = String(++zt), l = It(e), u = ee(l, t), a = n != null && n.anchor ? ee(qt, { overlayId: i, anchor: n.anchor }, () => [u]) : void 0, d = {
|
|
126
126
|
id: i,
|
|
127
127
|
component: l,
|
|
128
128
|
props: t,
|
|
129
129
|
options: n ?? {},
|
|
130
130
|
vnode: u,
|
|
131
|
-
wrapperVnode:
|
|
131
|
+
wrapperVnode: a
|
|
132
132
|
};
|
|
133
133
|
return _.push(d), d;
|
|
134
134
|
}
|
|
@@ -155,13 +155,13 @@ function te(e) {
|
|
|
155
155
|
async function Ee(e, t, n) {
|
|
156
156
|
return new Promise((o) => {
|
|
157
157
|
let i = null;
|
|
158
|
-
const u = { ...t, callback: async (
|
|
158
|
+
const u = { ...t, callback: async (a) => {
|
|
159
159
|
if (n != null && n.onCallback) {
|
|
160
|
-
const d = n.onCallback(
|
|
160
|
+
const d = n.onCallback(a);
|
|
161
161
|
if (typeof d == "object" && "then" in d && typeof d.then == "function" && await d === !1)
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
te(i), o(
|
|
164
|
+
te(i), o(a);
|
|
165
165
|
} };
|
|
166
166
|
i = we(e, u, n);
|
|
167
167
|
});
|
|
@@ -217,23 +217,23 @@ class oe extends Error {
|
|
|
217
217
|
function Zt(e) {
|
|
218
218
|
return e instanceof oe ? e.message : `An application error has occurred:
|
|
219
219
|
|
|
220
|
-
${
|
|
220
|
+
${be(e).message}
|
|
221
221
|
|
|
222
222
|
Please refresh the page and try again. If this error persists, ${B.unhandledErrorSupportText}.`;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function be(e) {
|
|
225
225
|
return e instanceof Error ? e : new Error(String(e));
|
|
226
226
|
}
|
|
227
|
-
async function
|
|
228
|
-
const n =
|
|
227
|
+
async function bo(e, t) {
|
|
228
|
+
const n = be(e);
|
|
229
229
|
return n instanceof oe || B.errorHandler(n), Xt({
|
|
230
230
|
title: t == null ? void 0 : t.title,
|
|
231
231
|
message: n,
|
|
232
232
|
classes: t == null ? void 0 : t.classes
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
async function
|
|
236
|
-
const t =
|
|
235
|
+
async function ko(e) {
|
|
236
|
+
const t = be(e);
|
|
237
237
|
t instanceof oe || B.errorHandler(t);
|
|
238
238
|
}
|
|
239
239
|
const z = Symbol("MaskState");
|
|
@@ -266,9 +266,9 @@ function Qt(e, t, n) {
|
|
|
266
266
|
const i = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
|
|
267
267
|
let l;
|
|
268
268
|
i && (l = i.tagName === "INPUT" ? i.value : i.innerHTML, i.setAttribute("disabled", "disabled"), i.innerText = n ?? "Please wait...");
|
|
269
|
-
const
|
|
270
|
-
return
|
|
271
|
-
disabledElements:
|
|
269
|
+
const a = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
270
|
+
return a.forEach((d) => d.setAttribute("disabled", "disabled")), o[me] = {
|
|
271
|
+
disabledElements: a,
|
|
272
272
|
waitButton: i,
|
|
273
273
|
buttonHtml: l
|
|
274
274
|
}, () => Qe(o);
|
|
@@ -302,8 +302,8 @@ const Jt = ["id"], en = {
|
|
|
302
302
|
emits: ["formSubmit"],
|
|
303
303
|
setup(e, { expose: t }) {
|
|
304
304
|
const n = pe(), o = e;
|
|
305
|
-
t({ mask: f, unmask: w, hide: m, unhide:
|
|
306
|
-
const i = T(), l = T(), u = T(!1),
|
|
305
|
+
t({ mask: f, unmask: w, hide: m, unhide: r });
|
|
306
|
+
const i = T(), l = T(), u = T(!1), a = M(() => Ke([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
|
|
307
307
|
V(() => {
|
|
308
308
|
var c;
|
|
309
309
|
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", g), (c = i.value) == null || c.addEventListener("click", d));
|
|
@@ -311,15 +311,15 @@ const Jt = ["id"], en = {
|
|
|
311
311
|
window.removeEventListener("keydown", g), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
312
312
|
});
|
|
313
313
|
function d(c) {
|
|
314
|
-
c.target == i.value &&
|
|
314
|
+
c.target == i.value && k();
|
|
315
315
|
}
|
|
316
316
|
function g(c) {
|
|
317
317
|
if (c.key === "Esc" || c.key === "Escape") {
|
|
318
318
|
const S = document.querySelectorAll(".vf-modal-wrap");
|
|
319
|
-
S[S.length - 1] === i.value &&
|
|
319
|
+
S[S.length - 1] === i.value && k();
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function k() {
|
|
323
323
|
Ze(n);
|
|
324
324
|
}
|
|
325
325
|
function f() {
|
|
@@ -329,16 +329,16 @@ const Jt = ["id"], en = {
|
|
|
329
329
|
Qe(l.value);
|
|
330
330
|
}
|
|
331
331
|
function m() {
|
|
332
|
-
return u.value = !0, () =>
|
|
332
|
+
return u.value = !0, () => r();
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function r() {
|
|
335
335
|
u.value = !1;
|
|
336
336
|
}
|
|
337
|
-
return (c, S) => (E(),
|
|
337
|
+
return (c, S) => (E(), b("div", {
|
|
338
338
|
id: c.id,
|
|
339
339
|
ref_key: "overlay",
|
|
340
340
|
ref: i,
|
|
341
|
-
class: $(["vf-overlay vf-modal-wrap",
|
|
341
|
+
class: $(["vf-overlay vf-modal-wrap", a.value])
|
|
342
342
|
}, [
|
|
343
343
|
F("form", {
|
|
344
344
|
ref_key: "form",
|
|
@@ -347,18 +347,18 @@ const Jt = ["id"], en = {
|
|
|
347
347
|
class: $(["vf-modal", { scrolls: c.scrolls }]),
|
|
348
348
|
onSubmit: S[0] || (S[0] = ye((I) => c.$emit("formSubmit"), ["prevent"]))
|
|
349
349
|
}, [
|
|
350
|
-
c.$slots.header ? (E(),
|
|
350
|
+
c.$slots.header ? (E(), b("div", en, [
|
|
351
351
|
G(c.$slots, "header"),
|
|
352
|
-
o.closeX ? (E(),
|
|
352
|
+
o.closeX ? (E(), b("i", {
|
|
353
353
|
key: 0,
|
|
354
354
|
class: "close",
|
|
355
|
-
onClick:
|
|
355
|
+
onClick: k
|
|
356
356
|
})) : D("", !0)
|
|
357
357
|
])) : D("", !0),
|
|
358
358
|
F("div", tn, [
|
|
359
359
|
G(c.$slots, "default")
|
|
360
360
|
]),
|
|
361
|
-
c.$slots.footer ? (E(),
|
|
361
|
+
c.$slots.footer ? (E(), b("div", nn, [
|
|
362
362
|
G(c.$slots, "footer")
|
|
363
363
|
])) : D("", !0)
|
|
364
364
|
], 34)
|
|
@@ -383,11 +383,11 @@ const Jt = ["id"], en = {
|
|
|
383
383
|
class: $(["vf-alert", ...o.classes ?? []])
|
|
384
384
|
}, Ot({
|
|
385
385
|
default: ue(() => [
|
|
386
|
-
o.isHtml ? (E(),
|
|
386
|
+
o.isHtml ? (E(), b("div", {
|
|
387
387
|
key: 0,
|
|
388
388
|
innerHtml: o.message,
|
|
389
389
|
class: "user-message"
|
|
390
|
-
}, null, 8, ln)) : (E(),
|
|
390
|
+
}, null, 8, ln)) : (E(), b("div", {
|
|
391
391
|
key: 1,
|
|
392
392
|
innerText: n.value
|
|
393
393
|
}, null, 8, sn))
|
|
@@ -404,8 +404,8 @@ const Jt = ["id"], en = {
|
|
|
404
404
|
o.isBare ? void 0 : {
|
|
405
405
|
name: "footer",
|
|
406
406
|
fn: ue(() => [
|
|
407
|
-
o.shouldConfirm ? (E(),
|
|
408
|
-
Q((E(),
|
|
407
|
+
o.shouldConfirm ? (E(), b(J, { key: 0 }, [
|
|
408
|
+
Q((E(), b("button", {
|
|
409
409
|
class: "primary",
|
|
410
410
|
onClick: i[0] || (i[0] = () => o.callback(!0))
|
|
411
411
|
}, i[3] || (i[3] = [
|
|
@@ -417,7 +417,7 @@ const Jt = ["id"], en = {
|
|
|
417
417
|
class: "default",
|
|
418
418
|
onClick: i[1] || (i[1] = () => o.callback(!1))
|
|
419
419
|
}, "Cancel")
|
|
420
|
-
], 64)) : Q((E(),
|
|
420
|
+
], 64)) : Q((E(), b("button", {
|
|
421
421
|
key: 1,
|
|
422
422
|
class: "default",
|
|
423
423
|
onClick: i[2] || (i[2] = () => o.callback(!0))
|
|
@@ -435,18 +435,18 @@ const Jt = ["id"], en = {
|
|
|
435
435
|
}), L = [];
|
|
436
436
|
for (let e = 0; e < 256; ++e)
|
|
437
437
|
L.push((e + 256).toString(16).slice(1));
|
|
438
|
-
function
|
|
438
|
+
function an(e, t = 0) {
|
|
439
439
|
return (L[e[t + 0]] + L[e[t + 1]] + L[e[t + 2]] + L[e[t + 3]] + "-" + L[e[t + 4]] + L[e[t + 5]] + "-" + L[e[t + 6]] + L[e[t + 7]] + "-" + L[e[t + 8]] + L[e[t + 9]] + "-" + L[e[t + 10]] + L[e[t + 11]] + L[e[t + 12]] + L[e[t + 13]] + L[e[t + 14]] + L[e[t + 15]]).toLowerCase();
|
|
440
440
|
}
|
|
441
441
|
let de;
|
|
442
|
-
const
|
|
442
|
+
const rn = new Uint8Array(16);
|
|
443
443
|
function un() {
|
|
444
444
|
if (!de) {
|
|
445
445
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
446
446
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
447
447
|
de = crypto.getRandomValues.bind(crypto);
|
|
448
448
|
}
|
|
449
|
-
return de(
|
|
449
|
+
return de(rn);
|
|
450
450
|
}
|
|
451
451
|
const cn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Be = { randomUUID: cn };
|
|
452
452
|
function dn(e, t, n) {
|
|
@@ -454,9 +454,9 @@ function dn(e, t, n) {
|
|
|
454
454
|
return Be.randomUUID();
|
|
455
455
|
e = e || {};
|
|
456
456
|
const o = e.random || (e.rng || un)();
|
|
457
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
457
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, an(o);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function xo(e) {
|
|
460
460
|
return e.replace(/\n/g, "<br>");
|
|
461
461
|
}
|
|
462
462
|
function fn(e) {
|
|
@@ -469,7 +469,7 @@ function vn(e) {
|
|
|
469
469
|
function mn(e, t = 1) {
|
|
470
470
|
return "$" + (Number(e) / t).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Co() {
|
|
473
473
|
return dn();
|
|
474
474
|
}
|
|
475
475
|
const hn = ["disabled", "placeholder", "required"], pn = {
|
|
@@ -478,7 +478,7 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
478
478
|
}, yn = ["onMousemove", "onMousedown"], gn = ["innerHTML"], wn = ["innerHTML"], En = {
|
|
479
479
|
key: 0,
|
|
480
480
|
class: "no-results"
|
|
481
|
-
},
|
|
481
|
+
}, bn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", kn = /* @__PURE__ */ N({
|
|
482
482
|
__name: "vf-smart-select",
|
|
483
483
|
props: {
|
|
484
484
|
modelValue: {},
|
|
@@ -504,20 +504,21 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
504
504
|
optionsListId: {},
|
|
505
505
|
debug: { type: Boolean },
|
|
506
506
|
required: { type: Boolean },
|
|
507
|
-
showCreateTextOnNewItem: { type: Boolean }
|
|
507
|
+
showCreateTextOnNewItem: { type: Boolean },
|
|
508
|
+
autoNext: { type: Boolean }
|
|
508
509
|
},
|
|
509
510
|
emits: ["optionsLoaded", "update:modelValue"],
|
|
510
511
|
setup(e, { expose: t, emit: n }) {
|
|
511
512
|
const o = Symbol("null"), i = Symbol("create"), l = e, u = n;
|
|
512
513
|
t({
|
|
513
|
-
addRemoteOption:
|
|
514
|
+
addRemoteOption: kt
|
|
514
515
|
});
|
|
515
|
-
const
|
|
516
|
+
const a = T(), d = T(), g = T(), k = T(!1), f = T(!1), w = T([]), m = T(!1), r = T(""), c = T(null), S = T(null), I = T(!1), C = T(null), Se = T(!1), at = M(() => l.showCreateTextOnNewItem ?? !0), rt = M(() => l.prependOptions ?? []), ut = M(() => l.appendOptions ?? []), xe = M(() => !!l.disabled), ct = M(() => !f.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), dt = M(() => l.noResultsText || "No options match your search."), W = M(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = M(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : W.value ? (s) => String(W.value(s)) : null), se = M(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), Ce = M(() => [...rt.value, ...w.value, ...ut.value]), ie = M(() => Ce.value.map((s, v) => {
|
|
516
517
|
var Ae, Fe;
|
|
517
|
-
const h = se.value(s), p = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), y = h ? h.trim().toLowerCase() : "",
|
|
518
|
+
const h = se.value(s), p = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), y = h ? h.trim().toLowerCase() : "", x = p ? p.trim().toLowerCase() : "", Z = [];
|
|
518
519
|
return l.searchFields ? l.searchFields.forEach((De) => {
|
|
519
520
|
s[De] && Z.push(String(s[De]).toLowerCase());
|
|
520
|
-
}) : (Z.push(y),
|
|
521
|
+
}) : (Z.push(y), x && Z.push(x)), {
|
|
521
522
|
key: ((Fe = j.value) == null ? void 0 : Fe.call(j, s)) ?? String(v),
|
|
522
523
|
title: h,
|
|
523
524
|
subtitle: p,
|
|
@@ -527,20 +528,20 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
527
528
|
})), H = M(() => {
|
|
528
529
|
let s = [...ie.value];
|
|
529
530
|
if (m.value) {
|
|
530
|
-
const v =
|
|
531
|
+
const v = r.value.trim().toLowerCase();
|
|
531
532
|
if (v.length) {
|
|
532
533
|
s = s.filter((y) => y.searchContent.includes(v));
|
|
533
|
-
const h = Nt(
|
|
534
|
+
const h = Nt(r.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${h})`, "ig");
|
|
534
535
|
s = s.map((y) => {
|
|
535
|
-
var
|
|
536
|
+
var x;
|
|
536
537
|
return {
|
|
537
538
|
...y,
|
|
538
539
|
title: y.title.replace(p, "<mark>$1</mark>"),
|
|
539
|
-
subtitle: (
|
|
540
|
+
subtitle: (x = y.subtitle) == null ? void 0 : x.replace(p, "<mark>$1</mark>")
|
|
540
541
|
};
|
|
541
|
-
}), Se.value && (s.find((
|
|
542
|
+
}), Se.value && (s.find((x) => x.searchContent === v) !== void 0 || s.push({
|
|
542
543
|
key: i,
|
|
543
|
-
title:
|
|
544
|
+
title: at.value ? "Create <strong>" + r.value.trim() + "</strong>..." : r.value.trim()
|
|
544
545
|
}));
|
|
545
546
|
}
|
|
546
547
|
} else l.nullTitle && s.unshift({
|
|
@@ -549,38 +550,38 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
549
550
|
});
|
|
550
551
|
return s;
|
|
551
552
|
});
|
|
552
|
-
A(() => l.modelValue,
|
|
553
|
+
A(() => l.modelValue, re), A(
|
|
553
554
|
() => l.options,
|
|
554
555
|
() => {
|
|
555
556
|
w.value = l.options ?? [], f.value = !0;
|
|
556
557
|
}
|
|
557
558
|
), A(ie, () => {
|
|
558
559
|
I.value && setTimeout(Ie, 0);
|
|
559
|
-
}), A(
|
|
560
|
-
m.value && !l.remoteSearch && !
|
|
560
|
+
}), A(r, () => {
|
|
561
|
+
m.value && !l.remoteSearch && !r.value.trim().length && (m.value = !1);
|
|
561
562
|
}), A(I, () => {
|
|
562
|
-
I.value ? setTimeout(wt, 0) : (m.value = !1,
|
|
563
|
+
I.value ? setTimeout(wt, 0) : (m.value = !1, r.value = S.value || "", g.value && (g.value.style.visibility = "hidden"));
|
|
563
564
|
}), A(H, () => {
|
|
564
565
|
var s;
|
|
565
|
-
l.modelValue && !c.value &&
|
|
566
|
+
l.modelValue && !c.value && re(), (C.value || m.value) && !H.value.find((v) => v.key == C.value) && (C.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
|
|
566
567
|
}), V(async () => {
|
|
567
|
-
Se.value = l.onCreateItem !== void 0, l.options ? (w.value = [...l.options], f.value = !0) : l.preload && await Le(),
|
|
568
|
+
Se.value = l.onCreateItem !== void 0, l.options ? (w.value = [...l.options], f.value = !0) : l.preload && await Le(), re(), A(c, () => {
|
|
568
569
|
c.value !== l.modelValue && u(
|
|
569
570
|
"update:modelValue",
|
|
570
571
|
c.value && W.value ? W.value(c.value) : c.value
|
|
571
572
|
);
|
|
572
|
-
}), l.remoteSearch && A(
|
|
573
|
+
}), l.remoteSearch && A(r, Ft(ft, 250));
|
|
573
574
|
});
|
|
574
575
|
async function Le() {
|
|
575
576
|
await Me(), w.value && u("optionsLoaded", w.value);
|
|
576
577
|
}
|
|
577
578
|
async function Me() {
|
|
578
579
|
var v;
|
|
579
|
-
const s = l.remoteSearch && m.value &&
|
|
580
|
-
|
|
580
|
+
const s = l.remoteSearch && m.value && r.value ? r.value : null;
|
|
581
|
+
k.value = !0, w.value = await ((v = l.loadOptions) == null ? void 0 : v.call(l, s)) ?? [], k.value = !1, f.value = !0;
|
|
581
582
|
}
|
|
582
583
|
function ft() {
|
|
583
|
-
m.value && (Me(), m.value =
|
|
584
|
+
m.value && (Me(), m.value = r.value.trim().length > 0);
|
|
584
585
|
}
|
|
585
586
|
function vt(s) {
|
|
586
587
|
if (s.key == "Escape") {
|
|
@@ -593,21 +594,21 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
593
594
|
return;
|
|
594
595
|
}
|
|
595
596
|
if (s.key == "ArrowUp" || s.key == "ArrowDown")
|
|
596
|
-
return s.preventDefault(),
|
|
597
|
+
return s.preventDefault(), ae(s.key == "ArrowUp" ? -1 : 1);
|
|
597
598
|
if (s.key == "PageUp" || s.key == "PageDown")
|
|
598
|
-
return s.preventDefault(),
|
|
599
|
+
return s.preventDefault(), ae(s.key == "PageUp" ? -10 : 10);
|
|
599
600
|
if (s.key == "Home" || s.key == "End")
|
|
600
|
-
return s.preventDefault(),
|
|
601
|
+
return s.preventDefault(), ae(s.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
601
602
|
if (s.key == "Enter") {
|
|
602
603
|
s.preventDefault();
|
|
603
|
-
const v = H.value.find((h) => h.key ==
|
|
604
|
+
const v = H.value.find((h) => h.key == C.value);
|
|
604
605
|
if (v) return He(v);
|
|
605
606
|
}
|
|
606
607
|
if (s.key === "Delete" || s.key === "Backspace") {
|
|
607
|
-
|
|
608
|
+
r.value.length > 1 && (m.value = !0);
|
|
608
609
|
return;
|
|
609
610
|
}
|
|
610
|
-
!s.metaKey &&
|
|
611
|
+
!s.metaKey && bn.includes(s.key) && (m.value = !0);
|
|
611
612
|
}
|
|
612
613
|
}
|
|
613
614
|
function mt() {
|
|
@@ -617,7 +618,7 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
617
618
|
}, 0);
|
|
618
619
|
}
|
|
619
620
|
function ht(s) {
|
|
620
|
-
c.value ?
|
|
621
|
+
c.value ? C.value = pt(c.value) : l.nullTitle && (C.value = o);
|
|
621
622
|
}
|
|
622
623
|
function pt(s) {
|
|
623
624
|
var v;
|
|
@@ -627,83 +628,84 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
627
628
|
const v = H.value.find((y) => y.ref === s);
|
|
628
629
|
if (v)
|
|
629
630
|
return v;
|
|
630
|
-
const h = l.keyExtractor ? (y,
|
|
631
|
+
const h = l.keyExtractor ? (y, x) => l.keyExtractor(y) === l.keyExtractor(x) : Xe, p = H.value.find((y) => h(y.ref, s));
|
|
631
632
|
return p || null;
|
|
632
633
|
}
|
|
633
634
|
function gt() {
|
|
634
|
-
l.debug || (!
|
|
635
|
+
l.debug || (!r.value.length && l.nullTitle && (c.value = null, S.value = null), I.value = !1);
|
|
635
636
|
}
|
|
636
637
|
function wt() {
|
|
637
638
|
var s;
|
|
638
639
|
f.value || Le(), l.optionsListId && ((s = g.value) == null || s.setAttribute("id", l.optionsListId)), Et();
|
|
639
640
|
}
|
|
640
641
|
function Et() {
|
|
641
|
-
const s =
|
|
642
|
-
for (let
|
|
643
|
-
/^(font|text)/.test(
|
|
642
|
+
const s = a.value.getBoundingClientRect(), v = s.y + s.height + 2, h = s.x, p = g.value, y = window.getComputedStyle(a.value);
|
|
643
|
+
for (let x in y)
|
|
644
|
+
/^(font|text)/.test(x) && (p.style[x] = y[x]);
|
|
644
645
|
if (p.style.top = v + "px", p.style.left = h + "px", p.style.minWidth = s.width + "px", !y.maxHeight || y.maxHeight == "none") {
|
|
645
|
-
const
|
|
646
|
-
p.style.maxHeight =
|
|
646
|
+
const x = window.innerHeight - v - 12;
|
|
647
|
+
p.style.maxHeight = x + "px";
|
|
647
648
|
}
|
|
648
649
|
p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Ie, 0);
|
|
649
650
|
}
|
|
650
651
|
function Ie() {
|
|
651
|
-
if (!f.value || !
|
|
652
|
-
const s = H.value.findIndex((p) => p.key ==
|
|
652
|
+
if (!f.value || !C.value) return;
|
|
653
|
+
const s = H.value.findIndex((p) => p.key == C.value), v = g.value, h = v == null ? void 0 : v.querySelectorAll(".option")[s];
|
|
653
654
|
h && (v.scrollTop = h.offsetTop);
|
|
654
655
|
}
|
|
655
|
-
function
|
|
656
|
-
|
|
656
|
+
function bt(s) {
|
|
657
|
+
C.value = s ? s.key : null;
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
-
const v = H.value.findIndex((
|
|
659
|
+
function ae(s) {
|
|
660
|
+
const v = H.value.findIndex((x) => x.key == C.value);
|
|
660
661
|
let h = v + s;
|
|
661
662
|
if (h < 0 ? h = 0 : h >= H.value.length && (h = H.value.length - 1), v == h) return;
|
|
662
|
-
|
|
663
|
+
C.value = H.value[h].key;
|
|
663
664
|
const p = g.value, y = p == null ? void 0 : p.querySelectorAll(".option")[h];
|
|
664
665
|
y && (y.offsetTop < p.scrollTop ? p.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = y.offsetTop + y.offsetHeight - p.clientHeight));
|
|
665
666
|
}
|
|
666
667
|
function He(s) {
|
|
667
668
|
var v, h;
|
|
668
669
|
if (m.value = !1, s.key == o)
|
|
669
|
-
|
|
670
|
+
r.value = "", c.value = null, S.value = null;
|
|
670
671
|
else if (s.key === i) {
|
|
671
|
-
const p =
|
|
672
|
-
|
|
672
|
+
const p = r.value.trim();
|
|
673
|
+
r.value = "", c.value = null, S.value = null, (v = l.onCreateItem) == null || v.call(l, p);
|
|
673
674
|
} else {
|
|
674
|
-
const y = ie.value.find((
|
|
675
|
-
c.value = y, S.value = se.value(y),
|
|
675
|
+
const y = ie.value.find((x) => x.key == s.key).ref;
|
|
676
|
+
c.value = y, S.value = se.value(y), r.value = S.value || "";
|
|
676
677
|
}
|
|
677
678
|
(h = d.value) == null || h.blur(), Oe();
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
-
l.modelValue ? (c.value = W.value ?
|
|
680
|
+
function re() {
|
|
681
|
+
l.modelValue ? (c.value = W.value ? Ce.value.find((s) => l.modelValue === W.value(s)) : l.modelValue, S.value = c.value ? se.value(c.value) : null, r.value = S.value || "") : (c.value = null, S.value = null, r.value = "");
|
|
681
682
|
}
|
|
682
|
-
function
|
|
683
|
+
function kt(s) {
|
|
683
684
|
w.value.unshift(s);
|
|
684
685
|
}
|
|
685
686
|
function Oe() {
|
|
686
687
|
var y;
|
|
687
|
-
|
|
688
|
+
if (!l.autoNext) return;
|
|
689
|
+
let s = (y = a.value) == null ? void 0 : y.parentElement;
|
|
688
690
|
for (; s && s.tagName !== "FORM" && s.tagName !== "BODY"; )
|
|
689
691
|
s = s.parentElement;
|
|
690
692
|
if (!s) return;
|
|
691
693
|
const v = s.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
692
694
|
if (!v) return;
|
|
693
|
-
const h = Array.from(v).findIndex((
|
|
695
|
+
const h = Array.from(v).findIndex((x) => x === d.value), p = v[h + 1];
|
|
694
696
|
p && setTimeout(() => p.focus(), 0);
|
|
695
697
|
}
|
|
696
|
-
return (s, v) => (E(),
|
|
698
|
+
return (s, v) => (E(), b("div", {
|
|
697
699
|
ref_key: "el",
|
|
698
|
-
ref:
|
|
699
|
-
class: $(["vf-smart-select", { disabled:
|
|
700
|
+
ref: a,
|
|
701
|
+
class: $(["vf-smart-select", { disabled: xe.value, open: I.value }])
|
|
700
702
|
}, [
|
|
701
703
|
Q(F("input", {
|
|
702
704
|
ref_key: "searchField",
|
|
703
705
|
ref: d,
|
|
704
|
-
"onUpdate:modelValue": v[0] || (v[0] = (h) =>
|
|
706
|
+
"onUpdate:modelValue": v[0] || (v[0] = (h) => r.value = h),
|
|
705
707
|
type: "text",
|
|
706
|
-
disabled:
|
|
708
|
+
disabled: xe.value,
|
|
707
709
|
class: $({ nullable: !!s.nullTitle }),
|
|
708
710
|
placeholder: ct.value,
|
|
709
711
|
required: s.required,
|
|
@@ -712,35 +714,35 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
712
714
|
onFocus: mt,
|
|
713
715
|
onBlur: gt
|
|
714
716
|
}, null, 42, hn), [
|
|
715
|
-
[At,
|
|
717
|
+
[At, r.value]
|
|
716
718
|
]),
|
|
717
|
-
I.value ? (E(),
|
|
719
|
+
I.value ? (E(), b("div", {
|
|
718
720
|
key: 0,
|
|
719
721
|
ref_key: "optionsContainer",
|
|
720
722
|
ref: g,
|
|
721
723
|
class: "vf-smart-select-options"
|
|
722
724
|
}, [
|
|
723
|
-
f.value ? (E(),
|
|
724
|
-
(E(!0),
|
|
725
|
+
f.value ? (E(), b(J, { key: 1 }, [
|
|
726
|
+
(E(!0), b(J, null, he(H.value, (h) => (E(), b("div", {
|
|
725
727
|
key: String(h.key),
|
|
726
728
|
class: $(["option", {
|
|
727
|
-
highlighted:
|
|
729
|
+
highlighted: C.value === h.key
|
|
728
730
|
}]),
|
|
729
|
-
onMousemove: (p) =>
|
|
731
|
+
onMousemove: (p) => bt(h),
|
|
730
732
|
onMousedown: (p) => He(h)
|
|
731
733
|
}, [
|
|
732
734
|
F("div", {
|
|
733
735
|
class: "title",
|
|
734
736
|
innerHTML: h.title
|
|
735
737
|
}, null, 8, gn),
|
|
736
|
-
h.subtitle ? (E(),
|
|
738
|
+
h.subtitle ? (E(), b("div", {
|
|
737
739
|
key: 0,
|
|
738
740
|
class: "subtitle",
|
|
739
741
|
innerHTML: h.subtitle
|
|
740
742
|
}, null, 8, wn)) : D("", !0)
|
|
741
743
|
], 42, yn))), 128)),
|
|
742
|
-
!H.value.length &&
|
|
743
|
-
], 64)) : (E(),
|
|
744
|
+
!H.value.length && r.value ? (E(), b("div", En, U(dt.value), 1)) : D("", !0)
|
|
745
|
+
], 64)) : (E(), b("div", pn, "Loading..."))
|
|
744
746
|
], 512)) : D("", !0)
|
|
745
747
|
], 2));
|
|
746
748
|
}
|
|
@@ -755,35 +757,35 @@ const hn = ["disabled", "placeholder", "required"], pn = {
|
|
|
755
757
|
},
|
|
756
758
|
emits: ["update:modelValue"],
|
|
757
759
|
setup(e, { emit: t }) {
|
|
758
|
-
const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((
|
|
759
|
-
value:
|
|
760
|
+
const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((a) => ({ value: a, label: a })) : Object.entries(n.options).map(([a, d]) => ({
|
|
761
|
+
value: a,
|
|
760
762
|
label: d
|
|
761
|
-
}))), i = M(() => n.formatter ? (
|
|
763
|
+
}))), i = M(() => n.formatter ? (a) => n.formatter(a.label) : (a) => a.label), l = t, u = T(o.value.find((a) => a.value === n.modelValue) ?? null);
|
|
762
764
|
return A(
|
|
763
765
|
() => n.modelValue,
|
|
764
|
-
(
|
|
765
|
-
u.value = o.value.find((d) => d.value ===
|
|
766
|
+
(a) => {
|
|
767
|
+
u.value = o.value.find((d) => d.value === a) ?? null;
|
|
766
768
|
}
|
|
767
|
-
), A(u, (
|
|
769
|
+
), A(u, (a) => {
|
|
768
770
|
var g;
|
|
769
|
-
const d =
|
|
771
|
+
const d = a ? (g = o.value.find((k) => Xe(k, a))) == null ? void 0 : g.value : null;
|
|
770
772
|
l("update:modelValue", d ?? null);
|
|
771
|
-
}), (
|
|
773
|
+
}), (a, d) => (E(), qe(kn, {
|
|
772
774
|
modelValue: u.value,
|
|
773
775
|
"onUpdate:modelValue": d[0] || (d[0] = (g) => u.value = g),
|
|
774
776
|
options: o.value,
|
|
775
777
|
formatter: i.value,
|
|
776
|
-
"null-title":
|
|
778
|
+
"null-title": a.nullTitle
|
|
777
779
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
778
780
|
}
|
|
779
781
|
});
|
|
780
782
|
function Mo() {
|
|
781
783
|
return T();
|
|
782
784
|
}
|
|
783
|
-
const Tn = { class: "content" }, Sn = { class: "message" },
|
|
785
|
+
const Tn = { class: "content" }, Sn = { class: "message" }, xn = {
|
|
784
786
|
key: 0,
|
|
785
787
|
class: "close"
|
|
786
|
-
},
|
|
788
|
+
}, Cn = {
|
|
787
789
|
key: 0,
|
|
788
790
|
class: "progress-bar"
|
|
789
791
|
}, Ln = /* @__PURE__ */ N({
|
|
@@ -809,15 +811,15 @@ const Tn = { class: "content" }, Sn = { class: "message" }, Cn = {
|
|
|
809
811
|
duration: i * 1e3,
|
|
810
812
|
easing: "linear"
|
|
811
813
|
}), setTimeout(() => t.callback(), i * 1e3);
|
|
812
|
-
}), (i, l) => (E(),
|
|
814
|
+
}), (i, l) => (E(), b("div", {
|
|
813
815
|
class: $(["vf-toast", i.className]),
|
|
814
816
|
onClick: ye(n, ["stop"])
|
|
815
817
|
}, [
|
|
816
818
|
F("div", Tn, [
|
|
817
819
|
F("div", Sn, U(i.message), 1),
|
|
818
|
-
i.disableClose ? D("", !0) : (E(),
|
|
820
|
+
i.disableClose ? D("", !0) : (E(), b("div", xn, "x"))
|
|
819
821
|
]),
|
|
820
|
-
i.durationSecs !== null ? (E(),
|
|
822
|
+
i.durationSecs !== null ? (E(), b("div", Cn, [
|
|
821
823
|
F("div", {
|
|
822
824
|
ref_key: "progressInnerEl",
|
|
823
825
|
ref: o,
|
|
@@ -896,25 +898,25 @@ function Ao(e, t) {
|
|
|
896
898
|
c.classList.add("separator"), o.appendChild(c);
|
|
897
899
|
return;
|
|
898
900
|
}
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
+
const r = document.createElement("div");
|
|
902
|
+
r.classList.add("item"), r.style.userSelect = "none", r.innerText = m.title, o.appendChild(r), m.class && r.classList.add(m.class), m.shouldConfirm ? r.addEventListener("click", (c) => w(c, r, m.handler)) : r.addEventListener("click", () => m.handler());
|
|
901
903
|
});
|
|
902
|
-
const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY,
|
|
903
|
-
o.style.left = g + "px", o.style.top =
|
|
904
|
+
const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, a = o.offsetHeight, d = o.offsetWidth, g = l < d ? e.clientX - d - 1 : e.clientX + 1, k = u < a ? e.clientY - a - 1 : e.clientY + 1;
|
|
905
|
+
o.style.left = g + "px", o.style.top = k + "px", setTimeout(() => {
|
|
904
906
|
o.style.width = o.offsetWidth + "px";
|
|
905
907
|
}, 50);
|
|
906
908
|
function f() {
|
|
907
909
|
t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
|
|
908
910
|
}
|
|
909
|
-
function w(m,
|
|
910
|
-
if (
|
|
911
|
+
function w(m, r, c) {
|
|
912
|
+
if (r.classList.contains("pending-confirm"))
|
|
911
913
|
return c();
|
|
912
|
-
const S =
|
|
913
|
-
|
|
914
|
+
const S = r.innerHTML;
|
|
915
|
+
r.classList.add("pending-confirm"), r.innerText = "Confirm";
|
|
914
916
|
const I = () => {
|
|
915
|
-
|
|
917
|
+
r.classList.remove("pending-confirm"), r.innerHTML = S, r.removeEventListener("mouseleave", I);
|
|
916
918
|
};
|
|
917
|
-
|
|
919
|
+
r.addEventListener("mouseleave", I), m.stopPropagation();
|
|
918
920
|
}
|
|
919
921
|
}
|
|
920
922
|
const _n = (e) => new Promise((t) => setTimeout(t, e)), Fo = (e) => _n(e * 1e3);
|
|
@@ -941,7 +943,7 @@ function $o(e, t) {
|
|
|
941
943
|
}
|
|
942
944
|
});
|
|
943
945
|
}
|
|
944
|
-
const
|
|
946
|
+
const ke = Symbol("HookState");
|
|
945
947
|
function Vo(e, t) {
|
|
946
948
|
const n = t ?? pe();
|
|
947
949
|
V(() => Rn(n, e), n), ze(() => Wn(n), n), Ye(() => Ve(n), n), ge(() => Ve(n), n);
|
|
@@ -952,16 +954,16 @@ function Rn(e, t) {
|
|
|
952
954
|
const o = et(e.vnode.el);
|
|
953
955
|
o ? n.ancestor = new Y(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
954
956
|
}
|
|
955
|
-
t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[
|
|
957
|
+
t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[ke] = n;
|
|
956
958
|
}
|
|
957
959
|
function Wn(e) {
|
|
958
960
|
var n, o, i;
|
|
959
|
-
const t = e[
|
|
961
|
+
const t = e[ke];
|
|
960
962
|
(n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (i = t == null ? void 0 : t.window) == null || i.install();
|
|
961
963
|
}
|
|
962
964
|
function Ve(e) {
|
|
963
965
|
var n, o, i;
|
|
964
|
-
const t = e[
|
|
966
|
+
const t = e[ke];
|
|
965
967
|
(n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (i = t == null ? void 0 : t.window) == null || i.uninstall();
|
|
966
968
|
}
|
|
967
969
|
const fe = ["auto", "scroll"];
|
|
@@ -1005,7 +1007,7 @@ const jn = {
|
|
|
1005
1007
|
}, P = Symbol("ConfirmState");
|
|
1006
1008
|
function Pn(e, t) {
|
|
1007
1009
|
e.addEventListener("click", (n) => {
|
|
1008
|
-
var u,
|
|
1010
|
+
var u, a;
|
|
1009
1011
|
const o = Date.now(), i = ((u = t.value) == null ? void 0 : u.text) !== void 0 ? t.value.text : "Confirm";
|
|
1010
1012
|
if (e[P]) {
|
|
1011
1013
|
if (o - e[P].initTime < 300)
|
|
@@ -1022,7 +1024,7 @@ function Pn(e, t) {
|
|
|
1022
1024
|
i && (e.innerHTML = l.preconfirmHtml), (d = t.value) != null && d.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", l.resetHandler), delete e[P];
|
|
1023
1025
|
}
|
|
1024
1026
|
};
|
|
1025
|
-
e[P] = l, i && (e.innerHTML = i), (
|
|
1027
|
+
e[P] = l, i && (e.innerHTML = i), (a = t.value) != null && a.class && e.classList.add(t.value.class), e.addEventListener("mouseout", l.resetHandler);
|
|
1026
1028
|
});
|
|
1027
1029
|
}
|
|
1028
1030
|
const qn = {
|
|
@@ -1044,14 +1046,14 @@ function Re(e, t) {
|
|
|
1044
1046
|
t.value == t.oldValue && e.innerHTML.length || (e.innerText = Kn(e, t));
|
|
1045
1047
|
}
|
|
1046
1048
|
function Kn(e, t) {
|
|
1047
|
-
var g,
|
|
1049
|
+
var g, k;
|
|
1048
1050
|
if (!t.value)
|
|
1049
1051
|
return ((g = e.attributes.getNamedItem("placeholder")) == null ? void 0 : g.value) ?? "";
|
|
1050
1052
|
let n = "";
|
|
1051
1053
|
const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), l = new Date(i);
|
|
1052
1054
|
e.attributes.getNamedItem("display-utc") !== null && l.setMinutes(l.getMinutes() - l.getTimezoneOffset());
|
|
1053
|
-
let u = (
|
|
1054
|
-
const
|
|
1055
|
+
let u = (k = e.attributes.getNamedItem("format")) == null ? void 0 : k.value;
|
|
1056
|
+
const a = e.attributes.getNamedItem("date-only") !== null;
|
|
1055
1057
|
if (!u && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1056
1058
|
const f = /* @__PURE__ */ new Date();
|
|
1057
1059
|
f.getFullYear() === l.getFullYear() && f.getMonth() === l.getMonth() && f.getDate() === l.getDate() && (n = "at", u = "HH:mm");
|
|
@@ -1060,10 +1062,10 @@ function Kn(e, t) {
|
|
|
1060
1062
|
let f = null;
|
|
1061
1063
|
const w = /* @__PURE__ */ new Date();
|
|
1062
1064
|
w.getFullYear() === l.getFullYear() ? (w.getMonth() !== l.getMonth() || w.getDate() !== l.getDate()) && (f = "M/d") : f = "M/d/YY";
|
|
1063
|
-
const m =
|
|
1065
|
+
const m = a ? null : B.defaultTimeFormat;
|
|
1064
1066
|
u = Ke([f, m]).join(" ");
|
|
1065
1067
|
}
|
|
1066
|
-
u || (
|
|
1068
|
+
u || (a ? u = B.defaultDateFormat : u = `${B.defaultDateFormat} ${B.defaultTimeFormat}`);
|
|
1067
1069
|
let d = ve(l, u);
|
|
1068
1070
|
return n && (d = n + " " + d), d;
|
|
1069
1071
|
}
|
|
@@ -1216,8 +1218,8 @@ class so {
|
|
|
1216
1218
|
}
|
|
1217
1219
|
handleMouseMove(t) {
|
|
1218
1220
|
const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, i = window.innerWidth, l = window.innerHeight;
|
|
1219
|
-
let u = t.pageX + 10,
|
|
1220
|
-
u + n > i && (u = t.pageX - 5 - n),
|
|
1221
|
+
let u = t.pageX + 10, a = t.pageY + 20;
|
|
1222
|
+
u + n > i && (u = t.pageX - 5 - n), a + o > l && (a = t.pageY - 5 - o), this.tipEl.style.left = u + "px", this.tipEl.style.top = a + "px", this.lastMoveEvt = t;
|
|
1221
1223
|
}
|
|
1222
1224
|
checkMoveEvent() {
|
|
1223
1225
|
var t;
|
|
@@ -1240,7 +1242,7 @@ export {
|
|
|
1240
1242
|
le as VfAlertModal,
|
|
1241
1243
|
Lo as VfEzSmartSelect,
|
|
1242
1244
|
on as VfModal,
|
|
1243
|
-
|
|
1245
|
+
kn as VfSmartSelect,
|
|
1244
1246
|
Do as cloneProp,
|
|
1245
1247
|
Eo as configureVf,
|
|
1246
1248
|
$o as configureVfOpenApiClient,
|
|
@@ -1256,13 +1258,13 @@ export {
|
|
|
1256
1258
|
Nn as formatNumber,
|
|
1257
1259
|
vn as formatPhone,
|
|
1258
1260
|
mn as formatUSCurrency,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
+
ko as handleError,
|
|
1262
|
+
bo as handleErrorAndAlert,
|
|
1261
1263
|
No as installVf,
|
|
1262
1264
|
To as maskComponent,
|
|
1263
1265
|
Gt as maskEl,
|
|
1264
1266
|
Qt as maskForm,
|
|
1265
|
-
|
|
1267
|
+
xo as nl2br,
|
|
1266
1268
|
Bo as nullifyEmptyInputs,
|
|
1267
1269
|
Ee as presentOverlay,
|
|
1268
1270
|
te as removeOverlayInjection,
|
|
@@ -1275,12 +1277,12 @@ export {
|
|
|
1275
1277
|
wo as showWait,
|
|
1276
1278
|
_n as sleep,
|
|
1277
1279
|
Fo as sleepSecs,
|
|
1278
|
-
|
|
1280
|
+
be as toError,
|
|
1279
1281
|
So as unmaskComponent,
|
|
1280
1282
|
Ge as unmaskEl,
|
|
1281
1283
|
Qe as unmaskForm,
|
|
1282
1284
|
Vo as useInfiniteScroll,
|
|
1283
1285
|
_o as useResizeWatcher,
|
|
1284
|
-
|
|
1286
|
+
Co as uuid,
|
|
1285
1287
|
Mo as vfModalRef
|
|
1286
1288
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const props = defineProps<{
|
|
|
18
18
|
nullTitle?: string;
|
|
19
19
|
placeholder?: string;
|
|
20
20
|
options: { [K: string]: string } | string[];
|
|
21
|
-
formatter?: (
|
|
21
|
+
formatter?: (title: string) => string;
|
|
22
22
|
}>();
|
|
23
23
|
|
|
24
24
|
const computedOpts = computed(() => {
|
|
@@ -32,7 +32,7 @@ const computedOpts = computed(() => {
|
|
|
32
32
|
|
|
33
33
|
const ezFormatter = computed(() => {
|
|
34
34
|
if (props.formatter) {
|
|
35
|
-
return (o: IComputedOption) => props.formatter!(o);
|
|
35
|
+
return (o: IComputedOption) => props.formatter!(o.label);
|
|
36
36
|
}
|
|
37
37
|
return (o: IComputedOption) => o.label;
|
|
38
38
|
});
|
|
@@ -82,6 +82,7 @@ const props = defineProps<{
|
|
|
82
82
|
debug?: boolean;
|
|
83
83
|
required?: boolean;
|
|
84
84
|
showCreateTextOnNewItem?: boolean;
|
|
85
|
+
autoNext?: boolean;
|
|
85
86
|
}>();
|
|
86
87
|
|
|
87
88
|
const emit = defineEmits<{
|
|
@@ -523,6 +524,8 @@ function addRemoteOption(option: T) {
|
|
|
523
524
|
}
|
|
524
525
|
|
|
525
526
|
function focusNextInput() {
|
|
527
|
+
if (!props.autoNext) return;
|
|
528
|
+
|
|
526
529
|
let parent = el.value?.parentElement;
|
|
527
530
|
while (parent && parent.tagName !== 'FORM' && parent.tagName !== 'BODY') {
|
|
528
531
|
parent = parent.parentElement;
|