x-essential-lib 0.3.16 → 0.3.17

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 +57 -57
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +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
2
  import { VAlert as ve, VBtn as me, VCard as he, VCardActions as we, VCardText as ye, VCardTitle as xe, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
3
- import { ref as i, computed as f, onMounted as D, onBeforeUnmount as T, defineComponent as R, watch as H, resolveComponent as g, openBlock as C, createBlock as O, unref as U, isRef as J, withKeys as W, withModifiers as A, withCtx as v, createVNode as h, createTextVNode as V, toDisplayString as b, createElementBlock as F, normalizeStyle as Ve, pushScopeId as De, popScopeId as qe, createElementVNode as m, reactive as Se, Fragment as Te, renderList as Oe, createCommentVNode as Re } from "vue";
4
- import { useLocale as X, useTheme as K, useDisplay as je } from "vuetify/lib/framework.mjs";
3
+ import { ref as i, computed as f, onMounted as S, onBeforeUnmount as T, defineComponent as R, watch as W, resolveComponent as g, openBlock as C, createBlock as O, unref as N, isRef as J, withKeys as U, withModifiers as A, withCtx as v, createVNode as h, createTextVNode as V, toDisplayString as b, createElementBlock as F, normalizeStyle as Ve, pushScopeId as Se, popScopeId as De, createElementVNode as m, reactive as qe, Fragment as Te, renderList as Oe, createCommentVNode as Re } from "vue";
4
+ import { useLocale as X, useTheme as H, useDisplay as je } from "vuetify/lib/framework.mjs";
5
5
  import { defineStore as le } from "pinia";
6
6
  import { useRouter as re, useRoute as Ie } from "vue-router";
7
7
  import Ee from "axios";
@@ -75,7 +75,7 @@ function Q(e, a) {
75
75
  }), l = (n) => {
76
76
  a == null || a(n), o.value = !0;
77
77
  };
