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