halo-fe 1.0.25 → 1.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. package/README.md +3 -1
  2. package/dist/assets/{liquidjs-B8dqQyVv.js → liquidjs-C2HVw1Ra.js} +82 -81
  3. package/dist/main.js +3562 -3070
  4. package/dist/style.css +1 -1
  5. package/esm/coms/@types/PagerEmit.d.ts +11 -0
  6. package/esm/coms/@types/PagerProps.d.ts +18 -0
  7. package/esm/coms/@types/SocketProgressProps.d.ts +16 -0
  8. package/esm/coms/@types/TableEmit.d.ts +10 -0
  9. package/esm/coms/@types/TableProps.d.ts +14 -2
  10. package/esm/coms/@types/index.d.ts +4 -1
  11. package/esm/coms/controls/@types/CodeIntelli.d.ts +6 -0
  12. package/esm/coms/controls/@types/CodeProps.d.ts +31 -2
  13. package/esm/coms/controls/@types/Range.d.ts +1 -1
  14. package/esm/coms/controls/Code.vue.d.ts +15 -25
  15. package/esm/coms/index.d.ts +1 -0
  16. package/esm/coms/layouts/Row.vue.d.ts +7 -2
  17. package/esm/coms/pagers/Index.vue.d.ts +8 -1
  18. package/esm/coms/pagers/index.d.ts +2 -2
  19. package/esm/coms/progresses/Circle.vue.d.ts +2 -0
  20. package/esm/coms/progresses/Index.vue.d.ts +6 -3
  21. package/esm/coms/progresses/Spinner.vue.d.ts +20 -0
  22. package/esm/coms/progresses/index.d.ts +2 -1
  23. package/esm/coms/tables/Index.vue.d.ts +22 -3
  24. package/esm/coms/texts/@types/DanceProps.d.ts +14 -0
  25. package/esm/coms/texts/@types/index.d.ts +2 -0
  26. package/esm/coms/texts/Dance.vue.d.ts +5 -0
  27. package/esm/coms/texts/index.d.ts +2 -0
  28. package/esm/drivers/@types/IOpen.d.ts +1 -1
  29. package/esm/drivers/builders/BuilderFactory.d.ts +1 -1
  30. package/esm/drivers/cdns/Cdn.d.ts +1 -1
  31. package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
  32. package/esm/drivers/cdns/ICdn.d.ts +2 -6
  33. package/esm/drivers/encoders/Encoder.d.ts +1 -1
  34. package/esm/drivers/encoders/EncoderFactory.d.ts +2 -2
  35. package/esm/drivers/encoders/IEncoder.d.ts +2 -5
  36. package/esm/drivers/encoders/implement/Base64Encoder.d.ts +1 -1
  37. package/esm/drivers/excels/Excel.d.ts +1 -1
  38. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  39. package/esm/drivers/excels/implements/XlsxExcel.d.ts +1 -1
  40. package/esm/drivers/explainers/ExplainerFactory.d.ts +2 -2
  41. package/esm/drivers/features/FeatureFactory.d.ts +2 -2
  42. package/esm/drivers/features/IFeature.d.ts +2 -6
  43. package/esm/drivers/features/implements/ExpressionFeature.d.ts +1 -1
  44. package/esm/drivers/features/implements/I18NFeature.d.ts +1 -1
  45. package/esm/drivers/features/implements/SortFeature.d.ts +1 -1
  46. package/esm/drivers/hashers/Hasher.d.ts +1 -1
  47. package/esm/drivers/hashers/HasherFactory.d.ts +2 -2
  48. package/esm/drivers/hashers/IHasher.d.ts +2 -5
  49. package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
  50. package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
  51. package/esm/drivers/https/Http.d.ts +11 -7
  52. package/esm/drivers/https/HttpFactory.d.ts +2 -7
  53. package/esm/drivers/https/IHttp.d.ts +12 -12
  54. package/esm/drivers/https/entities/HttpResponse.d.ts +5 -1
  55. package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
  56. package/esm/drivers/https/implements/FeiShuHttp.d.ts +8 -0
  57. package/esm/drivers/https/implements/HaloHttp.d.ts +1 -1
  58. package/esm/drivers/https/implements/MkHttp.d.ts +1 -1
  59. package/esm/drivers/i18ns/I18n.d.ts +2 -2
  60. package/esm/drivers/i18ns/I18nFactory.d.ts +1 -1
  61. package/esm/drivers/i18ns/II18n.d.ts +1 -1
  62. package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +2 -2
  63. package/esm/drivers/index.d.ts +50 -0
  64. package/esm/drivers/messengers/MessengerFactory.d.ts +2 -2
  65. package/esm/drivers/providers/IProvider.d.ts +19 -15
  66. package/esm/drivers/providers/Provider.d.ts +11 -9
  67. package/esm/drivers/providers/ProviderFactory.d.ts +5 -9
  68. package/esm/drivers/providers/implements/CookieProvider.d.ts +8 -8
  69. package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +20 -10
  70. package/esm/drivers/providers/implements/StorageProvider.d.ts +8 -8
  71. package/esm/drivers/signers/ISigner.d.ts +1 -1
  72. package/esm/drivers/signers/Signer.d.ts +1 -1
  73. package/esm/drivers/signers/SignerFactory.d.ts +2 -2
  74. package/esm/drivers/signers/implements/DefaultSigner.d.ts +1 -1
  75. package/esm/drivers/sockets/@types/SubscribedWindow.d.ts +16 -0
  76. package/esm/drivers/sockets/@types/index.d.ts +2 -0
  77. package/esm/drivers/sockets/ISocket.d.ts +7 -3
  78. package/esm/drivers/sockets/Socket.d.ts +10 -1
  79. package/esm/drivers/sockets/SocketFactory.d.ts +1 -1
  80. package/esm/drivers/sockets/entities/SocketProgress.d.ts +34 -0
  81. package/esm/drivers/sockets/entities/SocketResponse.d.ts +42 -0
  82. package/esm/drivers/sockets/entities/index.d.ts +3 -0
  83. package/esm/drivers/sockets/implement/DefaultSocket.d.ts +0 -2
  84. package/esm/drivers/sockets/index.d.ts +3 -1
  85. package/esm/drivers/ssos/ISso.d.ts +1 -1
  86. package/esm/drivers/ssos/Sso.d.ts +1 -1
  87. package/esm/drivers/ssos/SsoFactory.d.ts +2 -2
  88. package/esm/drivers/ssos/implements/AnonymousSso.d.ts +1 -1
  89. package/esm/drivers/ssos/implements/BearerSso.d.ts +1 -1
  90. package/esm/drivers/ssos/implements/NioSso.d.ts +1 -1
  91. package/esm/drivers/ssos/implements/SecretSso.d.ts +1 -1
  92. package/esm/drivers/ssos/implements/WeiXinSso.d.ts +1 -1
  93. package/esm/drivers/tasks/ITask.d.ts +7 -3
  94. package/esm/drivers/tasks/Task.d.ts +2 -1
  95. package/esm/drivers/tasks/TaskFactory.d.ts +2 -2
  96. package/esm/drivers/tasks/implement/MemoryTask.d.ts +5 -3
  97. package/esm/drivers/templates/ITemplate.d.ts +1 -1
  98. package/esm/drivers/templates/Template.d.ts +1 -1
  99. package/esm/drivers/templates/TemplateFactory.d.ts +2 -2
  100. package/esm/drivers/templates/implement/LiquidTemplate.d.ts +1 -1
  101. package/esm/drivers/util/UtilFactory.d.ts +1 -1
  102. package/esm/drivers/util/implements/ArrayUtil.d.ts +5 -5
  103. package/esm/drivers/util/implements/EventUtil.d.ts +6 -6
  104. package/esm/drivers/util/implements/JsonUtil.d.ts +5 -0
  105. package/esm/drivers/util/implements/ObjectUtil.d.ts +1 -1
  106. package/esm/drivers/util/implements/SignUtil.d.ts +1 -1
  107. package/esm/drivers/util/implements/StringUtil.d.ts +1 -1
  108. package/esm/drivers/util/implements/TimeUtil.d.ts +1 -1
  109. package/esm/drivers/utilities/IUtility.d.ts +3 -0
  110. package/esm/drivers/utilities/Utility.d.ts +3 -0
  111. package/esm/drivers/utilities/UtilityFactory.d.ts +6 -6
  112. package/esm/drivers/utilities/implement/EventUtility.d.ts +3 -6
  113. package/esm/drivers/utilities/implement/SaveUtility.d.ts +48 -3
  114. package/esm/drivers/videos/VideoFactory.d.ts +2 -2
  115. package/esm/drivers/voices/VoiceFactory.d.ts +2 -2
  116. package/esm/factory/Factories.d.ts +99 -0
  117. package/esm/factory/Factory.d.ts +41 -0
  118. package/esm/factory/IFactory.d.ts +40 -0
  119. package/esm/factory/Utils.d.ts +29 -0
  120. package/esm/factory/index.d.ts +4 -0
  121. package/esm/factorying/Factory.d.ts +3 -3
  122. package/esm/factorying/IFactory.d.ts +1 -1
  123. package/esm/main.d.ts +1 -2
  124. package/esm/repos/Repo.d.ts +5 -0
  125. package/esm/repos/RepoFactory.d.ts +20 -1
  126. package/esm/repos/entities/KeyboardType.d.ts +8 -0
  127. package/esm/repos/entities/index.d.ts +2 -0
  128. package/esm/repos/implements/ModuleRepo.d.ts +36 -0
  129. package/esm/repos/implements/PageRepo.d.ts +30 -0
  130. package/esm/repos/implements/QueryRepo.d.ts +64 -0
  131. package/esm/repos/implements/SettingRepo.d.ts +1 -0
  132. package/esm/repos/index.d.ts +11 -1
  133. package/esm/svcs/SvcFactory.d.ts +1 -1
  134. package/esm/svcs/implement/ConfigSvc.d.ts +9 -9
  135. package/esm/svcs/implement/DriverSvc.d.ts +1 -35
  136. package/esm/svcs/index.d.ts +6 -15
  137. package/package.json +9 -9
