halo-fe 1.0.18 → 1.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. package/dist/main.js +975 -976
  2. package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
  3. package/esm/drivers/builders/types/index.d.ts +2 -0
  4. package/esm/drivers/i18ns/I18n.d.ts +41 -0
  5. package/esm/drivers/i18ns/I18nFactory.d.ts +13 -0
  6. package/esm/drivers/i18ns/II18n.d.ts +66 -0
  7. package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +13 -0
  8. package/esm/drivers/i18ns/index.d.ts +3 -0
  9. package/esm/drivers/index.d.ts +1 -0
  10. package/esm/factorying/Factories.d.ts +15 -11
  11. package/esm/factorying/index.d.ts +16 -4
  12. package/esm/helpers/JsonHelper.d.ts +5 -1
  13. package/esm/repos/IRepo.d.ts +4 -0
  14. package/esm/repos/RepoFactory.d.ts +5 -0
  15. package/esm/repos/implements/SettingRepo.d.ts +15 -0
  16. package/esm/repos/index.d.ts +1 -1
  17. package/esm/svcs/implement/I18nSvc.d.ts +1 -1
  18. package/esm/svcs/implement/index.d.ts +1 -2
  19. package/esm/svcs/index.d.ts +1 -7
  20. package/esm/types/CreateFeOptions.d.ts +6 -5
  21. package/esm/utilities/SaveUtility.d.ts +15 -0
  22. package/esm/utilities/index.d.ts +2 -1
  23. package/package.json +2 -3
  24. package/dist/assets/@intlify-BISCQg1h.js +0 -2189
  25. package/dist/assets/@vue-aVYGocXp.js +0 -93
  26. package/dist/assets/vue-i18n-CLr3brPz.js +0 -1670
  27. package/esm/coms/Code.vue.d.ts +0 -41
  28. package/esm/coms/Col.vue.d.ts +0 -11
  29. package/esm/coms/Compare.vue.d.ts +0 -40
  30. package/esm/coms/Container.vue.d.ts +0 -23
  31. package/esm/coms/RichText.vue.d.ts +0 -24
  32. package/esm/coms/Row.vue.d.ts +0 -21
  33. package/esm/coms/types/CodeEmit.d.ts +0 -23
  34. package/esm/coms/types/CodeProps.d.ts +0 -18
  35. package/esm/coms/types/RichTextOptions.d.ts +0 -14
  36. package/esm/coms/types/RichTextProps.d.ts +0 -12
  37. package/esm/coms/types/RowProps.d.ts +0 -14
  38. package/esm/drivers/IDriver.d.ts +0 -10
  39. package/esm/drivers/cdns/implements/BootCdn.d.ts +0 -12
  40. package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +0 -15
  41. package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +0 -21
  42. package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +0 -12
  43. package/esm/drivers/factories/DriverFactory.d.ts +0 -64
  44. package/esm/drivers/factories/Factory.d.ts +0 -18
  45. package/esm/drivers/factories/IFactory.d.ts +0 -18
  46. package/esm/drivers/factories/index.d.ts +0 -42
  47. package/esm/drivers/providers/implements/StorageHelper.d.ts +0 -34
  48. package/esm/helpers/ScriptHelper.d.ts +0 -19
  49. package/esm/helpers/array-helper.d.ts +0 -97
  50. package/esm/helpers/component-helper.d.ts +0 -18
  51. package/esm/helpers/cookie-helper.d.ts +0 -6
  52. package/esm/helpers/dictionary-helper.d.ts +0 -18
  53. package/esm/helpers/dom-helper.d.ts +0 -86
  54. package/esm/helpers/event-helper.d.ts +0 -30
  55. package/esm/helpers/file-helper.d.ts +0 -22
  56. package/esm/helpers/html-helper.d.ts +0 -10
  57. package/esm/helpers/i18n-helper.d.ts +0 -14
  58. package/esm/helpers/image-helper.d.ts +0 -10
  59. package/esm/helpers/json-helper.d.ts +0 -39
  60. package/esm/helpers/math-helper.d.ts +0 -46
  61. package/esm/helpers/micro-helper.d.ts +0 -10
  62. package/esm/helpers/mount-helper.d.ts +0 -14
  63. package/esm/helpers/object-helper.d.ts +0 -38
  64. package/esm/helpers/script-helper.d.ts +0 -31
  65. package/esm/helpers/scroll-helper.d.ts +0 -14
  66. package/esm/helpers/sign-helper.d.ts +0 -14
  67. package/esm/helpers/storage-helper.d.ts +0 -34
  68. package/esm/helpers/string-helper.d.ts +0 -94
  69. package/esm/helpers/task-helper.d.ts +0 -26
  70. package/esm/helpers/time-helper.d.ts +0 -66
  71. package/esm/helpers/tree-helper.d.ts +0 -54
  72. package/esm/helpers/type-helper.d.ts +0 -26
  73. package/esm/helpers/url-helper.d.ts +0 -96
  74. package/esm/plugins/HtmlTransform.d.ts +0 -6
  75. package/esm/plugins/types/IMessager.d.ts +0 -34
  76. package/esm/plugins/types/index.d.ts +0 -7
  77. package/esm/services/ConfigService.d.ts +0 -66
  78. package/esm/services/DriverService.d.ts +0 -36
  79. package/esm/services/EnvService.d.ts +0 -14
  80. package/esm/services/LogService.d.ts +0 -19
  81. package/esm/services/SettingService.d.ts +0 -42
  82. package/esm/services/SocketService.d.ts +0 -23
  83. package/esm/services/UserService.d.ts +0 -47
  84. package/esm/services/index.d.ts +0 -15
  85. package/esm/services/types/IMessage.d.ts +0 -14
  86. package/esm/services/types/IMessager.d.ts +0 -34
  87. package/esm/services/types/index.d.ts +0 -2
  88. package/esm/servs/ConfigServ.d.ts +0 -66
  89. package/esm/servs/DriverServ.d.ts +0 -36
  90. package/esm/servs/EnvServ.d.ts +0 -14
  91. package/esm/servs/IServ.d.ts +0 -6
  92. package/esm/servs/LogServ.d.ts +0 -19
  93. package/esm/servs/Serv.d.ts +0 -4
  94. package/esm/servs/ServFactory.d.ts +0 -11
  95. package/esm/servs/SettingServ.d.ts +0 -42
  96. package/esm/servs/SocketServ.d.ts +0 -38
  97. package/esm/servs/UserServ.d.ts +0 -47
  98. package/esm/servs/implement/ConfigServ.d.ts +0 -66
  99. package/esm/servs/implement/DriverServ.d.ts +0 -36
  100. package/esm/servs/implement/EnvServ.d.ts +0 -14
  101. package/esm/servs/implement/LogServ.d.ts +0 -19
  102. package/esm/servs/implement/SettingServ.d.ts +0 -42
  103. package/esm/servs/implement/SocketServ.d.ts +0 -38
  104. package/esm/servs/implement/UserServ.d.ts +0 -47
  105. package/esm/servs/index.d.ts +0 -15
  106. package/esm/stores/config.d.ts +0 -63
  107. package/esm/stores/driver.d.ts +0 -37
  108. package/esm/stores/env.d.ts +0 -12
  109. package/esm/stores/index.d.ts +0 -8
  110. package/esm/stores/log.d.ts +0 -20
  111. package/esm/stores/setting.d.ts +0 -43
  112. package/esm/stores/socket.d.ts +0 -27
  113. package/esm/stores/user.d.ts +0 -40
  114. package/esm/types/CreateOptions.d.ts +0 -18
