x-essential-lib 0.10.38 → 0.10.40

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.
@@ -3,12 +3,6 @@ import { t as __exportAll } from "./rolldown-runtime.c6i0pdwe.js";
3
3
  //#region src/i18n/locales/en/index.ts
4
4
  var en_exports = /* @__PURE__ */ __exportAll({ default: () => en_default });
5
5
  var en_default = {
6
- "dlg": { common: {
7
- ask: "Do you want {verb} {object} '{name}' ?",
8
- cancel: "Cancel",
9
- confirm: "Confirm",
10
- responding: "Responding..."
11
- } },
12
6
  "$vuetify": {
13
7
  badge: "Badge",
14
8
  open: "Open",
@@ -196,7 +190,15 @@ var en_default = {
196
190
  changeFormat: "Change color format"
197
191
  } }
198
192
  },
199
- "x-essential-lib": { publicDomain: "Public Domain" }
193
+ "x-essential-lib": {
194
+ dlg: {
195
+ ask: "Do you want {verb} {object} '{name}' ?",
196
+ cancel: "Cancel",
197
+ ok: "OK",
198
+ responding: "Responding..."
199
+ },
200
+ publicDomain: "Public Domain"
201
+ }
200
202
  };
201
203
 
202
204
  //#endregion
@@ -3,12 +3,6 @@ import { t as __exportAll } from "./rolldown-runtime.c6i0pdwe.js";
3
3
  //#region src/i18n/locales/zhHans/index.ts
4
4
  var zhHans_exports = /* @__PURE__ */ __exportAll({ default: () => zhHans_default });
5
5
  var zhHans_default = {
6
- "dlg": { common: {
7
- ask: "你想要{verb}{object}'{name}'?",
8
- cancel: "取消",
9
- confirm: "确定",
10
- responding: "响应中..."
11
- } },
12
6
  "$vuetify": {
13
7
  badge: "徽章",
14
8
  open: "打开",
@@ -196,7 +190,15 @@ var zhHans_default = {
196
190
  changeFormat: "更改颜色格式"
197
191
  } }
198
192
  },
199
- "x-essential-lib": { publicDomain: "公域" }
193
+ "x-essential-lib": {
194
+ dlg: {
195
+ ask: "你想要{verb}{object}'{name}'?",
196
+ cancel: "取消",
197
+ ok: "确定",
198
+ responding: "响应中..."
199
+ },
200
+ publicDomain: "公域"
201
+ }
200
202
  };
201
203
 
202
204
  //#endregion
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { n as EventType, t as Emitter } from "./vendor.dqdzrw43.js";
1
+ import { n as EventType, t as Emitter } from "./vendor.g0828r92.js";
2
2
  import { Ref } from "vue";
3
3
  import { AxiosInstance } from "axios";
4
-
5
4
  //#region src/composables/color.d.ts
