x-essential-lib 0.1.4 → 0.1.6

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.d.ts CHANGED
@@ -96,11 +96,35 @@ interface PromptParams {
96
96
  export declare function openPromptDlg(params: PromptParams): Promise<any>
97
97
 
98
98
  export declare function openWaitDlg()
99
+
99
100
  export declare function closeWaitDlg()
100
101
 
101
102
  export declare function messageError(text: string, timeout?: number)
103
+
102
104
  export declare function messageInfo(text: string, timeout?: number)
105
+
103
106
  export declare function messageSuccess(text: string, timeout?: number)
107
+
104
108
  export declare function messageWarning(text: string, timeout?: number)
105
109
 
106
110
  export declare function appAppear(name: string)
111
+
112
+ type RequiredState = 'auth' | 'org'
113
+
114
+ interface RouteMeta {
115
+ path: string
116
+ level: number
117
+ requiredState?: RequiredState
118
+ }
119
+
120
+ export declare const routeMetas: RouteMeta[]
121
+
122
+ export declare function matchRouteMeta(path: string): RouteMeta | undefined
123
+
124
+ interface PathInfo {
125
+ app: string
126
+ path: string
127
+ level: number
128
+ }
129
+
130
+ export declare function getPathInfo(path: string): PathInfo
package/dist/index.js CHANGED
@@ -1,91 +1,91 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode('.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(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { getCurrentInstance as ae, inject as A, computed as d, defineComponent as I, useModel as H, ref as g, onMounted as W, onBeforeUnmount as U, watch as O, resolveComponent as p, openBlock as k, createBlock as M, withKeys as L, withModifiers as R, withCtx as v, createVNode as y, createTextVNode as h, toDisplayString as b, createElementBlock as z, normalizeStyle as se, pushScopeId as ue, popScopeId as ce, createElementVNode as _, reactive as ie, Fragment as de, renderList as fe, unref as me } from "vue";
3
- function pe(e) {
4
- return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
5
- var o = e.get(n);
6
- o ? o.push(t) : e.set(n, [t]);
7
- }, off: function(n, t) {
8
- var o = e.get(n);
9
- o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(n, []));
10
- }, emit: function(n, t) {
11
- var o = e.get(n);
2
+ import { getCurrentInstance as ae, inject as K, computed as d, defineComponent as q, useModel as H, ref as _, onMounted as R, onBeforeUnmount as L, watch as O, resolveComponent as m, openBlock as k, createBlock as W, withKeys as A, withModifiers as B, withCtx as v, createVNode as x, createTextVNode as b, toDisplayString as w, createElementBlock as U, normalizeStyle as se, pushScopeId as ue, popScopeId as ie, createElementVNode as g, reactive as ce, Fragment as de, renderList as pe, unref as fe } from "vue";
3
+ function me(e) {
4
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, n) {
5
+ var o = e.get(t);
6
+ o ? o.push(n) : e.set(t, [n]);
7
+ }, off: function(t, n) {
8
+ var o = e.get(t);
9
+ o && (n ? o.splice(o.indexOf(n) >>> 0, 1) : e.set(t, []));
10
+ }, emit: function(t, n) {
11
+ var o = e.get(t);
12
12
  o && o.slice().map(function(l) {
13
- l(t);
13
+ l(n);
14
14
  }), (o = e.get("*")) && o.slice().map(function(l) {
15
- l(n, t);
15
+ l(t, n);
16
16
  });
17
17
  } };
18
18
  }
