x-essential-lib 0.3.11 → 0.3.12
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 +186 -178
- package/dist/store/viewMgr.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,87 +2,95 @@
|
|
|
2
2
|
import { VAlert as ve, VBtn as me, VCard as he, VCardActions as we, VCardText as ye, VCardTitle as xe, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
|
|
3
3
|
import { ref as i, computed as f, onMounted as D, onBeforeUnmount as T, defineComponent as O, watch as H, resolveComponent as g, openBlock as V, createBlock as A, unref as W, isRef as J, withKeys as N, withModifiers as $, withCtx as v, createVNode as h, createTextVNode as C, toDisplayString as b, createElementBlock as F, normalizeStyle as Ve, pushScopeId as De, popScopeId as qe, createElementVNode as m, reactive as Se, Fragment as Te, renderList as Oe } from "vue";
|
|
4
4
|
import { useLocale as X, useTheme as K, useDisplay as Re } from "vuetify/lib/framework.mjs";
|
|
5
|
-
import { defineStore as
|
|
5
|
+
import { defineStore as oe } from "pinia";
|
|
6
6
|
import { useRouter as re, useRoute as je } from "vue-router";
|
|
7
7
|
import Ie from "axios";
|
|
8
|
-
const ne =
|
|
8
|
+
const ne = oe("viewMgr", () => {
|
|
9
9
|
const e = i([]);
|
|
10
10
|
function a() {
|
|
11
11
|
return e.value.length <= 0;
|
|
12
12
|
}
|
|
13
|
-
function t(
|
|
14
|
-
|
|
13
|
+
function t() {
|
|
14
|
+
const s = e.value.length;
|
|
15
|
+
if (s > 0)
|
|
16
|
+
return e.value[s - 1];
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
+
function l(s) {
|
|
19
|
+
return e.value.find((c) => c === s) !== void 0;
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
+
function o(s) {
|
|
22
|
+
n(s), e.value.push(s);
|
|
23
|
+
}
|
|
24
|
+
function n(s) {
|
|
25
|
+
const c = e.value.findIndex((y) => y === s);
|
|
21
26
|
c !== -1 && e.value.splice(c, 1);
|
|
22
27
|
}
|
|
23
|
-
function
|
|
28
|
+
function r() {
|
|
24
29
|
e.value.pop();
|
|
25
30
|
}
|
|
26
|
-
|
|
31
|
+
function u() {
|
|
32
|
+
e.value = [];
|
|
33
|
+
}
|
|
34
|
+
return { isEmpty: a, lastView: t, hasView: l, addView: o, delView: n, popView: r, clearViews: u };
|
|
27
35
|
});
|
|
28
36
|
function Ee(e) {
|
|
29
37
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
30
|
-
var
|
|
31
|
-
|
|
38
|
+
var l = e.get(a);
|
|
39
|
+
l ? l.push(t) : e.set(a, [t]);
|
|
32
40
|
}, off: function(a, t) {
|
|
33
|
-
var
|
|
34
|
-
|
|
41
|
+
var l = e.get(a);
|
|
42
|
+
l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : e.set(a, []));
|
|
35
43
|
}, emit: function(a, t) {
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}), (
|
|
40
|
-
|
|
44
|
+
var l = e.get(a);
|
|
45
|
+
l && l.slice().map(function(o) {
|
|
46
|
+
o(t);
|
|
47
|
+
}), (l = e.get("*")) && l.slice().map(function(o) {
|
|
48
|
+
o(a, t);
|
|
41
49
|
});
|
|
42
50
|
} };
|
|
43
51
|
}
|
|
44
|
-
const
|
|
52
|
+
const _ = Ee();
|
|
45
53
|
async function dt(e) {
|
|
46
54
|
return new Promise((a) => {
|
|
47
55
|
setTimeout(a, e);
|
|
48
56
|
});
|
|
49
57
|
}
|
|
50
58
|
async function G(e, a, t) {
|
|
51
|
-
const
|
|
52
|
-
return new Promise((
|
|
59
|
+
const l = Date.now();
|
|
60
|
+
return new Promise((o) => {
|
|
53
61
|
const n = async () => {
|
|
54
|
-
e() ?
|
|
62
|
+
e() ? o(!0) : a && Date.now() - l > a ? o(!1) : setTimeout(n, t ?? 30);
|
|
55
63
|
};
|
|
56
64
|
n();
|
|
57
65
|
});
|
|
58
66
|
}
|
|
59
67
|
function Q(e, a) {
|
|
60
|
-
const t = ne(),
|
|
68
|
+
const t = ne(), l = f({
|
|
61
69
|
get() {
|
|
62
70
|
return t.hasView(e);
|
|
63
71
|
},
|
|
64
72
|
set(n) {
|
|
65
73
|
n ? t.addView(e) : t.delView(e);
|
|
66
74
|
}
|
|
67
|
-
}),
|
|
68
|
-
a == null || a(n),
|
|
75
|
+
}), o = (n) => {
|
|
76
|
+
a == null || a(n), l.value = !0;
|
|
69
77
|
};
|
|
70
78
|
return D(() => {
|
|
71
|
-
|
|
79
|
+
_.on(e, o);
|
|
72
80
|
}), T(() => {
|
|
73
|
-
|
|
74
|
-
}), { open:
|
|
81
|
+
_.off(e, o);
|
|
82
|
+
}), { open: l };
|
|
75
83
|
}
|
|
76
84
|
const $e = /* @__PURE__ */ O({
|
|
77
85
|
__name: "index",
|
|
78
86
|
setup(e) {
|
|
79
|
-
const a = X(), { open: t } = Q("confirmDlg"),
|
|
87
|
+
const a = X(), { open: t } = Q("confirmDlg"), l = i(""), o = i(""), n = i(), r = i(), u = f(() => {
|
|
80
88
|
var d;
|
|
81
89
|
return ((d = n.value) == null ? void 0 : d.color) ?? "primary";
|
|
82
|
-
}),
|
|
90
|
+
}), s = f(() => {
|
|
83
91
|
var d;
|
|
84
92
|
return ((d = n.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
85
|
-
}),
|
|
93
|
+
}), c = f(() => {
|
|
86
94
|
var d;
|
|
87
95
|
return ((d = r.value) == null ? void 0 : d.color) ?? "primary";
|
|
88
96
|
}), y = f(() => {
|
|
@@ -91,18 +99,18 @@ const $e = /* @__PURE__ */ O({
|
|
|
91
99
|
});
|
|
92
100
|
let R = 0, q = !1;
|
|
93
101
|
const M = (d) => {
|
|
94
|
-
|
|
102
|
+
l.value = d.title, o.value = d.text, n.value = d.cancel, r.value = d.confirm, R = d.seq, q = !1, t.value = !0;
|
|
95
103
|
};
|
|
96
104
|
D(() => {
|
|
97
|
-
|
|
105
|
+
_.on("confirmDlg", M);
|
|
98
106
|
}), T(() => {
|
|
99
|
-
|
|
107
|
+
_.off("confirmDlg", M);
|
|
100
108
|
});
|
|
101
109
|
const B = () => {
|
|
102
|
-
t.value = !1, q || (
|
|
110
|
+
t.value = !1, q || (_.emit("confirmDlgResult" + R, !0), q = !0);
|
|
103
111
|
};
|
|
104
112
|
return H(t, (d) => {
|
|
105
|
-
!d && !q && (
|
|
113
|
+
!d && !q && (_.emit("confirmDlgResult" + R, !1), q = !0);
|
|
106
114
|
}), (d, x) => {
|
|
107
115
|
const S = g("v-card-title"), L = g("v-card-text"), j = g("v-btn"), p = g("v-card-actions"), w = g("v-card"), z = g("v-dialog");
|
|
108
116
|
return V(), A(z, {
|
|
@@ -120,13 +128,13 @@ const $e = /* @__PURE__ */ O({
|
|
|
120
128
|
default: v(() => [
|
|
121
129
|
h(S, null, {
|
|
122
130
|
default: v(() => [
|
|
123
|
-
C(b(
|
|
131
|
+
C(b(l.value), 1)
|
|
124
132
|
]),
|
|
125
133
|
_: 1
|
|
126
134
|
}),
|
|
127
135
|
h(L, null, {
|
|
128
136
|
default: v(() => [
|
|
129
|
-
C(b(
|
|
137
|
+
C(b(o.value), 1)
|
|
130
138
|
]),
|
|
131
139
|
_: 1
|
|
132
140
|
}),
|
|
@@ -134,17 +142,17 @@ const $e = /* @__PURE__ */ O({
|
|
|
134
142
|
default: v(() => [
|
|
135
143
|
h(j, {
|
|
136
144
|
onClick: x[0] || (x[0] = (I) => t.value = !1),
|
|
137
|
-
color:
|
|
145
|
+
color: u.value,
|
|
138
146
|
variant: "text"
|
|
139
147
|
}, {
|
|
140
148
|
default: v(() => [
|
|
141
|
-
C(b(
|
|
149
|
+
C(b(s.value), 1)
|
|
142
150
|
]),
|
|
143
151
|
_: 1
|
|
144
152
|
}, 8, ["color"]),
|
|
145
153
|
h(j, {
|
|
146
154
|
onClick: B,
|
|
147
|
-
color:
|
|
155
|
+
color: c.value,
|
|
148
156
|
variant: "text"
|
|
149
157
|
}, {
|
|
150
158
|
default: v(() => [
|
|
@@ -187,19 +195,19 @@ const $e = /* @__PURE__ */ O({
|
|
|
187
195
|
}
|
|
188
196
|
},
|
|
189
197
|
setup(e) {
|
|
190
|
-
const a = K(), t = e,
|
|
198
|
+
const a = K(), t = e, l = f(() => ({
|
|
191
199
|
background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
192
200
|
zIndex: t.zIndex
|
|
193
201
|
}));
|
|
194
|
-
return (
|
|
202
|
+
return (o, n) => (V(), F("div", {
|
|
195
203
|
class: "x-cont",
|
|
196
|
-
style: Ve(
|
|
204
|
+
style: Ve(l.value)
|
|
197
205
|
}, Be, 4));
|
|
198
206
|
}
|
|
199
207
|
}), ce = (e, a) => {
|
|
200
208
|
const t = e.__vccOpts || e;
|
|
201
|
-
for (const [
|
|
202
|
-
t[
|
|
209
|
+
for (const [l, o] of a)
|
|
210
|
+
t[l] = o;
|
|
203
211
|
return t;
|
|
204
212
|
}, Ue = /* @__PURE__ */ ce(Le, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ O({
|
|
205
213
|
__name: "item",
|
|
@@ -223,7 +231,7 @@ const $e = /* @__PURE__ */ O({
|
|
|
223
231
|
},
|
|
224
232
|
emits: ["timeout"],
|
|
225
233
|
setup(e, { emit: a }) {
|
|
226
|
-
const t = e,
|
|
234
|
+
const t = e, l = i(!0), o = a, n = f(() => {
|
|
227
235
|
let r = "";
|
|
228
236
|
switch (t.type) {
|
|
229
237
|
case "error":
|
|
@@ -243,15 +251,15 @@ const $e = /* @__PURE__ */ O({
|
|
|
243
251
|
});
|
|
244
252
|
return D(() => {
|
|
245
253
|
setTimeout(() => {
|
|
246
|
-
|
|
254
|
+
o("timeout", t.id);
|
|
247
255
|
}, t.timeout);
|
|
248
|
-
}), H(
|
|
249
|
-
r ||
|
|
250
|
-
}), (r,
|
|
251
|
-
const
|
|
252
|
-
return V(), A(
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue":
|
|
256
|
+
}), H(l, (r) => {
|
|
257
|
+
r || o("timeout", t.id);
|
|
258
|
+
}), (r, u) => {
|
|
259
|
+
const s = g("v-alert");
|
|
260
|
+
return V(), A(s, {
|
|
261
|
+
modelValue: l.value,
|
|
262
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => l.value = c),
|
|
255
263
|
class: "mt-2",
|
|
256
264
|
type: e.type,
|
|
257
265
|
icon: n.value,
|
|
@@ -269,47 +277,47 @@ const $e = /* @__PURE__ */ O({
|
|
|
269
277
|
setup(e) {
|
|
270
278
|
const a = Se({ items: [] });
|
|
271
279
|
D(() => {
|
|
272
|
-
|
|
280
|
+
_.on("message", t);
|
|
273
281
|
}), T(() => {
|
|
274
|
-
|
|
282
|
+
_.off("message", t);
|
|
275
283
|
});
|
|
276
|
-
const t = (
|
|
277
|
-
n(
|
|
278
|
-
},
|
|
279
|
-
r(
|
|
284
|
+
const t = (u) => {
|
|
285
|
+
n(u.type, u.text, u.timeout);
|
|
286
|
+
}, l = (u) => {
|
|
287
|
+
r(u);
|
|
280
288
|
};
|
|
281
|
-
let
|
|
282
|
-
const n = (
|
|
283
|
-
const y =
|
|
284
|
-
a.items.push({ id: y, type:
|
|
285
|
-
}, r = (
|
|
286
|
-
const
|
|
287
|
-
|
|
289
|
+
let o = 0;
|
|
290
|
+
const n = (u, s, c) => {
|
|
291
|
+
const y = o++;
|
|
292
|
+
a.items.push({ id: y, type: u, text: s, timeout: c });
|
|
293
|
+
}, r = (u) => {
|
|
294
|
+
const s = a.items.findIndex((c) => c.id === u);
|
|
295
|
+
s >= 0 && a.items.splice(s, 1);
|
|
288
296
|
};
|
|
289
|
-
return (
|
|
290
|
-
onClick:
|
|
297
|
+
return (u, s) => (V(), F("div", {
|
|
298
|
+
onClick: s[0] || (s[0] = $(() => {
|
|
291
299
|
}, ["stop"])),
|
|
292
300
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
293
301
|
}, [
|
|
294
|
-
(V(!0), F(Te, null, Oe(a.items, (
|
|
295
|
-
onTimeout:
|
|
296
|
-
id:
|
|
297
|
-
type:
|
|
298
|
-
text:
|
|
299
|
-
timeout:
|
|
300
|
-
key:
|
|
302
|
+
(V(!0), F(Te, null, Oe(a.items, (c) => (V(), A(We, {
|
|
303
|
+
onTimeout: l,
|
|
304
|
+
id: c.id,
|
|
305
|
+
type: c.type,
|
|
306
|
+
text: c.text,
|
|
307
|
+
timeout: c.timeout,
|
|
308
|
+
key: c.id
|
|
301
309
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
302
310
|
]));
|
|
303
311
|
}
|
|
304
312
|
}), He = /* @__PURE__ */ ce(Ne, [["__scopeId", "data-v-70ed4b89"]]), Ke = /* @__PURE__ */ O({
|
|
305
313
|
__name: "index",
|
|
306
314
|
setup(e) {
|
|
307
|
-
const a = X(), { open: t } = Q("promptDlg"),
|
|
315
|
+
const a = X(), { open: t } = Q("promptDlg"), l = i(""), o = i(""), n = i(), r = i(), u = i(), s = i(""), c = i(), y = i(), R = f(() => {
|
|
308
316
|
var p;
|
|
309
|
-
return ((p =
|
|
317
|
+
return ((p = c.value) == null ? void 0 : p.color) ?? "primary";
|
|
310
318
|
}), q = f(() => {
|
|
311
319
|
var p;
|
|
312
|
-
return ((p =
|
|
320
|
+
return ((p = c.value) == null ? void 0 : p.text) ?? a.t("cancel");
|
|
313
321
|
}), M = f(() => {
|
|
314
322
|
var p;
|
|
315
323
|
return ((p = y.value) == null ? void 0 : p.color) ?? "primary";
|
|
@@ -320,18 +328,18 @@ const $e = /* @__PURE__ */ O({
|
|
|
320
328
|
let x = 0, S = !1;
|
|
321
329
|
const L = async (p) => {
|
|
322
330
|
var w;
|
|
323
|
-
|
|
331
|
+
l.value = p.title, o.value = p.text, n.value = p.label, r.value = p.placeholder, u.value = p.rules, s.value = p.value, c.value = p.cancel, y.value = p.confirm, x = p.seq, S = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (w = d.value) == null || w.focus();
|
|
324
332
|
};
|
|
325
333
|
D(() => {
|
|
326
|
-
|
|
334
|
+
_.on("promptDlg", L);
|
|
327
335
|
}), T(() => {
|
|
328
|
-
|
|
336
|
+
_.off("promptDlg", L);
|
|
329
337
|
});
|
|
330
338
|
const j = () => {
|
|
331
|
-
t.value = !1, S || (
|
|
339
|
+
t.value = !1, S || (_.emit("promptDlgResult" + x, s.value ?? ""), S = !0);
|
|
332
340
|
};
|
|
333
341
|
return H(t, (p) => {
|
|
334
|
-
!p && !S && (
|
|
342
|
+
!p && !S && (_.emit("promptDlgResult" + x, void 0), S = !0);
|
|
335
343
|
}), (p, w) => {
|
|
336
344
|
const z = g("v-card-title"), I = g("v-card-text"), pe = g("v-text-field"), de = g("v-form"), P = g("v-btn"), fe = g("v-card-actions"), ie = g("v-card"), ge = g("v-dialog");
|
|
337
345
|
return V(), A(ge, {
|
|
@@ -349,24 +357,24 @@ const $e = /* @__PURE__ */ O({
|
|
|
349
357
|
default: v(() => [
|
|
350
358
|
h(z, null, {
|
|
351
359
|
default: v(() => [
|
|
352
|
-
C(b(
|
|
360
|
+
C(b(l.value), 1)
|
|
353
361
|
]),
|
|
354
362
|
_: 1
|
|
355
363
|
}),
|
|
356
364
|
h(I, null, {
|
|
357
365
|
default: v(() => [
|
|
358
|
-
C(b(
|
|
366
|
+
C(b(o.value), 1)
|
|
359
367
|
]),
|
|
360
368
|
_: 1
|
|
361
369
|
}),
|
|
362
370
|
h(de, { class: "mx-3" }, {
|
|
363
371
|
default: v(() => [
|
|
364
372
|
h(pe, {
|
|
365
|
-
modelValue:
|
|
366
|
-
"onUpdate:modelValue": w[0] || (w[0] = (E) =>
|
|
373
|
+
modelValue: s.value,
|
|
374
|
+
"onUpdate:modelValue": w[0] || (w[0] = (E) => s.value = E),
|
|
367
375
|
label: n.value,
|
|
368
376
|
placeholder: r.value,
|
|
369
|
-
rules:
|
|
377
|
+
rules: u.value,
|
|
370
378
|
ref_key: "target",
|
|
371
379
|
ref: d
|
|
372
380
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])
|
|
@@ -409,27 +417,27 @@ const $e = /* @__PURE__ */ O({
|
|
|
409
417
|
}), ze = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Je = /* @__PURE__ */ O({
|
|
410
418
|
__name: "index",
|
|
411
419
|
setup(e) {
|
|
412
|
-
const a = X(), { open: t } = Q("waitDlg"),
|
|
420
|
+
const a = X(), { open: t } = Q("waitDlg"), l = () => {
|
|
413
421
|
t.value = !0;
|
|
414
|
-
},
|
|
422
|
+
}, o = () => {
|
|
415
423
|
t.value = !1;
|
|
416
424
|
};
|
|
417
425
|
return D(() => {
|
|
418
|
-
|
|
426
|
+
_.on("openWaitDlg", l), _.on("closeWaitDlg", o);
|
|
419
427
|
}), T(() => {
|
|
420
|
-
|
|
428
|
+
_.off("openWaitDlg", l), _.off("closeWaitDlg", o);
|
|
421
429
|
}), (n, r) => {
|
|
422
|
-
const
|
|
423
|
-
return V(), A(
|
|
430
|
+
const u = g("v-card"), s = g("v-dialog");
|
|
431
|
+
return V(), A(s, {
|
|
424
432
|
modelValue: W(t),
|
|
425
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
433
|
+
"onUpdate:modelValue": r[0] || (r[0] = (c) => J(t) ? t.value = c : null),
|
|
426
434
|
persistent: "",
|
|
427
435
|
"no-click-animation": "",
|
|
428
436
|
fullscreen: ""
|
|
429
437
|
}, {
|
|
430
438
|
default: v(() => [
|
|
431
439
|
m("div", ze, [
|
|
432
|
-
h(
|
|
440
|
+
h(u, {
|
|
433
441
|
width: "300px",
|
|
434
442
|
height: "80px",
|
|
435
443
|
loading: ""
|
|
@@ -451,18 +459,18 @@ const $e = /* @__PURE__ */ O({
|
|
|
451
459
|
e.component("v-alert", ve), e.component("v-btn", me), e.component("v-card", he), e.component("v-card-actions", we), e.component("v-card-text", ye), e.component("v-card-title", xe), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", $e), e.component("x-loading", Ue), e.component("x-message", He), e.component("x-prompt-dlg", Ke), e.component("x-wait-dlg", Je);
|
|
452
460
|
};
|
|
453
461
|
function ft() {
|
|
454
|
-
const e = K(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary),
|
|
462
|
+
const e = K(), 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"), u = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
455
463
|
return {
|
|
456
464
|
primaryColor: a,
|
|
457
465
|
secondaryColor: t,
|
|
458
|
-
backgroundColor0:
|
|
459
|
-
backgroundColor1:
|
|
466
|
+
backgroundColor0: l,
|
|
467
|
+
backgroundColor1: o,
|
|
460
468
|
backgroundColor2: n,
|
|
461
469
|
highlightColor: r,
|
|
462
|
-
borderColor:
|
|
470
|
+
borderColor: u
|
|
463
471
|
};
|
|
464
472
|
}
|
|
465
|
-
const Y =
|
|
473
|
+
const Y = oe(
|
|
466
474
|
"global",
|
|
467
475
|
() => {
|
|
468
476
|
const e = K(), a = i(!1);
|
|
@@ -475,12 +483,12 @@ const Y = le(
|
|
|
475
483
|
immediate: !0
|
|
476
484
|
}
|
|
477
485
|
);
|
|
478
|
-
const t = i("en"),
|
|
486
|
+
const t = i("en"), l = i({}), o = i("");
|
|
479
487
|
return {
|
|
480
488
|
dark: a,
|
|
481
489
|
locale: t,
|
|
482
|
-
permissionObjects:
|
|
483
|
-
permissionChecksum:
|
|
490
|
+
permissionObjects: l,
|
|
491
|
+
permissionChecksum: o
|
|
484
492
|
};
|
|
485
493
|
},
|
|
486
494
|
{
|
|
@@ -517,16 +525,16 @@ function Ye(e) {
|
|
|
517
525
|
return e.data;
|
|
518
526
|
}
|
|
519
527
|
function Ze(e, a) {
|
|
520
|
-
var
|
|
528
|
+
var o;
|
|
521
529
|
const t = e.response;
|
|
522
530
|
if (!t)
|
|
523
531
|
return Promise.reject(e);
|
|
524
532
|
t.status === 401 && Pe();
|
|
525
|
-
let
|
|
526
|
-
return
|
|
533
|
+
let l = (o = t.data) == null ? void 0 : o.message;
|
|
534
|
+
return l || (l = {
|
|
527
535
|
code: t.status,
|
|
528
536
|
message: t.statusText
|
|
529
|
-
}), a(
|
|
537
|
+
}), a(l), Promise.reject(e);
|
|
530
538
|
}
|
|
531
539
|
function Pe() {
|
|
532
540
|
U.remove("accessToken"), U.remove("refreshToken"), U.remove("activeOrg"), re().replace({ path: "/passport/login" });
|
|
@@ -544,46 +552,46 @@ async function gt(e) {
|
|
|
544
552
|
if (!ue())
|
|
545
553
|
return;
|
|
546
554
|
let a = !1, t;
|
|
547
|
-
const
|
|
555
|
+
const l = (n) => {
|
|
548
556
|
t = n, a = !0;
|
|
549
|
-
},
|
|
550
|
-
return
|
|
557
|
+
}, o = se();
|
|
558
|
+
return _.on("confirmDlgResult" + o, l), _.emit("confirmDlg", { ...e, seq: o }), await G(() => a), _.off("confirmDlgResult" + o, l), t;
|
|
551
559
|
}
|
|
552
560
|
async function vt(e) {
|
|
553
561
|
if (!ue())
|
|
554
562
|
return;
|
|
555
563
|
let a = !1, t;
|
|
556
|
-
const
|
|
564
|
+
const l = (n) => {
|
|
557
565
|
t = n, a = !0;
|
|
558
|
-
},
|
|
559
|
-
return
|
|
566
|
+
}, o = se();
|
|
567
|
+
return _.on("promptDlgResult" + o, l), _.emit("promptDlg", { ...e, seq: o }), await G(() => a), _.off("promptDlgResult" + o, l), t;
|
|
560
568
|
}
|
|
561
569
|
function mt() {
|
|
562
|
-
|
|
570
|
+
_.emit("openWaitDlg");
|
|
563
571
|
}
|
|
564
572
|
function ht() {
|
|
565
|
-
|
|
573
|
+
_.emit("closeWaitDlg");
|
|
566
574
|
}
|
|
567
575
|
function wt(e, a) {
|
|
568
|
-
|
|
576
|
+
_.emit("message", { type: "error", text: e, timeout: a });
|
|
569
577
|
}
|
|
570
578
|
function yt(e, a) {
|
|
571
|
-
|
|
579
|
+
_.emit("message", { type: "info", text: e, timeout: a });
|
|
572
580
|
}
|
|
573
581
|
function xt(e, a) {
|
|
574
|
-
|
|
582
|
+
_.emit("message", { type: "success", text: e, timeout: a });
|
|
575
583
|
}
|
|
576
584
|
function kt(e, a) {
|
|
577
|
-
|
|
585
|
+
_.emit("message", { type: "warning", text: e, timeout: a });
|
|
578
586
|
}
|
|
579
587
|
function bt(e) {
|
|
580
|
-
var
|
|
588
|
+
var l, o;
|
|
581
589
|
if (!window.appAppear) {
|
|
582
590
|
window.appAppear = !0;
|
|
583
591
|
return;
|
|
584
592
|
}
|
|
585
|
-
const a = "single-spa-application:" + e, t = (
|
|
586
|
-
t && (t.remove("app-left", "app-right", "app-reset"), (
|
|
593
|
+
const a = "single-spa-application:" + e, t = (l = document.getElementById(a)) == null ? void 0 : l.classList;
|
|
594
|
+
t && (t.remove("app-left", "app-right", "app-reset"), (o = window.routeExtras) != null && o.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
|
|
587
595
|
t.add("app-reset");
|
|
588
596
|
}, 0));
|
|
589
597
|
}
|
|
@@ -592,11 +600,11 @@ function te(e, a) {
|
|
|
592
600
|
if (!e)
|
|
593
601
|
return !1;
|
|
594
602
|
let t = e;
|
|
595
|
-
return Object.keys(t).length <= 0 || (a.split("/").forEach((
|
|
603
|
+
return Object.keys(t).length <= 0 || (a.split("/").forEach((o) => {
|
|
596
604
|
if (Object.keys(t).length <= 0)
|
|
597
605
|
return !0;
|
|
598
|
-
if (t[
|
|
599
|
-
t = t[
|
|
606
|
+
if (t[o])
|
|
607
|
+
t = t[o];
|
|
600
608
|
else
|
|
601
609
|
return !1;
|
|
602
610
|
}), Object.keys(t).length <= 0);
|
|
@@ -623,13 +631,13 @@ const _e = require("js-cookie"), at = [
|
|
|
623
631
|
];
|
|
624
632
|
function Z(e) {
|
|
625
633
|
let a, t = 0;
|
|
626
|
-
const
|
|
627
|
-
return at.forEach((
|
|
628
|
-
const n =
|
|
634
|
+
const l = e.split("/");
|
|
635
|
+
return at.forEach((o) => {
|
|
636
|
+
const n = o.path.split("/");
|
|
629
637
|
let r = 0;
|
|
630
|
-
for (let
|
|
638
|
+
for (let u = 0; u < l.length && !(u >= n.length || l[u] !== n[u]); u++)
|
|
631
639
|
r++;
|
|
632
|
-
r >= t && (a =
|
|
640
|
+
r >= t && (a = o, t = r);
|
|
633
641
|
}), a;
|
|
634
642
|
}
|
|
635
643
|
function ae(e) {
|
|
@@ -641,28 +649,28 @@ function ae(e) {
|
|
|
641
649
|
const t = e.split("/");
|
|
642
650
|
return console.assert(t.length >= 2), { app: t[1], path: a.path, level: a.level };
|
|
643
651
|
}
|
|
644
|
-
const
|
|
652
|
+
const le = i("");
|
|
645
653
|
function k(e, a) {
|
|
646
|
-
const t = ae(e),
|
|
654
|
+
const t = ae(e), l = ae(a), o = t.app === l.app, n = t.path === l.path, r = t.level >= l.level;
|
|
647
655
|
console.info(
|
|
648
|
-
`~~~~before route change~~~~ ${
|
|
649
|
-
),
|
|
656
|
+
`~~~~before route change~~~~ ${l.path} -> ${t.path} inner=${o} forward=${r}`
|
|
657
|
+
), o ? n ? le.value = "" : le.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
|
|
650
658
|
}
|
|
651
|
-
function
|
|
659
|
+
function lt() {
|
|
652
660
|
return !!_e.get("accessToken");
|
|
653
661
|
}
|
|
654
|
-
function
|
|
662
|
+
function ot() {
|
|
655
663
|
return !!_e.get("activeOrg");
|
|
656
664
|
}
|
|
657
665
|
function Ct(e, a, t) {
|
|
658
|
-
const
|
|
666
|
+
const l = lt(), o = ot(), n = Z(e.path);
|
|
659
667
|
if (!n) {
|
|
660
668
|
t();
|
|
661
669
|
return;
|
|
662
670
|
}
|
|
663
671
|
if (n.requiredState === "auth")
|
|
664
|
-
if (
|
|
665
|
-
if (
|
|
672
|
+
if (l)
|
|
673
|
+
if (o) {
|
|
666
674
|
const r = "/main";
|
|
667
675
|
k(r, a.path), t({ path: r });
|
|
668
676
|
} else
|
|
@@ -672,8 +680,8 @@ function Ct(e, a, t) {
|
|
|
672
680
|
k(r, a.path), t({ path: r });
|
|
673
681
|
}
|
|
674
682
|
else if (n.requiredState === "org")
|
|
675
|
-
if (
|
|
676
|
-
if (
|
|
683
|
+
if (l)
|
|
684
|
+
if (o)
|
|
677
685
|
k(e.path, a.path), t();
|
|
678
686
|
else {
|
|
679
687
|
const r = "/org/joinOrCreate";
|
|
@@ -683,8 +691,8 @@ function Ct(e, a, t) {
|
|
|
683
691
|
const r = "/passport/login";
|
|
684
692
|
k(r, a.path), t({ path: r });
|
|
685
693
|
}
|
|
686
|
-
else if (
|
|
687
|
-
if (
|
|
694
|
+
else if (l)
|
|
695
|
+
if (o) {
|
|
688
696
|
const r = "/main";
|
|
689
697
|
k(r, a.path), t({ path: r });
|
|
690
698
|
} else {
|
|
@@ -695,36 +703,36 @@ function Ct(e, a, t) {
|
|
|
695
703
|
k(e.path, a.path), t();
|
|
696
704
|
}
|
|
697
705
|
function Vt(e) {
|
|
698
|
-
const a = je(), t = re(),
|
|
699
|
-
if (
|
|
706
|
+
const a = je(), t = re(), l = Y(), o = ne(), n = (c) => {
|
|
707
|
+
if (c.key === "Escape") {
|
|
700
708
|
r();
|
|
701
709
|
return;
|
|
702
710
|
}
|
|
703
|
-
if (!e &&
|
|
704
|
-
|
|
711
|
+
if (!e && c.ctrlKey && c.key.toLowerCase() === "d") {
|
|
712
|
+
u();
|
|
705
713
|
return;
|
|
706
714
|
}
|
|
707
|
-
if (!e &&
|
|
708
|
-
|
|
715
|
+
if (!e && c.ctrlKey && c.key.toLowerCase() === "l") {
|
|
716
|
+
s();
|
|
709
717
|
return;
|
|
710
718
|
}
|
|
711
719
|
}, r = () => {
|
|
712
720
|
var y;
|
|
713
|
-
if (!
|
|
714
|
-
|
|
721
|
+
if (!o.isEmpty()) {
|
|
722
|
+
o.hasView("waitDlg") || o.popView();
|
|
715
723
|
return;
|
|
716
724
|
}
|
|
717
|
-
const
|
|
718
|
-
(
|
|
725
|
+
const c = Z(a.path);
|
|
726
|
+
(c == null ? void 0 : c.level) === 0 ? (y = navigator == null ? void 0 : navigator.Backbutton) == null || y.goHome(
|
|
719
727
|
() => {
|
|
720
728
|
},
|
|
721
729
|
() => {
|
|
722
730
|
}
|
|
723
731
|
) : t.back();
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
},
|
|
727
|
-
|
|
732
|
+
}, u = () => {
|
|
733
|
+
l.dark = !l.dark;
|
|
734
|
+
}, s = () => {
|
|
735
|
+
l.locale === "en" ? l.locale = "zhHans" : l.locale = "en";
|
|
728
736
|
};
|
|
729
737
|
return D(() => {
|
|
730
738
|
window.addEventListener("keydown", n, !1);
|
|
@@ -734,9 +742,9 @@ function Vt(e) {
|
|
|
734
742
|
}
|
|
735
743
|
function Dt() {
|
|
736
744
|
const e = Y();
|
|
737
|
-
function a(t,
|
|
738
|
-
const
|
|
739
|
-
return
|
|
745
|
+
function a(t, l) {
|
|
746
|
+
const o = e.permissionObjects[t];
|
|
747
|
+
return o ? l ? !(!te(o.includes, l) || te(o.excludes, l)) : !0 : !1;
|
|
740
748
|
}
|
|
741
749
|
return { verifyPermission: a };
|
|
742
750
|
}
|
|
@@ -746,38 +754,38 @@ function rt(e, a) {
|
|
|
746
754
|
function qt(e) {
|
|
747
755
|
const a = Y();
|
|
748
756
|
let t;
|
|
749
|
-
const
|
|
757
|
+
const l = () => {
|
|
750
758
|
clearTimeout(t), t = setTimeout(async () => {
|
|
751
|
-
await
|
|
759
|
+
await o(), t && l();
|
|
752
760
|
}, 3e3);
|
|
753
|
-
},
|
|
761
|
+
}, o = async () => {
|
|
754
762
|
try {
|
|
755
763
|
const { update: n, permissions: r } = await rt(e, {
|
|
756
764
|
checksum: a.permissionChecksum
|
|
757
765
|
});
|
|
758
766
|
if (!n)
|
|
759
767
|
return;
|
|
760
|
-
const
|
|
761
|
-
for (const
|
|
762
|
-
if (
|
|
768
|
+
const u = {};
|
|
769
|
+
for (const s in r) {
|
|
770
|
+
if (s === "checksum")
|
|
763
771
|
continue;
|
|
764
|
-
const
|
|
765
|
-
|
|
772
|
+
const c = r[s];
|
|
773
|
+
u[s] = JSON.parse(c);
|
|
766
774
|
}
|
|
767
|
-
a.permissionObjects =
|
|
775
|
+
a.permissionObjects = u, a.permissionChecksum = r.checksum ?? "";
|
|
768
776
|
} catch (n) {
|
|
769
777
|
console.error(n);
|
|
770
778
|
}
|
|
771
779
|
};
|
|
772
780
|
return D(() => {
|
|
773
|
-
|
|
781
|
+
o(), l();
|
|
774
782
|
}), T(() => {
|
|
775
783
|
clearTimeout(t), t = void 0;
|
|
776
784
|
}), {};
|
|
777
785
|
}
|
|
778
786
|
function St() {
|
|
779
|
-
const e = K(), { width: a } = Re(), t = f(() => e.global.name.value),
|
|
780
|
-
return { dark: t, sysBarAvail:
|
|
787
|
+
const e = K(), { width: a } = Re(), t = f(() => e.global.name.value), l = f(() => !!window.cordova), o = f(() => a.value <= 1280 ? a.value + "px" : a.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
788
|
+
return { dark: t, sysBarAvail: l, compactWidth: o };
|
|
781
789
|
}
|
|
782
790
|
const Tt = { install: Xe };
|
|
783
791
|
export {
|
|
@@ -786,7 +794,7 @@ export {
|
|
|
786
794
|
ht as closeWaitDlg,
|
|
787
795
|
it as createAxios,
|
|
788
796
|
Tt as default,
|
|
789
|
-
|
|
797
|
+
_ as eventBus,
|
|
790
798
|
te as isExist,
|
|
791
799
|
Z as matchRouteMeta,
|
|
792
800
|
wt as messageError,
|
|
@@ -797,7 +805,7 @@ export {
|
|
|
797
805
|
gt as openConfirmDlg,
|
|
798
806
|
vt as openPromptDlg,
|
|
799
807
|
mt as openWaitDlg,
|
|
800
|
-
|
|
808
|
+
le as routeTransName,
|
|
801
809
|
ft as useColor,
|
|
802
810
|
Y as useGlobalStore,
|
|
803
811
|
Vt as useHotkey,
|
package/dist/store/viewMgr.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
export declare const useViewMgrStore: import("pinia").StoreDefinition<"viewMgr", import("pinia")._UnwrapAll<Pick<{
|
|
2
2
|
isEmpty: () => boolean;
|
|
3
|
+
lastView: () => string | undefined;
|
|
3
4
|
hasView: (name: string) => boolean;
|
|
4
5
|
addView: (name: string) => void;
|
|
5
6
|
delView: (name: string) => void;
|
|
6
7
|
popView: () => void;
|
|
8
|
+
clearViews: () => void;
|
|
7
9
|
}, never>>, Pick<{
|
|
8
10
|
isEmpty: () => boolean;
|
|
11
|
+
lastView: () => string | undefined;
|
|
9
12
|
hasView: (name: string) => boolean;
|
|
10
13
|
addView: (name: string) => void;
|
|
11
14
|
delView: (name: string) => void;
|
|
12
15
|
popView: () => void;
|
|
16
|
+
clearViews: () => void;
|
|
13
17
|
}, never>, Pick<{
|
|
14
18
|
isEmpty: () => boolean;
|
|
19
|
+
lastView: () => string | undefined;
|
|
15
20
|
hasView: (name: string) => boolean;
|
|
16
21
|
addView: (name: string) => void;
|
|
17
22
|
delView: (name: string) => void;
|
|
18
23
|
popView: () => void;
|
|
19
|
-
|
|
24
|
+
clearViews: () => void;
|
|
25
|
+
}, "isEmpty" | "lastView" | "hasView" | "addView" | "delView" | "popView" | "clearViews">>;
|