x-essential-lib 0.9.7 → 0.9.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.
@@ -1,5 +1,5 @@
1
1
  export declare function useNameHelper(): {
2
2
  nameOfVerbObject: (verb: string, object: string) => string;
3
3
  nameOfObjectsInstance: (objects: string[], instance?: string) => string;
4
- nameOfDeleteObjectText: (object: string) => string;
4
+ nameOfDeleteObjectText: (object: string, name: string) => string;
5
5
  };
@@ -103,7 +103,7 @@ const e = {
103
103
  common: {
104
104
  cancel: "Cancel",
105
105
  confirm: "Confirm",
106
- deleteObjectText: "Do you want to delete 「{name}」?",
106
+ deleteObjectText: "Do you want to delete {object} 「{name}」?",
107
107
  responding: "Responding..."
108
108
  }
109
109
  }, a = {
@@ -103,7 +103,7 @@ const e = {
103
103
  common: {
104
104
  cancel: "取消",
105
105
  confirm: "确定",
106
- deleteObjectText: "你想要删除「{name}」?",
106
+ deleteObjectText: "你想要删除{object}「{name}」?",
107
107
  responding: "响应中..."
108
108
  }
109
109
  }, a = {
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.id="x-essential-lib",d.appendChild(document.createTextNode('.fade-leave-active[data-v-83c3cd1d]{transition:opacity .5s ease}.fade-leave-to[data-v-83c3cd1d]{opacity:0}.x-cont[data-v-83c3cd1d]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-83c3cd1d]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-83c3cd1d]{transform-origin:20px 20px;animation:lds-spinner-83c3cd1d 1.2s linear infinite}.lds-spinner div[data-v-83c3cd1d]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-83c3cd1d]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-83c3cd1d]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-83c3cd1d]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-83c3cd1d]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-83c3cd1d]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-83c3cd1d]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-83c3cd1d]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-83c3cd1d]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-83c3cd1d]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-83c3cd1d{0%{opacity:1}to{opacity:0}}.x-item[data-v-f1f60167]{width:600px}@media (max-width: 600px){.x-item[data-v-f1f60167]{width:calc(100vw - 16px)}}.x-cont[data-v-b482df18]{position:fixed;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(d)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { computed as j, provide as U, inject as K, ref as p, watchEffect as ne, onMounted as W, onBeforeUnmount as N, onBeforeMount as ke, defineComponent as A, watch as J, resolveComponent as m, createBlock as L, openBlock as V, withKeys as F, unref as E, withModifiers as $, isRef as X, withCtx as v, createVNode as y, createTextVNode as B, toDisplayString as S, Transition as De, createElementBlock as ee, createCommentVNode as te, normalizeStyle as ce, createElementVNode as w, Fragment as Oe, renderList as je, useTemplateRef as se } from "vue";
2
+ import { computed as O, provide as U, inject as K, ref as p, watchEffect as ne, onMounted as W, onBeforeUnmount as N, onBeforeMount as ke, defineComponent as A, watch as J, resolveComponent as m, createBlock as L, openBlock as V, withKeys as F, unref as E, withModifiers as $, isRef as X, withCtx as v, createVNode as y, createTextVNode as B, toDisplayString as S, Transition as De, createElementBlock as ee, createCommentVNode as te, normalizeStyle as ce, createElementVNode as w, Fragment as je, renderList as Oe, useTemplateRef as se } from "vue";
3
3
  import { useI18n as z } from "vue-i18n";
4
4
  import { useTheme as pe, useDisplay as Ve } from "vuetify";
5
5
  import { useRouter as _e, useRoute as Ce } from "vue-router";
6
6
  import qe from "axios";
7
7
  import { a as I, m as Se, u as Re } from "./vendor.waod39c6.js";
8
8
  function Te() {
9
- const e = pe(), t = j(() => e.global.current.value.colors.primary), a = j(() => e.global.current.value.colors.secondary), o = j(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = j(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = j(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), u = j(() => e.current.value.dark ? "#303030" : "#f6f6f6"), r = j(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
9
+ const e = pe(), t = O(() => e.global.current.value.colors.primary), a = O(() => e.global.current.value.colors.secondary), o = O(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = O(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = O(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), u = O(() => e.current.value.dark ? "#303030" : "#f6f6f6"), r = O(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
10
10
  return {
11
11
  primaryColor: t,
12
12
  secondaryColor: a,
@@ -51,7 +51,7 @@ function Me(e, t) {
51
51
  function $e() {
52
52
  I.remove("accessToken"), I.remove("refreshToken"), I.remove("userId"), I.remove("userName"), I.remove("phone"), I.remove("activeOrg"), _e().replace({ path: "/passport/login" });
53
53
  }
54
- const Ot = (function() {
54
+ const jt = (function() {
55
55
  return window.globalObjects || (window.globalObjects = {
56
56
  router: null,
57
57
  i18n: null
@@ -59,7 +59,7 @@ const Ot = (function() {
59
59
  })(), c = (function() {
60
60
  return window.eventBus || (window.eventBus = Se(), console.log("eventBus created")), window.eventBus;
61
61
  })();
62
- async function jt(e) {
62
+ async function Ot(e) {
63
63
  return new Promise((t) => {
64
64
  setTimeout(t, e);
65
65
  });
@@ -434,7 +434,7 @@ function Wt(e, t, a, o, l, n) {
434
434
  });
435
435
  const i = (f) => {
436
436
  e.value = f;
437
- }, O = (f) => {
437
+ }, j = (f) => {
438
438
  t.value = f;
439
439
  }, h = (f) => {
440
440
  const R = f;
@@ -443,9 +443,9 @@ function Wt(e, t, a, o, l, n) {
443
443
  l.value = f;
444
444
  };
445
445
  ke(() => {
446
- c.on("updateDark", i), c.on("updateLocale", O), c.on("updatePermission", h), c.on("updateLastAppPath", d), c.emit("syncGlobalState");
446
+ c.on("updateDark", i), c.on("updateLocale", j), c.on("updatePermission", h), c.on("updateLastAppPath", d), c.emit("syncGlobalState");
447
447
  }), N(() => {
448
- c.off("updateDark", i), c.off("updateLocale", O), c.off("updatePermission", h), c.off("updateLastAppPath", d);
448
+ c.off("updateDark", i), c.off("updateLocale", j), c.off("updatePermission", h), c.off("updateLastAppPath", d);
449
449
  });
450
450
  }
451
451
  function Xt() {
@@ -459,7 +459,7 @@ function Xt() {
459
459
  let _ = r.join(" / ");
460
460
  return u && (_ += ` <${u}>`), _;
461
461
  },
462
- nameOfDeleteObjectText: (n) => t("dlg.common.deleteObjectText", { name: t(n) })
462
+ nameOfDeleteObjectText: (n, u) => t("dlg.common.deleteObjectText", { object: t(n), name: u })
463
463
  };
464
464
  }
465
465
  function zt() {
@@ -474,7 +474,7 @@ function zt() {
474
474
  return { verifyPermission: t };
475
475
  }
476
476
  function Ht() {
477
- const e = j(() => !!window.cordova), t = Ve(), a = j(() => t.width.value <= 1280 ? t.width.value + "px" : t.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px"), o = j(() => t.xs.value);
477
+ const e = O(() => !!window.cordova), t = Ve(), a = O(() => t.width.value <= 1280 ? t.width.value + "px" : t.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px"), o = O(() => t.xs.value);
478
478
  function l() {
479
479
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
480
480
  navigator.userAgent
@@ -483,7 +483,7 @@ function Ht() {
483
483
  return { sysBarAvail: e, compactWidth: a, isCurvedScreen: o, isMobile: l };
484
484
  }
485
485
  function Q(e, t) {
486
- const a = Je(), o = j({
486
+ const a = Je(), o = O({
487
487
  get() {
488
488
  return be(a, e);
489
489
  },
@@ -511,23 +511,23 @@ const ot = /* @__PURE__ */ A({
511
511
  };
512
512
  return J(k, (i) => {
513
513
  !i && !g && (c.emit("confirmDlgResult" + s, !1), g = !0);
514
- }), (i, O) => {
514
+ }), (i, j) => {
515
515
  const h = m("v-card-text"), d = m("v-btn"), f = m("v-card-actions"), R = m("v-card"), b = m("v-dialog");
516
516
  return V(), L(b, {
517
517
  modelValue: E(k),
518
- "onUpdate:modelValue": O[1] || (O[1] = (D) => X(k) ? k.value = D : null),
518
+ "onUpdate:modelValue": j[1] || (j[1] = (D) => X(k) ? k.value = D : null),
519
519
  attach: "",
520
520
  "max-width": "600px",
521
521
  transition: "dialog-top-transition",
522
522
  onKeydown: [
523
523
  F($(x, ["stop", "prevent"]), ["enter"]),
524
- O[2] || (O[2] = F($((D) => k.value = !1, ["stop", "prevent"]), ["esc"]))
524
+ j[2] || (j[2] = F($((D) => k.value = !1, ["stop", "prevent"]), ["esc"]))
525
525
  ]
526
526
  }, {
527
527
  default: v(() => [
528
528
  y(R, {
529
- title: a.value,
530
- subtitle: o.value
529
+ subtitle: o.value,
530
+ title: a.value
531
531
  }, {
532
532
  default: v(() => [
533
533
  y(h, null, {
@@ -541,7 +541,7 @@ const ot = /* @__PURE__ */ A({
541
541
  y(d, {
542
542
  color: n.value,
543
543
  variant: "text",
544
- onClick: O[0] || (O[0] = (D) => k.value = !1)
544
+ onClick: j[0] || (j[0] = (D) => k.value = !1)
545
545
  }, {
546
546
  default: v(() => [
547
547
  B(S(u.value), 1)
@@ -563,7 +563,7 @@ const ot = /* @__PURE__ */ A({
563
563
  })
564
564
  ]),
565
565
  _: 1
566
- }, 8, ["title", "subtitle"])
566
+ }, 8, ["subtitle", "title"])
567
567
  ]),
568
568
  _: 1
569
569
  }, 8, ["modelValue", "onKeydown"]);
@@ -576,7 +576,7 @@ const ot = /* @__PURE__ */ A({
576
576
  zIndex: { default: 1 }
577
577
  },
578
578
  setup(e) {
579
- const { backgroundColor2: t } = Te(), a = j(() => ({
579
+ const { backgroundColor2: t } = Te(), a = O(() => ({
580
580
  background: t.value,
581
581
  zIndex: e.zIndex
582
582
  }));
@@ -622,10 +622,10 @@ const ot = /* @__PURE__ */ A({
622
622
  },
623
623
  emits: ["timeout"],
624
624
  setup(e, { emit: t }) {
625
- const a = j(() => ({
625
+ const a = O(() => ({
626
626
  width: "calc(100% - 64px)",
627
627
  overflowWrap: "break-word"
628
- })), o = j(() => {
628
+ })), o = O(() => {
629
629
  switch (e.type) {
630
630
  case "success":
631
631
  return "mdi-check-circle";
@@ -699,7 +699,7 @@ const ot = /* @__PURE__ */ A({
699
699
  onClick: _[0] || (_[0] = $(() => {
700
700
  }, ["stop"]))
701
701
  }, [
702
- (V(!0), ee(Oe, null, je(t.value, (s) => (V(), L(ut, {
702
+ (V(!0), ee(je, null, Oe(t.value, (s) => (V(), L(ut, {
703
703
  id: s.id,
704
704
  key: s.id,
705
705
  text: s.text,
@@ -716,7 +716,7 @@ const ot = /* @__PURE__ */ A({
716
716
  let s = 0, g = !1;
717
717
  const C = se("target"), k = async (h) => {
718
718
  a.value = h.title, o.value = h.subtitle ?? "", l.value = h.value, n.value = h.precision, u.value = h.min, r.value = h.max, _.value = h.step, s = h.seq, g = !1, x.value = !0, await H(() => !!C.value), C.value.focus();
719
- }, { open: x } = Q("numberDlg", k), i = p(!1), O = () => {
719
+ }, { open: x } = Q("numberDlg", k), i = p(!1), j = () => {
720
720
  x.value = !1, g || (c.emit(`numberDlgResult${s}`, l.value), g = !0);
721
721
  };
722
722
  return J(x, (h) => {
@@ -738,7 +738,7 @@ const ot = /* @__PURE__ */ A({
738
738
  modelValue: i.value,
739
739
  "onUpdate:modelValue": d[2] || (d[2] = (q) => i.value = q),
740
740
  class: "mx-3",
741
- onSubmit: $(O, ["prevent"])
741
+ onSubmit: $(j, ["prevent"])
742
742
  }, {
743
743
  default: v(() => [
744
744
  y(f, {
@@ -794,8 +794,8 @@ const ot = /* @__PURE__ */ A({
794
794
  setup(e) {
795
795
  const { t } = z(), a = p(""), o = p(""), l = p(""), n = p(""), u = p(""), r = p(), _ = p(""), s = p(""), g = p(""), C = p(""), k = p("");
796
796
  let x = 0, i = !1;
797
- const O = se("target"), h = async (b) => {
798
- a.value = b.title, o.value = b.subtitle ?? "", l.value = b.text, n.value = b.label, u.value = b.placeholder, r.value = b.rules, _.value = b.value, s.value = b.cancel?.color ?? "primary", g.value = b.cancel?.text ?? t("dlg.common.cancel"), C.value = b.confirm?.color ?? "primary", k.value = b.confirm?.text ?? t("dlg.common.confirm"), x = b.seq, i = !1, d.value = !0, await H(() => !!O.value), O.value.focus();
797
+ const j = se("target"), h = async (b) => {
798
+ a.value = b.title, o.value = b.subtitle ?? "", l.value = b.text, n.value = b.label, u.value = b.placeholder, r.value = b.rules, _.value = b.value, s.value = b.cancel?.color ?? "primary", g.value = b.cancel?.text ?? t("dlg.common.cancel"), C.value = b.confirm?.color ?? "primary", k.value = b.confirm?.text ?? t("dlg.common.confirm"), x = b.seq, i = !1, d.value = !0, await H(() => !!j.value), j.value.focus();
799
799
  }, { open: d } = Q("promptDlg", h), f = p(!1), R = () => {
800
800
  d.value = !1, i || (c.emit("promptDlgResult" + x, _.value ?? ""), i = !0);
801
801
  };
@@ -829,7 +829,7 @@ const ot = /* @__PURE__ */ A({
829
829
  default: v(() => [
830
830
  y(Z, {
831
831
  ref_key: "target",
832
- ref: O,
832
+ ref: j,
833
833
  modelValue: _.value,
834
834
  "onUpdate:modelValue": D[0] || (D[0] = (M) => _.value = M),
835
835
  label: n.value,
@@ -925,7 +925,7 @@ const ot = /* @__PURE__ */ A({
925
925
  });
926
926
  };
927
927
  async function Ft(e) {
928
- return (await mt(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.b4pdkbnt.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.jx2nrjh0.js") }), `./locales/${e}/index.ts`, 4)).default;
928
+ return (await mt(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.m6jy5ga5.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.l9rvbadw.js") }), `./locales/${e}/index.ts`, 4)).default;
929
929
  }
930
930
  const Gt = { install: vt };
931
931
  export {
@@ -938,7 +938,7 @@ export {
938
938
  Gt as default,
939
939
  tt as delView,
940
940
  c as eventBus,
941
- Ot as globalObjects,
941
+ jt as globalObjects,
942
942
  be as hasView,
943
943
  Mt as injectDark,
944
944
  Et as injectLastAppPath,
@@ -975,6 +975,6 @@ export {
975
975
  Ht as useSystem,
976
976
  Q as useViewStack,
977
977
  Ke as verifyPermission,
978
- jt as waitMs,
978
+ Ot as waitMs,
979
979
  H as waitUtil
980
980
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.9.7",
4
+ "version": "0.9.8",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",