@signal24/vue-foundation 4.28.2 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/helpers/openapi.d.ts +1 -1
- package/dist/src/vite-plugins/vite-openapi-plugin.js +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vue-foundation.es.js +688 -617
- package/package.json +2 -2
- package/src/components/overlay-container.ts +1 -0
- package/src/components/vf-smart-select.vue +1 -1
- package/src/helpers/openapi.ts +1 -1
- package/src/vite-plugins/vite-openapi-plugin.ts +1 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { compact as
|
|
3
|
-
import {
|
|
4
|
-
import { escapeHtml as
|
|
5
|
-
import {
|
|
6
|
-
import { format as U, addDays as Jt, parse as Qt } from "date-fns";
|
|
1
|
+
import { defineComponent as _, ref as S, computed as T, watch as I, onMounted as N, createElementBlock as k, withDirectives as re, openBlock as b, createElementVNode as $, toDisplayString as R, createCommentVNode as H, Fragment as ie, renderList as le, vModelSelect as At, getCurrentInstance as be, withModifiers as ke, normalizeStyle as $t, normalizeClass as V, renderSlot as U, reactive as Bt, h as ae, Teleport as Nt, markRaw as _t, onBeforeUnmount as ue, resolveDirective as Rt, createBlock as Qe, createSlots as Ut, withCtx as he, createTextVNode as X, vModelText as jt, onActivated as et, onDeactivated as tt } from "vue";
|
|
2
|
+
import { compact as nt, cloneDeep as Pt, uniq as Wt, groupBy as qt, isEqual as we, debounce as zt, startCase as Kt, upperFirst as Yt, remove as Xt, last as Gt } from "lodash";
|
|
3
|
+
import { escapeHtml as Zt } from "@vue/shared";
|
|
4
|
+
import { escapeHtml as ys } from "@vue/shared";
|
|
5
|
+
import { format as P, addDays as Jt, parse as Qt } from "date-fns";
|
|
7
6
|
const en = {
|
|
8
7
|
key: 0,
|
|
9
8
|
disabled: ""
|
|
10
9
|
}, tn = {
|
|
11
10
|
key: 0,
|
|
12
11
|
value: null
|
|
13
|
-
}, nn = ["value"],
|
|
12
|
+
}, nn = ["value"], jo = /* @__PURE__ */ _({
|
|
14
13
|
__name: "vf-ajax-select",
|
|
15
14
|
props: {
|
|
16
15
|
modelValue: {},
|
|
@@ -22,28 +21,28 @@ const en = {
|
|
|
22
21
|
},
|
|
23
22
|
emits: ["update:modelValue"],
|
|
24
23
|
setup(e, { emit: t }) {
|
|
25
|
-
const n = e, o = t,
|
|
26
|
-
const
|
|
27
|
-
return n.preprocesor ? n.preprocesor(
|
|
28
|
-
}) : null),
|
|
29
|
-
I(() => n.loadFn,
|
|
24
|
+
const n = e, o = t, r = S(null), s = T(() => r.value ? r.value.map((d) => {
|
|
25
|
+
const h = d;
|
|
26
|
+
return n.preprocesor ? n.preprocesor(h) : n.displayKey ? h[n.displayKey] : "";
|
|
27
|
+
}) : null), a = S(n.modelValue ?? null);
|
|
28
|
+
I(() => n.loadFn, l), I(
|
|
30
29
|
() => n.modelValue,
|
|
31
|
-
() =>
|
|
32
|
-
), I(
|
|
33
|
-
async function
|
|
34
|
-
|
|
30
|
+
() => a.value = n.modelValue
|
|
31
|
+
), I(a, () => o("update:modelValue", a.value));
|
|
32
|
+
async function l() {
|
|
33
|
+
r.value = await n.loadFn();
|
|
35
34
|
}
|
|
36
|
-
return
|
|
35
|
+
return N(l), (u, d) => s.value ? re((b(), k("select", {
|
|
37
36
|
key: 1,
|
|
38
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
37
|
+
"onUpdate:modelValue": d[0] || (d[0] = (h) => a.value = h)
|
|
39
38
|
}, [
|
|
40
|
-
n.nullText ? (b(), k("option", tn, R(n.nullText), 1)) :
|
|
41
|
-
(b(!0), k(
|
|
42
|
-
key:
|
|
43
|
-
value:
|
|
44
|
-
}, R(
|
|
39
|
+
n.nullText ? (b(), k("option", tn, R(n.nullText), 1)) : H("", !0),
|
|
40
|
+
(b(!0), k(ie, null, le(s.value, (h, m) => (b(), k("option", {
|
|
41
|
+
key: m,
|
|
42
|
+
value: r.value?.[m]
|
|
43
|
+
}, R(h), 9, nn))), 128))
|
|
45
44
|
], 512)), [
|
|
46
|
-
[
|
|
45
|
+
[At, a.value]
|
|
47
46
|
]) : (b(), k("select", en, [
|
|
48
47
|
$("option", null, R(n.loadingText || "Loading..."), 1)
|
|
49
48
|
]));
|
|
@@ -55,104 +54,104 @@ const en = {
|
|
|
55
54
|
defaultTimeFormat: "H:mm",
|
|
56
55
|
defaultCurrencyDivisor: 1
|
|
57
56
|
};
|
|
58
|
-
function
|
|
57
|
+
function Po(e) {
|
|
59
58
|
Object.assign(F, e);
|
|
60
59
|
}
|
|
61
|
-
const on = /* @__PURE__ */
|
|
60
|
+
const on = /* @__PURE__ */ _({
|
|
62
61
|
__name: "overlay-anchor",
|
|
63
62
|
props: {
|
|
64
63
|
overlayId: {},
|
|
65
64
|
anchor: {}
|
|
66
65
|
},
|
|
67
66
|
setup(e) {
|
|
68
|
-
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }),
|
|
69
|
-
|
|
70
|
-
function
|
|
67
|
+
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }), r = S([]), s = be();
|
|
68
|
+
N(a);
|
|
69
|
+
function a() {
|
|
71
70
|
if (!s) return;
|
|
72
|
-
const d = s.vnode.el, { styles:
|
|
73
|
-
o.value =
|
|
71
|
+
const d = s.vnode.el, { styles: h, classes: m } = l(d, n);
|
|
72
|
+
o.value = h, r.value = m;
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const f =
|
|
79
|
-
let
|
|
80
|
-
if (
|
|
81
|
-
|
|
74
|
+
function l(d, h) {
|
|
75
|
+
const m = t.anchor instanceof HTMLElement ? {} : t.anchor, w = h.getBoundingClientRect(), c = d.getBoundingClientRect();
|
|
76
|
+
m.matchWidth && (c.width = w.width), m.matchHeight && (c.height = w.height);
|
|
77
|
+
const f = m.class ? Array.isArray(m.class) ? m.class : [m.class] : [];
|
|
78
|
+
let y, C;
|
|
79
|
+
if (m.y === "center")
|
|
80
|
+
y = w.top + w.height / 2 - c.height / 2, f.push("anchored-center-y");
|
|
82
81
|
else {
|
|
83
|
-
const B = (
|
|
84
|
-
|
|
82
|
+
const B = (w.bottom + c.height < window.innerHeight || m.y === "below") && m.y !== "above";
|
|
83
|
+
y = B ? w.bottom : w.top - c.height, f.push(B ? "anchored-top" : "anchored-bottom");
|
|
85
84
|
}
|
|
86
|
-
if (
|
|
87
|
-
C =
|
|
85
|
+
if (m.x === "center")
|
|
86
|
+
C = w.left + w.width / 2 - c.width / 2, f.push("anchored-center-x");
|
|
88
87
|
else {
|
|
89
|
-
const B = (
|
|
90
|
-
C = B ?
|
|
88
|
+
const B = (w.left + c.width < window.innerWidth || m.x === "left") && m.x !== "right";
|
|
89
|
+
C = B ? w.left : w.right - c.width, f.push(B ? "anchored-left" : "anchored-right");
|
|
91
90
|
}
|
|
92
91
|
return {
|
|
93
92
|
styles: {
|
|
94
|
-
top: `${
|
|
93
|
+
top: `${y}px`,
|
|
95
94
|
left: `${C}px`,
|
|
96
|
-
...
|
|
97
|
-
...
|
|
95
|
+
...m.matchWidth ? { width: `${c.width}px` } : {},
|
|
96
|
+
...m.matchHeight ? { height: `${c.height}px` } : {}
|
|
98
97
|
},
|
|
99
98
|
classes: f
|
|
100
99
|
};
|
|
101
100
|
}
|
|
102
|
-
function
|
|
103
|
-
window.removeEventListener("click",
|
|
101
|
+
function u() {
|
|
102
|
+
window.removeEventListener("click", u), ln(t.overlayId);
|
|
104
103
|
}
|
|
105
|
-
return
|
|
104
|
+
return N(() => {
|
|
106
105
|
setTimeout(() => {
|
|
107
|
-
window.addEventListener("click",
|
|
106
|
+
window.addEventListener("click", u);
|
|
108
107
|
}, 10);
|
|
109
|
-
}), (d,
|
|
110
|
-
class:
|
|
111
|
-
style:
|
|
112
|
-
onClick: ke(
|
|
108
|
+
}), (d, h) => (b(), k("div", {
|
|
109
|
+
class: V(["vf-overlay-anchor", r.value]),
|
|
110
|
+
style: $t(o.value),
|
|
111
|
+
onClick: ke(u, ["stop"])
|
|
113
112
|
}, [
|
|
114
|
-
|
|
113
|
+
U(d.$slots, "default")
|
|
115
114
|
], 6));
|
|
116
115
|
}
|
|
117
116
|
});
|
|
118
117
|
let sn = 0;
|
|
119
|
-
const A =
|
|
118
|
+
const A = Bt([]);
|
|
120
119
|
I(A, () => {
|
|
121
120
|
F.onOverlaysChanged?.(A.length);
|
|
122
121
|
});
|
|
123
|
-
const
|
|
122
|
+
const Wo = _({
|
|
124
123
|
setup() {
|
|
125
124
|
return () => ae("div", [
|
|
126
|
-
|
|
125
|
+
le(A, (e) => ae(Nt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
|
|
127
126
|
]);
|
|
128
127
|
}
|
|
129
128
|
});
|
|
130
129
|
function ce(e, t, n) {
|
|
131
130
|
const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
|
|
132
131
|
o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
|
|
133
|
-
const
|
|
134
|
-
id:
|
|
132
|
+
const r = String(++sn), s = _t(e), a = ae(s, t), l = n?.anchor ? ae(on, { overlayId: r, anchor: n.anchor }, () => [a]) : void 0, u = {
|
|
133
|
+
id: r,
|
|
135
134
|
component: s,
|
|
136
135
|
props: t,
|
|
137
136
|
options: n ?? {},
|
|
138
|
-
vnode:
|
|
139
|
-
wrapperVnode:
|
|
137
|
+
vnode: a,
|
|
138
|
+
wrapperVnode: l
|
|
140
139
|
};
|
|
141
|
-
return A.push(
|
|
140
|
+
return A.push(u), u;
|
|
142
141
|
}
|
|
143
|
-
function
|
|
144
|
-
e.$ &&
|
|
142
|
+
function qo(e) {
|
|
143
|
+
e.$ && ot(e.$);
|
|
145
144
|
}
|
|
146
|
-
function
|
|
145
|
+
function ot(e) {
|
|
147
146
|
let t = e;
|
|
148
|
-
for (; t && !
|
|
147
|
+
for (; t && !rn(t.vnode); )
|
|
149
148
|
t = t.parent;
|
|
150
149
|
}
|
|
151
|
-
function
|
|
150
|
+
function rn(e) {
|
|
152
151
|
const t = A.findIndex((n) => n.vnode.component === e.component);
|
|
153
152
|
return t >= 0 ? (A[t].props.callback(), !0) : !1;
|
|
154
153
|
}
|
|
155
|
-
function
|
|
154
|
+
function ln(e) {
|
|
156
155
|
const t = A.findIndex((n) => n.id === e);
|
|
157
156
|
return t >= 0 ? (A[t].props.callback(), !0) : !1;
|
|
158
157
|
}
|
|
@@ -162,16 +161,16 @@ function Q(e) {
|
|
|
162
161
|
}
|
|
163
162
|
async function Te(e, t, n) {
|
|
164
163
|
return new Promise((o) => {
|
|
165
|
-
let
|
|
166
|
-
const
|
|
164
|
+
let r = null;
|
|
165
|
+
const a = { ...t, callback: async (l) => {
|
|
167
166
|
if (n?.onCallback) {
|
|
168
|
-
const
|
|
169
|
-
if (typeof
|
|
167
|
+
const u = n.onCallback(l);
|
|
168
|
+
if (typeof u == "object" && "then" in u && typeof u.then == "function" && await u === !1)
|
|
170
169
|
return;
|
|
171
170
|
}
|
|
172
|
-
Q(
|
|
171
|
+
Q(r), o(l);
|
|
173
172
|
} };
|
|
174
|
-
|
|
173
|
+
r = ce(e, a, n);
|
|
175
174
|
});
|
|
176
175
|
}
|
|
177
176
|
async function an(e, t) {
|
|
@@ -188,14 +187,14 @@ function te(e, t) {
|
|
|
188
187
|
async function un(e, t) {
|
|
189
188
|
await Te(ne, te(e, t));
|
|
190
189
|
}
|
|
191
|
-
async function
|
|
190
|
+
async function zo(e, t) {
|
|
192
191
|
const n = te(e, t);
|
|
193
192
|
return await Te(ne, {
|
|
194
193
|
...n,
|
|
195
194
|
shouldConfirm: !0
|
|
196
195
|
}) === !0;
|
|
197
196
|
}
|
|
198
|
-
async function
|
|
197
|
+
async function Ko(e, t) {
|
|
199
198
|
const n = te(e, t);
|
|
200
199
|
return await Te(ne, {
|
|
201
200
|
...n,
|
|
@@ -203,7 +202,7 @@ async function Uo(e, t) {
|
|
|
203
202
|
classes: ["destructive", ...n.classes]
|
|
204
203
|
}) === !0;
|
|
205
204
|
}
|
|
206
|
-
function
|
|
205
|
+
function Yo(e, t) {
|
|
207
206
|
const n = te(e, t), o = ce(ne, {
|
|
208
207
|
...n,
|
|
209
208
|
isBare: !0,
|
|
@@ -213,7 +212,7 @@ function Po(e, t) {
|
|
|
213
212
|
});
|
|
214
213
|
return () => Q(o);
|
|
215
214
|
}
|
|
216
|
-
function
|
|
215
|
+
function Xo(e, t) {
|
|
217
216
|
const n = te(e, t), o = ce(ne, {
|
|
218
217
|
...n,
|
|
219
218
|
isBare: !0,
|
|
@@ -222,8 +221,8 @@ function qo(e, t) {
|
|
|
222
221
|
}
|
|
223
222
|
});
|
|
224
223
|
return {
|
|
225
|
-
update: (
|
|
226
|
-
an(o, { message:
|
|
224
|
+
update: (r) => {
|
|
225
|
+
an(o, { message: r });
|
|
227
226
|
},
|
|
228
227
|
dismiss: () => Q(o)
|
|
229
228
|
};
|
|
@@ -246,7 +245,7 @@ function Se(e) {
|
|
|
246
245
|
function dn(e) {
|
|
247
246
|
return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
|
|
248
247
|
}
|
|
249
|
-
async function
|
|
248
|
+
async function Go(e, t) {
|
|
250
249
|
const n = Se(e);
|
|
251
250
|
return n instanceof de || F.errorHandler(n), un({
|
|
252
251
|
title: t?.title,
|
|
@@ -254,46 +253,46 @@ async function zo(e, t) {
|
|
|
254
253
|
classes: t?.classes
|
|
255
254
|
});
|
|
256
255
|
}
|
|
257
|
-
async function
|
|
256
|
+
async function Zo(e) {
|
|
258
257
|
const t = Se(e);
|
|
259
258
|
t instanceof de || F.errorHandler(t);
|
|
260
259
|
}
|
|
261
|
-
const
|
|
262
|
-
function
|
|
260
|
+
const G = Symbol("MaskState");
|
|
261
|
+
function Jo(e, t) {
|
|
263
262
|
const n = e.$?.vnode.el, o = n.closest(".vf-modal");
|
|
264
263
|
return fn(o ?? n, t);
|
|
265
264
|
}
|
|
266
|
-
function
|
|
265
|
+
function Qo(e) {
|
|
267
266
|
const t = e.$?.vnode.el, n = t.closest(".vf-modal");
|
|
268
|
-
return
|
|
267
|
+
return st(n ?? t);
|
|
269
268
|
}
|
|
270
269
|
function fn(e, t) {
|
|
271
|
-
if (!e[
|
|
270
|
+
if (!e[G]) {
|
|
272
271
|
const n = document.createElement("div");
|
|
273
|
-
n.classList.add("vf-mask"), e.appendChild(n), e[
|
|
272
|
+
n.classList.add("vf-mask"), e.appendChild(n), e[G] = { maskEl: n };
|
|
274
273
|
}
|
|
275
|
-
return e[
|
|
274
|
+
return e[G].maskEl.innerText = t ?? "", () => st(e);
|
|
276
275
|
}
|
|
277
|
-
function
|
|
278
|
-
e[
|
|
276
|
+
function st(e) {
|
|
277
|
+
e[G] && e.removeChild(e[G].maskEl);
|
|
279
278
|
}
|
|
280
279
|
const Ee = Symbol("FormMaskState");
|
|
281
|
-
function
|
|
280
|
+
function pn(e, t, n) {
|
|
282
281
|
const o = e instanceof Element ? e : it(e);
|
|
283
282
|
if (!o) return () => {
|
|
284
283
|
};
|
|
285
284
|
o.classList.add("vf-masked");
|
|
286
|
-
const
|
|
285
|
+
const r = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
|
|
287
286
|
let s;
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
return
|
|
291
|
-
disabledElements:
|
|
292
|
-
waitButton:
|
|
287
|
+
r && (s = r.tagName === "INPUT" ? r.value : r.innerHTML, r.setAttribute("disabled", "disabled"), r.innerText = n ?? "Please wait...");
|
|
288
|
+
const l = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
289
|
+
return l.forEach((u) => u.setAttribute("disabled", "disabled")), o[Ee] = {
|
|
290
|
+
disabledElements: l,
|
|
291
|
+
waitButton: r,
|
|
293
292
|
buttonHtml: s
|
|
294
|
-
}, () =>
|
|
293
|
+
}, () => rt(o);
|
|
295
294
|
}
|
|
296
|
-
function
|
|
295
|
+
function rt(e) {
|
|
297
296
|
const t = e instanceof Element ? e : it(e);
|
|
298
297
|
if (!t) return;
|
|
299
298
|
const n = t[Ee];
|
|
@@ -303,13 +302,13 @@ function it(e) {
|
|
|
303
302
|
const t = e?.$?.vnode.el;
|
|
304
303
|
return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
|
|
305
304
|
}
|
|
306
|
-
const
|
|
305
|
+
const vn = ["id"], mn = {
|
|
307
306
|
key: 0,
|
|
308
307
|
class: "vf-modal-header"
|
|
309
308
|
}, hn = { class: "vf-modal-content" }, yn = {
|
|
310
309
|
key: 1,
|
|
311
310
|
class: "vf-modal-footer"
|
|
312
|
-
}, gn = /* @__PURE__ */
|
|
311
|
+
}, gn = /* @__PURE__ */ _({
|
|
313
312
|
__name: "vf-modal",
|
|
314
313
|
props: {
|
|
315
314
|
id: {},
|
|
@@ -321,68 +320,68 @@ const pn = ["id"], mn = {
|
|
|
321
320
|
emits: ["formSubmit"],
|
|
322
321
|
setup(e, { expose: t }) {
|
|
323
322
|
const n = be(), o = e;
|
|
324
|
-
t({ mask:
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d),
|
|
323
|
+
t({ mask: m, unmask: w, hide: c, unhide: f });
|
|
324
|
+
const r = S(), s = S(), a = S(!1), l = T(() => nt([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
|
|
325
|
+
N(() => {
|
|
326
|
+
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d), r.value?.addEventListener("click", u));
|
|
328
327
|
}), ue(() => {
|
|
329
328
|
window.removeEventListener("keydown", d), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
330
329
|
});
|
|
331
|
-
function
|
|
332
|
-
|
|
330
|
+
function u(y) {
|
|
331
|
+
y.target == r.value && h();
|
|
333
332
|
}
|
|
334
|
-
function d(
|
|
335
|
-
if (
|
|
333
|
+
function d(y) {
|
|
334
|
+
if (y.key === "Esc" || y.key === "Escape") {
|
|
336
335
|
const C = document.querySelectorAll(".vf-modal-wrap");
|
|
337
|
-
C[C.length - 1] ===
|
|
336
|
+
C[C.length - 1] === r.value && h();
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
|
-
function E() {
|
|
341
|
-
nt(n);
|
|
342
|
-
}
|
|
343
339
|
function h() {
|
|
344
|
-
|
|
340
|
+
ot(n);
|
|
345
341
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
342
|
+
function m() {
|
|
343
|
+
return pn(s.value), () => w();
|
|
348
344
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
345
|
+
function w() {
|
|
346
|
+
rt(s.value);
|
|
347
|
+
}
|
|
348
|
+
function c() {
|
|
349
|
+
return a.value = !0, () => f();
|
|
351
350
|
}
|
|
352
351
|
function f() {
|
|
353
|
-
|
|
352
|
+
a.value = !1;
|
|
354
353
|
}
|
|
355
|
-
return (
|
|
356
|
-
id:
|
|
354
|
+
return (y, C) => (b(), k("div", {
|
|
355
|
+
id: y.id,
|
|
357
356
|
ref_key: "overlay",
|
|
358
|
-
ref:
|
|
359
|
-
class:
|
|
357
|
+
ref: r,
|
|
358
|
+
class: V(["vf-overlay vf-modal-wrap", l.value])
|
|
360
359
|
}, [
|
|
361
360
|
$("form", {
|
|
362
361
|
ref_key: "form",
|
|
363
362
|
ref: s,
|
|
364
363
|
action: ".",
|
|
365
|
-
class:
|
|
366
|
-
onSubmit: C[0] || (C[0] = ke((x) =>
|
|
364
|
+
class: V(["vf-modal", { scrolls: y.scrolls }]),
|
|
365
|
+
onSubmit: C[0] || (C[0] = ke((x) => y.$emit("formSubmit"), ["prevent"]))
|
|
367
366
|
}, [
|
|
368
|
-
|
|
369
|
-
|
|
367
|
+
y.$slots.header ? (b(), k("div", mn, [
|
|
368
|
+
U(y.$slots, "header"),
|
|
370
369
|
o.closeX ? (b(), k("i", {
|
|
371
370
|
key: 0,
|
|
372
371
|
class: "close",
|
|
373
|
-
onClick:
|
|
374
|
-
})) :
|
|
375
|
-
])) :
|
|
372
|
+
onClick: h
|
|
373
|
+
})) : H("", !0)
|
|
374
|
+
])) : H("", !0),
|
|
376
375
|
$("div", hn, [
|
|
377
|
-
|
|
376
|
+
U(y.$slots, "default")
|
|
378
377
|
]),
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
])) :
|
|
378
|
+
y.$slots.footer ? (b(), k("div", yn, [
|
|
379
|
+
U(y.$slots, "footer")
|
|
380
|
+
])) : H("", !0)
|
|
382
381
|
], 34)
|
|
383
|
-
], 10,
|
|
382
|
+
], 10, vn));
|
|
384
383
|
}
|
|
385
|
-
}), wn = ["innerHtml"], En = ["innerText"], ne = /* @__PURE__ */
|
|
384
|
+
}), wn = ["innerHtml"], En = ["innerText"], ne = /* @__PURE__ */ _({
|
|
386
385
|
__name: "vf-alert-modal",
|
|
387
386
|
props: {
|
|
388
387
|
isBare: { type: Boolean },
|
|
@@ -396,16 +395,16 @@ const pn = ["id"], mn = {
|
|
|
396
395
|
},
|
|
397
396
|
setup(e) {
|
|
398
397
|
const t = e, n = T(() => t.message instanceof Error ? cn(t.message) : t.message);
|
|
399
|
-
return (o,
|
|
400
|
-
const s =
|
|
401
|
-
return b(),
|
|
402
|
-
class:
|
|
403
|
-
},
|
|
398
|
+
return (o, r) => {
|
|
399
|
+
const s = Rt("autofocus");
|
|
400
|
+
return b(), Qe(gn, {
|
|
401
|
+
class: V(["vf-alert", ...o.classes ?? []])
|
|
402
|
+
}, Ut({
|
|
404
403
|
default: he(() => [
|
|
405
404
|
o.iconClass ? (b(), k("i", {
|
|
406
405
|
key: 0,
|
|
407
|
-
class:
|
|
408
|
-
}, null, 2)) :
|
|
406
|
+
class: V(["vf-alert-icon", o.iconClass])
|
|
407
|
+
}, null, 2)) : H("", !0),
|
|
409
408
|
o.isHtml ? (b(), k("div", {
|
|
410
409
|
key: 1,
|
|
411
410
|
innerHtml: o.message,
|
|
@@ -427,24 +426,24 @@ const pn = ["id"], mn = {
|
|
|
427
426
|
o.isBare ? void 0 : {
|
|
428
427
|
name: "footer",
|
|
429
428
|
fn: he(() => [
|
|
430
|
-
o.shouldConfirm ? (b(), k(
|
|
431
|
-
|
|
429
|
+
o.shouldConfirm ? (b(), k(ie, { key: 0 }, [
|
|
430
|
+
re((b(), k("button", {
|
|
432
431
|
class: "primary",
|
|
433
|
-
onClick:
|
|
434
|
-
},
|
|
432
|
+
onClick: r[0] || (r[0] = () => o.callback(!0))
|
|
433
|
+
}, r[3] || (r[3] = [
|
|
435
434
|
X("Confirm")
|
|
436
435
|
]))), [
|
|
437
436
|
[s]
|
|
438
437
|
]),
|
|
439
438
|
$("button", {
|
|
440
439
|
class: "default",
|
|
441
|
-
onClick:
|
|
440
|
+
onClick: r[1] || (r[1] = () => o.callback(!1))
|
|
442
441
|
}, "Cancel")
|
|
443
|
-
], 64)) :
|
|
442
|
+
], 64)) : re((b(), k("button", {
|
|
444
443
|
key: 1,
|
|
445
444
|
class: "default",
|
|
446
|
-
onClick:
|
|
447
|
-
},
|
|
445
|
+
onClick: r[2] || (r[2] = () => o.callback(!0))
|
|
446
|
+
}, r[4] || (r[4] = [
|
|
448
447
|
X("OK")
|
|
449
448
|
]))), [
|
|
450
449
|
[s]
|
|
@@ -456,66 +455,138 @@ const pn = ["id"], mn = {
|
|
|
456
455
|
};
|
|
457
456
|
}
|
|
458
457
|
});
|
|
459
|
-
function
|
|
458
|
+
function es(e, t, n) {
|
|
460
459
|
const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
461
460
|
return o === -1 ? !1 : (e.splice(o, 1, n), !0);
|
|
462
461
|
}
|
|
463
|
-
function
|
|
462
|
+
function ts(e, t) {
|
|
464
463
|
const n = document.createElement("div");
|
|
465
|
-
n.classList.add("vf-overlay"), n.addEventListener("click",
|
|
464
|
+
n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
|
|
466
465
|
const o = document.createElement("div");
|
|
467
466
|
o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
|
|
467
|
+
const r = e.currentTarget;
|
|
468
|
+
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((c) => {
|
|
469
|
+
if (c == "-") {
|
|
470
|
+
const y = document.createElement("div");
|
|
471
|
+
y.classList.add("separator"), o.appendChild(y);
|
|
473
472
|
return;
|
|
474
473
|
}
|
|
475
474
|
const f = document.createElement("div");
|
|
476
|
-
f.classList.add("item"), f.style.userSelect = "none", f.innerText =
|
|
475
|
+
f.classList.add("item"), f.style.userSelect = "none", f.innerText = c.title, o.appendChild(f), c.class && f.classList.add(c.class), c.shouldConfirm ? f.addEventListener("click", (y) => w(y, f, c.handler)) : f.addEventListener("click", () => c.handler());
|
|
477
476
|
});
|
|
478
|
-
const s = window.innerWidth - e.clientX,
|
|
479
|
-
o.style.left = d + "px", o.style.top =
|
|
477
|
+
const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, l = o.offsetHeight, u = o.offsetWidth, d = s < u ? e.clientX - u - 1 : e.clientX + 1, h = a < l ? e.clientY - l - 1 : e.clientY + 1;
|
|
478
|
+
o.style.left = d + "px", o.style.top = h + "px", setTimeout(() => {
|
|
480
479
|
o.style.width = o.offsetWidth + "px";
|
|
481
480
|
}, 50);
|
|
482
|
-
function
|
|
483
|
-
t.targetClass &&
|
|
481
|
+
function m() {
|
|
482
|
+
t.targetClass && r.classList.remove(t.targetClass), r.classList.remove("context-menu-active"), r.style.userSelect = "", n.remove();
|
|
484
483
|
}
|
|
485
|
-
function
|
|
484
|
+
function w(c, f, y) {
|
|
486
485
|
if (f.classList.contains("pending-confirm"))
|
|
487
|
-
return
|
|
486
|
+
return y();
|
|
488
487
|
const C = f.innerHTML;
|
|
489
488
|
f.classList.add("pending-confirm"), f.innerText = "Confirm";
|
|
490
489
|
const x = () => {
|
|
491
490
|
f.classList.remove("pending-confirm"), f.innerHTML = C, f.removeEventListener("mouseleave", x);
|
|
492
491
|
};
|
|
493
|
-
f.addEventListener("mouseleave", x),
|
|
492
|
+
f.addEventListener("mouseleave", x), c.stopPropagation();
|
|
494
493
|
}
|
|
495
494
|
}
|
|
496
|
-
const bn = (e) => new Promise((t) => setTimeout(t, e)),
|
|
495
|
+
const bn = (e) => new Promise((t) => setTimeout(t, e)), ns = (e) => bn(e * 1e3);
|
|
497
496
|
function kn(e) {
|
|
498
497
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
499
498
|
}
|
|
500
|
-
function
|
|
501
|
-
return e != null ?
|
|
499
|
+
function os(e, t) {
|
|
500
|
+
return e != null ? Pt(e) : t;
|
|
502
501
|
}
|
|
503
|
-
function
|
|
502
|
+
function ss(e, t) {
|
|
504
503
|
const n = { ...e };
|
|
505
504
|
for (const o of t)
|
|
506
505
|
n[o] === "" && (n[o] = null);
|
|
507
506
|
return n;
|
|
508
507
|
}
|
|
509
|
-
function
|
|
508
|
+
function je(e) {
|
|
510
509
|
return e != null;
|
|
511
510
|
}
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
class Ce {
|
|
512
|
+
validator = null;
|
|
513
|
+
lastModifiedDate = null;
|
|
514
|
+
size = 0;
|
|
515
|
+
path = "";
|
|
516
|
+
name = "";
|
|
517
|
+
type = "";
|
|
518
|
+
}
|
|
519
|
+
class Tn extends Ce {
|
|
520
|
+
blob;
|
|
521
|
+
constructor(t) {
|
|
522
|
+
super(), this.blob = t;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
class Sn extends Ce {
|
|
526
|
+
uri;
|
|
527
|
+
constructor(t) {
|
|
528
|
+
super(), this.uri = t.uri, this.name = t.name ?? void 0, this.type = t.type ?? t.mimeType ?? void 0, this.size = t.size ?? 0;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function Cn(e) {
|
|
532
|
+
if (typeof e.body != "object" || !Object.values(e.body).some((r) => r instanceof Ce))
|
|
533
|
+
return e;
|
|
534
|
+
const n = new FormData(), o = {};
|
|
535
|
+
for (const [r, s] of Object.entries(e.body))
|
|
536
|
+
s instanceof Sn ? n.append(r, s) : s instanceof Tn ? n.append(r, s.blob) : o[r] = s;
|
|
537
|
+
return n.append("_payload", JSON.stringify(o)), {
|
|
538
|
+
...e,
|
|
539
|
+
headers: {
|
|
540
|
+
...e.headers,
|
|
541
|
+
"content-type": null
|
|
542
|
+
// deletes default JSON content-type header
|
|
543
|
+
},
|
|
544
|
+
body: n,
|
|
545
|
+
bodySerializer: void 0
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
class lt extends Error {
|
|
549
|
+
request;
|
|
550
|
+
response;
|
|
551
|
+
body;
|
|
552
|
+
constructor(t, n, o, r) {
|
|
553
|
+
super(t), this.request = n, this.response = o, this.body = r;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
function xn(e, t) {
|
|
557
|
+
e.setConfig({
|
|
558
|
+
throwOnError: !0
|
|
559
|
+
}), e.interceptors.error.use((s, a, l, u) => {
|
|
560
|
+
const d = Mn(s, a), h = new lt(d, l, a, s);
|
|
561
|
+
if (t.onError) {
|
|
562
|
+
const m = t.onError(h, u);
|
|
563
|
+
if (m instanceof Error)
|
|
564
|
+
throw m;
|
|
565
|
+
if (m === null)
|
|
566
|
+
return new Promise(() => {
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
throw h;
|
|
570
|
+
}), t.headers && e.interceptors.request.use(async (s) => {
|
|
571
|
+
const a = typeof t.headers == "function" ? await t.headers(s) : t.headers;
|
|
572
|
+
if (a)
|
|
573
|
+
for (const [l, u] of Object.entries(a))
|
|
574
|
+
u === null ? s.headers.delete(l) : u !== void 0 && s.headers.set(l, u);
|
|
575
|
+
return s;
|
|
576
|
+
});
|
|
577
|
+
const n = t.wrapper ?? ((s, a) => a(s)), o = e.request, r = (s) => (s = Cn(s), n(s, o));
|
|
578
|
+
e.request = r, e.connect = (s) => r({ ...s, method: "CONNECT" }), e.delete = (s) => r({ ...s, method: "DELETE" }), e.get = (s) => r({ ...s, method: "GET" }), e.head = (s) => r({ ...s, method: "HEAD" }), e.options = (s) => r({ ...s, method: "OPTIONS" }), e.patch = (s) => r({ ...s, method: "PATCH" }), e.post = (s) => r({ ...s, method: "POST" }), e.put = (s) => r({ ...s, method: "PUT" }), e.trace = (s) => r({ ...s, method: "TRACE" });
|
|
579
|
+
}
|
|
580
|
+
function Mn(e, t) {
|
|
581
|
+
return e && typeof e == "object" ? "error" in e && typeof e.error == "string" ? `${e.error} (${t.status})` : JSON.stringify(e) : String(e);
|
|
582
|
+
}
|
|
583
|
+
function rs(e, t) {
|
|
584
|
+
xn(e, {
|
|
514
585
|
...t,
|
|
515
586
|
onError(n, o) {
|
|
516
|
-
n instanceof
|
|
517
|
-
const
|
|
518
|
-
return
|
|
587
|
+
n instanceof lt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new de(n.body.error));
|
|
588
|
+
const r = t.onError?.(n, o);
|
|
589
|
+
return r !== void 0 ? r : n;
|
|
519
590
|
}
|
|
520
591
|
});
|
|
521
592
|
}
|
|
@@ -526,7 +597,7 @@ function ts(e, t) {
|
|
|
526
597
|
* Copyright (c) 2021 Jason Wilson
|
|
527
598
|
* Released under MIT license
|
|
528
599
|
*/
|
|
529
|
-
var
|
|
600
|
+
var Ln = {
|
|
530
601
|
symbol: "$",
|
|
531
602
|
separator: ",",
|
|
532
603
|
decimal: ".",
|
|
@@ -534,41 +605,41 @@ var Tn = {
|
|
|
534
605
|
precision: 2,
|
|
535
606
|
pattern: "!#",
|
|
536
607
|
negativePattern: "-!#",
|
|
537
|
-
format:
|
|
608
|
+
format: Dn,
|
|
538
609
|
fromCents: !1
|
|
539
|
-
},
|
|
610
|
+
}, at = function(t) {
|
|
540
611
|
return Math.round(t);
|
|
541
|
-
},
|
|
612
|
+
}, xe = function(t) {
|
|
542
613
|
return Math.pow(10, t);
|
|
543
|
-
},
|
|
544
|
-
return
|
|
545
|
-
},
|
|
614
|
+
}, Fn = function(t, n) {
|
|
615
|
+
return at(t / n) * n;
|
|
616
|
+
}, On = /(\d)(?=(\d{3})+\b)/g, In = /(\d)(?=(\d\d)+\d\b)/g;
|
|
546
617
|
function D(e, t) {
|
|
547
618
|
var n = this;
|
|
548
619
|
if (!(n instanceof D))
|
|
549
620
|
return new D(e, t);
|
|
550
|
-
var o = Object.assign({},
|
|
551
|
-
n.intValue = s, n.value = s /
|
|
621
|
+
var o = Object.assign({}, Ln, t), r = xe(o.precision), s = se(e, o);
|
|
622
|
+
n.intValue = s, n.value = s / r, o.increment = o.increment || 1 / r, o.useVedic ? o.groups = In : o.groups = On, this.s = o, this.p = r;
|
|
552
623
|
}
|
|
553
624
|
function se(e, t) {
|
|
554
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0,
|
|
555
|
-
if (
|
|
625
|
+
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 = xe(a), d = typeof e == "number", h = e instanceof D;
|
|
626
|
+
if (h && l)
|
|
556
627
|
return e.intValue;
|
|
557
|
-
if (d ||
|
|
558
|
-
o =
|
|
628
|
+
if (d || h)
|
|
629
|
+
o = h ? e.value : e;
|
|
559
630
|
else if (typeof e == "string") {
|
|
560
|
-
var
|
|
561
|
-
o = e.replace(/\((.*)\)/, "-$1").replace(
|
|
631
|
+
var m = new RegExp("[^-\\d" + r + "]", "g"), w = new RegExp("\\" + r, "g");
|
|
632
|
+
o = e.replace(/\((.*)\)/, "-$1").replace(m, "").replace(w, "."), o = o || 0;
|
|
562
633
|
} else {
|
|
563
634
|
if (s)
|
|
564
635
|
throw Error("Invalid Input");
|
|
565
636
|
o = 0;
|
|
566
637
|
}
|
|
567
|
-
return
|
|
638
|
+
return l || (o *= u, o = o.toFixed(4)), n ? at(o) : o;
|
|
568
639
|
}
|
|
569
|
-
function
|
|
570
|
-
var n = t.pattern, o = t.negativePattern,
|
|
571
|
-
return (e.value >= 0 ? n : o).replace("!",
|
|
640
|
+
function Dn(e, t) {
|
|
641
|
+
var n = t.pattern, o = t.negativePattern, r = t.symbol, s = t.separator, a = t.decimal, l = t.groups, u = ("" + e).replace(/^-/, "").split("."), d = u[0], h = u[1];
|
|
642
|
+
return (e.value >= 0 ? n : o).replace("!", r).replace("#", d.replace(l, "$1" + s) + (h ? a + h : ""));
|
|
572
643
|
}
|
|
573
644
|
D.prototype = {
|
|
574
645
|
/**
|
|
@@ -577,8 +648,8 @@ D.prototype = {
|
|
|
577
648
|
* @returns {currency}
|
|
578
649
|
*/
|
|
579
650
|
add: function(t) {
|
|
580
|
-
var n = this.intValue, o = this.s,
|
|
581
|
-
return D((n += se(t, o)) / (o.fromCents ? 1 :
|
|
651
|
+
var n = this.intValue, o = this.s, r = this.p;
|
|
652
|
+
return D((n += se(t, o)) / (o.fromCents ? 1 : r), o);
|
|
582
653
|
},
|
|
583
654
|
/**
|
|
584
655
|
* Subtracts value.
|
|
@@ -586,8 +657,8 @@ D.prototype = {
|
|
|
586
657
|
* @returns {currency}
|
|
587
658
|
*/
|
|
588
659
|
subtract: function(t) {
|
|
589
|
-
var n = this.intValue, o = this.s,
|
|
590
|
-
return D((n -= se(t, o)) / (o.fromCents ? 1 :
|
|
660
|
+
var n = this.intValue, o = this.s, r = this.p;
|
|
661
|
+
return D((n -= se(t, o)) / (o.fromCents ? 1 : r), o);
|
|
591
662
|
},
|
|
592
663
|
/**
|
|
593
664
|
* Multiplies values.
|
|
@@ -596,7 +667,7 @@ D.prototype = {
|
|
|
596
667
|
*/
|
|
597
668
|
multiply: function(t) {
|
|
598
669
|
var n = this.intValue, o = this.s;
|
|
599
|
-
return D((n *= t) / (o.fromCents ? 1 :
|
|
670
|
+
return D((n *= t) / (o.fromCents ? 1 : xe(o.precision)), o);
|
|
600
671
|
},
|
|
601
672
|
/**
|
|
602
673
|
* Divides value.
|
|
@@ -614,9 +685,9 @@ D.prototype = {
|
|
|
614
685
|
* @returns {array}
|
|
615
686
|
*/
|
|
616
687
|
distribute: function(t) {
|
|
617
|
-
for (var n = this.intValue, o = this.p,
|
|
618
|
-
var d = D(
|
|
619
|
-
|
|
688
|
+
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--) {
|
|
689
|
+
var d = D(a / u, r);
|
|
690
|
+
l-- > 0 && (d = d[n >= 0 ? "add" : "subtract"](1 / u)), s.push(d);
|
|
620
691
|
}
|
|
621
692
|
return s;
|
|
622
693
|
},
|
|
@@ -650,7 +721,7 @@ D.prototype = {
|
|
|
650
721
|
*/
|
|
651
722
|
toString: function() {
|
|
652
723
|
var t = this.intValue, n = this.p, o = this.s;
|
|
653
|
-
return
|
|
724
|
+
return Fn(t / n, o.increment).toFixed(o.precision);
|
|
654
725
|
},
|
|
655
726
|
/**
|
|
656
727
|
* Value for JSON serialization.
|
|
@@ -663,55 +734,55 @@ D.prototype = {
|
|
|
663
734
|
const M = [];
|
|
664
735
|
for (let e = 0; e < 256; ++e)
|
|
665
736
|
M.push((e + 256).toString(16).slice(1));
|
|
666
|
-
function
|
|
737
|
+
function Hn(e, t = 0) {
|
|
667
738
|
return (M[e[t + 0]] + M[e[t + 1]] + M[e[t + 2]] + M[e[t + 3]] + "-" + M[e[t + 4]] + M[e[t + 5]] + "-" + M[e[t + 6]] + M[e[t + 7]] + "-" + M[e[t + 8]] + M[e[t + 9]] + "-" + M[e[t + 10]] + M[e[t + 11]] + M[e[t + 12]] + M[e[t + 13]] + M[e[t + 14]] + M[e[t + 15]]).toLowerCase();
|
|
668
739
|
}
|
|
669
740
|
let ye;
|
|
670
|
-
const
|
|
671
|
-
function
|
|
741
|
+
const Vn = new Uint8Array(16);
|
|
742
|
+
function An() {
|
|
672
743
|
if (!ye) {
|
|
673
744
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
674
745
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
675
746
|
ye = crypto.getRandomValues.bind(crypto);
|
|
676
747
|
}
|
|
677
|
-
return ye(
|
|
748
|
+
return ye(Vn);
|
|
678
749
|
}
|
|
679
|
-
const
|
|
680
|
-
function
|
|
681
|
-
if (
|
|
682
|
-
return
|
|
750
|
+
const $n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Pe = { randomUUID: $n };
|
|
751
|
+
function Bn(e, t, n) {
|
|
752
|
+
if (Pe.randomUUID && !e)
|
|
753
|
+
return Pe.randomUUID();
|
|
683
754
|
e = e || {};
|
|
684
|
-
const o = e.random ?? e.rng?.() ??
|
|
755
|
+
const o = e.random ?? e.rng?.() ?? An();
|
|
685
756
|
if (o.length < 16)
|
|
686
757
|
throw new Error("Random bytes length must be >= 16");
|
|
687
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
758
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Hn(o);
|
|
688
759
|
}
|
|
689
|
-
function
|
|
760
|
+
function is(e) {
|
|
690
761
|
return e.replace(/\n/g, "<br>");
|
|
691
762
|
}
|
|
692
|
-
function
|
|
763
|
+
function Nn(e) {
|
|
693
764
|
return e.replace(/_/g, " ");
|
|
694
765
|
}
|
|
695
|
-
function
|
|
766
|
+
function _n(e) {
|
|
696
767
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
697
768
|
return t.length !== 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
698
769
|
}
|
|
699
|
-
function
|
|
770
|
+
function Rn(e, t) {
|
|
700
771
|
return D(e).divide(t ?? F.defaultCurrencyDivisor).format();
|
|
701
772
|
}
|
|
702
|
-
function
|
|
703
|
-
return
|
|
773
|
+
function ls() {
|
|
774
|
+
return Bn();
|
|
704
775
|
}
|
|
705
|
-
const
|
|
776
|
+
const Un = ["disabled", "placeholder", "required", "name"], jn = {
|
|
706
777
|
key: 0,
|
|
707
778
|
class: "no-results"
|
|
708
|
-
},
|
|
779
|
+
}, Pn = {
|
|
709
780
|
key: 0,
|
|
710
781
|
class: "group-title"
|
|
711
|
-
},
|
|
782
|
+
}, Wn = ["onMousemove", "onMousedown"], qn = ["innerHTML"], zn = ["innerHTML"], Kn = {
|
|
712
783
|
key: 1,
|
|
713
784
|
class: "no-results"
|
|
714
|
-
},
|
|
785
|
+
}, Yn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Xn = /* @__PURE__ */ _({
|
|
715
786
|
__name: "vf-smart-select",
|
|
716
787
|
props: {
|
|
717
788
|
modelValue: {},
|
|
@@ -748,36 +819,36 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
|
|
|
748
819
|
},
|
|
749
820
|
emits: ["optionsLoaded", "update:modelValue"],
|
|
750
821
|
setup(e, { expose: t, emit: n }) {
|
|
751
|
-
const o = Symbol("null"),
|
|
822
|
+
const o = Symbol("null"), r = Symbol("create"), s = e, a = n;
|
|
752
823
|
t({
|
|
753
|
-
addRemoteOption:
|
|
824
|
+
addRemoteOption: Vt
|
|
754
825
|
});
|
|
755
|
-
const
|
|
756
|
-
const
|
|
757
|
-
return s.searchFields ? s.searchFields.forEach((
|
|
758
|
-
i[
|
|
759
|
-
}) : (oe.push(O),
|
|
760
|
-
key: fe.value?.(i) ?? String(
|
|
761
|
-
group:
|
|
762
|
-
title:
|
|
763
|
-
subtitle:
|
|
826
|
+
const l = S(), u = S(), d = S(), h = S(!1), m = S(), w = S(!1), c = S(""), f = S(null), y = S(null), C = S(!1), x = S(null), B = S(!1), yt = T(() => s.showCreateTextOnNewItem ?? !0), W = T(() => !!(s.options || m.value)), gt = T(() => s.options ?? m.value ?? []), wt = T(() => s.prependOptions ?? []), Et = T(() => s.appendOptions ?? []), Fe = T(() => !!s.disabled || !W.value && (h.value || !s.loadOptions)), z = T(() => s.loadingText || "..."), bt = T(() => !W.value && (!s.loadOptions || s.preload || s.modelValue && (s.valueField || s.valueExtractor)) ? z.value : s.nullTitle ? s.nullTitle : s.placeholder || ""), kt = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), fe = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), Tt = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Oe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Ie = T(() => s.selectionFormatter ? s.selectionFormatter : Oe.value), De = T(() => [...wt.value, ...gt.value, ...Et.value]), He = T(() => !!(s.groupField || s.groupFormatter)), pe = T(() => De.value.map((i, E) => {
|
|
827
|
+
const v = Tt.value?.(i), p = Oe.value(i), g = s.subtitleFormatter?.(i), O = p ? p.trim().toLowerCase() : "", Re = g ? g.trim().toLowerCase() : "", oe = [];
|
|
828
|
+
return s.searchFields ? s.searchFields.forEach((Ue) => {
|
|
829
|
+
i[Ue] && oe.push(String(i[Ue]).toLowerCase());
|
|
830
|
+
}) : (oe.push(O), Re && oe.push(Re)), {
|
|
831
|
+
key: fe.value?.(i) ?? String(E),
|
|
832
|
+
group: v,
|
|
833
|
+
title: p,
|
|
834
|
+
subtitle: g,
|
|
764
835
|
searchContent: oe.join(""),
|
|
765
836
|
ref: i
|
|
766
837
|
};
|
|
767
838
|
})), L = T(() => {
|
|
768
|
-
let i = [...
|
|
769
|
-
if (
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
i = i.filter((
|
|
773
|
-
const
|
|
774
|
-
i = i.map((
|
|
775
|
-
...
|
|
776
|
-
title:
|
|
777
|
-
subtitle:
|
|
778
|
-
})), B.value && (i.find((O) => O.searchContent ===
|
|
779
|
-
key:
|
|
780
|
-
title:
|
|
839
|
+
let i = [...pe.value];
|
|
840
|
+
if (w.value) {
|
|
841
|
+
const E = c.value.trim().toLowerCase();
|
|
842
|
+
if (E.length) {
|
|
843
|
+
i = i.filter((g) => g.searchContent.includes(E));
|
|
844
|
+
const v = Zt(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${v})`, "ig");
|
|
845
|
+
i = i.map((g) => ({
|
|
846
|
+
...g,
|
|
847
|
+
title: g.title.replace(p, "<mark>$1</mark>"),
|
|
848
|
+
subtitle: g.subtitle?.replace(p, "<mark>$1</mark>")
|
|
849
|
+
})), B.value && (i.find((O) => O.searchContent === E) !== void 0 || i.push({
|
|
850
|
+
key: r,
|
|
851
|
+
title: yt.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
|
|
781
852
|
}));
|
|
782
853
|
}
|
|
783
854
|
} else s.nullTitle && i.unshift({
|
|
@@ -785,218 +856,218 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
|
|
|
785
856
|
title: s.nullTitle
|
|
786
857
|
});
|
|
787
858
|
return i;
|
|
788
|
-
}),
|
|
789
|
-
if (!
|
|
859
|
+
}), St = T(() => {
|
|
860
|
+
if (!He.value)
|
|
790
861
|
return [
|
|
791
862
|
{
|
|
792
863
|
groupTitle: "",
|
|
793
864
|
options: L.value
|
|
794
865
|
}
|
|
795
866
|
];
|
|
796
|
-
const i =
|
|
797
|
-
return i.map((
|
|
798
|
-
groupTitle:
|
|
799
|
-
options:
|
|
867
|
+
const i = Wt(L.value.map((v) => v.group ?? "")), E = qt(L.value, (v) => v.group ?? "");
|
|
868
|
+
return i.map((v) => ({
|
|
869
|
+
groupTitle: v,
|
|
870
|
+
options: E[v]
|
|
800
871
|
}));
|
|
801
872
|
});
|
|
802
|
-
I(() => s.modelValue, me), I(
|
|
803
|
-
C.value && setTimeout(
|
|
804
|
-
}), I(
|
|
805
|
-
|
|
873
|
+
I(() => s.modelValue, me), I(pe, () => {
|
|
874
|
+
C.value && setTimeout(Be, 0);
|
|
875
|
+
}), I(c, () => {
|
|
876
|
+
w.value && !s.remoteSearch && !c.value.trim().length && (w.value = !1);
|
|
806
877
|
}), I(C, () => {
|
|
807
|
-
C.value ? setTimeout(
|
|
878
|
+
C.value ? setTimeout(It, 0) : (w.value = !1, c.value = y.value ?? "", d.value && (d.value.style.visibility = "hidden"));
|
|
808
879
|
}), I(L, () => {
|
|
809
|
-
s.modelValue !== null && f.value === null && me(), (x.value !== null ||
|
|
810
|
-
}),
|
|
811
|
-
B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (
|
|
812
|
-
const i =
|
|
813
|
-
we(s.modelValue, i) ||
|
|
814
|
-
}), s.remoteSearch && I(
|
|
880
|
+
s.modelValue !== null && f.value === null && me(), (x.value !== null || w.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
|
|
881
|
+
}), N(async () => {
|
|
882
|
+
B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (c.value = z.value, await Ve(), c.value = ""), !s.options && !s.loadOptions && (s.valueField || s.valueExtractor) ? c.value = z.value : me(), I(f, () => {
|
|
883
|
+
const i = je(f.value) && q.value !== null ? q.value(f.value) : f.value;
|
|
884
|
+
we(s.modelValue, i) || a("update:modelValue", i);
|
|
885
|
+
}), s.remoteSearch && I(c, zt(Ct, 250));
|
|
815
886
|
}), ue(() => {
|
|
816
887
|
d.value?.remove();
|
|
817
888
|
});
|
|
818
889
|
async function Ve() {
|
|
819
|
-
await
|
|
890
|
+
await Ae(), m.value && a("optionsLoaded", m.value);
|
|
820
891
|
}
|
|
821
|
-
async function
|
|
822
|
-
const i = s.remoteSearch &&
|
|
823
|
-
|
|
892
|
+
async function Ae() {
|
|
893
|
+
const i = s.remoteSearch && w.value && c.value.length ? c.value : null;
|
|
894
|
+
h.value = !0, m.value = await s.loadOptions?.(i) ?? [], h.value = !1, $e();
|
|
824
895
|
}
|
|
825
|
-
function
|
|
826
|
-
|
|
896
|
+
function Ct() {
|
|
897
|
+
w.value && (Ae(), w.value = c.value.trim().length > 0);
|
|
827
898
|
}
|
|
828
|
-
function
|
|
899
|
+
function xt(i) {
|
|
829
900
|
if (i.key == "Escape") {
|
|
830
901
|
i.stopPropagation(), i.target.blur(), _e();
|
|
831
902
|
return;
|
|
832
903
|
}
|
|
833
904
|
if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
|
|
834
|
-
if (!
|
|
835
|
-
|
|
905
|
+
if (!W.value) {
|
|
906
|
+
w.value || i.preventDefault();
|
|
836
907
|
return;
|
|
837
908
|
}
|
|
838
909
|
if (i.key == "ArrowUp" || i.key == "ArrowDown")
|
|
839
|
-
return i.preventDefault(),
|
|
910
|
+
return i.preventDefault(), ve(i.key == "ArrowUp" ? -1 : 1);
|
|
840
911
|
if (i.key == "PageUp" || i.key == "PageDown")
|
|
841
|
-
return i.preventDefault(),
|
|
912
|
+
return i.preventDefault(), ve(i.key == "PageUp" ? -10 : 10);
|
|
842
913
|
if (i.key == "Home" || i.key == "End")
|
|
843
|
-
return i.preventDefault(),
|
|
914
|
+
return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
844
915
|
if (i.key == "Enter") {
|
|
845
916
|
i.preventDefault();
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
917
|
+
const E = L.value.find((v) => v.key == x.value);
|
|
918
|
+
if (E) return Ne(E);
|
|
848
919
|
}
|
|
849
920
|
if (i.key === "Delete" || i.key === "Backspace") {
|
|
850
|
-
|
|
921
|
+
c.value.length > 1 && (w.value = !0);
|
|
851
922
|
return;
|
|
852
923
|
}
|
|
853
|
-
!i.metaKey &&
|
|
924
|
+
!i.metaKey && Yn.includes(i.key) && (w.value = !0);
|
|
854
925
|
}
|
|
855
926
|
}
|
|
856
|
-
function
|
|
857
|
-
|
|
927
|
+
function Mt() {
|
|
928
|
+
$e(), C.value = !0, setTimeout(() => u.value?.select(), 0);
|
|
858
929
|
}
|
|
859
|
-
function
|
|
860
|
-
f.value ? x.value =
|
|
930
|
+
function $e(i) {
|
|
931
|
+
f.value ? x.value = Lt(f.value) : s.nullTitle && (x.value = o);
|
|
861
932
|
}
|
|
862
|
-
function
|
|
863
|
-
return fe.value ? fe.value(f.value) :
|
|
933
|
+
function Lt(i) {
|
|
934
|
+
return fe.value ? fe.value(f.value) : Ft(i)?.key ?? "";
|
|
864
935
|
}
|
|
865
|
-
function
|
|
866
|
-
const
|
|
867
|
-
if (
|
|
868
|
-
return
|
|
869
|
-
const
|
|
870
|
-
return
|
|
936
|
+
function Ft(i) {
|
|
937
|
+
const E = L.value.find((g) => g.ref === i);
|
|
938
|
+
if (E)
|
|
939
|
+
return E;
|
|
940
|
+
const v = s.keyExtractor ? (g, O) => s.keyExtractor(g) === s.keyExtractor(O) : we, p = L.value.find((g) => v(g.ref, i));
|
|
941
|
+
return p || null;
|
|
871
942
|
}
|
|
872
|
-
function
|
|
873
|
-
s.debug || (!
|
|
943
|
+
function Ot() {
|
|
944
|
+
s.debug || (!c.value.length && s.nullTitle && (f.value = null, y.value = null), C.value = !1);
|
|
874
945
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
946
|
+
function It() {
|
|
947
|
+
W.value || Ve(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), Dt();
|
|
877
948
|
}
|
|
878
|
-
function
|
|
879
|
-
const i =
|
|
880
|
-
for (let O in
|
|
881
|
-
/^(font|text)/.test(O) && (
|
|
882
|
-
if (
|
|
883
|
-
const O = window.innerHeight -
|
|
884
|
-
|
|
949
|
+
function Dt() {
|
|
950
|
+
const i = l.value.getBoundingClientRect(), E = i.y + i.height + 2, v = i.x, p = d.value, g = window.getComputedStyle(l.value);
|
|
951
|
+
for (let O in g)
|
|
952
|
+
/^(font|text)/.test(O) && (p.style[O] = g[O]);
|
|
953
|
+
if (p.style.top = E + "px", p.style.left = v + "px", p.style.minWidth = i.width + "px", !g.maxHeight || g.maxHeight == "none") {
|
|
954
|
+
const O = window.innerHeight - E - 12;
|
|
955
|
+
p.style.maxHeight = O + "px";
|
|
885
956
|
}
|
|
886
|
-
|
|
957
|
+
p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Be, 0);
|
|
887
958
|
}
|
|
888
|
-
function
|
|
889
|
-
if (!
|
|
890
|
-
const i = L.value.findIndex((
|
|
891
|
-
|
|
959
|
+
function Be() {
|
|
960
|
+
if (!W.value || !x.value) return;
|
|
961
|
+
const i = L.value.findIndex((p) => p.key == x.value), E = d.value, v = E?.querySelectorAll(".option")[i];
|
|
962
|
+
v && (E.scrollTop = v.offsetTop);
|
|
892
963
|
}
|
|
893
|
-
function
|
|
964
|
+
function Ht(i) {
|
|
894
965
|
x.value = i ? i.key : null;
|
|
895
966
|
}
|
|
896
|
-
function
|
|
897
|
-
const
|
|
898
|
-
let
|
|
899
|
-
if (
|
|
900
|
-
x.value = L.value[
|
|
901
|
-
const
|
|
902
|
-
|
|
967
|
+
function ve(i) {
|
|
968
|
+
const E = L.value.findIndex((O) => O.key == x.value);
|
|
969
|
+
let v = E + i;
|
|
970
|
+
if (v < 0 ? v = 0 : v >= L.value.length && (v = L.value.length - 1), E == v) return;
|
|
971
|
+
x.value = L.value[v].key;
|
|
972
|
+
const p = d.value, g = p?.querySelectorAll(".option")[v];
|
|
973
|
+
g && (g.offsetTop < p.scrollTop ? p.scrollTop = g.offsetTop : g.offsetTop + g.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = g.offsetTop + g.offsetHeight - p.clientHeight));
|
|
903
974
|
}
|
|
904
|
-
function
|
|
905
|
-
if (
|
|
906
|
-
|
|
907
|
-
else if (i.key ===
|
|
908
|
-
const
|
|
909
|
-
|
|
975
|
+
function Ne(i) {
|
|
976
|
+
if (w.value = !1, i.key === o)
|
|
977
|
+
c.value = "", f.value = null, y.value = null;
|
|
978
|
+
else if (i.key === r) {
|
|
979
|
+
const E = c.value.trim();
|
|
980
|
+
c.value = "", f.value = null, y.value = null, s.onCreateItem?.(E);
|
|
910
981
|
} else {
|
|
911
|
-
const
|
|
912
|
-
f.value =
|
|
982
|
+
const v = pe.value.find((p) => p.key == i.key).ref;
|
|
983
|
+
f.value = v, y.value = Ie.value(v), c.value = y.value ?? "";
|
|
913
984
|
}
|
|
914
|
-
|
|
985
|
+
u.value?.blur(), _e();
|
|
915
986
|
}
|
|
916
987
|
function me() {
|
|
917
|
-
s.modelValue !== null ? (f.value = q.value ?
|
|
988
|
+
s.modelValue !== null ? (f.value = q.value ? De.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, y.value = je(f.value) ? Ie.value(f.value) : null, c.value = y.value ?? "") : (f.value = null, y.value = null, c.value = "");
|
|
918
989
|
}
|
|
919
|
-
function
|
|
920
|
-
|
|
990
|
+
function Vt(i) {
|
|
991
|
+
m.value.unshift(i);
|
|
921
992
|
}
|
|
922
993
|
function _e() {
|
|
923
994
|
if (!s.autoNext) return;
|
|
924
|
-
let i =
|
|
995
|
+
let i = l.value?.parentElement;
|
|
925
996
|
for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
|
|
926
997
|
i = i.parentElement;
|
|
927
998
|
if (!i) return;
|
|
928
|
-
const
|
|
929
|
-
if (!
|
|
930
|
-
const
|
|
931
|
-
|
|
999
|
+
const E = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
1000
|
+
if (!E) return;
|
|
1001
|
+
const v = Array.from(E).findIndex((g) => g === u.value), p = E[v + 1];
|
|
1002
|
+
p && setTimeout(() => p.focus(), 0);
|
|
932
1003
|
}
|
|
933
|
-
return (i,
|
|
1004
|
+
return (i, E) => (b(), k("div", {
|
|
934
1005
|
ref_key: "el",
|
|
935
|
-
ref:
|
|
936
|
-
class:
|
|
1006
|
+
ref: l,
|
|
1007
|
+
class: V(["vf-smart-select", { disabled: Fe.value, open: C.value }])
|
|
937
1008
|
}, [
|
|
938
|
-
|
|
1009
|
+
re($("input", {
|
|
939
1010
|
ref_key: "searchField",
|
|
940
|
-
ref:
|
|
941
|
-
"onUpdate:modelValue":
|
|
1011
|
+
ref: u,
|
|
1012
|
+
"onUpdate:modelValue": E[0] || (E[0] = (v) => c.value = v),
|
|
942
1013
|
type: "text",
|
|
943
|
-
disabled:
|
|
944
|
-
class:
|
|
945
|
-
placeholder:
|
|
1014
|
+
disabled: Fe.value,
|
|
1015
|
+
class: V({ nullable: !!i.nullTitle }),
|
|
1016
|
+
placeholder: bt.value,
|
|
946
1017
|
required: i.required,
|
|
947
1018
|
name: i.name,
|
|
948
1019
|
"data-1p-ignore": "",
|
|
949
|
-
onKeydown:
|
|
950
|
-
onFocus:
|
|
951
|
-
onBlur:
|
|
952
|
-
}, null, 42,
|
|
953
|
-
[
|
|
1020
|
+
onKeydown: xt,
|
|
1021
|
+
onFocus: Mt,
|
|
1022
|
+
onBlur: Ot
|
|
1023
|
+
}, null, 42, Un), [
|
|
1024
|
+
[jt, c.value]
|
|
954
1025
|
]),
|
|
955
1026
|
C.value ? (b(), k("div", {
|
|
956
1027
|
key: 0,
|
|
957
1028
|
ref_key: "optionsContainer",
|
|
958
1029
|
ref: d,
|
|
959
|
-
class:
|
|
1030
|
+
class: V(["vf-smart-select-options", { grouped: He.value }])
|
|
960
1031
|
}, [
|
|
961
|
-
|
|
962
|
-
key:
|
|
1032
|
+
W.value ? (b(!0), k(ie, { key: 1 }, le(St.value, (v) => (b(), k("div", {
|
|
1033
|
+
key: v.groupTitle,
|
|
963
1034
|
class: "group"
|
|
964
1035
|
}, [
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
group:
|
|
1036
|
+
v.groupTitle ? (b(), k("div", Pn, [
|
|
1037
|
+
U(i.$slots, "group", {
|
|
1038
|
+
group: v.groupTitle
|
|
968
1039
|
}, () => [
|
|
969
|
-
X(R(
|
|
1040
|
+
X(R(v.groupTitle), 1)
|
|
970
1041
|
])
|
|
971
|
-
])) :
|
|
972
|
-
(b(!0), k(
|
|
973
|
-
key:
|
|
974
|
-
class:
|
|
975
|
-
onMousemove: (
|
|
976
|
-
onMousedown: (
|
|
1042
|
+
])) : H("", !0),
|
|
1043
|
+
(b(!0), k(ie, null, le(v.options, (p) => (b(), k("div", {
|
|
1044
|
+
key: p.key,
|
|
1045
|
+
class: V(["option", [x.value === p.key && "highlighted", p.ref && i.classForOption?.(p.ref)]]),
|
|
1046
|
+
onMousemove: (g) => Ht(p),
|
|
1047
|
+
onMousedown: (g) => Ne(p)
|
|
977
1048
|
}, [
|
|
978
|
-
|
|
1049
|
+
U(i.$slots, "option", { option: p }, () => [
|
|
979
1050
|
$("div", {
|
|
980
1051
|
class: "title",
|
|
981
|
-
innerHTML:
|
|
982
|
-
}, null, 8,
|
|
983
|
-
|
|
1052
|
+
innerHTML: p.title
|
|
1053
|
+
}, null, 8, qn),
|
|
1054
|
+
p.subtitle ? (b(), k("div", {
|
|
984
1055
|
key: 0,
|
|
985
1056
|
class: "subtitle",
|
|
986
|
-
innerHTML:
|
|
987
|
-
}, null, 8,
|
|
1057
|
+
innerHTML: p.subtitle
|
|
1058
|
+
}, null, 8, zn)) : H("", !0)
|
|
988
1059
|
])
|
|
989
|
-
], 42,
|
|
990
|
-
!L.value.length &&
|
|
991
|
-
|
|
992
|
-
X(R(
|
|
1060
|
+
], 42, Wn))), 128)),
|
|
1061
|
+
!L.value.length && c.value ? (b(), k("div", Kn, [
|
|
1062
|
+
U(i.$slots, "no-results", {}, () => [
|
|
1063
|
+
X(R(kt.value), 1)
|
|
993
1064
|
])
|
|
994
|
-
])) :
|
|
995
|
-
]))), 128)) : (b(), k("div",
|
|
996
|
-
], 2)) :
|
|
1065
|
+
])) : H("", !0)
|
|
1066
|
+
]))), 128)) : (b(), k("div", jn, "Loading..."))
|
|
1067
|
+
], 2)) : H("", !0)
|
|
997
1068
|
], 2));
|
|
998
1069
|
}
|
|
999
|
-
}),
|
|
1070
|
+
}), as = /* @__PURE__ */ _({
|
|
1000
1071
|
__name: "vf-ez-smart-select",
|
|
1001
1072
|
props: {
|
|
1002
1073
|
modelValue: {},
|
|
@@ -1008,39 +1079,39 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
|
|
|
1008
1079
|
},
|
|
1009
1080
|
emits: ["update:modelValue"],
|
|
1010
1081
|
setup(e, { emit: t }) {
|
|
1011
|
-
const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((
|
|
1012
|
-
value:
|
|
1013
|
-
label:
|
|
1014
|
-
}))),
|
|
1082
|
+
const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: String(l) })) : Object.entries(n.options).map(([l, u]) => ({
|
|
1083
|
+
value: l,
|
|
1084
|
+
label: u
|
|
1085
|
+
}))), r = T(() => n.formatter ? (l) => n.formatter(l.label, l.value) : (l) => l.label), s = t, a = S(o.value.find((l) => l.value === n.modelValue) ?? null);
|
|
1015
1086
|
return I(
|
|
1016
1087
|
() => n.modelValue,
|
|
1017
|
-
(
|
|
1018
|
-
|
|
1088
|
+
(l) => {
|
|
1089
|
+
a.value = o.value.find((u) => u.value === l) ?? null;
|
|
1019
1090
|
}
|
|
1020
|
-
), I(
|
|
1021
|
-
const
|
|
1022
|
-
s("update:modelValue",
|
|
1023
|
-
}), (
|
|
1024
|
-
modelValue:
|
|
1025
|
-
"onUpdate:modelValue":
|
|
1091
|
+
), I(a, (l) => {
|
|
1092
|
+
const u = l ? o.value.find((d) => we(d, l))?.value : null;
|
|
1093
|
+
s("update:modelValue", u ?? null);
|
|
1094
|
+
}), (l, u) => (b(), Qe(Xn, {
|
|
1095
|
+
modelValue: a.value,
|
|
1096
|
+
"onUpdate:modelValue": u[0] || (u[0] = (d) => a.value = d),
|
|
1026
1097
|
options: o.value,
|
|
1027
|
-
formatter:
|
|
1028
|
-
"null-title":
|
|
1029
|
-
placeholder:
|
|
1030
|
-
name:
|
|
1098
|
+
formatter: r.value,
|
|
1099
|
+
"null-title": l.nullTitle,
|
|
1100
|
+
placeholder: l.placeholder,
|
|
1101
|
+
name: l.name
|
|
1031
1102
|
}, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
|
|
1032
1103
|
}
|
|
1033
1104
|
});
|
|
1034
|
-
function
|
|
1105
|
+
function us() {
|
|
1035
1106
|
return S();
|
|
1036
1107
|
}
|
|
1037
|
-
const
|
|
1108
|
+
const Gn = { class: "content" }, Zn = { class: "message" }, Jn = {
|
|
1038
1109
|
key: 0,
|
|
1039
1110
|
class: "close"
|
|
1040
|
-
},
|
|
1111
|
+
}, Qn = {
|
|
1041
1112
|
key: 0,
|
|
1042
1113
|
class: "progress-bar"
|
|
1043
|
-
},
|
|
1114
|
+
}, eo = /* @__PURE__ */ _({
|
|
1044
1115
|
__name: "vf-toast",
|
|
1045
1116
|
props: {
|
|
1046
1117
|
message: {},
|
|
@@ -1056,135 +1127,135 @@ const qn = { class: "content" }, zn = { class: "message" }, Kn = {
|
|
|
1056
1127
|
t.onClick ? t.onClick() : t.disableClose || t.callback();
|
|
1057
1128
|
}
|
|
1058
1129
|
const o = S();
|
|
1059
|
-
return t.durationSecs !== null &&
|
|
1060
|
-
const
|
|
1130
|
+
return t.durationSecs !== null && N(() => {
|
|
1131
|
+
const r = t.durationSecs ?? 5;
|
|
1061
1132
|
o.value?.animate([{ width: "0%" }, { width: "100%" }], {
|
|
1062
|
-
duration:
|
|
1133
|
+
duration: r * 1e3,
|
|
1063
1134
|
easing: "linear"
|
|
1064
|
-
}), setTimeout(() => t.callback(),
|
|
1065
|
-
}), (
|
|
1066
|
-
class:
|
|
1135
|
+
}), setTimeout(() => t.callback(), r * 1e3);
|
|
1136
|
+
}), (r, s) => (b(), k("div", {
|
|
1137
|
+
class: V(["vf-toast", r.className]),
|
|
1067
1138
|
onClick: ke(n, ["stop"])
|
|
1068
1139
|
}, [
|
|
1069
|
-
$("div",
|
|
1070
|
-
$("div",
|
|
1071
|
-
|
|
1140
|
+
$("div", Gn, [
|
|
1141
|
+
$("div", Zn, R(r.message), 1),
|
|
1142
|
+
r.disableClose ? H("", !0) : (b(), k("div", Jn, "x"))
|
|
1072
1143
|
]),
|
|
1073
|
-
|
|
1144
|
+
r.durationSecs !== null ? (b(), k("div", Qn, [
|
|
1074
1145
|
$("div", {
|
|
1075
1146
|
ref_key: "progressInnerEl",
|
|
1076
1147
|
ref: o,
|
|
1077
1148
|
class: "inner"
|
|
1078
1149
|
}, null, 512)
|
|
1079
|
-
])) :
|
|
1150
|
+
])) : H("", !0)
|
|
1080
1151
|
], 2));
|
|
1081
1152
|
}
|
|
1082
1153
|
});
|
|
1083
|
-
function
|
|
1084
|
-
const t = ce(
|
|
1154
|
+
function cs(e) {
|
|
1155
|
+
const t = ce(eo, {
|
|
1085
1156
|
...e,
|
|
1086
1157
|
callback: () => Q(t)
|
|
1087
1158
|
});
|
|
1088
1159
|
return () => Q(t);
|
|
1089
1160
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2),
|
|
1092
|
-
return `${o} ${
|
|
1161
|
+
function to(e) {
|
|
1162
|
+
const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), r = ["B", "KB", "MB", "GB", "TB"][t];
|
|
1163
|
+
return `${o} ${r}`;
|
|
1093
1164
|
}
|
|
1094
|
-
function
|
|
1165
|
+
function no(e) {
|
|
1095
1166
|
return e != null && String(e).length ? e : "-";
|
|
1096
1167
|
}
|
|
1097
|
-
function
|
|
1168
|
+
function oo(e) {
|
|
1098
1169
|
return e || "-";
|
|
1099
1170
|
}
|
|
1100
|
-
function
|
|
1171
|
+
function so(e) {
|
|
1101
1172
|
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : kn(Number(e));
|
|
1102
1173
|
}
|
|
1103
|
-
function
|
|
1104
|
-
return e &&
|
|
1174
|
+
function ro(e) {
|
|
1175
|
+
return e && _n(e);
|
|
1105
1176
|
}
|
|
1106
|
-
function
|
|
1107
|
-
return e ?
|
|
1177
|
+
function io(e) {
|
|
1178
|
+
return e ? Yt(e) : null;
|
|
1108
1179
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return e ?
|
|
1180
|
+
function ut(e) {
|
|
1181
|
+
return e ? Kt(e) : null;
|
|
1111
1182
|
}
|
|
1112
|
-
function
|
|
1183
|
+
function lo(e) {
|
|
1113
1184
|
return e ? e.toUpperCase() : null;
|
|
1114
1185
|
}
|
|
1115
|
-
function
|
|
1116
|
-
return e ?
|
|
1186
|
+
function ao(e) {
|
|
1187
|
+
return e ? ut(e.toLowerCase()) : null;
|
|
1117
1188
|
}
|
|
1118
|
-
function
|
|
1119
|
-
return e ?
|
|
1189
|
+
function uo(e) {
|
|
1190
|
+
return e ? Nn(e) : null;
|
|
1120
1191
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return
|
|
1192
|
+
function co(e, t) {
|
|
1193
|
+
return Rn(e, t);
|
|
1123
1194
|
}
|
|
1124
|
-
function
|
|
1195
|
+
function fo(e, t) {
|
|
1125
1196
|
return D(e).divide(t).value;
|
|
1126
1197
|
}
|
|
1127
|
-
function
|
|
1128
|
-
return e &&
|
|
1129
|
-
}
|
|
1130
|
-
function
|
|
1131
|
-
return e &&
|
|
1132
|
-
}
|
|
1133
|
-
function
|
|
1134
|
-
return e &&
|
|
1135
|
-
}
|
|
1136
|
-
function
|
|
1137
|
-
return e &&
|
|
1138
|
-
}
|
|
1139
|
-
const
|
|
1140
|
-
bytes:
|
|
1141
|
-
dash:
|
|
1142
|
-
dashZeros:
|
|
1143
|
-
number:
|
|
1144
|
-
phone:
|
|
1145
|
-
upperFirst:
|
|
1146
|
-
startCase:
|
|
1147
|
-
upperCase:
|
|
1148
|
-
upperWords:
|
|
1149
|
-
desnake:
|
|
1150
|
-
usCurrency:
|
|
1151
|
-
divide:
|
|
1152
|
-
date:
|
|
1153
|
-
time:
|
|
1154
|
-
dateTime:
|
|
1155
|
-
oneDayForward:
|
|
1156
|
-
},
|
|
1157
|
-
...
|
|
1158
|
-
...e(
|
|
1159
|
-
}),
|
|
1160
|
-
function
|
|
1198
|
+
function po(e, t) {
|
|
1199
|
+
return e && P(new Date(e), t ?? F.defaultDateFormat);
|
|
1200
|
+
}
|
|
1201
|
+
function vo(e, t) {
|
|
1202
|
+
return e && P(new Date(e), t ?? F.defaultTimeFormat);
|
|
1203
|
+
}
|
|
1204
|
+
function mo(e, t) {
|
|
1205
|
+
return e && P(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1206
|
+
}
|
|
1207
|
+
function ho(e) {
|
|
1208
|
+
return e && P(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
|
|
1209
|
+
}
|
|
1210
|
+
const We = {
|
|
1211
|
+
bytes: to,
|
|
1212
|
+
dash: no,
|
|
1213
|
+
dashZeros: oo,
|
|
1214
|
+
number: so,
|
|
1215
|
+
phone: ro,
|
|
1216
|
+
upperFirst: io,
|
|
1217
|
+
startCase: ut,
|
|
1218
|
+
upperCase: lo,
|
|
1219
|
+
upperWords: ao,
|
|
1220
|
+
desnake: uo,
|
|
1221
|
+
usCurrency: co,
|
|
1222
|
+
divide: fo,
|
|
1223
|
+
date: po,
|
|
1224
|
+
time: vo,
|
|
1225
|
+
dateTime: mo,
|
|
1226
|
+
oneDayForward: ho
|
|
1227
|
+
}, ds = (e) => ({
|
|
1228
|
+
...We,
|
|
1229
|
+
...e(We)
|
|
1230
|
+
}), Me = Symbol("HookState");
|
|
1231
|
+
function fs(e, t) {
|
|
1161
1232
|
const n = t ?? be();
|
|
1162
|
-
|
|
1233
|
+
N(() => yo(n, e), n), et(() => go(n), n), tt(() => qe(n), n), ue(() => qe(n), n);
|
|
1163
1234
|
}
|
|
1164
|
-
function
|
|
1235
|
+
function yo(e, t) {
|
|
1165
1236
|
const n = {};
|
|
1166
|
-
if (t.elScrolledToBottom && (n.el = new
|
|
1167
|
-
const o =
|
|
1168
|
-
o ? n.ancestor = new
|
|
1237
|
+
if (t.elScrolledToBottom && (n.el = new Z(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1238
|
+
const o = ct(e.vnode.el);
|
|
1239
|
+
o ? n.ancestor = new Z(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
1169
1240
|
}
|
|
1170
|
-
t.windowScrolledToBottom && (n.window = new
|
|
1241
|
+
t.windowScrolledToBottom && (n.window = new Z(window, t.windowScrolledToBottom)), e[Me] = n;
|
|
1171
1242
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const t = e[
|
|
1243
|
+
function go(e) {
|
|
1244
|
+
const t = e[Me];
|
|
1174
1245
|
t?.el?.install(), t?.ancestor?.install(), t?.window?.install();
|
|
1175
1246
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const t = e[
|
|
1247
|
+
function qe(e) {
|
|
1248
|
+
const t = e[Me];
|
|
1178
1249
|
t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
|
|
1179
1250
|
}
|
|
1180
1251
|
const ge = ["auto", "scroll"];
|
|
1181
|
-
function
|
|
1252
|
+
function ct(e) {
|
|
1182
1253
|
const t = e.parentElement;
|
|
1183
1254
|
if (!t) return null;
|
|
1184
1255
|
const n = window.getComputedStyle(t);
|
|
1185
|
-
return ge.includes(n.overflow) || ge.includes(n.overflowX) || ge.includes(n.overflowY) ? t :
|
|
1256
|
+
return ge.includes(n.overflow) || ge.includes(n.overflowX) || ge.includes(n.overflowY) ? t : ct(t);
|
|
1186
1257
|
}
|
|
1187
|
-
class
|
|
1258
|
+
class Z {
|
|
1188
1259
|
constructor(t, n) {
|
|
1189
1260
|
this.el = t, this.handler = n, this.install();
|
|
1190
1261
|
}
|
|
@@ -1200,25 +1271,25 @@ class G {
|
|
|
1200
1271
|
Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight ? this.isTripped || (this.handler(t), this.isTripped = !0) : this.isTripped && (this.isTripped = !1);
|
|
1201
1272
|
}
|
|
1202
1273
|
}
|
|
1203
|
-
function
|
|
1204
|
-
|
|
1274
|
+
function ps(e) {
|
|
1275
|
+
N(() => window.addEventListener("resize", e)), et(() => window.addEventListener("resize", e)), tt(() => window.removeEventListener("resize", e)), ue(() => window.removeEventListener("resize", e));
|
|
1205
1276
|
}
|
|
1206
|
-
const
|
|
1207
|
-
mounted:
|
|
1208
|
-
updated:
|
|
1209
|
-
},
|
|
1210
|
-
function
|
|
1211
|
-
if (t.value === void 0 && e[
|
|
1212
|
-
e[
|
|
1277
|
+
const wo = {
|
|
1278
|
+
mounted: Ke,
|
|
1279
|
+
updated: Ke
|
|
1280
|
+
}, ze = Symbol("HasAutoFocused");
|
|
1281
|
+
function Ke(e, t) {
|
|
1282
|
+
if (t.value === void 0 && e[ze] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
|
|
1283
|
+
e[ze] = !0;
|
|
1213
1284
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1214
1285
|
setTimeout(() => n.focus(), 10);
|
|
1215
1286
|
}
|
|
1216
|
-
const
|
|
1217
|
-
mounted:
|
|
1287
|
+
const Eo = {
|
|
1288
|
+
mounted: bo
|
|
1218
1289
|
}, K = Symbol("ConfirmState");
|
|
1219
|
-
function
|
|
1290
|
+
function bo(e, t) {
|
|
1220
1291
|
e.addEventListener("click", (n) => {
|
|
1221
|
-
const o = Date.now(),
|
|
1292
|
+
const o = Date.now(), r = t.value?.text !== void 0 ? t.value.text : "Confirm";
|
|
1222
1293
|
if (e[K]) {
|
|
1223
1294
|
if (o - e[K].initTime < 300)
|
|
1224
1295
|
return;
|
|
@@ -1230,158 +1301,158 @@ function ho(e, t) {
|
|
|
1230
1301
|
initTime: o,
|
|
1231
1302
|
preconfirmHtml: e.innerHTML,
|
|
1232
1303
|
resetHandler: () => {
|
|
1233
|
-
|
|
1304
|
+
r && (e.innerHTML = s.preconfirmHtml), t.value?.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
|
|
1234
1305
|
}
|
|
1235
1306
|
};
|
|
1236
|
-
e[K] = s,
|
|
1307
|
+
e[K] = s, r && (e.innerHTML = r), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
|
|
1237
1308
|
});
|
|
1238
1309
|
}
|
|
1239
|
-
const
|
|
1240
|
-
beforeMount:
|
|
1310
|
+
const ko = {
|
|
1311
|
+
beforeMount: To
|
|
1241
1312
|
};
|
|
1242
|
-
function
|
|
1313
|
+
function To(e) {
|
|
1243
1314
|
e.addEventListener("blur", () => {
|
|
1244
1315
|
let t = e.value;
|
|
1245
|
-
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" +
|
|
1316
|
+
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
|
|
1246
1317
|
const n = Date.parse(t);
|
|
1247
|
-
isNaN(n) ? e.value = "" : e.value =
|
|
1318
|
+
isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1248
1319
|
});
|
|
1249
1320
|
}
|
|
1250
|
-
const
|
|
1251
|
-
beforeMount:
|
|
1252
|
-
updated:
|
|
1321
|
+
const So = {
|
|
1322
|
+
beforeMount: Ye,
|
|
1323
|
+
updated: Ye
|
|
1253
1324
|
};
|
|
1254
|
-
function
|
|
1255
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1325
|
+
function Ye(e, t) {
|
|
1326
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = Co(e, t));
|
|
1256
1327
|
}
|
|
1257
|
-
function
|
|
1328
|
+
function Co(e, t) {
|
|
1258
1329
|
if (!t.value)
|
|
1259
1330
|
return e.attributes.getNamedItem("placeholder")?.value ?? "";
|
|
1260
1331
|
let n = "";
|
|
1261
|
-
const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"),
|
|
1332
|
+
const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), r = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), s = new Date(r);
|
|
1262
1333
|
e.attributes.getNamedItem("display-utc") !== null && s.setMinutes(s.getMinutes() - s.getTimezoneOffset());
|
|
1263
|
-
let
|
|
1264
|
-
const
|
|
1265
|
-
if (!
|
|
1334
|
+
let a = e.attributes.getNamedItem("format")?.value;
|
|
1335
|
+
const l = e.attributes.getNamedItem("date-only") !== null;
|
|
1336
|
+
if (!a && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1266
1337
|
const d = /* @__PURE__ */ new Date();
|
|
1267
|
-
d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at",
|
|
1338
|
+
d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at", a = "HH:mm");
|
|
1268
1339
|
}
|
|
1269
|
-
if (!
|
|
1340
|
+
if (!a && e.attributes.getNamedItem("simplified-date") !== null) {
|
|
1270
1341
|
let d = null;
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1342
|
+
const h = /* @__PURE__ */ new Date();
|
|
1343
|
+
h.getFullYear() === s.getFullYear() ? (h.getMonth() !== s.getMonth() || h.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
|
|
1344
|
+
const m = l ? null : F.defaultTimeFormat;
|
|
1345
|
+
a = nt([d, m]).join(" ");
|
|
1275
1346
|
}
|
|
1276
|
-
|
|
1277
|
-
let
|
|
1278
|
-
return n && (
|
|
1347
|
+
a || (l ? a = F.defaultDateFormat : a = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1348
|
+
let u = P(s, a);
|
|
1349
|
+
return n && (u = n + " " + u), u;
|
|
1279
1350
|
}
|
|
1280
|
-
const
|
|
1281
|
-
beforeMount:
|
|
1282
|
-
updated:
|
|
1283
|
-
unmounted:
|
|
1351
|
+
const xo = {
|
|
1352
|
+
beforeMount: Xe,
|
|
1353
|
+
updated: Xe,
|
|
1354
|
+
unmounted: Mo
|
|
1284
1355
|
};
|
|
1285
|
-
function
|
|
1356
|
+
function Xe(e, t) {
|
|
1286
1357
|
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");
|
|
1287
1358
|
}
|
|
1288
|
-
function
|
|
1359
|
+
function Mo(e) {
|
|
1289
1360
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1290
1361
|
}
|
|
1291
|
-
const
|
|
1292
|
-
beforeMount:
|
|
1293
|
-
updated:
|
|
1294
|
-
unmounted:
|
|
1295
|
-
}, ee = Symbol("HasAutoFocused"),
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1362
|
+
const Lo = {
|
|
1363
|
+
beforeMount: Ge,
|
|
1364
|
+
updated: Ge,
|
|
1365
|
+
unmounted: ft
|
|
1366
|
+
}, ee = Symbol("HasAutoFocused"), Le = [];
|
|
1367
|
+
function Fo() {
|
|
1368
|
+
Le.forEach(dt);
|
|
1298
1369
|
}
|
|
1299
|
-
setInterval(
|
|
1300
|
-
function
|
|
1370
|
+
setInterval(Fo, 1e3);
|
|
1371
|
+
function Ge(e, t) {
|
|
1301
1372
|
if (t.value == t.oldValue) return;
|
|
1302
|
-
if (!t.value) return
|
|
1303
|
-
const n = new Date(t.value), o = e.attributes.getNamedItem("base-time")?.value,
|
|
1304
|
-
e[ee] ||
|
|
1305
|
-
startTs:
|
|
1373
|
+
if (!t.value) return ft(e);
|
|
1374
|
+
const n = new Date(t.value), o = e.attributes.getNamedItem("base-time")?.value, r = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
|
|
1375
|
+
e[ee] || Le.push(e), e[ee] = {
|
|
1376
|
+
startTs: r,
|
|
1306
1377
|
includeSeconds: s
|
|
1307
|
-
},
|
|
1378
|
+
}, dt(e);
|
|
1308
1379
|
}
|
|
1309
|
-
function
|
|
1380
|
+
function dt(e) {
|
|
1310
1381
|
const t = e[ee], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1311
|
-
e.innerText =
|
|
1382
|
+
e.innerText = Oo(n, t.includeSeconds);
|
|
1312
1383
|
}
|
|
1313
|
-
function
|
|
1314
|
-
e[ee] && (
|
|
1384
|
+
function ft(e) {
|
|
1385
|
+
e[ee] && (Xt(Le, e), delete e[ee]), e.innerText = "-";
|
|
1315
1386
|
}
|
|
1316
|
-
function
|
|
1387
|
+
function Oo(e, t) {
|
|
1317
1388
|
const n = [], o = Math.floor(e / 86400);
|
|
1318
1389
|
o && n.push(o + "d"), e -= o * 86400;
|
|
1319
|
-
const
|
|
1320
|
-
(o ||
|
|
1390
|
+
const r = Math.floor(e / 3600);
|
|
1391
|
+
(o || r) && n.push(r + "h"), e -= r * 3600;
|
|
1321
1392
|
const s = Math.floor(e / 60);
|
|
1322
|
-
return (o ||
|
|
1393
|
+
return (o || r || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
|
|
1323
1394
|
}
|
|
1324
|
-
const
|
|
1325
|
-
mounted:
|
|
1326
|
-
updated:
|
|
1327
|
-
unmounted:
|
|
1395
|
+
const Io = {
|
|
1396
|
+
mounted: pt,
|
|
1397
|
+
updated: Do,
|
|
1398
|
+
unmounted: vt
|
|
1328
1399
|
}, j = /* @__PURE__ */ new Map();
|
|
1329
|
-
function
|
|
1330
|
-
j.size === 0 && window.addEventListener("keydown",
|
|
1400
|
+
function pt(e, t) {
|
|
1401
|
+
j.size === 0 && window.addEventListener("keydown", mt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
|
|
1331
1402
|
}
|
|
1332
|
-
function
|
|
1403
|
+
function vt(e, t) {
|
|
1333
1404
|
const n = j.get(t.value.toLowerCase());
|
|
1334
1405
|
if (n) {
|
|
1335
1406
|
const o = n.indexOf(e);
|
|
1336
1407
|
o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
|
|
1337
1408
|
}
|
|
1338
|
-
j.size === 0 && window.removeEventListener("keydown",
|
|
1409
|
+
j.size === 0 && window.removeEventListener("keydown", mt);
|
|
1339
1410
|
}
|
|
1340
|
-
function
|
|
1341
|
-
|
|
1411
|
+
function Do(e, t) {
|
|
1412
|
+
vt(e, t), pt(e, t);
|
|
1342
1413
|
}
|
|
1343
|
-
function
|
|
1414
|
+
function mt(e) {
|
|
1344
1415
|
if (typeof e.key != "string") return;
|
|
1345
1416
|
const t = e.key.toLowerCase(), n = j.get(t);
|
|
1346
|
-
n && (
|
|
1417
|
+
n && (Gt(n)?.click(), e.preventDefault());
|
|
1347
1418
|
}
|
|
1348
|
-
const Y = Symbol("InfiniteScrollHandler"),
|
|
1419
|
+
const Y = Symbol("InfiniteScrollHandler"), Ho = {
|
|
1349
1420
|
mounted(e, t) {
|
|
1350
|
-
e[Y] = new
|
|
1421
|
+
e[Y] = new Z(e, t.value);
|
|
1351
1422
|
},
|
|
1352
1423
|
updated(e, t) {
|
|
1353
|
-
e[Y]?.uninstall(), e[Y] = new
|
|
1424
|
+
e[Y]?.uninstall(), e[Y] = new Z(e, t.value);
|
|
1354
1425
|
},
|
|
1355
1426
|
unmounted(e) {
|
|
1356
1427
|
e[Y]?.uninstall(), delete e[Y];
|
|
1357
1428
|
}
|
|
1358
|
-
},
|
|
1429
|
+
}, Vo = {
|
|
1359
1430
|
beforeMount: Ze,
|
|
1360
1431
|
updated: Ze
|
|
1361
1432
|
};
|
|
1362
1433
|
function Ze(e, t) {
|
|
1363
1434
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1364
1435
|
}
|
|
1365
|
-
const
|
|
1366
|
-
mounted:
|
|
1367
|
-
updated:
|
|
1368
|
-
unmounted:
|
|
1436
|
+
const Ao = {
|
|
1437
|
+
mounted: Je,
|
|
1438
|
+
updated: Je,
|
|
1439
|
+
unmounted: ht
|
|
1369
1440
|
}, J = Symbol("TooltipState");
|
|
1370
|
-
function
|
|
1441
|
+
function Je(e, t) {
|
|
1371
1442
|
let n = e.attributes.getNamedItem("tip")?.value ?? t.value;
|
|
1372
1443
|
if (t.value || (n = null), n) {
|
|
1373
1444
|
const o = {
|
|
1374
1445
|
content: n,
|
|
1375
1446
|
html: e.getAttribute("html") !== null
|
|
1376
1447
|
};
|
|
1377
|
-
e[J] ? e[J].configure(o) : e[J] = new
|
|
1448
|
+
e[J] ? e[J].configure(o) : e[J] = new $o(e, o);
|
|
1378
1449
|
} else
|
|
1379
|
-
|
|
1450
|
+
ht(e);
|
|
1380
1451
|
}
|
|
1381
|
-
function
|
|
1452
|
+
function ht(e) {
|
|
1382
1453
|
e[J]?.destroy(), delete e[J];
|
|
1383
1454
|
}
|
|
1384
|
-
class
|
|
1455
|
+
class $o {
|
|
1385
1456
|
constructor(t, n) {
|
|
1386
1457
|
this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1387
1458
|
}
|
|
@@ -1417,9 +1488,9 @@ class Io {
|
|
|
1417
1488
|
this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
|
|
1418
1489
|
}
|
|
1419
1490
|
handleMouseMove(t) {
|
|
1420
|
-
const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight,
|
|
1421
|
-
let
|
|
1422
|
-
|
|
1491
|
+
const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, r = window.innerWidth, s = window.innerHeight;
|
|
1492
|
+
let a = t.pageX + 10, l = t.pageY + 20;
|
|
1493
|
+
a + n > r && (a = Math.max(10, t.pageX - 5 - n)), l + o > s && (l = Math.max(10, t.pageY - 5 - o)), this.tipEl.style.left = a + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
|
|
1423
1494
|
}
|
|
1424
1495
|
checkMoveEvent() {
|
|
1425
1496
|
this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
|
|
@@ -1428,64 +1499,64 @@ class Io {
|
|
|
1428
1499
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1429
1500
|
}
|
|
1430
1501
|
}
|
|
1431
|
-
function
|
|
1432
|
-
e.directive("autofocus",
|
|
1502
|
+
function Bo(e) {
|
|
1503
|
+
e.directive("autofocus", wo), e.directive("confirm-button", Eo), e.directive("date-input", ko), e.directive("datetime", So), e.directive("disabled", xo), e.directive("duration", Lo), e.directive("hotkey", Io), e.directive("infinite-scroll", Ho), e.directive("readonly", Vo), e.directive("tooltip", Ao);
|
|
1433
1504
|
}
|
|
1434
|
-
function
|
|
1435
|
-
|
|
1505
|
+
function vs(e) {
|
|
1506
|
+
Bo(e);
|
|
1436
1507
|
}
|
|
1437
1508
|
export {
|
|
1438
|
-
|
|
1509
|
+
Wo as OverlayContainer,
|
|
1439
1510
|
de as UserError,
|
|
1440
|
-
|
|
1511
|
+
jo as VfAjaxSelect,
|
|
1441
1512
|
ne as VfAlertModal,
|
|
1442
|
-
|
|
1513
|
+
as as VfEzSmartSelect,
|
|
1443
1514
|
gn as VfModal,
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1515
|
+
Xn as VfSmartSelect,
|
|
1516
|
+
os as cloneProp,
|
|
1517
|
+
Po as configureVf,
|
|
1518
|
+
rs as configureVfOpenApiClient,
|
|
1519
|
+
ds as createFilters,
|
|
1449
1520
|
ce as createOverlayInjection,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1521
|
+
Nn as desnakeCase,
|
|
1522
|
+
ln as dismissOverlayInjectionById,
|
|
1523
|
+
qo as dismissOverlayInjectionByInstance,
|
|
1524
|
+
ot as dismissOverlayInjectionByInternalInstance,
|
|
1525
|
+
rn as dismissOverlayInjectionByVnode,
|
|
1526
|
+
ys as escapeHtml,
|
|
1456
1527
|
cn as formatError,
|
|
1457
1528
|
kn as formatNumber,
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1529
|
+
_n as formatPhone,
|
|
1530
|
+
Rn as formatUSCurrency,
|
|
1531
|
+
Zo as handleError,
|
|
1532
|
+
Go as handleErrorAndAlert,
|
|
1533
|
+
vs as installVf,
|
|
1463
1534
|
dn as isError,
|
|
1464
|
-
|
|
1465
|
-
|
|
1535
|
+
je as isNotNullOrUndefined,
|
|
1536
|
+
Jo as maskComponent,
|
|
1466
1537
|
fn as maskEl,
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1538
|
+
pn as maskForm,
|
|
1539
|
+
is as nl2br,
|
|
1540
|
+
ss as nullifyEmptyInputs,
|
|
1470
1541
|
Te as presentOverlay,
|
|
1471
1542
|
Q as removeOverlayInjection,
|
|
1472
|
-
|
|
1543
|
+
es as replaceElement,
|
|
1473
1544
|
un as showAlert,
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1545
|
+
zo as showConfirm,
|
|
1546
|
+
Ko as showConfirmDestroy,
|
|
1547
|
+
ts as showContextMenu,
|
|
1548
|
+
Xo as showMutableWait,
|
|
1549
|
+
cs as showToast,
|
|
1550
|
+
Yo as showWait,
|
|
1480
1551
|
bn as sleep,
|
|
1481
|
-
|
|
1552
|
+
ns as sleepSecs,
|
|
1482
1553
|
Se as toError,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1554
|
+
Qo as unmaskComponent,
|
|
1555
|
+
st as unmaskEl,
|
|
1556
|
+
rt as unmaskForm,
|
|
1486
1557
|
an as updateOverlayProps,
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1558
|
+
fs as useInfiniteScroll,
|
|
1559
|
+
ps as useResizeWatcher,
|
|
1560
|
+
ls as uuid,
|
|
1561
|
+
us as vfModalRef
|
|
1491
1562
|
};
|