@signal24/vue-foundation 4.30.1 → 4.30.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as q, ref as N, computed as O, watch as H, onMounted as z, createElementBlock as I, withDirectives as fe, openBlock as T, createElementVNode as U, toDisplayString as J, createCommentVNode as W, Fragment as he, renderList as pe, vModelSelect as Ht, getCurrentInstance as
|
|
2
|
-
import { compact as ut, cloneDeep as qt, uniq as Jt, groupBy as Kt, isEqual as
|
|
1
|
+
import { defineComponent as q, ref as N, computed as O, watch as H, onMounted as z, createElementBlock as I, withDirectives as fe, openBlock as T, createElementVNode as U, toDisplayString as J, createCommentVNode as W, Fragment as he, renderList as pe, vModelSelect as Ht, getCurrentInstance as Ne, withModifiers as Le, normalizeStyle as Vt, normalizeClass as P, renderSlot as K, reactive as Bt, h as ve, Teleport as _t, markRaw as Wt, onBeforeUnmount as me, resolveDirective as Pt, createBlock as at, createSlots as jt, withCtx as Se, createTextVNode as te, onUpdated as Ut, vModelText as zt, onActivated as st, onDeactivated as lt } from "vue";
|
|
2
|
+
import { compact as ut, cloneDeep as qt, uniq as Jt, groupBy as Kt, isEqual as Ce, debounce as Yt, startCase as Xt, upperFirst as Zt, remove as Gt, last as Qt } from "lodash";
|
|
3
3
|
import { configureOpenApiClient as en, OpenApiError as tn } from "@signal24/openapi-client-codegen";
|
|
4
4
|
import { escapeHtml as br } from "@vue/shared";
|
|
5
5
|
import { format as X, addDays as nn, parse as on } from "date-fns";
|
|
@@ -64,7 +64,7 @@ const ln = /* @__PURE__ */ q({
|
|
|
64
64
|
anchor: {}
|
|
65
65
|
},
|
|
66
66
|
setup(e) {
|
|
67
|
-
const t = e, o = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, a = N({ visibility: "hidden", top: "0", left: "0" }), p = N([]), l =
|
|
67
|
+
const t = e, o = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, a = N({ visibility: "hidden", top: "0", left: "0" }), p = N([]), l = Ne();
|
|
68
68
|
z(y);
|
|
69
69
|
function y() {
|
|
70
70
|
if (!l) return;
|
|
@@ -108,7 +108,7 @@ const ln = /* @__PURE__ */ q({
|
|
|
108
108
|
}), (v, c) => (T(), I("div", {
|
|
109
109
|
class: P(["vf-overlay-anchor", p.value]),
|
|
110
110
|
style: Vt(a.value),
|
|
111
|
-
onClick:
|
|
111
|
+
onClick: Le(E, ["stop"])
|
|
112
112
|
}, [
|
|
113
113
|
K(v.$slots, "default")
|
|
114
114
|
], 6));
|
|
@@ -159,7 +159,7 @@ function ie(e) {
|
|
|
159
159
|
const t = j.indexOf(e);
|
|
160
160
|
t >= 0 && j.splice(t, 1);
|
|
161
161
|
}
|
|
162
|
-
async function
|
|
162
|
+
async function Re(e, t, o) {
|
|
163
163
|
return new Promise((a) => {
|
|
164
164
|
let p = null;
|
|
165
165
|
const y = { ...t, callback: async (g) => {
|
|
@@ -185,18 +185,18 @@ function se(e, t) {
|
|
|
185
185
|
} : { title: t ? e : void 0, message: t ?? e, classes: [] };
|
|
186
186
|
}
|
|
187
187
|
async function hn(e, t) {
|
|
188
|
-
await
|
|
188
|
+
await Re(le, se(e, t));
|
|
189
189
|
}
|
|
190
190
|
async function Go(e, t) {
|
|
191
191
|
const o = se(e, t);
|
|
192
|
-
return await
|
|
192
|
+
return await Re(le, {
|
|
193
193
|
...o,
|
|
194
194
|
shouldConfirm: !0
|
|
195
195
|
}) === !0;
|
|
196
196
|
}
|
|
197
197
|
async function Qo(e, t) {
|
|
198
198
|
const o = se(e, t);
|
|
199
|
-
return await
|
|
199
|
+
return await Re(le, {
|
|
200
200
|
...o,
|
|
201
201
|
shouldConfirm: !0,
|
|
202
202
|
classes: ["destructive", ...o.classes]
|
|
@@ -235,27 +235,28 @@ class ye extends Error {
|
|
|
235
235
|
function pn(e) {
|
|
236
236
|
return e instanceof ye ? e.message : `An application error has occurred:
|
|
237
237
|
|
|
238
|
-
${
|
|
238
|
+
${Ee(e).message}
|
|
239
239
|
|
|
240
240
|
Please refresh the page and try again. If this error persists, ${$.unhandledErrorSupportText}.`;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
|
|
242
|
+
function Ee(e, t) {
|
|
243
|
+
const o = vn(e) ? e : new Error(String(e));
|
|
244
|
+
return t && (o.cause = Ee(t)), o;
|
|
244
245
|
}
|
|
245
246
|
function vn(e) {
|
|
246
247
|
return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
|
|
247
248
|
}
|
|
248
249
|
async function nr(e, t) {
|
|
249
|
-
const o =
|
|
250
|
+
const o = Ee(e, t?.cause);
|
|
250
251
|
return o instanceof ye || $.errorHandler(o), hn({
|
|
251
252
|
title: t?.title,
|
|
252
253
|
message: o,
|
|
253
254
|
classes: t?.classes
|
|
254
255
|
});
|
|
255
256
|
}
|
|
256
|
-
async function or(e) {
|
|
257
|
-
const
|
|
258
|
-
|
|
257
|
+
async function or(e, t) {
|
|
258
|
+
const o = Ee(e, t);
|
|
259
|
+
o instanceof ye || $.errorHandler(o);
|
|
259
260
|
}
|
|
260
261
|
const ne = Symbol("MaskState");
|
|
261
262
|
function rr(e, t) {
|
|
@@ -276,7 +277,7 @@ function mn(e, t) {
|
|
|
276
277
|
function dt(e) {
|
|
277
278
|
e[ne] && e.removeChild(e[ne].maskEl);
|
|
278
279
|
}
|
|
279
|
-
const
|
|
280
|
+
const Oe = Symbol("FormMaskState");
|
|
280
281
|
function gn(e, t, o) {
|
|
281
282
|
const a = e instanceof Element ? e : ht(e);
|
|
282
283
|
if (!a) return () => {
|
|
@@ -286,7 +287,7 @@ function gn(e, t, o) {
|
|
|
286
287
|
let l;
|
|
287
288
|
p && (l = p.tagName === "INPUT" ? p.value : p.innerHTML, p.setAttribute("disabled", "disabled"), p.innerText = o ?? "Please wait...");
|
|
288
289
|
const g = [...a.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
289
|
-
return g.forEach((E) => E.setAttribute("disabled", "disabled")), a[
|
|
290
|
+
return g.forEach((E) => E.setAttribute("disabled", "disabled")), a[Oe] = {
|
|
290
291
|
disabledElements: g,
|
|
291
292
|
waitButton: p,
|
|
292
293
|
buttonHtml: l
|
|
@@ -295,8 +296,8 @@ function gn(e, t, o) {
|
|
|
295
296
|
function ft(e) {
|
|
296
297
|
const t = e instanceof Element ? e : ht(e);
|
|
297
298
|
if (!t) return;
|
|
298
|
-
const o = t[
|
|
299
|
-
o && (t.classList.remove("vf-masked"), o.disabledElements.forEach((a) => a.removeAttribute("disabled")), o.waitButton && (o.waitButton.innerHTML = o.buttonHtml, o.waitButton.removeAttribute("disabled")), delete t[
|
|
299
|
+
const o = t[Oe];
|
|
300
|
+
o && (t.classList.remove("vf-masked"), o.disabledElements.forEach((a) => a.removeAttribute("disabled")), o.waitButton && (o.waitButton.innerHTML = o.buttonHtml, o.waitButton.removeAttribute("disabled")), delete t[Oe]);
|
|
300
301
|
}
|
|
301
302
|
function ht(e) {
|
|
302
303
|
const t = e?.$?.vnode.el;
|
|
@@ -319,7 +320,7 @@ const yn = ["id"], En = {
|
|
|
319
320
|
},
|
|
320
321
|
emits: ["formSubmit"],
|
|
321
322
|
setup(e, { expose: t }) {
|
|
322
|
-
const o =
|
|
323
|
+
const o = Ne(), a = e;
|
|
323
324
|
t({ mask: n, unmask: i, hide: r, unhide: s });
|
|
324
325
|
const p = N(), l = N(), y = N(!1), g = O(() => ut([...Array.isArray(a.class) ? a.class : [a.class], y.value && "hidden"]));
|
|
325
326
|
z(() => {
|
|
@@ -362,7 +363,7 @@ const yn = ["id"], En = {
|
|
|
362
363
|
ref: l,
|
|
363
364
|
action: ".",
|
|
364
365
|
class: P(["vf-modal", { scrolls: e.scrolls }]),
|
|
365
|
-
onSubmit: h[0] || (h[0] =
|
|
366
|
+
onSubmit: h[0] || (h[0] = Le((f) => u.$emit("formSubmit"), ["prevent"]))
|
|
366
367
|
}, [
|
|
367
368
|
u.$slots.header ? (T(), I("div", En, [
|
|
368
369
|
K(u.$slots, "header"),
|
|
@@ -401,7 +402,7 @@ const yn = ["id"], En = {
|
|
|
401
402
|
class: P(["vf-alert", ...e.classes ?? []]),
|
|
402
403
|
scrolls: ""
|
|
403
404
|
}, jt({
|
|
404
|
-
default:
|
|
405
|
+
default: Se(() => [
|
|
405
406
|
e.iconClass ? (T(), I("i", {
|
|
406
407
|
key: 0,
|
|
407
408
|
class: P(["vf-alert-icon", e.iconClass])
|
|
@@ -419,14 +420,14 @@ const yn = ["id"], En = {
|
|
|
419
420
|
}, [
|
|
420
421
|
e.title ? {
|
|
421
422
|
name: "header",
|
|
422
|
-
fn:
|
|
423
|
+
fn: Se(() => [
|
|
423
424
|
te(J(e.title), 1)
|
|
424
425
|
]),
|
|
425
426
|
key: "0"
|
|
426
427
|
} : void 0,
|
|
427
428
|
e.isBare ? void 0 : {
|
|
428
429
|
name: "footer",
|
|
429
|
-
fn:
|
|
430
|
+
fn: Se(() => [
|
|
430
431
|
e.shouldConfirm ? (T(), I(he, { key: 0 }, [
|
|
431
432
|
fe((T(), I("button", {
|
|
432
433
|
class: "primary",
|
|
@@ -981,8 +982,8 @@ function Mn() {
|
|
|
981
982
|
this.opt = i;
|
|
982
983
|
var s = 0, u = "wrapMatches", h = this.getSeparatedKeywords(typeof n == "string" ? [n] : n), f = h.keywords, m = h.length, w = this.opt.caseSensitive ? "" : "i", S = function C(L) {
|
|
983
984
|
var R = new RegExp(r.createRegExp(L), "gm" + w), F = 0;
|
|
984
|
-
r.log('Searching with expression "' + R + '"'), r[u](R, 1, function(V,
|
|
985
|
-
return r.opt.filter(
|
|
985
|
+
r.log('Searching with expression "' + R + '"'), r[u](R, 1, function(V, ke) {
|
|
986
|
+
return r.opt.filter(ke, L, s, F);
|
|
986
987
|
}, function(V) {
|
|
987
988
|
F++, s++, r.opt.each(V);
|
|
988
989
|
}, function() {
|
|
@@ -1281,15 +1282,15 @@ for (let e = 0; e < 256; ++e)
|
|
|
1281
1282
|
function Hn(e, t = 0) {
|
|
1282
1283
|
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();
|
|
1283
1284
|
}
|
|
1284
|
-
let
|
|
1285
|
+
let Te;
|
|
1285
1286
|
const Vn = new Uint8Array(16);
|
|
1286
1287
|
function Bn() {
|
|
1287
|
-
if (!
|
|
1288
|
+
if (!Te) {
|
|
1288
1289
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1289
1290
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1290
|
-
|
|
1291
|
+
Te = crypto.getRandomValues.bind(crypto);
|
|
1291
1292
|
}
|
|
1292
|
-
return
|
|
1293
|
+
return Te(Vn);
|
|
1293
1294
|
}
|
|
1294
1295
|
const _n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Xe = { randomUUID: _n };
|
|
1295
1296
|
function Wn(e, t, o) {
|
|
@@ -1368,14 +1369,14 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1368
1369
|
t({
|
|
1369
1370
|
addRemoteOption: $t
|
|
1370
1371
|
});
|
|
1371
|
-
const g = N(), E = N(), v = N(), c = N(!1), n = N(), i = N(!1), r = N(""), s = N(null), u = N(null), h = N(!1), f = N(null), m = N(!1), w = O(() => l.showCreateTextOnNewItem ?? !0), S = O(() => !!(l.options || n.value)), C = O(() => l.options ?? n.value ?? []), L = O(() => l.prependOptions ?? []), R = O(() => l.appendOptions ?? []), F = O(() => !!l.disabled || !S.value && !l.loadOptions), V = O(() => l.loadingText || "..."),
|
|
1372
|
+
const g = N(), E = N(), v = N(), c = N(!1), n = N(), i = N(!1), r = N(""), s = N(null), u = N(null), h = N(!1), f = N(null), m = N(!1), w = O(() => l.showCreateTextOnNewItem ?? !0), S = O(() => !!(l.options || n.value)), C = O(() => l.options ?? n.value ?? []), L = O(() => l.prependOptions ?? []), R = O(() => l.appendOptions ?? []), F = O(() => !!l.disabled || !S.value && !l.loadOptions), V = O(() => l.loadingText || "..."), ke = O(() => !S.value && (!l.loadOptions || l.preload || l.modelValue && (l.valueField || l.valueExtractor)) ? V.value : l.nullTitle ? l.nullTitle : l.placeholder || ""), bt = O(() => l.noResultsText || "No options match your search."), Z = O(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (d) => d[l.valueField] : null), xe = O(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (d) => String(d[l.keyField]) : Z.value ? (d) => String(Z.value(d)) : null), St = O(() => l.groupFormatter ? l.groupFormatter : l.groupField ? (d) => String(d[l.groupField]) : null), $e = O(() => l.formatter ? l.formatter : l.labelField ? (d) => String(d[l.labelField]) : (d) => String(d)), He = O(() => l.selectionFormatter ? l.selectionFormatter : $e.value), Ve = O(() => [...L.value, ...C.value, ...R.value]), Be = O(() => !!(l.groupField || l.groupFormatter)), we = O(() => Ve.value.map((d, b) => {
|
|
1372
1373
|
const k = St.value?.(d), x = $e.value(d), M = l.subtitleFormatter?.(d), B = x ? x.trim().toLowerCase() : "", qe = M ? M.trim().toLowerCase() : "", ue = [];
|
|
1373
1374
|
return l.searchFields ? l.searchFields.forEach((Je) => {
|
|
1374
1375
|
d[Je] && ue.push(
|
|
1375
1376
|
String(d[Je]).toLowerCase().replace(/^[a-z0-9 ]+$/i, "")
|
|
1376
1377
|
);
|
|
1377
1378
|
}) : (ue.push(B), qe && ue.push(qe)), {
|
|
1378
|
-
key:
|
|
1379
|
+
key: xe.value?.(d) ?? String(b),
|
|
1379
1380
|
group: k,
|
|
1380
1381
|
title: x,
|
|
1381
1382
|
subtitle: M,
|
|
@@ -1383,7 +1384,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1383
1384
|
ref: d
|
|
1384
1385
|
};
|
|
1385
1386
|
})), D = O(() => {
|
|
1386
|
-
let d = [...
|
|
1387
|
+
let d = [...we.value];
|
|
1387
1388
|
if (i.value) {
|
|
1388
1389
|
const b = r.value.trim().toLowerCase().replace(/[^a-z0-9 ]+$/i, "");
|
|
1389
1390
|
b.length && (d = d.filter((k) => k.searchContent.includes(b)), m.value && (d.find((x) => x.searchContent === b) !== void 0 || d.push({
|
|
@@ -1409,7 +1410,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1409
1410
|
options: b[k]
|
|
1410
1411
|
}));
|
|
1411
1412
|
});
|
|
1412
|
-
H(() => l.modelValue, G), H(
|
|
1413
|
+
H(() => l.modelValue, G), H(we, () => {
|
|
1413
1414
|
h.value && setTimeout(je, 0);
|
|
1414
1415
|
}), H(r, () => {
|
|
1415
1416
|
i.value && !l.remoteSearch && !r.value.trim().length && (i.value = !1);
|
|
@@ -1420,7 +1421,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1420
1421
|
}), z(async () => {
|
|
1421
1422
|
m.value = l.onCreateItem !== void 0, l.loadOptions && l.preload ? await _e() : !l.options && !l.loadOptions && (l.valueField || l.valueExtractor) || G(), H(s, () => {
|
|
1422
1423
|
const d = Ye(s.value) && Z.value !== null ? Z.value(s.value) : s.value;
|
|
1423
|
-
|
|
1424
|
+
Ce(l.modelValue, d) || y("update:modelValue", d);
|
|
1424
1425
|
}), l.remoteSearch && H(r, Yt(It, 250));
|
|
1425
1426
|
}), me(() => {
|
|
1426
1427
|
v.value?.remove();
|
|
@@ -1446,11 +1447,11 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1446
1447
|
return;
|
|
1447
1448
|
}
|
|
1448
1449
|
if (d.key == "ArrowUp" || d.key == "ArrowDown")
|
|
1449
|
-
return d.preventDefault(),
|
|
1450
|
+
return d.preventDefault(), be(d.key == "ArrowUp" ? -1 : 1);
|
|
1450
1451
|
if (d.key == "PageUp" || d.key == "PageDown")
|
|
1451
|
-
return d.preventDefault(),
|
|
1452
|
+
return d.preventDefault(), be(d.key == "PageUp" ? -10 : 10);
|
|
1452
1453
|
if (d.key == "Home" || d.key == "End")
|
|
1453
|
-
return d.preventDefault(),
|
|
1454
|
+
return d.preventDefault(), be(d.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
|
|
1454
1455
|
if (d.key == "Enter") {
|
|
1455
1456
|
d.preventDefault();
|
|
1456
1457
|
const b = D.value.find((k) => k.key == f.value);
|
|
@@ -1473,13 +1474,13 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1473
1474
|
s.value ? f.value = Nt(s.value) : l.nullTitle && (f.value = a);
|
|
1474
1475
|
}
|
|
1475
1476
|
function Nt(d) {
|
|
1476
|
-
return
|
|
1477
|
+
return xe.value ? xe.value(s.value) : Lt(d)?.key ?? "";
|
|
1477
1478
|
}
|
|
1478
1479
|
function Lt(d) {
|
|
1479
1480
|
const b = D.value.find((M) => M.ref === d);
|
|
1480
1481
|
if (b)
|
|
1481
1482
|
return b;
|
|
1482
|
-
const k = l.keyExtractor ? (M, B) => l.keyExtractor(M) === l.keyExtractor(B) :
|
|
1483
|
+
const k = l.keyExtractor ? (M, B) => l.keyExtractor(M) === l.keyExtractor(B) : Ce, x = D.value.find((M) => k(M.ref, d));
|
|
1483
1484
|
return x || null;
|
|
1484
1485
|
}
|
|
1485
1486
|
function Rt() {
|
|
@@ -1506,7 +1507,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1506
1507
|
function Dt(d) {
|
|
1507
1508
|
f.value = d ? d.key : null;
|
|
1508
1509
|
}
|
|
1509
|
-
function
|
|
1510
|
+
function be(d) {
|
|
1510
1511
|
const b = D.value.findIndex((B) => B.key == f.value);
|
|
1511
1512
|
let k = b + d;
|
|
1512
1513
|
if (k < 0 ? k = 0 : k >= D.value.length && (k = D.value.length - 1), b == k) return;
|
|
@@ -1521,7 +1522,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1521
1522
|
const b = r.value.trim();
|
|
1522
1523
|
r.value = "", s.value = null, u.value = null, l.onCreateItem?.(b);
|
|
1523
1524
|
} else {
|
|
1524
|
-
const k =
|
|
1525
|
+
const k = we.value.find((x) => x.key == d.key).ref;
|
|
1525
1526
|
s.value = k, u.value = He.value(k), r.value = u.value ?? "";
|
|
1526
1527
|
}
|
|
1527
1528
|
E.value?.blur(), ze();
|
|
@@ -1566,7 +1567,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1566
1567
|
type: "text",
|
|
1567
1568
|
disabled: F.value,
|
|
1568
1569
|
class: P({ nullable: !!e.nullTitle }),
|
|
1569
|
-
placeholder:
|
|
1570
|
+
placeholder: ke.value,
|
|
1570
1571
|
required: e.required,
|
|
1571
1572
|
name: e.name,
|
|
1572
1573
|
"data-1p-ignore": "",
|
|
@@ -1643,7 +1644,7 @@ const qn = ["disabled", "placeholder", "required", "name"], Jn = {
|
|
|
1643
1644
|
y.value = a.value.find((E) => E.value === g) ?? null;
|
|
1644
1645
|
}
|
|
1645
1646
|
), H(y, (g) => {
|
|
1646
|
-
const E = g ? a.value.find((v) =>
|
|
1647
|
+
const E = g ? a.value.find((v) => Ce(v, g))?.value : null;
|
|
1647
1648
|
l("update:modelValue", E ?? null);
|
|
1648
1649
|
}), (g, E) => (T(), at(eo, {
|
|
1649
1650
|
modelValue: y.value,
|
|
@@ -1690,7 +1691,7 @@ const to = { class: "content" }, no = { class: "message" }, oo = {
|
|
|
1690
1691
|
}), setTimeout(() => t.callback(), p * 1e3);
|
|
1691
1692
|
}), (p, l) => (T(), I("div", {
|
|
1692
1693
|
class: P(["vf-toast", [e.className, { top: e.position === "top", bottom: e.position !== "top" }]]),
|
|
1693
|
-
onClick:
|
|
1694
|
+
onClick: Le(o, ["stop"])
|
|
1694
1695
|
}, [
|
|
1695
1696
|
U("div", to, [
|
|
1696
1697
|
U("div", no, J(e.message), 1),
|
|
@@ -1784,7 +1785,7 @@ const Ze = {
|
|
|
1784
1785
|
...e(Ze)
|
|
1785
1786
|
}), Ae = Symbol("HookState");
|
|
1786
1787
|
function yr(e, t) {
|
|
1787
|
-
const o = t ??
|
|
1788
|
+
const o = t ?? Ne();
|
|
1788
1789
|
z(() => wo(o, e), o), st(() => bo(o), o), lt(() => Ge(o), o), me(() => Ge(o), o);
|
|
1789
1790
|
}
|
|
1790
1791
|
function wo(e, t) {
|
|
@@ -1803,12 +1804,12 @@ function Ge(e) {
|
|
|
1803
1804
|
const t = e[Ae];
|
|
1804
1805
|
t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
|
|
1805
1806
|
}
|
|
1806
|
-
const
|
|
1807
|
+
const Ie = ["auto", "scroll"];
|
|
1807
1808
|
function mt(e) {
|
|
1808
1809
|
const t = e.parentElement;
|
|
1809
1810
|
if (!t) return null;
|
|
1810
1811
|
const o = window.getComputedStyle(t);
|
|
1811
|
-
return
|
|
1812
|
+
return Ie.includes(o.overflow) || Ie.includes(o.overflowX) || Ie.includes(o.overflowY) ? t : mt(t);
|
|
1812
1813
|
}
|
|
1813
1814
|
class oe {
|
|
1814
1815
|
constructor(t, o) {
|
|
@@ -1988,17 +1989,17 @@ const ee = Symbol("InfiniteScrollHandler"), Vo = {
|
|
|
1988
1989
|
function rt(e, t) {
|
|
1989
1990
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1990
1991
|
}
|
|
1991
|
-
const
|
|
1992
|
+
const Me = /* @__PURE__ */ new WeakMap(), _o = {
|
|
1992
1993
|
beforeMount(e) {
|
|
1993
1994
|
const t = new ResizeObserver(() => {
|
|
1994
1995
|
const o = window.getComputedStyle(e).minWidth.match(/^(\d+)px$/)?.[1], a = o ? parseInt(o, 10) : 0;
|
|
1995
1996
|
e.clientWidth <= a || (e.style.minWidth = `${e.clientWidth}px`);
|
|
1996
1997
|
});
|
|
1997
|
-
|
|
1998
|
+
Me.set(e, t), t.observe(e);
|
|
1998
1999
|
},
|
|
1999
2000
|
beforeUnmount(e) {
|
|
2000
|
-
const t =
|
|
2001
|
-
t && (t.unobserve(e),
|
|
2001
|
+
const t = Me.get(e);
|
|
2002
|
+
t && (t.unobserve(e), Me.delete(e));
|
|
2002
2003
|
}
|
|
2003
2004
|
}, Wo = {
|
|
2004
2005
|
mounted: it,
|
|
@@ -2105,7 +2106,7 @@ export {
|
|
|
2105
2106
|
gn as maskForm,
|
|
2106
2107
|
fr as nl2br,
|
|
2107
2108
|
cr as nullifyEmptyInputs,
|
|
2108
|
-
|
|
2109
|
+
Re as presentOverlay,
|
|
2109
2110
|
ie as removeOverlayInjection,
|
|
2110
2111
|
ar as replaceElement,
|
|
2111
2112
|
hn as showAlert,
|
|
@@ -2117,7 +2118,7 @@ export {
|
|
|
2117
2118
|
er as showWait,
|
|
2118
2119
|
Nn as sleep,
|
|
2119
2120
|
lr as sleepSecs,
|
|
2120
|
-
|
|
2121
|
+
Ee as toError,
|
|
2121
2122
|
ir as unmaskComponent,
|
|
2122
2123
|
dt as unmaskEl,
|
|
2123
2124
|
ft as unmaskForm,
|
package/package.json
CHANGED
package/src/helpers/error.ts
CHANGED
|
@@ -8,6 +8,10 @@ export class UserError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
interface ErrorWithCause extends Error {
|
|
12
|
+
cause?: Error;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
16
|
export function formatError(err: any): string {
|
|
13
17
|
if (err instanceof UserError) {
|
|
@@ -19,9 +23,12 @@ export function formatError(err: any): string {
|
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
export function toError(err: any) {
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
export function toError(err: any, cause?: any): ErrorWithCause {
|
|
27
|
+
const error = (isError(err) ? err : new Error(String(err))) as ErrorWithCause;
|
|
28
|
+
if (cause) {
|
|
29
|
+
error.cause = toError(cause);
|
|
30
|
+
}
|
|
31
|
+
return error;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
export function isError(err: unknown): err is Error {
|
|
@@ -31,12 +38,14 @@ export function isError(err: unknown): err is Error {
|
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
interface IErrorAlertOptions {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
cause?: any;
|
|
34
43
|
title?: string;
|
|
35
44
|
classes?: string[];
|
|
36
45
|
}
|
|
37
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
47
|
export async function handleErrorAndAlert(errIn: any, options?: IErrorAlertOptions) {
|
|
39
|
-
const err = toError(errIn);
|
|
48
|
+
const err = toError(errIn, options?.cause);
|
|
40
49
|
|
|
41
50
|
if (!(err instanceof UserError)) {
|
|
42
51
|
VfOptions.errorHandler(err);
|
|
@@ -50,8 +59,8 @@ export async function handleErrorAndAlert(errIn: any, options?: IErrorAlertOptio
|
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
export async function handleError(errIn: any) {
|
|
54
|
-
const err = toError(errIn);
|
|
62
|
+
export async function handleError(errIn: any, cause?: any) {
|
|
63
|
+
const err = toError(errIn, cause);
|
|
55
64
|
|
|
56
65
|
if (!(err instanceof UserError)) {
|
|
57
66
|
VfOptions.errorHandler(err);
|