@ibiz-template/runtime 0.0.1-alpha.9 → 0.0.1-beta.1

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.
Files changed (183) hide show
  1. package/dist/system/index.system.js +1 -0
  2. package/out/command/app/app-func/app-func.js +3 -3
  3. package/out/command/app/open-app-view/open-app-view.d.ts +2 -13
  4. package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
  5. package/out/command/app/open-app-view/open-app-view.js +6 -18
  6. package/out/index.d.ts +3 -1
  7. package/out/index.d.ts.map +1 -1
  8. package/out/index.js +3 -1
  9. package/out/install.d.ts.map +1 -1
  10. package/out/install.js +5 -2
  11. package/out/interface/i-drawer-options/i-drawer-options.d.ts +29 -0
  12. package/out/interface/i-drawer-options/i-drawer-options.d.ts.map +1 -0
  13. package/out/interface/{provider/i-editor-provider.js → i-drawer-options/i-drawer-options.js} +0 -0
  14. package/out/interface/i-modal-data/i-modal-data.d.ts +1 -1
  15. package/out/interface/i-modal-data/i-modal-data.d.ts.map +1 -1
  16. package/out/interface/i-modal-options/i-modal-options.d.ts +35 -0
  17. package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -0
  18. package/out/interface/{register/i-editor-register.js → i-modal-options/i-modal-options.js} +0 -0
  19. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +39 -0
  20. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -0
  21. package/out/interface/i-plugin-factory/i-plugin-factory.js +1 -0
  22. package/out/interface/i-popover-options/i-popover-options.d.ts +84 -0
  23. package/out/interface/i-popover-options/i-popover-options.d.ts.map +1 -0
  24. package/out/interface/i-popover-options/i-popover-options.js +1 -0
  25. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts +27 -0
  26. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts.map +1 -0
  27. package/out/interface/i-ui-action-handler/i-ui-action-handler.js +1 -0
  28. package/out/interface/index.d.ts +7 -3
  29. package/out/interface/index.d.ts.map +1 -1
  30. package/out/interface/index.js +2 -3
  31. package/out/interface/provider/i-ui-action-provider.d.ts +20 -0
  32. package/out/interface/provider/i-ui-action-provider.d.ts.map +1 -0
  33. package/out/interface/provider/i-ui-action-provider.js +1 -0
  34. package/out/interface/provider/index.d.ts +2 -0
  35. package/out/interface/provider/index.d.ts.map +1 -0
  36. package/out/interface/provider/index.js +1 -0
  37. package/out/interface/register/i-register.d.ts +8 -1
  38. package/out/interface/register/i-register.d.ts.map +1 -1
  39. package/out/interface/register/i-ui-action-register.d.ts +15 -0
  40. package/out/interface/register/i-ui-action-register.d.ts.map +1 -0
  41. package/out/interface/register/i-ui-action-register.js +1 -0
  42. package/out/interface/register/index.d.ts +3 -0
  43. package/out/interface/register/index.d.ts.map +1 -0
  44. package/out/interface/register/index.js +2 -0
  45. package/out/interface/util/i-loading-util/i-loading-util.d.ts +14 -0
  46. package/out/interface/util/i-loading-util/i-loading-util.d.ts.map +1 -1
  47. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +1 -1
  48. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  49. package/out/interface/util/i-overlay-container/i-overlay-container.d.ts +37 -0
  50. package/out/interface/util/i-overlay-container/i-overlay-container.d.ts.map +1 -0
  51. package/out/interface/util/i-overlay-container/i-overlay-container.js +1 -0
  52. package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts +86 -0
  53. package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts.map +1 -0
  54. package/out/interface/util/i-overlay-controller/i-overlay-controller.js +1 -0
  55. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts +23 -0
  56. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts.map +1 -0
  57. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.js +1 -0
  58. package/out/interface/util/index.d.ts +3 -0
  59. package/out/interface/util/index.d.ts.map +1 -1
  60. package/out/plugin/index.d.ts +3 -0
  61. package/out/plugin/index.d.ts.map +1 -0
  62. package/out/plugin/index.js +2 -0
  63. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts +37 -0
  64. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts.map +1 -0
  65. package/out/plugin/plugin-static-resource/plugin-static-resource.js +31 -0
  66. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +102 -0
  67. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -0
  68. package/out/plugin/remote-plugin-item/remote-plugin-item.js +22 -0
  69. package/out/provider/index.d.ts +2 -0
  70. package/out/provider/index.d.ts.map +1 -0
  71. package/out/provider/index.js +1 -0
  72. package/out/provider/ui-action/backend-ui-action-provider.d.ts +15 -0
  73. package/out/provider/ui-action/backend-ui-action-provider.d.ts.map +1 -0
  74. package/out/provider/ui-action/backend-ui-action-provider.js +18 -0
  75. package/out/provider/ui-action/common-sys-ui-action-provider.d.ts +15 -0
  76. package/out/provider/ui-action/common-sys-ui-action-provider.d.ts.map +1 -0
  77. package/out/provider/ui-action/common-sys-ui-action-provider.js +18 -0
  78. package/out/provider/ui-action/front-ui-action-provider.d.ts +15 -0
  79. package/out/provider/ui-action/front-ui-action-provider.d.ts.map +1 -0
  80. package/out/provider/ui-action/front-ui-action-provider.js +18 -0
  81. package/out/provider/ui-action/index.d.ts +13 -0
  82. package/out/provider/ui-action/index.d.ts.map +1 -0
  83. package/out/provider/ui-action/index.js +44 -0
  84. package/out/register/index.d.ts +4 -0
  85. package/out/register/index.d.ts.map +1 -0
  86. package/out/register/index.js +3 -0
  87. package/out/register/register-base.d.ts +18 -0
  88. package/out/register/register-base.d.ts.map +1 -0
  89. package/out/register/register-base.js +24 -0
  90. package/out/register/register-center.d.ts +20 -0
  91. package/out/register/register-center.d.ts.map +1 -0
  92. package/out/register/register-center.js +21 -0
  93. package/out/register/ui-action-register.d.ts +17 -0
  94. package/out/register/ui-action-register.d.ts.map +1 -0
  95. package/out/register/ui-action-register.js +41 -0
  96. package/out/types.d.ts +19 -3
  97. package/out/types.d.ts.map +1 -1
  98. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +3 -61
  99. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -1
  100. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +4 -241
  101. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +17 -0
  102. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -0
  103. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +28 -0
  104. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +17 -0
  105. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts.map +1 -0
  106. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.js +103 -0
  107. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +17 -0
  108. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -0
  109. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +24 -0
  110. package/out/utils/app-de-ui-action-util/handler/index.d.ts +5 -0
  111. package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -0
  112. package/out/utils/app-de-ui-action-util/handler/index.js +4 -0
  113. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +82 -0
  114. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -0
  115. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +143 -0
  116. package/out/utils/app-de-ui-action-util/index.d.ts +3 -0
  117. package/out/utils/app-de-ui-action-util/index.d.ts.map +1 -0
  118. package/out/utils/app-de-ui-action-util/index.js +2 -0
  119. package/out/utils/index.d.ts +2 -1
  120. package/out/utils/index.d.ts.map +1 -1
  121. package/out/utils/index.js +2 -1
  122. package/out/utils/open-redirect-view/open-redirect-view.d.ts +43 -0
  123. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -0
  124. package/out/utils/open-redirect-view/open-redirect-view.js +139 -0
  125. package/out/view-logic/view-logic.d.ts +7 -6
  126. package/out/view-logic/view-logic.d.ts.map +1 -1
  127. package/out/view-logic/view-logic.js +19 -13
  128. package/package.json +22 -12
  129. package/src/command/app/app-func/app-func.ts +3 -3
  130. package/src/command/app/open-app-view/open-app-view.ts +12 -28
  131. package/src/index.ts +3 -1
  132. package/src/install.ts +5 -2
  133. package/src/interface/i-drawer-options/i-drawer-options.ts +28 -0
  134. package/src/interface/i-modal-data/i-modal-data.ts +1 -1
  135. package/src/interface/i-modal-options/i-modal-options.ts +35 -0
  136. package/src/interface/i-plugin-factory/i-plugin-factory.ts +39 -0
  137. package/src/interface/i-popover-options/i-popover-options.ts +85 -0
  138. package/src/interface/i-ui-action-handler/i-ui-action-handler.ts +33 -0
  139. package/src/interface/index.ts +10 -3
  140. package/src/interface/provider/i-ui-action-provider.ts +20 -0
  141. package/src/interface/provider/index.ts +1 -0
  142. package/src/interface/register/i-register.ts +8 -1
  143. package/src/interface/register/i-ui-action-register.ts +15 -0
  144. package/src/interface/register/index.ts +2 -0
  145. package/src/interface/util/i-loading-util/i-loading-util.ts +14 -0
  146. package/src/interface/util/i-open-view-util/i-open-view-util.ts +1 -0
  147. package/src/interface/util/i-overlay-container/i-overlay-container.ts +38 -0
  148. package/src/interface/util/i-overlay-controller/i-overlay-controller.ts +116 -0
  149. package/src/interface/util/i-overlay-popover-container/i-overlay-popover-container.ts +23 -0
  150. package/src/interface/util/index.ts +3 -0
  151. package/src/plugin/index.ts +5 -0
  152. package/src/plugin/plugin-static-resource/plugin-static-resource.ts +42 -0
  153. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +107 -0
  154. package/src/provider/index.ts +1 -0
  155. package/src/provider/ui-action/backend-ui-action-provider.ts +22 -0
  156. package/src/provider/ui-action/common-sys-ui-action-provider.ts +22 -0
  157. package/src/provider/ui-action/front-ui-action-provider.ts +22 -0
  158. package/src/provider/ui-action/index.ts +50 -0
  159. package/src/register/index.ts +3 -0
  160. package/src/register/register-base.ts +27 -0
  161. package/src/register/register-center.ts +20 -0
  162. package/src/register/ui-action-register.ts +48 -0
  163. package/src/types.ts +20 -3
  164. package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +6 -330
  165. package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +43 -0
  166. package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +125 -0
  167. package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +46 -0
  168. package/src/utils/app-de-ui-action-util/handler/index.ts +4 -0
  169. package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +215 -0
  170. package/src/utils/app-de-ui-action-util/index.ts +2 -0
  171. package/src/utils/index.ts +2 -1
  172. package/src/utils/open-redirect-view/open-redirect-view.ts +180 -0
  173. package/src/view-logic/view-logic.ts +30 -17
  174. package/out/interface/provider/i-editor-provider.d.ts +0 -38
  175. package/out/interface/provider/i-editor-provider.d.ts.map +0 -1
  176. package/out/interface/register/i-editor-register.d.ts +0 -23
  177. package/out/interface/register/i-editor-register.d.ts.map +0 -1
  178. package/out/register/register.d.ts +0 -20
  179. package/out/register/register.d.ts.map +0 -1
  180. package/out/register/register.js +0 -10
  181. package/src/interface/provider/i-editor-provider.ts +0 -44
  182. package/src/interface/register/i-editor-register.ts +0 -23
  183. package/src/register/register.ts +0 -20
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 全局呈现容器
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-11-09 14:11:59
6
+ * @export
7
+ * @interface IOverlayContainer
8
+ */
9
+ export interface IOverlayContainer {
10
+ /**
11
+ * 展示容器
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-11-09 14:11:10
15
+ * @return {*} {Promise<void>}
16
+ */
17
+ present(): Promise<void>;
18
+
19
+ /**
20
+ * 关闭容器
21
+ *
22
+ * @author chitanda
23
+ * @date 2022-11-09 14:11:17
24
+ * @param {unknown} [data]
25
+ * @return {*} {Promise<void>}
26
+ */
27
+ dismiss(data?: unknown): Promise<void>;
28
+
29
+ /**
30
+ * 等待容器关闭并返回返回值
31
+ *
32
+ * @author chitanda
33
+ * @date 2022-11-09 14:11:21
34
+ * @template T
35
+ * @return {*} {Promise<T>}
36
+ */
37
+ onWillDismiss<T = unknown>(): Promise<T>;
38
+ }
@@ -0,0 +1,116 @@
1
+ import { IDrawerOptions } from '../../i-drawer-options/i-drawer-options';
2
+ import { IPopoverOptions } from '../../i-popover-options/i-popover-options';
3
+ import { IModalOptions } from '../../i-modal-options/i-modal-options';
4
+ import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
5
+ import { IOverlayPopoverContainer } from '../i-overlay-popover-container/i-overlay-popover-container';
6
+
7
+ /**
8
+ * 全局呈现容器控制器
9
+ *
10
+ * @author chitanda
11
+ * @date 2022-11-08 14:11:27
12
+ * @export
13
+ * @interface IOverlayController
14
+ */
15
+ export interface IOverlayController {
16
+ /**
17
+ * 飘窗
18
+ *
19
+ * @author chitanda
20
+ * @date 2022-11-09 12:11:22
21
+ * @template T
22
+ * @param {HTMLElement} element
23
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
24
+ * @param {IParams} [props] 组件props
25
+ * @param {IPopoverOptions} [opts]
26
+ * @return {*} {Promise<T>}
27
+ */
28
+ popover<T = void>(
29
+ element: HTMLElement,
30
+ component: unknown,
31
+ props?: IParams,
32
+ opts?: IPopoverOptions,
33
+ ): Promise<T>;
34
+
35
+ /**
36
+ * 创建飘窗全局容器
37
+ *
38
+ * @author chitanda
39
+ * @date 2022-11-09 15:11:13
40
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
41
+ * @param {IParams} [props] 组件props
42
+ * @param {IPopoverOptions} [opts]
43
+ * @return {*} {IOverlayPopoverContainer}
44
+ */
45
+ createPopover(
46
+ component: unknown,
47
+ props?: IParams,
48
+ opts?: IPopoverOptions,
49
+ ): IOverlayPopoverContainer;
50
+
51
+ /**
52
+ * 抽屉
53
+ *
54
+ * @author chitanda
55
+ * @date 2022-11-08 15:11:45
56
+ * @template T
57
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
58
+ * @param {IParams} [props] 组件props
59
+ * @param {IDrawerOptions} [opts]
60
+ * @return {*} {Promise<T>}
61
+ */
62
+ drawer<T = void>(
63
+ component: unknown,
64
+ props?: IParams,
65
+ opts?: IDrawerOptions,
66
+ ): Promise<T>;
67
+
68
+ /**
69
+ * 创建全局抽屉容器
70
+ *
71
+ * @author chitanda
72
+ * @date 2022-11-09 15:11:49
73
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
74
+ * @param {IParams} [props] 组件props
75
+ * @param {IDrawerOptions} [opts]
76
+ * @return {*} {IOverlayContainer}
77
+ */
78
+ createDrawer(
79
+ component: unknown,
80
+ props?: IParams,
81
+ opts?: IDrawerOptions,
82
+ ): IOverlayContainer;
83
+
84
+ /**
85
+ * 模态
86
+ *
87
+ * @author chitanda
88
+ * @date 2022-11-08 15:11:40
89
+ * @template T
90
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
91
+ * @param {IParams} [props] 组件props
92
+ * @param {IModalOptions} [opts]
93
+ * @return {*} {Promise<T>}
94
+ */
95
+ modal<T = void>(
96
+ component: unknown,
97
+ props?: IParams,
98
+ opts?: IModalOptions,
99
+ ): Promise<T>;
100
+
101
+ /**
102
+ * 创建全局模态容器
103
+ *
104
+ * @author chitanda
105
+ * @date 2022-11-09 15:11:58
106
+ * @param {unknown} component 组件名称,组件对象,或者绘制函数
107
+ * @param {IParams} [props] 组件props
108
+ * @param {IModalOptions} [opts]
109
+ * @return {*} {IOverlayContainer}
110
+ */
111
+ createModal(
112
+ component: unknown,
113
+ props?: IParams,
114
+ opts?: IModalOptions,
115
+ ): IOverlayContainer;
116
+ }
@@ -0,0 +1,23 @@
1
+ import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
2
+
3
+ /**
4
+ * 飘窗容器
5
+ *
6
+ * @author chitanda
7
+ * @date 2022-11-09 14:11:39
8
+ * @export
9
+ * @interface IOverlayPopoverContainer
10
+ * @extends {IOverlayContainer}
11
+ */
12
+ export interface IOverlayPopoverContainer extends IOverlayContainer {
13
+ /**
14
+ * 展示飘窗容器
15
+ *
16
+ * @author chitanda
17
+ * @date 2022-11-09 14:11:47
18
+ * @param {HTMLElement} target
19
+ * @return {*} {Promise<void>}
20
+ */
21
+ present(target: HTMLElement): Promise<void>;
22
+ present(): Promise<void>;
23
+ }
@@ -6,3 +6,6 @@ export {
6
6
  NotificationParams,
7
7
  } from './i-notification-util/i-notification-util';
