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