x-essential-lib 0.3.8 → 0.3.9

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.
@@ -1,5 +1,5 @@
1
1
  export * from './color';
2
2
  export * from './hotkey';
3
- export * from './pullPermission';
3
+ export * from './permission';
4
4
  export * from './system';
5
5
  export * from './viewStack';
@@ -0,0 +1,5 @@
1
+ import { Permission } from '../utils';
2
+ import { AxiosInstance } from 'axios';
3
+ export declare function usePermission(instance: AxiosInstance): {
4
+ verifyPermission: (permission: Permission, instance: string) => boolean;
5
+ };
package/dist/index.js CHANGED
@@ -1,153 +1,153 @@
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
- import { VAlert as he, VBtn as _e, VCard as xe, VCardActions as ye, VCardText as we, VCardTitle as ke, VDialog as be, VForm as Ce, VTextField as Ve } from "vuetify/lib/components/index.mjs";
3
- import { ref as m, computed as f, onMounted as D, onBeforeUnmount as T, defineComponent as P, watch as N, resolveComponent as v, openBlock as V, createBlock as $, unref as U, isRef as F, withKeys as W, withModifiers as E, withCtx as g, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as z, normalizeStyle as De, pushScopeId as qe, popScopeId as Se, createElementVNode as h, reactive as Te, Fragment as Pe, renderList as Oe } from "vue";
4
- import { useLocale as J, useTheme as H, useDisplay as Re } from "vuetify/lib/framework.mjs";
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 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
+ import { useLocale as X, useTheme as K, useDisplay as Re } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as oe } from "pinia";
6
- import { useRouter as re, useRoute as je } from "vue-router";
6
+ import { useRouter as le, useRoute as je } from "vue-router";
7
7
  import Ie from "axios";
