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