x-essential-lib 0.8.3 → 0.8.5

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 +180 -174
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.id="x-essential-lib",t.appendChild(document.createTextNode('.fade-leave-active[data-v-0c686889]{transition:opacity .5s ease}.fade-leave-to[data-v-0c686889]{opacity:0}.x-cont[data-v-0c686889]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-0c686889]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-0c686889]{transform-origin:20px 20px;animation:lds-spinner-0c686889 1.2s linear infinite}.lds-spinner div[data-v-0c686889]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-0c686889]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-0c686889]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-0c686889]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-0c686889]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-0c686889]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-0c686889]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-0c686889]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-0c686889]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-0c686889]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-0c686889]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-0c686889]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-0c686889]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-0c686889{0%{opacity:1}to{opacity:0}}.x-item[data-v-d5cfe252]{width:600px}@media (max-width: 600px){.x-item[data-v-d5cfe252]{width:calc(100vw - 16px)}}.x-cont[data-v-c6a59757]{position:fixed;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 { computed as w, provide as T, inject as A, ref as v, getCurrentInstance as _e, hasInjectionContext as ie, watch as K, getCurrentScope as je, onScopeDispose as Re, shallowRef as ee, watchEffect as Ve, toValue as q, onMounted as E, unref as z, onBeforeUnmount as $, onBeforeMount as Ae, defineComponent as B, resolveComponent as x, createBlock as V, openBlock as L, withKeys as Z, withModifiers as H, isRef as Q, withCtx as y, createVNode as C, createTextVNode as O, toDisplayString as R, Transition as qe, createElementBlock as te, createCommentVNode as oe, normalizeStyle as de, createElementVNode as h, Fragment as Oe, renderList as Ie, useTemplateRef as Te } from "vue";
2
+ import { computed as x, provide as T, inject as A, ref as g, getCurrentInstance as _e, hasInjectionContext as ie, watch as K, getCurrentScope as je, onScopeDispose as Re, shallowRef as ee, watchEffect as Ve, toValue as q, onMounted as B, unref as z, onBeforeUnmount as $, onBeforeMount as Ae, defineComponent as E, resolveComponent as b, createBlock as V, openBlock as D, withKeys as Z, withModifiers as H, isRef as Q, withCtx as w, createVNode as L, createTextVNode as O, toDisplayString as R, Transition as qe, createElementBlock as te, createCommentVNode as oe, normalizeStyle as de, createElementVNode as y, Fragment as Oe, renderList as Ie, useTemplateRef as Te } from "vue";
3
3
  import { useI18n as ne } from "vue-i18n";
4
- import { useTheme as fe, useDisplay as Ee } from "vuetify";
5
- import { useRouter as ge, useRoute as Be } from "vue-router";
4
+ import { useTheme as fe, useDisplay as Be } from "vuetify";
5
+ import { useRouter as ge, useRoute as Ee } 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 = x(() => e.global.current.value.colors.primary), a = x(() => e.global.current.value.colors.secondary), o = x(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), n = x(() => e.current.value.dark ? "#272727" : "#eeeeee"), l = x(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = x(() => e.current.value.dark ? "#303030" : "#f6f6f6"), r = x(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
9
9
  return {
10
10
  primaryColor: t,
11
11
  secondaryColor: a,
@@ -51,8 +51,8 @@ function ae(e, t) {
51
51
  for (var l = document.cookie ? document.cookie.split("; ") : [], c = {}, r = 0; r < l.length; r++) {
52
52
  var u = l[r].split("="), s = u.slice(1).join("=");
53
53
  try {
54
- var d = decodeURIComponent(u[0]);
55
- if (c[d] = e.read(s, d), n === d)
54
+ var i = decodeURIComponent(u[0]);
55
+ if (c[i] = e.read(s, i), n === i)
56
56
  break;
57
57
  } catch {
58
58
  }
@@ -380,8 +380,8 @@ function G(e) {
380
380
  c > 0 && c > a && (t = n, a = c);
381
381
  }), t;
382
382
  }
383
- const J = v("");
384
- function M(e, t, a) {
383
+ const J = g("");
384
+ function S(e, t, a) {
385
385
  t === "/" && (t = a);
386
386
  const o = G(e), n = G(t);
387
387
  if (!o) {
@@ -409,35 +409,35 @@ function _a(e, t, a, o) {
409
409
  if (n)
410
410
  if (l) {
411
411
  const r = "/main";
412
- M(r, t.path, o), a({ path: r });
412
+ S(r, t.path, o), a({ path: r });
413
413
  } else
414
- M(e.path, t.path, o), a();
414
+ S(e.path, t.path, o), a();
415
415
  else {
416
416
  const r = "/passport/login";
417
- M(r, t.path, o), a({ path: r });
417
+ S(r, t.path, o), a({ path: r });
418
418
  }
419
419
  else if (c.requiredState === "org")
420
420
  if (n)
421
421
  if (l)
422
- M(e.path, t.path, o), a();
422
+ S(e.path, t.path, o), a();
423
423
  else {
424
424
  const r = "/org/joinOrCreate";
425
- M(r, t.path, o), a({ path: r });
425
+ S(r, t.path, o), a({ path: r });
426
426
  }
427
427
  else {
428
428
  const r = "/passport/login";
429
- M(r, t.path, o), a({ path: r });
429
+ S(r, t.path, o), a({ path: r });
430
430
  }
431
431
  else if (n)
432
432
  if (l) {
433
433
  const r = "/main";
434
- M(r, t.path, o), a({ path: r });
434
+ S(r, t.path, o), a({ path: r });
435
435
  } else {
436
436
  const r = "/org/joinOrCreate";
437
- M(r, t.path, o), a({ path: r });
437
+ S(r, t.path, o), a({ path: r });
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;
@@ -499,7 +499,7 @@ function yt(e) {
499
499
  function wt(...e) {
500
500
  const t = [], a = () => {
501
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(() => {
502
+ }, o = (r, u, s, i) => (r.addEventListener(u, s, i), () => r.removeEventListener(u, s, i)), n = x(() => {
503
503
  const r = P(q(e[0])).filter((u) => u != null);
504
504
  return r.every((u) => typeof u != "string") ? r : void 0;
505
505
  }), l = ht(
@@ -513,14 +513,14 @@ function wt(...e) {
513
513
  q(n.value ? e[3] : e[2])
514
514
  ];
515
515
  },
516
- ([r, u, s, d]) => {
516
+ ([r, u, s, i]) => {
517
517
  if (a(), !(r != null && r.length) || !(u != null && u.length) || !(s != null && s.length))
518
518
  return;
519
- const g = mt(d) ? { ...d } : d;
519
+ const v = mt(i) ? { ...i } : i;
520
520
  t.push(
521
521
  ...r.flatMap(
522
- (b) => u.flatMap(
523
- (m) => s.map((_) => o(b, m, _, g))
522
+ (k) => u.flatMap(
523
+ (m) => s.map((_) => o(k, m, _, v))
524
524
  )
525
525
  )
526
526
  );
@@ -533,13 +533,13 @@ function wt(...e) {
533
533
  }
534
534
  function xt() {
535
535
  const e = ee(!1), t = _e();
536
- return t && E(() => {
536
+ return t && B(() => {
537
537
  e.value = !0;
538
538
  }, t), e;
539
539
  }
540
540
  function bt(e) {
541
541
  const t = xt();
542
- return w(() => (t.value, !!e()));
542
+ return x(() => (t.value, !!e()));
543
543
  }
544
544
  const kt = Symbol("vueuse-ssr-width");
545
545
  function Ct() {
@@ -547,76 +547,82 @@ 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) => {
550
+ const { window: a = Le, ssrWidth: o = Ct() } = t, n = bt(() => a && "matchMedia" in a && typeof a.matchMedia == "function"), l = g(typeof o == "number"), c = ee(), r = ee(!1), u = (s) => {
551
551
  r.value = s.matches;
552
552
  };
553
553
  return Ve(() => {
554
554
  if (l.value) {
555
555
  l.value = !n.value;
556
556
  const s = q(e).split(",");
557
- r.value = s.some((d) => {
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
- let _ = !!(b || m);
560
- return b && _ && (_ = o >= pe(b[1])), m && _ && (_ = o <= pe(m[1])), g ? !_ : _;
557
+ r.value = s.some((i) => {
558
+ const v = i.includes("not all"), k = i.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = i.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
559
+ let _ = !!(k || m);
560
+ return k && _ && (_ = o >= pe(k[1])), m && _ && (_ = o <= pe(m[1])), v ? !_ : _;
561
561
  });
562
562
  return;
563
563
  }
564
564
  n.value && (c.value = a.matchMedia(q(e)), r.value = c.value.matches);
565
- }), wt(c, "change", u, { passive: !0 }), w(() => r.value);
565
+ }), wt(c, "change", u, { passive: !0 }), x(() => r.value);
566
566
  }
567
567
  function Dt(e) {
568
568
  return Lt("(prefers-color-scheme: dark)", e);
569
569
  }
570
570
  function fa(e, t, a, o, n, l) {
571
- const c = Be(), r = ge();
571
+ const c = Ee(), r = ge();
572
572
  Ye(e), Pe(t), et(a), at(o), ot(n), nt(l);
573
573
  const u = fe(), s = Dt();
574
574
  K(
575
575
  e,
576
576
  () => {
577
- let i = !1;
578
- typeof e.value == "boolean" ? i = e.value : i = s.value, u.global.name.value = i ? "dark" : "light";
577
+ let d = !1;
578
+ typeof e.value == "boolean" ? d = e.value : d = s.value, u.global.name.value = d ? "dark" : "light";
579
579
  },
580
580
  { immediate: !0 }
581
581
  );
582
- const d = (i) => {
583
- if (i.key === "Escape") {
584
- g();
585
- return;
586
- }
587
- }, g = () => {
588
- var k;
582
+ const i = () => {
583
+ var C;
589
584
  if (!st(l)) {
590
585
  Ce(l, "waitDlg") || it(l);
591
586
  return;
592
587
  }
593
- const i = G(c.path);
594
- (i == null ? void 0 : i.level) === 0 ? (k = navigator == null ? void 0 : navigator.Backbutton) == null || k.goHome(
588
+ const d = G(c.path);
589
+ if (!d) {
590
+ console.assert(!1);
591
+ return;
592
+ }
593
+ d.level === 0 ? (C = navigator == null ? void 0 : navigator.Backbutton) == null || C.goHome(
595
594
  () => {
596
595
  },
597
596
  () => {
598
597
  }
599
598
  ) : r.back();
599
+ }, v = (d) => {
600
+ if (d.key === "Escape") {
601
+ i();
602
+ return;
603
+ }
604
+ }, k = () => {
605
+ i();
600
606
  };
601
- E(() => {
602
- window.addEventListener("keydown", d), p.on("backbutton", g);
607
+ B(() => {
608
+ window.addEventListener("keydown", v), p.on("backbutton", k);
603
609
  }), $(() => {
604
- window.removeEventListener("keydown", d), p.off("backbutton", g);
610
+ window.removeEventListener("keydown", v), p.off("backbutton", k);
605
611
  });
606
- const b = (i) => {
607
- e.value = i;
608
- }, m = (i) => {
609
- t.value = i;
610
- }, _ = (i) => {
611
- const k = i;
612
- a.value = k[0], o.value = k[1];
613
- }, D = (i) => {
614
- n.value = i;
612
+ const m = (d) => {
613
+ e.value = d;
614
+ }, _ = (d) => {
615
+ t.value = d;
616
+ }, M = (d) => {
617
+ const C = d;
618
+ a.value = C[0], o.value = C[1];
619
+ }, h = (d) => {
620
+ n.value = d;
615
621
  };
616
622
  Ae(() => {
617
- p.on("updateDark", b), p.on("updateLocale", m), p.on("updatePermission", _), p.on("updateLastAppPath", D), p.emit("syncGlobalState");
623
+ p.on("updateDark", m), p.on("updateLocale", _), p.on("updatePermission", M), p.on("updateLastAppPath", h), p.emit("syncGlobalState");
618
624
  }), $(() => {
619
- p.off("updateDark", b), p.off("updateLocale", m), p.off("updatePermission", _), p.off("updateLastAppPath", D);
625
+ p.off("updateDark", m), p.off("updateLocale", _), p.off("updatePermission", M), p.off("updateLastAppPath", h);
620
626
  });
621
627
  }
622
628
  function ga() {
@@ -631,11 +637,11 @@ function ga() {
631
637
  return { verifyPermission: t };
632
638
  }
633
639
  function va() {
634
- const e = w(() => !!window.cordova), t = Ee(), a = w(() => t.width.value <= 1280 ? t.width.value + "px" : t.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
640
+ const e = x(() => !!window.cordova), t = Be(), a = x(() => t.width.value <= 1280 ? t.width.value + "px" : t.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
635
641
  return { sysBarAvail: e, compactWidth: a };
636
642
  }
637
643
  function le(e, t) {
638
- const a = rt(), o = w({
644
+ const a = rt(), o = x({
639
645
  get() {
640
646
  return Ce(a, e);
641
647
  },
@@ -645,66 +651,66 @@ function le(e, t) {
645
651
  }), n = (l) => {
646
652
  t == null || t(l), o.value = !0;
647
653
  };
648
- return E(() => {
654
+ return B(() => {
649
655
  p.on(e, n);
650
656
  }), $(() => {
651
657
  p.off(e, n);
652
658
  }), { open: o };
653
659
  }
654
- const St = /* @__PURE__ */ B({
660
+ const Mt = /* @__PURE__ */ E({
655
661
  __name: "index",
656
662
  setup(e) {
657
- const { t } = ne(), a = v(""), o = v(""), n = v(""), l = v(""), c = v(""), r = v("");
663
+ const { t } = ne(), a = g(""), o = g(""), n = g(""), l = g(""), c = g(""), r = g("");
658
664
  let u = 0, s = !1;
659
- const d = (m) => {
660
- var D, i, k, S;
665
+ const i = (m) => {
666
+ var M, h, d, C;
661
667
  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;
663
- }, { open: g } = le("confirmDlg", d), b = () => {
664
- g.value = !1, s || (p.emit("confirmDlgResult" + u, !0), s = !0);
668
+ a.value = _.title, o.value = _.text, n.value = ((M = _.cancel) == null ? void 0 : M.color) ?? "primary", l.value = ((h = _.cancel) == null ? void 0 : h.text) ?? t("dlg.common.cancel"), c.value = ((d = _.confirm) == null ? void 0 : d.color) ?? "primary", r.value = ((C = _.confirm) == null ? void 0 : C.text) ?? t("dlg.common.confirm"), u = _.seq, s = !1, v.value = !0;
669
+ }, { open: v } = le("confirmDlg", i), k = () => {
670
+ v.value = !1, s || (p.emit("confirmDlgResult" + u, !0), s = !0);
665
671
  };
666
- return K(g, (m) => {
672
+ return K(v, (m) => {
667
673
  !m && !s && (p.emit("confirmDlgResult" + u, !1), s = !0);
668
674
  }), (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");
670
- return L(), V(f, {
671
- modelValue: z(g),
672
- "onUpdate:modelValue": _[1] || (_[1] = (j) => Q(g) ? g.value = j : null),
675
+ const M = b("v-card-text"), h = b("v-btn"), d = b("v-card-actions"), C = b("v-card"), f = b("v-dialog");
676
+ return D(), V(f, {
677
+ modelValue: z(v),
678
+ "onUpdate:modelValue": _[1] || (_[1] = (j) => Q(v) ? v.value = j : null),
673
679
  transition: "dialog-top-transition",
674
680
  "max-width": "600px",
675
681
  attach: "",
676
682
  onKeydown: [
677
- _[2] || (_[2] = Z(H((j) => g.value = !1, ["stop", "prevent"]), ["esc"])),
678
- Z(H(b, ["stop", "prevent"]), ["enter"])
683
+ _[2] || (_[2] = Z(H((j) => v.value = !1, ["stop", "prevent"]), ["esc"])),
684
+ Z(H(k, ["stop", "prevent"]), ["enter"])
679
685
  ]
680
686
  }, {
681
- default: y(() => [
682
- C(S, { title: a.value }, {
683
- default: y(() => [
684
- C(D, null, {
685
- default: y(() => [
687
+ default: w(() => [
688
+ L(C, { title: a.value }, {
689
+ default: w(() => [
690
+ L(M, null, {
691
+ default: w(() => [
686
692
  O(R(o.value), 1)
687
693
  ]),
688
694
  _: 1
689
695
  }),
690
- C(k, { class: "d-flex justify-end" }, {
691
- default: y(() => [
692
- C(i, {
696
+ L(d, { class: "d-flex justify-end" }, {
697
+ default: w(() => [
698
+ L(h, {
693
699
  color: n.value,
694
700
  variant: "text",
695
- onClick: _[0] || (_[0] = (j) => g.value = !1)
701
+ onClick: _[0] || (_[0] = (j) => v.value = !1)
696
702
  }, {
697
- default: y(() => [
703
+ default: w(() => [
698
704
  O(R(l.value), 1)
699
705
  ]),
700
706
  _: 1
701
707
  }, 8, ["color"]),
702
- C(i, {
708
+ L(h, {
703
709
  color: c.value,
704
710
  variant: "text",
705
- onClick: b
711
+ onClick: k
706
712
  }, {
707
- default: y(() => [
713
+ default: w(() => [
708
714
  O(R(r.value), 1)
709
715
  ]),
710
716
  _: 1
@@ -720,38 +726,38 @@ const St = /* @__PURE__ */ B({
720
726
  }, 8, ["modelValue", "onKeydown"]);
721
727
  };
722
728
  }
723
- }), Mt = /* @__PURE__ */ B({
729
+ }), St = /* @__PURE__ */ E({
724
730
  __name: "index",
725
731
  props: {
726
732
  open: { type: Boolean, default: !0 },
727
733
  zIndex: { default: 1 }
728
734
  },
729
735
  setup(e) {
730
- const { backgroundColor2: t } = Ue(), a = w(() => ({
736
+ const { backgroundColor2: t } = Ue(), a = x(() => ({
731
737
  background: t.value,
732
738
  zIndex: e.zIndex
733
739
  }));
734
740
  let o = 0;
735
- return (n, l) => (L(), V(qe, { name: "fade" }, {
736
- default: y(() => [
737
- n.open ? (L(), te("div", {
741
+ return (n, l) => (D(), V(qe, { name: "fade" }, {
742
+ default: w(() => [
743
+ n.open ? (D(), te("div", {
738
744
  key: Q(o) ? ++o.value : ++o,
739
745
  class: "x-cont",
740
746
  style: de(a.value)
741
747
  }, l[0] || (l[0] = [
742
- h("div", { class: "lds-spinner" }, [
743
- h("div"),
744
- h("div"),
745
- h("div"),
746
- h("div"),
747
- h("div"),
748
- h("div"),
749
- h("div"),
750
- h("div"),
751
- h("div"),
752
- h("div"),
753
- h("div"),
754
- h("div")
748
+ y("div", { class: "lds-spinner" }, [
749
+ y("div"),
750
+ y("div"),
751
+ y("div"),
752
+ y("div"),
753
+ y("div"),
754
+ y("div"),
755
+ y("div"),
756
+ y("div"),
757
+ y("div"),
758
+ y("div"),
759
+ y("div"),
760
+ y("div")
755
761
  ], -1)
756
762
  ]), 4)) : oe("", !0)
757
763
  ]),
@@ -763,9 +769,9 @@ const St = /* @__PURE__ */ B({
763
769
  for (const [o, n] of t)
764
770
  a[o] = n;
765
771
  return a;
766
- }, jt = /* @__PURE__ */ ce(Mt, [["__scopeId", "data-v-0c686889"]]);
772
+ }, jt = /* @__PURE__ */ ce(St, [["__scopeId", "data-v-0c686889"]]);
767
773
  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
- const It = /* @__PURE__ */ B({
774
+ const It = /* @__PURE__ */ E({
769
775
  __name: "item",
770
776
  props: {
771
777
  id: {},
@@ -775,10 +781,10 @@ const It = /* @__PURE__ */ B({
775
781
  },
776
782
  emits: ["timeout"],
777
783
  setup(e, { emit: t }) {
778
- const a = e, o = w(() => ({
784
+ const a = e, o = x(() => ({
779
785
  width: "calc(100% - 64px)",
780
786
  overflowWrap: "break-word"
781
- })), n = w(() => {
787
+ })), n = x(() => {
782
788
  switch (a.type) {
783
789
  case "success":
784
790
  return Vt;
@@ -791,68 +797,68 @@ const It = /* @__PURE__ */ B({
791
797
  default:
792
798
  return "";
793
799
  }
794
- }), l = v(!0), c = t;
795
- return E(() => {
800
+ }), l = g(!0), c = t;
801
+ return B(() => {
796
802
  setTimeout(() => {
797
803
  c("timeout", a.id);
798
804
  }, a.timeout);
799
805
  }), K(l, (r) => {
800
806
  r || c("timeout", a.id);
801
807
  }), (r, u) => {
802
- const s = x("v-icon"), d = x("v-sheet");
803
- return L(), V(d, {
808
+ const s = b("v-icon"), i = b("v-sheet");
809
+ return D(), V(i, {
804
810
  class: "x-item d-flex align-center py-2 mb-2",
805
811
  color: a.type,
806
812
  elevation: 1
807
813
  }, {
808
- default: y(() => [
809
- n.value ? (L(), V(s, {
814
+ default: w(() => [
815
+ n.value ? (D(), V(s, {
810
816
  key: 0,
811
817
  class: "mx-1",
812
818
  icon: n.value
813
819
  }, null, 8, ["icon"])) : oe("", !0),
814
- h("div", {
820
+ y("div", {
815
821
  style: de(o.value)
816
822
  }, R(a.text), 5),
817
- C(s, {
823
+ L(s, {
818
824
  class: "mx-1",
819
825
  icon: z(At),
820
- onClick: u[0] || (u[0] = (g) => c("timeout", a.id))
826
+ onClick: u[0] || (u[0] = (v) => c("timeout", a.id))
821
827
  }, null, 8, ["icon"])
822
828
  ]),
823
829
  _: 1
824
830
  }, 8, ["color"]);
825
831
  };
826
832
  }
827
- }), Tt = /* @__PURE__ */ ce(It, [["__scopeId", "data-v-d5cfe252"]]), Et = /* @__PURE__ */ B({
833
+ }), Tt = /* @__PURE__ */ ce(It, [["__scopeId", "data-v-d5cfe252"]]), Bt = /* @__PURE__ */ E({
828
834
  __name: "index",
829
835
  setup(e) {
830
- const t = v([]);
831
- E(() => {
836
+ const t = g([]);
837
+ B(() => {
832
838
  p.on("message", a);
833
839
  }), $(() => {
834
840
  p.off("message", a);
835
841
  });
836
842
  const a = (r) => {
837
- const { type: u, text: s, timeout: d } = r;
838
- l(u, s, d);
843
+ const { type: u, text: s, timeout: i } = r;
844
+ l(u, s, i);
839
845
  }, o = (r) => {
840
846
  c(r);
841
847
  };
842
848
  let n = 0;
843
849
  const l = (r, u, s) => {
844
- const d = n++;
845
- t.value.push({ id: d, type: r, text: u, timeout: s });
850
+ const i = n++;
851
+ t.value.push({ id: i, type: r, text: u, timeout: s });
846
852
  }, c = (r) => {
847
853
  const u = t.value.findIndex((s) => s.id === r);
848
854
  u >= 0 && t.value.splice(u, 1);
849
855
  };
850
- return (r, u) => (L(), te("div", {
856
+ return (r, u) => (D(), te("div", {
851
857
  class: "x-cont d-flex flex-column-reverse align-center",
852
858
  onClick: u[0] || (u[0] = H(() => {
853
859
  }, ["stop"]))
854
860
  }, [
855
- (L(!0), te(Oe, null, Ie(t.value, (s) => (L(), V(Tt, {
861
+ (D(!0), te(Oe, null, Ie(t.value, (s) => (D(), V(Tt, {
856
862
  id: s.id,
857
863
  key: s.id,
858
864
  type: s.type,
@@ -862,47 +868,47 @@ const It = /* @__PURE__ */ B({
862
868
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
863
869
  ]));
864
870
  }
865
- }), Bt = /* @__PURE__ */ ce(Et, [["__scopeId", "data-v-c6a59757"]]), Wt = /* @__PURE__ */ B({
871
+ }), Et = /* @__PURE__ */ ce(Bt, [["__scopeId", "data-v-c6a59757"]]), Wt = /* @__PURE__ */ E({
866
872
  __name: "index",
867
873
  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");
874
+ const { t } = ne(), a = g(""), o = g(""), n = g(""), l = g(""), c = g(), r = g(""), u = g(""), s = g(""), i = g(""), v = g(""), k = Te("target");
869
875
  let m = 0, _ = !1;
870
- const D = async (S) => {
876
+ const M = async (C) => {
871
877
  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();
874
- }, { open: i } = le("promptDlg", D), k = () => {
875
- i.value = !1, _ || (p.emit("promptDlgResult" + m, r.value ?? ""), _ = !0);
878
+ const f = C;
879
+ 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"), i.value = ((X = f.confirm) == null ? void 0 : X.color) ?? "primary", v.value = ((W = f.confirm) == null ? void 0 : W.text) ?? t("dlg.common.confirm"), m = f.seq, _ = !1, h.value = !0, await re(() => !!k.value), k.value.focus();
880
+ }, { open: h } = le("promptDlg", M), d = () => {
881
+ h.value = !1, _ || (p.emit("promptDlgResult" + m, r.value ?? ""), _ = !0);
876
882
  };
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, {
882
- modelValue: z(i),
883
- "onUpdate:modelValue": f[2] || (f[2] = (U) => Q(i) ? i.value = U : null),
883
+ return K(h, (C) => {
884
+ !C && !_ && (p.emit("promptDlgResult" + m, void 0), _ = !0);
885
+ }), (C, f) => {
886
+ const j = b("v-card-text"), F = b("v-text-field"), X = b("v-form"), W = b("v-btn"), De = b("v-card-actions"), Me = b("v-card"), Se = b("v-dialog");
887
+ return D(), V(Se, {
888
+ modelValue: z(h),
889
+ "onUpdate:modelValue": f[2] || (f[2] = (U) => Q(h) ? h.value = U : null),
884
890
  transition: "dialog-top-transition",
885
891
  "max-width": "600px",
886
892
  attach: "",
887
893
  onKeydown: [
888
- f[3] || (f[3] = Z(H((U) => i.value = !1, ["stop", "prevent"]), ["esc"])),
889
- Z(H(k, ["stop", "prevent"]), ["enter"])
894
+ f[3] || (f[3] = Z(H((U) => h.value = !1, ["stop", "prevent"]), ["esc"])),
895
+ Z(H(d, ["stop", "prevent"]), ["enter"])
890
896
  ]
891
897
  }, {
892
- default: y(() => [
893
- C(Se, { title: a.value }, {
894
- default: y(() => [
895
- o.value ? (L(), V(j, { key: 0 }, {
896
- default: y(() => [
898
+ default: w(() => [
899
+ L(Me, { title: a.value }, {
900
+ default: w(() => [
901
+ o.value ? (D(), V(j, { key: 0 }, {
902
+ default: w(() => [
897
903
  O(R(o.value), 1)
898
904
  ]),
899
905
  _: 1
900
906
  })) : oe("", !0),
901
- C(X, { class: "mx-3" }, {
902
- default: y(() => [
903
- C(F, {
907
+ L(X, { class: "mx-3" }, {
908
+ default: w(() => [
909
+ L(F, {
904
910
  ref_key: "target",
905
- ref: b,
911
+ ref: k,
906
912
  modelValue: r.value,
907
913
  "onUpdate:modelValue": f[0] || (f[0] = (U) => r.value = U),
908
914
  label: n.value,
@@ -912,25 +918,25 @@ const It = /* @__PURE__ */ B({
912
918
  ]),
913
919
  _: 1
914
920
  }),
915
- C(De, { class: "d-flex justify-end" }, {
916
- default: y(() => [
917
- C(W, {
921
+ L(De, { class: "d-flex justify-end" }, {
922
+ default: w(() => [
923
+ L(W, {
918
924
  color: u.value,
919
925
  variant: "text",
920
- onClick: f[1] || (f[1] = (U) => i.value = !1)
926
+ onClick: f[1] || (f[1] = (U) => h.value = !1)
921
927
  }, {
922
- default: y(() => [
928
+ default: w(() => [
923
929
  O(R(s.value), 1)
924
930
  ]),
925
931
  _: 1
926
932
  }, 8, ["color"]),
927
- C(W, {
928
- color: d.value,
933
+ L(W, {
934
+ color: i.value,
929
935
  variant: "text",
930
- onClick: k
936
+ onClick: d
931
937
  }, {
932
- default: y(() => [
933
- O(R(g.value), 1)
938
+ default: w(() => [
939
+ O(R(v.value), 1)
934
940
  ]),
935
941
  _: 1
936
942
  }, 8, ["color"])
@@ -945,39 +951,39 @@ const It = /* @__PURE__ */ B({
945
951
  }, 8, ["modelValue", "onKeydown"]);
946
952
  };
947
953
  }
948
- }), Ut = { class: "mx-auto my-auto" }, $t = { class: "w-100 h-100 d-flex align-center justify-center" }, Ht = { class: "text-body-1" }, Kt = /* @__PURE__ */ B({
954
+ }), Ut = { class: "mx-auto my-auto" }, $t = { class: "w-100 h-100 d-flex align-center justify-center" }, Ht = { class: "text-body-1" }, Kt = /* @__PURE__ */ E({
949
955
  __name: "index",
950
956
  setup(e) {
951
- const { t } = ne(), a = v(""), o = (c) => {
957
+ const { t } = ne(), a = g(""), o = (c) => {
952
958
  const r = c;
953
959
  a.value = r.text ?? t("dlg.common.waiting"), l.value = !0;
954
960
  }, n = () => {
955
961
  l.value = !1;
956
962
  }, { open: l } = le("waitDlg", o);
957
- return E(() => {
963
+ return B(() => {
958
964
  p.on("closeWaitDlg", n);
959
965
  }), $(() => {
960
966
  p.off("closeWaitDlg", n);
961
967
  }), (c, r) => {
962
- const u = x("v-card"), s = x("v-dialog");
963
- return L(), V(s, {
968
+ const u = b("v-card"), s = b("v-dialog");
969
+ return D(), V(s, {
964
970
  modelValue: z(l),
965
- "onUpdate:modelValue": r[0] || (r[0] = (d) => Q(l) ? l.value = d : null),
971
+ "onUpdate:modelValue": r[0] || (r[0] = (i) => Q(l) ? l.value = i : null),
966
972
  persistent: "",
967
973
  "no-click-animation": "",
968
974
  fullscreen: "",
969
975
  attach: ""
970
976
  }, {
971
- default: y(() => [
972
- h("div", Ut, [
973
- C(u, {
977
+ default: w(() => [
978
+ y("div", Ut, [
979
+ L(u, {
974
980
  width: "300px",
975
981
  height: "80px",
976
982
  loading: ""
977
983
  }, {
978
- default: y(() => [
979
- h("div", $t, [
980
- h("span", Ht, R(a.value), 1)
984
+ default: w(() => [
985
+ y("div", $t, [
986
+ y("span", Ht, R(a.value), 1)
981
987
  ])
982
988
  ]),
983
989
  _: 1
@@ -989,7 +995,7 @@ const It = /* @__PURE__ */ B({
989
995
  };
990
996
  }
991
997
  }), zt = (e) => {
992
- e.component("XConfirmDlg", St), e.component("XLoading", jt), e.component("XMessage", Bt), e.component("XPromptDlg", Wt), e.component("XWaitDlg", Kt);
998
+ e.component("XConfirmDlg", Mt), e.component("XLoading", jt), e.component("XMessage", Et), e.component("XPromptDlg", Wt), e.component("XWaitDlg", Kt);
993
999
  }, Ft = (e, t, a) => {
994
1000
  const o = e[t];
995
1001
  return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((n, l) => {
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.5",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",