x-essential-lib 0.3.5 → 0.3.6

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.
Files changed (2) hide show
  1. package/dist/index.js +126 -137
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
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 ge, VBtn as he, VCard as _e, VCardActions as xe, VCardText as ye, VCardTitle as we, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
3
- import { ref as m, computed as f, onMounted as S, onBeforeUnmount as R, defineComponent as T, watch as E, resolveComponent as v, openBlock as V, createBlock as A, unref as W, isRef as F, withKeys as H, withModifiers as $, withCtx as g, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as z, normalizeStyle as Ve, pushScopeId as De, popScopeId as qe, createElementVNode as h, reactive as Se, Fragment as Re, renderList as Te } from "vue";
3
+ import { ref as m, computed as f, onMounted as S, onBeforeUnmount as R, defineComponent as T, watch as H, 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 Ve, pushScopeId as De, popScopeId as qe, createElementVNode as h, reactive as Se, Fragment as Re, renderList as Te } from "vue";
4
4
  import { useLocale as X, useTheme as K, useDisplay as Oe } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as oe } from "pinia";
6
- import { useRouter as re, useRoute as Ie } from "vue-router";
7
- import { useI18n as Pe } from "vue-i18n";
6
+ import { useRouter as re, useRoute as Pe } from "vue-router";
8
7
  import je from "axios";
9
8
  const le = oe("viewMgr", () => {
10
9
  const e = m([]);
@@ -26,7 +25,7 @@ const le = oe("viewMgr", () => {
26
25
  }
27
26
  return { isEmpty: n, hasView: t, addView: o, delView: r, popView: a };
28
27
  });
29
- function Ee(e) {
28
+ function Ie(e) {
30
29
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
31
30
  var o = e.get(n);
32
31
  o ? o.push(t) : e.set(n, [t]);
@@ -42,8 +41,8 @@ function Ee(e) {
42
41
  });
43
42
  } };
44
43
  }
45
- const c = Ee();
46
- async function ft(e) {
44
+ const c = Ie();
45
+ async function dt(e) {
47
46
  return new Promise((n) => {
48
47
  setTimeout(n, e);
49
48
  });
@@ -74,7 +73,7 @@ function J(e, n) {
74
73
  c.off(e, r);
75
74
  }), { open: o };
76
75
  }
