x-essential-lib 0.8.2 → 0.8.4
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/index.js +153 -146
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { useTheme as fe, useDisplay as Ee } from "vuetify";
|
|
|
5
5
|
import { useRouter as ge, useRoute as Be } from "vue-router";
|
|
6
6
|
import We from "axios";
|
|
7
7
|
function Ue() {
|
|
8
|
-
const e = fe(), t = w(() => e.global.current.value.colors.primary), a = w(() => e.global.current.value.colors.secondary), o = w(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"),
|
|
8
|
+
const e = fe(), t = w(() => e.global.current.value.colors.primary), a = w(() => e.global.current.value.colors.secondary), o = w(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = w(() => e.current.value.dark ? "#272727" : "#eeeeee"), l = w(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = w(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = w(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
9
9
|
return {
|
|
10
10
|
primaryColor: t,
|
|
11
11
|
secondaryColor: a,
|
|
12
12
|
backgroundColor0: o,
|
|
13
|
-
backgroundColor1:
|
|
13
|
+
backgroundColor1: r,
|
|
14
14
|
backgroundColor2: l,
|
|
15
15
|
highlightColor: c,
|
|
16
|
-
borderColor:
|
|
16
|
+
borderColor: n
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
/*! js-cookie v3.0.5 | MIT */
|
|
@@ -37,47 +37,47 @@ var $e = {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
function ae(e, t) {
|
|
40
|
-
function a(
|
|
40
|
+
function a(r, l, c) {
|
|
41
41
|
if (!(typeof document > "u")) {
|
|
42
|
-
c = N({}, t, c), typeof c.expires == "number" && (c.expires = new Date(Date.now() + c.expires * 864e5)), c.expires && (c.expires = c.expires.toUTCString()),
|
|
43
|
-
var
|
|
42
|
+
c = N({}, t, c), typeof c.expires == "number" && (c.expires = new Date(Date.now() + c.expires * 864e5)), c.expires && (c.expires = c.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
43
|
+
var n = "";
|
|
44
44
|
for (var u in c)
|
|
45
|
-
c[u] && (
|
|
46
|
-
return document.cookie =
|
|
45
|
+
c[u] && (n += "; " + u, c[u] !== !0 && (n += "=" + c[u].split(";")[0]));
|
|
46
|
+
return document.cookie = r + "=" + e.write(l, r) + n;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function o(
|
|
50
|
-
if (!(typeof document > "u" || arguments.length && !
|
|
51
|
-
for (var l = document.cookie ? document.cookie.split("; ") : [], c = {},
|
|
52
|
-
var u = l[
|
|
49
|
+
function o(r) {
|
|
50
|
+
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
51
|
+
for (var l = document.cookie ? document.cookie.split("; ") : [], c = {}, n = 0; n < l.length; n++) {
|
|
52
|
+
var u = l[n].split("="), s = u.slice(1).join("=");
|
|
53
53
|
try {
|
|
54
54
|
var d = decodeURIComponent(u[0]);
|
|
55
|
-
if (c[d] = e.read(s, d),
|
|
55
|
+
if (c[d] = e.read(s, d), r === d)
|
|
56
56
|
break;
|
|
57
57
|
} catch {
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return r ? c[r] : c;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return Object.create(
|
|
64
64
|
{
|
|
65
65
|
set: a,
|
|
66
66
|
get: o,
|
|
67
|
-
remove: function(
|
|
67
|
+
remove: function(r, l) {
|
|
68
68
|
a(
|
|
69
|
-
|
|
69
|
+
r,
|
|
70
70
|
"",
|
|
71
71
|
N({}, l, {
|
|
72
72
|
expires: -1
|
|
73
73
|
})
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
|
-
withAttributes: function(
|
|
77
|
-
return ae(this.converter, N({}, this.attributes,
|
|
76
|
+
withAttributes: function(r) {
|
|
77
|
+
return ae(this.converter, N({}, this.attributes, r));
|
|
78
78
|
},
|
|
79
|
-
withConverter: function(
|
|
80
|
-
return ae(N({}, this.converter,
|
|
79
|
+
withConverter: function(r) {
|
|
80
|
+
return ae(N({}, this.converter, r), this.attributes);
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
{
|
|
@@ -112,9 +112,9 @@ function ze(e) {
|
|
|
112
112
|
return e.data;
|
|
113
113
|
}
|
|
114
114
|
function Fe(e, t) {
|
|
115
|
-
var
|
|
115
|
+
var r, l;
|
|
116
116
|
const o = e.response;
|
|
117
|
-
return o && (o.status === 401 && Xe(), (
|
|
117
|
+
return o && (o.status === 401 && Xe(), (r = o.data) != null && r.message ? t((l = o.data) == null ? void 0 : l.message) : t({
|
|
118
118
|
code: o.status,
|
|
119
119
|
message: o.statusText
|
|
120
120
|
})), Promise.reject(e);
|
|
@@ -131,10 +131,10 @@ function Ne(e) {
|
|
|
131
131
|
o && (a ? o.splice(o.indexOf(a) >>> 0, 1) : e.set(t, []));
|
|
132
132
|
}, emit: function(t, a) {
|
|
133
133
|
var o = e.get(t);
|
|
134
|
-
o && o.slice().map(function(
|
|
135
|
-
|
|
136
|
-
}), (o = e.get("*")) && o.slice().map(function(
|
|
137
|
-
|
|
134
|
+
o && o.slice().map(function(r) {
|
|
135
|
+
r(a);
|
|
136
|
+
}), (o = e.get("*")) && o.slice().map(function(r) {
|
|
137
|
+
r(t, a);
|
|
138
138
|
});
|
|
139
139
|
} };
|
|
140
140
|
}
|
|
@@ -148,9 +148,9 @@ async function Yt(e) {
|
|
|
148
148
|
}
|
|
149
149
|
async function re(e, t, a) {
|
|
150
150
|
const o = Date.now();
|
|
151
|
-
return new Promise((
|
|
151
|
+
return new Promise((r) => {
|
|
152
152
|
const l = async () => {
|
|
153
|
-
e() ?
|
|
153
|
+
e() ? r(!0) : t && Date.now() - o > t ? r(!1) : setTimeout(l, a ?? 30);
|
|
154
154
|
};
|
|
155
155
|
l();
|
|
156
156
|
});
|
|
@@ -176,8 +176,8 @@ async function Pt(e) {
|
|
|
176
176
|
let t = !1, a;
|
|
177
177
|
const o = (l) => {
|
|
178
178
|
a = l, t = !0;
|
|
179
|
-
},
|
|
180
|
-
return p.on("confirmDlgResult" +
|
|
179
|
+
}, r = me();
|
|
180
|
+
return p.on("confirmDlgResult" + r, o), p.emit("confirmDlg", { ...e, seq: r }), await re(() => t), p.off("confirmDlgResult" + r, o), a;
|
|
181
181
|
}
|
|
182
182
|
async function ea(e) {
|
|
183
183
|
if (!ve())
|
|
@@ -185,8 +185,8 @@ async function ea(e) {
|
|
|
185
185
|
let t = !1, a;
|
|
186
186
|
const o = (l) => {
|
|
187
187
|
a = l, t = !0;
|
|
188
|
-
},
|
|
189
|
-
return p.on("promptDlgResult" +
|
|
188
|
+
}, r = me();
|
|
189
|
+
return p.on("promptDlgResult" + r, o), p.emit("promptDlg", { ...e, seq: r }), await re(() => t), p.off("promptDlgResult" + r, o), a;
|
|
190
190
|
}
|
|
191
191
|
function ta(e) {
|
|
192
192
|
p.emit("openWaitDlg", { text: e });
|
|
@@ -211,11 +211,11 @@ function se(e, t) {
|
|
|
211
211
|
if (!e)
|
|
212
212
|
return !1;
|
|
213
213
|
let a = e;
|
|
214
|
-
return Object.keys(a).length <= 0 || (t.split("/").forEach((
|
|
214
|
+
return Object.keys(a).length <= 0 || (t.split("/").forEach((r) => {
|
|
215
215
|
if (Object.keys(a).length <= 0)
|
|
216
216
|
return !0;
|
|
217
|
-
if (a[
|
|
218
|
-
a = a[
|
|
217
|
+
if (a[r])
|
|
218
|
+
a = a[r];
|
|
219
219
|
else
|
|
220
220
|
return !1;
|
|
221
221
|
}), Object.keys(a).length <= 0);
|
|
@@ -371,27 +371,27 @@ const lt = [
|
|
|
371
371
|
];
|
|
372
372
|
function G(e) {
|
|
373
373
|
let t, a = 0;
|
|
374
|
-
const o = e.split("/").filter((
|
|
375
|
-
return lt.forEach((
|
|
376
|
-
const l =
|
|
374
|
+
const o = e.split("/").filter((r) => r.trim() !== "");
|
|
375
|
+
return lt.forEach((r) => {
|
|
376
|
+
const l = r.path.split("/").filter((n) => n.trim() !== "");
|
|
377
377
|
let c = 0;
|
|
378
|
-
for (let
|
|
378
|
+
for (let n = 0; n < o.length && !(n >= l.length || o[n] !== l[n]); n++)
|
|
379
379
|
c++;
|
|
380
|
-
c > 0 && c > a && (t =
|
|
380
|
+
c > 0 && c > a && (t = r, a = c);
|
|
381
381
|
}), t;
|
|
382
382
|
}
|
|
383
383
|
const J = v("");
|
|
384
|
-
function
|
|
384
|
+
function S(e, t, a) {
|
|
385
385
|
t === "/" && (t = a);
|
|
386
|
-
const o = G(e),
|
|
386
|
+
const o = G(e), r = G(t);
|
|
387
387
|
if (!o) {
|
|
388
388
|
console.assert(!1);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !
|
|
391
|
+
if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !r)
|
|
392
392
|
return;
|
|
393
|
-
const l = o.app ===
|
|
394
|
-
l ? c ? J.value = "" : J.value =
|
|
393
|
+
const l = o.app === r.app, c = o.path === r.path, n = o.level >= r.level;
|
|
394
|
+
l ? c ? J.value = "" : J.value = n ? "inner-left" : "inner-right" : (J.value = "", Ze(o.app, n));
|
|
395
395
|
}
|
|
396
396
|
function ct() {
|
|
397
397
|
return !!I.get("accessToken");
|
|
@@ -400,44 +400,44 @@ function ut() {
|
|
|
400
400
|
return !!I.get("activeOrg");
|
|
401
401
|
}
|
|
402
402
|
function _a(e, t, a, o) {
|
|
403
|
-
const
|
|
403
|
+
const r = ct(), l = ut(), c = G(e.path);
|
|
404
404
|
if (!c) {
|
|
405
405
|
console.assert(!1), a();
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
if (c.requiredState === "auth")
|
|
409
|
-
if (
|
|
409
|
+
if (r)
|
|
410
410
|
if (l) {
|
|
411
|
-
const
|
|
412
|
-
|
|
411
|
+
const n = "/main";
|
|
412
|
+
S(n, t.path, o), a({ path: n });
|
|
413
413
|
} else
|
|
414
|
-
|
|
414
|
+
S(e.path, t.path, o), a();
|
|
415
415
|
else {
|
|
416
|
-
const
|
|
417
|
-
|
|
416
|
+
const n = "/passport/login";
|
|
417
|
+
S(n, t.path, o), a({ path: n });
|
|
418
418
|
}
|
|
419
419
|
else if (c.requiredState === "org")
|
|
420
|
-
if (
|
|
420
|
+
if (r)
|
|
421
421
|
if (l)
|
|
422
|
-
|
|
422
|
+
S(e.path, t.path, o), a();
|
|
423
423
|
else {
|
|
424
|
-
const
|
|
425
|
-
|
|
424
|
+
const n = "/org/joinOrCreate";
|
|
425
|
+
S(n, t.path, o), a({ path: n });
|
|
426
426
|
}
|
|
427
427
|
else {
|
|
428
|
-
const
|
|
429
|
-
|
|
428
|
+
const n = "/passport/login";
|
|
429
|
+
S(n, t.path, o), a({ path: n });
|
|
430
430
|
}
|
|
431
|
-
else if (
|
|
431
|
+
else if (r)
|
|
432
432
|
if (l) {
|
|
433
|
-
const
|
|
434
|
-
|
|
433
|
+
const n = "/main";
|
|
434
|
+
S(n, t.path, o), a({ path: n });
|
|
435
435
|
} else {
|
|
436
|
-
const
|
|
437
|
-
|
|
436
|
+
const n = "/org/joinOrCreate";
|
|
437
|
+
S(n, t.path, o), a({ path: n });
|
|
438
438
|
}
|
|
439
439
|
else
|
|
440
|
-
|
|
440
|
+
S(e.path, t.path, o), a();
|
|
441
441
|
}
|
|
442
442
|
function st(e) {
|
|
443
443
|
return e.value.length <= 0;
|
|
@@ -498,27 +498,27 @@ function yt(e) {
|
|
|
498
498
|
}
|
|
499
499
|
function wt(...e) {
|
|
500
500
|
const t = [], a = () => {
|
|
501
|
-
t.forEach((
|
|
502
|
-
}, o = (
|
|
503
|
-
const
|
|
504
|
-
return
|
|
501
|
+
t.forEach((n) => n()), t.length = 0;
|
|
502
|
+
}, o = (n, u, s, d) => (n.addEventListener(u, s, d), () => n.removeEventListener(u, s, d)), r = w(() => {
|
|
503
|
+
const n = P(q(e[0])).filter((u) => u != null);
|
|
504
|
+
return n.every((u) => typeof u != "string") ? n : void 0;
|
|
505
505
|
}), l = ht(
|
|
506
506
|
() => {
|
|
507
|
-
var
|
|
507
|
+
var n, u;
|
|
508
508
|
return [
|
|
509
|
-
(u = (
|
|
510
|
-
P(q(
|
|
511
|
-
P(z(
|
|
509
|
+
(u = (n = r.value) == null ? void 0 : n.map((s) => yt(s))) != null ? u : [Le].filter((s) => s != null),
|
|
510
|
+
P(q(r.value ? e[1] : e[0])),
|
|
511
|
+
P(z(r.value ? e[2] : e[1])),
|
|
512
512
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
513
|
-
q(
|
|
513
|
+
q(r.value ? e[3] : e[2])
|
|
514
514
|
];
|
|
515
515
|
},
|
|
516
|
-
([
|
|
517
|
-
if (a(), !(
|
|
516
|
+
([n, u, s, d]) => {
|
|
517
|
+
if (a(), !(n != null && n.length) || !(u != null && u.length) || !(s != null && s.length))
|
|
518
518
|
return;
|
|
519
519
|
const g = mt(d) ? { ...d } : d;
|
|
520
520
|
t.push(
|
|
521
|
-
...
|
|
521
|
+
...n.flatMap(
|
|
522
522
|
(b) => u.flatMap(
|
|
523
523
|
(m) => s.map((_) => o(b, m, _, g))
|
|
524
524
|
)
|
|
@@ -547,29 +547,29 @@ function Ct() {
|
|
|
547
547
|
return typeof e == "number" ? e : void 0;
|
|
548
548
|
}
|
|
549
549
|
function Lt(e, t = {}) {
|
|
550
|
-
const { window: a = Le, ssrWidth: o = Ct() } = t,
|
|
551
|
-
|
|
550
|
+
const { window: a = Le, ssrWidth: o = Ct() } = t, r = bt(() => a && "matchMedia" in a && typeof a.matchMedia == "function"), l = v(typeof o == "number"), c = ee(), n = ee(!1), u = (s) => {
|
|
551
|
+
n.value = s.matches;
|
|
552
552
|
};
|
|
553
553
|
return Ve(() => {
|
|
554
554
|
if (l.value) {
|
|
555
|
-
l.value = !
|
|
555
|
+
l.value = !r.value;
|
|
556
556
|
const s = q(e).split(",");
|
|
557
|
-
|
|
557
|
+
n.value = s.some((d) => {
|
|
558
558
|
const g = d.includes("not all"), b = d.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = d.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
559
559
|
let _ = !!(b || m);
|
|
560
560
|
return b && _ && (_ = o >= pe(b[1])), m && _ && (_ = o <= pe(m[1])), g ? !_ : _;
|
|
561
561
|
});
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
|
-
|
|
565
|
-
}), wt(c, "change", u, { passive: !0 }), w(() =>
|
|
564
|
+
r.value && (c.value = a.matchMedia(q(e)), n.value = c.value.matches);
|
|
565
|
+
}), wt(c, "change", u, { passive: !0 }), w(() => n.value);
|
|
566
566
|
}
|
|
567
567
|
function Dt(e) {
|
|
568
568
|
return Lt("(prefers-color-scheme: dark)", e);
|
|
569
569
|
}
|
|
570
|
-
function fa(e, t, a, o,
|
|
571
|
-
const c = Be(),
|
|
572
|
-
Ye(e), Pe(t), et(a), at(o), ot(
|
|
570
|
+
function fa(e, t, a, o, r, l) {
|
|
571
|
+
const c = Be(), n = ge();
|
|
572
|
+
Ye(e), Pe(t), et(a), at(o), ot(r), nt(l);
|
|
573
573
|
const u = fe(), s = Dt();
|
|
574
574
|
K(
|
|
575
575
|
e,
|
|
@@ -591,12 +591,16 @@ function fa(e, t, a, o, n, l) {
|
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
593
|
const i = G(c.path);
|
|
594
|
-
(i
|
|
594
|
+
if (!i) {
|
|
595
|
+
console.assert(!1);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
i.level === 0 ? (k = navigator == null ? void 0 : navigator.Backbutton) == null || k.goHome(
|
|
595
599
|
() => {
|
|
596
600
|
},
|
|
597
601
|
() => {
|
|
598
602
|
}
|
|
599
|
-
) :
|
|
603
|
+
) : i.level === 1 ? n.replace({ path: "/main" }) : n.back();
|
|
600
604
|
};
|
|
601
605
|
E(() => {
|
|
602
606
|
window.addEventListener("keydown", d), p.on("backbutton", g);
|
|
@@ -611,7 +615,7 @@ function fa(e, t, a, o, n, l) {
|
|
|
611
615
|
const k = i;
|
|
612
616
|
a.value = k[0], o.value = k[1];
|
|
613
617
|
}, D = (i) => {
|
|
614
|
-
|
|
618
|
+
r.value = i;
|
|
615
619
|
};
|
|
616
620
|
Ae(() => {
|
|
617
621
|
p.on("updateDark", b), p.on("updateLocale", m), p.on("updatePermission", _), p.on("updateLastAppPath", D), p.emit("syncGlobalState");
|
|
@@ -642,43 +646,44 @@ function le(e, t) {
|
|
|
642
646
|
set(l) {
|
|
643
647
|
l ? pt(a, e) : _t(a, e);
|
|
644
648
|
}
|
|
645
|
-
}),
|
|
649
|
+
}), r = (l) => {
|
|
646
650
|
t == null || t(l), o.value = !0;
|
|
647
651
|
};
|
|
648
652
|
return E(() => {
|
|
649
|
-
p.on(e,
|
|
653
|
+
p.on(e, r);
|
|
650
654
|
}), $(() => {
|
|
651
|
-
p.off(e,
|
|
655
|
+
p.off(e, r);
|
|
652
656
|
}), { open: o };
|
|
653
657
|
}
|
|
654
|
-
const
|
|
658
|
+
const Mt = /* @__PURE__ */ B({
|
|
655
659
|
__name: "index",
|
|
656
660
|
setup(e) {
|
|
657
|
-
const { t } = ne(), a = v(""), o = v(""),
|
|
661
|
+
const { t } = ne(), a = v(""), o = v(""), r = v(""), l = v(""), c = v(""), n = v("");
|
|
658
662
|
let u = 0, s = !1;
|
|
659
663
|
const d = (m) => {
|
|
660
|
-
var D, i, k,
|
|
664
|
+
var D, i, k, M;
|
|
661
665
|
const _ = m;
|
|
662
|
-
a.value = _.title, o.value = _.text,
|
|
666
|
+
a.value = _.title, o.value = _.text, r.value = ((D = _.cancel) == null ? void 0 : D.color) ?? "primary", l.value = ((i = _.cancel) == null ? void 0 : i.text) ?? t("dlg.common.cancel"), c.value = ((k = _.confirm) == null ? void 0 : k.color) ?? "primary", n.value = ((M = _.confirm) == null ? void 0 : M.text) ?? t("dlg.common.confirm"), u = _.seq, s = !1, g.value = !0;
|
|
663
667
|
}, { open: g } = le("confirmDlg", d), b = () => {
|
|
664
668
|
g.value = !1, s || (p.emit("confirmDlgResult" + u, !0), s = !0);
|
|
665
669
|
};
|
|
666
670
|
return K(g, (m) => {
|
|
667
671
|
!m && !s && (p.emit("confirmDlgResult" + u, !1), s = !0);
|
|
668
672
|
}), (m, _) => {
|
|
669
|
-
const D = x("v-card-text"), i = x("v-btn"), k = x("v-card-actions"),
|
|
673
|
+
const D = x("v-card-text"), i = x("v-btn"), k = x("v-card-actions"), M = x("v-card"), f = x("v-dialog");
|
|
670
674
|
return L(), V(f, {
|
|
671
675
|
modelValue: z(g),
|
|
672
676
|
"onUpdate:modelValue": _[1] || (_[1] = (j) => Q(g) ? g.value = j : null),
|
|
673
677
|
transition: "dialog-top-transition",
|
|
674
678
|
"max-width": "600px",
|
|
679
|
+
attach: "",
|
|
675
680
|
onKeydown: [
|
|
676
681
|
_[2] || (_[2] = Z(H((j) => g.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
677
682
|
Z(H(b, ["stop", "prevent"]), ["enter"])
|
|
678
683
|
]
|
|
679
684
|
}, {
|
|
680
685
|
default: y(() => [
|
|
681
|
-
C(
|
|
686
|
+
C(M, { title: a.value }, {
|
|
682
687
|
default: y(() => [
|
|
683
688
|
C(D, null, {
|
|
684
689
|
default: y(() => [
|
|
@@ -689,7 +694,7 @@ const St = /* @__PURE__ */ B({
|
|
|
689
694
|
C(k, { class: "d-flex justify-end" }, {
|
|
690
695
|
default: y(() => [
|
|
691
696
|
C(i, {
|
|
692
|
-
color:
|
|
697
|
+
color: r.value,
|
|
693
698
|
variant: "text",
|
|
694
699
|
onClick: _[0] || (_[0] = (j) => g.value = !1)
|
|
695
700
|
}, {
|
|
@@ -704,7 +709,7 @@ const St = /* @__PURE__ */ B({
|
|
|
704
709
|
onClick: b
|
|
705
710
|
}, {
|
|
706
711
|
default: y(() => [
|
|
707
|
-
O(R(
|
|
712
|
+
O(R(n.value), 1)
|
|
708
713
|
]),
|
|
709
714
|
_: 1
|
|
710
715
|
}, 8, ["color"])
|
|
@@ -719,7 +724,7 @@ const St = /* @__PURE__ */ B({
|
|
|
719
724
|
}, 8, ["modelValue", "onKeydown"]);
|
|
720
725
|
};
|
|
721
726
|
}
|
|
722
|
-
}),
|
|
727
|
+
}), St = /* @__PURE__ */ B({
|
|
723
728
|
__name: "index",
|
|
724
729
|
props: {
|
|
725
730
|
open: { type: Boolean, default: !0 },
|
|
@@ -731,9 +736,9 @@ const St = /* @__PURE__ */ B({
|
|
|
731
736
|
zIndex: e.zIndex
|
|
732
737
|
}));
|
|
733
738
|
let o = 0;
|
|
734
|
-
return (
|
|
739
|
+
return (r, l) => (L(), V(qe, { name: "fade" }, {
|
|
735
740
|
default: y(() => [
|
|
736
|
-
|
|
741
|
+
r.open ? (L(), te("div", {
|
|
737
742
|
key: Q(o) ? ++o.value : ++o,
|
|
738
743
|
class: "x-cont",
|
|
739
744
|
style: de(a.value)
|
|
@@ -759,10 +764,10 @@ const St = /* @__PURE__ */ B({
|
|
|
759
764
|
}
|
|
760
765
|
}), ce = (e, t) => {
|
|
761
766
|
const a = e.__vccOpts || e;
|
|
762
|
-
for (const [o,
|
|
763
|
-
a[o] =
|
|
767
|
+
for (const [o, r] of t)
|
|
768
|
+
a[o] = r;
|
|
764
769
|
return a;
|
|
765
|
-
}, jt = /* @__PURE__ */ ce(
|
|
770
|
+
}, jt = /* @__PURE__ */ ce(St, [["__scopeId", "data-v-0c686889"]]);
|
|
766
771
|
var Rt = "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", Vt = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z", At = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", qt = "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z", Ot = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
|
|
767
772
|
const It = /* @__PURE__ */ B({
|
|
768
773
|
__name: "item",
|
|
@@ -777,7 +782,7 @@ const It = /* @__PURE__ */ B({
|
|
|
777
782
|
const a = e, o = w(() => ({
|
|
778
783
|
width: "calc(100% - 64px)",
|
|
779
784
|
overflowWrap: "break-word"
|
|
780
|
-
})),
|
|
785
|
+
})), r = w(() => {
|
|
781
786
|
switch (a.type) {
|
|
782
787
|
case "success":
|
|
783
788
|
return Vt;
|
|
@@ -795,9 +800,9 @@ const It = /* @__PURE__ */ B({
|
|
|
795
800
|
setTimeout(() => {
|
|
796
801
|
c("timeout", a.id);
|
|
797
802
|
}, a.timeout);
|
|
798
|
-
}), K(l, (
|
|
799
|
-
|
|
800
|
-
}), (
|
|
803
|
+
}), K(l, (n) => {
|
|
804
|
+
n || c("timeout", a.id);
|
|
805
|
+
}), (n, u) => {
|
|
801
806
|
const s = x("v-icon"), d = x("v-sheet");
|
|
802
807
|
return L(), V(d, {
|
|
803
808
|
class: "x-item d-flex align-center py-2 mb-2",
|
|
@@ -805,10 +810,10 @@ const It = /* @__PURE__ */ B({
|
|
|
805
810
|
elevation: 1
|
|
806
811
|
}, {
|
|
807
812
|
default: y(() => [
|
|
808
|
-
|
|
813
|
+
r.value ? (L(), V(s, {
|
|
809
814
|
key: 0,
|
|
810
815
|
class: "mx-1",
|
|
811
|
-
icon:
|
|
816
|
+
icon: r.value
|
|
812
817
|
}, null, 8, ["icon"])) : oe("", !0),
|
|
813
818
|
h("div", {
|
|
814
819
|
style: de(o.value)
|
|
@@ -832,21 +837,21 @@ const It = /* @__PURE__ */ B({
|
|
|
832
837
|
}), $(() => {
|
|
833
838
|
p.off("message", a);
|
|
834
839
|
});
|
|
835
|
-
const a = (
|
|
836
|
-
const { type: u, text: s, timeout: d } =
|
|
840
|
+
const a = (n) => {
|
|
841
|
+
const { type: u, text: s, timeout: d } = n;
|
|
837
842
|
l(u, s, d);
|
|
838
|
-
}, o = (
|
|
839
|
-
c(
|
|
843
|
+
}, o = (n) => {
|
|
844
|
+
c(n);
|
|
840
845
|
};
|
|
841
|
-
let
|
|
842
|
-
const l = (
|
|
843
|
-
const d =
|
|
844
|
-
t.value.push({ id: d, type:
|
|
845
|
-
}, c = (
|
|
846
|
-
const u = t.value.findIndex((s) => s.id ===
|
|
846
|
+
let r = 0;
|
|
847
|
+
const l = (n, u, s) => {
|
|
848
|
+
const d = r++;
|
|
849
|
+
t.value.push({ id: d, type: n, text: u, timeout: s });
|
|
850
|
+
}, c = (n) => {
|
|
851
|
+
const u = t.value.findIndex((s) => s.id === n);
|
|
847
852
|
u >= 0 && t.value.splice(u, 1);
|
|
848
853
|
};
|
|
849
|
-
return (
|
|
854
|
+
return (n, u) => (L(), te("div", {
|
|
850
855
|
class: "x-cont d-flex flex-column-reverse align-center",
|
|
851
856
|
onClick: u[0] || (u[0] = H(() => {
|
|
852
857
|
}, ["stop"]))
|
|
@@ -864,31 +869,32 @@ const It = /* @__PURE__ */ B({
|
|
|
864
869
|
}), Bt = /* @__PURE__ */ ce(Et, [["__scopeId", "data-v-c6a59757"]]), Wt = /* @__PURE__ */ B({
|
|
865
870
|
__name: "index",
|
|
866
871
|
setup(e) {
|
|
867
|
-
const { t } = ne(), a = v(""), o = v(""),
|
|
872
|
+
const { t } = ne(), a = v(""), o = v(""), r = v(""), l = v(""), c = v(), n = v(""), u = v(""), s = v(""), d = v(""), g = v(""), b = Te("target");
|
|
868
873
|
let m = 0, _ = !1;
|
|
869
|
-
const D = async (
|
|
874
|
+
const D = async (M) => {
|
|
870
875
|
var j, F, X, W;
|
|
871
|
-
const f =
|
|
872
|
-
a.value = f.title, o.value = f.text,
|
|
876
|
+
const f = M;
|
|
877
|
+
a.value = f.title, o.value = f.text, r.value = f.label, l.value = f.placeholder, c.value = f.rules, n.value = f.value, u.value = ((j = f.cancel) == null ? void 0 : j.color) ?? "primary", s.value = ((F = f.cancel) == null ? void 0 : F.text) ?? t("dlg.common.cancel"), d.value = ((X = f.confirm) == null ? void 0 : X.color) ?? "primary", g.value = ((W = f.confirm) == null ? void 0 : W.text) ?? t("dlg.common.confirm"), m = f.seq, _ = !1, i.value = !0, await re(() => !!b.value), b.value.focus();
|
|
873
878
|
}, { open: i } = le("promptDlg", D), k = () => {
|
|
874
|
-
i.value = !1, _ || (p.emit("promptDlgResult" + m,
|
|
879
|
+
i.value = !1, _ || (p.emit("promptDlgResult" + m, n.value ?? ""), _ = !0);
|
|
875
880
|
};
|
|
876
|
-
return K(i, (
|
|
877
|
-
!
|
|
878
|
-
}), (
|
|
879
|
-
const j = x("v-card-text"), F = x("v-text-field"), X = x("v-form"), W = x("v-btn"), De = x("v-card-actions"),
|
|
880
|
-
return L(), V(
|
|
881
|
+
return K(i, (M) => {
|
|
882
|
+
!M && !_ && (p.emit("promptDlgResult" + m, void 0), _ = !0);
|
|
883
|
+
}), (M, f) => {
|
|
884
|
+
const j = x("v-card-text"), F = x("v-text-field"), X = x("v-form"), W = x("v-btn"), De = x("v-card-actions"), Me = x("v-card"), Se = x("v-dialog");
|
|
885
|
+
return L(), V(Se, {
|
|
881
886
|
modelValue: z(i),
|
|
882
887
|
"onUpdate:modelValue": f[2] || (f[2] = (U) => Q(i) ? i.value = U : null),
|
|
883
888
|
transition: "dialog-top-transition",
|
|
884
889
|
"max-width": "600px",
|
|
890
|
+
attach: "",
|
|
885
891
|
onKeydown: [
|
|
886
892
|
f[3] || (f[3] = Z(H((U) => i.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
887
893
|
Z(H(k, ["stop", "prevent"]), ["enter"])
|
|
888
894
|
]
|
|
889
895
|
}, {
|
|
890
896
|
default: y(() => [
|
|
891
|
-
C(
|
|
897
|
+
C(Me, { title: a.value }, {
|
|
892
898
|
default: y(() => [
|
|
893
899
|
o.value ? (L(), V(j, { key: 0 }, {
|
|
894
900
|
default: y(() => [
|
|
@@ -901,9 +907,9 @@ const It = /* @__PURE__ */ B({
|
|
|
901
907
|
C(F, {
|
|
902
908
|
ref_key: "target",
|
|
903
909
|
ref: b,
|
|
904
|
-
modelValue:
|
|
905
|
-
"onUpdate:modelValue": f[0] || (f[0] = (U) =>
|
|
906
|
-
label:
|
|
910
|
+
modelValue: n.value,
|
|
911
|
+
"onUpdate:modelValue": f[0] || (f[0] = (U) => n.value = U),
|
|
912
|
+
label: r.value,
|
|
907
913
|
placeholder: l.value,
|
|
908
914
|
rules: c.value
|
|
909
915
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])
|
|
@@ -947,23 +953,24 @@ const It = /* @__PURE__ */ B({
|
|
|
947
953
|
__name: "index",
|
|
948
954
|
setup(e) {
|
|
949
955
|
const { t } = ne(), a = v(""), o = (c) => {
|
|
950
|
-
const
|
|
951
|
-
a.value =
|
|
952
|
-
},
|
|
956
|
+
const n = c;
|
|
957
|
+
a.value = n.text ?? t("dlg.common.waiting"), l.value = !0;
|
|
958
|
+
}, r = () => {
|
|
953
959
|
l.value = !1;
|
|
954
960
|
}, { open: l } = le("waitDlg", o);
|
|
955
961
|
return E(() => {
|
|
956
|
-
p.on("closeWaitDlg",
|
|
962
|
+
p.on("closeWaitDlg", r);
|
|
957
963
|
}), $(() => {
|
|
958
|
-
p.off("closeWaitDlg",
|
|
959
|
-
}), (c,
|
|
964
|
+
p.off("closeWaitDlg", r);
|
|
965
|
+
}), (c, n) => {
|
|
960
966
|
const u = x("v-card"), s = x("v-dialog");
|
|
961
967
|
return L(), V(s, {
|
|
962
968
|
modelValue: z(l),
|
|
963
|
-
"onUpdate:modelValue":
|
|
969
|
+
"onUpdate:modelValue": n[0] || (n[0] = (d) => Q(l) ? l.value = d : null),
|
|
964
970
|
persistent: "",
|
|
965
971
|
"no-click-animation": "",
|
|
966
|
-
fullscreen: ""
|
|
972
|
+
fullscreen: "",
|
|
973
|
+
attach: ""
|
|
967
974
|
}, {
|
|
968
975
|
default: y(() => [
|
|
969
976
|
h("div", Ut, [
|
|
@@ -986,10 +993,10 @@ const It = /* @__PURE__ */ B({
|
|
|
986
993
|
};
|
|
987
994
|
}
|
|
988
995
|
}), zt = (e) => {
|
|
989
|
-
e.component("XConfirmDlg",
|
|
996
|
+
e.component("XConfirmDlg", Mt), e.component("XLoading", jt), e.component("XMessage", Bt), e.component("XPromptDlg", Wt), e.component("XWaitDlg", Kt);
|
|
990
997
|
}, Ft = (e, t, a) => {
|
|
991
998
|
const o = e[t];
|
|
992
|
-
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((
|
|
999
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((r, l) => {
|
|
993
1000
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
994
1001
|
l.bind(
|
|
995
1002
|
null,
|