8
8
  export { IOpenViewUtil } from './i-open-view-util/i-open-view-util';
9
+ export { IOverlayContainer } from './i-overlay-container/i-overlay-container';
10
+ export { IOverlayController } from './i-overlay-controller/i-overlay-controller';
11
+ export { IOverlayPopoverContainer } from './i-overlay-popover-container/i-overlay-popover-container';
@@ -0,0 +1,5 @@
1
+ export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
2
+ export {
3
+ RemotePluginConfig,
4
+ RemotePluginItem,
5
+ } from './remote-plugin-item/remote-plugin-item';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 插件静态资源工具类
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-11-03 10:11:08
6
+ * @export
7
+ * @class PluginStaticResource
8
+ */
9
+ export class PluginStaticResource {
10
+ /**
11
+ * 计算出的静态资源跟路径
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-11-03 10:11:08
15
+ * @protected
16
+ * @type {string}
17
+ */
18
+ protected baseDir: string;
19
+
20
+ /**
21
+ * 插件静态资源工具类.
22
+ *
23
+ * @author chitanda
24
+ * @date 2022-11-03 10:11:41
25
+ * @param {string} mateUrl import.mate.url
26
+ */
27
+ constructor(mateUrl: string) {
28
+ this.baseDir = mateUrl.substring(0, mateUrl.lastIndexOf('/'));
29
+ }
30
+
31
+ /**
32
+ * 合并输出静态资源目录
33
+ *
34
+ * @author chitanda
35
+ * @date 2022-11-03 10:11:39
36
+ * @param {string} path
37
+ * @return {*} {string}
38
+ */
39
+ dir(path: string): string {
40
+ return this.baseDir + path;
41
+ }
42
+ }
@@ -0,0 +1,107 @@
1
+ /**
2
+ * 远程插件配置
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-10-31 16:10:34
6
+ * @export
7
+ * @interface RemotePluginConfig
8
+ */
9
+ export interface RemotePluginConfig {
10
+ /**
11
+ * 所有配置文件基础路径
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-11-02 14:11:06
15
+ * @type {string}
16
+ */
17
+ baseUrl: string;
18
+ /**
19
+ * 包名称
20
+ *
21
+ * @author chitanda
22
+ * @date 2022-10-31 16:10:42
23
+ * @type {string}
24
+ */
25
+ name: string;
26
+ /**
27
+ * 版本
28
+ *
29
+ * @author chitanda
30
+ * @date 2022-11-02 15:11:03
31
+ * @type {string}
32
+ */
33
+ version: string;
34
+ /**
35
+ * system js 入口脚本
36
+ *
37
+ * @author chitanda
38
+ * @date 2022-11-02 15:11:28
39
+ * @type {string}
40
+ */
41
+ system: string;
42
+ /**
43
+ * 模块文件 入口脚本
44
+ *
45
+ * @author chitanda
46
+ * @date 2022-11-02 16:11:50
47
+ * @type {string}
48
+ */
49
+ module: string;
50
+ /**
51
+ * 样式地址
52
+ *
53
+ * @author chitanda
54
+ * @date 2022-10-31 16:10:46
55
+ * @type {(string | string[])}
56
+ */
57
+ styles: string | string[];
58
+ /**
59
+ * 是否为应用级
60
+ *
61
+ * @author chitanda
62
+ * @date 2022-10-31 16:10:51
63
+ * @type {boolean}
64
+ */
65
+ app?: boolean;
66
+ }
67
+
68
+ /**
69
+ * 远程插件项
70
+ *
71
+ * @author chitanda
72
+ * @date 2022-10-31 12:10:41
73
+ * @export
74
+ * @class RemotePluginItem
75
+ */
76
+ export class RemotePluginItem {
77
+ /**
78
+ * 唯一标识
79
+ *
80
+ * @author chitanda
81
+ * @date 2022-10-31 12:10:48
82
+ * @type {string}
83
+ */
84
+ readonly tag: string;
85
+
86
+ /**
87
+ * 配置参数
88
+ *
89
+ * @author chitanda
90
+ * @date 2022-11-02 15:11:38
91
+ * @type {RemotePluginConfig}
92
+ */
93
+ readonly config: RemotePluginConfig;
94
+
95
+ /**
96
+ * Creates an instance of RemotePluginItem.
97
+ *
98
+ * @author chitanda
99
+ * @date 2022-10-31 12:10:28
100
+ * @param {string} tag 插件唯一标识
101
+ * @param {RemotePluginConfig} config
102
+ */
103
+ constructor(tag: string, config: RemotePluginConfig) {
104
+ this.tag = tag;
105
+ this.config = config;
106
+ }
107
+ }
@@ -0,0 +1 @@
1
+ export * from './ui-action';
@@ -0,0 +1,22 @@
1
+ import { IUIActionHandler, IUIActionProvider } from '../../interface';
2
+ import { BackendUIActionHandler } from '../../utils';
3
+
4
+ /**
5
+ * 后台调用界面行为适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-10-25 15:10:51
9
+ * @export
10
+ * @class BackendUIActionProvider
11
+ * @implements {IUIActionProvider}
12
+ */
13
+ export class BackendUIActionProvider implements IUIActionProvider {
14
+ private handler?: IUIActionHandler;
15
+
16
+ async getHandler(): Promise<IUIActionHandler> {
17
+ if (!this.handler) {
18
+ this.handler = new BackendUIActionHandler();
19
+ }
20
+ return this.handler;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ import { IUIActionHandler, IUIActionProvider } from '../../interface';
2
+ import { CommonSysUIActionHandler } from '../../utils';
3
+
4
+ /**
5
+ * 常用系统预置界面行为适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-10-25 15:10:51
9
+ * @export
10
+ * @class CommonSysUIActionProvider
11
+ * @implements {IUIActionProvider}
12
+ */
13
+ export class CommonSysUIActionProvider implements IUIActionProvider {
14
+ private handler?: IUIActionHandler;
15
+
16
+ async getHandler(): Promise<IUIActionHandler> {
17
+ if (!this.handler) {
18
+ this.handler = new CommonSysUIActionHandler();
19
+ }
20
+ return this.handler;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ import { IUIActionHandler, IUIActionProvider } from '../../interface';
2
+ import { FrontUIActionHandler } from '../../utils';
3
+
4
+ /**
5
+ * 前台调用界面行为适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-10-25 15:10:51
9
+ * @export
10
+ * @class FrontUIActionProvider
11
+ * @implements {IUIActionProvider}
12
+ */
13
+ export class FrontUIActionProvider implements IUIActionProvider {
14
+ private handler?: IUIActionHandler;
15
+
16
+ async getHandler(): Promise<IUIActionHandler> {
17
+ if (!this.handler) {
18
+ this.handler = new FrontUIActionHandler();
19
+ }
20
+ return this.handler;
21
+ }
22
+ }
@@ -0,0 +1,50 @@
1
+ import { BackendUIActionProvider } from './backend-ui-action-provider';
2
+ import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
3
+ import { FrontUIActionProvider } from './front-ui-action-provider';
4
+
5
+ /**
6
+ * 预置默认的界面行为适配器
7
+ *
8
+ * @author lxm
9
+ * @date 2022-09-19 22:09:50
10
+ * @export
11
+ */
12
+ export function presetUIActionProvider(): void {
13
+ const { uiAction } = ibiz.register;
14
+ if (!uiAction) {
15
+ return;
16
+ }
17
+ // *前台调用
18
+ uiAction.register('FRONT', new FrontUIActionProvider());
19
+ // *后台调用
20
+ uiAction.register('BACKEND', new BackendUIActionProvider());
21
+ // *系统预置界面行为
22
+ // 打开新建数据视图
23
+ uiAction.register('SYS_New', new CommonSysUIActionProvider());
24
+ // 打开编辑数据视图
25
+ uiAction.register('SYS_Edit', new CommonSysUIActionProvider());
26
+ // 保存
27
+ uiAction.register('SYS_Save', new CommonSysUIActionProvider());
28
+ uiAction.register('SYS_SaveAndExit', new CommonSysUIActionProvider());
29
+ uiAction.register('SYS_SaveRow', new CommonSysUIActionProvider());
30
+ uiAction.register('SYS_SaveAndNew', new CommonSysUIActionProvider());
31
+ // 删除
32
+ uiAction.register('SYS_Remove', new CommonSysUIActionProvider());
33
+ uiAction.register('SYS_RemoveAndExit', new CommonSysUIActionProvider());
34
+ uiAction.register('SYS_NewRow', new CommonSysUIActionProvider());
35
+ // 工作流
36
+ uiAction.register('SYS_SaveAndStart', new CommonSysUIActionProvider());
37
+ uiAction.register('SYS_ViewWFStep', new CommonSysUIActionProvider());
38
+ // 其他
39
+ uiAction.register('SYS_ToggleFilter', new CommonSysUIActionProvider());
40
+ uiAction.register('SYS_Exit', new CommonSysUIActionProvider());
41
+ uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
42
+ uiAction.register('SYS_Import', new CommonSysUIActionProvider());
43
+ uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
44
+ }
45
+
46
+ export {
47
+ FrontUIActionProvider,
48
+ CommonSysUIActionProvider,
49
+ BackendUIActionProvider,
50
+ };
@@ -0,0 +1,3 @@
1
+ export * from './register-center';
2
+ export * from './register-base';
3
+ export * from './ui-action-register';
@@ -0,0 +1,27 @@
1
+ import { IRegister } from '../interface';
2
+
3
+ /**
4
+ * 注册器基类
5
+ *
6
+ * @author lxm
7
+ * @date 2022-10-17 16:10:54
8
+ * @export
9
+ * @class RegisterBase
10
+ * @implements {IRegister<T>}
11
+ * @template T
12
+ */
13
+ export class RegisterBase<T> implements IRegister<T> {
14
+ providers: Map<string, T> = new Map();
15
+
16
+ register(key: string, provider: T): void {
17
+ this.providers.set(key, provider);
18
+ }
19
+
20
+ unRegister(key: string): void {
21
+ this.providers.delete(key);
22
+ }
23
+
24
+ getByKey(key: string): T | undefined {
25
+ return this.providers.get(key);
26
+ }
27
+ }
@@ -0,0 +1,20 @@
1
+ import { UIActionRegister } from './ui-action-register';
2
+
3
+ /**
4
+ * 注册中心
5
+ *
6
+ * @author lxm
7
+ * @date 2022-09-19 19:09:10
8
+ * @export
9
+ * @class Register
10
+ */
11
+ export class RegisterCenter {
12
+ /**
13
+ * 界面行为注册器
14
+ *
15
+ * @author lxm
16
+ * @date 2022-10-25 15:10:39
17
+ * @type {UIActionRegister}
18
+ */
19
+ uiAction: UIActionRegister = new UIActionRegister();
20
+ }
@@ -0,0 +1,48 @@
1
+ import { RuntimeError } from '@ibiz-template/core';
2
+ import { IPSAppUIAction } from '@ibiz-template/model';
3
+ import { IUIActionRegister, IUIActionProvider } from '../interface';
4
+ import { RegisterBase } from './register-base';
5
+
6
+ /**
7
+ * 界面行为注册器
8
+ *
9
+ * @author lxm
10
+ * @date 2022-10-25 15:10:38
11
+ * @export
12
+ * @class UIActionRegister
13
+ * @extends {RegisterBase<IUIActionProvider>}
14
+ * @implements {IUIActionRegister}
15
+ */
16
+ export class UIActionRegister
17
+ extends RegisterBase<IUIActionProvider>
18
+ implements IUIActionRegister
19
+ {
20
+ async get(model: IPSAppUIAction): Promise<IUIActionProvider> {
21
+ // 先找插件标识和类型
22
+ if (model.getPSSysPFPlugin()) {
23
+ await ibiz.plugin.loadPlugin(model.getPSSysPFPlugin()!);
24
+ const { pluginType, pluginCode } = model.getPSSysPFPlugin()!;
25
+ const key = `${pluginType}_${pluginCode}`;
26
+ if (this.providers.has(key)) {
27
+ return this.providers.get(key)!;
28
+ }
29
+ throw new RuntimeError(`找不到插件标识${key}对应的适配器`);
30
+ }
31
+ // 找界面行为模式和界面行为标记
32
+ const { uIActionMode, uIActionTag } = model;
33
+ if (uIActionMode === 'SYS') {
34
+ const key = `${uIActionMode}_${uIActionTag}`;
35
+ if (this.providers.has(key)) {
36
+ return this.providers.get(key)!;
37
+ }
38
+ throw new RuntimeError(
39
+ `找不到系统预置界面行为${uIActionTag}对应的适配器`,
40
+ );
41
+ } else {
42
+ if (this.providers.has(uIActionMode)) {
43
+ return this.providers.get(uIActionMode)!;
44
+ }
45
+ throw new RuntimeError(`找不界面行为模式${uIActionMode}对应的适配器`);
46
+ }
47
+ }
48
+ }
package/src/types.ts CHANGED
@@ -6,8 +6,10 @@ import {
6
6
  IOpenViewUtil,
7
7
  IModalUtil,
8
8
  ILoadingUtil,
9
+ IPluginFactory,
10
+ IOverlayController,
9
11
  } from './interface';
10
- import { Register } from './register/register';
12
+ import { RegisterCenter } from './register/register-center';
11
13
 
12
14
  declare module '@ibiz-template/core' {
13
15
  interface IBizSys {
@@ -63,7 +65,22 @@ declare module '@ibiz-template/core' {
63
65
  * @type {IOpenViewUtil}
64
66
  */
65
67
  openView: IOpenViewUtil;
66
-
68
+ /**
69
+ * 全局多种组件呈现工具类
70
+ *
71
+ * @author chitanda
72
+ * @date 2022-11-08 15:11:08
73
+ * @type {IOverlayController}
74
+ */
75
+ overlay: IOverlayController;
76
+ /**
77
+ * 插件工具工厂
78
+ *
79
+ * @author chitanda
80
+ * @date 2022-10-20 16:10:36
81
+ * @type {IPluginFactory}
82
+ */
83
+ plugin: IPluginFactory;
67
84
  /**
68
85
  * 注册中心
69
86
  *
@@ -71,6 +88,6 @@ declare module '@ibiz-template/core' {
71
88
  * @date 2022-09-19 19:09:23
72
89
  * @type {Register}
73
90
  */
74
- register: Register;
91
+ register: RegisterCenter;
75
92
  }
76
93
  }