x-essential-lib 0.5.39 → 0.5.40

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 +26 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
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 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";
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 j, 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
3
  import { useTheme as H, useLocale as Q, useDisplay as ke } from "vuetify";
4
4
  import { defineStore as le } from "pinia";
5
5
  import be from "axios";
@@ -11,7 +11,9 @@ const Y = le(
11
11
  return N(
12
12
  a,
13
13
  () => {
14
- window.dispatchEvent(new CustomEvent("darkchange", { detail: a.value })), e.global.name.value = a.value ? "dark" : "light";
14
+ window.dispatchEvent(
15
+ new CustomEvent("darkchange", { detail: a.value })
16
+ ), e.global.name.value = a.value ? "dark" : "light";
15
17
  },
16
18
  { immediate: !0 }
17
19
  ), {
@@ -181,7 +183,7 @@ function Oe(e, a) {
181
183
  function Te() {
182
184
  R.remove("accessToken"), R.remove("refreshToken"), R.remove("activeOrg"), ne().replace({ path: "/passport/login" });
183
185
  }
184
- function je(e) {
186
+ function Ae(e) {
185
187
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
186
188
  var l = e.get(a);
187
189
  l ? l.push(t) : e.set(a, [t]);
@@ -198,7 +200,7 @@ function je(e) {
198
200
  } };
199
201
  }
200
202
  const s = function() {
201
- return window.eventBus || (window.eventBus = je()), window.eventBus;
203
+ return window.eventBus || (window.eventBus = Ae()), window.eventBus;
202
204
  }();
203
205
  async function nt(e) {
204
206
  return new Promise((a) => {
@@ -214,7 +216,7 @@ async function Z(e, a, t) {
214
216
  r();
215
217
  });
216
218
  }
217
- function Ae(e, a) {
219
+ function je(e, a) {
218
220
  var o;
219
221
  if (!window.appAppear) {
220
222
  window.appAppear = !0;
@@ -405,12 +407,12 @@ function z(e) {
405
407
  }
406
408
  const oe = i("");
407
409
  function D(e, a) {
408
- const { lastAppPath: t } = Y();
409
- a === "/" && (a = t);
410
+ const t = Y();
411
+ a === "/" && (a = t.lastAppPath);
410
412
  const l = z(e), o = z(a), r = (l == null ? void 0 : l.app) === (o == null ? void 0 : o.app), n = (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);
411
413
  console.info(
412
414
  `~~~~before route change~~~~ ${a} -> ${e} inner=${r} forward=${c}`
413
- ), r ? n ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l && Ae(l.app, c);
415
+ ), r ? n ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : l && je(l.app, c), t.lastAppPath = "/";
414
416
  }
415
417
  function Ee() {
416
418
  return !!R.get("accessToken");
@@ -492,13 +494,13 @@ const $e = /* @__PURE__ */ U({
492
494
  return ((u = n.value) == null ? void 0 : u.text) ?? a.t("confirm");
493
495
  });
494
496
  let y = 0, C = !1;
495
- const j = (u) => {
497
+ const A = (u) => {
496
498
  l.value = u.title, o.value = u.text, r.value = u.cancel, n.value = u.confirm, y = u.seq, C = !1, t.value = !0;
497
499
  };
498
500
  S(() => {
499
- s.on("confirmDlg", j);
501
+ s.on("confirmDlg", A);
500
502
  }), T(() => {
501
- s.off("confirmDlg", j);
503
+ s.off("confirmDlg", A);
502
504
  });
503
505
  const I = () => {
504
506
  t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
@@ -522,7 +524,7 @@ const $e = /* @__PURE__ */ U({
522
524
  default: w(() => [
523
525
  k(b, null, {
524
526
  default: w(() => [
525
- B(A(o.value), 1)
527
+ B(j(o.value), 1)
526
528
  ]),
527
529
  _: 1
528
530
  }),
@@ -534,7 +536,7 @@ const $e = /* @__PURE__ */ U({
534
536
  variant: "text"
535
537
  }, {
536
538
  default: w(() => [
537
- B(A(p.value), 1)
539
+ B(j(p.value), 1)
538
540
  ]),
539
541
  _: 1
540
542
  }, 8, ["color"]),
@@ -544,7 +546,7 @@ const $e = /* @__PURE__ */ U({
544
546
  variant: "text"
545
547
  }, {
546
548
  default: w(() => [
547
- B(A(v.value), 1)
549
+ B(j(v.value), 1)
548
550
  ]),
549
551
  _: 1
550
552
  }, 8, ["color"])
@@ -676,7 +678,7 @@ const $e = /* @__PURE__ */ U({
676
678
  }), C = f(() => {
677
679
  var d;
678
680
  return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
679
- }), j = f(() => {
681
+ }), A = f(() => {
680
682
  var d;
681
683
  return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
682
684
  }), I = f(() => {
@@ -715,7 +717,7 @@ const $e = /* @__PURE__ */ U({
715
717
  default: w(() => [
716
718
  o.value ? (V(), E($, { key: 0 }, {
717
719
  default: w(() => [
718
- B(A(o.value), 1)
720
+ B(j(o.value), 1)
719
721
  ]),
720
722
  _: 1
721
723
  })) : ye("", !0),
@@ -741,17 +743,17 @@ const $e = /* @__PURE__ */ U({
741
743
  variant: "text"
742
744
  }, {
743
745
  default: w(() => [
744
- B(A(C.value), 1)
746
+ B(j(C.value), 1)
745
747
  ]),
746
748
  _: 1
747
749
  }, 8, ["color"]),
748
750
  k(ee, {
749
751
  onClick: O,
750
- color: j.value,
752
+ color: A.value,
751
753
  variant: "text"
752
754
  }, {
753
755
  default: w(() => [
754
- B(A(I.value), 1)
756
+ B(j(I.value), 1)
755
757
  ]),
756
758
  _: 1
757
759
  }, 8, ["color"])
@@ -796,7 +798,7 @@ const $e = /* @__PURE__ */ U({
796
798
  }, {
797
799
  default: w(() => [
798
800
  m("div", Ge, [
799
- m("span", null, A(F(a).t("waitingResponse")), 1)
801
+ m("span", null, j(F(a).t("waitingResponse")), 1)
800
802
  ])
801
803
  ]),
802
804
  _: 1
@@ -893,15 +895,15 @@ function vt(e, a) {
893
895
  } catch (g) {
894
896
  console.error(g);
895
897
  }
896
- }, j = async (u) => {
898
+ }, A = async (u) => {
897
899
  u && await C(), clearTimeout(y), y = setTimeout(async () => {
898
- await C(), y && j();
900
+ await C(), y && A();
899
901
  }, 3e3);
900
902
  }, I = () => {
901
903
  clearTimeout(y), y = void 0;
902
904
  };
903
905
  S(() => {
904
- a && j(!0);
906
+ a && A(!0);
905
907
  }), T(() => {
906
908
  I();
907
909
  });
@@ -921,7 +923,7 @@ function ht() {
921
923
  const wt = { install: Ye };
922
924
  export {
923
925
  Be as Permission,
924
- Ae as appAppear,
926
+ je as appAppear,
925
927
  pt as closeWaitDlg,
926
928
  lt as createAxios,
927
929
  wt as default,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.39",
4
+ "version": "0.5.40",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",