x-essential-lib 0.2.11 → 0.2.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.
package/dist/index.js CHANGED
@@ -1,57 +1,63 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-a8f3d91f]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-a8f3d91f]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-a8f3d91f]{transform-origin:20px 20px;animation:lds-spinner-a8f3d91f 1.2s linear infinite}.lds-spinner div[data-v-a8f3d91f]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-a8f3d91f]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-a8f3d91f]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-a8f3d91f]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-a8f3d91f]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-a8f3d91f]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-a8f3d91f]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-a8f3d91f]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-a8f3d91f]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-a8f3d91f]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-a8f3d91f{0%{opacity:1}to{opacity:0}}.x-cont[data-v-70ed4b89]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { VAlert as ge, VBtn as _e, VCard as he, VCardActions as xe, VCardText as we, VCardTitle as ye, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
3
- import { ref as p, computed as d, onMounted as D, onBeforeUnmount as A, defineComponent as R, watch as P, resolveComponent as v, openBlock as C, createBlock as M, unref as z, isRef as X, withKeys as K, withModifiers as $, withCtx as g, createVNode as h, createTextVNode as b, toDisplayString as k, createElementBlock as H, normalizeStyle as Ve, pushScopeId as qe, popScopeId as Se, createElementVNode as _, reactive as De, Fragment as Re, renderList as Oe, inject as Ie } from "vue";
2
+ import { VAlert as ge, VBtn as he, VCard as _e, VCardActions as xe, VCardText as we, VCardTitle as ye, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
3
+ import { ref as f, computed as d, onMounted as D, onBeforeUnmount as A, defineComponent as R, watch as P, resolveComponent as v, openBlock as C, createBlock as E, unref as z, isRef as X, withKeys as K, withModifiers as $, withCtx as g, createVNode as _, createTextVNode as b, toDisplayString as k, createElementBlock as H, normalizeStyle as Ve, pushScopeId as qe, popScopeId as Se, createElementVNode as h, reactive as De, Fragment as Re, renderList as Oe, inject as Ie } from "vue";
4
4
  import { useLocale as F, useTheme as L, useDisplay as Te } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as le } from "pinia";
6
6
  import { useI18n as je } from "vue-i18n";
7
7
  import Pe from "axios";
8
8
  const $e = le("viewMgr", () => {
9
- const e = p([]), o = d(() => (a) => e.value.find((l) => l === a) !== void 0);
10
- function t(a) {
11
- n(a), e.value.push(a);
9
+ const e = f([]);
10
+ function n() {
11
+ return e.value.length <= 0;
12
12
  }
13
- function n(a) {
14
- const l = e.value.findIndex((s) => s === a);
15
- l !== -1 && e.value.splice(l, 1);
13
+ function t(l) {
14
+ return e.value.find((s) => s === l) !== void 0;
16
15
  }
17
- function r() {
16
+ function o(l) {
17
+ r(l), e.value.push(l);
18
+ }
19
+ function r(l) {
20
+ const s = e.value.findIndex((p) => p === l);
21
+ s !== -1 && e.value.splice(s, 1);
22
+ }
23
+ function a() {
18
24
  e.value.pop();
19
25
  }
20
- return { views: e, hasView: o, addView: t, delView: n, popView: r };
26
+ return { isEmpty: n, hasView: t, addView: o, delView: r, popView: a };
21
27
  });
22
28
  function Ae(e) {
23
- return { all: e = e || /* @__PURE__ */ new Map(), on: function(o, t) {
24
- var n = e.get(o);
25
- n ? n.push(t) : e.set(o, [t]);
26
- }, off: function(o, t) {
27
- var n = e.get(o);
28
- n && (t ? n.splice(n.indexOf(t) >>> 0, 1) : e.set(o, []));
29
- }, emit: function(o, t) {
30
- var n = e.get(o);
31
- n && n.slice().map(function(r) {
29
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
30
+ var o = e.get(n);
31
+ o ? o.push(t) : e.set(n, [t]);
32
+ }, off: function(n, t) {
33
+ var o = e.get(n);
34
+ o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(n, []));
35
+ }, emit: function(n, t) {
36
+ var o = e.get(n);
37
+ o && o.slice().map(function(r) {
32
38
  r(t);
33
- }), (n = e.get("*")) && n.slice().map(function(r) {
34
- r(o, t);
39
+ }), (o = e.get("*")) && o.slice().map(function(r) {
40
+ r(n, t);
35
41
  });
36
42
  } };
37
43
  }
38
44
  const c = Ae();
39
45
  async function gt(e) {
40
- return new Promise((o) => {
41
- setTimeout(o, e);
46
+ return new Promise((n) => {
47
+ setTimeout(n, e);
42
48
  });
43
49
  }
44
- async function G(e, o, t) {
45
- const n = Date.now();
50
+ async function G(e, n, t) {
51
+ const o = Date.now();
46
52
  return new Promise((r) => {
47
53
  const a = async () => {
48
- e() ? r(!0) : o && Date.now() - n > o ? r(!1) : setTimeout(a, t ?? 30);
54
+ e() ? r(!0) : n && Date.now() - o > n ? r(!1) : setTimeout(a, t ?? 30);
49
55
  };
50
56
  a();
51
57
  });
52
58
  }
53
- function J(e, o) {
54
- const t = $e(), n = d({
59
+ function J(e, n) {
60
+ const t = $e(), o = d({
55
61
  get() {
56
62
  return t.hasView(e);
57
63
  },
@@ -59,38 +65,38 @@ function J(e, o) {
59
65
  a ? t.addView(e) : t.delView(e);
60
66
  }
61
67
  }), r = (a) => {
62
- n.value = !0;
68
+ o.value = !0;
63
69
  };
64
70
  return D(() => {
65
71
  c.on(e, r);
66
72
  }), A(() => {
67
73
  c.off(e, r);
68
- }), { open: n };
74
+ }), { open: o };
69
75
  }
70
- const Me = /* @__PURE__ */ R({
76
+ const Ee = /* @__PURE__ */ R({
71
77
  __name: "index",
72
78
  setup(e) {
73
- const o = F(), { open: t } = J("confirmDlg"), n = p(""), r = p(""), a = p(), l = p(), s = d(() => {
79
+ const n = F(), { open: t } = J("confirmDlg"), o = f(""), r = f(""), a = f(), l = f(), s = d(() => {
74
80
  var u;
75
81
  return ((u = a.value) == null ? void 0 : u.color) ?? "primary";
76
- }), m = d(() => {
82
+ }), p = d(() => {
77
83
  var u;
78
- return ((u = a.value) == null ? void 0 : u.text) ?? o.t("cancel");
79
- }), f = d(() => {
84
+ return ((u = a.value) == null ? void 0 : u.text) ?? n.t("cancel");
85
+ }), m = d(() => {
80
86
  var u;
81
87
  return ((u = l.value) == null ? void 0 : u.color) ?? "primary";
82
88
  }), V = d(() => {
83
89
  var u;
84
- return ((u = l.value) == null ? void 0 : u.text) ?? o.t("confirm");
90
+ return ((u = l.value) == null ? void 0 : u.text) ?? n.t("confirm");
85
91
  });
86
92
  let O = 0, q = !1;
87
- const E = (u) => {
88
- n.value = u.title, r.value = u.text, a.value = u.cancel, l.value = u.confirm, O = u.seq, q = !1, t.value = !0;
93
+ const M = (u) => {
94
+ o.value = u.title, r.value = u.text, a.value = u.cancel, l.value = u.confirm, O = u.seq, q = !1, t.value = !0;
89
95
  };
90
96
  D(() => {
91
- c.on("confirmDlg", E);
97
+ c.on("confirmDlg", M);
92
98
  }), A(() => {
93
- c.off("confirmDlg", E);
99
+ c.off("confirmDlg", M);
94
100
  });
95
101
  const B = () => {
96
102
  t.value = !1, q || (c.emit("confirmDlgResult" + O, !0), q = !0);
@@ -99,7 +105,7 @@ const Me = /* @__PURE__ */ R({
99
105
  !u && !q && (c.emit("confirmDlgResult" + O, !1), q = !0);
100
106
  }), (u, w) => {
101
107
  const S = v("v-card-title"), U = v("v-card-text"), I = v("v-btn"), i = v("v-card-actions"), x = v("v-card"), N = v("v-dialog");
102
- return C(), M(N, {
108
+ return C(), E(N, {
103
109
  modelValue: z(t),
104
110
  "onUpdate:modelValue": w[1] || (w[1] = (T) => X(t) ? t.value = T : null),
105
111
  onKeydown: [
@@ -110,35 +116,35 @@ const Me = /* @__PURE__ */ R({
110
116
  "max-width": "600px"
111
117
  }, {
112
118
  default: g(() => [
113
- h(x, null, {
119
+ _(x, null, {
114
120
  default: g(() => [
115
- h(S, null, {
121
+ _(S, null, {
116
122
  default: g(() => [
117
- b(k(n.value), 1)
123
+ b(k(o.value), 1)
118
124
  ]),
119
125
  _: 1
120
126
  }),
121
- h(U, null, {
127
+ _(U, null, {
122
128
  default: g(() => [
123
129
  b(k(r.value), 1)
124
130
  ]),
125
131
  _: 1
126
132
  }),
127
- h(i, { class: "d-flex justify-end" }, {
133
+ _(i, { class: "d-flex justify-end" }, {
128
134
  default: g(() => [
129
- h(I, {
135
+ _(I, {
130
136
  onClick: w[0] || (w[0] = (T) => t.value = !1),
131
137
  color: s.value,
132
138
  variant: "text"
133
139
  }, {
134
140
  default: g(() => [
135
- b(k(m.value), 1)
141
+ b(k(p.value), 1)
136
142
  ]),
137
143
  _: 1
138
144
  }, 8, ["color"]),
139
- h(I, {
145
+ _(I, {
140
146
  onClick: B,
141
- color: f.value,
147
+ color: m.value,
142
148
  variant: "text"
143
149
  }, {
144
150
  default: g(() => [
@@ -157,19 +163,19 @@ const Me = /* @__PURE__ */ R({
157
163
  }, 8, ["modelValue", "onKeydown"]);
158
164
  };
159
165
  }
160
- }), Ee = (e) => (qe("data-v-a8f3d91f"), e = e(), Se(), e), Be = /* @__PURE__ */ Ee(() => /* @__PURE__ */ _("div", { class: "lds-spinner" }, [
161
- /* @__PURE__ */ _("div"),
162
- /* @__PURE__ */ _("div"),
163
- /* @__PURE__ */ _("div"),
164
- /* @__PURE__ */ _("div"),
165
- /* @__PURE__ */ _("div"),
166
- /* @__PURE__ */ _("div"),
167
- /* @__PURE__ */ _("div"),
168
- /* @__PURE__ */ _("div"),
169
- /* @__PURE__ */ _("div"),
170
- /* @__PURE__ */ _("div"),
171
- /* @__PURE__ */ _("div"),
172
- /* @__PURE__ */ _("div")
166
+ }), Me = (e) => (qe("data-v-a8f3d91f"), e = e(), Se(), e), Be = /* @__PURE__ */ Me(() => /* @__PURE__ */ h("div", { class: "lds-spinner" }, [
167
+ /* @__PURE__ */ h("div"),
168
+ /* @__PURE__ */ h("div"),
169
+ /* @__PURE__ */ h("div"),
170
+ /* @__PURE__ */ h("div"),
171
+ /* @__PURE__ */ h("div"),
172
+ /* @__PURE__ */ h("div"),
173
+ /* @__PURE__ */ h("div"),
174
+ /* @__PURE__ */ h("div"),
175
+ /* @__PURE__ */ h("div"),
176
+ /* @__PURE__ */ h("div"),
177
+ /* @__PURE__ */ h("div"),
178
+ /* @__PURE__ */ h("div")
173
179
  ], -1)), Ue = [
174
180
  Be
175
181
  ], We = /* @__PURE__ */ R({
@@ -181,19 +187,19 @@ const Me = /* @__PURE__ */ R({
181
187
  }
182
188
  },
183
189
  setup(e) {
184
- const o = L(), t = e, n = d(() => ({
185
- background: o.current.value.dark ? "#1e1e1e" : "#ffffff",
190
+ const n = L(), t = e, o = d(() => ({
191
+ background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
186
192
  zIndex: t.zIndex
187
193
  }));
188
194
  return (r, a) => (C(), H("div", {
189
195
  class: "x-cont",
190
- style: Ve(n.value)
196
+ style: Ve(o.value)
191
197
  }, Ue, 4));
192
198
  }
193
- }), ae = (e, o) => {
199
+ }), ae = (e, n) => {
194
200
  const t = e.__vccOpts || e;
195
- for (const [n, r] of o)
196
- t[n] = r;
201
+ for (const [o, r] of n)
202
+ t[o] = r;
197
203
  return t;
198
204
  }, ze = /* @__PURE__ */ ae(We, [["__scopeId", "data-v-a8f3d91f"]]), Ke = /* @__PURE__ */ R({
199
205
  __name: "item",
@@ -216,8 +222,8 @@ const Me = /* @__PURE__ */ R({
216
222
  }
217
223
  },
218
224
  emits: ["timeout"],
219
- setup(e, { emit: o }) {
220
- const t = e, n = p(!0), r = o, a = d(() => {
225
+ setup(e, { emit: n }) {
226
+ const t = e, o = f(!0), r = n, a = d(() => {
221
227
  let l = "";
222
228
  switch (t.type) {
223
229
  case "error":
@@ -239,13 +245,13 @@ const Me = /* @__PURE__ */ R({
239
245
  setTimeout(() => {
240
246
  r("timeout", t.id);
241
247
  }, t.timeout);
242
- }), P(n, (l) => {
248
+ }), P(o, (l) => {
243
249
  l || r("timeout", t.id);
244
250
  }), (l, s) => {
245
- const m = v("v-alert");
246
- return C(), M(m, {
247
- modelValue: n.value,
248
- "onUpdate:modelValue": s[0] || (s[0] = (f) => n.value = f),
251
+ const p = v("v-alert");
252
+ return C(), E(p, {
253
+ modelValue: o.value,
254
+ "onUpdate:modelValue": s[0] || (s[0] = (m) => o.value = m),
249
255
  class: "mt-2",
250
256
  type: e.type,
251
257
  icon: a.value,
@@ -261,7 +267,7 @@ const Me = /* @__PURE__ */ R({
261
267
  }), Le = /* @__PURE__ */ R({
262
268
  __name: "index",
263
269
  setup(e) {
264
- const o = De({ items: [] });
270
+ const n = De({ items: [] });
265
271
  D(() => {
266
272
  c.on("message", t);
267
273
  }), A(() => {
@@ -269,52 +275,52 @@ const Me = /* @__PURE__ */ R({
269
275
  });
270
276
  const t = (s) => {
271
277
  a(s.type, s.text, s.timeout);
272
- }, n = (s) => {
278
+ }, o = (s) => {
273
279
  l(s);
274
280
  };
275
281
  let r = 0;
276
- const a = (s, m, f) => {
282
+ const a = (s, p, m) => {
277
283
  const V = r++;
278
- o.items.push({ id: V, type: s, text: m, timeout: f });
284
+ n.items.push({ id: V, type: s, text: p, timeout: m });
279
285
  }, l = (s) => {
280
- const m = o.items.findIndex((f) => f.id === s);
281
- m >= 0 && o.items.splice(m, 1);
286
+ const p = n.items.findIndex((m) => m.id === s);
287
+ p >= 0 && n.items.splice(p, 1);
282
288
  };
283
- return (s, m) => (C(), H("div", {
284
- onClick: m[0] || (m[0] = $(() => {
289
+ return (s, p) => (C(), H("div", {
290
+ onClick: p[0] || (p[0] = $(() => {
285
291
  }, ["stop"])),
286
292
  class: "x-cont d-flex flex-column-reverse align-center"
287
293
  }, [
288
- (C(!0), H(Re, null, Oe(o.items, (f) => (C(), M(Ke, {
289
- onTimeout: n,
290
- id: f.id,
291
- type: f.type,
292
- text: f.text,
293
- timeout: f.timeout,
294
- key: f.id
294
+ (C(!0), H(Re, null, Oe(n.items, (m) => (C(), E(Ke, {
295
+ onTimeout: o,
296
+ id: m.id,
297
+ type: m.type,
298
+ text: m.text,
299
+ timeout: m.timeout,
300
+ key: m.id
295
301
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
296
302
  ]));
297
303
  }
298
304
  }), Ne = /* @__PURE__ */ ae(Le, [["__scopeId", "data-v-70ed4b89"]]), He = /* @__PURE__ */ R({
299
305
  __name: "index",
300
306
  setup(e) {
301
- const o = F(), { open: t } = J("promptDlg"), n = p(""), r = p(""), a = p(), l = p(), s = p(), m = p(""), f = p(), V = p(), O = d(() => {
307
+ const n = F(), { open: t } = J("promptDlg"), o = f(""), r = f(""), a = f(), l = f(), s = f(), p = f(""), m = f(), V = f(), O = d(() => {
302
308
  var i;
303
- return ((i = f.value) == null ? void 0 : i.color) ?? "primary";
309
+ return ((i = m.value) == null ? void 0 : i.color) ?? "primary";
304
310
  }), q = d(() => {
305
311
  var i;
306
- return ((i = f.value) == null ? void 0 : i.text) ?? o.t("cancel");
307
- }), E = d(() => {
312
+ return ((i = m.value) == null ? void 0 : i.text) ?? n.t("cancel");
313
+ }), M = d(() => {
308
314
  var i;
309
315
  return ((i = V.value) == null ? void 0 : i.color) ?? "primary";
310
316
  }), B = d(() => {
311
317
  var i;
312
- return ((i = V.value) == null ? void 0 : i.text) ?? o.t("confirm");
313
- }), u = p();
318
+ return ((i = V.value) == null ? void 0 : i.text) ?? n.t("confirm");
319
+ }), u = f();
314
320
  let w = 0, S = !1;
315
321
  const U = async (i) => {
316
322
  var x;
317
- n.value = i.title, r.value = i.text, a.value = i.label, l.value = i.placeholder, s.value = i.rules, m.value = i.value, f.value = i.cancel, V.value = i.confirm, w = i.seq, S = !1, t.value = !0, await G(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
323
+ o.value = i.title, r.value = i.text, a.value = i.label, l.value = i.placeholder, s.value = i.rules, p.value = i.value, m.value = i.cancel, V.value = i.confirm, w = i.seq, S = !1, t.value = !0, await G(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
318
324
  };
319
325
  D(() => {
320
326
  c.on("promptDlg", U);
@@ -322,13 +328,13 @@ const Me = /* @__PURE__ */ R({
322
328
  c.off("promptDlg", U);
323
329
  });
324
330
  const I = () => {
325
- t.value = !1, S || (c.emit("promptDlgResult" + w, m.value ?? ""), S = !0);
331
+ t.value = !1, S || (c.emit("promptDlgResult" + w, p.value ?? ""), S = !0);
326
332
  };
327
333
  return P(t, (i) => {
328
334
  !i && !S && (c.emit("promptDlgResult" + w, void 0), S = !0);
329
335
  }), (i, x) => {
330
336
  const N = v("v-card-title"), T = v("v-card-text"), de = v("v-text-field"), pe = v("v-form"), Q = v("v-btn"), fe = v("v-card-actions"), me = v("v-card"), ve = v("v-dialog");
331
- return C(), M(ve, {
337
+ return C(), E(ve, {
332
338
  modelValue: z(t),
333
339
  "onUpdate:modelValue": x[2] || (x[2] = (j) => X(t) ? t.value = j : null),
334
340
  onKeydown: [
@@ -339,25 +345,25 @@ const Me = /* @__PURE__ */ R({
339
345
  "max-width": "600px"
340
346
  }, {
341
347
  default: g(() => [
342
- h(me, null, {
348
+ _(me, null, {
343
349
  default: g(() => [
344
- h(N, null, {
350
+ _(N, null, {
345
351
  default: g(() => [
346
- b(k(n.value), 1)
352
+ b(k(o.value), 1)
347
353
  ]),
348
354
  _: 1
349
355
  }),
350
- h(T, null, {
356
+ _(T, null, {
351
357
  default: g(() => [
352
358
  b(k(r.value), 1)
353
359
  ]),
354
360
  _: 1
355
361
  }),
356
- h(pe, { class: "mx-3" }, {
362
+ _(pe, { class: "mx-3" }, {
357
363
  default: g(() => [
358
- h(de, {
359
- modelValue: m.value,
360
- "onUpdate:modelValue": x[0] || (x[0] = (j) => m.value = j),
364
+ _(de, {
365
+ modelValue: p.value,
366
+ "onUpdate:modelValue": x[0] || (x[0] = (j) => p.value = j),
361
367
  label: a.value,
362
368
  placeholder: l.value,
363
369
  rules: s.value,
@@ -367,9 +373,9 @@ const Me = /* @__PURE__ */ R({
367
373
  ]),
368
374
  _: 1
369
375
  }),
370
- h(fe, { class: "d-flex justify-end" }, {
376
+ _(fe, { class: "d-flex justify-end" }, {
371
377
  default: g(() => [
372
- h(Q, {
378
+ _(Q, {
373
379
  onClick: x[1] || (x[1] = (j) => t.value = !1),
374
380
  color: O.value,
375
381
  variant: "text"
@@ -379,9 +385,9 @@ const Me = /* @__PURE__ */ R({
379
385
  ]),
380
386
  _: 1
381
387
  }, 8, ["color"]),
382
- h(Q, {
388
+ _(Q, {
383
389
  onClick: I,
384
- color: E.value,
390
+ color: M.value,
385
391
  variant: "text"
386
392
  }, {
387
393
  default: g(() => [
@@ -403,34 +409,34 @@ const Me = /* @__PURE__ */ R({
403
409
  }), Xe = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Ge = /* @__PURE__ */ R({
404
410
  __name: "index",
405
411
  setup(e) {
406
- const o = F(), { open: t } = J("waitDlg"), n = () => {
412
+ const n = F(), { open: t } = J("waitDlg"), o = () => {
407
413
  t.value = !0;
408
414
  }, r = () => {
409
415
  t.value = !1;
410
416
  };
411
417
  return D(() => {
412
- c.on("openWaitDlg", n), c.on("closeWaitDlg", r);
418
+ c.on("openWaitDlg", o), c.on("closeWaitDlg", r);
413
419
  }), A(() => {
414
- c.off("openWaitDlg", n), c.off("closeWaitDlg", r);
420
+ c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
415
421
  }), (a, l) => {
416
- const s = v("v-card"), m = v("v-dialog");
417
- return C(), M(m, {
422
+ const s = v("v-card"), p = v("v-dialog");
423
+ return C(), E(p, {
418
424
  modelValue: z(t),
419
- "onUpdate:modelValue": l[0] || (l[0] = (f) => X(t) ? t.value = f : null),
425
+ "onUpdate:modelValue": l[0] || (l[0] = (m) => X(t) ? t.value = m : null),
420
426
  persistent: "",
421
427
  "no-click-animation": "",
422
428
  fullscreen: ""
423
429
  }, {
424
430
  default: g(() => [
425
- _("div", Xe, [
426
- h(s, {
431
+ h("div", Xe, [
432
+ _(s, {
427
433
  width: "300px",
428
434
  height: "80px",
429
435
  loading: ""
430
436
  }, {
431
437
  default: g(() => [
432
- _("div", Fe, [
433
- _("span", null, k(z(o).t("waitingResponse")), 1)
438
+ h("div", Fe, [
439
+ h("span", null, k(z(n).t("waitingResponse")), 1)
434
440
  ])
435
441
  ]),
436
442
  _: 1
@@ -442,28 +448,28 @@ const Me = /* @__PURE__ */ R({
442
448
  };
443
449
  }
444
450
  }), Je = (e) => {
445
- e.component("v-alert", ge), e.component("v-btn", _e), e.component("v-card", he), e.component("v-card-actions", xe), e.component("v-card-text", we), e.component("v-card-title", ye), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", Me), e.component("x-loading", ze), e.component("x-message", Ne), e.component("x-prompt-dlg", He), e.component("x-wait-dlg", Ge);
451
+ e.component("v-alert", ge), e.component("v-btn", he), e.component("v-card", _e), e.component("v-card-actions", xe), e.component("v-card-text", we), e.component("v-card-title", ye), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", Ee), e.component("x-loading", ze), e.component("x-message", Ne), e.component("x-prompt-dlg", He), e.component("x-wait-dlg", Ge);
446
452
  };
447
- function _t() {
448
- const e = L(), o = d(() => e.global.current.value.colors.primary), t = d(() => e.global.current.value.colors.secondary), n = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), a = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
453
+ function ht() {
454
+ const e = L(), n = d(() => e.global.current.value.colors.primary), t = d(() => e.global.current.value.colors.secondary), o = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), a = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
449
455
  return {
450
- primaryColor: o,
456
+ primaryColor: n,
451
457
  secondaryColor: t,
452
- backgroundColor0: n,
458
+ backgroundColor0: o,
453
459
  backgroundColor1: r,
454
460
  backgroundColor2: a,
455
461
  highlightColor: l,
456
462
  borderColor: s
457
463
  };
458
464
  }
459
- function ht() {
460
- const e = L(), { width: o } = Te(), t = d(() => e.global.name.value), n = d(() => !!window.cordova), r = d(() => o.value <= 1280 ? o.value + "px" : o.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
461
- return { dark: t, sysBarAvail: n, compactWidth: r };
465
+ function _t() {
466
+ const e = L(), { width: n } = Te(), t = d(() => e.global.name.value), o = d(() => !!window.cordova), r = d(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
467
+ return { dark: t, sysBarAvail: o, compactWidth: r };
462
468
  }
463
469
  const xt = le(
464
470
  "global",
465
471
  () => {
466
- const e = L(), o = je(), t = p(!1);
472
+ const e = L(), n = je(), t = f(!1);
467
473
  P(
468
474
  t,
469
475
  (l) => {
@@ -473,18 +479,18 @@ const xt = le(
473
479
  immediate: !0
474
480
  }
475
481
  );
476
- const n = p("");
482
+ const o = f("en");
477
483
  P(
478
- n,
484
+ o,
479
485
  (l) => {
480
- o.locale.value = l;
486
+ n.locale.value = l;
481
487
  },
482
488
  {
483
489
  immediate: !0
484
490
  }
485
491
  );
486
- const r = p({}), a = p("");
487
- return { dark: t, locale: n, permissionObjects: r, permissionChecksum: a };
492
+ const r = f({}), a = f("");
493
+ return { dark: t, locale: o, permissionObjects: r, permissionChecksum: a };
488
494
  },
489
495
  {
490
496
  persist: [
@@ -513,40 +519,40 @@ function Ze() {
513
519
  }
514
520
  const W = require("js-cookie");
515
521
  function wt(e) {
516
- const o = Pe.create({
522
+ const n = Pe.create({
517
523
  timeout: 6e3
518
524
  });
519
- return o.defaults.baseURL = e.baseUrl, o.interceptors.request.use(
525
+ return n.defaults.baseURL = e.baseUrl, n.interceptors.request.use(
520
526
  (t) => et(t),
521
527
  (t) => {
522
528
  tt(t, e.onError);
523
529
  }
524
- ), o.interceptors.response.use(
525
- (t) => ot(t),
526
- (t) => nt(t, e.onError)
527
- ), o;
530
+ ), n.interceptors.response.use(
531
+ (t) => nt(t),
532
+ (t) => ot(t, e.onError)
533
+ ), n;
528
534
  }
529
535
  function et(e) {
530
- const o = W.get("accessToken") ?? "";
531
- return e.headers.Authorization = "Basic " + o, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
536
+ const n = W.get("accessToken") ?? "";
537
+ return e.headers.Authorization = "Basic " + n, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
532
538
  }
533
- function tt(e, o) {
534
- console.error(e), o("request timeout");
539
+ function tt(e, n) {
540
+ console.error(e), n("request timeout");
535
541
  }
536
- function ot(e) {
542
+ function nt(e) {
537
543
  return e.data;
538
544
  }
539
- function nt(e, o) {
545
+ function ot(e, n) {
540
546
  var r;
541
547
  const t = e.response;
542
548
  if (!t)
543
549
  return Promise.reject(e);
544
550
  t.status === 401 && rt();
545
- let n = (r = t.data) == null ? void 0 : r.message;
546
- return n || (n = {
551
+ let o = (r = t.data) == null ? void 0 : r.message;
552
+ return o || (o = {
547
553
  code: t.status,
548
554
  message: t.statusText
549
- }), o(n), Promise.reject(e);
555
+ }), n(o), Promise.reject(e);
550
556
  }
551
557
  function rt() {
552
558
  W.remove("accessToken"), W.remove("refreshToken"), W.remove("activeOrg"), Ze().replace({ path: "/passport/login" });
@@ -563,20 +569,20 @@ function ce() {
563
569
  async function yt(e) {
564
570
  if (!se())
565
571
  return;
566
- let o = !1, t;
567
- const n = (a) => {
568
- t = a, o = !0;
572
+ let n = !1, t;
573
+ const o = (a) => {
574
+ t = a, n = !0;
569
575
  }, r = ce();
570
- return c.on("confirmDlgResult" + r, n), c.emit("confirmDlg", { ...e, seq: r }), await G(() => o), c.off("confirmDlgResult" + r, n), t;
576
+ return c.on("confirmDlgResult" + r, o), c.emit("confirmDlg", { ...e, seq: r }), await G(() => n), c.off("confirmDlgResult" + r, o), t;
571
577
  }
572
578
  async function kt(e) {
573
579
  if (!se())
574
580
  return;
575
- let o = !1, t;
576
- const n = (a) => {
577
- t = a, o = !0;
581
+ let n = !1, t;
582
+ const o = (a) => {
583
+ t = a, n = !0;
578
584
  }, r = ce();
579
- return c.on("promptDlgResult" + r, n), c.emit("promptDlg", { ...e, seq: r }), await G(() => o), c.off("promptDlgResult" + r, n), t;
585
+ return c.on("promptDlgResult" + r, o), c.emit("promptDlg", { ...e, seq: r }), await G(() => n), c.off("promptDlgResult" + r, o), t;
580
586
  }
581
587
  function bt() {
582
588
  c.emit("openWaitDlg");
@@ -584,35 +590,35 @@ function bt() {
584
590
  function Ct() {
585
591
  c.emit("closeWaitDlg");
586
592
  }
587
- function Vt(e, o) {
588
- c.emit("message", { type: "error", text: e, timeout: o });
593
+ function Vt(e, n) {
594
+ c.emit("message", { type: "error", text: e, timeout: n });
589
595
  }
590
- function qt(e, o) {
591
- c.emit("message", { type: "info", text: e, timeout: o });
596
+ function qt(e, n) {
597
+ c.emit("message", { type: "info", text: e, timeout: n });
592
598
  }
593
- function St(e, o) {
594
- c.emit("message", { type: "success", text: e, timeout: o });
599
+ function St(e, n) {
600
+ c.emit("message", { type: "success", text: e, timeout: n });
595
601
  }
596
- function Dt(e, o) {
597
- c.emit("message", { type: "warning", text: e, timeout: o });
602
+ function Dt(e, n) {
603
+ c.emit("message", { type: "warning", text: e, timeout: n });
598
604
  }
599
605
  function Rt(e) {
600
- var n, r;
606
+ var o, r;
601
607
  if (!window.appAppear) {
602
608
  window.appAppear = !0;
603
609
  return;
604
610
  }
605
- const o = "single-spa-application:" + e, t = (n = document.getElementById(o)) == null ? void 0 : n.classList;
611
+ const n = "single-spa-application:" + e, t = (o = document.getElementById(n)) == null ? void 0 : o.classList;
606
612
  t && (t.remove("app-left", "app-right", "app-reset"), (r = window.routeExtras) != null && r.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
607
613
  t.add("app-reset");
608
614
  }, 0));
609
615
  }
610
616
  let at = {};
611
- function oe(e, o) {
617
+ function ne(e, n) {
612
618
  if (!e)
613
619
  return !1;
614
620
  let t = e;
615
- return Object.keys(t).length <= 0 || (o.split("/").forEach((r) => {
621
+ return Object.keys(t).length <= 0 || (n.split("/").forEach((r) => {
616
622
  if (Object.keys(t).length <= 0)
617
623
  return !0;
618
624
  if (t[r])
@@ -621,9 +627,9 @@ function oe(e, o) {
621
627
  return !1;
622
628
  }), Object.keys(t).length <= 0);
623
629
  }
624
- function Ot(e, o) {
630
+ function Ot(e, n) {
625
631
  const t = at[e];
626
- return t ? o ? (!oe(t.includes, o) || oe(t.excludes, o), !1) : !0 : !1;
632
+ return t ? n ? (!ne(t.includes, n) || ne(t.excludes, n), !1) : !0 : !1;
627
633
  }
628
634
  const ie = require("js-cookie"), st = [
629
635
  { path: "/passport/login", level: 0 },
@@ -646,30 +652,30 @@ const ie = require("js-cookie"), st = [
646
652
  { path: "/data", level: 1, requiredState: "org" }
647
653
  ];
648
654
  function ue(e) {
649
- let o, t = 0;
650
- const n = e.split("/");
655
+ let n, t = 0;
656
+ const o = e.split("/");
651
657
  return st.forEach((r) => {
652
658
  const a = r.path.split("/");
653
659
  let l = 0;
654
- for (let s = 0; s < n.length && !(s >= a.length || n[s] !== a[s]); s++)
660
+ for (let s = 0; s < o.length && !(s >= a.length || o[s] !== a[s]); s++)
655
661
  l++;
656
- l >= t && (o = r, t = l);
657
- }), o;
662
+ l >= t && (n = r, t = l);
663
+ }), n;
658
664
  }
659
- function ne(e) {
665
+ function oe(e) {
660
666
  if (e === "/")
661
667
  return { app: "", path: "/", level: -1 };
662
- const o = ue(e);
663
- if (!o)
668
+ const n = ue(e);
669
+ if (!n)
664
670
  return { app: "invalidApp", path: "/invalidApp/invalidRoute", level: -1 };
665
671
  const t = e.split("/");
666
- return console.assert(t.length >= 2), { app: t[1], path: o.path, level: o.level };
672
+ return console.assert(t.length >= 2), { app: t[1], path: n.path, level: n.level };
667
673
  }
668
- const re = p("");
669
- function y(e, o) {
670
- const t = ne(e), n = ne(o), r = t.app === n.app, a = t.path === n.path, l = t.level >= n.level;
674
+ const re = f("");
675
+ function y(e, n) {
676
+ const t = oe(e), o = oe(n), r = t.app === o.app, a = t.path === o.path, l = t.level >= o.level;
671
677
  console.info(
672
- `~~~~before route change~~~~ ${n.path} -> ${t.path} inner=${r} forward=${l}`
678
+ `~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${r} forward=${l}`
673
679
  ), r ? a ? re.value = "" : re.value = l ? "inner-left" : "inner-right" : window.routeExtras = { forward: l };
674
680
  }
675
681
  function ct() {
@@ -678,45 +684,45 @@ function ct() {
678
684
  function it() {
679
685
  return !!ie.get("activeOrg");
680
686
  }
681
- function It(e, o, t) {
682
- const n = ct(), r = it(), a = ue(e.path);
687
+ function It(e, n, t) {
688
+ const o = ct(), r = it(), a = ue(e.path);
683
689
  if (!a) {
684
690
  t();
685
691
  return;
686
692
  }
687
693
  if (a.requiredState === "auth")
688
- if (n)
694
+ if (o)
689
695
  if (r) {
690
696
  const l = "/main";
691
- y(l, o.path), t({ path: l });
697
+ y(l, n.path), t({ path: l });
692
698
  } else
693
- y(e.path, o.path), t();
699
+ y(e.path, n.path), t();
694
700
  else {
695
701
  const l = "/passport/login";
696
- y(l, o.path), t({ path: l });
702
+ y(l, n.path), t({ path: l });
697
703
  }
698
704
  else if (a.requiredState === "org")
699
- if (n)
705
+ if (o)
700
706
  if (r)
701
- y(e.path, o.path), t();
707
+ y(e.path, n.path), t();
702
708
  else {
703
709
  const l = "/org/joinOrCreate";
704
- y(l, o.path), t({ path: l });
710
+ y(l, n.path), t({ path: l });
705
711
  }
706
712
  else {
707
713
  const l = "/passport/login";
708
- y(l, o.path), t({ path: l });
714
+ y(l, n.path), t({ path: l });
709
715
  }
710
- else if (n)
716
+ else if (o)
711
717
  if (r) {
712
718
  const l = "/main";
713
- y(l, o.path), t({ path: l });
719
+ y(l, n.path), t({ path: l });
714
720
  } else {
715
721
  const l = "/org/joinOrCreate";
716
- y(l, o.path), t({ path: l });
722
+ y(l, n.path), t({ path: l });
717
723
  }
718
724
  else
719
- y(e.path, o.path), t();
725
+ y(e.path, n.path), t();
720
726
  }
721
727
  const Tt = { install: Je };
722
728
  export {
@@ -734,9 +740,9 @@ export {
734
740
  kt as openPromptDlg,
735
741
  bt as openWaitDlg,
736
742
  re as routeTransName,
737
- _t as useColor,
743
+ ht as useColor,
738
744
  xt as useGlobalStore,
739
- ht as useSystem,
745
+ _t as useSystem,
740
746
  $e as useViewMgrStore,
741
747
  Ot as verifyPermission,
742
748
  gt as waitMs,
@@ -1,19 +1,19 @@
1
1
  export declare const useViewMgrStore: import("pinia").StoreDefinition<"viewMgr", import("pinia")._UnwrapAll<Pick<{
2
- views: import("vue").Ref<string[]>;
3
- hasView: import("vue").ComputedRef<(name: string) => boolean>;
2
+ isEmpty: () => boolean;
3
+ hasView: (name: string) => boolean;
4
4
  addView: (name: string) => void;
5
5
  delView: (name: string) => void;
6
6
  popView: () => void;
7
- }, "views">>, Pick<{
8
- views: import("vue").Ref<string[]>;
9
- hasView: import("vue").ComputedRef<(name: string) => boolean>;
7
+ }, never>>, Pick<{
8
+ isEmpty: () => boolean;
9
+ hasView: (name: string) => boolean;
10
10
  addView: (name: string) => void;
11
11
  delView: (name: string) => void;
12
12
  popView: () => void;
13
- }, "hasView">, Pick<{
14
- views: import("vue").Ref<string[]>;
15
- hasView: import("vue").ComputedRef<(name: string) => boolean>;
13
+ }, never>, Pick<{
14
+ isEmpty: () => boolean;
15
+ hasView: (name: string) => boolean;
16
16
  addView: (name: string) => void;
17
17
  delView: (name: string) => void;
18
18
  popView: () => void;
19
- }, "addView" | "delView" | "popView">>;
19
+ }, "isEmpty" | "hasView" | "addView" | "delView" | "popView">>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.2.11",
4
+ "version": "0.2.13",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",