x-essential-lib 0.5.42 → 0.5.44
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 +43 -49
- 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";
|
|
@@ -7,7 +7,7 @@ import { useRouter as ne, useRoute as Ce } from "vue-router";
|
|
|
7
7
|
const Y = le(
|
|
8
8
|
"global",
|
|
9
9
|
() => {
|
|
10
|
-
const e = H(), a = i(), t = i("en"), l = i({}), o = i(""), r = i("
|
|
10
|
+
const e = H(), a = i(), t = i("en"), l = i({}), o = i(""), r = i("");
|
|
11
11
|
return N(
|
|
12
12
|
a,
|
|
13
13
|
() => {
|
|
@@ -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,12 +216,8 @@ 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
|
-
if (!window.appAppear) {
|
|
222
|
-
window.appAppear = !0;
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
221
|
const t = "single-spa-application:" + e, l = (o = document.getElementById(t)) == null ? void 0 : o.classList;
|
|
226
222
|
l && (l.remove("app-left", "app-right", "app-reset"), a ? l.add("app-left") : l.add("app-right"), setTimeout(() => {
|
|
227
223
|
l.add("app-reset");
|
|
@@ -412,9 +408,7 @@ function D(e, a) {
|
|
|
412
408
|
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
409
|
console.info(
|
|
414
410
|
`~~~~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
|
-
});
|
|
411
|
+
), r ? n ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l && Ae(l.app, c), t.lastAppPath = "";
|
|
418
412
|
}
|
|
419
413
|
function Ee() {
|
|
420
414
|
return !!R.get("accessToken");
|
|
@@ -475,7 +469,7 @@ function P(e, a) {
|
|
|
475
469
|
};
|
|
476
470
|
return S(() => {
|
|
477
471
|
s.on(e, o);
|
|
478
|
-
}),
|
|
472
|
+
}), T(() => {
|
|
479
473
|
s.off(e, o);
|
|
480
474
|
}), { open: l };
|
|
481
475
|
}
|
|
@@ -496,13 +490,13 @@ const $e = /* @__PURE__ */ U({
|
|
|
496
490
|
return ((u = n.value) == null ? void 0 : u.text) ?? a.t("confirm");
|
|
497
491
|
});
|
|
498
492
|
let y = 0, C = !1;
|
|
499
|
-
const
|
|
493
|
+
const j = (u) => {
|
|
500
494
|
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
495
|
};
|
|
502
496
|
S(() => {
|
|
503
|
-
s.on("confirmDlg",
|
|
504
|
-
}),
|
|
505
|
-
s.off("confirmDlg",
|
|
497
|
+
s.on("confirmDlg", j);
|
|
498
|
+
}), T(() => {
|
|
499
|
+
s.off("confirmDlg", j);
|
|
506
500
|
});
|
|
507
501
|
const I = () => {
|
|
508
502
|
t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
|
|
@@ -510,7 +504,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
510
504
|
return N(t, (u) => {
|
|
511
505
|
!u && !C && (s.emit("confirmDlgResult" + y, !1), C = !0);
|
|
512
506
|
}), (u, g) => {
|
|
513
|
-
const b = h("v-card-text"), q = h("v-btn"),
|
|
507
|
+
const b = h("v-card-text"), q = h("v-btn"), O = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
|
|
514
508
|
return V(), E(x, {
|
|
515
509
|
modelValue: F(t),
|
|
516
510
|
"onUpdate:modelValue": g[1] || (g[1] = ($) => G(t) ? t.value = $ : null),
|
|
@@ -526,11 +520,11 @@ const $e = /* @__PURE__ */ U({
|
|
|
526
520
|
default: w(() => [
|
|
527
521
|
k(b, null, {
|
|
528
522
|
default: w(() => [
|
|
529
|
-
B(
|
|
523
|
+
B(A(o.value), 1)
|
|
530
524
|
]),
|
|
531
525
|
_: 1
|
|
532
526
|
}),
|
|
533
|
-
k(
|
|
527
|
+
k(O, { class: "d-flex justify-end" }, {
|
|
534
528
|
default: w(() => [
|
|
535
529
|
k(q, {
|
|
536
530
|
onClick: g[0] || (g[0] = ($) => t.value = !1),
|
|
@@ -538,7 +532,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
538
532
|
variant: "text"
|
|
539
533
|
}, {
|
|
540
534
|
default: w(() => [
|
|
541
|
-
B(
|
|
535
|
+
B(A(p.value), 1)
|
|
542
536
|
]),
|
|
543
537
|
_: 1
|
|
544
538
|
}, 8, ["color"]),
|
|
@@ -548,7 +542,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
548
542
|
variant: "text"
|
|
549
543
|
}, {
|
|
550
544
|
default: w(() => [
|
|
551
|
-
B(
|
|
545
|
+
B(A(v.value), 1)
|
|
552
546
|
]),
|
|
553
547
|
_: 1
|
|
554
548
|
}, 8, ["color"])
|
|
@@ -640,7 +634,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
640
634
|
const a = he({ items: [] });
|
|
641
635
|
S(() => {
|
|
642
636
|
s.on("message", t);
|
|
643
|
-
}),
|
|
637
|
+
}), T(() => {
|
|
644
638
|
s.off("message", t);
|
|
645
639
|
});
|
|
646
640
|
const t = (c) => {
|
|
@@ -680,7 +674,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
680
674
|
}), C = f(() => {
|
|
681
675
|
var d;
|
|
682
676
|
return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
683
|
-
}),
|
|
677
|
+
}), j = f(() => {
|
|
684
678
|
var d;
|
|
685
679
|
return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
|
|
686
680
|
}), I = f(() => {
|
|
@@ -694,10 +688,10 @@ const $e = /* @__PURE__ */ U({
|
|
|
694
688
|
};
|
|
695
689
|
S(() => {
|
|
696
690
|
s.on("promptDlg", q);
|
|
697
|
-
}),
|
|
691
|
+
}), T(() => {
|
|
698
692
|
s.off("promptDlg", q);
|
|
699
693
|
});
|
|
700
|
-
const
|
|
694
|
+
const O = () => {
|
|
701
695
|
t.value = !1, b || (s.emit("promptDlgResult" + g, p.value ?? ""), b = !0);
|
|
702
696
|
};
|
|
703
697
|
return N(t, (d) => {
|
|
@@ -709,7 +703,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
709
703
|
"onUpdate:modelValue": x[2] || (x[2] = (K) => G(t) ? t.value = K : null),
|
|
710
704
|
onKeydown: [
|
|
711
705
|
x[3] || (x[3] = M(W((K) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
712
|
-
M(W(
|
|
706
|
+
M(W(O, ["stop", "prevent"]), ["enter"])
|
|
713
707
|
],
|
|
714
708
|
transition: "dialog-top-transition",
|
|
715
709
|
"max-width": "600px"
|
|
@@ -719,7 +713,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
719
713
|
default: w(() => [
|
|
720
714
|
o.value ? (V(), E($, { key: 0 }, {
|
|
721
715
|
default: w(() => [
|
|
722
|
-
B(
|
|
716
|
+
B(A(o.value), 1)
|
|
723
717
|
]),
|
|
724
718
|
_: 1
|
|
725
719
|
})) : ye("", !0),
|
|
@@ -745,17 +739,17 @@ const $e = /* @__PURE__ */ U({
|
|
|
745
739
|
variant: "text"
|
|
746
740
|
}, {
|
|
747
741
|
default: w(() => [
|
|
748
|
-
B(
|
|
742
|
+
B(A(C.value), 1)
|
|
749
743
|
]),
|
|
750
744
|
_: 1
|
|
751
745
|
}, 8, ["color"]),
|
|
752
746
|
k(ee, {
|
|
753
|
-
onClick:
|
|
754
|
-
color:
|
|
747
|
+
onClick: O,
|
|
748
|
+
color: j.value,
|
|
755
749
|
variant: "text"
|
|
756
750
|
}, {
|
|
757
751
|
default: w(() => [
|
|
758
|
-
B(
|
|
752
|
+
B(A(I.value), 1)
|
|
759
753
|
]),
|
|
760
754
|
_: 1
|
|
761
755
|
}, 8, ["color"])
|
|
@@ -780,7 +774,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
780
774
|
};
|
|
781
775
|
return S(() => {
|
|
782
776
|
s.on("openWaitDlg", l), s.on("closeWaitDlg", o);
|
|
783
|
-
}),
|
|
777
|
+
}), T(() => {
|
|
784
778
|
s.off("openWaitDlg", l), s.off("closeWaitDlg", o);
|
|
785
779
|
}), (r, n) => {
|
|
786
780
|
const c = h("v-card"), p = h("v-dialog");
|
|
@@ -800,7 +794,7 @@ const $e = /* @__PURE__ */ U({
|
|
|
800
794
|
}, {
|
|
801
795
|
default: w(() => [
|
|
802
796
|
m("div", Ge, [
|
|
803
|
-
m("span", null,
|
|
797
|
+
m("span", null, A(F(a).t("waitingResponse")), 1)
|
|
804
798
|
])
|
|
805
799
|
]),
|
|
806
800
|
_: 1
|
|
@@ -852,7 +846,7 @@ function vt(e, a) {
|
|
|
852
846
|
};
|
|
853
847
|
S(() => {
|
|
854
848
|
s.on("pause", c), s.on("resume", p), s.on("backbutton", _);
|
|
855
|
-
}),
|
|
849
|
+
}), T(() => {
|
|
856
850
|
s.off("pause", c), s.off("resume", p), s.off("backbutton", _);
|
|
857
851
|
});
|
|
858
852
|
const v = (u) => {
|
|
@@ -871,7 +865,7 @@ function vt(e, a) {
|
|
|
871
865
|
};
|
|
872
866
|
S(() => {
|
|
873
867
|
window.addEventListener("keydown", v);
|
|
874
|
-
}),
|
|
868
|
+
}), T(() => {
|
|
875
869
|
window.removeEventListener("keydown", v);
|
|
876
870
|
});
|
|
877
871
|
let y;
|
|
@@ -887,26 +881,26 @@ function vt(e, a) {
|
|
|
887
881
|
if (!g)
|
|
888
882
|
return;
|
|
889
883
|
const q = {};
|
|
890
|
-
for (const
|
|
891
|
-
if (
|
|
884
|
+
for (const O in b) {
|
|
885
|
+
if (O === "checksum")
|
|
892
886
|
continue;
|
|
893
|
-
const d = b[
|
|
894
|
-
q[
|
|
887
|
+
const d = b[O];
|
|
888
|
+
q[O] = JSON.parse(d);
|
|
895
889
|
}
|
|
896
890
|
o.permissionObjects = q, o.permissionChecksum = b.checksum ?? "";
|
|
897
891
|
} catch (g) {
|
|
898
892
|
console.error(g);
|
|
899
893
|
}
|
|
900
|
-
},
|
|
894
|
+
}, j = async (u) => {
|
|
901
895
|
u && await C(), clearTimeout(y), y = setTimeout(async () => {
|
|
902
|
-
await C(), y &&
|
|
896
|
+
await C(), y && j();
|
|
903
897
|
}, 3e3);
|
|
904
898
|
}, I = () => {
|
|
905
899
|
clearTimeout(y), y = void 0;
|
|
906
900
|
};
|
|
907
901
|
S(() => {
|
|
908
|
-
a &&
|
|
909
|
-
}),
|
|
902
|
+
a && j(!0);
|
|
903
|
+
}), T(() => {
|
|
910
904
|
I();
|
|
911
905
|
});
|
|
912
906
|
}
|
|
@@ -925,7 +919,7 @@ function ht() {
|
|
|
925
919
|
const wt = { install: Ye };
|
|
926
920
|
export {
|
|
927
921
|
Be as Permission,
|
|
928
|
-
|
|
922
|
+
Ae as appAppear,
|
|
929
923
|
pt as closeWaitDlg,
|
|
930
924
|
lt as createAxios,
|
|
931
925
|
wt as default,
|