x-essential-lib 0.5.59 → 0.5.61

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 +38 -35
  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 O, defineComponent as M, resolveComponent as h, openBlock as R, createBlock as E, unref as z, isRef as Q, withKeys as F, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as I, toDisplayString as A, createElementBlock as X, 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 R, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as S, createBlock as E, unref as z, isRef as Q, withKeys as F, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as I, toDisplayString as A, createElementBlock as X, 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 Y, useDisplay as ke } from "vuetify";
4
4
  import { defineStore as le } from "pinia";
5
5
  import be from "axios";
@@ -27,8 +27,11 @@ const Z = le(
27
27
  {
28
28
  persist: [
29
29
  {
30
+ beforeRestore: (e) => {
31
+ console.log("beforeRestore", e.store.$state);
32
+ },
30
33
  afterRestore: (e) => {
31
- console.log("afterRestore", e.store.$id);
34
+ console.log("afterRestore", e.store.$state);
32
35
  },
33
36
  storage: localStorage,
34
37
  paths: ["dark", "locale"]
@@ -152,20 +155,20 @@ function rt(e) {
152
155
  timeout: 6e3
153
156
  });
154
157
  return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
155
- (t) => Se(t),
158
+ (t) => Re(t),
156
159
  (t) => {
157
- Re(t, e.onError);
160
+ Se(t, e.onError);
158
161
  }
159
162
  ), a.interceptors.response.use(
160
163
  (t) => Ve(t),
161
164
  (t) => qe(t, e.onError)
162
165
  ), a;
163
166
  }
164
- function Se(e) {
167
+ function Re(e) {
165
168
  const a = B.get("accessToken") ?? "";
166
169
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
167
170
  }
168
- function Re(e, a) {
171
+ function Se(e, a) {
169
172
  console.error(e), a("request timeout");
170
173
  }
171
174
  function Ve(e) {
@@ -426,11 +429,11 @@ function D(e, a) {
426
429
  function Me() {
427
430
  return !!B.get("accessToken");
428
431
  }
429
- function Ue() {
432
+ function $e() {
430
433
  return !!B.get("activeOrg");
431
434
  }
432
435
  function gt(e, a, t) {
433
- const l = Me(), o = Ue(), n = L(e.path);
436
+ const l = Me(), o = $e(), n = L(e.path);
434
437
  if (!n) {
435
438
  t();
436
439
  return;
@@ -480,13 +483,13 @@ function ee(e, a) {
480
483
  }), o = (n) => {
481
484
  a == null || a(n), l.value = !0;
482
485
  };
483
- return S(() => {
486
+ return R(() => {
484
487
  p.on(e, o);
485
488
  }), O(() => {
486
489
  p.off(e, o);
487
490
  }), { open: l };
488
491
  }
489
- const $e = /* @__PURE__ */ M({
492
+ const Ue = /* @__PURE__ */ M({
490
493
  __name: "index",
491
494
  setup(e) {
492
495
  const a = Y(), { open: t } = ee("confirmDlgInternal"), l = i(""), o = i(""), n = i(), r = i(), c = f(() => {
@@ -506,7 +509,7 @@ const $e = /* @__PURE__ */ M({
506
509
  const T = (u) => {
507
510
  l.value = u.title, o.value = u.text, n.value = u.cancel, r.value = u.confirm, y = u.seq, C = !1, t.value = !0;
508
511
  };
509
- S(() => {
512
+ R(() => {
510
513
  p.on("confirmDlg", T);
511
514
  }), O(() => {
512
515
  p.off("confirmDlg", T);
@@ -518,11 +521,11 @@ const $e = /* @__PURE__ */ M({
518
521
  !u && !C && (p.emit("confirmDlgResult" + y, !1), C = !0);
519
522
  }), (u, g) => {
520
523
  const b = h("v-card-text"), V = h("v-btn"), q = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
521
- return R(), E(x, {
524
+ return S(), E(x, {
522
525
  modelValue: z(t),
523
- "onUpdate:modelValue": g[1] || (g[1] = (U) => Q(t) ? t.value = U : null),
526
+ "onUpdate:modelValue": g[1] || (g[1] = ($) => Q(t) ? t.value = $ : null),
524
527
  onKeydown: [
525
- g[2] || (g[2] = F(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
528
+ g[2] || (g[2] = F(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
526
529
  F(K(j, ["stop", "prevent"]), ["enter"])
527
530
  ],
528
531
  transition: "dialog-top-transition",
@@ -540,7 +543,7 @@ const $e = /* @__PURE__ */ M({
540
543
  k(q, { class: "d-flex justify-end" }, {
541
544
  default: w(() => [
542
545
  k(V, {
543
- onClick: g[0] || (g[0] = (U) => t.value = !1),
546
+ onClick: g[0] || (g[0] = ($) => t.value = !1),
544
547
  color: c.value,
545
548
  variant: "text"
546
549
  }, {
@@ -598,7 +601,7 @@ const $e = /* @__PURE__ */ M({
598
601
  background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
599
602
  zIndex: t.zIndex
600
603
  }));
601
- return (o, n) => (R(), X("div", {
604
+ return (o, n) => (S(), X("div", {
602
605
  class: "x-cont",
603
606
  style: ge(l.value)
604
607
  }, We, 4));
@@ -619,7 +622,7 @@ const $e = /* @__PURE__ */ M({
619
622
  emits: ["timeout"],
620
623
  setup(e, { emit: a }) {
621
624
  const t = e, l = i(!0), o = a;
622
- return S(() => {
625
+ return R(() => {
623
626
  setTimeout(() => {
624
627
  o("timeout", t.id);
625
628
  }, t.timeout);
@@ -627,7 +630,7 @@ const $e = /* @__PURE__ */ M({
627
630
  n || o("timeout", t.id);
628
631
  }), (n, r) => {
629
632
  const c = h("v-alert");
630
- return R(), E(c, {
633
+ return S(), E(c, {
631
634
  modelValue: l.value,
632
635
  "onUpdate:modelValue": r[0] || (r[0] = (s) => l.value = s),
633
636
  class: "mt-2",
@@ -645,7 +648,7 @@ const $e = /* @__PURE__ */ M({
645
648
  __name: "index",
646
649
  setup(e) {
647
650
  const a = he({ items: [] });
648
- S(() => {
651
+ R(() => {
649
652
  p.on("message", t);
650
653
  }), O(() => {
651
654
  p.off("message", t);
@@ -663,12 +666,12 @@ const $e = /* @__PURE__ */ M({
663
666
  const s = a.items.findIndex((_) => _.id === c);
664
667
  s >= 0 && a.items.splice(s, 1);
665
668
  };
666
- return (c, s) => (R(), X("div", {
669
+ return (c, s) => (S(), X("div", {
667
670
  onClick: s[0] || (s[0] = K(() => {
668
671
  }, ["stop"])),
669
672
  class: "x-cont d-flex flex-column-reverse align-center"
670
673
  }, [
671
- (R(!0), X(we, null, xe(a.items, (_) => (R(), E(Ne, {
674
+ (S(!0), X(we, null, xe(a.items, (_) => (S(), E(Ne, {
672
675
  onTimeout: l,
673
676
  id: _.id,
674
677
  type: _.type,
@@ -699,7 +702,7 @@ const $e = /* @__PURE__ */ M({
699
702
  var x;
700
703
  l.value = d.title, o.value = d.text, n.value = d.label, r.value = d.placeholder, c.value = d.rules, s.value = d.value, _.value = d.cancel, v.value = d.confirm, g = d.seq, b = !1, t.value = !0, await P(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
701
704
  };
702
- S(() => {
705
+ R(() => {
703
706
  p.on("promptDlg", V);
704
707
  }), O(() => {
705
708
  p.off("promptDlg", V);
@@ -710,12 +713,12 @@ const $e = /* @__PURE__ */ M({
710
713
  return N(t, (d) => {
711
714
  !d && !b && (p.emit("promptDlgResult" + g, void 0), b = !0);
712
715
  }), (d, x) => {
713
- const U = h("v-card-text"), pe = h("v-text-field"), _e = h("v-form"), te = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
714
- return R(), E(fe, {
716
+ const $ = h("v-card-text"), pe = h("v-text-field"), _e = h("v-form"), te = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
717
+ return S(), E(fe, {
715
718
  modelValue: z(t),
716
- "onUpdate:modelValue": x[2] || (x[2] = ($) => Q(t) ? t.value = $ : null),
719
+ "onUpdate:modelValue": x[2] || (x[2] = (U) => Q(t) ? t.value = U : null),
717
720
  onKeydown: [
718
- x[3] || (x[3] = F(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
721
+ x[3] || (x[3] = F(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
719
722
  F(K(q, ["stop", "prevent"]), ["enter"])
720
723
  ],
721
724
  transition: "dialog-top-transition",
@@ -724,7 +727,7 @@ const $e = /* @__PURE__ */ M({
724
727
  default: w(() => [
725
728
  k(ie, { title: l.value }, {
726
729
  default: w(() => [
727
- o.value ? (R(), E(U, { key: 0 }, {
730
+ o.value ? (S(), E($, { key: 0 }, {
728
731
  default: w(() => [
729
732
  I(A(o.value), 1)
730
733
  ]),
@@ -734,7 +737,7 @@ const $e = /* @__PURE__ */ M({
734
737
  default: w(() => [
735
738
  k(pe, {
736
739
  modelValue: s.value,
737
- "onUpdate:modelValue": x[0] || (x[0] = ($) => s.value = $),
740
+ "onUpdate:modelValue": x[0] || (x[0] = (U) => s.value = U),
738
741
  label: n.value,
739
742
  placeholder: r.value,
740
743
  rules: c.value,
@@ -747,7 +750,7 @@ const $e = /* @__PURE__ */ M({
747
750
  k(de, { class: "d-flex justify-end" }, {
748
751
  default: w(() => [
749
752
  k(te, {
750
- onClick: x[1] || (x[1] = ($) => t.value = !1),
753
+ onClick: x[1] || (x[1] = (U) => t.value = !1),
751
754
  color: y.value,
752
755
  variant: "text"
753
756
  }, {
@@ -785,13 +788,13 @@ const $e = /* @__PURE__ */ M({
785
788
  }, o = () => {
786
789
  t.value = !1;
787
790
  };
788
- return S(() => {
791
+ return R(() => {
789
792
  p.on("openWaitDlg", l), p.on("closeWaitDlg", o);
790
793
  }), O(() => {
791
794
  p.off("openWaitDlg", l), p.off("closeWaitDlg", o);
792
795
  }), (n, r) => {
793
796
  const c = h("v-card"), s = h("v-dialog");
794
- return R(), E(s, {
797
+ return S(), E(s, {
795
798
  modelValue: z(t),
796
799
  "onUpdate:modelValue": r[0] || (r[0] = (_) => Q(t) ? t.value = _ : null),
797
800
  persistent: "",
@@ -819,7 +822,7 @@ const $e = /* @__PURE__ */ M({
819
822
  };
820
823
  }
821
824
  }), Ze = (e) => {
822
- e.component("x-confirm-dlg", $e), e.component("x-loading", Fe), e.component("x-message", Je), e.component("x-prompt-dlg", Xe), e.component("x-wait-dlg", Ye);
825
+ e.component("x-confirm-dlg", Ue), e.component("x-loading", Fe), e.component("x-message", Je), e.component("x-prompt-dlg", Xe), e.component("x-wait-dlg", Ye);
823
826
  };
824
827
  function vt() {
825
828
  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");
@@ -857,7 +860,7 @@ function mt(e, a) {
857
860
  }
858
861
  ) : l.back();
859
862
  };
860
- S(() => {
863
+ R(() => {
861
864
  p.on("pause", c), p.on("resume", s), p.on("backbutton", _);
862
865
  }), O(() => {
863
866
  p.off("pause", c), p.off("resume", s), p.off("backbutton", _);
@@ -876,7 +879,7 @@ function mt(e, a) {
876
879
  return;
877
880
  }
878
881
  };
879
- S(() => {
882
+ R(() => {
880
883
  window.addEventListener("keydown", v);
881
884
  }), O(() => {
882
885
  window.removeEventListener("keydown", v);
@@ -911,7 +914,7 @@ function mt(e, a) {
911
914
  }, j = () => {
912
915
  clearTimeout(y), y = void 0;
913
916
  };
914
- S(() => {
917
+ R(() => {
915
918
  a && T(!0);
916
919
  }), O(() => {
917
920
  j();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.59",
4
+ "version": "0.5.61",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",