@@ -0,0 +1,6 @@
1
+ interface ProviderTable {
2
+ name: string;
3
+ columns: any[];
4
+ rows: any[];
5
+ }
6
+ export default ProviderTable;
@@ -0,0 +1,2 @@
1
+ import ProviderTable from "./ProviderTable";
2
+ export { type ProviderTable };
@@ -0,0 +1,41 @@
1
+ import II18n from "./II18n";
2
+ declare abstract class I18n implements II18n {
3
+ type: string;
4
+ lang: string;
5
+ messages: {
6
+ [key: string]: any;
7
+ };
8
+ open(conn?: string): Promise<void>;
9
+ t: (key: string, params?: any) => string;
10
+ abstract translate(key: string, params: any): string;
11
+ abstract t_exists(key: string): boolean;
12
+ t_menu: (key: string) => string;
13
+ t_module: (type: string, key: string) => string;
14
+ t_table: (table: string) => string;
15
+ t_field: (table: string, field: string) => string;
16
+ t_enum: (name: string, value: string) => string;
17
+ t_field_placeholder: (table: string, field: string) => string;
18
+ t_field_choose_placeholder: (table: string, field: string) => string;
19
+ t_sys: (key: string) => string;
20
+ t_title: () => string;
21
+ /**
22
+ * 根据key设置多语言标题
23
+ */
24
+ setI18nTitle: (key: string) => void;
25
+ /**
26
+ * 设置标题
27
+ */
28
+ setTitle: (title?: string, env?: string) => void;
29
+ /**
30
+ * 添加自定义多语言包
31
+ */
32
+ addMessages: (messages: {
33
+ [key: string]: string;
34
+ }) => void;
35
+ abstract loadI18n(lang: string): Promise<void>;
36
+ /**
37
+ * 切换语言,自动加载菜单
38
+ */
39
+ switchI18n: (lang: string) => Promise<void>;
40
+ }
41
+ export default I18n;
@@ -0,0 +1,13 @@
1
+ import Factory from "../../factorying/Factory";
2
+ import II18n from "./II18n";
3
+ /**
4
+ * 多语言工厂
5
+ */
6
+ declare class I18nFactory extends Factory<II18n> {
7
+ open(): void;
8
+ /**
9
+ * 获取默认多语言
10
+ */
11
+ getDefault(): Promise<II18n>;
12
+ }
13
+ export default I18nFactory;
@@ -0,0 +1,66 @@
1
+ import { IDriver, IOpen } from "../types";
2
+ /**
3
+ * 多语言翻译接口
4
+ */
5
+ interface II18n extends IDriver, IOpen {
6
+ /**
7
+ * 当前语言
8
+ */
9
+ lang: string;
10
+ /**
11
+ * 多语言翻译文案
12
+ */
13
+ messages: {
14
+ [key: string]: any;
15
+ };
16
+ /**
17
+ * 翻译指定key,不存在使用默认值
18
+ */
19
+ t(key: string, params?: any): string;
20
+ /**
21
+ * 判断指定key是否存在
22
+ */
23
+ t_exists(key: any): boolean;
24
+ /**
25
+ * 业务翻译:菜单多语言、多个窗口的多语言同时切换,而不用重载接口
26
+ */
27
+ t_menu(key: string): string;
28
+ /**
29
+ * 模块业务翻译
30
+ */
31
+ t_module(type: string, key: string): string;
32
+ /**
33
+ * 业务翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
34
+ */
35
+ t_table(table: string): string;
36
+ /**
37
+ * 业务翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
38
+ * 注意:如果结果返回未完毕},则vue编译异常
39
+ */
40
+ t_field(table: string, field: string): string;
41
+ /**
42
+ * 枚举翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
43
+ */
44
+ t_enum(name: string, value: string): string;
45
+ /**
46
+ * 字段占位符翻译
47
+ */
48
+ t_field_placeholder(table: string, field: string): string;
49
+ /**
50
+ * 字段占位符翻译
51
+ */
52
+ t_field_choose_placeholder(table: string, field: string): string;
53
+ /**
54
+ * 系统翻译
55
+ */
56
+ t_sys(key: string): string;
57
+ /**
58
+ * 系统标题
59
+ */
60
+ t_title(): string;
61
+ /**
62
+ * 加载指定语言包
63
+ */
64
+ loadI18n(lang?: string): Promise<void>;
65
+ }
66
+ export default II18n;
@@ -0,0 +1,13 @@
1
+ import I18n from "../I18n";
2
+ /**
3
+ * 默认翻译
4
+ * 不用vue-i18n的原因:对json内容的翻译报错无法消除,如:驱动Conn的多语言提示
5
+ */
6
+ declare class DefaultI18n extends I18n {
7
+ type: string;
8
+ open(conn?: string): Promise<void>;
9
+ translate: (key: string, params?: any) => string;
10
+ t_exists: (key: string) => boolean;
11
+ loadI18n: (lang: string) => Promise<void>;
12
+ }
13
+ export default DefaultI18n;
@@ -0,0 +1,3 @@
1
+ import II18n from "./II18n";
2
+ import I18nFactory from "./I18nFactory";
3
+ export { type II18n, I18nFactory };
@@ -7,6 +7,7 @@ export * from "./explainers";
7
7
  export * from "./features";
