@signal24/vue-foundation 4.27.0 → 4.28.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/.yarnrc.yml +1 -1
- package/demo/components/demo-vf-smart-select.vue +89 -9
- package/dist/src/components/vf-ajax-select.vue.d.ts +1 -1
- package/dist/src/components/vf-ez-smart-select.vue.d.ts +1 -1
- package/dist/src/components/vf-smart-select.vue.d.ts +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vue-foundation.es.js +603 -605
- package/package.json +9 -9
- package/src/components/vf-smart-select.vue +21 -10
|
@@ -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 V, Fragment as le, renderList as re, vModelSelect as Vt, getCurrentInstance as be, withModifiers as ke, normalizeStyle as Ht, normalizeClass as H, renderSlot as W, reactive as At, h as ae, Teleport as $t, markRaw as Bt, onBeforeUnmount as ue, resolveDirective as _t, createBlock as Je, createSlots as Nt, withCtx as he, createTextVNode as X, vModelText as Rt, onActivated as Qe, onDeactivated as et } from "vue";
|
|
2
|
+
import { compact as tt, cloneDeep as Wt, uniq as jt, groupBy as Ut, isEqual as we, debounce as Pt, 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)) : V("", !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
|
+
[Vt, 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 = be();
|
|
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:
|
|
100
|
+
class: H(["vf-overlay-anchor", l.value]),
|
|
101
101
|
style: Ht(o.value),
|
|
102
|
-
onClick:
|
|
102
|
+
onClick: ke(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 Te(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 Te(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 Te(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 Te(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
|
+
${Se(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 Se(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 = Se(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 = Se(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 Ee = 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[Ee] = {
|
|
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[Ee];
|
|
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[Ee]);
|
|
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,69 +316,69 @@ 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 = be(), o = e;
|
|
320
|
+
t({ mask: h, unmask: g, hide: a, unhide: f });
|
|
321
|
+
const l = S(), s = S(), u = S(!1), r = T(() => tt([...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:
|
|
354
|
+
ref: l,
|
|
355
|
+
class: H(["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
|
-
class:
|
|
362
|
-
onSubmit: C[0] || (C[0] =
|
|
361
|
+
class: H(["vf-modal", { scrolls: m.scrolls }]),
|
|
362
|
+
onSubmit: C[0] || (C[0] = ke((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,
|
|
368
368
|
class: "close",
|
|
369
369
|
onClick: E
|
|
370
|
-
})) :
|
|
371
|
-
])) :
|
|
372
|
-
A("div",
|
|
370
|
+
})) : V("", !0)
|
|
371
|
+
])) : V("", !0),
|
|
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
|
+
])) : V("", !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,57 +391,57 @@ 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(),
|
|
398
|
-
class:
|
|
399
|
-
},
|
|
400
|
-
default:
|
|
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(), Je(gn, {
|
|
398
|
+
class: H(["vf-alert", ...o.classes ?? []])
|
|
399
|
+
}, Nt({
|
|
400
|
+
default: he(() => [
|
|
401
401
|
o.iconClass ? (b(), k("i", {
|
|
402
402
|
key: 0,
|
|
403
|
-
class:
|
|
404
|
-
}, null, 2)) :
|
|
403
|
+
class: H(["vf-alert-icon", o.iconClass])
|
|
404
|
+
}, null, 2)) : V("", !0),
|
|
405
405
|
o.isHtml ? (b(), k("div", {
|
|
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 We(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
|
+
}, Ce = 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 = Ce(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 = Ce(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 : Ce(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), je = { randomUUID: On };
|
|
676
|
+
function Dn(e, t, n) {
|
|
677
|
+
if (je.randomUUID && !e)
|
|
678
|
+
return je.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 Vn(e) {
|
|
689
689
|
return e.replace(/_/g, " ");
|
|
690
690
|
}
|
|
691
691
|
function Hn(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 ?? []), Le = 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), Fe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Ie = T(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Oe = T(() => [...yt.value, ...ht.value, ...gt.value]), De = T(() => !!(s.groupField || s.groupFormatter)), pe = T(() => Oe.value.map((i, w) => {
|
|
752
|
+
const v = bt.value?.(i), p = Fe.value(i), y = s.subtitleFormatter?.(i), I = p ? p.trim().toLowerCase() : "", Ne = y ? y.trim().toLowerCase() : "", oe = [];
|
|
753
|
+
return s.searchFields ? s.searchFields.forEach((Re) => {
|
|
754
|
+
i[Re] && oe.push(String(i[Re]).toLowerCase());
|
|
755
|
+
}) : (oe.push(I), Ne && oe.push(Ne)), {
|
|
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,49 @@ 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 (!De.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($e, 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 !==
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}), s.remoteSearch && O(c, Ut(kt, 250));
|
|
813
|
-
}), ae(() => {
|
|
807
|
+
$.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (a.value = z.value, await Ve(), a.value = ""), !s.options && !s.loadOptions && (s.valueField || s.valueExtractor) ? a.value = z.value : me(), O(f, () => {
|
|
808
|
+
const i = We(f.value) && q.value !== null ? q.value(f.value) : f.value;
|
|
809
|
+
we(s.modelValue, i) || u("update:modelValue", i);
|
|
810
|
+
}), s.remoteSearch && O(a, Pt(Tt, 250));
|
|
811
|
+
}), ue(() => {
|
|
814
812
|
d.value?.remove();
|
|
815
813
|
});
|
|
816
|
-
async function
|
|
817
|
-
await
|
|
814
|
+
async function Ve() {
|
|
815
|
+
await He(), h.value && u("optionsLoaded", h.value);
|
|
818
816
|
}
|
|
819
|
-
async function
|
|
820
|
-
const i = s.remoteSearch && g.value &&
|
|
821
|
-
E.value = !0, h.value = await s.loadOptions?.(i) ?? [], E.value = !1,
|
|
817
|
+
async function He() {
|
|
818
|
+
const i = s.remoteSearch && g.value && a.value.length ? a.value : null;
|
|
819
|
+
E.value = !0, h.value = await s.loadOptions?.(i) ?? [], E.value = !1, Ae();
|
|
822
820
|
}
|
|
823
|
-
function
|
|
824
|
-
g.value && (
|
|
821
|
+
function Tt() {
|
|
822
|
+
g.value && (He(), g.value = a.value.trim().length > 0);
|
|
825
823
|
}
|
|
826
|
-
function
|
|
824
|
+
function St(i) {
|
|
827
825
|
if (i.key == "Escape") {
|
|
828
|
-
i.stopPropagation(), i.target.blur(),
|
|
826
|
+
i.stopPropagation(), i.target.blur(), _e();
|
|
829
827
|
return;
|
|
830
828
|
}
|
|
831
829
|
if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
|
|
@@ -834,64 +832,64 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
834
832
|
return;
|
|
835
833
|
}
|
|
836
834
|
if (i.key == "ArrowUp" || i.key == "ArrowDown")
|
|
837
|
-
return i.preventDefault(),
|
|
835
|
+
return i.preventDefault(), ve(i.key == "ArrowUp" ? -1 : 1);
|
|
838
836
|
if (i.key == "PageUp" || i.key == "PageDown")
|
|
839
|
-
return i.preventDefault(),
|
|
837
|
+
return i.preventDefault(), ve(i.key == "PageUp" ? -10 : 10);
|
|
840
838
|
if (i.key == "Home" || i.key == "End")
|
|
841
|
-
return i.preventDefault(),
|
|
839
|
+
return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
842
840
|
if (i.key == "Enter") {
|
|
843
841
|
i.preventDefault();
|
|
844
842
|
const w = L.value.find((v) => v.key == x.value);
|
|
845
|
-
if (w) return
|
|
843
|
+
if (w) return Be(w);
|
|
846
844
|
}
|
|
847
845
|
if (i.key === "Delete" || i.key === "Backspace") {
|
|
848
|
-
|
|
846
|
+
a.value.length > 1 && (g.value = !0);
|
|
849
847
|
return;
|
|
850
848
|
}
|
|
851
|
-
!i.metaKey &&
|
|
849
|
+
!i.metaKey && Un.includes(i.key) && (g.value = !0);
|
|
852
850
|
}
|
|
853
851
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
856
|
-
}
|
|
857
|
-
function He(i) {
|
|
858
|
-
f.value ? x.value = Ct(f.value) : s.nullTitle && (x.value = o);
|
|
852
|
+
function Ct() {
|
|
853
|
+
Ae(), C.value = !0, setTimeout(() => c.value?.select(), 0);
|
|
859
854
|
}
|
|
860
|
-
function
|
|
861
|
-
|
|
855
|
+
function Ae(i) {
|
|
856
|
+
f.value ? x.value = xt(f.value) : s.nullTitle && (x.value = o);
|
|
862
857
|
}
|
|
863
858
|
function xt(i) {
|
|
859
|
+
return fe.value ? fe.value(f.value) : Mt(i)?.key ?? "";
|
|
860
|
+
}
|
|
861
|
+
function Mt(i) {
|
|
864
862
|
const w = L.value.find((y) => y.ref === i);
|
|
865
863
|
if (w)
|
|
866
864
|
return w;
|
|
867
|
-
const v = s.keyExtractor ? (y, I) => s.keyExtractor(y) === s.keyExtractor(I) :
|
|
865
|
+
const v = s.keyExtractor ? (y, I) => s.keyExtractor(y) === s.keyExtractor(I) : we, p = L.value.find((y) => v(y.ref, i));
|
|
868
866
|
return p || null;
|
|
869
867
|
}
|
|
870
|
-
function Mt() {
|
|
871
|
-
s.debug || (!c.value.length && s.nullTitle && (f.value = null, m.value = null), C.value = !1);
|
|
872
|
-
}
|
|
873
868
|
function Lt() {
|
|
874
|
-
|
|
869
|
+
s.debug || (!a.value.length && s.nullTitle && (f.value = null, m.value = null), C.value = !1);
|
|
875
870
|
}
|
|
876
871
|
function Ft() {
|
|
877
|
-
|
|
872
|
+
P.value || Ve(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), It();
|
|
873
|
+
}
|
|
874
|
+
function It() {
|
|
875
|
+
const i = r.value.getBoundingClientRect(), w = i.y + i.height + 2, v = i.x, p = d.value, y = window.getComputedStyle(r.value);
|
|
878
876
|
for (let I in y)
|
|
879
877
|
/^(font|text)/.test(I) && (p.style[I] = y[I]);
|
|
880
878
|
if (p.style.top = w + "px", p.style.left = v + "px", p.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
|
|
881
879
|
const I = window.innerHeight - w - 12;
|
|
882
880
|
p.style.maxHeight = I + "px";
|
|
883
881
|
}
|
|
884
|
-
p.style.visibility = "visible", document.body.appendChild(p), setTimeout(
|
|
882
|
+
p.style.visibility = "visible", document.body.appendChild(p), setTimeout($e, 0);
|
|
885
883
|
}
|
|
886
|
-
function
|
|
884
|
+
function $e() {
|
|
887
885
|
if (!P.value || !x.value) return;
|
|
888
886
|
const i = L.value.findIndex((p) => p.key == x.value), w = d.value, v = w?.querySelectorAll(".option")[i];
|
|
889
887
|
v && (w.scrollTop = v.offsetTop);
|
|
890
888
|
}
|
|
891
|
-
function
|
|
889
|
+
function Ot(i) {
|
|
892
890
|
x.value = i ? i.key : null;
|
|
893
891
|
}
|
|
894
|
-
function
|
|
892
|
+
function ve(i) {
|
|
895
893
|
const w = L.value.findIndex((I) => I.key == x.value);
|
|
896
894
|
let v = w + i;
|
|
897
895
|
if (v < 0 ? v = 0 : v >= L.value.length && (v = L.value.length - 1), w == v) return;
|
|
@@ -899,102 +897,102 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
899
897
|
const p = d.value, y = p?.querySelectorAll(".option")[v];
|
|
900
898
|
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
899
|
}
|
|
902
|
-
function
|
|
900
|
+
function Be(i) {
|
|
903
901
|
if (g.value = !1, i.key === o)
|
|
904
|
-
|
|
905
|
-
else if (i.key ===
|
|
906
|
-
const w =
|
|
907
|
-
|
|
902
|
+
a.value = "", f.value = null, m.value = null;
|
|
903
|
+
else if (i.key === l) {
|
|
904
|
+
const w = a.value.trim();
|
|
905
|
+
a.value = "", f.value = null, m.value = null, s.onCreateItem?.(w);
|
|
908
906
|
} else {
|
|
909
|
-
const v =
|
|
910
|
-
f.value = v, m.value =
|
|
907
|
+
const v = pe.value.find((p) => p.key == i.key).ref;
|
|
908
|
+
f.value = v, m.value = Ie.value(v), a.value = m.value ?? "";
|
|
911
909
|
}
|
|
912
|
-
|
|
910
|
+
c.value?.blur(), _e();
|
|
913
911
|
}
|
|
914
|
-
function
|
|
915
|
-
s.modelValue !== null ? (f.value = q.value ?
|
|
912
|
+
function me() {
|
|
913
|
+
s.modelValue !== null ? (f.value = q.value ? Oe.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, m.value = We(f.value) ? Ie.value(f.value) : null, a.value = m.value ?? "") : (f.value = null, m.value = null, a.value = "");
|
|
916
914
|
}
|
|
917
|
-
function
|
|
915
|
+
function Dt(i) {
|
|
918
916
|
h.value.unshift(i);
|
|
919
917
|
}
|
|
920
|
-
function
|
|
918
|
+
function _e() {
|
|
921
919
|
if (!s.autoNext) return;
|
|
922
|
-
let i =
|
|
920
|
+
let i = r.value?.parentElement;
|
|
923
921
|
for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
|
|
924
922
|
i = i.parentElement;
|
|
925
923
|
if (!i) return;
|
|
926
924
|
const w = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
927
925
|
if (!w) return;
|
|
928
|
-
const v = Array.from(w).findIndex((y) => y ===
|
|
926
|
+
const v = Array.from(w).findIndex((y) => y === c.value), p = w[v + 1];
|
|
929
927
|
p && setTimeout(() => p.focus(), 0);
|
|
930
928
|
}
|
|
931
929
|
return (i, w) => (b(), k("div", {
|
|
932
930
|
ref_key: "el",
|
|
933
|
-
ref:
|
|
934
|
-
class:
|
|
931
|
+
ref: r,
|
|
932
|
+
class: H(["vf-smart-select", { disabled: Le.value, open: C.value }])
|
|
935
933
|
}, [
|
|
936
|
-
|
|
934
|
+
ie(A("input", {
|
|
937
935
|
ref_key: "searchField",
|
|
938
|
-
ref:
|
|
939
|
-
"onUpdate:modelValue": w[0] || (w[0] = (v) =>
|
|
936
|
+
ref: c,
|
|
937
|
+
"onUpdate:modelValue": w[0] || (w[0] = (v) => a.value = v),
|
|
940
938
|
type: "text",
|
|
941
|
-
disabled:
|
|
942
|
-
class:
|
|
943
|
-
placeholder:
|
|
939
|
+
disabled: Le.value,
|
|
940
|
+
class: H({ nullable: !!i.nullTitle }),
|
|
941
|
+
placeholder: wt.value,
|
|
944
942
|
required: i.required,
|
|
945
943
|
name: i.name,
|
|
946
944
|
"data-1p-ignore": "",
|
|
947
|
-
onKeydown:
|
|
948
|
-
onFocus:
|
|
949
|
-
onBlur:
|
|
950
|
-
}, null, 42,
|
|
951
|
-
[
|
|
945
|
+
onKeydown: St,
|
|
946
|
+
onFocus: Ct,
|
|
947
|
+
onBlur: Lt
|
|
948
|
+
}, null, 42, $n), [
|
|
949
|
+
[Rt, a.value]
|
|
952
950
|
]),
|
|
953
951
|
C.value ? (b(), k("div", {
|
|
954
952
|
key: 0,
|
|
955
953
|
ref_key: "optionsContainer",
|
|
956
954
|
ref: d,
|
|
957
|
-
class:
|
|
955
|
+
class: H(["vf-smart-select-options", { grouped: De.value }])
|
|
958
956
|
}, [
|
|
959
|
-
P.value ? (b(!0), k(
|
|
957
|
+
P.value ? (b(!0), k(le, { key: 1 }, re(kt.value, (v) => (b(), k("div", {
|
|
960
958
|
key: v.groupTitle,
|
|
961
959
|
class: "group"
|
|
962
960
|
}, [
|
|
963
|
-
v.groupTitle ? (b(), k("div",
|
|
961
|
+
v.groupTitle ? (b(), k("div", _n, [
|
|
964
962
|
W(i.$slots, "group", {
|
|
965
963
|
group: v.groupTitle
|
|
966
964
|
}, () => [
|
|
967
|
-
|
|
965
|
+
X(R(v.groupTitle), 1)
|
|
968
966
|
])
|
|
969
|
-
])) :
|
|
970
|
-
(b(!0), k(
|
|
967
|
+
])) : V("", !0),
|
|
968
|
+
(b(!0), k(le, null, re(v.options, (p) => (b(), k("div", {
|
|
971
969
|
key: p.key,
|
|
972
|
-
class:
|
|
973
|
-
onMousemove: (y) =>
|
|
974
|
-
onMousedown: (y) =>
|
|
970
|
+
class: H(["option", [x.value === p.key && "highlighted", p.ref && i.classForOption?.(p.ref)]]),
|
|
971
|
+
onMousemove: (y) => Ot(p),
|
|
972
|
+
onMousedown: (y) => Be(p)
|
|
975
973
|
}, [
|
|
976
974
|
W(i.$slots, "option", { option: p }, () => [
|
|
977
975
|
A("div", {
|
|
978
976
|
class: "title",
|
|
979
977
|
innerHTML: p.title
|
|
980
|
-
}, null, 8,
|
|
978
|
+
}, null, 8, Rn),
|
|
981
979
|
p.subtitle ? (b(), k("div", {
|
|
982
980
|
key: 0,
|
|
983
981
|
class: "subtitle",
|
|
984
982
|
innerHTML: p.subtitle
|
|
985
|
-
}, null, 8,
|
|
983
|
+
}, null, 8, Wn)) : V("", !0)
|
|
986
984
|
])
|
|
987
|
-
], 42,
|
|
988
|
-
!L.value.length &&
|
|
985
|
+
], 42, Nn))), 128)),
|
|
986
|
+
!L.value.length && a.value ? (b(), k("div", jn, [
|
|
989
987
|
W(i.$slots, "no-results", {}, () => [
|
|
990
|
-
|
|
988
|
+
X(R(Et.value), 1)
|
|
991
989
|
])
|
|
992
|
-
])) :
|
|
993
|
-
]))), 128)) : (b(), k("div",
|
|
994
|
-
], 2)) :
|
|
990
|
+
])) : V("", !0)
|
|
991
|
+
]))), 128)) : (b(), k("div", Bn, "Loading..."))
|
|
992
|
+
], 2)) : V("", !0)
|
|
995
993
|
], 2));
|
|
996
994
|
}
|
|
997
|
-
}),
|
|
995
|
+
}), ss = /* @__PURE__ */ N({
|
|
998
996
|
__name: "vf-ez-smart-select",
|
|
999
997
|
props: {
|
|
1000
998
|
modelValue: {},
|
|
@@ -1006,39 +1004,39 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
|
|
|
1006
1004
|
},
|
|
1007
1005
|
emits: ["update:modelValue"],
|
|
1008
1006
|
setup(e, { emit: t }) {
|
|
1009
|
-
const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((
|
|
1010
|
-
value:
|
|
1011
|
-
label:
|
|
1012
|
-
}))),
|
|
1007
|
+
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]) => ({
|
|
1008
|
+
value: r,
|
|
1009
|
+
label: c
|
|
1010
|
+
}))), 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
1011
|
return O(
|
|
1014
1012
|
() => n.modelValue,
|
|
1015
|
-
(
|
|
1016
|
-
|
|
1013
|
+
(r) => {
|
|
1014
|
+
u.value = o.value.find((c) => c.value === r) ?? null;
|
|
1017
1015
|
}
|
|
1018
|
-
), O(
|
|
1019
|
-
const
|
|
1020
|
-
s("update:modelValue",
|
|
1021
|
-
}), (
|
|
1022
|
-
modelValue:
|
|
1023
|
-
"onUpdate:modelValue":
|
|
1016
|
+
), O(u, (r) => {
|
|
1017
|
+
const c = r ? o.value.find((d) => we(d, r))?.value : null;
|
|
1018
|
+
s("update:modelValue", c ?? null);
|
|
1019
|
+
}), (r, c) => (b(), Je(Pn, {
|
|
1020
|
+
modelValue: u.value,
|
|
1021
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => u.value = d),
|
|
1024
1022
|
options: o.value,
|
|
1025
|
-
formatter:
|
|
1026
|
-
"null-title":
|
|
1027
|
-
placeholder:
|
|
1028
|
-
name:
|
|
1023
|
+
formatter: l.value,
|
|
1024
|
+
"null-title": r.nullTitle,
|
|
1025
|
+
placeholder: r.placeholder,
|
|
1026
|
+
name: r.name
|
|
1029
1027
|
}, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
|
|
1030
1028
|
}
|
|
1031
1029
|
});
|
|
1032
|
-
function
|
|
1030
|
+
function is() {
|
|
1033
1031
|
return S();
|
|
1034
1032
|
}
|
|
1035
|
-
const
|
|
1033
|
+
const qn = { class: "content" }, zn = { class: "message" }, Kn = {
|
|
1036
1034
|
key: 0,
|
|
1037
1035
|
class: "close"
|
|
1038
|
-
},
|
|
1036
|
+
}, Yn = {
|
|
1039
1037
|
key: 0,
|
|
1040
1038
|
class: "progress-bar"
|
|
1041
|
-
},
|
|
1039
|
+
}, Xn = /* @__PURE__ */ N({
|
|
1042
1040
|
__name: "vf-toast",
|
|
1043
1041
|
props: {
|
|
1044
1042
|
message: {},
|
|
@@ -1055,134 +1053,134 @@ const Pn = { class: "content" }, qn = { class: "message" }, zn = {
|
|
|
1055
1053
|
}
|
|
1056
1054
|
const o = S();
|
|
1057
1055
|
return t.durationSecs !== null && B(() => {
|
|
1058
|
-
const
|
|
1056
|
+
const l = t.durationSecs ?? 5;
|
|
1059
1057
|
o.value?.animate([{ width: "0%" }, { width: "100%" }], {
|
|
1060
|
-
duration:
|
|
1058
|
+
duration: l * 1e3,
|
|
1061
1059
|
easing: "linear"
|
|
1062
|
-
}), setTimeout(() => t.callback(),
|
|
1063
|
-
}), (
|
|
1064
|
-
class:
|
|
1065
|
-
onClick:
|
|
1060
|
+
}), setTimeout(() => t.callback(), l * 1e3);
|
|
1061
|
+
}), (l, s) => (b(), k("div", {
|
|
1062
|
+
class: H(["vf-toast", l.className]),
|
|
1063
|
+
onClick: ke(n, ["stop"])
|
|
1066
1064
|
}, [
|
|
1067
|
-
A("div",
|
|
1068
|
-
A("div",
|
|
1069
|
-
|
|
1065
|
+
A("div", qn, [
|
|
1066
|
+
A("div", zn, R(l.message), 1),
|
|
1067
|
+
l.disableClose ? V("", !0) : (b(), k("div", Kn, "x"))
|
|
1070
1068
|
]),
|
|
1071
|
-
|
|
1069
|
+
l.durationSecs !== null ? (b(), k("div", Yn, [
|
|
1072
1070
|
A("div", {
|
|
1073
1071
|
ref_key: "progressInnerEl",
|
|
1074
1072
|
ref: o,
|
|
1075
1073
|
class: "inner"
|
|
1076
1074
|
}, null, 512)
|
|
1077
|
-
])) :
|
|
1075
|
+
])) : V("", !0)
|
|
1078
1076
|
], 2));
|
|
1079
1077
|
}
|
|
1080
1078
|
});
|
|
1081
|
-
function
|
|
1082
|
-
const t =
|
|
1079
|
+
function ls(e) {
|
|
1080
|
+
const t = ce(Xn, {
|
|
1083
1081
|
...e,
|
|
1084
|
-
callback: () =>
|
|
1082
|
+
callback: () => Q(t)
|
|
1085
1083
|
});
|
|
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}`;
|
|
1084
|
+
return () => Q(t);
|
|
1091
1085
|
}
|
|
1092
1086
|
function Zn(e) {
|
|
1093
|
-
|
|
1087
|
+
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];
|
|
1088
|
+
return `${o} ${l}`;
|
|
1094
1089
|
}
|
|
1095
1090
|
function Gn(e) {
|
|
1096
|
-
return e
|
|
1091
|
+
return e != null && String(e).length ? e : "-";
|
|
1097
1092
|
}
|
|
1098
1093
|
function Jn(e) {
|
|
1099
|
-
return e
|
|
1094
|
+
return e || "-";
|
|
1100
1095
|
}
|
|
1101
1096
|
function Qn(e) {
|
|
1102
|
-
return e &&
|
|
1097
|
+
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : kn(Number(e));
|
|
1103
1098
|
}
|
|
1104
1099
|
function eo(e) {
|
|
1105
|
-
return e
|
|
1106
|
-
}
|
|
1107
|
-
function rt(e) {
|
|
1108
|
-
return e ? Pt(e) : null;
|
|
1100
|
+
return e && Hn(e);
|
|
1109
1101
|
}
|
|
1110
1102
|
function to(e) {
|
|
1111
|
-
return e ? e
|
|
1103
|
+
return e ? zt(e) : null;
|
|
1104
|
+
}
|
|
1105
|
+
function rt(e) {
|
|
1106
|
+
return e ? qt(e) : null;
|
|
1112
1107
|
}
|
|
1113
1108
|
function no(e) {
|
|
1114
|
-
return e ?
|
|
1109
|
+
return e ? e.toUpperCase() : null;
|
|
1115
1110
|
}
|
|
1116
1111
|
function oo(e) {
|
|
1117
|
-
return e ?
|
|
1112
|
+
return e ? rt(e.toLowerCase()) : null;
|
|
1118
1113
|
}
|
|
1119
|
-
function so(e
|
|
1120
|
-
return Vn(e
|
|
1114
|
+
function so(e) {
|
|
1115
|
+
return e ? Vn(e) : null;
|
|
1121
1116
|
}
|
|
1122
1117
|
function io(e, t) {
|
|
1118
|
+
return An(e, t);
|
|
1119
|
+
}
|
|
1120
|
+
function lo(e, t) {
|
|
1123
1121
|
return D(e).divide(t).value;
|
|
1124
1122
|
}
|
|
1125
1123
|
function ro(e, t) {
|
|
1126
1124
|
return e && U(new Date(e), t ?? F.defaultDateFormat);
|
|
1127
1125
|
}
|
|
1128
|
-
function
|
|
1126
|
+
function ao(e, t) {
|
|
1129
1127
|
return e && U(new Date(e), t ?? F.defaultTimeFormat);
|
|
1130
1128
|
}
|
|
1131
|
-
function
|
|
1129
|
+
function uo(e, t) {
|
|
1132
1130
|
return e && U(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1133
1131
|
}
|
|
1134
|
-
function
|
|
1135
|
-
return e && U(
|
|
1132
|
+
function co(e) {
|
|
1133
|
+
return e && U(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
|
|
1136
1134
|
}
|
|
1137
|
-
const
|
|
1138
|
-
bytes:
|
|
1139
|
-
dash:
|
|
1140
|
-
dashZeros:
|
|
1141
|
-
number:
|
|
1142
|
-
phone:
|
|
1143
|
-
upperFirst:
|
|
1135
|
+
const Ue = {
|
|
1136
|
+
bytes: Zn,
|
|
1137
|
+
dash: Gn,
|
|
1138
|
+
dashZeros: Jn,
|
|
1139
|
+
number: Qn,
|
|
1140
|
+
phone: eo,
|
|
1141
|
+
upperFirst: to,
|
|
1144
1142
|
startCase: rt,
|
|
1145
|
-
upperCase:
|
|
1146
|
-
upperWords:
|
|
1147
|
-
desnake:
|
|
1148
|
-
usCurrency:
|
|
1149
|
-
divide:
|
|
1143
|
+
upperCase: no,
|
|
1144
|
+
upperWords: oo,
|
|
1145
|
+
desnake: so,
|
|
1146
|
+
usCurrency: io,
|
|
1147
|
+
divide: lo,
|
|
1150
1148
|
date: ro,
|
|
1151
|
-
time:
|
|
1152
|
-
dateTime:
|
|
1153
|
-
oneDayForward:
|
|
1149
|
+
time: ao,
|
|
1150
|
+
dateTime: uo,
|
|
1151
|
+
oneDayForward: co
|
|
1154
1152
|
}, rs = (e) => ({
|
|
1155
|
-
...
|
|
1156
|
-
...e(
|
|
1157
|
-
}),
|
|
1158
|
-
function
|
|
1159
|
-
const n = t ??
|
|
1160
|
-
B(() =>
|
|
1161
|
-
}
|
|
1162
|
-
function
|
|
1153
|
+
...Ue,
|
|
1154
|
+
...e(Ue)
|
|
1155
|
+
}), xe = Symbol("HookState");
|
|
1156
|
+
function as(e, t) {
|
|
1157
|
+
const n = t ?? be();
|
|
1158
|
+
B(() => fo(n, e), n), Qe(() => po(n), n), et(() => Pe(n), n), ue(() => Pe(n), n);
|
|
1159
|
+
}
|
|
1160
|
+
function fo(e, t) {
|
|
1163
1161
|
const n = {};
|
|
1164
|
-
if (t.elScrolledToBottom && (n.el = new
|
|
1165
|
-
const o =
|
|
1166
|
-
o ? n.ancestor = new
|
|
1162
|
+
if (t.elScrolledToBottom && (n.el = new G(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1163
|
+
const o = at(e.vnode.el);
|
|
1164
|
+
o ? n.ancestor = new G(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
1167
1165
|
}
|
|
1168
|
-
t.windowScrolledToBottom && (n.window = new
|
|
1166
|
+
t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[xe] = n;
|
|
1169
1167
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const t = e[
|
|
1168
|
+
function po(e) {
|
|
1169
|
+
const t = e[xe];
|
|
1172
1170
|
t?.el?.install(), t?.ancestor?.install(), t?.window?.install();
|
|
1173
1171
|
}
|
|
1174
|
-
function
|
|
1175
|
-
const t = e[
|
|
1172
|
+
function Pe(e) {
|
|
1173
|
+
const t = e[xe];
|
|
1176
1174
|
t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
|
|
1177
1175
|
}
|
|
1178
|
-
const
|
|
1179
|
-
function
|
|
1176
|
+
const ge = ["auto", "scroll"];
|
|
1177
|
+
function at(e) {
|
|
1180
1178
|
const t = e.parentElement;
|
|
1181
1179
|
if (!t) return null;
|
|
1182
1180
|
const n = window.getComputedStyle(t);
|
|
1183
|
-
return
|
|
1181
|
+
return ge.includes(n.overflow) || ge.includes(n.overflowX) || ge.includes(n.overflowY) ? t : at(t);
|
|
1184
1182
|
}
|
|
1185
|
-
class
|
|
1183
|
+
class G {
|
|
1186
1184
|
constructor(t, n) {
|
|
1187
1185
|
this.el = t, this.handler = n, this.install();
|
|
1188
1186
|
}
|
|
@@ -1198,29 +1196,29 @@ class Z {
|
|
|
1198
1196
|
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
1197
|
}
|
|
1200
1198
|
}
|
|
1201
|
-
function
|
|
1202
|
-
B(() => window.addEventListener("resize", e)),
|
|
1199
|
+
function us(e) {
|
|
1200
|
+
B(() => window.addEventListener("resize", e)), Qe(() => window.addEventListener("resize", e)), et(() => window.removeEventListener("resize", e)), ue(() => window.removeEventListener("resize", e));
|
|
1203
1201
|
}
|
|
1204
|
-
const
|
|
1205
|
-
mounted:
|
|
1206
|
-
updated:
|
|
1207
|
-
},
|
|
1208
|
-
function
|
|
1209
|
-
if (t.value === void 0 && e[
|
|
1210
|
-
e[
|
|
1202
|
+
const vo = {
|
|
1203
|
+
mounted: ze,
|
|
1204
|
+
updated: ze
|
|
1205
|
+
}, qe = Symbol("HasAutoFocused");
|
|
1206
|
+
function ze(e, t) {
|
|
1207
|
+
if (t.value === void 0 && e[qe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
|
|
1208
|
+
e[qe] = !0;
|
|
1211
1209
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1212
1210
|
setTimeout(() => n.focus(), 10);
|
|
1213
1211
|
}
|
|
1214
|
-
const
|
|
1215
|
-
mounted:
|
|
1216
|
-
},
|
|
1217
|
-
function
|
|
1212
|
+
const mo = {
|
|
1213
|
+
mounted: ho
|
|
1214
|
+
}, K = Symbol("ConfirmState");
|
|
1215
|
+
function ho(e, t) {
|
|
1218
1216
|
e.addEventListener("click", (n) => {
|
|
1219
|
-
const o = Date.now(),
|
|
1220
|
-
if (e[
|
|
1221
|
-
if (o - e[
|
|
1217
|
+
const o = Date.now(), l = t.value?.text !== void 0 ? t.value.text : "Confirm";
|
|
1218
|
+
if (e[K]) {
|
|
1219
|
+
if (o - e[K].initTime < 300)
|
|
1222
1220
|
return;
|
|
1223
|
-
e[
|
|
1221
|
+
e[K].resetHandler(), e.dispatchEvent(new Event("confirm"));
|
|
1224
1222
|
return;
|
|
1225
1223
|
}
|
|
1226
1224
|
n.preventDefault(), n.stopImmediatePropagation();
|
|
@@ -1228,16 +1226,16 @@ function mo(e, t) {
|
|
|
1228
1226
|
initTime: o,
|
|
1229
1227
|
preconfirmHtml: e.innerHTML,
|
|
1230
1228
|
resetHandler: () => {
|
|
1231
|
-
|
|
1229
|
+
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
1230
|
}
|
|
1233
1231
|
};
|
|
1234
|
-
e[
|
|
1232
|
+
e[K] = s, l && (e.innerHTML = l), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
|
|
1235
1233
|
});
|
|
1236
1234
|
}
|
|
1237
|
-
const
|
|
1238
|
-
beforeMount:
|
|
1235
|
+
const yo = {
|
|
1236
|
+
beforeMount: go
|
|
1239
1237
|
};
|
|
1240
|
-
function
|
|
1238
|
+
function go(e) {
|
|
1241
1239
|
e.addEventListener("blur", () => {
|
|
1242
1240
|
let t = e.value;
|
|
1243
1241
|
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + U(/* @__PURE__ */ new Date(), "yy"));
|
|
@@ -1245,141 +1243,141 @@ function yo(e) {
|
|
|
1245
1243
|
isNaN(n) ? e.value = "" : e.value = U(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1246
1244
|
});
|
|
1247
1245
|
}
|
|
1248
|
-
const
|
|
1249
|
-
beforeMount:
|
|
1250
|
-
updated:
|
|
1246
|
+
const wo = {
|
|
1247
|
+
beforeMount: Ke,
|
|
1248
|
+
updated: Ke
|
|
1251
1249
|
};
|
|
1252
|
-
function
|
|
1253
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1250
|
+
function Ke(e, t) {
|
|
1251
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = Eo(e, t));
|
|
1254
1252
|
}
|
|
1255
|
-
function
|
|
1253
|
+
function Eo(e, t) {
|
|
1256
1254
|
if (!t.value)
|
|
1257
1255
|
return e.attributes.getNamedItem("placeholder")?.value ?? "";
|
|
1258
1256
|
let n = "";
|
|
1259
|
-
const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"),
|
|
1257
|
+
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
1258
|
e.attributes.getNamedItem("display-utc") !== null && s.setMinutes(s.getMinutes() - s.getTimezoneOffset());
|
|
1261
|
-
let
|
|
1262
|
-
const
|
|
1263
|
-
if (!
|
|
1259
|
+
let u = e.attributes.getNamedItem("format")?.value;
|
|
1260
|
+
const r = e.attributes.getNamedItem("date-only") !== null;
|
|
1261
|
+
if (!u && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1264
1262
|
const d = /* @__PURE__ */ new Date();
|
|
1265
|
-
d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at",
|
|
1263
|
+
d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at", u = "HH:mm");
|
|
1266
1264
|
}
|
|
1267
|
-
if (!
|
|
1265
|
+
if (!u && e.attributes.getNamedItem("simplified-date") !== null) {
|
|
1268
1266
|
let d = null;
|
|
1269
1267
|
const E = /* @__PURE__ */ new Date();
|
|
1270
1268
|
E.getFullYear() === s.getFullYear() ? (E.getMonth() !== s.getMonth() || E.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
|
|
1271
|
-
const h =
|
|
1272
|
-
|
|
1269
|
+
const h = r ? null : F.defaultTimeFormat;
|
|
1270
|
+
u = tt([d, h]).join(" ");
|
|
1273
1271
|
}
|
|
1274
|
-
|
|
1275
|
-
let
|
|
1276
|
-
return n && (
|
|
1277
|
-
}
|
|
1278
|
-
const
|
|
1279
|
-
beforeMount:
|
|
1280
|
-
updated:
|
|
1281
|
-
unmounted:
|
|
1272
|
+
u || (r ? u = F.defaultDateFormat : u = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
|
|
1273
|
+
let c = U(s, u);
|
|
1274
|
+
return n && (c = n + " " + c), c;
|
|
1275
|
+
}
|
|
1276
|
+
const bo = {
|
|
1277
|
+
beforeMount: Ye,
|
|
1278
|
+
updated: Ye,
|
|
1279
|
+
unmounted: ko
|
|
1282
1280
|
};
|
|
1283
|
-
function
|
|
1281
|
+
function Ye(e, t) {
|
|
1284
1282
|
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
1283
|
}
|
|
1286
|
-
function
|
|
1284
|
+
function ko(e) {
|
|
1287
1285
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1288
1286
|
}
|
|
1289
|
-
const
|
|
1290
|
-
beforeMount:
|
|
1291
|
-
updated:
|
|
1292
|
-
unmounted:
|
|
1293
|
-
},
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1287
|
+
const To = {
|
|
1288
|
+
beforeMount: Xe,
|
|
1289
|
+
updated: Xe,
|
|
1290
|
+
unmounted: ct
|
|
1291
|
+
}, ee = Symbol("HasAutoFocused"), Me = [];
|
|
1292
|
+
function So() {
|
|
1293
|
+
Me.forEach(ut);
|
|
1296
1294
|
}
|
|
1297
|
-
setInterval(
|
|
1298
|
-
function
|
|
1295
|
+
setInterval(So, 1e3);
|
|
1296
|
+
function Xe(e, t) {
|
|
1299
1297
|
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:
|
|
1298
|
+
if (!t.value) return ct(e);
|
|
1299
|
+
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;
|
|
1300
|
+
e[ee] || Me.push(e), e[ee] = {
|
|
1301
|
+
startTs: l,
|
|
1304
1302
|
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);
|
|
1303
|
+
}, ut(e);
|
|
1310
1304
|
}
|
|
1311
1305
|
function ut(e) {
|
|
1312
|
-
e[
|
|
1306
|
+
const t = e[ee], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1307
|
+
e.innerText = Co(n, t.includeSeconds);
|
|
1313
1308
|
}
|
|
1314
|
-
function
|
|
1309
|
+
function ct(e) {
|
|
1310
|
+
e[ee] && (Kt(Me, e), delete e[ee]), e.innerText = "-";
|
|
1311
|
+
}
|
|
1312
|
+
function Co(e, t) {
|
|
1315
1313
|
const n = [], o = Math.floor(e / 86400);
|
|
1316
1314
|
o && n.push(o + "d"), e -= o * 86400;
|
|
1317
|
-
const
|
|
1318
|
-
(o ||
|
|
1315
|
+
const l = Math.floor(e / 3600);
|
|
1316
|
+
(o || l) && n.push(l + "h"), e -= l * 3600;
|
|
1319
1317
|
const s = Math.floor(e / 60);
|
|
1320
|
-
return (o ||
|
|
1318
|
+
return (o || l || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
|
|
1321
1319
|
}
|
|
1322
|
-
const
|
|
1323
|
-
mounted:
|
|
1324
|
-
updated:
|
|
1325
|
-
unmounted:
|
|
1320
|
+
const xo = {
|
|
1321
|
+
mounted: dt,
|
|
1322
|
+
updated: Mo,
|
|
1323
|
+
unmounted: ft
|
|
1326
1324
|
}, 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
1325
|
function dt(e, t) {
|
|
1326
|
+
j.size === 0 && window.addEventListener("keydown", pt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
|
|
1327
|
+
}
|
|
1328
|
+
function ft(e, t) {
|
|
1331
1329
|
const n = j.get(t.value.toLowerCase());
|
|
1332
1330
|
if (n) {
|
|
1333
1331
|
const o = n.indexOf(e);
|
|
1334
1332
|
o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
|
|
1335
1333
|
}
|
|
1336
|
-
j.size === 0 && window.removeEventListener("keydown",
|
|
1334
|
+
j.size === 0 && window.removeEventListener("keydown", pt);
|
|
1337
1335
|
}
|
|
1338
|
-
function
|
|
1339
|
-
|
|
1336
|
+
function Mo(e, t) {
|
|
1337
|
+
ft(e, t), dt(e, t);
|
|
1340
1338
|
}
|
|
1341
|
-
function
|
|
1339
|
+
function pt(e) {
|
|
1342
1340
|
if (typeof e.key != "string") return;
|
|
1343
1341
|
const t = e.key.toLowerCase(), n = j.get(t);
|
|
1344
|
-
n && (
|
|
1342
|
+
n && (Yt(n)?.click(), e.preventDefault());
|
|
1345
1343
|
}
|
|
1346
|
-
const
|
|
1344
|
+
const Y = Symbol("InfiniteScrollHandler"), Lo = {
|
|
1347
1345
|
mounted(e, t) {
|
|
1348
|
-
e[
|
|
1346
|
+
e[Y] = new G(e, t.value);
|
|
1349
1347
|
},
|
|
1350
1348
|
updated(e, t) {
|
|
1351
|
-
e[
|
|
1349
|
+
e[Y]?.uninstall(), e[Y] = new G(e, t.value);
|
|
1352
1350
|
},
|
|
1353
1351
|
unmounted(e) {
|
|
1354
|
-
e[
|
|
1352
|
+
e[Y]?.uninstall(), delete e[Y];
|
|
1355
1353
|
}
|
|
1356
|
-
},
|
|
1357
|
-
beforeMount:
|
|
1358
|
-
updated:
|
|
1354
|
+
}, Fo = {
|
|
1355
|
+
beforeMount: Ze,
|
|
1356
|
+
updated: Ze
|
|
1359
1357
|
};
|
|
1360
|
-
function
|
|
1358
|
+
function Ze(e, t) {
|
|
1361
1359
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1362
1360
|
}
|
|
1363
|
-
const
|
|
1364
|
-
mounted:
|
|
1365
|
-
updated:
|
|
1366
|
-
unmounted:
|
|
1367
|
-
},
|
|
1368
|
-
function
|
|
1361
|
+
const Io = {
|
|
1362
|
+
mounted: Ge,
|
|
1363
|
+
updated: Ge,
|
|
1364
|
+
unmounted: vt
|
|
1365
|
+
}, J = Symbol("TooltipState");
|
|
1366
|
+
function Ge(e, t) {
|
|
1369
1367
|
let n = e.attributes.getNamedItem("tip")?.value ?? t.value;
|
|
1370
1368
|
if (t.value || (n = null), n) {
|
|
1371
1369
|
const o = {
|
|
1372
1370
|
content: n,
|
|
1373
1371
|
html: e.getAttribute("html") !== null
|
|
1374
1372
|
};
|
|
1375
|
-
e[
|
|
1373
|
+
e[J] ? e[J].configure(o) : e[J] = new Oo(e, o);
|
|
1376
1374
|
} else
|
|
1377
|
-
|
|
1375
|
+
vt(e);
|
|
1378
1376
|
}
|
|
1379
|
-
function
|
|
1380
|
-
e[
|
|
1377
|
+
function vt(e) {
|
|
1378
|
+
e[J]?.destroy(), delete e[J];
|
|
1381
1379
|
}
|
|
1382
|
-
class
|
|
1380
|
+
class Oo {
|
|
1383
1381
|
constructor(t, n) {
|
|
1384
1382
|
this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1385
1383
|
}
|
|
@@ -1415,9 +1413,9 @@ class Io {
|
|
|
1415
1413
|
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
1414
|
}
|
|
1417
1415
|
handleMouseMove(t) {
|
|
1418
|
-
const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight,
|
|
1419
|
-
let
|
|
1420
|
-
|
|
1416
|
+
const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, l = window.innerWidth, s = window.innerHeight;
|
|
1417
|
+
let u = t.pageX + 10, r = t.pageY + 20;
|
|
1418
|
+
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
1419
|
}
|
|
1422
1420
|
checkMoveEvent() {
|
|
1423
1421
|
this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
|
|
@@ -1426,64 +1424,64 @@ class Io {
|
|
|
1426
1424
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
1427
1425
|
}
|
|
1428
1426
|
}
|
|
1429
|
-
function
|
|
1430
|
-
e.directive("autofocus",
|
|
1427
|
+
function Do(e) {
|
|
1428
|
+
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
1429
|
}
|
|
1432
|
-
function
|
|
1433
|
-
|
|
1430
|
+
function cs(e) {
|
|
1431
|
+
Do(e);
|
|
1434
1432
|
}
|
|
1435
1433
|
export {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1434
|
+
No as OverlayContainer,
|
|
1435
|
+
de as UserError,
|
|
1436
|
+
_o as VfAjaxSelect,
|
|
1437
|
+
ne as VfAlertModal,
|
|
1438
|
+
ss as VfEzSmartSelect,
|
|
1439
|
+
gn as VfModal,
|
|
1440
|
+
Pn as VfSmartSelect,
|
|
1441
|
+
Qo as cloneProp,
|
|
1442
|
+
qo as configureVf,
|
|
1443
|
+
ts as configureVfOpenApiClient,
|
|
1446
1444
|
rs as createFilters,
|
|
1447
|
-
|
|
1448
|
-
|
|
1445
|
+
ce as createOverlayInjection,
|
|
1446
|
+
Vn as desnakeCase,
|
|
1449
1447
|
rn as dismissOverlayInjectionById,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1448
|
+
Ro as dismissOverlayInjectionByInstance,
|
|
1449
|
+
nt as dismissOverlayInjectionByInternalInstance,
|
|
1450
|
+
ln as dismissOverlayInjectionByVnode,
|
|
1451
|
+
ps as escapeHtml,
|
|
1452
|
+
cn as formatError,
|
|
1453
|
+
kn as formatNumber,
|
|
1456
1454
|
Hn as formatPhone,
|
|
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
|
-
|
|
1455
|
+
An as formatUSCurrency,
|
|
1456
|
+
Ko as handleError,
|
|
1457
|
+
zo as handleErrorAndAlert,
|
|
1458
|
+
cs as installVf,
|
|
1459
|
+
dn as isError,
|
|
1460
|
+
We as isNotNullOrUndefined,
|
|
1461
|
+
Yo as maskComponent,
|
|
1462
|
+
fn as maskEl,
|
|
1463
|
+
pn as maskForm,
|
|
1464
|
+
ns as nl2br,
|
|
1465
|
+
es as nullifyEmptyInputs,
|
|
1466
|
+
Te as presentOverlay,
|
|
1467
|
+
Q as removeOverlayInjection,
|
|
1468
|
+
Zo as replaceElement,
|
|
1469
|
+
un as showAlert,
|
|
1470
|
+
Wo as showConfirm,
|
|
1471
|
+
jo as showConfirmDestroy,
|
|
1472
|
+
Go as showContextMenu,
|
|
1473
|
+
Po as showMutableWait,
|
|
1474
|
+
ls as showToast,
|
|
1475
|
+
Uo as showWait,
|
|
1476
|
+
bn as sleep,
|
|
1477
|
+
Jo as sleepSecs,
|
|
1478
|
+
Se as toError,
|
|
1479
|
+
Xo as unmaskComponent,
|
|
1480
|
+
ot as unmaskEl,
|
|
1481
|
+
st as unmaskForm,
|
|
1482
|
+
an as updateOverlayProps,
|
|
1483
|
+
as as useInfiniteScroll,
|
|
1484
|
+
us as useResizeWatcher,
|
|
1485
|
+
os as uuid,
|
|
1486
|
+
is as vfModalRef
|
|
1489
1487
|
};
|