x-essential-lib 0.5.22 → 0.5.24

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,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 f, watch as N, computed as i, onMounted as S, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as V, createBlock as A, unref as z, isRef as G, withKeys as L, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as B, toDisplayString as j, createElementBlock as J, normalizeStyle as ve, pushScopeId as me, popScopeId as he, createElementVNode as m, reactive as we, Fragment as ye, renderList as xe, createCommentVNode as ke } from "vue";
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 B, toDisplayString as j, createElementBlock as J, normalizeStyle as ve, pushScopeId as me, popScopeId as he, createElementVNode as m, reactive as we, Fragment as ye, renderList as xe, createCommentVNode as ke } from "vue";
3
3
  import { useTheme as H, useLocale as Q, useDisplay as be } from "vuetify";
4
4
  import { defineStore as le } from "pinia";
5
5
  import Ce from "axios";
@@ -7,7 +7,7 @@ import { useRouter as re, useRoute as De } from "vue-router";
7
7
  const ne = le(
8
8
  "global",
9
9
  () => {
10
- const e = H(), a = f(), t = f("en"), l = f({}), o = f("");
10
+ const e = H(), a = f(), t = f("en"), l = f({}), o = f(""), n = f("/");
11
11
  return N(
12
12
  a,
13
13
  () => {
@@ -18,14 +18,23 @@ const ne = le(
18
18
  dark: a,
19
19
  locale: t,
20
20
  permissionObjects: l,
21
- permissionChecksum: o
21
+ permissionChecksum: o,
22
+ lastAppPath: n
22
23
  };
23
24
  },
24
25
  {
25
26
  persist: [
26
27
  {
27
28
  storage: localStorage,
28
- paths: ["dark", "locale", "permissionObjects", "permissionChecksum"]
29
+ paths: ["dark", "locale"]
30
+ },
31
+ {
32
+ storage: sessionStorage,
33
+ paths: [
34
+ "permissionObjects",
35
+ "permissionChecksum",
36
+ "lastAppPath"
37
+ ]
29
38
  }
30
39
  ]
31
40
  }
@@ -136,7 +145,7 @@ function X(e, a) {
136
145
  }
137
146
  );
138
147
  }
139
- var E = X(Se, { path: "/" });
148
+ var A = X(Se, { path: "/" });
140
149
  function lt(e) {
141
150
  const a = Ce.create({
142
151
  timeout: 6e3
@@ -152,7 +161,7 @@ function lt(e) {
152
161
  ), a;
153
162
  }
154
163
  function Ve(e) {
155
- const a = E.get("accessToken") ?? "";
164
+ const a = A.get("accessToken") ?? "";
156
165
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
157
166
  }
158
167
  function Re(e, a) {
@@ -174,7 +183,7 @@ function Oe(e, a) {
174
183
  }), a(l), Promise.reject(e);
175
184
  }
176
185
  function Te() {
177
- E.remove("accessToken"), E.remove("refreshToken"), E.remove("activeOrg"), re().replace({ path: "/passport/login" });
186
+ A.remove("accessToken"), A.remove("refreshToken"), A.remove("activeOrg"), re().replace({ path: "/passport/login" });
178
187
  }
179
188
  function je(e) {
180
189
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
@@ -279,7 +288,7 @@ function te(e, a) {
279
288
  return !1;
280
289
  }), Object.keys(t).length <= 0);
281
290
  }
