x-essential-lib 0.3.0 → 0.3.2

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.
@@ -1 +1 @@
1
- export declare function useHotkey(): void;
1
+ export declare function useHotkey(prod: boolean): {};
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
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
2
  import { VAlert as we, VBtn as ye, VCard as ke, VCardActions as be, VCardText as Ce, VCardTitle as Ve, VDialog as De, VForm as Se, VTextField as qe } from "vuetify/lib/components/index.mjs";
3
- import { ref as f, computed as d, onMounted as q, onBeforeUnmount as R, defineComponent as O, watch as P, resolveComponent as v, openBlock as C, createBlock as $, unref as L, isRef as X, withKeys as K, withModifiers as M, withCtx as g, createVNode as h, createTextVNode as b, toDisplayString as k, createElementBlock as H, normalizeStyle as Re, pushScopeId as Oe, popScopeId as Ee, createElementVNode as _, reactive as Ie, Fragment as Te, renderList as je, inject as le } from "vue";
4
- import { useLocale as F, useTheme as N, useDisplay as Pe } from "vuetify/lib/framework.mjs";
3
+ import { ref as m, computed as f, onMounted as q, onBeforeUnmount as R, defineComponent as O, watch as P, resolveComponent as v, openBlock as C, createBlock as $, unref as U, isRef as X, withKeys as W, withModifiers as M, withCtx as g, createVNode as h, createTextVNode as b, toDisplayString as k, createElementBlock as N, normalizeStyle as Re, pushScopeId as Oe, popScopeId as Ee, createElementVNode as _, reactive as Ie, Fragment as Te, renderList as je, inject as le } from "vue";
4
+ import { useLocale as F, useTheme as H, useDisplay as Pe } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as ae } from "pinia";
6
6
  import { useI18n as Me } from "vue-i18n";
7
7
  import $e from "axios";
8
8
  const se = ae("viewMgr", () => {
9
- const e = f([]);
9
+ const e = m([]);
10
10
  function n() {
11
11
  return e.value.length <= 0;
12
12
  }
@@ -41,7 +41,7 @@ function Ae(e) {
41
41
  });
42
42
  } };
43
43
  }
