x-essential-lib 0.5.41 → 0.5.43
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 +42 -44
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, watch as N, computed as f, onMounted as S, onBeforeUnmount as
|
|
2
|
+
import { ref as i, watch as N, computed as f, onMounted as S, onBeforeUnmount as T, defineComponent as U, resolveComponent as h, openBlock as V, createBlock as E, unref as F, isRef as G, withKeys as M, withModifiers as W, withCtx as w, createVNode as k, createTextVNode as B, toDisplayString as A, createElementBlock as J, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as xe, createCommentVNode as ye } from "vue";
|
|
3
3
|
import { useTheme as H, useLocale as Q, useDisplay as ke } from "vuetify";
|
|
4
4
|
import { defineStore as le } from "pinia";
|
|
5
5
|
import be from "axios";
|
|
@@ -155,7 +155,7 @@ function lt(e) {
|
|
|
155
155
|
}
|
|
156
156
|
), a.interceptors.response.use(
|
|
157
157
|
(t) => qe(t),
|
|
158
|
-
(t) =>
|
|
158
|
+
(t) => Oe(t, e.onError)
|
|
159
159
|
), a;
|
|
160
160
|
}
|
|
161
161
|
function Se(e) {
|
|
@@ -168,22 +168,22 @@ function Ve(e, a) {
|
|
|
168
168
|
function qe(e) {
|
|
169
169
|
return e.data;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Oe(e, a) {
|
|
172
172
|
var o;
|
|
173
173
|
const t = e.response;
|
|
174
174
|
if (!t)
|
|
175
175
|
return Promise.reject(e);
|
|
176
|
-
t.status === 401 &&
|
|
176
|
+
t.status === 401 && Te();
|
|
177
177
|
let l = (o = t.data) == null ? void 0 : o.message;
|
|
178
178
|
return l || (l = {
|
|
179
179
|
code: t.status,
|
|
180
180
|
message: t.statusText
|
|
181
181
|
}), a(l), Promise.reject(e);
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Te() {
|
|
184
184
|
R.remove("accessToken"), R.remove("refreshToken"), R.remove("activeOrg"), ne().replace({ path: "/passport/login" });
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function je(e) {
|
|
187
187
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
188
188
|
var l = e.get(a);
|
|
189
189
|
l ? l.push(t) : e.set(a, [t]);
|
|
@@ -200,7 +200,7 @@ function Ae(e) {
|
|
|
200
200
|
} };
|
|
201
201
|
}
|
|
202
202
|
const s = function() {
|
|
203
|
-
return window.eventBus || (window.eventBus =
|
|
203
|
+
return window.eventBus || (window.eventBus = je()), window.eventBus;
|
|
204
204
|
}();
|
|
205
205
|
async function nt(e) {
|
|
206
206
|
return new Promise((a) => {
|
|
@@ -216,7 +216,7 @@ async function Z(e, a, t) {
|
|
|
216
216
|
r();
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Ae(e, a) {
|
|
220
220
|
var o;
|
|
221
221
|
if (!window.appAppear) {
|
|
222
222
|
window.appAppear = !0;
|
|
@@ -412,9 +412,7 @@ function D(e, a) {
|
|
|
412
412
|
const l = z(e), o = z(a), r = (l == null ? void 0 : l.app) === (o == null ? void 0 : o.app), n = (l == null ? void 0 : l.path) === (o == null ? void 0 : o.path), c = ((l == null ? void 0 : l.level) ?? -1) >= ((o == null ? void 0 : o.level) ?? -1);
|
|
413
413
|
console.info(
|
|
414
414
|
`~~~~before route change~~~~ ${a} -> ${e} inner=${r} forward=${c}`
|
|
415
|
-
), r ? n ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l &&
|
|
416
|
-
t.lastAppPath = "/";
|
|
417
|
-
});
|
|
415
|
+
), r ? n ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l && Ae(l.app, c);
|
|
418
416
|
}
|
|
419
417
|
function Ee() {
|
|
420
418
|
return !!R.get("accessToken");
|
|
@@ -475,7 +473,7 @@ function P(e, a) {
|
|
|
475
473
|
};
|
|
476
474
|
return S(() => {
|
|
477
475
|
s.on(e, o);
|
|
478
|
-
}),
|
|
476
|
+
}), T(() => {
|
|
479
477
|
s.off(e, o);
|
|
480
478
|
}), { open: l };
|
|
481
479
|
}
|
|
@@ -496,13 +494,13 @@ const $e = /* @__PURE__ */ U({
|
|
|
496
494
|
return ((u = n.value) == null ? void 0 : u.text) ?? a.t("confirm");
|
|
497
495
|
});
|
|
498
496
|
let y = 0, C = !1;
|
|
499
|
-
const
|
|
497
|
+
const j = (u) => {
|
|
500
498
|
l.value = u.title, o.value = u.text, r.value = u.cancel, n.value = u.confirm, y = u.seq, C = !1, t.value = !0;
|
|
501
499
|
};
|
|
502
500
|
S(() => {
|
|
503
|
-
s.on("confirmDlg",
|
|
504
|
-
}),
|
|
505
|
-
s.off("confirmDlg",
|
|
501
|
+
s.on("confirmDlg", j);
|
|
502
|
+
}), T(() => {
|
|
503
|
+
s.off("confirmDlg", j);
|
|
506
504
|
});
|
|
507
505
|
const I = () => {
|
|
508
506
|
t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
|
|
@@ -510,7 +508,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
510
508
|
return N(t, (u) => {
|
|
511
509
|
!u && !C && (s.emit("confirmDlgResult" + y, !1), C = !0);
|
|
512
510
|
}), (u, g) => {
|
|
513
|
-
const b = h("v-card-text"), q = h("v-btn"),
|
|
511
|
+
const b = h("v-card-text"), q = h("v-btn"), O = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
|
|
514
512
|
return V(), E(x, {
|
|
515
513
|
modelValue: F(t),
|
|
516
514
|
"onUpdate:modelValue": g[1] || (g[1] = ($) => G(t) ? t.value = $ : null),
|
|
@@ -526,11 +524,11 @@ const $e = /* @__PURE__ */ U({
|
|
|
526
524
|
default: w(() => [
|
|
527
525
|
k(b, null, {
|
|
528
526
|
default: w(() => [
|
|
529
|
-
B(
|
|
527
|
+
B(A(o.value), 1)
|
|
530
528
|
]),
|
|
531
529
|
_: 1
|
|
532
530
|
}),
|
|
533
|
-
k(
|
|
531
|
+
k(O, { class: "d-flex justify-end" }, {
|
|
534
532
|
default: w(() => [
|
|
535
533
|
k(q, {
|
|
536
534
|
onClick: g[0] || (g[0] = ($) => t.value = !1),
|
|
@@ -538,7 +536,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
538
536
|
variant: "text"
|
|
539
537
|
}, {
|
|
540
538
|
default: w(() => [
|
|
541
|
-
B(
|
|
539
|
+
B(A(p.value), 1)
|
|
542
540
|
]),
|
|
543
541
|
_: 1
|
|
544
542
|
}, 8, ["color"]),
|
|
@@ -548,7 +546,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
548
546
|
variant: "text"
|
|
549
547
|
}, {
|
|
550
548
|
default: w(() => [
|
|
551
|
-
B(
|
|
549
|
+
B(A(v.value), 1)
|
|
552
550
|
]),
|
|
553
551
|
_: 1
|
|
554
552
|
}, 8, ["color"])
|
|
@@ -640,7 +638,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
640
638
|
const a = he({ items: [] });
|
|
641
639
|
S(() => {
|
|
642
640
|
s.on("message", t);
|
|
643
|
-
}),
|
|
641
|
+
}), T(() => {
|
|
644
642
|
s.off("message", t);
|
|
645
643
|
});
|
|
646
644
|
const t = (c) => {
|
|
@@ -680,7 +678,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
680
678
|
}), C = f(() => {
|
|
681
679
|
var d;
|
|
682
680
|
return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
683
|
-
}),
|
|
681
|
+
}), j = f(() => {
|
|
684
682
|
var d;
|
|
685
683
|
return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
|
|
686
684
|
}), I = f(() => {
|
|
@@ -694,10 +692,10 @@ const $e = /* @__PURE__ */ U({
|
|
|
694
692
|
};
|
|
695
693
|
S(() => {
|
|
696
694
|
s.on("promptDlg", q);
|
|
697
|
-
}),
|
|
695
|
+
}), T(() => {
|
|
698
696
|
s.off("promptDlg", q);
|
|
699
697
|
});
|
|
700
|
-
const
|
|
698
|
+
const O = () => {
|
|
701
699
|
t.value = !1, b || (s.emit("promptDlgResult" + g, p.value ?? ""), b = !0);
|
|
702
700
|
};
|
|
703
701
|
return N(t, (d) => {
|
|
@@ -709,7 +707,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
709
707
|
"onUpdate:modelValue": x[2] || (x[2] = (K) => G(t) ? t.value = K : null),
|
|
710
708
|
onKeydown: [
|
|
711
709
|
x[3] || (x[3] = M(W((K) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
712
|
-
M(W(
|
|
710
|
+
M(W(O, ["stop", "prevent"]), ["enter"])
|
|
713
711
|
],
|
|
714
712
|
transition: "dialog-top-transition",
|
|
715
713
|
"max-width": "600px"
|
|
@@ -719,7 +717,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
719
717
|
default: w(() => [
|
|
720
718
|
o.value ? (V(), E($, { key: 0 }, {
|
|
721
719
|
default: w(() => [
|
|
722
|
-
B(
|
|
720
|
+
B(A(o.value), 1)
|
|
723
721
|
]),
|
|
724
722
|
_: 1
|
|
725
723
|
})) : ye("", !0),
|
|
@@ -745,17 +743,17 @@ const $e = /* @__PURE__ */ U({
|
|
|
745
743
|
variant: "text"
|
|
746
744
|
}, {
|
|
747
745
|
default: w(() => [
|
|
748
|
-
B(
|
|
746
|
+
B(A(C.value), 1)
|
|
749
747
|
]),
|
|
750
748
|
_: 1
|
|
751
749
|
}, 8, ["color"]),
|
|
752
750
|
k(ee, {
|
|
753
|
-
onClick:
|
|
754
|
-
color:
|
|
751
|
+
onClick: O,
|
|
752
|
+
color: j.value,
|
|
755
753
|
variant: "text"
|
|
756
754
|
}, {
|
|
757
755
|
default: w(() => [
|
|
758
|
-
B(
|
|
756
|
+
B(A(I.value), 1)
|
|
759
757
|
]),
|
|
760
758
|
_: 1
|
|
761
759
|
}, 8, ["color"])
|
|
@@ -780,7 +778,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
780
778
|
};
|
|
781
779
|
return S(() => {
|
|
782
780
|
s.on("openWaitDlg", l), s.on("closeWaitDlg", o);
|
|
783
|
-
}),
|
|
781
|
+
}), T(() => {
|
|
784
782
|
s.off("openWaitDlg", l), s.off("closeWaitDlg", o);
|
|
785
783
|
}), (r, n) => {
|
|
786
784
|
const c = h("v-card"), p = h("v-dialog");
|
|
@@ -800,7 +798,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
800
798
|
}, {
|
|
801
799
|
default: w(() => [
|
|
802
800
|
m("div", Ge, [
|
|
803
|
-
m("span", null,
|
|
801
|
+
m("span", null, A(F(a).t("waitingResponse")), 1)
|
|
804
802
|
])
|
|
805
803
|
]),
|
|
806
804
|
_: 1
|
|
@@ -852,7 +850,7 @@ function vt(e, a) {
|
|
|
852
850
|
};
|
|
853
851
|
S(() => {
|
|
854
852
|
s.on("pause", c), s.on("resume", p), s.on("backbutton", _);
|
|
855
|
-
}),
|
|
853
|
+
}), T(() => {
|
|
856
854
|
s.off("pause", c), s.off("resume", p), s.off("backbutton", _);
|
|
857
855
|
});
|
|
858
856
|
const v = (u) => {
|
|
@@ -871,7 +869,7 @@ function vt(e, a) {
|
|
|
871
869
|
};
|
|
872
870
|
S(() => {
|
|
873
871
|
window.addEventListener("keydown", v);
|
|
874
|
-
}),
|
|
872
|
+
}), T(() => {
|
|
875
873
|
window.removeEventListener("keydown", v);
|
|
876
874
|
});
|
|
877
875
|
let y;
|
|
@@ -887,26 +885,26 @@ function vt(e, a) {
|
|
|
887
885
|
if (!g)
|
|
888
886
|
return;
|
|
889
887
|
const q = {};
|
|
890
|
-
for (const
|
|
891
|
-
if (
|
|
888
|
+
for (const O in b) {
|
|
889
|
+
if (O === "checksum")
|
|
892
890
|
continue;
|
|
893
|
-
const d = b[
|
|
894
|
-
q[
|
|
891
|
+
const d = b[O];
|
|
892
|
+
q[O] = JSON.parse(d);
|
|
895
893
|
}
|
|
896
894
|
o.permissionObjects = q, o.permissionChecksum = b.checksum ?? "";
|
|
897
895
|
} catch (g) {
|
|
898
896
|
console.error(g);
|
|
899
897
|
}
|
|
900
|
-
},
|
|
898
|
+
}, j = async (u) => {
|
|
901
899
|
u && await C(), clearTimeout(y), y = setTimeout(async () => {
|
|
902
|
-
await C(), y &&
|
|
900
|
+
await C(), y && j();
|
|
903
901
|
}, 3e3);
|
|
904
902
|
}, I = () => {
|
|
905
903
|
clearTimeout(y), y = void 0;
|
|
906
904
|
};
|
|
907
905
|
S(() => {
|
|
908
|
-
a &&
|
|
909
|
-
}),
|
|
906
|
+
a && j(!0);
|
|
907
|
+
}), T(() => {
|
|
910
908
|
I();
|
|
911
909
|
});
|
|
912
910
|
}
|
|
@@ -925,7 +923,7 @@ function ht() {
|
|
|
925
923
|
const wt = { install: Ye };
|
|
926
924
|
export {
|
|
927
925
|
Be as Permission,
|
|
928
|
-
|
|
926
|
+
Ae as appAppear,
|
|
929
927
|
pt as closeWaitDlg,
|
|
930
928
|
lt as createAxios,
|
|
931
929
|
wt as default,
|