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