@signal24/vue-foundation 4.25.0 → 4.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Ht = Object.defineProperty;
|
|
2
2
|
var Vt = (e, t, n) => t in e ? Ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as R, ref as T, computed as M, watch as
|
|
5
|
-
import { compact as
|
|
3
|
+
var D = (e, t, n) => Vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as R, ref as T, computed as M, watch as H, onMounted as _, createElementBlock as k, withDirectives as ne, openBlock as b, createElementVNode as B, toDisplayString as W, createCommentVNode as A, Fragment as oe, renderList as se, vModelSelect as At, getCurrentInstance as we, withModifiers as Ee, normalizeStyle as $t, normalizeClass as $, renderSlot as j, reactive as Bt, h as ie, Teleport as _t, markRaw as Nt, onBeforeUnmount as be, resolveDirective as Rt, createBlock as Je, createSlots as Wt, withCtx as pe, createTextVNode as X, vModelText as jt, onActivated as Qe, onDeactivated as et } from "vue";
|
|
5
|
+
import { compact as tt, uniq as Ut, groupBy as Pt, debounce as qt, isEqual as nt, startCase as zt, upperFirst as Kt, cloneDeep as Yt, remove as Xt, last as Zt } from "lodash";
|
|
6
6
|
import { escapeHtml as Gt } from "@vue/shared";
|
|
7
7
|
import { escapeHtml as ms } from "@vue/shared";
|
|
8
8
|
import { format as P, addDays as Jt, parse as Qt } from "date-fns";
|
|
@@ -29,14 +29,14 @@ const nn = {
|
|
|
29
29
|
const E = p;
|
|
30
30
|
return n.preprocesor ? n.preprocesor(E) : n.displayKey ? E[n.displayKey] : "";
|
|
31
31
|
}) : null), a = T(n.modelValue ?? null);
|
|
32
|
-
|
|
32
|
+
H(() => n.loadFn, l), H(
|
|
33
33
|
() => n.modelValue,
|
|
34
34
|
() => a.value = n.modelValue
|
|
35
|
-
),
|
|
35
|
+
), H(a, () => o("update:modelValue", a.value));
|
|
36
36
|
async function l() {
|
|
37
37
|
r.value = await n.loadFn();
|
|
38
38
|
}
|
|
39
|
-
return _(l), (
|
|
39
|
+
return _(l), (u, p) => s.value ? ne((b(), k("select", {
|
|
40
40
|
key: 1,
|
|
41
41
|
"onUpdate:modelValue": p[0] || (p[0] = (E) => a.value = E)
|
|
42
42
|
}, [
|
|
@@ -69,43 +69,43 @@ const nn = {
|
|
|
69
69
|
o.value = E, r.value = v;
|
|
70
70
|
}
|
|
71
71
|
function l(p, E) {
|
|
72
|
-
const v = t.anchor instanceof HTMLElement ? {} : t.anchor, w = E.getBoundingClientRect(),
|
|
73
|
-
v.matchWidth && (
|
|
74
|
-
const
|
|
75
|
-
let
|
|
72
|
+
const v = t.anchor instanceof HTMLElement ? {} : t.anchor, w = E.getBoundingClientRect(), g = p.getBoundingClientRect();
|
|
73
|
+
v.matchWidth && (g.width = w.width), v.matchHeight && (g.height = w.height);
|
|
74
|
+
const c = v.class ? Array.isArray(v.class) ? v.class : [v.class] : [];
|
|
75
|
+
let d, S;
|
|
76
76
|
if (v.y === "center")
|
|
77
|
-
|
|
77
|
+
d = w.top + w.height / 2 - g.height / 2, c.push("anchored-center-y");
|
|
78
78
|
else {
|
|
79
|
-
const L = (w.bottom +
|
|
80
|
-
|
|
79
|
+
const L = (w.bottom + g.height < window.innerHeight || v.y === "below") && v.y !== "above";
|
|
80
|
+
d = L ? w.bottom : w.top - g.height, c.push(L ? "anchored-top" : "anchored-bottom");
|
|
81
81
|
}
|
|
82
82
|
if (v.x === "center")
|
|
83
|
-
S = w.left + w.width / 2 -
|
|
83
|
+
S = w.left + w.width / 2 - g.width / 2, c.push("anchored-center-x");
|
|
84
84
|
else {
|
|
85
|
-
const L = (w.left +
|
|
86
|
-
S = L ? w.left : w.right -
|
|
85
|
+
const L = (w.left + g.width < window.innerWidth || v.x === "left") && v.x !== "right";
|
|
86
|
+
S = L ? w.left : w.right - g.width, c.push(L ? "anchored-left" : "anchored-right");
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
89
|
styles: {
|
|
90
|
-
top: `${
|
|
90
|
+
top: `${d}px`,
|
|
91
91
|
left: `${S}px`,
|
|
92
|
-
...v.matchWidth ? { width: `${
|
|
93
|
-
...v.matchHeight ? { height: `${
|
|
92
|
+
...v.matchWidth ? { width: `${g.width}px` } : {},
|
|
93
|
+
...v.matchHeight ? { height: `${g.height}px` } : {}
|
|
94
94
|
},
|
|
95
|
-
classes:
|
|
95
|
+
classes: c
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
window.removeEventListener("click",
|
|
98
|
+
function u() {
|
|
99
|
+
window.removeEventListener("click", u), un(t.overlayId);
|
|
100
100
|
}
|
|
101
101
|
return _(() => {
|
|
102
102
|
setTimeout(() => {
|
|
103
|
-
window.addEventListener("click",
|
|
103
|
+
window.addEventListener("click", u);
|
|
104
104
|
}, 10);
|
|
105
105
|
}), (p, E) => (b(), k("div", {
|
|
106
106
|
class: $(["vf-overlay-anchor", r.value]),
|
|
107
107
|
style: $t(o.value),
|
|
108
|
-
onClick: Ee(
|
|
108
|
+
onClick: Ee(u, ["stop"])
|
|
109
109
|
}, [
|
|
110
110
|
j(p.$slots, "default")
|
|
111
111
|
], 6));
|
|
@@ -122,7 +122,7 @@ const N = Bt([]), Wo = R({
|
|
|
122
122
|
function ke(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 r = String(++ln), s = Nt(e), a = ie(s, t), l = n != null && n.anchor ? ie(rn, { overlayId: r, anchor: n.anchor }, () => [a]) : void 0,
|
|
125
|
+
const r = String(++ln), s = Nt(e), a = ie(s, t), l = n != null && n.anchor ? ie(rn, { overlayId: r, anchor: n.anchor }, () => [a]) : void 0, u = {
|
|
126
126
|
id: r,
|
|
127
127
|
component: s,
|
|
128
128
|
props: t,
|
|
@@ -130,12 +130,12 @@ function ke(e, t, n) {
|
|
|
130
130
|
vnode: a,
|
|
131
131
|
wrapperVnode: l
|
|
132
132
|
};
|
|
133
|
-
return N.push(
|
|
133
|
+
return N.push(u), u;
|
|
134
134
|
}
|
|
135
135
|
function jo(e) {
|
|
136
|
-
e.$ &&
|
|
136
|
+
e.$ && ot(e.$);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function ot(e) {
|
|
139
139
|
let t = e;
|
|
140
140
|
for (; t && !an(t.vnode); )
|
|
141
141
|
t = t.parent;
|
|
@@ -157,8 +157,8 @@ async function Te(e, t, n) {
|
|
|
157
157
|
let r = null;
|
|
158
158
|
const a = { ...t, callback: async (l) => {
|
|
159
159
|
if (n != null && n.onCallback) {
|
|
160
|
-
const
|
|
161
|
-
if (typeof
|
|
160
|
+
const u = n.onCallback(l);
|
|
161
|
+
if (typeof u == "object" && "then" in u && typeof u.then == "function" && await u === !1)
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
re(r), o(l);
|
|
@@ -200,7 +200,7 @@ function qo(e, t) {
|
|
|
200
200
|
});
|
|
201
201
|
return () => re(o);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const F = {
|
|
204
204
|
unhandledErrorSupportText: "please contact support",
|
|
205
205
|
errorHandler: (e) => console.error("Unhandled error:", e),
|
|
206
206
|
defaultDateFormat: "M/d/yy",
|
|
@@ -208,7 +208,7 @@ const H = {
|
|
|
208
208
|
defaultCurrencyDivisor: 1
|
|
209
209
|
};
|
|
210
210
|
function zo(e) {
|
|
211
|
-
Object.assign(
|
|
211
|
+
Object.assign(F, e);
|
|
212
212
|
}
|
|
213
213
|
class ae extends Error {
|
|
214
214
|
constructor(t) {
|
|
@@ -220,7 +220,7 @@ function dn(e) {
|
|
|
220
220
|
|
|
221
221
|
${Ce(e).message}
|
|
222
222
|
|
|
223
|
-
Please refresh the page and try again. If this error persists, ${
|
|
223
|
+
Please refresh the page and try again. If this error persists, ${F.unhandledErrorSupportText}.`;
|
|
224
224
|
}
|
|
225
225
|
function Ce(e) {
|
|
226
226
|
return fn(e) ? e : new Error(String(e));
|
|
@@ -230,7 +230,7 @@ function fn(e) {
|
|
|
230
230
|
}
|
|
231
231
|
async function Ko(e, t) {
|
|
232
232
|
const n = Ce(e);
|
|
233
|
-
return n instanceof ae ||
|
|
233
|
+
return n instanceof ae || F.errorHandler(n), cn({
|
|
234
234
|
title: t == null ? void 0 : t.title,
|
|
235
235
|
message: n,
|
|
236
236
|
classes: t == null ? void 0 : t.classes
|
|
@@ -238,7 +238,7 @@ async function Ko(e, t) {
|
|
|
238
238
|
}
|
|
239
239
|
async function Yo(e) {
|
|
240
240
|
const t = Ce(e);
|
|
241
|
-
t instanceof ae ||
|
|
241
|
+
t instanceof ae || F.errorHandler(t);
|
|
242
242
|
}
|
|
243
243
|
const Z = Symbol("MaskState");
|
|
244
244
|
function Xo(e, t) {
|
|
@@ -249,21 +249,21 @@ function Xo(e, t) {
|
|
|
249
249
|
function Zo(e) {
|
|
250
250
|
var o;
|
|
251
251
|
const t = (o = e.$) == null ? void 0 : o.vnode.el, n = t.closest(".vf-modal");
|
|
252
|
-
return
|
|
252
|
+
return st(n ?? t);
|
|
253
253
|
}
|
|
254
254
|
function vn(e, t) {
|
|
255
255
|
if (!e[Z]) {
|
|
256
256
|
const n = document.createElement("div");
|
|
257
257
|
n.classList.add("vf-mask"), e.appendChild(n), e[Z] = { maskEl: n };
|
|
258
258
|
}
|
|
259
|
-
return e[Z].maskEl.innerText = t ?? "", () =>
|
|
259
|
+
return e[Z].maskEl.innerText = t ?? "", () => st(e);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function st(e) {
|
|
262
262
|
e[Z] && e.removeChild(e[Z].maskEl);
|
|
263
263
|
}
|
|
264
264
|
const ge = Symbol("FormMaskState");
|
|
265
265
|
function mn(e, t, n) {
|
|
266
|
-
const o = e instanceof Element ? e :
|
|
266
|
+
const o = e instanceof Element ? e : rt(e);
|
|
267
267
|
if (!o) return () => {
|
|
268
268
|
};
|
|
269
269
|
o.classList.add("vf-masked");
|
|
@@ -271,19 +271,19 @@ function mn(e, t, n) {
|
|
|
271
271
|
let s;
|
|
272
272
|
r && (s = r.tagName === "INPUT" ? r.value : r.innerHTML, r.setAttribute("disabled", "disabled"), r.innerText = n ?? "Please wait...");
|
|
273
273
|
const l = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
274
|
-
return l.forEach((
|
|
274
|
+
return l.forEach((u) => u.setAttribute("disabled", "disabled")), o[ge] = {
|
|
275
275
|
disabledElements: l,
|
|
276
276
|
waitButton: r,
|
|
277
277
|
buttonHtml: s
|
|
278
|
-
}, () =>
|
|
278
|
+
}, () => it(o);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const t = e instanceof Element ? e :
|
|
280
|
+
function it(e) {
|
|
281
|
+
const t = e instanceof Element ? e : rt(e);
|
|
282
282
|
if (!t) return;
|
|
283
283
|
const n = t[ge];
|
|
284
284
|
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ge]);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function rt(e) {
|
|
287
287
|
var n;
|
|
288
288
|
const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
|
|
289
289
|
return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
|
|
@@ -306,40 +306,40 @@ const pn = ["id"], hn = {
|
|
|
306
306
|
emits: ["formSubmit"],
|
|
307
307
|
setup(e, { expose: t }) {
|
|
308
308
|
const n = we(), o = e;
|
|
309
|
-
t({ mask: v, unmask: w, hide:
|
|
310
|
-
const r = T(), s = T(), a = T(!1), l = M(() =>
|
|
309
|
+
t({ mask: v, unmask: w, hide: g, unhide: c });
|
|
310
|
+
const r = T(), s = T(), a = T(!1), l = M(() => tt([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
|
|
311
311
|
_(() => {
|
|
312
|
-
var
|
|
313
|
-
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", p), (
|
|
312
|
+
var d;
|
|
313
|
+
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", p), (d = r.value) == null || d.addEventListener("click", u));
|
|
314
314
|
}), be(() => {
|
|
315
315
|
window.removeEventListener("keydown", p), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
316
316
|
});
|
|
317
|
-
function
|
|
318
|
-
|
|
317
|
+
function u(d) {
|
|
318
|
+
d.target == r.value && E();
|
|
319
319
|
}
|
|
320
|
-
function p(
|
|
321
|
-
if (
|
|
320
|
+
function p(d) {
|
|
321
|
+
if (d.key === "Esc" || d.key === "Escape") {
|
|
322
322
|
const S = document.querySelectorAll(".vf-modal-wrap");
|
|
323
323
|
S[S.length - 1] === r.value && E();
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
function E() {
|
|
327
|
-
|
|
327
|
+
ot(n);
|
|
328
328
|
}
|
|
329
329
|
function v() {
|
|
330
330
|
return mn(s.value), () => w();
|
|
331
331
|
}
|
|
332
332
|
function w() {
|
|
333
|
-
|
|
333
|
+
it(s.value);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
return a.value = !0, () =>
|
|
335
|
+
function g() {
|
|
336
|
+
return a.value = !0, () => c();
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function c() {
|
|
339
339
|
a.value = !1;
|
|
340
340
|
}
|
|
341
|
-
return (
|
|
342
|
-
id:
|
|
341
|
+
return (d, S) => (b(), k("div", {
|
|
342
|
+
id: d.id,
|
|
343
343
|
ref_key: "overlay",
|
|
344
344
|
ref: r,
|
|
345
345
|
class: $(["vf-overlay vf-modal-wrap", l.value])
|
|
@@ -348,11 +348,11 @@ const pn = ["id"], hn = {
|
|
|
348
348
|
ref_key: "form",
|
|
349
349
|
ref: s,
|
|
350
350
|
action: ".",
|
|
351
|
-
class: $(["vf-modal", { scrolls:
|
|
352
|
-
onSubmit: S[0] || (S[0] = Ee((
|
|
351
|
+
class: $(["vf-modal", { scrolls: d.scrolls }]),
|
|
352
|
+
onSubmit: S[0] || (S[0] = Ee((O) => d.$emit("formSubmit"), ["prevent"]))
|
|
353
353
|
}, [
|
|
354
|
-
|
|
355
|
-
j(
|
|
354
|
+
d.$slots.header ? (b(), k("div", hn, [
|
|
355
|
+
j(d.$slots, "header"),
|
|
356
356
|
o.closeX ? (b(), k("i", {
|
|
357
357
|
key: 0,
|
|
358
358
|
class: "close",
|
|
@@ -360,10 +360,10 @@ const pn = ["id"], hn = {
|
|
|
360
360
|
})) : A("", !0)
|
|
361
361
|
])) : A("", !0),
|
|
362
362
|
B("div", yn, [
|
|
363
|
-
j(
|
|
363
|
+
j(d.$slots, "default")
|
|
364
364
|
]),
|
|
365
|
-
|
|
366
|
-
j(
|
|
365
|
+
d.$slots.footer ? (b(), k("div", gn, [
|
|
366
|
+
j(d.$slots, "footer")
|
|
367
367
|
])) : A("", !0)
|
|
368
368
|
], 34)
|
|
369
369
|
], 10, pn));
|
|
@@ -384,7 +384,7 @@ const pn = ["id"], hn = {
|
|
|
384
384
|
const t = e, n = M(() => t.message instanceof Error ? dn(t.message) : t.message);
|
|
385
385
|
return (o, r) => {
|
|
386
386
|
const s = Rt("autofocus");
|
|
387
|
-
return b(),
|
|
387
|
+
return b(), Je(wn, {
|
|
388
388
|
class: $(["vf-alert", ...o.classes ?? []])
|
|
389
389
|
}, Wt({
|
|
390
390
|
default: pe(() => [
|
|
@@ -459,12 +459,12 @@ var kn = {
|
|
|
459
459
|
negativePattern: "-!#",
|
|
460
460
|
format: Mn,
|
|
461
461
|
fromCents: !1
|
|
462
|
-
},
|
|
462
|
+
}, lt = function(t) {
|
|
463
463
|
return Math.round(t);
|
|
464
464
|
}, Se = function(t) {
|
|
465
465
|
return Math.pow(10, t);
|
|
466
466
|
}, Tn = function(t, n) {
|
|
467
|
-
return
|
|
467
|
+
return lt(t / n) * n;
|
|
468
468
|
}, Cn = /(\d)(?=(\d{3})+\b)/g, Sn = /(\d)(?=(\d\d)+\d\b)/g;
|
|
469
469
|
function V(e, t) {
|
|
470
470
|
var n = this;
|
|
@@ -474,7 +474,7 @@ function V(e, t) {
|
|
|
474
474
|
n.intValue = s, n.value = s / r, o.increment = o.increment || 1 / r, o.useVedic ? o.groups = Sn : o.groups = Cn, this.s = o, this.p = r;
|
|
475
475
|
}
|
|
476
476
|
function te(e, t) {
|
|
477
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, r = t.decimal, s = t.errorOnInvalid, a = t.precision, l = t.fromCents,
|
|
477
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, r = t.decimal, s = t.errorOnInvalid, a = t.precision, l = t.fromCents, u = Se(a), p = typeof e == "number", E = e instanceof V;
|
|
478
478
|
if (E && l)
|
|
479
479
|
return e.intValue;
|
|
480
480
|
if (p || E)
|
|
@@ -487,10 +487,10 @@ function te(e, t) {
|
|
|
487
487
|
throw Error("Invalid Input");
|
|
488
488
|
o = 0;
|
|
489
489
|
}
|
|
490
|
-
return l || (o *=
|
|
490
|
+
return l || (o *= u, o = o.toFixed(4)), n ? lt(o) : o;
|
|
491
491
|
}
|
|
492
492
|
function Mn(e, t) {
|
|
493
|
-
var n = t.pattern, o = t.negativePattern, r = t.symbol, s = t.separator, a = t.decimal, l = t.groups,
|
|
493
|
+
var n = t.pattern, o = t.negativePattern, r = t.symbol, s = t.separator, a = t.decimal, l = t.groups, u = ("" + e).replace(/^-/, "").split("."), p = u[0], E = u[1];
|
|
494
494
|
return (e.value >= 0 ? n : o).replace("!", r).replace("#", p.replace(l, "$1" + s) + (E ? a + E : ""));
|
|
495
495
|
}
|
|
496
496
|
V.prototype = {
|
|
@@ -537,9 +537,9 @@ V.prototype = {
|
|
|
537
537
|
* @returns {array}
|
|
538
538
|
*/
|
|
539
539
|
distribute: function(t) {
|
|
540
|
-
for (var n = this.intValue, o = this.p, r = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), l = Math.abs(n - a * t),
|
|
541
|
-
var p = V(a /
|
|
542
|
-
l-- > 0 && (p = p[n >= 0 ? "add" : "subtract"](1 /
|
|
540
|
+
for (var n = this.intValue, o = this.p, r = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), l = Math.abs(n - a * t), u = r.fromCents ? 1 : o; t !== 0; t--) {
|
|
541
|
+
var p = V(a / u, r);
|
|
542
|
+
l-- > 0 && (p = p[n >= 0 ? "add" : "subtract"](1 / u)), s.push(p);
|
|
543
543
|
}
|
|
544
544
|
return s;
|
|
545
545
|
},
|
|
@@ -599,11 +599,11 @@ function In() {
|
|
|
599
599
|
}
|
|
600
600
|
return he(xn);
|
|
601
601
|
}
|
|
602
|
-
const Fn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
602
|
+
const Fn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = { randomUUID: Fn };
|
|
603
603
|
function On(e, t, n) {
|
|
604
604
|
var r;
|
|
605
|
-
if (
|
|
606
|
-
return
|
|
605
|
+
if (je.randomUUID && !e)
|
|
606
|
+
return je.randomUUID();
|
|
607
607
|
e = e || {};
|
|
608
608
|
const o = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? In();
|
|
609
609
|
if (o.length < 16)
|
|
@@ -621,7 +621,7 @@ function Hn(e) {
|
|
|
621
621
|
return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
622
622
|
}
|
|
623
623
|
function Vn(e, t) {
|
|
624
|
-
return V(e).divide(t ??
|
|
624
|
+
return V(e).divide(t ?? F.defaultCurrencyDivisor).format();
|
|
625
625
|
}
|
|
626
626
|
function Jo() {
|
|
627
627
|
return On();
|
|
@@ -674,36 +674,36 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
674
674
|
t({
|
|
675
675
|
addRemoteOption: Dt
|
|
676
676
|
});
|
|
677
|
-
const l = T(),
|
|
678
|
-
var
|
|
679
|
-
const
|
|
680
|
-
return s.searchFields ? s.searchFields.forEach((
|
|
681
|
-
i[
|
|
682
|
-
}) : (ee.push(C),
|
|
683
|
-
key: ((
|
|
684
|
-
group:
|
|
685
|
-
title:
|
|
686
|
-
subtitle:
|
|
677
|
+
const l = T(), u = T(), p = T(), E = T(!1), v = T(!1), w = T([]), g = T(!1), c = T(""), d = T(null), S = T(null), O = T(!1), L = T(null), xe = T(!1), ht = M(() => s.showCreateTextOnNewItem ?? !0), yt = M(() => s.prependOptions ?? []), gt = M(() => s.appendOptions ?? []), Ie = M(() => !!s.disabled), wt = M(() => !v.value && s.preload ? "Loading..." : s.nullTitle ? s.nullTitle : s.placeholder || ""), Et = M(() => s.noResultsText || "No options match your search."), q = M(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), z = M(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), ce = M(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), de = M(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Fe = M(() => [...yt.value, ...w.value, ...gt.value]), Oe = M(() => !!(s.groupField || s.groupFormatter)), fe = M(() => Fe.value.map((i, m) => {
|
|
678
|
+
var _e, Ne, Re;
|
|
679
|
+
const h = (_e = ce.value) == null ? void 0 : _e.call(ce, i), f = de.value(i), y = (Ne = s.subtitleFormatter) == null ? void 0 : Ne.call(s, i), C = f ? f.trim().toLowerCase() : "", Be = y ? y.trim().toLowerCase() : "", ee = [];
|
|
680
|
+
return s.searchFields ? s.searchFields.forEach((We) => {
|
|
681
|
+
i[We] && ee.push(String(i[We]).toLowerCase());
|
|
682
|
+
}) : (ee.push(C), Be && ee.push(Be)), {
|
|
683
|
+
key: ((Re = z.value) == null ? void 0 : Re.call(z, i)) ?? String(m),
|
|
684
|
+
group: h,
|
|
685
|
+
title: f,
|
|
686
|
+
subtitle: y,
|
|
687
687
|
searchContent: ee.join(""),
|
|
688
688
|
ref: i
|
|
689
689
|
};
|
|
690
690
|
})), I = M(() => {
|
|
691
691
|
let i = [...fe.value];
|
|
692
|
-
if (
|
|
693
|
-
const m =
|
|
692
|
+
if (g.value) {
|
|
693
|
+
const m = c.value.trim().toLowerCase();
|
|
694
694
|
if (m.length) {
|
|
695
|
-
i = i.filter((
|
|
696
|
-
const
|
|
697
|
-
i = i.map((
|
|
695
|
+
i = i.filter((y) => y.searchContent.includes(m));
|
|
696
|
+
const h = Gt(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), f = new RegExp(`(${h})`, "ig");
|
|
697
|
+
i = i.map((y) => {
|
|
698
698
|
var C;
|
|
699
699
|
return {
|
|
700
|
-
...
|
|
701
|
-
title:
|
|
702
|
-
subtitle: (C =
|
|
700
|
+
...y,
|
|
701
|
+
title: y.title.replace(f, "<mark>$1</mark>"),
|
|
702
|
+
subtitle: (C = y.subtitle) == null ? void 0 : C.replace(f, "<mark>$1</mark>")
|
|
703
703
|
};
|
|
704
704
|
}), xe.value && (i.find((C) => C.searchContent === m) !== void 0 || i.push({
|
|
705
705
|
key: r,
|
|
706
|
-
title:
|
|
706
|
+
title: ht.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
|
|
707
707
|
}));
|
|
708
708
|
}
|
|
709
709
|
} else s.nullTitle && i.unshift({
|
|
@@ -712,61 +712,60 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
712
712
|
});
|
|
713
713
|
return i;
|
|
714
714
|
}), bt = M(() => {
|
|
715
|
-
|
|
716
|
-
if (!((g = I.value[0]) != null && g.group))
|
|
715
|
+
if (!Oe.value)
|
|
717
716
|
return [
|
|
718
717
|
{
|
|
719
718
|
groupTitle: "",
|
|
720
719
|
options: I.value
|
|
721
720
|
}
|
|
722
721
|
];
|
|
723
|
-
const i = Ut(I.value.map((
|
|
724
|
-
return i.map((
|
|
725
|
-
groupTitle:
|
|
726
|
-
options: m[
|
|
722
|
+
const i = Ut(I.value.map((h) => h.group ?? "")), m = Pt(I.value, (h) => h.group ?? "");
|
|
723
|
+
return i.map((h) => ({
|
|
724
|
+
groupTitle: h,
|
|
725
|
+
options: m[h]
|
|
727
726
|
}));
|
|
728
727
|
});
|
|
729
|
-
|
|
728
|
+
H(() => s.modelValue, me), H(
|
|
730
729
|
() => s.options,
|
|
731
730
|
() => {
|
|
732
731
|
w.value = s.options ?? [], v.value = !0;
|
|
733
732
|
}
|
|
734
|
-
),
|
|
735
|
-
|
|
736
|
-
}),
|
|
737
|
-
|
|
738
|
-
}),
|
|
739
|
-
|
|
740
|
-
}),
|
|
733
|
+
), H(fe, () => {
|
|
734
|
+
O.value && setTimeout(Ve, 0);
|
|
735
|
+
}), H(c, () => {
|
|
736
|
+
g.value && !s.remoteSearch && !c.value.trim().length && (g.value = !1);
|
|
737
|
+
}), H(O, () => {
|
|
738
|
+
O.value ? setTimeout(It, 0) : (g.value = !1, c.value = S.value || "", p.value && (p.value.style.visibility = "hidden"));
|
|
739
|
+
}), H(I, () => {
|
|
741
740
|
var i;
|
|
742
|
-
s.modelValue && !
|
|
741
|
+
s.modelValue && !d.value && me(), (L.value || g.value) && !I.value.find((m) => m.key == L.value) && (L.value = ((i = I.value[0]) == null ? void 0 : i.key) ?? o);
|
|
743
742
|
}), _(async () => {
|
|
744
|
-
xe.value = s.onCreateItem !== void 0, s.options ? (w.value = [...s.options], v.value = !0) : s.preload && await
|
|
745
|
-
|
|
743
|
+
xe.value = s.onCreateItem !== void 0, s.options ? (w.value = [...s.options], v.value = !0) : s.preload && await De(), me(), H(d, () => {
|
|
744
|
+
d.value !== s.modelValue && a(
|
|
746
745
|
"update:modelValue",
|
|
747
|
-
|
|
746
|
+
d.value && q.value ? q.value(d.value) : d.value
|
|
748
747
|
);
|
|
749
|
-
}), s.remoteSearch &&
|
|
748
|
+
}), s.remoteSearch && H(c, qt(kt, 250));
|
|
750
749
|
});
|
|
751
|
-
async function Oe() {
|
|
752
|
-
await De(), w.value && a("optionsLoaded", w.value);
|
|
753
|
-
}
|
|
754
750
|
async function De() {
|
|
751
|
+
await He(), w.value && a("optionsLoaded", w.value);
|
|
752
|
+
}
|
|
753
|
+
async function He() {
|
|
755
754
|
var m;
|
|
756
|
-
const i = s.remoteSearch &&
|
|
755
|
+
const i = s.remoteSearch && g.value && c.value ? c.value : null;
|
|
757
756
|
E.value = !0, w.value = await ((m = s.loadOptions) == null ? void 0 : m.call(s, i)) ?? [], E.value = !1, v.value = !0;
|
|
758
757
|
}
|
|
759
758
|
function kt() {
|
|
760
|
-
|
|
759
|
+
g.value && (He(), g.value = c.value.trim().length > 0);
|
|
761
760
|
}
|
|
762
761
|
function Tt(i) {
|
|
763
762
|
if (i.key == "Escape") {
|
|
764
|
-
i.stopPropagation(), i.target.blur(),
|
|
763
|
+
i.stopPropagation(), i.target.blur(), $e();
|
|
765
764
|
return;
|
|
766
765
|
}
|
|
767
766
|
if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
|
|
768
767
|
if (!v.value) {
|
|
769
|
-
|
|
768
|
+
g.value || i.preventDefault();
|
|
770
769
|
return;
|
|
771
770
|
}
|
|
772
771
|
if (i.key == "ArrowUp" || i.key == "ArrowDown")
|
|
@@ -777,113 +776,113 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
777
776
|
return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
778
777
|
if (i.key == "Enter") {
|
|
779
778
|
i.preventDefault();
|
|
780
|
-
const m = I.value.find((
|
|
781
|
-
if (m) return
|
|
779
|
+
const m = I.value.find((h) => h.key == L.value);
|
|
780
|
+
if (m) return Ae(m);
|
|
782
781
|
}
|
|
783
782
|
if (i.key === "Delete" || i.key === "Backspace") {
|
|
784
|
-
|
|
783
|
+
c.value.length > 1 && (g.value = !0);
|
|
785
784
|
return;
|
|
786
785
|
}
|
|
787
|
-
!i.metaKey && jn.includes(i.key) && (
|
|
786
|
+
!i.metaKey && jn.includes(i.key) && (g.value = !0);
|
|
788
787
|
}
|
|
789
788
|
}
|
|
790
789
|
function Ct() {
|
|
791
|
-
St(),
|
|
790
|
+
St(), O.value = !0, setTimeout(() => {
|
|
792
791
|
var i;
|
|
793
|
-
return (i =
|
|
792
|
+
return (i = u.value) == null ? void 0 : i.select();
|
|
794
793
|
}, 0);
|
|
795
794
|
}
|
|
796
795
|
function St(i) {
|
|
797
|
-
|
|
796
|
+
d.value ? L.value = Mt(d.value) : s.nullTitle && (L.value = o);
|
|
798
797
|
}
|
|
799
798
|
function Mt(i) {
|
|
800
799
|
var m;
|
|
801
|
-
return z.value ? z.value(
|
|
800
|
+
return z.value ? z.value(d.value) : ((m = Lt(i)) == null ? void 0 : m.key) ?? "";
|
|
802
801
|
}
|
|
803
802
|
function Lt(i) {
|
|
804
|
-
const m = I.value.find((
|
|
803
|
+
const m = I.value.find((y) => y.ref === i);
|
|
805
804
|
if (m)
|
|
806
805
|
return m;
|
|
807
|
-
const
|
|
808
|
-
return
|
|
806
|
+
const h = s.keyExtractor ? (y, C) => s.keyExtractor(y) === s.keyExtractor(C) : nt, f = I.value.find((y) => h(y.ref, i));
|
|
807
|
+
return f || null;
|
|
809
808
|
}
|
|
810
809
|
function xt() {
|
|
811
|
-
s.debug || (!
|
|
810
|
+
s.debug || (!c.value.length && s.nullTitle && (d.value = null, S.value = null), O.value = !1);
|
|
812
811
|
}
|
|
813
812
|
function It() {
|
|
814
813
|
var i;
|
|
815
|
-
v.value ||
|
|
814
|
+
v.value || De(), s.optionsListId && ((i = p.value) == null || i.setAttribute("id", s.optionsListId)), Ft();
|
|
816
815
|
}
|
|
817
816
|
function Ft() {
|
|
818
|
-
const i = l.value.getBoundingClientRect(), m = i.y + i.height + 2,
|
|
819
|
-
for (let C in
|
|
820
|
-
/^(font|text)/.test(C) && (
|
|
821
|
-
if (
|
|
817
|
+
const i = l.value.getBoundingClientRect(), m = i.y + i.height + 2, h = i.x, f = p.value, y = window.getComputedStyle(l.value);
|
|
818
|
+
for (let C in y)
|
|
819
|
+
/^(font|text)/.test(C) && (f.style[C] = y[C]);
|
|
820
|
+
if (f.style.top = m + "px", f.style.left = h + "px", f.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
|
|
822
821
|
const C = window.innerHeight - m - 12;
|
|
823
|
-
|
|
822
|
+
f.style.maxHeight = C + "px";
|
|
824
823
|
}
|
|
825
|
-
|
|
824
|
+
f.style.visibility = "visible", document.body.appendChild(f), setTimeout(Ve, 0);
|
|
826
825
|
}
|
|
827
|
-
function
|
|
826
|
+
function Ve() {
|
|
828
827
|
if (!v.value || !L.value) return;
|
|
829
|
-
const i = I.value.findIndex((
|
|
830
|
-
|
|
828
|
+
const i = I.value.findIndex((f) => f.key == L.value), m = p.value, h = m == null ? void 0 : m.querySelectorAll(".option")[i];
|
|
829
|
+
h && (m.scrollTop = h.offsetTop);
|
|
831
830
|
}
|
|
832
831
|
function Ot(i) {
|
|
833
832
|
L.value = i ? i.key : null;
|
|
834
833
|
}
|
|
835
834
|
function ve(i) {
|
|
836
835
|
const m = I.value.findIndex((C) => C.key == L.value);
|
|
837
|
-
let
|
|
838
|
-
if (
|
|
839
|
-
L.value = I.value[
|
|
840
|
-
const
|
|
841
|
-
|
|
836
|
+
let h = m + i;
|
|
837
|
+
if (h < 0 ? h = 0 : h >= I.value.length && (h = I.value.length - 1), m == h) return;
|
|
838
|
+
L.value = I.value[h].key;
|
|
839
|
+
const f = p.value, y = f == null ? void 0 : f.querySelectorAll(".option")[h];
|
|
840
|
+
y && (y.offsetTop < f.scrollTop ? f.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > f.scrollTop + f.clientHeight && (f.scrollTop = y.offsetTop + y.offsetHeight - f.clientHeight));
|
|
842
841
|
}
|
|
843
|
-
function
|
|
844
|
-
var m,
|
|
845
|
-
if (
|
|
846
|
-
|
|
842
|
+
function Ae(i) {
|
|
843
|
+
var m, h;
|
|
844
|
+
if (g.value = !1, i.key == o)
|
|
845
|
+
c.value = "", d.value = null, S.value = null;
|
|
847
846
|
else if (i.key === r) {
|
|
848
|
-
const
|
|
849
|
-
|
|
847
|
+
const f = c.value.trim();
|
|
848
|
+
c.value = "", d.value = null, S.value = null, (m = s.onCreateItem) == null || m.call(s, f);
|
|
850
849
|
} else {
|
|
851
|
-
const
|
|
852
|
-
|
|
850
|
+
const y = fe.value.find((C) => C.key == i.key).ref;
|
|
851
|
+
d.value = y, S.value = de.value(y), c.value = S.value || "";
|
|
853
852
|
}
|
|
854
|
-
(
|
|
853
|
+
(h = u.value) == null || h.blur(), $e();
|
|
855
854
|
}
|
|
856
855
|
function me() {
|
|
857
|
-
s.modelValue ? (
|
|
856
|
+
s.modelValue ? (d.value = q.value ? Fe.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, S.value = d.value ? de.value(d.value) : null, c.value = S.value || "") : (d.value = null, S.value = null, c.value = "");
|
|
858
857
|
}
|
|
859
858
|
function Dt(i) {
|
|
860
859
|
w.value.unshift(i);
|
|
861
860
|
}
|
|
862
|
-
function
|
|
863
|
-
var
|
|
861
|
+
function $e() {
|
|
862
|
+
var y;
|
|
864
863
|
if (!s.autoNext) return;
|
|
865
|
-
let i = (
|
|
864
|
+
let i = (y = l.value) == null ? void 0 : y.parentElement;
|
|
866
865
|
for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
|
|
867
866
|
i = i.parentElement;
|
|
868
867
|
if (!i) return;
|
|
869
868
|
const m = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
870
869
|
if (!m) return;
|
|
871
|
-
const
|
|
872
|
-
|
|
870
|
+
const h = Array.from(m).findIndex((C) => C === u.value), f = m[h + 1];
|
|
871
|
+
f && setTimeout(() => f.focus(), 0);
|
|
873
872
|
}
|
|
874
873
|
return (i, m) => (b(), k("div", {
|
|
875
874
|
ref_key: "el",
|
|
876
875
|
ref: l,
|
|
877
|
-
class: $(["vf-smart-select", { disabled: Ie.value, open:
|
|
876
|
+
class: $(["vf-smart-select", { disabled: Ie.value, open: O.value }])
|
|
878
877
|
}, [
|
|
879
878
|
ne(B("input", {
|
|
880
879
|
ref_key: "searchField",
|
|
881
|
-
ref:
|
|
882
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
880
|
+
ref: u,
|
|
881
|
+
"onUpdate:modelValue": m[0] || (m[0] = (h) => c.value = h),
|
|
883
882
|
type: "text",
|
|
884
883
|
disabled: Ie.value,
|
|
885
884
|
class: $({ nullable: !!i.nullTitle }),
|
|
886
|
-
placeholder:
|
|
885
|
+
placeholder: wt.value,
|
|
887
886
|
required: i.required,
|
|
888
887
|
name: i.name,
|
|
889
888
|
"data-1p-ignore": "",
|
|
@@ -891,49 +890,49 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
891
890
|
onFocus: Ct,
|
|
892
891
|
onBlur: xt
|
|
893
892
|
}, null, 42, An), [
|
|
894
|
-
[jt,
|
|
893
|
+
[jt, c.value]
|
|
895
894
|
]),
|
|
896
|
-
|
|
895
|
+
O.value ? (b(), k("div", {
|
|
897
896
|
key: 0,
|
|
898
897
|
ref_key: "optionsContainer",
|
|
899
898
|
ref: p,
|
|
900
|
-
class: $(["vf-smart-select-options", { grouped:
|
|
899
|
+
class: $(["vf-smart-select-options", { grouped: Oe.value }])
|
|
901
900
|
}, [
|
|
902
|
-
v.value ? (b(!0), k(oe, { key: 1 }, se(bt.value, (
|
|
903
|
-
key:
|
|
901
|
+
v.value ? (b(!0), k(oe, { key: 1 }, se(bt.value, (h) => (b(), k("div", {
|
|
902
|
+
key: h.groupTitle,
|
|
904
903
|
class: "group"
|
|
905
904
|
}, [
|
|
906
|
-
|
|
905
|
+
h.groupTitle ? (b(), k("div", Bn, [
|
|
907
906
|
j(i.$slots, "group", {
|
|
908
|
-
group:
|
|
907
|
+
group: h.groupTitle
|
|
909
908
|
}, () => [
|
|
910
|
-
X(W(
|
|
909
|
+
X(W(h.groupTitle), 1)
|
|
911
910
|
])
|
|
912
911
|
])) : A("", !0),
|
|
913
|
-
(b(!0), k(oe, null, se(
|
|
914
|
-
var
|
|
912
|
+
(b(!0), k(oe, null, se(h.options, (f) => {
|
|
913
|
+
var y;
|
|
915
914
|
return b(), k("div", {
|
|
916
|
-
key:
|
|
917
|
-
class: $(["option", [L.value ===
|
|
918
|
-
onMousemove: (C) => Ot(
|
|
919
|
-
onMousedown: (C) =>
|
|
915
|
+
key: f.key,
|
|
916
|
+
class: $(["option", [L.value === f.key && "highlighted", f.ref && ((y = i.classForOption) == null ? void 0 : y.call(i, f.ref))]]),
|
|
917
|
+
onMousemove: (C) => Ot(f),
|
|
918
|
+
onMousedown: (C) => Ae(f)
|
|
920
919
|
}, [
|
|
921
|
-
j(i.$slots, "option", { option:
|
|
920
|
+
j(i.$slots, "option", { option: f }, () => [
|
|
922
921
|
B("div", {
|
|
923
922
|
class: "title",
|
|
924
|
-
innerHTML:
|
|
923
|
+
innerHTML: f.title
|
|
925
924
|
}, null, 8, Nn),
|
|
926
|
-
|
|
925
|
+
f.subtitle ? (b(), k("div", {
|
|
927
926
|
key: 0,
|
|
928
927
|
class: "subtitle",
|
|
929
|
-
innerHTML:
|
|
928
|
+
innerHTML: f.subtitle
|
|
930
929
|
}, null, 8, Rn)) : A("", !0)
|
|
931
930
|
])
|
|
932
931
|
], 42, _n);
|
|
933
932
|
}), 128)),
|
|
934
|
-
!I.value.length &&
|
|
933
|
+
!I.value.length && c.value ? (b(), k("div", Wn, [
|
|
935
934
|
j(i.$slots, "no-results", {}, () => [
|
|
936
|
-
X(W(
|
|
935
|
+
X(W(Et.value), 1)
|
|
937
936
|
])
|
|
938
937
|
])) : A("", !0)
|
|
939
938
|
]))), 128)) : (b(), k("div", $n, "Loading..."))
|
|
@@ -952,22 +951,22 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
952
951
|
},
|
|
953
952
|
emits: ["update:modelValue"],
|
|
954
953
|
setup(e, { emit: t }) {
|
|
955
|
-
const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: String(l) })) : Object.entries(n.options).map(([l,
|
|
954
|
+
const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: String(l) })) : Object.entries(n.options).map(([l, u]) => ({
|
|
956
955
|
value: l,
|
|
957
|
-
label:
|
|
956
|
+
label: u
|
|
958
957
|
}))), r = M(() => n.formatter ? (l) => n.formatter(l.label, l.value) : (l) => l.label), s = t, a = T(o.value.find((l) => l.value === n.modelValue) ?? null);
|
|
959
|
-
return
|
|
958
|
+
return H(
|
|
960
959
|
() => n.modelValue,
|
|
961
960
|
(l) => {
|
|
962
|
-
a.value = o.value.find((
|
|
961
|
+
a.value = o.value.find((u) => u.value === l) ?? null;
|
|
963
962
|
}
|
|
964
|
-
),
|
|
963
|
+
), H(a, (l) => {
|
|
965
964
|
var p;
|
|
966
|
-
const
|
|
967
|
-
s("update:modelValue",
|
|
968
|
-
}), (l,
|
|
965
|
+
const u = l ? (p = o.value.find((E) => nt(E, l))) == null ? void 0 : p.value : null;
|
|
966
|
+
s("update:modelValue", u ?? null);
|
|
967
|
+
}), (l, u) => (b(), Je(Un, {
|
|
969
968
|
modelValue: a.value,
|
|
970
|
-
"onUpdate:modelValue":
|
|
969
|
+
"onUpdate:modelValue": u[0] || (u[0] = (p) => a.value = p),
|
|
971
970
|
options: o.value,
|
|
972
971
|
formatter: r.value,
|
|
973
972
|
"null-title": l.nullTitle,
|
|
@@ -1052,14 +1051,14 @@ function Qn(e) {
|
|
|
1052
1051
|
function eo(e) {
|
|
1053
1052
|
return e ? Kt(e) : null;
|
|
1054
1053
|
}
|
|
1055
|
-
function
|
|
1054
|
+
function at(e) {
|
|
1056
1055
|
return e ? zt(e) : null;
|
|
1057
1056
|
}
|
|
1058
1057
|
function to(e) {
|
|
1059
1058
|
return e ? e.toUpperCase() : null;
|
|
1060
1059
|
}
|
|
1061
1060
|
function no(e) {
|
|
1062
|
-
return e ?
|
|
1061
|
+
return e ? at(e.toLowerCase()) : null;
|
|
1063
1062
|
}
|
|
1064
1063
|
function oo(e) {
|
|
1065
1064
|
return e ? Dn(e) : null;
|
|
@@ -1071,25 +1070,25 @@ function io(e, t) {
|
|
|
1071
1070
|
return V(e).divide(t).value;
|
|
1072
1071
|
}
|
|
1073
1072
|
function ro(e, t) {
|
|
1074
|
-
return e && P(new Date(e), t ??
|
|
1073
|
+
return e && P(new Date(e), t ?? F.defaultDateFormat);
|
|
1075
1074
|
}
|
|
1076
1075
|
function lo(e, t) {
|
|
1077
|
-
return e && P(new Date(e), t ??
|
|
1076
|
+
return e && P(new Date(e), t ?? F.defaultTimeFormat);
|
|
1078
1077
|
}
|
|
1079
1078
|
function ao(e, t) {
|
|
1080
|
-
return e && P(new Date(e), t ??
|
|
1079
|
+
return e && P(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1081
1080
|
}
|
|
1082
1081
|
function uo(e) {
|
|
1083
|
-
return e && P(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1),
|
|
1082
|
+
return e && P(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
|
|
1084
1083
|
}
|
|
1085
|
-
const
|
|
1084
|
+
const Ue = {
|
|
1086
1085
|
bytes: Xn,
|
|
1087
1086
|
dash: Zn,
|
|
1088
1087
|
dashZeros: Gn,
|
|
1089
1088
|
number: Jn,
|
|
1090
1089
|
phone: Qn,
|
|
1091
1090
|
upperFirst: eo,
|
|
1092
|
-
startCase:
|
|
1091
|
+
startCase: at,
|
|
1093
1092
|
upperCase: to,
|
|
1094
1093
|
upperWords: no,
|
|
1095
1094
|
desnake: oo,
|
|
@@ -1100,8 +1099,8 @@ const je = {
|
|
|
1100
1099
|
dateTime: ao,
|
|
1101
1100
|
oneDayForward: uo
|
|
1102
1101
|
}, ns = (e) => ({
|
|
1103
|
-
...
|
|
1104
|
-
...e(
|
|
1102
|
+
...Ue,
|
|
1103
|
+
...e(Ue)
|
|
1105
1104
|
});
|
|
1106
1105
|
function os(e, t, n) {
|
|
1107
1106
|
const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
@@ -1113,31 +1112,31 @@ function ss(e, t) {
|
|
|
1113
1112
|
const o = document.createElement("div");
|
|
1114
1113
|
o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
|
|
1115
1114
|
const r = e.currentTarget;
|
|
1116
|
-
r.style.userSelect = "none", r.classList.add("context-menu-active"), t.targetClass && r.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((
|
|
1117
|
-
if (
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1115
|
+
r.style.userSelect = "none", r.classList.add("context-menu-active"), t.targetClass && r.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((g) => {
|
|
1116
|
+
if (g == "-") {
|
|
1117
|
+
const d = document.createElement("div");
|
|
1118
|
+
d.classList.add("separator"), o.appendChild(d);
|
|
1120
1119
|
return;
|
|
1121
1120
|
}
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1121
|
+
const c = document.createElement("div");
|
|
1122
|
+
c.classList.add("item"), c.style.userSelect = "none", c.innerText = g.title, o.appendChild(c), g.class && c.classList.add(g.class), g.shouldConfirm ? c.addEventListener("click", (d) => w(d, c, g.handler)) : c.addEventListener("click", () => g.handler());
|
|
1124
1123
|
});
|
|
1125
|
-
const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, l = o.offsetHeight,
|
|
1124
|
+
const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, l = o.offsetHeight, u = o.offsetWidth, p = s < u ? e.clientX - u - 1 : e.clientX + 1, E = a < l ? e.clientY - l - 1 : e.clientY + 1;
|
|
1126
1125
|
o.style.left = p + "px", o.style.top = E + "px", setTimeout(() => {
|
|
1127
1126
|
o.style.width = o.offsetWidth + "px";
|
|
1128
1127
|
}, 50);
|
|
1129
1128
|
function v() {
|
|
1130
1129
|
t.targetClass && r.classList.remove(t.targetClass), r.classList.remove("context-menu-active"), r.style.userSelect = "", n.remove();
|
|
1131
1130
|
}
|
|
1132
|
-
function w(
|
|
1133
|
-
if (
|
|
1134
|
-
return
|
|
1135
|
-
const S =
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1131
|
+
function w(g, c, d) {
|
|
1132
|
+
if (c.classList.contains("pending-confirm"))
|
|
1133
|
+
return d();
|
|
1134
|
+
const S = c.innerHTML;
|
|
1135
|
+
c.classList.add("pending-confirm"), c.innerText = "Confirm";
|
|
1136
|
+
const O = () => {
|
|
1137
|
+
c.classList.remove("pending-confirm"), c.innerHTML = S, c.removeEventListener("mouseleave", O);
|
|
1139
1138
|
};
|
|
1140
|
-
|
|
1139
|
+
c.addEventListener("mouseleave", O), g.stopPropagation();
|
|
1141
1140
|
}
|
|
1142
1141
|
}
|
|
1143
1142
|
const co = (e) => new Promise((t) => setTimeout(t, e)), is = (e) => co(e * 1e3);
|
|
@@ -1167,12 +1166,12 @@ function as(e, t) {
|
|
|
1167
1166
|
const Me = Symbol("HookState");
|
|
1168
1167
|
function us(e, t) {
|
|
1169
1168
|
const n = t ?? we();
|
|
1170
|
-
_(() => vo(n, e), n),
|
|
1169
|
+
_(() => vo(n, e), n), Qe(() => mo(n), n), et(() => Pe(n), n), be(() => Pe(n), n);
|
|
1171
1170
|
}
|
|
1172
1171
|
function vo(e, t) {
|
|
1173
1172
|
const n = {};
|
|
1174
1173
|
if (t.elScrolledToBottom && (n.el = new G(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1175
|
-
const o =
|
|
1174
|
+
const o = ut(e.vnode.el);
|
|
1176
1175
|
o ? n.ancestor = new G(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
1177
1176
|
}
|
|
1178
1177
|
t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[Me] = n;
|
|
@@ -1182,22 +1181,22 @@ function mo(e) {
|
|
|
1182
1181
|
const t = e[Me];
|
|
1183
1182
|
(n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (r = t == null ? void 0 : t.window) == null || r.install();
|
|
1184
1183
|
}
|
|
1185
|
-
function
|
|
1184
|
+
function Pe(e) {
|
|
1186
1185
|
var n, o, r;
|
|
1187
1186
|
const t = e[Me];
|
|
1188
1187
|
(n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (r = t == null ? void 0 : t.window) == null || r.uninstall();
|
|
1189
1188
|
}
|
|
1190
1189
|
const ye = ["auto", "scroll"];
|
|
1191
|
-
function
|
|
1190
|
+
function ut(e) {
|
|
1192
1191
|
const t = e.parentElement;
|
|
1193
1192
|
if (!t) return null;
|
|
1194
1193
|
const n = window.getComputedStyle(t);
|
|
1195
|
-
return ye.includes(n.overflow) || ye.includes(n.overflowX) || ye.includes(n.overflowY) ? t :
|
|
1194
|
+
return ye.includes(n.overflow) || ye.includes(n.overflowX) || ye.includes(n.overflowY) ? t : ut(t);
|
|
1196
1195
|
}
|
|
1197
1196
|
class G {
|
|
1198
1197
|
constructor(t, n) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1198
|
+
D(this, "isTripped", !1);
|
|
1199
|
+
D(this, "onScrollWithContext", this.onScroll.bind(this));
|
|
1201
1200
|
this.el = t, this.handler = n, this.install();
|
|
1202
1201
|
}
|
|
1203
1202
|
install() {
|
|
@@ -1211,15 +1210,15 @@ class G {
|
|
|
1211
1210
|
}
|
|
1212
1211
|
}
|
|
1213
1212
|
function cs(e) {
|
|
1214
|
-
_(() => window.addEventListener("resize", e)),
|
|
1213
|
+
_(() => window.addEventListener("resize", e)), Qe(() => window.addEventListener("resize", e)), et(() => window.removeEventListener("resize", e)), be(() => window.removeEventListener("resize", e));
|
|
1215
1214
|
}
|
|
1216
1215
|
const po = {
|
|
1217
|
-
mounted:
|
|
1218
|
-
updated:
|
|
1219
|
-
},
|
|
1220
|
-
function
|
|
1221
|
-
if (t.value === void 0 && e[
|
|
1222
|
-
e[
|
|
1216
|
+
mounted: ze,
|
|
1217
|
+
updated: ze
|
|
1218
|
+
}, qe = Symbol("HasAutoFocused");
|
|
1219
|
+
function ze(e, t) {
|
|
1220
|
+
if (t.value === void 0 && e[qe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
|
|
1221
|
+
e[qe] = !0;
|
|
1223
1222
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1224
1223
|
setTimeout(() => n.focus(), 10);
|
|
1225
1224
|
}
|
|
@@ -1241,8 +1240,8 @@ function yo(e, t) {
|
|
|
1241
1240
|
initTime: o,
|
|
1242
1241
|
preconfirmHtml: e.innerHTML,
|
|
1243
1242
|
resetHandler: () => {
|
|
1244
|
-
var
|
|
1245
|
-
r && (e.innerHTML = s.preconfirmHtml), (
|
|
1243
|
+
var u;
|
|
1244
|
+
r && (e.innerHTML = s.preconfirmHtml), (u = t.value) != null && u.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
|
|
1246
1245
|
}
|
|
1247
1246
|
};
|
|
1248
1247
|
e[K] = s, r && (e.innerHTML = r), (l = t.value) != null && l.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
|
|
@@ -1260,10 +1259,10 @@ function wo(e) {
|
|
|
1260
1259
|
});
|
|
1261
1260
|
}
|
|
1262
1261
|
const Eo = {
|
|
1263
|
-
beforeMount:
|
|
1264
|
-
updated:
|
|
1262
|
+
beforeMount: Ke,
|
|
1263
|
+
updated: Ke
|
|
1265
1264
|
};
|
|
1266
|
-
function
|
|
1265
|
+
function Ke(e, t) {
|
|
1267
1266
|
t.value == t.oldValue && e.innerHTML.length || (e.innerText = bo(e, t));
|
|
1268
1267
|
}
|
|
1269
1268
|
function bo(e, t) {
|
|
@@ -1283,48 +1282,48 @@ function bo(e, t) {
|
|
|
1283
1282
|
let v = null;
|
|
1284
1283
|
const w = /* @__PURE__ */ new Date();
|
|
1285
1284
|
w.getFullYear() === s.getFullYear() ? (w.getMonth() !== s.getMonth() || w.getDate() !== s.getDate()) && (v = "M/d") : v = "M/d/yy";
|
|
1286
|
-
const
|
|
1287
|
-
a =
|
|
1285
|
+
const g = l ? null : F.defaultTimeFormat;
|
|
1286
|
+
a = tt([v, g]).join(" ");
|
|
1288
1287
|
}
|
|
1289
|
-
a || (l ? a =
|
|
1290
|
-
let
|
|
1291
|
-
return n && (
|
|
1288
|
+
a || (l ? a = F.defaultDateFormat : a = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1289
|
+
let u = P(s, a);
|
|
1290
|
+
return n && (u = n + " " + u), u;
|
|
1292
1291
|
}
|
|
1293
1292
|
const ko = {
|
|
1294
|
-
beforeMount:
|
|
1295
|
-
updated:
|
|
1293
|
+
beforeMount: Ye,
|
|
1294
|
+
updated: Ye,
|
|
1296
1295
|
unmounted: To
|
|
1297
1296
|
};
|
|
1298
|
-
function
|
|
1297
|
+
function Ye(e, t) {
|
|
1299
1298
|
e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
|
|
1300
1299
|
}
|
|
1301
1300
|
function To(e) {
|
|
1302
1301
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1303
1302
|
}
|
|
1304
1303
|
const Co = {
|
|
1305
|
-
beforeMount:
|
|
1306
|
-
updated:
|
|
1307
|
-
unmounted:
|
|
1304
|
+
beforeMount: Xe,
|
|
1305
|
+
updated: Xe,
|
|
1306
|
+
unmounted: dt
|
|
1308
1307
|
}, Q = Symbol("HasAutoFocused"), Le = [];
|
|
1309
1308
|
function So() {
|
|
1310
|
-
Le.forEach(
|
|
1309
|
+
Le.forEach(ct);
|
|
1311
1310
|
}
|
|
1312
1311
|
setInterval(So, 1e3);
|
|
1313
|
-
function
|
|
1312
|
+
function Xe(e, t) {
|
|
1314
1313
|
var a;
|
|
1315
1314
|
if (t.value == t.oldValue) return;
|
|
1316
|
-
if (!t.value) return
|
|
1315
|
+
if (!t.value) return dt(e);
|
|
1317
1316
|
const n = new Date(t.value), o = (a = e.attributes.getNamedItem("base-time")) == null ? void 0 : a.value, r = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
|
|
1318
1317
|
e[Q] || Le.push(e), e[Q] = {
|
|
1319
1318
|
startTs: r,
|
|
1320
1319
|
includeSeconds: s
|
|
1321
|
-
},
|
|
1320
|
+
}, ct(e);
|
|
1322
1321
|
}
|
|
1323
|
-
function
|
|
1322
|
+
function ct(e) {
|
|
1324
1323
|
const t = e[Q], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1325
1324
|
e.innerText = Mo(n, t.includeSeconds);
|
|
1326
1325
|
}
|
|
1327
|
-
function
|
|
1326
|
+
function dt(e) {
|
|
1328
1327
|
e[Q] && (Xt(Le, e), delete e[Q]), e.innerText = "-";
|
|
1329
1328
|
}
|
|
1330
1329
|
function Mo(e, t) {
|
|
@@ -1336,25 +1335,25 @@ function Mo(e, t) {
|
|
|
1336
1335
|
return (o || r || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
|
|
1337
1336
|
}
|
|
1338
1337
|
const Lo = {
|
|
1339
|
-
mounted:
|
|
1338
|
+
mounted: ft,
|
|
1340
1339
|
updated: xo,
|
|
1341
|
-
unmounted:
|
|
1340
|
+
unmounted: vt
|
|
1342
1341
|
}, U = /* @__PURE__ */ new Map();
|
|
1343
|
-
function dt(e, t) {
|
|
1344
|
-
U.size === 0 && window.addEventListener("keydown", vt), U.set(t.value.toLowerCase(), [...U.get(t.value.toLowerCase()) ?? [], e]);
|
|
1345
|
-
}
|
|
1346
1342
|
function ft(e, t) {
|
|
1343
|
+
U.size === 0 && window.addEventListener("keydown", mt), U.set(t.value.toLowerCase(), [...U.get(t.value.toLowerCase()) ?? [], e]);
|
|
1344
|
+
}
|
|
1345
|
+
function vt(e, t) {
|
|
1347
1346
|
const n = U.get(t.value.toLowerCase());
|
|
1348
1347
|
if (n) {
|
|
1349
1348
|
const o = n.indexOf(e);
|
|
1350
1349
|
o !== -1 && n.splice(o, 1), n.length === 0 && U.delete(t.value.toLowerCase());
|
|
1351
1350
|
}
|
|
1352
|
-
U.size === 0 && window.removeEventListener("keydown",
|
|
1351
|
+
U.size === 0 && window.removeEventListener("keydown", mt);
|
|
1353
1352
|
}
|
|
1354
1353
|
function xo(e, t) {
|
|
1355
|
-
|
|
1354
|
+
vt(e, t), ft(e, t);
|
|
1356
1355
|
}
|
|
1357
|
-
function
|
|
1356
|
+
function mt(e) {
|
|
1358
1357
|
if (typeof e.key != "string") return;
|
|
1359
1358
|
const t = e.key.toLowerCase(), n = U.get(t);
|
|
1360
1359
|
if (n) {
|
|
@@ -1375,18 +1374,18 @@ const Y = Symbol("InfiniteScrollHandler"), Io = {
|
|
|
1375
1374
|
(t = e[Y]) == null || t.uninstall(), delete e[Y];
|
|
1376
1375
|
}
|
|
1377
1376
|
}, Fo = {
|
|
1378
|
-
beforeMount:
|
|
1379
|
-
updated:
|
|
1377
|
+
beforeMount: Ze,
|
|
1378
|
+
updated: Ze
|
|
1380
1379
|
};
|
|
1381
|
-
function
|
|
1380
|
+
function Ze(e, t) {
|
|
1382
1381
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1383
1382
|
}
|
|
1384
1383
|
const Oo = {
|
|
1385
|
-
mounted:
|
|
1386
|
-
updated:
|
|
1387
|
-
unmounted:
|
|
1384
|
+
mounted: Ge,
|
|
1385
|
+
updated: Ge,
|
|
1386
|
+
unmounted: pt
|
|
1388
1387
|
}, J = Symbol("TooltipState");
|
|
1389
|
-
function
|
|
1388
|
+
function Ge(e, t) {
|
|
1390
1389
|
var o;
|
|
1391
1390
|
let n = ((o = e.attributes.getNamedItem("tip")) == null ? void 0 : o.value) ?? t.value;
|
|
1392
1391
|
if (t.value || (n = null), n) {
|
|
@@ -1396,24 +1395,24 @@ function Ze(e, t) {
|
|
|
1396
1395
|
};
|
|
1397
1396
|
e[J] ? e[J].configure(r) : e[J] = new Do(e, r);
|
|
1398
1397
|
} else
|
|
1399
|
-
|
|
1398
|
+
pt(e);
|
|
1400
1399
|
}
|
|
1401
|
-
function
|
|
1400
|
+
function pt(e) {
|
|
1402
1401
|
var t;
|
|
1403
1402
|
(t = e[J]) == null || t.destroy(), delete e[J];
|
|
1404
1403
|
}
|
|
1405
1404
|
class Do {
|
|
1406
1405
|
constructor(t, n) {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1406
|
+
D(this, "lastMoveEvt");
|
|
1407
|
+
D(this, "checkInterval");
|
|
1408
|
+
D(this, "shouldShow", !1);
|
|
1409
|
+
D(this, "tipEl");
|
|
1410
|
+
D(this, "titleEl");
|
|
1411
|
+
D(this, "contentEl");
|
|
1412
|
+
D(this, "mouseMoveBound", !1);
|
|
1413
|
+
D(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
|
|
1414
|
+
D(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
|
|
1415
|
+
D(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
|
|
1417
1416
|
this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1418
1417
|
}
|
|
1419
1418
|
configure(t) {
|
|
@@ -1472,7 +1471,7 @@ export {
|
|
|
1472
1471
|
Dn as desnakeCase,
|
|
1473
1472
|
un as dismissOverlayInjectionById,
|
|
1474
1473
|
jo as dismissOverlayInjectionByInstance,
|
|
1475
|
-
|
|
1474
|
+
ot as dismissOverlayInjectionByInternalInstance,
|
|
1476
1475
|
an as dismissOverlayInjectionByVnode,
|
|
1477
1476
|
ms as escapeHtml,
|
|
1478
1477
|
dn as formatError,
|
|
@@ -1501,8 +1500,8 @@ export {
|
|
|
1501
1500
|
is as sleepSecs,
|
|
1502
1501
|
Ce as toError,
|
|
1503
1502
|
Zo as unmaskComponent,
|
|
1504
|
-
|
|
1505
|
-
|
|
1503
|
+
st as unmaskEl,
|
|
1504
|
+
it as unmaskForm,
|
|
1506
1505
|
us as useInfiniteScroll,
|
|
1507
1506
|
cs as useResizeWatcher,
|
|
1508
1507
|
Jo as uuid,
|