zova-module-a-zod 5.1.21 → 5.1.24

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,4 +1,3 @@
1
- import type { TypeLocaleBase } from 'zova';
2
1
  export declare const locales: {
3
2
  'en-us': {
4
3
  ZodErrorRequired: string;
@@ -7,5 +6,4 @@ export declare const locales: {
7
6
  ZodErrorRequired: string;
8
7
  };
9
8
  };
10
- export declare function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K, ...args: any[]): string;
11
9
  //# sourceMappingURL=locales.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/.metadata/locales.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAO3C,eAAO,MAAM,OAAO;;;;;;;CAGnB,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC,cAAc,CAAC,EACzE,GAAG,EAAE,CAAC,EACN,GAAG,IAAI,EAAE,GAAG,EAAE,UAOf"}
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/.metadata/locales.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;;;;CAGnB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BeanBase, BeanInfo, BeanScopeBase, useApp, useComputed } from "zova";
1
+ import { BeanBase, BeanInfo, BeanScopeBase } from "zova";
2
2
  import z from "zod";
3
3
  import { Scope, Tool } from "zova-module-a-bean";
4
4
  //#region src/bean/tool.v.ts
@@ -28,14 +28,7 @@ var locales = {
28
28
  "en-us": { ZodErrorRequired: "Required" },
29
29
  "zh-cn": { ZodErrorRequired: "必填项" }
30
30
  };
31
- function $useLocale(key, ...args) {
32
- const app = useApp();
33
- const str = `a-zod::${key}`;
34
- return useComputed(() => {
35
- return app.meta.text(str, ...args);
36
- });
37
- }
38
31
  //#endregion
39
- export { $useLocale, ScopeModuleAZod, ToolV, locale, locales };
32
+ export { ScopeModuleAZod, ToolV, locale, locales };
40
33
 
