x-essential-lib 0.3.7 → 0.3.8

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 +52 -48
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
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 he, VBtn as _e, VCard as xe, VCardActions as ye, VCardText as we, VCardTitle as ke, VDialog as be, VForm as Ce, VTextField as Ve } from "vuetify/lib/components/index.mjs";
3
- import { ref as m, computed as f, onMounted as D, onBeforeUnmount as T, defineComponent as P, watch as N, resolveComponent as v, openBlock as V, createBlock as $, unref as U, isRef as F, withKeys as W, withModifiers as I, withCtx as g, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as z, normalizeStyle as De, pushScopeId as qe, popScopeId as Se, createElementVNode as h, reactive as Te, Fragment as Pe, renderList as Oe } from "vue";
3
+ import { ref as m, computed as f, onMounted as D, onBeforeUnmount as T, defineComponent as P, watch as N, resolveComponent as v, openBlock as V, createBlock as $, unref as U, isRef as F, withKeys as W, withModifiers as E, withCtx as g, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as z, normalizeStyle as De, pushScopeId as qe, popScopeId as Se, createElementVNode as h, reactive as Te, Fragment as Pe, renderList as Oe } from "vue";
4
4
  import { useLocale as J, useTheme as H, useDisplay as Re } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as oe } from "pinia";
6
6
  import { useRouter as re, useRoute as je } from "vue-router";
