x-essential-lib 0.5.21 → 0.5.23

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("/"), r = f(1);
11
11
  return N(
12
12
  a,
13
13
  () => {
@@ -18,14 +18,25 @@ const ne = le(
18
18
  dark: a,
19
19
  locale: t,
20
20
  permissionObjects: l,
21
- permissionChecksum: o
21
+ permissionChecksum: o,
22
+ lastPath: n,
23
+ mainActive: r
22
24
  };
23
25
  },
24
26
  {
25
27
  persist: [
26
28
  {
27
29
  storage: localStorage,
28
- paths: ["dark", "locale", "permissionObjects", "permissionChecksum"]
30
+ paths: ["dark", "locale"]
31
+ },
32
+ {
33
+ storage: sessionStorage,
34
+ paths: [
35
+ "permissionObjects",
36
+ "permissionChecksum",
37
+ "lastPath",
38
+ "mainActive"
39
+ ]
29
40
  }
30
41
  ]
31
42
  }
@@ -136,7 +147,7 @@ function X(e, a) {
136
147
  }
137
148
  );
138
149
  }
139
- var E = X(Se, { path: "/" });
150
+ var A = X(Se, { path: "/" });
140
151
  function lt(e) {
141
152
  const a = Ce.create({
142
153
  timeout: 6e3
@@ -152,7 +163,7 @@ function lt(e) {
152
163
  ), a;
153
164
  }
154
165
  function Ve(e) {
155
- const a = E.get("accessToken") ?? "";
166
+ const a = A.get("accessToken") ?? "";
156
167
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
157
168
  }
158
169
  function Re(e, a) {
@@ -174,7 +185,7 @@ function Oe(e, a) {
174
185
  }), a(l), Promise.reject(e);
175
186
  }
176
187
  function Te() {
177
- E.remove("accessToken"), E.remove("refreshToken"), E.remove("activeOrg"), re().replace({ path: "/passport/login" });
188
+ A.remove("accessToken"), A.remove("refreshToken"), A.remove("activeOrg"), re().replace({ path: "/passport/login" });
178
189
  }
179
190
  function je(e) {
180
191
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
@@ -279,7 +290,7 @@ function te(e, a) {
279
290
  return !1;
280
291
  }), Object.keys(t).length <= 0);
281
292
  }
