halo-fe 1.0.23 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. package/dist/assets/{liquidjs-C-LVcoaY.js → liquidjs-B8dqQyVv.js} +639 -632
  2. package/dist/main.js +4365 -4206
  3. package/dist/style.css +1 -1
  4. package/esm/@types/CreateFeOptions.d.ts +4 -0
  5. package/esm/coms/@types/SocketProgressProps.d.ts +23 -0
  6. package/esm/coms/@types/TabProps.d.ts +11 -0
  7. package/esm/coms/@types/TableProps.d.ts +22 -0
  8. package/esm/coms/@types/index.d.ts +4 -1
  9. package/esm/coms/Empty.vue.d.ts +11 -7
  10. package/esm/coms/Fill.vue.d.ts +11 -4
  11. package/esm/coms/Scroller.vue.d.ts +16 -15
  12. package/esm/coms/Timer.vue.d.ts +9 -4
  13. package/esm/coms/{Col.vue.d.ts → cards/Index.vue.d.ts} +8 -3
  14. package/esm/coms/cards/index.d.ts +2 -0
  15. package/esm/coms/conditions/Condition.vue.d.ts +1 -10
  16. package/esm/coms/conditions/Index.vue.d.ts +1 -10
  17. package/esm/coms/controls/Code.vue.d.ts +15 -15
  18. package/esm/coms/controls/Compare.vue.d.ts +5 -5
  19. package/esm/coms/controls/Input.vue.d.ts +2 -0
  20. package/esm/coms/controls/Option.vue.d.ts +1 -1
  21. package/esm/coms/controls/RichText.vue.d.ts +4 -15
  22. package/esm/coms/controls/Select.vue.d.ts +1 -1
  23. package/esm/coms/controls/index.d.ts +2 -1
  24. package/esm/coms/index.d.ts +1 -0
  25. package/esm/coms/layouts/Col.vue.d.ts +8 -3
  26. package/esm/coms/layouts/Container.vue.d.ts +11 -6
  27. package/esm/coms/layouts/Desc.vue.d.ts +2 -0
  28. package/esm/coms/layouts/Row.vue.d.ts +8 -13
  29. package/esm/coms/pagers/Index.vue.d.ts +2 -0
  30. package/esm/coms/pagers/index.d.ts +2 -0
  31. package/esm/coms/progresses/Index.vue.d.ts +6 -0
  32. package/esm/coms/progresses/Progress.vue.d.ts +4 -16
  33. package/esm/coms/progresses/SocketProgress.vue.d.ts +9 -13
  34. package/esm/coms/progresses/index.d.ts +1 -1
  35. package/esm/coms/tables/Index.vue.d.ts +14 -0
  36. package/esm/coms/tables/Table.vue.d.ts +1 -1
  37. package/esm/coms/tabs/Tab.vue.d.ts +2 -11
  38. package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
  39. package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
  40. package/esm/drivers/builders/types/index.d.ts +2 -0
  41. package/esm/drivers/cdns/Cdn.d.ts +6 -8
  42. package/esm/drivers/cdns/ICdn.d.ts +0 -5
  43. package/esm/drivers/encoders/EncoderFactory.d.ts +1 -0
  44. package/esm/drivers/encoders/implement/UrlEncoder.d.ts +7 -0
  45. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  46. package/esm/drivers/helpers/implements/ArrayHelper.d.ts +1 -2
  47. package/esm/drivers/helpers/implements/DomHelper.d.ts +1 -1
  48. package/esm/drivers/https/Http.d.ts +13 -2
  49. package/esm/drivers/https/IHttp.d.ts +4 -0
  50. package/esm/drivers/https/entities/HttpModel.d.ts +12 -0
  51. package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
  52. package/esm/drivers/https/implements/HaloHttp.d.ts +1 -9
  53. package/esm/drivers/https/implements/MkHttp.d.ts +1 -2
  54. package/esm/drivers/index.d.ts +3 -1
  55. package/esm/drivers/sockets/ISocket.d.ts +35 -0
  56. package/esm/drivers/sockets/Socket.d.ts +8 -0
  57. package/esm/drivers/sockets/SocketFactory.d.ts +13 -0
  58. package/esm/drivers/sockets/implement/DefaultSocket.d.ts +39 -0
  59. package/esm/drivers/sockets/index.d.ts +2 -0
  60. package/esm/drivers/tasks/ITask.d.ts +3 -0
  61. package/esm/drivers/util/@types/JsonConfig.d.ts +10 -0
  62. package/esm/drivers/util/@types/TreeNodeProp.d.ts +9 -0
  63. package/esm/drivers/util/@types/index.d.ts +3 -0
  64. package/esm/drivers/util/IUtil.d.ts +8 -0
  65. package/esm/drivers/util/Util.d.ts +8 -0
  66. package/esm/drivers/util/UtilFactory.d.ts +32 -0
  67. package/esm/drivers/util/implements/ArrayUtil.d.ts +123 -0
  68. package/esm/drivers/util/implements/BrowserUtil.d.ts +12 -0
  69. package/esm/drivers/util/implements/ComponentUtil.d.ts +20 -0
  70. package/esm/drivers/util/implements/DictionaryUtil.d.ts +40 -0
  71. package/esm/drivers/util/implements/DomUtil.d.ts +118 -0
  72. package/esm/drivers/util/implements/EventUtil.d.ts +32 -0
  73. package/esm/drivers/util/implements/FileUtil.d.ts +24 -0
  74. package/esm/drivers/util/implements/HtmlUtil.d.ts +16 -0
  75. package/esm/drivers/util/implements/ImageUtil.d.ts +12 -0
  76. package/esm/drivers/util/implements/JsonUtil.d.ts +53 -0
  77. package/esm/drivers/util/implements/MathUtil.d.ts +52 -0
  78. package/esm/drivers/util/implements/MicroUtil.d.ts +12 -0
  79. package/esm/drivers/util/implements/MountUtil.d.ts +16 -0
  80. package/esm/drivers/util/implements/ObjectUtil.d.ts +44 -0
  81. package/esm/drivers/util/implements/ScrollUtil.d.ts +16 -0
  82. package/esm/drivers/util/implements/SignUtil.d.ts +16 -0
  83. package/esm/drivers/util/implements/StringUtil.d.ts +104 -0
  84. package/esm/drivers/util/implements/TaskUtil.d.ts +28 -0
  85. package/esm/{helpers/time-helper.d.ts → drivers/util/implements/TimeUtil.d.ts} +30 -24
  86. package/esm/drivers/util/implements/TreeUtil.d.ts +56 -0
  87. package/esm/{helpers/type-helper.d.ts → drivers/util/implements/TypeUtil.d.ts} +9 -7
  88. package/esm/{helpers/url-helper.d.ts → drivers/util/implements/UrlUtil.d.ts} +23 -29
  89. package/esm/drivers/util/index.d.ts +24 -0
  90. package/esm/drivers/utilities/@types/DragEvent.d.ts +11 -0
  91. package/esm/drivers/utilities/@types/DragOptions.d.ts +28 -0
  92. package/esm/drivers/utilities/@types/Position.d.ts +15 -0
  93. package/esm/drivers/utilities/@types/Rect.d.ts +10 -0
  94. package/esm/drivers/utilities/@types/index.d.ts +5 -0
  95. package/esm/drivers/utilities/IUtility.d.ts +4 -0
  96. package/esm/drivers/utilities/Utility.d.ts +5 -0
  97. package/esm/drivers/utilities/UtilityFactory.d.ts +43 -0
  98. package/esm/drivers/utilities/implement/AffixUtility.d.ts +11 -0
  99. package/esm/drivers/utilities/implement/DeltaUtility.d.ts +11 -0
  100. package/esm/drivers/utilities/implement/EventUtility.d.ts +73 -0
  101. package/esm/drivers/utilities/implement/KeyboardUtility.d.ts +74 -0
  102. package/esm/drivers/utilities/implement/MouseUtility.d.ts +25 -0
  103. package/esm/drivers/utilities/implement/RandomUtility.d.ts +41 -0
  104. package/esm/drivers/utilities/implement/SaveUtility.d.ts +16 -0
  105. package/esm/drivers/utilities/index.d.ts +9 -0
  106. package/esm/factorying/Factories.d.ts +13 -5
  107. package/esm/factorying/Factory.d.ts +4 -7
  108. package/esm/factorying/{Helpers.d.ts → Helps.d.ts} +2 -2
  109. package/esm/factorying/IFactory.d.ts +6 -2
  110. package/esm/factorying/Utils.d.ts +29 -0
  111. package/esm/factorying/index.d.ts +7 -2
  112. package/esm/helpers/DictionaryHelper.d.ts +6 -0
  113. package/esm/main.d.ts +1 -1
  114. package/esm/svcs/@types/Dictionary.d.ts +4 -0
  115. package/esm/svcs/implement/ConfigSvc.d.ts +1 -1
  116. package/esm/svcs/implement/DriverSvc.d.ts +4 -0
  117. package/esm/svcs/implement/I18nSvc.d.ts +1 -1
  118. package/esm/svcs/index.d.ts +2 -3
  119. package/esm/utilities/MathUtility.d.ts +35 -0
  120. package/package.json +9 -9
  121. package/esm/coms/Code.vue.d.ts +0 -41
  122. package/esm/coms/Compare.vue.d.ts +0 -40
  123. package/esm/coms/Container.vue.d.ts +0 -23
  124. package/esm/coms/RichText.vue.d.ts +0 -24
  125. package/esm/coms/Row.vue.d.ts +0 -21
  126. package/esm/coms/types/CodeEmit.d.ts +0 -23
  127. package/esm/coms/types/CodeProps.d.ts +0 -18
  128. package/esm/coms/types/RichTextOptions.d.ts +0 -14
  129. package/esm/coms/types/RichTextProps.d.ts +0 -12
  130. package/esm/coms/types/RowProps.d.ts +0 -14
  131. package/esm/drivers/IDriver.d.ts +0 -10
  132. package/esm/drivers/cdns/implements/BootCdn.d.ts +0 -12
  133. package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +0 -15
  134. package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +0 -21
  135. package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +0 -12
  136. package/esm/drivers/factories/DriverFactory.d.ts +0 -64
  137. package/esm/drivers/factories/Factory.d.ts +0 -18
  138. package/esm/drivers/factories/IFactory.d.ts +0 -18
  139. package/esm/drivers/factories/index.d.ts +0 -42
  140. package/esm/drivers/providers/implements/StorageHelper.d.ts +0 -34
  141. package/esm/helpers/ScriptHelper.d.ts +0 -19
  142. package/esm/helpers/array-helper.d.ts +0 -97
  143. package/esm/helpers/component-helper.d.ts +0 -18
  144. package/esm/helpers/cookie-helper.d.ts +0 -6
  145. package/esm/helpers/dictionary-helper.d.ts +0 -18
  146. package/esm/helpers/dom-helper.d.ts +0 -86
  147. package/esm/helpers/event-helper.d.ts +0 -30
  148. package/esm/helpers/file-helper.d.ts +0 -22
  149. package/esm/helpers/html-helper.d.ts +0 -10
  150. package/esm/helpers/i18n-helper.d.ts +0 -14
  151. package/esm/helpers/image-helper.d.ts +0 -10
  152. package/esm/helpers/json-helper.d.ts +0 -39
  153. package/esm/helpers/math-helper.d.ts +0 -46
  154. package/esm/helpers/micro-helper.d.ts +0 -10
  155. package/esm/helpers/mount-helper.d.ts +0 -14
  156. package/esm/helpers/object-helper.d.ts +0 -38
  157. package/esm/helpers/script-helper.d.ts +0 -31
  158. package/esm/helpers/scroll-helper.d.ts +0 -14
  159. package/esm/helpers/sign-helper.d.ts +0 -14
  160. package/esm/helpers/storage-helper.d.ts +0 -34
  161. package/esm/helpers/string-helper.d.ts +0 -94
  162. package/esm/helpers/task-helper.d.ts +0 -26
  163. package/esm/helpers/tree-helper.d.ts +0 -54
  164. package/esm/plugins/HtmlTransform.d.ts +0 -6
  165. package/esm/plugins/types/IMessager.d.ts +0 -34
  166. package/esm/plugins/types/index.d.ts +0 -7
  167. package/esm/services/ConfigService.d.ts +0 -66
  168. package/esm/services/DriverService.d.ts +0 -36
  169. package/esm/services/EnvService.d.ts +0 -14
  170. package/esm/services/LogService.d.ts +0 -19
  171. package/esm/services/SettingService.d.ts +0 -42
  172. package/esm/services/SocketService.d.ts +0 -23
  173. package/esm/services/UserService.d.ts +0 -47
  174. package/esm/services/index.d.ts +0 -15
  175. package/esm/services/types/IMessage.d.ts +0 -14
  176. package/esm/services/types/IMessager.d.ts +0 -34
  177. package/esm/services/types/index.d.ts +0 -2
  178. package/esm/servs/ConfigServ.d.ts +0 -66
  179. package/esm/servs/DriverServ.d.ts +0 -36
  180. package/esm/servs/EnvServ.d.ts +0 -14
  181. package/esm/servs/IServ.d.ts +0 -6
  182. package/esm/servs/LogServ.d.ts +0 -19
  183. package/esm/servs/Serv.d.ts +0 -4
  184. package/esm/servs/ServFactory.d.ts +0 -11
  185. package/esm/servs/SettingServ.d.ts +0 -42
  186. package/esm/servs/SocketServ.d.ts +0 -38
  187. package/esm/servs/UserServ.d.ts +0 -47
  188. package/esm/servs/implement/ConfigServ.d.ts +0 -66
  189. package/esm/servs/implement/DriverServ.d.ts +0 -36
  190. package/esm/servs/implement/EnvServ.d.ts +0 -14
  191. package/esm/servs/implement/LogServ.d.ts +0 -19
  192. package/esm/servs/implement/SettingServ.d.ts +0 -42
  193. package/esm/servs/implement/SocketServ.d.ts +0 -38
  194. package/esm/servs/implement/UserServ.d.ts +0 -47
  195. package/esm/servs/index.d.ts +0 -15
  196. package/esm/stores/config.d.ts +0 -63
  197. package/esm/stores/driver.d.ts +0 -37
  198. package/esm/stores/env.d.ts +0 -12
  199. package/esm/stores/index.d.ts +0 -8
  200. package/esm/stores/log.d.ts +0 -20
  201. package/esm/stores/setting.d.ts +0 -43
  202. package/esm/stores/socket.d.ts +0 -27
  203. package/esm/stores/user.d.ts +0 -40
  204. package/esm/types/CreateOptions.d.ts +0 -18