@@ -16,11 +16,15 @@ interface ISocket extends IDriver, IOpen {
16
16
  */
17
17
  connect(): Promise<void>;
18
18
  /**
19
- * 订阅并替换Socket事件处理程序
19
+ * 订阅多个消息类型,并缓存到订阅池
20
20
  */
21
- subscribe(win: string, kind: string, type: string): Promise<any>;
21
+ subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
22
22
  /**
23
- * 取消订阅Socket事件处理程序,防止内存泄漏
23
+ * 重连时,重新订阅
24
+ */
25
+ resubscribe(): Promise<void>;
26
+ /**
27
+ * 取消订阅该窗口 所有Socket事件处理程序,防止内存泄漏
24
28
  */
25
29
  unsubscribe(win: string): Promise<any>;
26
30
  /**
@@ -1,8 +1,17 @@
1
1
  import ISocket from "./ISocket";
2
+ import { SubscribedWindow } from "./@types";
2
3
  /**
3
4
  * Socket基类
4
5
  */
5
6
  declare class Socket implements ISocket {
6
- open(conn?: string): Promise<void>;
7
+ /**
8
+ * 已订阅的消息类型列表
9
+ */
10
+ subscribed: SubscribedWindow;
11
+ openAsync(conn?: string): Promise<void>;
12
+ subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
13
+ resubscribe(): Promise<void>;
14
+ unsubscribe(win: string): Promise<any>;
15
+ abstract send(data: any): void;
7
16
  }
8
17
  export default Socket;
@@ -1,4 +1,4 @@
1
- import { Factory } from "../../factorying";
1
+ import Factory from "../../factory/Factory";
2
2
  import ISocket from "./ISocket";
3
3
  /**
4
4
  * Socket工厂
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Socket进度消息
3
+ */
4
+ declare class SocketProgress<T> {
5
+ /**
6
+ * 成功数量
7
+ */
8
+ succeed: number;
9
+ /**
10
+ * 异常数量
11
+ */
12
+ errored: number;
13
+ /**
14
+ * 已处理数量
15
+ */
16
+ handled: number;
17
+ /**
18
+ * 总数量
19
+ */
20
+ total: number;
21
+ /**
22
+ * 当前消息体
23
+ */
24
+ current: T;
25
+ /**
26
+ * 增加成功进度
27
+ */
28
+ success(current: T): void;
29
+ /**
30
+ * 增加异常进度
31
+ */
32
+ error(current: T, message: string): void;
33
+ }
34
+ export default SocketProgress;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Socket响应消息
3
+ */
4
+ declare class SocketResponse<T> {
5
+ /**
6
+ * 是否执行成功
7
+ */
8
+ ok: boolean;
9
+ /**
10
+ * 异常消息
11
+ */
12
+ message: string;
13
+ /**
14
+ * 耗时
15
+ */
16
+ elapsed: number;
17
+ /**
18
+ * 消息类别
19
+ */
20
+ kind: string;
21
+ /**
22
+ * 消息类型
23
+ */
24
+ type: string;
25
+ /**
26
+ * 数据体
27
+ */
28
+ data: T;
29
+ /**
30
+ * 初始化并设置数据
31
+ */
32
+ constructor(kind: string, type: string, data: T);
33
+ /**
34
+ * 成功输出
35
+ */
36
+ onOk(message?: string): void;
37
+ /**
38
+ * 异常输出
39
+ */
40
+ onError(message: string): void;
41
+ }
42
+ export default SocketResponse;
@@ -0,0 +1,3 @@
1
+ import SocketProgress from "./SocketProgress";
2
+ import SocketResponse from "./SocketResponse";
3
+ export { SocketProgress, SocketResponse, };
@@ -25,8 +25,6 @@ declare class DefaultSocket extends Socket {
25
25
  */
26
26
  handler: (event: MessageEvent) => void;
27
27
  connect(): Promise<void>;
28
- subscribe(win: string, kind: string, type: string): Promise<any>;
29
- unsubscribe(win: string): Promise<any>;
30
28
  /**
31
29
  * 发送消息
32
30
  */
@@ -1,2 +1,4 @@
1
+ import ISocket from "./ISocket";
1
2
  import SocketFactory from "./SocketFactory";
2
- export { SocketFactory };
3
+ export * from "./entities";
4
+ export { type ISocket, SocketFactory };
@@ -7,7 +7,7 @@ interface ISso extends IDriver {
7
7
  /**
8
8
  * 开启连接
9
9
  */
10
- open(auth: {
10
+ openAsync(auth: {
11
11
  url: string;
12
12
  app_id: string;
13
13
  }): Promise<void>;
@@ -5,7 +5,7 @@ import SsoUser from "./entities/SsoUser";
5
5
  */
6
6
  declare abstract class Sso implements ISso {
7
7
  type: string;
8
- abstract open(auth: {
8
+ abstract openAsync(auth: {
9
9
  url: string;
10
10
  app_id: string;
11
11
  }): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import ISso from "./ISso";
2
- import Factory from "../../factorying/Factory";
2
+ import Factory from "../../factory/Factory";
3
3
  /**
4
4
  * SSO工厂类
5
5
  */
@@ -7,7 +7,7 @@ declare class SsoFactory extends Factory<ISso> {
7
7
  /**
8
8
  * 获取实例
9
9
  */
10
- get instances(): ISso[];
10
+ open(): void;
11
11
  /**
12
12
  * 获取指定SSO实例
13
13
  */
@@ -7,7 +7,7 @@ declare class AnonymousSso extends Sso {
7
7
  * 数据库提供程序
8
8
  */
9
9
  provider: IProvider;
10
- open(auth: {
10
+ openAsync(auth: {
11
11
  url: string;
12
12
  app_id: string;
13
13
  }): Promise<void>;
@@ -10,7 +10,7 @@ declare class BearerSso implements Sso {
10
10
  * 数据库提供程序
11
11
  */
12
12
  provider: IProvider;
13
- open(auth: {
13
+ openAsync(auth: {
14
14
  url: string;
15
15
  app_id: string;
16
16
  }): Promise<void>;
@@ -12,7 +12,7 @@ declare class NioSso implements ISso {
12
12
  * 数据库提供程序
13
13
  */
14
14
  provider: IProvider;
15
- open(auth: {
15
+ openAsync(auth: {
16
16
  url: string;
17
17
  app_id: string;
18
18
  }): Promise<void>;
@@ -7,7 +7,7 @@ declare class SecretSso implements ISso {
7
7
  * 数据库提供程序
8
8
  */
9
9
  provider: IProvider;
10
- open(auth: {
10
+ openAsync(auth: {
11
11
  url: string;
12
12
  app_id: string;
13
13
  }): Promise<void>;
@@ -5,7 +5,7 @@ import SsoUser from "../entities/SsoUser";
5
5
  */
6
6
  declare class WeiXinSso implements ISso {
7
7
  type: string;
8
- open(auth: {
8
+ openAsync(auth: {
9
9
  url: string;
10
10
  }): Promise<void>;
11
11
  login(form: any): Promise<any>;
@@ -14,14 +14,18 @@ interface ITask extends IDriver, IDispose {
14
14
  /**
15
15
  * 按照频控去执行任务
16
16
  */
17
- executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
17
+ frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
18
18
  /**
19
19
  * 按照并发数量控制多个任务执行
20
20
  * handler不能直接放置promise,因为promise被传递前的实例化过程就会执行内部方法
21
- * 场景:通过并发数为1,来控制不通类库,在并发加载时,define函数冲突问题
21
+ * 场景:通过并发数为1,控制不通类库在并发加载时,define函数冲突问题
22
22
  * 注意:是相同时间的并发数控制,不是1s内的并发数控制
23
23
  */
24
- concurrent<T>(handler: () => Promise<T>): Promise<T>;
24
+ concurrent<T>(handler: () => Promise<T>, limit?: number): Promise<T>;
25
+ /**
26
+ * 事件防抖: time ms没重复触发才执行指定操作
27
+ */
28
+ debounce(fn: (args: any) => Promise<void>, time: number, args?: any): void;
25
29
  /**
26
30
  * 每间隔指定时间执行指定任务
27
31
  */
@@ -6,8 +6,9 @@ declare abstract class Task implements ITask {
6
6
  type: string;
7
7
  taskLimit: number;
8
8
  abstract execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
- abstract executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
+ abstract frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
10
10
  abstract concurrent<T>(handler: () => Promise<T>): Promise<T>;
11
+ abstract debounce(fn: (args: any) => Promise<void>, time: number, args?: any): void;
11
12
  abstract interval(ms: number, task: () => void): void;
12
13
  abstract dispose(): void;
13
14
  }
@@ -1,9 +1,9 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import ITask from "./ITask";
3
3
  /**
4
4
  * 任务工厂类
5
5
  */
6
6
  declare class TaskFactory extends Factory<ITask> {
7
- get instances(): ITask[];
7
+ open(): void;
8
8
  }
9
9
  export default TaskFactory;
@@ -6,22 +6,24 @@ declare class MemoryTask extends Task {
6
6
  type: string;
7
7
  intervalTimeout: any;
8
8
  execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
- executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
+ frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
10
10
  /**
11
11
  * 待执行的任务队列
12
12
  */
13
13
  tasks: (() => Promise<any>)[];
14
- taskLimit: number;
15
14
  taskExecuting: number;
16
15
  taskResolves: ((value: any) => void)[];
17
16
  /**
18
17
  * 相同时间的并发数控制,不是1s内的并发数控制
19
18
  */
20
- concurrent<T>(handler: () => Promise<T>): Promise<T>;
19
+ concurrent<T>(handler: () => Promise<T>, limit?: number): Promise<T>;
21
20
  /**
22
21
  * 按照并发执行
23
22
  */
24
23
  private run;
24
+ lastDebounceTime: number;
25
+ lastDebounceTimeout: any;
26
+ debounce: (fn: (args: any) => Promise<void>, time: number, args?: any) => void;
25
27
  interval(ms: number, task: () => void): void;
26
28
  dispose(): void;
27
29
  }
@@ -6,6 +6,6 @@ interface ITemplate extends IDriver {
6
6
  /**
7
7
  * 模板渲染
8
8
  */
9
- render(template: string, model: any): Promise<string>;
9
+ renderAsync(template: string, model: any): Promise<string>;
10
10
  }
11
11
  export default ITemplate;
@@ -1,6 +1,6 @@
1
1
  import ITemplate from "./ITemplate";
2
2
  declare abstract class Template implements ITemplate {
3
3
  type: string;
4
- abstract render(template: string, model: any): Promise<string>;
4
+ abstract renderAsync(template: string, model: any): Promise<string>;
5
5
  }
6
6
  export default Template;
@@ -1,9 +1,9 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import ITemplate from "./ITemplate";
3
3
  /**
4
4
  * 模板工厂
5
5
  */
6
6
  declare class TemplateFactory extends Factory<ITemplate> {
7
- get instances(): ITemplate[];
7
+ open(): void;
8
8
  }
9
9
  export default TemplateFactory;
@@ -1,6 +1,6 @@
1
1
  import Template from "../Template";
2
2
  declare class LiquidTemplate extends Template {
3
3
  type: string;
4
- render(template: string, model: any): Promise<string>;
4
+ renderAsync(template: string, model: any): Promise<string>;
5
5
  }
6
6
  export default LiquidTemplate;
@@ -1,4 +1,4 @@
1
- import { Factory } from "../../factorying";
1
+ import Factory from "../../factory/Factory";
2
2
  import IUtil from "./IUtil";
3
3
  import { ArrayUtil, BrowserUtil, ComponentUtil, DictionaryUtil, DomUtil, EventUtil, FileUtil, HtmlUtil, ImageUtil, JsonUtil, MathUtil, MicroUtil, MountUtil, ObjectUtil, ScrollUtil, SignUtil, StringUtil, TaskUtil, TimeUtil, TreeUtil, TypeUtil, UrlUtil } from "./";
4
4
  /**
@@ -31,19 +31,19 @@ declare class ArrayUtil extends Util {
31
31
  /**
32
32
  * 求最大值,数据类型的比较函数要自己转换为数值类型
33
33
  */
34
- max: (entities: any[], func: Function) => any;
34
+ max: (entities: any[], fn: Function) => any;
35
35
  /**
36
36
  * 求最小值,数据类型的比较函数要自己转换为数值类型
37
37
  */
38
- min: (entities: any[], func: Function) => any;
38
+ min: (entities: any[], fn: Function) => any;
39
39
  /**
40
40
  * 求平均值
41
41
  */
42
- avg: (entities: any[], func: Function, digits?: number) => number;
42
+ avg: (entities: any[], fn: Function, digits?: number) => number;
43
43
  /**
44
44
  * 求和
45
45
  */
46
- sum: (entities: any[], func: Function, digits?: number) => number;
46
+ sum: (entities: any[], fn: Function, digits?: number) => number;
47
47
  /**
48
48
  * 是否包含
49
49
  */
@@ -114,7 +114,7 @@ declare class ArrayUtil extends Util {
114
114
  /**
115
115
  * 分组
116
116
  */
117
- groupByArray: (entities: any[], keyFunc: (item: any) => any) => any[];
117
+ groupByArray: (entities: any[], keyFn: (item: any) => any) => any[];
118
118
  /**
119
119
  * 替换指定元素为新元素,不存在则添加
120
120
  */
@@ -7,26 +7,26 @@ declare class EventUtil extends Util {
7
7
  /**
8
8
  * 批量绑定事件,执行指定处理函数
9
9
  */
10
- bind: (events: any[], dom: any, func: Function) => void;
10
+ bind: (events: any[], dom: any, fn: Function) => void;
11
11
  /**
12
12
  * 批量绑定事件,执行指定处理函数
13
13
  */
14
- unbind: (events: any[], dom: any, func: Function) => void;
14
+ unbind: (events: any[], dom: any, fn: Function) => void;
15
15
  /**
16
16
  * 绑定点击处理函数
17
17
  */
18
- click: (dom: any, func: Function) => void;
18
+ click: (dom: any, fn: Function) => void;
19
19
  /**
20
20
  * 解除点击监听
21
21
  */
22
- unclick: (dom: any, func: Function) => void;
22
+ unclick: (dom: any, fn: Function) => void;
23
23
  /**
24
24
  * 绑定滚动处理函数
25
25
  */
26
- scroll: (dom: any, func: Function) => void;
26
+ scroll: (dom: any, fn: Function) => void;
27
27
  /**
28
28
  * 移除滚动处理函数,防止内存泄漏
29
29
  */
30
- unscroll: (dom: any, func: Function) => void;
30
+ unscroll: (dom: any, fn: Function) => void;
31
31
  }
32
32
  export default EventUtil;
@@ -13,6 +13,11 @@ declare class JsonUtil extends Util {
13
13
  * 把对象格式化为Json字符串
14
14
  */
15
15
  serialize(value: any, config?: boolean | JsonConfig): string;
16
+ /**
17
+ * 自动移除注释,并反序列化
18
+ * 支持自动去除// 和 \/**\/注释
19
+ */
20
+ autoDeserialize(value: string): any;
16
21
  /**
17
22
  * 反序列化成json对象
18
23
  */
@@ -5,7 +5,7 @@ import Util from "../Util";
5
5
  declare class ObjectUtil extends Util {
6
6
  type: string;
7
7
  /**
8
- * 净化对象,返回不带默认属性的对象
8
+ * 净化对象,只清除默认值属性
9
9
  */
10
10
  pure(input: object): {};
11
11
  /**
@@ -11,6 +11,6 @@ declare class SignUtil extends Util {
11
11
  /**
12
12
  * 签名字典
13
13
  */
14
- signDictionary(dictionary: object, encoding?: boolean): any;
14
+ signDictionary(dictionary: object, encoding?: boolean): string;
15
15
  }
16
16
  export default SignUtil;
@@ -55,7 +55,7 @@ declare class StringUtil extends Util {
55
55
  /**
56
56
  * 判断是否是json
57
57
  */
58
- isJson: (value: string) => any;
58
+ isJson: (value: string) => boolean;
59
59
  /**
60
60
  * 判断是否是isJsonp
61
61
  */
@@ -35,7 +35,7 @@ declare class TimeUtil extends Util {
35
35
  /**
36
36
  * 格式化时间
37
37
  */
38
- formatDateTime: (value: number) => string;
38
+ formatDateTime: (value: any) => string;
39
39
  /**
40
40
  * 获取当前日期时间的字符串
41
41
  */
@@ -1,4 +1,7 @@
1
1
  import { IDriver } from "../@types";
2
+ /**
3
+ * 工具类接口
4
+ */
2
5
  interface IUtility extends IDriver {
3
6
  }
4
7
  export default IUtility;
@@ -1,4 +1,7 @@
1
1
  import IUtility from "./IUtility";
2
+ /**
3
+ * 工具类基类
4
+ */
2
5
  declare abstract class Utility implements IUtility {
3
6
  type: string;
4
7
  }
@@ -1,4 +1,4 @@
1
- import { Factory } from "../../factorying";
1
+ import Factory from "../../factory/Factory";
2
2
  import IUtility from "./IUtility";
3
3
  import AffixUtility from "./implement/AffixUtility";
4
4
  import DeltaUtility from "./implement/DeltaUtility";
@@ -20,23 +20,23 @@ declare class UtilityFactory extends Factory<IUtility> {
20
20
  */
21
21
  delta(): DeltaUtility;
22
22
  /**
23
- * 创建固定工具
23
+ * 创建事件工具
24
24
  */
25
25
  event(): EventUtility;
26
26
  /**
27
- * 键盘工具
27
+ * 创建键盘工具
28
28
  */
29
29
  keyboard(): KeyboardUtility;
30
30
  /**
31
- * 鼠标工具
31
+ * 创建鼠标工具
32
32
  */
33
33
  mouse(container: HTMLElement, closeTriggers?: any[]): MouseUtility;
34
34
  /**
35
- * 随机工具
35
+ * 创建随机工具
36
36
  */
37
37
  random(): RandomUtility;
38
38
  /**
39
- * 随机工具
39
+ * 创建保存工具
40
40
  */
41
41
  save(): SaveUtility;
42
42
  }
@@ -1,9 +1,12 @@
1
1
  import { DragOptions } from "../@types";
2
+ import { ITask } from "../../tasks";
2
3
  import Utility from "../Utility";
3
4
  /**
4
5
  * 事件工具类
5
6
  */
6
7
  declare class EventUtility extends Utility {
8
+ constructor();
9
+ resizeTask: ITask;
7
10
  resizeObserver: ResizeObserver;
8
11
  element: Element;
9
12
  resizeHandler: any;
@@ -44,12 +47,6 @@ declare class EventUtility extends Utility {
44
47
  * 鼠标按下
45
48
  */
46
49
  mouseDown(element: Element, mouseDown: (event: MouseEvent) => void, mouseUp: (event: MouseEvent) => void): void;
47
- lastDebounceTime: number;
48
- lastDebounceTimeout: any;
49
- /**
50
- * 事件防抖: time ms没重复触发才执行指定操作
51
- */
52
- debounce: (func: (args: any) => void, time: number, args?: any) => void;
53
50
  dispatchElement: HTMLElement;
54
51
  /**
55
52
  * 创建分发事件元素
@@ -1,16 +1,61 @@
1
1
  import Utility from "../Utility";
2
+ import { ITask } from "../../tasks";
3
+ import { IProvider } from "../../providers";
2
4
  /**
3
5
  * 自动保存工具
4
6
  * 函数式编程,从而可以让方法被多处使用
5
7
  */
6
8
  declare class SaveUtility extends Utility {
9
+ /**
10
+ * 已开启窗口
11
+ * 使用静态对象记录各自工具类开启的窗口,保证同一个kind工具类,被窗口多开时,能够杜绝异步方法导致的变量不一致问题
12
+ */
13
+ static opened: {
14
+ [kind: string]: string[];
15
+ };
16
+ /**
17
+ * 任务实例,用于控制任务并发
18
+ */
19
+ task: ITask;
20
+ /**
21
+ * 数据库驱动
22
+ */
23
+ provider: IProvider;
24
+ /**
25
+ * 内容类别标识
26
+ */
27
+ kind: string;
28
+ /**
29
+ * 实际对应的数据主键
30
+ */
31
+ key: string;
32
+ /**
33
+ * 最新表单
34
+ */
35
+ form: any;
36
+ /**
37
+ * 待删除的主键
38
+ */
39
+ oldKey: string;
40
+ /**
41
+ * 变动实际处理程序
42
+ */
43
+ handler: (val: any, oldVal: any) => Promise<void>;
7
44
  /**
8
45
  * 开启表单监控
9
46
  */
10
- open(form: any, store: string, id: string): Promise<void>;
47
+ openAsync(kind: string, key: string, form: any): Promise<IProvider>;
48
+ /**
49
+ * 内容变动监听程序
50
+ */
51
+ set changeHandler<T>(value: (val: T, oldVal: T) => Promise<void>);
52
+ /**
53
+ * 手动保存
54
+ */
55
+ saveAsync(form: any): Promise<void>;
11
56
  /**
12
- * 资源释放
57
+ * VIP:资源释放
13
58
  */
14
- dispose(): void;
59
+ dispose(dispose?: boolean): Promise<void>;
15
60
  }
16
61
  export default SaveUtility;
@@ -1,6 +1,6 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import IVideo from "./IVideo";
3
3
  declare class VideoFactory extends Factory<IVideo> {
4
- get instances(): IVideo[];
4
+ open(): void;
5
5
  }
6
6
  export default VideoFactory;
@@ -1,6 +1,6 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import { IVoice } from "./IVoice";
3
3
  declare class VoiceFactory extends Factory<IVoice> {
4
- get instances(): IVoice[];
4
+ open(): void;
5
5
  }
6
6
  export default VoiceFactory;