78
- return D(() => {
78
+ return S(() => {
79
79
  _.on(e, l);
80
80
  }), T(() => {
81
81
  _.off(e, l);
@@ -97,28 +97,28 @@ const Ae = /* @__PURE__ */ R({
97
97
  var d;
98
98
  return ((d = r.value) == null ? void 0 : d.text) ?? a.t("confirm");
99
99
  });
100
- let j = 0, q = !1;
100
+ let j = 0, D = !1;
101
101
  const M = (d) => {
102
- o.value = d.title, l.value = d.text, n.value = d.cancel, r.value = d.confirm, j = d.seq, q = !1, t.value = !0;
102
+ o.value = d.title, l.value = d.text, n.value = d.cancel, r.value = d.confirm, j = d.seq, D = !1, t.value = !0;
103
103
  };
104
- D(() => {
104
+ S(() => {
105
105
  _.on("confirmDlg", M);
106
106
  }), T(() => {
107
107
  _.off("confirmDlg", M);
108
108
  });
109
109
  const B = () => {
110
- t.value = !1, q || (_.emit("confirmDlgResult" + j, !0), q = !0);
110
+ t.value = !1, D || (_.emit("confirmDlgResult" + j, !0), D = !0);
111
111
  };
112
- return H(t, (d) => {
113
- !d && !q && (_.emit("confirmDlgResult" + j, !1), q = !0);
112
+ return W(t, (d) => {
113
+ !d && !D && (_.emit("confirmDlgResult" + j, !1), D = !0);
114
114
  }), (d, x) => {
115
- const S = g("v-card-title"), L = g("v-card-text"), I = g("v-btn"), p = g("v-card-actions"), w = g("v-card"), z = g("v-dialog");
115
+ const q = g("v-card-title"), L = g("v-card-text"), I = g("v-btn"), p = g("v-card-actions"), w = g("v-card"), z = g("v-dialog");
116
116
  return C(), O(z, {
117
- modelValue: U(t),
117
+ modelValue: N(t),
118
118
  "onUpdate:modelValue": x[1] || (x[1] = (E) => J(t) ? t.value = E : null),
119
119
  onKeydown: [
120
- x[2] || (x[2] = W(A((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
121
- W(A(B, ["stop", "prevent"]), ["enter"])
120
+ x[2] || (x[2] = U(A((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
121
+ U(A(B, ["stop", "prevent"]), ["enter"])
122
122
  ],
123
123
  transition: "dialog-top-transition",
124
124
  "max-width": "600px"
@@ -126,7 +126,7 @@ const Ae = /* @__PURE__ */ R({
126
126
  default: v(() => [
127
127
  h(w, null, {
128
128
  default: v(() => [
129
- h(S, null, {
129
+ h(q, null, {
130
130
  default: v(() => [
131
131
  V(b(o.value), 1)
132
132
  ]),
@@ -171,7 +171,7 @@ const Ae = /* @__PURE__ */ R({
171
171
  }, 8, ["modelValue", "onKeydown"]);
172
172
  };
173
173
  }
174
- }), Me = (e) => (De("data-v-a8f3d91f"), e = e(), qe(), e), Be = /* @__PURE__ */ Me(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
174
+ }), Me = (e) => (Se("data-v-a8f3d91f"), e = e(), De(), e), Be = /* @__PURE__ */ Me(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
175
175
  /* @__PURE__ */ m("div"),
176
176
  /* @__PURE__ */ m("div"),
177
177
  /* @__PURE__ */ m("div"),
@@ -186,7 +186,7 @@ const Ae = /* @__PURE__ */ R({
186
186
  /* @__PURE__ */ m("div")
187
187
  ], -1)), Le = [
188
188
  Be
189
- ], Ne = /* @__PURE__ */ R({
189
+ ], Ke = /* @__PURE__ */ R({
190
190
  __name: "index",
191
191
  props: {
192
192
  zIndex: {
@@ -195,7 +195,7 @@ const Ae = /* @__PURE__ */ R({
195
195
  }
196
196
  },
197
197
  setup(e) {
198
- const a = K(), t = e, o = f(() => ({
198
+ const a = H(), t = e, o = f(() => ({
199
199
  background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
200
200
  zIndex: t.zIndex
201
201
  }));
@@ -209,7 +209,7 @@ const Ae = /* @__PURE__ */ R({
209
209
  for (const [o, l] of a)
210
210
  t[o] = l;
211
211
  return t;
212
- }, Ue = /* @__PURE__ */ ce(Ne, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ R({
212
+ }, Ne = /* @__PURE__ */ ce(Ke, [["__scopeId", "data-v-a8f3d91f"]]), Ue = /* @__PURE__ */ R({
213
213
  __name: "item",
214
214
  props: {
215
215
  id: {
@@ -249,11 +249,11 @@ const Ae = /* @__PURE__ */ R({
249
249
  }
250
250
  return r;
251
251
  });
252
- return D(() => {
252
+ return S(() => {
253
253
  setTimeout(() => {
254
254
  l("timeout", t.id);
255
255
  }, t.timeout);
256
- }), H(o, (r) => {
256
+ }), W(o, (r) => {
257
257
  r || l("timeout", t.id);
258
258
  }), (r, u) => {
259
259
  const s = g("v-alert");
@@ -272,11 +272,11 @@ const Ae = /* @__PURE__ */ R({
272
272
  }, null, 8, ["modelValue", "type", "icon", "text"]);
273
273
  };
274
274
  }
275
- }), He = /* @__PURE__ */ R({
275
+ }), We = /* @__PURE__ */ R({
276
276
  __name: "index",
277
277
  setup(e) {
278
- const a = Se({ items: [] });
279
- D(() => {
278
+ const a = qe({ items: [] });
279
+ S(() => {
280
280
  _.on("message", t);
281
281
  }), T(() => {
282
282
  _.off("message", t);
@@ -299,7 +299,7 @@ const Ae = /* @__PURE__ */ R({
299
299
  }, ["stop"])),
300
300
  class: "x-cont d-flex flex-column-reverse align-center"
301
301
  }, [
302
- (C(!0), F(Te, null, Oe(a.items, (c) => (C(), O(We, {
302
+ (C(!0), F(Te, null, Oe(a.items, (c) => (C(), O(Ue, {
303
303
  onTimeout: o,
304
304
  id: c.id,
305
305
  type: c.type,
@@ -309,13 +309,13 @@ const Ae = /* @__PURE__ */ R({
309
309
  }, null, 8, ["id", "type", "text", "timeout"]))), 128))
310
310
  ]));
311
311
  }
312
- }), Ke = /* @__PURE__ */ ce(He, [["__scopeId", "data-v-70ed4b89"]]), ze = /* @__PURE__ */ R({
312
+ }), He = /* @__PURE__ */ ce(We, [["__scopeId", "data-v-70ed4b89"]]), ze = /* @__PURE__ */ R({
313
313
  __name: "index",
314
314
  setup(e) {
315
315
  const a = X(), { open: t } = Q("promptDlg"), o = i(""), l = i(""), n = i(), r = i(), u = i(), s = i(""), c = i(), y = i(), j = f(() => {
316
316
  var p;
317
317
  return ((p = c.value) == null ? void 0 : p.color) ?? "primary";
318
- }), q = f(() => {
318
+ }), D = f(() => {
319
319
  var p;
320
320
  return ((p = c.value) == null ? void 0 : p.text) ?? a.t("cancel");
321
321
  }), M = f(() => {
@@ -325,29 +325,29 @@ const Ae = /* @__PURE__ */ R({
325
325
  var p;
326
326
  return ((p = y.value) == null ? void 0 : p.text) ?? a.t("confirm");
327
327
  }), d = i();
328
- let x = 0, S = !1;
328
+ let x = 0, q = !1;
329
329
  const L = async (p) => {
330
330
  var w;
331
- o.value = p.title, l.value = p.text, n.value = p.label, r.value = p.placeholder, u.value = p.rules, s.value = p.value, c.value = p.cancel, y.value = p.confirm, x = p.seq, S = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (w = d.value) == null || w.focus();
331
+ o.value = p.title, l.value = p.text, n.value = p.label, r.value = p.placeholder, u.value = p.rules, s.value = p.value, c.value = p.cancel, y.value = p.confirm, x = p.seq, q = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (w = d.value) == null || w.focus();
332
332
  };
333
- D(() => {
333
+ S(() => {
334
334
  _.on("promptDlg", L);
335
335
  }), T(() => {
336
336
  _.off("promptDlg", L);
337
337
  });
338
338
  const I = () => {
339
- t.value = !1, S || (_.emit("promptDlgResult" + x, s.value ?? ""), S = !0);
339
+ t.value = !1, q || (_.emit("promptDlgResult" + x, s.value ?? ""), q = !0);
340
340
  };
341
- return H(t, (p) => {
342
- !p && !S && (_.emit("promptDlgResult" + x, void 0), S = !0);
341
+ return W(t, (p) => {
342
+ !p && !q && (_.emit("promptDlgResult" + x, void 0), q = !0);
343
343
  }), (p, w) => {
344
344
  const z = g("v-card-title"), E = g("v-card-text"), pe = g("v-text-field"), de = g("v-form"), P = g("v-btn"), fe = g("v-card-actions"), ie = g("v-card"), ge = g("v-dialog");
345
345
  return C(), O(ge, {
346
- modelValue: U(t),
346
+ modelValue: N(t),
347
347
  "onUpdate:modelValue": w[2] || (w[2] = ($) => J(t) ? t.value = $ : null),
348
348
  onKeydown: [
349
- w[3] || (w[3] = W(A(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
350
- W(A(I, ["stop", "prevent"]), ["enter"])
349
+ w[3] || (w[3] = U(A(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
350
+ U(A(I, ["stop", "prevent"]), ["enter"])
351
351
  ],
352
352
  transition: "dialog-top-transition",
353
353
  "max-width": "600px"
@@ -389,7 +389,7 @@ const Ae = /* @__PURE__ */ R({
389
389
  variant: "text"
390
390
  }, {
391
391
  default: v(() => [
392
- V(b(q.value), 1)
392
+ V(b(D.value), 1)
393
393
  ]),
394
394
  _: 1
395
395
  }, 8, ["color"]),
@@ -422,14 +422,14 @@ const Ae = /* @__PURE__ */ R({
422
422
  }, l = () => {
423
423
  t.value = !1;
424
424
  };
425
- return D(() => {
425
+ return S(() => {
426
426
  _.on("openWaitDlg", o), _.on("closeWaitDlg", l);
427
427
  }), T(() => {
428
428
  _.off("openWaitDlg", o), _.off("closeWaitDlg", l);
429
429
  }), (n, r) => {
430
430
  const u = g("v-card"), s = g("v-dialog");
431
431
  return C(), O(s, {
432
- modelValue: U(t),
432
+ modelValue: N(t),
433
433
  "onUpdate:modelValue": r[0] || (r[0] = (c) => J(t) ? t.value = c : null),
434
434
  persistent: "",
435
435
  "no-click-animation": "",
@@ -444,7 +444,7 @@ const Ae = /* @__PURE__ */ R({
444
444
  }, {
445
445
  default: v(() => [
446
446
  m("div", Je, [
447
- m("span", null, b(U(a).t("waitingResponse")), 1)
447
+ m("span", null, b(N(a).t("waitingResponse")), 1)
448
448
  ])
449
449
  ]),
450
450
  _: 1
@@ -456,10 +456,10 @@ const Ae = /* @__PURE__ */ R({
456
456
  };
457
457
  }
458
458
  }), Ge = (e) => {
459
- e.component("v-alert", ve), e.component("v-btn", me), e.component("v-card", he), e.component("v-card-actions", we), e.component("v-card-text", ye), e.component("v-card-title", xe), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", Ae), e.component("x-loading", Ue), e.component("x-message", Ke), e.component("x-prompt-dlg", ze), e.component("x-wait-dlg", Xe);
459
+ e.component("v-alert", ve), e.component("v-btn", me), e.component("v-card", he), e.component("v-card-actions", we), e.component("v-card-text", ye), e.component("v-card-title", xe), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", Ae), e.component("x-loading", Ne), e.component("x-message", He), e.component("x-prompt-dlg", ze), e.component("x-wait-dlg", Xe);
460
460
  };
461
461
  function it() {
462
- const e = K(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), u = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
462
+ const e = H(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), u = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
463
463
  return {
464
464
  primaryColor: a,
465
465
  secondaryColor: t,
@@ -473,8 +473,8 @@ function it() {
473
473
  const Y = le(
474
474
  "global",
475
475
  () => {
476
- const e = K(), a = i();
477
- H(
476
+ const e = H(), a = i();
477
+ W(
478
478
  a,
479
479
  (n) => {
480
480
  e.global.name.value = n ? "dark" : "light";
@@ -499,7 +499,7 @@ const Y = le(
499
499
  }
500
500
  ]
501
501
  }
502
- ), N = require("js-cookie");
502
+ ), K = require("js-cookie");
503
503
  function gt(e) {
504
504
  const a = Ee.create({
505
505
  timeout: 6e3
@@ -515,7 +515,7 @@ function gt(e) {
515
515
  ), a;
516
516
  }
517
517
  function Qe(e) {
518
- const a = N.get("accessToken") ?? "";
518
+ const a = K.get("accessToken") ?? "";
519
519
  return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
520
520
  }
521
521
  function Ye(e, a) {
@@ -537,7 +537,7 @@ function Pe(e, a) {
537
537
  }), a(o), Promise.reject(e);
538
538
  }
539
539
  function et() {
540
- N.remove("accessToken"), N.remove("refreshToken"), N.remove("activeOrg"), re().replace({ path: "/passport/login" });
540
+ K.remove("accessToken"), K.remove("refreshToken"), K.remove("activeOrg"), re().replace({ path: "/passport/login" });
541
541
  }
542
542
  let ee = Date.now();
543
543
  function ue() {
@@ -702,17 +702,17 @@ function Vt(e, a, t) {
702
702
  else
703
703
  k(e.path, a.path), t();
704
704
  }
705
- function Dt(e) {
705
+ function St(e) {
706
706
  const a = Ie(), t = re(), o = Y(), l = ne(), n = (c) => {
707
707
  if (c.key === "Escape") {
708
708
  r();
709
709
  return;
710
710
  }
711
- if (!e && c.ctrlKey && c.key.toLowerCase() === "d") {
711
+ if (!e && c.ctrlKey && c.shiftKey && c.key.toLowerCase() === "d") {
712
712
  u();
713
713
  return;
714
714
  }
715
- if (!e && c.ctrlKey && c.key.toLowerCase() === "l") {
715
+ if (!e && c.ctrlKey && c.shiftKey && c.key.toLowerCase() === "l") {
716
716
  s();
717
717
  return;
718
718
  }
@@ -734,13 +734,13 @@ function Dt(e) {
734
734
  }, s = () => {
735
735
  o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
736
736
  };
737
- return D(() => {
737
+ return S(() => {
738
738
  window.addEventListener("keydown", n, !1);
739
739
  }), T(() => {
740
740
  window.removeEventListener("keydown", n, !1);
741
741
  }), {};
742
742
  }
743
- function qt() {
743
+ function Dt() {
744
744
  const e = Y();
745
745
  function a(t, o) {
746
746
  const l = e.permissionObjects[t];
@@ -751,7 +751,7 @@ function qt() {
751
751
  function nt(e, a) {
752
752
  return e.post("pullPermission", a);
753
753
  }
754
- function St(e) {
754
+ function qt(e) {
755
755
  const a = Y();
756
756
  let t;
757
757
  const o = () => {
@@ -777,14 +777,14 @@ function St(e) {
777
777
  console.error(n);
778
778
  }
779
779
  };
780
- return D(() => {
780
+ return S(() => {
781
781
  l(), o();
782
782
  }), T(() => {
783
783
  clearTimeout(t), t = void 0;
784
784
  }), {};
785
785
  }
786
786
  function Tt() {
787
- const e = K(), a = f(() => e.current.value.dark), t = f(() => !!window.cordova), o = f(() => {
787
+ const e = H(), a = f(() => e.current.value.dark), t = f(() => !!window.cordova), o = f(() => {
788
788
  const { width: l } = je();
789
789
  return l.value <= 1280 ? l.value + "px" : l.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px";
790
790
  });
@@ -811,9 +811,9 @@ export {
811
811
  oe as routeTransName,
812
812
  it as useColor,
813
813
  Y as useGlobalStore,
814
- Dt as useHotkey,
815
- qt as usePermission,
816
- St as usePullPermission,
814
+ St as useHotkey,
815
+ Dt as usePermission,
816
+ qt as usePullPermission,
817
817
  Tt as useSystem,
818
818
  ne as useViewMgrStore,
819
819
  Q as useViewStack,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.3.16",
4
+ "version": "0.3.17",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",