@signal24/vue-foundation 4.19.1 → 4.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as N, ref as T, computed as
|
|
5
|
-
import { compact as
|
|
6
|
-
import { escapeHtml as
|
|
7
|
-
import { escapeHtml as
|
|
8
|
-
import { configureOpenApiClient as
|
|
9
|
-
import { format as
|
|
10
|
-
const
|
|
1
|
+
var Tt = Object.defineProperty;
|
|
2
|
+
var St = (e, t, n) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var O = (e, t, n) => St(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as N, ref as T, computed as M, watch as A, onMounted as V, openBlock as E, createElementBlock as k, createElementVNode as F, toDisplayString as U, withDirectives as Q, createCommentVNode as D, Fragment as J, renderList as he, vModelSelect as Ct, getCurrentInstance as pe, withModifiers as ye, normalizeStyle as xt, normalizeClass as $, renderSlot as G, reactive as Lt, h as ee, Teleport as Mt, markRaw as It, onBeforeUnmount as ge, resolveDirective as Ht, createBlock as qe, createSlots as Ot, withCtx as ue, createTextVNode as ce, vModelText as At, onActivated as ze, onDeactivated as Ye } from "vue";
|
|
5
|
+
import { compact as Ke, debounce as Ft, isEqual as Xe, startCase as Dt, upperFirst as Bt, cloneDeep as $t, remove as Vt, last as _t } from "lodash";
|
|
6
|
+
import { escapeHtml as Nt } from "@vue/shared";
|
|
7
|
+
import { escapeHtml as Uo } from "@vue/shared";
|
|
8
|
+
import { configureOpenApiClient as Rt, OpenApiError as Wt } from "@signal24/openapi-client-codegen/browser";
|
|
9
|
+
import { format as ve } from "date-fns";
|
|
10
|
+
const Ut = {
|
|
11
11
|
key: 0,
|
|
12
12
|
disabled: ""
|
|
13
|
-
},
|
|
13
|
+
}, jt = {
|
|
14
14
|
key: 0,
|
|
15
15
|
value: null
|
|
16
|
-
},
|
|
16
|
+
}, Pt = ["value"], mo = /* @__PURE__ */ N({
|
|
17
17
|
__name: "vf-ajax-select",
|
|
18
18
|
props: {
|
|
19
19
|
modelValue: {},
|
|
@@ -25,104 +25,104 @@ const Rt = {
|
|
|
25
25
|
},
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
27
|
setup(e, { emit: t }) {
|
|
28
|
-
const n = e, o = t, i = T(null), l =
|
|
29
|
-
const b =
|
|
28
|
+
const n = e, o = t, i = T(null), l = M(() => i.value ? i.value.map((g) => {
|
|
29
|
+
const b = g;
|
|
30
30
|
return n.preprocesor ? n.preprocesor(b) : n.displayKey ? b[n.displayKey] : "";
|
|
31
31
|
}) : null), u = T(n.modelValue ?? null);
|
|
32
|
-
|
|
32
|
+
A(() => n.loadFn, r), A(
|
|
33
33
|
() => n.modelValue,
|
|
34
34
|
() => u.value = n.modelValue
|
|
35
|
-
),
|
|
35
|
+
), A(u, () => o("update:modelValue", u.value));
|
|
36
36
|
async function r() {
|
|
37
37
|
i.value = await n.loadFn();
|
|
38
38
|
}
|
|
39
|
-
return V(r), (d,
|
|
39
|
+
return V(r), (d, g) => l.value ? Q((E(), k("select", {
|
|
40
40
|
key: 1,
|
|
41
|
-
"onUpdate:modelValue":
|
|
41
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => u.value = b)
|
|
42
42
|
}, [
|
|
43
|
-
n.nullText ? (
|
|
44
|
-
(
|
|
45
|
-
var
|
|
46
|
-
return
|
|
43
|
+
n.nullText ? (E(), k("option", jt, U(n.nullText), 1)) : D("", !0),
|
|
44
|
+
(E(!0), k(J, null, he(l.value, (b, f) => {
|
|
45
|
+
var w;
|
|
46
|
+
return E(), k("option", {
|
|
47
47
|
key: f,
|
|
48
|
-
value: (
|
|
49
|
-
}, U(b), 9,
|
|
48
|
+
value: (w = i.value) == null ? void 0 : w[f]
|
|
49
|
+
}, U(b), 9, Pt);
|
|
50
50
|
}), 128))
|
|
51
51
|
], 512)), [
|
|
52
|
-
[
|
|
53
|
-
]) : (
|
|
54
|
-
|
|
52
|
+
[Ct, u.value]
|
|
53
|
+
]) : (E(), k("select", Ut, [
|
|
54
|
+
F("option", null, U(n.loadingText || "Loading..."), 1)
|
|
55
55
|
]));
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), qt = /* @__PURE__ */ N({
|
|
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 = T({ visibility: "hidden", top: "0", left: "0" }), i = T([]), l =
|
|
64
|
+
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = T({ visibility: "hidden", top: "0", left: "0" }), i = T([]), l = pe();
|
|
65
65
|
V(u);
|
|
66
66
|
function u() {
|
|
67
67
|
if (!l) return;
|
|
68
|
-
const
|
|
68
|
+
const g = l.vnode.el, { styles: b, classes: f } = r(g, n);
|
|
69
69
|
o.value = b, i.value = f;
|
|
70
70
|
}
|
|
71
|
-
function r(
|
|
72
|
-
const f = t.anchor instanceof HTMLElement ? {} : t.anchor,
|
|
73
|
-
f.matchWidth && (
|
|
71
|
+
function r(g, b) {
|
|
72
|
+
const f = t.anchor instanceof HTMLElement ? {} : t.anchor, w = b.getBoundingClientRect(), m = g.getBoundingClientRect();
|
|
73
|
+
f.matchWidth && (m.width = w.width), f.matchHeight && (m.height = w.height);
|
|
74
74
|
const a = f.class ? Array.isArray(f.class) ? f.class : [f.class] : [];
|
|
75
75
|
let c, S;
|
|
76
76
|
if (f.y === "center")
|
|
77
|
-
c =
|
|
77
|
+
c = w.top + w.height / 2 - m.height / 2, a.push("anchored-center-y");
|
|
78
78
|
else {
|
|
79
|
-
const
|
|
80
|
-
c =
|
|
79
|
+
const x = (w.bottom + m.height < window.innerHeight || f.y === "below") && f.y !== "above";
|
|
80
|
+
c = x ? w.bottom : w.top - m.height, a.push(x ? "anchored-top" : "anchored-bottom");
|
|
81
81
|
}
|
|
82
82
|
if (f.x === "center")
|
|
83
|
-
S =
|
|
83
|
+
S = w.left + w.width / 2 - m.width / 2, a.push("anchored-center-x");
|
|
84
84
|
else {
|
|
85
|
-
const
|
|
86
|
-
S =
|
|
85
|
+
const x = (w.left + m.width < window.innerWidth || f.x === "left") && f.x !== "right";
|
|
86
|
+
S = x ? w.left : w.right - m.width, a.push(x ? "anchored-left" : "anchored-right");
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
89
|
styles: {
|
|
90
90
|
top: `${c}px`,
|
|
91
91
|
left: `${S}px`,
|
|
92
|
-
...f.matchWidth ? { width: `${
|
|
93
|
-
...f.matchHeight ? { height: `${
|
|
92
|
+
...f.matchWidth ? { width: `${m.width}px` } : {},
|
|
93
|
+
...f.matchHeight ? { height: `${m.height}px` } : {}
|
|
94
94
|
},
|
|
95
95
|
classes: a
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
function d() {
|
|
99
|
-
window.removeEventListener("click", d),
|
|
99
|
+
window.removeEventListener("click", d), Kt(t.overlayId);
|
|
100
100
|
}
|
|
101
101
|
return V(() => {
|
|
102
102
|
setTimeout(() => {
|
|
103
103
|
window.addEventListener("click", d);
|
|
104
104
|
}, 10);
|
|
105
|
-
}), (
|
|
106
|
-
class:
|
|
107
|
-
style:
|
|
108
|
-
onClick:
|
|
105
|
+
}), (g, b) => (E(), k("div", {
|
|
106
|
+
class: $(["vf-overlay-anchor", i.value]),
|
|
107
|
+
style: xt(o.value),
|
|
108
|
+
onClick: ye(d, ["stop"])
|
|
109
109
|
}, [
|
|
110
|
-
G(
|
|
110
|
+
G(g.$slots, "default")
|
|
111
111
|
], 6));
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
-
let
|
|
115
|
-
const _ =
|
|
114
|
+
let zt = 0;
|
|
115
|
+
const _ = Lt([]), ho = N({
|
|
116
116
|
setup() {
|
|
117
117
|
return () => ee("div", [
|
|
118
|
-
|
|
118
|
+
he(_, (e) => ee(Mt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
|
|
119
119
|
]);
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
|
-
function
|
|
122
|
+
function we(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 i = String(++
|
|
125
|
+
const i = String(++zt), l = It(e), u = ee(l, t), r = n != null && n.anchor ? ee(qt, { overlayId: i, anchor: n.anchor }, () => [u]) : void 0, d = {
|
|
126
126
|
id: i,
|
|
127
127
|
component: l,
|
|
128
128
|
props: t,
|
|
@@ -132,19 +132,19 @@ function ge(e, t, n) {
|
|
|
132
132
|
};
|
|
133
133
|
return _.push(d), d;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
e.$ &&
|
|
135
|
+
function po(e) {
|
|
136
|
+
e.$ && Ze(e.$);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Ze(e) {
|
|
139
139
|
let t = e;
|
|
140
|
-
for (; t && !
|
|
140
|
+
for (; t && !Yt(t.vnode); )
|
|
141
141
|
t = t.parent;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Yt(e) {
|
|
144
144
|
const t = _.findIndex((n) => n.vnode.component === e.component);
|
|
145
145
|
return t >= 0 ? (_[t].props.callback(), !0) : !1;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Kt(e) {
|
|
148
148
|
const t = _.findIndex((n) => n.id === e);
|
|
149
149
|
return t >= 0 ? (_[t].props.callback(), !0) : !1;
|
|
150
150
|
}
|
|
@@ -163,7 +163,7 @@ async function Ee(e, t, n) {
|
|
|
163
163
|
}
|
|
164
164
|
te(i), o(r);
|
|
165
165
|
} };
|
|
166
|
-
i =
|
|
166
|
+
i = we(e, u, n);
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
function ne(e, t) {
|
|
@@ -172,17 +172,17 @@ function ne(e, t) {
|
|
|
172
172
|
classes: e.classes ?? []
|
|
173
173
|
} : { title: t ? e : void 0, message: t ?? e, classes: [] };
|
|
174
174
|
}
|
|
175
|
-
async function
|
|
175
|
+
async function Xt(e, t) {
|
|
176
176
|
await Ee(le, ne(e, t));
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
178
|
+
async function yo(e, t) {
|
|
179
179
|
const n = ne(e, t);
|
|
180
180
|
return await Ee(le, {
|
|
181
181
|
...n,
|
|
182
182
|
shouldConfirm: !0
|
|
183
183
|
}) === !0;
|
|
184
184
|
}
|
|
185
|
-
async function
|
|
185
|
+
async function go(e, t) {
|
|
186
186
|
const n = ne(e, t);
|
|
187
187
|
return await Ee(le, {
|
|
188
188
|
...n,
|
|
@@ -190,8 +190,8 @@ async function po(e, t) {
|
|
|
190
190
|
classes: ["destructive", ...n.classes]
|
|
191
191
|
}) === !0;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const n = ne(e, t), o =
|
|
193
|
+
function wo(e, t) {
|
|
194
|
+
const n = ne(e, t), o = we(le, {
|
|
195
195
|
...n,
|
|
196
196
|
isBare: !0,
|
|
197
197
|
classes: ["wait", ...n.classes],
|
|
@@ -200,66 +200,66 @@ function yo(e, t) {
|
|
|
200
200
|
});
|
|
201
201
|
return () => te(o);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const B = {
|
|
204
204
|
unhandledErrorSupportText: "please contact support",
|
|
205
205
|
errorHandler: (e) => console.error("Unhandled error:", e),
|
|
206
206
|
defaultDateFormat: "M/d/yy",
|
|
207
207
|
defaultTimeFormat: "H:mm"
|
|
208
208
|
};
|
|
209
|
-
function
|
|
210
|
-
Object.assign(
|
|
209
|
+
function Eo(e) {
|
|
210
|
+
Object.assign(B, e);
|
|
211
211
|
}
|
|
212
212
|
class oe extends Error {
|
|
213
213
|
constructor(t) {
|
|
214
214
|
super(t), this.name = "UserError";
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Zt(e) {
|
|
218
218
|
return e instanceof oe ? e.message : `An application error has occurred:
|
|
219
219
|
|
|
220
|
-
${
|
|
220
|
+
${ke(e).message}
|
|
221
221
|
|
|
222
|
-
Please refresh the page and try again. If this error persists, ${
|
|
222
|
+
Please refresh the page and try again. If this error persists, ${B.unhandledErrorSupportText}.`;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function ke(e) {
|
|
225
225
|
return e instanceof Error ? e : new Error(String(e));
|
|
226
226
|
}
|
|
227
|
-
async function
|
|
228
|
-
const n =
|
|
229
|
-
return n instanceof oe ||
|
|
227
|
+
async function ko(e, t) {
|
|
228
|
+
const n = ke(e);
|
|
229
|
+
return n instanceof oe || B.errorHandler(n), Xt({
|
|
230
230
|
title: t == null ? void 0 : t.title,
|
|
231
231
|
message: n,
|
|
232
232
|
classes: t == null ? void 0 : t.classes
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
async function
|
|
236
|
-
const t =
|
|
237
|
-
t instanceof oe ||
|
|
235
|
+
async function bo(e) {
|
|
236
|
+
const t = ke(e);
|
|
237
|
+
t instanceof oe || B.errorHandler(t);
|
|
238
238
|
}
|
|
239
239
|
const z = Symbol("MaskState");
|
|
240
|
-
function
|
|
240
|
+
function To(e, t) {
|
|
241
241
|
var i;
|
|
242
242
|
const n = (i = e.$) == null ? void 0 : i.vnode.el, o = n.closest(".vf-modal");
|
|
243
|
-
return
|
|
243
|
+
return Gt(o ?? n, t);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function So(e) {
|
|
246
246
|
var o;
|
|
247
247
|
const t = (o = e.$) == null ? void 0 : o.vnode.el, n = t.closest(".vf-modal");
|
|
248
|
-
return
|
|
248
|
+
return Ge(n ?? t);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Gt(e, t) {
|
|
251
251
|
if (!e[z]) {
|
|
252
252
|
const n = document.createElement("div");
|
|
253
253
|
n.classList.add("vf-mask"), e.appendChild(n), e[z] = { maskEl: n };
|
|
254
254
|
}
|
|
255
|
-
return e[z].maskEl.innerText = t ?? "", () =>
|
|
255
|
+
return e[z].maskEl.innerText = t ?? "", () => Ge(e);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Ge(e) {
|
|
258
258
|
e[z] && e.removeChild(e[z].maskEl);
|
|
259
259
|
}
|
|
260
|
-
const
|
|
261
|
-
function
|
|
262
|
-
const o = e instanceof Element ? e :
|
|
260
|
+
const me = Symbol("FormMaskState");
|
|
261
|
+
function Qt(e, t, n) {
|
|
262
|
+
const o = e instanceof Element ? e : Je(e);
|
|
263
263
|
if (!o) return () => {
|
|
264
264
|
};
|
|
265
265
|
o.classList.add("vf-masked");
|
|
@@ -267,30 +267,30 @@ function Zt(e, t, n) {
|
|
|
267
267
|
let l;
|
|
268
268
|
i && (l = i.tagName === "INPUT" ? i.value : i.innerHTML, i.setAttribute("disabled", "disabled"), i.innerText = n ?? "Please wait...");
|
|
269
269
|
const r = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
270
|
-
return r.forEach((d) => d.setAttribute("disabled", "disabled")), o[
|
|
270
|
+
return r.forEach((d) => d.setAttribute("disabled", "disabled")), o[me] = {
|
|
271
271
|
disabledElements: r,
|
|
272
272
|
waitButton: i,
|
|
273
273
|
buttonHtml: l
|
|
274
|
-
}, () =>
|
|
274
|
+
}, () => Qe(o);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const t = e instanceof Element ? e :
|
|
276
|
+
function Qe(e) {
|
|
277
|
+
const t = e instanceof Element ? e : Je(e);
|
|
278
278
|
if (!t) return;
|
|
279
|
-
const n = t[
|
|
280
|
-
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[
|
|
279
|
+
const n = t[me];
|
|
280
|
+
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[me]);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Je(e) {
|
|
283
283
|
var n;
|
|
284
284
|
const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
|
|
285
285
|
return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
287
|
+
const Jt = ["id"], en = {
|
|
288
288
|
key: 0,
|
|
289
289
|
class: "vf-modal-header"
|
|
290
|
-
},
|
|
290
|
+
}, tn = { class: "vf-modal-content" }, nn = {
|
|
291
291
|
key: 1,
|
|
292
292
|
class: "vf-modal-footer"
|
|
293
|
-
},
|
|
293
|
+
}, on = /* @__PURE__ */ N({
|
|
294
294
|
__name: "vf-modal",
|
|
295
295
|
props: {
|
|
296
296
|
id: {},
|
|
@@ -301,70 +301,70 @@ const Gt = ["id"], Qt = {
|
|
|
301
301
|
},
|
|
302
302
|
emits: ["formSubmit"],
|
|
303
303
|
setup(e, { expose: t }) {
|
|
304
|
-
const n =
|
|
305
|
-
t({ mask: f, unmask:
|
|
306
|
-
const i = T(), l = T(), u = T(!1), r =
|
|
304
|
+
const n = pe(), o = e;
|
|
305
|
+
t({ mask: f, unmask: w, hide: m, unhide: a });
|
|
306
|
+
const i = T(), l = T(), u = T(!1), r = M(() => Ke([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
|
|
307
307
|
V(() => {
|
|
308
308
|
var c;
|
|
309
|
-
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown",
|
|
310
|
-
}),
|
|
311
|
-
window.removeEventListener("keydown",
|
|
309
|
+
document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", g), (c = i.value) == null || c.addEventListener("click", d));
|
|
310
|
+
}), ge(() => {
|
|
311
|
+
window.removeEventListener("keydown", g), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
312
312
|
});
|
|
313
313
|
function d(c) {
|
|
314
314
|
c.target == i.value && b();
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function g(c) {
|
|
317
317
|
if (c.key === "Esc" || c.key === "Escape") {
|
|
318
318
|
const S = document.querySelectorAll(".vf-modal-wrap");
|
|
319
319
|
S[S.length - 1] === i.value && b();
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
function b() {
|
|
323
|
-
|
|
323
|
+
Ze(n);
|
|
324
324
|
}
|
|
325
325
|
function f() {
|
|
326
|
-
return
|
|
326
|
+
return Qt(l.value), () => w();
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
|
|
328
|
+
function w() {
|
|
329
|
+
Qe(l.value);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function m() {
|
|
332
332
|
return u.value = !0, () => a();
|
|
333
333
|
}
|
|
334
334
|
function a() {
|
|
335
335
|
u.value = !1;
|
|
336
336
|
}
|
|
337
|
-
return (c, S) => (
|
|
337
|
+
return (c, S) => (E(), k("div", {
|
|
338
338
|
id: c.id,
|
|
339
339
|
ref_key: "overlay",
|
|
340
340
|
ref: i,
|
|
341
|
-
class:
|
|
341
|
+
class: $(["vf-overlay vf-modal-wrap", r.value])
|
|
342
342
|
}, [
|
|
343
|
-
|
|
343
|
+
F("form", {
|
|
344
344
|
ref_key: "form",
|
|
345
345
|
ref: l,
|
|
346
346
|
action: ".",
|
|
347
|
-
class:
|
|
348
|
-
onSubmit: S[0] || (S[0] =
|
|
347
|
+
class: $(["vf-modal", { scrolls: c.scrolls }]),
|
|
348
|
+
onSubmit: S[0] || (S[0] = ye((I) => c.$emit("formSubmit"), ["prevent"]))
|
|
349
349
|
}, [
|
|
350
|
-
c.$slots.header ? (
|
|
350
|
+
c.$slots.header ? (E(), k("div", en, [
|
|
351
351
|
G(c.$slots, "header"),
|
|
352
|
-
o.closeX ? (
|
|
352
|
+
o.closeX ? (E(), k("i", {
|
|
353
353
|
key: 0,
|
|
354
354
|
class: "close",
|
|
355
355
|
onClick: b
|
|
356
|
-
})) :
|
|
357
|
-
])) :
|
|
358
|
-
|
|
356
|
+
})) : D("", !0)
|
|
357
|
+
])) : D("", !0),
|
|
358
|
+
F("div", tn, [
|
|
359
359
|
G(c.$slots, "default")
|
|
360
360
|
]),
|
|
361
|
-
c.$slots.footer ? (
|
|
361
|
+
c.$slots.footer ? (E(), k("div", nn, [
|
|
362
362
|
G(c.$slots, "footer")
|
|
363
|
-
])) :
|
|
363
|
+
])) : D("", !0)
|
|
364
364
|
], 34)
|
|
365
|
-
], 10,
|
|
365
|
+
], 10, Jt));
|
|
366
366
|
}
|
|
367
|
-
}),
|
|
367
|
+
}), ln = ["innerHtml"], sn = ["innerText"], le = /* @__PURE__ */ N({
|
|
368
368
|
__name: "vf-alert-modal",
|
|
369
369
|
props: {
|
|
370
370
|
isBare: { type: Boolean },
|
|
@@ -376,53 +376,53 @@ const Gt = ["id"], Qt = {
|
|
|
376
376
|
callback: { type: Function }
|
|
377
377
|
},
|
|
378
378
|
setup(e) {
|
|
379
|
-
const t = e, n =
|
|
379
|
+
const t = e, n = M(() => t.message instanceof Error ? Zt(t.message) : t.message);
|
|
380
380
|
return (o, i) => {
|
|
381
|
-
const l =
|
|
382
|
-
return
|
|
383
|
-
class:
|
|
384
|
-
},
|
|
381
|
+
const l = Ht("autofocus");
|
|
382
|
+
return E(), qe(on, {
|
|
383
|
+
class: $(["vf-alert", ...o.classes ?? []])
|
|
384
|
+
}, Ot({
|
|
385
385
|
default: ue(() => [
|
|
386
|
-
o.isHtml ? (
|
|
386
|
+
o.isHtml ? (E(), k("div", {
|
|
387
387
|
key: 0,
|
|
388
388
|
innerHtml: o.message,
|
|
389
389
|
class: "user-message"
|
|
390
|
-
}, null, 8,
|
|
390
|
+
}, null, 8, ln)) : (E(), k("div", {
|
|
391
391
|
key: 1,
|
|
392
392
|
innerText: n.value
|
|
393
|
-
}, null, 8,
|
|
393
|
+
}, null, 8, sn))
|
|
394
394
|
]),
|
|
395
395
|
_: 2
|
|
396
396
|
}, [
|
|
397
397
|
o.title ? {
|
|
398
398
|
name: "header",
|
|
399
399
|
fn: ue(() => [
|
|
400
|
-
|
|
400
|
+
ce(U(o.title), 1)
|
|
401
401
|
]),
|
|
402
402
|
key: "0"
|
|
403
403
|
} : void 0,
|
|
404
404
|
o.isBare ? void 0 : {
|
|
405
405
|
name: "footer",
|
|
406
406
|
fn: ue(() => [
|
|
407
|
-
o.shouldConfirm ? (
|
|
408
|
-
Q((
|
|
407
|
+
o.shouldConfirm ? (E(), k(J, { key: 0 }, [
|
|
408
|
+
Q((E(), k("button", {
|
|
409
409
|
class: "primary",
|
|
410
410
|
onClick: i[0] || (i[0] = () => o.callback(!0))
|
|
411
411
|
}, i[3] || (i[3] = [
|
|
412
|
-
|
|
412
|
+
ce("Confirm")
|
|
413
413
|
]))), [
|
|
414
414
|
[l]
|
|
415
415
|
]),
|
|
416
|
-
|
|
416
|
+
F("button", {
|
|
417
417
|
class: "default",
|
|
418
418
|
onClick: i[1] || (i[1] = () => o.callback(!1))
|
|
419
419
|
}, "Cancel")
|
|
420
|
-
], 64)) : Q((
|
|
420
|
+
], 64)) : Q((E(), k("button", {
|
|
421
421
|
key: 1,
|
|
422
422
|
class: "default",
|
|
423
423
|
onClick: i[2] || (i[2] = () => o.callback(!0))
|
|
424
424
|
}, i[4] || (i[4] = [
|
|
425
|
-
|
|
425
|
+
ce("OK")
|
|
426
426
|
]))), [
|
|
427
427
|
[l]
|
|
428
428
|
])
|
|
@@ -432,53 +432,53 @@ const Gt = ["id"], Qt = {
|
|
|
432
432
|
]), 1032, ["class"]);
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
}),
|
|
435
|
+
}), L = [];
|
|
436
436
|
for (let e = 0; e < 256; ++e)
|
|
437
|
-
|
|
438
|
-
function
|
|
439
|
-
return (
|
|
440
|
-
}
|
|
441
|
-
let
|
|
442
|
-
const
|
|
443
|
-
function
|
|
444
|
-
if (!
|
|
437
|
+
L.push((e + 256).toString(16).slice(1));
|
|
438
|
+
function rn(e, t = 0) {
|
|
439
|
+
return (L[e[t + 0]] + L[e[t + 1]] + L[e[t + 2]] + L[e[t + 3]] + "-" + L[e[t + 4]] + L[e[t + 5]] + "-" + L[e[t + 6]] + L[e[t + 7]] + "-" + L[e[t + 8]] + L[e[t + 9]] + "-" + L[e[t + 10]] + L[e[t + 11]] + L[e[t + 12]] + L[e[t + 13]] + L[e[t + 14]] + L[e[t + 15]]).toLowerCase();
|
|
440
|
+
}
|
|
441
|
+
let de;
|
|
442
|
+
const an = new Uint8Array(16);
|
|
443
|
+
function un() {
|
|
444
|
+
if (!de) {
|
|
445
445
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
446
446
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
447
|
-
|
|
447
|
+
de = crypto.getRandomValues.bind(crypto);
|
|
448
448
|
}
|
|
449
|
-
return
|
|
449
|
+
return de(an);
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
453
|
-
if (
|
|
454
|
-
return
|
|
451
|
+
const cn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Be = { randomUUID: cn };
|
|
452
|
+
function dn(e, t, n) {
|
|
453
|
+
if (Be.randomUUID && !t && !e)
|
|
454
|
+
return Be.randomUUID();
|
|
455
455
|
e = e || {};
|
|
456
|
-
const o = e.random || (e.rng ||
|
|
457
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
456
|
+
const o = e.random || (e.rng || un)();
|
|
457
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, rn(o);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Co(e) {
|
|
460
460
|
return e.replace(/\n/g, "<br>");
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function fn(e) {
|
|
463
463
|
return e.replace(/_/g, " ");
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function vn(e) {
|
|
466
466
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
467
467
|
return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function mn(e, t = 1) {
|
|
470
470
|
return "$" + (Number(e) / t).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
472
|
+
function xo() {
|
|
473
|
+
return dn();
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const hn = ["disabled", "placeholder", "required"], pn = {
|
|
476
476
|
key: 0,
|
|
477
477
|
class: "no-results"
|
|
478
|
-
},
|
|
478
|
+
}, yn = ["onMousemove", "onMousedown"], gn = ["innerHTML"], wn = ["innerHTML"], En = {
|
|
479
479
|
key: 0,
|
|
480
480
|
class: "no-results"
|
|
481
|
-
},
|
|
481
|
+
}, kn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", bn = /* @__PURE__ */ N({
|
|
482
482
|
__name: "vf-smart-select",
|
|
483
483
|
props: {
|
|
484
484
|
modelValue: {},
|
|
@@ -503,43 +503,44 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
503
503
|
disabled: { type: Boolean },
|
|
504
504
|
optionsListId: {},
|
|
505
505
|
debug: { type: Boolean },
|
|
506
|
-
required: { type: Boolean }
|
|
506
|
+
required: { type: Boolean },
|
|
507
|
+
showCreateTextOnNewItem: { type: Boolean }
|
|
507
508
|
},
|
|
508
509
|
emits: ["optionsLoaded", "update:modelValue"],
|
|
509
510
|
setup(e, { expose: t, emit: n }) {
|
|
510
511
|
const o = Symbol("null"), i = Symbol("create"), l = e, u = n;
|
|
511
512
|
t({
|
|
512
|
-
addRemoteOption:
|
|
513
|
+
addRemoteOption: bt
|
|
513
514
|
});
|
|
514
|
-
const r = T(), d = T(),
|
|
515
|
-
var
|
|
516
|
-
const h = se.value(s), p = (
|
|
517
|
-
return l.searchFields ? l.searchFields.forEach((
|
|
518
|
-
s[
|
|
519
|
-
}) : (Z.push(
|
|
520
|
-
key: ((
|
|
515
|
+
const r = T(), d = T(), g = T(), b = T(!1), f = T(!1), w = T([]), m = T(!1), a = T(""), c = T(null), S = T(null), I = T(!1), x = T(null), Se = T(!1), rt = M(() => l.showCreateTextOnNewItem ?? !0), at = M(() => l.prependOptions ?? []), ut = M(() => l.appendOptions ?? []), Ce = M(() => !!l.disabled), ct = M(() => !f.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), dt = M(() => l.noResultsText || "No options match your search."), W = M(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = M(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : W.value ? (s) => String(W.value(s)) : null), se = M(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), xe = M(() => [...at.value, ...w.value, ...ut.value]), ie = M(() => xe.value.map((s, v) => {
|
|
516
|
+
var Ae, Fe;
|
|
517
|
+
const h = se.value(s), p = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), y = h ? h.trim().toLowerCase() : "", C = p ? p.trim().toLowerCase() : "", Z = [];
|
|
518
|
+
return l.searchFields ? l.searchFields.forEach((De) => {
|
|
519
|
+
s[De] && Z.push(String(s[De]).toLowerCase());
|
|
520
|
+
}) : (Z.push(y), C && Z.push(C)), {
|
|
521
|
+
key: ((Fe = j.value) == null ? void 0 : Fe.call(j, s)) ?? String(v),
|
|
521
522
|
title: h,
|
|
522
523
|
subtitle: p,
|
|
523
524
|
searchContent: Z.join(""),
|
|
524
525
|
ref: s
|
|
525
526
|
};
|
|
526
|
-
})), H =
|
|
527
|
+
})), H = M(() => {
|
|
527
528
|
let s = [...ie.value];
|
|
528
|
-
if (
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
531
|
-
s = s.filter((
|
|
532
|
-
const h =
|
|
533
|
-
s = s.map((
|
|
529
|
+
if (m.value) {
|
|
530
|
+
const v = a.value.trim().toLowerCase();
|
|
531
|
+
if (v.length) {
|
|
532
|
+
s = s.filter((y) => y.searchContent.includes(v));
|
|
533
|
+
const h = Nt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${h})`, "ig");
|
|
534
|
+
s = s.map((y) => {
|
|
534
535
|
var C;
|
|
535
536
|
return {
|
|
536
|
-
...
|
|
537
|
-
title:
|
|
538
|
-
subtitle: (C =
|
|
537
|
+
...y,
|
|
538
|
+
title: y.title.replace(p, "<mark>$1</mark>"),
|
|
539
|
+
subtitle: (C = y.subtitle) == null ? void 0 : C.replace(p, "<mark>$1</mark>")
|
|
539
540
|
};
|
|
540
|
-
}),
|
|
541
|
+
}), Se.value && (s.find((C) => C.searchContent === v) !== void 0 || s.push({
|
|
541
542
|
key: i,
|
|
542
|
-
title: "Create <strong>" + a.value.trim() + "</strong>..."
|
|
543
|
+
title: rt.value ? "Create <strong>" + a.value.trim() + "</strong>..." : a.value.trim()
|
|
543
544
|
}));
|
|
544
545
|
}
|
|
545
546
|
} else l.nullTitle && s.unshift({
|
|
@@ -548,47 +549,47 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
548
549
|
});
|
|
549
550
|
return s;
|
|
550
551
|
});
|
|
551
|
-
|
|
552
|
+
A(() => l.modelValue, ae), A(
|
|
552
553
|
() => l.options,
|
|
553
554
|
() => {
|
|
554
|
-
|
|
555
|
+
w.value = l.options ?? [], f.value = !0;
|
|
555
556
|
}
|
|
556
|
-
),
|
|
557
|
-
I.value && setTimeout(
|
|
558
|
-
}),
|
|
559
|
-
|
|
560
|
-
}),
|
|
561
|
-
I.value ? setTimeout(
|
|
562
|
-
}),
|
|
557
|
+
), A(ie, () => {
|
|
558
|
+
I.value && setTimeout(Ie, 0);
|
|
559
|
+
}), A(a, () => {
|
|
560
|
+
m.value && !l.remoteSearch && !a.value.trim().length && (m.value = !1);
|
|
561
|
+
}), A(I, () => {
|
|
562
|
+
I.value ? setTimeout(wt, 0) : (m.value = !1, a.value = S.value || "", g.value && (g.value.style.visibility = "hidden"));
|
|
563
|
+
}), A(H, () => {
|
|
563
564
|
var s;
|
|
564
|
-
l.modelValue && !c.value && ae(), (
|
|
565
|
+
l.modelValue && !c.value && ae(), (x.value || m.value) && !H.value.find((v) => v.key == x.value) && (x.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
|
|
565
566
|
}), V(async () => {
|
|
566
|
-
|
|
567
|
+
Se.value = l.onCreateItem !== void 0, l.options ? (w.value = [...l.options], f.value = !0) : l.preload && await Le(), ae(), A(c, () => {
|
|
567
568
|
c.value !== l.modelValue && u(
|
|
568
569
|
"update:modelValue",
|
|
569
570
|
c.value && W.value ? W.value(c.value) : c.value
|
|
570
571
|
);
|
|
571
|
-
}), l.remoteSearch &&
|
|
572
|
+
}), l.remoteSearch && A(a, Ft(ft, 250));
|
|
572
573
|
});
|
|
573
574
|
async function Le() {
|
|
574
|
-
await Me(),
|
|
575
|
+
await Me(), w.value && u("optionsLoaded", w.value);
|
|
575
576
|
}
|
|
576
577
|
async function Me() {
|
|
577
|
-
var
|
|
578
|
-
const s = l.remoteSearch &&
|
|
579
|
-
b.value = !0,
|
|
578
|
+
var v;
|
|
579
|
+
const s = l.remoteSearch && m.value && a.value ? a.value : null;
|
|
580
|
+
b.value = !0, w.value = await ((v = l.loadOptions) == null ? void 0 : v.call(l, s)) ?? [], b.value = !1, f.value = !0;
|
|
580
581
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
582
|
+
function ft() {
|
|
583
|
+
m.value && (Me(), m.value = a.value.trim().length > 0);
|
|
583
584
|
}
|
|
584
|
-
function
|
|
585
|
+
function vt(s) {
|
|
585
586
|
if (s.key == "Escape") {
|
|
586
|
-
s.stopPropagation(), s.target.blur();
|
|
587
|
+
s.stopPropagation(), s.target.blur(), Oe();
|
|
587
588
|
return;
|
|
588
589
|
}
|
|
589
590
|
if (!(s.key == "ArrowLeft" || s.key == "ArrowRight") && s.key != "Tab") {
|
|
590
591
|
if (!f.value) {
|
|
591
|
-
|
|
592
|
+
m.value || s.preventDefault();
|
|
592
593
|
return;
|
|
593
594
|
}
|
|
594
595
|
if (s.key == "ArrowUp" || s.key == "ArrowDown")
|
|
@@ -599,140 +600,151 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
599
600
|
return s.preventDefault(), re(s.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
600
601
|
if (s.key == "Enter") {
|
|
601
602
|
s.preventDefault();
|
|
602
|
-
const
|
|
603
|
-
if (
|
|
603
|
+
const v = H.value.find((h) => h.key == x.value);
|
|
604
|
+
if (v) return He(v);
|
|
604
605
|
}
|
|
605
606
|
if (s.key === "Delete" || s.key === "Backspace") {
|
|
606
|
-
a.value.length > 1 && (
|
|
607
|
+
a.value.length > 1 && (m.value = !0);
|
|
607
608
|
return;
|
|
608
609
|
}
|
|
609
|
-
!s.metaKey &&
|
|
610
|
+
!s.metaKey && kn.includes(s.key) && (m.value = !0);
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
-
|
|
613
|
+
function mt() {
|
|
614
|
+
ht(), I.value = !0, setTimeout(() => {
|
|
614
615
|
var s;
|
|
615
616
|
return (s = d.value) == null ? void 0 : s.select();
|
|
616
617
|
}, 0);
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
-
c.value ?
|
|
619
|
+
function ht(s) {
|
|
620
|
+
c.value ? x.value = pt(c.value) : l.nullTitle && (x.value = o);
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
-
var
|
|
623
|
-
return j.value ? j.value(c.value) : ((
|
|
622
|
+
function pt(s) {
|
|
623
|
+
var v;
|
|
624
|
+
return j.value ? j.value(c.value) : ((v = yt(s)) == null ? void 0 : v.key) ?? "";
|
|
624
625
|
}
|
|
625
|
-
function
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
return
|
|
629
|
-
const h = l.keyExtractor ? (
|
|
626
|
+
function yt(s) {
|
|
627
|
+
const v = H.value.find((y) => y.ref === s);
|
|
628
|
+
if (v)
|
|
629
|
+
return v;
|
|
630
|
+
const h = l.keyExtractor ? (y, C) => l.keyExtractor(y) === l.keyExtractor(C) : Xe, p = H.value.find((y) => h(y.ref, s));
|
|
630
631
|
return p || null;
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
+
function gt() {
|
|
633
634
|
l.debug || (!a.value.length && l.nullTitle && (c.value = null, S.value = null), I.value = !1);
|
|
634
635
|
}
|
|
635
|
-
function
|
|
636
|
+
function wt() {
|
|
636
637
|
var s;
|
|
637
|
-
f.value || Le(), l.optionsListId && ((s =
|
|
638
|
+
f.value || Le(), l.optionsListId && ((s = g.value) == null || s.setAttribute("id", l.optionsListId)), Et();
|
|
638
639
|
}
|
|
639
|
-
function
|
|
640
|
-
const s = r.value.getBoundingClientRect(),
|
|
641
|
-
for (let C in
|
|
642
|
-
/^(font|text)/.test(C) && (p.style[C] =
|
|
643
|
-
if (p.style.top =
|
|
644
|
-
const C = window.innerHeight -
|
|
640
|
+
function Et() {
|
|
641
|
+
const s = r.value.getBoundingClientRect(), v = s.y + s.height + 2, h = s.x, p = g.value, y = window.getComputedStyle(r.value);
|
|
642
|
+
for (let C in y)
|
|
643
|
+
/^(font|text)/.test(C) && (p.style[C] = y[C]);
|
|
644
|
+
if (p.style.top = v + "px", p.style.left = h + "px", p.style.minWidth = s.width + "px", !y.maxHeight || y.maxHeight == "none") {
|
|
645
|
+
const C = window.innerHeight - v - 12;
|
|
645
646
|
p.style.maxHeight = C + "px";
|
|
646
647
|
}
|
|
647
|
-
p.style.visibility = "visible", document.body.appendChild(p), setTimeout(
|
|
648
|
+
p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Ie, 0);
|
|
648
649
|
}
|
|
649
|
-
function
|
|
650
|
-
if (!f.value || !
|
|
651
|
-
const s = H.value.findIndex((p) => p.key ==
|
|
652
|
-
h && (
|
|
650
|
+
function Ie() {
|
|
651
|
+
if (!f.value || !x.value) return;
|
|
652
|
+
const s = H.value.findIndex((p) => p.key == x.value), v = g.value, h = v == null ? void 0 : v.querySelectorAll(".option")[s];
|
|
653
|
+
h && (v.scrollTop = h.offsetTop);
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
655
|
+
function kt(s) {
|
|
656
|
+
x.value = s ? s.key : null;
|
|
656
657
|
}
|
|
657
658
|
function re(s) {
|
|
658
|
-
const
|
|
659
|
-
let h =
|
|
660
|
-
if (h < 0 ? h = 0 : h >= H.value.length && (h = H.value.length - 1),
|
|
661
|
-
|
|
662
|
-
const p =
|
|
663
|
-
|
|
659
|
+
const v = H.value.findIndex((C) => C.key == x.value);
|
|
660
|
+
let h = v + s;
|
|
661
|
+
if (h < 0 ? h = 0 : h >= H.value.length && (h = H.value.length - 1), v == h) return;
|
|
662
|
+
x.value = H.value[h].key;
|
|
663
|
+
const p = g.value, y = p == null ? void 0 : p.querySelectorAll(".option")[h];
|
|
664
|
+
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));
|
|
664
665
|
}
|
|
665
|
-
function
|
|
666
|
-
var
|
|
667
|
-
if (
|
|
666
|
+
function He(s) {
|
|
667
|
+
var v, h;
|
|
668
|
+
if (m.value = !1, s.key == o)
|
|
668
669
|
a.value = "", c.value = null, S.value = null;
|
|
669
670
|
else if (s.key === i) {
|
|
670
671
|
const p = a.value.trim();
|
|
671
|
-
a.value = "", c.value = null, S.value = null, (
|
|
672
|
+
a.value = "", c.value = null, S.value = null, (v = l.onCreateItem) == null || v.call(l, p);
|
|
672
673
|
} else {
|
|
673
|
-
const
|
|
674
|
-
c.value =
|
|
674
|
+
const y = ie.value.find((C) => C.key == s.key).ref;
|
|
675
|
+
c.value = y, S.value = se.value(y), a.value = S.value || "";
|
|
675
676
|
}
|
|
676
|
-
(h = d.value) == null || h.blur();
|
|
677
|
+
(h = d.value) == null || h.blur(), Oe();
|
|
677
678
|
}
|
|
678
679
|
function ae() {
|
|
679
|
-
l.modelValue ? (c.value = W.value ?
|
|
680
|
+
l.modelValue ? (c.value = W.value ? xe.value.find((s) => l.modelValue === W.value(s)) : l.modelValue, S.value = c.value ? se.value(c.value) : null, a.value = S.value || "") : (c.value = null, S.value = null, a.value = "");
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
-
|
|
682
|
+
function bt(s) {
|
|
683
|
+
w.value.unshift(s);
|
|
683
684
|
}
|
|
684
|
-
|
|
685
|
+
function Oe() {
|
|
686
|
+
var y;
|
|
687
|
+
let s = (y = r.value) == null ? void 0 : y.parentElement;
|
|
688
|
+
for (; s && s.tagName !== "FORM" && s.tagName !== "BODY"; )
|
|
689
|
+
s = s.parentElement;
|
|
690
|
+
if (!s) return;
|
|
691
|
+
const v = s.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
692
|
+
if (!v) return;
|
|
693
|
+
const h = Array.from(v).findIndex((C) => C === d.value), p = v[h + 1];
|
|
694
|
+
p && setTimeout(() => p.focus(), 0);
|
|
695
|
+
}
|
|
696
|
+
return (s, v) => (E(), k("div", {
|
|
685
697
|
ref_key: "el",
|
|
686
698
|
ref: r,
|
|
687
|
-
class:
|
|
699
|
+
class: $(["vf-smart-select", { disabled: Ce.value, open: I.value }])
|
|
688
700
|
}, [
|
|
689
|
-
Q(
|
|
701
|
+
Q(F("input", {
|
|
690
702
|
ref_key: "searchField",
|
|
691
703
|
ref: d,
|
|
692
|
-
"onUpdate:modelValue":
|
|
704
|
+
"onUpdate:modelValue": v[0] || (v[0] = (h) => a.value = h),
|
|
693
705
|
type: "text",
|
|
694
|
-
disabled:
|
|
695
|
-
class:
|
|
696
|
-
placeholder:
|
|
706
|
+
disabled: Ce.value,
|
|
707
|
+
class: $({ nullable: !!s.nullTitle }),
|
|
708
|
+
placeholder: ct.value,
|
|
697
709
|
required: s.required,
|
|
698
710
|
"data-1p-ignore": "",
|
|
699
|
-
onKeydown:
|
|
700
|
-
onFocus:
|
|
701
|
-
onBlur:
|
|
702
|
-
}, null, 42,
|
|
703
|
-
[
|
|
711
|
+
onKeydown: vt,
|
|
712
|
+
onFocus: mt,
|
|
713
|
+
onBlur: gt
|
|
714
|
+
}, null, 42, hn), [
|
|
715
|
+
[At, a.value]
|
|
704
716
|
]),
|
|
705
|
-
I.value ? (
|
|
717
|
+
I.value ? (E(), k("div", {
|
|
706
718
|
key: 0,
|
|
707
719
|
ref_key: "optionsContainer",
|
|
708
|
-
ref:
|
|
720
|
+
ref: g,
|
|
709
721
|
class: "vf-smart-select-options"
|
|
710
722
|
}, [
|
|
711
|
-
f.value ? (
|
|
712
|
-
(
|
|
723
|
+
f.value ? (E(), k(J, { key: 1 }, [
|
|
724
|
+
(E(!0), k(J, null, he(H.value, (h) => (E(), k("div", {
|
|
713
725
|
key: String(h.key),
|
|
714
|
-
class:
|
|
715
|
-
highlighted:
|
|
726
|
+
class: $(["option", {
|
|
727
|
+
highlighted: x.value === h.key
|
|
716
728
|
}]),
|
|
717
|
-
onMousemove: (p) =>
|
|
718
|
-
onMousedown: (p) =>
|
|
729
|
+
onMousemove: (p) => kt(h),
|
|
730
|
+
onMousedown: (p) => He(h)
|
|
719
731
|
}, [
|
|
720
|
-
|
|
732
|
+
F("div", {
|
|
721
733
|
class: "title",
|
|
722
734
|
innerHTML: h.title
|
|
723
|
-
}, null, 8,
|
|
724
|
-
h.subtitle ? (
|
|
735
|
+
}, null, 8, gn),
|
|
736
|
+
h.subtitle ? (E(), k("div", {
|
|
725
737
|
key: 0,
|
|
726
738
|
class: "subtitle",
|
|
727
739
|
innerHTML: h.subtitle
|
|
728
|
-
}, null, 8,
|
|
729
|
-
], 42,
|
|
730
|
-
!H.value.length && a.value ? (
|
|
731
|
-
], 64)) : (
|
|
732
|
-
], 512)) :
|
|
740
|
+
}, null, 8, wn)) : D("", !0)
|
|
741
|
+
], 42, yn))), 128)),
|
|
742
|
+
!H.value.length && a.value ? (E(), k("div", En, U(dt.value), 1)) : D("", !0)
|
|
743
|
+
], 64)) : (E(), k("div", pn, "Loading..."))
|
|
744
|
+
], 512)) : D("", !0)
|
|
733
745
|
], 2));
|
|
734
746
|
}
|
|
735
|
-
}),
|
|
747
|
+
}), Lo = /* @__PURE__ */ N({
|
|
736
748
|
__name: "vf-ez-smart-select",
|
|
737
749
|
props: {
|
|
738
750
|
modelValue: {},
|
|
@@ -743,38 +755,38 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
743
755
|
},
|
|
744
756
|
emits: ["update:modelValue"],
|
|
745
757
|
setup(e, { emit: t }) {
|
|
746
|
-
const n = e, o =
|
|
758
|
+
const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, d]) => ({
|
|
747
759
|
value: r,
|
|
748
760
|
label: d
|
|
749
|
-
}))), i =
|
|
750
|
-
return
|
|
761
|
+
}))), i = M(() => n.formatter ? (r) => n.formatter(r) : (r) => r.label), l = t, u = T(o.value.find((r) => r.value === n.modelValue) ?? null);
|
|
762
|
+
return A(
|
|
751
763
|
() => n.modelValue,
|
|
752
764
|
(r) => {
|
|
753
765
|
u.value = o.value.find((d) => d.value === r) ?? null;
|
|
754
766
|
}
|
|
755
|
-
),
|
|
756
|
-
var
|
|
757
|
-
const d = r ? (
|
|
767
|
+
), A(u, (r) => {
|
|
768
|
+
var g;
|
|
769
|
+
const d = r ? (g = o.value.find((b) => Xe(b, r))) == null ? void 0 : g.value : null;
|
|
758
770
|
l("update:modelValue", d ?? null);
|
|
759
|
-
}), (r, d) => (
|
|
771
|
+
}), (r, d) => (E(), qe(bn, {
|
|
760
772
|
modelValue: u.value,
|
|
761
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
773
|
+
"onUpdate:modelValue": d[0] || (d[0] = (g) => u.value = g),
|
|
762
774
|
options: o.value,
|
|
763
775
|
formatter: i.value,
|
|
764
776
|
"null-title": r.nullTitle
|
|
765
777
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
766
778
|
}
|
|
767
779
|
});
|
|
768
|
-
function
|
|
780
|
+
function Mo() {
|
|
769
781
|
return T();
|
|
770
782
|
}
|
|
771
|
-
const
|
|
783
|
+
const Tn = { class: "content" }, Sn = { class: "message" }, Cn = {
|
|
772
784
|
key: 0,
|
|
773
785
|
class: "close"
|
|
774
|
-
},
|
|
786
|
+
}, xn = {
|
|
775
787
|
key: 0,
|
|
776
788
|
class: "progress-bar"
|
|
777
|
-
},
|
|
789
|
+
}, Ln = /* @__PURE__ */ N({
|
|
778
790
|
__name: "vf-toast",
|
|
779
791
|
props: {
|
|
780
792
|
message: {},
|
|
@@ -797,104 +809,104 @@ const kn = { class: "content" }, bn = { class: "message" }, Tn = {
|
|
|
797
809
|
duration: i * 1e3,
|
|
798
810
|
easing: "linear"
|
|
799
811
|
}), setTimeout(() => t.callback(), i * 1e3);
|
|
800
|
-
}), (i, l) => (
|
|
801
|
-
class:
|
|
802
|
-
onClick:
|
|
812
|
+
}), (i, l) => (E(), k("div", {
|
|
813
|
+
class: $(["vf-toast", i.className]),
|
|
814
|
+
onClick: ye(n, ["stop"])
|
|
803
815
|
}, [
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
i.disableClose ?
|
|
816
|
+
F("div", Tn, [
|
|
817
|
+
F("div", Sn, U(i.message), 1),
|
|
818
|
+
i.disableClose ? D("", !0) : (E(), k("div", Cn, "x"))
|
|
807
819
|
]),
|
|
808
|
-
i.durationSecs !== null ? (
|
|
809
|
-
|
|
820
|
+
i.durationSecs !== null ? (E(), k("div", xn, [
|
|
821
|
+
F("div", {
|
|
810
822
|
ref_key: "progressInnerEl",
|
|
811
823
|
ref: o,
|
|
812
824
|
class: "inner"
|
|
813
825
|
}, null, 512)
|
|
814
|
-
])) :
|
|
826
|
+
])) : D("", !0)
|
|
815
827
|
], 2));
|
|
816
828
|
}
|
|
817
829
|
});
|
|
818
|
-
function
|
|
819
|
-
const t =
|
|
830
|
+
function Io(e) {
|
|
831
|
+
const t = we(Ln, {
|
|
820
832
|
...e,
|
|
821
833
|
callback: () => te(t)
|
|
822
834
|
});
|
|
823
835
|
return () => te(t);
|
|
824
836
|
}
|
|
825
|
-
function
|
|
837
|
+
function Mn(e) {
|
|
826
838
|
const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), i = ["B", "KB", "MB", "GB", "TB"][t];
|
|
827
839
|
return `${o} ${i}`;
|
|
828
840
|
}
|
|
829
|
-
function
|
|
841
|
+
function In(e) {
|
|
830
842
|
return e != null && String(e).length ? e : "-";
|
|
831
843
|
}
|
|
832
|
-
function
|
|
844
|
+
function Hn(e) {
|
|
833
845
|
return e || "-";
|
|
834
846
|
}
|
|
835
|
-
function
|
|
836
|
-
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e :
|
|
837
|
-
}
|
|
838
|
-
function Hn(e) {
|
|
839
|
-
return e && dn(e);
|
|
847
|
+
function On(e) {
|
|
848
|
+
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Nn(Number(e));
|
|
840
849
|
}
|
|
841
850
|
function An(e) {
|
|
842
|
-
return e
|
|
851
|
+
return e && vn(e);
|
|
843
852
|
}
|
|
844
853
|
function Fn(e) {
|
|
845
|
-
return e ?
|
|
854
|
+
return e ? Bt(e) : null;
|
|
846
855
|
}
|
|
847
856
|
function Dn(e) {
|
|
857
|
+
return e ? Dt(e) : null;
|
|
858
|
+
}
|
|
859
|
+
function Bn(e) {
|
|
848
860
|
return e ? e.toUpperCase() : null;
|
|
849
861
|
}
|
|
850
|
-
function
|
|
851
|
-
return e ?
|
|
862
|
+
function $n(e) {
|
|
863
|
+
return e ? fn(e) : null;
|
|
852
864
|
}
|
|
853
|
-
function
|
|
854
|
-
return
|
|
865
|
+
function Vn(e, t = 1) {
|
|
866
|
+
return mn(e, t);
|
|
855
867
|
}
|
|
856
868
|
const $e = {
|
|
857
|
-
bytes:
|
|
858
|
-
dash:
|
|
859
|
-
dashZeros:
|
|
860
|
-
number:
|
|
861
|
-
phone:
|
|
862
|
-
upperFirst:
|
|
863
|
-
startCase:
|
|
864
|
-
upperCase:
|
|
865
|
-
desnake:
|
|
866
|
-
usCurrency:
|
|
867
|
-
},
|
|
869
|
+
bytes: Mn,
|
|
870
|
+
dash: In,
|
|
871
|
+
dashZeros: Hn,
|
|
872
|
+
number: On,
|
|
873
|
+
phone: An,
|
|
874
|
+
upperFirst: Fn,
|
|
875
|
+
startCase: Dn,
|
|
876
|
+
upperCase: Bn,
|
|
877
|
+
desnake: $n,
|
|
878
|
+
usCurrency: Vn
|
|
879
|
+
}, Ho = (e) => ({
|
|
868
880
|
...$e,
|
|
869
881
|
...e($e)
|
|
870
882
|
});
|
|
871
|
-
function
|
|
883
|
+
function Oo(e, t, n) {
|
|
872
884
|
const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
873
885
|
return o === -1 ? !1 : (e.splice(o, 1, n), !0);
|
|
874
886
|
}
|
|
875
|
-
function
|
|
887
|
+
function Ao(e, t) {
|
|
876
888
|
const n = document.createElement("div");
|
|
877
889
|
n.classList.add("vf-overlay"), n.addEventListener("click", f), document.body.appendChild(n);
|
|
878
890
|
const o = document.createElement("div");
|
|
879
891
|
o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
|
|
880
892
|
const i = e.currentTarget;
|
|
881
|
-
i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((
|
|
882
|
-
if (
|
|
893
|
+
i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((m) => {
|
|
894
|
+
if (m == "-") {
|
|
883
895
|
const c = document.createElement("div");
|
|
884
896
|
c.classList.add("separator"), o.appendChild(c);
|
|
885
897
|
return;
|
|
886
898
|
}
|
|
887
899
|
const a = document.createElement("div");
|
|
888
|
-
a.classList.add("item"), a.style.userSelect = "none", a.innerText =
|
|
900
|
+
a.classList.add("item"), a.style.userSelect = "none", a.innerText = m.title, o.appendChild(a), m.class && a.classList.add(m.class), m.shouldConfirm ? a.addEventListener("click", (c) => w(c, a, m.handler)) : a.addEventListener("click", () => m.handler());
|
|
889
901
|
});
|
|
890
|
-
const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth,
|
|
891
|
-
o.style.left =
|
|
902
|
+
const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth, g = l < d ? e.clientX - d - 1 : e.clientX + 1, b = u < r ? e.clientY - r - 1 : e.clientY + 1;
|
|
903
|
+
o.style.left = g + "px", o.style.top = b + "px", setTimeout(() => {
|
|
892
904
|
o.style.width = o.offsetWidth + "px";
|
|
893
905
|
}, 50);
|
|
894
906
|
function f() {
|
|
895
907
|
t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
|
|
896
908
|
}
|
|
897
|
-
function
|
|
909
|
+
function w(m, a, c) {
|
|
898
910
|
if (a.classList.contains("pending-confirm"))
|
|
899
911
|
return c();
|
|
900
912
|
const S = a.innerHTML;
|
|
@@ -902,67 +914,67 @@ function Ho(e, t) {
|
|
|
902
914
|
const I = () => {
|
|
903
915
|
a.classList.remove("pending-confirm"), a.innerHTML = S, a.removeEventListener("mouseleave", I);
|
|
904
916
|
};
|
|
905
|
-
a.addEventListener("mouseleave", I),
|
|
917
|
+
a.addEventListener("mouseleave", I), m.stopPropagation();
|
|
906
918
|
}
|
|
907
919
|
}
|
|
908
|
-
const
|
|
909
|
-
function
|
|
920
|
+
const _n = (e) => new Promise((t) => setTimeout(t, e)), Fo = (e) => _n(e * 1e3);
|
|
921
|
+
function Nn(e) {
|
|
910
922
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
911
923
|
}
|
|
912
|
-
function Fo(e, t) {
|
|
913
|
-
return e != null ? Ot(e) : t;
|
|
914
|
-
}
|
|
915
924
|
function Do(e, t) {
|
|
925
|
+
return e != null ? $t(e) : t;
|
|
926
|
+
}
|
|
927
|
+
function Bo(e, t) {
|
|
916
928
|
const n = { ...e };
|
|
917
929
|
for (const o of t)
|
|
918
930
|
n[o] === "" && (n[o] = null);
|
|
919
931
|
return n;
|
|
920
932
|
}
|
|
921
|
-
function
|
|
922
|
-
|
|
933
|
+
function $o(e, t) {
|
|
934
|
+
Rt(e, {
|
|
923
935
|
...t,
|
|
924
936
|
onError(n, o) {
|
|
925
937
|
var l;
|
|
926
|
-
n instanceof
|
|
938
|
+
n instanceof Wt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new oe(n.body.error));
|
|
927
939
|
const i = (l = t.onError) == null ? void 0 : l.call(t, n, o);
|
|
928
940
|
return i !== void 0 ? i : n;
|
|
929
941
|
}
|
|
930
942
|
});
|
|
931
943
|
}
|
|
932
|
-
const
|
|
933
|
-
function
|
|
934
|
-
const n = t ??
|
|
935
|
-
V(() =>
|
|
944
|
+
const be = Symbol("HookState");
|
|
945
|
+
function Vo(e, t) {
|
|
946
|
+
const n = t ?? pe();
|
|
947
|
+
V(() => Rn(n, e), n), ze(() => Wn(n), n), Ye(() => Ve(n), n), ge(() => Ve(n), n);
|
|
936
948
|
}
|
|
937
|
-
function
|
|
949
|
+
function Rn(e, t) {
|
|
938
950
|
const n = {};
|
|
939
951
|
if (t.elScrolledToBottom && (n.el = new Y(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
940
|
-
const o =
|
|
952
|
+
const o = et(e.vnode.el);
|
|
941
953
|
o ? n.ancestor = new Y(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
942
954
|
}
|
|
943
|
-
t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[
|
|
955
|
+
t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[be] = n;
|
|
944
956
|
}
|
|
945
|
-
function
|
|
957
|
+
function Wn(e) {
|
|
946
958
|
var n, o, i;
|
|
947
|
-
const t = e[
|
|
959
|
+
const t = e[be];
|
|
948
960
|
(n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (i = t == null ? void 0 : t.window) == null || i.install();
|
|
949
961
|
}
|
|
950
|
-
function
|
|
962
|
+
function Ve(e) {
|
|
951
963
|
var n, o, i;
|
|
952
|
-
const t = e[
|
|
964
|
+
const t = e[be];
|
|
953
965
|
(n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (i = t == null ? void 0 : t.window) == null || i.uninstall();
|
|
954
966
|
}
|
|
955
|
-
const
|
|
956
|
-
function
|
|
967
|
+
const fe = ["auto", "scroll"];
|
|
968
|
+
function et(e) {
|
|
957
969
|
const t = e.parentElement;
|
|
958
970
|
if (!t) return null;
|
|
959
971
|
const n = window.getComputedStyle(t);
|
|
960
|
-
return
|
|
972
|
+
return fe.includes(n.overflow) || fe.includes(n.overflowX) || fe.includes(n.overflowY) ? t : et(t);
|
|
961
973
|
}
|
|
962
974
|
class Y {
|
|
963
975
|
constructor(t, n) {
|
|
964
|
-
|
|
965
|
-
|
|
976
|
+
O(this, "isTripped", !1);
|
|
977
|
+
O(this, "onScrollWithContext", this.onScroll.bind(this));
|
|
966
978
|
this.el = t, this.handler = n, this.install();
|
|
967
979
|
}
|
|
968
980
|
install() {
|
|
@@ -975,23 +987,23 @@ class Y {
|
|
|
975
987
|
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);
|
|
976
988
|
}
|
|
977
989
|
}
|
|
978
|
-
function
|
|
979
|
-
V(() => window.addEventListener("resize", e)),
|
|
990
|
+
function _o(e) {
|
|
991
|
+
V(() => window.addEventListener("resize", e)), ze(() => window.addEventListener("resize", e)), Ye(() => window.removeEventListener("resize", e)), ge(() => window.removeEventListener("resize", e));
|
|
980
992
|
}
|
|
981
|
-
const
|
|
982
|
-
mounted:
|
|
983
|
-
updated:
|
|
984
|
-
},
|
|
985
|
-
function
|
|
986
|
-
if (t.value === void 0 && e[
|
|
987
|
-
e[
|
|
993
|
+
const Un = {
|
|
994
|
+
mounted: Ne,
|
|
995
|
+
updated: Ne
|
|
996
|
+
}, _e = Symbol("HasAutoFocused");
|
|
997
|
+
function Ne(e, t) {
|
|
998
|
+
if (t.value === void 0 && e[_e] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
|
|
999
|
+
e[_e] = !0;
|
|
988
1000
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
989
1001
|
setTimeout(() => n.focus(), 10);
|
|
990
1002
|
}
|
|
991
|
-
const
|
|
992
|
-
mounted:
|
|
1003
|
+
const jn = {
|
|
1004
|
+
mounted: Pn
|
|
993
1005
|
}, P = Symbol("ConfirmState");
|
|
994
|
-
function
|
|
1006
|
+
function Pn(e, t) {
|
|
995
1007
|
e.addEventListener("click", (n) => {
|
|
996
1008
|
var u, r;
|
|
997
1009
|
const o = Date.now(), i = ((u = t.value) == null ? void 0 : u.text) !== void 0 ? t.value.text : "Confirm";
|
|
@@ -1013,28 +1025,28 @@ function Un(e, t) {
|
|
|
1013
1025
|
e[P] = l, i && (e.innerHTML = i), (r = t.value) != null && r.class && e.classList.add(t.value.class), e.addEventListener("mouseout", l.resetHandler);
|
|
1014
1026
|
});
|
|
1015
1027
|
}
|
|
1016
|
-
const
|
|
1017
|
-
beforeMount:
|
|
1028
|
+
const qn = {
|
|
1029
|
+
beforeMount: zn
|
|
1018
1030
|
};
|
|
1019
|
-
function
|
|
1031
|
+
function zn(e) {
|
|
1020
1032
|
e.addEventListener("blur", () => {
|
|
1021
1033
|
let t = e.value;
|
|
1022
|
-
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" +
|
|
1034
|
+
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + ve(/* @__PURE__ */ new Date(), "yy"));
|
|
1023
1035
|
const n = Date.parse(t);
|
|
1024
|
-
isNaN(n) ? e.value = "" : e.value =
|
|
1036
|
+
isNaN(n) ? e.value = "" : e.value = ve(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1025
1037
|
});
|
|
1026
1038
|
}
|
|
1027
|
-
const
|
|
1028
|
-
beforeMount:
|
|
1029
|
-
updated:
|
|
1039
|
+
const Yn = {
|
|
1040
|
+
beforeMount: Re,
|
|
1041
|
+
updated: Re
|
|
1030
1042
|
};
|
|
1031
|
-
function
|
|
1032
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1043
|
+
function Re(e, t) {
|
|
1044
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = Kn(e, t));
|
|
1033
1045
|
}
|
|
1034
|
-
function
|
|
1035
|
-
var
|
|
1046
|
+
function Kn(e, t) {
|
|
1047
|
+
var g, b;
|
|
1036
1048
|
if (!t.value)
|
|
1037
|
-
return ((
|
|
1049
|
+
return ((g = e.attributes.getNamedItem("placeholder")) == null ? void 0 : g.value) ?? "";
|
|
1038
1050
|
let n = "";
|
|
1039
1051
|
const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), l = new Date(i);
|
|
1040
1052
|
e.attributes.getNamedItem("display-utc") !== null && l.setMinutes(l.getMinutes() - l.getTimezoneOffset());
|
|
@@ -1046,53 +1058,53 @@ function zn(e, t) {
|
|
|
1046
1058
|
}
|
|
1047
1059
|
if (!u && e.attributes.getNamedItem("simplified-date") !== null) {
|
|
1048
1060
|
let f = null;
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
const
|
|
1052
|
-
u =
|
|
1061
|
+
const w = /* @__PURE__ */ new Date();
|
|
1062
|
+
w.getFullYear() === l.getFullYear() ? (w.getMonth() !== l.getMonth() || w.getDate() !== l.getDate()) && (f = "M/d") : f = "M/d/YY";
|
|
1063
|
+
const m = r ? null : B.defaultTimeFormat;
|
|
1064
|
+
u = Ke([f, m]).join(" ");
|
|
1053
1065
|
}
|
|
1054
|
-
u || (r ? u =
|
|
1055
|
-
let d =
|
|
1066
|
+
u || (r ? u = B.defaultDateFormat : u = `${B.defaultDateFormat} ${B.defaultTimeFormat}`);
|
|
1067
|
+
let d = ve(l, u);
|
|
1056
1068
|
return n && (d = n + " " + d), d;
|
|
1057
1069
|
}
|
|
1058
|
-
const
|
|
1059
|
-
beforeMount:
|
|
1060
|
-
updated:
|
|
1061
|
-
unmounted:
|
|
1070
|
+
const Xn = {
|
|
1071
|
+
beforeMount: We,
|
|
1072
|
+
updated: We,
|
|
1073
|
+
unmounted: Zn
|
|
1062
1074
|
};
|
|
1063
|
-
function
|
|
1075
|
+
function We(e, t) {
|
|
1064
1076
|
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");
|
|
1065
1077
|
}
|
|
1066
|
-
function
|
|
1078
|
+
function Zn(e) {
|
|
1067
1079
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1068
1080
|
}
|
|
1069
|
-
const
|
|
1070
|
-
beforeMount:
|
|
1071
|
-
updated:
|
|
1072
|
-
unmounted:
|
|
1073
|
-
}, X = Symbol("HasAutoFocused"),
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1081
|
+
const Gn = {
|
|
1082
|
+
beforeMount: Ue,
|
|
1083
|
+
updated: Ue,
|
|
1084
|
+
unmounted: nt
|
|
1085
|
+
}, X = Symbol("HasAutoFocused"), Te = [];
|
|
1086
|
+
function Qn() {
|
|
1087
|
+
Te.forEach(tt);
|
|
1076
1088
|
}
|
|
1077
|
-
setInterval(
|
|
1078
|
-
function
|
|
1089
|
+
setInterval(Qn, 1e3);
|
|
1090
|
+
function Ue(e, t) {
|
|
1079
1091
|
var u;
|
|
1080
1092
|
if (t.value == t.oldValue) return;
|
|
1081
|
-
if (!t.value) return
|
|
1093
|
+
if (!t.value) return nt(e);
|
|
1082
1094
|
const n = new Date(t.value), o = (u = e.attributes.getNamedItem("base-time")) == null ? void 0 : u.value, i = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), l = e.getAttribute("no-seconds") === null;
|
|
1083
|
-
e[X] ||
|
|
1095
|
+
e[X] || Te.push(e), e[X] = {
|
|
1084
1096
|
startTs: i,
|
|
1085
1097
|
includeSeconds: l
|
|
1086
|
-
},
|
|
1098
|
+
}, tt(e);
|
|
1087
1099
|
}
|
|
1088
|
-
function
|
|
1100
|
+
function tt(e) {
|
|
1089
1101
|
const t = e[X], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1090
|
-
e.innerText =
|
|
1102
|
+
e.innerText = Jn(n, t.includeSeconds);
|
|
1091
1103
|
}
|
|
1092
|
-
function
|
|
1093
|
-
e[X] && (
|
|
1104
|
+
function nt(e) {
|
|
1105
|
+
e[X] && (Vt(Te, e), delete e[X]), e.innerText = "-";
|
|
1094
1106
|
}
|
|
1095
|
-
function
|
|
1107
|
+
function Jn(e, t) {
|
|
1096
1108
|
const n = [], o = Math.floor(e / 86400);
|
|
1097
1109
|
o && n.push(o + "d"), e -= o * 86400;
|
|
1098
1110
|
const i = Math.floor(e / 3600);
|
|
@@ -1100,34 +1112,34 @@ function Gn(e, t) {
|
|
|
1100
1112
|
const l = Math.floor(e / 60);
|
|
1101
1113
|
return (o || i || l) && n.push(l + "m"), t ? n.length || n.push("0m") : (e -= l * 60, n.push(e + "s")), n.join(" ");
|
|
1102
1114
|
}
|
|
1103
|
-
const
|
|
1104
|
-
mounted:
|
|
1105
|
-
updated:
|
|
1106
|
-
unmounted:
|
|
1115
|
+
const eo = {
|
|
1116
|
+
mounted: ot,
|
|
1117
|
+
updated: to,
|
|
1118
|
+
unmounted: lt
|
|
1107
1119
|
}, R = /* @__PURE__ */ new Map();
|
|
1108
|
-
function nt(e, t) {
|
|
1109
|
-
R.size === 0 && window.addEventListener("keydown", lt), R.set(t.value.toLowerCase(), [...R.get(t.value.toLowerCase()) ?? [], e]);
|
|
1110
|
-
}
|
|
1111
1120
|
function ot(e, t) {
|
|
1121
|
+
R.size === 0 && window.addEventListener("keydown", st), R.set(t.value.toLowerCase(), [...R.get(t.value.toLowerCase()) ?? [], e]);
|
|
1122
|
+
}
|
|
1123
|
+
function lt(e, t) {
|
|
1112
1124
|
const n = R.get(t.value.toLowerCase());
|
|
1113
1125
|
if (n) {
|
|
1114
1126
|
const o = n.indexOf(e);
|
|
1115
1127
|
o !== -1 && n.splice(o, 1), n.length === 0 && R.delete(t.value.toLowerCase());
|
|
1116
1128
|
}
|
|
1117
|
-
R.size === 0 && window.removeEventListener("keydown",
|
|
1129
|
+
R.size === 0 && window.removeEventListener("keydown", st);
|
|
1118
1130
|
}
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1131
|
+
function to(e, t) {
|
|
1132
|
+
lt(e, t), ot(e, t);
|
|
1121
1133
|
}
|
|
1122
|
-
function
|
|
1134
|
+
function st(e) {
|
|
1123
1135
|
if (typeof e.key != "string") return;
|
|
1124
1136
|
const t = e.key.toLowerCase(), n = R.get(t);
|
|
1125
1137
|
if (n) {
|
|
1126
|
-
const o =
|
|
1138
|
+
const o = _t(n);
|
|
1127
1139
|
o == null || o.click(), e.preventDefault();
|
|
1128
1140
|
}
|
|
1129
1141
|
}
|
|
1130
|
-
const q = Symbol("InfiniteScrollHandler"),
|
|
1142
|
+
const q = Symbol("InfiniteScrollHandler"), no = {
|
|
1131
1143
|
mounted(e, t) {
|
|
1132
1144
|
e[q] = new Y(e, t.value);
|
|
1133
1145
|
},
|
|
@@ -1139,19 +1151,19 @@ const q = Symbol("InfiniteScrollHandler"), eo = {
|
|
|
1139
1151
|
var t;
|
|
1140
1152
|
(t = e[q]) == null || t.uninstall(), delete e[q];
|
|
1141
1153
|
}
|
|
1142
|
-
},
|
|
1143
|
-
beforeMount:
|
|
1144
|
-
updated:
|
|
1154
|
+
}, oo = {
|
|
1155
|
+
beforeMount: je,
|
|
1156
|
+
updated: je
|
|
1145
1157
|
};
|
|
1146
|
-
function
|
|
1158
|
+
function je(e, t) {
|
|
1147
1159
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1148
1160
|
}
|
|
1149
|
-
const
|
|
1150
|
-
mounted:
|
|
1151
|
-
updated:
|
|
1152
|
-
unmounted:
|
|
1161
|
+
const lo = {
|
|
1162
|
+
mounted: Pe,
|
|
1163
|
+
updated: Pe,
|
|
1164
|
+
unmounted: it
|
|
1153
1165
|
}, K = Symbol("TooltipState");
|
|
1154
|
-
function
|
|
1166
|
+
function Pe(e, t) {
|
|
1155
1167
|
var o;
|
|
1156
1168
|
let n = ((o = e.attributes.getNamedItem("tip")) == null ? void 0 : o.value) ?? t.value;
|
|
1157
1169
|
if (t.value || (n = null), n) {
|
|
@@ -1159,26 +1171,26 @@ function je(e, t) {
|
|
|
1159
1171
|
content: n,
|
|
1160
1172
|
html: e.getAttribute("html") !== null
|
|
1161
1173
|
};
|
|
1162
|
-
e[K] ? e[K].configure(i) : e[K] = new
|
|
1174
|
+
e[K] ? e[K].configure(i) : e[K] = new so(e, i);
|
|
1163
1175
|
} else
|
|
1164
|
-
|
|
1176
|
+
it(e);
|
|
1165
1177
|
}
|
|
1166
|
-
function
|
|
1178
|
+
function it(e) {
|
|
1167
1179
|
var t;
|
|
1168
1180
|
(t = e[K]) == null || t.destroy(), delete e[K];
|
|
1169
1181
|
}
|
|
1170
|
-
class
|
|
1182
|
+
class so {
|
|
1171
1183
|
constructor(t, n) {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1184
|
+
O(this, "lastMoveEvt");
|
|
1185
|
+
O(this, "checkInterval");
|
|
1186
|
+
O(this, "shouldShow", !1);
|
|
1187
|
+
O(this, "tipEl");
|
|
1188
|
+
O(this, "titleEl");
|
|
1189
|
+
O(this, "contentEl");
|
|
1190
|
+
O(this, "mouseMoveBound", !1);
|
|
1191
|
+
O(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
|
|
1192
|
+
O(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
|
|
1193
|
+
O(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
|
|
1182
1194
|
this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1183
1195
|
}
|
|
1184
1196
|
configure(t) {
|
|
@@ -1215,60 +1227,60 @@ class oo {
|
|
|
1215
1227
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1216
1228
|
}
|
|
1217
1229
|
}
|
|
1218
|
-
function
|
|
1219
|
-
e.directive("autofocus",
|
|
1230
|
+
function io(e) {
|
|
1231
|
+
e.directive("autofocus", Un), e.directive("confirm-button", jn), e.directive("date-input", qn), e.directive("datetime", Yn), e.directive("disabled", Xn), e.directive("duration", Gn), e.directive("hotkey", eo), e.directive("infinite-scroll", no), e.directive("readonly", oo), e.directive("tooltip", lo);
|
|
1220
1232
|
}
|
|
1221
|
-
function
|
|
1222
|
-
|
|
1233
|
+
function No(e) {
|
|
1234
|
+
io(e);
|
|
1223
1235
|
}
|
|
1224
1236
|
export {
|
|
1225
|
-
|
|
1237
|
+
ho as OverlayContainer,
|
|
1226
1238
|
oe as UserError,
|
|
1227
|
-
|
|
1239
|
+
mo as VfAjaxSelect,
|
|
1228
1240
|
le as VfAlertModal,
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1241
|
+
Lo as VfEzSmartSelect,
|
|
1242
|
+
on as VfModal,
|
|
1243
|
+
bn as VfSmartSelect,
|
|
1244
|
+
Do as cloneProp,
|
|
1245
|
+
Eo as configureVf,
|
|
1246
|
+
$o as configureVfOpenApiClient,
|
|
1247
|
+
Ho as createFilters,
|
|
1248
|
+
we as createOverlayInjection,
|
|
1249
|
+
fn as desnakeCase,
|
|
1250
|
+
Kt as dismissOverlayInjectionById,
|
|
1251
|
+
po as dismissOverlayInjectionByInstance,
|
|
1252
|
+
Ze as dismissOverlayInjectionByInternalInstance,
|
|
1253
|
+
Yt as dismissOverlayInjectionByVnode,
|
|
1254
|
+
Uo as escapeHtml,
|
|
1255
|
+
Zt as formatError,
|
|
1256
|
+
Nn as formatNumber,
|
|
1257
|
+
vn as formatPhone,
|
|
1258
|
+
mn as formatUSCurrency,
|
|
1259
|
+
bo as handleError,
|
|
1260
|
+
ko as handleErrorAndAlert,
|
|
1261
|
+
No as installVf,
|
|
1262
|
+
To as maskComponent,
|
|
1263
|
+
Gt as maskEl,
|
|
1264
|
+
Qt as maskForm,
|
|
1265
|
+
Co as nl2br,
|
|
1266
|
+
Bo as nullifyEmptyInputs,
|
|
1255
1267
|
Ee as presentOverlay,
|
|
1256
1268
|
te as removeOverlayInjection,
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1269
|
+
Oo as replaceElement,
|
|
1270
|
+
Xt as showAlert,
|
|
1271
|
+
yo as showConfirm,
|
|
1272
|
+
go as showConfirmDestroy,
|
|
1273
|
+
Ao as showContextMenu,
|
|
1274
|
+
Io as showToast,
|
|
1275
|
+
wo as showWait,
|
|
1276
|
+
_n as sleep,
|
|
1277
|
+
Fo as sleepSecs,
|
|
1278
|
+
ke as toError,
|
|
1279
|
+
So as unmaskComponent,
|
|
1280
|
+
Ge as unmaskEl,
|
|
1281
|
+
Qe as unmaskForm,
|
|
1282
|
+
Vo as useInfiniteScroll,
|
|
1283
|
+
_o as useResizeWatcher,
|
|
1284
|
+
xo as uuid,
|
|
1285
|
+
Mo as vfModalRef
|
|
1274
1286
|
};
|