6
- declare function useColor(): {
5
+ export declare function useColor(): {
7
6
  primaryColor: import("vue").ComputedRef<string>;
8
7
  secondaryColor: import("vue").ComputedRef<string>;
9
8
  backgroundColor0: import("vue").ComputedRef<"#2e2e2e" | "#bdbdbd">;
@@ -19,7 +18,7 @@ interface Options {
19
18
  baseUrl: string;
20
19
  onError: OnError;
21
20
  }
22
- declare function createAxios(options: Options): AxiosInstance;
21
+ export declare function createAxios(options: Options): AxiosInstance;
23
22
  //#endregion
24
23
  //#region src/utils/dialog.d.ts
25
24
  interface ButtonOptions {
@@ -31,9 +30,9 @@ interface ConfirmParams {
31
30
  subtitle?: string;
32
31
  text: string;
33
32
  cancel?: ButtonOptions;
34
- confirm?: ButtonOptions;
33
+ ok?: ButtonOptions;
35
34
  }
36
- declare function openConfirmDlg(params: ConfirmParams): Promise<boolean | undefined>;
35
+ export declare function openConfirmDlg(params: ConfirmParams): Promise<boolean | undefined>;
37
36
  interface NumberParams {
38
37
  title: string;
39
38
  subtitle?: string;
@@ -43,7 +42,7 @@ interface NumberParams {
43
42
  max?: number;
44
43
  step?: number;
45
44
  }
46
- declare function openNumberDlg(params: NumberParams): Promise<number | undefined>;
45
+ export declare function openNumberDlg(params: NumberParams): Promise<number | undefined>;
47
46
  interface PromptParams {
48
47
  title: string;
49
48
  subtitle?: string;
@@ -53,27 +52,27 @@ interface PromptParams {
53
52
  rules?: ((val: string) => string | boolean)[];
54
53
  value?: string;
55
54
  cancel?: ButtonOptions;
56
- confirm?: ButtonOptions;
55
+ ok?: ButtonOptions;
57
56
  }
58
- declare function openPromptDlg(params: PromptParams): Promise<string | undefined>;
59
- declare function openWaitDlg(text?: string): void;
60
- declare function closeWaitDlg(): void;
57
+ export declare function openPromptDlg(params: PromptParams): Promise<string | undefined>;
58
+ export declare function openWaitDlg(text?: string): void;
59
+ export declare function closeWaitDlg(): void;
61
60
  //#endregion
62
61
  //#region src/utils/message.d.ts
63
- declare function messageError(text: string, timeout?: number): void;
64
- declare function messageInfo(text: string, timeout?: number): void;
65
- declare function messageSuccess(text: string, timeout?: number): void;
66
- declare function messageWarning(text: string, timeout?: number): void;
62
+ export declare function messageError(text: string, timeout?: number): void;
63
+ export declare function messageInfo(text: string, timeout?: number): void;
64
+ export declare function messageSuccess(text: string, timeout?: number): void;
65
+ export declare function messageWarning(text: string, timeout?: number): void;
67
66
  //#endregion
68
67
  //#region src/utils/misc.d.ts
69
- declare const globalObjects: {
68
+ export declare const globalObjects: {
70
69
  router: any;
71
70
  i18n: any;
72
71
  };
73
- declare const eventBus: Emitter<Record<EventType, unknown>>;
74
- declare function waitMs(ms: number): Promise<void>;
75
- declare function waitUtil(conditionFunc: () => boolean, timeout?: number, interval?: number): Promise<boolean>;
76
- declare function appAppear(name: string, diff: number): void;
72
+ export declare const eventBus: Emitter<Record<EventType, unknown>>;
73
+ export declare function waitMs(ms: number): Promise<void>;
74
+ export declare function waitUtil(conditionFunc: () => boolean, timeout?: number, interval?: number): Promise<boolean>;
75
+ export declare function appAppear(name: string, diff: number): void;
77
76
  //#endregion
78
77
  //#region src/utils/permission.d.ts
79
78
  type InstanceTree = {
@@ -83,54 +82,54 @@ type PermissionObject = {
83
82
  includes: InstanceTree;
84
83
  excludes: InstanceTree;
85
84
  };
86
- type PermissionObjects = {
85
+ export type PermissionObjects = {
87
86
  [key: string]: PermissionObject;
88
87
  };
89
- declare function toPermissionObjects(permissions: {
88
+ export declare function toPermissionObjects(permissions: {
90
89
  [key: string]: string;
91
90
  }): PermissionObjects;
92
- declare function isExist(instanceTree: InstanceTree | undefined, instance: string): boolean;
93
- declare function verifyPermission(permissionObjects: PermissionObjects, permission: string, instance: string): boolean;
91
+ export declare function isExist(instanceTree: InstanceTree | undefined, instance: string): boolean;
92
+ export declare function verifyPermission(permissionObjects: PermissionObjects, permission: string, instance: string): boolean;
94
93
  //#endregion
95
94
  //#region src/utils/provideInject.d.ts
96
- declare function provideDark(dark: Ref<boolean>): void;
97
- declare function injectDark(): Ref<boolean>;
98
- declare function provideLocale(locale: Ref<string>): void;
99
- declare function injectLocale(): Ref<string>;
100
- declare function providePermissionObjects(permissionObjects: Ref<PermissionObjects>): void;
101
- declare function injectPermissionObjects(): Ref<PermissionObjects>;
102
- declare function provideViews(views: Ref<string[]>): void;
103
- declare function injectViews(): Ref<string[]>;
95
+ export declare function provideDark(dark: Ref<boolean>): void;
96
+ export declare function injectDark(): Ref<boolean>;
97
+ export declare function provideLocale(locale: Ref<string>): void;
98
+ export declare function injectLocale(): Ref<string>;
99
+ export declare function providePermissionObjects(permissionObjects: Ref<PermissionObjects>): void;
100
+ export declare function injectPermissionObjects(): Ref<PermissionObjects>;
101
+ export declare function provideViews(views: Ref<string[]>): void;
102
+ export declare function injectViews(): Ref<string[]>;
104
103
  //#endregion
105
104
  //#region src/utils/router.d.ts
106
- interface RouteMeta {
105
+ export interface RouteMeta {
107
106
  app: 'x-app-mf' | 'x-compute-mf' | 'x-create-mf' | 'x-data-mf' | 'x-ecosystem-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf' | 'x-resource-mf';
108
107
  path: string;
109
108
  back?: string;
110
109
  level: number;
111
110
  requireAuth: boolean;
112
111
  }
113
- declare function matchRouteMeta(path: string): RouteMeta | undefined;
114
- declare const routeTransName: import("vue").Ref<string, string>;
115
- declare function onBeforeEnter(toPath: string, fromPath: string, lastAppPath: string): void;
112
+ export declare function matchRouteMeta(path: string): RouteMeta | undefined;
113
+ export declare const routeTransName: import("vue").Ref<string, string>;
114
+ export declare function onBeforeEnter(toPath: string, fromPath: string, lastAppPath: string): void;
116
115
  //#endregion
117
116
  //#region src/utils/type.d.ts
118
- declare const types: readonly ["string", "number", "boolean", "array", "object", "any"];
119
- type Type = (typeof types)[number];
120
- declare function getTypeColor(type: Type): string;
121
- declare function getTypeDefault(type: Type): any;
117
+ export declare const types: readonly ["string", "number", "boolean", "array", "object", "any"];
118
+ export type Type = (typeof types)[number];
119
+ export declare function getTypeColor(type: Type): string;
120
+ export declare function getTypeDefault(type: Type): any;
122
121
  //#endregion
123
122
  //#region src/utils/viewMgr.d.ts
124
- declare function isEmpty(views: Ref<string[]>): boolean;
125
- declare function lastView(views: Ref<string[]>): string | undefined;
126
- declare function hasView(views: Ref<string[]>, name: string): boolean;
127
- declare function addView(views: Ref<string[]>, name: string): void;
128
- declare function delView(views: Ref<string[]>, name: string): void;
129
- declare function popView(views: Ref<string[]>): void;
130
- declare function clearViews(views: Ref<string[]>): void;
123
+ export declare function isEmpty(views: Ref<string[]>): boolean;
124
+ export declare function lastView(views: Ref<string[]>): string | undefined;
125
+ export declare function hasView(views: Ref<string[]>, name: string): boolean;
126
+ export declare function addView(views: Ref<string[]>, name: string): void;
127
+ export declare function delView(views: Ref<string[]>, name: string): void;
128
+ export declare function popView(views: Ref<string[]>): void;
129
+ export declare function clearViews(views: Ref<string[]>): void;
131
130
  //#endregion
132
131
  //#region src/composables/globalStates.d.ts
133
- interface GlobalStates {
132
+ export interface GlobalStates {
134
133
  darkRaw: Ref<boolean | undefined>;
135
134
  dark: Ref<boolean>;
136
135
  locale: Ref<string>;
@@ -143,23 +142,23 @@ interface GlobalStates {
143
142
  lastAppPath: Ref<string>;
144
143
  views: Ref<string[]>;
145
144
  }
146
- declare function useGlobalStates(globalStates: GlobalStates, base?: boolean): void;
145
+ export declare function useGlobalStates(globalStates: GlobalStates, base?: boolean): void;
147
146
  //#endregion
148
147
  //#region src/composables/microApp.d.ts
149
- declare function useMicroApp(globalStates: GlobalStates, customBack?: (m: RouteMeta) => void): void;
148
+ export declare function useMicroApp(globalStates: GlobalStates, customBack?: (m: RouteMeta) => void): void;
150
149
  //#endregion
151
150
  //#region src/composables/pageRoute.d.ts
152
- declare function usePageRoute(onRouteChange?: () => Promise<void>): {
151
+ export declare function usePageRoute(onRouteChange?: () => Promise<void>): {
153
152
  syncOrg: () => Promise<boolean>;
154
153
  };
155
154
  //#endregion
156
155
  //#region src/composables/permission.d.ts
157
- declare function usePermission(): {
156
+ export declare function usePermission(): {
158
157
  verifyPermission: (permission: string, instance?: string) => boolean;
159
158
  };
160
159
  //#endregion
161
160
  //#region src/composables/system.d.ts
162
- declare function useSystem(): {
161
+ export declare function useSystem(): {
163
162
  sysBarAvail: import("vue").ComputedRef<boolean>;
164
163
  compactWidth: import("vue").ComputedRef<string>;
165
164
  isCurvedScreen: import("vue").ComputedRef<boolean>;
@@ -169,20 +168,12 @@ declare function useSystem(): {
169
168
  };
170
169
  //#endregion
171
170
  //#region src/composables/viewStack.d.ts
172
- declare function useViewStack(name: string, hook?: (params: unknown) => void): {
171
+ export declare function useViewStack(name: string, hook?: (params: unknown) => void): {
173
172
  open: import("vue").WritableComputedRef<boolean, boolean>;
174
173
  };
175
174
  //#endregion
176
175
  //#region src/i18n/index.d.ts
177
- declare function loadLocaleMessageEssential(locale: string): Promise<{
178
- dlg: {
179
- common: {
180
- ask: string;
181
- cancel: string;
182
- confirm: string;
183
- responding: string;
184
- };
185
- };
176
+ export declare function loadLocaleMessageEssential(locale: string): Promise<{
186
177
  $vuetify: {
187
178
  badge: string;
188
179
  open: string;
@@ -389,6 +380,12 @@ declare function loadLocaleMessageEssential(locale: string): Promise<{
389
380
  };
390
381
  };
391
382
  'x-essential-lib': {
383
+ dlg: {
384
+ ask: string;
385
+ cancel: string;
386
+ ok: string;
387
+ responding: string;
388
+ };
392
389
  publicDomain: string;
393
390
  };
394
391
  }>;
@@ -398,4 +395,4 @@ declare const _default: {
398
395
  install: (app: import("vue").App) => void;
399
396
  };
400
397
  //#endregion
401
- export { GlobalStates, PermissionObjects, RouteMeta, Type, addView, appAppear, clearViews, closeWaitDlg, createAxios, _default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLocale, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEnter, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLocale, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useGlobalStates, useMicroApp, usePageRoute, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
398
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){try{document.getElementById(`x-essential-lib`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-essential-lib`);const t = document.createTextNode(`.fade-leave-active[data-v-x-essential-lib-c3545c8d]{transition:opacity .5s}.fade-leave-to[data-v-x-essential-lib-c3545c8d]{opacity:0}.x-cont[data-v-x-essential-lib-c3545c8d]{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.lds-spinner[data-v-x-essential-lib-c3545c8d]{color:official;width:40px;height:40px;display:inline-block;position:relative}.lds-spinner div[data-v-x-essential-lib-c3545c8d]{transform-origin:20px 20px;animation:1.2s linear infinite lds-spinner-x-essential-lib-c3545c8d}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:after{content:" ";background:#9e9e9e;border-radius:5%;width:2px;height:6px;display:block;position:absolute;top:3px;left:18px}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes lds-spinner-x-essential-lib-c3545c8d{0%{opacity:1}to{opacity:0}}.x-item[data-v-x-essential-lib-cfcda9d9]{width:600px}@media (width<=600px){.x-item[data-v-x-essential-lib-cfcda9d9]{width:calc(100vw - 16px)}}.x-cont[data-v-x-essential-lib-b973907d]{z-index:9999;position:fixed;bottom:50px;left:50%;transform:translate(-50%)}`);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
2
- import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.dqdzrw43.js";
2
+ import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.g0828r92.js";
3
3
  import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, resolveComponent, toDisplayString, unref, useTemplateRef, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
4
4
  import { useI18n } from "vue-i18n";
5
5
  import { useDisplay, useTheme } from "vuetify";
@@ -465,10 +465,11 @@ function onBeforeEnter(toPath, fromPath, lastAppPath) {
465
465
  if (!fromRouteMeta) return;
466
466
  const sameApp = toRouteMeta.app === fromRouteMeta.app;
467
467
  const diff = toRouteMeta.level - fromRouteMeta.level;
468
- if (sameApp) if (diff > 0) routeTransName.value = "inner-left";
469
- else if (diff < 0) routeTransName.value = "inner-right";
470
- else routeTransName.value = "";
471
- else {
468
+ if (sameApp) {
469
+ if (diff > 0) routeTransName.value = "inner-left";
470
+ else if (diff < 0) routeTransName.value = "inner-right";
471
+ else routeTransName.value = "";
472
+ } else {
472
473
  routeTransName.value = "";
473
474
  appAppear(toRouteMeta.app, diff);
474
475
  }
@@ -744,12 +745,12 @@ function useSystem() {
744
745
  return name;
745
746
  };
746
747
  const sentenceOfAsk = (verb, object, name) => {
747
- if (locale.value === "en") return t("dlg.common.ask", {
748
+ if (locale.value === "en") return t("x-essential-lib.dlg.ask", {
748
749
  verb: toLower(t(verb)),
749
750
  object: toLower(t(object)),
750
751
  name
751
752
  });
752
- else return t("dlg.common.ask", {
753
+ else return t("x-essential-lib.dlg.ask", {
753
754
  verb: t(verb),
754
755
  object: t(object),
755
756
  name
@@ -802,30 +803,30 @@ var index_vue_vue_type_script_setup_true_lang_default$6 = /*@__PURE__*/ defineCo
802
803
  const text = ref("");
803
804
  const cancelColor = ref("");
804
805
  const cancelText = ref("");
805
- const confirmColor = ref("");
806
- const confirmText = ref("");
806
+ const okColor = ref("");
807
+ const okText = ref("");
807
808
  let seq = 0;
808
809
  let handled = false;
809
- const onOpen = (params) => {
810
+ function onOpen(params) {
810
811
  title.value = params.title;
811
812
  subtitle.value = params.subtitle ?? "";
812
813
  text.value = params.text;
813
814
  cancelColor.value = params.cancel?.color ?? "primary";
814
- cancelText.value = params.cancel?.text ?? t("dlg.common.cancel");
815
- confirmColor.value = params.confirm?.color ?? "primary";
816
- confirmText.value = params.confirm?.text ?? t("dlg.common.confirm");
815
+ cancelText.value = params.cancel?.text ?? t("x-essential-lib.dlg.cancel");
816
+ okColor.value = params.ok?.color ?? "primary";
817
+ okText.value = params.ok?.text ?? t("x-essential-lib.dlg.ok");
817
818
  seq = params.seq;
818
819
  handled = false;
819
820
  open.value = true;
820
- };
821
+ }
821
822
  const { open } = useViewStack("confirmDlg", onOpen);
822
- const onConfirm = () => {
823
+ function onConfirm() {
823
824
  open.value = false;
824
825
  if (!handled) {
825
826
  eventBus.emit("confirmDlgResult" + seq, true);
826
827
  handled = true;
827
828
  }
828
- };
829
+ }
829
830
  watch(open, (val) => {
830
831
  if (!val && !handled) {
831
832
  eventBus.emit("confirmDlgResult" + seq, false);
@@ -862,11 +863,11 @@ var index_vue_vue_type_script_setup_true_lang_default$6 = /*@__PURE__*/ defineCo
862
863
  default: withCtx(() => [createTextVNode(toDisplayString(cancelText.value), 1)]),
863
864
  _: 1
864
865
  }, 8, ["color"]), createVNode(_component_v_btn, {
865
- color: confirmColor.value,
866
+ color: okColor.value,
866
867
  variant: "text",
867
868
  onClick: onConfirm
868
869
  }, {
869
- default: withCtx(() => [createTextVNode(toDisplayString(confirmText.value), 1)]),
870
+ default: withCtx(() => [createTextVNode(toDisplayString(okText.value), 1)]),
870
871
  _: 1
871
872
  }, 8, ["color"])]),
872
873
  _: 1
@@ -1103,7 +1104,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
1103
1104
  let seq = 0;
1104
1105
  let handled = false;
1105
1106
  const target = useTemplateRef("target");
1106
- const onOpen = async (params) => {
1107
+ async function onOpen(params) {
1107
1108
  title.value = params.title;
1108
1109
  subtitle.value = params.subtitle ?? "";
1109
1110
  value.value = params.value;
@@ -1116,16 +1117,19 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
1116
1117
  open.value = true;
1117
1118
  await waitUtil(() => !!target.value);
1118
1119
  target.value.focus();
1119
- };
1120
+ }
1120
1121
  const { open } = useViewStack("numberDlg", onOpen);
1121
1122
  const formValid = ref(false);
1122
- const onSubmit = () => {
1123
- open.value = false;
1124
- if (!handled) {
1125
- eventBus.emit(`numberDlgResult${seq}`, value.value);
1126
- handled = true;
1123
+ function onSubmit() {
1124
+ try {
1125
+ if (!handled) {
1126
+ eventBus.emit(`numberDlgResult${seq}`, value.value);
1127
+ handled = true;
1128
+ }
1129
+ } finally {
1130
+ open.value = false;
1127
1131
  }
1128
- };
1132
+ }
1129
1133
  watch(open, (val) => {
1130
1134
  if (!val && !handled) {
1131
1135
  eventBus.emit(`numberDlgResult${seq}`, void 0);
@@ -1176,7 +1180,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
1176
1180
  variant: "text",
1177
1181
  onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
1178
1182
  }, {
1179
- default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("dlg.common.cancel")), 1)]),
1183
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("x-essential-lib.dlg.cancel")), 1)]),
1180
1184
  _: 1
1181
1185
  }), createVNode(_component_v_btn, {
1182
1186
  color: "primary",
@@ -1184,7 +1188,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
1184
1188
  type: "submit",
1185
1189
  variant: "text"
1186
1190
  }, {
1187
- default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("dlg.common.confirm")), 1)]),
1191
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("x-essential-lib.dlg.ok")), 1)]),
1188
1192
  _: 1
1189
1193
  }, 8, ["disabled"])]),
1190
1194
  _: 1
@@ -1218,12 +1222,12 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineCo
1218
1222
  const value = ref("");
1219
1223
  const cancelColor = ref("");
1220
1224
  const cancelText = ref("");
1221
- const confirmColor = ref("");
1222
- const confirmText = ref("");
1225
+ const okColor = ref("");
1226
+ const okText = ref("");
1223
1227
  let seq = 0;
1224
1228
  let handled = false;
1225
1229
  const target = useTemplateRef("target");
1226
- const onOpen = async (params) => {
1230
+ async function onOpen(params) {
1227
1231
  title.value = params.title;
1228
1232
  subtitle.value = params.subtitle ?? "";
1229
1233
  text.value = params.text;
@@ -1232,24 +1236,27 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineCo
1232
1236
  rules.value = params.rules;
1233
1237
  value.value = params.value;
1234
1238
  cancelColor.value = params.cancel?.color ?? "primary";
1235
- cancelText.value = params.cancel?.text ?? t("dlg.common.cancel");
1236
- confirmColor.value = params.confirm?.color ?? "primary";
1237
- confirmText.value = params.confirm?.text ?? t("dlg.common.confirm");
1239
+ cancelText.value = params.cancel?.text ?? t("x-essential-lib.dlg.cancel");
1240
+ okColor.value = params.ok?.color ?? "primary";
1241
+ okText.value = params.ok?.text ?? t("x-essential-lib.dlg.ok");
1238
1242
  seq = params.seq;
1239
1243
  handled = false;
1240
1244
  open.value = true;
1241
1245
  await waitUtil(() => !!target.value);
1242
1246
  target.value.focus();
1243
- };
1247
+ }
1244
1248
  const { open } = useViewStack("promptDlg", onOpen);
1245
1249
  const formValid = ref(false);
1246
- const onSubmit = () => {
1247
- open.value = false;
1248
- if (!handled) {
1249
- eventBus.emit("promptDlgResult" + seq, value.value ?? "");
1250
- handled = true;
1250
+ function onSubmit() {
1251
+ try {
1252
+ if (!handled) {
1253
+ eventBus.emit("promptDlgResult" + seq, value.value ?? "");
1254
+ handled = true;
1255
+ }
1256
+ } finally {
1257
+ open.value = false;
1251
1258
  }
1252
- };
1259
+ }
1253
1260
  watch(open, (val) => {
1254
1261
  if (!val && !handled) {
1255
1262
  eventBus.emit("promptDlgResult" + seq, void 0);
@@ -1307,12 +1314,12 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineCo
1307
1314
  default: withCtx(() => [createTextVNode(toDisplayString(cancelText.value), 1)]),
1308
1315
  _: 1
1309
1316
  }, 8, ["color"]), createVNode(_component_v_btn, {
1310
- color: confirmColor.value,
1317
+ color: okColor.value,
1311
1318
  disabled: !formValid.value,
1312
1319
  type: "submit",
1313
1320
  variant: "text"
1314
1321
  }, {
1315
- default: withCtx(() => [createTextVNode(toDisplayString(confirmText.value), 1)]),
1322
+ default: withCtx(() => [createTextVNode(toDisplayString(okText.value), 1)]),
1316
1323
  _: 1
1317
1324
  }, 8, ["color", "disabled"])]),
1318
1325
  _: 1
@@ -1398,10 +1405,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
1398
1405
  setup(__props) {
1399
1406
  const { t } = useI18n();
1400
1407
  const text = ref("");
1401
- const onOpen = (params) => {
1402
- text.value = params.text ?? t("dlg.common.responding");
1408
+ function onOpen(params) {
1409
+ text.value = params.text ?? t("x-essential-lib.dlg.responding");
1403
1410
  open.value = true;
1404
- };
1411
+ }
1405
1412
  const onClose = () => {
1406
1413
  open.value = false;
1407
1414
  };
@@ -1456,8 +1463,8 @@ const install = (app) => {
1456
1463
  //#endregion
1457
1464
  //#region src/i18n/index.ts
1458
1465
  async function loadLocaleMessageEssential(locale) {
1459
- if (locale === "en") return (await import("./i18n-en.abhkfjnr.js").then((n) => n.t)).default;
1460
- else if (locale === "zhHans") return (await import("./i18n-zhHans.hng3by2g.js").then((n) => n.t)).default;
1466
+ if (locale === "en") return (await import("./i18n-en.giopyqn9.js").then((n) => n.t)).default;
1467
+ else if (locale === "zhHans") return (await import("./i18n-zhHans.n7dz1nv0.js").then((n) => n.t)).default;
1461
1468
  else throw new Error(`invalid locale=${locale}`);
1462
1469
  }
1463
1470
 
@@ -1,6 +1,6 @@
1
1
  import { Fragment, computed, defineComponent, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isRef, onBeforeMount, onBeforeUnmount, onMounted, provide, ref, shallowRef, toValue, unref, watch, watchEffect } from "vue";
2
2
 
3
- //#region node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.38_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
3
+ //#region node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.42_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4
4
  const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
5
5
  /**
6
6
  * On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
@@ -60,7 +60,7 @@ function watchImmediate(source, cb, options) {
60
60
  }
61
61
 
62
62
  //#endregion
63
- //#region node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.38_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
63
+ //#region node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.42_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
64
64
  const defaultWindow = isClient ? window : void 0;
65
65
  const defaultDocument = isClient ? window.document : void 0;
66
66
  const defaultNavigator = isClient ? window.navigator : void 0;
@@ -149,7 +149,8 @@ function useMediaQuery(query, options = {}) {
149
149
  watchEffect(() => {
150
150
  if (ssrSupport.value) {
151
151
  ssrSupport.value = !isSupported.value;
152
- matches.value = toValue(query).split(",").some((queryString) => {
152
+ const queryStrings = toValue(query).split(",");
153
+ matches.value = queryStrings.some((queryString) => {
153
154
  const not = queryString.includes("not all");
154
155
  const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
155
156
  const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
@@ -329,50 +330,6 @@ var root = freeGlobal || freeSelf || Function("return this")();
329
330
  /** Built-in value references. */
330
331
  var Symbol$1 = root.Symbol;
331
332
 
332
- //#endregion
333
- //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js
334
- /**
335
- * A specialized version of `_.map` for arrays without support for iteratee
336
- * shorthands.
337
- *
338
- * @private
339
- * @param {Array} [array] The array to iterate over.
340
- * @param {Function} iteratee The function invoked per iteration.
341
- * @returns {Array} Returns the new mapped array.
342
- */
343
- function arrayMap(array, iteratee) {
344
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
345
- while (++index < length) result[index] = iteratee(array[index], index, array);
346
- return result;
347
- }
348
-
349
- //#endregion
350
- //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.js
351
- /**
352
- * Checks if `value` is classified as an `Array` object.
353
- *
354
- * @static
355
- * @memberOf _
356
- * @since 0.1.0
357
- * @category Lang
358
- * @param {*} value The value to check.
359
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
360
- * @example
361
- *
362
- * _.isArray([1, 2, 3]);
363
- * // => true
364
- *
365
- * _.isArray(document.body.children);
366
- * // => false
367
- *
368
- * _.isArray('abc');
369
- * // => false
370
- *
371
- * _.isArray(_.noop);
372
- * // => false
373
- */
374
- var isArray = Array.isArray;
375
-
376
333
  //#endregion
377
334
  //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
378
335
  /** Used for built-in method references. */
@@ -401,8 +358,10 @@ function getRawTag(value) {
401
358
  var unmasked = true;
402
359
  } catch (e) {}
403
360
  var result = nativeObjectToString$1.call(value);
404
- if (unmasked) if (isOwn) value[symToStringTag$1] = tag;
405
- else delete value[symToStringTag$1];
361
+ if (unmasked) {
362
+ if (isOwn) value[symToStringTag$1] = tag;
363
+ else delete value[symToStringTag$1];
364
+ }
406
365
  return result;
407
366
  }
408
367
 
@@ -428,7 +387,8 @@ function objectToString(value) {
428
387
  //#endregion
429
388
  //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
430
389
  /** `Object#toString` result references. */
431
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
390
+ var nullTag = "[object Null]";
391
+ var undefinedTag = "[object Undefined]";
432
392
  /** Built-in value references. */
433
393
  var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
434
394
  /**
@@ -498,12 +458,57 @@ function isSymbol(value) {
498
458
  return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
499
459
  }
500
460
 
461
+ //#endregion
462
+ //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js
463
+ /**
464
+ * A specialized version of `_.map` for arrays without support for iteratee
465
+ * shorthands.
466
+ *
467
+ * @private
468
+ * @param {Array} [array] The array to iterate over.
469
+ * @param {Function} iteratee The function invoked per iteration.
470
+ * @returns {Array} Returns the new mapped array.
471
+ */
472
+ function arrayMap(array, iteratee) {
473
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
474
+ while (++index < length) result[index] = iteratee(array[index], index, array);
475
+ return result;
476
+ }
477
+
478
+ //#endregion
479
+ //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.js
480
+ /**
481
+ * Checks if `value` is classified as an `Array` object.
482
+ *
483
+ * @static
484
+ * @memberOf _
485
+ * @since 0.1.0
486
+ * @category Lang
487
+ * @param {*} value The value to check.
488
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
489
+ * @example
490
+ *
491
+ * _.isArray([1, 2, 3]);
492
+ * // => true
493
+ *
494
+ * _.isArray(document.body.children);
495
+ * // => false
496
+ *
497
+ * _.isArray('abc');
498
+ * // => false
499
+ *
500
+ * _.isArray(_.noop);
501
+ * // => false
502
+ */
503
+ var isArray = Array.isArray;
504
+
501
505
  //#endregion
502
506
  //#region node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js
503
507
  /** Used as references for various `Number` constants. */
504
- var INFINITY = Infinity;
508
+ var INFINITY = 1 / 0;
505
509
  /** Used to convert symbols to primitives and strings. */
506
- var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
510
+ var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0;
511
+ var symbolToString = symbolProto ? symbolProto.toString : void 0;
507
512
  /**
508
513
  * The base implementation of `_.toString` which doesn't convert nullish
509
514
  * values to empty strings.
@@ -576,12 +581,12 @@ function toLower(value) {
576
581
 
577
582
  //#endregion
578
583
  //#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
579
- var EventType = [
584
+ var [EventType] = [
580
585
  60,
581
586
  () => [],
582
587
  []
583
588
  ];
584
- var Handler = [
589
+ var [Handler] = [
585
590
  61,
586
591
  (T) => [T],
587
592
  [
@@ -590,7 +595,7 @@ var Handler = [
590
595
  ""
591
596
  ]
592
597
  ];
593
- var WildcardHandler = [
598
+ var [WildcardHandler] = [
594
599
  62,
595
600
  (T) => [
596
601
  Record,
@@ -608,7 +613,7 @@ var WildcardHandler = [
608
613
  ""
609
614
  ]
610
615
  ];
611
- var EventHandlerList = [
616
+ var [EventHandlerList] = [
612
617
  63,
613
618
  (T) => [
614
619
  T,
@@ -622,7 +627,7 @@ var EventHandlerList = [
622
627
  ""
623
628
  ]
624
629
  ];
625
- var WildCardEventHandlerList = [
630
+ var [WildCardEventHandlerList] = [
626
631
  64,
627
632
  (T) => [
628
633
  Record,
@@ -638,7 +643,7 @@ var WildCardEventHandlerList = [
638
643
  ""
639
644
  ]
640
645
  ];
641
- var EventHandlerMap = [
646
+ var [EventHandlerMap] = [
642
647
  65,
643
648
  (Events) => [
644
649
  EventType,
@@ -664,7 +669,7 @@ var EventHandlerMap = [
664
669
  ""
665
670
  ]
666
671
  ];
667
- var Emitter = [
672
+ var [Emitter] = [
668
673
  66,
669
674
  (Key, Events) => [
670
675
  EventType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
- "version": "0.10.38",
3
+ "version": "0.10.40",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -30,29 +30,29 @@
30
30
  "@types/js-cookie": "^3.0.6",
31
31
  "@types/lodash-es": "^4.17.12",
32
32
  "@types/node": "^26.0.0",
33
- "@vueuse/core": "^14.3.0",
33
+ "@vueuse/core": "^14.4.0",
34
34
  "husky": "^9.1.7",
35
35
  "js-cookie": "^3.0.8",
36
- "lint-staged": "^17.0.7",
36
+ "lint-staged": "^17.5.1",
37
37
  "lodash-es": "^4.18.1",
38
38
  "mitt": "^3.0.1",
39
- "oxfmt": "^0.55.0",
40
- "oxlint": "^1.70.0",
41
- "picomatch": "^4.0.5",
42
- "rolldown": "^1.1.2",
43
- "sass": "^1.101.0",
44
- "tsdown": "^0.22.3",
39
+ "oxfmt": "^0.67.0",
40
+ "oxlint": "^1.82.0",
41
+ "picomatch": "^4.0.7",
42
+ "rolldown": "^1.2.8",
43
+ "sass": "^1.104.0",
44
+ "tsdown": "^0.23.0",
45
45
  "typescript": "^6.0.3",
46
- "vite": "^8.0.16",
47
- "x-config-lib": "^0.1.5",
48
- "x-config-oxfmt": "^0.1.5",
49
- "x-config-oxlint": "^0.1.6"
46
+ "vite": "^8.3.0",
47
+ "x-config-lib": "^0.1.6",
48
+ "x-config-oxfmt": "^0.1.6",
49
+ "x-config-oxlint": "^0.1.7"
50
50
  },
51
51
  "peerDependencies": {
52
- "axios": "^1.18.0",
53
- "vue": "^3.5.38",
54
- "vue-i18n": "^11.4.6",
55
- "vue-router": "^5.1.0",
56
- "vuetify": "^4.1.2"
52
+ "axios": "^1.20.0",
53
+ "vue": "^3.5.42",
54
+ "vue-i18n": "^11.4.10",
55
+ "vue-router": "^5.3.1",
56
+ "vuetify": "^4.2.1"
57
57
  }
58
58
  }