x-essential-lib 0.5.28 → 0.5.30

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 CHANGED
@@ -1,13 +1,13 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="x-essential-lib",a.appendChild(document.createTextNode('.x-cont[data-v-f4ad116e]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-f4ad116e]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-f4ad116e]{transform-origin:20px 20px;animation:lds-spinner-f4ad116e 1.2s linear infinite}.lds-spinner div[data-v-f4ad116e]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-f4ad116e]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-f4ad116e]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-f4ad116e]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-f4ad116e]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-f4ad116e]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-f4ad116e]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-f4ad116e]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-f4ad116e]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-f4ad116e]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-f4ad116e]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-f4ad116e{0%{opacity:1}to{opacity:0}}.x-cont[data-v-8c2268ea]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { ref as f, watch as N, computed as i, onMounted as S, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as V, createBlock as E, unref as z, isRef as G, withKeys as L, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as I, toDisplayString as j, createElementBlock as J, normalizeStyle as ve, pushScopeId as me, popScopeId as he, createElementVNode as m, reactive as we, Fragment as xe, renderList as ye, createCommentVNode as ke } from "vue";
3
- import { useTheme as H, useLocale as Q, useDisplay as be } from "vuetify";
4
- import { defineStore as re } from "pinia";
5
- import Ce from "axios";
6
- import { useRouter as ne, useRoute as De } from "vue-router";
7
- const Y = re(
2
+ import { ref as i, watch as N, computed as f, onMounted as S, onBeforeUnmount as T, defineComponent as U, resolveComponent as h, openBlock as V, createBlock as E, unref as F, isRef as G, withKeys as M, withModifiers as W, withCtx as w, createVNode as k, createTextVNode as B, toDisplayString as A, createElementBlock as J, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as xe, createCommentVNode as ye } from "vue";
3
+ import { useTheme as H, useLocale as Q, useDisplay as ke } from "vuetify";
4
+ import { defineStore as le } from "pinia";
5
+ import be from "axios";
6
+ import { useRouter as re, useRoute as Ce } from "vue-router";
7
+ const Y = le(
8
8
  "global",
9
9
  () => {
10
- const e = H(), a = f(), t = f("en"), l = f({}), o = f(""), n = f("/");
10
+ const e = H(), a = i(), t = i("en"), l = i({}), o = i(""), n = i("/");
11
11
  return N(
12
12
  a,
13
13
  () => {
@@ -34,8 +34,8 @@ const Y = re(
34
34
  }
35
35
  ]
36
36
  }
37
- ), ce = re("viewMgr", () => {
38
- const e = f([]);
37
+ ), ne = le("viewMgr", () => {
38
+ const e = i([]);
39
39
  function a() {
40
40
  return e.value.length <= 0;
41
41
  }
@@ -72,7 +72,7 @@ const Y = re(
72
72
  };
73
73
  });
74
74
  /*! js-cookie v3.0.5 | MIT */
75
- function W(e) {
75
+ function L(e) {
76
76
  for (var a = 1; a < arguments.length; a++) {
77
77
  var t = arguments[a];
78
78
  for (var l in t)
@@ -80,7 +80,7 @@ function W(e) {
80
80
  }
81
81
  return e;
82
82
  }
83
- var Se = {
83
+ var De = {
84
84
  read: function(e) {
85
85
  return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
86
86
  },
@@ -94,7 +94,7 @@ var Se = {
94
94
  function X(e, a) {
95
95
  function t(o, n, r) {
96
96
  if (!(typeof document > "u")) {
97
- r = W({}, a, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
97
+ r = L({}, a, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
98
98
  var c = "";
99
99
  for (var p in r)
100
100
  r[p] && (c += "; " + p, r[p] !== !0 && (c += "=" + r[p].split(";")[0]));
@@ -123,16 +123,16 @@ function X(e, a) {
123
123
  t(
124
124
  o,
125
125
  "",
126
- W({}, n, {
126
+ L({}, n, {
127
127
  expires: -1
128
128
  })
129
129
  );
130
130
  },
131
131
  withAttributes: function(o) {
132
- return X(this.converter, W({}, this.attributes, o));
132
+ return X(this.converter, L({}, this.attributes, o));
133
133
  },
134
134
  withConverter: function(o) {
135
- return X(W({}, this.converter, o), this.attributes);
135
+ return X(L({}, this.converter, o), this.attributes);
136
136
  }
137
137
  },
138
138
  {
@@ -141,29 +141,29 @@ function X(e, a) {
141
141
  }
142
142
  );
143
143
  }
144
- var B = X(Se, { path: "/" });
145
- function lt(e) {
146
- const a = Ce.create({
144
+ var R = X(De, { path: "/" });
145
+ function ot(e) {
146
+ const a = be.create({
147
147
  timeout: 6e3
148
148
  });
149
149
  return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
150
- (t) => Ve(t),
150
+ (t) => Se(t),
151
151
  (t) => {
152
- qe(t, e.onError);
152
+ Ve(t, e.onError);
153
153
  }
154
154
  ), a.interceptors.response.use(
155
- (t) => Re(t),
155
+ (t) => qe(t),
156
156
  (t) => Oe(t, e.onError)
157
157
  ), a;
158
158
  }
159
- function Ve(e) {
160
- const a = B.get("accessToken") ?? "";
159
+ function Se(e) {
160
+ const a = R.get("accessToken") ?? "";
161
161
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
162
162
  }
163
- function qe(e, a) {
163
+ function Ve(e, a) {
164
164
  console.error(e), a("request timeout");
165
165
  }
166
- function Re(e) {
166
+ function qe(e) {
167
167
  return e.data;
168
168
  }
169
169
  function Oe(e, a) {
@@ -179,7 +179,7 @@ function Oe(e, a) {
179
179
  }), a(l), Promise.reject(e);
180
180
  }
181
181
  function Te() {
182
- B.remove("accessToken"), B.remove("refreshToken"), B.remove("activeOrg"), ne().replace({ path: "/passport/login" });
182
+ R.remove("accessToken"), R.remove("refreshToken"), R.remove("activeOrg"), re().replace({ path: "/passport/login" });
183
183
  }
184
184
  function je(e) {
185
185
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
@@ -200,7 +200,7 @@ function je(e) {
200
200
  const s = function() {
201
201
  return window.eventBus || (window.eventBus = je()), window.eventBus;
202
202
  }();
203
- async function rt(e) {
203
+ async function lt(e) {
204
204
  return new Promise((a) => {
205
205
  setTimeout(a, e);
206
206
  });
@@ -214,7 +214,7 @@ async function Z(e, a, t) {
214
214
  n();
215
215
  });
216
216
  }
217
- function nt(e) {
217
+ function rt(e) {
218
218
  var l, o;
219
219
  if (!window.appAppear) {
220
220
  window.appAppear = !0;
@@ -226,45 +226,45 @@ function nt(e) {
226
226
  }, 0));
227
227
  }
228
228
  let te = Date.now();
229
- function ue() {
229
+ function ce() {
230
230
  const e = Date.now();
231
231
  return e - te > 500 ? (te = e, !0) : !1;
232
232
  }
233
233
  let Ae = 0;
234
- function pe() {
234
+ function ue() {
235
235
  return ++Ae;
236
236
  }
237
- async function ct(e) {
238
- if (!ue())
237
+ async function nt(e) {
238
+ if (!ce())
239
239
  return;
240
240
  let a = !1, t;
241
241
  const l = (n) => {
242
242
  t = n, a = !0;
243
- }, o = pe();
243
+ }, o = ue();
244
244
  return s.on("confirmDlgResult" + o, l), s.emit("confirmDlg", { ...e, seq: o }), await Z(() => a), s.off("confirmDlgResult" + o, l), t;
245
245
  }
246
- async function ut(e) {
247
- if (!ue())
246
+ async function ct(e) {
247
+ if (!ce())
248
248
  return;
249
249
  let a = !1, t;
250
250
  const l = (n) => {
251
251
  t = n, a = !0;
252
- }, o = pe();
252
+ }, o = ue();
253
253
  return s.on("promptDlgResult" + o, l), s.emit("promptDlg", { ...e, seq: o }), await Z(() => a), s.off("promptDlgResult" + o, l), t;
254
254
  }
255
- function pt() {
255
+ function ut() {
256
256
  s.emit("openWaitDlg");
257
257
  }
258
- function st() {
258
+ function pt() {
259
259
  s.emit("closeWaitDlg");
260
260
  }
261
- function _t(e, a) {
261
+ function st(e, a) {
262
262
  s.emit("message", { type: "error", text: e, timeout: a });
263
263
  }
264
- function dt(e, a) {
264
+ function _t(e, a) {
265
265
  s.emit("message", { type: "info", text: e, timeout: a });
266
266
  }
267
- function ft(e, a) {
267
+ function dt(e, a) {
268
268
  s.emit("message", { type: "success", text: e, timeout: a });
269
269
  }
270
270
  function it(e, a) {
@@ -285,25 +285,114 @@ function ae(e, a) {
285
285
  }), Object.keys(t).length <= 0);
286
286
  }
287
287
  const Be = [
288
- { app: "x-passport-mf", path: "/passport/login", level: 0 },
289
- { app: "x-passport-mf", path: "/passport/loginAccount", level: 1 },
290
- { app: "x-passport-mf", path: "/passport/register", level: 1 },
291
- { app: "x-org-mf", path: "/org/joinOrCreate", level: 1, requiredState: "auth" },
292
- { app: "x-org-mf", path: "/org/manager", level: 1, requiredState: "org", mainActive: 2 },
293
- { app: "x-main-mf", path: "/main", level: 0, requiredState: "org" },
294
- { app: "x-mine-mf", path: "/mine/personalInfo", level: 1, requiredState: "org", mainActive: 4 },
295
- { app: "x-mine-mf", path: "/mine/accountSecurity", level: 2, requiredState: "org" },
296
- { app: "x-mine-mf", path: "/mine/settings", level: 1, requiredState: "org", mainActive: 4 },
297
- { app: "x-mine-mf", path: "/mine/general", level: 2, requiredState: "org" },
298
- { app: "x-mine-mf", path: "/mine/general/darkMode", level: 3, requiredState: "org" },
299
- { app: "x-mine-mf", path: "/mine/general/language", level: 3, requiredState: "org" },
300
- { app: "x-app-mf", path: "/app/manager", level: 1, requiredState: "org", mainActive: 2 },
301
- { app: "x-app-mf", path: "/app/editor", level: 2, requiredState: "org" },
302
- { app: "x-asset-mf", path: "/asset", level: 1, requiredState: "org", mainActive: 2 },
303
- { app: "x-calc-mf", path: "/calc", level: 1, requiredState: "org", mainActive: 2 },
304
- { app: "x-data-mf", path: "/data", level: 1, requiredState: "org", mainActive: 2 }
288
+ {
289
+ app: "x-passport-mf",
290
+ path: "/passport/login",
291
+ level: 0
292
+ },
293
+ {
294
+ app: "x-passport-mf",
295
+ path: "/passport/loginAccount",
296
+ level: 1
297
+ },
298
+ {
299
+ app: "x-passport-mf",
300
+ path: "/passport/register",
301
+ level: 1
302
+ },
303
+ {
304
+ app: "x-org-mf",
305
+ path: "/org/joinOrCreate",
306
+ level: 1,
307
+ requiredState: "auth"
308
+ },
309
+ {
310
+ app: "x-org-mf",
311
+ path: "/org/manager",
312
+ level: 1,
313
+ requiredState: "org",
314
+ mainActive: 2
315
+ },
316
+ {
317
+ app: "x-main-mf",
318
+ path: "/main",
319
+ level: 0,
320
+ requiredState: "org"
321
+ },
322
+ {
323
+ app: "x-mine-mf",
324
+ path: "/mine/personalInfo",
325
+ level: 1,
326
+ requiredState: "org",
327
+ mainActive: 4
328
+ },
329
+ {
330
+ app: "x-mine-mf",
331
+ path: "/mine/accountSecurity",
332
+ level: 2,
333
+ requiredState: "org"
334
+ },
335
+ {
336
+ app: "x-mine-mf",
337
+ path: "/mine/settings",
338
+ level: 1,
339
+ requiredState: "org",
340
+ mainActive: 4
341
+ },
342
+ {
343
+ app: "x-mine-mf",
344
+ path: "/mine/general",
345
+ level: 2,
346
+ requiredState: "org"
347
+ },
348
+ {
349
+ app: "x-mine-mf",
350
+ path: "/mine/general/darkMode",
351
+ level: 3,
352
+ requiredState: "org"
353
+ },
354
+ {
355
+ app: "x-mine-mf",
356
+ path: "/mine/general/language",
357
+ level: 3,
358
+ requiredState: "org"
359
+ },
360
+ {
361
+ app: "x-app-mf",
362
+ path: "/app/manager",
363
+ level: 1,
364
+ requiredState: "org",
365
+ mainActive: 2
366
+ },
367
+ {
368
+ app: "x-app-mf",
369
+ path: "/app/editor",
370
+ level: 2,
371
+ requiredState: "org"
372
+ },
373
+ {
374
+ app: "x-asset-mf",
375
+ path: "/asset",
376
+ level: 1,
377
+ requiredState: "org",
378
+ mainActive: 2
379
+ },
380
+ {
381
+ app: "x-calc-mf",
382
+ path: "/calc",
383
+ level: 1,
384
+ requiredState: "org",
385
+ mainActive: 2
386
+ },
387
+ {
388
+ app: "x-data-mf",
389
+ path: "/data",
390
+ level: 1,
391
+ requiredState: "org",
392
+ mainActive: 2
393
+ }
305
394
  ];
306
- function F(e) {
395
+ function z(e) {
307
396
  let a, t = 0;
308
397
  const l = e.split("/").filter((o) => o.trim() !== "");
309
398
  return Be.forEach((o) => {
@@ -314,30 +403,23 @@ function F(e) {
314
403
  r > 0 && r >= t && (a = o, t = r);
315
404
  }), a;
316
405
  }
317
- function oe(e) {
318
- const { lastAppPath: a } = Y();
319
- if (e === "/" && (e = a), e === "/")
320
- return { app: "", path: "/", level: -1 };
321
- const t = F(e);
322
- console.assert(t, "invalid route meta");
323
- const l = e.split("/");
324
- return console.assert(l.length >= 2), { app: l[1], path: t.path, level: t.level };
325
- }
326
- const le = f("");
406
+ const oe = i("");
327
407
  function D(e, a) {
328
- const t = oe(e), l = oe(a), o = t.app === l.app, n = t.path === l.path, r = t.level >= l.level;
408
+ const { lastAppPath: t } = Y();
409
+ e === "/" && (e = t);
410
+ const l = z(e), o = z(a), n = (l == null ? void 0 : l.app) === (o == null ? void 0 : o.app), r = (l == null ? void 0 : l.path) === (o == null ? void 0 : o.path), c = ((l == null ? void 0 : l.level) ?? -1) >= ((o == null ? void 0 : o.level) ?? -1);
329
411
  console.info(
330
- `~~~~before route change~~~~ ${l.path} -> ${t.path} inner=${o} forward=${r}`
331
- ), o ? n ? le.value = "" : le.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
412
+ `~~~~before route change~~~~ ${a} -> ${e} inner=${n} forward=${c}`
413
+ ), n ? r ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : window.routeExtras = { forward: c };
332
414
  }
333
- function Ee() {
334
- return !!B.get("accessToken");
415
+ function Re() {
416
+ return !!R.get("accessToken");
335
417
  }
336
- function Me() {
337
- return !!B.get("activeOrg");
418
+ function Ee() {
419
+ return !!R.get("activeOrg");
338
420
  }
339
- function gt(e, a, t) {
340
- const l = Ee(), o = Me(), n = F(e.path);
421
+ function ft(e, a, t) {
422
+ const l = Re(), o = Ee(), n = z(e.path);
341
423
  if (!n) {
342
424
  t();
343
425
  return;
@@ -377,7 +459,7 @@ function gt(e, a, t) {
377
459
  D(e.path, a.path), t();
378
460
  }
379
461
  function P(e, a) {
380
- const t = ce(), l = i({
462
+ const t = ne(), l = f({
381
463
  get() {
382
464
  return t.hasView(e);
383
465
  },
@@ -389,48 +471,48 @@ function P(e, a) {
389
471
  };
390
472
  return S(() => {
391
473
  s.on(e, o);
392
- }), O(() => {
474
+ }), T(() => {
393
475
  s.off(e, o);
394
476
  }), { open: l };
395
477
  }
396
- const Ue = /* @__PURE__ */ M({
478
+ const Ue = /* @__PURE__ */ U({
397
479
  __name: "index",
398
480
  setup(e) {
399
- const a = Q(), { open: t } = P("confirmDlg"), l = f(""), o = f(""), n = f(), r = f(), c = i(() => {
481
+ const a = Q(), { open: t } = P("confirmDlg"), l = i(""), o = i(""), n = i(), r = i(), c = f(() => {
400
482
  var u;
401
483
  return ((u = n.value) == null ? void 0 : u.color) ?? "primary";
402
- }), p = i(() => {
484
+ }), p = f(() => {
403
485
  var u;
404
486
  return ((u = n.value) == null ? void 0 : u.text) ?? a.t("cancel");
405
- }), _ = i(() => {
487
+ }), _ = f(() => {
406
488
  var u;
407
489
  return ((u = r.value) == null ? void 0 : u.color) ?? "primary";
408
- }), v = i(() => {
490
+ }), v = f(() => {
409
491
  var u;
410
492
  return ((u = r.value) == null ? void 0 : u.text) ?? a.t("confirm");
411
493
  });
412
494
  let y = 0, C = !1;
413
- const T = (u) => {
495
+ const j = (u) => {
414
496
  l.value = u.title, o.value = u.text, n.value = u.cancel, r.value = u.confirm, y = u.seq, C = !1, t.value = !0;
415
497
  };
416
498
  S(() => {
417
- s.on("confirmDlg", T);
418
- }), O(() => {
419
- s.off("confirmDlg", T);
499
+ s.on("confirmDlg", j);
500
+ }), T(() => {
501
+ s.off("confirmDlg", j);
420
502
  });
421
- const A = () => {
503
+ const I = () => {
422
504
  t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
423
505
  };
424
506
  return N(t, (u) => {
425
507
  !u && !C && (s.emit("confirmDlgResult" + y, !1), C = !0);
426
508
  }), (u, g) => {
427
- const b = h("v-card-text"), q = h("v-btn"), R = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
509
+ const b = h("v-card-text"), q = h("v-btn"), O = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
428
510
  return V(), E(x, {
429
- modelValue: z(t),
430
- "onUpdate:modelValue": g[1] || (g[1] = (U) => G(t) ? t.value = U : null),
511
+ modelValue: F(t),
512
+ "onUpdate:modelValue": g[1] || (g[1] = ($) => G(t) ? t.value = $ : null),
431
513
  onKeydown: [
432
- g[2] || (g[2] = L(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
433
- L(K(A, ["stop", "prevent"]), ["enter"])
514
+ g[2] || (g[2] = M(W(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
515
+ M(W(I, ["stop", "prevent"]), ["enter"])
434
516
  ],
435
517
  transition: "dialog-top-transition",
436
518
  "max-width": "600px"
@@ -440,29 +522,29 @@ const Ue = /* @__PURE__ */ M({
440
522
  default: w(() => [
441
523
  k(b, null, {
442
524
  default: w(() => [
443
- I(j(o.value), 1)
525
+ B(A(o.value), 1)
444
526
  ]),
445
527
  _: 1
446
528
  }),
447
- k(R, { class: "d-flex justify-end" }, {
529
+ k(O, { class: "d-flex justify-end" }, {
448
530
  default: w(() => [
449
531
  k(q, {
450
- onClick: g[0] || (g[0] = (U) => t.value = !1),
532
+ onClick: g[0] || (g[0] = ($) => t.value = !1),
451
533
  color: c.value,
452
534
  variant: "text"
453
535
  }, {
454
536
  default: w(() => [
455
- I(j(p.value), 1)
537
+ B(A(p.value), 1)
456
538
  ]),
457
539
  _: 1
458
540
  }, 8, ["color"]),
459
541
  k(q, {
460
- onClick: A,
542
+ onClick: I,
461
543
  color: _.value,
462
544
  variant: "text"
463
545
  }, {
464
546
  default: w(() => [
465
- I(j(v.value), 1)
547
+ B(A(v.value), 1)
466
548
  ]),
467
549
  _: 1
468
550
  }, 8, ["color"])
@@ -477,7 +559,7 @@ const Ue = /* @__PURE__ */ M({
477
559
  }, 8, ["modelValue", "onKeydown"]);
478
560
  };
479
561
  }
480
- }), $e = (e) => (me("data-v-f4ad116e"), e = e(), he(), e), Ke = /* @__PURE__ */ $e(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
562
+ }), $e = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), Ke = /* @__PURE__ */ $e(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
481
563
  /* @__PURE__ */ m("div"),
482
564
  /* @__PURE__ */ m("div"),
483
565
  /* @__PURE__ */ m("div"),
@@ -492,7 +574,7 @@ const Ue = /* @__PURE__ */ M({
492
574
  /* @__PURE__ */ m("div")
493
575
  ], -1)), We = [
494
576
  Ke
495
- ], ze = /* @__PURE__ */ M({
577
+ ], ze = /* @__PURE__ */ U({
496
578
  __name: "index",
497
579
  props: {
498
580
  zIndex: {
@@ -501,21 +583,21 @@ const Ue = /* @__PURE__ */ M({
501
583
  }
502
584
  },
503
585
  setup(e) {
504
- const a = H(), t = e, l = i(() => ({
586
+ const a = H(), t = e, l = f(() => ({
505
587
  background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
506
588
  zIndex: t.zIndex
507
589
  }));
508
590
  return (o, n) => (V(), J("div", {
509
591
  class: "x-cont",
510
- style: ve(l.value)
592
+ style: ge(l.value)
511
593
  }, We, 4));
512
594
  }
513
- }), se = (e, a) => {
595
+ }), pe = (e, a) => {
514
596
  const t = e.__vccOpts || e;
515
597
  for (const [l, o] of a)
516
598
  t[l] = o;
517
599
  return t;
518
- }, Le = /* @__PURE__ */ se(ze, [["__scopeId", "data-v-f4ad116e"]]), Fe = /* @__PURE__ */ M({
600
+ }, Le = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Fe = /* @__PURE__ */ U({
519
601
  __name: "item",
520
602
  props: {
521
603
  id: {},
@@ -525,7 +607,7 @@ const Ue = /* @__PURE__ */ M({
525
607
  },
526
608
  emits: ["timeout"],
527
609
  setup(e, { emit: a }) {
528
- const t = e, l = f(!0), o = a;
610
+ const t = e, l = i(!0), o = a;
529
611
  return S(() => {
530
612
  setTimeout(() => {
531
613
  o("timeout", t.id);
@@ -548,13 +630,13 @@ const Ue = /* @__PURE__ */ M({
548
630
  }, null, 8, ["modelValue", "type", "text"]);
549
631
  };
550
632
  }
551
- }), Ne = /* @__PURE__ */ M({
633
+ }), Me = /* @__PURE__ */ U({
552
634
  __name: "index",
553
635
  setup(e) {
554
- const a = we({ items: [] });
636
+ const a = he({ items: [] });
555
637
  S(() => {
556
638
  s.on("message", t);
557
- }), O(() => {
639
+ }), T(() => {
558
640
  s.off("message", t);
559
641
  });
560
642
  const t = (c) => {
@@ -571,11 +653,11 @@ const Ue = /* @__PURE__ */ M({
571
653
  p >= 0 && a.items.splice(p, 1);
572
654
  };
573
655
  return (c, p) => (V(), J("div", {
574
- onClick: p[0] || (p[0] = K(() => {
656
+ onClick: p[0] || (p[0] = W(() => {
575
657
  }, ["stop"])),
576
658
  class: "x-cont d-flex flex-column-reverse align-center"
577
659
  }, [
578
- (V(!0), J(xe, null, ye(a.items, (_) => (V(), E(Fe, {
660
+ (V(!0), J(we, null, xe(a.items, (_) => (V(), E(Fe, {
579
661
  onTimeout: l,
580
662
  id: _.id,
581
663
  type: _.type,
@@ -585,22 +667,22 @@ const Ue = /* @__PURE__ */ M({
585
667
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
586
668
  ]));
587
669
  }
588
- }), He = /* @__PURE__ */ se(Ne, [["__scopeId", "data-v-8c2268ea"]]), Je = /* @__PURE__ */ M({
670
+ }), Ne = /* @__PURE__ */ pe(Me, [["__scopeId", "data-v-8c2268ea"]]), He = /* @__PURE__ */ U({
589
671
  __name: "index",
590
672
  setup(e) {
591
- const a = Q(), { open: t } = P("promptDlg"), l = f(""), o = f(""), n = f(), r = f(), c = f(), p = f(""), _ = f(), v = f(), y = i(() => {
673
+ const a = Q(), { open: t } = P("promptDlg"), l = i(""), o = i(""), n = i(), r = i(), c = i(), p = i(""), _ = i(), v = i(), y = f(() => {
592
674
  var d;
593
675
  return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
594
- }), C = i(() => {
676
+ }), C = f(() => {
595
677
  var d;
596
678
  return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
597
- }), T = i(() => {
679
+ }), j = f(() => {
598
680
  var d;
599
681
  return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
600
- }), A = i(() => {
682
+ }), I = f(() => {
601
683
  var d;
602
684
  return ((d = v.value) == null ? void 0 : d.text) ?? a.t("confirm");
603
- }), u = f();
685
+ }), u = i();
604
686
  let g = 0, b = !1;
605
687
  const q = async (d) => {
606
688
  var x;
@@ -608,22 +690,22 @@ const Ue = /* @__PURE__ */ M({
608
690
  };
609
691
  S(() => {
610
692
  s.on("promptDlg", q);
611
- }), O(() => {
693
+ }), T(() => {
612
694
  s.off("promptDlg", q);
613
695
  });
614
- const R = () => {
696
+ const O = () => {
615
697
  t.value = !1, b || (s.emit("promptDlgResult" + g, p.value ?? ""), b = !0);
616
698
  };
617
699
  return N(t, (d) => {
618
700
  !d && !b && (s.emit("promptDlgResult" + g, void 0), b = !0);
619
701
  }), (d, x) => {
620
- const U = h("v-card-text"), _e = h("v-text-field"), de = h("v-form"), ee = h("v-btn"), fe = h("v-card-actions"), ie = h("v-card"), ge = h("v-dialog");
621
- return V(), E(ge, {
622
- modelValue: z(t),
623
- "onUpdate:modelValue": x[2] || (x[2] = ($) => G(t) ? t.value = $ : null),
702
+ const $ = h("v-card-text"), se = h("v-text-field"), _e = h("v-form"), ee = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
703
+ return V(), E(fe, {
704
+ modelValue: F(t),
705
+ "onUpdate:modelValue": x[2] || (x[2] = (K) => G(t) ? t.value = K : null),
624
706
  onKeydown: [
625
- x[3] || (x[3] = L(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
626
- L(K(R, ["stop", "prevent"]), ["enter"])
707
+ x[3] || (x[3] = M(W((K) => t.value = !1, ["stop", "prevent"]), ["esc"])),
708
+ M(W(O, ["stop", "prevent"]), ["enter"])
627
709
  ],
628
710
  transition: "dialog-top-transition",
629
711
  "max-width": "600px"
@@ -631,17 +713,17 @@ const Ue = /* @__PURE__ */ M({
631
713
  default: w(() => [
632
714
  k(ie, { title: l.value }, {
633
715
  default: w(() => [
634
- o.value ? (V(), E(U, { key: 0 }, {
716
+ o.value ? (V(), E($, { key: 0 }, {
635
717
  default: w(() => [
636
- I(j(o.value), 1)
718
+ B(A(o.value), 1)
637
719
  ]),
638
720
  _: 1
639
- })) : ke("", !0),
640
- k(de, { class: "mx-3" }, {
721
+ })) : ye("", !0),
722
+ k(_e, { class: "mx-3" }, {
641
723
  default: w(() => [
642
- k(_e, {
724
+ k(se, {
643
725
  modelValue: p.value,
644
- "onUpdate:modelValue": x[0] || (x[0] = ($) => p.value = $),
726
+ "onUpdate:modelValue": x[0] || (x[0] = (K) => p.value = K),
645
727
  label: n.value,
646
728
  placeholder: r.value,
647
729
  rules: c.value,
@@ -651,25 +733,25 @@ const Ue = /* @__PURE__ */ M({
651
733
  ]),
652
734
  _: 1
653
735
  }),
654
- k(fe, { class: "d-flex justify-end" }, {
736
+ k(de, { class: "d-flex justify-end" }, {
655
737
  default: w(() => [
656
738
  k(ee, {
657
- onClick: x[1] || (x[1] = ($) => t.value = !1),
739
+ onClick: x[1] || (x[1] = (K) => t.value = !1),
658
740
  color: y.value,
659
741
  variant: "text"
660
742
  }, {
661
743
  default: w(() => [
662
- I(j(C.value), 1)
744
+ B(A(C.value), 1)
663
745
  ]),
664
746
  _: 1
665
747
  }, 8, ["color"]),
666
748
  k(ee, {
667
- onClick: R,
668
- color: T.value,
749
+ onClick: O,
750
+ color: j.value,
669
751
  variant: "text"
670
752
  }, {
671
753
  default: w(() => [
672
- I(j(A.value), 1)
754
+ B(A(I.value), 1)
673
755
  ]),
674
756
  _: 1
675
757
  }, 8, ["color"])
@@ -684,7 +766,7 @@ const Ue = /* @__PURE__ */ M({
684
766
  }, 8, ["modelValue", "onKeydown"]);
685
767
  };
686
768
  }
687
- }), Xe = { class: "mx-auto my-auto" }, Ge = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ M({
769
+ }), Je = { class: "mx-auto my-auto" }, Xe = { class: "d-flex align-center justify-center w-100 h-100" }, Ge = /* @__PURE__ */ U({
688
770
  __name: "index",
689
771
  setup(e) {
690
772
  const a = Q(), { open: t } = P("waitDlg"), l = () => {
@@ -694,27 +776,27 @@ const Ue = /* @__PURE__ */ M({
694
776
  };
695
777
  return S(() => {
696
778
  s.on("openWaitDlg", l), s.on("closeWaitDlg", o);
697
- }), O(() => {
779
+ }), T(() => {
698
780
  s.off("openWaitDlg", l), s.off("closeWaitDlg", o);
699
781
  }), (n, r) => {
700
782
  const c = h("v-card"), p = h("v-dialog");
701
783
  return V(), E(p, {
702
- modelValue: z(t),
784
+ modelValue: F(t),
703
785
  "onUpdate:modelValue": r[0] || (r[0] = (_) => G(t) ? t.value = _ : null),
704
786
  persistent: "",
705
787
  "no-click-animation": "",
706
788
  fullscreen: ""
707
789
  }, {
708
790
  default: w(() => [
709
- m("div", Xe, [
791
+ m("div", Je, [
710
792
  k(c, {
711
793
  width: "300px",
712
794
  height: "80px",
713
795
  loading: ""
714
796
  }, {
715
797
  default: w(() => [
716
- m("div", Ge, [
717
- m("span", null, j(z(a).t("waitingResponse")), 1)
798
+ m("div", Xe, [
799
+ m("span", null, A(F(a).t("waitingResponse")), 1)
718
800
  ])
719
801
  ]),
720
802
  _: 1
@@ -725,11 +807,11 @@ const Ue = /* @__PURE__ */ M({
725
807
  }, 8, ["modelValue"]);
726
808
  };
727
809
  }
728
- }), Ye = (e) => {
729
- e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message", He), e.component("x-prompt-dlg", Je), e.component("x-wait-dlg", Qe);
810
+ }), Qe = (e) => {
811
+ e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message", Ne), e.component("x-prompt-dlg", He), e.component("x-wait-dlg", Ge);
730
812
  };
731
- function vt() {
732
- const e = H(), a = i(() => e.global.current.value.colors.primary), t = i(() => e.global.current.value.colors.secondary), l = i(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = i(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = i(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = i(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = i(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
813
+ function gt() {
814
+ const e = H(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), l = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
733
815
  return {
734
816
  primaryColor: a,
735
817
  secondaryColor: t,
@@ -740,11 +822,11 @@ function vt() {
740
822
  borderColor: c
741
823
  };
742
824
  }
743
- function Ze(e, a) {
825
+ function Ye(e, a) {
744
826
  return e.post("pullPermission", a);
745
827
  }
746
- function mt(e, a) {
747
- const t = De(), l = ne(), o = Y(), n = ce();
828
+ function vt(e, a) {
829
+ const t = Ce(), l = re(), o = Y(), n = ne();
748
830
  let r = !0;
749
831
  const c = () => {
750
832
  r = !1;
@@ -756,7 +838,7 @@ function mt(e, a) {
756
838
  n.hasView("waitDlg") || n.popView();
757
839
  return;
758
840
  }
759
- const u = F(t.path);
841
+ const u = z(t.path);
760
842
  (u == null ? void 0 : u.level) === 0 ? (g = navigator == null ? void 0 : navigator.Backbutton) == null || g.goHome(
761
843
  () => {
762
844
  },
@@ -766,7 +848,7 @@ function mt(e, a) {
766
848
  };
767
849
  S(() => {
768
850
  s.on("pause", c), s.on("resume", p), s.on("backbutton", _);
769
- }), O(() => {
851
+ }), T(() => {
770
852
  s.off("pause", c), s.off("resume", p), s.off("backbutton", _);
771
853
  });
772
854
  const v = (u) => {
@@ -785,46 +867,46 @@ function mt(e, a) {
785
867
  };
786
868
  S(() => {
787
869
  window.addEventListener("keydown", v);
788
- }), O(() => {
870
+ }), T(() => {
789
871
  window.removeEventListener("keydown", v);
790
872
  });
791
873
  let y;
792
874
  const C = async () => {
793
875
  if (!r)
794
876
  return;
795
- const u = F(t.path);
877
+ const u = z(t.path);
796
878
  if (!(!u || u.requiredState !== "org"))
797
879
  try {
798
- const { update: g, permissions: b } = await Ze(a, {
880
+ const { update: g, permissions: b } = await Ye(a, {
799
881
  checksum: o.permissionChecksum
800
882
  });
801
883
  if (!g)
802
884
  return;
803
885
  const q = {};
804
- for (const R in b) {
805
- if (R === "checksum")
886
+ for (const O in b) {
887
+ if (O === "checksum")
806
888
  continue;
807
- const d = b[R];
808
- q[R] = JSON.parse(d);
889
+ const d = b[O];
890
+ q[O] = JSON.parse(d);
809
891
  }
810
892
  o.permissionObjects = q, o.permissionChecksum = b.checksum ?? "";
811
893
  } catch (g) {
812
894
  console.error(g);
813
895
  }
814
- }, T = async (u) => {
896
+ }, j = async (u) => {
815
897
  u && await C(), clearTimeout(y), y = setTimeout(async () => {
816
- await C(), y && T();
898
+ await C(), y && j();
817
899
  }, 3e3);
818
- }, A = () => {
900
+ }, I = () => {
819
901
  clearTimeout(y), y = void 0;
820
902
  };
821
903
  S(() => {
822
- a && T(!0);
823
- }), O(() => {
824
- A();
904
+ a && j(!0);
905
+ }), T(() => {
906
+ I();
825
907
  });
826
908
  }
827
- function ht() {
909
+ function mt() {
828
910
  const e = Y();
829
911
  function a(t, l) {
830
912
  const o = e.permissionObjects[t];
@@ -832,36 +914,36 @@ function ht() {
832
914
  }
833
915
  return { verifyPermission: a };
834
916
  }
835
- function wt() {
836
- const e = H(), a = be(), t = i(() => e.current.value.dark), l = i(() => !!window.cordova), o = i(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
917
+ function ht() {
918
+ const e = H(), a = ke(), t = f(() => e.current.value.dark), l = f(() => !!window.cordova), o = f(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
837
919
  return { dark: t, sysBarAvail: l, compactWidth: o };
838
920
  }
839
- const xt = { install: Ye };
921
+ const wt = { install: Qe };
840
922
  export {
841
923
  Ie as Permission,
842
- nt as appAppear,
843
- st as closeWaitDlg,
844
- lt as createAxios,
845
- xt as default,
924
+ rt as appAppear,
925
+ pt as closeWaitDlg,
926
+ ot as createAxios,
927
+ wt as default,
846
928
  s as eventBus,
847
929
  ae as isExist,
848
- F as matchRouteMeta,
849
- _t as messageError,
850
- dt as messageInfo,
851
- ft as messageSuccess,
930
+ z as matchRouteMeta,
931
+ st as messageError,
932
+ _t as messageInfo,
933
+ dt as messageSuccess,
852
934
  it as messageWarning,
853
- gt as onBeforeEach,
854
- ct as openConfirmDlg,
855
- ut as openPromptDlg,
856
- pt as openWaitDlg,
857
- le as routeTransName,
858
- vt as useColor,
935
+ ft as onBeforeEach,
936
+ nt as openConfirmDlg,
937
+ ct as openPromptDlg,
938
+ ut as openWaitDlg,
939
+ oe as routeTransName,
940
+ gt as useColor,
859
941
  Y as useGlobalStore,
860
- mt as useMicroApp,
861
- ht as usePermission,
862
- wt as useSystem,
863
- ce as useViewMgrStore,
942
+ vt as useMicroApp,
943
+ mt as usePermission,
944
+ ht as useSystem,
945
+ ne as useViewMgrStore,
864
946
  P as useViewStack,
865
- rt as waitMs,
947
+ lt as waitMs,
866
948
  Z as waitUtil
867
949
  };
@@ -1,10 +1,9 @@
1
1
  import { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
2
- type RequiredState = 'auth' | 'org';
3
2
  interface RouteMeta {
4
3
  app: 'x-app-mf' | 'x-asset-mf' | 'x-calc-mf' | 'x-data-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf';
5
4
  path: string;
6
5
  level: number;
7
- requiredState?: RequiredState;
6
+ requiredState?: 'auth' | 'org';
8
7
  mainActive?: 2 | 3 | 4;
9
8
  }
10
9
  export declare function matchRouteMeta(path: string): RouteMeta | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.28",
4
+ "version": "0.5.30",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",