x-essential-lib 0.5.6 → 0.5.7

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 +67 -58
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,20 +1,29 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.id="x-essential-lib",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-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-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
- import { ref as i, computed as g, onMounted as V, onBeforeUnmount as O, defineComponent as M, watch as J, resolveComponent as h, openBlock as R, createBlock as B, unref as z, isRef as X, withKeys as L, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as A, toDisplayString as T, createElementBlock as F, 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
- import { useLocale as G, useTheme as Q, useDisplay as be } from "vuetify";
2
+ import { ref as i, watch as F, computed as g, onMounted as V, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as R, createBlock as E, unref as W, isRef as G, withKeys as z, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as A, toDisplayString as T, 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
+ import { useTheme as H, useLocale as Q, useDisplay as be } from "vuetify";
4
4
  import { defineStore as re } from "pinia";
5
5
  import Ce from "axios";
6
6
  import { useRouter as le, useRoute as De } from "vue-router";
7
7
  const ne = re(
8
8
  "global",
9
9
  () => {
10
- const e = i(!0), a = i(1), t = i(), r = i("en"), o = i({}), n = i("");
11
- return {
12
- running: e,
13
- mainActive: a,
14
- dark: t,
15
- locale: r,
16
- permissionObjects: o,
17
- permissionChecksum: n
10
+ const e = H(), a = i(!0), t = i(1), r = i(), o = i("en"), n = i({}), l = i("");
11
+ return F(
12
+ r,
13
+ () => {
14
+ const c = !!r.value;
15
+ c ? StatusBar == null || StatusBar.styleLightContent() : StatusBar == null || StatusBar.styleDefault(), e.global.name.value = c ? "dark" : "light";
16
+ },
17
+ {
18
+ immediate: !0
19
+ }
20
+ ), {
21
+ running: a,
22
+ mainActive: t,
23
+ dark: r,
24
+ locale: o,
25
+ permissionObjects: n,
26
+ permissionChecksum: l
18
27
  };
19
28
  },
20
29
  {
@@ -69,7 +78,7 @@ const ne = re(
69
78
  };
70
79
  });
71
80
  /*! js-cookie v3.0.5 | MIT */
72
- function W(e) {
81
+ function L(e) {
73
82
  for (var a = 1; a < arguments.length; a++) {
74
83
  var t = arguments[a];
75
84
  for (var r in t)
@@ -88,10 +97,10 @@ var Se = {
88
97
  );
89
98
  }
90
99
  };
91
- function H(e, a) {
100
+ function X(e, a) {
92
101
  function t(o, n, l) {
93
102
  if (!(typeof document > "u")) {
94
- l = W({}, a, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires && (l.expires = l.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
103
+ l = L({}, a, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires && (l.expires = l.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
95
104
  var c = "";
96
105
  for (var u in l)
97
106
  l[u] && (c += "; " + u, l[u] !== !0 && (c += "=" + l[u].split(";")[0]));
@@ -120,16 +129,16 @@ function H(e, a) {
120
129
  t(
121
130
  o,
122
131
  "",
123
- W({}, n, {
132
+ L({}, n, {
124
133
  expires: -1
125
134
  })
126
135
  );
127
136
  },
128
137
  withAttributes: function(o) {
129
- return H(this.converter, W({}, this.attributes, o));
138
+ return X(this.converter, L({}, this.attributes, o));
130
139
  },
131
140
  withConverter: function(o) {
132
- return H(W({}, this.converter, o), this.attributes);
141
+ return X(L({}, this.converter, o), this.attributes);
133
142
  }
134
143
  },
135
144
  {
@@ -138,7 +147,7 @@ function H(e, a) {
138
147
  }
139
148
  );
140
149
  }
141
- var E = H(Se, { path: "/" });
150
+ var B = X(Se, { path: "/" });
142
151
  function rt(e) {
143
152
  const a = Ce.create({
144
153
  timeout: 6e3
@@ -154,7 +163,7 @@ function rt(e) {
154
163
  ), a;
155
164
  }
156
165
  function qe(e) {
157
- const a = E.get("accessToken") ?? "";
166
+ const a = B.get("accessToken") ?? "";
158
167
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
159
168
  }
160
169
  function Ve(e, a) {
@@ -176,7 +185,7 @@ function Oe(e, a) {
176
185
  }), a(r), Promise.reject(e);
177
186
  }
178
187
  function Te() {
179
- E.remove("accessToken"), E.remove("refreshToken"), E.remove("activeOrg"), le().replace({ path: "/passport/login" });
188
+ B.remove("accessToken"), B.remove("refreshToken"), B.remove("activeOrg"), le().replace({ path: "/passport/login" });
180
189
  }
181
190
  function je(e) {
182
191
  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 Be = [
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 N(e) {
302
311
  let a, t = 0;
303
312
  const r = e.split("/").filter((o) => o.trim() !== "");
304
- return Ee.forEach((o) => {
313
+ return Be.forEach((o) => {
305
314
  const n = o.path.split("/").filter((c) => c.trim() !== "");
306
315
  let l = 0;
307
316
  for (let c = 0; c < r.length && !(c >= n.length || r[c] !== n[c]); c++)
@@ -325,14 +334,14 @@ function q(e, a) {
325
334
  `~~~~before route change~~~~ ${r.path} -> ${t.path} inner=${o} forward=${l}`
326
335
  ), o ? n ? oe.value = "" : oe.value = l ? "inner-left" : "inner-right" : window.routeExtras = { forward: l };
327
336
  }
328
- function Be() {
329
- return !!E.get("accessToken");
337
+ function Ee() {
338
+ return !!B.get("accessToken");
330
339
  }
331
340
  function Me() {
332
- return !!E.get("activeOrg");
341
+ return !!B.get("activeOrg");
333
342
  }
334
343
  function gt(e, a, t) {
335
- const r = Be(), o = Me(), n = N(e.path);
344
+ const r = Ee(), o = Me(), n = N(e.path);
336
345
  if (!n) {
337
346
  t();
338
347
  return;
@@ -391,7 +400,7 @@ function Z(e, a) {
391
400
  const Ue = /* @__PURE__ */ M({
392
401
  __name: "index",
393
402
  setup(e) {
394
- const a = G(), { open: t } = Z("confirmDlg"), r = i(""), o = i(""), n = i(), l = i(), c = g(() => {
403
+ const a = Q(), { open: t } = Z("confirmDlg"), r = i(""), o = i(""), n = i(), l = i(), c = g(() => {
395
404
  var p;
396
405
  return ((p = n.value) == null ? void 0 : p.color) ?? "primary";
397
406
  }), u = g(() => {
@@ -416,16 +425,16 @@ const Ue = /* @__PURE__ */ M({
416
425
  const f = () => {
417
426
  t.value = !1, b || (s.emit("confirmDlgResult" + D, !0), b = !0);
418
427
  };
419
- return J(t, (p) => {
428
+ return F(t, (p) => {
420
429
  !p && !b && (s.emit("confirmDlgResult" + D, !1), b = !0);
421
430
  }), (p, y) => {
422
431
  const C = h("v-card-text"), S = h("v-btn"), I = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
423
- return R(), B(x, {
424
- modelValue: z(t),
425
- "onUpdate:modelValue": y[1] || (y[1] = (U) => X(t) ? t.value = U : null),
432
+ return R(), E(x, {
433
+ modelValue: W(t),
434
+ "onUpdate:modelValue": y[1] || (y[1] = (U) => G(t) ? t.value = U : null),
426
435
  onKeydown: [
427
- y[2] || (y[2] = L(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
428
- L(K(f, ["stop", "prevent"]), ["enter"])
436
+ y[2] || (y[2] = z(K((U) => t.value = !1, ["stop", "prevent"]), ["esc"])),
437
+ z(K(f, ["stop", "prevent"]), ["enter"])
429
438
  ],
430
439
  transition: "dialog-top-transition",
431
440
  "max-width": "600px"
@@ -485,9 +494,9 @@ const Ue = /* @__PURE__ */ M({
485
494
  /* @__PURE__ */ m("div"),
486
495
  /* @__PURE__ */ m("div"),
487
496
  /* @__PURE__ */ m("div")
488
- ], -1)), We = [
497
+ ], -1)), Le = [
489
498
  Ke
490
- ], ze = /* @__PURE__ */ M({
499
+ ], We = /* @__PURE__ */ M({
491
500
  __name: "index",
492
501
  props: {
493
502
  zIndex: {
@@ -496,21 +505,21 @@ const Ue = /* @__PURE__ */ M({
496
505
  }
497
506
  },
498
507
  setup(e) {
499
- const a = Q(), t = e, r = g(() => ({
508
+ const a = H(), t = e, r = g(() => ({
500
509
  background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
501
510
  zIndex: t.zIndex
502
511
  }));
503
- return (o, n) => (R(), F("div", {
512
+ return (o, n) => (R(), J("div", {
504
513
  class: "x-cont",
505
514
  style: ve(r.value)
506
- }, We, 4));
515
+ }, Le, 4));
507
516
  }
508
517
  }), pe = (e, a) => {
509
518
  const t = e.__vccOpts || e;
510
519
  for (const [r, o] of a)
511
520
  t[r] = o;
512
521
  return t;
513
- }, Le = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Ne = /* @__PURE__ */ M({
522
+ }, ze = /* @__PURE__ */ pe(We, [["__scopeId", "data-v-f4ad116e"]]), Ne = /* @__PURE__ */ M({
514
523
  __name: "item",
515
524
  props: {
516
525
  id: {
@@ -554,11 +563,11 @@ const Ue = /* @__PURE__ */ M({
554
563
  setTimeout(() => {
555
564
  o("timeout", t.id);
556
565
  }, t.timeout);
557
- }), J(r, (l) => {
566
+ }), F(r, (l) => {
558
567
  l || o("timeout", t.id);
559
568
  }), (l, c) => {
560
569
  const u = h("v-alert");
561
- return R(), B(u, {
570
+ return R(), E(u, {
562
571
  modelValue: r.value,
563
572
  "onUpdate:modelValue": c[0] || (c[0] = (_) => r.value = _),
564
573
  class: "mt-2",
@@ -595,12 +604,12 @@ const Ue = /* @__PURE__ */ M({
595
604
  const u = a.items.findIndex((_) => _.id === c);
596
605
  u >= 0 && a.items.splice(u, 1);
597
606
  };
598
- return (c, u) => (R(), F("div", {
607
+ return (c, u) => (R(), J("div", {
599
608
  onClick: u[0] || (u[0] = K(() => {
600
609
  }, ["stop"])),
601
610
  class: "x-cont d-flex flex-column-reverse align-center"
602
611
  }, [
603
- (R(!0), F(ye, null, xe(a.items, (_) => (R(), B(Ne, {
612
+ (R(!0), J(ye, null, xe(a.items, (_) => (R(), E(Ne, {
604
613
  onTimeout: r,
605
614
  id: _.id,
606
615
  type: _.type,
@@ -613,7 +622,7 @@ const Ue = /* @__PURE__ */ M({
613
622
  }), He = /* @__PURE__ */ pe(Fe, [["__scopeId", "data-v-70ed4b89"]]), Je = /* @__PURE__ */ M({
614
623
  __name: "index",
615
624
  setup(e) {
616
- const a = G(), { open: t } = Z("promptDlg"), r = i(""), o = i(""), n = i(), l = i(), c = i(), u = i(""), _ = i(), v = i(), D = g(() => {
625
+ const a = Q(), { open: t } = Z("promptDlg"), r = i(""), o = i(""), n = i(), l = i(), c = i(), u = i(""), _ = i(), v = i(), D = g(() => {
617
626
  var d;
618
627
  return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
619
628
  }), b = g(() => {
@@ -639,16 +648,16 @@ const Ue = /* @__PURE__ */ M({
639
648
  const I = () => {
640
649
  t.value = !1, C || (s.emit("promptDlgResult" + y, u.value ?? ""), C = !0);
641
650
  };
642
- return J(t, (d) => {
651
+ return F(t, (d) => {
643
652
  !d && !C && (s.emit("promptDlgResult" + y, void 0), C = !0);
644
653
  }), (d, x) => {
645
654
  const U = h("v-card-text"), _e = h("v-text-field"), de = h("v-form"), P = h("v-btn"), ie = h("v-card-actions"), fe = h("v-card"), ge = h("v-dialog");
646
- return R(), B(ge, {
647
- modelValue: z(t),
648
- "onUpdate:modelValue": x[2] || (x[2] = ($) => X(t) ? t.value = $ : null),
655
+ return R(), E(ge, {
656
+ modelValue: W(t),
657
+ "onUpdate:modelValue": x[2] || (x[2] = ($) => G(t) ? t.value = $ : null),
649
658
  onKeydown: [
650
- x[3] || (x[3] = L(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
651
- L(K(I, ["stop", "prevent"]), ["enter"])
659
+ x[3] || (x[3] = z(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
660
+ z(K(I, ["stop", "prevent"]), ["enter"])
652
661
  ],
653
662
  transition: "dialog-top-transition",
654
663
  "max-width": "600px"
@@ -656,7 +665,7 @@ const Ue = /* @__PURE__ */ M({
656
665
  default: w(() => [
657
666
  k(fe, { title: r.value }, {
658
667
  default: w(() => [
659
- o.value ? (R(), B(U, { key: 0 }, {
668
+ o.value ? (R(), E(U, { key: 0 }, {
660
669
  default: w(() => [
661
670
  A(T(o.value), 1)
662
671
  ]),
@@ -712,7 +721,7 @@ const Ue = /* @__PURE__ */ M({
712
721
  }), Xe = { class: "mx-auto my-auto" }, Ge = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ M({
713
722
  __name: "index",
714
723
  setup(e) {
715
- const a = G(), { open: t } = Z("waitDlg"), r = () => {
724
+ const a = Q(), { open: t } = Z("waitDlg"), r = () => {
716
725
  t.value = !0;
717
726
  }, o = () => {
718
727
  t.value = !1;
@@ -723,9 +732,9 @@ const Ue = /* @__PURE__ */ M({
723
732
  s.off("openWaitDlg", r), s.off("closeWaitDlg", o);
724
733
  }), (n, l) => {
725
734
  const c = h("v-card"), u = h("v-dialog");
726
- return R(), B(u, {
727
- modelValue: z(t),
728
- "onUpdate:modelValue": l[0] || (l[0] = (_) => X(t) ? t.value = _ : null),
735
+ return R(), E(u, {
736
+ modelValue: W(t),
737
+ "onUpdate:modelValue": l[0] || (l[0] = (_) => G(t) ? t.value = _ : null),
729
738
  persistent: "",
730
739
  "no-click-animation": "",
731
740
  fullscreen: ""
@@ -739,7 +748,7 @@ const Ue = /* @__PURE__ */ M({
739
748
  }, {
740
749
  default: w(() => [
741
750
  m("div", Ge, [
742
- m("span", null, T(z(a).t("waitingResponse")), 1)
751
+ m("span", null, T(W(a).t("waitingResponse")), 1)
743
752
  ])
744
753
  ]),
745
754
  _: 1
@@ -751,10 +760,10 @@ const Ue = /* @__PURE__ */ M({
751
760
  };
752
761
  }
753
762
  }), Ye = (e) => {
754
- e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message", He), e.component("x-prompt-dlg", Je), e.component("x-wait-dlg", Qe);
763
+ e.component("x-confirm-dlg", Ue), e.component("x-loading", ze), e.component("x-message", He), e.component("x-prompt-dlg", Je), e.component("x-wait-dlg", Qe);
755
764
  };
756
765
  function vt() {
757
- const e = Q(), a = g(() => e.global.current.value.colors.primary), t = g(() => e.global.current.value.colors.secondary), r = g(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = g(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = g(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = g(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = g(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
766
+ const e = H(), a = g(() => e.global.current.value.colors.primary), t = g(() => e.global.current.value.colors.secondary), r = g(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = g(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = g(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = g(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = g(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
758
767
  return {
759
768
  primaryColor: a,
760
769
  secondaryColor: t,
@@ -856,7 +865,7 @@ function ht() {
856
865
  return { verifyPermission: a };
857
866
  }
858
867
  function wt() {
859
- const e = Q(), a = be(), t = g(() => e.current.value.dark), r = g(() => !!window.cordova), o = g(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
868
+ const e = H(), a = be(), t = g(() => e.current.value.dark), r = g(() => !!window.cordova), o = g(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
860
869
  return { dark: t, sysBarAvail: r, compactWidth: o };
861
870
  }
862
871
  const yt = { install: Ye };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.6",
4
+ "version": "0.5.7",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",