8
8
  export * from "./hashers";
9
9
  export * from "./https";
10
+ export * from "./i18ns";
10
11
  export * from "./messengers";
11
12
  export * from "./providers";
12
13
  export * from "./signers";
@@ -1,19 +1,9 @@
1
- import { BuilderFactory, CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HttpFactory, MessengerFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory, TemplateFactory } from "../drivers";
1
+ import { BuilderFactory, CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, I18nFactory, HttpFactory, MessengerFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory, TemplateFactory } from "../drivers";
2
2
  import { SvcFactory } from "../svcs";
3
3
  /**
4
4
  * 驱动工厂类
5
5
  */
6
6
  declare class Factories {
7
- /**
8
- * 工厂缓存
9
- */
10
- static mappings: {
11
- [key: string]: any;
12
- };
13
- /**
14
- * 并缓存工厂实例
15
- */
16
- static create<T>(type: any): T;
17
7
  /**
18
8
  * Builder工厂
19
9
  */
@@ -46,6 +36,10 @@ declare class Factories {
46
36
  * Http请求工厂
47
37
  */
48
38
  static get http(): HttpFactory;
39
+ /**
40
+ * 多语言工厂
41
+ */
42
+ static get i18n(): I18nFactory;
49
43
  /**
50
44
  * 消息提示请求工厂
51
45
  */
@@ -74,5 +68,15 @@ declare class Factories {
74
68
  * 服务工厂
75
69
  */
76
70
  static get svc(): SvcFactory;
71
+ /**
72
+ * 工厂缓存
73
+ */
74
+ static mappings: {
75
+ [key: string]: any;
76
+ };
77
+ /**
78
+ * 并缓存工厂实例
79
+ */
80
+ static create<T>(type: any): T;
77
81
  }
78
82
  export default Factories;
@@ -1,5 +1,5 @@
1
1
  import Factories from "./Factories";
2
- import { ICdn, IEncoder, IHasher, IHttp, IMessenger, IProvider } from "../drivers";
2
+ import { ICdn, IEncoder, IHasher, II18n, IHttp, IMessenger, ITemplate } from "../drivers";
3
3
  import { CreateFeOptions } from "../types";
4
4
  /**
5
5
  * 默认base64编码
@@ -13,14 +13,18 @@ declare let cdn: ICdn;
13
13
  * 默认Http请求对象
14
14
  */
15
15
  declare let http: IHttp;
16
+ /**
17
+ * 多语言翻译对象
18
+ */
19
+ declare let i18n: II18n;
16
20
  /**
17
21
  * MD5 hash计算
18
22
  */
19
23
  declare let md5: IHasher;
20
24
  /**
21
- * 默认Storage
25
+ * 默认模板引擎
22
26
  */
23
- declare let storage: IProvider;
27
+ declare let template: ITemplate;
24
28
  /**
25
29
  * 初始化消息对象,保证后续更新能够被同步更新
26
30
  */
@@ -29,4 +33,12 @@ declare let messenger: IMessenger;
29
33
  * 初始化默认驱动实例
30
34
  */
31
35
  declare let initDriver: (options: CreateFeOptions) => Promise<void>;
32
- export { base64, cdn, http, md5, storage, messenger, initDriver, Factories };
36
+ /**
37
+ * 设置好请求器后,才可以设置多语言
38
+ */
39
+ declare let initI18n: () => Promise<void>;
40
+ /**
41
+ * 提取可导出的翻译方法,当i18n实例变化后,导出的方案会跟着变化?
42
+ */
43
+ declare let t: {}, t_exists: {}, t_sys: {}, t_enum: {}, t_field: {}, t_field_choose_placeholder: {}, t_field_placeholder: {}, t_table: {}, t_module: {}, t_menu: {};
44
+ export { base64, cdn, http, i18n, md5, template, messenger, initDriver, initI18n, Factories, t, t_exists, t_sys, t_enum, t_field, t_field_choose_placeholder, t_field_placeholder, t_table, t_module, t_menu };
@@ -18,7 +18,11 @@ declare class JsonHelper {
18
18
  /**
19
19
  * 根据props中的.自动分割得到属性值
20
20
  */
21
- static getValue(value: string, props: string): string;
21
+ static hasKey(value: any, props: string[]): boolean;
22
+ /**
23
+ * 根据props中的.自动分割得到属性值
24
+ */
25
+ static getValue(value: any, props: string[]): any;
22
26
  /**
23
27
  * 把json字符串合并到目标对象上
24
28
  */
@@ -0,0 +1,4 @@
1
+ import { IDriver } from "../drivers";
2
+ interface IRepo extends IDriver {
3
+ }
4
+ export default IRepo;
@@ -0,0 +1,5 @@
1
+ import Factory from "../factorying/Factory";
2
+ import IRepo from "./IRepo";
3
+ declare class RepoFactory extends Factory<IRepo> {
4
+ }
5
+ export default RepoFactory;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 前端配置仓储
3
+ */
4
+ declare class SettingRepo {
5
+ /**
6
+ * 定义支持键访问
7
+ */
8
+ [key: string]: any;
9
+ constructor();
10
+ /**
11
+ * 获取侧边栏宽度
12
+ */
13
+ getSidebarWidth: () => number;
14
+ }
15
+ export default SettingRepo;
@@ -1,3 +1,3 @@
1
- import SettingRepo from "./SettingRepo";
1
+ import SettingRepo from "./implements/SettingRepo";
2
2
  declare let settingRepo: SettingRepo;
3
3
  export { settingRepo };
@@ -17,7 +17,7 @@ declare class I18nSvc {
17
17
  /**
18
18
  * 翻译指定key,不存在使用默认值
19
19
  */
20
- t(key: string, params?: any): any;
20
+ t(key: string, params?: any, display?: string): any;
21
21
  /**
22
22
  * 判断指定key是否存在
23
23
  */
@@ -1,2 +1 @@
1
- import I18nSvc from "./I18nSvc";
2
- export { I18nSvc };
1
+ export {};
@@ -1,4 +1,3 @@
1
- import { I18nSvc } from "./implement";
2
1
  import ConfigSvc from "./implement/ConfigSvc";
3
2
  import EnvSvc from "./implement/EnvSvc";
4
3
  import LogSvc from "./implement/LogSvc";
@@ -29,7 +28,6 @@ declare let driverSvc: {
29
28
  loadEnvs: (reload?: boolean) => Promise<void>;
30
29
  };
31
30
  declare let envSvc: EnvSvc;
32
- declare let i18nSvc: I18nSvc;
33
31
  declare let logSvc: LogSvc;
34
32
  declare let settingSvc: {
35
33
  loaded: boolean;
@@ -65,8 +63,4 @@ declare let userSvc: UserSvc;
65
63
  */
66
64
  declare let initSvc: (options: CreateFeOptions) => Promise<void>;
67
65
  export * from "./implement";
68
- /**
69
- * 提取可导出的翻译方法,当i18nSvc实例变化后,导出的方案会跟着变化?
70
- */
71
- declare let t: (key: string, params?: any) => any, t_exists: (key: any) => any, t_sys: (key: string) => any, t_enum: (name: string, value: string) => any, t_field: (table: string, field: string) => any, t_field_choose_placeholder: (table: string, field: string) => any, t_field_placeholder: (table: string, field: string) => any, t_table: (table: string) => any, t_module: (type: string, key: string) => string, t_menu: (key: string) => any;
72
- export { initSvc, configSvc, driverSvc, envSvc, i18nSvc, logSvc, settingSvc, socketSvc, userSvc, t, t_exists, t_sys, t_enum, t_field, t_field_choose_placeholder, t_field_placeholder, t_table, t_module, t_menu, SvcFactory };
66
+ export { initSvc, configSvc, driverSvc, envSvc, logSvc, settingSvc, socketSvc, userSvc, SvcFactory };
@@ -1,5 +1,4 @@
1
1
  import { IMessenger } from "../drivers";
2
- import I18nSvc from "../svcs/implement/I18nSvc";
3
2
  /**
4
3
  * 初始化选项
5
4
  */
@@ -8,14 +7,16 @@ declare class CreateFeOptions {
8
7
  * 消息发送对象
9
8
  */
10
9
  messenger: IMessenger;
11
- /**
12
- * 实际的多语言翻译服务实体
13
- */
14
- i18nSvc: I18nSvc;
15
10
  /**
16
11
  * 基准请求地址
17
12
  */
18
13
  baseUrl: string;
14
+ /**
15
+ * 自定义语言包
16
+ */
17
+ lang: {
18
+ [key: string]: any;
19
+ };
19
20
  /**
20
21
  * CDN类型
21
22
  */
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 自动保存工具
3
+ * 函数式编程,从而可以让方法被多处使用
4
+ */
5
+ declare class SaveUtility {
6
+ /**
7
+ * 开启表单监控
8
+ */
9
+ open(form: any, store: string, id: string): Promise<void>;
10
+ /**
11
+ * 资源释放
12
+ */
13
+ dispose(): void;
14
+ }
15
+ export default SaveUtility;
@@ -2,5 +2,6 @@ import EventUtility from "./EventUtility";
2
2
  import KeyboardUtility from "./KeyboardUtility";
3
3
  import ListDelta from "./ListDelta";
4
4
  import MouseUtility from "./MouseUtility";
5
+ import SaveUtility from "./SaveUtility";
5
6
  export * from "./types";
6
- export { EventUtility, KeyboardUtility, ListDelta, MouseUtility, };
7
+ export { EventUtility, KeyboardUtility, ListDelta, MouseUtility, SaveUtility };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halo-fe",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Halo front end sdk",
5
5
  "scripts": {
6
6
  "halo-fe:tsc": "vue-tsc",
@@ -29,8 +29,7 @@
29
29
  "registry": "https://registry.npmjs.org"
30
30
  },
31
31
  "peerDependencies": {
32
- "vue": "3.4.37",
33
- "vue-i18n": "9.13.1"
32
+ "vue": "3.4.37"
34
33
  },
35
34
  "dependencies": {
36
35
  "clone": "2.1.2",