x-essential-lib 0.9.12 → 0.9.13

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.
@@ -5,4 +5,5 @@ export declare function useSystem(): {
5
5
  isMobile: () => boolean;
6
6
  nameOfList: (entries: string[], stack?: boolean, instance?: string) => string;
7
7
  sentenceOfAsk: (verb: string, object: string, name: string) => string;
8
+ sentenceOfOperate: (operate: string, result: string) => string;
8
9
  };
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.id="x-essential-lib",d.appendChild(document.createTextNode('.fade-leave-active[data-v-83c3cd1d]{transition:opacity .5s ease}.fade-leave-to[data-v-83c3cd1d]{opacity:0}.x-cont[data-v-83c3cd1d]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-83c3cd1d]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-83c3cd1d]{transform-origin:20px 20px;animation:lds-spinner-83c3cd1d 1.2s linear infinite}.lds-spinner div[data-v-83c3cd1d]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-83c3cd1d]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-83c3cd1d]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-83c3cd1d]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-83c3cd1d]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-83c3cd1d]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-83c3cd1d]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-83c3cd1d]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-83c3cd1d]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-83c3cd1d]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-83c3cd1d{0%{opacity:1}to{opacity:0}}.x-item[data-v-f1f60167]{width:600px}@media (max-width: 600px){.x-item[data-v-f1f60167]{width:calc(100vw - 16px)}}.x-cont[data-v-b482df18]{position:fixed;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(d)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { computed as j, provide as $, inject as K, ref as p, watchEffect as ne, onMounted as W, onBeforeUnmount as N, onBeforeMount as De, defineComponent as E, watch as J, resolveComponent as y, createBlock as A, openBlock as q, withKeys as F, unref as U, withModifiers as I, isRef as X, withCtx as v, createVNode as w, createTextVNode as M, toDisplayString as S, Transition as Ce, createElementBlock as ee, createCommentVNode as te, normalizeStyle as se, createElementVNode as D, Fragment as Ve, renderList as je, useTemplateRef as pe } from "vue";
2
+ import { computed as O, provide as U, inject as K, ref as s, watchEffect as ne, onMounted as W, onBeforeUnmount as N, onBeforeMount as De, defineComponent as $, watch as J, resolveComponent as y, createBlock as A, openBlock as j, withKeys as F, unref as E, withModifiers as I, isRef as X, withCtx as m, createVNode as h, createTextVNode as M, toDisplayString as S, Transition as Ce, createElementBlock as ee, createCommentVNode as te, normalizeStyle as se, createElementVNode as C, Fragment as Ve, renderList as Oe, useTemplateRef as pe } from "vue";
3
3
  import { useI18n as z } from "vue-i18n";
4
- import { useTheme as _e, useDisplay as qe } from "vuetify";
5
- import { useRouter as de, useRoute as Oe } from "vue-router";
4
+ import { useTheme as _e, useDisplay as je } from "vuetify";
5
+ import { useRouter as de, useRoute as qe } from "vue-router";
6
6
  import Se from "axios";
7
7
  import { a as T, m as Re, u as Le, t as re } from "./vendor.evicfx58.js";
8
8
  function Te() {
9
- const e = _e(), t = j(() => e.global.current.value.colors.primary), a = j(() => e.global.current.value.colors.secondary), o = j(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = j(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = j(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), s = j(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = j(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
9
+ const e = _e(), t = O(() => e.global.current.value.colors.primary), a = O(() => e.global.current.value.colors.secondary), o = O(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = O(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = O(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = O(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = O(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
10
10
  return {
11
11
  primaryColor: t,
12
12
  secondaryColor: a,
13
13
  backgroundColor0: o,
14
14
  backgroundColor1: l,
15
15
  backgroundColor2: r,
16
- highlightColor: s,
16
+ highlightColor: c,
17
17
  borderColor: n
18
18
  };
19
19
  }
@@ -43,12 +43,12 @@ function Be(e) {
43
43
  }
44
44
  function Ie(e, t) {
45
45
  const o = e.response;
46
- return o && (o.status === 401 && Ee(), o.data?.message ? t(o.data?.message) : t({
46
+ return o && (o.status === 401 && $e(), o.data?.message ? t(o.data?.message) : t({
47
47
  code: o.status,
48
48
  message: o.statusText
49
49
  })), Promise.reject(e);
50
50
  }
51
- function Ee() {
51
+ function $e() {
52
52
  T.remove("accessToken"), T.remove("refreshToken"), T.remove("userId"), T.remove("userName"), T.remove("phone"), T.remove("activeOrg"), de().replace({ path: "/passport/login" });
53
53
  }
54
54
  const Vt = (function() {
@@ -59,7 +59,7 @@ const Vt = (function() {
59
59
  })(), u = (function() {
60
60
  return window.eventBus || (window.eventBus = Re(), console.log("eventBus created")), window.eventBus;
61
61
  })();
62
- async function jt(e) {
62
+ async function Ot(e) {
63
63
  return new Promise((t) => {
64
64
  setTimeout(t, e);
65
65
  });
@@ -73,7 +73,7 @@ async function H(e, t, a) {
73
73
  r();
74
74
  });
75
75
  }
76
- function Ue(e, t) {
76
+ function Ee(e, t) {
77
77
  const a = document.getElementById("single-spa-application:" + e);
78
78
  a && (a.classList.remove("app-left", "app-right", "app-reset"), t ? a.classList.add("app-left") : a.classList.add("app-right"), setTimeout(() => {
79
79
  a.classList.add("app-reset");
@@ -84,11 +84,11 @@ function ae() {
84
84
  const e = Date.now();
85
85
  return e - ue > 500 ? (ue = e, !0) : !1;
86
86
  }
87
- let $e = 0;
87
+ let Ue = 0;
88
88
  function oe() {
89
- return ++$e;
89
+ return ++Ue;
90
90
  }
91
- async function qt(e) {
91
+ async function jt(e) {
92
92
  if (!ae())
93
93
  return;
94
94
  let t = !1, a;
@@ -97,7 +97,7 @@ async function qt(e) {
97
97
  }, l = oe();
98
98
  return u.on("confirmDlgResult" + l, o), u.emit("confirmDlg", { ...e, seq: l }), await H(() => t), u.off("confirmDlgResult" + l, o), a;
99
99
  }
100
- async function Ot(e) {
100
+ async function qt(e) {
101
101
  if (!ae())
102
102
  return;
103
103
  let t = !1, a;
@@ -153,37 +153,37 @@ function Ne(e, t, a) {
153
153
  }
154
154
  const ie = "essentialDark", fe = "essentialLocale", ge = "essentialPermissionObjects", ve = "essentialPermissionChecksum", me = "essentialLastAppPath", be = "essentialViews";
155
155
  function We(e) {
156
- $(ie, e);
156
+ U(ie, e);
157
157
  }
158
158
  function It() {
159
159
  return K(ie);
160
160
  }
161
161
  function Xe(e) {
162
- $(fe, e);
162
+ U(fe, e);
163
163
  }
164
- function Et() {
164
+ function $t() {
165
165
  return K(fe);
166
166
  }
167
167
  function ze(e) {
168
- $(ge, e);
168
+ U(ge, e);
169
169
  }
170
170
  function He() {
171
171
  return K(ge);
172
172
  }
173
173
  function Fe(e) {
174
- $(ve, e);
174
+ U(ve, e);
175
175
  }
176
- function Ut() {
176
+ function Et() {
177
177
  return K(ve);
178
178
  }
179
179
  function Ge(e) {
180
- $(me, e);
180
+ U(me, e);
181
181
  }
182
- function $t() {
182
+ function Ut() {
183
183
  return K(me);
184
184
  }
185
185
  function Je(e) {
186
- $(be, e);
186
+ U(be, e);
187
187
  }
188
188
  function Qe() {
189
189
  return K(be);
@@ -304,13 +304,13 @@ function G(e) {
304
304
  const o = e.split("/").filter((l) => l.trim() !== "");
305
305
  return Ye.forEach((l) => {
306
306
  const r = l.path.split("/").filter((n) => n.trim() !== "");
307
- let s = 0;
307
+ let c = 0;
308
308
  for (let n = 0; n < o.length && !(n >= r.length || o[n] !== r[n]); n++)
309
- s++;
310
- s > 0 && s > a && (t = l, a = s);
309
+ c++;
310
+ c > 0 && c > a && (t = l, a = c);
311
311
  }), t;
312
312
  }
313
- const P = p("");
313
+ const P = s("");
314
314
  function L(e, t, a) {
315
315
  t === "/" && (t = a);
316
316
  const o = G(e), l = G(t);
@@ -320,8 +320,8 @@ function L(e, t, a) {
320
320
  }
321
321
  if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !l)
322
322
  return;
323
- const r = o.app === l.app, s = o.path === l.path, n = o.level >= l.level;
324
- r ? s ? P.value = "" : P.value = n ? "inner-left" : "inner-right" : (P.value = "", Ue(o.app, n));
323
+ const r = o.app === l.app, c = o.path === l.path, n = o.level >= l.level;
324
+ r ? c ? P.value = "" : P.value = n ? "inner-left" : "inner-right" : (P.value = "", Ee(o.app, n));
325
325
  }
326
326
  function Ze() {
327
327
  return !!T.get("accessToken");
@@ -330,12 +330,12 @@ function Pe() {
330
330
  return !!T.get("activeOrg");
331
331
  }
332
332
  function Kt(e, t, a, o) {
333
- const l = Ze(), r = Pe(), s = G(e.path);
334
- if (!s) {
333
+ const l = Ze(), r = Pe(), c = G(e.path);
334
+ if (!c) {
335
335
  console.assert(!1), a();
336
336
  return;
337
337
  }
338
- if (s.requiredState === "auth")
338
+ if (c.requiredState === "auth")
339
339
  if (l)
340
340
  if (r) {
341
341
  const n = "/main";
@@ -346,7 +346,7 @@ function Kt(e, t, a, o) {
346
346
  const n = "/passport/login";
347
347
  L(n, t.path, o), a({ path: n });
348
348
  }
349
- else if (s.requiredState === "org")
349
+ else if (c.requiredState === "org")
350
350
  if (l)
351
351
  if (r)
352
352
  L(e.path, t.path, o), a();
@@ -394,58 +394,58 @@ function Wt(e) {
394
394
  e.value = [];
395
395
  }
396
396
  function Xt(e, t, a, o, l, r) {
397
- const s = Oe(), n = de(), _ = Le(), c = p(!1);
397
+ const c = qe(), n = de(), d = Le(), p = s(!1);
398
398
  ne(() => {
399
- let g = !1;
400
- typeof e.value == "boolean" ? g = e.value : g = _.value, c.value = g;
401
- }), We(c), Xe(t), ze(a), Fe(o), Ge(l), Je(r);
402
- const d = _e();
399
+ let v = !1;
400
+ typeof e.value == "boolean" ? v = e.value : v = d.value, p.value = v;
401
+ }), We(p), Xe(t), ze(a), Fe(o), Ge(l), Je(r);
402
+ const _ = _e();
403
403
  ne(() => {
404
- d.change(c.value ? "dark" : "light");
404
+ _.change(p.value ? "dark" : "light");
405
405
  });
406
- const k = () => {
406
+ const x = () => {
407
407
  if (!et(r)) {
408
408
  ye(r, "waitDlg") || ot(r);
409
409
  return;
410
410
  }
411
- const g = G(s.path);
412
- if (!g) {
411
+ const v = G(c.path);
412
+ if (!v) {
413
413
  console.assert(!1);
414
414
  return;
415
415
  }
416
- g.level === 0 ? navigator?.Backbutton?.goHome(
416
+ v.level === 0 ? navigator?.Backbutton?.goHome(
417
417
  () => {
418
418
  },
419
419
  () => {
420
420
  }
421
421
  ) : n.back();
422
- }, m = (g) => {
423
- if (g.key === "Escape") {
424
- k();
422
+ }, b = (v) => {
423
+ if (v.key === "Escape") {
424
+ x();
425
425
  return;
426
426
  }
427
- }, b = () => {
428
- k();
427
+ }, g = () => {
428
+ x();
429
429
  };
430
430
  W(() => {
431
- window.addEventListener("keydown", m), u.on("backbutton", b);
431
+ window.addEventListener("keydown", b), u.on("backbutton", g);
432
432
  }), N(() => {
433
- window.removeEventListener("keydown", m), u.off("backbutton", b);
433
+ window.removeEventListener("keydown", b), u.off("backbutton", g);
434
434
  });
435
- const i = (g) => {
436
- e.value = g;
437
- }, V = (g) => {
438
- t.value = g;
439
- }, h = (g) => {
440
- const R = g;
435
+ const i = (v) => {
436
+ e.value = v;
437
+ }, D = (v) => {
438
+ t.value = v;
439
+ }, k = (v) => {
440
+ const R = v;
441
441
  a.value = R[0], o.value = R[1];
442
- }, f = (g) => {
443
- l.value = g;
442
+ }, f = (v) => {
443
+ l.value = v;
444
444
  };
445
445
  De(() => {
446
- u.on("updateDark", i), u.on("updateLocale", V), u.on("updatePermission", h), u.on("updateLastAppPath", f), u.emit("syncGlobalState");
446
+ u.on("updateDark", i), u.on("updateLocale", D), u.on("updatePermission", k), u.on("updateLastAppPath", f), u.emit("syncGlobalState");
447
447
  }), N(() => {
448
- u.off("updateDark", i), u.off("updateLocale", V), u.off("updatePermission", h), u.off("updateLastAppPath", f);
448
+ u.off("updateDark", i), u.off("updateLocale", D), u.off("updatePermission", k), u.off("updateLastAppPath", f);
449
449
  });
450
450
  }
451
451
  function zt() {
@@ -460,7 +460,7 @@ function zt() {
460
460
  return { verifyPermission: t };
461
461
  }
462
462
  function Ht() {
463
- const { locale: e, t } = z(), a = j(() => !!window.cordova), o = qe(), l = j(() => o.width.value <= 1280 ? o.width.value + "px" : o.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px"), r = j(() => o.xs.value);
463
+ const { locale: e, t } = z(), a = O(() => !!window.cordova), o = je(), l = O(() => o.width.value <= 1280 ? o.width.value + "px" : o.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px"), r = O(() => o.xs.value);
464
464
  return {
465
465
  sysBarAvail: a,
466
466
  compactWidth: l,
@@ -468,20 +468,21 @@ function Ht() {
468
468
  isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
469
469
  navigator.userAgent
470
470
  ),
471
- nameOfList: (c, d, k) => {
472
- let m = "";
473
- const b = c.map((i) => t(i));
474
- return d ? m = b.join(" / ") : e.value === "en" ? m = b.join(" ") : m = b.join(""), k && (m += ` <${k}>`), m;
471
+ nameOfList: (_, x, b) => {
472
+ let g = "";
473
+ const i = _.map((D) => t(D));
474
+ return x ? g = i.join(" / ") : e.value === "en" ? g = i.join(" ") : g = i.join(""), b && (g += ` <${b}>`), g;
475
475
  },
476
- sentenceOfAsk: (c, d, k) => e.value === "en" ? t("dlg.common.ask", {
477
- verb: re(t(c)),
478
- object: re(t(d)),
479
- name: k
480
- }) : t("dlg.common.ask", { verb: t(c), object: t(d), name: k })
476
+ sentenceOfAsk: (_, x, b) => e.value === "en" ? t("dlg.common.ask", {
477
+ verb: re(t(_)),
478
+ object: re(t(x)),
479
+ name: b
480
+ }) : t("dlg.common.ask", { verb: t(_), object: t(x), name: b }),
481
+ sentenceOfOperate: (_, x) => e.value === "en" ? `${t(_)} ${t(x)}` : `${t(_)}${t(x)}`
481
482
  };
482
483
  }
483
484
  function Q(e, t) {
484
- const a = Qe(), o = j({
485
+ const a = Qe(), o = O({
485
486
  get() {
486
487
  return ye(a, e);
487
488
  },
@@ -497,62 +498,62 @@ function Q(e, t) {
497
498
  u.off(e, l);
498
499
  }), { open: o };
499
500
  }
500
- const lt = /* @__PURE__ */ E({
501
+ const lt = /* @__PURE__ */ $({
501
502
  __name: "index",
502
503
  setup(e) {
503
- const { t } = z(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(""), n = p(""), _ = p("");
504
- let c = 0, d = !1;
505
- const k = (i) => {
506
- a.value = i.title, o.value = i.subtitle ?? "", l.value = i.text, r.value = i.cancel?.color ?? "primary", s.value = i.cancel?.text ?? t("dlg.common.cancel"), n.value = i.confirm?.color ?? "primary", _.value = i.confirm?.text ?? t("dlg.common.confirm"), c = i.seq, d = !1, m.value = !0;
507
- }, { open: m } = Q("confirmDlg", k), b = () => {
508
- m.value = !1, d || (u.emit("confirmDlgResult" + c, !0), d = !0);
504
+ const { t } = z(), a = s(""), o = s(""), l = s(""), r = s(""), c = s(""), n = s(""), d = s("");
505
+ let p = 0, _ = !1;
506
+ const x = (i) => {
507
+ a.value = i.title, o.value = i.subtitle ?? "", l.value = i.text, r.value = i.cancel?.color ?? "primary", c.value = i.cancel?.text ?? t("dlg.common.cancel"), n.value = i.confirm?.color ?? "primary", d.value = i.confirm?.text ?? t("dlg.common.confirm"), p = i.seq, _ = !1, b.value = !0;
508
+ }, { open: b } = Q("confirmDlg", x), g = () => {
509
+ b.value = !1, _ || (u.emit("confirmDlgResult" + p, !0), _ = !0);
509
510
  };
510
- return J(m, (i) => {
511
- !i && !d && (u.emit("confirmDlgResult" + c, !1), d = !0);
512
- }), (i, V) => {
513
- const h = y("v-card-text"), f = y("v-btn"), g = y("v-card-actions"), R = y("v-card"), x = y("v-dialog");
514
- return q(), A(x, {
515
- modelValue: U(m),
516
- "onUpdate:modelValue": V[1] || (V[1] = (C) => X(m) ? m.value = C : null),
511
+ return J(b, (i) => {
512
+ !i && !_ && (u.emit("confirmDlgResult" + p, !1), _ = !0);
513
+ }), (i, D) => {
514
+ const k = y("v-card-text"), f = y("v-btn"), v = y("v-card-actions"), R = y("v-card"), w = y("v-dialog");
515
+ return j(), A(w, {
516
+ modelValue: E(b),
517
+ "onUpdate:modelValue": D[1] || (D[1] = (V) => X(b) ? b.value = V : null),
517
518
  attach: "",
518
519
  "max-width": "600px",
519
520
  transition: "dialog-top-transition",
520
521
  onKeydown: [
521
- F(I(b, ["stop", "prevent"]), ["enter"]),
522
- V[2] || (V[2] = F(I((C) => m.value = !1, ["stop", "prevent"]), ["esc"]))
522
+ F(I(g, ["stop", "prevent"]), ["enter"]),
523
+ D[2] || (D[2] = F(I((V) => b.value = !1, ["stop", "prevent"]), ["esc"]))
523
524
  ]
524
525
  }, {
525
- default: v(() => [
526
- w(R, {
526
+ default: m(() => [
527
+ h(R, {
527
528
  subtitle: o.value,
528
529
  title: a.value
529
530
  }, {
530
- default: v(() => [
531
- w(h, null, {
532
- default: v(() => [
531
+ default: m(() => [
532
+ h(k, null, {
533
+ default: m(() => [
533
534
  M(S(l.value), 1)
534
535
  ]),
535
536
  _: 1
536
537
  }),
537
- w(g, { class: "d-flex justify-end" }, {
538
- default: v(() => [
539
- w(f, {
538
+ h(v, { class: "d-flex justify-end" }, {
539
+ default: m(() => [
540
+ h(f, {
540
541
  color: r.value,
541
542
  variant: "text",
542
- onClick: V[0] || (V[0] = (C) => m.value = !1)
543
+ onClick: D[0] || (D[0] = (V) => b.value = !1)
543
544
  }, {
544
- default: v(() => [
545
- M(S(s.value), 1)
545
+ default: m(() => [
546
+ M(S(c.value), 1)
546
547
  ]),
547
548
  _: 1
548
549
  }, 8, ["color"]),
549
- w(f, {
550
+ h(f, {
550
551
  color: n.value,
551
552
  variant: "text",
552
- onClick: b
553
+ onClick: g
553
554
  }, {
554
- default: v(() => [
555
- M(S(_.value), 1)
555
+ default: m(() => [
556
+ M(S(d.value), 1)
556
557
  ]),
557
558
  _: 1
558
559
  }, 8, ["color"])
@@ -567,38 +568,38 @@ const lt = /* @__PURE__ */ E({
567
568
  }, 8, ["modelValue", "onKeydown"]);
568
569
  };
569
570
  }
570
- }), nt = /* @__PURE__ */ E({
571
+ }), nt = /* @__PURE__ */ $({
571
572
  __name: "index",
572
573
  props: {
573
574
  open: { type: Boolean, default: !0 },
574
575
  zIndex: { default: 1 }
575
576
  },
576
577
  setup(e) {
577
- const { backgroundColor2: t } = Te(), a = j(() => ({
578
+ const { backgroundColor2: t } = Te(), a = O(() => ({
578
579
  background: t.value,
579
580
  zIndex: e.zIndex
580
581
  }));
581
582
  let o = 0;
582
- return (l, r) => (q(), A(Ce, { name: "fade" }, {
583
- default: v(() => [
584
- e.open ? (q(), ee("div", {
583
+ return (l, r) => (j(), A(Ce, { name: "fade" }, {
584
+ default: m(() => [
585
+ e.open ? (j(), ee("div", {
585
586
  key: X(o) ? ++o.value : ++o,
586
587
  class: "x-cont",
587
588
  style: se(a.value)
588
589
  }, [...r[0] || (r[0] = [
589
- D("div", { class: "lds-spinner" }, [
590
- D("div"),
591
- D("div"),
592
- D("div"),
593
- D("div"),
594
- D("div"),
595
- D("div"),
596
- D("div"),
597
- D("div"),
598
- D("div"),
599
- D("div"),
600
- D("div"),
601
- D("div")
590
+ C("div", { class: "lds-spinner" }, [
591
+ C("div"),
592
+ C("div"),
593
+ C("div"),
594
+ C("div"),
595
+ C("div"),
596
+ C("div"),
597
+ C("div"),
598
+ C("div"),
599
+ C("div"),
600
+ C("div"),
601
+ C("div"),
602
+ C("div")
602
603
  ], -1)
603
604
  ])], 4)) : te("", !0)
604
605
  ]),
@@ -610,7 +611,7 @@ const lt = /* @__PURE__ */ E({
610
611
  for (const [o, l] of t)
611
612
  a[o] = l;
612
613
  return a;
613
- }, rt = /* @__PURE__ */ le(nt, [["__scopeId", "data-v-83c3cd1d"]]), ut = /* @__PURE__ */ E({
614
+ }, rt = /* @__PURE__ */ le(nt, [["__scopeId", "data-v-83c3cd1d"]]), ut = /* @__PURE__ */ $({
614
615
  __name: "item",
615
616
  props: {
616
617
  id: {},
@@ -620,10 +621,10 @@ const lt = /* @__PURE__ */ E({
620
621
  },
621
622
  emits: ["timeout"],
622
623
  setup(e, { emit: t }) {
623
- const a = j(() => ({
624
+ const a = O(() => ({
624
625
  width: "calc(100% - 64px)",
625
626
  overflowWrap: "break-word"
626
- })), o = j(() => {
627
+ })), o = O(() => {
627
628
  switch (e.type) {
628
629
  case "success":
629
630
  return "mdi-check-circle";
@@ -636,140 +637,140 @@ const lt = /* @__PURE__ */ E({
636
637
  default:
637
638
  return "";
638
639
  }
639
- }), l = p(!0), r = t;
640
+ }), l = s(!0), r = t;
640
641
  return W(() => {
641
642
  setTimeout(() => {
642
643
  r("timeout", e.id);
643
644
  }, e.timeout);
644
- }), J(l, (s) => {
645
- s || r("timeout", e.id);
646
- }), (s, n) => {
647
- const _ = y("v-icon"), c = y("v-sheet");
648
- return q(), A(c, {
645
+ }), J(l, (c) => {
646
+ c || r("timeout", e.id);
647
+ }), (c, n) => {
648
+ const d = y("v-icon"), p = y("v-sheet");
649
+ return j(), A(p, {
649
650
  class: "x-item d-flex align-center py-2 mb-2",
650
651
  color: e.type,
651
652
  elevation: 1
652
653
  }, {
653
- default: v(() => [
654
- o.value ? (q(), A(_, {
654
+ default: m(() => [
655
+ o.value ? (j(), A(d, {
655
656
  key: 0,
656
657
  class: "mx-1",
657
658
  icon: o.value
658
659
  }, null, 8, ["icon"])) : te("", !0),
659
- D("div", {
660
+ C("div", {
660
661
  style: se(a.value)
661
662
  }, S(e.text), 5),
662
- w(_, {
663
+ h(d, {
663
664
  class: "mx-1",
664
665
  icon: "mdi-close",
665
- onClick: n[0] || (n[0] = (d) => r("timeout", e.id))
666
+ onClick: n[0] || (n[0] = (_) => r("timeout", e.id))
666
667
  })
667
668
  ]),
668
669
  _: 1
669
670
  }, 8, ["color"]);
670
671
  };
671
672
  }
672
- }), ct = /* @__PURE__ */ le(ut, [["__scopeId", "data-v-f1f60167"]]), st = /* @__PURE__ */ E({
673
+ }), ct = /* @__PURE__ */ le(ut, [["__scopeId", "data-v-f1f60167"]]), st = /* @__PURE__ */ $({
673
674
  __name: "index",
674
675
  setup(e) {
675
- const t = p([]);
676
+ const t = s([]);
676
677
  W(() => {
677
678
  u.on("message", a);
678
679
  }), N(() => {
679
680
  u.off("message", a);
680
681
  });
681
682
  const a = (n) => {
682
- const { type: _, text: c, timeout: d } = n;
683
- r(_, c, d);
683
+ const { type: d, text: p, timeout: _ } = n;
684
+ r(d, p, _);
684
685
  }, o = (n) => {
685
- s(n);
686
+ c(n);
686
687
  };
687
688
  let l = 0;
688
- const r = (n, _, c) => {
689
- const d = l++;
690
- t.value.push({ id: d, type: n, text: _, timeout: c });
691
- }, s = (n) => {
692
- const _ = t.value.findIndex((c) => c.id === n);
693
- _ >= 0 && t.value.splice(_, 1);
689
+ const r = (n, d, p) => {
690
+ const _ = l++;
691
+ t.value.push({ id: _, type: n, text: d, timeout: p });
692
+ }, c = (n) => {
693
+ const d = t.value.findIndex((p) => p.id === n);
694
+ d >= 0 && t.value.splice(d, 1);
694
695
  };
695
- return (n, _) => (q(), ee("div", {
696
+ return (n, d) => (j(), ee("div", {
696
697
  class: "x-cont d-flex flex-column-reverse align-center",
697
- onClick: _[0] || (_[0] = I(() => {
698
+ onClick: d[0] || (d[0] = I(() => {
698
699
  }, ["stop"]))
699
700
  }, [
700
- (q(!0), ee(Ve, null, je(t.value, (c) => (q(), A(ct, {
701
- id: c.id,
702
- key: c.id,
703
- text: c.text,
704
- timeout: c.timeout,
705
- type: c.type,
701
+ (j(!0), ee(Ve, null, Oe(t.value, (p) => (j(), A(ct, {
702
+ id: p.id,
703
+ key: p.id,
704
+ text: p.text,
705
+ timeout: p.timeout,
706
+ type: p.type,
706
707
  onTimeout: o
707
708
  }, null, 8, ["id", "text", "timeout", "type"]))), 128))
708
709
  ]));
709
710
  }
710
- }), pt = /* @__PURE__ */ le(st, [["__scopeId", "data-v-b482df18"]]), _t = /* @__PURE__ */ E({
711
+ }), pt = /* @__PURE__ */ le(st, [["__scopeId", "data-v-b482df18"]]), _t = /* @__PURE__ */ $({
711
712
  __name: "index",
712
713
  setup(e) {
713
- const { t } = z(), a = p(""), o = p(""), l = p(0), r = p(), s = p(-1 / 0), n = p(1 / 0), _ = p(1);
714
- let c = 0, d = !1;
715
- const k = pe("target"), m = async (h) => {
716
- a.value = h.title, o.value = h.subtitle ?? "", l.value = h.value, r.value = h.precision, s.value = h.min, n.value = h.max, _.value = h.step, c = h.seq, d = !1, b.value = !0, await H(() => !!k.value), k.value.focus();
717
- }, { open: b } = Q("numberDlg", m), i = p(!1), V = () => {
718
- b.value = !1, d || (u.emit(`numberDlgResult${c}`, l.value), d = !0);
714
+ const { t } = z(), a = s(""), o = s(""), l = s(0), r = s(), c = s(-1 / 0), n = s(1 / 0), d = s(1);
715
+ let p = 0, _ = !1;
716
+ const x = pe("target"), b = async (k) => {
717
+ a.value = k.title, o.value = k.subtitle ?? "", l.value = k.value, r.value = k.precision, c.value = k.min, n.value = k.max, d.value = k.step, p = k.seq, _ = !1, g.value = !0, await H(() => !!x.value), x.value.focus();
718
+ }, { open: g } = Q("numberDlg", b), i = s(!1), D = () => {
719
+ g.value = !1, _ || (u.emit(`numberDlgResult${p}`, l.value), _ = !0);
719
720
  };
720
- return J(b, (h) => {
721
- !h && !d && (u.emit(`numberDlgResult${c}`, void 0), d = !0);
722
- }), (h, f) => {
723
- const g = y("v-number-input"), R = y("v-btn"), x = y("v-card-actions"), C = y("v-form"), Y = y("v-card"), Z = y("v-dialog");
724
- return q(), A(Z, {
725
- modelValue: U(b),
726
- "onUpdate:modelValue": f[3] || (f[3] = (O) => X(b) ? b.value = O : null),
721
+ return J(g, (k) => {
722
+ !k && !_ && (u.emit(`numberDlgResult${p}`, void 0), _ = !0);
723
+ }), (k, f) => {
724
+ const v = y("v-number-input"), R = y("v-btn"), w = y("v-card-actions"), V = y("v-form"), Y = y("v-card"), Z = y("v-dialog");
725
+ return j(), A(Z, {
726
+ modelValue: E(g),
727
+ "onUpdate:modelValue": f[3] || (f[3] = (q) => X(g) ? g.value = q : null),
727
728
  attach: "",
728
729
  "max-width": "600px",
729
730
  transition: "dialog-top-transition",
730
- onKeydown: f[4] || (f[4] = F(I((O) => b.value = !1, ["stop", "prevent"]), ["esc"]))
731
+ onKeydown: f[4] || (f[4] = F(I((q) => g.value = !1, ["stop", "prevent"]), ["esc"]))
731
732
  }, {
732
- default: v(() => [
733
- w(Y, { title: a.value }, {
734
- default: v(() => [
735
- w(C, {
733
+ default: m(() => [
734
+ h(Y, { title: a.value }, {
735
+ default: m(() => [
736
+ h(V, {
736
737
  modelValue: i.value,
737
- "onUpdate:modelValue": f[2] || (f[2] = (O) => i.value = O),
738
+ "onUpdate:modelValue": f[2] || (f[2] = (q) => i.value = q),
738
739
  class: "mx-3",
739
- onSubmit: I(V, ["prevent"])
740
+ onSubmit: I(D, ["prevent"])
740
741
  }, {
741
- default: v(() => [
742
- w(g, {
742
+ default: m(() => [
743
+ h(v, {
743
744
  ref_key: "target",
744
- ref: k,
745
+ ref: x,
745
746
  modelValue: l.value,
746
- "onUpdate:modelValue": f[0] || (f[0] = (O) => l.value = O),
747
+ "onUpdate:modelValue": f[0] || (f[0] = (q) => l.value = q),
747
748
  "control-variant": "stacked",
748
749
  max: n.value,
749
- min: s.value,
750
+ min: c.value,
750
751
  precision: r.value,
751
- step: _.value
752
+ step: d.value
752
753
  }, null, 8, ["modelValue", "max", "min", "precision", "step"]),
753
- w(x, { class: "d-flex justify-end" }, {
754
- default: v(() => [
755
- w(R, {
754
+ h(w, { class: "d-flex justify-end" }, {
755
+ default: m(() => [
756
+ h(R, {
756
757
  color: "primary",
757
758
  variant: "text",
758
- onClick: f[1] || (f[1] = (O) => b.value = !1)
759
+ onClick: f[1] || (f[1] = (q) => g.value = !1)
759
760
  }, {
760
- default: v(() => [
761
- M(S(U(t)("dlg.common.cancel")), 1)
761
+ default: m(() => [
762
+ M(S(E(t)("dlg.common.cancel")), 1)
762
763
  ]),
763
764
  _: 1
764
765
  }),
765
- w(R, {
766
+ h(R, {
766
767
  color: "primary",
767
768
  disabled: !i.value,
768
769
  type: "submit",
769
770
  variant: "text"
770
771
  }, {
771
- default: v(() => [
772
- M(S(U(t)("dlg.common.confirm")), 1)
772
+ default: m(() => [
773
+ M(S(E(t)("dlg.common.confirm")), 1)
773
774
  ]),
774
775
  _: 1
775
776
  }, 8, ["disabled"])
@@ -787,76 +788,76 @@ const lt = /* @__PURE__ */ E({
787
788
  }, 8, ["modelValue"]);
788
789
  };
789
790
  }
790
- }), dt = /* @__PURE__ */ E({
791
+ }), dt = /* @__PURE__ */ $({
791
792
  __name: "index",
792
793
  setup(e) {
793
- const { t } = z(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(""), n = p(), _ = p(""), c = p(""), d = p(""), k = p(""), m = p("");
794
- let b = 0, i = !1;
795
- const V = pe("target"), h = async (x) => {
796
- a.value = x.title, o.value = x.subtitle ?? "", l.value = x.text, r.value = x.label, s.value = x.placeholder, n.value = x.rules, _.value = x.value, c.value = x.cancel?.color ?? "primary", d.value = x.cancel?.text ?? t("dlg.common.cancel"), k.value = x.confirm?.color ?? "primary", m.value = x.confirm?.text ?? t("dlg.common.confirm"), b = x.seq, i = !1, f.value = !0, await H(() => !!V.value), V.value.focus();
797
- }, { open: f } = Q("promptDlg", h), g = p(!1), R = () => {
798
- f.value = !1, i || (u.emit("promptDlgResult" + b, _.value ?? ""), i = !0);
794
+ const { t } = z(), a = s(""), o = s(""), l = s(""), r = s(""), c = s(""), n = s(), d = s(""), p = s(""), _ = s(""), x = s(""), b = s("");
795
+ let g = 0, i = !1;
796
+ const D = pe("target"), k = async (w) => {
797
+ a.value = w.title, o.value = w.subtitle ?? "", l.value = w.text, r.value = w.label, c.value = w.placeholder, n.value = w.rules, d.value = w.value, p.value = w.cancel?.color ?? "primary", _.value = w.cancel?.text ?? t("dlg.common.cancel"), x.value = w.confirm?.color ?? "primary", b.value = w.confirm?.text ?? t("dlg.common.confirm"), g = w.seq, i = !1, f.value = !0, await H(() => !!D.value), D.value.focus();
798
+ }, { open: f } = Q("promptDlg", k), v = s(!1), R = () => {
799
+ f.value = !1, i || (u.emit("promptDlgResult" + g, d.value ?? ""), i = !0);
799
800
  };
800
- return J(f, (x) => {
801
- !x && !i && (u.emit("promptDlgResult" + b, void 0), i = !0);
802
- }), (x, C) => {
803
- const Y = y("v-card-text"), Z = y("v-text-field"), O = y("v-btn"), xe = y("v-card-actions"), we = y("v-form"), he = y("v-card"), ke = y("v-dialog");
804
- return q(), A(ke, {
805
- modelValue: U(f),
806
- "onUpdate:modelValue": C[3] || (C[3] = (B) => X(f) ? f.value = B : null),
801
+ return J(f, (w) => {
802
+ !w && !i && (u.emit("promptDlgResult" + g, void 0), i = !0);
803
+ }), (w, V) => {
804
+ const Y = y("v-card-text"), Z = y("v-text-field"), q = y("v-btn"), xe = y("v-card-actions"), we = y("v-form"), he = y("v-card"), ke = y("v-dialog");
805
+ return j(), A(ke, {
806
+ modelValue: E(f),
807
+ "onUpdate:modelValue": V[3] || (V[3] = (B) => X(f) ? f.value = B : null),
807
808
  attach: "",
808
809
  "max-width": "600px",
809
810
  transition: "dialog-top-transition",
810
- onKeydown: C[4] || (C[4] = F(I((B) => f.value = !1, ["stop", "prevent"]), ["esc"]))
811
+ onKeydown: V[4] || (V[4] = F(I((B) => f.value = !1, ["stop", "prevent"]), ["esc"]))
811
812
  }, {
812
- default: v(() => [
813
- w(he, {
813
+ default: m(() => [
814
+ h(he, {
814
815
  subtitle: o.value,
815
816
  title: a.value
816
817
  }, {
817
- default: v(() => [
818
- l.value ? (q(), A(Y, { key: 0 }, {
819
- default: v(() => [
818
+ default: m(() => [
819
+ l.value ? (j(), A(Y, { key: 0 }, {
820
+ default: m(() => [
820
821
  M(S(l.value), 1)
821
822
  ]),
822
823
  _: 1
823
824
  })) : te("", !0),
824
- w(we, {
825
- modelValue: g.value,
826
- "onUpdate:modelValue": C[2] || (C[2] = (B) => g.value = B),
825
+ h(we, {
826
+ modelValue: v.value,
827
+ "onUpdate:modelValue": V[2] || (V[2] = (B) => v.value = B),
827
828
  class: "mx-3",
828
829
  onSubmit: I(R, ["prevent"])
829
830
  }, {
830
- default: v(() => [
831
- w(Z, {
831
+ default: m(() => [
832
+ h(Z, {
832
833
  ref_key: "target",
833
- ref: V,
834
- modelValue: _.value,
835
- "onUpdate:modelValue": C[0] || (C[0] = (B) => _.value = B),
834
+ ref: D,
835
+ modelValue: d.value,
836
+ "onUpdate:modelValue": V[0] || (V[0] = (B) => d.value = B),
836
837
  label: r.value,
837
- placeholder: s.value,
838
+ placeholder: c.value,
838
839
  rules: n.value
839
840
  }, null, 8, ["modelValue", "label", "placeholder", "rules"]),
840
- w(xe, { class: "d-flex justify-end" }, {
841
- default: v(() => [
842
- w(O, {
843
- color: c.value,
841
+ h(xe, { class: "d-flex justify-end" }, {
842
+ default: m(() => [
843
+ h(q, {
844
+ color: p.value,
844
845
  variant: "text",
845
- onClick: C[1] || (C[1] = (B) => f.value = !1)
846
+ onClick: V[1] || (V[1] = (B) => f.value = !1)
846
847
  }, {
847
- default: v(() => [
848
- M(S(d.value), 1)
848
+ default: m(() => [
849
+ M(S(_.value), 1)
849
850
  ]),
850
851
  _: 1
851
852
  }, 8, ["color"]),
852
- w(O, {
853
- color: k.value,
854
- disabled: !g.value,
853
+ h(q, {
854
+ color: x.value,
855
+ disabled: !v.value,
855
856
  type: "submit",
856
857
  variant: "text"
857
858
  }, {
858
- default: v(() => [
859
- M(S(m.value), 1)
859
+ default: m(() => [
860
+ M(S(b.value), 1)
860
861
  ]),
861
862
  _: 1
862
863
  }, 8, ["color", "disabled"])
@@ -874,11 +875,11 @@ const lt = /* @__PURE__ */ E({
874
875
  }, 8, ["modelValue"]);
875
876
  };
876
877
  }
877
- }), it = { class: "ma-auto" }, ft = { class: "w-100 h-100 d-flex align-center justify-center" }, gt = { class: "text-body-1" }, vt = /* @__PURE__ */ E({
878
+ }), it = { class: "ma-auto" }, ft = { class: "w-100 h-100 d-flex align-center justify-center" }, gt = { class: "text-body-1" }, vt = /* @__PURE__ */ $({
878
879
  __name: "index",
879
880
  setup(e) {
880
- const { t } = z(), a = p(""), o = (s) => {
881
- const n = s;
881
+ const { t } = z(), a = s(""), o = (c) => {
882
+ const n = c;
882
883
  a.value = n.text ?? t("dlg.common.responding"), r.value = !0;
883
884
  }, l = () => {
884
885
  r.value = !1;
@@ -887,26 +888,26 @@ const lt = /* @__PURE__ */ E({
887
888
  u.on("closeWaitDlg", l);
888
889
  }), N(() => {
889
890
  u.off("closeWaitDlg", l);
890
- }), (s, n) => {
891
- const _ = y("v-card"), c = y("v-dialog");
892
- return q(), A(c, {
893
- modelValue: U(r),
894
- "onUpdate:modelValue": n[0] || (n[0] = (d) => X(r) ? r.value = d : null),
891
+ }), (c, n) => {
892
+ const d = y("v-card"), p = y("v-dialog");
893
+ return j(), A(p, {
894
+ modelValue: E(r),
895
+ "onUpdate:modelValue": n[0] || (n[0] = (_) => X(r) ? r.value = _ : null),
895
896
  attach: "",
896
897
  fullscreen: "",
897
898
  "no-click-animation": "",
898
899
  persistent: ""
899
900
  }, {
900
- default: v(() => [
901
- D("div", it, [
902
- w(_, {
901
+ default: m(() => [
902
+ C("div", it, [
903
+ h(d, {
903
904
  height: "80px",
904
905
  loading: "",
905
906
  width: "300px"
906
907
  }, {
907
- default: v(() => [
908
- D("div", ft, [
909
- D("span", gt, S(a.value), 1)
908
+ default: m(() => [
909
+ C("div", ft, [
910
+ C("span", gt, S(a.value), 1)
910
911
  ])
911
912
  ]),
912
913
  _: 1
@@ -932,7 +933,7 @@ const Gt = { install: mt };
932
933
  export {
933
934
  Ke as Permission,
934
935
  tt as addView,
935
- Ue as appAppear,
936
+ Ee as appAppear,
936
937
  Wt as clearViews,
937
938
  Lt as closeWaitDlg,
938
939
  Ct as createAxios,
@@ -942,9 +943,9 @@ export {
942
943
  Vt as globalObjects,
943
944
  ye as hasView,
944
945
  It as injectDark,
945
- $t as injectLastAppPath,
946
- Et as injectLocale,
947
- Ut as injectPermissionChecksum,
946
+ Ut as injectLastAppPath,
947
+ $t as injectLocale,
948
+ Et as injectPermissionChecksum,
948
949
  He as injectPermissionObjects,
949
950
  Qe as injectViews,
950
951
  et as isEmpty,
@@ -957,8 +958,8 @@ export {
957
958
  Mt as messageSuccess,
958
959
  Bt as messageWarning,
959
960
  Kt as onBeforeEach,
960
- qt as openConfirmDlg,
961
- Ot as openNumberDlg,
961
+ jt as openConfirmDlg,
962
+ qt as openNumberDlg,
962
963
  St as openPromptDlg,
963
964
  Rt as openWaitDlg,
964
965
  ot as popView,
@@ -975,6 +976,6 @@ export {
975
976
  Ht as useSystem,
976
977
  Q as useViewStack,
977
978
  Ne as verifyPermission,
978
- jt as waitMs,
979
+ Ot as waitMs,
979
980
  H as waitUtil
980
981
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.9.12",
4
+ "version": "0.9.13",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",