x-essential-lib 0.5.30 → 0.5.32
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 +38 -39
- package/dist/utils/misc.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -142,7 +142,7 @@ function X(e, a) {
|
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
var R = X(De, { path: "/" });
|
|
145
|
-
function
|
|
145
|
+
function lt(e) {
|
|
146
146
|
const a = be.create({
|
|
147
147
|
timeout: 6e3
|
|
148
148
|
});
|
|
@@ -200,7 +200,7 @@ function je(e) {
|
|
|
200
200
|
const s = function() {
|
|
201
201
|
return window.eventBus || (window.eventBus = je()), window.eventBus;
|
|
202
202
|
}();
|
|
203
|
-
async function
|
|
203
|
+
async function rt(e) {
|
|
204
204
|
return new Promise((a) => {
|
|
205
205
|
setTimeout(a, e);
|
|
206
206
|
});
|
|
@@ -214,17 +214,6 @@ async function Z(e, a, t) {
|
|
|
214
214
|
n();
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
function rt(e) {
|
|
218
|
-
var l, o;
|
|
219
|
-
if (!window.appAppear) {
|
|
220
|
-
window.appAppear = !0;
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const a = "single-spa-application:" + e, t = (l = document.getElementById(a)) == null ? void 0 : l.classList;
|
|
224
|
-
t && (t.remove("app-left", "app-right", "app-reset"), (o = window.routeExtras) != null && o.forward ? t.add("app-right") : t.add("app-left"), setTimeout(() => {
|
|
225
|
-
t.add("app-reset");
|
|
226
|
-
}, 0));
|
|
227
|
-
}
|
|
228
217
|
let te = Date.now();
|
|
229
218
|
function ce() {
|
|
230
219
|
const e = Date.now();
|
|
@@ -404,22 +393,33 @@ function z(e) {
|
|
|
404
393
|
}), a;
|
|
405
394
|
}
|
|
406
395
|
const oe = i("");
|
|
396
|
+
function Re(e, a) {
|
|
397
|
+
var o;
|
|
398
|
+
if (!window.appAppear) {
|
|
399
|
+
window.appAppear = !0;
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const t = "single-spa-application:" + e, l = (o = document.getElementById(t)) == null ? void 0 : o.classList;
|
|
403
|
+
l && (l.remove("app-left", "app-right", "app-reset"), a ? l.add("app-right") : l.add("app-left"), setTimeout(() => {
|
|
404
|
+
l.add("app-reset");
|
|
405
|
+
}, 0));
|
|
406
|
+
}
|
|
407
407
|
function D(e, a) {
|
|
408
408
|
const { lastAppPath: t } = Y();
|
|
409
|
-
|
|
409
|
+
a === "/" && (a = t);
|
|
410
410
|
const l = z(e), o = z(a), n = (l == null ? void 0 : l.app) === (o == null ? void 0 : o.app), r = (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);
|
|
411
411
|
console.info(
|
|
412
412
|
`~~~~before route change~~~~ ${a} -> ${e} inner=${n} forward=${c}`
|
|
413
|
-
), n ? r ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" :
|
|
413
|
+
), n ? r ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l && (!o || o.app !== l.app) && Re(l.app, c);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Ee() {
|
|
416
416
|
return !!R.get("accessToken");
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ue() {
|
|
419
419
|
return !!R.get("activeOrg");
|
|
420
420
|
}
|
|
421
421
|
function ft(e, a, t) {
|
|
422
|
-
const l =
|
|
422
|
+
const l = Ee(), o = Ue(), n = z(e.path);
|
|
423
423
|
if (!n) {
|
|
424
424
|
t();
|
|
425
425
|
return;
|
|
@@ -475,7 +475,7 @@ function P(e, a) {
|
|
|
475
475
|
s.off(e, o);
|
|
476
476
|
}), { open: l };
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const $e = /* @__PURE__ */ U({
|
|
479
479
|
__name: "index",
|
|
480
480
|
setup(e) {
|
|
481
481
|
const a = Q(), { open: t } = P("confirmDlg"), l = i(""), o = i(""), n = i(), r = i(), c = f(() => {
|
|
@@ -559,7 +559,7 @@ const Ue = /* @__PURE__ */ U({
|
|
|
559
559
|
}, 8, ["modelValue", "onKeydown"]);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
}),
|
|
562
|
+
}), Ke = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), We = /* @__PURE__ */ Ke(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
|
|
563
563
|
/* @__PURE__ */ m("div"),
|
|
564
564
|
/* @__PURE__ */ m("div"),
|
|
565
565
|
/* @__PURE__ */ m("div"),
|
|
@@ -572,9 +572,9 @@ const Ue = /* @__PURE__ */ U({
|
|
|
572
572
|
/* @__PURE__ */ m("div"),
|
|
573
573
|
/* @__PURE__ */ m("div"),
|
|
574
574
|
/* @__PURE__ */ m("div")
|
|
575
|
-
], -1)),
|
|
576
|
-
|
|
577
|
-
],
|
|
575
|
+
], -1)), ze = [
|
|
576
|
+
We
|
|
577
|
+
], Le = /* @__PURE__ */ U({
|
|
578
578
|
__name: "index",
|
|
579
579
|
props: {
|
|
580
580
|
zIndex: {
|
|
@@ -590,14 +590,14 @@ const Ue = /* @__PURE__ */ U({
|
|
|
590
590
|
return (o, n) => (V(), J("div", {
|
|
591
591
|
class: "x-cont",
|
|
592
592
|
style: ge(l.value)
|
|
593
|
-
},
|
|
593
|
+
}, ze, 4));
|
|
594
594
|
}
|
|
595
595
|
}), pe = (e, a) => {
|
|
596
596
|
const t = e.__vccOpts || e;
|
|
597
597
|
for (const [l, o] of a)
|
|
598
598
|
t[l] = o;
|
|
599
599
|
return t;
|
|
600
|
-
},
|
|
600
|
+
}, Fe = /* @__PURE__ */ pe(Le, [["__scopeId", "data-v-f4ad116e"]]), Me = /* @__PURE__ */ U({
|
|
601
601
|
__name: "item",
|
|
602
602
|
props: {
|
|
603
603
|
id: {},
|
|
@@ -630,7 +630,7 @@ const Ue = /* @__PURE__ */ U({
|
|
|
630
630
|
}, null, 8, ["modelValue", "type", "text"]);
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
|
-
}),
|
|
633
|
+
}), Ne = /* @__PURE__ */ U({
|
|
634
634
|
__name: "index",
|
|
635
635
|
setup(e) {
|
|
636
636
|
const a = he({ items: [] });
|
|
@@ -657,7 +657,7 @@ const Ue = /* @__PURE__ */ U({
|
|
|
657
657
|
}, ["stop"])),
|
|
658
658
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
659
659
|
}, [
|
|
660
|
-
(V(!0), J(we, null, xe(a.items, (_) => (V(), E(
|
|
660
|
+
(V(!0), J(we, null, xe(a.items, (_) => (V(), E(Me, {
|
|
661
661
|
onTimeout: l,
|
|
662
662
|
id: _.id,
|
|
663
663
|
type: _.type,
|
|
@@ -667,7 +667,7 @@ const Ue = /* @__PURE__ */ U({
|
|
|
667
667
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
668
668
|
]));
|
|
669
669
|
}
|
|
670
|
-
}),
|
|
670
|
+
}), He = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-8c2268ea"]]), Je = /* @__PURE__ */ U({
|
|
671
671
|
__name: "index",
|
|
672
672
|
setup(e) {
|
|
673
673
|
const a = Q(), { open: t } = P("promptDlg"), l = i(""), o = i(""), n = i(), r = i(), c = i(), p = i(""), _ = i(), v = i(), y = f(() => {
|
|
@@ -766,7 +766,7 @@ const Ue = /* @__PURE__ */ U({
|
|
|
766
766
|
}, 8, ["modelValue", "onKeydown"]);
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
-
}),
|
|
769
|
+
}), Xe = { class: "mx-auto my-auto" }, Ge = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ U({
|
|
770
770
|
__name: "index",
|
|
771
771
|
setup(e) {
|
|
772
772
|
const a = Q(), { open: t } = P("waitDlg"), l = () => {
|
|
@@ -788,14 +788,14 @@ const Ue = /* @__PURE__ */ U({
|
|
|
788
788
|
fullscreen: ""
|
|
789
789
|
}, {
|
|
790
790
|
default: w(() => [
|
|
791
|
-
m("div",
|
|
791
|
+
m("div", Xe, [
|
|
792
792
|
k(c, {
|
|
793
793
|
width: "300px",
|
|
794
794
|
height: "80px",
|
|
795
795
|
loading: ""
|
|
796
796
|
}, {
|
|
797
797
|
default: w(() => [
|
|
798
|
-
m("div",
|
|
798
|
+
m("div", Ge, [
|
|
799
799
|
m("span", null, A(F(a).t("waitingResponse")), 1)
|
|
800
800
|
])
|
|
801
801
|
]),
|
|
@@ -807,8 +807,8 @@ const Ue = /* @__PURE__ */ U({
|
|
|
807
807
|
}, 8, ["modelValue"]);
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
|
-
}),
|
|
811
|
-
e.component("x-confirm-dlg",
|
|
810
|
+
}), Ye = (e) => {
|
|
811
|
+
e.component("x-confirm-dlg", $e), e.component("x-loading", Fe), e.component("x-message", He), e.component("x-prompt-dlg", Je), e.component("x-wait-dlg", Qe);
|
|
812
812
|
};
|
|
813
813
|
function gt() {
|
|
814
814
|
const e = H(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), l = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
@@ -822,7 +822,7 @@ function gt() {
|
|
|
822
822
|
borderColor: c
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Ze(e, a) {
|
|
826
826
|
return e.post("pullPermission", a);
|
|
827
827
|
}
|
|
828
828
|
function vt(e, a) {
|
|
@@ -877,7 +877,7 @@ function vt(e, a) {
|
|
|
877
877
|
const u = z(t.path);
|
|
878
878
|
if (!(!u || u.requiredState !== "org"))
|
|
879
879
|
try {
|
|
880
|
-
const { update: g, permissions: b } = await
|
|
880
|
+
const { update: g, permissions: b } = await Ze(a, {
|
|
881
881
|
checksum: o.permissionChecksum
|
|
882
882
|
});
|
|
883
883
|
if (!g)
|
|
@@ -918,12 +918,11 @@ function ht() {
|
|
|
918
918
|
const e = H(), a = ke(), t = f(() => e.current.value.dark), l = f(() => !!window.cordova), o = f(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
919
919
|
return { dark: t, sysBarAvail: l, compactWidth: o };
|
|
920
920
|
}
|
|
921
|
-
const wt = { install:
|
|
921
|
+
const wt = { install: Ye };
|
|
922
922
|
export {
|
|
923
923
|
Ie as Permission,
|
|
924
|
-
rt as appAppear,
|
|
925
924
|
pt as closeWaitDlg,
|
|
926
|
-
|
|
925
|
+
lt as createAxios,
|
|
927
926
|
wt as default,
|
|
928
927
|
s as eventBus,
|
|
929
928
|
ae as isExist,
|
|
@@ -944,6 +943,6 @@ export {
|
|
|
944
943
|
ht as useSystem,
|
|
945
944
|
ne as useViewMgrStore,
|
|
946
945
|
P as useViewStack,
|
|
947
|
-
|
|
946
|
+
rt as waitMs,
|
|
948
947
|
Z as waitUtil
|
|
949
948
|
};
|
package/dist/utils/misc.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ import { Emitter, EventType } from 'mitt';
|
|
|
2
2
|
export declare const eventBus: Emitter<Record<EventType, unknown>>;
|
|
3
3
|
export declare function waitMs(ms: number): Promise<void>;
|
|
4
4
|
export declare function waitUtil(conditionFunc: () => boolean, timeout?: number, interval?: number): Promise<boolean>;
|
|
5
|
-
export declare function appAppear(name: string): void;
|