x-essential-lib 0.3.15 → 0.3.17
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 +162 -162
- 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 t=document.createElement("style");t.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-a8f3d91f]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-a8f3d91f]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-a8f3d91f]{transform-origin:20px 20px;animation:lds-spinner-a8f3d91f 1.2s linear infinite}.lds-spinner div[data-v-a8f3d91f]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-a8f3d91f]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-a8f3d91f]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-a8f3d91f]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-a8f3d91f]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-a8f3d91f]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-a8f3d91f]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-a8f3d91f]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-a8f3d91f]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-a8f3d91f]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-a8f3d91f{0%{opacity:1}to{opacity:0}}.x-cont[data-v-70ed4b89]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
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
|
-
import { ref as i, computed as f, onMounted as
|
|
4
|
-
import { useLocale as X, useTheme as
|
|
5
|
-
import { defineStore as
|
|
3
|
+
import { ref as i, computed as f, onMounted as S, onBeforeUnmount as T, defineComponent as R, watch as W, resolveComponent as g, openBlock as C, createBlock as O, unref as N, isRef as J, withKeys as U, withModifiers as A, withCtx as v, createVNode as h, createTextVNode as V, toDisplayString as b, createElementBlock as F, normalizeStyle as Ve, pushScopeId as Se, popScopeId as De, createElementVNode as m, reactive as qe, Fragment as Te, renderList as Oe, createCommentVNode as Re } from "vue";
|
|
4
|
+
import { useLocale as X, useTheme as H, useDisplay as je } from "vuetify/lib/framework.mjs";
|
|
5
|
+
import { defineStore as le } from "pinia";
|
|
6
6
|
import { useRouter as re, useRoute as Ie } from "vue-router";
|
|
7
7
|
import Ee from "axios";
|
|
8
|
-
const ne =
|
|
8
|
+
const ne = le("viewMgr", () => {
|
|
9
9
|
const e = i([]);
|
|
10
10
|
function a() {
|
|
11
11
|
return e.value.length <= 0;
|
|
@@ -15,10 +15,10 @@ const ne = oe("viewMgr", () => {
|
|
|
15
15
|
if (s > 0)
|
|
16
16
|
return e.value[s - 1];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function o(s) {
|
|
19
19
|
return e.value.find((c) => c === s) !== void 0;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function l(s) {
|
|
22
22
|
n(s), e.value.push(s);
|
|
23
23
|
}
|
|
24
24
|
function n(s) {
|
|
@@ -31,21 +31,21 @@ const ne = oe("viewMgr", () => {
|
|
|
31
31
|
function u() {
|
|
32
32
|
e.value = [];
|
|
33
33
|
}
|
|
34
|
-
return { isEmpty: a, lastView: t, hasView:
|
|
34
|
+
return { isEmpty: a, lastView: t, hasView: o, addView: l, delView: n, popView: r, clearViews: u };
|
|
35
35
|
});
|
|
36
36
|
function $e(e) {
|
|
37
37
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
38
|
-
var
|
|
39
|
-
|
|
38
|
+
var o = e.get(a);
|
|
39
|
+
o ? o.push(t) : e.set(a, [t]);
|
|
40
40
|
}, off: function(a, t) {
|
|
41
|
-
var
|
|
42
|
-
|
|
41
|
+
var o = e.get(a);
|
|
42
|
+
o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(a, []));
|
|
43
43
|
}, emit: function(a, t) {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}), (
|
|
48
|
-
|
|
44
|
+
var o = e.get(a);
|
|
45
|
+
o && o.slice().map(function(l) {
|
|
46
|
+
l(t);
|
|
47
|
+
}), (o = e.get("*")) && o.slice().map(function(l) {
|
|
48
|
+
l(a, t);
|
|
49
49
|
});
|
|
50
50
|
} };
|
|
51
51
|
}
|
|
@@ -56,35 +56,35 @@ async function ft(e) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
async function G(e, a, t) {
|
|
59
|
-
const
|
|
60
|
-
return new Promise((
|
|
59
|
+
const o = Date.now();
|
|
60
|
+
return new Promise((l) => {
|
|
61
61
|
const n = async () => {
|
|
62
|
-
e() ?
|
|
62
|
+
e() ? l(!0) : a && Date.now() - o > a ? l(!1) : setTimeout(n, t ?? 30);
|
|
63
63
|
};
|
|
64
64
|
n();
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function Q(e, a) {
|
|
68
|
-
const t = ne(),
|
|
68
|
+
const t = ne(), o = f({
|
|
69
69
|
get() {
|
|
70
70
|
return t.hasView(e);
|
|
71
71
|
},
|
|
72
72
|
set(n) {
|
|
73
73
|
n ? t.addView(e) : t.delView(e);
|
|
74
74
|
}
|
|
75
|
-
}),
|
|
76
|
-
a == null || a(n),
|
|
75
|
+
}), l = (n) => {
|
|
76
|
+
a == null || a(n), o.value = !0;
|
|
77
77
|
};
|
|
78
|
-
return
|
|
79
|
-
_.on(e,
|
|
78
|
+
return S(() => {
|
|
79
|
+
_.on(e, l);
|
|
80
80
|
}), T(() => {
|
|
81
|
-
_.off(e,
|
|
82
|
-
}), { open:
|
|
81
|
+
_.off(e, l);
|
|
82
|
+
}), { open: o };
|
|
83
83
|
}
|
|
84
84
|
const Ae = /* @__PURE__ */ R({
|
|
85
85
|
__name: "index",
|
|
86
86
|
setup(e) {
|
|
87
|
-
const a = X(), { open: t } = Q("confirmDlg"),
|
|
87
|
+
const a = X(), { open: t } = Q("confirmDlg"), o = i(""), l = i(""), n = i(), r = i(), u = f(() => {
|
|
88
88
|
var d;
|
|
89
89
|
return ((d = n.value) == null ? void 0 : d.color) ?? "primary";
|
|
90
90
|
}), s = f(() => {
|
|
@@ -97,28 +97,28 @@ const Ae = /* @__PURE__ */ R({
|
|
|
97
97
|
var d;
|
|
98
98
|
return ((d = r.value) == null ? void 0 : d.text) ?? a.t("confirm");
|
|
99
99
|
});
|
|
100
|
-
let j = 0,
|
|
100
|
+
let j = 0, D = !1;
|
|
101
101
|
const M = (d) => {
|
|
102
|
-
|
|
102
|
+
o.value = d.title, l.value = d.text, n.value = d.cancel, r.value = d.confirm, j = d.seq, D = !1, t.value = !0;
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
S(() => {
|
|
105
105
|
_.on("confirmDlg", M);
|
|
106
106
|
}), T(() => {
|
|
107
107
|
_.off("confirmDlg", M);
|
|
108
108
|
});
|
|
109
109
|
const B = () => {
|
|
110
|
-
t.value = !1,
|
|
110
|
+
t.value = !1, D || (_.emit("confirmDlgResult" + j, !0), D = !0);
|
|
111
111
|
};
|
|
112
|
-
return
|
|
113
|
-
!d && !
|
|
112
|
+
return W(t, (d) => {
|
|
113
|
+
!d && !D && (_.emit("confirmDlgResult" + j, !1), D = !0);
|
|
114
114
|
}), (d, x) => {
|
|
115
|
-
const
|
|
115
|
+
const q = g("v-card-title"), L = g("v-card-text"), I = g("v-btn"), p = g("v-card-actions"), w = g("v-card"), z = g("v-dialog");
|
|
116
116
|
return C(), O(z, {
|
|
117
|
-
modelValue:
|
|
117
|
+
modelValue: N(t),
|
|
118
118
|
"onUpdate:modelValue": x[1] || (x[1] = (E) => J(t) ? t.value = E : null),
|
|
119
119
|
onKeydown: [
|
|
120
|
-
x[2] || (x[2] =
|
|
121
|
-
|
|
120
|
+
x[2] || (x[2] = U(A((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
121
|
+
U(A(B, ["stop", "prevent"]), ["enter"])
|
|
122
122
|
],
|
|
123
123
|
transition: "dialog-top-transition",
|
|
124
124
|
"max-width": "600px"
|
|
@@ -126,15 +126,15 @@ const Ae = /* @__PURE__ */ R({
|
|
|
126
126
|
default: v(() => [
|
|
127
127
|
h(w, null, {
|
|
128
128
|
default: v(() => [
|
|
129
|
-
h(
|
|
129
|
+
h(q, null, {
|
|
130
130
|
default: v(() => [
|
|
131
|
-
V(b(
|
|
131
|
+
V(b(o.value), 1)
|
|
132
132
|
]),
|
|
133
133
|
_: 1
|
|
134
134
|
}),
|
|
135
135
|
h(L, null, {
|
|
136
136
|
default: v(() => [
|
|
137
|
-
V(b(
|
|
137
|
+
V(b(l.value), 1)
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
140
|
}),
|
|
@@ -171,7 +171,7 @@ const Ae = /* @__PURE__ */ R({
|
|
|
171
171
|
}, 8, ["modelValue", "onKeydown"]);
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
}), Me = (e) => (
|
|
174
|
+
}), Me = (e) => (Se("data-v-a8f3d91f"), e = e(), De(), e), Be = /* @__PURE__ */ Me(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
|
|
175
175
|
/* @__PURE__ */ m("div"),
|
|
176
176
|
/* @__PURE__ */ m("div"),
|
|
177
177
|
/* @__PURE__ */ m("div"),
|
|
@@ -186,7 +186,7 @@ const Ae = /* @__PURE__ */ R({
|
|
|
186
186
|
/* @__PURE__ */ m("div")
|
|
187
187
|
], -1)), Le = [
|
|
188
188
|
Be
|
|
189
|
-
],
|
|
189
|
+
], Ke = /* @__PURE__ */ R({
|
|
190
190
|
__name: "index",
|
|
191
191
|
props: {
|
|
192
192
|
zIndex: {
|
|
@@ -195,21 +195,21 @@ const Ae = /* @__PURE__ */ R({
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
setup(e) {
|
|
198
|
-
const a =
|
|
198
|
+
const a = H(), t = e, o = f(() => ({
|
|
199
199
|
background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
200
200
|
zIndex: t.zIndex
|
|
201
201
|
}));
|
|
202
|
-
return (
|
|
202
|
+
return (l, n) => (C(), F("div", {
|
|
203
203
|
class: "x-cont",
|
|
204
|
-
style: Ve(
|
|
204
|
+
style: Ve(o.value)
|
|
205
205
|
}, Le, 4));
|
|
206
206
|
}
|
|
207
207
|
}), ce = (e, a) => {
|
|
208
208
|
const t = e.__vccOpts || e;
|
|
209
|
-
for (const [
|
|
210
|
-
t[
|
|
209
|
+
for (const [o, l] of a)
|
|
210
|
+
t[o] = l;
|
|
211
211
|
return t;
|
|
212
|
-
},
|
|
212
|
+
}, Ne = /* @__PURE__ */ ce(Ke, [["__scopeId", "data-v-a8f3d91f"]]), Ue = /* @__PURE__ */ R({
|
|
213
213
|
__name: "item",
|
|
214
214
|
props: {
|
|
215
215
|
id: {
|
|
@@ -231,7 +231,7 @@ const Ae = /* @__PURE__ */ R({
|
|
|
231
231
|
},
|
|
232
232
|
emits: ["timeout"],
|
|
233
233
|
setup(e, { emit: a }) {
|
|
234
|
-
const t = e,
|
|
234
|
+
const t = e, o = i(!0), l = a, n = f(() => {
|
|
235
235
|
let r = "";
|
|
236
236
|
switch (t.type) {
|
|
237
237
|
case "error":
|
|
@@ -249,17 +249,17 @@ const Ae = /* @__PURE__ */ R({
|
|
|
249
249
|
}
|
|
250
250
|
return r;
|
|
251
251
|
});
|
|
252
|
-
return
|
|
252
|
+
return S(() => {
|
|
253
253
|
setTimeout(() => {
|
|
254
|
-
|
|
254
|
+
l("timeout", t.id);
|
|
255
255
|
}, t.timeout);
|
|
256
|
-
}),
|
|
257
|
-
r ||
|
|
256
|
+
}), W(o, (r) => {
|
|
257
|
+
r || l("timeout", t.id);
|
|
258
258
|
}), (r, u) => {
|
|
259
259
|
const s = g("v-alert");
|
|
260
260
|
return C(), O(s, {
|
|
261
|
-
modelValue:
|
|
262
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
261
|
+
modelValue: o.value,
|
|
262
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
263
263
|
class: "mt-2",
|
|
264
264
|
type: e.type,
|
|
265
265
|
icon: n.value,
|
|
@@ -272,23 +272,23 @@ const Ae = /* @__PURE__ */ R({
|
|
|
272
272
|
}, null, 8, ["modelValue", "type", "icon", "text"]);
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
}),
|
|
275
|
+
}), We = /* @__PURE__ */ R({
|
|
276
276
|
__name: "index",
|
|
277
277
|
setup(e) {
|
|
278
|
-
const a =
|
|
279
|
-
|
|
278
|
+
const a = qe({ items: [] });
|
|
279
|
+
S(() => {
|
|
280
280
|
_.on("message", t);
|
|
281
281
|
}), T(() => {
|
|
282
282
|
_.off("message", t);
|
|
283
283
|
});
|
|
284
284
|
const t = (u) => {
|
|
285
285
|
n(u.type, u.text, u.timeout);
|
|
286
|
-
},
|
|
286
|
+
}, o = (u) => {
|
|
287
287
|
r(u);
|
|
288
288
|
};
|
|
289
|
-
let
|
|
289
|
+
let l = 0;
|
|
290
290
|
const n = (u, s, c) => {
|
|
291
|
-
const y =
|
|
291
|
+
const y = l++;
|
|
292
292
|
a.items.push({ id: y, type: u, text: s, timeout: c });
|
|
293
293
|
}, r = (u) => {
|
|
294
294
|
const s = a.items.findIndex((c) => c.id === u);
|
|
@@ -299,8 +299,8 @@ const Ae = /* @__PURE__ */ R({
|
|
|
299
299
|
}, ["stop"])),
|
|
300
300
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
301
301
|
}, [
|
|
302
|
-
(C(!0), F(Te, null, Oe(a.items, (c) => (C(), O(
|
|
303
|
-
onTimeout:
|
|
302
|
+
(C(!0), F(Te, null, Oe(a.items, (c) => (C(), O(Ue, {
|
|
303
|
+
onTimeout: o,
|
|
304
304
|
id: c.id,
|
|
305
305
|
type: c.type,
|
|
306
306
|
text: c.text,
|
|
@@ -309,13 +309,13 @@ const Ae = /* @__PURE__ */ R({
|
|
|
309
309
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
310
310
|
]));
|
|
311
311
|
}
|
|
312
|
-
}),
|
|
312
|
+
}), He = /* @__PURE__ */ ce(We, [["__scopeId", "data-v-70ed4b89"]]), ze = /* @__PURE__ */ R({
|
|
313
313
|
__name: "index",
|
|
314
314
|
setup(e) {
|
|
315
|
-
const a = X(), { open: t } = Q("promptDlg"),
|
|
315
|
+
const a = X(), { open: t } = Q("promptDlg"), o = i(""), l = i(""), n = i(), r = i(), u = i(), s = i(""), c = i(), y = i(), j = f(() => {
|
|
316
316
|
var p;
|
|
317
317
|
return ((p = c.value) == null ? void 0 : p.color) ?? "primary";
|
|
318
|
-
}),
|
|
318
|
+
}), D = f(() => {
|
|
319
319
|
var p;
|
|
320
320
|
return ((p = c.value) == null ? void 0 : p.text) ?? a.t("cancel");
|
|
321
321
|
}), M = f(() => {
|
|
@@ -325,29 +325,29 @@ const Ae = /* @__PURE__ */ R({
|
|
|
325
325
|
var p;
|
|
326
326
|
return ((p = y.value) == null ? void 0 : p.text) ?? a.t("confirm");
|
|
327
327
|
}), d = i();
|
|
328
|
-
let x = 0,
|
|
328
|
+
let x = 0, q = !1;
|
|
329
329
|
const L = async (p) => {
|
|
330
330
|
var w;
|
|
331
|
-
|
|
331
|
+
o.value = p.title, l.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, q = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (w = d.value) == null || w.focus();
|
|
332
332
|
};
|
|
333
|
-
|
|
333
|
+
S(() => {
|
|
334
334
|
_.on("promptDlg", L);
|
|
335
335
|
}), T(() => {
|
|
336
336
|
_.off("promptDlg", L);
|
|
337
337
|
});
|
|
338
338
|
const I = () => {
|
|
339
|
-
t.value = !1,
|
|
339
|
+
t.value = !1, q || (_.emit("promptDlgResult" + x, s.value ?? ""), q = !0);
|
|
340
340
|
};
|
|
341
|
-
return
|
|
342
|
-
!p && !
|
|
341
|
+
return W(t, (p) => {
|
|
342
|
+
!p && !q && (_.emit("promptDlgResult" + x, void 0), q = !0);
|
|
343
343
|
}), (p, w) => {
|
|
344
344
|
const z = g("v-card-title"), E = 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");
|
|
345
345
|
return C(), O(ge, {
|
|
346
|
-
modelValue:
|
|
346
|
+
modelValue: N(t),
|
|
347
347
|
"onUpdate:modelValue": w[2] || (w[2] = ($) => J(t) ? t.value = $ : null),
|
|
348
348
|
onKeydown: [
|
|
349
|
-
w[3] || (w[3] =
|
|
350
|
-
|
|
349
|
+
w[3] || (w[3] = U(A(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
350
|
+
U(A(I, ["stop", "prevent"]), ["enter"])
|
|
351
351
|
],
|
|
352
352
|
transition: "dialog-top-transition",
|
|
353
353
|
"max-width": "600px"
|
|
@@ -357,13 +357,13 @@ const Ae = /* @__PURE__ */ R({
|
|
|
357
357
|
default: v(() => [
|
|
358
358
|
h(z, null, {
|
|
359
359
|
default: v(() => [
|
|
360
|
-
V(b(
|
|
360
|
+
V(b(o.value), 1)
|
|
361
361
|
]),
|
|
362
362
|
_: 1
|
|
363
363
|
}),
|
|
364
|
-
|
|
364
|
+
l.value ? (C(), O(E, { key: 0 }, {
|
|
365
365
|
default: v(() => [
|
|
366
|
-
V(b(
|
|
366
|
+
V(b(l.value), 1)
|
|
367
367
|
]),
|
|
368
368
|
_: 1
|
|
369
369
|
})) : Re("", !0),
|
|
@@ -389,7 +389,7 @@ const Ae = /* @__PURE__ */ R({
|
|
|
389
389
|
variant: "text"
|
|
390
390
|
}, {
|
|
391
391
|
default: v(() => [
|
|
392
|
-
V(b(
|
|
392
|
+
V(b(D.value), 1)
|
|
393
393
|
]),
|
|
394
394
|
_: 1
|
|
395
395
|
}, 8, ["color"]),
|
|
@@ -417,19 +417,19 @@ const Ae = /* @__PURE__ */ R({
|
|
|
417
417
|
}), Fe = { class: "mx-auto my-auto" }, Je = { class: "d-flex align-center justify-center w-100 h-100" }, Xe = /* @__PURE__ */ R({
|
|
418
418
|
__name: "index",
|
|
419
419
|
setup(e) {
|
|
420
|
-
const a = X(), { open: t } = Q("waitDlg"),
|
|
420
|
+
const a = X(), { open: t } = Q("waitDlg"), o = () => {
|
|
421
421
|
t.value = !0;
|
|
422
|
-
},
|
|
422
|
+
}, l = () => {
|
|
423
423
|
t.value = !1;
|
|
424
424
|
};
|
|
425
|
-
return
|
|
426
|
-
_.on("openWaitDlg",
|
|
425
|
+
return S(() => {
|
|
426
|
+
_.on("openWaitDlg", o), _.on("closeWaitDlg", l);
|
|
427
427
|
}), T(() => {
|
|
428
|
-
_.off("openWaitDlg",
|
|
428
|
+
_.off("openWaitDlg", o), _.off("closeWaitDlg", l);
|
|
429
429
|
}), (n, r) => {
|
|
430
430
|
const u = g("v-card"), s = g("v-dialog");
|
|
431
431
|
return C(), O(s, {
|
|
432
|
-
modelValue:
|
|
432
|
+
modelValue: N(t),
|
|
433
433
|
"onUpdate:modelValue": r[0] || (r[0] = (c) => J(t) ? t.value = c : null),
|
|
434
434
|
persistent: "",
|
|
435
435
|
"no-click-animation": "",
|
|
@@ -444,7 +444,7 @@ const Ae = /* @__PURE__ */ R({
|
|
|
444
444
|
}, {
|
|
445
445
|
default: v(() => [
|
|
446
446
|
m("div", Je, [
|
|
447
|
-
m("span", null, b(
|
|
447
|
+
m("span", null, b(N(a).t("waitingResponse")), 1)
|
|
448
448
|
])
|
|
449
449
|
]),
|
|
450
450
|
_: 1
|
|
@@ -456,38 +456,38 @@ const Ae = /* @__PURE__ */ R({
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
}), Ge = (e) => {
|
|
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", Ae), e.component("x-loading",
|
|
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", Ae), e.component("x-loading", Ne), e.component("x-message", He), e.component("x-prompt-dlg", ze), e.component("x-wait-dlg", Xe);
|
|
460
460
|
};
|
|
461
461
|
function it() {
|
|
462
|
-
const e =
|
|
462
|
+
const e = H(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = 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");
|
|
463
463
|
return {
|
|
464
464
|
primaryColor: a,
|
|
465
465
|
secondaryColor: t,
|
|
466
|
-
backgroundColor0:
|
|
467
|
-
backgroundColor1:
|
|
466
|
+
backgroundColor0: o,
|
|
467
|
+
backgroundColor1: l,
|
|
468
468
|
backgroundColor2: n,
|
|
469
469
|
highlightColor: r,
|
|
470
470
|
borderColor: u
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
const Y =
|
|
473
|
+
const Y = le(
|
|
474
474
|
"global",
|
|
475
475
|
() => {
|
|
476
|
-
const e = i();
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
(
|
|
480
|
-
|
|
476
|
+
const e = H(), a = i();
|
|
477
|
+
W(
|
|
478
|
+
a,
|
|
479
|
+
(n) => {
|
|
480
|
+
e.global.name.value = n ? "dark" : "light";
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
483
|
immediate: !0
|
|
484
484
|
}
|
|
485
485
|
);
|
|
486
|
-
const
|
|
486
|
+
const t = i("en"), o = i({}), l = i("");
|
|
487
487
|
return {
|
|
488
|
-
dark:
|
|
489
|
-
locale:
|
|
490
|
-
permissionObjects:
|
|
488
|
+
dark: a,
|
|
489
|
+
locale: t,
|
|
490
|
+
permissionObjects: o,
|
|
491
491
|
permissionChecksum: l
|
|
492
492
|
};
|
|
493
493
|
},
|
|
@@ -499,7 +499,7 @@ const Y = oe(
|
|
|
499
499
|
}
|
|
500
500
|
]
|
|
501
501
|
}
|
|
502
|
-
),
|
|
502
|
+
), K = require("js-cookie");
|
|
503
503
|
function gt(e) {
|
|
504
504
|
const a = Ee.create({
|
|
505
505
|
timeout: 6e3
|
|
@@ -515,7 +515,7 @@ function gt(e) {
|
|
|
515
515
|
), a;
|
|
516
516
|
}
|
|
517
517
|
function Qe(e) {
|
|
518
|
-
const a =
|
|
518
|
+
const a = K.get("accessToken") ?? "";
|
|
519
519
|
return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
520
520
|
}
|
|
521
521
|
function Ye(e, a) {
|
|
@@ -525,19 +525,19 @@ function Ze(e) {
|
|
|
525
525
|
return e.data;
|
|
526
526
|
}
|
|
527
527
|
function Pe(e, a) {
|
|
528
|
-
var
|
|
528
|
+
var l;
|
|
529
529
|
const t = e.response;
|
|
530
530
|
if (!t)
|
|
531
531
|
return Promise.reject(e);
|
|
532
532
|
t.status === 401 && et();
|
|
533
|
-
let
|
|
534
|
-
return
|
|
533
|
+
let o = (l = t.data) == null ? void 0 : l.message;
|
|
534
|
+
return o || (o = {
|
|
535
535
|
code: t.status,
|
|
536
536
|
message: t.statusText
|
|
537
|
-
}), a(
|
|
537
|
+
}), a(o), Promise.reject(e);
|
|
538
538
|
}
|
|
539
539
|
function et() {
|
|
540
|
-
|
|
540
|
+
K.remove("accessToken"), K.remove("refreshToken"), K.remove("activeOrg"), re().replace({ path: "/passport/login" });
|
|
541
541
|
}
|
|
542
542
|
let ee = Date.now();
|
|
543
543
|
function ue() {
|
|
@@ -552,19 +552,19 @@ async function vt(e) {
|
|
|
552
552
|
if (!ue())
|
|
553
553
|
return;
|
|
554
554
|
let a = !1, t;
|
|
555
|
-
const
|
|
555
|
+
const o = (n) => {
|
|
556
556
|
t = n, a = !0;
|
|
557
|
-
},
|
|
558
|
-
return _.on("confirmDlgResult" +
|
|
557
|
+
}, l = se();
|
|
558
|
+
return _.on("confirmDlgResult" + l, o), _.emit("confirmDlg", { ...e, seq: l }), await G(() => a), _.off("confirmDlgResult" + l, o), t;
|
|
559
559
|
}
|
|
560
560
|
async function mt(e) {
|
|
561
561
|
if (!ue())
|
|
562
562
|
return;
|
|
563
563
|
let a = !1, t;
|
|
564
|
-
const
|
|
564
|
+
const o = (n) => {
|
|
565
565
|
t = n, a = !0;
|
|
566
|
-
},
|
|
567
|
-
return _.on("promptDlgResult" +
|
|
566
|
+
}, l = se();
|
|
567
|
+
return _.on("promptDlgResult" + l, o), _.emit("promptDlg", { ...e, seq: l }), await G(() => a), _.off("promptDlgResult" + l, o), t;
|
|
568
568
|
}
|
|
569
569
|
function ht() {
|
|
570
570
|
_.emit("openWaitDlg");
|
|
@@ -585,13 +585,13 @@ function bt(e, a) {
|
|
|
585
585
|
_.emit("message", { type: "warning", text: e, timeout: a });
|
|
586
586
|
}
|
|
587
587
|
function Ct(e) {
|
|
588
|
-
var
|
|
588
|
+
var o, l;
|
|
589
589
|
if (!window.appAppear) {
|
|
590
590
|
window.appAppear = !0;
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
const a = "single-spa-application:" + e, t = (
|
|
594
|
-
t && (t.remove("app-left", "app-right", "app-reset"), (
|
|
593
|
+
const a = "single-spa-application:" + e, t = (o = document.getElementById(a)) == null ? void 0 : o.classList;
|
|
594
|
+
t && (t.remove("app-left", "app-right", "app-reset"), (l = window.routeExtras) != null && l.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
|
|
595
595
|
t.add("app-reset");
|
|
596
596
|
}, 0));
|
|
597
597
|
}
|
|
@@ -600,16 +600,16 @@ function te(e, a) {
|
|
|
600
600
|
if (!e)
|
|
601
601
|
return !1;
|
|
602
602
|
let t = e;
|
|
603
|
-
return Object.keys(t).length <= 0 || (a.split("/").forEach((
|
|
603
|
+
return Object.keys(t).length <= 0 || (a.split("/").forEach((l) => {
|
|
604
604
|
if (Object.keys(t).length <= 0)
|
|
605
605
|
return !0;
|
|
606
|
-
if (t[
|
|
607
|
-
t = t[
|
|
606
|
+
if (t[l])
|
|
607
|
+
t = t[l];
|
|
608
608
|
else
|
|
609
609
|
return !1;
|
|
610
610
|
}), Object.keys(t).length <= 0);
|
|
611
611
|
}
|
|
612
|
-
const _e = require("js-cookie"),
|
|
612
|
+
const _e = require("js-cookie"), ot = [
|
|
613
613
|
{ path: "/passport/login", level: 0 },
|
|
614
614
|
{ path: "/passport/loginAccount", level: 1 },
|
|
615
615
|
{ path: "/passport/register", level: 1 },
|
|
@@ -631,13 +631,13 @@ const _e = require("js-cookie"), lt = [
|
|
|
631
631
|
];
|
|
632
632
|
function Z(e) {
|
|
633
633
|
let a, t = 0;
|
|
634
|
-
const
|
|
635
|
-
return
|
|
636
|
-
const n =
|
|
634
|
+
const o = e.split("/");
|
|
635
|
+
return ot.forEach((l) => {
|
|
636
|
+
const n = l.path.split("/");
|
|
637
637
|
let r = 0;
|
|
638
|
-
for (let u = 0; u <
|
|
638
|
+
for (let u = 0; u < o.length && !(u >= n.length || o[u] !== n[u]); u++)
|
|
639
639
|
r++;
|
|
640
|
-
r >= t && (a =
|
|
640
|
+
r >= t && (a = l, t = r);
|
|
641
641
|
}), a;
|
|
642
642
|
}
|
|
643
643
|
function ae(e) {
|
|
@@ -649,28 +649,28 @@ function ae(e) {
|
|
|
649
649
|
const t = e.split("/");
|
|
650
650
|
return console.assert(t.length >= 2), { app: t[1], path: a.path, level: a.level };
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const oe = i("");
|
|
653
653
|
function k(e, a) {
|
|
654
|
-
const t = ae(e),
|
|
654
|
+
const t = ae(e), o = ae(a), l = t.app === o.app, n = t.path === o.path, r = t.level >= o.level;
|
|
655
655
|
console.info(
|
|
656
|
-
`~~~~before route change~~~~ ${
|
|
657
|
-
),
|
|
656
|
+
`~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${l} forward=${r}`
|
|
657
|
+
), l ? n ? oe.value = "" : oe.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function lt() {
|
|
660
660
|
return !!_e.get("accessToken");
|
|
661
661
|
}
|
|
662
662
|
function rt() {
|
|
663
663
|
return !!_e.get("activeOrg");
|
|
664
664
|
}
|
|
665
665
|
function Vt(e, a, t) {
|
|
666
|
-
const
|
|
666
|
+
const o = lt(), l = rt(), n = Z(e.path);
|
|
667
667
|
if (!n) {
|
|
668
668
|
t();
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
if (n.requiredState === "auth")
|
|
672
|
-
if (
|
|
673
|
-
if (
|
|
672
|
+
if (o)
|
|
673
|
+
if (l) {
|
|
674
674
|
const r = "/main";
|
|
675
675
|
k(r, a.path), t({ path: r });
|
|
676
676
|
} else
|
|
@@ -680,8 +680,8 @@ function Vt(e, a, t) {
|
|
|
680
680
|
k(r, a.path), t({ path: r });
|
|
681
681
|
}
|
|
682
682
|
else if (n.requiredState === "org")
|
|
683
|
-
if (
|
|
684
|
-
if (
|
|
683
|
+
if (o)
|
|
684
|
+
if (l)
|
|
685
685
|
k(e.path, a.path), t();
|
|
686
686
|
else {
|
|
687
687
|
const r = "/org/joinOrCreate";
|
|
@@ -691,8 +691,8 @@ function Vt(e, a, t) {
|
|
|
691
691
|
const r = "/passport/login";
|
|
692
692
|
k(r, a.path), t({ path: r });
|
|
693
693
|
}
|
|
694
|
-
else if (
|
|
695
|
-
if (
|
|
694
|
+
else if (o)
|
|
695
|
+
if (l) {
|
|
696
696
|
const r = "/main";
|
|
697
697
|
k(r, a.path), t({ path: r });
|
|
698
698
|
} else {
|
|
@@ -702,24 +702,24 @@ function Vt(e, a, t) {
|
|
|
702
702
|
else
|
|
703
703
|
k(e.path, a.path), t();
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
const a = Ie(), t = re(),
|
|
705
|
+
function St(e) {
|
|
706
|
+
const a = Ie(), t = re(), o = Y(), l = ne(), n = (c) => {
|
|
707
707
|
if (c.key === "Escape") {
|
|
708
708
|
r();
|
|
709
709
|
return;
|
|
710
710
|
}
|
|
711
|
-
if (!e && c.ctrlKey && c.key.toLowerCase() === "d") {
|
|
711
|
+
if (!e && c.ctrlKey && c.shiftKey && c.key.toLowerCase() === "d") {
|
|
712
712
|
u();
|
|
713
713
|
return;
|
|
714
714
|
}
|
|
715
|
-
if (!e && c.ctrlKey && c.key.toLowerCase() === "l") {
|
|
715
|
+
if (!e && c.ctrlKey && c.shiftKey && c.key.toLowerCase() === "l") {
|
|
716
716
|
s();
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
719
|
}, r = () => {
|
|
720
720
|
var y;
|
|
721
|
-
if (!
|
|
722
|
-
|
|
721
|
+
if (!l.isEmpty()) {
|
|
722
|
+
l.hasView("waitDlg") || l.popView();
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
725
|
const c = Z(a.path);
|
|
@@ -730,35 +730,35 @@ function Dt(e) {
|
|
|
730
730
|
}
|
|
731
731
|
) : t.back();
|
|
732
732
|
}, u = () => {
|
|
733
|
-
|
|
733
|
+
o.dark = !o.dark;
|
|
734
734
|
}, s = () => {
|
|
735
|
-
|
|
735
|
+
o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
|
|
736
736
|
};
|
|
737
|
-
return
|
|
737
|
+
return S(() => {
|
|
738
738
|
window.addEventListener("keydown", n, !1);
|
|
739
739
|
}), T(() => {
|
|
740
740
|
window.removeEventListener("keydown", n, !1);
|
|
741
741
|
}), {};
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Dt() {
|
|
744
744
|
const e = Y();
|
|
745
|
-
function a(t,
|
|
746
|
-
const
|
|
747
|
-
return
|
|
745
|
+
function a(t, o) {
|
|
746
|
+
const l = e.permissionObjects[t];
|
|
747
|
+
return l ? o ? !(!te(l.includes, o) || te(l.excludes, o)) : !0 : !1;
|
|
748
748
|
}
|
|
749
749
|
return { verifyPermission: a };
|
|
750
750
|
}
|
|
751
751
|
function nt(e, a) {
|
|
752
752
|
return e.post("pullPermission", a);
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function qt(e) {
|
|
755
755
|
const a = Y();
|
|
756
756
|
let t;
|
|
757
|
-
const
|
|
757
|
+
const o = () => {
|
|
758
758
|
clearTimeout(t), t = setTimeout(async () => {
|
|
759
|
-
await
|
|
759
|
+
await l(), t && o();
|
|
760
760
|
}, 3e3);
|
|
761
|
-
},
|
|
761
|
+
}, l = async () => {
|
|
762
762
|
try {
|
|
763
763
|
const { update: n, permissions: r } = await nt(e, {
|
|
764
764
|
checksum: a.permissionChecksum
|
|
@@ -777,18 +777,18 @@ function St(e) {
|
|
|
777
777
|
console.error(n);
|
|
778
778
|
}
|
|
779
779
|
};
|
|
780
|
-
return
|
|
781
|
-
|
|
780
|
+
return S(() => {
|
|
781
|
+
l(), o();
|
|
782
782
|
}), T(() => {
|
|
783
783
|
clearTimeout(t), t = void 0;
|
|
784
784
|
}), {};
|
|
785
785
|
}
|
|
786
786
|
function Tt() {
|
|
787
|
-
const e = f(() =>
|
|
787
|
+
const e = H(), a = f(() => e.current.value.dark), t = f(() => !!window.cordova), o = f(() => {
|
|
788
788
|
const { width: l } = je();
|
|
789
789
|
return l.value <= 1280 ? l.value + "px" : l.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px";
|
|
790
790
|
});
|
|
791
|
-
return { dark:
|
|
791
|
+
return { dark: a, sysBarAvail: t, compactWidth: o };
|
|
792
792
|
}
|
|
793
793
|
const Ot = { install: Ge };
|
|
794
794
|
export {
|
|
@@ -808,12 +808,12 @@ export {
|
|
|
808
808
|
vt as openConfirmDlg,
|
|
809
809
|
mt as openPromptDlg,
|
|
810
810
|
ht as openWaitDlg,
|
|
811
|
-
|
|
811
|
+
oe as routeTransName,
|
|
812
812
|
it as useColor,
|
|
813
813
|
Y as useGlobalStore,
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
814
|
+
St as useHotkey,
|
|
815
|
+
Dt as usePermission,
|
|
816
|
+
qt as usePullPermission,
|
|
817
817
|
Tt as useSystem,
|
|
818
818
|
ne as useViewMgrStore,
|
|
819
819
|
Q as useViewStack,
|