282
- const Ee = [
293
+ const Ae = [
283
294
  { path: "/passport/login", level: 0 },
284
295
  { path: "/passport/loginAccount", level: 1 },
285
296
  { path: "/passport/register", level: 1 },
@@ -301,7 +312,7 @@ const Ee = [
301
312
  function F(e) {
302
313
  let a, t = 0;
303
314
  const l = e.split("/").filter((o) => o.trim() !== "");
304
- return Ee.forEach((o) => {
315
+ return Ae.forEach((o) => {
305
316
  const n = o.path.split("/").filter((c) => c.trim() !== "");
306
317
  let r = 0;
307
318
  for (let c = 0; c < l.length && !(c >= n.length || l[c] !== n[c]); c++)
@@ -325,14 +336,14 @@ function D(e, a) {
325
336
  `~~~~before route change~~~~ ${l.path} -> ${t.path} inner=${o} forward=${r}`
326
337
  ), o ? n ? oe.value = "" : oe.value = r ? "inner-left" : "inner-right" : window.routeExtras = { forward: r };
327
338
  }
328
- function Ae() {
329
- return !!E.get("accessToken");
339
+ function Ee() {
340
+ return !!A.get("accessToken");
330
341
  }
331
342
  function Me() {
332
- return !!E.get("activeOrg");
343
+ return !!A.get("activeOrg");
333
344
  }
334
345
  function gt(e, a, t) {
335
- const l = Ae(), o = Me(), n = F(e.path);
346
+ const l = Ee(), o = Me(), n = F(e.path);
336
347
  if (!n) {
337
348
  t();
338
349
  return;
@@ -420,7 +431,7 @@ const Ue = /* @__PURE__ */ M({
420
431
  !u && !C && (p.emit("confirmDlgResult" + x, !1), C = !0);
421
432
  }), (u, g) => {
422
433
  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, {
434
+ return V(), E(y, {
424
435
  modelValue: z(t),
425
436
  "onUpdate:modelValue": g[1] || (g[1] = (U) => G(t) ? t.value = U : null),
426
437
  onKeydown: [
@@ -529,7 +540,7 @@ const Ue = /* @__PURE__ */ M({
529
540
  n || o("timeout", t.id);
530
541
  }), (n, r) => {
531
542
  const c = h("v-alert");
532
- return V(), A(c, {
543
+ return V(), E(c, {
533
544
  modelValue: l.value,
534
545
  "onUpdate:modelValue": r[0] || (r[0] = (s) => l.value = s),
535
546
  class: "mt-2",
@@ -570,7 +581,7 @@ const Ue = /* @__PURE__ */ M({
570
581
  }, ["stop"])),
571
582
  class: "x-cont d-flex flex-column-reverse align-center"
572
583
  }, [
573
- (V(!0), J(ye, null, xe(a.items, (_) => (V(), A(Fe, {
584
+ (V(!0), J(ye, null, xe(a.items, (_) => (V(), E(Fe, {
574
585
  onTimeout: l,
575
586
  id: _.id,
576
587
  type: _.type,
@@ -613,7 +624,7 @@ const Ue = /* @__PURE__ */ M({
613
624
  !d && !b && (p.emit("promptDlgResult" + g, void 0), b = !0);
614
625
  }), (d, y) => {
615
626
  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, {
627
+ return V(), E(ge, {
617
628
  modelValue: z(t),
618
629
  "onUpdate:modelValue": y[2] || (y[2] = ($) => G(t) ? t.value = $ : null),
619
630
  onKeydown: [
@@ -626,7 +637,7 @@ const Ue = /* @__PURE__ */ M({
626
637
  default: w(() => [
627
638
  k(ie, { title: l.value }, {
628
639
  default: w(() => [
629
- o.value ? (V(), A(U, { key: 0 }, {
640
+ o.value ? (V(), E(U, { key: 0 }, {
630
641
  default: w(() => [
631
642
  B(j(o.value), 1)
632
643
  ]),
@@ -693,7 +704,7 @@ const Ue = /* @__PURE__ */ M({
693
704
  p.off("openWaitDlg", l), p.off("closeWaitDlg", o);
694
705
  }), (n, r) => {
695
706
  const c = h("v-card"), s = h("v-dialog");
696
- return V(), A(s, {
707
+ return V(), E(s, {
697
708
  modelValue: z(t),
698
709
  "onUpdate:modelValue": r[0] || (r[0] = (_) => G(t) ? t.value = _ : null),
699
710
  persistent: "",
@@ -736,7 +747,7 @@ function vt() {
736
747
  };
737
748
  }
738
749
  function Ze(e, a) {
739
- return e.post("syncPermission", a);
750
+ return e.post("pullPermission", a);
740
751
  }
741
752
  function mt(e, a) {
742
753
  const t = De(), l = re(), o = ne(), n = ce();
@@ -4,14 +4,20 @@ 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
+ lastPath: import("vue").Ref<string>;
8
+ mainActive: import("vue").Ref<0 | 1 | 2 | 3 | 4>;
9
+ }, "dark" | "locale" | "permissionObjects" | "permissionChecksum" | "lastPath" | "mainActive">>, Pick<{
8
10
  dark: import("vue").Ref<boolean | undefined>;
9
11
  locale: import("vue").Ref<string>;
10
12
  permissionObjects: import("vue").Ref<PermissionObjects>;
11
13
  permissionChecksum: import("vue").Ref<string>;
14
+ lastPath: import("vue").Ref<string>;
15
+ mainActive: import("vue").Ref<0 | 1 | 2 | 3 | 4>;
12
16
  }, never>, Pick<{
13
17
  dark: import("vue").Ref<boolean | undefined>;
14
18
  locale: import("vue").Ref<string>;
15
19
  permissionObjects: import("vue").Ref<PermissionObjects>;
16
20
  permissionChecksum: import("vue").Ref<string>;
21
+ lastPath: import("vue").Ref<string>;
22
+ mainActive: import("vue").Ref<0 | 1 | 2 | 3 | 4>;
17
23
  }, 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.21",
4
+ "version": "0.5.23",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",