19
- const a = pe();
20
- async function Te(e) {
21
- return new Promise((n) => {
22
- setTimeout(n, e);
19
+ const i = me();
20
+ async function je(e) {
21
+ return new Promise((t) => {
22
+ setTimeout(t, e);
23
23
  });
24
24
  }
25
- async function X(e, n, t) {
25
+ async function z(e, t, n) {
26
26
  const o = Date.now();
27
27
  return new Promise((l) => {
28
- const s = async () => {
29
- e() ? l(!0) : n && Date.now() - o > n ? l(!1) : setTimeout(s, t ?? 30);
28
+ const r = async () => {
29
+ e() ? l(!0) : t && Date.now() - o > t ? l(!1) : setTimeout(r, n ?? 30);
30
30
  };
31
- s();
31
+ r();
32
32
  });
33
33
  }
34
- function B() {
34
+ function M() {
35
35
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
36
- if (B.cache.has(e))
37
- return B.cache.get(e);
38
- const n = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
39
- return B.cache.set(e, n), n;
36
+ if (M.cache.has(e))
37
+ return M.cache.get(e);
38
+ const t = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
39
+ return M.cache.set(e, t), t;
40
40
  }
41
- B.cache = /* @__PURE__ */ new Map();
42
- function J(e, n) {
43
- const t = ae();
44
- if (!t)
41
+ M.cache = /* @__PURE__ */ new Map();
42
+ function J(e, t) {
43
+ const n = ae();
44
+ if (!n)
45
45
  throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
46
- return t;
46
+ return n;
47
47
  }
48
48
  function ve() {
49
49
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
50
- const n = J(e).type;
51
- return B((n == null ? void 0 : n.aliasName) || (n == null ? void 0 : n.name));
50
+ const t = J(e).type;
51
+ return M((t == null ? void 0 : t.aliasName) || (t == null ? void 0 : t.name));
52
52
  }
53
- const _e = Symbol.for("vuetify:locale");
54
- function P() {
55
- const e = A(_e);
53
+ const ge = Symbol.for("vuetify:locale");
54
+ function X() {
55
+ const e = K(ge);
56
56
  if (!e)
57
57
  throw new Error("[Vuetify] Could not find injected locale instance");
58
58
  return e;
59
59
  }
60
- const ge = Symbol.for("vuetify:display");
61
- function ye() {
62
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ve();
63
- const t = A(ge);
64
- if (!t)
60
+ const _e = Symbol.for("vuetify:display");
61
+ function xe() {
62
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ve();
63
+ const n = K(_e);
64
+ if (!n)
65
65
  throw new Error("Could not find Vuetify display injection");
66
66
  const o = d(() => {
67
67
  if (!e.mobileBreakpoint)
68
- return t.mobile.value;
69
- const s = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : t.thresholds.value[e.mobileBreakpoint];
70
- return t.width.value < s;
71
- }), l = d(() => n ? {
72
- [`${n}--mobile`]: o.value
68
+ return n.mobile.value;
69
+ const r = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : n.thresholds.value[e.mobileBreakpoint];
70
+ return n.width.value < r;
71
+ }), l = d(() => t ? {
72
+ [`${t}--mobile`]: o.value
73
73
  } : {});
74
74
  return {
75
- ...t,
75
+ ...n,
76
76
  displayClasses: l,
77
77
  mobile: o
78
78
  };
79
79
  }
80
- const xe = Symbol.for("vuetify:theme");
80
+ const ye = Symbol.for("vuetify:theme");
81
81
  function F() {
82
82
  J("useTheme");
83
- const e = A(xe, null);
83
+ const e = K(ye, null);
84
84
  if (!e)
85
85
  throw new Error("Could not find Vuetify theme injection");
86
86
  return e;
87
87
  }
88
- const qe = /* @__PURE__ */ I({
88
+ const he = /* @__PURE__ */ q({
89
89
  __name: "index",
90
90
  props: {
91
91
  modelValue: { type: Boolean, required: !0 },
@@ -93,79 +93,79 @@ const qe = /* @__PURE__ */ I({
93
93
  },
94
94
  emits: ["update:modelValue"],
95
95
  setup(e) {
96
- const n = P(), t = H(e, "modelValue"), o = g(""), l = g(""), s = g(), c = g(), i = d(() => {
97
- var u;
98
- return ((u = s.value) == null ? void 0 : u.color) ?? "primary";
99
- }), m = d(() => {
100
- var u;
101
- return ((u = s.value) == null ? void 0 : u.text) ?? n.t("cancel");
96
+ const t = X(), n = H(e, "modelValue"), o = _(""), l = _(""), r = _(), s = _(), a = d(() => {
97
+ var c;
98
+ return ((c = r.value) == null ? void 0 : c.color) ?? "primary";
102
99
  }), f = d(() => {
103
- var u;
104
- return ((u = c.value) == null ? void 0 : u.color) ?? "primary";
100
+ var c;
101
+ return ((c = r.value) == null ? void 0 : c.text) ?? t.t("cancel");
102
+ }), p = d(() => {
103
+ var c;
104
+ return ((c = s.value) == null ? void 0 : c.color) ?? "primary";
105
105
  }), C = d(() => {
106
- var u;
107
- return ((u = c.value) == null ? void 0 : u.text) ?? n.t("confirm");
106
+ var c;
107
+ return ((c = s.value) == null ? void 0 : c.text) ?? t.t("confirm");
108
108
  });
109
- let $ = 0, D = !1;
110
- const E = (u) => {
111
- o.value = u.title, l.value = u.text, s.value = u.cancel, c.value = u.confirm, $ = u.seq, D = !1, t.value = !0;
109
+ let V = 0, D = !1;
110
+ const E = (c) => {
111
+ o.value = c.title, l.value = c.text, r.value = c.cancel, s.value = c.confirm, V = c.seq, D = !1, n.value = !0;
112
112
  };
113
- W(() => {
114
- a.on("confirmDlg", E);
115
- }), U(() => {
116
- a.off("confirmDlg", E);
113
+ R(() => {
114
+ i.on("confirmDlg", E);
115
+ }), L(() => {
116
+ i.off("confirmDlg", E);
117
117
  });
118
118
  const N = () => {
119
- t.value = !1, D || (a.emit("confirmDlgResult" + $, !0), D = !0);
119
+ n.value = !1, D || (i.emit("confirmDlgResult" + V, !0), D = !0);
120
120
  };
121
- return O(t, (u) => {
122
- !u && !D && (a.emit("confirmDlgResult" + $, !1), D = !0);
123
- }), (u, w) => {
124
- const V = p("v-card-title"), j = p("v-card-text"), S = p("v-btn"), r = p("v-card-actions"), x = p("v-card"), K = p("v-dialog");
125
- return k(), M(K, {
126
- modelValue: t.value,
127
- "onUpdate:modelValue": w[1] || (w[1] = (T) => t.value = T),
121
+ return O(n, (c) => {
122
+ !c && !D && (i.emit("confirmDlgResult" + V, !1), D = !0);
123
+ }), (c, h) => {
124
+ const S = m("v-card-title"), j = m("v-card-text"), I = m("v-btn"), u = m("v-card-actions"), y = m("v-card"), P = m("v-dialog");
125
+ return k(), W(P, {
126
+ modelValue: n.value,
127
+ "onUpdate:modelValue": h[1] || (h[1] = (T) => n.value = T),
128
128
  onKeydown: [
129
- w[2] || (w[2] = L(R((T) => t.value = !1, ["stop", "prevent"]), ["esc"])),
130
- L(R(N, ["stop", "prevent"]), ["enter"])
129
+ h[2] || (h[2] = A(B((T) => n.value = !1, ["stop", "prevent"]), ["esc"])),
130
+ A(B(N, ["stop", "prevent"]), ["enter"])
131
131
  ],
132
132
  transition: "dialog-top-transition",
133
133
  "max-width": "600px"
134
134
  }, {
135
135
  default: v(() => [
136
- y(x, null, {
136
+ x(y, null, {
137
137
  default: v(() => [
138
- y(V, null, {
138
+ x(S, null, {
139
139
  default: v(() => [
140
- h(b(o.value), 1)
140
+ b(w(o.value), 1)
141
141
  ]),
142
142
  _: 1
143
143
  }),
144
- y(j, null, {
144
+ x(j, null, {
145
145
  default: v(() => [
146
- h(b(l.value), 1)
146
+ b(w(l.value), 1)
147
147
  ]),
148
148
  _: 1
149
149
  }),
150
- y(r, { class: "d-flex justify-end" }, {
150
+ x(u, { class: "d-flex justify-end" }, {
151
151
  default: v(() => [
152
- y(S, {
153
- onClick: w[0] || (w[0] = (T) => t.value = !1),
154
- color: i.value,
152
+ x(I, {
153
+ onClick: h[0] || (h[0] = (T) => n.value = !1),
154
+ color: a.value,
155
155
  variant: "text"
156
156
  }, {
157
157
  default: v(() => [
158
- h(b(m.value), 1)
158
+ b(w(f.value), 1)
159
159
  ]),
160
160
  _: 1
161
161
  }, 8, ["color"]),
162
- y(S, {
162
+ x(I, {
163
163
  onClick: N,
164
- color: f.value,
164
+ color: p.value,
165
165
  variant: "text"
166
166
  }, {
167
167
  default: v(() => [
168
- h(b(C.value), 1)
168
+ b(w(C.value), 1)
169
169
  ]),
170
170
  _: 1
171
171
  }, 8, ["color"])
@@ -180,22 +180,22 @@ const qe = /* @__PURE__ */ I({
180
180
  }, 8, ["modelValue", "onKeydown"]);
181
181
  };
182
182
  }
183
- }), we = (e) => (ue("data-v-a8f3d91f"), e = e(), ce(), e), be = /* @__PURE__ */ we(() => /* @__PURE__ */ _("div", { class: "lds-spinner" }, [
184
- /* @__PURE__ */ _("div"),
185
- /* @__PURE__ */ _("div"),
186
- /* @__PURE__ */ _("div"),
187
- /* @__PURE__ */ _("div"),
188
- /* @__PURE__ */ _("div"),
189
- /* @__PURE__ */ _("div"),
190
- /* @__PURE__ */ _("div"),
191
- /* @__PURE__ */ _("div"),
192
- /* @__PURE__ */ _("div"),
193
- /* @__PURE__ */ _("div"),
194
- /* @__PURE__ */ _("div"),
195
- /* @__PURE__ */ _("div")
196
- ], -1)), he = [
183
+ }), we = (e) => (ue("data-v-a8f3d91f"), e = e(), ie(), e), be = /* @__PURE__ */ we(() => /* @__PURE__ */ g("div", { class: "lds-spinner" }, [
184
+ /* @__PURE__ */ g("div"),
185
+ /* @__PURE__ */ g("div"),
186
+ /* @__PURE__ */ g("div"),
187
+ /* @__PURE__ */ g("div"),
188
+ /* @__PURE__ */ g("div"),
189
+ /* @__PURE__ */ g("div"),
190
+ /* @__PURE__ */ g("div"),
191
+ /* @__PURE__ */ g("div"),
192
+ /* @__PURE__ */ g("div"),
193
+ /* @__PURE__ */ g("div"),
194
+ /* @__PURE__ */ g("div"),
195
+ /* @__PURE__ */ g("div")
196
+ ], -1)), ke = [
197
197
  be
198
- ], ke = /* @__PURE__ */ I({
198
+ ], Ce = /* @__PURE__ */ q({
199
199
  __name: "index",
200
200
  props: {
201
201
  zIndex: {
@@ -204,21 +204,21 @@ const qe = /* @__PURE__ */ I({
204
204
  }
205
205
  },
206
206
  setup(e) {
207
- const n = F(), t = e, o = d(() => ({
208
- background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
209
- zIndex: t.zIndex
207
+ const t = F(), n = e, o = d(() => ({
208
+ background: t.current.value.dark ? "#1e1e1e" : "#ffffff",
209
+ zIndex: n.zIndex
210
210
  }));
211
- return (l, s) => (k(), z("div", {
211
+ return (l, r) => (k(), U("div", {
212
212
  class: "x-cont",
213
213
  style: se(o.value)
214
- }, he, 4));
214
+ }, ke, 4));
215
215
  }
216
- }), Q = (e, n) => {
217
- const t = e.__vccOpts || e;
218
- for (const [o, l] of n)
219
- t[o] = l;
220
- return t;
221
- }, Be = /* @__PURE__ */ Q(ke, [["__scopeId", "data-v-a8f3d91f"]]), Ce = /* @__PURE__ */ I({
216
+ }), Q = (e, t) => {
217
+ const n = e.__vccOpts || e;
218
+ for (const [o, l] of t)
219
+ n[o] = l;
220
+ return n;
221
+ }, De = /* @__PURE__ */ Q(Ce, [["__scopeId", "data-v-a8f3d91f"]]), Se = /* @__PURE__ */ q({
222
222
  __name: "item",
223
223
  props: {
224
224
  id: {
@@ -239,39 +239,39 @@ const qe = /* @__PURE__ */ I({
239
239
  }
240
240
  },
241
241
  emits: ["timeout"],
242
- setup(e, { emit: n }) {
243
- const t = e, o = g(!0), l = n, s = d(() => {
244
- let c = "";
245
- switch (t.type) {
242
+ setup(e, { emit: t }) {
243
+ const n = e, o = _(!0), l = t, r = d(() => {
244
+ let s = "";
245
+ switch (n.type) {
246
246
  case "error":
247
- c = "cancel";
247
+ s = "cancel";
248
248
  break;
249
249
  case "info":
250
- c = "info";
250
+ s = "info";
251
251
  break;
252
252
  case "success":
253
- c = "check-circle";
253
+ s = "check-circle";
254
254
  break;
255
255
  case "warning":
256
- c = "error";
256
+ s = "error";
257
257
  break;
258
258
  }
259
- return c;
259
+ return s;
260
260
  });
261
- return W(() => {
261
+ return R(() => {
262
262
  setTimeout(() => {
263
- l("timeout", t.id);
264
- }, t.timeout);
265
- }), O(o, (c) => {
266
- c || l("timeout", t.id);
267
- }), (c, i) => {
268
- const m = p("v-alert");
269
- return k(), M(m, {
263
+ l("timeout", n.id);
264
+ }, n.timeout);
265
+ }), O(o, (s) => {
266
+ s || l("timeout", n.id);
267
+ }), (s, a) => {
268
+ const f = m("v-alert");
269
+ return k(), W(f, {
270
270
  modelValue: o.value,
271
- "onUpdate:modelValue": i[0] || (i[0] = (f) => o.value = f),
271
+ "onUpdate:modelValue": a[0] || (a[0] = (p) => o.value = p),
272
272
  class: "mt-2",
273
273
  type: e.type,
274
- icon: s.value,
274
+ icon: r.value,
275
275
  text: e.text,
276
276
  "max-width": "90%",
277
277
  width: "500px",
@@ -281,44 +281,44 @@ const qe = /* @__PURE__ */ I({
281
281
  }, null, 8, ["modelValue", "type", "icon", "text"]);
282
282
  };
283
283
  }
284
- }), De = /* @__PURE__ */ I({
284
+ }), qe = /* @__PURE__ */ q({
285
285
  __name: "index",
286
286
  setup(e) {
287
- const n = ie({ items: [] });
288
- W(() => {
289
- a.on("message", t);
290
- }), U(() => {
291
- a.off("message", t);
287
+ const t = ce({ items: [] });
288
+ R(() => {
289
+ i.on("message", n);
290
+ }), L(() => {
291
+ i.off("message", n);
292
292
  });
293
- const t = (i) => {
294
- s(i.type, i.text, i.timeout);
295
- }, o = (i) => {
296
- c(i);
293
+ const n = (a) => {
294
+ r(a.type, a.text, a.timeout);
295
+ }, o = (a) => {
296
+ s(a);
297
297
  };
298
298
  let l = 0;
299
- const s = (i, m, f) => {
299
+ const r = (a, f, p) => {
300
300
  const C = l++;
301
- n.items.push({ id: C, type: i, text: m, timeout: f });
302
- }, c = (i) => {
303
- const m = n.items.findIndex((f) => f.id === i);
304
- m >= 0 && n.items.splice(m, 1);
301
+ t.items.push({ id: C, type: a, text: f, timeout: p });
302
+ }, s = (a) => {
303
+ const f = t.items.findIndex((p) => p.id === a);
304
+ f >= 0 && t.items.splice(f, 1);
305
305
  };
306
- return (i, m) => (k(), z("div", {
307
- onClick: m[0] || (m[0] = R(() => {
306
+ return (a, f) => (k(), U("div", {
307
+ onClick: f[0] || (f[0] = B(() => {
308
308
  }, ["stop"])),
309
309
  class: "x-cont d-flex flex-column-reverse align-center"
310
310
  }, [
311
- (k(!0), z(de, null, fe(n.items, (f) => (k(), M(Ce, {
311
+ (k(!0), U(de, null, pe(t.items, (p) => (k(), W(Se, {
312
312
  onTimeout: o,
313
- id: f.id,
314
- type: f.type,
315
- text: f.text,
316
- timeout: f.timeout,
317
- key: f.id
313
+ id: p.id,
314
+ type: p.type,
315
+ text: p.text,
316
+ timeout: p.timeout,
317
+ key: p.id
318
318
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
319
319
  ]));
320
320
  }
321
- }), Re = /* @__PURE__ */ Q(De, [["__scopeId", "data-v-70ed4b89"]]), We = /* @__PURE__ */ I({
321
+ }), Ve = /* @__PURE__ */ Q(qe, [["__scopeId", "data-v-70ed4b89"]]), Ie = /* @__PURE__ */ q({
322
322
  __name: "index",
323
323
  props: {
324
324
  modelValue: { type: Boolean, required: !0 },
@@ -326,94 +326,94 @@ const qe = /* @__PURE__ */ I({
326
326
  },
327
327
  emits: ["update:modelValue"],
328
328
  setup(e) {
329
- const n = P(), t = H(e, "modelValue"), o = g(""), l = g(""), s = g(), c = g(), i = g(), m = g(""), f = g(), C = g(), $ = d(() => {
330
- var r;
331
- return ((r = f.value) == null ? void 0 : r.color) ?? "primary";
329
+ const t = X(), n = H(e, "modelValue"), o = _(""), l = _(""), r = _(), s = _(), a = _(), f = _(""), p = _(), C = _(), V = d(() => {
330
+ var u;
331
+ return ((u = p.value) == null ? void 0 : u.color) ?? "primary";
332
332
  }), D = d(() => {
333
- var r;
334
- return ((r = f.value) == null ? void 0 : r.text) ?? n.t("cancel");
333
+ var u;
334
+ return ((u = p.value) == null ? void 0 : u.text) ?? t.t("cancel");
335
335
  }), E = d(() => {
336
- var r;
337
- return ((r = C.value) == null ? void 0 : r.color) ?? "primary";
336
+ var u;
337
+ return ((u = C.value) == null ? void 0 : u.color) ?? "primary";
338
338
  }), N = d(() => {
339
- var r;
340
- return ((r = C.value) == null ? void 0 : r.text) ?? n.t("confirm");
341
- }), u = g();
342
- let w = 0, V = !1;
343
- const j = async (r) => {
344
- var x;
345
- o.value = r.title, l.value = r.text, s.value = r.label, c.value = r.placeholder, i.value = r.rules, m.value = r.value, f.value = r.cancel, C.value = r.confirm, w = r.seq, V = !1, t.value = !0, await X(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
339
+ var u;
340
+ return ((u = C.value) == null ? void 0 : u.text) ?? t.t("confirm");
341
+ }), c = _();
342
+ let h = 0, S = !1;
343
+ const j = async (u) => {
344
+ var y;
345
+ o.value = u.title, l.value = u.text, r.value = u.label, s.value = u.placeholder, a.value = u.rules, f.value = u.value, p.value = u.cancel, C.value = u.confirm, h = u.seq, S = !1, n.value = !0, await z(() => c.value !== void 0, 1e3), (y = c.value) == null || y.focus();
346
346
  };
347
- W(() => {
348
- a.on("promptDlg", j);
349
- }), U(() => {
350
- a.off("promptDlg", j);
347
+ R(() => {
348
+ i.on("promptDlg", j);
349
+ }), L(() => {
350
+ i.off("promptDlg", j);
351
351
  });
352
- const S = () => {
353
- t.value = !1, V || (a.emit("promptDlgResult" + w, m.value ?? ""), V = !0);
352
+ const I = () => {
353
+ n.value = !1, S || (i.emit("promptDlgResult" + h, f.value ?? ""), S = !0);
354
354
  };
355
- return O(t, (r) => {
356
- !r && !V && (a.emit("promptDlgResult" + w, void 0), V = !0);
357
- }), (r, x) => {
358
- const K = p("v-card-title"), T = p("v-card-text"), te = p("v-text-field"), ne = p("v-form"), Z = p("v-btn"), oe = p("v-card-actions"), le = p("v-card"), re = p("v-dialog");
359
- return k(), M(re, {
360
- modelValue: t.value,
361
- "onUpdate:modelValue": x[2] || (x[2] = (q) => t.value = q),
355
+ return O(n, (u) => {
356
+ !u && !S && (i.emit("promptDlgResult" + h, void 0), S = !0);
357
+ }), (u, y) => {
358
+ const P = m("v-card-title"), T = m("v-card-text"), te = m("v-text-field"), ne = m("v-form"), Z = m("v-btn"), oe = m("v-card-actions"), le = m("v-card"), re = m("v-dialog");
359
+ return k(), W(re, {
360
+ modelValue: n.value,
361
+ "onUpdate:modelValue": y[2] || (y[2] = ($) => n.value = $),
362
362
  onKeydown: [
363
- x[3] || (x[3] = L(R((q) => t.value = !1, ["stop", "prevent"]), ["esc"])),
364
- L(R(S, ["stop", "prevent"]), ["enter"])
363
+ y[3] || (y[3] = A(B(($) => n.value = !1, ["stop", "prevent"]), ["esc"])),
364
+ A(B(I, ["stop", "prevent"]), ["enter"])
365
365
  ],
366
366
  transition: "dialog-top-transition",
367
367
  "max-width": "600px"
368
368
  }, {
369
369
  default: v(() => [
370
- y(le, null, {
370
+ x(le, null, {
371
371
  default: v(() => [
372
- y(K, null, {
372
+ x(P, null, {
373
373
  default: v(() => [
374
- h(b(o.value), 1)
374
+ b(w(o.value), 1)
375
375
  ]),
376
376
  _: 1
377
377
  }),
378
- y(T, null, {
378
+ x(T, null, {
379
379
  default: v(() => [
380
- h(b(l.value), 1)
380
+ b(w(l.value), 1)
381
381
  ]),
382
382
  _: 1
383
383
  }),
384
- y(ne, { class: "mx-3" }, {
384
+ x(ne, { class: "mx-3" }, {
385
385
  default: v(() => [
386
- y(te, {
387
- modelValue: m.value,
388
- "onUpdate:modelValue": x[0] || (x[0] = (q) => m.value = q),
389
- label: s.value,
390
- placeholder: c.value,
391
- rules: i.value,
386
+ x(te, {
387
+ modelValue: f.value,
388
+ "onUpdate:modelValue": y[0] || (y[0] = ($) => f.value = $),
389
+ label: r.value,
390
+ placeholder: s.value,
391
+ rules: a.value,
392
392
  ref_key: "target",
393
- ref: u
393
+ ref: c
394
394
  }, null, 8, ["modelValue", "label", "placeholder", "rules"])
395
395
  ]),
396
396
  _: 1
397
397
  }),
398
- y(oe, { class: "d-flex justify-end" }, {
398
+ x(oe, { class: "d-flex justify-end" }, {
399
399
  default: v(() => [
400
- y(Z, {
401
- onClick: x[1] || (x[1] = (q) => t.value = !1),
402
- color: $.value,
400
+ x(Z, {
401
+ onClick: y[1] || (y[1] = ($) => n.value = !1),
402
+ color: V.value,
403
403
  variant: "text"
404
404
  }, {
405
405
  default: v(() => [
406
- h(b(D.value), 1)
406
+ b(w(D.value), 1)
407
407
  ]),
408
408
  _: 1
409
409
  }, 8, ["color"]),
410
- y(Z, {
411
- onClick: S,
410
+ x(Z, {
411
+ onClick: I,
412
412
  color: E.value,
413
413
  variant: "text"
414
414
  }, {
415
415
  default: v(() => [
416
- h(b(N.value), 1)
416
+ b(w(N.value), 1)
417
417
  ]),
418
418
  _: 1
419
419
  }, 8, ["color"])
@@ -428,37 +428,37 @@ const qe = /* @__PURE__ */ I({
428
428
  }, 8, ["modelValue", "onKeydown"]);
429
429
  };
430
430
  }
431
- }), Ve = { class: "mx-auto my-auto" }, Ie = { class: "d-flex align-center justify-center w-100 h-100" }, Me = /* @__PURE__ */ I({
431
+ }), Te = { class: "mx-auto my-auto" }, $e = { class: "d-flex align-center justify-center w-100 h-100" }, Me = /* @__PURE__ */ q({
432
432
  __name: "index",
433
433
  setup(e) {
434
- const n = P(), t = g(!1), o = () => {
435
- t.value = !0;
434
+ const t = X(), n = _(!1), o = () => {
435
+ n.value = !0;
436
436
  }, l = () => {
437
- t.value = !1;
437
+ n.value = !1;
438
438
  };
439
- return W(() => {
440
- a.on("openWaitDlg", o), a.on("closeWaitDlg", l);
441
- }), U(() => {
442
- a.off("openWaitDlg", o), a.off("closeWaitDlg", l);
443
- }), (s, c) => {
444
- const i = p("v-card"), m = p("v-dialog");
445
- return k(), M(m, {
446
- "model-value": t.value,
447
- "onUpdate:modelValue": c[0] || (c[0] = (f) => t.value = f),
439
+ return R(() => {
440
+ i.on("openWaitDlg", o), i.on("closeWaitDlg", l);
441
+ }), L(() => {
442
+ i.off("openWaitDlg", o), i.off("closeWaitDlg", l);
443
+ }), (r, s) => {
444
+ const a = m("v-card"), f = m("v-dialog");
445
+ return k(), W(f, {
446
+ "model-value": n.value,
447
+ "onUpdate:modelValue": s[0] || (s[0] = (p) => n.value = p),
448
448
  persistent: "",
449
449
  "no-click-animation": "",
450
450
  fullscreen: ""
451
451
  }, {
452
452
  default: v(() => [
453
- _("div", Ve, [
454
- y(i, {
453
+ g("div", Te, [
454
+ x(a, {
455
455
  width: "300px",
456
456
  height: "80px",
457
457
  loading: ""
458
458
  }, {
459
459
  default: v(() => [
460
- _("div", Ie, [
461
- _("span", null, b(me(n).t("waitingResponse")), 1)
460
+ g("div", $e, [
461
+ g("span", null, w(fe(t).t("waitingResponse")), 1)
462
462
  ])
463
463
  ]),
464
464
  _: 1
@@ -470,95 +470,142 @@ const qe = /* @__PURE__ */ I({
470
470
  };
471
471
  }
472
472
  });
473
- function Ee() {
474
- const e = F(), n = d(() => e.global.current.value.colors.primary), t = d(() => e.global.current.value.colors.secondary), o = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), s = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), i = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
473
+ function Ae() {
474
+ const e = F(), t = d(() => e.global.current.value.colors.primary), n = d(() => e.global.current.value.colors.secondary), o = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), s = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), a = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
475
475
  return {
476
- primaryColor: n,
477
- secondaryColor: t,
476
+ primaryColor: t,
477
+ secondaryColor: n,
478
478
  backgroundColor0: o,
479
479
  backgroundColor1: l,
480
- backgroundColor2: s,
481
- highlightColor: c,
482
- borderColor: i
480
+ backgroundColor2: r,
481
+ highlightColor: s,
482
+ borderColor: a
483
483
  };
484
484
  }
485
- function Ne() {
486
- const e = F(), { width: n } = ye(), t = d(() => e.current.value.dark), o = g(""), l = d(() => !!window.cordova), s = d(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
487
- return { dark: t, routeTransName: o, sysBarAvail: l, compactWidth: s };
485
+ function Le() {
486
+ const e = F(), { width: t } = xe(), n = d(() => e.current.value.dark), o = _(""), l = d(() => !!window.cordova), r = d(() => t.value <= 1280 ? t.value + "px" : t.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
487
+ return { dark: n, routeTransName: o, sysBarAvail: l, compactWidth: r };
488
488
  }
489
489
  let G = Date.now();
490
490
  function Y() {
491
491
  const e = Date.now();
492
492
  return e - G > 500 ? (G = e, !0) : !1;
493
493
  }
494
- let $e = 0;
494
+ let Be = 0;
495
495
  function ee() {
496
- return ++$e;
496
+ return ++Be;
497
497
  }
498
- async function je(e) {
498
+ async function Pe(e) {
499
499
  if (!Y())
500
500
  return;
501
- let n = !1, t;
502
- const o = (s) => {
503
- t = s, n = !0;
501
+ let t = !1, n;
502
+ const o = (r) => {
503
+ n = r, t = !0;
504
504
  }, l = ee();
505
- return a.on("confirmDlgResult" + l, o), a.emit("confirmDlg", { ...e, seq: l }), await X(() => n), a.off("confirmDlgResult" + l, o), t;
505
+ return i.on("confirmDlgResult" + l, o), i.emit("confirmDlg", { ...e, seq: l }), await z(() => t), i.off("confirmDlgResult" + l, o), n;
506
506
  }
507
- async function Le(e) {
507
+ async function Ue(e) {
508
508
  if (!Y())
509
509
  return;
510
- let n = !1, t;
511
- const o = (s) => {
512
- t = s, n = !0;
510
+ let t = !1, n;
511
+ const o = (r) => {
512
+ n = r, t = !0;
513
513
  }, l = ee();
514
- return a.on("promptDlgResult" + l, o), a.emit("promptDlg", { ...e, seq: l }), await X(() => n), a.off("promptDlgResult" + l, o), t;
515
- }
516
- function Ue() {
517
- a.emit("openWaitDlg");
514
+ return i.on("promptDlgResult" + l, o), i.emit("promptDlg", { ...e, seq: l }), await z(() => t), i.off("promptDlgResult" + l, o), n;
518
515
  }
519
516
  function Ke() {
520
- a.emit("closeWaitDlg");
517
+ i.emit("openWaitDlg");
521
518
  }
522
- function ze(e, n) {
523
- a.emit("message", { type: "error", text: e, timeout: n });
519
+ function Oe() {
520
+ i.emit("closeWaitDlg");
524
521
  }
525
- function Ae(e, n) {
526
- a.emit("message", { type: "info", text: e, timeout: n });
522
+ function ze(e, t) {
523
+ i.emit("message", { type: "error", text: e, timeout: t });
527
524
  }
528
- function Oe(e, n) {
529
- a.emit("message", { type: "success", text: e, timeout: n });
525
+ function Xe(e, t) {
526
+ i.emit("message", { type: "info", text: e, timeout: t });
530
527
  }
531
- function Xe(e, n) {
532
- a.emit("message", { type: "warning", text: e, timeout: n });
528
+ function Fe(e, t) {
529
+ i.emit("message", { type: "success", text: e, timeout: t });
533
530
  }
534
- function Pe(e) {
531
+ function Ze(e, t) {
532
+ i.emit("message", { type: "warning", text: e, timeout: t });
533
+ }
534
+ function Ge(e) {
535
535
  var o, l;
536
536
  if (!window.appAppear) {
537
537
  window.appAppear = !0;
538
538
  return;
539
539
  }
540
- const n = "single-spa-application:" + e, t = (o = document.getElementById(n)) == null ? void 0 : o.classList;
541
- t && (t.remove("app-left", "app-right", "app-reset"), (l = window.routeExtras) != null && l.forward ? t.add("app-left") : t.add("app-right"), setTimeout(() => {
542
- t.add("app-reset");
540
+ const t = "single-spa-application:" + e, n = (o = document.getElementById(t)) == null ? void 0 : o.classList;
541
+ n && (n.remove("app-left", "app-right", "app-reset"), (l = window.routeExtras) != null && l.forward ? n.add("app-left") : n.add("app-right"), setTimeout(() => {
542
+ n.add("app-reset");
543
543
  }, 0));
544
544
  }
545
+ const Re = [
546
+ { path: "/passport/login", level: 0 },
547
+ { path: "/passport/loginAccount", level: 1 },
548
+ { path: "/passport/register", level: 1 },
549
+ { path: "/org/joinOrCreate", level: 1, requiredState: "auth" },
550
+ { path: "/org/manager", level: 1, requiredState: "org" },
551
+ { path: "/main", level: 0, requiredState: "org" },
552
+ { path: "/mine/personalInfo", level: 1, requiredState: "org" },
553
+ { path: "/mine/accountSecurity", level: 2, requiredState: "org" },
554
+ { path: "/mine/settings", level: 1, requiredState: "org" },
555
+ { path: "/mine/general", level: 2, requiredState: "org" },
556
+ { path: "/mine/general/darkMode", level: 3, requiredState: "org" },
557
+ { path: "/mine/general/language", level: 3, requiredState: "org" },
558
+ { path: "/app/manager", level: 1, requiredState: "org" },
559
+ { path: "/app/editor", level: 2, requiredState: "org" },
560
+ { path: "/app/editor/*", level: 2, requiredState: "org" },
561
+ { path: "/asset", level: 1, requiredState: "org" },
562
+ { path: "/calc", level: 1, requiredState: "org" },
563
+ { path: "/data", level: 1, requiredState: "org" }
564
+ ];
565
+ function We(e) {
566
+ let t, n = 0;
567
+ const o = e.split("/");
568
+ return Re.forEach((l) => {
569
+ const r = l.path.split("/");
570
+ let s = 0;
571
+ for (let a = 0; a < o.length && !(a >= r.length || o[a] !== r[a]); a++)
572
+ s++;
573
+ s >= n && (t = l, n = s);
574
+ }), t;
575
+ }
576
+ function He(e) {
577
+ if (e === "/")
578
+ return { app: "", path: "/", level: -1 };
579
+ const t = We(e);
580
+ if (!t)
581
+ return { app: "invalidApp", path: "/invalidApp/invalidRoute", level: -1 };
582
+ const n = e.split("/");
583
+ return console.assert(n.length >= 2), { app: n[1], path: t.path, level: t.level };
584
+ }
585
+ const Ee = (e) => {
586
+ e.component("x-confirm-dlg", he), e.component("x-loading", De), e.component("x-message", Ve), e.component("x-prompt-dlg", Ie), e.component("x-wait-dlg", Me);
587
+ }, Je = { install: Ee };
545
588
  export {
546
- qe as XConfirmDlg,
547
- Be as XLoading,
548
- Re as XMessage,
549
- We as XPromptDlg,
589
+ he as XConfirmDlg,
590
+ De as XLoading,
591
+ Ve as XMessage,
592
+ Ie as XPromptDlg,
550
593
  Me as XWaitDlg,
551
- Pe as appAppear,
552
- Ke as closeWaitDlg,
594
+ Ge as appAppear,
595
+ Oe as closeWaitDlg,
596
+ Je as default,
597
+ He as getPathInfo,
598
+ We as matchRouteMeta,
553
599
  ze as messageError,
554
- Ae as messageInfo,
555
- Oe as messageSuccess,
556
- Xe as messageWarning,
557
- je as openConfirmDlg,
558
- Le as openPromptDlg,
559
- Ue as openWaitDlg,
560
- Ee as useColor,
561
- Ne as useSystem,
562
- Te as waitMs,
563
- X as waitUtil
600
+ Xe as messageInfo,
601
+ Fe as messageSuccess,
602
+ Ze as messageWarning,
603
+ Pe as openConfirmDlg,
604
+ Ue as openPromptDlg,
605
+ Ke as openWaitDlg,
606
+ Re as routeMetas,
607
+ Ae as useColor,
608
+ Le as useSystem,
609
+ je as waitMs,
610
+ z as waitUtil
564
611
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.1.4",
4
+ "version": "0.1.6",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",