x-essential-lib 0.1.9 → 0.1.10

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