@signal24/vue-foundation 4.29.8 → 4.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +805 -817
- package/package.json +24 -24
- package/src/components/overlay-container.ts +2 -2
- package/src/components/vf-smart-select.vue +3 -3
- package/src/directives/sticky-min-width.ts +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as N, computed as O, watch as H, onMounted as z, createElementBlock as I, withDirectives as fe, openBlock as
|
|
1
|
+
import { defineComponent as q, ref as N, computed as O, watch as H, onMounted as z, createElementBlock as I, withDirectives as fe, openBlock as T, createElementVNode as U, toDisplayString as J, createCommentVNode as W, Fragment as he, renderList as pe, vModelSelect as Ht, getCurrentInstance as Oe, withModifiers as Ne, normalizeStyle as Vt, 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
|
H(() => o.loadFn, g), H(
|
|
29
29
|
() => o.modelValue,
|
|
30
30
|
() => y.value = o.modelValue
|
|
31
|
-
), H(y, () =>
|
|
31
|
+
), H(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((T(), 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
|
-
o.nullText ? (
|
|
40
|
-
(
|
|
39
|
+
o.nullText ? (T(), I("option", an, J(o.nullText), 1)) : W("", !0),
|
|
40
|
+
(T(!0), I(he, null, pe(l.value, (c, n) => (T(), 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
|
[Ht, y.value]
|
|
46
|
-
]) : (
|
|
46
|
+
]) : (T(), I("select", rn, [
|
|
47
47
|
U("option", null, J(o.loadingText || "Loading..."), 1)
|
|
48
48
|
]));
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), $ = {
|
|
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($, 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: Vt(
|
|
108
|
+
}), (v, c) => (T(), I("div", {
|
|
109
|
+
class: P(["vf-overlay-anchor", p.value]),
|
|
110
|
+
style: Vt(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 =
|
|
118
|
+
const j = Bt([]);
|
|
119
119
|
H(j, () => {
|
|
120
|
-
|
|
120
|
+
$.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, ${$.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 || $.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 || $.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) => (T(), 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 ? (T(), I("div", En, [
|
|
368
|
+
K(u.$slots, "header"),
|
|
369
|
+
a.closeX ? (T(), 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 ? (T(), 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"], Sn = ["innerText"], le = /* @__PURE__ */ q({
|
|
385
385
|
__name: "vf-alert-modal",
|
|
386
386
|
props: {
|
|
387
387
|
isBare: { type: Boolean },
|
|
@@ -395,59 +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
|
|
401
|
-
class: P(["vf-alert", ...
|
|
398
|
+
return (a, p) => {
|
|
399
|
+
const l = Pt("autofocus");
|
|
400
|
+
return T(), at(wn, {
|
|
401
|
+
class: P(["vf-alert", ...e.classes ?? []]),
|
|
402
402
|
scrolls: ""
|
|
403
403
|
}, jt({
|
|
404
|
-
default:
|
|
405
|
-
|
|
404
|
+
default: be(() => [
|
|
405
|
+
e.iconClass ? (T(), I("i", {
|
|
406
406
|
key: 0,
|
|
407
|
-
class: P(["vf-alert-icon",
|
|
407
|
+
class: P(["vf-alert-icon", e.iconClass])
|
|
408
408
|
}, null, 2)) : W("", !0),
|
|
409
|
-
|
|
409
|
+
e.isHtml ? (T(), I("div", {
|
|
410
410
|
key: 1,
|
|
411
|
-
innerHtml:
|
|
411
|
+
innerHtml: e.message,
|
|
412
412
|
class: "user-message"
|
|
413
|
-
}, null, 8,
|
|
413
|
+
}, null, 8, bn)) : (T(), I("div", {
|
|
414
414
|
key: 2,
|
|
415
415
|
innerText: o.value
|
|
416
|
-
}, null, 8,
|
|
416
|
+
}, null, 8, Sn))
|
|
417
417
|
]),
|
|
418
418
|
_: 2
|
|
419
419
|
}, [
|
|
420
|
-
|
|
420
|
+
e.title ? {
|
|
421
421
|
name: "header",
|
|
422
|
-
fn:
|
|
423
|
-
te(J(
|
|
422
|
+
fn: be(() => [
|
|
423
|
+
te(J(e.title), 1)
|
|
424
424
|
]),
|
|
425
425
|
key: "0"
|
|
426
426
|
} : void 0,
|
|
427
|
-
|
|
427
|
+
e.isBare ? void 0 : {
|
|
428
428
|
name: "footer",
|
|
429
|
-
fn:
|
|
430
|
-
|
|
431
|
-
fe((
|
|
429
|
+
fn: be(() => [
|
|
430
|
+
e.shouldConfirm ? (T(), I(he, { key: 0 }, [
|
|
431
|
+
fe((T(), I("button", {
|
|
432
432
|
class: "primary",
|
|
433
|
-
onClick:
|
|
434
|
-
},
|
|
435
|
-
te("Confirm")
|
|
436
|
-
]))), [
|
|
437
|
-
[
|
|
433
|
+
onClick: p[0] || (p[0] = () => e.callback(!0))
|
|
434
|
+
}, [...p[3] || (p[3] = [
|
|
435
|
+
te("Confirm", -1)
|
|
436
|
+
])])), [
|
|
437
|
+
[l]
|
|
438
438
|
]),
|
|
439
439
|
U("button", {
|
|
440
440
|
class: "default",
|
|
441
|
-
onClick:
|
|
441
|
+
onClick: p[1] || (p[1] = () => e.callback(!1))
|
|
442
442
|
}, "Cancel")
|
|
443
|
-
], 64)) : fe((
|
|
443
|
+
], 64)) : fe((T(), I("button", {
|
|
444
444
|
key: 1,
|
|
445
445
|
class: "default",
|
|
446
|
-
onClick:
|
|
447
|
-
},
|
|
448
|
-
te("OK")
|
|
449
|
-
]))), [
|
|
450
|
-
[
|
|
446
|
+
onClick: p[2] || (p[2] = () => e.callback(!0))
|
|
447
|
+
}, [...p[4] || (p[4] = [
|
|
448
|
+
te("OK", -1)
|
|
449
|
+
])])), [
|
|
450
|
+
[l]
|
|
451
451
|
])
|
|
452
452
|
]),
|
|
453
453
|
key: "1"
|
|
@@ -456,139 +456,133 @@ const yn = ["id"], En = {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
|
-
function
|
|
459
|
+
function Tn(e) {
|
|
460
460
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
461
461
|
}
|
|
462
462
|
var ce = { exports: {} };
|
|
463
|
-
/*!***************************************************
|
|
464
|
-
* mark.js v8.11.1
|
|
465
|
-
* https://markjs.io/
|
|
466
|
-
* Copyright (c) 2014–2018, Julian Kühnel
|
|
467
|
-
* Released under the MIT license https://git.io/vwTVl
|
|
468
|
-
*****************************************************/
|
|
469
463
|
var In = ce.exports, Ke;
|
|
470
464
|
function Mn() {
|
|
471
|
-
return Ke || (Ke = 1, function(e, t) {
|
|
472
|
-
(function(o,
|
|
473
|
-
e.exports =
|
|
474
|
-
})(In, function() {
|
|
465
|
+
return Ke || (Ke = 1, (function(e, t) {
|
|
466
|
+
(function(o, a) {
|
|
467
|
+
e.exports = a();
|
|
468
|
+
})(In, (function() {
|
|
475
469
|
var o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
|
|
476
470
|
return typeof v;
|
|
477
471
|
} : function(v) {
|
|
478
472
|
return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
|
|
479
|
-
},
|
|
480
|
-
if (!(v instanceof
|
|
473
|
+
}, a = function(v, c) {
|
|
474
|
+
if (!(v instanceof c))
|
|
481
475
|
throw new TypeError("Cannot call a class as a function");
|
|
482
|
-
},
|
|
483
|
-
function v(
|
|
484
|
-
for (var
|
|
485
|
-
var r = n[
|
|
486
|
-
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);
|
|
487
481
|
}
|
|
488
482
|
}
|
|
489
|
-
return function(
|
|
490
|
-
return n && v(
|
|
483
|
+
return function(c, n, i) {
|
|
484
|
+
return n && v(c.prototype, n), i && v(c, i), c;
|
|
491
485
|
};
|
|
492
|
-
}(),
|
|
493
|
-
for (var
|
|
494
|
-
var n = arguments[
|
|
495
|
-
for (var
|
|
496
|
-
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]);
|
|
497
491
|
}
|
|
498
492
|
return v;
|
|
499
|
-
}, y = function() {
|
|
500
|
-
function v(
|
|
501
|
-
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0,
|
|
502
|
-
|
|
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;
|
|
503
497
|
}
|
|
504
|
-
return
|
|
498
|
+
return p(v, [{
|
|
505
499
|
key: "getContexts",
|
|
506
500
|
value: function() {
|
|
507
|
-
var n = void 0,
|
|
501
|
+
var n = void 0, i = [];
|
|
508
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) {
|
|
509
|
-
var s =
|
|
510
|
-
return
|
|
503
|
+
var s = i.filter(function(u) {
|
|
504
|
+
return u.contains(r);
|
|
511
505
|
}).length > 0;
|
|
512
|
-
|
|
513
|
-
}),
|
|
506
|
+
i.indexOf(r) === -1 && !s && i.push(r);
|
|
507
|
+
}), i;
|
|
514
508
|
}
|
|
515
509
|
}, {
|
|
516
510
|
key: "getIframeContents",
|
|
517
|
-
value: function(n,
|
|
511
|
+
value: function(n, i) {
|
|
518
512
|
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
|
|
519
513
|
}, s = void 0;
|
|
520
514
|
try {
|
|
521
|
-
var
|
|
522
|
-
if (s =
|
|
515
|
+
var u = n.contentWindow;
|
|
516
|
+
if (s = u.document, !u || !s)
|
|
523
517
|
throw new Error("iframe inaccessible");
|
|
524
518
|
} catch {
|
|
525
519
|
r();
|
|
526
520
|
}
|
|
527
|
-
s &&
|
|
521
|
+
s && i(s);
|
|
528
522
|
}
|
|
529
523
|
}, {
|
|
530
524
|
key: "isIframeBlank",
|
|
531
525
|
value: function(n) {
|
|
532
|
-
var
|
|
533
|
-
return s ===
|
|
526
|
+
var i = "about:blank", r = n.getAttribute("src").trim(), s = n.contentWindow.location.href;
|
|
527
|
+
return s === i && r !== i && r;
|
|
534
528
|
}
|
|
535
529
|
}, {
|
|
536
530
|
key: "observeIframeLoad",
|
|
537
|
-
value: function(n,
|
|
538
|
-
var s = this,
|
|
539
|
-
if (!
|
|
540
|
-
|
|
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);
|
|
541
535
|
try {
|
|
542
|
-
s.isIframeBlank(n) || (n.removeEventListener("load", m), s.getIframeContents(n,
|
|
536
|
+
s.isIframeBlank(n) || (n.removeEventListener("load", m), s.getIframeContents(n, i, r));
|
|
543
537
|
} catch {
|
|
544
538
|
r();
|
|
545
539
|
}
|
|
546
540
|
}
|
|
547
541
|
};
|
|
548
|
-
n.addEventListener("load",
|
|
542
|
+
n.addEventListener("load", f), h = setTimeout(f, this.iframesTimeout);
|
|
549
543
|
}
|
|
550
544
|
}, {
|
|
551
545
|
key: "onIframeReady",
|
|
552
|
-
value: function(n,
|
|
546
|
+
value: function(n, i, r) {
|
|
553
547
|
try {
|
|
554
|
-
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);
|
|
555
549
|
} catch {
|
|
556
550
|
r();
|
|
557
551
|
}
|
|
558
552
|
}
|
|
559
553
|
}, {
|
|
560
554
|
key: "waitForIframes",
|
|
561
|
-
value: function(n,
|
|
555
|
+
value: function(n, i) {
|
|
562
556
|
var r = this, s = 0;
|
|
563
557
|
this.forEachIframe(n, function() {
|
|
564
558
|
return !0;
|
|
565
|
-
}, function(
|
|
566
|
-
s++, r.waitForIframes(
|
|
567
|
-
--s ||
|
|
559
|
+
}, function(u) {
|
|
560
|
+
s++, r.waitForIframes(u.querySelector("html"), function() {
|
|
561
|
+
--s || i();
|
|
568
562
|
});
|
|
569
|
-
}, function(
|
|
570
|
-
|
|
563
|
+
}, function(u) {
|
|
564
|
+
u || i();
|
|
571
565
|
});
|
|
572
566
|
}
|
|
573
567
|
}, {
|
|
574
568
|
key: "forEachIframe",
|
|
575
|
-
value: function(n,
|
|
576
|
-
var s = this,
|
|
577
|
-
},
|
|
578
|
-
|
|
579
|
-
var
|
|
580
|
-
--
|
|
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);
|
|
581
575
|
};
|
|
582
|
-
|
|
583
|
-
v.matches(
|
|
584
|
-
|
|
585
|
-
},
|
|
576
|
+
f || w(), h.forEach(function(S) {
|
|
577
|
+
v.matches(S, s.exclude) ? w() : s.onIframeReady(S, function(C) {
|
|
578
|
+
i(S) && (m++, r(C)), w();
|
|
579
|
+
}, w);
|
|
586
580
|
});
|
|
587
581
|
}
|
|
588
582
|
}, {
|
|
589
583
|
key: "createIterator",
|
|
590
|
-
value: function(n,
|
|
591
|
-
return document.createNodeIterator(n,
|
|
584
|
+
value: function(n, i, r) {
|
|
585
|
+
return document.createNodeIterator(n, i, r, !1);
|
|
592
586
|
}
|
|
593
587
|
}, {
|
|
594
588
|
key: "createInstanceOnIframe",
|
|
@@ -597,12 +591,12 @@ function Mn() {
|
|
|
597
591
|
}
|
|
598
592
|
}, {
|
|
599
593
|
key: "compareNodeIframe",
|
|
600
|
-
value: function(n,
|
|
601
|
-
var s = n.compareDocumentPosition(r),
|
|
602
|
-
if (s &
|
|
603
|
-
if (
|
|
604
|
-
var
|
|
605
|
-
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)
|
|
606
600
|
return !0;
|
|
607
601
|
} else
|
|
608
602
|
return !0;
|
|
@@ -611,92 +605,92 @@ function Mn() {
|
|
|
611
605
|
}, {
|
|
612
606
|
key: "getIteratorNode",
|
|
613
607
|
value: function(n) {
|
|
614
|
-
var
|
|
615
|
-
return
|
|
616
|
-
prevNode:
|
|
608
|
+
var i = n.previousNode(), r = void 0;
|
|
609
|
+
return i === null ? r = n.nextNode() : r = n.nextNode() && n.nextNode(), {
|
|
610
|
+
prevNode: i,
|
|
617
611
|
node: r
|
|
618
612
|
};
|
|
619
613
|
}
|
|
620
614
|
}, {
|
|
621
615
|
key: "checkIframeFilter",
|
|
622
|
-
value: function(n,
|
|
623
|
-
var
|
|
624
|
-
return s.forEach(function(
|
|
625
|
-
|
|
626
|
-
}), 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({
|
|
627
621
|
val: r,
|
|
628
622
|
handled: !0
|
|
629
|
-
}) :
|
|
623
|
+
}) : u !== !1 && !h && (s[u].handled = !0), !0) : (u === !1 && s.push({
|
|
630
624
|
val: r,
|
|
631
625
|
handled: !1
|
|
632
626
|
}), !1);
|
|
633
627
|
}
|
|
634
628
|
}, {
|
|
635
629
|
key: "handleOpenIframes",
|
|
636
|
-
value: function(n,
|
|
637
|
-
var
|
|
638
|
-
n.forEach(function(
|
|
639
|
-
|
|
640
|
-
|
|
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);
|
|
641
635
|
});
|
|
642
636
|
});
|
|
643
637
|
}
|
|
644
638
|
}, {
|
|
645
639
|
key: "iterateThroughNodes",
|
|
646
|
-
value: function(n,
|
|
647
|
-
for (var
|
|
648
|
-
var F =
|
|
649
|
-
return C = F.prevNode,
|
|
640
|
+
value: function(n, i, r, s, u) {
|
|
641
|
+
for (var h = this, f = this.createIterator(i, n, s), m = [], w = [], S = void 0, C = void 0, L = function() {
|
|
642
|
+
var F = h.getIteratorNode(f);
|
|
643
|
+
return C = F.prevNode, S = F.node, S;
|
|
650
644
|
}; L(); )
|
|
651
|
-
this.iframes && this.forEachIframe(
|
|
652
|
-
return
|
|
645
|
+
this.iframes && this.forEachIframe(i, function(R) {
|
|
646
|
+
return h.checkIframeFilter(S, C, R, m);
|
|
653
647
|
}, function(R) {
|
|
654
|
-
|
|
655
|
-
return
|
|
648
|
+
h.createInstanceOnIframe(R).forEachNode(n, function(F) {
|
|
649
|
+
return w.push(F);
|
|
656
650
|
}, s);
|
|
657
|
-
}),
|
|
658
|
-
|
|
651
|
+
}), w.push(S);
|
|
652
|
+
w.forEach(function(R) {
|
|
659
653
|
r(R);
|
|
660
|
-
}), this.iframes && this.handleOpenIframes(m, n, r, s),
|
|
654
|
+
}), this.iframes && this.handleOpenIframes(m, n, r, s), u();
|
|
661
655
|
}
|
|
662
656
|
}, {
|
|
663
657
|
key: "forEachNode",
|
|
664
|
-
value: function(n,
|
|
665
|
-
var s = this,
|
|
666
|
-
},
|
|
667
|
-
|
|
668
|
-
var
|
|
669
|
-
s.iterateThroughNodes(n, m,
|
|
670
|
-
--
|
|
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();
|
|
671
665
|
});
|
|
672
666
|
};
|
|
673
|
-
s.iframes ? s.waitForIframes(m,
|
|
667
|
+
s.iframes ? s.waitForIframes(m, w) : w();
|
|
674
668
|
});
|
|
675
669
|
}
|
|
676
670
|
}], [{
|
|
677
671
|
key: "matches",
|
|
678
|
-
value: function(n,
|
|
679
|
-
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;
|
|
680
674
|
if (s) {
|
|
681
|
-
var
|
|
682
|
-
return r.every(function(
|
|
683
|
-
return s.call(n,
|
|
684
|
-
}),
|
|
675
|
+
var u = !1;
|
|
676
|
+
return r.every(function(h) {
|
|
677
|
+
return s.call(n, h) ? (u = !0, !1) : !0;
|
|
678
|
+
}), u;
|
|
685
679
|
} else
|
|
686
680
|
return !1;
|
|
687
681
|
}
|
|
688
682
|
}]), v;
|
|
689
|
-
}(), g = function() {
|
|
690
|
-
function v(
|
|
691
|
-
|
|
683
|
+
})(), g = (function() {
|
|
684
|
+
function v(c) {
|
|
685
|
+
a(this, v), this.ctx = c, this.ie = !1;
|
|
692
686
|
var n = window.navigator.userAgent;
|
|
693
687
|
(n.indexOf("MSIE") > -1 || n.indexOf("Trident") > -1) && (this.ie = !0);
|
|
694
688
|
}
|
|
695
|
-
return
|
|
689
|
+
return p(v, [{
|
|
696
690
|
key: "log",
|
|
697
691
|
value: function(n) {
|
|
698
|
-
var
|
|
699
|
-
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);
|
|
700
694
|
}
|
|
701
695
|
}, {
|
|
702
696
|
key: "escapeStr",
|
|
@@ -711,11 +705,11 @@ function Mn() {
|
|
|
711
705
|
}, {
|
|
712
706
|
key: "createSynonymsRegExp",
|
|
713
707
|
value: function(n) {
|
|
714
|
-
var
|
|
715
|
-
for (var
|
|
716
|
-
if (
|
|
717
|
-
var
|
|
718
|
-
|
|
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));
|
|
719
713
|
}
|
|
720
714
|
return n;
|
|
721
715
|
}
|
|
@@ -727,42 +721,42 @@ function Mn() {
|
|
|
727
721
|
}, {
|
|
728
722
|
key: "setupWildcardsRegExp",
|
|
729
723
|
value: function(n) {
|
|
730
|
-
return n = n.replace(/(?:\\)*\?/g, function(
|
|
731
|
-
return
|
|
732
|
-
}), n.replace(/(?:\\)*\*/g, function(
|
|
733
|
-
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) === "\\" ? "*" : "";
|
|
734
728
|
});
|
|
735
729
|
}
|
|
736
730
|
}, {
|
|
737
731
|
key: "createWildcardsRegExp",
|
|
738
732
|
value: function(n) {
|
|
739
|
-
var
|
|
740
|
-
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*");
|
|
741
735
|
}
|
|
742
736
|
}, {
|
|
743
737
|
key: "setupIgnoreJoinersRegExp",
|
|
744
738
|
value: function(n) {
|
|
745
|
-
return n.replace(/[^(|)\\]/g, function(
|
|
746
|
-
var
|
|
747
|
-
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";
|
|
748
742
|
});
|
|
749
743
|
}
|
|
750
744
|
}, {
|
|
751
745
|
key: "createJoinersRegExp",
|
|
752
746
|
value: function(n) {
|
|
753
|
-
var
|
|
754
|
-
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;
|
|
755
749
|
}
|
|
756
750
|
}, {
|
|
757
751
|
key: "createDiacriticsRegExp",
|
|
758
752
|
value: function(n) {
|
|
759
|
-
var
|
|
760
|
-
return n.split("").forEach(function(
|
|
761
|
-
r.every(function(
|
|
762
|
-
if (
|
|
763
|
-
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)
|
|
764
758
|
return !1;
|
|
765
|
-
n = n.replace(new RegExp("[" +
|
|
759
|
+
n = n.replace(new RegExp("[" + h + "]", "gm" + i), "[" + h + "]"), s.push(h);
|
|
766
760
|
}
|
|
767
761
|
return !0;
|
|
768
762
|
});
|
|
@@ -776,30 +770,30 @@ function Mn() {
|
|
|
776
770
|
}, {
|
|
777
771
|
key: "createAccuracyRegExp",
|
|
778
772
|
value: function(n) {
|
|
779
|
-
var
|
|
780
|
-
switch (
|
|
781
|
-
|
|
782
|
-
}),
|
|
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) {
|
|
783
777
|
case "partially":
|
|
784
778
|
default:
|
|
785
779
|
return "()(" + n + ")";
|
|
786
780
|
case "complementary":
|
|
787
|
-
return
|
|
781
|
+
return f = "\\s" + (f || this.escapeStr(r)), "()([^" + f + "]*" + n + "[^" + f + "]*)";
|
|
788
782
|
case "exactly":
|
|
789
|
-
return "(^|\\s" +
|
|
783
|
+
return "(^|\\s" + f + ")(" + n + ")(?=$|\\s" + f + ")";
|
|
790
784
|
}
|
|
791
785
|
}
|
|
792
786
|
}, {
|
|
793
787
|
key: "getSeparatedKeywords",
|
|
794
788
|
value: function(n) {
|
|
795
|
-
var
|
|
789
|
+
var i = this, r = [];
|
|
796
790
|
return n.forEach(function(s) {
|
|
797
|
-
|
|
798
|
-
|
|
791
|
+
i.opt.separateWordSearch ? s.split(" ").forEach(function(u) {
|
|
792
|
+
u.trim() && r.indexOf(u) === -1 && r.push(u);
|
|
799
793
|
}) : s.trim() && r.indexOf(s) === -1 && r.push(s);
|
|
800
794
|
}), {
|
|
801
|
-
keywords: r.sort(function(s,
|
|
802
|
-
return
|
|
795
|
+
keywords: r.sort(function(s, u) {
|
|
796
|
+
return u.length - s.length;
|
|
803
797
|
}),
|
|
804
798
|
length: r.length
|
|
805
799
|
};
|
|
@@ -812,49 +806,49 @@ function Mn() {
|
|
|
812
806
|
}, {
|
|
813
807
|
key: "checkRanges",
|
|
814
808
|
value: function(n) {
|
|
815
|
-
var
|
|
809
|
+
var i = this;
|
|
816
810
|
if (!Array.isArray(n) || Object.prototype.toString.call(n[0]) !== "[object Object]")
|
|
817
811
|
return this.log("markRanges() will only accept an array of objects"), this.opt.noMatch(n), [];
|
|
818
812
|
var r = [], s = 0;
|
|
819
|
-
return n.sort(function(
|
|
820
|
-
return
|
|
821
|
-
}).forEach(function(
|
|
822
|
-
var
|
|
823
|
-
|
|
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);
|
|
824
818
|
}), r;
|
|
825
819
|
}
|
|
826
820
|
}, {
|
|
827
821
|
key: "callNoMatchOnInvalidRanges",
|
|
828
|
-
value: function(n,
|
|
829
|
-
var r = void 0, s = void 0,
|
|
830
|
-
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)), {
|
|
831
825
|
start: r,
|
|
832
826
|
end: s,
|
|
833
|
-
valid:
|
|
827
|
+
valid: u
|
|
834
828
|
};
|
|
835
829
|
}
|
|
836
830
|
}, {
|
|
837
831
|
key: "checkWhitespaceRanges",
|
|
838
|
-
value: function(n,
|
|
839
|
-
var s = void 0,
|
|
840
|
-
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)), {
|
|
841
835
|
start: m,
|
|
842
836
|
end: s,
|
|
843
|
-
valid:
|
|
837
|
+
valid: u
|
|
844
838
|
};
|
|
845
839
|
}
|
|
846
840
|
}, {
|
|
847
841
|
key: "getTextNodes",
|
|
848
842
|
value: function(n) {
|
|
849
|
-
var
|
|
850
|
-
this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(
|
|
843
|
+
var i = this, r = "", s = [];
|
|
844
|
+
this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(u) {
|
|
851
845
|
s.push({
|
|
852
846
|
start: r.length,
|
|
853
|
-
end: (r +=
|
|
854
|
-
node:
|
|
847
|
+
end: (r += u.textContent).length,
|
|
848
|
+
node: u
|
|
855
849
|
});
|
|
856
|
-
}, function(
|
|
857
|
-
return
|
|
850
|
+
}, function(u) {
|
|
851
|
+
return i.matchesExclude(u.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
858
852
|
}, function() {
|
|
859
853
|
n({
|
|
860
854
|
value: r,
|
|
@@ -869,24 +863,24 @@ function Mn() {
|
|
|
869
863
|
}
|
|
870
864
|
}, {
|
|
871
865
|
key: "wrapRangeInTextNode",
|
|
872
|
-
value: function(n,
|
|
873
|
-
var s = this.opt.element ? this.opt.element : "mark",
|
|
874
|
-
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;
|
|
875
869
|
}
|
|
876
870
|
}, {
|
|
877
871
|
key: "wrapRangeInMappedTextNode",
|
|
878
|
-
value: function(n,
|
|
879
|
-
var
|
|
880
|
-
n.nodes.every(function(
|
|
881
|
-
var
|
|
882
|
-
if (typeof
|
|
883
|
-
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))
|
|
884
878
|
return !1;
|
|
885
|
-
var
|
|
886
|
-
if (
|
|
879
|
+
var S = 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, S, C), n.value = L + R, n.nodes.forEach(function(F, V) {
|
|
887
881
|
V >= m && (n.nodes[V].start > 0 && V !== m && (n.nodes[V].start -= C), n.nodes[V].end -= C);
|
|
888
|
-
}), r -= C,
|
|
889
|
-
|
|
882
|
+
}), r -= C, u(f.node.previousSibling, f.start), r > f.end)
|
|
883
|
+
i = f.end;
|
|
890
884
|
else
|
|
891
885
|
return !1;
|
|
892
886
|
}
|
|
@@ -895,52 +889,52 @@ function Mn() {
|
|
|
895
889
|
}
|
|
896
890
|
}, {
|
|
897
891
|
key: "wrapMatches",
|
|
898
|
-
value: function(n,
|
|
899
|
-
var
|
|
892
|
+
value: function(n, i, r, s, u) {
|
|
893
|
+
var h = this, f = i === 0 ? 0 : i + 1;
|
|
900
894
|
this.getTextNodes(function(m) {
|
|
901
|
-
m.nodes.forEach(function(
|
|
902
|
-
|
|
903
|
-
for (var
|
|
904
|
-
if (r(
|
|
905
|
-
var C =
|
|
906
|
-
if (
|
|
907
|
-
for (var L = 1; L <
|
|
908
|
-
C +=
|
|
909
|
-
|
|
895
|
+
m.nodes.forEach(function(w) {
|
|
896
|
+
w = w.node;
|
|
897
|
+
for (var S = void 0; (S = n.exec(w.textContent)) !== null && S[f] !== ""; )
|
|
898
|
+
if (r(S[f], w)) {
|
|
899
|
+
var C = S.index;
|
|
900
|
+
if (f !== 0)
|
|
901
|
+
for (var L = 1; L < f; L++)
|
|
902
|
+
C += S[L].length;
|
|
903
|
+
w = h.wrapRangeInTextNode(w, C, C + S[f].length), s(w.previousSibling), n.lastIndex = 0;
|
|
910
904
|
}
|
|
911
|
-
}),
|
|
905
|
+
}), u();
|
|
912
906
|
});
|
|
913
907
|
}
|
|
914
908
|
}, {
|
|
915
909
|
key: "wrapMatchesAcrossElements",
|
|
916
|
-
value: function(n,
|
|
917
|
-
var
|
|
910
|
+
value: function(n, i, r, s, u) {
|
|
911
|
+
var h = this, f = i === 0 ? 0 : i + 1;
|
|
918
912
|
this.getTextNodes(function(m) {
|
|
919
|
-
for (var
|
|
920
|
-
var
|
|
921
|
-
if (
|
|
922
|
-
for (var C = 1; C <
|
|
923
|
-
|
|
924
|
-
var L =
|
|
925
|
-
|
|
926
|
-
return r(
|
|
913
|
+
for (var w = void 0; (w = n.exec(m.value)) !== null && w[f] !== ""; ) {
|
|
914
|
+
var S = w.index;
|
|
915
|
+
if (f !== 0)
|
|
916
|
+
for (var C = 1; C < f; C++)
|
|
917
|
+
S += w[C].length;
|
|
918
|
+
var L = S + w[f].length;
|
|
919
|
+
h.wrapRangeInMappedTextNode(m, S, L, function(R) {
|
|
920
|
+
return r(w[f], R);
|
|
927
921
|
}, function(R, F) {
|
|
928
922
|
n.lastIndex = F, s(R);
|
|
929
923
|
});
|
|
930
924
|
}
|
|
931
|
-
|
|
925
|
+
u();
|
|
932
926
|
});
|
|
933
927
|
}
|
|
934
928
|
}, {
|
|
935
929
|
key: "wrapRangeFromIndex",
|
|
936
|
-
value: function(n,
|
|
937
|
-
var
|
|
938
|
-
this.getTextNodes(function(
|
|
939
|
-
var
|
|
940
|
-
n.forEach(function(m,
|
|
941
|
-
var
|
|
942
|
-
R &&
|
|
943
|
-
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 S = u.checkWhitespaceRanges(m, f, h.value), C = S.start, L = S.end, R = S.valid;
|
|
936
|
+
R && u.wrapRangeInMappedTextNode(h, C, L, function(F) {
|
|
937
|
+
return i(F, m, h.value.substring(C, L), w);
|
|
944
938
|
}, function(F) {
|
|
945
939
|
r(F, m);
|
|
946
940
|
});
|
|
@@ -950,9 +944,9 @@ function Mn() {
|
|
|
950
944
|
}, {
|
|
951
945
|
key: "unwrapMatches",
|
|
952
946
|
value: function(n) {
|
|
953
|
-
for (var
|
|
947
|
+
for (var i = n.parentNode, r = document.createDocumentFragment(); n.firstChild; )
|
|
954
948
|
r.appendChild(n.removeChild(n.firstChild));
|
|
955
|
-
|
|
949
|
+
i.replaceChild(r, n), this.ie ? this.normalizeTextNode(i) : i.normalize();
|
|
956
950
|
}
|
|
957
951
|
}, {
|
|
958
952
|
key: "normalizeTextNode",
|
|
@@ -968,45 +962,45 @@ function Mn() {
|
|
|
968
962
|
}
|
|
969
963
|
}, {
|
|
970
964
|
key: "markRegExp",
|
|
971
|
-
value: function(n,
|
|
965
|
+
value: function(n, i) {
|
|
972
966
|
var r = this;
|
|
973
|
-
this.opt =
|
|
974
|
-
var s = 0,
|
|
967
|
+
this.opt = i, this.log('Searching with expression "' + n + '"');
|
|
968
|
+
var s = 0, u = "wrapMatches", h = function(m) {
|
|
975
969
|
s++, r.opt.each(m);
|
|
976
970
|
};
|
|
977
|
-
this.opt.acrossElements && (
|
|
978
|
-
return r.opt.filter(m,
|
|
979
|
-
},
|
|
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() {
|
|
980
974
|
s === 0 && r.opt.noMatch(n), r.opt.done(s);
|
|
981
975
|
});
|
|
982
976
|
}
|
|
983
977
|
}, {
|
|
984
978
|
key: "mark",
|
|
985
|
-
value: function(n,
|
|
979
|
+
value: function(n, i) {
|
|
986
980
|
var r = this;
|
|
987
|
-
this.opt =
|
|
988
|
-
var s = 0,
|
|
989
|
-
var R = new RegExp(r.createRegExp(L), "gm" +
|
|
990
|
-
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", S = 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(V, Ee) {
|
|
991
985
|
return r.opt.filter(Ee, L, s, F);
|
|
992
986
|
}, function(V) {
|
|
993
987
|
F++, s++, r.opt.each(V);
|
|
994
988
|
}, function() {
|
|
995
|
-
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]);
|
|
996
990
|
});
|
|
997
991
|
};
|
|
998
|
-
this.opt.acrossElements && (
|
|
992
|
+
this.opt.acrossElements && (u = "wrapMatchesAcrossElements"), m === 0 ? this.opt.done(s) : S(f[0]);
|
|
999
993
|
}
|
|
1000
994
|
}, {
|
|
1001
995
|
key: "markRanges",
|
|
1002
|
-
value: function(n,
|
|
996
|
+
value: function(n, i) {
|
|
1003
997
|
var r = this;
|
|
1004
|
-
this.opt =
|
|
1005
|
-
var s = 0,
|
|
1006
|
-
|
|
1007
|
-
return r.opt.filter(
|
|
1008
|
-
}, function(
|
|
1009
|
-
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);
|
|
1010
1004
|
}, function() {
|
|
1011
1005
|
r.opt.done(s);
|
|
1012
1006
|
})) : this.opt.done(s);
|
|
@@ -1014,20 +1008,20 @@ function Mn() {
|
|
|
1014
1008
|
}, {
|
|
1015
1009
|
key: "unmark",
|
|
1016
1010
|
value: function(n) {
|
|
1017
|
-
var
|
|
1011
|
+
var i = this;
|
|
1018
1012
|
this.opt = n;
|
|
1019
1013
|
var r = this.opt.element ? this.opt.element : "*";
|
|
1020
1014
|
r += "[data-markjs]", this.opt.className && (r += "." + this.opt.className), this.log('Removal selector "' + r + '"'), this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function(s) {
|
|
1021
|
-
|
|
1015
|
+
i.unwrapMatches(s);
|
|
1022
1016
|
}, function(s) {
|
|
1023
|
-
var
|
|
1024
|
-
return !
|
|
1017
|
+
var u = y.matches(s, r), h = i.matchesExclude(s);
|
|
1018
|
+
return !u || h ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
1025
1019
|
}, this.opt.done);
|
|
1026
1020
|
}
|
|
1027
1021
|
}, {
|
|
1028
1022
|
key: "opt",
|
|
1029
1023
|
set: function(n) {
|
|
1030
|
-
this._opt =
|
|
1024
|
+
this._opt = l({}, {
|
|
1031
1025
|
element: "",
|
|
1032
1026
|
className: "",
|
|
1033
1027
|
exclude: [],
|
|
@@ -1065,95 +1059,88 @@ function Mn() {
|
|
|
1065
1059
|
return new y(this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout);
|
|
1066
1060
|
}
|
|
1067
1061
|
}]), v;
|
|
1068
|
-
}();
|
|
1062
|
+
})();
|
|
1069
1063
|
function E(v) {
|
|
1070
|
-
var
|
|
1071
|
-
return this.mark = function(
|
|
1072
|
-
return n.mark(
|
|
1073
|
-
}, this.markRegExp = function(
|
|
1074
|
-
return n.markRegExp(
|
|
1075
|
-
}, this.markRanges = function(
|
|
1076
|
-
return n.markRanges(
|
|
1077
|
-
}, this.unmark = function(
|
|
1078
|
-
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;
|
|
1079
1073
|
}, this;
|
|
1080
1074
|
}
|
|
1081
1075
|
return E;
|
|
1082
|
-
});
|
|
1083
|
-
}(ce)), ce.exports;
|
|
1076
|
+
}));
|
|
1077
|
+
})(ce)), ce.exports;
|
|
1084
1078
|
}
|
|
1085
1079
|
var Cn = Mn();
|
|
1086
|
-
const On = /* @__PURE__ */
|
|
1087
|
-
function
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1080
|
+
const On = /* @__PURE__ */ Tn(Cn);
|
|
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);
|
|
1090
1084
|
}
|
|
1091
|
-
function
|
|
1085
|
+
function sr(e, t) {
|
|
1092
1086
|
const o = document.createElement("div");
|
|
1093
1087
|
o.classList.add("vf-overlay"), o.addEventListener("click", n), document.body.appendChild(o);
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1097
|
-
|
|
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) => {
|
|
1098
1092
|
if (r == "-") {
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1093
|
+
const u = document.createElement("div");
|
|
1094
|
+
u.classList.add("separator"), a.appendChild(u);
|
|
1101
1095
|
return;
|
|
1102
1096
|
}
|
|
1103
1097
|
const s = document.createElement("div");
|
|
1104
|
-
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());
|
|
1105
1099
|
});
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
|
|
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";
|
|
1109
1103
|
}, 50);
|
|
1110
1104
|
function n() {
|
|
1111
|
-
t.targetClass &&
|
|
1105
|
+
t.targetClass && p.classList.remove(t.targetClass), p.classList.remove("context-menu-active"), p.style.userSelect = "", o.remove();
|
|
1112
1106
|
}
|
|
1113
|
-
function
|
|
1107
|
+
function i(r, s, u) {
|
|
1114
1108
|
if (s.classList.contains("pending-confirm"))
|
|
1115
|
-
return
|
|
1116
|
-
const
|
|
1109
|
+
return u();
|
|
1110
|
+
const h = s.innerHTML;
|
|
1117
1111
|
s.classList.add("pending-confirm"), s.innerText = "Confirm";
|
|
1118
|
-
const
|
|
1119
|
-
s.classList.remove("pending-confirm"), s.innerHTML =
|
|
1112
|
+
const f = () => {
|
|
1113
|
+
s.classList.remove("pending-confirm"), s.innerHTML = h, s.removeEventListener("mouseleave", f);
|
|
1120
1114
|
};
|
|
1121
|
-
s.addEventListener("mouseleave",
|
|
1115
|
+
s.addEventListener("mouseleave", f), r.stopPropagation();
|
|
1122
1116
|
}
|
|
1123
1117
|
}
|
|
1124
|
-
const Nn = (e) => new Promise((t) => setTimeout(t, e)),
|
|
1118
|
+
const Nn = (e) => new Promise((t) => setTimeout(t, e)), lr = (e) => Nn(e * 1e3);
|
|
1125
1119
|
function Ln(e) {
|
|
1126
1120
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1127
1121
|
}
|
|
1128
|
-
function
|
|
1122
|
+
function ur(e, t) {
|
|
1129
1123
|
return e != null ? qt(e) : t;
|
|
1130
1124
|
}
|
|
1131
|
-
function
|
|
1125
|
+
function cr(e, t) {
|
|
1132
1126
|
const o = { ...e };
|
|
1133
|
-
for (const
|
|
1134
|
-
o[
|
|
1127
|
+
for (const a of t)
|
|
1128
|
+
o[a] === "" && (o[a] = null);
|
|
1135
1129
|
return o;
|
|
1136
1130
|
}
|
|
1137
1131
|
function Ye(e) {
|
|
1138
1132
|
return e != null;
|
|
1139
1133
|
}
|
|
1140
|
-
function
|
|
1134
|
+
function dr(e, t) {
|
|
1141
1135
|
en(e, {
|
|
1142
1136
|
...t,
|
|
1143
|
-
onError(o,
|
|
1137
|
+
onError(o, a) {
|
|
1144
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));
|
|
1145
|
-
const
|
|
1146
|
-
return
|
|
1139
|
+
const p = t.onError?.(o, a);
|
|
1140
|
+
return p !== void 0 ? p : o;
|
|
1147
1141
|
}
|
|
1148
1142
|
});
|
|
1149
1143
|
}
|
|
1150
|
-
/*!
|
|
1151
|
-
* currency.js - v2.0.4
|
|
1152
|
-
* http://scurker.github.io/currency.js
|
|
1153
|
-
*
|
|
1154
|
-
* Copyright (c) 2021 Jason Wilson
|
|
1155
|
-
* Released under MIT license
|
|
1156
|
-
*/
|
|
1157
1144
|
var Rn = {
|
|
1158
1145
|
symbol: "$",
|
|
1159
1146
|
separator: ",",
|
|
@@ -1162,7 +1149,7 @@ var Rn = {
|
|
|
1162
1149
|
precision: 2,
|
|
1163
1150
|
pattern: "!#",
|
|
1164
1151
|
negativePattern: "-!#",
|
|
1165
|
-
format:
|
|
1152
|
+
format: $n,
|
|
1166
1153
|
fromCents: !1
|
|
1167
1154
|
}, pt = function(t) {
|
|
1168
1155
|
return Math.round(t);
|
|
@@ -1170,43 +1157,43 @@ var Rn = {
|
|
|
1170
1157
|
return Math.pow(10, t);
|
|
1171
1158
|
}, Fn = function(t, o) {
|
|
1172
1159
|
return pt(t / o) * o;
|
|
1173
|
-
}, An = /(\d)(?=(\d{3})+\b)/g,
|
|
1174
|
-
function
|
|
1160
|
+
}, An = /(\d)(?=(\d{3})+\b)/g, Dn = /(\d)(?=(\d\d)+\d\b)/g;
|
|
1161
|
+
function _(e, t) {
|
|
1175
1162
|
var o = this;
|
|
1176
|
-
if (!(o instanceof
|
|
1177
|
-
return new
|
|
1178
|
-
var
|
|
1179
|
-
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;
|
|
1180
1167
|
}
|
|
1181
1168
|
function de(e, t) {
|
|
1182
|
-
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0,
|
|
1183
|
-
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)
|
|
1184
1171
|
return e.intValue;
|
|
1185
|
-
if (v ||
|
|
1186
|
-
|
|
1172
|
+
if (v || c)
|
|
1173
|
+
a = c ? e.value : e;
|
|
1187
1174
|
else if (typeof e == "string") {
|
|
1188
|
-
var n = new RegExp("[^-\\d" +
|
|
1189
|
-
|
|
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;
|
|
1190
1177
|
} else {
|
|
1191
|
-
if (
|
|
1178
|
+
if (l)
|
|
1192
1179
|
throw Error("Invalid Input");
|
|
1193
|
-
|
|
1180
|
+
a = 0;
|
|
1194
1181
|
}
|
|
1195
|
-
return g || (
|
|
1182
|
+
return g || (a *= E, a = a.toFixed(4)), o ? pt(a) : a;
|
|
1196
1183
|
}
|
|
1197
|
-
function
|
|
1198
|
-
var o = t.pattern,
|
|
1199
|
-
return (e.value >= 0 ? o :
|
|
1184
|
+
function $n(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 : ""));
|
|
1200
1187
|
}
|
|
1201
|
-
|
|
1188
|
+
_.prototype = {
|
|
1202
1189
|
/**
|
|
1203
1190
|
* Adds values together.
|
|
1204
1191
|
* @param {number} number
|
|
1205
1192
|
* @returns {currency}
|
|
1206
1193
|
*/
|
|
1207
1194
|
add: function(t) {
|
|
1208
|
-
var o = this.intValue,
|
|
1209
|
-
return
|
|
1195
|
+
var o = this.intValue, a = this.s, p = this.p;
|
|
1196
|
+
return _((o += de(t, a)) / (a.fromCents ? 1 : p), a);
|
|
1210
1197
|
},
|
|
1211
1198
|
/**
|
|
1212
1199
|
* Subtracts value.
|
|
@@ -1214,8 +1201,8 @@ B.prototype = {
|
|
|
1214
1201
|
* @returns {currency}
|
|
1215
1202
|
*/
|
|
1216
1203
|
subtract: function(t) {
|
|
1217
|
-
var o = this.intValue,
|
|
1218
|
-
return
|
|
1204
|
+
var o = this.intValue, a = this.s, p = this.p;
|
|
1205
|
+
return _((o -= de(t, a)) / (a.fromCents ? 1 : p), a);
|
|
1219
1206
|
},
|
|
1220
1207
|
/**
|
|
1221
1208
|
* Multiplies values.
|
|
@@ -1223,8 +1210,8 @@ B.prototype = {
|
|
|
1223
1210
|
* @returns {currency}
|
|
1224
1211
|
*/
|
|
1225
1212
|
multiply: function(t) {
|
|
1226
|
-
var o = this.intValue,
|
|
1227
|
-
return
|
|
1213
|
+
var o = this.intValue, a = this.s;
|
|
1214
|
+
return _((o *= t) / (a.fromCents ? 1 : Fe(a.precision)), a);
|
|
1228
1215
|
},
|
|
1229
1216
|
/**
|
|
1230
1217
|
* Divides value.
|
|
@@ -1232,8 +1219,8 @@ B.prototype = {
|
|
|
1232
1219
|
* @returns {currency}
|
|
1233
1220
|
*/
|
|
1234
1221
|
divide: function(t) {
|
|
1235
|
-
var o = this.intValue,
|
|
1236
|
-
return
|
|
1222
|
+
var o = this.intValue, a = this.s;
|
|
1223
|
+
return _(o /= de(t, a, !1), a);
|
|
1237
1224
|
},
|
|
1238
1225
|
/**
|
|
1239
1226
|
* Takes the currency amount and distributes the values evenly. Any extra pennies
|
|
@@ -1242,11 +1229,11 @@ B.prototype = {
|
|
|
1242
1229
|
* @returns {array}
|
|
1243
1230
|
*/
|
|
1244
1231
|
distribute: function(t) {
|
|
1245
|
-
for (var o = this.intValue,
|
|
1246
|
-
var v =
|
|
1247
|
-
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);
|
|
1248
1235
|
}
|
|
1249
|
-
return
|
|
1236
|
+
return l;
|
|
1250
1237
|
},
|
|
1251
1238
|
/**
|
|
1252
1239
|
* Returns the dollar value.
|
|
@@ -1277,8 +1264,8 @@ B.prototype = {
|
|
|
1277
1264
|
* @returns {string}
|
|
1278
1265
|
*/
|
|
1279
1266
|
toString: function() {
|
|
1280
|
-
var t = this.intValue, o = this.p,
|
|
1281
|
-
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);
|
|
1282
1269
|
},
|
|
1283
1270
|
/**
|
|
1284
1271
|
* Value for JSON serialization.
|
|
@@ -1294,52 +1281,53 @@ for (let e = 0; e < 256; ++e)
|
|
|
1294
1281
|
function Hn(e, t = 0) {
|
|
1295
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();
|
|
1296
1283
|
}
|
|
1297
|
-
let
|
|
1284
|
+
let Se;
|
|
1298
1285
|
const Vn = new Uint8Array(16);
|
|
1299
|
-
function
|
|
1300
|
-
if (!
|
|
1286
|
+
function Bn() {
|
|
1287
|
+
if (!Se) {
|
|
1301
1288
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1302
1289
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1303
|
-
|
|
1290
|
+
Se = crypto.getRandomValues.bind(crypto);
|
|
1304
1291
|
}
|
|
1305
|
-
return
|
|
1292
|
+
return Se(Vn);
|
|
1306
1293
|
}
|
|
1307
|
-
const
|
|
1294
|
+
const _n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Xe = { randomUUID: _n };
|
|
1308
1295
|
function Wn(e, t, o) {
|
|
1309
|
-
if (Xe.randomUUID && !e)
|
|
1310
|
-
return Xe.randomUUID();
|
|
1311
1296
|
e = e || {};
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1297
|
+
const a = e.random ?? e.rng?.() ?? Bn();
|
|
1298
|
+
if (a.length < 16)
|
|
1314
1299
|
throw new Error("Random bytes length must be >= 16");
|
|
1315
|
-
return
|
|
1300
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Hn(a);
|
|
1301
|
+
}
|
|
1302
|
+
function Pn(e, t, o) {
|
|
1303
|
+
return Xe.randomUUID && !e ? Xe.randomUUID() : Wn(e);
|
|
1316
1304
|
}
|
|
1317
|
-
function
|
|
1305
|
+
function fr(e) {
|
|
1318
1306
|
return e.replace(/\n/g, "<br>");
|
|
1319
1307
|
}
|
|
1320
|
-
function
|
|
1308
|
+
function jn(e) {
|
|
1321
1309
|
return e.replace(/_/g, " ");
|
|
1322
1310
|
}
|
|
1323
|
-
function
|
|
1311
|
+
function Un(e) {
|
|
1324
1312
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
1325
1313
|
return t.length !== 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
1326
1314
|
}
|
|
1327
|
-
function
|
|
1328
|
-
return
|
|
1315
|
+
function zn(e, t) {
|
|
1316
|
+
return _(e).divide(t ?? $.defaultCurrencyDivisor).format();
|
|
1329
1317
|
}
|
|
1330
|
-
function
|
|
1331
|
-
return
|
|
1318
|
+
function hr() {
|
|
1319
|
+
return Pn();
|
|
1332
1320
|
}
|
|
1333
|
-
const
|
|
1321
|
+
const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
1334
1322
|
key: 0,
|
|
1335
1323
|
class: "no-results"
|
|
1336
|
-
},
|
|
1324
|
+
}, Kn = {
|
|
1337
1325
|
key: 0,
|
|
1338
1326
|
class: "group-title"
|
|
1339
|
-
},
|
|
1327
|
+
}, Yn = ["onMousemove", "onMousedown"], Xn = ["innerHTML"], Zn = ["innerHTML"], Gn = {
|
|
1340
1328
|
key: 1,
|
|
1341
1329
|
class: "no-results"
|
|
1342
|
-
},
|
|
1330
|
+
}, Qn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", eo = /* @__PURE__ */ q({
|
|
1343
1331
|
__name: "vf-smart-select",
|
|
1344
1332
|
props: {
|
|
1345
1333
|
modelValue: {},
|
|
@@ -1376,264 +1364,264 @@ const zn = ["disabled", "placeholder", "required", "name"], qn = {
|
|
|
1376
1364
|
},
|
|
1377
1365
|
emits: ["optionsLoaded", "update:modelValue"],
|
|
1378
1366
|
setup(e, { expose: t, emit: o }) {
|
|
1379
|
-
const
|
|
1367
|
+
const a = Symbol("null"), p = Symbol("create"), l = e, y = o;
|
|
1380
1368
|
t({
|
|
1381
|
-
addRemoteOption:
|
|
1369
|
+
addRemoteOption: $t
|
|
1382
1370
|
});
|
|
1383
|
-
const g = N(), E = N(), v = N(),
|
|
1384
|
-
const k =
|
|
1385
|
-
return
|
|
1386
|
-
|
|
1387
|
-
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), S = O(() => !!(l.options || n.value)), C = O(() => l.options ?? n.value ?? []), L = O(() => l.prependOptions ?? []), R = O(() => l.appendOptions ?? []), F = O(() => !!l.disabled || !S.value && !l.loadOptions), V = O(() => l.loadingText || "..."), Ee = O(() => !S.value && (!l.loadOptions || l.preload || l.modelValue && (l.valueField || l.valueExtractor)) ? V.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), St = O(() => l.groupFormatter ? l.groupFormatter : l.groupField ? (d) => String(d[l.groupField]) : null), $e = O(() => l.formatter ? l.formatter : l.labelField ? (d) => String(d[l.labelField]) : (d) => String(d)), He = O(() => l.selectionFormatter ? l.selectionFormatter : $e.value), Ve = O(() => [...L.value, ...C.value, ...R.value]), Be = O(() => !!(l.groupField || l.groupFormatter)), xe = O(() => Ve.value.map((d, b) => {
|
|
1372
|
+
const k = St.value?.(d), x = $e.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, "")
|
|
1388
1376
|
);
|
|
1389
|
-
}) : (ue.push(
|
|
1390
|
-
key: ke.value?.(
|
|
1377
|
+
}) : (ue.push(B), qe && ue.push(qe)), {
|
|
1378
|
+
key: ke.value?.(d) ?? String(b),
|
|
1391
1379
|
group: k,
|
|
1392
|
-
title:
|
|
1380
|
+
title: x,
|
|
1393
1381
|
subtitle: M,
|
|
1394
1382
|
searchContent: ue.join(""),
|
|
1395
|
-
ref:
|
|
1383
|
+
ref: d
|
|
1396
1384
|
};
|
|
1397
|
-
})),
|
|
1398
|
-
let
|
|
1399
|
-
if (
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
key:
|
|
1403
|
-
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()
|
|
1404
1392
|
})));
|
|
1405
|
-
} else
|
|
1406
|
-
key:
|
|
1407
|
-
title:
|
|
1393
|
+
} else l.nullTitle && d.unshift({
|
|
1394
|
+
key: a,
|
|
1395
|
+
title: l.nullTitle
|
|
1408
1396
|
});
|
|
1409
|
-
return
|
|
1410
|
-
}),
|
|
1411
|
-
if (
|
|
1397
|
+
return d;
|
|
1398
|
+
}), Tt = O(() => {
|
|
1399
|
+
if (!Be.value)
|
|
1412
1400
|
return [
|
|
1413
1401
|
{
|
|
1414
1402
|
groupTitle: "",
|
|
1415
|
-
options:
|
|
1403
|
+
options: D.value
|
|
1416
1404
|
}
|
|
1417
1405
|
];
|
|
1418
|
-
const
|
|
1419
|
-
return
|
|
1406
|
+
const d = Jt(D.value.map((k) => k.group ?? "")), b = Kt(D.value, (k) => k.group ?? "");
|
|
1407
|
+
return d.map((k) => ({
|
|
1420
1408
|
groupTitle: k,
|
|
1421
|
-
options:
|
|
1409
|
+
options: b[k]
|
|
1422
1410
|
}));
|
|
1423
1411
|
});
|
|
1424
|
-
H(() =>
|
|
1425
|
-
|
|
1412
|
+
H(() => l.modelValue, G), H(xe, () => {
|
|
1413
|
+
h.value && setTimeout(je, 0);
|
|
1426
1414
|
}), H(r, () => {
|
|
1427
|
-
|
|
1428
|
-
}), H(
|
|
1429
|
-
|
|
1430
|
-
}), H(
|
|
1431
|
-
|
|
1415
|
+
i.value && !l.remoteSearch && !r.value.trim().length && (i.value = !1);
|
|
1416
|
+
}), H(h, () => {
|
|
1417
|
+
h.value ? setTimeout(Ft, 0) : (i.value = !1, r.value = u.value ?? "", v.value && (v.value.style.visibility = "hidden"));
|
|
1418
|
+
}), H(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);
|
|
1432
1420
|
}), z(async () => {
|
|
1433
|
-
m.value =
|
|
1434
|
-
const
|
|
1435
|
-
Me(
|
|
1436
|
-
}),
|
|
1421
|
+
m.value = l.onCreateItem !== void 0, l.loadOptions && l.preload ? await _e() : !l.options && !l.loadOptions && (l.valueField || l.valueExtractor) || G(), H(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 && H(r, Yt(It, 250));
|
|
1437
1425
|
}), me(() => {
|
|
1438
1426
|
v.value?.remove();
|
|
1439
1427
|
});
|
|
1440
|
-
async function
|
|
1428
|
+
async function _e() {
|
|
1441
1429
|
await We(!0), G(), n.value && y("optionsLoaded", n.value);
|
|
1442
1430
|
}
|
|
1443
|
-
async function We(
|
|
1444
|
-
const
|
|
1445
|
-
|
|
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();
|
|
1446
1434
|
}
|
|
1447
1435
|
function It() {
|
|
1448
|
-
|
|
1436
|
+
i.value && (We(), i.value = r.value.trim().length > 0);
|
|
1449
1437
|
}
|
|
1450
|
-
function Mt(
|
|
1451
|
-
if (
|
|
1452
|
-
|
|
1438
|
+
function Mt(d) {
|
|
1439
|
+
if (d.key == "Escape") {
|
|
1440
|
+
d.stopPropagation(), d.target.blur(), ze();
|
|
1453
1441
|
return;
|
|
1454
1442
|
}
|
|
1455
|
-
if (!(
|
|
1456
|
-
if (!
|
|
1457
|
-
|
|
1443
|
+
if (!(d.key == "ArrowLeft" || d.key == "ArrowRight") && d.key != "Tab") {
|
|
1444
|
+
if (!S.value) {
|
|
1445
|
+
i.value || d.preventDefault();
|
|
1458
1446
|
return;
|
|
1459
1447
|
}
|
|
1460
|
-
if (
|
|
1461
|
-
return
|
|
1462
|
-
if (
|
|
1463
|
-
return
|
|
1464
|
-
if (
|
|
1465
|
-
return
|
|
1466
|
-
if (
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1469
|
-
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);
|
|
1470
1458
|
}
|
|
1471
|
-
if (
|
|
1472
|
-
r.value.length > 1 && (
|
|
1459
|
+
if (d.key === "Delete" || d.key === "Backspace") {
|
|
1460
|
+
r.value.length > 1 && (i.value = !0);
|
|
1473
1461
|
return;
|
|
1474
1462
|
}
|
|
1475
|
-
!
|
|
1463
|
+
!d.metaKey && Qn.includes(d.key) && (i.value = !0);
|
|
1476
1464
|
}
|
|
1477
1465
|
}
|
|
1478
1466
|
function Ct() {
|
|
1479
|
-
|
|
1467
|
+
i.value = !0;
|
|
1480
1468
|
}
|
|
1481
1469
|
function Ot() {
|
|
1482
|
-
Pe(),
|
|
1470
|
+
Pe(), h.value = !0, setTimeout(() => E.value?.select(), 0);
|
|
1483
1471
|
}
|
|
1484
|
-
function Pe(
|
|
1485
|
-
s.value ?
|
|
1472
|
+
function Pe(d) {
|
|
1473
|
+
s.value ? f.value = Nt(s.value) : l.nullTitle && (f.value = a);
|
|
1486
1474
|
}
|
|
1487
|
-
function Nt(
|
|
1488
|
-
return ke.value ? ke.value(s.value) : Lt(
|
|
1475
|
+
function Nt(d) {
|
|
1476
|
+
return ke.value ? ke.value(s.value) : Lt(d)?.key ?? "";
|
|
1489
1477
|
}
|
|
1490
|
-
function Lt(
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
return
|
|
1494
|
-
const k =
|
|
1495
|
-
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;
|
|
1496
1484
|
}
|
|
1497
1485
|
function Rt() {
|
|
1498
|
-
|
|
1486
|
+
l.debug || (!r.value.length && l.nullTitle && (s.value = null, u.value = null), h.value = !1);
|
|
1499
1487
|
}
|
|
1500
1488
|
function Ft() {
|
|
1501
|
-
|
|
1489
|
+
S.value || _e(), l.optionsListId && v.value?.setAttribute("id", l.optionsListId), At();
|
|
1502
1490
|
}
|
|
1503
1491
|
function At() {
|
|
1504
|
-
const
|
|
1505
|
-
for (let
|
|
1506
|
-
/^(font|text)/.test(
|
|
1507
|
-
if (
|
|
1508
|
-
const
|
|
1509
|
-
|
|
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";
|
|
1510
1498
|
}
|
|
1511
|
-
|
|
1499
|
+
x.style.visibility = "visible", document.body.appendChild(x), setTimeout(je, 0);
|
|
1512
1500
|
}
|
|
1513
1501
|
function je() {
|
|
1514
|
-
if (!
|
|
1515
|
-
const
|
|
1516
|
-
k && (
|
|
1502
|
+
if (!S.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);
|
|
1517
1505
|
}
|
|
1518
|
-
function
|
|
1519
|
-
|
|
1506
|
+
function Dt(d) {
|
|
1507
|
+
f.value = d ? d.key : null;
|
|
1520
1508
|
}
|
|
1521
|
-
function
|
|
1522
|
-
const
|
|
1523
|
-
let k =
|
|
1524
|
-
if (k < 0 ? k = 0 : k >=
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1527
|
-
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));
|
|
1528
1516
|
}
|
|
1529
|
-
function Ue(
|
|
1530
|
-
if (
|
|
1531
|
-
r.value = "", s.value = null,
|
|
1532
|
-
else if (
|
|
1533
|
-
const
|
|
1534
|
-
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);
|
|
1535
1523
|
} else {
|
|
1536
|
-
const k =
|
|
1537
|
-
s.value = k,
|
|
1524
|
+
const k = xe.value.find((x) => x.key == d.key).ref;
|
|
1525
|
+
s.value = k, u.value = He.value(k), r.value = u.value ?? "";
|
|
1538
1526
|
}
|
|
1539
1527
|
E.value?.blur(), ze();
|
|
1540
1528
|
}
|
|
1541
1529
|
function G() {
|
|
1542
|
-
|
|
1530
|
+
l.modelValue !== null ? (s.value = Z.value ? Ve.value.find((d) => l.modelValue === Z.value(d)) : l.modelValue, u.value = Ye(s.value) ? He.value(s.value) : null, r.value = u.value ?? "") : (s.value = null, u.value = null, r.value = "");
|
|
1543
1531
|
}
|
|
1544
|
-
function
|
|
1545
|
-
n.value.unshift(
|
|
1532
|
+
function $t(d) {
|
|
1533
|
+
n.value.unshift(d);
|
|
1546
1534
|
}
|
|
1547
1535
|
function ze() {
|
|
1548
|
-
if (!
|
|
1549
|
-
let
|
|
1550
|
-
for (;
|
|
1551
|
-
|
|
1552
|
-
if (!
|
|
1553
|
-
const
|
|
1554
|
-
if (!
|
|
1555
|
-
const k = Array.from(
|
|
1556
|
-
|
|
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);
|
|
1557
1545
|
}
|
|
1558
1546
|
return Ut(() => {
|
|
1559
|
-
if (!
|
|
1560
|
-
const
|
|
1561
|
-
v.value?.querySelectorAll(".option").forEach((
|
|
1562
|
-
const k = new On(
|
|
1563
|
-
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, {
|
|
1564
1552
|
done: () => {
|
|
1565
|
-
|
|
1553
|
+
b.innerHTML = b.innerHTML.replace(/ <mark /g, " <mark ").replace(/<\/mark> /g, "</mark> ");
|
|
1566
1554
|
}
|
|
1567
1555
|
});
|
|
1568
1556
|
});
|
|
1569
|
-
}), (
|
|
1557
|
+
}), (d, b) => (T(), I("div", {
|
|
1570
1558
|
ref_key: "el",
|
|
1571
1559
|
ref: g,
|
|
1572
|
-
class: P(["vf-smart-select", { disabled: F.value, open:
|
|
1560
|
+
class: P(["vf-smart-select", { disabled: F.value, open: h.value }])
|
|
1573
1561
|
}, [
|
|
1574
1562
|
fe(U("input", {
|
|
1575
1563
|
ref_key: "searchField",
|
|
1576
1564
|
ref: E,
|
|
1577
|
-
"onUpdate:modelValue":
|
|
1565
|
+
"onUpdate:modelValue": b[0] || (b[0] = (k) => r.value = k),
|
|
1578
1566
|
type: "text",
|
|
1579
1567
|
disabled: F.value,
|
|
1580
|
-
class: P({ nullable: !!
|
|
1568
|
+
class: P({ nullable: !!e.nullTitle }),
|
|
1581
1569
|
placeholder: Ee.value,
|
|
1582
|
-
required:
|
|
1583
|
-
name:
|
|
1570
|
+
required: e.required,
|
|
1571
|
+
name: e.name,
|
|
1584
1572
|
"data-1p-ignore": "",
|
|
1585
1573
|
onKeydown: Mt,
|
|
1586
1574
|
onPaste: Ct,
|
|
1587
1575
|
onFocus: Ot,
|
|
1588
1576
|
onBlur: Rt
|
|
1589
|
-
}, null, 42,
|
|
1577
|
+
}, null, 42, qn), [
|
|
1590
1578
|
[zt, r.value]
|
|
1591
1579
|
]),
|
|
1592
|
-
|
|
1580
|
+
h.value ? (T(), I("div", {
|
|
1593
1581
|
key: 0,
|
|
1594
1582
|
ref_key: "optionsContainer",
|
|
1595
1583
|
ref: v,
|
|
1596
|
-
class: P(["vf-smart-select-options", { grouped:
|
|
1584
|
+
class: P(["vf-smart-select-options", { grouped: Be.value }])
|
|
1597
1585
|
}, [
|
|
1598
|
-
|
|
1586
|
+
S.value ? (T(!0), I(he, { key: 1 }, pe(Tt.value, (k) => (T(), I("div", {
|
|
1599
1587
|
key: k.groupTitle,
|
|
1600
1588
|
class: "group"
|
|
1601
1589
|
}, [
|
|
1602
|
-
k.groupTitle ? (
|
|
1603
|
-
K(
|
|
1590
|
+
k.groupTitle ? (T(), I("div", Kn, [
|
|
1591
|
+
K(d.$slots, "group", {
|
|
1604
1592
|
group: k.groupTitle
|
|
1605
1593
|
}, () => [
|
|
1606
1594
|
te(J(k.groupTitle), 1)
|
|
1607
1595
|
])
|
|
1608
1596
|
])) : W("", !0),
|
|
1609
|
-
(
|
|
1610
|
-
key:
|
|
1611
|
-
class: P(["option", [
|
|
1612
|
-
onMousemove: (M) =>
|
|
1613
|
-
onMousedown: (M) => Ue(
|
|
1597
|
+
(T(!0), I(he, null, pe(k.options, (x) => (T(), 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)
|
|
1614
1602
|
}, [
|
|
1615
|
-
K(
|
|
1603
|
+
K(d.$slots, "option", { option: x }, () => [
|
|
1616
1604
|
U("div", {
|
|
1617
1605
|
class: "title",
|
|
1618
|
-
innerHTML:
|
|
1619
|
-
}, null, 8,
|
|
1620
|
-
|
|
1606
|
+
innerHTML: x.title
|
|
1607
|
+
}, null, 8, Xn),
|
|
1608
|
+
x.subtitle ? (T(), I("div", {
|
|
1621
1609
|
key: 0,
|
|
1622
1610
|
class: "subtitle",
|
|
1623
|
-
innerHTML:
|
|
1624
|
-
}, null, 8,
|
|
1611
|
+
innerHTML: x.subtitle
|
|
1612
|
+
}, null, 8, Zn)) : W("", !0)
|
|
1625
1613
|
])
|
|
1626
|
-
], 42,
|
|
1627
|
-
!
|
|
1628
|
-
K(
|
|
1629
|
-
te(J(
|
|
1614
|
+
], 42, Yn))), 128)),
|
|
1615
|
+
!D.value.length && r.value ? (T(), I("div", Gn, [
|
|
1616
|
+
K(d.$slots, "no-results", {}, () => [
|
|
1617
|
+
te(J(bt.value), 1)
|
|
1630
1618
|
])
|
|
1631
1619
|
])) : W("", !0)
|
|
1632
|
-
]))), 128)) : (
|
|
1620
|
+
]))), 128)) : (T(), I("div", Jn, "Loading..."))
|
|
1633
1621
|
], 2)) : W("", !0)
|
|
1634
1622
|
], 2));
|
|
1635
1623
|
}
|
|
1636
|
-
}),
|
|
1624
|
+
}), pr = /* @__PURE__ */ q({
|
|
1637
1625
|
__name: "vf-ez-smart-select",
|
|
1638
1626
|
props: {
|
|
1639
1627
|
modelValue: {},
|
|
@@ -1645,39 +1633,39 @@ const zn = ["disabled", "placeholder", "required", "name"], qn = {
|
|
|
1645
1633
|
},
|
|
1646
1634
|
emits: ["update:modelValue"],
|
|
1647
1635
|
setup(e, { emit: t }) {
|
|
1648
|
-
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]) => ({
|
|
1649
1637
|
value: g,
|
|
1650
1638
|
label: E
|
|
1651
|
-
}))),
|
|
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);
|
|
1652
1640
|
return H(
|
|
1653
1641
|
() => o.modelValue,
|
|
1654
1642
|
(g) => {
|
|
1655
|
-
y.value =
|
|
1643
|
+
y.value = a.value.find((E) => E.value === g) ?? null;
|
|
1656
1644
|
}
|
|
1657
1645
|
), H(y, (g) => {
|
|
1658
|
-
const E = g ?
|
|
1659
|
-
|
|
1660
|
-
}), (g, E) => (
|
|
1646
|
+
const E = g ? a.value.find((v) => Me(v, g))?.value : null;
|
|
1647
|
+
l("update:modelValue", E ?? null);
|
|
1648
|
+
}), (g, E) => (T(), at(eo, {
|
|
1661
1649
|
modelValue: y.value,
|
|
1662
1650
|
"onUpdate:modelValue": E[0] || (E[0] = (v) => y.value = v),
|
|
1663
|
-
options:
|
|
1664
|
-
formatter:
|
|
1665
|
-
"null-title":
|
|
1666
|
-
placeholder:
|
|
1667
|
-
name:
|
|
1651
|
+
options: a.value,
|
|
1652
|
+
formatter: p.value,
|
|
1653
|
+
"null-title": e.nullTitle,
|
|
1654
|
+
placeholder: e.placeholder,
|
|
1655
|
+
name: e.name
|
|
1668
1656
|
}, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
|
|
1669
1657
|
}
|
|
1670
1658
|
});
|
|
1671
|
-
function
|
|
1659
|
+
function vr() {
|
|
1672
1660
|
return N();
|
|
1673
1661
|
}
|
|
1674
|
-
const
|
|
1662
|
+
const to = { class: "content" }, no = { class: "message" }, oo = {
|
|
1675
1663
|
key: 0,
|
|
1676
1664
|
class: "close"
|
|
1677
|
-
},
|
|
1665
|
+
}, ro = {
|
|
1678
1666
|
key: 0,
|
|
1679
1667
|
class: "progress-bar"
|
|
1680
|
-
},
|
|
1668
|
+
}, io = /* @__PURE__ */ q({
|
|
1681
1669
|
__name: "vf-toast",
|
|
1682
1670
|
props: {
|
|
1683
1671
|
position: {},
|
|
@@ -1693,117 +1681,117 @@ const eo = { class: "content" }, to = { class: "message" }, no = {
|
|
|
1693
1681
|
function o() {
|
|
1694
1682
|
t.onClick ? (t.onClick(), t.callback()) : t.disableClose || t.callback();
|
|
1695
1683
|
}
|
|
1696
|
-
const
|
|
1684
|
+
const a = N();
|
|
1697
1685
|
return t.durationSecs !== null && z(() => {
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1700
|
-
duration:
|
|
1686
|
+
const p = t.durationSecs ?? 5;
|
|
1687
|
+
a.value?.animate([{ width: "0%" }, { width: "100%" }], {
|
|
1688
|
+
duration: p * 1e3,
|
|
1701
1689
|
easing: "linear"
|
|
1702
|
-
}), setTimeout(() => t.callback(),
|
|
1703
|
-
}), (
|
|
1704
|
-
class: P(["vf-toast", [
|
|
1690
|
+
}), setTimeout(() => t.callback(), p * 1e3);
|
|
1691
|
+
}), (p, l) => (T(), I("div", {
|
|
1692
|
+
class: P(["vf-toast", [e.className, { top: e.position === "top", bottom: e.position !== "top" }]]),
|
|
1705
1693
|
onClick: Ne(o, ["stop"])
|
|
1706
1694
|
}, [
|
|
1707
|
-
U("div",
|
|
1708
|
-
U("div",
|
|
1709
|
-
|
|
1695
|
+
U("div", to, [
|
|
1696
|
+
U("div", no, J(e.message), 1),
|
|
1697
|
+
e.disableClose ? W("", !0) : (T(), I("div", oo, "x"))
|
|
1710
1698
|
]),
|
|
1711
|
-
|
|
1699
|
+
e.durationSecs !== null ? (T(), I("div", ro, [
|
|
1712
1700
|
U("div", {
|
|
1713
1701
|
ref_key: "progressInnerEl",
|
|
1714
|
-
ref:
|
|
1702
|
+
ref: a,
|
|
1715
1703
|
class: "inner"
|
|
1716
1704
|
}, null, 512)
|
|
1717
1705
|
])) : W("", !0)
|
|
1718
1706
|
], 2));
|
|
1719
1707
|
}
|
|
1720
1708
|
});
|
|
1721
|
-
function
|
|
1722
|
-
const t = ge(
|
|
1709
|
+
function mr(e) {
|
|
1710
|
+
const t = ge(io, {
|
|
1723
1711
|
...e,
|
|
1724
1712
|
callback: () => ie(t)
|
|
1725
1713
|
});
|
|
1726
1714
|
return () => ie(t);
|
|
1727
1715
|
}
|
|
1728
|
-
function io(e) {
|
|
1729
|
-
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];
|
|
1730
|
-
return `${i} ${f}`;
|
|
1731
|
-
}
|
|
1732
1716
|
function ao(e) {
|
|
1733
|
-
|
|
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}`;
|
|
1734
1719
|
}
|
|
1735
1720
|
function so(e) {
|
|
1736
|
-
return e
|
|
1721
|
+
return e != null && String(e).length ? e : "-";
|
|
1737
1722
|
}
|
|
1738
1723
|
function lo(e) {
|
|
1739
|
-
return e
|
|
1724
|
+
return e || "-";
|
|
1740
1725
|
}
|
|
1741
1726
|
function uo(e) {
|
|
1742
|
-
return e &&
|
|
1727
|
+
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ln(Number(e));
|
|
1743
1728
|
}
|
|
1744
1729
|
function co(e) {
|
|
1730
|
+
return e && Un(e);
|
|
1731
|
+
}
|
|
1732
|
+
function fo(e) {
|
|
1745
1733
|
return e ? Zt(e) : null;
|
|
1746
1734
|
}
|
|
1747
1735
|
function vt(e) {
|
|
1748
1736
|
return e ? Xt(e) : null;
|
|
1749
1737
|
}
|
|
1750
|
-
function fo(e) {
|
|
1751
|
-
return e ? e.toUpperCase() : null;
|
|
1752
|
-
}
|
|
1753
1738
|
function ho(e) {
|
|
1754
|
-
return e ?
|
|
1739
|
+
return e ? e.toUpperCase() : null;
|
|
1755
1740
|
}
|
|
1756
1741
|
function po(e) {
|
|
1757
|
-
return e ?
|
|
1742
|
+
return e ? vt(e.toLowerCase()) : null;
|
|
1758
1743
|
}
|
|
1759
|
-
function vo(e
|
|
1760
|
-
return
|
|
1744
|
+
function vo(e) {
|
|
1745
|
+
return e ? jn(e) : null;
|
|
1761
1746
|
}
|
|
1762
1747
|
function mo(e, t) {
|
|
1763
|
-
return
|
|
1748
|
+
return zn(e, t);
|
|
1764
1749
|
}
|
|
1765
1750
|
function go(e, t) {
|
|
1766
|
-
return
|
|
1751
|
+
return _(e).divide(t).value;
|
|
1767
1752
|
}
|
|
1768
1753
|
function yo(e, t) {
|
|
1769
|
-
return e && X(new Date(e), t ??
|
|
1754
|
+
return e && X(new Date(e), t ?? $.defaultDateFormat);
|
|
1770
1755
|
}
|
|
1771
1756
|
function Eo(e, t) {
|
|
1772
|
-
return e && X(new Date(e), t ??
|
|
1757
|
+
return e && X(new Date(e), t ?? $.defaultTimeFormat);
|
|
1758
|
+
}
|
|
1759
|
+
function ko(e, t) {
|
|
1760
|
+
return e && X(new Date(e), t ?? `${$.defaultDateFormat} ${$.defaultTimeFormat}`);
|
|
1773
1761
|
}
|
|
1774
|
-
function
|
|
1775
|
-
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), $.defaultDateFormat);
|
|
1776
1764
|
}
|
|
1777
1765
|
const Ze = {
|
|
1778
|
-
bytes:
|
|
1779
|
-
dash:
|
|
1780
|
-
dashZeros:
|
|
1781
|
-
number:
|
|
1782
|
-
phone:
|
|
1783
|
-
upperFirst:
|
|
1766
|
+
bytes: ao,
|
|
1767
|
+
dash: so,
|
|
1768
|
+
dashZeros: lo,
|
|
1769
|
+
number: uo,
|
|
1770
|
+
phone: co,
|
|
1771
|
+
upperFirst: fo,
|
|
1784
1772
|
startCase: vt,
|
|
1785
|
-
upperCase:
|
|
1786
|
-
upperWords:
|
|
1787
|
-
desnake:
|
|
1788
|
-
usCurrency:
|
|
1789
|
-
divide:
|
|
1790
|
-
date:
|
|
1791
|
-
time:
|
|
1792
|
-
dateTime:
|
|
1793
|
-
oneDayForward:
|
|
1794
|
-
},
|
|
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) => ({
|
|
1795
1783
|
...Ze,
|
|
1796
1784
|
...e(Ze)
|
|
1797
1785
|
}), Ae = Symbol("HookState");
|
|
1798
|
-
function
|
|
1786
|
+
function yr(e, t) {
|
|
1799
1787
|
const o = t ?? Oe();
|
|
1800
1788
|
z(() => wo(o, e), o), st(() => bo(o), o), lt(() => Ge(o), o), me(() => Ge(o), o);
|
|
1801
1789
|
}
|
|
1802
1790
|
function wo(e, t) {
|
|
1803
1791
|
const o = {};
|
|
1804
1792
|
if (t.elScrolledToBottom && (o.el = new oe(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
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);
|
|
1807
1795
|
}
|
|
1808
1796
|
t.windowScrolledToBottom && (o.window = new oe(window, t.windowScrolledToBottom)), e[Ae] = o;
|
|
1809
1797
|
}
|
|
@@ -1815,12 +1803,12 @@ function Ge(e) {
|
|
|
1815
1803
|
const t = e[Ae];
|
|
1816
1804
|
t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
|
|
1817
1805
|
}
|
|
1818
|
-
const
|
|
1806
|
+
const Te = ["auto", "scroll"];
|
|
1819
1807
|
function mt(e) {
|
|
1820
1808
|
const t = e.parentElement;
|
|
1821
1809
|
if (!t) return null;
|
|
1822
1810
|
const o = window.getComputedStyle(t);
|
|
1823
|
-
return
|
|
1811
|
+
return Te.includes(o.overflow) || Te.includes(o.overflowX) || Te.includes(o.overflowY) ? t : mt(t);
|
|
1824
1812
|
}
|
|
1825
1813
|
class oe {
|
|
1826
1814
|
constructor(t, o) {
|
|
@@ -1838,10 +1826,10 @@ class oe {
|
|
|
1838
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);
|
|
1839
1827
|
}
|
|
1840
1828
|
}
|
|
1841
|
-
function
|
|
1829
|
+
function Er(e) {
|
|
1842
1830
|
z(() => window.addEventListener("resize", e)), st(() => window.addEventListener("resize", e)), lt(() => window.removeEventListener("resize", e)), me(() => window.removeEventListener("resize", e));
|
|
1843
1831
|
}
|
|
1844
|
-
const
|
|
1832
|
+
const So = {
|
|
1845
1833
|
mounted: et,
|
|
1846
1834
|
updated: et
|
|
1847
1835
|
}, Qe = Symbol("HasAutoFocused");
|
|
@@ -1852,32 +1840,32 @@ function et(e, t) {
|
|
|
1852
1840
|
setTimeout(() => o.focus(), 10);
|
|
1853
1841
|
}
|
|
1854
1842
|
const To = {
|
|
1855
|
-
mounted:
|
|
1843
|
+
mounted: Io
|
|
1856
1844
|
}, Q = Symbol("ConfirmState");
|
|
1857
|
-
function
|
|
1845
|
+
function Io(e, t) {
|
|
1858
1846
|
e.addEventListener("click", (o) => {
|
|
1859
|
-
const
|
|
1847
|
+
const a = Date.now(), p = t.value?.text !== void 0 ? t.value.text : "Confirm";
|
|
1860
1848
|
if (e[Q]) {
|
|
1861
|
-
if (
|
|
1849
|
+
if (a - e[Q].initTime < 300)
|
|
1862
1850
|
return;
|
|
1863
1851
|
e[Q].resetHandler(), e.dispatchEvent(new Event("confirm"));
|
|
1864
1852
|
return;
|
|
1865
1853
|
}
|
|
1866
1854
|
o.preventDefault(), o.stopImmediatePropagation();
|
|
1867
|
-
const
|
|
1868
|
-
initTime:
|
|
1855
|
+
const l = {
|
|
1856
|
+
initTime: a,
|
|
1869
1857
|
preconfirmHtml: e.innerHTML,
|
|
1870
1858
|
resetHandler: () => {
|
|
1871
|
-
|
|
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];
|
|
1872
1860
|
}
|
|
1873
1861
|
};
|
|
1874
|
-
e[Q] =
|
|
1862
|
+
e[Q] = l, p && (e.innerHTML = p), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", l.resetHandler);
|
|
1875
1863
|
});
|
|
1876
1864
|
}
|
|
1877
|
-
const
|
|
1878
|
-
beforeMount:
|
|
1865
|
+
const Mo = {
|
|
1866
|
+
beforeMount: Co
|
|
1879
1867
|
};
|
|
1880
|
-
function
|
|
1868
|
+
function Co(e) {
|
|
1881
1869
|
e.addEventListener("blur", () => {
|
|
1882
1870
|
let t = e.value;
|
|
1883
1871
|
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + X(/* @__PURE__ */ new Date(), "yy"));
|
|
@@ -1885,105 +1873,105 @@ function Mo(e) {
|
|
|
1885
1873
|
isNaN(o) ? e.value = "" : e.value = X(o, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1886
1874
|
});
|
|
1887
1875
|
}
|
|
1888
|
-
const
|
|
1876
|
+
const Oo = {
|
|
1889
1877
|
beforeMount: tt,
|
|
1890
1878
|
updated: tt
|
|
1891
1879
|
};
|
|
1892
1880
|
function tt(e, t) {
|
|
1893
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1881
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = No(e, t));
|
|
1894
1882
|
}
|
|
1895
|
-
function
|
|
1883
|
+
function No(e, t) {
|
|
1896
1884
|
if (!t.value)
|
|
1897
1885
|
return e.attributes.getNamedItem("placeholder")?.value ?? "";
|
|
1898
1886
|
let o = "";
|
|
1899
|
-
const
|
|
1900
|
-
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());
|
|
1901
1889
|
let y = e.attributes.getNamedItem("format")?.value;
|
|
1902
1890
|
const g = e.attributes.getNamedItem("date-only") !== null;
|
|
1903
1891
|
if (!y && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1904
1892
|
const v = /* @__PURE__ */ new Date();
|
|
1905
|
-
v.getFullYear() ===
|
|
1893
|
+
v.getFullYear() === l.getFullYear() && v.getMonth() === l.getMonth() && v.getDate() === l.getDate() && (o = "at", y = "HH:mm");
|
|
1906
1894
|
}
|
|
1907
1895
|
if (!y && e.attributes.getNamedItem("simplified-date") !== null) {
|
|
1908
1896
|
let v = null;
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1911
|
-
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 : $.defaultTimeFormat;
|
|
1912
1900
|
y = ut([v, n]).join(" ");
|
|
1913
1901
|
}
|
|
1914
|
-
y || (g ? y =
|
|
1915
|
-
let E = X(
|
|
1902
|
+
y || (g ? y = $.defaultDateFormat : y = `${$.defaultDateFormat} ${$.defaultTimeFormat}`);
|
|
1903
|
+
let E = X(l, y);
|
|
1916
1904
|
return o && (E = o + " " + E), E;
|
|
1917
1905
|
}
|
|
1918
|
-
const
|
|
1906
|
+
const Lo = {
|
|
1919
1907
|
beforeMount: nt,
|
|
1920
1908
|
updated: nt,
|
|
1921
|
-
unmounted:
|
|
1909
|
+
unmounted: Ro
|
|
1922
1910
|
};
|
|
1923
1911
|
function nt(e, t) {
|
|
1924
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");
|
|
1925
1913
|
}
|
|
1926
|
-
function
|
|
1914
|
+
function Ro(e) {
|
|
1927
1915
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1928
1916
|
}
|
|
1929
|
-
const
|
|
1917
|
+
const Fo = {
|
|
1930
1918
|
beforeMount: ot,
|
|
1931
1919
|
updated: ot,
|
|
1932
1920
|
unmounted: yt
|
|
1933
|
-
}, ae = Symbol("HasAutoFocused"),
|
|
1934
|
-
function
|
|
1935
|
-
|
|
1921
|
+
}, ae = Symbol("HasAutoFocused"), De = [];
|
|
1922
|
+
function Ao() {
|
|
1923
|
+
De.forEach(gt);
|
|
1936
1924
|
}
|
|
1937
|
-
setInterval(
|
|
1925
|
+
setInterval(Ao, 1e3);
|
|
1938
1926
|
function ot(e, t) {
|
|
1939
1927
|
if (t.value == t.oldValue) return;
|
|
1940
1928
|
if (!t.value) return yt(e);
|
|
1941
|
-
const o = new Date(t.value),
|
|
1942
|
-
e[ae] ||
|
|
1943
|
-
startTs:
|
|
1944
|
-
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
|
|
1945
1933
|
}, gt(e);
|
|
1946
1934
|
}
|
|
1947
1935
|
function gt(e) {
|
|
1948
1936
|
const t = e[ae], o = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1949
|
-
e.innerText =
|
|
1937
|
+
e.innerText = Do(o, t.includeSeconds);
|
|
1950
1938
|
}
|
|
1951
1939
|
function yt(e) {
|
|
1952
|
-
e[ae] && (Gt(
|
|
1953
|
-
}
|
|
1954
|
-
function Ao(e, t) {
|
|
1955
|
-
const o = [], i = Math.floor(e / 86400);
|
|
1956
|
-
i && o.push(i + "d"), e -= i * 86400;
|
|
1957
|
-
const f = Math.floor(e / 3600);
|
|
1958
|
-
(i || f) && o.push(f + "h"), e -= f * 3600;
|
|
1959
|
-
const u = Math.floor(e / 60);
|
|
1960
|
-
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 = "-";
|
|
1961
1941
|
}
|
|
1962
|
-
|
|
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 $o = {
|
|
1963
1951
|
mounted: Et,
|
|
1964
|
-
updated:
|
|
1952
|
+
updated: Ho,
|
|
1965
1953
|
unmounted: kt
|
|
1966
1954
|
}, Y = /* @__PURE__ */ new Map();
|
|
1967
1955
|
function Et(e, t) {
|
|
1968
|
-
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]);
|
|
1969
1957
|
}
|
|
1970
1958
|
function kt(e, t) {
|
|
1971
1959
|
const o = Y.get(t.value.toLowerCase());
|
|
1972
1960
|
if (o) {
|
|
1973
|
-
const
|
|
1974
|
-
|
|
1961
|
+
const a = o.indexOf(e);
|
|
1962
|
+
a !== -1 && o.splice(a, 1), o.length === 0 && Y.delete(t.value.toLowerCase());
|
|
1975
1963
|
}
|
|
1976
|
-
Y.size === 0 && window.removeEventListener("keydown",
|
|
1964
|
+
Y.size === 0 && window.removeEventListener("keydown", xt);
|
|
1977
1965
|
}
|
|
1978
|
-
function
|
|
1966
|
+
function Ho(e, t) {
|
|
1979
1967
|
kt(e, t), Et(e, t);
|
|
1980
1968
|
}
|
|
1981
|
-
function
|
|
1969
|
+
function xt(e) {
|
|
1982
1970
|
if (typeof e.key != "string") return;
|
|
1983
1971
|
const t = e.key.toLowerCase(), o = Y.get(t);
|
|
1984
1972
|
o && (Qt(o)?.click(), e.preventDefault());
|
|
1985
1973
|
}
|
|
1986
|
-
const ee = Symbol("InfiniteScrollHandler"),
|
|
1974
|
+
const ee = Symbol("InfiniteScrollHandler"), Vo = {
|
|
1987
1975
|
mounted(e, t) {
|
|
1988
1976
|
e[ee] = new oe(e, t.value);
|
|
1989
1977
|
},
|
|
@@ -1993,18 +1981,18 @@ const ee = Symbol("InfiniteScrollHandler"), Ho = {
|
|
|
1993
1981
|
unmounted(e) {
|
|
1994
1982
|
e[ee]?.uninstall(), delete e[ee];
|
|
1995
1983
|
}
|
|
1996
|
-
},
|
|
1984
|
+
}, Bo = {
|
|
1997
1985
|
beforeMount: rt,
|
|
1998
1986
|
updated: rt
|
|
1999
1987
|
};
|
|
2000
1988
|
function rt(e, t) {
|
|
2001
1989
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
2002
1990
|
}
|
|
2003
|
-
const Ie = /* @__PURE__ */ new WeakMap(),
|
|
1991
|
+
const Ie = /* @__PURE__ */ new WeakMap(), _o = {
|
|
2004
1992
|
beforeMount(e) {
|
|
2005
1993
|
const t = new ResizeObserver(() => {
|
|
2006
|
-
const o = e.
|
|
2007
|
-
e.style.minWidth = `${
|
|
1994
|
+
const o = window.getComputedStyle(e).minWidth.match(/^(\d+)px$/)?.[1], a = o ? parseInt(o, 10) : 0;
|
|
1995
|
+
e.clientWidth <= a || (e.style.minWidth = `${e.clientWidth}px`);
|
|
2008
1996
|
});
|
|
2009
1997
|
Ie.set(e, t), t.observe(e);
|
|
2010
1998
|
},
|
|
@@ -2012,26 +2000,26 @@ const Ie = /* @__PURE__ */ new WeakMap(), $o = {
|
|
|
2012
2000
|
const t = Ie.get(e);
|
|
2013
2001
|
t && (t.unobserve(e), Ie.delete(e));
|
|
2014
2002
|
}
|
|
2015
|
-
},
|
|
2003
|
+
}, Wo = {
|
|
2016
2004
|
mounted: it,
|
|
2017
2005
|
updated: it,
|
|
2018
|
-
unmounted:
|
|
2006
|
+
unmounted: wt
|
|
2019
2007
|
}, re = Symbol("TooltipState");
|
|
2020
2008
|
function it(e, t) {
|
|
2021
2009
|
let o = e.attributes.getNamedItem("tip")?.value ?? t.value;
|
|
2022
2010
|
if (t.value || (o = null), o) {
|
|
2023
|
-
const
|
|
2011
|
+
const a = {
|
|
2024
2012
|
content: o,
|
|
2025
2013
|
html: e.getAttribute("html") !== null
|
|
2026
2014
|
};
|
|
2027
|
-
e[re] ? e[re].configure(
|
|
2015
|
+
e[re] ? e[re].configure(a) : e[re] = new Po(e, a);
|
|
2028
2016
|
} else
|
|
2029
|
-
|
|
2017
|
+
wt(e);
|
|
2030
2018
|
}
|
|
2031
|
-
function
|
|
2019
|
+
function wt(e) {
|
|
2032
2020
|
e[re]?.destroy(), delete e[re];
|
|
2033
2021
|
}
|
|
2034
|
-
class
|
|
2022
|
+
class Po {
|
|
2035
2023
|
constructor(t, o) {
|
|
2036
2024
|
this.el = t, this.config = o, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
2037
2025
|
}
|
|
@@ -2067,9 +2055,9 @@ class Wo {
|
|
|
2067
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);
|
|
2068
2056
|
}
|
|
2069
2057
|
handleMouseMove(t) {
|
|
2070
|
-
const o = this.tipEl.offsetWidth,
|
|
2058
|
+
const o = this.tipEl.offsetWidth, a = this.tipEl.offsetHeight, p = window.innerWidth, l = window.innerHeight;
|
|
2071
2059
|
let y = t.pageX + 10, g = t.pageY + 20;
|
|
2072
|
-
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;
|
|
2073
2061
|
}
|
|
2074
2062
|
checkMoveEvent() {
|
|
2075
2063
|
this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
|
|
@@ -2078,64 +2066,64 @@ class Wo {
|
|
|
2078
2066
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
|
|
2079
2067
|
}
|
|
2080
2068
|
}
|
|
2081
|
-
function
|
|
2082
|
-
e.directive("autofocus",
|
|
2069
|
+
function jo(e) {
|
|
2070
|
+
e.directive("autofocus", So), e.directive("confirm-button", To), e.directive("date-input", Mo), e.directive("datetime", Oo), e.directive("disabled", Lo), e.directive("duration", Fo), e.directive("hotkey", $o), e.directive("infinite-scroll", Vo), e.directive("readonly", Bo), e.directive("tooltip", Wo), e.directive("sticky-min-width", _o);
|
|
2083
2071
|
}
|
|
2084
|
-
function
|
|
2085
|
-
|
|
2072
|
+
function kr(e) {
|
|
2073
|
+
jo(e);
|
|
2086
2074
|
}
|
|
2087
2075
|
export {
|
|
2088
|
-
|
|
2076
|
+
Xo as OverlayContainer,
|
|
2089
2077
|
ye as UserError,
|
|
2090
|
-
|
|
2078
|
+
Ko as VfAjaxSelect,
|
|
2091
2079
|
le as VfAlertModal,
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
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,
|
|
2099
2087
|
ge as createOverlayInjection,
|
|
2100
|
-
|
|
2088
|
+
jn as desnakeCase,
|
|
2101
2089
|
dn as dismissOverlayInjectionById,
|
|
2102
|
-
|
|
2090
|
+
Zo as dismissOverlayInjectionByInstance,
|
|
2103
2091
|
ct as dismissOverlayInjectionByInternalInstance,
|
|
2104
2092
|
cn as dismissOverlayInjectionByVnode,
|
|
2105
2093
|
br as escapeHtml,
|
|
2106
2094
|
pn as formatError,
|
|
2107
2095
|
Ln as formatNumber,
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2096
|
+
Un as formatPhone,
|
|
2097
|
+
zn as formatUSCurrency,
|
|
2098
|
+
or as handleError,
|
|
2099
|
+
nr as handleErrorAndAlert,
|
|
2100
|
+
kr as installVf,
|
|
2113
2101
|
vn as isError,
|
|
2114
2102
|
Ye as isNotNullOrUndefined,
|
|
2115
|
-
|
|
2103
|
+
rr as maskComponent,
|
|
2116
2104
|
mn as maskEl,
|
|
2117
2105
|
gn as maskForm,
|
|
2118
|
-
|
|
2119
|
-
|
|
2106
|
+
fr as nl2br,
|
|
2107
|
+
cr as nullifyEmptyInputs,
|
|
2120
2108
|
Le as presentOverlay,
|
|
2121
2109
|
ie as removeOverlayInjection,
|
|
2122
|
-
|
|
2110
|
+
ar as replaceElement,
|
|
2123
2111
|
hn as showAlert,
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2112
|
+
Go as showConfirm,
|
|
2113
|
+
Qo as showConfirmDestroy,
|
|
2114
|
+
sr as showContextMenu,
|
|
2115
|
+
tr as showMutableWait,
|
|
2116
|
+
mr as showToast,
|
|
2117
|
+
er as showWait,
|
|
2130
2118
|
Nn as sleep,
|
|
2131
|
-
|
|
2119
|
+
lr as sleepSecs,
|
|
2132
2120
|
Re as toError,
|
|
2133
|
-
|
|
2121
|
+
ir as unmaskComponent,
|
|
2134
2122
|
dt as unmaskEl,
|
|
2135
2123
|
ft as unmaskForm,
|
|
2136
2124
|
fn as updateOverlayProps,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2125
|
+
yr as useInfiniteScroll,
|
|
2126
|
+
Er as useResizeWatcher,
|
|
2127
|
+
hr as uuid,
|
|
2128
|
+
vr as vfModalRef
|
|
2141
2129
|
};
|