x-essential-lib 0.5.55 → 0.5.57

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,2 +1,3 @@
1
1
  import { AxiosInstance } from 'axios';
2
+ import 'pinia-plugin-persistedstate';
2
3
  export declare function useMicroApp(prod: boolean, instance?: AxiosInstance): void;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="x-essential-lib",a.appendChild(document.createTextNode('.x-cont[data-v-f4ad116e]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-f4ad116e]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-f4ad116e]{transform-origin:20px 20px;animation:lds-spinner-f4ad116e 1.2s linear infinite}.lds-spinner div[data-v-f4ad116e]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-f4ad116e]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-f4ad116e]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-f4ad116e]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-f4ad116e]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-f4ad116e]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-f4ad116e]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-f4ad116e]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-f4ad116e]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-f4ad116e]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-f4ad116e]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-f4ad116e{0%{opacity:1}to{opacity:0}}.x-cont[data-v-8c2268ea]{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 { ref as i, watch as N, computed as f, onMounted as S, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as R, createBlock as E, unref as z, isRef as Q, withKeys as F, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as I, toDisplayString as A, createElementBlock as X, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as xe, createCommentVNode as ye } from "vue";
2
+ import { ref as i, watch as N, computed as f, onMounted as S, onBeforeUnmount as O, defineComponent as M, resolveComponent as h, openBlock as R, createBlock as E, unref as z, isRef as Q, withKeys as F, withModifiers as K, withCtx as w, createVNode as k, createTextVNode as I, toDisplayString as A, createElementBlock as X, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as ye, createCommentVNode as xe } from "vue";
3
3
  import { useTheme as H, useLocale as Y, useDisplay as ke } from "vuetify";
4
4
  import { defineStore as le } from "pinia";
5
5
  import be from "axios";
@@ -54,7 +54,7 @@ const Z = le(
54
54
  }
55
55
  function r(p) {
56
56
  const _ = e.value.findIndex((v) => v === p);
57
- _ !== -1 && e.value.splice(_, e.value.length - _);
57
+ _ !== -1 && e.value.splice(_, 1);
58
58
  }
59
59
  function n() {
60
60
  console.assert(e.value.length > 0), e.value.pop();
@@ -499,9 +499,9 @@ const $e = /* @__PURE__ */ M({
499
499
  var u;
500
500
  return ((u = n.value) == null ? void 0 : u.text) ?? a.t("confirm");
501
501
  });
502
- let y = 0, C = !1;
502
+ let x = 0, C = !1;
503
503
  const T = (u) => {
504
- l.value = u.title, o.value = u.text, r.value = u.cancel, n.value = u.confirm, y = u.seq, C = !1, t.value = !0;
504
+ l.value = u.title, o.value = u.text, r.value = u.cancel, n.value = u.confirm, x = u.seq, C = !1, t.value = !0;
505
505
  };
506
506
  S(() => {
507
507
  s.on("confirmDlg", T);
@@ -509,13 +509,13 @@ const $e = /* @__PURE__ */ M({
509
509
  s.off("confirmDlg", T);
510
510
  });
511
511
  const j = () => {
512
- t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
512
+ t.value = !1, C || (s.emit("confirmDlgResult" + x, !0), C = !0);
513
513
  };
514
514
  return N(t, (u) => {
515
- !u && !C && (s.emit("confirmDlgResult" + y, !1), C = !0);
515
+ !u && !C && (s.emit("confirmDlgResult" + x, !1), C = !0);
516
516
  }), (u, g) => {
517
- const b = h("v-card-text"), V = h("v-btn"), q = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
518
- return R(), E(x, {
517
+ const b = h("v-card-text"), V = h("v-btn"), q = h("v-card-actions"), d = h("v-card"), y = h("v-dialog");
518
+ return R(), E(y, {
519
519
  modelValue: z(t),
520
520
  "onUpdate:modelValue": g[1] || (g[1] = (U) => Q(t) ? t.value = U : null),
521
521
  onKeydown: [
@@ -665,7 +665,7 @@ const $e = /* @__PURE__ */ M({
665
665
  }, ["stop"])),
666
666
  class: "x-cont d-flex flex-column-reverse align-center"
667
667
  }, [
668
- (R(!0), X(we, null, xe(a.items, (_) => (R(), E(Ne, {
668
+ (R(!0), X(we, null, ye(a.items, (_) => (R(), E(Ne, {
669
669
  onTimeout: l,
670
670
  id: _.id,
671
671
  type: _.type,
@@ -678,7 +678,7 @@ const $e = /* @__PURE__ */ M({
678
678
  }), Je = /* @__PURE__ */ pe(He, [["__scopeId", "data-v-8c2268ea"]]), Xe = /* @__PURE__ */ M({
679
679
  __name: "index",
680
680
  setup(e) {
681
- const a = Y(), { open: t } = ee("promptDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = i(), p = i(""), _ = i(), v = i(), y = f(() => {
681
+ const a = Y(), { open: t } = ee("promptDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = i(), p = i(""), _ = i(), v = i(), x = f(() => {
682
682
  var d;
683
683
  return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
684
684
  }), C = f(() => {
@@ -693,8 +693,8 @@ const $e = /* @__PURE__ */ M({
693
693
  }), u = i();
694
694
  let g = 0, b = !1;
695
695
  const V = async (d) => {
696
- var x;
697
- l.value = d.title, o.value = d.text, r.value = d.label, n.value = d.placeholder, c.value = d.rules, p.value = d.value, _.value = d.cancel, v.value = d.confirm, g = d.seq, b = !1, t.value = !0, await P(() => u.value !== void 0, 1e3), (x = u.value) == null || x.focus();
696
+ var y;
697
+ l.value = d.title, o.value = d.text, r.value = d.label, n.value = d.placeholder, c.value = d.rules, p.value = d.value, _.value = d.cancel, v.value = d.confirm, g = d.seq, b = !1, t.value = !0, await P(() => u.value !== void 0, 1e3), (y = u.value) == null || y.focus();
698
698
  };
699
699
  S(() => {
700
700
  s.on("promptDlg", V);
@@ -706,13 +706,13 @@ const $e = /* @__PURE__ */ M({
706
706
  };
707
707
  return N(t, (d) => {
708
708
  !d && !b && (s.emit("promptDlgResult" + g, void 0), b = !0);
709
- }), (d, x) => {
709
+ }), (d, y) => {
710
710
  const U = h("v-card-text"), se = h("v-text-field"), _e = h("v-form"), te = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
711
711
  return R(), E(fe, {
712
712
  modelValue: z(t),
713
- "onUpdate:modelValue": x[2] || (x[2] = ($) => Q(t) ? t.value = $ : null),
713
+ "onUpdate:modelValue": y[2] || (y[2] = ($) => Q(t) ? t.value = $ : null),
714
714
  onKeydown: [
715
- x[3] || (x[3] = F(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
715
+ y[3] || (y[3] = F(K(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
716
716
  F(K(q, ["stop", "prevent"]), ["enter"])
717
717
  ],
718
718
  transition: "dialog-top-transition",
@@ -726,12 +726,12 @@ const $e = /* @__PURE__ */ M({
726
726
  I(A(o.value), 1)
727
727
  ]),
728
728
  _: 1
729
- })) : ye("", !0),
729
+ })) : xe("", !0),
730
730
  k(_e, { class: "mx-3" }, {
731
731
  default: w(() => [
732
732
  k(se, {
733
733
  modelValue: p.value,
734
- "onUpdate:modelValue": x[0] || (x[0] = ($) => p.value = $),
734
+ "onUpdate:modelValue": y[0] || (y[0] = ($) => p.value = $),
735
735
  label: r.value,
736
736
  placeholder: n.value,
737
737
  rules: c.value,
@@ -744,8 +744,8 @@ const $e = /* @__PURE__ */ M({
744
744
  k(de, { class: "d-flex justify-end" }, {
745
745
  default: w(() => [
746
746
  k(te, {
747
- onClick: x[1] || (x[1] = ($) => t.value = !1),
748
- color: y.value,
747
+ onClick: y[1] || (y[1] = ($) => t.value = !1),
748
+ color: x.value,
749
749
  variant: "text"
750
750
  }, {
751
751
  default: w(() => [
@@ -835,6 +835,7 @@ function Pe(e, a) {
835
835
  }
836
836
  function mt(e, a) {
837
837
  const t = Ce(), l = ne(), o = Z(), r = re();
838
+ o.$hydrate();
838
839
  let n = !0;
839
840
  const c = () => {
840
841
  n = !1;
@@ -865,11 +866,11 @@ function mt(e, a) {
865
866
  return;
866
867
  }
867
868
  if (!e && u.ctrlKey && u.altKey && u.code === "KeyD") {
868
- o.dark = !o.dark;
869
+ o.dark = !o.dark, o.$persist();
869
870
  return;
870
871
  }
871
872
  if (!e && u.ctrlKey && u.altKey && u.code === "KeyL") {
872
- o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
873
+ o.locale === "en" ? o.locale = "zhHans" : o.locale = "en", o.$persist();
873
874
  return;
874
875
  }
875
876
  };
@@ -878,7 +879,7 @@ function mt(e, a) {
878
879
  }), O(() => {
879
880
  window.removeEventListener("keydown", v);
880
881
  });
881
- let y;
882
+ let x;
882
883
  const C = async () => {
883
884
  if (!n)
884
885
  return;
@@ -897,16 +898,16 @@ function mt(e, a) {
897
898
  const d = b[q];
898
899
  V[q] = JSON.parse(d);
899
900
  }
900
- o.permissionObjects = V, o.permissionChecksum = b.checksum ?? "";
901
+ o.permissionObjects = V, o.permissionChecksum = b.checksum ?? "", o.$persist();
901
902
  } catch (g) {
902
903
  console.error(g);
903
904
  }
904
905
  }, T = async (u) => {
905
- u && await C(), clearTimeout(y), y = setTimeout(async () => {
906
- await C(), y && T();
906
+ u && await C(), clearTimeout(x), x = setTimeout(async () => {
907
+ await C(), x && T();
907
908
  }, 3e3);
908
909
  }, j = () => {
909
- clearTimeout(y), y = void 0;
910
+ clearTimeout(x), x = void 0;
910
911
  };
911
912
  S(() => {
912
913
  a && T(!0);
@@ -926,14 +927,14 @@ function wt() {
926
927
  const e = H(), a = ke(), t = f(() => e.current.value.dark), l = f(() => !!window.cordova), o = f(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
927
928
  return { dark: t, sysBarAvail: l, compactWidth: o };
928
929
  }
929
- const xt = { install: Ze };
930
+ const yt = { install: Ze };
930
931
  export {
931
932
  Be as Permission,
932
933
  je as appAppear,
933
934
  Ae as clearAppAppear,
934
935
  st as closeWaitDlg,
935
936
  nt as createAxios,
936
- xt as default,
937
+ yt as default,
937
938
  s as eventBus,
938
939
  oe as isExist,
939
940
  L as matchRouteMeta,
@@ -1,3 +1,4 @@
1
+ import 'pinia-plugin-persistedstate';
1
2
  import { PermissionObjects } from '../utils';
2
3
  export declare const useGlobalStore: import("pinia").StoreDefinition<"global", import("pinia")._UnwrapAll<Pick<{
3
4
  dark: import("vue").Ref<boolean | undefined>;
@@ -1,3 +1,4 @@
1
+ import 'pinia-plugin-persistedstate';
1
2
  export declare const useViewMgrStore: import("pinia").StoreDefinition<"viewMgr", import("pinia")._UnwrapAll<Pick<{
2
3
  views: import("vue").Ref<string[]>;
3
4
  isEmpty: () => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.5.55",
4
+ "version": "0.5.57",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -46,7 +46,6 @@
46
46
  "lint-staged": "^15.2.2",
47
47
  "pinia-plugin-persistedstate": "^3.2.1",
48
48
  "prettier": "3.2.5",
49
- "rollup-plugin-copy": "^3.5.0",
50
49
  "sass": "^1.74.1",
51
50
  "typescript": "^5.2.2",
52
51
  "vite": "^5.2.0",