8
- const se = oe("viewMgr", () => {
9
- const e = m([]);
10
- function n() {
8
+ const re = oe("viewMgr", () => {
9
+ const e = i([]);
10
+ function a() {
11
11
  return e.value.length <= 0;
12
12
  }
13
- function t(s) {
14
- return e.value.find((a) => a === s) !== void 0;
13
+ function t(r) {
14
+ return e.value.find((c) => c === r) !== void 0;
15
15
  }
16
- function o(s) {
17
- r(s), e.value.push(s);
16
+ function o(r) {
17
+ l(r), e.value.push(r);
18
18
  }
19
- function r(s) {
20
- const a = e.value.findIndex((u) => u === s);
21
- a !== -1 && e.value.splice(a, 1);
19
+ function l(r) {
20
+ const c = e.value.findIndex((s) => s === r);
21
+ c !== -1 && e.value.splice(c, 1);
22
22
  }
23
- function l() {
23
+ function n() {
24
24
  e.value.pop();
25
25
  }
26
- return { isEmpty: n, hasView: t, addView: o, delView: r, popView: l };
26
+ return { isEmpty: a, hasView: t, addView: o, delView: l, popView: n };
27
27
  });
28
28
  function Ee(e) {
29
- return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
30
- var o = e.get(n);
31
- o ? o.push(t) : e.set(n, [t]);
32
- }, off: function(n, t) {
33
- var o = e.get(n);
34
- o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(n, []));
35
- }, emit: function(n, t) {
36
- var o = e.get(n);
37
- o && o.slice().map(function(r) {
38
- r(t);
39
- }), (o = e.get("*")) && o.slice().map(function(r) {
40
- r(n, t);
29
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
30
+ var o = e.get(a);
31
+ o ? o.push(t) : e.set(a, [t]);
32
+ }, off: function(a, t) {
33
+ var o = e.get(a);
34
+ o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(a, []));
35
+ }, emit: function(a, t) {
36
+ var o = e.get(a);
37
+ o && o.slice().map(function(l) {
38
+ l(t);
39
+ }), (o = e.get("*")) && o.slice().map(function(l) {
40
+ l(a, t);
41
41
  });
42
42
  } };
43
43
  }
44
- const c = Ee();
45
- async function pt(e) {
46
- return new Promise((n) => {
47
- setTimeout(n, e);
44
+ const _ = Ee();
45
+ async function dt(e) {
46
+ return new Promise((a) => {
47
+ setTimeout(a, e);
48
48
  });
49
49
  }
50
- async function X(e, n, t) {
50
+ async function G(e, a, t) {
51
51
  const o = Date.now();
52
- return new Promise((r) => {
53
- const l = async () => {
54
- e() ? r(!0) : n && Date.now() - o > n ? r(!1) : setTimeout(l, t ?? 30);
52
+ return new Promise((l) => {
53
+ const n = async () => {
54
+ e() ? l(!0) : a && Date.now() - o > a ? l(!1) : setTimeout(n, t ?? 30);
55
55
  };
56
- l();
56
+ n();
57
57
  });
58
58
  }
59
- function G(e, n) {
60
- const t = se(), o = f({
59
+ function Q(e, a) {
60
+ const t = re(), o = f({
61
61
  get() {
62
62
  return t.hasView(e);
63
63
  },
64
- set(l) {
65
- l ? t.addView(e) : t.delView(e);
64
+ set(n) {
65
+ n ? t.addView(e) : t.delView(e);
66
66
  }
67
- }), r = (l) => {
68
- n == null || n(l), o.value = !0;
67
+ }), l = (n) => {
68
+ a == null || a(n), o.value = !0;
69
69
  };
70
70
  return D(() => {
71
- c.on(e, r);
71
+ _.on(e, l);
72
72
  }), T(() => {
73
- c.off(e, r);
73
+ _.off(e, l);
74
74
  }), { open: o };
75
75
  }
76
- const $e = /* @__PURE__ */ P({
76
+ const $e = /* @__PURE__ */ O({
77
77
  __name: "index",
78
78
  setup(e) {
79
- const n = J(), { open: t } = G("confirmDlg"), o = m(""), r = m(""), l = m(), s = m(), a = f(() => {
80
- var p;
81
- return ((p = l.value) == null ? void 0 : p.color) ?? "primary";
79
+ const a = X(), { open: t } = Q("confirmDlg"), o = i(""), l = i(""), n = i(), r = i(), c = f(() => {
80
+ var d;
81
+ return ((d = n.value) == null ? void 0 : d.color) ?? "primary";
82
+ }), s = f(() => {
83
+ var d;
84
+ return ((d = n.value) == null ? void 0 : d.text) ?? a.t("cancel");
82
85
  }), u = f(() => {
83
- var p;
84
- return ((p = l.value) == null ? void 0 : p.text) ?? n.t("cancel");
85
- }), i = f(() => {
86
- var p;
87
- return ((p = s.value) == null ? void 0 : p.color) ?? "primary";
86
+ var d;
87
+ return ((d = r.value) == null ? void 0 : d.color) ?? "primary";
88
88
  }), y = f(() => {
89
- var p;
90
- return ((p = s.value) == null ? void 0 : p.text) ?? n.t("confirm");
89
+ var d;
90
+ return ((d = r.value) == null ? void 0 : d.text) ?? a.t("confirm");
91
91
  });
92
- let O = 0, q = !1;
93
- const A = (p) => {
94
- o.value = p.title, r.value = p.text, l.value = p.cancel, s.value = p.confirm, O = p.seq, q = !1, t.value = !0;
92
+ let R = 0, q = !1;
93
+ const M = (d) => {
94
+ o.value = d.title, l.value = d.text, n.value = d.cancel, r.value = d.confirm, R = d.seq, q = !1, t.value = !0;
95
95
  };
96
96
  D(() => {
97
- c.on("confirmDlg", A);
97
+ _.on("confirmDlg", M);
98
98
  }), T(() => {
99
- c.off("confirmDlg", A);
99
+ _.off("confirmDlg", M);
100
100
  });
101
- const M = () => {
102
- t.value = !1, q || (c.emit("confirmDlgResult" + O, !0), q = !0);
101
+ const B = () => {
102
+ t.value = !1, q || (_.emit("confirmDlgResult" + R, !0), q = !0);
103
103
  };
104
- return N(t, (p) => {
105
- !p && !q && (c.emit("confirmDlgResult" + O, !1), q = !0);
106
- }), (p, w) => {
107
- const S = v("v-card-title"), B = v("v-card-text"), R = v("v-btn"), d = v("v-card-actions"), x = v("v-card"), K = v("v-dialog");
108
- return V(), $(K, {
109
- modelValue: U(t),
110
- "onUpdate:modelValue": w[1] || (w[1] = (j) => F(t) ? t.value = j : null),
104
+ return H(t, (d) => {
105
+ !d && !q && (_.emit("confirmDlgResult" + R, !1), q = !0);
106
+ }), (d, x) => {
107
+ 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
+ return V(), A(z, {
109
+ modelValue: W(t),
110
+ "onUpdate:modelValue": x[1] || (x[1] = (I) => J(t) ? t.value = I : null),
111
111
  onKeydown: [
112
- w[2] || (w[2] = W(E((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
- W(E(M, ["stop", "prevent"]), ["enter"])
112
+ x[2] || (x[2] = N($((I) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
+ N($(B, ["stop", "prevent"]), ["enter"])
114
114
  ],
115
115
  transition: "dialog-top-transition",
116
116
  "max-width": "600px"
117
117
  }, {
118
- default: g(() => [
119
- _(x, null, {
120
- default: g(() => [
121
- _(S, null, {
122
- default: g(() => [
118
+ default: v(() => [
119
+ h(w, null, {
120
+ default: v(() => [
121
+ h(S, null, {
122
+ default: v(() => [
123
123
  C(b(o.value), 1)
124
124
  ]),
125
125
  _: 1
126
126
  }),
127
- _(B, null, {
128
- default: g(() => [
129
- C(b(r.value), 1)
127
+ h(L, null, {
128
+ default: v(() => [
129
+ C(b(l.value), 1)
130
130
  ]),
131
131
  _: 1
132
132
  }),
133
- _(d, { class: "d-flex justify-end" }, {
134
- default: g(() => [
135
- _(R, {
136
- onClick: w[0] || (w[0] = (j) => t.value = !1),
137
- color: a.value,
133
+ h(p, { class: "d-flex justify-end" }, {
134
+ default: v(() => [
135
+ h(j, {
136
+ onClick: x[0] || (x[0] = (I) => t.value = !1),
137
+ color: c.value,
138
138
  variant: "text"
139
139
  }, {
140
- default: g(() => [
141
- C(b(u.value), 1)
140
+ default: v(() => [
141
+ C(b(s.value), 1)
142
142
  ]),
143
143
  _: 1
144
144
  }, 8, ["color"]),
145
- _(R, {
146
- onClick: M,
147
- color: i.value,
145
+ h(j, {
146
+ onClick: B,
147
+ color: u.value,
148
148
  variant: "text"
149
149
  }, {
150
- default: g(() => [
150
+ default: v(() => [
151
151
  C(b(y.value), 1)
152
152
  ]),
153
153
  _: 1
@@ -163,22 +163,22 @@ const $e = /* @__PURE__ */ P({
163
163
  }, 8, ["modelValue", "onKeydown"]);
164
164
  };
165
165
  }
166
- }), Ae = (e) => (qe("data-v-a8f3d91f"), e = e(), Se(), e), Me = /* @__PURE__ */ Ae(() => /* @__PURE__ */ h("div", { class: "lds-spinner" }, [
167
- /* @__PURE__ */ h("div"),
168
- /* @__PURE__ */ h("div"),
169
- /* @__PURE__ */ h("div"),
170
- /* @__PURE__ */ h("div"),
171
- /* @__PURE__ */ h("div"),
172
- /* @__PURE__ */ h("div"),
173
- /* @__PURE__ */ h("div"),
174
- /* @__PURE__ */ h("div"),
175
- /* @__PURE__ */ h("div"),
176
- /* @__PURE__ */ h("div"),
177
- /* @__PURE__ */ h("div"),
178
- /* @__PURE__ */ h("div")
166
+ }), Ae = (e) => (De("data-v-a8f3d91f"), e = e(), qe(), e), Me = /* @__PURE__ */ Ae(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
167
+ /* @__PURE__ */ m("div"),
168
+ /* @__PURE__ */ m("div"),
169
+ /* @__PURE__ */ m("div"),
170
+ /* @__PURE__ */ m("div"),
171
+ /* @__PURE__ */ m("div"),
172
+ /* @__PURE__ */ m("div"),
173
+ /* @__PURE__ */ m("div"),
174
+ /* @__PURE__ */ m("div"),
175
+ /* @__PURE__ */ m("div"),
176
+ /* @__PURE__ */ m("div"),
177
+ /* @__PURE__ */ m("div"),
178
+ /* @__PURE__ */ m("div")
179
179
  ], -1)), Be = [
180
180
  Me
181
- ], Le = /* @__PURE__ */ P({
181
+ ], Le = /* @__PURE__ */ O({
182
182
  __name: "index",
183
183
  props: {
184
184
  zIndex: {
@@ -187,21 +187,21 @@ const $e = /* @__PURE__ */ P({
187
187
  }
188
188
  },
189
189
  setup(e) {
190
- const n = H(), t = e, o = f(() => ({
191
- background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
190
+ const a = K(), t = e, o = f(() => ({
191
+ background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
192
192
  zIndex: t.zIndex
193
193
  }));
194
- return (r, l) => (V(), z("div", {
194
+ return (l, n) => (V(), F("div", {
195
195
  class: "x-cont",
196
- style: De(o.value)
196
+ style: Ve(o.value)
197
197
  }, Be, 4));
198
198
  }
199
- }), le = (e, n) => {
199
+ }), ne = (e, a) => {
200
200
  const t = e.__vccOpts || e;
201
- for (const [o, r] of n)
202
- t[o] = r;
201
+ for (const [o, l] of a)
202
+ t[o] = l;
203
203
  return t;
204
- }, Ue = /* @__PURE__ */ le(Le, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ P({
204
+ }, Ue = /* @__PURE__ */ ne(Le, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ O({
205
205
  __name: "item",
206
206
  props: {
207
207
  id: {
@@ -222,39 +222,39 @@ const $e = /* @__PURE__ */ P({
222
222
  }
223
223
  },
224
224
  emits: ["timeout"],
225
- setup(e, { emit: n }) {
226
- const t = e, o = m(!0), r = n, l = f(() => {
227
- let s = "";
225
+ setup(e, { emit: a }) {
226
+ const t = e, o = i(!0), l = a, n = f(() => {
227
+ let r = "";
228
228
  switch (t.type) {
229
229
  case "error":
230
- s = "cancel";
230
+ r = "cancel";
231
231
  break;
232
232
  case "info":
233
- s = "info";
233
+ r = "info";
234
234
  break;
235
235
  case "success":
236
- s = "check-circle";
236
+ r = "check-circle";
237
237
  break;
238
238
  case "warning":
239
- s = "error";
239
+ r = "error";
240
240
  break;
241
241
  }
242
- return s;
242
+ return r;
243
243
  });
244
244
  return D(() => {
245
245
  setTimeout(() => {
246
- r("timeout", t.id);
246
+ l("timeout", t.id);
247
247
  }, t.timeout);
248
- }), N(o, (s) => {
249
- s || r("timeout", t.id);
250
- }), (s, a) => {
251
- const u = v("v-alert");
252
- return V(), $(u, {
248
+ }), H(o, (r) => {
249
+ r || l("timeout", t.id);
250
+ }), (r, c) => {
251
+ const s = g("v-alert");
252
+ return V(), A(s, {
253
253
  modelValue: o.value,
254
- "onUpdate:modelValue": a[0] || (a[0] = (i) => o.value = i),
254
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => o.value = u),
255
255
  class: "mt-2",
256
256
  type: e.type,
257
- icon: l.value,
257
+ icon: n.value,
258
258
  text: e.text,
259
259
  "max-width": "90%",
260
260
  width: "500px",
@@ -264,134 +264,134 @@ const $e = /* @__PURE__ */ P({
264
264
  }, null, 8, ["modelValue", "type", "icon", "text"]);
265
265
  };
266
266
  }
267
- }), Ne = /* @__PURE__ */ P({
267
+ }), Ne = /* @__PURE__ */ O({
268
268
  __name: "index",
269
269
  setup(e) {
270
- const n = Te({ items: [] });
270
+ const a = Se({ items: [] });
271
271
  D(() => {
272
- c.on("message", t);
272
+ _.on("message", t);
273
273
  }), T(() => {
274
- c.off("message", t);
274
+ _.off("message", t);
275
275
  });
276
- const t = (a) => {
277
- l(a.type, a.text, a.timeout);
278
- }, o = (a) => {
279
- s(a);
276
+ const t = (c) => {
277
+ n(c.type, c.text, c.timeout);
278
+ }, o = (c) => {
279
+ r(c);
280
280
  };
281
- let r = 0;
282
- const l = (a, u, i) => {
283
- const y = r++;
284
- n.items.push({ id: y, type: a, text: u, timeout: i });
285
- }, s = (a) => {
286
- const u = n.items.findIndex((i) => i.id === a);
287
- u >= 0 && n.items.splice(u, 1);
281
+ let l = 0;
282
+ const n = (c, s, u) => {
283
+ const y = l++;
284
+ a.items.push({ id: y, type: c, text: s, timeout: u });
285
+ }, r = (c) => {
286
+ const s = a.items.findIndex((u) => u.id === c);
287
+ s >= 0 && a.items.splice(s, 1);
288
288
  };
289
- return (a, u) => (V(), z("div", {
290
- onClick: u[0] || (u[0] = E(() => {
289
+ return (c, s) => (V(), F("div", {
290
+ onClick: s[0] || (s[0] = $(() => {
291
291
  }, ["stop"])),
292
292
  class: "x-cont d-flex flex-column-reverse align-center"
293
293
  }, [
294
- (V(!0), z(Pe, null, Oe(n.items, (i) => (V(), $(We, {
294
+ (V(!0), F(Te, null, Oe(a.items, (u) => (V(), A(We, {
295
295
  onTimeout: o,
296
- id: i.id,
297
- type: i.type,
298
- text: i.text,
299
- timeout: i.timeout,
300
- key: i.id
296
+ id: u.id,
297
+ type: u.type,
298
+ text: u.text,
299
+ timeout: u.timeout,
300
+ key: u.id
301
301
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
302
302
  ]));
303
303
  }
304
- }), He = /* @__PURE__ */ le(Ne, [["__scopeId", "data-v-70ed4b89"]]), Ke = /* @__PURE__ */ P({
304
+ }), He = /* @__PURE__ */ ne(Ne, [["__scopeId", "data-v-70ed4b89"]]), Ke = /* @__PURE__ */ O({
305
305
  __name: "index",
306
306
  setup(e) {
307
- const n = J(), { open: t } = G("promptDlg"), o = m(""), r = m(""), l = m(), s = m(), a = m(), u = m(""), i = m(), y = m(), O = f(() => {
308
- var d;
309
- return ((d = i.value) == null ? void 0 : d.color) ?? "primary";
307
+ const a = X(), { open: t } = Q("promptDlg"), o = i(""), l = i(""), n = i(), r = i(), c = i(), s = i(""), u = i(), y = i(), R = f(() => {
308
+ var p;
309
+ return ((p = u.value) == null ? void 0 : p.color) ?? "primary";
310
310
  }), q = f(() => {
311
- var d;
312
- return ((d = i.value) == null ? void 0 : d.text) ?? n.t("cancel");
313
- }), A = f(() => {
314
- var d;
315
- return ((d = y.value) == null ? void 0 : d.color) ?? "primary";
311
+ var p;
312
+ return ((p = u.value) == null ? void 0 : p.text) ?? a.t("cancel");
316
313
  }), M = f(() => {
317
- var d;
318
- return ((d = y.value) == null ? void 0 : d.text) ?? n.t("confirm");
319
- }), p = m();
320
- let w = 0, S = !1;
321
- const B = async (d) => {
322
- var x;
323
- o.value = d.title, r.value = d.text, l.value = d.label, s.value = d.placeholder, a.value = d.rules, u.value = d.value, i.value = d.cancel, y.value = d.confirm, w = d.seq, S = !1, t.value = !0, await X(() => p.value !== void 0, 1e3), (x = p.value) == null || x.focus();
314
+ var p;
315
+ return ((p = y.value) == null ? void 0 : p.color) ?? "primary";
316
+ }), B = f(() => {
317
+ var p;
318
+ return ((p = y.value) == null ? void 0 : p.text) ?? a.t("confirm");
319
+ }), d = i();
320
+ let x = 0, S = !1;
321
+ const L = async (p) => {
322
+ var w;
323
+ o.value = p.title, l.value = p.text, n.value = p.label, r.value = p.placeholder, c.value = p.rules, s.value = p.value, u.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
324
  };
325
325
  D(() => {
326
- c.on("promptDlg", B);
326
+ _.on("promptDlg", L);
327
327
  }), T(() => {
328
- c.off("promptDlg", B);
328
+ _.off("promptDlg", L);
329
329
  });
330
- const R = () => {
331
- t.value = !1, S || (c.emit("promptDlgResult" + w, u.value ?? ""), S = !0);
330
+ const j = () => {
331
+ t.value = !1, S || (_.emit("promptDlgResult" + x, s.value ?? ""), S = !0);
332
332
  };
333
- return N(t, (d) => {
334
- !d && !S && (c.emit("promptDlgResult" + w, void 0), S = !0);
335
- }), (d, x) => {
336
- const K = v("v-card-title"), j = v("v-card-text"), pe = v("v-text-field"), fe = v("v-form"), Y = v("v-btn"), me = v("v-card-actions"), ve = v("v-card"), ge = v("v-dialog");
337
- return V(), $(ge, {
338
- modelValue: U(t),
339
- "onUpdate:modelValue": x[2] || (x[2] = (I) => F(t) ? t.value = I : null),
333
+ return H(t, (p) => {
334
+ !p && !S && (_.emit("promptDlgResult" + x, void 0), S = !0);
335
+ }), (p, w) => {
336
+ const z = g("v-card-title"), I = g("v-card-text"), pe = g("v-text-field"), de = g("v-form"), Z = g("v-btn"), fe = g("v-card-actions"), ie = g("v-card"), ge = g("v-dialog");
337
+ return V(), A(ge, {
338
+ modelValue: W(t),
339
+ "onUpdate:modelValue": w[2] || (w[2] = (E) => J(t) ? t.value = E : null),
340
340
  onKeydown: [
341
- x[3] || (x[3] = W(E((I) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
- W(E(R, ["stop", "prevent"]), ["enter"])
341
+ w[3] || (w[3] = N($((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
+ N($(j, ["stop", "prevent"]), ["enter"])
343
343
  ],
344
344
  transition: "dialog-top-transition",
345
345
  "max-width": "600px"
346
346
  }, {
347
- default: g(() => [
348
- _(ve, null, {
349
- default: g(() => [
350
- _(K, null, {
351
- default: g(() => [
347
+ default: v(() => [
348
+ h(ie, null, {
349
+ default: v(() => [
350
+ h(z, null, {
351
+ default: v(() => [
352
352
  C(b(o.value), 1)
353
353
  ]),
354
354
  _: 1
355
355
  }),
356
- _(j, null, {
357
- default: g(() => [
358
- C(b(r.value), 1)
356
+ h(I, null, {
357
+ default: v(() => [
358
+ C(b(l.value), 1)
359
359
  ]),
360
360
  _: 1
361
361
  }),
362
- _(fe, { class: "mx-3" }, {
363
- default: g(() => [
364
- _(pe, {
365
- modelValue: u.value,
366
- "onUpdate:modelValue": x[0] || (x[0] = (I) => u.value = I),
367
- label: l.value,
368
- placeholder: s.value,
369
- rules: a.value,
362
+ h(de, { class: "mx-3" }, {
363
+ default: v(() => [
364
+ h(pe, {
365
+ modelValue: s.value,
366
+ "onUpdate:modelValue": w[0] || (w[0] = (E) => s.value = E),
367
+ label: n.value,
368
+ placeholder: r.value,
369
+ rules: c.value,
370
370
  ref_key: "target",
371
- ref: p
371
+ ref: d
372
372
  }, null, 8, ["modelValue", "label", "placeholder", "rules"])
373
373
  ]),
374
374
  _: 1
375
375
  }),
376
- _(me, { class: "d-flex justify-end" }, {
377
- default: g(() => [
378
- _(Y, {
379
- onClick: x[1] || (x[1] = (I) => t.value = !1),
380
- color: O.value,
376
+ h(fe, { class: "d-flex justify-end" }, {
377
+ default: v(() => [
378
+ h(Z, {
379
+ onClick: w[1] || (w[1] = (E) => t.value = !1),
380
+ color: R.value,
381
381
  variant: "text"
382
382
  }, {
383
- default: g(() => [
383
+ default: v(() => [
384
384
  C(b(q.value), 1)
385
385
  ]),
386
386
  _: 1
387
387
  }, 8, ["color"]),
388
- _(Y, {
389
- onClick: R,
390
- color: A.value,
388
+ h(Z, {
389
+ onClick: j,
390
+ color: M.value,
391
391
  variant: "text"
392
392
  }, {
393
- default: g(() => [
394
- C(b(M.value), 1)
393
+ default: v(() => [
394
+ C(b(B.value), 1)
395
395
  ]),
396
396
  _: 1
397
397
  }, 8, ["color"])
@@ -406,37 +406,37 @@ const $e = /* @__PURE__ */ P({
406
406
  }, 8, ["modelValue", "onKeydown"]);
407
407
  };
408
408
  }
409
- }), ze = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Je = /* @__PURE__ */ P({
409
+ }), ze = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Je = /* @__PURE__ */ O({
410
410
  __name: "index",
411
411
  setup(e) {
412
- const n = J(), { open: t } = G("waitDlg"), o = () => {
412
+ const a = X(), { open: t } = Q("waitDlg"), o = () => {
413
413
  t.value = !0;
414
- }, r = () => {
414
+ }, l = () => {
415
415
  t.value = !1;
416
416
  };
417
417
  return D(() => {
418
- c.on("openWaitDlg", o), c.on("closeWaitDlg", r);
418
+ _.on("openWaitDlg", o), _.on("closeWaitDlg", l);
419
419
  }), T(() => {
420
- c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
421
- }), (l, s) => {
422
- const a = v("v-card"), u = v("v-dialog");
423
- return V(), $(u, {
424
- modelValue: U(t),
425
- "onUpdate:modelValue": s[0] || (s[0] = (i) => F(t) ? t.value = i : null),
420
+ _.off("openWaitDlg", o), _.off("closeWaitDlg", l);
421
+ }), (n, r) => {
422
+ const c = g("v-card"), s = g("v-dialog");
423
+ return V(), A(s, {
424
+ modelValue: W(t),
425
+ "onUpdate:modelValue": r[0] || (r[0] = (u) => J(t) ? t.value = u : null),
426
426
  persistent: "",
427
427
  "no-click-animation": "",
428
428
  fullscreen: ""
429
429
  }, {
430
- default: g(() => [
431
- h("div", ze, [
432
- _(a, {
430
+ default: v(() => [
431
+ m("div", ze, [
432
+ h(c, {
433
433
  width: "300px",
434
434
  height: "80px",
435
435
  loading: ""
436
436
  }, {
437
- default: g(() => [
438
- h("div", Fe, [
439
- h("span", null, b(U(n).t("waitingResponse")), 1)
437
+ default: v(() => [
438
+ m("div", Fe, [
439
+ m("span", null, b(W(a).t("waitingResponse")), 1)
440
440
  ])
441
441
  ]),
442
442
  _: 1
@@ -448,39 +448,39 @@ const $e = /* @__PURE__ */ P({
448
448
  };
449
449
  }
450
450
  }), Xe = (e) => {
451
- e.component("v-alert", he), e.component("v-btn", _e), e.component("v-card", xe), e.component("v-card-actions", ye), e.component("v-card-text", we), e.component("v-card-title", ke), e.component("v-dialog", be), e.component("v-form", Ce), e.component("v-text-field", Ve), 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);
451
+ 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
452
  };
453
453
  function ft() {
454
- const e = H(), n = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), l = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), s = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), a = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
454
+ const e = K(), 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"), c = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
455
455
  return {
456
- primaryColor: n,
456
+ primaryColor: a,
457
457
  secondaryColor: t,
458
458
  backgroundColor0: o,
459
- backgroundColor1: r,
460
- backgroundColor2: l,
461
- highlightColor: s,
462
- borderColor: a
459
+ backgroundColor1: l,
460
+ backgroundColor2: n,
461
+ highlightColor: r,
462
+ borderColor: c
463
463
  };
464
464
  }
465
- const ae = oe(
465
+ const ce = oe(
466
466
  "global",
467
467
  () => {
468
- const e = H(), n = m(!1);
469
- N(
470
- n,
471
- (l) => {
472
- e.global.name.value = l ? "dark" : "light";
468
+ const e = K(), a = i(!1);
469
+ H(
470
+ a,
471
+ (n) => {
472
+ e.global.name.value = n ? "dark" : "light";
473
473
  },
474
474
  {
475
475
  immediate: !0
476
476
  }
477
477
  );
478
- const t = m("en"), o = m({}), r = m("");
478
+ const t = i("en"), o = i({}), l = i("");
479
479
  return {
480
- dark: n,
480
+ dark: a,
481
481
  locale: t,
482
482
  permissionObjects: o,
483
- permissionChecksum: r
483
+ permissionChecksum: l
484
484
  };
485
485
  },
486
486
  {
@@ -491,124 +491,117 @@ const ae = oe(
491
491
  }
492
492
  ]
493
493
  }
494
- ), L = require("js-cookie");
495
- function mt(e) {
496
- const n = Ie.create({
494
+ ), U = require("js-cookie");
495
+ function it(e) {
496
+ const a = Ie.create({
497
497
  timeout: 6e3
498
498
  });
499
- return n.defaults.baseURL = e.baseUrl, n.interceptors.request.use(
499
+ return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
500
500
  (t) => Ge(t),
501
501
  (t) => {
502
502
  Qe(t, e.onError);
503
503
  }
504
- ), n.interceptors.response.use(
504
+ ), a.interceptors.response.use(
505
505
  (t) => Ye(t),
506
506
  (t) => Ze(t, e.onError)
507
- ), n;
507
+ ), a;
508
508
  }
509
509
  function Ge(e) {
510
- const n = L.get("accessToken") ?? "";
511
- return e.headers.Authorization = "Basic " + n, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
510
+ const a = U.get("accessToken") ?? "";
511
+ return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
512
512
  }
513
- function Qe(e, n) {
514
- console.error(e), n("request timeout");
513
+ function Qe(e, a) {
514
+ console.error(e), a("request timeout");
515
515
  }
516
516
  function Ye(e) {
517
517
  return e.data;
518
518
  }
519
- function Ze(e, n) {
520
- var r;
519
+ function Ze(e, a) {
520
+ var l;
521
521
  const t = e.response;
522
522
  if (!t)
523
523
  return Promise.reject(e);
524
- t.status === 401 && et();
525
- let o = (r = t.data) == null ? void 0 : r.message;
524
+ t.status === 401 && Pe();
525
+ let o = (l = t.data) == null ? void 0 : l.message;
526
526
  return o || (o = {
527
527
  code: t.status,
528
528
  message: t.statusText
529
- }), n(o), Promise.reject(e);
529
+ }), a(o), Promise.reject(e);
530
530
  }
531
- function et() {
532
- L.remove("accessToken"), L.remove("refreshToken"), L.remove("activeOrg"), re().replace({ path: "/passport/login" });
531
+ function Pe() {
532
+ U.remove("accessToken"), U.remove("refreshToken"), U.remove("activeOrg"), le().replace({ path: "/passport/login" });
533
533
  }
534
- let Z = Date.now();
535
- function ie() {
534
+ let P = Date.now();
535
+ function ue() {
536
536
  const e = Date.now();
537
- return e - Z > 500 ? (Z = e, !0) : !1;
537
+ return e - P > 500 ? (P = e, !0) : !1;
538
538
  }
539
- let tt = 0;
540
- function ce() {
541
- return ++tt;
539
+ let et = 0;
540
+ function se() {
541
+ return ++et;
542
542
  }
543
- async function vt(e) {
544
- if (!ie())
543
+ async function gt(e) {
544
+ if (!ue())
545
545
  return;
546
- let n = !1, t;
547
- const o = (l) => {
548
- t = l, n = !0;
549
- }, r = ce();
550
- return c.on("confirmDlgResult" + r, o), c.emit("confirmDlg", { ...e, seq: r }), await X(() => n), c.off("confirmDlgResult" + r, o), t;
546
+ let a = !1, t;
547
+ const o = (n) => {
548
+ t = n, a = !0;
549
+ }, l = se();
550
+ return _.on("confirmDlgResult" + l, o), _.emit("confirmDlg", { ...e, seq: l }), await G(() => a), _.off("confirmDlgResult" + l, o), t;
551
551
  }
552
- async function gt(e) {
553
- if (!ie())
552
+ async function vt(e) {
553
+ if (!ue())
554
554
  return;
555
- let n = !1, t;
556
- const o = (l) => {
557
- t = l, n = !0;
558
- }, r = ce();
559
- return c.on("promptDlgResult" + r, o), c.emit("promptDlg", { ...e, seq: r }), await X(() => n), c.off("promptDlgResult" + r, o), t;
555
+ let a = !1, t;
556
+ const o = (n) => {
557
+ t = n, a = !0;
558
+ }, l = se();
559
+ return _.on("promptDlgResult" + l, o), _.emit("promptDlg", { ...e, seq: l }), await G(() => a), _.off("promptDlgResult" + l, o), t;
560
560
  }
561
- function ht() {
562
- c.emit("openWaitDlg");
561
+ function mt() {
562
+ _.emit("openWaitDlg");
563
563
  }
564
- function _t() {
565
- c.emit("closeWaitDlg");
564
+ function ht() {
565
+ _.emit("closeWaitDlg");
566
566
  }
567
- function xt(e, n) {
568
- c.emit("message", { type: "error", text: e, timeout: n });
567
+ function wt(e, a) {
568
+ _.emit("message", { type: "error", text: e, timeout: a });
569
569
  }
570
- function yt(e, n) {
571
- c.emit("message", { type: "info", text: e, timeout: n });
570
+ function yt(e, a) {
571
+ _.emit("message", { type: "info", text: e, timeout: a });
572
572
  }
573
- function wt(e, n) {
574
- c.emit("message", { type: "success", text: e, timeout: n });
573
+ function xt(e, a) {
574
+ _.emit("message", { type: "success", text: e, timeout: a });
575
575
  }
576
- function kt(e, n) {
577
- c.emit("message", { type: "warning", text: e, timeout: n });
576
+ function kt(e, a) {
577
+ _.emit("message", { type: "warning", text: e, timeout: a });
578
578
  }
579
579
  function bt(e) {
580
- var o, r;
580
+ var o, l;
581
581
  if (!window.appAppear) {
582
582
  window.appAppear = !0;
583
583
  return;
584
584
  }
585
- const n = "single-spa-application:" + e, t = (o = document.getElementById(n)) == null ? void 0 : o.classList;
586
- t && (t.remove("app-left", "app-right", "app-reset"), (r = window.routeExtras) != null && r.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
585
+ const a = "single-spa-application:" + e, t = (o = document.getElementById(a)) == null ? void 0 : o.classList;
586
+ t && (t.remove("app-left", "app-right", "app-reset"), (l = window.routeExtras) != null && l.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
587
587
  t.add("app-reset");
588
588
  }, 0));
589
589
  }
590
- let ue = {};
591
- function Ct(e) {
592
- ue = e;
593
- }
594
- function ee(e, n) {
590
+ var tt = /* @__PURE__ */ ((e) => (e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_group", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_calc_space = "list_calc_space", e.get_calc_space = "get_calc_space", e.create_calc_space = "create_calc_space", e.delete_calc_space = "delete_calc_space", e.update_calc_space = "update_calc_space", e.arrange_calc_space = "arrange_calc_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_calc_layer = "open_calc_layer", e.list_db_space = "list_db_space", e.get_db_space = "get_db_space", e.create_db_space = "create_db_space", e.delete_db_space = "delete_db_space", e.update_db_space = "update_db_space", e.arrange_db_space = "arrange_db_space", e.list_model_group = "list_model_group", e.create_model_group = "create_model_group", e.delete_model_group = "delete_model_group", e.update_model_group = "update_model_group", e.arrange_model_group = "arrange_model_group", e.list_model = "list_model", e.get_model = "get_model", e.create_model = "create_model", e.delete_model = "delete_model", e.update_model = "update_model", e.get_model_data = "get_model_data", e.create_model_data = "create_model_data", e.delete_model_data = "delete_model_data", e.update_model_data = "update_model_data", e.get_graph = "get_graph", e.update_graph = "update_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_asset_space = "list_asset_space", e.get_asset_space = "get_asset_space", e.create_asset_space = "create_asset_space", e.delete_asset_space = "delete_asset_space", e.update_asset_space = "update_asset_space", e.arrange_asset_space = "arrange_asset_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_asset = "list_asset", e.get_asset = "get_asset", e.create_asset = "create_asset", e.delete_asset = "delete_asset", e.update_asset = "update_asset", e.move_asset = "move_asset", e.open_asset_layer = "open_asset_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.arrange_org_role = "arrange_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_model = "filter_model", e))(tt || {});
591
+ function ee(e, a) {
595
592
  if (!e)
596
593
  return !1;
597
594
  let t = e;
598
- return Object.keys(t).length <= 0 || (n.split("/").forEach((r) => {
595
+ return Object.keys(t).length <= 0 || (a.split("/").forEach((l) => {
599
596
  if (Object.keys(t).length <= 0)
600
597
  return !0;
601
- if (t[r])
602
- t = t[r];
598
+ if (t[l])
599
+ t = t[l];
603
600
  else
604
601
  return !1;
605
602
  }), Object.keys(t).length <= 0);
606
603
  }
607
- function Vt(e, n) {
608
- const t = ue[e];
609
- return t ? n ? (!ee(t.includes, n) || ee(t.excludes, n), !1) : !0 : !1;
610
- }
611
- const de = require("js-cookie"), nt = [
604
+ const _e = require("js-cookie"), at = [
612
605
  { path: "/passport/login", level: 0 },
613
606
  { path: "/passport/loginAccount", level: 1 },
614
607
  { path: "/passport/register", level: 1 },
@@ -628,182 +621,187 @@ const de = require("js-cookie"), nt = [
628
621
  { path: "/calc", level: 1, requiredState: "org" },
629
622
  { path: "/data", level: 1, requiredState: "org" }
630
623
  ];
631
- function Q(e) {
632
- let n, t = 0;
624
+ function Y(e) {
625
+ let a, t = 0;
633
626
  const o = e.split("/");
634
- return nt.forEach((r) => {
635
- const l = r.path.split("/");
636
- let s = 0;
637
- for (let a = 0; a < o.length && !(a >= l.length || o[a] !== l[a]); a++)
638
- s++;
639
- s >= t && (n = r, t = s);
640
- }), n;
627
+ return at.forEach((l) => {
628
+ const n = l.path.split("/");
629
+ let r = 0;
630
+ for (let c = 0; c < o.length && !(c >= n.length || o[c] !== n[c]); c++)
631
+ r++;
632
+ r >= t && (a = l, t = r);
633
+ }), a;
641
634
  }
642
635
  function te(e) {
643
636
  if (e === "/")
644
637
  return { app: "", path: "/", level: -1 };
645
- const n = Q(e);
646
- if (!n)
638
+ const a = Y(e);
639
+ if (!a)
647
640
  return { app: "invalidApp", path: "/invalidApp/invalidRoute", level: -1 };
648
641
  const t = e.split("/");
649
- return console.assert(t.length >= 2), { app: t[1], path: n.path, level: n.level };
642
+ return console.assert(t.length >= 2), { app: t[1], path: a.path, level: a.level };
650
643
  }
651
- const ne = m("");
652
- function k(e, n) {
653
- const t = te(e), o = te(n), r = t.app === o.app, l = t.path === o.path, s = t.level >= o.level;
644
+ const ae = i("");
645
+ function k(e, a) {
646
+ const t = te(e), o = te(a), l = t.app === o.app, n = t.path === o.path, r = t.level >= o.level;
654
647
  console.info(
655
- `~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${r} forward=${s}`
656
- ), r ? l ? ne.value = "" : ne.value = s ? "inner-left" : "inner-right" : window.routeExtras = { forward: s };
648
+ `~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${l} forward=${r}`
649
+ ), l ? n ? ae.value = "" : ae.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
657
650
  }
658
651
  function ot() {
659
- return !!de.get("accessToken");
652
+ return !!_e.get("accessToken");
660
653
  }
661
- function rt() {
662
- return !!de.get("activeOrg");
654
+ function lt() {
655
+ return !!_e.get("activeOrg");
663
656
  }
664
- function Dt(e, n, t) {
665
- const o = ot(), r = rt(), l = Q(e.path);
666
- if (!l) {
657
+ function Ct(e, a, t) {
658
+ const o = ot(), l = lt(), n = Y(e.path);
659
+ if (!n) {
667
660
  t();
668
661
  return;
669
662
  }
670
- if (l.requiredState === "auth")
663
+ if (n.requiredState === "auth")
671
664
  if (o)
672
- if (r) {
673
- const s = "/main";
674
- k(s, n.path), t({ path: s });
665
+ if (l) {
666
+ const r = "/main";
667
+ k(r, a.path), t({ path: r });
675
668
  } else
676
- k(e.path, n.path), t();
669
+ k(e.path, a.path), t();
677
670
  else {
678
- const s = "/passport/login";
679
- k(s, n.path), t({ path: s });
671
+ const r = "/passport/login";
672
+ k(r, a.path), t({ path: r });
680
673
  }
681
- else if (l.requiredState === "org")
674
+ else if (n.requiredState === "org")
682
675
  if (o)
683
- if (r)
684
- k(e.path, n.path), t();
676
+ if (l)
677
+ k(e.path, a.path), t();
685
678
  else {
686
- const s = "/org/joinOrCreate";
687
- k(s, n.path), t({ path: s });
679
+ const r = "/org/joinOrCreate";
680
+ k(r, a.path), t({ path: r });
688
681
  }
689
682
  else {
690
- const s = "/passport/login";
691
- k(s, n.path), t({ path: s });
683
+ const r = "/passport/login";
684
+ k(r, a.path), t({ path: r });
692
685
  }
693
686
  else if (o)
694
- if (r) {
695
- const s = "/main";
696
- k(s, n.path), t({ path: s });
687
+ if (l) {
688
+ const r = "/main";
689
+ k(r, a.path), t({ path: r });
697
690
  } else {
698
- const s = "/org/joinOrCreate";
699
- k(s, n.path), t({ path: s });
691
+ const r = "/org/joinOrCreate";
692
+ k(r, a.path), t({ path: r });
700
693
  }
701
694
  else
702
- k(e.path, n.path), t();
695
+ k(e.path, a.path), t();
703
696
  }
704
- function qt(e) {
705
- const n = je(), t = re(), o = ae(), r = se(), l = (i) => {
706
- if (i.key === "Escape") {
707
- s();
697
+ function Vt(e) {
698
+ const a = je(), t = le(), o = ce(), l = re(), n = (u) => {
699
+ if (u.key === "Escape") {
700
+ r();
708
701
  return;
709
702
  }
710
- if (!e && i.ctrlKey && i.key.toLowerCase() === "d") {
711
- a();
703
+ if (!e && u.ctrlKey && u.key.toLowerCase() === "d") {
704
+ c();
712
705
  return;
713
706
  }
714
- if (!e && i.ctrlKey && i.key.toLowerCase() === "l") {
715
- u();
707
+ if (!e && u.ctrlKey && u.key.toLowerCase() === "l") {
708
+ s();
716
709
  return;
717
710
  }
718
- }, s = () => {
711
+ }, r = () => {
719
712
  var y;
720
- if (!r.isEmpty()) {
721
- r.hasView("waitDlg") || r.popView();
713
+ if (!l.isEmpty()) {
714
+ l.hasView("waitDlg") || l.popView();
722
715
  return;
723
716
  }
724
- const i = Q(n.path);
725
- (i == null ? void 0 : i.level) === 0 ? (y = navigator == null ? void 0 : navigator.Backbutton) == null || y.goHome(
717
+ const u = Y(a.path);
718
+ (u == null ? void 0 : u.level) === 0 ? (y = navigator == null ? void 0 : navigator.Backbutton) == null || y.goHome(
726
719
  () => {
727
720
  },
728
721
  () => {
729
722
  }
730
723
  ) : t.back();
731
- }, a = () => {
724
+ }, c = () => {
732
725
  o.dark = !o.dark;
733
- }, u = () => {
726
+ }, s = () => {
734
727
  o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
735
728
  };
736
729
  return D(() => {
737
- window.addEventListener("keydown", l, !1);
730
+ window.addEventListener("keydown", n, !1);
738
731
  }), T(() => {
739
- window.removeEventListener("keydown", l, !1);
732
+ window.removeEventListener("keydown", n, !1);
740
733
  }), {};
741
734
  }
742
- function st(e, n) {
743
- return e.post("pullPermission", n);
735
+ function rt(e, a) {
736
+ return e.post("pullPermission", a);
744
737
  }
745
- function St(e) {
746
- const n = ae();
738
+ function Dt(e) {
739
+ const a = ce();
747
740
  let t;
748
741
  const o = () => {
749
742
  clearTimeout(t), t = setTimeout(async () => {
750
- await r(), t && o();
743
+ await l(), t && o();
751
744
  }, 3e3);
752
- }, r = async () => {
745
+ }, l = async () => {
753
746
  try {
754
- const { update: l, permissions: s } = await st(e, {
755
- checksum: n.permissionChecksum
747
+ const { update: r, permissions: c } = await rt(e, {
748
+ checksum: a.permissionChecksum
756
749
  });
757
- if (!l)
750
+ if (!r)
758
751
  return;
759
- const a = {};
760
- for (let u in s) {
752
+ const s = {};
753
+ for (const u in c) {
761
754
  if (u === "checksum")
762
755
  continue;
763
- const i = s[u];
764
- a[u] = JSON.parse(i);
756
+ const y = c[u];
757
+ s[u] = JSON.parse(y);
765
758
  }
766
- n.permissionObjects = a, n.permissionChecksum = s.checksum ?? "";
767
- } catch (l) {
768
- console.error(l);
759
+ a.permissionObjects = s, a.permissionChecksum = c.checksum ?? "";
760
+ } catch (r) {
761
+ console.error(r);
769
762
  }
770
763
  };
771
- return D(() => {
772
- r(), o();
764
+ D(() => {
765
+ l(), o();
773
766
  }), T(() => {
774
767
  clearTimeout(t), t = void 0;
775
- }), {};
768
+ });
769
+ function n(r, c) {
770
+ const s = a.permissionObjects[r];
771
+ return s ? c ? !(!ee(s.includes, c) || ee(s.excludes, c)) : !0 : !1;
772
+ }
773
+ return { verifyPermission: n };
776
774
  }
777
- function Tt() {
778
- const e = H(), { width: n } = Re(), t = f(() => e.global.name.value), o = f(() => !!window.cordova), r = f(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
779
- return { dark: t, sysBarAvail: o, compactWidth: r };
775
+ function qt() {
776
+ const e = K(), { width: a } = Re(), t = f(() => e.global.name.value), o = f(() => !!window.cordova), l = f(() => a.value <= 1280 ? a.value + "px" : a.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
777
+ return { dark: t, sysBarAvail: o, compactWidth: l };
780
778
  }
781
- const Pt = { install: Xe };
779
+ const St = { install: Xe };
782
780
  export {
781
+ tt as Permission,
783
782
  bt as appAppear,
784
- _t as closeWaitDlg,
785
- mt as createAxios,
786
- Pt as default,
787
- c as eventBus,
788
- Q as matchRouteMeta,
789
- xt as messageError,
783
+ ht as closeWaitDlg,
784
+ it as createAxios,
785
+ St as default,
786
+ _ as eventBus,
787
+ ee as isExist,
788
+ Y as matchRouteMeta,
789
+ wt as messageError,
790
790
  yt as messageInfo,
791
- wt as messageSuccess,
791
+ xt as messageSuccess,
792
792
  kt as messageWarning,
793
- Dt as onBeforeEach,
794
- vt as openConfirmDlg,
795
- gt as openPromptDlg,
796
- ht as openWaitDlg,
797
- ne as routeTransName,
798
- Ct as setPermissionObject,
793
+ Ct as onBeforeEach,
794
+ gt as openConfirmDlg,
795
+ vt as openPromptDlg,
796
+ mt as openWaitDlg,
797
+ ae as routeTransName,
799
798
  ft as useColor,
800
- ae as useGlobalStore,
801
- qt as useHotkey,
802
- St as usePullPermission,
803
- Tt as useSystem,
804
- se as useViewMgrStore,
805
- G as useViewStack,
806
- Vt as verifyPermission,
807
- pt as waitMs,
808
- X as waitUtil
799
+ ce as useGlobalStore,
800
+ Vt as useHotkey,
801
+ Dt as usePermission,
802
+ qt as useSystem,
803
+ re as useViewMgrStore,
804
+ Q as useViewStack,
805
+ dt as waitMs,
806
+ G as waitUtil
809
807
  };
@@ -1,4 +1,4 @@
1
- declare enum Permission {
1
+ export declare enum Permission {
2
2
  list_app_group = "list_app_group",
3
3
  create_app_group = "create_app_group",
4
4
  delete_app_group = "delete_app_group",
@@ -129,6 +129,5 @@ type PermissionObject = {
129
129
  export type PermissionObjects = {
130
130
  [key: string]: PermissionObject;
131
131
  };
132
- export declare function setPermissionObject(permissonObjects: PermissionObjects): void;
133
- export declare function verifyPermission(permission: Permission, instance: string | undefined): boolean;
132
+ export declare function isExist(instanceTree: InstanceTree | undefined, instance: string): boolean;
134
133
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.3.8",
4
+ "version": "0.3.9",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",