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