x-essential-lib 0.2.5 → 0.2.9

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