x-essential-lib 0.8.3 → 0.8.4

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 +149 -145
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,15 +5,15 @@ import { useTheme as fe, useDisplay as Ee } from "vuetify";
5
5
  import { useRouter as ge, useRoute as Be } from "vue-router";
6
6
  import We from "axios";
7
7
  function Ue() {
8
- const e = fe(), t = w(() => e.global.current.value.colors.primary), a = w(() => e.global.current.value.colors.secondary), o = w(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), n = w(() => e.current.value.dark ? "#272727" : "#eeeeee"), l = w(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = w(() => e.current.value.dark ? "#303030" : "#f6f6f6"), r = w(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
8
+ const e = fe(), t = w(() => e.global.current.value.colors.primary), a = w(() => e.global.current.value.colors.secondary), o = w(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = w(() => e.current.value.dark ? "#272727" : "#eeeeee"), l = w(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = w(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = w(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
9
9
  return {
10
10
  primaryColor: t,
11
11
  secondaryColor: a,
12
12
  backgroundColor0: o,
13
- backgroundColor1: n,
13
+ backgroundColor1: r,
14
14
  backgroundColor2: l,
15
15
  highlightColor: c,
16
- borderColor: r
16
+ borderColor: n
17
17
  };
18
18
  }
19
19
  /*! js-cookie v3.0.5 | MIT */
@@ -37,47 +37,47 @@ var $e = {
37
37
  }
38
38
  };
39
39
  function ae(e, t) {
40
- function a(n, l, c) {
40
+ function a(r, l, c) {
41
41
  if (!(typeof document > "u")) {
42
- c = N({}, t, c), typeof c.expires == "number" && (c.expires = new Date(Date.now() + c.expires * 864e5)), c.expires && (c.expires = c.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
43
- var r = "";
42
+ c = N({}, t, c), typeof c.expires == "number" && (c.expires = new Date(Date.now() + c.expires * 864e5)), c.expires && (c.expires = c.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
43
+ var n = "";
44
44
  for (var u in c)
45
- c[u] && (r += "; " + u, c[u] !== !0 && (r += "=" + c[u].split(";")[0]));
46
- return document.cookie = n + "=" + e.write(l, n) + r;
45
+ c[u] && (n += "; " + u, c[u] !== !0 && (n += "=" + c[u].split(";")[0]));
46
+ return document.cookie = r + "=" + e.write(l, r) + n;
47
47
  }
48
48
  }
49
- function o(n) {
50
- if (!(typeof document > "u" || arguments.length && !n)) {
51
- for (var l = document.cookie ? document.cookie.split("; ") : [], c = {}, r = 0; r < l.length; r++) {
52
- var u = l[r].split("="), s = u.slice(1).join("=");
49
+ function o(r) {
50
+ if (!(typeof document > "u" || arguments.length && !r)) {
51
+ for (var l = document.cookie ? document.cookie.split("; ") : [], c = {}, n = 0; n < l.length; n++) {
52
+ var u = l[n].split("="), s = u.slice(1).join("=");
53
53
  try {
54
54
  var d = decodeURIComponent(u[0]);
55
- if (c[d] = e.read(s, d), n === d)
55
+ if (c[d] = e.read(s, d), r === d)
56
56
  break;
57
57
  } catch {
58
58
  }
59
59
  }
60
- return n ? c[n] : c;
60
+ return r ? c[r] : c;
61
61
  }
62
62
  }
63
63
  return Object.create(
64
64
  {
65
65
  set: a,
66
66
  get: o,
67
- remove: function(n, l) {
67
+ remove: function(r, l) {
68
68
  a(
69
- n,
69
+ r,
70
70
  "",
71
71
  N({}, l, {
72
72
  expires: -1
73
73
  })
74
74
  );
75
75
  },
76
- withAttributes: function(n) {
77
- return ae(this.converter, N({}, this.attributes, n));
76
+ withAttributes: function(r) {
77
+ return ae(this.converter, N({}, this.attributes, r));
78
78
  },
79
- withConverter: function(n) {
80
- return ae(N({}, this.converter, n), this.attributes);
79
+ withConverter: function(r) {
80
+ return ae(N({}, this.converter, r), this.attributes);
81
81
  }
82
82
  },
83
83
  {
@@ -112,9 +112,9 @@ function ze(e) {
112
112
  return e.data;
113
113
  }
114
114
  function Fe(e, t) {
115
- var n, l;
115
+ var r, l;
116
116
  const o = e.response;
117
- return o && (o.status === 401 && Xe(), (n = o.data) != null && n.message ? t((l = o.data) == null ? void 0 : l.message) : t({
117
+ return o && (o.status === 401 && Xe(), (r = o.data) != null && r.message ? t((l = o.data) == null ? void 0 : l.message) : t({
118
118
  code: o.status,
119
119
  message: o.statusText
120
120
  })), Promise.reject(e);
@@ -131,10 +131,10 @@ function Ne(e) {
131
131
  o && (a ? o.splice(o.indexOf(a) >>> 0, 1) : e.set(t, []));
132
132
  }, emit: function(t, a) {
133
133
  var o = e.get(t);
134
- o && o.slice().map(function(n) {
135
- n(a);
136
- }), (o = e.get("*")) && o.slice().map(function(n) {
137
- n(t, a);
134
+ o && o.slice().map(function(r) {
135
+ r(a);
136
+ }), (o = e.get("*")) && o.slice().map(function(r) {
137
+ r(t, a);
138
138
  });
139
139
  } };
140
140
  }
@@ -148,9 +148,9 @@ async function Yt(e) {
148
148
  }
149
149
  async function re(e, t, a) {
150
150
  const o = Date.now();
151
- return new Promise((n) => {
151
+ return new Promise((r) => {
152
152
  const l = async () => {
153
- e() ? n(!0) : t && Date.now() - o > t ? n(!1) : setTimeout(l, a ?? 30);
153
+ e() ? r(!0) : t && Date.now() - o > t ? r(!1) : setTimeout(l, a ?? 30);
154
154
  };
155
155
  l();
156
156
  });
@@ -176,8 +176,8 @@ async function Pt(e) {
176
176
  let t = !1, a;
177
177
  const o = (l) => {
178
178
  a = l, t = !0;
179
- }, n = me();
180
- return p.on("confirmDlgResult" + n, o), p.emit("confirmDlg", { ...e, seq: n }), await re(() => t), p.off("confirmDlgResult" + n, o), a;
179
+ }, r = me();
180
+ return p.on("confirmDlgResult" + r, o), p.emit("confirmDlg", { ...e, seq: r }), await re(() => t), p.off("confirmDlgResult" + r, o), a;
181
181
  }
182
182
  async function ea(e) {
183
183
  if (!ve())
@@ -185,8 +185,8 @@ async function ea(e) {
185
185
  let t = !1, a;
186
186
  const o = (l) => {
187
187
  a = l, t = !0;
188
- }, n = me();
189
- return p.on("promptDlgResult" + n, o), p.emit("promptDlg", { ...e, seq: n }), await re(() => t), p.off("promptDlgResult" + n, o), a;
188
+ }, r = me();
189
+ return p.on("promptDlgResult" + r, o), p.emit("promptDlg", { ...e, seq: r }), await re(() => t), p.off("promptDlgResult" + r, o), a;
190
190
  }
191
191
  function ta(e) {
192
192
  p.emit("openWaitDlg", { text: e });
@@ -211,11 +211,11 @@ function se(e, t) {
211
211
  if (!e)
212
212
  return !1;
213
213
  let a = e;
214
- return Object.keys(a).length <= 0 || (t.split("/").forEach((n) => {
214
+ return Object.keys(a).length <= 0 || (t.split("/").forEach((r) => {
215
215
  if (Object.keys(a).length <= 0)
216
216
  return !0;
217
- if (a[n])
218
- a = a[n];
217
+ if (a[r])
218
+ a = a[r];
219
219
  else
220
220
  return !1;
221
221
  }), Object.keys(a).length <= 0);
@@ -371,27 +371,27 @@ const lt = [
371
371
  ];
372
372
  function G(e) {
373
373
  let t, a = 0;
374
- const o = e.split("/").filter((n) => n.trim() !== "");
375
- return lt.forEach((n) => {
376
- const l = n.path.split("/").filter((r) => r.trim() !== "");
374
+ const o = e.split("/").filter((r) => r.trim() !== "");
375
+ return lt.forEach((r) => {
376
+ const l = r.path.split("/").filter((n) => n.trim() !== "");
377
377
  let c = 0;
378
- for (let r = 0; r < o.length && !(r >= l.length || o[r] !== l[r]); r++)
378
+ for (let n = 0; n < o.length && !(n >= l.length || o[n] !== l[n]); n++)
379
379
  c++;
380
- c > 0 && c > a && (t = n, a = c);
380
+ c > 0 && c > a && (t = r, a = c);
381
381
  }), t;
382
382
  }
383
383
  const J = v("");
384
- function M(e, t, a) {
384
+ function S(e, t, a) {
385
385
  t === "/" && (t = a);
386
- const o = G(e), n = G(t);
386
+ const o = G(e), r = G(t);
387
387
  if (!o) {
388
388
  console.assert(!1);
389
389
  return;
390
390
  }
391
- if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !n)
391
+ if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !r)
392
392
  return;
393
- const l = o.app === n.app, c = o.path === n.path, r = o.level >= n.level;
394
- l ? c ? J.value = "" : J.value = r ? "inner-left" : "inner-right" : (J.value = "", Ze(o.app, r));
393
+ const l = o.app === r.app, c = o.path === r.path, n = o.level >= r.level;
394
+ l ? c ? J.value = "" : J.value = n ? "inner-left" : "inner-right" : (J.value = "", Ze(o.app, n));
395
395
  }
396
396
  function ct() {
397
397
  return !!I.get("accessToken");
@@ -400,44 +400,44 @@ function ut() {
400
400
  return !!I.get("activeOrg");
401
401
  }
402
402
  function _a(e, t, a, o) {
403
- const n = ct(), l = ut(), c = G(e.path);
403
+ const r = ct(), l = ut(), c = G(e.path);
404
404
  if (!c) {
405
405
  console.assert(!1), a();
406
406
  return;
407
407
  }
408
408
  if (c.requiredState === "auth")
409
- if (n)
409
+ if (r)
410
410
  if (l) {
411
- const r = "/main";
412
- M(r, t.path, o), a({ path: r });
411
+ const n = "/main";
412
+ S(n, t.path, o), a({ path: n });
413
413
  } else
414
- M(e.path, t.path, o), a();
414
+ S(e.path, t.path, o), a();
415
415
  else {
416
- const r = "/passport/login";
417
- M(r, t.path, o), a({ path: r });
416
+ const n = "/passport/login";
417
+ S(n, t.path, o), a({ path: n });
418
418
  }
419
419
  else if (c.requiredState === "org")
420
- if (n)
420
+ if (r)
421
421
  if (l)
422
- M(e.path, t.path, o), a();
422
+ S(e.path, t.path, o), a();
423
423
  else {
424
- const r = "/org/joinOrCreate";
425
- M(r, t.path, o), a({ path: r });
424
+ const n = "/org/joinOrCreate";
425
+ S(n, t.path, o), a({ path: n });
426
426
  }
427
427
  else {
428
- const r = "/passport/login";
429
- M(r, t.path, o), a({ path: r });
428
+ const n = "/passport/login";
429
+ S(n, t.path, o), a({ path: n });
430
430
  }
431
- else if (n)
431
+ else if (r)
432
432
  if (l) {
433
- const r = "/main";
434
- M(r, t.path, o), a({ path: r });
433
+ const n = "/main";
434
+ S(n, t.path, o), a({ path: n });
435
435
  } else {
436
- const r = "/org/joinOrCreate";
437
- M(r, t.path, o), a({ path: r });
436
+ const n = "/org/joinOrCreate";
437
+ S(n, t.path, o), a({ path: n });
438
438
  }
439
439
  else
440
- M(e.path, t.path, o), a();
440
+ S(e.path, t.path, o), a();
441
441
  }
442
442
  function st(e) {
443
443
  return e.value.length <= 0;
@@ -498,27 +498,27 @@ function yt(e) {
498
498
  }
499
499
  function wt(...e) {
500
500
  const t = [], a = () => {
501
- t.forEach((r) => r()), t.length = 0;
502
- }, o = (r, u, s, d) => (r.addEventListener(u, s, d), () => r.removeEventListener(u, s, d)), n = w(() => {
503
- const r = P(q(e[0])).filter((u) => u != null);
504
- return r.every((u) => typeof u != "string") ? r : void 0;
501
+ t.forEach((n) => n()), t.length = 0;
502
+ }, o = (n, u, s, d) => (n.addEventListener(u, s, d), () => n.removeEventListener(u, s, d)), r = w(() => {
503
+ const n = P(q(e[0])).filter((u) => u != null);
504
+ return n.every((u) => typeof u != "string") ? n : void 0;
505
505
  }), l = ht(
506
506
  () => {
507
- var r, u;
507
+ var n, u;
508
508
  return [
509
- (u = (r = n.value) == null ? void 0 : r.map((s) => yt(s))) != null ? u : [Le].filter((s) => s != null),
510
- P(q(n.value ? e[1] : e[0])),
511
- P(z(n.value ? e[2] : e[1])),
509
+ (u = (n = r.value) == null ? void 0 : n.map((s) => yt(s))) != null ? u : [Le].filter((s) => s != null),
510
+ P(q(r.value ? e[1] : e[0])),
511
+ P(z(r.value ? e[2] : e[1])),
512
512
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
513
- q(n.value ? e[3] : e[2])
513
+ q(r.value ? e[3] : e[2])
514
514
  ];
515
515
  },
516
- ([r, u, s, d]) => {
517
- if (a(), !(r != null && r.length) || !(u != null && u.length) || !(s != null && s.length))
516
+ ([n, u, s, d]) => {
517
+ if (a(), !(n != null && n.length) || !(u != null && u.length) || !(s != null && s.length))
518
518
  return;
519
519
  const g = mt(d) ? { ...d } : d;
520
520
  t.push(
521
- ...r.flatMap(
521
+ ...n.flatMap(
522
522
  (b) => u.flatMap(
523
523
  (m) => s.map((_) => o(b, m, _, g))
524
524
  )
@@ -547,29 +547,29 @@ function Ct() {
547
547
  return typeof e == "number" ? e : void 0;
548
548
  }
549
549
  function Lt(e, t = {}) {
550
- const { window: a = Le, ssrWidth: o = Ct() } = t, n = bt(() => a && "matchMedia" in a && typeof a.matchMedia == "function"), l = v(typeof o == "number"), c = ee(), r = ee(!1), u = (s) => {
551
- r.value = s.matches;
550
+ const { window: a = Le, ssrWidth: o = Ct() } = t, r = bt(() => a && "matchMedia" in a && typeof a.matchMedia == "function"), l = v(typeof o == "number"), c = ee(), n = ee(!1), u = (s) => {
551
+ n.value = s.matches;
552
552
  };
553
553
  return Ve(() => {
554
554
  if (l.value) {
555
- l.value = !n.value;
555
+ l.value = !r.value;
556
556
  const s = q(e).split(",");
557
- r.value = s.some((d) => {
557
+ n.value = s.some((d) => {
558
558
  const g = d.includes("not all"), b = d.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = d.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
559
559
  let _ = !!(b || m);
560
560
  return b && _ && (_ = o >= pe(b[1])), m && _ && (_ = o <= pe(m[1])), g ? !_ : _;
561
561
  });
562
562
  return;
563
563
  }
564
- n.value && (c.value = a.matchMedia(q(e)), r.value = c.value.matches);
565
- }), wt(c, "change", u, { passive: !0 }), w(() => r.value);
564
+ r.value && (c.value = a.matchMedia(q(e)), n.value = c.value.matches);
565
+ }), wt(c, "change", u, { passive: !0 }), w(() => n.value);
566
566
  }
567
567
  function Dt(e) {
568
568
  return Lt("(prefers-color-scheme: dark)", e);
569
569
  }
570
- function fa(e, t, a, o, n, l) {
571
- const c = Be(), r = ge();
572
- Ye(e), Pe(t), et(a), at(o), ot(n), nt(l);
570
+ function fa(e, t, a, o, r, l) {
571
+ const c = Be(), n = ge();
572
+ Ye(e), Pe(t), et(a), at(o), ot(r), nt(l);
573
573
  const u = fe(), s = Dt();
574
574
  K(
575
575
  e,
@@ -591,12 +591,16 @@ function fa(e, t, a, o, n, l) {
591
591
  return;
592
592
  }
593
593
  const i = G(c.path);
594
- (i == null ? void 0 : i.level) === 0 ? (k = navigator == null ? void 0 : navigator.Backbutton) == null || k.goHome(
594
+ if (!i) {
595
+ console.assert(!1);
596
+ return;
597
+ }
598
+ i.level === 0 ? (k = navigator == null ? void 0 : navigator.Backbutton) == null || k.goHome(
595
599
  () => {
596
600
  },
597
601
  () => {
598
602
  }
599
- ) : r.back();
603
+ ) : i.level === 1 ? n.replace({ path: "/main" }) : n.back();
600
604
  };
601
605
  E(() => {
602
606
  window.addEventListener("keydown", d), p.on("backbutton", g);
@@ -611,7 +615,7 @@ function fa(e, t, a, o, n, l) {
611
615
  const k = i;
612
616
  a.value = k[0], o.value = k[1];
613
617
  }, D = (i) => {
614
- n.value = i;
618
+ r.value = i;
615
619
  };
616
620
  Ae(() => {
617
621
  p.on("updateDark", b), p.on("updateLocale", m), p.on("updatePermission", _), p.on("updateLastAppPath", D), p.emit("syncGlobalState");
@@ -642,31 +646,31 @@ function le(e, t) {
642
646
  set(l) {
643
647
  l ? pt(a, e) : _t(a, e);
644
648
  }
645
- }), n = (l) => {
649
+ }), r = (l) => {
646
650
  t == null || t(l), o.value = !0;
647
651
  };
648
652
  return E(() => {
649
- p.on(e, n);
653
+ p.on(e, r);
650
654
  }), $(() => {
651
- p.off(e, n);
655
+ p.off(e, r);
652
656
  }), { open: o };
653
657
  }
654
- const St = /* @__PURE__ */ B({
658
+ const Mt = /* @__PURE__ */ B({
655
659
  __name: "index",
656
660
  setup(e) {
657
- const { t } = ne(), a = v(""), o = v(""), n = v(""), l = v(""), c = v(""), r = v("");
661
+ const { t } = ne(), a = v(""), o = v(""), r = v(""), l = v(""), c = v(""), n = v("");
658
662
  let u = 0, s = !1;
659
663
  const d = (m) => {
660
- var D, i, k, S;
664
+ var D, i, k, M;
661
665
  const _ = m;
662
- a.value = _.title, o.value = _.text, n.value = ((D = _.cancel) == null ? void 0 : D.color) ?? "primary", l.value = ((i = _.cancel) == null ? void 0 : i.text) ?? t("dlg.common.cancel"), c.value = ((k = _.confirm) == null ? void 0 : k.color) ?? "primary", r.value = ((S = _.confirm) == null ? void 0 : S.text) ?? t("dlg.common.confirm"), u = _.seq, s = !1, g.value = !0;
666
+ a.value = _.title, o.value = _.text, r.value = ((D = _.cancel) == null ? void 0 : D.color) ?? "primary", l.value = ((i = _.cancel) == null ? void 0 : i.text) ?? t("dlg.common.cancel"), c.value = ((k = _.confirm) == null ? void 0 : k.color) ?? "primary", n.value = ((M = _.confirm) == null ? void 0 : M.text) ?? t("dlg.common.confirm"), u = _.seq, s = !1, g.value = !0;
663
667
  }, { open: g } = le("confirmDlg", d), b = () => {
664
668
  g.value = !1, s || (p.emit("confirmDlgResult" + u, !0), s = !0);
665
669
  };
666
670
  return K(g, (m) => {
667
671
  !m && !s && (p.emit("confirmDlgResult" + u, !1), s = !0);
668
672
  }), (m, _) => {
669
- const D = x("v-card-text"), i = x("v-btn"), k = x("v-card-actions"), S = x("v-card"), f = x("v-dialog");
673
+ const D = x("v-card-text"), i = x("v-btn"), k = x("v-card-actions"), M = x("v-card"), f = x("v-dialog");
670
674
  return L(), V(f, {
671
675
  modelValue: z(g),
672
676
  "onUpdate:modelValue": _[1] || (_[1] = (j) => Q(g) ? g.value = j : null),
@@ -679,7 +683,7 @@ const St = /* @__PURE__ */ B({
679
683
  ]
680
684
  }, {
681
685
  default: y(() => [
682
- C(S, { title: a.value }, {
686
+ C(M, { title: a.value }, {
683
687
  default: y(() => [
684
688
  C(D, null, {
685
689
  default: y(() => [
@@ -690,7 +694,7 @@ const St = /* @__PURE__ */ B({
690
694
  C(k, { class: "d-flex justify-end" }, {
691
695
  default: y(() => [
692
696
  C(i, {
693
- color: n.value,
697
+ color: r.value,
694
698
  variant: "text",
695
699
  onClick: _[0] || (_[0] = (j) => g.value = !1)
696
700
  }, {
@@ -705,7 +709,7 @@ const St = /* @__PURE__ */ B({
705
709
  onClick: b
706
710
  }, {
707
711
  default: y(() => [
708
- O(R(r.value), 1)
712
+ O(R(n.value), 1)
709
713
  ]),
710
714
  _: 1
711
715
  }, 8, ["color"])
@@ -720,7 +724,7 @@ const St = /* @__PURE__ */ B({
720
724
  }, 8, ["modelValue", "onKeydown"]);
721
725
  };
722
726
  }
723
- }), Mt = /* @__PURE__ */ B({
727
+ }), St = /* @__PURE__ */ B({
724
728
  __name: "index",
725
729
  props: {
726
730
  open: { type: Boolean, default: !0 },
@@ -732,9 +736,9 @@ const St = /* @__PURE__ */ B({
732
736
  zIndex: e.zIndex
733
737
  }));
734
738
  let o = 0;
735
- return (n, l) => (L(), V(qe, { name: "fade" }, {
739
+ return (r, l) => (L(), V(qe, { name: "fade" }, {
736
740
  default: y(() => [
737
- n.open ? (L(), te("div", {
741
+ r.open ? (L(), te("div", {
738
742
  key: Q(o) ? ++o.value : ++o,
739
743
  class: "x-cont",
740
744
  style: de(a.value)
@@ -760,10 +764,10 @@ const St = /* @__PURE__ */ B({
760
764
  }
761
765
  }), ce = (e, t) => {
762
766
  const a = e.__vccOpts || e;
763
- for (const [o, n] of t)
764
- a[o] = n;
767
+ for (const [o, r] of t)
768
+ a[o] = r;
765
769
  return a;
766
- }, jt = /* @__PURE__ */ ce(Mt, [["__scopeId", "data-v-0c686889"]]);
770
+ }, jt = /* @__PURE__ */ ce(St, [["__scopeId", "data-v-0c686889"]]);
767
771
  var Rt = "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", Vt = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z", At = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", qt = "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z", Ot = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
768
772
  const It = /* @__PURE__ */ B({
769
773
  __name: "item",
@@ -778,7 +782,7 @@ const It = /* @__PURE__ */ B({
778
782
  const a = e, o = w(() => ({
779
783
  width: "calc(100% - 64px)",
780
784
  overflowWrap: "break-word"
781
- })), n = w(() => {
785
+ })), r = w(() => {
782
786
  switch (a.type) {
783
787
  case "success":
784
788
  return Vt;
@@ -796,9 +800,9 @@ const It = /* @__PURE__ */ B({
796
800
  setTimeout(() => {
797
801
  c("timeout", a.id);
798
802
  }, a.timeout);
799
- }), K(l, (r) => {
800
- r || c("timeout", a.id);
801
- }), (r, u) => {
803
+ }), K(l, (n) => {
804
+ n || c("timeout", a.id);
805
+ }), (n, u) => {
802
806
  const s = x("v-icon"), d = x("v-sheet");
803
807
  return L(), V(d, {
804
808
  class: "x-item d-flex align-center py-2 mb-2",
@@ -806,10 +810,10 @@ const It = /* @__PURE__ */ B({
806
810
  elevation: 1
807
811
  }, {
808
812
  default: y(() => [
809
- n.value ? (L(), V(s, {
813
+ r.value ? (L(), V(s, {
810
814
  key: 0,
811
815
  class: "mx-1",
812
- icon: n.value
816
+ icon: r.value
813
817
  }, null, 8, ["icon"])) : oe("", !0),
814
818
  h("div", {
815
819
  style: de(o.value)
@@ -833,21 +837,21 @@ const It = /* @__PURE__ */ B({
833
837
  }), $(() => {
834
838
  p.off("message", a);
835
839
  });
836
- const a = (r) => {
837
- const { type: u, text: s, timeout: d } = r;
840
+ const a = (n) => {
841
+ const { type: u, text: s, timeout: d } = n;
838
842
  l(u, s, d);
839
- }, o = (r) => {
840
- c(r);
843
+ }, o = (n) => {
844
+ c(n);
841
845
  };
842
- let n = 0;
843
- const l = (r, u, s) => {
844
- const d = n++;
845
- t.value.push({ id: d, type: r, text: u, timeout: s });
846
- }, c = (r) => {
847
- const u = t.value.findIndex((s) => s.id === r);
846
+ let r = 0;
847
+ const l = (n, u, s) => {
848
+ const d = r++;
849
+ t.value.push({ id: d, type: n, text: u, timeout: s });
850
+ }, c = (n) => {
851
+ const u = t.value.findIndex((s) => s.id === n);
848
852
  u >= 0 && t.value.splice(u, 1);
849
853
  };
850
- return (r, u) => (L(), te("div", {
854
+ return (n, u) => (L(), te("div", {
851
855
  class: "x-cont d-flex flex-column-reverse align-center",
852
856
  onClick: u[0] || (u[0] = H(() => {
853
857
  }, ["stop"]))
@@ -865,20 +869,20 @@ const It = /* @__PURE__ */ B({
865
869
  }), Bt = /* @__PURE__ */ ce(Et, [["__scopeId", "data-v-c6a59757"]]), Wt = /* @__PURE__ */ B({
866
870
  __name: "index",
867
871
  setup(e) {
868
- const { t } = ne(), a = v(""), o = v(""), n = v(""), l = v(""), c = v(), r = v(""), u = v(""), s = v(""), d = v(""), g = v(""), b = Te("target");
872
+ const { t } = ne(), a = v(""), o = v(""), r = v(""), l = v(""), c = v(), n = v(""), u = v(""), s = v(""), d = v(""), g = v(""), b = Te("target");
869
873
  let m = 0, _ = !1;
870
- const D = async (S) => {
874
+ const D = async (M) => {
871
875
  var j, F, X, W;
872
- const f = S;
873
- a.value = f.title, o.value = f.text, n.value = f.label, l.value = f.placeholder, c.value = f.rules, r.value = f.value, u.value = ((j = f.cancel) == null ? void 0 : j.color) ?? "primary", s.value = ((F = f.cancel) == null ? void 0 : F.text) ?? t("dlg.common.cancel"), d.value = ((X = f.confirm) == null ? void 0 : X.color) ?? "primary", g.value = ((W = f.confirm) == null ? void 0 : W.text) ?? t("dlg.common.confirm"), m = f.seq, _ = !1, i.value = !0, await re(() => !!b.value), b.value.focus();
876
+ const f = M;
877
+ a.value = f.title, o.value = f.text, r.value = f.label, l.value = f.placeholder, c.value = f.rules, n.value = f.value, u.value = ((j = f.cancel) == null ? void 0 : j.color) ?? "primary", s.value = ((F = f.cancel) == null ? void 0 : F.text) ?? t("dlg.common.cancel"), d.value = ((X = f.confirm) == null ? void 0 : X.color) ?? "primary", g.value = ((W = f.confirm) == null ? void 0 : W.text) ?? t("dlg.common.confirm"), m = f.seq, _ = !1, i.value = !0, await re(() => !!b.value), b.value.focus();
874
878
  }, { open: i } = le("promptDlg", D), k = () => {
875
- i.value = !1, _ || (p.emit("promptDlgResult" + m, r.value ?? ""), _ = !0);
879
+ i.value = !1, _ || (p.emit("promptDlgResult" + m, n.value ?? ""), _ = !0);
876
880
  };
877
- return K(i, (S) => {
878
- !S && !_ && (p.emit("promptDlgResult" + m, void 0), _ = !0);
879
- }), (S, f) => {
880
- const j = x("v-card-text"), F = x("v-text-field"), X = x("v-form"), W = x("v-btn"), De = x("v-card-actions"), Se = x("v-card"), Me = x("v-dialog");
881
- return L(), V(Me, {
881
+ return K(i, (M) => {
882
+ !M && !_ && (p.emit("promptDlgResult" + m, void 0), _ = !0);
883
+ }), (M, f) => {
884
+ const j = x("v-card-text"), F = x("v-text-field"), X = x("v-form"), W = x("v-btn"), De = x("v-card-actions"), Me = x("v-card"), Se = x("v-dialog");
885
+ return L(), V(Se, {
882
886
  modelValue: z(i),
883
887
  "onUpdate:modelValue": f[2] || (f[2] = (U) => Q(i) ? i.value = U : null),
884
888
  transition: "dialog-top-transition",
@@ -890,7 +894,7 @@ const It = /* @__PURE__ */ B({
890
894
  ]
891
895
  }, {
892
896
  default: y(() => [
893
- C(Se, { title: a.value }, {
897
+ C(Me, { title: a.value }, {
894
898
  default: y(() => [
895
899
  o.value ? (L(), V(j, { key: 0 }, {
896
900
  default: y(() => [
@@ -903,9 +907,9 @@ const It = /* @__PURE__ */ B({
903
907
  C(F, {
904
908
  ref_key: "target",
905
909
  ref: b,
906
- modelValue: r.value,
907
- "onUpdate:modelValue": f[0] || (f[0] = (U) => r.value = U),
908
- label: n.value,
910
+ modelValue: n.value,
911
+ "onUpdate:modelValue": f[0] || (f[0] = (U) => n.value = U),
912
+ label: r.value,
909
913
  placeholder: l.value,
910
914
  rules: c.value
911
915
  }, null, 8, ["modelValue", "label", "placeholder", "rules"])
@@ -949,20 +953,20 @@ const It = /* @__PURE__ */ B({
949
953
  __name: "index",
950
954
  setup(e) {
951
955
  const { t } = ne(), a = v(""), o = (c) => {
952
- const r = c;
953
- a.value = r.text ?? t("dlg.common.waiting"), l.value = !0;
954
- }, n = () => {
956
+ const n = c;
957
+ a.value = n.text ?? t("dlg.common.waiting"), l.value = !0;
958
+ }, r = () => {
955
959
  l.value = !1;
956
960
  }, { open: l } = le("waitDlg", o);
957
961
  return E(() => {
958
- p.on("closeWaitDlg", n);
962
+ p.on("closeWaitDlg", r);
959
963
  }), $(() => {
960
- p.off("closeWaitDlg", n);
961
- }), (c, r) => {
964
+ p.off("closeWaitDlg", r);
965
+ }), (c, n) => {
962
966
  const u = x("v-card"), s = x("v-dialog");
963
967
  return L(), V(s, {
964
968
  modelValue: z(l),
965
- "onUpdate:modelValue": r[0] || (r[0] = (d) => Q(l) ? l.value = d : null),
969
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => Q(l) ? l.value = d : null),
966
970
  persistent: "",
967
971
  "no-click-animation": "",
968
972
  fullscreen: "",
@@ -989,10 +993,10 @@ const It = /* @__PURE__ */ B({
989
993
  };
990
994
  }
991
995
  }), zt = (e) => {
992
- e.component("XConfirmDlg", St), e.component("XLoading", jt), e.component("XMessage", Bt), e.component("XPromptDlg", Wt), e.component("XWaitDlg", Kt);
996
+ e.component("XConfirmDlg", Mt), e.component("XLoading", jt), e.component("XMessage", Bt), e.component("XPromptDlg", Wt), e.component("XWaitDlg", Kt);
993
997
  }, Ft = (e, t, a) => {
994
998
  const o = e[t];
995
- return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((n, l) => {
999
+ return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((r, l) => {
996
1000
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
997
1001
  l.bind(
998
1002
  null,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.8.3",
4
+ "version": "0.8.4",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",