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