7
- import Ee from "axios";
7
+ import Ie from "axios";
8
8
  const se = oe("viewMgr", () => {
9
9
  const e = m([]);
10
10
  function n() {
@@ -17,7 +17,7 @@ const se = oe("viewMgr", () => {
17
17
  r(s), e.value.push(s);
18
18
  }
19
19
  function r(s) {
20
- const a = e.value.findIndex((d) => d === s);
20
+ const a = e.value.findIndex((u) => u === s);
21
21
  a !== -1 && e.value.splice(a, 1);
22
22
  }
23
23
  function l() {
@@ -25,7 +25,7 @@ const se = oe("viewMgr", () => {
25
25
  }
26
26
  return { isEmpty: n, hasView: t, addView: o, delView: r, popView: l };
27
27
  });
28
- function Ie(e) {
28
+ function Ee(e) {
29
29
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
30
30
  var o = e.get(n);
31
31
  o ? o.push(t) : e.set(n, [t]);
@@ -41,7 +41,7 @@ function Ie(e) {
41
41
  });
42
42
  } };
43
43
  }
44
- const c = Ie();
44
+ const c = Ee();
45
45
  async function pt(e) {
46
46
  return new Promise((n) => {
47
47
  setTimeout(n, e);
@@ -79,7 +79,7 @@ const $e = /* @__PURE__ */ P({
79
79
  const n = J(), { open: t } = G("confirmDlg"), o = m(""), r = m(""), l = m(), s = m(), a = f(() => {
80
80
  var p;
81
81
  return ((p = l.value) == null ? void 0 : p.color) ?? "primary";
82
- }), d = f(() => {
82
+ }), u = f(() => {
83
83
  var p;
84
84
  return ((p = l.value) == null ? void 0 : p.text) ?? n.t("cancel");
85
85
  }), i = f(() => {
@@ -104,13 +104,13 @@ const $e = /* @__PURE__ */ P({
104
104
  return N(t, (p) => {
105
105
  !p && !q && (c.emit("confirmDlgResult" + O, !1), q = !0);
106
106
  }), (p, w) => {
107
- const S = v("v-card-title"), B = v("v-card-text"), R = v("v-btn"), u = v("v-card-actions"), x = v("v-card"), K = v("v-dialog");
107
+ const S = v("v-card-title"), B = v("v-card-text"), R = v("v-btn"), d = v("v-card-actions"), x = v("v-card"), K = v("v-dialog");
108
108
  return V(), $(K, {
109
109
  modelValue: U(t),
110
110
  "onUpdate:modelValue": w[1] || (w[1] = (j) => F(t) ? t.value = j : null),
111
111
  onKeydown: [
112
- w[2] || (w[2] = W(I((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
- W(I(M, ["stop", "prevent"]), ["enter"])
112
+ w[2] || (w[2] = W(E((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
113
+ W(E(M, ["stop", "prevent"]), ["enter"])
114
114
  ],
115
115
  transition: "dialog-top-transition",
116
116
  "max-width": "600px"
@@ -130,7 +130,7 @@ const $e = /* @__PURE__ */ P({
130
130
  ]),
131
131
  _: 1
132
132
  }),
133
- _(u, { class: "d-flex justify-end" }, {
133
+ _(d, { class: "d-flex justify-end" }, {
134
134
  default: g(() => [
135
135
  _(R, {
136
136
  onClick: w[0] || (w[0] = (j) => t.value = !1),
@@ -138,7 +138,7 @@ const $e = /* @__PURE__ */ P({
138
138
  variant: "text"
139
139
  }, {
140
140
  default: g(() => [
141
- C(b(d.value), 1)
141
+ C(b(u.value), 1)
142
142
  ]),
143
143
  _: 1
144
144
  }, 8, ["color"]),
@@ -248,8 +248,8 @@ const $e = /* @__PURE__ */ P({
248
248
  }), N(o, (s) => {
249
249
  s || r("timeout", t.id);
250
250
  }), (s, a) => {
251
- const d = v("v-alert");
252
- return V(), $(d, {
251
+ const u = v("v-alert");
252
+ return V(), $(u, {
253
253
  modelValue: o.value,
254
254
  "onUpdate:modelValue": a[0] || (a[0] = (i) => o.value = i),
255
255
  class: "mt-2",
@@ -279,15 +279,15 @@ const $e = /* @__PURE__ */ P({
279
279
  s(a);
280
280
  };
281
281
  let r = 0;
282
- const l = (a, d, i) => {
282
+ const l = (a, u, i) => {
283
283
  const y = r++;
284
- n.items.push({ id: y, type: a, text: d, timeout: i });
284
+ n.items.push({ id: y, type: a, text: u, timeout: i });
285
285
  }, s = (a) => {
286
- const d = n.items.findIndex((i) => i.id === a);
287
- d >= 0 && n.items.splice(d, 1);
286
+ const u = n.items.findIndex((i) => i.id === a);
287
+ u >= 0 && n.items.splice(u, 1);
288
288
  };
289
- return (a, d) => (V(), z("div", {
290
- onClick: d[0] || (d[0] = I(() => {
289
+ return (a, u) => (V(), z("div", {
290
+ onClick: u[0] || (u[0] = E(() => {
291
291
  }, ["stop"])),
292
292
  class: "x-cont d-flex flex-column-reverse align-center"
293
293
  }, [
@@ -304,23 +304,23 @@ const $e = /* @__PURE__ */ P({
304
304
  }), He = /* @__PURE__ */ le(Ne, [["__scopeId", "data-v-70ed4b89"]]), Ke = /* @__PURE__ */ P({
305
305
  __name: "index",
306
306
  setup(e) {
307
- const n = J(), { open: t } = G("promptDlg"), o = m(""), r = m(""), l = m(), s = m(), a = m(), d = m(""), i = m(), y = m(), O = f(() => {
308
- var u;
309
- return ((u = i.value) == null ? void 0 : u.color) ?? "primary";
307
+ const n = J(), { open: t } = G("promptDlg"), o = m(""), r = m(""), l = m(), s = m(), a = m(), u = m(""), i = m(), y = m(), O = f(() => {
308
+ var d;
309
+ return ((d = i.value) == null ? void 0 : d.color) ?? "primary";
310
310
  }), q = f(() => {
311
- var u;
312
- return ((u = i.value) == null ? void 0 : u.text) ?? n.t("cancel");
311
+ var d;
312
+ return ((d = i.value) == null ? void 0 : d.text) ?? n.t("cancel");
313
313
  }), A = f(() => {
314
- var u;
315
- return ((u = y.value) == null ? void 0 : u.color) ?? "primary";
314
+ var d;
315
+ return ((d = y.value) == null ? void 0 : d.color) ?? "primary";
316
316
  }), M = f(() => {
317
- var u;
318
- return ((u = y.value) == null ? void 0 : u.text) ?? n.t("confirm");
317
+ var d;
318
+ return ((d = y.value) == null ? void 0 : d.text) ?? n.t("confirm");
319
319
  }), p = m();
320
320
  let w = 0, S = !1;
321
- const B = async (u) => {
321
+ const B = async (d) => {
322
322
  var x;
323
- o.value = u.title, r.value = u.text, l.value = u.label, s.value = u.placeholder, a.value = u.rules, d.value = u.value, i.value = u.cancel, y.value = u.confirm, w = u.seq, S = !1, t.value = !0, await X(() => p.value !== void 0, 1e3), (x = p.value) == null || x.focus();
323
+ o.value = d.title, r.value = d.text, l.value = d.label, s.value = d.placeholder, a.value = d.rules, u.value = d.value, i.value = d.cancel, y.value = d.confirm, w = d.seq, S = !1, t.value = !0, await X(() => p.value !== void 0, 1e3), (x = p.value) == null || x.focus();
324
324
  };
325
325
  D(() => {
326
326
  c.on("promptDlg", B);
@@ -328,18 +328,18 @@ const $e = /* @__PURE__ */ P({
328
328
  c.off("promptDlg", B);
329
329
  });
330
330
  const R = () => {
331
- t.value = !1, S || (c.emit("promptDlgResult" + w, d.value ?? ""), S = !0);
331
+ t.value = !1, S || (c.emit("promptDlgResult" + w, u.value ?? ""), S = !0);
332
332
  };
333
- return N(t, (u) => {
334
- !u && !S && (c.emit("promptDlgResult" + w, void 0), S = !0);
335
- }), (u, x) => {
333
+ return N(t, (d) => {
334
+ !d && !S && (c.emit("promptDlgResult" + w, void 0), S = !0);
335
+ }), (d, x) => {
336
336
  const K = v("v-card-title"), j = v("v-card-text"), pe = v("v-text-field"), fe = v("v-form"), Y = v("v-btn"), me = v("v-card-actions"), ve = v("v-card"), ge = v("v-dialog");
337
337
  return V(), $(ge, {
338
338
  modelValue: U(t),
339
- "onUpdate:modelValue": x[2] || (x[2] = (E) => F(t) ? t.value = E : null),
339
+ "onUpdate:modelValue": x[2] || (x[2] = (I) => F(t) ? t.value = I : null),
340
340
  onKeydown: [
341
- x[3] || (x[3] = W(I((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
- W(I(R, ["stop", "prevent"]), ["enter"])
341
+ x[3] || (x[3] = W(E((I) => t.value = !1, ["stop", "prevent"]), ["esc"])),
342
+ W(E(R, ["stop", "prevent"]), ["enter"])
343
343
  ],
344
344
  transition: "dialog-top-transition",
345
345
  "max-width": "600px"
@@ -362,8 +362,8 @@ const $e = /* @__PURE__ */ P({
362
362
  _(fe, { class: "mx-3" }, {
363
363
  default: g(() => [
364
364
  _(pe, {
365
- modelValue: d.value,
366
- "onUpdate:modelValue": x[0] || (x[0] = (E) => d.value = E),
365
+ modelValue: u.value,
366
+ "onUpdate:modelValue": x[0] || (x[0] = (I) => u.value = I),
367
367
  label: l.value,
368
368
  placeholder: s.value,
369
369
  rules: a.value,
@@ -376,7 +376,7 @@ const $e = /* @__PURE__ */ P({
376
376
  _(me, { class: "d-flex justify-end" }, {
377
377
  default: g(() => [
378
378
  _(Y, {
379
- onClick: x[1] || (x[1] = (E) => t.value = !1),
379
+ onClick: x[1] || (x[1] = (I) => t.value = !1),
380
380
  color: O.value,
381
381
  variant: "text"
382
382
  }, {
@@ -419,8 +419,8 @@ const $e = /* @__PURE__ */ P({
419
419
  }), T(() => {
420
420
  c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
421
421
  }), (l, s) => {
422
- const a = v("v-card"), d = v("v-dialog");
423
- return V(), $(d, {
422
+ const a = v("v-card"), u = v("v-dialog");
423
+ return V(), $(u, {
424
424
  modelValue: U(t),
425
425
  "onUpdate:modelValue": s[0] || (s[0] = (i) => F(t) ? t.value = i : null),
426
426
  persistent: "",
@@ -493,7 +493,7 @@ const ae = oe(
493
493
  }
494
494
  ), L = require("js-cookie");
495
495
  function mt(e) {
496
- const n = Ee.create({
496
+ const n = Ie.create({
497
497
  timeout: 6e3
498
498
  });
499
499
  return n.defaults.baseURL = e.baseUrl, n.interceptors.request.use(
@@ -712,7 +712,7 @@ function qt(e) {
712
712
  return;
713
713
  }
714
714
  if (!e && i.ctrlKey && i.key.toLowerCase() === "l") {
715
- d();
715
+ u();
716
716
  return;
717
717
  }
718
718
  }, s = () => {
@@ -730,7 +730,7 @@ function qt(e) {
730
730
  ) : t.back();
731
731
  }, a = () => {
732
732
  o.dark = !o.dark;
733
- }, d = () => {
733
+ }, u = () => {
734
734
  o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
735
735
  };
736
736
  return D(() => {
@@ -757,9 +757,13 @@ function St(e) {
757
757
  if (!l)
758
758
  return;
759
759
  const a = {};
760
- s.forEach((d, i) => {
761
- i !== "checksum" && (a[i] = JSON.parse(d));
762
- }), n.permissionObjects = a, n.permissionChecksum = s.get("checksum") ?? "";
760
+ for (let u in s) {
761
+ if (u === "checksum")
762
+ continue;
763
+ const i = s[u];
764
+ a[u] = JSON.parse(i);
765
+ }
766
+ n.permissionObjects = a, n.permissionChecksum = s.checksum ?? "";
763
767
  } catch (l) {
764
768
  console.error(l);
765
769
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.3.7",
4
+ "version": "0.3.8",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",