77
- const $e = /* @__PURE__ */ T({
76
+ const Ee = /* @__PURE__ */ T({
78
77
  __name: "index",
79
78
  setup(e) {
80
79
  const n = X(), { open: t } = J("confirmDlg"), o = m(""), r = m(""), a = m(), l = m(), s = f(() => {
@@ -91,27 +90,27 @@ const $e = /* @__PURE__ */ T({
91
90
  return ((d = l.value) == null ? void 0 : d.text) ?? n.t("confirm");
92
91
  });
93
92
  let O = 0, D = !1;
94
- const M = (d) => {
93
+ const A = (d) => {
95
94
  o.value = d.title, r.value = d.text, a.value = d.cancel, l.value = d.confirm, O = d.seq, D = !1, t.value = !0;
96
95
  };
97
96
  S(() => {
98
- c.on("confirmDlg", M);
97
+ c.on("confirmDlg", A);
99
98
  }), R(() => {
100
- c.off("confirmDlg", M);
99
+ c.off("confirmDlg", A);
101
100
  });
102
- const B = () => {
101
+ const M = () => {
103
102
  t.value = !1, D || (c.emit("confirmDlgResult" + O, !0), D = !0);
104
103
  };
105
- return E(t, (d) => {
104
+ return H(t, (d) => {
106
105
  !d && !D && (c.emit("confirmDlgResult" + O, !1), D = !0);
107
106
  }), (d, w) => {
108
- const q = v("v-card-title"), L = v("v-card-text"), I = v("v-btn"), u = v("v-card-actions"), x = v("v-card"), N = v("v-dialog");
109
- return V(), A(N, {
110
- modelValue: W(t),
111
- "onUpdate:modelValue": w[1] || (w[1] = (P) => F(t) ? t.value = P : null),
107
+ const q = v("v-card-title"), B = v("v-card-text"), P = v("v-btn"), u = v("v-card-actions"), x = v("v-card"), N = v("v-dialog");
108
+ return V(), $(N, {
109
+ modelValue: U(t),
110
+ "onUpdate:modelValue": w[1] || (w[1] = (j) => F(t) ? t.value = j : null),
112
111
  onKeydown: [
113
- w[2] || (w[2] = H($((P) => t.value = !1, ["stop", "prevent"]), ["esc"])),
114
- H($(B, ["stop", "prevent"]), ["enter"])
112
+ w[2] || (w[2] = W(E((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
+ W(E(M, ["stop", "prevent"]), ["enter"])
115
114
  ],
116
115
  transition: "dialog-top-transition",
117
116
  "max-width": "600px"
@@ -125,7 +124,7 @@ const $e = /* @__PURE__ */ T({
125
124
  ]),
126
125
  _: 1
127
126
  }),
128
- _(L, null, {
127
+ _(B, null, {
129
128
  default: g(() => [
130
129
  C(b(r.value), 1)
131
130
  ]),
@@ -133,8 +132,8 @@ const $e = /* @__PURE__ */ T({
133
132
  }),
134
133
  _(u, { class: "d-flex justify-end" }, {
135
134
  default: g(() => [
136
- _(I, {
137
- onClick: w[0] || (w[0] = (P) => t.value = !1),
135
+ _(P, {
136
+ onClick: w[0] || (w[0] = (j) => t.value = !1),
138
137
  color: s.value,
139
138
  variant: "text"
140
139
  }, {
@@ -143,8 +142,8 @@ const $e = /* @__PURE__ */ T({
143
142
  ]),
144
143
  _: 1
145
144
  }, 8, ["color"]),
146
- _(I, {
147
- onClick: B,
145
+ _(P, {
146
+ onClick: M,
148
147
  color: i.value,
149
148
  variant: "text"
150
149
  }, {
@@ -164,7 +163,7 @@ const $e = /* @__PURE__ */ T({
164
163
  }, 8, ["modelValue", "onKeydown"]);
165
164
  };
166
165
  }
167
- }), Ae = (e) => (De("data-v-a8f3d91f"), e = e(), qe(), e), Me = /* @__PURE__ */ Ae(() => /* @__PURE__ */ h("div", { class: "lds-spinner" }, [
166
+ }), $e = (e) => (De("data-v-a8f3d91f"), e = e(), qe(), e), Ae = /* @__PURE__ */ $e(() => /* @__PURE__ */ h("div", { class: "lds-spinner" }, [
168
167
  /* @__PURE__ */ h("div"),
169
168
  /* @__PURE__ */ h("div"),
170
169
  /* @__PURE__ */ h("div"),
@@ -177,9 +176,9 @@ const $e = /* @__PURE__ */ T({
177
176
  /* @__PURE__ */ h("div"),
178
177
  /* @__PURE__ */ h("div"),
179
178
  /* @__PURE__ */ h("div")
180
- ], -1)), Be = [
181
- Me
182
- ], Le = /* @__PURE__ */ T({
179
+ ], -1)), Me = [
180
+ Ae
181
+ ], Be = /* @__PURE__ */ T({
183
182
  __name: "index",
184
183
  props: {
185
184
  zIndex: {
@@ -195,14 +194,14 @@ const $e = /* @__PURE__ */ T({
195
194
  return (r, a) => (V(), z("div", {
196
195
  class: "x-cont",
197
196
  style: Ve(o.value)
198
- }, Be, 4));
197
+ }, Me, 4));
199
198
  }
200
199
  }), ae = (e, n) => {
201
200
  const t = e.__vccOpts || e;
202
201
  for (const [o, r] of n)
203
202
  t[o] = r;
204
203
  return t;
205
- }, Ue = /* @__PURE__ */ ae(Le, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ T({
204
+ }, Le = /* @__PURE__ */ ae(Be, [["__scopeId", "data-v-a8f3d91f"]]), Ue = /* @__PURE__ */ T({
206
205
  __name: "item",
207
206
  props: {
208
207
  id: {
@@ -246,11 +245,11 @@ const $e = /* @__PURE__ */ T({
246
245
  setTimeout(() => {
247
246
  r("timeout", t.id);
248
247
  }, t.timeout);
249
- }), E(o, (l) => {
248
+ }), H(o, (l) => {
250
249
  l || r("timeout", t.id);
251
250
  }), (l, s) => {
252
251
  const p = v("v-alert");
253
- return V(), A(p, {
252
+ return V(), $(p, {
254
253
  modelValue: o.value,
255
254
  "onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i),
256
255
  class: "mt-2",
@@ -265,7 +264,7 @@ const $e = /* @__PURE__ */ T({
265
264
  }, null, 8, ["modelValue", "type", "icon", "text"]);
266
265
  };
267
266
  }
268
- }), He = /* @__PURE__ */ T({
267
+ }), We = /* @__PURE__ */ T({
269
268
  __name: "index",
270
269
  setup(e) {
271
270
  const n = Se({ items: [] });
@@ -288,11 +287,11 @@ const $e = /* @__PURE__ */ T({
288
287
  p >= 0 && n.items.splice(p, 1);
289
288
  };
290
289
  return (s, p) => (V(), z("div", {
291
- onClick: p[0] || (p[0] = $(() => {
290
+ onClick: p[0] || (p[0] = E(() => {
292
291
  }, ["stop"])),
293
292
  class: "x-cont d-flex flex-column-reverse align-center"
294
293
  }, [
295
- (V(!0), z(Re, null, Te(n.items, (i) => (V(), A(We, {
294
+ (V(!0), z(Re, null, Te(n.items, (i) => (V(), $(Ue, {
296
295
  onTimeout: o,
297
296
  id: i.id,
298
297
  type: i.type,
@@ -302,7 +301,7 @@ const $e = /* @__PURE__ */ T({
302
301
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
303
302
  ]));
304
303
  }
305
- }), Ke = /* @__PURE__ */ ae(He, [["__scopeId", "data-v-70ed4b89"]]), Ne = /* @__PURE__ */ T({
304
+ }), He = /* @__PURE__ */ ae(We, [["__scopeId", "data-v-70ed4b89"]]), Ke = /* @__PURE__ */ T({
306
305
  __name: "index",
307
306
  setup(e) {
308
307
  const n = X(), { open: t } = J("promptDlg"), o = m(""), r = m(""), a = m(), l = m(), s = m(), p = m(""), i = m(), y = m(), O = f(() => {
@@ -311,36 +310,36 @@ const $e = /* @__PURE__ */ T({
311
310
  }), D = f(() => {
312
311
  var u;
313
312
  return ((u = i.value) == null ? void 0 : u.text) ?? n.t("cancel");
314
- }), M = f(() => {
313
+ }), A = f(() => {
315
314
  var u;
316
315
  return ((u = y.value) == null ? void 0 : u.color) ?? "primary";
317
- }), B = f(() => {
316
+ }), M = f(() => {
318
317
  var u;
319
318
  return ((u = y.value) == null ? void 0 : u.text) ?? n.t("confirm");
320
319
  }), d = m();
321
320
  let w = 0, q = !1;
322
- const L = async (u) => {
321
+ const B = async (u) => {
323
322
  var x;
324
323
  o.value = u.title, r.value = u.text, a.value = u.label, l.value = u.placeholder, s.value = u.rules, p.value = u.value, i.value = u.cancel, y.value = u.confirm, w = u.seq, q = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (x = d.value) == null || x.focus();
325
324
  };
326
325
  S(() => {
327
- c.on("promptDlg", L);
326
+ c.on("promptDlg", B);
328
327
  }), R(() => {
329
- c.off("promptDlg", L);
328
+ c.off("promptDlg", B);
330
329
  });
331
- const I = () => {
330
+ const P = () => {
332
331
  t.value = !1, q || (c.emit("promptDlgResult" + w, p.value ?? ""), q = !0);
333
332
  };
334
- return E(t, (u) => {
333
+ return H(t, (u) => {
335
334
  !u && !q && (c.emit("promptDlgResult" + w, void 0), q = !0);
336
335
  }), (u, x) => {
337
- const N = v("v-card-title"), P = v("v-card-text"), de = v("v-text-field"), pe = v("v-form"), Y = v("v-btn"), fe = v("v-card-actions"), me = v("v-card"), ve = v("v-dialog");
338
- return V(), A(ve, {
339
- modelValue: W(t),
340
- "onUpdate:modelValue": x[2] || (x[2] = (j) => F(t) ? t.value = j : null),
336
+ const N = v("v-card-title"), j = v("v-card-text"), de = v("v-text-field"), pe = v("v-form"), Y = v("v-btn"), fe = v("v-card-actions"), me = v("v-card"), ve = v("v-dialog");
337
+ return V(), $(ve, {
338
+ modelValue: U(t),
339
+ "onUpdate:modelValue": x[2] || (x[2] = (I) => F(t) ? t.value = I : null),
341
340
  onKeydown: [
342
- x[3] || (x[3] = H($((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
343
- H($(I, ["stop", "prevent"]), ["enter"])
341
+ x[3] || (x[3] = W(E((I) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
+ W(E(P, ["stop", "prevent"]), ["enter"])
344
343
  ],
345
344
  transition: "dialog-top-transition",
346
345
  "max-width": "600px"
@@ -354,7 +353,7 @@ const $e = /* @__PURE__ */ T({
354
353
  ]),
355
354
  _: 1
356
355
  }),
357
- _(P, null, {
356
+ _(j, null, {
358
357
  default: g(() => [
359
358
  C(b(r.value), 1)
360
359
  ]),
@@ -364,7 +363,7 @@ const $e = /* @__PURE__ */ T({
364
363
  default: g(() => [
365
364
  _(de, {
366
365
  modelValue: p.value,
367
- "onUpdate:modelValue": x[0] || (x[0] = (j) => p.value = j),
366
+ "onUpdate:modelValue": x[0] || (x[0] = (I) => p.value = I),
368
367
  label: a.value,
369
368
  placeholder: l.value,
370
369
  rules: s.value,
@@ -377,7 +376,7 @@ const $e = /* @__PURE__ */ T({
377
376
  _(fe, { class: "d-flex justify-end" }, {
378
377
  default: g(() => [
379
378
  _(Y, {
380
- onClick: x[1] || (x[1] = (j) => t.value = !1),
379
+ onClick: x[1] || (x[1] = (I) => t.value = !1),
381
380
  color: O.value,
382
381
  variant: "text"
383
382
  }, {
@@ -387,12 +386,12 @@ const $e = /* @__PURE__ */ T({
387
386
  _: 1
388
387
  }, 8, ["color"]),
389
388
  _(Y, {
390
- onClick: I,
391
- color: M.value,
389
+ onClick: P,
390
+ color: A.value,
392
391
  variant: "text"
393
392
  }, {
394
393
  default: g(() => [
395
- C(b(B.value), 1)
394
+ C(b(M.value), 1)
396
395
  ]),
397
396
  _: 1
398
397
  }, 8, ["color"])
@@ -407,7 +406,7 @@ const $e = /* @__PURE__ */ T({
407
406
  }, 8, ["modelValue", "onKeydown"]);
408
407
  };
409
408
  }
410
- }), ze = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Xe = /* @__PURE__ */ T({
409
+ }), Ne = { class: "mx-auto my-auto" }, ze = { class: "d-flex align-center justify-center w-100 h-100" }, Fe = /* @__PURE__ */ T({
411
410
  __name: "index",
412
411
  setup(e) {
413
412
  const n = X(), { open: t } = J("waitDlg"), o = () => {
@@ -421,23 +420,23 @@ const $e = /* @__PURE__ */ T({
421
420
  c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
422
421
  }), (a, l) => {
423
422
  const s = v("v-card"), p = v("v-dialog");
424
- return V(), A(p, {
425
- modelValue: W(t),
423
+ return V(), $(p, {
424
+ modelValue: U(t),
426
425
  "onUpdate:modelValue": l[0] || (l[0] = (i) => F(t) ? t.value = i : null),
427
426
  persistent: "",
428
427
  "no-click-animation": "",
429
428
  fullscreen: ""
430
429
  }, {
431
430
  default: g(() => [
432
- h("div", ze, [
431
+ h("div", Ne, [
433
432
  _(s, {
434
433
  width: "300px",
435
434
  height: "80px",
436
435
  loading: ""
437
436
  }, {
438
437
  default: g(() => [
439
- h("div", Fe, [
440
- h("span", null, b(W(n).t("waitingResponse")), 1)
438
+ h("div", ze, [
439
+ h("span", null, b(U(n).t("waitingResponse")), 1)
441
440
  ])
442
441
  ]),
443
442
  _: 1
@@ -448,10 +447,10 @@ const $e = /* @__PURE__ */ T({
448
447
  }, 8, ["modelValue"]);
449
448
  };
450
449
  }
451
- }), Ge = (e) => {
452
- e.component("v-alert", ge), e.component("v-btn", he), e.component("v-card", _e), e.component("v-card-actions", xe), e.component("v-card-text", ye), e.component("v-card-title", we), 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", Ke), e.component("x-prompt-dlg", Ne), e.component("x-wait-dlg", Xe);
450
+ }), Xe = (e) => {
451
+ e.component("v-alert", ge), e.component("v-btn", he), e.component("v-card", _e), e.component("v-card-actions", xe), e.component("v-card-text", ye), e.component("v-card-title", we), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", Ee), e.component("x-loading", Le), e.component("x-message", He), e.component("x-prompt-dlg", Ke), e.component("x-wait-dlg", Fe);
453
452
  };
454
- function mt() {
453
+ function pt() {
455
454
  const e = K(), 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"), a = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
456
455
  return {
457
456
  primaryColor: n,
@@ -463,31 +462,21 @@ function mt() {
463
462
  borderColor: s
464
463
  };
465
464
  }
466
- const Je = oe(
465
+ const Ge = oe(
467
466
  "global",
468
467
  () => {
469
- const e = K(), n = Pe(), t = m(!1);
470
- E(
471
- t,
472
- (l) => {
473
- e.global.name.value = l ? "dark" : "light";
474
- },
475
- {
476
- immediate: !0
477
- }
478
- );
479
- const o = m("en");
480
- E(
481
- o,
482
- (l) => {
483
- n.locale.value = l;
468
+ const e = K(), n = m(!1);
469
+ H(
470
+ n,
471
+ (a) => {
472
+ e.global.name.value = a ? "dark" : "light";
484
473
  },
485
474
  {
486
475
  immediate: !0
487
476
  }
488
477
  );
489
- const r = m({}), a = m("");
490
- return { dark: t, locale: o, permissionObjects: r, permissionChecksum: a };
478
+ const t = m("en"), o = m({}), r = m("");
479
+ return { dark: n, locale: t, permissionObjects: o, permissionChecksum: r };
491
480
  },
492
481
  {
493
482
  persist: [
@@ -497,56 +486,56 @@ const Je = oe(
497
486
  }
498
487
  ]
499
488
  }
500
- ), U = require("js-cookie");
501
- function vt(e) {
489
+ ), L = require("js-cookie");
490
+ function ft(e) {
502
491
  const n = je.create({
503
492
  timeout: 6e3
504
493
  });
505
494
  return n.defaults.baseURL = e.baseUrl, n.interceptors.request.use(
506
- (t) => Qe(t),
495
+ (t) => Je(t),
507
496
  (t) => {
508
- Ye(t, e.onError);
497
+ Qe(t, e.onError);
509
498
  }
510
499
  ), n.interceptors.response.use(
511
- (t) => Ze(t),
512
- (t) => et(t, e.onError)
500
+ (t) => Ye(t),
501
+ (t) => Ze(t, e.onError)
513
502
  ), n;
514
503
  }
515
- function Qe(e) {
516
- const n = U.get("accessToken") ?? "";
504
+ function Je(e) {
505
+ const n = L.get("accessToken") ?? "";
517
506
  return e.headers.Authorization = "Basic " + n, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
518
507
  }
519
- function Ye(e, n) {
508
+ function Qe(e, n) {
520
509
  console.error(e), n("request timeout");
521
510
  }
522
- function Ze(e) {
511
+ function Ye(e) {
523
512
  return e.data;
524
513
  }
525
- function et(e, n) {
514
+ function Ze(e, n) {
526
515
  var r;
527
516
  const t = e.response;
528
517
  if (!t)
529
518
  return Promise.reject(e);
530
- t.status === 401 && tt();
519
+ t.status === 401 && et();
531
520
  let o = (r = t.data) == null ? void 0 : r.message;
532
521
  return o || (o = {
533
522
  code: t.status,
534
523
  message: t.statusText
535
524
  }), n(o), Promise.reject(e);
536
525
  }
537
- function tt() {
538
- U.remove("accessToken"), U.remove("refreshToken"), U.remove("activeOrg"), re().replace({ path: "/passport/login" });
526
+ function et() {
527
+ L.remove("accessToken"), L.remove("refreshToken"), L.remove("activeOrg"), re().replace({ path: "/passport/login" });
539
528
  }
540
529
  let Z = Date.now();
541
530
  function se() {
542
531
  const e = Date.now();
543
532
  return e - Z > 500 ? (Z = e, !0) : !1;
544
533
  }
545
- let nt = 0;
534
+ let tt = 0;
546
535
  function ie() {
547
- return ++nt;
536
+ return ++tt;
548
537
  }
549
- async function gt(e) {
538
+ async function mt(e) {
550
539
  if (!se())
551
540
  return;
552
541
  let n = !1, t;
@@ -555,7 +544,7 @@ async function gt(e) {
555
544
  }, r = ie();
556
545
  return c.on("confirmDlgResult" + r, o), c.emit("confirmDlg", { ...e, seq: r }), await G(() => n), c.off("confirmDlgResult" + r, o), t;
557
546
  }
558
- async function ht(e) {
547
+ async function vt(e) {
559
548
  if (!se())
560
549
  return;
561
550
  let n = !1, t;
@@ -564,25 +553,25 @@ async function ht(e) {
564
553
  }, r = ie();
565
554
  return c.on("promptDlgResult" + r, o), c.emit("promptDlg", { ...e, seq: r }), await G(() => n), c.off("promptDlgResult" + r, o), t;
566
555
  }
567
- function _t() {
556
+ function gt() {
568
557
  c.emit("openWaitDlg");
569
558
  }
570
- function xt() {
559
+ function ht() {
571
560
  c.emit("closeWaitDlg");
572
561
  }
573
- function yt(e, n) {
562
+ function _t(e, n) {
574
563
  c.emit("message", { type: "error", text: e, timeout: n });
575
564
  }
576
- function wt(e, n) {
565
+ function xt(e, n) {
577
566
  c.emit("message", { type: "info", text: e, timeout: n });
578
567
  }
579
- function kt(e, n) {
568
+ function yt(e, n) {
580
569
  c.emit("message", { type: "success", text: e, timeout: n });
581
570
  }
582
- function bt(e, n) {
571
+ function wt(e, n) {
583
572
  c.emit("message", { type: "warning", text: e, timeout: n });
584
573
  }
585
- function Ct(e) {
574
+ function kt(e) {
586
575
  var o, r;
587
576
  if (!window.appAppear) {
588
577
  window.appAppear = !0;
@@ -594,7 +583,7 @@ function Ct(e) {
594
583
  }, 0));
595
584
  }
596
585
  let ce = {};
597
- function Vt(e) {
586
+ function bt(e) {
598
587
  ce = e;
599
588
  }
600
589
  function ee(e, n) {
@@ -610,11 +599,11 @@ function ee(e, n) {
610
599
  return !1;
611
600
  }), Object.keys(t).length <= 0);
612
601
  }
613
- function Dt(e, n) {
602
+ function Ct(e, n) {
614
603
  const t = ce[e];
615
604
  return t ? n ? (!ee(t.includes, n) || ee(t.excludes, n), !1) : !0 : !1;
616
605
  }
617
- const ue = require("js-cookie"), ot = [
606
+ const ue = require("js-cookie"), nt = [
618
607
  { path: "/passport/login", level: 0 },
619
608
  { path: "/passport/loginAccount", level: 1 },
620
609
  { path: "/passport/register", level: 1 },
@@ -637,7 +626,7 @@ const ue = require("js-cookie"), ot = [
637
626
  function Q(e) {
638
627
  let n, t = 0;
639
628
  const o = e.split("/");
640
- return ot.forEach((r) => {
629
+ return nt.forEach((r) => {
641
630
  const a = r.path.split("/");
642
631
  let l = 0;
643
632
  for (let s = 0; s < o.length && !(s >= a.length || o[s] !== a[s]); s++)
@@ -661,14 +650,14 @@ function k(e, n) {
661
650
  `~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${r} forward=${l}`
662
651
  ), r ? a ? ne.value = "" : ne.value = l ? "inner-left" : "inner-right" : window.routeExtras = { forward: l };
663
652
  }
664
- function rt() {
653
+ function ot() {
665
654
  return !!ue.get("accessToken");
666
655
  }
667
- function lt() {
656
+ function rt() {
668
657
  return !!ue.get("activeOrg");
669
658
  }
670
- function qt(e, n, t) {
671
- const o = rt(), r = lt(), a = Q(e.path);
659
+ function Vt(e, n, t) {
660
+ const o = ot(), r = rt(), a = Q(e.path);
672
661
  if (!a) {
673
662
  t();
674
663
  return;
@@ -707,8 +696,8 @@ function qt(e, n, t) {
707
696
  else
708
697
  k(e.path, n.path), t();
709
698
  }
710
- function St(e) {
711
- const n = Ie(), t = re(), o = Je(), r = le(), a = (i) => {
699
+ function Dt(e) {
700
+ const n = Pe(), t = re(), o = Ge(), r = le(), a = (i) => {
712
701
  if (i.key === "Escape") {
713
702
  l();
714
703
  return;
@@ -745,35 +734,35 @@ function St(e) {
745
734
  window.removeEventListener("keydown", a, !1);
746
735
  }), {};
747
736
  }
748
- function Rt() {
737
+ function qt() {
749
738
  const e = K(), { width: n } = Oe(), 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");
750
739
  return { dark: t, sysBarAvail: o, compactWidth: r };
751
740
  }
752
- const Tt = { install: Ge };
741
+ const St = { install: Xe };
753
742
  export {
754
- Ct as appAppear,
755
- xt as closeWaitDlg,
756
- vt as createAxios,
757
- Tt as default,
743
+ kt as appAppear,
744
+ ht as closeWaitDlg,
745
+ ft as createAxios,
746
+ St as default,
758
747
  c as eventBus,
759
748
  Q as matchRouteMeta,
760
- yt as messageError,
761
- wt as messageInfo,
762
- kt as messageSuccess,
763
- bt as messageWarning,
764
- qt as onBeforeEach,
765
- gt as openConfirmDlg,
766
- ht as openPromptDlg,
767
- _t as openWaitDlg,
749
+ _t as messageError,
750
+ xt as messageInfo,
751
+ yt as messageSuccess,
752
+ wt as messageWarning,
753
+ Vt as onBeforeEach,
754
+ mt as openConfirmDlg,
755
+ vt as openPromptDlg,
756
+ gt as openWaitDlg,
768
757
  ne as routeTransName,
769
- Vt as setPermissionObject,
770
- mt as useColor,
771
- Je as useGlobalStore,
772
- St as useHotkey,
773
- Rt as useSystem,
758
+ bt as setPermissionObject,
759
+ pt as useColor,
760
+ Ge as useGlobalStore,
761
+ Dt as useHotkey,
762
+ qt as useSystem,
774
763
  le as useViewMgrStore,
775
764
  J as useViewStack,
776
- Dt as verifyPermission,
777
- ft as waitMs,
765
+ Ct as verifyPermission,
766
+ dt as waitMs,
778
767
  G as waitUtil
779
768
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.3.5",
4
+ "version": "0.3.6",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",