41
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/bean/tool.v.ts","../src/.metadata/index.ts","../src/config/locale/en-us.ts","../src/config/locale/zh-cn.ts","../src/.metadata/locales.ts"],"sourcesContent":["import z from 'zod';\nimport { BeanBase } from 'zova';\nimport { Tool } from 'zova-module-a-bean';\n\n@Tool()\nexport class ToolV extends BeanBase {\n protected async __init__() {}\n\n required<T extends z.ZodType>(schema: T, params?: string | z.core.$ZodStringParams): T {\n params = params || this.scope.locale.ZodErrorRequired();\n schema._zod.def.error = z.util.normalizeParams(params).error;\n return schema;\n }\n}\n","// eslint-disable\n/** tool: begin */\nexport * from '../bean/tool.v.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-zod' {\n \n export interface ToolV {\n /** @internal */\n get scope(): ScopeModuleAZod;\n }\n\n export interface ToolV {\n get $beanFullName(): 'a-zod.tool.v';\n get $onionName(): 'a-zod:v';\n \n } \n}\n/** tool: end */\n/** tool: begin */\nimport { ToolV } from '../bean/tool.v.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-zod.tool.v': ToolV;\n }\n}\n/** tool: end */\n/** locale: begin */\nimport { locales } from './locales.js';\n/** locale: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleLocales, TypeLocaleBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAZod extends BeanScopeBase {}\n\nexport interface ScopeModuleAZod {\n util: BeanScopeUtil;\nlocale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-zod': ScopeModuleAZod;\n }\n \n \n\n export interface IBeanScopeLocale {\n 'a-zod': (typeof locales)[TypeLocaleBase];\n }\n\n \n}\n\nexport function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `a-zod::${K}` {\n return `a-zod::${key}`;\n} \n/** scope: end */\n","export default {\n ZodErrorRequired: 'Required',\n};\n","export default {\n ZodErrorRequired: '必填项',\n};\n","import type { TypeLocaleBase } from 'zova';\n\nimport { useApp, useComputed } from 'zova';\n\nimport locale_en_us from '../config/locale/en-us.js';\nimport locale_zh_cn from '../config/locale/zh-cn.js';\n\nexport const locales = {\n 'en-us': locale_en_us,\n 'zh-cn': locale_zh_cn,\n};\n\nexport function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(\n key: K,\n ...args: any[]\n) {\n const app = useApp();\n const str = `a-zod::${key}`;\n return useComputed(() => {\n return app.meta.text(str, ...args);\n });\n}\n"],"mappings":";;;;AAAA,IAAA,QAAS,SAAM;AAKf,IAAO,SAAY,SAAQ,MAAA,EAAQ,UAAC,SAAA,EAClC,QAAA,SAAA,CAAA,EAAA,OAAA,WAAA,QAAA,WAAA,MAAA,cAAA,SAAA;CAEA,MAAA,WAAW;CACX,SAAS,QAAQ,QAAQ;AACvB,WAAO,UAAS,KAAQ,MAAM,OAAC,kBAAwB;AACvD,SAAO,KAAA,IAAM,QAAA,EAAA,KAAA,gBAAA,OAAA,CAAA;AACf,SAAA;;;;;;;;;ACZF,IAAG,MAAO,OAAA;AAiBV,IAAU,mBAAoB,OAAO,OAAO,EAAC,QAAA,SAAA,EAC3C,QAAQ,SACT,CAAC,EAAE,KAAK,SAAA,MAAA,SAAA,MAAA,wBAAA,cAAA,GAAA,IAAA,OAAA,IAAA;AAET,SAAA,OAAA,KAAA;AACE,QAAO,UAAM;;;;;CGlBf,SFJe,EACb,kBAAkB,YACnB;CEGD,SDLe,EACb,kBAAkB,OACnB;;ACKD,SAAa,WAAU,KAAA,GAAA,MAAA;CACrB,MAAM,MAAG,QAAA;CACT,MAAM,MAAG,UAAY;AACtB,QAAA,kBAAA;;GAED"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/bean/tool.v.ts","../src/.metadata/index.ts","../src/config/locale/en-us.ts","../src/config/locale/zh-cn.ts","../src/.metadata/locales.ts"],"sourcesContent":["import z from 'zod';\nimport { BeanBase } from 'zova';\nimport { Tool } from 'zova-module-a-bean';\n\n@Tool()\nexport class ToolV extends BeanBase {\n protected async __init__() {}\n\n required<T extends z.ZodType>(schema: T, params?: string | z.core.$ZodStringParams): T {\n params = params || this.scope.locale.ZodErrorRequired();\n schema._zod.def.error = z.util.normalizeParams(params).error;\n return schema;\n }\n}\n","// eslint-disable\n/** tool: begin */\nexport * from '../bean/tool.v.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-zod' {\n \n export interface ToolV {\n /** @internal */\n get scope(): ScopeModuleAZod;\n }\n\n export interface ToolV {\n get $beanFullName(): 'a-zod.tool.v';\n get $onionName(): 'a-zod:v';\n \n } \n}\n/** tool: end */\n/** tool: begin */\nimport { ToolV } from '../bean/tool.v.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-zod.tool.v': ToolV;\n }\n}\n/** tool: end */\n/** locale: begin */\nimport { locales } from './locales.js';\n/** locale: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleLocales, TypeLocaleBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAZod extends BeanScopeBase {}\n\nexport interface ScopeModuleAZod {\n util: BeanScopeUtil;\nlocale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-zod': ScopeModuleAZod;\n }\n \n \n\n export interface IBeanScopeLocale {\n 'a-zod': (typeof locales)[TypeLocaleBase];\n }\n\n \n}\n\nexport function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `a-zod::${K}` {\n return `a-zod::${key}`;\n} \n/** scope: end */\n","export default {\n ZodErrorRequired: 'Required',\n};\n","export default {\n ZodErrorRequired: '必填项',\n};\n","import locale_en_us from '../config/locale/en-us.js';\nimport locale_zh_cn from '../config/locale/zh-cn.js';\n\nexport const locales = {\n 'en-us': locale_en_us,\n 'zh-cn': locale_zh_cn,\n};\n"],"mappings":";;;;AAAA,IAAA,QAAS,SAAM;AAKf,IAAO,SAAY,SAAQ,MAAA,EAAQ,UAAC,SAAA,EAClC,QAAA,SAAA,CAAA,EAAA,OAAA,WAAA,QAAA,WAAA,MAAA,cAAA,SAAA;CAEA,MAAA,WAAW;CACX,SAAS,QAAQ,QAAQ;AACvB,WAAO,UAAS,KAAQ,MAAM,OAAC,kBAAwB;AACvD,SAAO,KAAA,IAAM,QAAA,EAAA,KAAA,gBAAA,OAAA,CAAA;AACf,SAAA;;;;;;;;;ACZF,IAAG,MAAO,OAAA;AAiBV,IAAU,mBAAoB,OAAO,OAAO,EAAC,QAAA,SAAA,EAC3C,QAAQ,SACT,CAAC,EAAE,KAAK,SAAA,MAAA,SAAA,MAAA,wBAAA,cAAA,GAAA,IAAA,OAAA,IAAA;AAET,SAAA,OAAA,KAAA;AACE,QAAO,UAAM;;;;;CGnBf,SFHe,EACb,kBAAkB,YACnB;CEEC,SDJa,EACb,kBAAkB,OACnB;CCGA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-a-zod",
3
- "version": "5.1.21",
4
- "gitHead": "a534504c9a232c291c1bf395b63134a9222f2746",
3
+ "version": "5.1.24",
4
+ "gitHead": "b2879af32ebdecaf6687854b0f7c1d94918919ef",
5
5
  "description": "",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -1,7 +1,3 @@
1
- import type { TypeLocaleBase } from 'zova';
2
-
3
- import { useApp, useComputed } from 'zova';
4
-
5
1
  import locale_en_us from '../config/locale/en-us.js';
6
2
  import locale_zh_cn from '../config/locale/zh-cn.js';
7
3
 
@@ -9,14 +5,3 @@ export const locales = {
9
5
  'en-us': locale_en_us,
10
6
  'zh-cn': locale_zh_cn,
11
7
  };
12
-
13
- export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
14
- key: K,
15
- ...args: any[]
16
- ) {
17
- const app = useApp();
18
- const str = `a-zod::${key}`;
19
- return useComputed(() => {
20
- return app.meta.text(str, ...args);
21
- });
22
- }