@@ -0,0 +1,56 @@
1
+ import Util from "../Util";
2
+ /**
3
+ * 树帮助类
4
+ */
5
+ declare class TreeUtil extends Util {
6
+ type: string;
7
+ /**
8
+ * 从树结构数据中,递归获取指定主键的对象
9
+ */
10
+ getById: (id: any, idProp: string, tree: any[], childProp: string) => any;
11
+ /**
12
+ * 树节点
13
+ */
14
+ getByIds: (ids: any[], idProp: string, tree: any[], childProp: string) => any[];
15
+ /**
16
+ * 找出指定层级集合中,指定对象的下一个对象
17
+ */
18
+ getNextById: (id: any, idProp: string, tree: any[], childProp: string) => any;
19
+ /**
20
+ * 获取兄弟节点
21
+ */
22
+ getSiblingsById: (id: any, idProp: string, tree: any[], childProp: string) => any;
23
+ /**
24
+ * 获取父节点
25
+ */
26
+ getParentById: (id: any, idProp: string, tree: any[], childProp: string) => any;
27
+ /**
28
+ * 从树结构数据中,递归获取指定主键的父元素集合
29
+ */
30
+ getParentsById: (id: any, idProp: string, tree: any[], childProp: string, hasSelf?: boolean) => any[];
31
+ /**
32
+ * 获取当前节点的所有孩子节点的集合
33
+ */
34
+ getChildrenById: (id: any, idProp: string, tree: any[], childProp: string, hasSelf?: boolean) => any[];
35
+ /**
36
+ * 获取当前节点的所有孩子节点的集合
37
+ */
38
+ getChildren: (element: any, childProp: string, hasSelf?: boolean) => any[];
39
+ /**
40
+ * 搜索指定文本的树结构
41
+ */
42
+ searchTree: (keywords: string, tree: any[], childProp: string, searchProps: any) => any[];
43
+ /**
44
+ * 删除指定子元素
45
+ */
46
+ removeById: (id: any, idProp: string, tree: any[], childProp: string) => void;
47
+ /**
48
+ * 获取树结构扁平化后的节点信息
49
+ */
50
+ getFlat: (tree: any[], childProp: string) => any[];
51
+ /**
52
+ * 对树结点的数据进行重新映射,映射得到新的Tree数组
53
+ */
54
+ map: (tree: any[], prevChildProp: string, childProp: string, fn: Function) => any[];
55
+ }
56
+ export default TreeUtil;
@@ -1,26 +1,28 @@
1
+ import Util from "../Util";
1
2
  /**
2
3
  * 类型帮助类
3
4
  */