282
- const Ee = [
291
+ const Ae = [
283
292
  { path: "/passport/login", level: 0 },
284
293
  { path: "/passport/loginAccount", level: 1 },
285
294
  { path: "/passport/register", level: 1 },
@@ -301,7 +310,7 @@ const Ee = [
301
310
  function F(e) {
302
311
  let a, t = 0;
303
312
  const l = e.split("/").filter((o) => o.trim() !== "");
304
- return Ee.forEach((o) => {
313
+ return Ae.forEach((o) => {
305
314
  const n = o.path.split("/").filter((c) => c.trim() !== "");
306
315
  let r = 0;
307
316
  for (let c = 0; c < l.length && !(c >= n.length || l[c] !== n[c]); c++)
@@ -325,14 +334,14 @@ function D(e, a) {
325
334
  `~~~~before route change~~~~ ${l.path} -> ${t.path} inner=${o} forward=${r}`
326
335
  ), o ? n ? oe.value = "" : oe.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
327
336
  }
328
- function Ae() {
329
- return !!E.get("accessToken");
337
+ function Ee() {
338
+ return !!A.get("accessToken");
330
339
  }
331
340
  function Me() {
332
- return !!E.get("activeOrg");
341
+ return !!A.get("activeOrg");
333
342
  }
334
343
  function gt(e, a, t) {
335
- const l = Ae(), o = Me(), n = F(e.path);
344
+ const l = Ee(), o = Me(), n = F(e.path);
336
345
  if (!n) {
337
346
  t();
338
347
  return;
@@ -420,7 +429,7 @@ const Ue = /* @__PURE__ */ M({
420
429
  !u && !C && (p.emit("confirmDlgResult" + x, !1), C = !0);
421
430
  }), (u, g) => {
422
431
  const b = h("v-card-text"), R = h("v-btn"), q = h("v-card-actions"), d = h("v-card"), y = h("v-dialog");
423
- return V(), A(y, {
432
+ return V(), E(y, {
424
433
  modelValue: z(t),
425
434
  "onUpdate:modelValue": g[1] || (g[1] = (U) => G(t) ? t.value = U : null),
426
435
  onKeydown: [
@@ -529,7 +538,7 @@ const Ue = /* @__PURE__ */ M({
529
538
  n || o("timeout", t.id);
530
539
  }), (n, r) => {
531
540
  const c = h("v-alert");
532
- return V(), A(c, {
541
+ return V(), E(c, {
533
542
  modelValue: l.value,
534
543
  "onUpdate:modelValue": r[0] || (r[0] = (s) => l.value = s),
535
544
  class: "mt-2",
@@ -570,7 +579,7 @@ const Ue = /* @__PURE__ */ M({
570
579
  }, ["stop"])),
571
580
  class: "x-cont d-flex flex-column-reverse align-center"
572
581
  }, [
573
- (V(!0), J(ye, null, xe(a.items, (_) => (V(), A(Fe, {
582
+ (V(!0), J(ye, null, xe(a.items, (_) => (V(), E(Fe, {
574
583
  onTimeout: l,
575
584
  id: _.id,
576
585
  type: _.type,
@@ -613,7 +622,7 @@ const Ue = /* @__PURE__ */ M({
613
622
  !d && !b && (p.emit("promptDlgResult" + g, void 0), b = !0);
614
623
  }), (d, y) => {
615
624
  const U = h("v-card-text"), _e = h("v-text-field"), de = h("v-form"), P = h("v-btn"), fe = h("v-card-actions"), ie = h("v-card"), ge = h("v-dialog");
616
- return V(), A(ge, {
625
+ return V(), E(ge, {
617
626
  modelValue: z(t),
618
627
  "onUpdate:modelValue": y[2] || (y[2] = ($) => G(t) ? t.value = $ : null),
619
628
  onKeydown: [
@@ -626,7 +635,7 @@ const Ue = /* @__PURE__ */ M({
626
635
  default: w(() => [
627
636
  k(ie, { title: l.value }, {
628
637
  default: w(() => [
629
- o.value ? (V(), A(U, { key: 0 }, {
638
+ o.value ? (V(), E(U, { key: 0 }, {
630
639
  default: w(() => [
631
640
  B(j(o.value), 1)
632
641
  ]),
@@ -693,7 +702,7 @@ const Ue = /* @__PURE__ */ M({
693
702
  p.off("openWaitDlg", l), p.off("closeWaitDlg", o);
694
703
  }), (n, r) => {
695
704
  const c = h("v-card"), s = h("v-dialog");
696
- return V(), A(s, {
705
+ return V(), E(s, {
697
706
  modelValue: z(t),
698
707
  "onUpdate:modelValue": r[0] || (r[0] = (_) => G(t) ? t.value = _ : null),
699
708
  persistent: "",
@@ -4,14 +4,17 @@ export declare const useGlobalStore: import("pinia").StoreDefinition<"global", i
4
4
  locale: import("vue").Ref<string>;
5
5
  permissionObjects: import("vue").Ref<PermissionObjects>;
6
6
  permissionChecksum: import("vue").Ref<string>;
7
- }, "dark" | "locale" | "permissionObjects" | "permissionChecksum">>, Pick<{
7
+ lastAppPath: import("vue").Ref<string>;
8
+ }, "dark" | "locale" | "permissionObjects" | "permissionChecksum" | "lastAppPath">>, Pick<{
8
9
  dark: import("vue").Ref<boolean | undefined>;
9
10
  locale: import("vue").Ref<string>;
10
11
  permissionObjects: import("vue").Ref<PermissionObjects>;
11
12
  permissionChecksum: import("vue").Ref<string>;
13
+ lastAppPath: import("vue").Ref<string>;
12
14
  }, never>, Pick<{
13
15
  dark: import("vue").Ref<boolean | undefined>;
14
16
  locale: import("vue").Ref<string>;
15
17
  permissionObjects: import("vue").Ref<PermissionObjects>;
16
18
  permissionChecksum: import("vue").Ref<string>;
19
+ lastAppPath: import("vue").Ref<string>;
17
20
  }, never>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.22",
4
+ "version": "0.5.24",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",