44
- const c = Ae();
44
+ const i = Ae();
45
45
  async function xt(e) {
46
46
  return new Promise((n) => {
47
47
  setTimeout(n, e);
@@ -57,7 +57,7 @@ async function G(e, n, t) {
57
57
  });
58
58
  }
59
59
  function J(e, n) {
60
- const t = se(), o = d({
60
+ const t = se(), o = f({
61
61
  get() {
62
62
  return t.hasView(e);
63
63
  },
@@ -68,49 +68,49 @@ function J(e, n) {
68
68
  n == null || n(a), o.value = !0;
69
69
  };
70
70
  return q(() => {
71
- c.on(e, r);
71
+ i.on(e, r);
72
72
  }), R(() => {
73
- c.off(e, r);
73
+ i.off(e, r);
74
74
  }), { open: o };
75
75
  }
76
76
  const Be = /* @__PURE__ */ O({
77
77
  __name: "index",
78
78
  setup(e) {
79
- const n = F(), { open: t } = J("confirmDlg"), o = f(""), r = f(""), a = f(), l = f(), s = d(() => {
80
- var u;
81
- return ((u = a.value) == null ? void 0 : u.color) ?? "primary";
82
- }), p = d(() => {
83
- var u;
84
- return ((u = a.value) == null ? void 0 : u.text) ?? n.t("cancel");
85
- }), m = d(() => {
86
- var u;
87
- return ((u = l.value) == null ? void 0 : u.color) ?? "primary";
88
- }), V = d(() => {
89
- var u;
90
- return ((u = l.value) == null ? void 0 : u.text) ?? n.t("confirm");
79
+ const n = F(), { open: t } = J("confirmDlg"), o = m(""), r = m(""), a = m(), l = m(), s = f(() => {
80
+ var d;
81
+ return ((d = a.value) == null ? void 0 : d.color) ?? "primary";
82
+ }), p = f(() => {
83
+ var d;
84
+ return ((d = a.value) == null ? void 0 : d.text) ?? n.t("cancel");
85
+ }), c = f(() => {
86
+ var d;
87
+ return ((d = l.value) == null ? void 0 : d.color) ?? "primary";
88
+ }), V = f(() => {
89
+ var d;
90
+ return ((d = l.value) == null ? void 0 : d.text) ?? n.t("confirm");
91
91
  });
92
92
  let E = 0, D = !1;
93
- const A = (u) => {
94
- o.value = u.title, r.value = u.text, a.value = u.cancel, l.value = u.confirm, E = u.seq, D = !1, t.value = !0;
93
+ const A = (d) => {
94
+ o.value = d.title, r.value = d.text, a.value = d.cancel, l.value = d.confirm, E = d.seq, D = !1, t.value = !0;
95
95
  };
96
96
  q(() => {
97
- c.on("confirmDlg", A);
97
+ i.on("confirmDlg", A);
98
98
  }), R(() => {
99
- c.off("confirmDlg", A);
99
+ i.off("confirmDlg", A);
100
100
  });
101
101
  const B = () => {
102
- t.value = !1, D || (c.emit("confirmDlgResult" + E, !0), D = !0);
102
+ t.value = !1, D || (i.emit("confirmDlgResult" + E, !0), D = !0);
103
103
  };
104
- return P(t, (u) => {
105
- !u && !D && (c.emit("confirmDlgResult" + E, !1), D = !0);
106
- }), (u, w) => {
107
- const S = v("v-card-title"), U = v("v-card-text"), I = v("v-btn"), i = v("v-card-actions"), x = v("v-card"), z = v("v-dialog");
104
+ return P(t, (d) => {
105
+ !d && !D && (i.emit("confirmDlgResult" + E, !1), D = !0);
106
+ }), (d, w) => {
107
+ const S = v("v-card-title"), L = v("v-card-text"), I = v("v-btn"), u = v("v-card-actions"), x = v("v-card"), z = v("v-dialog");
108
108
  return C(), $(z, {
109
- modelValue: L(t),
109
+ modelValue: U(t),
110
110
  "onUpdate:modelValue": w[1] || (w[1] = (T) => X(t) ? t.value = T : null),
111
111
  onKeydown: [
112
- w[2] || (w[2] = K(M((T) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
- K(M(B, ["stop", "prevent"]), ["enter"])
112
+ w[2] || (w[2] = W(M((T) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
+ W(M(B, ["stop", "prevent"]), ["enter"])
114
114
  ],
115
115
  transition: "dialog-top-transition",
116
116
  "max-width": "600px"
@@ -124,13 +124,13 @@ const Be = /* @__PURE__ */ O({
124
124
  ]),
125
125
  _: 1
126
126
  }),
127
- h(U, null, {
127
+ h(L, null, {
128
128
  default: g(() => [
129
129
  b(k(r.value), 1)
130
130
  ]),
131
131
  _: 1
132
132
  }),
133
- h(i, { class: "d-flex justify-end" }, {
133
+ h(u, { class: "d-flex justify-end" }, {
134
134
  default: g(() => [
135
135
  h(I, {
136
136
  onClick: w[0] || (w[0] = (T) => t.value = !1),
@@ -144,7 +144,7 @@ const Be = /* @__PURE__ */ O({
144
144
  }, 8, ["color"]),
145
145
  h(I, {
146
146
  onClick: B,
147
- color: m.value,
147
+ color: c.value,
148
148
  variant: "text"
149
149
  }, {
150
150
  default: g(() => [
@@ -163,7 +163,7 @@ const Be = /* @__PURE__ */ O({
163
163
  }, 8, ["modelValue", "onKeydown"]);
164
164
  };
165
165
  }
166
- }), Ue = (e) => (Oe("data-v-a8f3d91f"), e = e(), Ee(), e), We = /* @__PURE__ */ Ue(() => /* @__PURE__ */ _("div", { class: "lds-spinner" }, [
166
+ }), Le = (e) => (Oe("data-v-a8f3d91f"), e = e(), Ee(), e), Ke = /* @__PURE__ */ Le(() => /* @__PURE__ */ _("div", { class: "lds-spinner" }, [
167
167
  /* @__PURE__ */ _("div"),
168
168
  /* @__PURE__ */ _("div"),
169
169
  /* @__PURE__ */ _("div"),
@@ -176,9 +176,9 @@ const Be = /* @__PURE__ */ O({
176
176
  /* @__PURE__ */ _("div"),
177
177
  /* @__PURE__ */ _("div"),
178
178
  /* @__PURE__ */ _("div")
179
- ], -1)), Le = [
180
- We
181
- ], Ke = /* @__PURE__ */ O({
179
+ ], -1)), Ue = [
180
+ Ke
181
+ ], We = /* @__PURE__ */ O({
182
182
  __name: "index",
183
183
  props: {
184
184
  zIndex: {
@@ -187,21 +187,21 @@ const Be = /* @__PURE__ */ O({
187
187
  }
188
188
  },
189
189
  setup(e) {
190
- const n = N(), t = e, o = d(() => ({
190
+ const n = H(), t = e, o = f(() => ({
191
191
  background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
192
192
  zIndex: t.zIndex
193
193
  }));
194
- return (r, a) => (C(), H("div", {
194
+ return (r, a) => (C(), N("div", {
195
195
  class: "x-cont",
196
196
  style: Re(o.value)
197
- }, Le, 4));
197
+ }, Ue, 4));
198
198
  }
199
199
  }), ce = (e, n) => {
200
200
  const t = e.__vccOpts || e;
201
201
  for (const [o, r] of n)
202
202
  t[o] = r;
203
203
  return t;
204
- }, Ne = /* @__PURE__ */ ce(Ke, [["__scopeId", "data-v-a8f3d91f"]]), ze = /* @__PURE__ */ O({
204
+ }, He = /* @__PURE__ */ ce(We, [["__scopeId", "data-v-a8f3d91f"]]), ze = /* @__PURE__ */ O({
205
205
  __name: "item",
206
206
  props: {
207
207
  id: {
@@ -223,7 +223,7 @@ const Be = /* @__PURE__ */ O({
223
223
  },
224
224
  emits: ["timeout"],
225
225
  setup(e, { emit: n }) {
226
- const t = e, o = f(!0), r = n, a = d(() => {
226
+ const t = e, o = m(!0), r = n, a = f(() => {
227
227
  let l = "";
228
228
  switch (t.type) {
229
229
  case "error":
@@ -251,7 +251,7 @@ const Be = /* @__PURE__ */ O({
251
251
  const p = v("v-alert");
252
252
  return C(), $(p, {
253
253
  modelValue: o.value,
254
- "onUpdate:modelValue": s[0] || (s[0] = (m) => o.value = m),
254
+ "onUpdate:modelValue": s[0] || (s[0] = (c) => o.value = c),
255
255
  class: "mt-2",
256
256
  type: e.type,
257
257
  icon: a.value,
@@ -264,14 +264,14 @@ const Be = /* @__PURE__ */ O({
264
264
  }, null, 8, ["modelValue", "type", "icon", "text"]);
265
265
  };
266
266
  }
267
- }), He = /* @__PURE__ */ O({
267
+ }), Ne = /* @__PURE__ */ O({
268
268
  __name: "index",
269
269
  setup(e) {
270
270
  const n = Ie({ items: [] });
271
271
  q(() => {
272
- c.on("message", t);
272
+ i.on("message", t);
273
273
  }), R(() => {
274
- c.off("message", t);
274
+ i.off("message", t);
275
275
  });
276
276
  const t = (s) => {
277
277
  a(s.type, s.text, s.timeout);
@@ -279,67 +279,67 @@ const Be = /* @__PURE__ */ O({
279
279
  l(s);
280
280
  };
281
281
  let r = 0;
282
- const a = (s, p, m) => {
282
+ const a = (s, p, c) => {
283
283
  const V = r++;
284
- n.items.push({ id: V, type: s, text: p, timeout: m });
284
+ n.items.push({ id: V, type: s, text: p, timeout: c });
285
285
  }, l = (s) => {
286
- const p = n.items.findIndex((m) => m.id === s);
286
+ const p = n.items.findIndex((c) => c.id === s);
287
287
  p >= 0 && n.items.splice(p, 1);
288
288
  };
289
- return (s, p) => (C(), H("div", {
289
+ return (s, p) => (C(), N("div", {
290
290
  onClick: p[0] || (p[0] = M(() => {
291
291
  }, ["stop"])),
292
292
  class: "x-cont d-flex flex-column-reverse align-center"
293
293
  }, [
294
- (C(!0), H(Te, null, je(n.items, (m) => (C(), $(ze, {
294
+ (C(!0), N(Te, null, je(n.items, (c) => (C(), $(ze, {
295
295
  onTimeout: o,
296
- id: m.id,
297
- type: m.type,
298
- text: m.text,
299
- timeout: m.timeout,
300
- key: m.id
296
+ id: c.id,
297
+ type: c.type,
298
+ text: c.text,
299
+ timeout: c.timeout,
300
+ key: c.id
301
301
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
302
302
  ]));
303
303
  }
304
- }), Xe = /* @__PURE__ */ ce(He, [["__scopeId", "data-v-70ed4b89"]]), Fe = /* @__PURE__ */ O({
304
+ }), Xe = /* @__PURE__ */ ce(Ne, [["__scopeId", "data-v-70ed4b89"]]), Fe = /* @__PURE__ */ O({
305
305
  __name: "index",
306
306
  setup(e) {
307
- const n = F(), { open: t } = J("promptDlg"), o = f(""), r = f(""), a = f(), l = f(), s = f(), p = f(""), m = f(), V = f(), E = d(() => {
308
- var i;
309
- return ((i = m.value) == null ? void 0 : i.color) ?? "primary";
310
- }), D = d(() => {
311
- var i;
312
- return ((i = m.value) == null ? void 0 : i.text) ?? n.t("cancel");
313
- }), A = d(() => {
314
- var i;
315
- return ((i = V.value) == null ? void 0 : i.color) ?? "primary";
316
- }), B = d(() => {
317
- var i;
318
- return ((i = V.value) == null ? void 0 : i.text) ?? n.t("confirm");
319
- }), u = f();
307
+ const n = F(), { open: t } = J("promptDlg"), o = m(""), r = m(""), a = m(), l = m(), s = m(), p = m(""), c = m(), V = m(), E = f(() => {
308
+ var u;
309
+ return ((u = c.value) == null ? void 0 : u.color) ?? "primary";
310
+ }), D = f(() => {
311
+ var u;
312
+ return ((u = c.value) == null ? void 0 : u.text) ?? n.t("cancel");
313
+ }), A = f(() => {
314
+ var u;
315
+ return ((u = V.value) == null ? void 0 : u.color) ?? "primary";
316
+ }), B = f(() => {
317
+ var u;
318
+ return ((u = V.value) == null ? void 0 : u.text) ?? n.t("confirm");
319
+ }), d = m();
320
320
  let w = 0, S = !1;
321
- const U = async (i) => {
321
+ const L = async (u) => {
322
322
  var x;
323
- o.value = i.title, r.value = i.text, a.value = i.label, l.value = i.placeholder, s.value = i.rules, p.value = i.value, m.value = i.cancel, V.value = i.confirm, w = i.seq, S = !1, t.value = !0, await G(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
323
+ o.value = u.title, r.value = u.text, a.value = u.label, l.value = u.placeholder, s.value = u.rules, p.value = u.value, c.value = u.cancel, V.value = u.confirm, w = u.seq, S = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (x = d.value) == null || x.focus();
324
324
  };
325
325
  q(() => {
326
- c.on("promptDlg", U);
326
+ i.on("promptDlg", L);
327
327
  }), R(() => {
328
- c.off("promptDlg", U);
328
+ i.off("promptDlg", L);
329
329
  });
330
330
  const I = () => {
331
- t.value = !1, S || (c.emit("promptDlgResult" + w, p.value ?? ""), S = !0);
331
+ t.value = !1, S || (i.emit("promptDlgResult" + w, p.value ?? ""), S = !0);
332
332
  };
333
- return P(t, (i) => {
334
- !i && !S && (c.emit("promptDlgResult" + w, void 0), S = !0);
335
- }), (i, x) => {
333
+ return P(t, (u) => {
334
+ !u && !S && (i.emit("promptDlgResult" + w, void 0), S = !0);
335
+ }), (u, x) => {
336
336
  const z = v("v-card-title"), T = v("v-card-text"), ve = v("v-text-field"), ge = v("v-form"), Q = v("v-btn"), _e = v("v-card-actions"), he = v("v-card"), xe = v("v-dialog");
337
337
  return C(), $(xe, {
338
- modelValue: L(t),
338
+ modelValue: U(t),
339
339
  "onUpdate:modelValue": x[2] || (x[2] = (j) => X(t) ? t.value = j : null),
340
340
  onKeydown: [
341
- x[3] || (x[3] = K(M((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
- K(M(I, ["stop", "prevent"]), ["enter"])
341
+ x[3] || (x[3] = W(M((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
+ W(M(I, ["stop", "prevent"]), ["enter"])
343
343
  ],
344
344
  transition: "dialog-top-transition",
345
345
  "max-width": "600px"
@@ -368,7 +368,7 @@ const Be = /* @__PURE__ */ O({
368
368
  placeholder: l.value,
369
369
  rules: s.value,
370
370
  ref_key: "target",
371
- ref: u
371
+ ref: d
372
372
  }, null, 8, ["modelValue", "label", "placeholder", "rules"])
373
373
  ]),
374
374
  _: 1
@@ -415,14 +415,14 @@ const Be = /* @__PURE__ */ O({
415
415
  t.value = !1;
416
416
  };
417
417
  return q(() => {
418
- c.on("openWaitDlg", o), c.on("closeWaitDlg", r);
418
+ i.on("openWaitDlg", o), i.on("closeWaitDlg", r);
419
419
  }), R(() => {
420
- c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
420
+ i.off("openWaitDlg", o), i.off("closeWaitDlg", r);
421
421
  }), (a, l) => {
422
422
  const s = v("v-card"), p = v("v-dialog");
423
423
  return C(), $(p, {
424
- modelValue: L(t),
425
- "onUpdate:modelValue": l[0] || (l[0] = (m) => X(t) ? t.value = m : null),
424
+ modelValue: U(t),
425
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => X(t) ? t.value = c : null),
426
426
  persistent: "",
427
427
  "no-click-animation": "",
428
428
  fullscreen: ""
@@ -436,7 +436,7 @@ const Be = /* @__PURE__ */ O({
436
436
  }, {
437
437
  default: g(() => [
438
438
  _("div", Je, [
439
- _("span", null, k(L(n).t("waitingResponse")), 1)
439
+ _("span", null, k(U(n).t("waitingResponse")), 1)
440
440
  ])
441
441
  ]),
442
442
  _: 1
@@ -448,10 +448,10 @@ const Be = /* @__PURE__ */ O({
448
448
  };
449
449
  }
450
450
  }), Ye = (e) => {
451
- e.component("v-alert", we), e.component("v-btn", ye), e.component("v-card", ke), e.component("v-card-actions", be), e.component("v-card-text", Ce), e.component("v-card-title", Ve), e.component("v-dialog", De), e.component("v-form", Se), e.component("v-text-field", qe), e.component("x-confirm-dlg", Be), e.component("x-loading", Ne), e.component("x-message", Xe), e.component("x-prompt-dlg", Fe), e.component("x-wait-dlg", Qe);
451
+ e.component("v-alert", we), e.component("v-btn", ye), e.component("v-card", ke), e.component("v-card-actions", be), e.component("v-card-text", Ce), e.component("v-card-title", Ve), e.component("v-dialog", De), e.component("v-form", Se), e.component("v-text-field", qe), e.component("x-confirm-dlg", Be), e.component("x-loading", He), e.component("x-message", Xe), e.component("x-prompt-dlg", Fe), e.component("x-wait-dlg", Qe);
452
452
  };
453
453
  function wt() {
454
- const e = N(), n = d(() => e.global.current.value.colors.primary), t = d(() => e.global.current.value.colors.secondary), o = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), a = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
454
+ const e = H(), n = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), a = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
455
455
  return {
456
456
  primaryColor: n,
457
457
  secondaryColor: t,
@@ -484,7 +484,7 @@ function tt() {
484
484
  const nt = ae(
485
485
  "global",
486
486
  () => {
487
- const e = N(), n = Me(), t = f(!1);
487
+ const e = H(), n = Me(), t = m(!1);
488
488
  P(
489
489
  t,
490
490
  (l) => {
@@ -494,7 +494,7 @@ const nt = ae(
494
494
  immediate: !0
495
495
  }
496
496
  );
497
- const o = f("en");
497
+ const o = m("en");
498
498
  P(
499
499
  o,
500
500
  (l) => {
@@ -504,7 +504,7 @@ const nt = ae(
504
504
  immediate: !0
505
505
  }
506
506
  );
507
- const r = f({}), a = f("");
507
+ const r = m({}), a = m("");
508
508
  return { dark: t, locale: o, permissionObjects: r, permissionChecksum: a };
509
509
  },
510
510
  {
@@ -516,38 +516,48 @@ const nt = ae(
516
516
  ]
517
517
  }
518
518
  );
519
- function yt() {
520
- const e = tt(), n = ue();
521
- nt();
522
- const t = se(), o = (a) => {
523
- if (a.key === "Escape") {
524
- r();
519
+ function yt(e) {
520
+ const n = tt(), t = ue(), o = nt(), r = se(), a = (c) => {
521
+ if (c.key === "Escape") {
522
+ l();
523
+ return;
524
+ }
525
+ if (!e && c.ctrlKey && c.key.toLowerCase() === "d") {
526
+ s();
525
527
  return;
526
528
  }
527
- }, r = () => {
528
- var a;
529
- if (!t.isEmpty()) {
530
- t.hasView("waitDlg") || t.popView();
529
+ if (!e && c.ctrlKey && c.key.toLowerCase() === "l") {
530
+ p();
531
531
  return;
532
532
  }
533
- e.meta.level === 0 ? (a = navigator == null ? void 0 : navigator.Backbutton) == null || a.goHome(
533
+ }, l = () => {
534
+ var c;
535
+ if (!r.isEmpty()) {
536
+ r.hasView("waitDlg") || r.popView();
537
+ return;
538
+ }
539
+ n.meta.level === 0 ? (c = navigator == null ? void 0 : navigator.Backbutton) == null || c.goHome(
534
540
  () => {
535
541
  },
536
542
  () => {
537
543
  }
538
- ) : n.back();
544
+ ) : t.back();
545
+ }, s = () => {
546
+ o.dark = !o.dark;
547
+ }, p = () => {
548
+ o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
539
549
  };
540
- q(() => {
541
- window.addEventListener("keydown", o, !1);
550
+ return q(() => {
551
+ window.addEventListener("keydown", a, !1);
542
552
  }), R(() => {
543
- window.removeEventListener("keydown", o, !1);
544
- });
553
+ window.removeEventListener("keydown", a, !1);
554
+ }), {};
545
555
  }
546
556
  function kt() {
547
- const e = N(), { width: n } = Pe(), t = d(() => e.global.name.value), o = d(() => !!window.cordova), r = d(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
557
+ const e = H(), { width: n } = Pe(), t = f(() => e.global.name.value), o = f(() => !!window.cordova), r = f(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
548
558
  return { dark: t, sysBarAvail: o, compactWidth: r };
549
559
  }
550
- const W = require("js-cookie");
560
+ const K = require("js-cookie");
551
561
  function bt(e) {
552
562
  const n = $e.create({
553
563
  timeout: 6e3
@@ -563,7 +573,7 @@ function bt(e) {
563
573
  ), n;
564
574
  }
565
575
  function ot(e) {
566
- const n = W.get("accessToken") ?? "";
576
+ const n = K.get("accessToken") ?? "";
567
577
  return e.headers.Authorization = "Basic " + n, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
568
578
  }
569
579
  function rt(e, n) {
@@ -585,7 +595,7 @@ function at(e, n) {
585
595
  }), n(o), Promise.reject(e);
586
596
  }
587
597
  function st() {
588
- W.remove("accessToken"), W.remove("refreshToken"), W.remove("activeOrg"), ue().replace({ path: "/passport/login" });
598
+ K.remove("accessToken"), K.remove("refreshToken"), K.remove("activeOrg"), ue().replace({ path: "/passport/login" });
589
599
  }
590
600
  let te = Date.now();
591
601
  function de() {
@@ -603,7 +613,7 @@ async function Ct(e) {
603
613
  const o = (a) => {
604
614
  t = a, n = !0;
605
615
  }, r = pe();
606
- return c.on("confirmDlgResult" + r, o), c.emit("confirmDlg", { ...e, seq: r }), await G(() => n), c.off("confirmDlgResult" + r, o), t;
616
+ return i.on("confirmDlgResult" + r, o), i.emit("confirmDlg", { ...e, seq: r }), await G(() => n), i.off("confirmDlgResult" + r, o), t;
607
617
  }
608
618
  async function Vt(e) {
609
619
  if (!de())
@@ -612,25 +622,25 @@ async function Vt(e) {
612
622
  const o = (a) => {
613
623
  t = a, n = !0;
614
624
  }, r = pe();
615
- return c.on("promptDlgResult" + r, o), c.emit("promptDlg", { ...e, seq: r }), await G(() => n), c.off("promptDlgResult" + r, o), t;
625
+ return i.on("promptDlgResult" + r, o), i.emit("promptDlg", { ...e, seq: r }), await G(() => n), i.off("promptDlgResult" + r, o), t;
616
626
  }
617
627
  function Dt() {
618
- c.emit("openWaitDlg");
628
+ i.emit("openWaitDlg");
619
629
  }
620
630
  function St() {
621
- c.emit("closeWaitDlg");
631
+ i.emit("closeWaitDlg");
622
632
  }
623
633
  function qt(e, n) {
624
- c.emit("message", { type: "error", text: e, timeout: n });
634
+ i.emit("message", { type: "error", text: e, timeout: n });
625
635
  }
626
636
  function Rt(e, n) {
627
- c.emit("message", { type: "info", text: e, timeout: n });
637
+ i.emit("message", { type: "info", text: e, timeout: n });
628
638
  }
629
639
  function Ot(e, n) {
630
- c.emit("message", { type: "success", text: e, timeout: n });
640
+ i.emit("message", { type: "success", text: e, timeout: n });
631
641
  }
632
642
  function Et(e, n) {
633
- c.emit("message", { type: "warning", text: e, timeout: n });
643
+ i.emit("message", { type: "warning", text: e, timeout: n });
634
644
  }
635
645
  function It(e) {
636
646
  var o, r;
@@ -701,7 +711,7 @@ function oe(e) {
701
711
  const t = e.split("/");
702
712
  return console.assert(t.length >= 2), { app: t[1], path: n.path, level: n.level };
703
713
  }
704
- const re = f("");
714
+ const re = m("");
705
715
  function y(e, n) {
706
716
  const t = oe(e), o = oe(n), r = t.app === o.app, a = t.path === o.path, l = t.level >= o.level;
707
717
  console.info(
@@ -760,7 +770,7 @@ export {
760
770
  St as closeWaitDlg,
761
771
  bt as createAxios,
762
772
  Pt as default,
763
- c as eventBus,
773
+ i as eventBus,
764
774
  qt as messageError,
765
775
  Rt as messageInfo,
766
776
  Ot as messageSuccess,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.3.0",
4
+ "version": "0.3.2",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",