4
- declare class TypeHelper {
5
+ declare class TypeUtil extends Util {
6
+ type: string;
5
7
  /**
6
8
  * 判断输入类型是否是字符串类型 null -> false
7
9
  */
8
- static isString: (input: any) => boolean;
10
+ isString: (input: any) => boolean;
9
11
  /**
10
12
  * 判断输入类型是否是Object类型
11
13
  */
12
- static isObject: (input: any) => boolean;
14
+ isObject: (input: any) => boolean;
13
15
  /**
14
16
  * 判断输入类型是否是Array类型
15
17
  */
16
- static isArray: (input: any) => boolean;
18
+ isArray: (input: any) => boolean;
17
19
  /**
18
20
  * 判断输入类型是否是Number类型,null -> false
19
21
  */
20
- static isNumber: (input: any) => boolean;
22
+ isNumber: (input: any) => boolean;
21
23
  /**
22
24
  * 判断输入类型是否是isBoolean类型
23
25
  */
24
- static isBoolean: (input: any) => boolean;
26
+ isBoolean: (input: any) => boolean;
25
27
  }
26
- export default TypeHelper;
28
+ export default TypeUtil;
@@ -1,96 +1,90 @@
1
+ import Util from "../Util";
1
2
  /**
2
3
  * Url帮助类
3
4
  */
4
- declare class UrlHelper {
5
+ declare class UrlUtil extends Util {
6
+ type: string;
5
7
  /**
6
8
  * 获取指定地址路由对象
7
9
  */
8
- static getToRoute(url: string, withReturnUrl?: boolean): any;
10
+ getToRoute(url: string, withReturnUrl?: boolean): any;
9
11
  /**
10
12
  * 获取要跳转的Url地址信息,自动涵盖后退地址
11
13
  */
12
- static getToUrl(url: string, withReturnUrl?: boolean): string;
14
+ getToUrl(url: string, withReturnUrl?: boolean): string;
13
15
  /**
14
16
  * 获取菜单参数
15
17
  */
16
- static getM(url: string): any;
18
+ getM(url: string): any;
17
19
  /**
18
20
  * 获取后退地址路由
19
21
  */
20
- static getBackRoute(): any;
22
+ getBackRoute(): any;
21
23
  /**
22
24
  * 获取要后退的地址URL
23
25
  */
24
- static getBackUrl(): string;
26
+ getBackUrl(): string;
25
27
  /**
26
28
  * 获取指定地址的路由对象,自动合并qs,并解码
27
29
  */
28
- static getRoute(url: string, queryObj?: object): any;
30
+ getRoute(url: string, queryObj?: object): any;
29
31
  /**
30
32
  * 处理实体,得到url query参数形式
31
33
  * 如:app=Tool&compare[language]=json&compare[sql]=App%3D%27Tool%27+and+[Table]+like+%27Ctl_%25%27+order+by+[Table],+Name
32
34
  */
33
- static getQuery(value: any): string;
35
+ getQuery(value: any): string;
34
36
  /**
35
37
  * 处理键值对的值
36
38
  */
37
- private static handleQueryValue;
39
+ private handleQueryValue;
38
40
  /**
39
41
  * 自动根据后面路径,决定是否要合并Url
40
42
  */
41
- static concatUrl: (url: string, path: string) => string;
43
+ concatUrl: (url: string, path: string) => string;
42
44
  /**
43
45
  * 合并路径和查询对象(自动编码,并支持覆盖现有参数),得到完整URL地址,并会省略默认值
44
46
  * ? 对url参数不编码,只对 queryObj 参数编码,防止用户的参数被改成编码形式
45
47
  * ? 目前,对Url参数对象和目标对象都编码,因为源对象属性是经过解码的
46
48
  */
47
- static getUrl: (url: string, params?: any) => string;
49
+ getUrl: (url: string, params?: any) => string;
48
50
  /**
49
51
  * 获取超链接配置对象
50
52
  */
51
- static getAnchor: (url: string, params?: any) => {
53
+ getAnchor: (url: string, params?: any) => {
52
54
  href: any;
53
55
  target: any;
54
56
  };
55
57
  /**
56
58
  * 从Url中提取路径
57
59
  */
58
- static getPath(url: string): string;
60
+ getPath(url: string): string;
59
61
  /**
60
62
  * 获取path中最后一个片段信息
61
63
  */
62
- static getLastSegment(url: string): string;
64
+ getLastSegment(url: string): string;
63
65
  /**
64
66
  * 获取地址中的查询参数
65
67
  */
66
- static getQueryParam(url: string, key: string): string;
68
+ getQueryParam(url: string, key: string): string;
67
69
  /**
68
70
  * 从Url中提取查询对象
69
71
  */
70
- static deserialize(url: string): object;
72
+ deserialize(url: string): object;
71
73
  /**
72
74
  * 把查询字符串转换成对象(自动解码成源数据)
73
75
  */
74
- static deserializeQs(qs: string, decode?: boolean): any;
76
+ deserializeQs(qs: string, decode?: boolean): any;
75
77
  /**
76
78
  * 把对象转换成查询字符串,自动编码
77
79
  */
78
- static serialize(obj: object, encoding?: boolean): string;
80
+ serialize(obj: object, encoding?: boolean): string;
79
81
  /**
80
82
  * URL编码
81
83
  */
82
- static encode(val: string): string;
83
- /**
84
- * 把指定对象转换成base64字符串
85
- */
86
- static base64(obj: object): Promise<string>;
87
- /**
88
- * 把指定base64字符串解析为原对象
89
- */
90
- static base64Decode(val: string): Promise<any>;
84
+ encode(value: string): string;
91
85
  /**
92
86
  * 是否是http或https开头的地址
93
87
  */
94
- static httpOrHttps(url: string): boolean;
88
+ httpOrHttps(url: string): boolean;
95
89
  }
96
- export default UrlHelper;
90
+ export default UrlUtil;
@@ -0,0 +1,24 @@
1
+ import UtilFactory from "./UtilFactory";
2
+ import ArrayUtil from "./implements/ArrayUtil";
3
+ import ComponentUtil from './implements/ComponentUtil';
4
+ import DomUtil from "./implements/DomUtil";
5
+ import DictionaryUtil from "./implements/DictionaryUtil";
6
+ import EventUtil from "./implements/EventUtil";
7
+ import FileUtil from "./implements/FileUtil";
8
+ import HtmlUtil from "./implements/HtmlUtil";
9
+ import ImageUtil from "./implements/ImageUtil";
10
+ import MathUtil from "./implements/MathUtil";
11
+ import MicroUtil from "./implements/MicroUtil";
12
+ import MountUtil from "./implements/MountUtil";
13
+ import ObjectUtil from "./implements/ObjectUtil";
14
+ import StringUtil from "./implements/StringUtil";
15
+ import TaskUtil from "./implements/TaskUtil";
16
+ import TypeUtil from "./implements/TypeUtil";
17
+ import TimeUtil from "./implements/TimeUtil";
18
+ import TreeUtil from "./implements/TreeUtil";
19
+ import ScrollUtil from "./implements/ScrollUtil";
20
+ import JsonUtil from "./implements/JsonUtil";
21
+ import BrowserUtil from "./implements/BrowserUtil";
22
+ import UrlUtil from "./implements/UrlUtil";
23
+ import SignUtil from "./implements/SignUtil";
24
+ export { UtilFactory, ArrayUtil, ComponentUtil, DomUtil, DictionaryUtil, EventUtil, FileUtil, HtmlUtil, ImageUtil, MathUtil, MountUtil, ObjectUtil, MicroUtil, StringUtil, TaskUtil, TypeUtil, TimeUtil, TreeUtil, ScrollUtil, JsonUtil, BrowserUtil, UrlUtil, SignUtil };
@@ -0,0 +1,11 @@
1
+ import Position from "./Position";
2
+ /**
3
+ * 自定义拖拽事件
4
+ */
5
+ declare class DragEvent extends Position {
6
+ /**
7
+ * 吸附的方向
8
+ */
9
+ affix?: string;
10
+ }
11
+ export default DragEvent;
@@ -0,0 +1,28 @@
1
+ import Rect from "./Rect";
2
+ import DragEvent from "./DragEvent";
3
+ /**
4
+ * 拖拽选项
5
+ */
6
+ interface DragOptions {
7
+ /**
8
+ * 拖拽初始化
9
+ */
10
+ init: (event: MouseEvent) => any;
11
+ /**
12
+ * 拖拽事件
13
+ */
14
+ handler: (dragEvent: DragEvent, start: MouseEvent, data: any, first: boolean, event: MouseEvent) => void;
15
+ /**
16
+ * 拖拽结束事件
17
+ */
18
+ end?: (event: MouseEvent) => void;
19
+ /**
20
+ * 可拖拽范围
21
+ */
22
+ range?: Rect;
23
+ /**
24
+ * 吸附检测的距离,设置吸附位置必须设置拖拽范围(依赖宽度等信息)
25
+ */
26
+ affix?: number;
27
+ }
28
+ export default DragOptions;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 位置
3
+ */
4
+ declare class Position {
5
+ /**
6
+ * 距窗口左边的距离
7
+ */
8
+ x: number;
9
+ /**
10
+ * 距窗口顶部的距离
11
+ */
12
+ y: number;
13
+ constructor(x?: number, y?: number);
14
+ }
15
+ export default Position;
@@ -0,0 +1,10 @@
1
+ import Position from "./Position";
2
+ /**
3
+ * 区域类
4
+ */
5
+ declare class Rect extends Position {
6
+ width: number;
7
+ height: number;
8
+ constructor(x: number, y: number, width: number, height: number);
9
+ }
10
+ export default Rect;
@@ -0,0 +1,5 @@
1
+ import DragOptions from "./DragOptions";
2
+ import DragEvent from "./DragEvent";
3
+ import Position from "./Position";
4
+ import Rect from "./Rect";
5
+ export { type DragOptions, DragEvent, Position, Rect };
@@ -0,0 +1,4 @@
1
+ import { IDriver } from "../@types";
2
+ interface IUtility extends IDriver {
3
+ }
4
+ export default IUtility;
@@ -0,0 +1,5 @@
1
+ import IUtility from "./IUtility";
2
+ declare abstract class Utility implements IUtility {
3
+ type: string;
4
+ }
5
+ export default Utility;
@@ -0,0 +1,43 @@
1
+ import { Factory } from "../../factorying";
2
+ import IUtility from "./IUtility";
3
+ import AffixUtility from "./implement/AffixUtility";
4
+ import DeltaUtility from "./implement/DeltaUtility";
5
+ import EventUtility from "./implement/EventUtility";
6
+ import KeyboardUtility from "./implement/KeyboardUtility";
7
+ import RandomUtility from "./implement/RandomUtility";
8
+ import SaveUtility from "./implement/SaveUtility";
9
+ import MouseUtility from "./implement/MouseUtility";
10
+ /**
11
+ * 工具类工厂
12
+ */
13
+ declare class UtilityFactory extends Factory<IUtility> {
14
+ /**
15
+ * 创建固定工具
16
+ */
17
+ affix(ele: Element, parent: Element): AffixUtility;
18
+ /**
19
+ * 创建对比工具
20
+ */
21
+ delta(): DeltaUtility;
22
+ /**
23
+ * 创建固定工具
24
+ */
25
+ event(): EventUtility;
26
+ /**
27
+ * 键盘工具
28
+ */
29
+ keyboard(): KeyboardUtility;
30
+ /**
31
+ * 鼠标工具
32
+ */
33
+ mouse(container: HTMLElement, closeTriggers?: any[]): MouseUtility;
34
+ /**
35
+ * 随机工具
36
+ */
37
+ random(): RandomUtility;
38
+ /**
39
+ * 随机工具
40
+ */
41
+ save(): SaveUtility;
42
+ }
43
+ export default UtilityFactory;
@@ -0,0 +1,11 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 固定元素位置
4
+ */
5
+ declare class AffixUtility extends Utility {
6
+ /**
7
+ * 初始化
8
+ */
9
+ constructor(ele: Element, parent: Element);
10
+ }
11
+ export default AffixUtility;
@@ -0,0 +1,11 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 列表数据变动对比
4
+ */
5
+ declare class DeltaUtility extends Utility {
6
+ /**
7
+ * 对比数据变动
8
+ */
9
+ delta<T>(oldEntities: T[], newEntities: T[], keys: string[], props: []): void;
10
+ }
11
+ export default DeltaUtility;
@@ -0,0 +1,73 @@
1
+ import { DragOptions } from "../@types";
2
+ import Utility from "../Utility";
3
+ /**
4
+ * 事件工具类
5
+ */
6
+ declare class EventUtility extends Utility {
7
+ resizeObserver: ResizeObserver;
8
+ element: Element;
9
+ resizeHandler: any;
10
+ /**
11
+ * 大小改变事件,已防抖
12
+ */
13
+ resize: (element: Element, handler: (entries: ResizeObserverEntry[]) => void, debounceMs?: number) => void;
14
+ scrollElement: Element;
15
+ scrollHandler: (event: Event) => void;
16
+ /**
17
+ * 滚动事件
18
+ */
19
+ scroll(element: Element, handler: (event: Event) => void): void;
20
+ /**
21
+ * 拖拽起始位置
22
+ */
23
+ dragStart: MouseEvent;
24
+ /**
25
+ * 拖拽起始数据,每次拖拽时,都会回调到拖拽方法的参数中
26
+ */
27
+ dragStartData: any;
28
+ dragElement: Element;
29
+ dragMouseDownHandler: (event: MouseEvent) => void;
30
+ /**
31
+ * 拖拽事件
32
+ */
33
+ drag(element: Element, options: DragOptions): void;
34
+ observeElement: Element;
35
+ observer: MutationObserver;
36
+ /**
37
+ * 观察DOM变动
38
+ */
39
+ observe(element: Element, handler: (mutations: MutationRecord[]) => void): void;
40
+ mouseDownElement: Element;
41
+ mouseDownHandler: (event: MouseEvent) => void;
42
+ mouseUpHandler: (event: MouseEvent) => void;
43
+ /**
44
+ * 鼠标按下
45
+ */
46
+ 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
+ dispatchElement: HTMLElement;
54
+ /**
55
+ * 创建分发事件元素
56
+ */
57
+ createDispatch: (id: string, name: string, handler: (e: Event) => void) => void;
58
+ /**
59
+ * 分发事件,并传递参数
60
+ */
61
+ dispatch(name: string, data: {
62
+ [key: string]: string;
63
+ }): void;
64
+ /**
65
+ * 事件节流: 指定时间段内只第一次操作被触发
66
+ */
67
+ throttle: () => void;
68
+ /**
69
+ * 移除大小改变事件
70
+ */
71
+ dispose: () => void;
72
+ }
73
+ export default EventUtility;
@@ -0,0 +1,74 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 键盘帮助类
4
+ */
5
+ declare class KeyboardUtility extends Utility {
6
+ events: Object;
7
+ /**
8
+ * 注册事件
9
+ */
10
+ add: (element: any, cb: Function, condition: Function, key: string, prevent: boolean, type: string) => void;
11
+ /**
12
+ * 移除事件
13
+ */
14
+ remove: (element: any, key: string, type: string) => void;
15
+ /**
16
+ * 监听键盘按下事件
17
+ */
18
+ keydown: (element: any, cb: Function, condition: Function, key: string, prevent?: boolean) => void;
19
+ /**
20
+ * 移除键盘按下事件
21
+ */
22
+ removeKeydown: (element: any, key: string) => void;
23
+ /**
24
+ * 当触发保存时执行
25
+ * 想在div上绑定ctrlS事件,需要div处于focus状态,才可以触发已绑定的ctrlS事件
26
+ * div设置tabindex=-1,才可以手动触发焦点
27
+ */
28
+ ctrlS: (element: any, cb: Function) => void;
29
+ /**
30
+ * 移除保存事件
31
+ */
32
+ removeCtrlS: (element: any) => void;
33
+ /**
34
+ * 触发Ctrl回车事件
35
+ */
36
+ ctrlEnter: (element: any, cb: Function) => void;
37
+ /**
38
+ * 移除Ctrl回车事件
39
+ */
40
+ removeCtrlEnter: (element: any) => void;
41
+ lastKeyTime: number;
42
+ isKeyLastUp: boolean;
43
+ /**
44
+ * 双击事件
45
+ */
46
+ doubleKey: (element: any, cb: Function, key: string, prevent?: boolean) => void;
47
+ /**
48
+ * 移除双击事件
49
+ */
50
+ removeDoubleKey: (element: any, key: string) => void;
51
+ /**
52
+ * 监听键盘抬起事件
53
+ */
54
+ keyup: (element: any, cb: Function, condition: Function, key: string, prevent?: boolean) => void;
55
+ /**
56
+ * 移除键盘抬起事件
57
+ */
58
+ removeKeyup: (element: any, key: string) => void;
59
+ /**
60
+ * 监控是否按下Ctrl
61
+ */
62
+ isCtrl: boolean;
63
+ ctrl: (document: any) => void;
64
+ /**
65
+ * 删除Ctrl事件
66
+ */
67
+ removeCtrl: (document: any) => void;
68
+ timer: number;
69
+ touchStart: Function;
70
+ touchEnd(): void;
71
+ touch: (element: any, cb: Function) => void;
72
+ removeTouch: (element: any) => void;
73
+ }
74
+ export default KeyboardUtility;
@@ -0,0 +1,25 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 鼠标工具类
4
+ */
5
+ declare class MouseUtility extends Utility {
6
+ container: HTMLElement;
7
+ closeTriggers: HTMLElement[];
8
+ /**
9
+ * 初始化,并绑定自动关闭上下文菜单事件
10
+ */
11
+ constructor(container: HTMLElement, closeTriggers?: any[]);
12
+ /**
13
+ * 手动关闭右键上下文菜单
14
+ */
15
+ close: () => void;
16
+ /**
17
+ * 根据鼠标事件,显示右键上下文弹窗
18
+ */
19
+ show: (event: MouseEvent) => void;
20
+ /**
21
+ * 资源释放,防止内存泄漏
22
+ */
23
+ dispose: () => void;
24
+ }
25
+ export default MouseUtility;
@@ -0,0 +1,41 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 随机数工具类
4
+ * 带状态,如随机数记录了已经使用过的随机数
5
+ */
6
+ declare class RandomUtility extends Utility {
7
+ /**
8
+ * 随机数总长度
9
+ */
10
+ length: number;
11
+ /**
12
+ * 当前显示元素之前的数组
13
+ */
14
+ history: number[];
15
+ /**
16
+ * 即将要显示的数组(未空表示用户还没看过,可随机生成)
17
+ */
18
+ future: number[];
19
+ /**
20
+ * 当前元素指针,索引值,用于指示当前显示的数在所有数组中的位置
21
+ */
22
+ current: number;
23
+ /**
24
+ * 是否有上一个数
25
+ */
26
+ get hasPrev(): boolean;
27
+ /**
28
+ * 是否有下一个数
29
+ */
30
+ get hasNext(): boolean;
31
+ /**
32
+ * 获取轨迹中的上一个数的索引,箭头函数可能会导致数据更新,但是UI不更新
33
+ */
34
+ prev(): number;
35
+ /**
36
+ * 获取下一个数
37
+ * 优先从轨迹获取,轨迹没有则取随机数
38
+ */
39
+ next(): number;
40
+ }
41
+ export default RandomUtility;
@@ -0,0 +1,16 @@
1
+ import Utility from "../Utility";
2
+ /**
3
+ * 自动保存工具
4
+ * 函数式编程,从而可以让方法被多处使用
5
+ */
6
+ declare class SaveUtility extends Utility {
7
+ /**
8
+ * 开启表单监控
9
+ */
10
+ open(form: any, store: string, id: string): Promise<void>;
11
+ /**
12
+ * 资源释放
13
+ */
14
+ dispose(): void;
15
+ }
16
+ export default SaveUtility;
@@ -0,0 +1,9 @@
1
+ import EventUtility from "./implement/EventUtility";
2
+ import KeyboardUtility from "./implement/KeyboardUtility";
3
+ import DeltaUtility from "./implement/DeltaUtility";
4
+ import MouseUtility from "./implement/MouseUtility";
5
+ import RandomUtility from "./implement/RandomUtility";
6
+ import SaveUtility from "./implement/SaveUtility";
7
+ import UtilityFactory from "./UtilityFactory";
8
+ export * from "./@types";
9
+ export { EventUtility, KeyboardUtility, DeltaUtility, MouseUtility, RandomUtility, SaveUtility, UtilityFactory };