x-essential-lib 0.5.68 → 0.5.75
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 +198 -202
- package/dist/store/global.d.ts +3 -3
- package/dist/utils/globalState.d.ts +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="x-essential-lib",a.appendChild(document.createTextNode('.x-cont[data-v-f4ad116e]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-f4ad116e]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-f4ad116e]{transform-origin:20px 20px;animation:lds-spinner-f4ad116e 1.2s linear infinite}.lds-spinner div[data-v-f4ad116e]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-f4ad116e]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-f4ad116e]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-f4ad116e]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-f4ad116e]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-f4ad116e]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-f4ad116e]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-f4ad116e]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-f4ad116e]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-f4ad116e]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-f4ad116e]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-f4ad116e{0%{opacity:1}to{opacity:0}}.x-cont[data-v-8c2268ea]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { ref as i, computed as g, onMounted as
|
|
2
|
+
import { ref as i, computed as g, onMounted as R, onBeforeUnmount as O, defineComponent as j, watch as X, resolveComponent as m, openBlock as C, createBlock as I, unref as z, isRef as J, withKeys as F, withModifiers as E, withCtx as h, createVNode as x, createTextVNode as q, toDisplayString as V, createElementBlock as H, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as v, reactive as he, Fragment as we, renderList as xe, createCommentVNode as ye } from "vue";
|
|
3
3
|
import { useLocale as Q, useTheme as Y, useDisplay as ke } from "vuetify";
|
|
4
4
|
import { defineStore as le } from "pinia";
|
|
5
|
-
import
|
|
6
|
-
import { useRouter as ne, useRoute as
|
|
5
|
+
import be from "axios";
|
|
6
|
+
import { useRouter as ne, useRoute as Ce } from "vue-router";
|
|
7
7
|
const Z = le("global", () => {
|
|
8
|
-
const e = i(
|
|
8
|
+
const e = i(), a = i("en"), t = i({}), l = i(""), o = i("");
|
|
9
9
|
return {
|
|
10
10
|
dark: e,
|
|
11
11
|
locale: a,
|
|
@@ -24,14 +24,14 @@ const Z = le("global", () => {
|
|
|
24
24
|
return e.value[p - 1];
|
|
25
25
|
}
|
|
26
26
|
function l(p) {
|
|
27
|
-
return e.value.find((
|
|
27
|
+
return e.value.find((_) => _ === p) !== void 0;
|
|
28
28
|
}
|
|
29
29
|
function o(p) {
|
|
30
30
|
e.value.push(p);
|
|
31
31
|
}
|
|
32
32
|
function r(p) {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const _ = e.value.findIndex((s) => s === p);
|
|
34
|
+
_ !== -1 && e.value.splice(_, 1);
|
|
35
35
|
}
|
|
36
36
|
function n() {
|
|
37
37
|
console.assert(e.value.length > 0), e.value.pop();
|
|
@@ -70,7 +70,7 @@ var De = {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
function
|
|
73
|
+
function G(e, a) {
|
|
74
74
|
function t(o, r, n) {
|
|
75
75
|
if (!(typeof document > "u")) {
|
|
76
76
|
n = W({}, a, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
@@ -83,10 +83,10 @@ function X(e, a) {
|
|
|
83
83
|
function l(o) {
|
|
84
84
|
if (!(typeof document > "u" || arguments.length && !o)) {
|
|
85
85
|
for (var r = document.cookie ? document.cookie.split("; ") : [], n = {}, c = 0; c < r.length; c++) {
|
|
86
|
-
var p = r[c].split("="),
|
|
86
|
+
var p = r[c].split("="), _ = p.slice(1).join("=");
|
|
87
87
|
try {
|
|
88
|
-
var
|
|
89
|
-
if (n[
|
|
88
|
+
var s = decodeURIComponent(p[0]);
|
|
89
|
+
if (n[s] = e.read(_, s), o === s)
|
|
90
90
|
break;
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
@@ -108,10 +108,10 @@ function X(e, a) {
|
|
|
108
108
|
);
|
|
109
109
|
},
|
|
110
110
|
withAttributes: function(o) {
|
|
111
|
-
return
|
|
111
|
+
return G(this.converter, W({}, this.attributes, o));
|
|
112
112
|
},
|
|
113
113
|
withConverter: function(o) {
|
|
114
|
-
return
|
|
114
|
+
return G(W({}, this.converter, o), this.attributes);
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
{
|
|
@@ -120,29 +120,29 @@ function X(e, a) {
|
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
|
-
var
|
|
123
|
+
var A = G(De, { path: "/" });
|
|
124
124
|
function ot(e) {
|
|
125
|
-
const a =
|
|
125
|
+
const a = be.create({
|
|
126
126
|
timeout: 6e3
|
|
127
127
|
});
|
|
128
128
|
return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
|
|
129
|
-
(t) =>
|
|
129
|
+
(t) => Se(t),
|
|
130
130
|
(t) => {
|
|
131
131
|
Ve(t, e.onError);
|
|
132
132
|
}
|
|
133
133
|
), a.interceptors.response.use(
|
|
134
|
-
(t) =>
|
|
134
|
+
(t) => Re(t),
|
|
135
135
|
(t) => qe(t, e.onError)
|
|
136
136
|
), a;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const a =
|
|
138
|
+
function Se(e) {
|
|
139
|
+
const a = A.get("accessToken") ?? "";
|
|
140
140
|
return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
141
141
|
}
|
|
142
142
|
function Ve(e, a) {
|
|
143
143
|
console.error(e), a("request timeout");
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Re(e) {
|
|
146
146
|
return e.data;
|
|
147
147
|
}
|
|
148
148
|
function qe(e, a) {
|
|
@@ -158,7 +158,7 @@ function qe(e, a) {
|
|
|
158
158
|
}), a(l), Promise.reject(e);
|
|
159
159
|
}
|
|
160
160
|
function Ae() {
|
|
161
|
-
|
|
161
|
+
A.remove("accessToken"), A.remove("refreshToken"), A.remove("activeOrg"), ne().replace({ path: "/passport/login" });
|
|
162
162
|
}
|
|
163
163
|
function Ie(e) {
|
|
164
164
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
@@ -259,7 +259,7 @@ function oe(e, a) {
|
|
|
259
259
|
return !1;
|
|
260
260
|
}), Object.keys(t).length <= 0);
|
|
261
261
|
}
|
|
262
|
-
const
|
|
262
|
+
const Ue = [
|
|
263
263
|
{
|
|
264
264
|
app: "x-passport-mf",
|
|
265
265
|
path: "/passport/login",
|
|
@@ -370,7 +370,7 @@ const Be = [
|
|
|
370
370
|
function K(e) {
|
|
371
371
|
let a, t = 0;
|
|
372
372
|
const l = e.split("/").filter((o) => o.trim() !== "");
|
|
373
|
-
return
|
|
373
|
+
return Ue.forEach((o) => {
|
|
374
374
|
const r = o.path.split("/").filter((c) => c.trim() !== "");
|
|
375
375
|
let n = 0;
|
|
376
376
|
for (let c = 0; c < l.length && !(c >= r.length || l[c] !== r[c]); c++)
|
|
@@ -392,14 +392,14 @@ function b(e, a) {
|
|
|
392
392
|
const r = l.app === o.app, n = l.path === o.path, c = l.level >= o.level;
|
|
393
393
|
r ? n ? N.value = "" : N.value = c ? "inner-left" : "inner-right" : (N.value = "", Oe(l.app, c));
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
return !!
|
|
395
|
+
function Be() {
|
|
396
|
+
return !!A.get("accessToken");
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return !!
|
|
398
|
+
function Ee() {
|
|
399
|
+
return !!A.get("activeOrg");
|
|
400
400
|
}
|
|
401
401
|
function ft(e, a, t) {
|
|
402
|
-
const l =
|
|
402
|
+
const l = Be(), o = Ee(), r = K(e.path);
|
|
403
403
|
if (!r) {
|
|
404
404
|
t();
|
|
405
405
|
return;
|
|
@@ -449,82 +449,82 @@ function ee(e, a) {
|
|
|
449
449
|
}), o = (r) => {
|
|
450
450
|
a == null || a(r), l.value = !0;
|
|
451
451
|
};
|
|
452
|
-
return
|
|
452
|
+
return R(() => {
|
|
453
453
|
u.on(e, o);
|
|
454
|
-
}),
|
|
454
|
+
}), O(() => {
|
|
455
455
|
u.off(e, o);
|
|
456
456
|
}), { open: l };
|
|
457
457
|
}
|
|
458
|
-
const
|
|
458
|
+
const Me = /* @__PURE__ */ j({
|
|
459
459
|
__name: "index",
|
|
460
460
|
setup(e) {
|
|
461
461
|
const a = Q(), { open: t } = ee("confirmDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = g(() => {
|
|
462
|
-
var
|
|
463
|
-
return ((
|
|
462
|
+
var f;
|
|
463
|
+
return ((f = r.value) == null ? void 0 : f.color) ?? "primary";
|
|
464
464
|
}), p = g(() => {
|
|
465
|
-
var
|
|
466
|
-
return ((
|
|
465
|
+
var f;
|
|
466
|
+
return ((f = r.value) == null ? void 0 : f.text) ?? a.t("cancel");
|
|
467
|
+
}), _ = g(() => {
|
|
468
|
+
var f;
|
|
469
|
+
return ((f = n.value) == null ? void 0 : f.color) ?? "primary";
|
|
467
470
|
}), s = g(() => {
|
|
468
|
-
var
|
|
469
|
-
return ((
|
|
470
|
-
}), v = g(() => {
|
|
471
|
-
var d;
|
|
472
|
-
return ((d = n.value) == null ? void 0 : d.text) ?? a.t("confirm");
|
|
471
|
+
var f;
|
|
472
|
+
return ((f = n.value) == null ? void 0 : f.text) ?? a.t("confirm");
|
|
473
473
|
});
|
|
474
|
-
let
|
|
475
|
-
const
|
|
476
|
-
l.value =
|
|
474
|
+
let k = 0, D = !1;
|
|
475
|
+
const M = (f) => {
|
|
476
|
+
l.value = f.title, o.value = f.text, r.value = f.cancel, n.value = f.confirm, k = f.seq, D = !1, t.value = !0;
|
|
477
477
|
};
|
|
478
|
-
|
|
479
|
-
u.on("confirmDlg",
|
|
480
|
-
}),
|
|
481
|
-
u.off("confirmDlg",
|
|
478
|
+
R(() => {
|
|
479
|
+
u.on("confirmDlg", M);
|
|
480
|
+
}), O(() => {
|
|
481
|
+
u.off("confirmDlg", M);
|
|
482
482
|
});
|
|
483
|
-
const
|
|
484
|
-
t.value = !1,
|
|
483
|
+
const L = () => {
|
|
484
|
+
t.value = !1, D || (u.emit("confirmDlgResult" + k, !0), D = !0);
|
|
485
485
|
};
|
|
486
|
-
return
|
|
487
|
-
!
|
|
488
|
-
}), (
|
|
489
|
-
const
|
|
490
|
-
return
|
|
486
|
+
return X(t, (f) => {
|
|
487
|
+
!f && !D && (u.emit("confirmDlgResult" + k, !1), D = !0);
|
|
488
|
+
}), (f, y) => {
|
|
489
|
+
const S = m("v-card-text"), T = m("v-btn"), $ = m("v-card-actions"), d = m("v-card"), w = m("v-dialog");
|
|
490
|
+
return C(), I(w, {
|
|
491
491
|
modelValue: z(t),
|
|
492
|
-
"onUpdate:modelValue":
|
|
492
|
+
"onUpdate:modelValue": y[1] || (y[1] = (U) => J(t) ? t.value = U : null),
|
|
493
493
|
onKeydown: [
|
|
494
|
-
|
|
495
|
-
F(
|
|
494
|
+
y[2] || (y[2] = F(E((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
495
|
+
F(E(L, ["stop", "prevent"]), ["enter"])
|
|
496
496
|
],
|
|
497
497
|
transition: "dialog-top-transition",
|
|
498
498
|
"max-width": "600px"
|
|
499
499
|
}, {
|
|
500
|
-
default:
|
|
501
|
-
|
|
502
|
-
default:
|
|
503
|
-
|
|
504
|
-
default:
|
|
505
|
-
|
|
500
|
+
default: h(() => [
|
|
501
|
+
x(d, { title: l.value }, {
|
|
502
|
+
default: h(() => [
|
|
503
|
+
x(S, null, {
|
|
504
|
+
default: h(() => [
|
|
505
|
+
q(V(o.value), 1)
|
|
506
506
|
]),
|
|
507
507
|
_: 1
|
|
508
508
|
}),
|
|
509
|
-
|
|
510
|
-
default:
|
|
511
|
-
|
|
512
|
-
onClick:
|
|
509
|
+
x($, { class: "d-flex justify-end" }, {
|
|
510
|
+
default: h(() => [
|
|
511
|
+
x(T, {
|
|
512
|
+
onClick: y[0] || (y[0] = (U) => t.value = !1),
|
|
513
513
|
color: c.value,
|
|
514
514
|
variant: "text"
|
|
515
515
|
}, {
|
|
516
|
-
default:
|
|
517
|
-
|
|
516
|
+
default: h(() => [
|
|
517
|
+
q(V(p.value), 1)
|
|
518
518
|
]),
|
|
519
519
|
_: 1
|
|
520
520
|
}, 8, ["color"]),
|
|
521
|
-
|
|
522
|
-
onClick:
|
|
523
|
-
color:
|
|
521
|
+
x(T, {
|
|
522
|
+
onClick: L,
|
|
523
|
+
color: _.value,
|
|
524
524
|
variant: "text"
|
|
525
525
|
}, {
|
|
526
|
-
default:
|
|
527
|
-
|
|
526
|
+
default: h(() => [
|
|
527
|
+
q(V(s.value), 1)
|
|
528
528
|
]),
|
|
529
529
|
_: 1
|
|
530
530
|
}, 8, ["color"])
|
|
@@ -539,22 +539,22 @@ const Ue = /* @__PURE__ */ T({
|
|
|
539
539
|
}, 8, ["modelValue", "onKeydown"]);
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
}),
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
542
|
+
}), Le = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), $e = /* @__PURE__ */ Le(() => /* @__PURE__ */ v("div", { class: "lds-spinner" }, [
|
|
543
|
+
/* @__PURE__ */ v("div"),
|
|
544
|
+
/* @__PURE__ */ v("div"),
|
|
545
|
+
/* @__PURE__ */ v("div"),
|
|
546
|
+
/* @__PURE__ */ v("div"),
|
|
547
|
+
/* @__PURE__ */ v("div"),
|
|
548
|
+
/* @__PURE__ */ v("div"),
|
|
549
|
+
/* @__PURE__ */ v("div"),
|
|
550
|
+
/* @__PURE__ */ v("div"),
|
|
551
|
+
/* @__PURE__ */ v("div"),
|
|
552
|
+
/* @__PURE__ */ v("div"),
|
|
553
|
+
/* @__PURE__ */ v("div"),
|
|
554
|
+
/* @__PURE__ */ v("div")
|
|
555
555
|
], -1)), We = [
|
|
556
|
-
|
|
557
|
-
], ze = /* @__PURE__ */
|
|
556
|
+
$e
|
|
557
|
+
], ze = /* @__PURE__ */ j({
|
|
558
558
|
__name: "index",
|
|
559
559
|
props: {
|
|
560
560
|
zIndex: {
|
|
@@ -567,7 +567,7 @@ const Ue = /* @__PURE__ */ T({
|
|
|
567
567
|
background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
568
568
|
zIndex: t.zIndex
|
|
569
569
|
}));
|
|
570
|
-
return (o, r) => (
|
|
570
|
+
return (o, r) => (C(), H("div", {
|
|
571
571
|
class: "x-cont",
|
|
572
572
|
style: ge(l.value)
|
|
573
573
|
}, We, 4));
|
|
@@ -577,7 +577,7 @@ const Ue = /* @__PURE__ */ T({
|
|
|
577
577
|
for (const [l, o] of a)
|
|
578
578
|
t[l] = o;
|
|
579
579
|
return t;
|
|
580
|
-
}, Fe = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Ke = /* @__PURE__ */
|
|
580
|
+
}, Fe = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Ke = /* @__PURE__ */ j({
|
|
581
581
|
__name: "item",
|
|
582
582
|
props: {
|
|
583
583
|
id: {},
|
|
@@ -588,15 +588,15 @@ const Ue = /* @__PURE__ */ T({
|
|
|
588
588
|
emits: ["timeout"],
|
|
589
589
|
setup(e, { emit: a }) {
|
|
590
590
|
const t = e, l = i(!0), o = a;
|
|
591
|
-
return
|
|
591
|
+
return R(() => {
|
|
592
592
|
setTimeout(() => {
|
|
593
593
|
o("timeout", t.id);
|
|
594
594
|
}, t.timeout);
|
|
595
|
-
}),
|
|
595
|
+
}), X(l, (r) => {
|
|
596
596
|
r || o("timeout", t.id);
|
|
597
597
|
}), (r, n) => {
|
|
598
|
-
const c =
|
|
599
|
-
return
|
|
598
|
+
const c = m("v-alert");
|
|
599
|
+
return C(), I(c, {
|
|
600
600
|
modelValue: l.value,
|
|
601
601
|
"onUpdate:modelValue": n[0] || (n[0] = (p) => l.value = p),
|
|
602
602
|
class: "mt-2",
|
|
@@ -610,13 +610,13 @@ const Ue = /* @__PURE__ */ T({
|
|
|
610
610
|
}, null, 8, ["modelValue", "type", "text"]);
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
}), Ne = /* @__PURE__ */
|
|
613
|
+
}), Ne = /* @__PURE__ */ j({
|
|
614
614
|
__name: "index",
|
|
615
615
|
setup(e) {
|
|
616
616
|
const a = he({ items: [] });
|
|
617
|
-
|
|
617
|
+
R(() => {
|
|
618
618
|
u.on("message", t);
|
|
619
|
-
}),
|
|
619
|
+
}), O(() => {
|
|
620
620
|
u.off("message", t);
|
|
621
621
|
});
|
|
622
622
|
const t = (c) => {
|
|
@@ -625,113 +625,113 @@ const Ue = /* @__PURE__ */ T({
|
|
|
625
625
|
n(c);
|
|
626
626
|
};
|
|
627
627
|
let o = 0;
|
|
628
|
-
const r = (c, p,
|
|
629
|
-
const
|
|
630
|
-
a.items.push({ id:
|
|
628
|
+
const r = (c, p, _) => {
|
|
629
|
+
const s = o++;
|
|
630
|
+
a.items.push({ id: s, type: c, text: p, timeout: _ });
|
|
631
631
|
}, n = (c) => {
|
|
632
|
-
const p = a.items.findIndex((
|
|
632
|
+
const p = a.items.findIndex((_) => _.id === c);
|
|
633
633
|
p >= 0 && a.items.splice(p, 1);
|
|
634
634
|
};
|
|
635
|
-
return (c, p) => (
|
|
636
|
-
onClick: p[0] || (p[0] =
|
|
635
|
+
return (c, p) => (C(), H("div", {
|
|
636
|
+
onClick: p[0] || (p[0] = E(() => {
|
|
637
637
|
}, ["stop"])),
|
|
638
638
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
639
639
|
}, [
|
|
640
|
-
(
|
|
640
|
+
(C(!0), H(we, null, xe(a.items, (_) => (C(), I(Ke, {
|
|
641
641
|
onTimeout: l,
|
|
642
|
-
id:
|
|
643
|
-
type:
|
|
644
|
-
text:
|
|
645
|
-
timeout:
|
|
646
|
-
key:
|
|
642
|
+
id: _.id,
|
|
643
|
+
type: _.type,
|
|
644
|
+
text: _.text,
|
|
645
|
+
timeout: _.timeout,
|
|
646
|
+
key: _.id
|
|
647
647
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
648
648
|
]));
|
|
649
649
|
}
|
|
650
|
-
}), He = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-8c2268ea"]]),
|
|
650
|
+
}), He = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-8c2268ea"]]), Ge = /* @__PURE__ */ j({
|
|
651
651
|
__name: "index",
|
|
652
652
|
setup(e) {
|
|
653
|
-
const a = Q(), { open: t } = ee("promptDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = i(), p = i(""),
|
|
654
|
-
var
|
|
655
|
-
return ((
|
|
656
|
-
}),
|
|
657
|
-
var
|
|
658
|
-
return ((
|
|
659
|
-
}),
|
|
660
|
-
var
|
|
661
|
-
return ((
|
|
662
|
-
}),
|
|
663
|
-
var
|
|
664
|
-
return ((
|
|
665
|
-
}),
|
|
666
|
-
let
|
|
667
|
-
const
|
|
668
|
-
var
|
|
669
|
-
l.value =
|
|
653
|
+
const a = Q(), { open: t } = ee("promptDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = i(), p = i(""), _ = i(), s = i(), k = g(() => {
|
|
654
|
+
var d;
|
|
655
|
+
return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
|
|
656
|
+
}), D = g(() => {
|
|
657
|
+
var d;
|
|
658
|
+
return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
659
|
+
}), M = g(() => {
|
|
660
|
+
var d;
|
|
661
|
+
return ((d = s.value) == null ? void 0 : d.color) ?? "primary";
|
|
662
|
+
}), L = g(() => {
|
|
663
|
+
var d;
|
|
664
|
+
return ((d = s.value) == null ? void 0 : d.text) ?? a.t("confirm");
|
|
665
|
+
}), f = i();
|
|
666
|
+
let y = 0, S = !1;
|
|
667
|
+
const T = async (d) => {
|
|
668
|
+
var w;
|
|
669
|
+
l.value = d.title, o.value = d.text, r.value = d.label, n.value = d.placeholder, c.value = d.rules, p.value = d.value, _.value = d.cancel, s.value = d.confirm, y = d.seq, S = !1, t.value = !0, await P(() => f.value !== void 0, 1e3), (w = f.value) == null || w.focus();
|
|
670
670
|
};
|
|
671
|
-
|
|
672
|
-
u.on("promptDlg",
|
|
673
|
-
}),
|
|
674
|
-
u.off("promptDlg",
|
|
671
|
+
R(() => {
|
|
672
|
+
u.on("promptDlg", T);
|
|
673
|
+
}), O(() => {
|
|
674
|
+
u.off("promptDlg", T);
|
|
675
675
|
});
|
|
676
|
-
const
|
|
677
|
-
t.value = !1,
|
|
676
|
+
const $ = () => {
|
|
677
|
+
t.value = !1, S || (u.emit("promptDlgResult" + y, p.value ?? ""), S = !0);
|
|
678
678
|
};
|
|
679
|
-
return
|
|
680
|
-
!
|
|
681
|
-
}), (
|
|
682
|
-
const
|
|
683
|
-
return
|
|
679
|
+
return X(t, (d) => {
|
|
680
|
+
!d && !S && (u.emit("promptDlgResult" + y, void 0), S = !0);
|
|
681
|
+
}), (d, w) => {
|
|
682
|
+
const U = m("v-card-text"), se = m("v-text-field"), _e = m("v-form"), te = m("v-btn"), de = m("v-card-actions"), fe = m("v-card"), ie = m("v-dialog");
|
|
683
|
+
return C(), I(ie, {
|
|
684
684
|
modelValue: z(t),
|
|
685
|
-
"onUpdate:modelValue":
|
|
685
|
+
"onUpdate:modelValue": w[2] || (w[2] = (B) => J(t) ? t.value = B : null),
|
|
686
686
|
onKeydown: [
|
|
687
|
-
|
|
688
|
-
F(
|
|
687
|
+
w[3] || (w[3] = F(E((B) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
688
|
+
F(E($, ["stop", "prevent"]), ["enter"])
|
|
689
689
|
],
|
|
690
690
|
transition: "dialog-top-transition",
|
|
691
691
|
"max-width": "600px"
|
|
692
692
|
}, {
|
|
693
|
-
default:
|
|
694
|
-
|
|
695
|
-
default:
|
|
696
|
-
o.value ? (
|
|
697
|
-
default:
|
|
698
|
-
|
|
693
|
+
default: h(() => [
|
|
694
|
+
x(fe, { title: l.value }, {
|
|
695
|
+
default: h(() => [
|
|
696
|
+
o.value ? (C(), I(U, { key: 0 }, {
|
|
697
|
+
default: h(() => [
|
|
698
|
+
q(V(o.value), 1)
|
|
699
699
|
]),
|
|
700
700
|
_: 1
|
|
701
701
|
})) : ye("", !0),
|
|
702
|
-
|
|
703
|
-
default:
|
|
704
|
-
|
|
702
|
+
x(_e, { class: "mx-3" }, {
|
|
703
|
+
default: h(() => [
|
|
704
|
+
x(se, {
|
|
705
705
|
modelValue: p.value,
|
|
706
|
-
"onUpdate:modelValue":
|
|
706
|
+
"onUpdate:modelValue": w[0] || (w[0] = (B) => p.value = B),
|
|
707
707
|
label: r.value,
|
|
708
708
|
placeholder: n.value,
|
|
709
709
|
rules: c.value,
|
|
710
710
|
ref_key: "target",
|
|
711
|
-
ref:
|
|
711
|
+
ref: f
|
|
712
712
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])
|
|
713
713
|
]),
|
|
714
714
|
_: 1
|
|
715
715
|
}),
|
|
716
|
-
|
|
717
|
-
default:
|
|
718
|
-
|
|
719
|
-
onClick:
|
|
720
|
-
color:
|
|
716
|
+
x(de, { class: "d-flex justify-end" }, {
|
|
717
|
+
default: h(() => [
|
|
718
|
+
x(te, {
|
|
719
|
+
onClick: w[1] || (w[1] = (B) => t.value = !1),
|
|
720
|
+
color: k.value,
|
|
721
721
|
variant: "text"
|
|
722
722
|
}, {
|
|
723
|
-
default:
|
|
724
|
-
|
|
723
|
+
default: h(() => [
|
|
724
|
+
q(V(D.value), 1)
|
|
725
725
|
]),
|
|
726
726
|
_: 1
|
|
727
727
|
}, 8, ["color"]),
|
|
728
|
-
|
|
729
|
-
onClick:
|
|
730
|
-
color:
|
|
728
|
+
x(te, {
|
|
729
|
+
onClick: $,
|
|
730
|
+
color: M.value,
|
|
731
731
|
variant: "text"
|
|
732
732
|
}, {
|
|
733
|
-
default:
|
|
734
|
-
|
|
733
|
+
default: h(() => [
|
|
734
|
+
q(V(L.value), 1)
|
|
735
735
|
]),
|
|
736
736
|
_: 1
|
|
737
737
|
}, 8, ["color"])
|
|
@@ -746,7 +746,7 @@ const Ue = /* @__PURE__ */ T({
|
|
|
746
746
|
}, 8, ["modelValue", "onKeydown"]);
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
|
-
}),
|
|
749
|
+
}), Xe = { class: "mx-auto my-auto" }, Je = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ j({
|
|
750
750
|
__name: "index",
|
|
751
751
|
setup(e) {
|
|
752
752
|
const a = Q(), { open: t } = ee("waitDlg"), l = () => {
|
|
@@ -754,29 +754,29 @@ const Ue = /* @__PURE__ */ T({
|
|
|
754
754
|
}, o = () => {
|
|
755
755
|
t.value = !1;
|
|
756
756
|
};
|
|
757
|
-
return
|
|
757
|
+
return R(() => {
|
|
758
758
|
u.on("openWaitDlg", l), u.on("closeWaitDlg", o);
|
|
759
|
-
}),
|
|
759
|
+
}), O(() => {
|
|
760
760
|
u.off("openWaitDlg", l), u.off("closeWaitDlg", o);
|
|
761
761
|
}), (r, n) => {
|
|
762
|
-
const c =
|
|
763
|
-
return
|
|
762
|
+
const c = m("v-card"), p = m("v-dialog");
|
|
763
|
+
return C(), I(p, {
|
|
764
764
|
modelValue: z(t),
|
|
765
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
765
|
+
"onUpdate:modelValue": n[0] || (n[0] = (_) => J(t) ? t.value = _ : null),
|
|
766
766
|
persistent: "",
|
|
767
767
|
"no-click-animation": "",
|
|
768
768
|
fullscreen: ""
|
|
769
769
|
}, {
|
|
770
|
-
default:
|
|
771
|
-
|
|
772
|
-
|
|
770
|
+
default: h(() => [
|
|
771
|
+
v("div", Xe, [
|
|
772
|
+
x(c, {
|
|
773
773
|
width: "300px",
|
|
774
774
|
height: "80px",
|
|
775
775
|
loading: ""
|
|
776
776
|
}, {
|
|
777
|
-
default:
|
|
778
|
-
|
|
779
|
-
|
|
777
|
+
default: h(() => [
|
|
778
|
+
v("div", Je, [
|
|
779
|
+
v("span", null, V(z(a).t("waitingResponse")), 1)
|
|
780
780
|
])
|
|
781
781
|
]),
|
|
782
782
|
_: 1
|
|
@@ -788,7 +788,7 @@ const Ue = /* @__PURE__ */ T({
|
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
790
|
}), Ye = (e) => {
|
|
791
|
-
e.component("x-confirm-dlg",
|
|
791
|
+
e.component("x-confirm-dlg", Me), e.component("x-loading", Fe), e.component("x-message", He), e.component("x-prompt-dlg", Ge), e.component("x-wait-dlg", Qe);
|
|
792
792
|
};
|
|
793
793
|
function it() {
|
|
794
794
|
const e = Y(), a = g(() => e.global.current.value.colors.primary), t = g(() => e.global.current.value.colors.secondary), l = g(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = g(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = g(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), n = g(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = g(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
@@ -803,41 +803,37 @@ function it() {
|
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
function gt() {
|
|
806
|
-
const e =
|
|
807
|
-
|
|
806
|
+
const e = Ce(), a = ne(), t = Z(), l = re(), o = (s) => {
|
|
807
|
+
if (s.key === "Escape") {
|
|
808
|
+
r();
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
808
811
|
}, r = () => {
|
|
809
|
-
|
|
810
|
-
}, n = () => {
|
|
811
|
-
var R;
|
|
812
|
+
var k;
|
|
812
813
|
if (!l.isEmpty()) {
|
|
813
814
|
l.hasView("waitDlg") || l.popView();
|
|
814
815
|
return;
|
|
815
816
|
}
|
|
816
|
-
const
|
|
817
|
-
(
|
|
817
|
+
const s = K(e.path);
|
|
818
|
+
(s == null ? void 0 : s.level) === 0 ? (k = navigator == null ? void 0 : navigator.Backbutton) == null || k.goHome(
|
|
818
819
|
() => {
|
|
819
820
|
},
|
|
820
821
|
() => {
|
|
821
822
|
}
|
|
822
823
|
) : a.back();
|
|
823
|
-
},
|
|
824
|
-
t.dark =
|
|
825
|
-
},
|
|
826
|
-
t.locale =
|
|
827
|
-
},
|
|
828
|
-
t.permissionObjects =
|
|
829
|
-
},
|
|
830
|
-
t.lastAppPath =
|
|
831
|
-
}, C = (f) => {
|
|
832
|
-
if (f.key === "Escape") {
|
|
833
|
-
n();
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
824
|
+
}, n = (s) => {
|
|
825
|
+
t.dark = s;
|
|
826
|
+
}, c = (s) => {
|
|
827
|
+
t.locale = s;
|
|
828
|
+
}, p = (s) => {
|
|
829
|
+
t.permissionObjects = s[0], t.permissionChecksum = s[1];
|
|
830
|
+
}, _ = (s) => {
|
|
831
|
+
t.lastAppPath = s;
|
|
836
832
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
}),
|
|
840
|
-
|
|
833
|
+
R(() => {
|
|
834
|
+
window.addEventListener("keydown", o), u.on("backbutton", r), u.on("updateDark", n), u.on("updateLocale", c), u.on("updatePermission", p), u.on("updateLastAppPath", _), u.emit("syncGlobalState");
|
|
835
|
+
}), O(() => {
|
|
836
|
+
window.removeEventListener("keydown", o), u.off("backbutton", r), u.off("updateDark", n), u.off("updateLocale", c), u.off("updatePermission", p), u.off("updateLastAppPath", _);
|
|
841
837
|
});
|
|
842
838
|
}
|
|
843
839
|
function vt() {
|
package/dist/store/global.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { PermissionObjects } from '../utils';
|
|
2
2
|
export declare const useGlobalStore: import("pinia").StoreDefinition<"global", import("pinia")._UnwrapAll<Pick<{
|
|
3
|
-
dark: import("vue").Ref<boolean>;
|
|
3
|
+
dark: import("vue").Ref<boolean | undefined>;
|
|
4
4
|
locale: import("vue").Ref<string>;
|
|
5
5
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
6
6
|
permissionChecksum: import("vue").Ref<string>;
|
|
7
7
|
lastAppPath: import("vue").Ref<string>;
|
|
8
8
|
}, "dark" | "locale" | "permissionObjects" | "permissionChecksum" | "lastAppPath">>, Pick<{
|
|
9
|
-
dark: import("vue").Ref<boolean>;
|
|
9
|
+
dark: import("vue").Ref<boolean | undefined>;
|
|
10
10
|
locale: import("vue").Ref<string>;
|
|
11
11
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
12
12
|
permissionChecksum: import("vue").Ref<string>;
|
|
13
13
|
lastAppPath: import("vue").Ref<string>;
|
|
14
14
|
}, never>, Pick<{
|
|
15
|
-
dark: import("vue").Ref<boolean>;
|
|
15
|
+
dark: import("vue").Ref<boolean | undefined>;
|
|
16
16
|
locale: import("vue").Ref<string>;
|
|
17
17
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
18
18
|
permissionChecksum: import("vue").Ref<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type LocaleHook = (val: any) => Promise<void>;
|
|
2
|
+
export declare class GlobalState {
|
|
3
|
+
private master;
|
|
4
|
+
private localeHook;
|
|
5
|
+
private alreadySync;
|
|
6
|
+
private handlers;
|
|
7
|
+
constructor(master: boolean, localeHook?: LocaleHook);
|
|
8
|
+
sync(): Promise<void>;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
private onDarkChange;
|
|
11
|
+
private onLocaleChange;
|
|
12
|
+
private onPermissionChange;
|
|
13
|
+
private onLastAppPathChange;
|
|
14
|
+
private onSync;
|
|
15
|
+
}
|
|
16
|
+
export {};
|