@signal24/vue-foundation 4.29.7 → 4.30.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-vf-smart-select.vue +1 -1
- package/dist/demo/components/demo-root.vue.d.ts +2 -1
- package/dist/demo/components/demo-vf-alert-modal.vue.d.ts +2 -1
- package/dist/demo/components/demo-vf-smart-select.vue.d.ts +2 -1
- package/dist/src/components/overlay-anchor.vue.d.ts +3 -2
- package/dist/src/components/vf-ajax-select.vue.d.ts +7 -6
- package/dist/src/components/vf-alert-modal.vue.d.ts +2 -1
- package/dist/src/components/vf-ez-smart-select.vue.d.ts +7 -6
- package/dist/src/components/vf-modal.vue.d.ts +3 -2
- package/dist/src/components/vf-smart-select.vue.d.ts +9 -8
- package/dist/src/components/vf-toast.vue.d.ts +2 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/vue-foundation.es.js +798 -809
- package/package.json +24 -24
- package/src/components/overlay-container.ts +2 -2
- package/src/components/vf-alert-modal.vue +1 -1
- package/src/components/vf-smart-select.vue +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as N, computed as O, watch as
|
|
1
|
+
import { defineComponent as q, ref as N, computed as O, watch as V, onMounted as z, createElementBlock as I, withDirectives as fe, openBlock as S, createElementVNode as U, toDisplayString as J, createCommentVNode as W, Fragment as he, renderList as pe, vModelSelect as Vt, getCurrentInstance as Oe, withModifiers as Ne, normalizeStyle as $t, normalizeClass as P, renderSlot as K, reactive as Bt, h as ve, Teleport as _t, markRaw as Wt, onBeforeUnmount as me, resolveDirective as Pt, createBlock as at, createSlots as jt, withCtx as be, createTextVNode as te, onUpdated as Ut, vModelText as zt, onActivated as st, onDeactivated as lt } from "vue";
|
|
2
2
|
import { compact as ut, cloneDeep as qt, uniq as Jt, groupBy as Kt, isEqual as Me, debounce as Yt, startCase as Xt, upperFirst as Zt, remove as Gt, last as Qt } from "lodash";
|
|
3
3
|
import { configureOpenApiClient as en, OpenApiError as tn } from "@signal24/openapi-client-codegen";
|
|
4
4
|
import { escapeHtml as br } from "@vue/shared";
|
|
@@ -9,7 +9,7 @@ const rn = {
|
|
|
9
9
|
}, an = {
|
|
10
10
|
key: 0,
|
|
11
11
|
value: null
|
|
12
|
-
}, sn = ["value"],
|
|
12
|
+
}, sn = ["value"], Ko = /* @__PURE__ */ q({
|
|
13
13
|
__name: "vf-ajax-select",
|
|
14
14
|
props: {
|
|
15
15
|
modelValue: {},
|
|
@@ -21,41 +21,41 @@ const rn = {
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:modelValue"],
|
|
23
23
|
setup(e, { emit: t }) {
|
|
24
|
-
const o = e,
|
|
25
|
-
const
|
|
26
|
-
return o.preprocesor ? o.preprocesor(
|
|
24
|
+
const o = e, a = t, p = N(null), l = O(() => p.value ? p.value.map((v) => {
|
|
25
|
+
const c = v;
|
|
26
|
+
return o.preprocesor ? o.preprocesor(c) : o.displayKey ? c[o.displayKey] : "";
|
|
27
27
|
}) : null), y = N(o.modelValue ?? null);
|
|
28
|
-
|
|
28
|
+
V(() => o.loadFn, g), V(
|
|
29
29
|
() => o.modelValue,
|
|
30
30
|
() => y.value = o.modelValue
|
|
31
|
-
),
|
|
31
|
+
), V(y, () => a("update:modelValue", y.value));
|
|
32
32
|
async function g() {
|
|
33
|
-
|
|
33
|
+
p.value = await o.loadFn();
|
|
34
34
|
}
|
|
35
|
-
return z(g), (E, v) =>
|
|
35
|
+
return z(g), (E, v) => l.value ? fe((S(), I("select", {
|
|
36
36
|
key: 1,
|
|
37
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
37
|
+
"onUpdate:modelValue": v[0] || (v[0] = (c) => y.value = c)
|
|
38
38
|
}, [
|
|
39
39
|
o.nullText ? (S(), I("option", an, J(o.nullText), 1)) : W("", !0),
|
|
40
|
-
(S(!0), I(he, null, pe(
|
|
40
|
+
(S(!0), I(he, null, pe(l.value, (c, n) => (S(), I("option", {
|
|
41
41
|
key: n,
|
|
42
|
-
value:
|
|
43
|
-
}, J(
|
|
42
|
+
value: p.value?.[n]
|
|
43
|
+
}, J(c), 9, sn))), 128))
|
|
44
44
|
], 512)), [
|
|
45
|
-
[
|
|
45
|
+
[Vt, y.value]
|
|
46
46
|
]) : (S(), I("select", rn, [
|
|
47
47
|
U("option", null, J(o.loadingText || "Loading..."), 1)
|
|
48
48
|
]));
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), H = {
|
|
51
51
|
unhandledErrorSupportText: "please contact support",
|
|
52
52
|
errorHandler: (e) => console.error("Unhandled error:", e),
|
|
53
53
|
defaultDateFormat: "M/d/yy",
|
|
54
54
|
defaultTimeFormat: "H:mm",
|
|
55
55
|
defaultCurrencyDivisor: 1
|
|
56
56
|
};
|
|
57
|
-
function
|
|
58
|
-
Object.assign(
|
|
57
|
+
function Yo(e) {
|
|
58
|
+
Object.assign(H, e);
|
|
59
59
|
}
|
|
60
60
|
const ln = /* @__PURE__ */ q({
|
|
61
61
|
__name: "overlay-anchor",
|
|
@@ -64,34 +64,34 @@ const ln = /* @__PURE__ */ q({
|
|
|
64
64
|
anchor: {}
|
|
65
65
|
},
|
|
66
66
|
setup(e) {
|
|
67
|
-
const t = e, o = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el,
|
|
67
|
+
const t = e, o = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, a = N({ visibility: "hidden", top: "0", left: "0" }), p = N([]), l = Oe();
|
|
68
68
|
z(y);
|
|
69
69
|
function y() {
|
|
70
|
-
if (!
|
|
71
|
-
const v =
|
|
72
|
-
|
|
70
|
+
if (!l) return;
|
|
71
|
+
const v = l.vnode.el, { styles: c, classes: n } = g(v, o);
|
|
72
|
+
a.value = c, p.value = n;
|
|
73
73
|
}
|
|
74
|
-
function g(v,
|
|
75
|
-
const n = t.anchor instanceof HTMLElement ? {} : t.anchor,
|
|
76
|
-
n.matchWidth && (r.width =
|
|
74
|
+
function g(v, c) {
|
|
75
|
+
const n = t.anchor instanceof HTMLElement ? {} : t.anchor, i = c.getBoundingClientRect(), r = v.getBoundingClientRect();
|
|
76
|
+
n.matchWidth && (r.width = i.width), n.matchHeight && (r.height = i.height);
|
|
77
77
|
const s = n.class ? Array.isArray(n.class) ? n.class : [n.class] : [];
|
|
78
|
-
let
|
|
78
|
+
let u, h;
|
|
79
79
|
if (n.y === "center")
|
|
80
|
-
|
|
80
|
+
u = i.top + i.height / 2 - r.height / 2, s.push("anchored-center-y");
|
|
81
81
|
else {
|
|
82
|
-
const m = (
|
|
83
|
-
|
|
82
|
+
const m = (i.bottom + r.height < window.innerHeight || n.y === "below") && n.y !== "above";
|
|
83
|
+
u = m ? i.bottom : i.top - r.height, s.push(m ? "anchored-top" : "anchored-bottom");
|
|
84
84
|
}
|
|
85
85
|
if (n.x === "center")
|
|
86
|
-
|
|
86
|
+
h = i.left + i.width / 2 - r.width / 2, s.push("anchored-center-x");
|
|
87
87
|
else {
|
|
88
|
-
const m = (
|
|
89
|
-
|
|
88
|
+
const m = (i.left + r.width < window.innerWidth || n.x === "left") && n.x !== "right";
|
|
89
|
+
h = m ? i.left : i.right - r.width, s.push(m ? "anchored-left" : "anchored-right");
|
|
90
90
|
}
|
|
91
91
|
return {
|
|
92
92
|
styles: {
|
|
93
|
-
top: `${
|
|
94
|
-
left: `${
|
|
93
|
+
top: `${u}px`,
|
|
94
|
+
left: `${h}px`,
|
|
95
95
|
...n.matchWidth ? { width: `${r.width}px` } : {},
|
|
96
96
|
...n.matchHeight ? { height: `${r.height}px` } : {}
|
|
97
97
|
},
|
|
@@ -105,9 +105,9 @@ const ln = /* @__PURE__ */ q({
|
|
|
105
105
|
setTimeout(() => {
|
|
106
106
|
window.addEventListener("click", E);
|
|
107
107
|
}, 10);
|
|
108
|
-
}), (v,
|
|
109
|
-
class: P(["vf-overlay-anchor",
|
|
110
|
-
style:
|
|
108
|
+
}), (v, c) => (S(), I("div", {
|
|
109
|
+
class: P(["vf-overlay-anchor", p.value]),
|
|
110
|
+
style: $t(a.value),
|
|
111
111
|
onClick: Ne(E, ["stop"])
|
|
112
112
|
}, [
|
|
113
113
|
K(v.$slots, "default")
|
|
@@ -115,23 +115,23 @@ const ln = /* @__PURE__ */ q({
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
let un = 0;
|
|
118
|
-
const j =
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
const j = Bt([]);
|
|
119
|
+
V(j, () => {
|
|
120
|
+
H.onOverlaysChanged?.(j.length);
|
|
121
121
|
});
|
|
122
|
-
const
|
|
122
|
+
const Xo = q({
|
|
123
123
|
setup() {
|
|
124
124
|
return () => ve("div", [
|
|
125
|
-
pe(j, (e) => ve(
|
|
125
|
+
pe(j, (e) => ve(_t, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
|
|
126
126
|
]);
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
function ge(e, t, o) {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
id:
|
|
134
|
-
component:
|
|
130
|
+
const a = document.getElementById("vf-overlay-target") ?? document.createElement("div");
|
|
131
|
+
a.id = "vf-overlay-target", a.removeAttribute("inert"), document.body.appendChild(a);
|
|
132
|
+
const p = String(++un), l = Wt(e), y = ve(l, t), g = o?.anchor ? ve(ln, { overlayId: p, anchor: o.anchor }, () => [y]) : void 0, E = {
|
|
133
|
+
id: p,
|
|
134
|
+
component: l,
|
|
135
135
|
props: t,
|
|
136
136
|
options: o ?? {},
|
|
137
137
|
vnode: y,
|
|
@@ -139,7 +139,7 @@ function ge(e, t, o) {
|
|
|
139
139
|
};
|
|
140
140
|
return j.push(E), E;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Zo(e) {
|
|
143
143
|
e.$ && ct(e.$);
|
|
144
144
|
}
|
|
145
145
|
function ct(e) {
|
|
@@ -160,23 +160,23 @@ function ie(e) {
|
|
|
160
160
|
t >= 0 && j.splice(t, 1);
|
|
161
161
|
}
|
|
162
162
|
async function Le(e, t, o) {
|
|
163
|
-
return new Promise((
|
|
164
|
-
let
|
|
163
|
+
return new Promise((a) => {
|
|
164
|
+
let p = null;
|
|
165
165
|
const y = { ...t, callback: async (g) => {
|
|
166
166
|
if (o?.onCallback) {
|
|
167
167
|
const E = o.onCallback(g);
|
|
168
168
|
if (typeof E == "object" && "then" in E && typeof E.then == "function" && await E === !1)
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
ie(
|
|
171
|
+
ie(p), a(g);
|
|
172
172
|
} };
|
|
173
|
-
|
|
173
|
+
p = ge(e, y, o);
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
async function fn(e, t) {
|
|
177
177
|
const o = e.vnode.component.props;
|
|
178
|
-
for (const
|
|
179
|
-
o[
|
|
178
|
+
for (const a in t)
|
|
179
|
+
o[a] = t[a];
|
|
180
180
|
}
|
|
181
181
|
function se(e, t) {
|
|
182
182
|
return typeof e == "object" && !(e instanceof Error) ? {
|
|
@@ -187,14 +187,14 @@ function se(e, t) {
|
|
|
187
187
|
async function hn(e, t) {
|
|
188
188
|
await Le(le, se(e, t));
|
|
189
189
|
}
|
|
190
|
-
async function
|
|
190
|
+
async function Go(e, t) {
|
|
191
191
|
const o = se(e, t);
|
|
192
192
|
return await Le(le, {
|
|
193
193
|
...o,
|
|
194
194
|
shouldConfirm: !0
|
|
195
195
|
}) === !0;
|
|
196
196
|
}
|
|
197
|
-
async function
|
|
197
|
+
async function Qo(e, t) {
|
|
198
198
|
const o = se(e, t);
|
|
199
199
|
return await Le(le, {
|
|
200
200
|
...o,
|
|
@@ -202,18 +202,18 @@ async function Go(e, t) {
|
|
|
202
202
|
classes: ["destructive", ...o.classes]
|
|
203
203
|
}) === !0;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const o = se(e, t),
|
|
205
|
+
function er(e, t) {
|
|
206
|
+
const o = se(e, t), a = ge(le, {
|
|
207
207
|
...o,
|
|
208
208
|
isBare: !0,
|
|
209
209
|
classes: ["wait", ...o.classes],
|
|
210
210
|
callback: () => {
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
|
-
return () => ie(
|
|
213
|
+
return () => ie(a);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
const o = se(e, t),
|
|
215
|
+
function tr(e, t) {
|
|
216
|
+
const o = se(e, t), a = ge(le, {
|
|
217
217
|
...o,
|
|
218
218
|
isBare: !0,
|
|
219
219
|
classes: ["wait", ...o.classes],
|
|
@@ -221,10 +221,10 @@ function er(e, t) {
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
return {
|
|
224
|
-
update: (
|
|
225
|
-
fn(
|
|
224
|
+
update: (p) => {
|
|
225
|
+
fn(a, { message: p });
|
|
226
226
|
},
|
|
227
|
-
dismiss: () => ie(
|
|
227
|
+
dismiss: () => ie(a)
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
class ye extends Error {
|
|
@@ -237,7 +237,7 @@ function pn(e) {
|
|
|
237
237
|
|
|
238
238
|
${Re(e).message}
|
|
239
239
|
|
|
240
|
-
Please refresh the page and try again. If this error persists, ${
|
|
240
|
+
Please refresh the page and try again. If this error persists, ${H.unhandledErrorSupportText}.`;
|
|
241
241
|
}
|
|
242
242
|
function Re(e) {
|
|
243
243
|
return vn(e) ? e : new Error(String(e));
|
|
@@ -245,24 +245,24 @@ function Re(e) {
|
|
|
245
245
|
function vn(e) {
|
|
246
246
|
return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
248
|
+
async function nr(e, t) {
|
|
249
249
|
const o = Re(e);
|
|
250
|
-
return o instanceof ye ||
|
|
250
|
+
return o instanceof ye || H.errorHandler(o), hn({
|
|
251
251
|
title: t?.title,
|
|
252
252
|
message: o,
|
|
253
253
|
classes: t?.classes
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
async function
|
|
256
|
+
async function or(e) {
|
|
257
257
|
const t = Re(e);
|
|
258
|
-
t instanceof ye ||
|
|
258
|
+
t instanceof ye || H.errorHandler(t);
|
|
259
259
|
}
|
|
260
260
|
const ne = Symbol("MaskState");
|
|
261
|
-
function
|
|
262
|
-
const o = e.$?.vnode.el,
|
|
263
|
-
return mn(
|
|
261
|
+
function rr(e, t) {
|
|
262
|
+
const o = e.$?.vnode.el, a = o.closest(".vf-modal");
|
|
263
|
+
return mn(a ?? o, t);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function ir(e) {
|
|
266
266
|
const t = e.$?.vnode.el, o = t.closest(".vf-modal");
|
|
267
267
|
return dt(o ?? t);
|
|
268
268
|
}
|
|
@@ -278,25 +278,25 @@ function dt(e) {
|
|
|
278
278
|
}
|
|
279
279
|
const Ce = Symbol("FormMaskState");
|
|
280
280
|
function gn(e, t, o) {
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
281
|
+
const a = e instanceof Element ? e : ht(e);
|
|
282
|
+
if (!a) return () => {
|
|
283
283
|
};
|
|
284
|
-
|
|
285
|
-
const
|
|
286
|
-
let
|
|
287
|
-
|
|
288
|
-
const g = [...
|
|
289
|
-
return g.forEach((E) => E.setAttribute("disabled", "disabled")),
|
|
284
|
+
a.classList.add("vf-masked");
|
|
285
|
+
const p = t instanceof Element ? t : a.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
|
|
286
|
+
let l;
|
|
287
|
+
p && (l = p.tagName === "INPUT" ? p.value : p.innerHTML, p.setAttribute("disabled", "disabled"), p.innerText = o ?? "Please wait...");
|
|
288
|
+
const g = [...a.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
289
|
+
return g.forEach((E) => E.setAttribute("disabled", "disabled")), a[Ce] = {
|
|
290
290
|
disabledElements: g,
|
|
291
|
-
waitButton:
|
|
292
|
-
buttonHtml:
|
|
293
|
-
}, () => ft(
|
|
291
|
+
waitButton: p,
|
|
292
|
+
buttonHtml: l
|
|
293
|
+
}, () => ft(a);
|
|
294
294
|
}
|
|
295
295
|
function ft(e) {
|
|
296
296
|
const t = e instanceof Element ? e : ht(e);
|
|
297
297
|
if (!t) return;
|
|
298
298
|
const o = t[Ce];
|
|
299
|
-
o && (t.classList.remove("vf-masked"), o.disabledElements.forEach((
|
|
299
|
+
o && (t.classList.remove("vf-masked"), o.disabledElements.forEach((a) => a.removeAttribute("disabled")), o.waitButton && (o.waitButton.innerHTML = o.buttonHtml, o.waitButton.removeAttribute("disabled")), delete t[Ce]);
|
|
300
300
|
}
|
|
301
301
|
function ht(e) {
|
|
302
302
|
const t = e?.$?.vnode.el;
|
|
@@ -305,10 +305,10 @@ function ht(e) {
|
|
|
305
305
|
const yn = ["id"], En = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "vf-modal-header"
|
|
308
|
-
}, kn = { class: "vf-modal-content" },
|
|
308
|
+
}, kn = { class: "vf-modal-content" }, xn = {
|
|
309
309
|
key: 1,
|
|
310
310
|
class: "vf-modal-footer"
|
|
311
|
-
},
|
|
311
|
+
}, wn = /* @__PURE__ */ q({
|
|
312
312
|
__name: "vf-modal",
|
|
313
313
|
props: {
|
|
314
314
|
id: {},
|
|
@@ -319,31 +319,31 @@ const yn = ["id"], En = {
|
|
|
319
319
|
},
|
|
320
320
|
emits: ["formSubmit"],
|
|
321
321
|
setup(e, { expose: t }) {
|
|
322
|
-
const o = Oe(),
|
|
323
|
-
t({ mask: n, unmask:
|
|
324
|
-
const
|
|
322
|
+
const o = Oe(), a = e;
|
|
323
|
+
t({ mask: n, unmask: i, hide: r, unhide: s });
|
|
324
|
+
const p = N(), l = N(), y = N(!1), g = O(() => ut([...Array.isArray(a.class) ? a.class : [a.class], y.value && "hidden"]));
|
|
325
325
|
z(() => {
|
|
326
|
-
document.body.classList.add("vf-modal-open"),
|
|
326
|
+
document.body.classList.add("vf-modal-open"), a.closeOnMaskClick && (window.addEventListener("keydown", v), p.value?.addEventListener("click", E));
|
|
327
327
|
}), me(() => {
|
|
328
328
|
window.removeEventListener("keydown", v), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
329
329
|
});
|
|
330
|
-
function E(
|
|
331
|
-
|
|
330
|
+
function E(u) {
|
|
331
|
+
u.target == p.value && c();
|
|
332
332
|
}
|
|
333
|
-
function v(
|
|
334
|
-
if (
|
|
335
|
-
const
|
|
336
|
-
|
|
333
|
+
function v(u) {
|
|
334
|
+
if (u.key === "Esc" || u.key === "Escape") {
|
|
335
|
+
const h = document.querySelectorAll(".vf-modal-wrap");
|
|
336
|
+
h[h.length - 1] === p.value && c();
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function c() {
|
|
340
340
|
ct(o);
|
|
341
341
|
}
|
|
342
342
|
function n() {
|
|
343
|
-
return gn(
|
|
343
|
+
return gn(l.value), () => i();
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
ft(
|
|
345
|
+
function i() {
|
|
346
|
+
ft(l.value);
|
|
347
347
|
}
|
|
348
348
|
function r() {
|
|
349
349
|
return y.value = !0, () => s();
|
|
@@ -351,37 +351,37 @@ const yn = ["id"], En = {
|
|
|
351
351
|
function s() {
|
|
352
352
|
y.value = !1;
|
|
353
353
|
}
|
|
354
|
-
return (
|
|
355
|
-
id:
|
|
354
|
+
return (u, h) => (S(), I("div", {
|
|
355
|
+
id: e.id,
|
|
356
356
|
ref_key: "overlay",
|
|
357
|
-
ref:
|
|
357
|
+
ref: p,
|
|
358
358
|
class: P(["vf-overlay vf-modal-wrap", g.value])
|
|
359
359
|
}, [
|
|
360
360
|
U("form", {
|
|
361
361
|
ref_key: "form",
|
|
362
|
-
ref:
|
|
362
|
+
ref: l,
|
|
363
363
|
action: ".",
|
|
364
|
-
class: P(["vf-modal", { scrolls:
|
|
365
|
-
onSubmit:
|
|
364
|
+
class: P(["vf-modal", { scrolls: e.scrolls }]),
|
|
365
|
+
onSubmit: h[0] || (h[0] = Ne((f) => u.$emit("formSubmit"), ["prevent"]))
|
|
366
366
|
}, [
|
|
367
|
-
|
|
368
|
-
K(
|
|
369
|
-
|
|
367
|
+
u.$slots.header ? (S(), I("div", En, [
|
|
368
|
+
K(u.$slots, "header"),
|
|
369
|
+
a.closeX ? (S(), I("i", {
|
|
370
370
|
key: 0,
|
|
371
371
|
class: "close",
|
|
372
|
-
onClick:
|
|
372
|
+
onClick: c
|
|
373
373
|
})) : W("", !0)
|
|
374
374
|
])) : W("", !0),
|
|
375
375
|
U("div", kn, [
|
|
376
|
-
K(
|
|
376
|
+
K(u.$slots, "default")
|
|
377
377
|
]),
|
|
378
|
-
|
|
379
|
-
K(
|
|
378
|
+
u.$slots.footer ? (S(), I("div", xn, [
|
|
379
|
+
K(u.$slots, "footer")
|
|
380
380
|
])) : W("", !0)
|
|
381
381
|
], 34)
|
|
382
382
|
], 10, yn));
|
|
383
383
|
}
|
|
384
|
-
}),
|
|
384
|
+
}), bn = ["innerHtml"], Tn = ["innerText"], le = /* @__PURE__ */ q({
|
|
385
385
|
__name: "vf-alert-modal",
|
|
386
386
|
props: {
|
|
387
387
|
isBare: { type: Boolean },
|
|
@@ -395,58 +395,59 @@ const yn = ["id"], En = {
|
|
|
395
395
|
},
|
|
396
396
|
setup(e) {
|
|
397
397
|
const t = e, o = O(() => t.message instanceof Error ? pn(t.message) : t.message);
|
|
398
|
-
return (
|
|
399
|
-
const
|
|
400
|
-
return S(), at(
|
|
401
|
-
class: P(["vf-alert", ...
|
|
398
|
+
return (a, p) => {
|
|
399
|
+
const l = Pt("autofocus");
|
|
400
|
+
return S(), at(wn, {
|
|
401
|
+
class: P(["vf-alert", ...e.classes ?? []]),
|
|
402
|
+
scrolls: ""
|
|
402
403
|
}, jt({
|
|
403
|
-
default:
|
|
404
|
-
|
|
404
|
+
default: be(() => [
|
|
405
|
+
e.iconClass ? (S(), I("i", {
|
|
405
406
|
key: 0,
|
|
406
|
-
class: P(["vf-alert-icon",
|
|
407
|
+
class: P(["vf-alert-icon", e.iconClass])
|
|
407
408
|
}, null, 2)) : W("", !0),
|
|
408
|
-
|
|
409
|
+
e.isHtml ? (S(), I("div", {
|
|
409
410
|
key: 1,
|
|
410
|
-
innerHtml:
|
|
411
|
+
innerHtml: e.message,
|
|
411
412
|
class: "user-message"
|
|
412
|
-
}, null, 8,
|
|
413
|
+
}, null, 8, bn)) : (S(), I("div", {
|
|
413
414
|
key: 2,
|
|
414
415
|
innerText: o.value
|
|
415
416
|
}, null, 8, Tn))
|
|
416
417
|
]),
|
|
417
418
|
_: 2
|
|
418
419
|
}, [
|
|
419
|
-
|
|
420
|
+
e.title ? {
|
|
420
421
|
name: "header",
|
|
421
|
-
fn:
|
|
422
|
-
te(J(
|
|
422
|
+
fn: be(() => [
|
|
423
|
+
te(J(e.title), 1)
|
|
423
424
|
]),
|
|
424
425
|
key: "0"
|
|
425
426
|
} : void 0,
|
|
426
|
-
|
|
427
|
+
e.isBare ? void 0 : {
|
|
427
428
|
name: "footer",
|
|
428
|
-
fn:
|
|
429
|
-
|
|
429
|
+
fn: be(() => [
|
|
430
|
+
e.shouldConfirm ? (S(), I(he, { key: 0 }, [
|
|
430
431
|
fe((S(), I("button", {
|
|
431
432
|
class: "primary",
|
|
432
|
-
onClick:
|
|
433
|
-
},
|
|
434
|
-
te("Confirm")
|
|
435
|
-
]))), [
|
|
436
|
-
[
|
|
433
|
+
onClick: p[0] || (p[0] = () => e.callback(!0))
|
|
434
|
+
}, [...p[3] || (p[3] = [
|
|
435
|
+
te("Confirm", -1)
|
|
436
|
+
])])), [
|
|
437
|
+
[l]
|
|
437
438
|
]),
|
|
438
439
|
U("button", {
|
|
439
440
|
class: "default",
|
|
440
|
-
onClick:
|
|
441
|
+
onClick: p[1] || (p[1] = () => e.callback(!1))
|
|
441
442
|
}, "Cancel")
|
|
442
443
|
], 64)) : fe((S(), I("button", {
|
|
443
444
|
key: 1,
|
|
444
445
|
class: "default",
|
|
445
|
-
onClick:
|
|
446
|
-
},
|
|
447
|
-
te("OK")
|
|
448
|
-
]))), [
|
|
449
|
-
[
|
|
446
|
+
onClick: p[2] || (p[2] = () => e.callback(!0))
|
|
447
|
+
}, [...p[4] || (p[4] = [
|
|
448
|
+
te("OK", -1)
|
|
449
|
+
])])), [
|
|
450
|
+
[l]
|
|
450
451
|
])
|
|
451
452
|
]),
|
|
452
453
|
key: "1"
|
|
@@ -459,135 +460,129 @@ function Sn(e) {
|
|
|
459
460
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
460
461
|
}
|
|
461
462
|
var ce = { exports: {} };
|
|
462
|
-
/*!***************************************************
|
|
463
|
-
* mark.js v8.11.1
|
|
464
|
-
* https://markjs.io/
|
|
465
|
-
* Copyright (c) 2014–2018, Julian Kühnel
|
|
466
|
-
* Released under the MIT license https://git.io/vwTVl
|
|
467
|
-
*****************************************************/
|
|
468
463
|
var In = ce.exports, Ke;
|
|
469
464
|
function Mn() {
|
|
470
|
-
return Ke || (Ke = 1, function(e, t) {
|
|
471
|
-
(function(o,
|
|
472
|
-
e.exports =
|
|
473
|
-
})(In, function() {
|
|
465
|
+
return Ke || (Ke = 1, (function(e, t) {
|
|
466
|
+
(function(o, a) {
|
|
467
|
+
e.exports = a();
|
|
468
|
+
})(In, (function() {
|
|
474
469
|
var o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
|
|
475
470
|
return typeof v;
|
|
476
471
|
} : function(v) {
|
|
477
472
|
return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
|
|
478
|
-
},
|
|
479
|
-
if (!(v instanceof
|
|
473
|
+
}, a = function(v, c) {
|
|
474
|
+
if (!(v instanceof c))
|
|
480
475
|
throw new TypeError("Cannot call a class as a function");
|
|
481
|
-
},
|
|
482
|
-
function v(
|
|
483
|
-
for (var
|
|
484
|
-
var r = n[
|
|
485
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(
|
|
476
|
+
}, p = /* @__PURE__ */ (function() {
|
|
477
|
+
function v(c, n) {
|
|
478
|
+
for (var i = 0; i < n.length; i++) {
|
|
479
|
+
var r = n[i];
|
|
480
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(c, r.key, r);
|
|
486
481
|
}
|
|
487
482
|
}
|
|
488
|
-
return function(
|
|
489
|
-
return n && v(
|
|
483
|
+
return function(c, n, i) {
|
|
484
|
+
return n && v(c.prototype, n), i && v(c, i), c;
|
|
490
485
|
};
|
|
491
|
-
}(),
|
|
492
|
-
for (var
|
|
493
|
-
var n = arguments[
|
|
494
|
-
for (var
|
|
495
|
-
Object.prototype.hasOwnProperty.call(n,
|
|
486
|
+
})(), l = Object.assign || function(v) {
|
|
487
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
488
|
+
var n = arguments[c];
|
|
489
|
+
for (var i in n)
|
|
490
|
+
Object.prototype.hasOwnProperty.call(n, i) && (v[i] = n[i]);
|
|
496
491
|
}
|
|
497
492
|
return v;
|
|
498
|
-
}, y = function() {
|
|
499
|
-
function v(
|
|
500
|
-
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0,
|
|
501
|
-
|
|
493
|
+
}, y = (function() {
|
|
494
|
+
function v(c) {
|
|
495
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 5e3;
|
|
496
|
+
a(this, v), this.ctx = c, this.iframes = n, this.exclude = i, this.iframesTimeout = r;
|
|
502
497
|
}
|
|
503
|
-
return
|
|
498
|
+
return p(v, [{
|
|
504
499
|
key: "getContexts",
|
|
505
500
|
value: function() {
|
|
506
|
-
var n = void 0,
|
|
501
|
+
var n = void 0, i = [];
|
|
507
502
|
return typeof this.ctx > "u" || !this.ctx ? n = [] : NodeList.prototype.isPrototypeOf(this.ctx) ? n = Array.prototype.slice.call(this.ctx) : Array.isArray(this.ctx) ? n = this.ctx : typeof this.ctx == "string" ? n = Array.prototype.slice.call(document.querySelectorAll(this.ctx)) : n = [this.ctx], n.forEach(function(r) {
|
|
508
|
-
var s =
|
|
509
|
-
return
|
|
503
|
+
var s = i.filter(function(u) {
|
|
504
|
+
return u.contains(r);
|
|
510
505
|
}).length > 0;
|
|
511
|
-
|
|
512
|
-
}),
|
|
506
|
+
i.indexOf(r) === -1 && !s && i.push(r);
|
|
507
|
+
}), i;
|
|
513
508
|
}
|
|
514
509
|
}, {
|
|
515
510
|
key: "getIframeContents",
|
|
516
|
-
value: function(n,
|
|
511
|
+
value: function(n, i) {
|
|
517
512
|
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
|
|
518
513
|
}, s = void 0;
|
|
519
514
|
try {
|
|
520
|
-
var
|
|
521
|
-
if (s =
|
|
515
|
+
var u = n.contentWindow;
|
|
516
|
+
if (s = u.document, !u || !s)
|
|
522
517
|
throw new Error("iframe inaccessible");
|
|
523
518
|
} catch {
|
|
524
519
|
r();
|
|
525
520
|
}
|
|
526
|
-
s &&
|
|
521
|
+
s && i(s);
|
|
527
522
|
}
|
|
528
523
|
}, {
|
|
529
524
|
key: "isIframeBlank",
|
|
530
525
|
value: function(n) {
|
|
531
|
-
var
|
|
532
|
-
return s ===
|
|
526
|
+
var i = "about:blank", r = n.getAttribute("src").trim(), s = n.contentWindow.location.href;
|
|
527
|
+
return s === i && r !== i && r;
|
|
533
528
|
}
|
|
534
529
|
}, {
|
|
535
530
|
key: "observeIframeLoad",
|
|
536
|
-
value: function(n,
|
|
537
|
-
var s = this,
|
|
538
|
-
if (!
|
|
539
|
-
|
|
531
|
+
value: function(n, i, r) {
|
|
532
|
+
var s = this, u = !1, h = null, f = function m() {
|
|
533
|
+
if (!u) {
|
|
534
|
+
u = !0, clearTimeout(h);
|
|
540
535
|
try {
|
|
541
|
-
s.isIframeBlank(n) || (n.removeEventListener("load", m), s.getIframeContents(n,
|
|
536
|
+
s.isIframeBlank(n) || (n.removeEventListener("load", m), s.getIframeContents(n, i, r));
|
|
542
537
|
} catch {
|
|
543
538
|
r();
|
|
544
539
|
}
|
|
545
540
|
}
|
|
546
541
|
};
|
|
547
|
-
n.addEventListener("load",
|
|
542
|
+
n.addEventListener("load", f), h = setTimeout(f, this.iframesTimeout);
|
|
548
543
|
}
|
|
549
544
|
}, {
|
|
550
545
|
key: "onIframeReady",
|
|
551
|
-
value: function(n,
|
|
546
|
+
value: function(n, i, r) {
|
|
552
547
|
try {
|
|
553
|
-
n.contentWindow.document.readyState === "complete" ? this.isIframeBlank(n) ? this.observeIframeLoad(n,
|
|
548
|
+
n.contentWindow.document.readyState === "complete" ? this.isIframeBlank(n) ? this.observeIframeLoad(n, i, r) : this.getIframeContents(n, i, r) : this.observeIframeLoad(n, i, r);
|
|
554
549
|
} catch {
|
|
555
550
|
r();
|
|
556
551
|
}
|
|
557
552
|
}
|
|
558
553
|
}, {
|
|
559
554
|
key: "waitForIframes",
|
|
560
|
-
value: function(n,
|
|
555
|
+
value: function(n, i) {
|
|
561
556
|
var r = this, s = 0;
|
|
562
557
|
this.forEachIframe(n, function() {
|
|
563
558
|
return !0;
|
|
564
|
-
}, function(
|
|
565
|
-
s++, r.waitForIframes(
|
|
566
|
-
--s ||
|
|
559
|
+
}, function(u) {
|
|
560
|
+
s++, r.waitForIframes(u.querySelector("html"), function() {
|
|
561
|
+
--s || i();
|
|
567
562
|
});
|
|
568
|
-
}, function(
|
|
569
|
-
|
|
563
|
+
}, function(u) {
|
|
564
|
+
u || i();
|
|
570
565
|
});
|
|
571
566
|
}
|
|
572
567
|
}, {
|
|
573
568
|
key: "forEachIframe",
|
|
574
|
-
value: function(n,
|
|
575
|
-
var s = this,
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
var
|
|
579
|
-
--
|
|
569
|
+
value: function(n, i, r) {
|
|
570
|
+
var s = this, u = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : function() {
|
|
571
|
+
}, h = n.querySelectorAll("iframe"), f = h.length, m = 0;
|
|
572
|
+
h = Array.prototype.slice.call(h);
|
|
573
|
+
var w = function() {
|
|
574
|
+
--f <= 0 && u(m);
|
|
580
575
|
};
|
|
581
|
-
|
|
582
|
-
v.matches(T, s.exclude) ?
|
|
583
|
-
|
|
584
|
-
},
|
|
576
|
+
f || w(), h.forEach(function(T) {
|
|
577
|
+
v.matches(T, s.exclude) ? w() : s.onIframeReady(T, function(C) {
|
|
578
|
+
i(T) && (m++, r(C)), w();
|
|
579
|
+
}, w);
|
|
585
580
|
});
|
|
586
581
|
}
|
|
587
582
|
}, {
|
|
588
583
|
key: "createIterator",
|
|
589
|
-
value: function(n,
|
|
590
|
-
return document.createNodeIterator(n,
|
|
584
|
+
value: function(n, i, r) {
|
|
585
|
+
return document.createNodeIterator(n, i, r, !1);
|
|
591
586
|
}
|
|
592
587
|
}, {
|
|
593
588
|
key: "createInstanceOnIframe",
|
|
@@ -596,12 +591,12 @@ function Mn() {
|
|
|
596
591
|
}
|
|
597
592
|
}, {
|
|
598
593
|
key: "compareNodeIframe",
|
|
599
|
-
value: function(n,
|
|
600
|
-
var s = n.compareDocumentPosition(r),
|
|
601
|
-
if (s &
|
|
602
|
-
if (
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
594
|
+
value: function(n, i, r) {
|
|
595
|
+
var s = n.compareDocumentPosition(r), u = Node.DOCUMENT_POSITION_PRECEDING;
|
|
596
|
+
if (s & u)
|
|
597
|
+
if (i !== null) {
|
|
598
|
+
var h = i.compareDocumentPosition(r), f = Node.DOCUMENT_POSITION_FOLLOWING;
|
|
599
|
+
if (h & f)
|
|
605
600
|
return !0;
|
|
606
601
|
} else
|
|
607
602
|
return !0;
|
|
@@ -610,92 +605,92 @@ function Mn() {
|
|
|
610
605
|
}, {
|
|
611
606
|
key: "getIteratorNode",
|
|
612
607
|
value: function(n) {
|
|
613
|
-
var
|
|
614
|
-
return
|
|
615
|
-
prevNode:
|
|
608
|
+
var i = n.previousNode(), r = void 0;
|
|
609
|
+
return i === null ? r = n.nextNode() : r = n.nextNode() && n.nextNode(), {
|
|
610
|
+
prevNode: i,
|
|
616
611
|
node: r
|
|
617
612
|
};
|
|
618
613
|
}
|
|
619
614
|
}, {
|
|
620
615
|
key: "checkIframeFilter",
|
|
621
|
-
value: function(n,
|
|
622
|
-
var
|
|
623
|
-
return s.forEach(function(
|
|
624
|
-
|
|
625
|
-
}), this.compareNodeIframe(n,
|
|
616
|
+
value: function(n, i, r, s) {
|
|
617
|
+
var u = !1, h = !1;
|
|
618
|
+
return s.forEach(function(f, m) {
|
|
619
|
+
f.val === r && (u = m, h = f.handled);
|
|
620
|
+
}), this.compareNodeIframe(n, i, r) ? (u === !1 && !h ? s.push({
|
|
626
621
|
val: r,
|
|
627
622
|
handled: !0
|
|
628
|
-
}) :
|
|
623
|
+
}) : u !== !1 && !h && (s[u].handled = !0), !0) : (u === !1 && s.push({
|
|
629
624
|
val: r,
|
|
630
625
|
handled: !1
|
|
631
626
|
}), !1);
|
|
632
627
|
}
|
|
633
628
|
}, {
|
|
634
629
|
key: "handleOpenIframes",
|
|
635
|
-
value: function(n,
|
|
636
|
-
var
|
|
637
|
-
n.forEach(function(
|
|
638
|
-
|
|
639
|
-
|
|
630
|
+
value: function(n, i, r, s) {
|
|
631
|
+
var u = this;
|
|
632
|
+
n.forEach(function(h) {
|
|
633
|
+
h.handled || u.getIframeContents(h.val, function(f) {
|
|
634
|
+
u.createInstanceOnIframe(f).forEachNode(i, r, s);
|
|
640
635
|
});
|
|
641
636
|
});
|
|
642
637
|
}
|
|
643
638
|
}, {
|
|
644
639
|
key: "iterateThroughNodes",
|
|
645
|
-
value: function(n,
|
|
646
|
-
for (var
|
|
647
|
-
var F =
|
|
640
|
+
value: function(n, i, r, s, u) {
|
|
641
|
+
for (var h = this, f = this.createIterator(i, n, s), m = [], w = [], T = void 0, C = void 0, L = function() {
|
|
642
|
+
var F = h.getIteratorNode(f);
|
|
648
643
|
return C = F.prevNode, T = F.node, T;
|
|
649
644
|
}; L(); )
|
|
650
|
-
this.iframes && this.forEachIframe(
|
|
651
|
-
return
|
|
645
|
+
this.iframes && this.forEachIframe(i, function(R) {
|
|
646
|
+
return h.checkIframeFilter(T, C, R, m);
|
|
652
647
|
}, function(R) {
|
|
653
|
-
|
|
654
|
-
return
|
|
648
|
+
h.createInstanceOnIframe(R).forEachNode(n, function(F) {
|
|
649
|
+
return w.push(F);
|
|
655
650
|
}, s);
|
|
656
|
-
}),
|
|
657
|
-
|
|
651
|
+
}), w.push(T);
|
|
652
|
+
w.forEach(function(R) {
|
|
658
653
|
r(R);
|
|
659
|
-
}), this.iframes && this.handleOpenIframes(m, n, r, s),
|
|
654
|
+
}), this.iframes && this.handleOpenIframes(m, n, r, s), u();
|
|
660
655
|
}
|
|
661
656
|
}, {
|
|
662
657
|
key: "forEachNode",
|
|
663
|
-
value: function(n,
|
|
664
|
-
var s = this,
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
var
|
|
668
|
-
s.iterateThroughNodes(n, m,
|
|
669
|
-
--
|
|
658
|
+
value: function(n, i, r) {
|
|
659
|
+
var s = this, u = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : function() {
|
|
660
|
+
}, h = this.getContexts(), f = h.length;
|
|
661
|
+
f || u(), h.forEach(function(m) {
|
|
662
|
+
var w = function() {
|
|
663
|
+
s.iterateThroughNodes(n, m, i, r, function() {
|
|
664
|
+
--f <= 0 && u();
|
|
670
665
|
});
|
|
671
666
|
};
|
|
672
|
-
s.iframes ? s.waitForIframes(m,
|
|
667
|
+
s.iframes ? s.waitForIframes(m, w) : w();
|
|
673
668
|
});
|
|
674
669
|
}
|
|
675
670
|
}], [{
|
|
676
671
|
key: "matches",
|
|
677
|
-
value: function(n,
|
|
678
|
-
var r = typeof
|
|
672
|
+
value: function(n, i) {
|
|
673
|
+
var r = typeof i == "string" ? [i] : i, s = n.matches || n.matchesSelector || n.msMatchesSelector || n.mozMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector;
|
|
679
674
|
if (s) {
|
|
680
|
-
var
|
|
681
|
-
return r.every(function(
|
|
682
|
-
return s.call(n,
|
|
683
|
-
}),
|
|
675
|
+
var u = !1;
|
|
676
|
+
return r.every(function(h) {
|
|
677
|
+
return s.call(n, h) ? (u = !0, !1) : !0;
|
|
678
|
+
}), u;
|
|
684
679
|
} else
|
|
685
680
|
return !1;
|
|
686
681
|
}
|
|
687
682
|
}]), v;
|
|
688
|
-
}(), g = function() {
|
|
689
|
-
function v(
|
|
690
|
-
|
|
683
|
+
})(), g = (function() {
|
|
684
|
+
function v(c) {
|
|
685
|
+
a(this, v), this.ctx = c, this.ie = !1;
|
|
691
686
|
var n = window.navigator.userAgent;
|
|
692
687
|
(n.indexOf("MSIE") > -1 || n.indexOf("Trident") > -1) && (this.ie = !0);
|
|
693
688
|
}
|
|
694
|
-
return
|
|
689
|
+
return p(v, [{
|
|
695
690
|
key: "log",
|
|
696
691
|
value: function(n) {
|
|
697
|
-
var
|
|
698
|
-
this.opt.debug && (typeof r > "u" ? "undefined" : o(r)) === "object" && typeof r[
|
|
692
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "debug", r = this.opt.log;
|
|
693
|
+
this.opt.debug && (typeof r > "u" ? "undefined" : o(r)) === "object" && typeof r[i] == "function" && r[i]("mark.js: " + n);
|
|
699
694
|
}
|
|
700
695
|
}, {
|
|
701
696
|
key: "escapeStr",
|
|
@@ -710,11 +705,11 @@ function Mn() {
|
|
|
710
705
|
}, {
|
|
711
706
|
key: "createSynonymsRegExp",
|
|
712
707
|
value: function(n) {
|
|
713
|
-
var
|
|
714
|
-
for (var
|
|
715
|
-
if (
|
|
716
|
-
var
|
|
717
|
-
|
|
708
|
+
var i = this.opt.synonyms, r = this.opt.caseSensitive ? "" : "i", s = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? "\0" : "";
|
|
709
|
+
for (var u in i)
|
|
710
|
+
if (i.hasOwnProperty(u)) {
|
|
711
|
+
var h = i[u], f = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(u) : this.escapeStr(u), m = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(h) : this.escapeStr(h);
|
|
712
|
+
f !== "" && m !== "" && (n = n.replace(new RegExp("(" + this.escapeStr(f) + "|" + this.escapeStr(m) + ")", "gm" + r), s + ("(" + this.processSynomyms(f) + "|") + (this.processSynomyms(m) + ")") + s));
|
|
718
713
|
}
|
|
719
714
|
return n;
|
|
720
715
|
}
|
|
@@ -726,42 +721,42 @@ function Mn() {
|
|
|
726
721
|
}, {
|
|
727
722
|
key: "setupWildcardsRegExp",
|
|
728
723
|
value: function(n) {
|
|
729
|
-
return n = n.replace(/(?:\\)*\?/g, function(
|
|
730
|
-
return
|
|
731
|
-
}), n.replace(/(?:\\)*\*/g, function(
|
|
732
|
-
return
|
|
724
|
+
return n = n.replace(/(?:\\)*\?/g, function(i) {
|
|
725
|
+
return i.charAt(0) === "\\" ? "?" : "";
|
|
726
|
+
}), n.replace(/(?:\\)*\*/g, function(i) {
|
|
727
|
+
return i.charAt(0) === "\\" ? "*" : "";
|
|
733
728
|
});
|
|
734
729
|
}
|
|
735
730
|
}, {
|
|
736
731
|
key: "createWildcardsRegExp",
|
|
737
732
|
value: function(n) {
|
|
738
|
-
var
|
|
739
|
-
return n.replace(/\u0001/g,
|
|
733
|
+
var i = this.opt.wildcards === "withSpaces";
|
|
734
|
+
return n.replace(/\u0001/g, i ? "[\\S\\s]?" : "\\S?").replace(/\u0002/g, i ? "[\\S\\s]*?" : "\\S*");
|
|
740
735
|
}
|
|
741
736
|
}, {
|
|
742
737
|
key: "setupIgnoreJoinersRegExp",
|
|
743
738
|
value: function(n) {
|
|
744
|
-
return n.replace(/[^(|)\\]/g, function(
|
|
745
|
-
var
|
|
746
|
-
return /[(|)\\]/.test(
|
|
739
|
+
return n.replace(/[^(|)\\]/g, function(i, r, s) {
|
|
740
|
+
var u = s.charAt(r + 1);
|
|
741
|
+
return /[(|)\\]/.test(u) || u === "" ? i : i + "\0";
|
|
747
742
|
});
|
|
748
743
|
}
|
|
749
744
|
}, {
|
|
750
745
|
key: "createJoinersRegExp",
|
|
751
746
|
value: function(n) {
|
|
752
|
-
var
|
|
753
|
-
return Array.isArray(r) && r.length &&
|
|
747
|
+
var i = [], r = this.opt.ignorePunctuation;
|
|
748
|
+
return Array.isArray(r) && r.length && i.push(this.escapeStr(r.join(""))), this.opt.ignoreJoiners && i.push("\\u00ad\\u200b\\u200c\\u200d"), i.length ? n.split(/\u0000+/).join("[" + i.join("") + "]*") : n;
|
|
754
749
|
}
|
|
755
750
|
}, {
|
|
756
751
|
key: "createDiacriticsRegExp",
|
|
757
752
|
value: function(n) {
|
|
758
|
-
var
|
|
759
|
-
return n.split("").forEach(function(
|
|
760
|
-
r.every(function(
|
|
761
|
-
if (
|
|
762
|
-
if (s.indexOf(
|
|
753
|
+
var i = this.opt.caseSensitive ? "" : "i", r = this.opt.caseSensitive ? ["aàáảãạăằắẳẵặâầấẩẫậäåāą", "AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", "cçćč", "CÇĆČ", "dđď", "DĐĎ", "eèéẻẽẹêềếểễệëěēę", "EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", "iìíỉĩịîïī", "IÌÍỈĨỊÎÏĪ", "lł", "LŁ", "nñňń", "NÑŇŃ", "oòóỏõọôồốổỗộơởỡớờợöøō", "OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", "rř", "RŘ", "sšśșş", "SŠŚȘŞ", "tťțţ", "TŤȚŢ", "uùúủũụưừứửữựûüůū", "UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", "yýỳỷỹỵÿ", "YÝỲỶỸỴŸ", "zžżź", "ZŽŻŹ"] : ["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", "cçćčCÇĆČ", "dđďDĐĎ", "eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", "iìíỉĩịîïīIÌÍỈĨỊÎÏĪ", "lłLŁ", "nñňńNÑŇŃ", "oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", "rřRŘ", "sšśșşSŠŚȘŞ", "tťțţTŤȚŢ", "uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", "yýỳỷỹỵÿYÝỲỶỸỴŸ", "zžżźZŽŻŹ"], s = [];
|
|
754
|
+
return n.split("").forEach(function(u) {
|
|
755
|
+
r.every(function(h) {
|
|
756
|
+
if (h.indexOf(u) !== -1) {
|
|
757
|
+
if (s.indexOf(h) > -1)
|
|
763
758
|
return !1;
|
|
764
|
-
n = n.replace(new RegExp("[" +
|
|
759
|
+
n = n.replace(new RegExp("[" + h + "]", "gm" + i), "[" + h + "]"), s.push(h);
|
|
765
760
|
}
|
|
766
761
|
return !0;
|
|
767
762
|
});
|
|
@@ -775,30 +770,30 @@ function Mn() {
|
|
|
775
770
|
}, {
|
|
776
771
|
key: "createAccuracyRegExp",
|
|
777
772
|
value: function(n) {
|
|
778
|
-
var
|
|
779
|
-
switch (
|
|
780
|
-
|
|
781
|
-
}),
|
|
773
|
+
var i = this, r = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿", s = this.opt.accuracy, u = typeof s == "string" ? s : s.value, h = typeof s == "string" ? [] : s.limiters, f = "";
|
|
774
|
+
switch (h.forEach(function(m) {
|
|
775
|
+
f += "|" + i.escapeStr(m);
|
|
776
|
+
}), u) {
|
|
782
777
|
case "partially":
|
|
783
778
|
default:
|
|
784
779
|
return "()(" + n + ")";
|
|
785
780
|
case "complementary":
|
|
786
|
-
return
|
|
781
|
+
return f = "\\s" + (f || this.escapeStr(r)), "()([^" + f + "]*" + n + "[^" + f + "]*)";
|
|
787
782
|
case "exactly":
|
|
788
|
-
return "(^|\\s" +
|
|
783
|
+
return "(^|\\s" + f + ")(" + n + ")(?=$|\\s" + f + ")";
|
|
789
784
|
}
|
|
790
785
|
}
|
|
791
786
|
}, {
|
|
792
787
|
key: "getSeparatedKeywords",
|
|
793
788
|
value: function(n) {
|
|
794
|
-
var
|
|
789
|
+
var i = this, r = [];
|
|
795
790
|
return n.forEach(function(s) {
|
|
796
|
-
|
|
797
|
-
|
|
791
|
+
i.opt.separateWordSearch ? s.split(" ").forEach(function(u) {
|
|
792
|
+
u.trim() && r.indexOf(u) === -1 && r.push(u);
|
|
798
793
|
}) : s.trim() && r.indexOf(s) === -1 && r.push(s);
|
|
799
794
|
}), {
|
|
800
|
-
keywords: r.sort(function(s,
|
|
801
|
-
return
|
|
795
|
+
keywords: r.sort(function(s, u) {
|
|
796
|
+
return u.length - s.length;
|
|
802
797
|
}),
|
|
803
798
|
length: r.length
|
|
804
799
|
};
|
|
@@ -811,49 +806,49 @@ function Mn() {
|
|
|
811
806
|
}, {
|
|
812
807
|
key: "checkRanges",
|
|
813
808
|
value: function(n) {
|
|
814
|
-
var
|
|
809
|
+
var i = this;
|
|
815
810
|
if (!Array.isArray(n) || Object.prototype.toString.call(n[0]) !== "[object Object]")
|
|
816
811
|
return this.log("markRanges() will only accept an array of objects"), this.opt.noMatch(n), [];
|
|
817
812
|
var r = [], s = 0;
|
|
818
|
-
return n.sort(function(
|
|
819
|
-
return
|
|
820
|
-
}).forEach(function(
|
|
821
|
-
var
|
|
822
|
-
|
|
813
|
+
return n.sort(function(u, h) {
|
|
814
|
+
return u.start - h.start;
|
|
815
|
+
}).forEach(function(u) {
|
|
816
|
+
var h = i.callNoMatchOnInvalidRanges(u, s), f = h.start, m = h.end, w = h.valid;
|
|
817
|
+
w && (u.start = f, u.length = m - f, r.push(u), s = m);
|
|
823
818
|
}), r;
|
|
824
819
|
}
|
|
825
820
|
}, {
|
|
826
821
|
key: "callNoMatchOnInvalidRanges",
|
|
827
|
-
value: function(n,
|
|
828
|
-
var r = void 0, s = void 0,
|
|
829
|
-
return n && typeof n.start < "u" ? (r = parseInt(n.start, 10), s = r + parseInt(n.length, 10), this.isNumeric(n.start) && this.isNumeric(n.length) && s -
|
|
822
|
+
value: function(n, i) {
|
|
823
|
+
var r = void 0, s = void 0, u = !1;
|
|
824
|
+
return n && typeof n.start < "u" ? (r = parseInt(n.start, 10), s = r + parseInt(n.length, 10), this.isNumeric(n.start) && this.isNumeric(n.length) && s - i > 0 && s - r > 0 ? u = !0 : (this.log("Ignoring invalid or overlapping range: " + ("" + JSON.stringify(n))), this.opt.noMatch(n))) : (this.log("Ignoring invalid range: " + JSON.stringify(n)), this.opt.noMatch(n)), {
|
|
830
825
|
start: r,
|
|
831
826
|
end: s,
|
|
832
|
-
valid:
|
|
827
|
+
valid: u
|
|
833
828
|
};
|
|
834
829
|
}
|
|
835
830
|
}, {
|
|
836
831
|
key: "checkWhitespaceRanges",
|
|
837
|
-
value: function(n,
|
|
838
|
-
var s = void 0,
|
|
839
|
-
return m = m >
|
|
832
|
+
value: function(n, i, r) {
|
|
833
|
+
var s = void 0, u = !0, h = r.length, f = i - h, m = parseInt(n.start, 10) - f;
|
|
834
|
+
return m = m > h ? h : m, s = m + parseInt(n.length, 10), s > h && (s = h, this.log("End range automatically set to the max value of " + h)), m < 0 || s - m < 0 || m > h || s > h ? (u = !1, this.log("Invalid range: " + JSON.stringify(n)), this.opt.noMatch(n)) : r.substring(m, s).replace(/\s+/g, "") === "" && (u = !1, this.log("Skipping whitespace only range: " + JSON.stringify(n)), this.opt.noMatch(n)), {
|
|
840
835
|
start: m,
|
|
841
836
|
end: s,
|
|
842
|
-
valid:
|
|
837
|
+
valid: u
|
|
843
838
|
};
|
|
844
839
|
}
|
|
845
840
|
}, {
|
|
846
841
|
key: "getTextNodes",
|
|
847
842
|
value: function(n) {
|
|
848
|
-
var
|
|
849
|
-
this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(
|
|
843
|
+
var i = this, r = "", s = [];
|
|
844
|
+
this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(u) {
|
|
850
845
|
s.push({
|
|
851
846
|
start: r.length,
|
|
852
|
-
end: (r +=
|
|
853
|
-
node:
|
|
847
|
+
end: (r += u.textContent).length,
|
|
848
|
+
node: u
|
|
854
849
|
});
|
|
855
|
-
}, function(
|
|
856
|
-
return
|
|
850
|
+
}, function(u) {
|
|
851
|
+
return i.matchesExclude(u.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
857
852
|
}, function() {
|
|
858
853
|
n({
|
|
859
854
|
value: r,
|
|
@@ -868,24 +863,24 @@ function Mn() {
|
|
|
868
863
|
}
|
|
869
864
|
}, {
|
|
870
865
|
key: "wrapRangeInTextNode",
|
|
871
|
-
value: function(n,
|
|
872
|
-
var s = this.opt.element ? this.opt.element : "mark",
|
|
873
|
-
return
|
|
866
|
+
value: function(n, i, r) {
|
|
867
|
+
var s = this.opt.element ? this.opt.element : "mark", u = n.splitText(i), h = u.splitText(r - i), f = document.createElement(s);
|
|
868
|
+
return f.setAttribute("data-markjs", "true"), this.opt.className && f.setAttribute("class", this.opt.className), f.textContent = u.textContent, u.parentNode.replaceChild(f, u), h;
|
|
874
869
|
}
|
|
875
870
|
}, {
|
|
876
871
|
key: "wrapRangeInMappedTextNode",
|
|
877
|
-
value: function(n,
|
|
878
|
-
var
|
|
879
|
-
n.nodes.every(function(
|
|
880
|
-
var
|
|
881
|
-
if (typeof
|
|
882
|
-
if (!s(
|
|
872
|
+
value: function(n, i, r, s, u) {
|
|
873
|
+
var h = this;
|
|
874
|
+
n.nodes.every(function(f, m) {
|
|
875
|
+
var w = n.nodes[m + 1];
|
|
876
|
+
if (typeof w > "u" || w.start > i) {
|
|
877
|
+
if (!s(f.node))
|
|
883
878
|
return !1;
|
|
884
|
-
var T =
|
|
885
|
-
if (
|
|
886
|
-
|
|
887
|
-
}), r -= C,
|
|
888
|
-
|
|
879
|
+
var T = i - f.start, C = (r > f.end ? f.end : r) - f.start, L = n.value.substr(0, f.start), R = n.value.substr(C + f.start);
|
|
880
|
+
if (f.node = h.wrapRangeInTextNode(f.node, T, C), n.value = L + R, n.nodes.forEach(function(F, $) {
|
|
881
|
+
$ >= m && (n.nodes[$].start > 0 && $ !== m && (n.nodes[$].start -= C), n.nodes[$].end -= C);
|
|
882
|
+
}), r -= C, u(f.node.previousSibling, f.start), r > f.end)
|
|
883
|
+
i = f.end;
|
|
889
884
|
else
|
|
890
885
|
return !1;
|
|
891
886
|
}
|
|
@@ -894,52 +889,52 @@ function Mn() {
|
|
|
894
889
|
}
|
|
895
890
|
}, {
|
|
896
891
|
key: "wrapMatches",
|
|
897
|
-
value: function(n,
|
|
898
|
-
var
|
|
892
|
+
value: function(n, i, r, s, u) {
|
|
893
|
+
var h = this, f = i === 0 ? 0 : i + 1;
|
|
899
894
|
this.getTextNodes(function(m) {
|
|
900
|
-
m.nodes.forEach(function(
|
|
901
|
-
|
|
902
|
-
for (var T = void 0; (T = n.exec(
|
|
903
|
-
if (r(T[
|
|
895
|
+
m.nodes.forEach(function(w) {
|
|
896
|
+
w = w.node;
|
|
897
|
+
for (var T = void 0; (T = n.exec(w.textContent)) !== null && T[f] !== ""; )
|
|
898
|
+
if (r(T[f], w)) {
|
|
904
899
|
var C = T.index;
|
|
905
|
-
if (
|
|
906
|
-
for (var L = 1; L <
|
|
900
|
+
if (f !== 0)
|
|
901
|
+
for (var L = 1; L < f; L++)
|
|
907
902
|
C += T[L].length;
|
|
908
|
-
|
|
903
|
+
w = h.wrapRangeInTextNode(w, C, C + T[f].length), s(w.previousSibling), n.lastIndex = 0;
|
|
909
904
|
}
|
|
910
|
-
}),
|
|
905
|
+
}), u();
|
|
911
906
|
});
|
|
912
907
|
}
|
|
913
908
|
}, {
|
|
914
909
|
key: "wrapMatchesAcrossElements",
|
|
915
|
-
value: function(n,
|
|
916
|
-
var
|
|
910
|
+
value: function(n, i, r, s, u) {
|
|
911
|
+
var h = this, f = i === 0 ? 0 : i + 1;
|
|
917
912
|
this.getTextNodes(function(m) {
|
|
918
|
-
for (var
|
|
919
|
-
var T =
|
|
920
|
-
if (
|
|
921
|
-
for (var C = 1; C <
|
|
922
|
-
T +=
|
|
923
|
-
var L = T +
|
|
924
|
-
|
|
925
|
-
return r(
|
|
913
|
+
for (var w = void 0; (w = n.exec(m.value)) !== null && w[f] !== ""; ) {
|
|
914
|
+
var T = w.index;
|
|
915
|
+
if (f !== 0)
|
|
916
|
+
for (var C = 1; C < f; C++)
|
|
917
|
+
T += w[C].length;
|
|
918
|
+
var L = T + w[f].length;
|
|
919
|
+
h.wrapRangeInMappedTextNode(m, T, L, function(R) {
|
|
920
|
+
return r(w[f], R);
|
|
926
921
|
}, function(R, F) {
|
|
927
922
|
n.lastIndex = F, s(R);
|
|
928
923
|
});
|
|
929
924
|
}
|
|
930
|
-
|
|
925
|
+
u();
|
|
931
926
|
});
|
|
932
927
|
}
|
|
933
928
|
}, {
|
|
934
929
|
key: "wrapRangeFromIndex",
|
|
935
|
-
value: function(n,
|
|
936
|
-
var
|
|
937
|
-
this.getTextNodes(function(
|
|
938
|
-
var
|
|
939
|
-
n.forEach(function(m,
|
|
940
|
-
var T =
|
|
941
|
-
R &&
|
|
942
|
-
return
|
|
930
|
+
value: function(n, i, r, s) {
|
|
931
|
+
var u = this;
|
|
932
|
+
this.getTextNodes(function(h) {
|
|
933
|
+
var f = h.value.length;
|
|
934
|
+
n.forEach(function(m, w) {
|
|
935
|
+
var T = u.checkWhitespaceRanges(m, f, h.value), C = T.start, L = T.end, R = T.valid;
|
|
936
|
+
R && u.wrapRangeInMappedTextNode(h, C, L, function(F) {
|
|
937
|
+
return i(F, m, h.value.substring(C, L), w);
|
|
943
938
|
}, function(F) {
|
|
944
939
|
r(F, m);
|
|
945
940
|
});
|
|
@@ -949,9 +944,9 @@ function Mn() {
|
|
|
949
944
|
}, {
|
|
950
945
|
key: "unwrapMatches",
|
|
951
946
|
value: function(n) {
|
|
952
|
-
for (var
|
|
947
|
+
for (var i = n.parentNode, r = document.createDocumentFragment(); n.firstChild; )
|
|
953
948
|
r.appendChild(n.removeChild(n.firstChild));
|
|
954
|
-
|
|
949
|
+
i.replaceChild(r, n), this.ie ? this.normalizeTextNode(i) : i.normalize();
|
|
955
950
|
}
|
|
956
951
|
}, {
|
|
957
952
|
key: "normalizeTextNode",
|
|
@@ -967,45 +962,45 @@ function Mn() {
|
|
|
967
962
|
}
|
|
968
963
|
}, {
|
|
969
964
|
key: "markRegExp",
|
|
970
|
-
value: function(n,
|
|
965
|
+
value: function(n, i) {
|
|
971
966
|
var r = this;
|
|
972
|
-
this.opt =
|
|
973
|
-
var s = 0,
|
|
967
|
+
this.opt = i, this.log('Searching with expression "' + n + '"');
|
|
968
|
+
var s = 0, u = "wrapMatches", h = function(m) {
|
|
974
969
|
s++, r.opt.each(m);
|
|
975
970
|
};
|
|
976
|
-
this.opt.acrossElements && (
|
|
977
|
-
return r.opt.filter(m,
|
|
978
|
-
},
|
|
971
|
+
this.opt.acrossElements && (u = "wrapMatchesAcrossElements"), this[u](n, this.opt.ignoreGroups, function(f, m) {
|
|
972
|
+
return r.opt.filter(m, f, s);
|
|
973
|
+
}, h, function() {
|
|
979
974
|
s === 0 && r.opt.noMatch(n), r.opt.done(s);
|
|
980
975
|
});
|
|
981
976
|
}
|
|
982
977
|
}, {
|
|
983
978
|
key: "mark",
|
|
984
|
-
value: function(n,
|
|
979
|
+
value: function(n, i) {
|
|
985
980
|
var r = this;
|
|
986
|
-
this.opt =
|
|
987
|
-
var s = 0,
|
|
988
|
-
var R = new RegExp(r.createRegExp(L), "gm" +
|
|
989
|
-
r.log('Searching with expression "' + R + '"'), r[
|
|
981
|
+
this.opt = i;
|
|
982
|
+
var s = 0, u = "wrapMatches", h = this.getSeparatedKeywords(typeof n == "string" ? [n] : n), f = h.keywords, m = h.length, w = this.opt.caseSensitive ? "" : "i", T = function C(L) {
|
|
983
|
+
var R = new RegExp(r.createRegExp(L), "gm" + w), F = 0;
|
|
984
|
+
r.log('Searching with expression "' + R + '"'), r[u](R, 1, function($, Ee) {
|
|
990
985
|
return r.opt.filter(Ee, L, s, F);
|
|
991
|
-
}, function(
|
|
992
|
-
F++, s++, r.opt.each(
|
|
986
|
+
}, function($) {
|
|
987
|
+
F++, s++, r.opt.each($);
|
|
993
988
|
}, function() {
|
|
994
|
-
F === 0 && r.opt.noMatch(L),
|
|
989
|
+
F === 0 && r.opt.noMatch(L), f[m - 1] === L ? r.opt.done(s) : C(f[f.indexOf(L) + 1]);
|
|
995
990
|
});
|
|
996
991
|
};
|
|
997
|
-
this.opt.acrossElements && (
|
|
992
|
+
this.opt.acrossElements && (u = "wrapMatchesAcrossElements"), m === 0 ? this.opt.done(s) : T(f[0]);
|
|
998
993
|
}
|
|
999
994
|
}, {
|
|
1000
995
|
key: "markRanges",
|
|
1001
|
-
value: function(n,
|
|
996
|
+
value: function(n, i) {
|
|
1002
997
|
var r = this;
|
|
1003
|
-
this.opt =
|
|
1004
|
-
var s = 0,
|
|
1005
|
-
|
|
1006
|
-
return r.opt.filter(
|
|
1007
|
-
}, function(
|
|
1008
|
-
s++, r.opt.each(
|
|
998
|
+
this.opt = i;
|
|
999
|
+
var s = 0, u = this.checkRanges(n);
|
|
1000
|
+
u && u.length ? (this.log("Starting to mark with the following ranges: " + JSON.stringify(u)), this.wrapRangeFromIndex(u, function(h, f, m, w) {
|
|
1001
|
+
return r.opt.filter(h, f, m, w);
|
|
1002
|
+
}, function(h, f) {
|
|
1003
|
+
s++, r.opt.each(h, f);
|
|
1009
1004
|
}, function() {
|
|
1010
1005
|
r.opt.done(s);
|
|
1011
1006
|
})) : this.opt.done(s);
|
|
@@ -1013,20 +1008,20 @@ function Mn() {
|
|
|
1013
1008
|
}, {
|
|
1014
1009
|
key: "unmark",
|
|
1015
1010
|
value: function(n) {
|
|
1016
|
-
var
|
|
1011
|
+
var i = this;
|
|
1017
1012
|
this.opt = n;
|
|
1018
1013
|
var r = this.opt.element ? this.opt.element : "*";
|
|
1019
1014
|
r += "[data-markjs]", this.opt.className && (r += "." + this.opt.className), this.log('Removal selector "' + r + '"'), this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function(s) {
|
|
1020
|
-
|
|
1015
|
+
i.unwrapMatches(s);
|
|
1021
1016
|
}, function(s) {
|
|
1022
|
-
var
|
|
1023
|
-
return !
|
|
1017
|
+
var u = y.matches(s, r), h = i.matchesExclude(s);
|
|
1018
|
+
return !u || h ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
1024
1019
|
}, this.opt.done);
|
|
1025
1020
|
}
|
|
1026
1021
|
}, {
|
|
1027
1022
|
key: "opt",
|
|
1028
1023
|
set: function(n) {
|
|
1029
|
-
this._opt =
|
|
1024
|
+
this._opt = l({}, {
|
|
1030
1025
|
element: "",
|
|
1031
1026
|
className: "",
|
|
1032
1027
|
exclude: [],
|
|
@@ -1064,95 +1059,88 @@ function Mn() {
|
|
|
1064
1059
|
return new y(this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout);
|
|
1065
1060
|
}
|
|
1066
1061
|
}]), v;
|
|
1067
|
-
}();
|
|
1062
|
+
})();
|
|
1068
1063
|
function E(v) {
|
|
1069
|
-
var
|
|
1070
|
-
return this.mark = function(
|
|
1071
|
-
return n.mark(
|
|
1072
|
-
}, this.markRegExp = function(
|
|
1073
|
-
return n.markRegExp(
|
|
1074
|
-
}, this.markRanges = function(
|
|
1075
|
-
return n.markRanges(
|
|
1076
|
-
}, this.unmark = function(
|
|
1077
|
-
return n.unmark(
|
|
1064
|
+
var c = this, n = new g(v);
|
|
1065
|
+
return this.mark = function(i, r) {
|
|
1066
|
+
return n.mark(i, r), c;
|
|
1067
|
+
}, this.markRegExp = function(i, r) {
|
|
1068
|
+
return n.markRegExp(i, r), c;
|
|
1069
|
+
}, this.markRanges = function(i, r) {
|
|
1070
|
+
return n.markRanges(i, r), c;
|
|
1071
|
+
}, this.unmark = function(i) {
|
|
1072
|
+
return n.unmark(i), c;
|
|
1078
1073
|
}, this;
|
|
1079
1074
|
}
|
|
1080
1075
|
return E;
|
|
1081
|
-
});
|
|
1082
|
-
}(ce)), ce.exports;
|
|
1076
|
+
}));
|
|
1077
|
+
})(ce)), ce.exports;
|
|
1083
1078
|
}
|
|
1084
1079
|
var Cn = Mn();
|
|
1085
1080
|
const On = /* @__PURE__ */ Sn(Cn);
|
|
1086
|
-
function
|
|
1087
|
-
const
|
|
1088
|
-
return
|
|
1081
|
+
function ar(e, t, o) {
|
|
1082
|
+
const a = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
1083
|
+
return a === -1 ? !1 : (e.splice(a, 1, o), !0);
|
|
1089
1084
|
}
|
|
1090
|
-
function
|
|
1085
|
+
function sr(e, t) {
|
|
1091
1086
|
const o = document.createElement("div");
|
|
1092
1087
|
o.classList.add("vf-overlay"), o.addEventListener("click", n), document.body.appendChild(o);
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1088
|
+
const a = document.createElement("div");
|
|
1089
|
+
a.classList.add("vf-context-menu"), a.style.position = "absolute", o.appendChild(a);
|
|
1090
|
+
const p = e.currentTarget;
|
|
1091
|
+
p.style.userSelect = "none", p.classList.add("context-menu-active"), t.targetClass && p.classList.add(t.targetClass), t.class && a.classList.add(t.class), t.items.forEach((r) => {
|
|
1097
1092
|
if (r == "-") {
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1093
|
+
const u = document.createElement("div");
|
|
1094
|
+
u.classList.add("separator"), a.appendChild(u);
|
|
1100
1095
|
return;
|
|
1101
1096
|
}
|
|
1102
1097
|
const s = document.createElement("div");
|
|
1103
|
-
s.classList.add("item"), s.style.userSelect = "none", s.innerText = r.title,
|
|
1098
|
+
s.classList.add("item"), s.style.userSelect = "none", s.innerText = r.title, a.appendChild(s), r.class && s.classList.add(r.class), r.shouldConfirm ? s.addEventListener("click", (u) => i(u, s, r.handler)) : s.addEventListener("click", () => r.handler());
|
|
1104
1099
|
});
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
|
|
1100
|
+
const l = window.innerWidth - e.clientX, y = window.innerHeight - e.clientY, g = a.offsetHeight, E = a.offsetWidth, v = l < E ? e.clientX - E - 1 : e.clientX + 1, c = y < g ? e.clientY - g - 1 : e.clientY + 1;
|
|
1101
|
+
a.style.left = v + "px", a.style.top = c + "px", setTimeout(() => {
|
|
1102
|
+
a.style.width = a.offsetWidth + "px";
|
|
1108
1103
|
}, 50);
|
|
1109
1104
|
function n() {
|
|
1110
|
-
t.targetClass &&
|
|
1105
|
+
t.targetClass && p.classList.remove(t.targetClass), p.classList.remove("context-menu-active"), p.style.userSelect = "", o.remove();
|
|
1111
1106
|
}
|
|
1112
|
-
function
|
|
1107
|
+
function i(r, s, u) {
|
|
1113
1108
|
if (s.classList.contains("pending-confirm"))
|
|
1114
|
-
return
|
|
1115
|
-
const
|
|
1109
|
+
return u();
|
|
1110
|
+
const h = s.innerHTML;
|
|
1116
1111
|
s.classList.add("pending-confirm"), s.innerText = "Confirm";
|
|
1117
|
-
const
|
|
1118
|
-
s.classList.remove("pending-confirm"), s.innerHTML =
|
|
1112
|
+
const f = () => {
|
|
1113
|
+
s.classList.remove("pending-confirm"), s.innerHTML = h, s.removeEventListener("mouseleave", f);
|
|
1119
1114
|
};
|
|
1120
|
-
s.addEventListener("mouseleave",
|
|
1115
|
+
s.addEventListener("mouseleave", f), r.stopPropagation();
|
|
1121
1116
|
}
|
|
1122
1117
|
}
|
|
1123
|
-
const Nn = (e) => new Promise((t) => setTimeout(t, e)),
|
|
1118
|
+
const Nn = (e) => new Promise((t) => setTimeout(t, e)), lr = (e) => Nn(e * 1e3);
|
|
1124
1119
|
function Ln(e) {
|
|
1125
1120
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1126
1121
|
}
|
|
1127
|
-
function
|
|
1122
|
+
function ur(e, t) {
|
|
1128
1123
|
return e != null ? qt(e) : t;
|
|
1129
1124
|
}
|
|
1130
|
-
function
|
|
1125
|
+
function cr(e, t) {
|
|
1131
1126
|
const o = { ...e };
|
|
1132
|
-
for (const
|
|
1133
|
-
o[
|
|
1127
|
+
for (const a of t)
|
|
1128
|
+
o[a] === "" && (o[a] = null);
|
|
1134
1129
|
return o;
|
|
1135
1130
|
}
|
|
1136
1131
|
function Ye(e) {
|
|
1137
1132
|
return e != null;
|
|
1138
1133
|
}
|
|
1139
|
-
function
|
|
1134
|
+
function dr(e, t) {
|
|
1140
1135
|
en(e, {
|
|
1141
1136
|
...t,
|
|
1142
|
-
onError(o,
|
|
1137
|
+
onError(o, a) {
|
|
1143
1138
|
o instanceof tn && o.response.status === 422 && typeof o.body == "object" && o.body && "error" in o.body && typeof o.body.error == "string" && (o = new ye(o.body.error));
|
|
1144
|
-
const
|
|
1145
|
-
return
|
|
1139
|
+
const p = t.onError?.(o, a);
|
|
1140
|
+
return p !== void 0 ? p : o;
|
|
1146
1141
|
}
|
|
1147
1142
|
});
|
|
1148
1143
|
}
|
|
1149
|
-
/*!
|
|
1150
|
-
* currency.js - v2.0.4
|
|
1151
|
-
* http://scurker.github.io/currency.js
|
|
1152
|
-
*
|
|
1153
|
-
* Copyright (c) 2021 Jason Wilson
|
|
1154
|
-
* Released under MIT license
|
|
1155
|
-
*/
|
|
1156
1144
|
var Rn = {
|
|
1157
1145
|
symbol: "$",
|
|
1158
1146
|
separator: ",",
|
|
@@ -1161,7 +1149,7 @@ var Rn = {
|
|
|
1161
1149
|
precision: 2,
|
|
1162
1150
|
pattern: "!#",
|
|
1163
1151
|
negativePattern: "-!#",
|
|
1164
|
-
format:
|
|
1152
|
+
format: Hn,
|
|
1165
1153
|
fromCents: !1
|
|
1166
1154
|
}, pt = function(t) {
|
|
1167
1155
|
return Math.round(t);
|
|
@@ -1169,43 +1157,43 @@ var Rn = {
|
|
|
1169
1157
|
return Math.pow(10, t);
|
|
1170
1158
|
}, Fn = function(t, o) {
|
|
1171
1159
|
return pt(t / o) * o;
|
|
1172
|
-
}, An = /(\d)(?=(\d{3})+\b)/g,
|
|
1173
|
-
function
|
|
1160
|
+
}, An = /(\d)(?=(\d{3})+\b)/g, Dn = /(\d)(?=(\d\d)+\d\b)/g;
|
|
1161
|
+
function _(e, t) {
|
|
1174
1162
|
var o = this;
|
|
1175
|
-
if (!(o instanceof
|
|
1176
|
-
return new
|
|
1177
|
-
var
|
|
1178
|
-
o.intValue =
|
|
1163
|
+
if (!(o instanceof _))
|
|
1164
|
+
return new _(e, t);
|
|
1165
|
+
var a = Object.assign({}, Rn, t), p = Fe(a.precision), l = de(e, a);
|
|
1166
|
+
o.intValue = l, o.value = l / p, a.increment = a.increment || 1 / p, a.useVedic ? a.groups = Dn : a.groups = An, this.s = a, this.p = p;
|
|
1179
1167
|
}
|
|
1180
1168
|
function de(e, t) {
|
|
1181
|
-
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0,
|
|
1182
|
-
if (
|
|
1169
|
+
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, a = 0, p = t.decimal, l = t.errorOnInvalid, y = t.precision, g = t.fromCents, E = Fe(y), v = typeof e == "number", c = e instanceof _;
|
|
1170
|
+
if (c && g)
|
|
1183
1171
|
return e.intValue;
|
|
1184
|
-
if (v ||
|
|
1185
|
-
|
|
1172
|
+
if (v || c)
|
|
1173
|
+
a = c ? e.value : e;
|
|
1186
1174
|
else if (typeof e == "string") {
|
|
1187
|
-
var n = new RegExp("[^-\\d" +
|
|
1188
|
-
|
|
1175
|
+
var n = new RegExp("[^-\\d" + p + "]", "g"), i = new RegExp("\\" + p, "g");
|
|
1176
|
+
a = e.replace(/\((.*)\)/, "-$1").replace(n, "").replace(i, "."), a = a || 0;
|
|
1189
1177
|
} else {
|
|
1190
|
-
if (
|
|
1178
|
+
if (l)
|
|
1191
1179
|
throw Error("Invalid Input");
|
|
1192
|
-
|
|
1180
|
+
a = 0;
|
|
1193
1181
|
}
|
|
1194
|
-
return g || (
|
|
1182
|
+
return g || (a *= E, a = a.toFixed(4)), o ? pt(a) : a;
|
|
1195
1183
|
}
|
|
1196
|
-
function
|
|
1197
|
-
var o = t.pattern,
|
|
1198
|
-
return (e.value >= 0 ? o :
|
|
1184
|
+
function Hn(e, t) {
|
|
1185
|
+
var o = t.pattern, a = t.negativePattern, p = t.symbol, l = t.separator, y = t.decimal, g = t.groups, E = ("" + e).replace(/^-/, "").split("."), v = E[0], c = E[1];
|
|
1186
|
+
return (e.value >= 0 ? o : a).replace("!", p).replace("#", v.replace(g, "$1" + l) + (c ? y + c : ""));
|
|
1199
1187
|
}
|
|
1200
|
-
|
|
1188
|
+
_.prototype = {
|
|
1201
1189
|
/**
|
|
1202
1190
|
* Adds values together.
|
|
1203
1191
|
* @param {number} number
|
|
1204
1192
|
* @returns {currency}
|
|
1205
1193
|
*/
|
|
1206
1194
|
add: function(t) {
|
|
1207
|
-
var o = this.intValue,
|
|
1208
|
-
return
|
|
1195
|
+
var o = this.intValue, a = this.s, p = this.p;
|
|
1196
|
+
return _((o += de(t, a)) / (a.fromCents ? 1 : p), a);
|
|
1209
1197
|
},
|
|
1210
1198
|
/**
|
|
1211
1199
|
* Subtracts value.
|
|
@@ -1213,8 +1201,8 @@ B.prototype = {
|
|
|
1213
1201
|
* @returns {currency}
|
|
1214
1202
|
*/
|
|
1215
1203
|
subtract: function(t) {
|
|
1216
|
-
var o = this.intValue,
|
|
1217
|
-
return
|
|
1204
|
+
var o = this.intValue, a = this.s, p = this.p;
|
|
1205
|
+
return _((o -= de(t, a)) / (a.fromCents ? 1 : p), a);
|
|
1218
1206
|
},
|
|
1219
1207
|
/**
|
|
1220
1208
|
* Multiplies values.
|
|
@@ -1222,8 +1210,8 @@ B.prototype = {
|
|
|
1222
1210
|
* @returns {currency}
|
|
1223
1211
|
*/
|
|
1224
1212
|
multiply: function(t) {
|
|
1225
|
-
var o = this.intValue,
|
|
1226
|
-
return
|
|
1213
|
+
var o = this.intValue, a = this.s;
|
|
1214
|
+
return _((o *= t) / (a.fromCents ? 1 : Fe(a.precision)), a);
|
|
1227
1215
|
},
|
|
1228
1216
|
/**
|
|
1229
1217
|
* Divides value.
|
|
@@ -1231,8 +1219,8 @@ B.prototype = {
|
|
|
1231
1219
|
* @returns {currency}
|
|
1232
1220
|
*/
|
|
1233
1221
|
divide: function(t) {
|
|
1234
|
-
var o = this.intValue,
|
|
1235
|
-
return
|
|
1222
|
+
var o = this.intValue, a = this.s;
|
|
1223
|
+
return _(o /= de(t, a, !1), a);
|
|
1236
1224
|
},
|
|
1237
1225
|
/**
|
|
1238
1226
|
* Takes the currency amount and distributes the values evenly. Any extra pennies
|
|
@@ -1241,11 +1229,11 @@ B.prototype = {
|
|
|
1241
1229
|
* @returns {array}
|
|
1242
1230
|
*/
|
|
1243
1231
|
distribute: function(t) {
|
|
1244
|
-
for (var o = this.intValue,
|
|
1245
|
-
var v =
|
|
1246
|
-
g-- > 0 && (v = v[o >= 0 ? "add" : "subtract"](1 / E)),
|
|
1232
|
+
for (var o = this.intValue, a = this.p, p = this.s, l = [], y = Math[o >= 0 ? "floor" : "ceil"](o / t), g = Math.abs(o - y * t), E = p.fromCents ? 1 : a; t !== 0; t--) {
|
|
1233
|
+
var v = _(y / E, p);
|
|
1234
|
+
g-- > 0 && (v = v[o >= 0 ? "add" : "subtract"](1 / E)), l.push(v);
|
|
1247
1235
|
}
|
|
1248
|
-
return
|
|
1236
|
+
return l;
|
|
1249
1237
|
},
|
|
1250
1238
|
/**
|
|
1251
1239
|
* Returns the dollar value.
|
|
@@ -1276,8 +1264,8 @@ B.prototype = {
|
|
|
1276
1264
|
* @returns {string}
|
|
1277
1265
|
*/
|
|
1278
1266
|
toString: function() {
|
|
1279
|
-
var t = this.intValue, o = this.p,
|
|
1280
|
-
return Fn(t / o,
|
|
1267
|
+
var t = this.intValue, o = this.p, a = this.s;
|
|
1268
|
+
return Fn(t / o, a.increment).toFixed(a.precision);
|
|
1281
1269
|
},
|
|
1282
1270
|
/**
|
|
1283
1271
|
* Value for JSON serialization.
|
|
@@ -1290,55 +1278,56 @@ B.prototype = {
|
|
|
1290
1278
|
const A = [];
|
|
1291
1279
|
for (let e = 0; e < 256; ++e)
|
|
1292
1280
|
A.push((e + 256).toString(16).slice(1));
|
|
1293
|
-
function
|
|
1281
|
+
function Vn(e, t = 0) {
|
|
1294
1282
|
return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
|
|
1295
1283
|
}
|
|
1296
1284
|
let Te;
|
|
1297
|
-
const
|
|
1298
|
-
function
|
|
1285
|
+
const $n = new Uint8Array(16);
|
|
1286
|
+
function Bn() {
|
|
1299
1287
|
if (!Te) {
|
|
1300
1288
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1301
1289
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1302
1290
|
Te = crypto.getRandomValues.bind(crypto);
|
|
1303
1291
|
}
|
|
1304
|
-
return Te(
|
|
1292
|
+
return Te($n);
|
|
1305
1293
|
}
|
|
1306
|
-
const
|
|
1294
|
+
const _n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Xe = { randomUUID: _n };
|
|
1307
1295
|
function Wn(e, t, o) {
|
|
1308
|
-
if (Xe.randomUUID && !e)
|
|
1309
|
-
return Xe.randomUUID();
|
|
1310
1296
|
e = e || {};
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1297
|
+
const a = e.random ?? e.rng?.() ?? Bn();
|
|
1298
|
+
if (a.length < 16)
|
|
1313
1299
|
throw new Error("Random bytes length must be >= 16");
|
|
1314
|
-
return
|
|
1300
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Vn(a);
|
|
1301
|
+
}
|
|
1302
|
+
function Pn(e, t, o) {
|
|
1303
|
+
return Xe.randomUUID && !e ? Xe.randomUUID() : Wn(e);
|
|
1315
1304
|
}
|
|
1316
|
-
function
|
|
1305
|
+
function fr(e) {
|
|
1317
1306
|
return e.replace(/\n/g, "<br>");
|
|
1318
1307
|
}
|
|
1319
|
-
function
|
|
1308
|
+
function jn(e) {
|
|
1320
1309
|
return e.replace(/_/g, " ");
|
|
1321
1310
|
}
|
|
1322
|
-
function
|
|
1311
|
+
function Un(e) {
|
|
1323
1312
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
1324
1313
|
return t.length !== 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
1325
1314
|
}
|
|
1326
|
-
function
|
|
1327
|
-
return
|
|
1315
|
+
function zn(e, t) {
|
|
1316
|
+
return _(e).divide(t ?? H.defaultCurrencyDivisor).format();
|
|
1328
1317
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return
|
|
1318
|
+
function hr() {
|
|
1319
|
+
return Pn();
|
|
1331
1320
|
}
|
|
1332
|
-
const
|
|
1321
|
+
const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
1333
1322
|
key: 0,
|
|
1334
1323
|
class: "no-results"
|
|
1335
|
-
},
|
|
1324
|
+
}, Kn = {
|
|
1336
1325
|
key: 0,
|
|
1337
1326
|
class: "group-title"
|
|
1338
|
-
},
|
|
1327
|
+
}, Yn = ["onMousemove", "onMousedown"], Xn = ["innerHTML"], Zn = ["innerHTML"], Gn = {
|
|
1339
1328
|
key: 1,
|
|
1340
1329
|
class: "no-results"
|
|
1341
|
-
},
|
|
1330
|
+
}, Qn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", eo = /* @__PURE__ */ q({
|
|
1342
1331
|
__name: "vf-smart-select",
|
|
1343
1332
|
props: {
|
|
1344
1333
|
modelValue: {},
|
|
@@ -1375,264 +1364,264 @@ const zn = ["disabled", "placeholder", "required", "name"], qn = {
|
|
|
1375
1364
|
},
|
|
1376
1365
|
emits: ["optionsLoaded", "update:modelValue"],
|
|
1377
1366
|
setup(e, { expose: t, emit: o }) {
|
|
1378
|
-
const
|
|
1367
|
+
const a = Symbol("null"), p = Symbol("create"), l = e, y = o;
|
|
1379
1368
|
t({
|
|
1380
|
-
addRemoteOption:
|
|
1369
|
+
addRemoteOption: Ht
|
|
1381
1370
|
});
|
|
1382
|
-
const g = N(), E = N(), v = N(),
|
|
1383
|
-
const k = Tt.value?.(
|
|
1384
|
-
return
|
|
1385
|
-
|
|
1386
|
-
String(
|
|
1371
|
+
const g = N(), E = N(), v = N(), c = N(!1), n = N(), i = N(!1), r = N(""), s = N(null), u = N(null), h = N(!1), f = N(null), m = N(!1), w = O(() => l.showCreateTextOnNewItem ?? !0), T = O(() => !!(l.options || n.value)), C = O(() => l.options ?? n.value ?? []), L = O(() => l.prependOptions ?? []), R = O(() => l.appendOptions ?? []), F = O(() => !!l.disabled || !T.value && !l.loadOptions), $ = O(() => l.loadingText || "..."), Ee = O(() => !T.value && (!l.loadOptions || l.preload || l.modelValue && (l.valueField || l.valueExtractor)) ? $.value : l.nullTitle ? l.nullTitle : l.placeholder || ""), bt = O(() => l.noResultsText || "No options match your search."), Z = O(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (d) => d[l.valueField] : null), ke = O(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (d) => String(d[l.keyField]) : Z.value ? (d) => String(Z.value(d)) : null), Tt = O(() => l.groupFormatter ? l.groupFormatter : l.groupField ? (d) => String(d[l.groupField]) : null), He = O(() => l.formatter ? l.formatter : l.labelField ? (d) => String(d[l.labelField]) : (d) => String(d)), Ve = O(() => l.selectionFormatter ? l.selectionFormatter : He.value), $e = O(() => [...L.value, ...C.value, ...R.value]), Be = O(() => !!(l.groupField || l.groupFormatter)), xe = O(() => $e.value.map((d, b) => {
|
|
1372
|
+
const k = Tt.value?.(d), x = He.value(d), M = l.subtitleFormatter?.(d), B = x ? x.trim().toLowerCase() : "", qe = M ? M.trim().toLowerCase() : "", ue = [];
|
|
1373
|
+
return l.searchFields ? l.searchFields.forEach((Je) => {
|
|
1374
|
+
d[Je] && ue.push(
|
|
1375
|
+
String(d[Je]).toLowerCase().replace(/^[a-z0-9 ]+$/i, "")
|
|
1387
1376
|
);
|
|
1388
|
-
}) : (ue.push(
|
|
1389
|
-
key: ke.value?.(
|
|
1377
|
+
}) : (ue.push(B), qe && ue.push(qe)), {
|
|
1378
|
+
key: ke.value?.(d) ?? String(b),
|
|
1390
1379
|
group: k,
|
|
1391
|
-
title:
|
|
1380
|
+
title: x,
|
|
1392
1381
|
subtitle: M,
|
|
1393
1382
|
searchContent: ue.join(""),
|
|
1394
|
-
ref:
|
|
1383
|
+
ref: d
|
|
1395
1384
|
};
|
|
1396
|
-
})),
|
|
1397
|
-
let
|
|
1398
|
-
if (
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
key:
|
|
1402
|
-
title:
|
|
1385
|
+
})), D = O(() => {
|
|
1386
|
+
let d = [...xe.value];
|
|
1387
|
+
if (i.value) {
|
|
1388
|
+
const b = r.value.trim().toLowerCase().replace(/[^a-z0-9 ]+$/i, "");
|
|
1389
|
+
b.length && (d = d.filter((k) => k.searchContent.includes(b)), m.value && (d.find((x) => x.searchContent === b) !== void 0 || d.push({
|
|
1390
|
+
key: p,
|
|
1391
|
+
title: w.value ? "Create <strong>" + r.value.trim() + "</strong>..." : r.value.trim()
|
|
1403
1392
|
})));
|
|
1404
|
-
} else
|
|
1405
|
-
key:
|
|
1406
|
-
title:
|
|
1393
|
+
} else l.nullTitle && d.unshift({
|
|
1394
|
+
key: a,
|
|
1395
|
+
title: l.nullTitle
|
|
1407
1396
|
});
|
|
1408
|
-
return
|
|
1397
|
+
return d;
|
|
1409
1398
|
}), St = O(() => {
|
|
1410
|
-
if (
|
|
1399
|
+
if (!Be.value)
|
|
1411
1400
|
return [
|
|
1412
1401
|
{
|
|
1413
1402
|
groupTitle: "",
|
|
1414
|
-
options:
|
|
1403
|
+
options: D.value
|
|
1415
1404
|
}
|
|
1416
1405
|
];
|
|
1417
|
-
const
|
|
1418
|
-
return
|
|
1406
|
+
const d = Jt(D.value.map((k) => k.group ?? "")), b = Kt(D.value, (k) => k.group ?? "");
|
|
1407
|
+
return d.map((k) => ({
|
|
1419
1408
|
groupTitle: k,
|
|
1420
|
-
options:
|
|
1409
|
+
options: b[k]
|
|
1421
1410
|
}));
|
|
1422
1411
|
});
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}),
|
|
1426
|
-
|
|
1427
|
-
}),
|
|
1428
|
-
|
|
1429
|
-
}),
|
|
1430
|
-
|
|
1412
|
+
V(() => l.modelValue, G), V(xe, () => {
|
|
1413
|
+
h.value && setTimeout(je, 0);
|
|
1414
|
+
}), V(r, () => {
|
|
1415
|
+
i.value && !l.remoteSearch && !r.value.trim().length && (i.value = !1);
|
|
1416
|
+
}), V(h, () => {
|
|
1417
|
+
h.value ? setTimeout(Ft, 0) : (i.value = !1, r.value = u.value ?? "", v.value && (v.value.style.visibility = "hidden"));
|
|
1418
|
+
}), V(D, () => {
|
|
1419
|
+
l.modelValue !== null && s.value === null && G(), (f.value !== null || i.value) && !D.value.find((d) => d.key == f.value) && (f.value = D.value[0]?.key ?? a);
|
|
1431
1420
|
}), z(async () => {
|
|
1432
|
-
m.value =
|
|
1433
|
-
const
|
|
1434
|
-
Me(
|
|
1435
|
-
}),
|
|
1421
|
+
m.value = l.onCreateItem !== void 0, l.loadOptions && l.preload ? await _e() : !l.options && !l.loadOptions && (l.valueField || l.valueExtractor) || G(), V(s, () => {
|
|
1422
|
+
const d = Ye(s.value) && Z.value !== null ? Z.value(s.value) : s.value;
|
|
1423
|
+
Me(l.modelValue, d) || y("update:modelValue", d);
|
|
1424
|
+
}), l.remoteSearch && V(r, Yt(It, 250));
|
|
1436
1425
|
}), me(() => {
|
|
1437
1426
|
v.value?.remove();
|
|
1438
1427
|
});
|
|
1439
|
-
async function
|
|
1428
|
+
async function _e() {
|
|
1440
1429
|
await We(!0), G(), n.value && y("optionsLoaded", n.value);
|
|
1441
1430
|
}
|
|
1442
|
-
async function We(
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1431
|
+
async function We(d = !1) {
|
|
1432
|
+
const b = l.remoteSearch && i.value && r.value.length ? r.value : null;
|
|
1433
|
+
c.value = !0, n.value = await l.loadOptions?.(b) ?? [], c.value = !1, d && G(), Pe();
|
|
1445
1434
|
}
|
|
1446
1435
|
function It() {
|
|
1447
|
-
|
|
1436
|
+
i.value && (We(), i.value = r.value.trim().length > 0);
|
|
1448
1437
|
}
|
|
1449
|
-
function Mt(
|
|
1450
|
-
if (
|
|
1451
|
-
|
|
1438
|
+
function Mt(d) {
|
|
1439
|
+
if (d.key == "Escape") {
|
|
1440
|
+
d.stopPropagation(), d.target.blur(), ze();
|
|
1452
1441
|
return;
|
|
1453
1442
|
}
|
|
1454
|
-
if (!(
|
|
1443
|
+
if (!(d.key == "ArrowLeft" || d.key == "ArrowRight") && d.key != "Tab") {
|
|
1455
1444
|
if (!T.value) {
|
|
1456
|
-
|
|
1445
|
+
i.value || d.preventDefault();
|
|
1457
1446
|
return;
|
|
1458
1447
|
}
|
|
1459
|
-
if (
|
|
1460
|
-
return
|
|
1461
|
-
if (
|
|
1462
|
-
return
|
|
1463
|
-
if (
|
|
1464
|
-
return
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1448
|
+
if (d.key == "ArrowUp" || d.key == "ArrowDown")
|
|
1449
|
+
return d.preventDefault(), we(d.key == "ArrowUp" ? -1 : 1);
|
|
1450
|
+
if (d.key == "PageUp" || d.key == "PageDown")
|
|
1451
|
+
return d.preventDefault(), we(d.key == "PageUp" ? -10 : 10);
|
|
1452
|
+
if (d.key == "Home" || d.key == "End")
|
|
1453
|
+
return d.preventDefault(), we(d.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
1454
|
+
if (d.key == "Enter") {
|
|
1455
|
+
d.preventDefault();
|
|
1456
|
+
const b = D.value.find((k) => k.key == f.value);
|
|
1457
|
+
if (b) return Ue(b);
|
|
1469
1458
|
}
|
|
1470
|
-
if (
|
|
1471
|
-
r.value.length > 1 && (
|
|
1459
|
+
if (d.key === "Delete" || d.key === "Backspace") {
|
|
1460
|
+
r.value.length > 1 && (i.value = !0);
|
|
1472
1461
|
return;
|
|
1473
1462
|
}
|
|
1474
|
-
!
|
|
1463
|
+
!d.metaKey && Qn.includes(d.key) && (i.value = !0);
|
|
1475
1464
|
}
|
|
1476
1465
|
}
|
|
1477
1466
|
function Ct() {
|
|
1478
|
-
|
|
1467
|
+
i.value = !0;
|
|
1479
1468
|
}
|
|
1480
1469
|
function Ot() {
|
|
1481
|
-
Pe(),
|
|
1470
|
+
Pe(), h.value = !0, setTimeout(() => E.value?.select(), 0);
|
|
1482
1471
|
}
|
|
1483
|
-
function Pe(
|
|
1484
|
-
s.value ?
|
|
1472
|
+
function Pe(d) {
|
|
1473
|
+
s.value ? f.value = Nt(s.value) : l.nullTitle && (f.value = a);
|
|
1485
1474
|
}
|
|
1486
|
-
function Nt(
|
|
1487
|
-
return ke.value ? ke.value(s.value) : Lt(
|
|
1475
|
+
function Nt(d) {
|
|
1476
|
+
return ke.value ? ke.value(s.value) : Lt(d)?.key ?? "";
|
|
1488
1477
|
}
|
|
1489
|
-
function Lt(
|
|
1490
|
-
const
|
|
1491
|
-
if (
|
|
1492
|
-
return
|
|
1493
|
-
const k =
|
|
1494
|
-
return
|
|
1478
|
+
function Lt(d) {
|
|
1479
|
+
const b = D.value.find((M) => M.ref === d);
|
|
1480
|
+
if (b)
|
|
1481
|
+
return b;
|
|
1482
|
+
const k = l.keyExtractor ? (M, B) => l.keyExtractor(M) === l.keyExtractor(B) : Me, x = D.value.find((M) => k(M.ref, d));
|
|
1483
|
+
return x || null;
|
|
1495
1484
|
}
|
|
1496
1485
|
function Rt() {
|
|
1497
|
-
|
|
1486
|
+
l.debug || (!r.value.length && l.nullTitle && (s.value = null, u.value = null), h.value = !1);
|
|
1498
1487
|
}
|
|
1499
1488
|
function Ft() {
|
|
1500
|
-
T.value ||
|
|
1489
|
+
T.value || _e(), l.optionsListId && v.value?.setAttribute("id", l.optionsListId), At();
|
|
1501
1490
|
}
|
|
1502
1491
|
function At() {
|
|
1503
|
-
const
|
|
1504
|
-
for (let
|
|
1505
|
-
/^(font|text)/.test(
|
|
1506
|
-
if (
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1492
|
+
const d = g.value.getBoundingClientRect(), b = d.y + d.height + 2, k = d.x, x = v.value, M = window.getComputedStyle(g.value);
|
|
1493
|
+
for (let B in M)
|
|
1494
|
+
/^(font|text)/.test(B) && (x.style[B] = M[B]);
|
|
1495
|
+
if (x.style.top = b + "px", x.style.left = k + "px", x.style.minWidth = d.width + "px", !M.maxHeight || M.maxHeight == "none") {
|
|
1496
|
+
const B = window.innerHeight - b - 12;
|
|
1497
|
+
x.style.maxHeight = B + "px";
|
|
1509
1498
|
}
|
|
1510
|
-
|
|
1499
|
+
x.style.visibility = "visible", document.body.appendChild(x), setTimeout(je, 0);
|
|
1511
1500
|
}
|
|
1512
1501
|
function je() {
|
|
1513
|
-
if (!T.value || !
|
|
1514
|
-
const
|
|
1515
|
-
k && (
|
|
1502
|
+
if (!T.value || !f.value) return;
|
|
1503
|
+
const d = D.value.findIndex((x) => x.key == f.value), b = v.value, k = b?.querySelectorAll(".option")[d];
|
|
1504
|
+
k && (b.scrollTop = k.offsetTop);
|
|
1516
1505
|
}
|
|
1517
|
-
function
|
|
1518
|
-
|
|
1506
|
+
function Dt(d) {
|
|
1507
|
+
f.value = d ? d.key : null;
|
|
1519
1508
|
}
|
|
1520
|
-
function
|
|
1521
|
-
const
|
|
1522
|
-
let k =
|
|
1523
|
-
if (k < 0 ? k = 0 : k >=
|
|
1524
|
-
|
|
1525
|
-
const
|
|
1526
|
-
M && (M.offsetTop <
|
|
1509
|
+
function we(d) {
|
|
1510
|
+
const b = D.value.findIndex((B) => B.key == f.value);
|
|
1511
|
+
let k = b + d;
|
|
1512
|
+
if (k < 0 ? k = 0 : k >= D.value.length && (k = D.value.length - 1), b == k) return;
|
|
1513
|
+
f.value = D.value[k].key;
|
|
1514
|
+
const x = v.value, M = x?.querySelectorAll(".option")[k];
|
|
1515
|
+
M && (M.offsetTop < x.scrollTop ? x.scrollTop = M.offsetTop : M.offsetTop + M.offsetHeight > x.scrollTop + x.clientHeight && (x.scrollTop = M.offsetTop + M.offsetHeight - x.clientHeight));
|
|
1527
1516
|
}
|
|
1528
|
-
function Ue(
|
|
1529
|
-
if (
|
|
1530
|
-
r.value = "", s.value = null,
|
|
1531
|
-
else if (
|
|
1532
|
-
const
|
|
1533
|
-
r.value = "", s.value = null,
|
|
1517
|
+
function Ue(d) {
|
|
1518
|
+
if (i.value = !1, d.key === a)
|
|
1519
|
+
r.value = "", s.value = null, u.value = null;
|
|
1520
|
+
else if (d.key === p) {
|
|
1521
|
+
const b = r.value.trim();
|
|
1522
|
+
r.value = "", s.value = null, u.value = null, l.onCreateItem?.(b);
|
|
1534
1523
|
} else {
|
|
1535
|
-
const k =
|
|
1536
|
-
s.value = k,
|
|
1524
|
+
const k = xe.value.find((x) => x.key == d.key).ref;
|
|
1525
|
+
s.value = k, u.value = Ve.value(k), r.value = u.value ?? "";
|
|
1537
1526
|
}
|
|
1538
1527
|
E.value?.blur(), ze();
|
|
1539
1528
|
}
|
|
1540
1529
|
function G() {
|
|
1541
|
-
|
|
1530
|
+
l.modelValue !== null ? (s.value = Z.value ? $e.value.find((d) => l.modelValue === Z.value(d)) : l.modelValue, u.value = Ye(s.value) ? Ve.value(s.value) : null, r.value = u.value ?? "") : (s.value = null, u.value = null, r.value = "");
|
|
1542
1531
|
}
|
|
1543
|
-
function
|
|
1544
|
-
n.value.unshift(
|
|
1532
|
+
function Ht(d) {
|
|
1533
|
+
n.value.unshift(d);
|
|
1545
1534
|
}
|
|
1546
1535
|
function ze() {
|
|
1547
|
-
if (!
|
|
1548
|
-
let
|
|
1549
|
-
for (;
|
|
1550
|
-
|
|
1551
|
-
if (!
|
|
1552
|
-
const
|
|
1553
|
-
if (!
|
|
1554
|
-
const k = Array.from(
|
|
1555
|
-
|
|
1536
|
+
if (!l.autoNext) return;
|
|
1537
|
+
let d = g.value?.parentElement;
|
|
1538
|
+
for (; d && d.tagName !== "FORM" && d.tagName !== "BODY"; )
|
|
1539
|
+
d = d.parentElement;
|
|
1540
|
+
if (!d) return;
|
|
1541
|
+
const b = d.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
1542
|
+
if (!b) return;
|
|
1543
|
+
const k = Array.from(b).findIndex((M) => M === E.value), x = b[k + 1];
|
|
1544
|
+
x && setTimeout(() => x.focus(), 0);
|
|
1556
1545
|
}
|
|
1557
1546
|
return Ut(() => {
|
|
1558
|
-
if (!
|
|
1559
|
-
const
|
|
1560
|
-
v.value?.querySelectorAll(".option").forEach((
|
|
1561
|
-
const k = new On(
|
|
1562
|
-
k.unmark(), k.mark(
|
|
1547
|
+
if (!h.value || !i.value || !r.value) return;
|
|
1548
|
+
const d = r.value.trim().replace(/[^a-z0-9 -]/gi, "").split(" ");
|
|
1549
|
+
v.value?.querySelectorAll(".option").forEach((b) => {
|
|
1550
|
+
const k = new On(b);
|
|
1551
|
+
k.unmark(), k.mark(d, {
|
|
1563
1552
|
done: () => {
|
|
1564
|
-
|
|
1553
|
+
b.innerHTML = b.innerHTML.replace(/ <mark /g, " <mark ").replace(/<\/mark> /g, "</mark> ");
|
|
1565
1554
|
}
|
|
1566
1555
|
});
|
|
1567
1556
|
});
|
|
1568
|
-
}), (
|
|
1557
|
+
}), (d, b) => (S(), I("div", {
|
|
1569
1558
|
ref_key: "el",
|
|
1570
1559
|
ref: g,
|
|
1571
|
-
class: P(["vf-smart-select", { disabled: F.value, open:
|
|
1560
|
+
class: P(["vf-smart-select", { disabled: F.value, open: h.value }])
|
|
1572
1561
|
}, [
|
|
1573
1562
|
fe(U("input", {
|
|
1574
1563
|
ref_key: "searchField",
|
|
1575
1564
|
ref: E,
|
|
1576
|
-
"onUpdate:modelValue":
|
|
1565
|
+
"onUpdate:modelValue": b[0] || (b[0] = (k) => r.value = k),
|
|
1577
1566
|
type: "text",
|
|
1578
1567
|
disabled: F.value,
|
|
1579
|
-
class: P({ nullable: !!
|
|
1568
|
+
class: P({ nullable: !!e.nullTitle }),
|
|
1580
1569
|
placeholder: Ee.value,
|
|
1581
|
-
required:
|
|
1582
|
-
name:
|
|
1570
|
+
required: e.required,
|
|
1571
|
+
name: e.name,
|
|
1583
1572
|
"data-1p-ignore": "",
|
|
1584
1573
|
onKeydown: Mt,
|
|
1585
1574
|
onPaste: Ct,
|
|
1586
1575
|
onFocus: Ot,
|
|
1587
1576
|
onBlur: Rt
|
|
1588
|
-
}, null, 42,
|
|
1577
|
+
}, null, 42, qn), [
|
|
1589
1578
|
[zt, r.value]
|
|
1590
1579
|
]),
|
|
1591
|
-
|
|
1580
|
+
h.value ? (S(), I("div", {
|
|
1592
1581
|
key: 0,
|
|
1593
1582
|
ref_key: "optionsContainer",
|
|
1594
1583
|
ref: v,
|
|
1595
|
-
class: P(["vf-smart-select-options", { grouped:
|
|
1584
|
+
class: P(["vf-smart-select-options", { grouped: Be.value }])
|
|
1596
1585
|
}, [
|
|
1597
1586
|
T.value ? (S(!0), I(he, { key: 1 }, pe(St.value, (k) => (S(), I("div", {
|
|
1598
1587
|
key: k.groupTitle,
|
|
1599
1588
|
class: "group"
|
|
1600
1589
|
}, [
|
|
1601
|
-
k.groupTitle ? (S(), I("div",
|
|
1602
|
-
K(
|
|
1590
|
+
k.groupTitle ? (S(), I("div", Kn, [
|
|
1591
|
+
K(d.$slots, "group", {
|
|
1603
1592
|
group: k.groupTitle
|
|
1604
1593
|
}, () => [
|
|
1605
1594
|
te(J(k.groupTitle), 1)
|
|
1606
1595
|
])
|
|
1607
1596
|
])) : W("", !0),
|
|
1608
|
-
(S(!0), I(he, null, pe(k.options, (
|
|
1609
|
-
key:
|
|
1610
|
-
class: P(["option", [
|
|
1611
|
-
onMousemove: (M) =>
|
|
1612
|
-
onMousedown: (M) => Ue(
|
|
1597
|
+
(S(!0), I(he, null, pe(k.options, (x) => (S(), I("div", {
|
|
1598
|
+
key: x.key,
|
|
1599
|
+
class: P(["option", [f.value === x.key && "highlighted", x.ref && e.classForOption?.(x.ref)]]),
|
|
1600
|
+
onMousemove: (M) => Dt(x),
|
|
1601
|
+
onMousedown: (M) => Ue(x)
|
|
1613
1602
|
}, [
|
|
1614
|
-
K(
|
|
1603
|
+
K(d.$slots, "option", { option: x }, () => [
|
|
1615
1604
|
U("div", {
|
|
1616
1605
|
class: "title",
|
|
1617
|
-
innerHTML:
|
|
1618
|
-
}, null, 8,
|
|
1619
|
-
|
|
1606
|
+
innerHTML: x.title
|
|
1607
|
+
}, null, 8, Xn),
|
|
1608
|
+
x.subtitle ? (S(), I("div", {
|
|
1620
1609
|
key: 0,
|
|
1621
1610
|
class: "subtitle",
|
|
1622
|
-
innerHTML:
|
|
1623
|
-
}, null, 8,
|
|
1611
|
+
innerHTML: x.subtitle
|
|
1612
|
+
}, null, 8, Zn)) : W("", !0)
|
|
1624
1613
|
])
|
|
1625
|
-
], 42,
|
|
1626
|
-
!
|
|
1627
|
-
K(
|
|
1628
|
-
te(J(
|
|
1614
|
+
], 42, Yn))), 128)),
|
|
1615
|
+
!D.value.length && r.value ? (S(), I("div", Gn, [
|
|
1616
|
+
K(d.$slots, "no-results", {}, () => [
|
|
1617
|
+
te(J(bt.value), 1)
|
|
1629
1618
|
])
|
|
1630
1619
|
])) : W("", !0)
|
|
1631
|
-
]))), 128)) : (S(), I("div",
|
|
1620
|
+
]))), 128)) : (S(), I("div", Jn, "Loading..."))
|
|
1632
1621
|
], 2)) : W("", !0)
|
|
1633
1622
|
], 2));
|
|
1634
1623
|
}
|
|
1635
|
-
}),
|
|
1624
|
+
}), pr = /* @__PURE__ */ q({
|
|
1636
1625
|
__name: "vf-ez-smart-select",
|
|
1637
1626
|
props: {
|
|
1638
1627
|
modelValue: {},
|
|
@@ -1644,39 +1633,39 @@ const zn = ["disabled", "placeholder", "required", "name"], qn = {
|
|
|
1644
1633
|
},
|
|
1645
1634
|
emits: ["update:modelValue"],
|
|
1646
1635
|
setup(e, { emit: t }) {
|
|
1647
|
-
const o = e,
|
|
1636
|
+
const o = e, a = O(() => Array.isArray(o.options) ? o.options.map((g) => ({ value: g, label: String(g) })) : Object.entries(o.options).map(([g, E]) => ({
|
|
1648
1637
|
value: g,
|
|
1649
1638
|
label: E
|
|
1650
|
-
}))),
|
|
1651
|
-
return
|
|
1639
|
+
}))), p = O(() => o.formatter ? (g) => o.formatter(g.label, g.value) : (g) => g.label), l = t, y = N(a.value.find((g) => g.value === o.modelValue) ?? null);
|
|
1640
|
+
return V(
|
|
1652
1641
|
() => o.modelValue,
|
|
1653
1642
|
(g) => {
|
|
1654
|
-
y.value =
|
|
1643
|
+
y.value = a.value.find((E) => E.value === g) ?? null;
|
|
1655
1644
|
}
|
|
1656
|
-
),
|
|
1657
|
-
const E = g ?
|
|
1658
|
-
|
|
1659
|
-
}), (g, E) => (S(), at(
|
|
1645
|
+
), V(y, (g) => {
|
|
1646
|
+
const E = g ? a.value.find((v) => Me(v, g))?.value : null;
|
|
1647
|
+
l("update:modelValue", E ?? null);
|
|
1648
|
+
}), (g, E) => (S(), at(eo, {
|
|
1660
1649
|
modelValue: y.value,
|
|
1661
1650
|
"onUpdate:modelValue": E[0] || (E[0] = (v) => y.value = v),
|
|
1662
|
-
options:
|
|
1663
|
-
formatter:
|
|
1664
|
-
"null-title":
|
|
1665
|
-
placeholder:
|
|
1666
|
-
name:
|
|
1651
|
+
options: a.value,
|
|
1652
|
+
formatter: p.value,
|
|
1653
|
+
"null-title": e.nullTitle,
|
|
1654
|
+
placeholder: e.placeholder,
|
|
1655
|
+
name: e.name
|
|
1667
1656
|
}, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
|
|
1668
1657
|
}
|
|
1669
1658
|
});
|
|
1670
|
-
function
|
|
1659
|
+
function vr() {
|
|
1671
1660
|
return N();
|
|
1672
1661
|
}
|
|
1673
|
-
const
|
|
1662
|
+
const to = { class: "content" }, no = { class: "message" }, oo = {
|
|
1674
1663
|
key: 0,
|
|
1675
1664
|
class: "close"
|
|
1676
|
-
},
|
|
1665
|
+
}, ro = {
|
|
1677
1666
|
key: 0,
|
|
1678
1667
|
class: "progress-bar"
|
|
1679
|
-
},
|
|
1668
|
+
}, io = /* @__PURE__ */ q({
|
|
1680
1669
|
__name: "vf-toast",
|
|
1681
1670
|
props: {
|
|
1682
1671
|
position: {},
|
|
@@ -1692,117 +1681,117 @@ const eo = { class: "content" }, to = { class: "message" }, no = {
|
|
|
1692
1681
|
function o() {
|
|
1693
1682
|
t.onClick ? (t.onClick(), t.callback()) : t.disableClose || t.callback();
|
|
1694
1683
|
}
|
|
1695
|
-
const
|
|
1684
|
+
const a = N();
|
|
1696
1685
|
return t.durationSecs !== null && z(() => {
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
duration:
|
|
1686
|
+
const p = t.durationSecs ?? 5;
|
|
1687
|
+
a.value?.animate([{ width: "0%" }, { width: "100%" }], {
|
|
1688
|
+
duration: p * 1e3,
|
|
1700
1689
|
easing: "linear"
|
|
1701
|
-
}), setTimeout(() => t.callback(),
|
|
1702
|
-
}), (
|
|
1703
|
-
class: P(["vf-toast", [
|
|
1690
|
+
}), setTimeout(() => t.callback(), p * 1e3);
|
|
1691
|
+
}), (p, l) => (S(), I("div", {
|
|
1692
|
+
class: P(["vf-toast", [e.className, { top: e.position === "top", bottom: e.position !== "top" }]]),
|
|
1704
1693
|
onClick: Ne(o, ["stop"])
|
|
1705
1694
|
}, [
|
|
1706
|
-
U("div",
|
|
1707
|
-
U("div",
|
|
1708
|
-
|
|
1695
|
+
U("div", to, [
|
|
1696
|
+
U("div", no, J(e.message), 1),
|
|
1697
|
+
e.disableClose ? W("", !0) : (S(), I("div", oo, "x"))
|
|
1709
1698
|
]),
|
|
1710
|
-
|
|
1699
|
+
e.durationSecs !== null ? (S(), I("div", ro, [
|
|
1711
1700
|
U("div", {
|
|
1712
1701
|
ref_key: "progressInnerEl",
|
|
1713
|
-
ref:
|
|
1702
|
+
ref: a,
|
|
1714
1703
|
class: "inner"
|
|
1715
1704
|
}, null, 512)
|
|
1716
1705
|
])) : W("", !0)
|
|
1717
1706
|
], 2));
|
|
1718
1707
|
}
|
|
1719
1708
|
});
|
|
1720
|
-
function
|
|
1721
|
-
const t = ge(
|
|
1709
|
+
function mr(e) {
|
|
1710
|
+
const t = ge(io, {
|
|
1722
1711
|
...e,
|
|
1723
1712
|
callback: () => ie(t)
|
|
1724
1713
|
});
|
|
1725
1714
|
return () => ie(t);
|
|
1726
1715
|
}
|
|
1727
|
-
function io(e) {
|
|
1728
|
-
const t = Math.floor(Math.log(e) / Math.log(1024)), i = (e / Math.pow(1024, t)).toFixed(2), f = ["B", "KB", "MB", "GB", "TB"][t];
|
|
1729
|
-
return `${i} ${f}`;
|
|
1730
|
-
}
|
|
1731
1716
|
function ao(e) {
|
|
1732
|
-
|
|
1717
|
+
const t = Math.floor(Math.log(e) / Math.log(1024)), a = (e / Math.pow(1024, t)).toFixed(2), p = ["B", "KB", "MB", "GB", "TB"][t];
|
|
1718
|
+
return `${a} ${p}`;
|
|
1733
1719
|
}
|
|
1734
1720
|
function so(e) {
|
|
1735
|
-
return e
|
|
1721
|
+
return e != null && String(e).length ? e : "-";
|
|
1736
1722
|
}
|
|
1737
1723
|
function lo(e) {
|
|
1738
|
-
return e
|
|
1724
|
+
return e || "-";
|
|
1739
1725
|
}
|
|
1740
1726
|
function uo(e) {
|
|
1741
|
-
return e &&
|
|
1727
|
+
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ln(Number(e));
|
|
1742
1728
|
}
|
|
1743
1729
|
function co(e) {
|
|
1730
|
+
return e && Un(e);
|
|
1731
|
+
}
|
|
1732
|
+
function fo(e) {
|
|
1744
1733
|
return e ? Zt(e) : null;
|
|
1745
1734
|
}
|
|
1746
1735
|
function vt(e) {
|
|
1747
1736
|
return e ? Xt(e) : null;
|
|
1748
1737
|
}
|
|
1749
|
-
function fo(e) {
|
|
1750
|
-
return e ? e.toUpperCase() : null;
|
|
1751
|
-
}
|
|
1752
1738
|
function ho(e) {
|
|
1753
|
-
return e ?
|
|
1739
|
+
return e ? e.toUpperCase() : null;
|
|
1754
1740
|
}
|
|
1755
1741
|
function po(e) {
|
|
1756
|
-
return e ?
|
|
1742
|
+
return e ? vt(e.toLowerCase()) : null;
|
|
1757
1743
|
}
|
|
1758
|
-
function vo(e
|
|
1759
|
-
return
|
|
1744
|
+
function vo(e) {
|
|
1745
|
+
return e ? jn(e) : null;
|
|
1760
1746
|
}
|
|
1761
1747
|
function mo(e, t) {
|
|
1762
|
-
return
|
|
1748
|
+
return zn(e, t);
|
|
1763
1749
|
}
|
|
1764
1750
|
function go(e, t) {
|
|
1765
|
-
return
|
|
1751
|
+
return _(e).divide(t).value;
|
|
1766
1752
|
}
|
|
1767
1753
|
function yo(e, t) {
|
|
1768
|
-
return e && X(new Date(e), t ??
|
|
1754
|
+
return e && X(new Date(e), t ?? H.defaultDateFormat);
|
|
1769
1755
|
}
|
|
1770
1756
|
function Eo(e, t) {
|
|
1771
|
-
return e && X(new Date(e), t ??
|
|
1757
|
+
return e && X(new Date(e), t ?? H.defaultTimeFormat);
|
|
1758
|
+
}
|
|
1759
|
+
function ko(e, t) {
|
|
1760
|
+
return e && X(new Date(e), t ?? `${H.defaultDateFormat} ${H.defaultTimeFormat}`);
|
|
1772
1761
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return e && X(nn(on(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1),
|
|
1762
|
+
function xo(e) {
|
|
1763
|
+
return e && X(nn(on(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), H.defaultDateFormat);
|
|
1775
1764
|
}
|
|
1776
1765
|
const Ze = {
|
|
1777
|
-
bytes:
|
|
1778
|
-
dash:
|
|
1779
|
-
dashZeros:
|
|
1780
|
-
number:
|
|
1781
|
-
phone:
|
|
1782
|
-
upperFirst:
|
|
1766
|
+
bytes: ao,
|
|
1767
|
+
dash: so,
|
|
1768
|
+
dashZeros: lo,
|
|
1769
|
+
number: uo,
|
|
1770
|
+
phone: co,
|
|
1771
|
+
upperFirst: fo,
|
|
1783
1772
|
startCase: vt,
|
|
1784
|
-
upperCase:
|
|
1785
|
-
upperWords:
|
|
1786
|
-
desnake:
|
|
1787
|
-
usCurrency:
|
|
1788
|
-
divide:
|
|
1789
|
-
date:
|
|
1790
|
-
time:
|
|
1791
|
-
dateTime:
|
|
1792
|
-
oneDayForward:
|
|
1793
|
-
},
|
|
1773
|
+
upperCase: ho,
|
|
1774
|
+
upperWords: po,
|
|
1775
|
+
desnake: vo,
|
|
1776
|
+
usCurrency: mo,
|
|
1777
|
+
divide: go,
|
|
1778
|
+
date: yo,
|
|
1779
|
+
time: Eo,
|
|
1780
|
+
dateTime: ko,
|
|
1781
|
+
oneDayForward: xo
|
|
1782
|
+
}, gr = (e) => ({
|
|
1794
1783
|
...Ze,
|
|
1795
1784
|
...e(Ze)
|
|
1796
1785
|
}), Ae = Symbol("HookState");
|
|
1797
|
-
function
|
|
1786
|
+
function yr(e, t) {
|
|
1798
1787
|
const o = t ?? Oe();
|
|
1799
1788
|
z(() => wo(o, e), o), st(() => bo(o), o), lt(() => Ge(o), o), me(() => Ge(o), o);
|
|
1800
1789
|
}
|
|
1801
1790
|
function wo(e, t) {
|
|
1802
1791
|
const o = {};
|
|
1803
1792
|
if (t.elScrolledToBottom && (o.el = new oe(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1793
|
+
const a = mt(e.vnode.el);
|
|
1794
|
+
a ? o.ancestor = new oe(a, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
1806
1795
|
}
|
|
1807
1796
|
t.windowScrolledToBottom && (o.window = new oe(window, t.windowScrolledToBottom)), e[Ae] = o;
|
|
1808
1797
|
}
|
|
@@ -1837,10 +1826,10 @@ class oe {
|
|
|
1837
1826
|
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);
|
|
1838
1827
|
}
|
|
1839
1828
|
}
|
|
1840
|
-
function
|
|
1829
|
+
function Er(e) {
|
|
1841
1830
|
z(() => window.addEventListener("resize", e)), st(() => window.addEventListener("resize", e)), lt(() => window.removeEventListener("resize", e)), me(() => window.removeEventListener("resize", e));
|
|
1842
1831
|
}
|
|
1843
|
-
const
|
|
1832
|
+
const To = {
|
|
1844
1833
|
mounted: et,
|
|
1845
1834
|
updated: et
|
|
1846
1835
|
}, Qe = Symbol("HasAutoFocused");
|
|
@@ -1850,33 +1839,33 @@ function et(e, t) {
|
|
|
1850
1839
|
const o = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1851
1840
|
setTimeout(() => o.focus(), 10);
|
|
1852
1841
|
}
|
|
1853
|
-
const
|
|
1854
|
-
mounted:
|
|
1842
|
+
const So = {
|
|
1843
|
+
mounted: Io
|
|
1855
1844
|
}, Q = Symbol("ConfirmState");
|
|
1856
|
-
function
|
|
1845
|
+
function Io(e, t) {
|
|
1857
1846
|
e.addEventListener("click", (o) => {
|
|
1858
|
-
const
|
|
1847
|
+
const a = Date.now(), p = t.value?.text !== void 0 ? t.value.text : "Confirm";
|
|
1859
1848
|
if (e[Q]) {
|
|
1860
|
-
if (
|
|
1849
|
+
if (a - e[Q].initTime < 300)
|
|
1861
1850
|
return;
|
|
1862
1851
|
e[Q].resetHandler(), e.dispatchEvent(new Event("confirm"));
|
|
1863
1852
|
return;
|
|
1864
1853
|
}
|
|
1865
1854
|
o.preventDefault(), o.stopImmediatePropagation();
|
|
1866
|
-
const
|
|
1867
|
-
initTime:
|
|
1855
|
+
const l = {
|
|
1856
|
+
initTime: a,
|
|
1868
1857
|
preconfirmHtml: e.innerHTML,
|
|
1869
1858
|
resetHandler: () => {
|
|
1870
|
-
|
|
1859
|
+
p && (e.innerHTML = l.preconfirmHtml), t.value?.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", l.resetHandler), delete e[Q];
|
|
1871
1860
|
}
|
|
1872
1861
|
};
|
|
1873
|
-
e[Q] =
|
|
1862
|
+
e[Q] = l, p && (e.innerHTML = p), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", l.resetHandler);
|
|
1874
1863
|
});
|
|
1875
1864
|
}
|
|
1876
|
-
const
|
|
1877
|
-
beforeMount:
|
|
1865
|
+
const Mo = {
|
|
1866
|
+
beforeMount: Co
|
|
1878
1867
|
};
|
|
1879
|
-
function
|
|
1868
|
+
function Co(e) {
|
|
1880
1869
|
e.addEventListener("blur", () => {
|
|
1881
1870
|
let t = e.value;
|
|
1882
1871
|
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + X(/* @__PURE__ */ new Date(), "yy"));
|
|
@@ -1884,105 +1873,105 @@ function Mo(e) {
|
|
|
1884
1873
|
isNaN(o) ? e.value = "" : e.value = X(o, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1885
1874
|
});
|
|
1886
1875
|
}
|
|
1887
|
-
const
|
|
1876
|
+
const Oo = {
|
|
1888
1877
|
beforeMount: tt,
|
|
1889
1878
|
updated: tt
|
|
1890
1879
|
};
|
|
1891
1880
|
function tt(e, t) {
|
|
1892
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1881
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = No(e, t));
|
|
1893
1882
|
}
|
|
1894
|
-
function
|
|
1883
|
+
function No(e, t) {
|
|
1895
1884
|
if (!t.value)
|
|
1896
1885
|
return e.attributes.getNamedItem("placeholder")?.value ?? "";
|
|
1897
1886
|
let o = "";
|
|
1898
|
-
const
|
|
1899
|
-
e.attributes.getNamedItem("display-utc") !== null &&
|
|
1887
|
+
const a = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), p = e.attributes.getNamedItem("local") !== null ? a.replace(/Z$/, "") : a.replace(/(Z|\+00:00)?$/, "Z"), l = new Date(p);
|
|
1888
|
+
e.attributes.getNamedItem("display-utc") !== null && l.setMinutes(l.getMinutes() - l.getTimezoneOffset());
|
|
1900
1889
|
let y = e.attributes.getNamedItem("format")?.value;
|
|
1901
1890
|
const g = e.attributes.getNamedItem("date-only") !== null;
|
|
1902
1891
|
if (!y && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1903
1892
|
const v = /* @__PURE__ */ new Date();
|
|
1904
|
-
v.getFullYear() ===
|
|
1893
|
+
v.getFullYear() === l.getFullYear() && v.getMonth() === l.getMonth() && v.getDate() === l.getDate() && (o = "at", y = "HH:mm");
|
|
1905
1894
|
}
|
|
1906
1895
|
if (!y && e.attributes.getNamedItem("simplified-date") !== null) {
|
|
1907
1896
|
let v = null;
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1910
|
-
const n = g ? null :
|
|
1897
|
+
const c = /* @__PURE__ */ new Date();
|
|
1898
|
+
c.getFullYear() === l.getFullYear() ? (c.getMonth() !== l.getMonth() || c.getDate() !== l.getDate()) && (v = "M/d") : v = "M/d/yy";
|
|
1899
|
+
const n = g ? null : H.defaultTimeFormat;
|
|
1911
1900
|
y = ut([v, n]).join(" ");
|
|
1912
1901
|
}
|
|
1913
|
-
y || (g ? y =
|
|
1914
|
-
let E = X(
|
|
1902
|
+
y || (g ? y = H.defaultDateFormat : y = `${H.defaultDateFormat} ${H.defaultTimeFormat}`);
|
|
1903
|
+
let E = X(l, y);
|
|
1915
1904
|
return o && (E = o + " " + E), E;
|
|
1916
1905
|
}
|
|
1917
|
-
const
|
|
1906
|
+
const Lo = {
|
|
1918
1907
|
beforeMount: nt,
|
|
1919
1908
|
updated: nt,
|
|
1920
|
-
unmounted:
|
|
1909
|
+
unmounted: Ro
|
|
1921
1910
|
};
|
|
1922
1911
|
function nt(e, t) {
|
|
1923
1912
|
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");
|
|
1924
1913
|
}
|
|
1925
|
-
function
|
|
1914
|
+
function Ro(e) {
|
|
1926
1915
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1927
1916
|
}
|
|
1928
|
-
const
|
|
1917
|
+
const Fo = {
|
|
1929
1918
|
beforeMount: ot,
|
|
1930
1919
|
updated: ot,
|
|
1931
1920
|
unmounted: yt
|
|
1932
|
-
}, ae = Symbol("HasAutoFocused"),
|
|
1933
|
-
function
|
|
1934
|
-
|
|
1921
|
+
}, ae = Symbol("HasAutoFocused"), De = [];
|
|
1922
|
+
function Ao() {
|
|
1923
|
+
De.forEach(gt);
|
|
1935
1924
|
}
|
|
1936
|
-
setInterval(
|
|
1925
|
+
setInterval(Ao, 1e3);
|
|
1937
1926
|
function ot(e, t) {
|
|
1938
1927
|
if (t.value == t.oldValue) return;
|
|
1939
1928
|
if (!t.value) return yt(e);
|
|
1940
|
-
const o = new Date(t.value),
|
|
1941
|
-
e[ae] ||
|
|
1942
|
-
startTs:
|
|
1943
|
-
includeSeconds:
|
|
1929
|
+
const o = new Date(t.value), a = e.attributes.getNamedItem("base-time")?.value, p = o.getTime() - (a ? new Date(a).getTime() - t.value * 1e3 : 0), l = e.getAttribute("no-seconds") === null;
|
|
1930
|
+
e[ae] || De.push(e), e[ae] = {
|
|
1931
|
+
startTs: p,
|
|
1932
|
+
includeSeconds: l
|
|
1944
1933
|
}, gt(e);
|
|
1945
1934
|
}
|
|
1946
1935
|
function gt(e) {
|
|
1947
1936
|
const t = e[ae], o = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1948
|
-
e.innerText =
|
|
1937
|
+
e.innerText = Do(o, t.includeSeconds);
|
|
1949
1938
|
}
|
|
1950
1939
|
function yt(e) {
|
|
1951
|
-
e[ae] && (Gt(
|
|
1952
|
-
}
|
|
1953
|
-
function Ao(e, t) {
|
|
1954
|
-
const o = [], i = Math.floor(e / 86400);
|
|
1955
|
-
i && o.push(i + "d"), e -= i * 86400;
|
|
1956
|
-
const f = Math.floor(e / 3600);
|
|
1957
|
-
(i || f) && o.push(f + "h"), e -= f * 3600;
|
|
1958
|
-
const u = Math.floor(e / 60);
|
|
1959
|
-
return (i || f || u) && o.push(u + "m"), t ? o.length || o.push("0m") : (e -= u * 60, o.push(e + "s")), o.join(" ");
|
|
1940
|
+
e[ae] && (Gt(De, e), delete e[ae]), e.innerText = "-";
|
|
1960
1941
|
}
|
|
1961
|
-
|
|
1942
|
+
function Do(e, t) {
|
|
1943
|
+
const o = [], a = Math.floor(e / 86400);
|
|
1944
|
+
a && o.push(a + "d"), e -= a * 86400;
|
|
1945
|
+
const p = Math.floor(e / 3600);
|
|
1946
|
+
(a || p) && o.push(p + "h"), e -= p * 3600;
|
|
1947
|
+
const l = Math.floor(e / 60);
|
|
1948
|
+
return (a || p || l) && o.push(l + "m"), t ? o.length || o.push("0m") : (e -= l * 60, o.push(e + "s")), o.join(" ");
|
|
1949
|
+
}
|
|
1950
|
+
const Ho = {
|
|
1962
1951
|
mounted: Et,
|
|
1963
|
-
updated:
|
|
1952
|
+
updated: Vo,
|
|
1964
1953
|
unmounted: kt
|
|
1965
1954
|
}, Y = /* @__PURE__ */ new Map();
|
|
1966
1955
|
function Et(e, t) {
|
|
1967
|
-
Y.size === 0 && window.addEventListener("keydown",
|
|
1956
|
+
Y.size === 0 && window.addEventListener("keydown", xt), Y.set(t.value.toLowerCase(), [...Y.get(t.value.toLowerCase()) ?? [], e]);
|
|
1968
1957
|
}
|
|
1969
1958
|
function kt(e, t) {
|
|
1970
1959
|
const o = Y.get(t.value.toLowerCase());
|
|
1971
1960
|
if (o) {
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1961
|
+
const a = o.indexOf(e);
|
|
1962
|
+
a !== -1 && o.splice(a, 1), o.length === 0 && Y.delete(t.value.toLowerCase());
|
|
1974
1963
|
}
|
|
1975
|
-
Y.size === 0 && window.removeEventListener("keydown",
|
|
1964
|
+
Y.size === 0 && window.removeEventListener("keydown", xt);
|
|
1976
1965
|
}
|
|
1977
|
-
function
|
|
1966
|
+
function Vo(e, t) {
|
|
1978
1967
|
kt(e, t), Et(e, t);
|
|
1979
1968
|
}
|
|
1980
|
-
function
|
|
1969
|
+
function xt(e) {
|
|
1981
1970
|
if (typeof e.key != "string") return;
|
|
1982
1971
|
const t = e.key.toLowerCase(), o = Y.get(t);
|
|
1983
1972
|
o && (Qt(o)?.click(), e.preventDefault());
|
|
1984
1973
|
}
|
|
1985
|
-
const ee = Symbol("InfiniteScrollHandler"),
|
|
1974
|
+
const ee = Symbol("InfiniteScrollHandler"), $o = {
|
|
1986
1975
|
mounted(e, t) {
|
|
1987
1976
|
e[ee] = new oe(e, t.value);
|
|
1988
1977
|
},
|
|
@@ -1992,14 +1981,14 @@ const ee = Symbol("InfiniteScrollHandler"), Ho = {
|
|
|
1992
1981
|
unmounted(e) {
|
|
1993
1982
|
e[ee]?.uninstall(), delete e[ee];
|
|
1994
1983
|
}
|
|
1995
|
-
},
|
|
1984
|
+
}, Bo = {
|
|
1996
1985
|
beforeMount: rt,
|
|
1997
1986
|
updated: rt
|
|
1998
1987
|
};
|
|
1999
1988
|
function rt(e, t) {
|
|
2000
1989
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
2001
1990
|
}
|
|
2002
|
-
const Ie = /* @__PURE__ */ new WeakMap(),
|
|
1991
|
+
const Ie = /* @__PURE__ */ new WeakMap(), _o = {
|
|
2003
1992
|
beforeMount(e) {
|
|
2004
1993
|
const t = new ResizeObserver(() => {
|
|
2005
1994
|
const o = e.clientWidth;
|
|
@@ -2011,26 +2000,26 @@ const Ie = /* @__PURE__ */ new WeakMap(), $o = {
|
|
|
2011
2000
|
const t = Ie.get(e);
|
|
2012
2001
|
t && (t.unobserve(e), Ie.delete(e));
|
|
2013
2002
|
}
|
|
2014
|
-
},
|
|
2003
|
+
}, Wo = {
|
|
2015
2004
|
mounted: it,
|
|
2016
2005
|
updated: it,
|
|
2017
|
-
unmounted:
|
|
2006
|
+
unmounted: wt
|
|
2018
2007
|
}, re = Symbol("TooltipState");
|
|
2019
2008
|
function it(e, t) {
|
|
2020
2009
|
let o = e.attributes.getNamedItem("tip")?.value ?? t.value;
|
|
2021
2010
|
if (t.value || (o = null), o) {
|
|
2022
|
-
const
|
|
2011
|
+
const a = {
|
|
2023
2012
|
content: o,
|
|
2024
2013
|
html: e.getAttribute("html") !== null
|
|
2025
2014
|
};
|
|
2026
|
-
e[re] ? e[re].configure(
|
|
2015
|
+
e[re] ? e[re].configure(a) : e[re] = new Po(e, a);
|
|
2027
2016
|
} else
|
|
2028
|
-
|
|
2017
|
+
wt(e);
|
|
2029
2018
|
}
|
|
2030
|
-
function
|
|
2019
|
+
function wt(e) {
|
|
2031
2020
|
e[re]?.destroy(), delete e[re];
|
|
2032
2021
|
}
|
|
2033
|
-
class
|
|
2022
|
+
class Po {
|
|
2034
2023
|
constructor(t, o) {
|
|
2035
2024
|
this.el = t, this.config = o, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
2036
2025
|
}
|
|
@@ -2066,9 +2055,9 @@ class Wo {
|
|
|
2066
2055
|
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);
|
|
2067
2056
|
}
|
|
2068
2057
|
handleMouseMove(t) {
|
|
2069
|
-
const o = this.tipEl.offsetWidth,
|
|
2058
|
+
const o = this.tipEl.offsetWidth, a = this.tipEl.offsetHeight, p = window.innerWidth, l = window.innerHeight;
|
|
2070
2059
|
let y = t.pageX + 10, g = t.pageY + 20;
|
|
2071
|
-
y + o >
|
|
2060
|
+
y + o > p && (y = Math.max(10, t.pageX - 5 - o)), g + a > l && (g = Math.max(10, t.pageY - 5 - a)), this.tipEl.style.left = y + "px", this.tipEl.style.top = g + "px", this.lastMoveEvt = t;
|
|
2072
2061
|
}
|
|
2073
2062
|
checkMoveEvent() {
|
|
2074
2063
|
this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
|
|
@@ -2077,64 +2066,64 @@ class Wo {
|
|
|
2077
2066
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
2078
2067
|
}
|
|
2079
2068
|
}
|
|
2080
|
-
function
|
|
2081
|
-
e.directive("autofocus",
|
|
2069
|
+
function jo(e) {
|
|
2070
|
+
e.directive("autofocus", To), e.directive("confirm-button", So), e.directive("date-input", Mo), e.directive("datetime", Oo), e.directive("disabled", Lo), e.directive("duration", Fo), e.directive("hotkey", Ho), e.directive("infinite-scroll", $o), e.directive("readonly", Bo), e.directive("tooltip", Wo), e.directive("sticky-min-width", _o);
|
|
2082
2071
|
}
|
|
2083
|
-
function
|
|
2084
|
-
|
|
2072
|
+
function kr(e) {
|
|
2073
|
+
jo(e);
|
|
2085
2074
|
}
|
|
2086
2075
|
export {
|
|
2087
|
-
|
|
2076
|
+
Xo as OverlayContainer,
|
|
2088
2077
|
ye as UserError,
|
|
2089
|
-
|
|
2078
|
+
Ko as VfAjaxSelect,
|
|
2090
2079
|
le as VfAlertModal,
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2080
|
+
pr as VfEzSmartSelect,
|
|
2081
|
+
wn as VfModal,
|
|
2082
|
+
eo as VfSmartSelect,
|
|
2083
|
+
ur as cloneProp,
|
|
2084
|
+
Yo as configureVf,
|
|
2085
|
+
dr as configureVfOpenApiClient,
|
|
2086
|
+
gr as createFilters,
|
|
2098
2087
|
ge as createOverlayInjection,
|
|
2099
|
-
|
|
2088
|
+
jn as desnakeCase,
|
|
2100
2089
|
dn as dismissOverlayInjectionById,
|
|
2101
|
-
|
|
2090
|
+
Zo as dismissOverlayInjectionByInstance,
|
|
2102
2091
|
ct as dismissOverlayInjectionByInternalInstance,
|
|
2103
2092
|
cn as dismissOverlayInjectionByVnode,
|
|
2104
2093
|
br as escapeHtml,
|
|
2105
2094
|
pn as formatError,
|
|
2106
2095
|
Ln as formatNumber,
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2096
|
+
Un as formatPhone,
|
|
2097
|
+
zn as formatUSCurrency,
|
|
2098
|
+
or as handleError,
|
|
2099
|
+
nr as handleErrorAndAlert,
|
|
2100
|
+
kr as installVf,
|
|
2112
2101
|
vn as isError,
|
|
2113
2102
|
Ye as isNotNullOrUndefined,
|
|
2114
|
-
|
|
2103
|
+
rr as maskComponent,
|
|
2115
2104
|
mn as maskEl,
|
|
2116
2105
|
gn as maskForm,
|
|
2117
|
-
|
|
2118
|
-
|
|
2106
|
+
fr as nl2br,
|
|
2107
|
+
cr as nullifyEmptyInputs,
|
|
2119
2108
|
Le as presentOverlay,
|
|
2120
2109
|
ie as removeOverlayInjection,
|
|
2121
|
-
|
|
2110
|
+
ar as replaceElement,
|
|
2122
2111
|
hn as showAlert,
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2112
|
+
Go as showConfirm,
|
|
2113
|
+
Qo as showConfirmDestroy,
|
|
2114
|
+
sr as showContextMenu,
|
|
2115
|
+
tr as showMutableWait,
|
|
2116
|
+
mr as showToast,
|
|
2117
|
+
er as showWait,
|
|
2129
2118
|
Nn as sleep,
|
|
2130
|
-
|
|
2119
|
+
lr as sleepSecs,
|
|
2131
2120
|
Re as toError,
|
|
2132
|
-
|
|
2121
|
+
ir as unmaskComponent,
|
|
2133
2122
|
dt as unmaskEl,
|
|
2134
2123
|
ft as unmaskForm,
|
|
2135
2124
|
fn as updateOverlayProps,
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2125
|
+
yr as useInfiniteScroll,
|
|
2126
|
+
Er as useResizeWatcher,
|
|
2127
|
+
hr as uuid,
|
|
2128
|
+
vr as vfModalRef
|
|
2140
2129
|
};
|