@ibiz-template/runtime 0.0.1-alpha.1 → 0.0.1-alpha.11

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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/out/command/app/app-func/app-func.d.ts +76 -1
  3. package/out/command/app/app-func/app-func.d.ts.map +1 -1
  4. package/out/command/app/app-func/app-func.js +123 -5
  5. package/out/command/app/open-app-view/open-app-view.d.ts +87 -0
  6. package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -0
  7. package/out/command/app/open-app-view/open-app-view.js +123 -0
  8. package/out/command/index.d.ts +3 -0
  9. package/out/command/index.d.ts.map +1 -1
  10. package/out/command/index.js +3 -0
  11. package/out/constant/index.d.ts +1 -1
  12. package/out/constant/index.d.ts.map +1 -1
  13. package/out/constant/index.js +1 -1
  14. package/out/constant/view-mode.d.ts +31 -0
  15. package/out/constant/view-mode.d.ts.map +1 -0
  16. package/out/constant/view-mode.js +32 -0
  17. package/out/index.d.ts +6 -0
  18. package/out/index.d.ts.map +1 -1
  19. package/out/index.js +6 -0
  20. package/out/install.d.ts.map +1 -1
  21. package/out/install.js +10 -6
  22. package/out/interface/i-modal/i-modal.d.ts +28 -0
  23. package/out/interface/i-modal/i-modal.d.ts.map +1 -0
  24. package/out/interface/i-modal/i-modal.js +1 -0
  25. package/out/interface/i-modal-data/i-modal-data.d.ts +35 -0
  26. package/out/interface/i-modal-data/i-modal-data.d.ts.map +1 -0
  27. package/out/interface/i-modal-data/i-modal-data.js +1 -0
  28. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +27 -0
  29. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -0
  30. package/out/interface/i-ui-action-result/i-ui-action-result.js +1 -0
  31. package/out/interface/index.d.ts +8 -0
  32. package/out/interface/index.d.ts.map +1 -0
  33. package/out/interface/index.js +4 -0
  34. package/out/interface/provider/i-editor-provider.d.ts +38 -0
  35. package/out/interface/provider/i-editor-provider.d.ts.map +1 -0
  36. package/out/interface/provider/i-editor-provider.js +1 -0
  37. package/out/interface/register/i-editor-register.d.ts +23 -0
  38. package/out/interface/register/i-editor-register.d.ts.map +1 -0
  39. package/out/interface/register/i-editor-register.js +1 -0
  40. package/out/interface/register/i-register.d.ts +38 -0
  41. package/out/interface/register/i-register.d.ts.map +1 -0
  42. package/out/interface/register/i-register.js +1 -0
  43. package/out/interface/util/i-loading-util/i-loading-util.d.ts +26 -0
  44. package/out/interface/util/i-loading-util/i-loading-util.d.ts.map +1 -0
  45. package/out/interface/util/i-loading-util/i-loading-util.js +1 -0
  46. package/out/interface/util/i-message-util/i-message-util.d.ts +51 -0
  47. package/out/interface/util/i-message-util/i-message-util.d.ts.map +1 -0
  48. package/out/interface/util/i-message-util/i-message-util.js +1 -0
  49. package/out/interface/util/i-modal-util/i-modal-util.d.ts +83 -0
  50. package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -0
  51. package/out/interface/util/i-modal-util/i-modal-util.js +1 -0
  52. package/out/interface/util/i-notification-util/i-notification-util.d.ts +79 -0
  53. package/out/interface/util/i-notification-util/i-notification-util.d.ts.map +1 -0
  54. package/out/interface/util/i-notification-util/i-notification-util.js +1 -0
  55. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +69 -0
  56. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -0
  57. package/out/interface/util/i-open-view-util/i-open-view-util.js +1 -0
  58. package/out/interface/util/index.d.ts +6 -0
  59. package/out/interface/util/index.d.ts.map +1 -0
  60. package/out/interface/util/index.js +1 -0
  61. package/out/register/register.d.ts +20 -0
  62. package/out/register/register.d.ts.map +1 -0
  63. package/out/register/register.js +10 -0
  64. package/out/types.d.ts +55 -0
  65. package/out/types.d.ts.map +1 -1
  66. package/out/types.js +1 -1
  67. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +87 -0
  68. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -0
  69. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +265 -0
  70. package/out/utils/index.d.ts +4 -0
  71. package/out/utils/index.d.ts.map +1 -0
  72. package/out/utils/index.js +3 -0
  73. package/out/utils/nav-params/nav-params.d.ts +44 -0
  74. package/out/utils/nav-params/nav-params.d.ts.map +1 -0
  75. package/out/utils/nav-params/nav-params.js +95 -0
  76. package/out/utils/open-redirect-view/open-redirect-view.d.ts +42 -0
  77. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -0
  78. package/out/utils/open-redirect-view/open-redirect-view.js +130 -0
  79. package/out/view-logic/index.d.ts +2 -0
  80. package/out/view-logic/index.d.ts.map +1 -0
  81. package/out/view-logic/index.js +1 -0
  82. package/out/view-logic/view-logic.d.ts +43 -0
  83. package/out/view-logic/view-logic.d.ts.map +1 -0
  84. package/out/view-logic/view-logic.js +141 -0
  85. package/package.json +18 -9
  86. package/src/command/app/app-func/app-func.ts +156 -5
  87. package/src/command/app/open-app-view/open-app-view.ts +164 -0
  88. package/src/command/index.ts +4 -0
  89. package/src/constant/index.ts +1 -1
  90. package/src/constant/view-mode.ts +31 -0
  91. package/src/index.ts +6 -0
  92. package/src/install.ts +10 -6
  93. package/src/interface/i-modal/i-modal.ts +29 -0
  94. package/src/interface/i-modal-data/i-modal-data.ts +34 -0
  95. package/src/interface/i-ui-action-result/i-ui-action-result.ts +26 -0
  96. package/src/interface/index.ts +7 -0
  97. package/src/interface/provider/i-editor-provider.ts +44 -0
  98. package/src/interface/register/i-editor-register.ts +23 -0
  99. package/src/interface/register/i-register.ts +40 -0
  100. package/src/interface/util/i-loading-util/i-loading-util.ts +25 -0
  101. package/src/interface/util/i-message-util/i-message-util.ts +50 -0
  102. package/src/interface/util/i-modal-util/i-modal-util.ts +83 -0
  103. package/src/interface/util/i-notification-util/i-notification-util.ts +79 -0
  104. package/src/interface/util/i-open-view-util/i-open-view-util.ts +89 -0
  105. package/src/interface/util/index.ts +8 -0
  106. package/src/register/register.ts +20 -0
  107. package/src/types.ts +62 -0
  108. package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +362 -0
  109. package/src/utils/index.ts +3 -0
  110. package/src/utils/nav-params/nav-params.ts +105 -0
  111. package/src/utils/open-redirect-view/open-redirect-view.ts +168 -0
  112. package/src/view-logic/index.ts +1 -0
  113. package/src/view-logic/view-logic.ts +207 -0
  114. package/out/constant/command/app/app.d.ts +0 -7
  115. package/out/constant/command/app/app.d.ts.map +0 -1
  116. package/out/constant/command/app/app.js +0 -7
  117. package/out/constant/command/command.d.ts +0 -20
  118. package/out/constant/command/command.d.ts.map +0 -1
  119. package/out/constant/command/command.js +0 -18
  120. package/src/constant/command/app/app.ts +0 -7
  121. package/src/constant/command/command.ts +0 -19
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 千反田丷
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,4 @@
1
+ import { IBizContext } from '@ibiz-template/core';
1
2
  import { IPSAppFunc } from '@ibiz-template/model';
2
3
  /**
3
4
  * 执行应用功能
@@ -8,7 +9,81 @@ import { IPSAppFunc } from '@ibiz-template/model';
8
9
  * @class AppFuncCommand
9
10
  */
10
11
  export declare class AppFuncCommand {
12
+ /**
13
+ * 指令标识
14
+ *
15
+ * @author chitanda
16
+ * @date 2022-07-25 17:07:20
17
+ * @see 具体实现 {@link AppFuncCommand.exec}
18
+ * @static
19
+ */
20
+ static readonly TAG = "ibiz.app-func.exec";
11
21
  constructor();
12
- exec(appFunc: IPSAppFunc): Promise<void>;
22
+ /**
23
+ * 执行应用功能
24
+ *
25
+ * @author chitanda
26
+ * @date 2022-07-25 17:07:35
27
+ * @param {IPSAppFunc} appFunc 应用功能模型
28
+ * @param {IBizContext} [context] 执行上下文
29
+ * @param {IParams} [params={}] 参数
30
+ * @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
31
+ * @return {*} {Promise<void>}
32
+ */
33
+ exec(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams, opts?: IData): Promise<void>;
34
+ /**
35
+ * 打开应用视图
36
+ *
37
+ * @author chitanda
38
+ * @date 2022-07-25 18:07:49
39
+ * @protected
40
+ * @param {IPSAppFunc} appFunc
41
+ * @param {IBizContext} [context]
42
+ * @param {IParams} [params]
43
+ * @return {*} {Promise<void>}
44
+ */
45
+ protected openAppView(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams, opts?: IData): Promise<void>;
46
+ /**
47
+ * 打开HTML页面
48
+ *
49
+ * @author chitanda
50
+ * @date 2022-07-25 18:07:56
51
+ * @protected
52
+ * @param {IPSAppFunc} appFunc
53
+ */
54
+ protected openHtmlPage(appFunc: IPSAppFunc): void;
55
+ /**
56
+ * 应用预置功能
57
+ *
58
+ * @author chitanda
59
+ * @date 2022-07-25 18:07:22
60
+ * @protected
61
+ * @param {IPSAppFunc} appFunc
62
+ * @param {IBizContext} [context]
63
+ * @param {IParams} [params]
64
+ */
65
+ protected openPdAppFunc(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
66
+ /**
67
+ * 执行 JavaScript 脚本
68
+ *
69
+ * @author chitanda
70
+ * @date 2022-07-25 18:07:09
71
+ * @protected
72
+ * @param {IPSAppFunc} appFunc
73
+ * @param {IBizContext} [context]
74
+ * @param {IParams} [params]
75
+ */
76
+ protected executeJavaScript(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
77
+ /**
78
+ * 自定义应用功能
79
+ *
80
+ * @author chitanda
81
+ * @date 2022-07-25 18:07:51
82
+ * @protected
83
+ * @param {IPSAppFunc} appFunc
84
+ * @param {IBizContext} [context]
85
+ * @param {IParams} [params]
86
+ */
87
+ protected custom(appFunc: IPSAppFunc, context?: IBizContext, params?: IParams): void;
13
88
  }
14
89
  //# sourceMappingURL=app-func.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-func.d.ts","sourceRoot":"","sources":["../../../../src/command/app/app-func/app-func.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,cAAc;;IAKnB,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
1
+ {"version":3,"file":"app-func.d.ts","sourceRoot":"","sources":["../../../../src/command/app/app-func/app-func.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,wBAAwB;;IAM3C;;;;;;;;;;OAUG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,IAAI,CAAC;IA6BhB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,WAAW,CACnB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,KAAK,GACX,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAKjD;;;;;;;;;OASG;IACH,SAAS,CAAC,aAAa,CACrB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;IAKP;;;;;;;;;OASG;IACH,SAAS,CAAC,iBAAiB,CACzB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;IAKP;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAM,CACd,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,GACf,IAAI;CAIR"}
@@ -1,5 +1,5 @@
1
- import { commands } from '@ibiz-template/command';
2
- import { CommandConst } from '../../../constant';
1
+ import { IBizContext } from '@ibiz-template/core';
2
+ import { OpenAppViewCommand } from '../open-app-view/open-app-view';
3
3
  /**
4
4
  * 执行应用功能
5
5
  *
@@ -10,9 +10,127 @@ import { CommandConst } from '../../../constant';
10
10
  */
11
11
  export class AppFuncCommand {
12
12
  constructor() {
13
- commands.register(CommandConst.app.APP_FUNC_EXEC, this.exec.bind(this));
13
+ ibiz.commands.register(AppFuncCommand.TAG, this.exec.bind(this));
14
14
  }
15
- async exec(appFunc) {
16
- console.log(appFunc);
15
+ /**
16
+ * 执行应用功能
17
+ *
18
+ * @author chitanda
19
+ * @date 2022-07-25 17:07:35
20
+ * @param {IPSAppFunc} appFunc 应用功能模型
21
+ * @param {IBizContext} [context] 执行上下文
22
+ * @param {IParams} [params={}] 参数
23
+ * @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
24
+ * @return {*} {Promise<void>}
25
+ */
26
+ async exec(appFunc, context, params = {}, opts = {}) {
27
+ const navContext = appFunc.getPSNavigateContexts();
28
+ if (navContext) {
29
+ if (context) {
30
+ Object.assign(context, navContext);
31
+ }
32
+ else {
33
+ context = new IBizContext(navContext);
34
+ }
35
+ }
36
+ const navParams = appFunc.getPSNavigateParams();
37
+ if (navParams) {
38
+ Object.assign(params, navParams);
39
+ }
40
+ switch (appFunc.appFuncType) {
41
+ case 'APPVIEW':
42
+ return this.openAppView(appFunc, context, params, opts);
43
+ case 'OPENHTMLPAGE':
44
+ return this.openHtmlPage(appFunc);
45
+ case 'PDTAPPFUNC':
46
+ return this.openPdAppFunc(appFunc, context, params);
47
+ case 'JAVASCRIPT':
48
+ return this.executeJavaScript(appFunc, context, params);
49
+ case 'CUSTOM':
50
+ return this.custom(appFunc, context, params);
51
+ default:
52
+ throw new Error(`未知的应用功能类型: ${appFunc.appFuncType}`);
53
+ }
54
+ }
55
+ /**
56
+ * 打开应用视图
57
+ *
58
+ * @author chitanda
59
+ * @date 2022-07-25 18:07:49
60
+ * @protected
61
+ * @param {IPSAppFunc} appFunc
62
+ * @param {IBizContext} [context]
63
+ * @param {IParams} [params]
64
+ * @return {*} {Promise<void>}
65
+ */
66
+ openAppView(appFunc, context, params, opts) {
67
+ const view = appFunc.getPSAppView();
68
+ if (!view) {
69
+ throw new Error('应用视图不存在');
70
+ }
71
+ return ibiz.commands.execute(OpenAppViewCommand.TAG, view, context, params, opts);
72
+ }
73
+ /**
74
+ * 打开HTML页面
75
+ *
76
+ * @author chitanda
77
+ * @date 2022-07-25 18:07:56
78
+ * @protected
79
+ * @param {IPSAppFunc} appFunc
80
+ */
81
+ openHtmlPage(appFunc) {
82
+ const url = appFunc.htmlPageUrl;
83
+ window.open(url, '_blank');
84
+ }
85
+ /**
86
+ * 应用预置功能
87
+ *
88
+ * @author chitanda
89
+ * @date 2022-07-25 18:07:22
90
+ * @protected
91
+ * @param {IPSAppFunc} appFunc
92
+ * @param {IBizContext} [context]
93
+ * @param {IParams} [params]
94
+ */
95
+ openPdAppFunc(appFunc, context, params) {
96
+ console.log('openPdAppFunc', appFunc, context, params);
97
+ throw new Error('未实现');
98
+ }
99
+ /**
100
+ * 执行 JavaScript 脚本
101
+ *
102
+ * @author chitanda
103
+ * @date 2022-07-25 18:07:09
104
+ * @protected
105
+ * @param {IPSAppFunc} appFunc
106
+ * @param {IBizContext} [context]
107
+ * @param {IParams} [params]
108
+ */
109
+ executeJavaScript(appFunc, context, params) {
110
+ console.log('executeJavaScript', appFunc, context, params);
111
+ throw new Error('未实现');
112
+ }
113
+ /**
114
+ * 自定义应用功能
115
+ *
116
+ * @author chitanda
117
+ * @date 2022-07-25 18:07:51
118
+ * @protected
119
+ * @param {IPSAppFunc} appFunc
120
+ * @param {IBizContext} [context]
121
+ * @param {IParams} [params]
122
+ */
123
+ custom(appFunc, context, params) {
124
+ console.log('custom', appFunc, context, params);
125
+ throw new Error('未实现');
17
126
  }
18
127
  }
128
+ /**
129
+ * 指令标识
130
+ *
131
+ * @author chitanda
132
+ * @date 2022-07-25 17:07:20
133
+ * @see 具体实现 {@link AppFuncCommand.exec}
134
+ * @static
135
+ */
136
+ AppFuncCommand.TAG = 'ibiz.app-func.exec';
@@ -0,0 +1,87 @@
1
+ import { IBizContext } from '@ibiz-template/core';
2
+ import { IPSAppView } from '@ibiz-template/model';
3
+ import { IModalData } from '../../../interface';
4
+ /**
5
+ * 打开应用视图
6
+ *
7
+ * @author chitanda
8
+ * @date 2022-07-25 18:07:20
9
+ * @export
10
+ * @class OpenAppViewCommand
11
+ */
12
+ export declare class OpenAppViewCommand {
13
+ static readonly TAG = "ibiz.app-view.open";
14
+ constructor();
15
+ /**
16
+ * xhr模式打开
17
+ *
18
+ * @author chitanda
19
+ * @date 2022-08-25 23:08:08
20
+ * @param {IPSAppView} appView
21
+ * @param {IBizContext} [context]
22
+ * @param {IParams} [params={}]
23
+ * @param {IData} [_opts={}]
24
+ * @return {*} {(Promise<IModalData | void>)}
25
+ */
26
+ exec(appView: IPSAppView, context?: IBizContext, params?: IParams, _opts?: IData): Promise<IModalData | void>;
27
+ /**
28
+ * 首页导航模式打开
29
+ *
30
+ * @author chitanda
31
+ * @date 2022-07-25 20:07:43
32
+ * @protected
33
+ * @param {IPSAppView} appView
34
+ * @param {IBizContext} [context]
35
+ * @param {IParams} [params={}]
36
+ */
37
+ protected openIndexViewTab(appView: IPSAppView, context?: IBizContext, params?: IParams): void;
38
+ /**
39
+ * 模态窗口打开
40
+ *
41
+ * @author chitanda
42
+ * @date 2022-07-25 20:07:55
43
+ * @protected
44
+ * @param {IPSAppView} appView
45
+ * @param {IBizContext} [context]
46
+ * @param {IParams} [params={}]
47
+ * @return {*} {Promise<IModalData>}
48
+ */
49
+ protected openModal(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
50
+ /**
51
+ * 气泡模式打开
52
+ *
53
+ * @author chitanda
54
+ * @date 2022-07-25 20:07:17
55
+ * @protected
56
+ * @param {IPSAppView} appView
57
+ * @param {IBizContext} [context]
58
+ * @param {IParams} [params={}]
59
+ * @return {*} {Promise<IModalData>}
60
+ */
61
+ protected openPopover(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
62
+ /**
63
+ * 抽屉模式打开
64
+ *
65
+ * @author chitanda
66
+ * @date 2022-07-25 20:07:08
67
+ * @protected
68
+ * @param {IPSAppView} appView
69
+ * @param {IBizContext} [context]
70
+ * @param {IParams} [params={}]
71
+ * @return {*} {Promise<void>}
72
+ */
73
+ protected openDrawer(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
74
+ /**
75
+ * 用户自定义
76
+ *
77
+ * @author chitanda
78
+ * @date 2022-07-25 20:07:41
79
+ * @protected
80
+ * @param {IPSAppView} appView
81
+ * @param {IBizContext} [context]
82
+ * @param {IParams} [params={}]
83
+ * @return {*} {Promise<void>}
84
+ */
85
+ protected openUserCustom(appView: IPSAppView, context?: IBizContext, params?: IParams): Promise<IModalData>;
86
+ }
87
+ //# sourceMappingURL=open-app-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-app-view.d.ts","sourceRoot":"","sources":["../../../../src/command/app/open-app-view/open-app-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAsB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD;;;;;;;GAOG;AACH,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,GAAG,wBAAwB;;IAM3C;;;;;;;;;;OAUG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,EACpB,KAAK,GAAE,KAAU,GAChB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAkC7B;;;;;;;;;OASG;IACH,SAAS,CAAC,gBAAgB,CACxB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,IAAI;IAIP;;;;;;;;;;OAUG;cACa,SAAS,CACvB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,WAAW,CACzB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,UAAU,CACxB,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;IAItB;;;;;;;;;;OAUG;cACa,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,UAAU,CAAC;CAGvB"}
@@ -0,0 +1,123 @@
1
+ import { openRedirectView } from '../../../utils';
2
+ /**
3
+ * 打开应用视图
4
+ *
5
+ * @author chitanda
6
+ * @date 2022-07-25 18:07:20
7
+ * @export
8
+ * @class OpenAppViewCommand
9
+ */
10
+ export class OpenAppViewCommand {
11
+ constructor() {
12
+ ibiz.commands.register(OpenAppViewCommand.TAG, this.exec.bind(this));
13
+ }
14
+ /**
15
+ * xhr模式打开
16
+ *
17
+ * @author chitanda
18
+ * @date 2022-08-25 23:08:08
19
+ * @param {IPSAppView} appView
20
+ * @param {IBizContext} [context]
21
+ * @param {IParams} [params={}]
22
+ * @param {IData} [_opts={}]
23
+ * @return {*} {(Promise<IModalData | void>)}
24
+ */
25
+ async exec(appView, context, params = {}, _opts = {}) {
26
+ await appView.fill(true);
27
+ if (appView.redirectView) {
28
+ return openRedirectView(appView, context, params, _opts.data);
29
+ }
30
+ const { openMode = 'INDEXVIEWTAB' } = appView;
31
+ switch (openMode) {
32
+ case 'INDEXVIEWTAB':
33
+ return this.openIndexViewTab(appView, context, params);
34
+ case 'POPUP':
35
+ throw new Error('未支持的视图打开模式: POPUP');
36
+ case 'POPUPMODAL':
37
+ return this.openModal(appView, context, params);
38
+ case 'POPUPAPP':
39
+ throw new Error('未支持的视图打开模式: POPUPAPP');
40
+ case 'POPOVER':
41
+ return this.openPopover(appView, context, params);
42
+ case 'DRAWER_LEFT':
43
+ case 'DRAWER_RIGHT':
44
+ case 'DRAWER_TOP':
45
+ case 'DRAWER_BOTTOM':
46
+ return this.openDrawer(appView, context, params);
47
+ case 'USER':
48
+ return this.openUserCustom(appView, context, params);
49
+ default:
50
+ return this.openIndexViewTab(appView, context, params);
51
+ }
52
+ }
53
+ /**
54
+ * 首页导航模式打开
55
+ *
56
+ * @author chitanda
57
+ * @date 2022-07-25 20:07:43
58
+ * @protected
59
+ * @param {IPSAppView} appView
60
+ * @param {IBizContext} [context]
61
+ * @param {IParams} [params={}]
62
+ */
63
+ openIndexViewTab(appView, context, params = {}) {
64
+ return ibiz.openView.root(appView, context, params);
65
+ }
66
+ /**
67
+ * 模态窗口打开
68
+ *
69
+ * @author chitanda
70
+ * @date 2022-07-25 20:07:55
71
+ * @protected
72
+ * @param {IPSAppView} appView
73
+ * @param {IBizContext} [context]
74
+ * @param {IParams} [params={}]
75
+ * @return {*} {Promise<IModalData>}
76
+ */
77
+ async openModal(appView, context, params = {}) {
78
+ return ibiz.openView.modal(appView, context, params);
79
+ }
80
+ /**
81
+ * 气泡模式打开
82
+ *
83
+ * @author chitanda
84
+ * @date 2022-07-25 20:07:17
85
+ * @protected
86
+ * @param {IPSAppView} appView
87
+ * @param {IBizContext} [context]
88
+ * @param {IParams} [params={}]
89
+ * @return {*} {Promise<IModalData>}
90
+ */
91
+ async openPopover(appView, context, params = {}) {
92
+ return ibiz.openView.popover(appView, context, params);
93
+ }
94
+ /**
95
+ * 抽屉模式打开
96
+ *
97
+ * @author chitanda
98
+ * @date 2022-07-25 20:07:08
99
+ * @protected
100
+ * @param {IPSAppView} appView
101
+ * @param {IBizContext} [context]
102
+ * @param {IParams} [params={}]
103
+ * @return {*} {Promise<void>}
104
+ */
105
+ async openDrawer(appView, context, params = {}) {
106
+ return ibiz.openView.drawer(appView, context, params);
107
+ }
108
+ /**
109
+ * 用户自定义
110
+ *
111
+ * @author chitanda
112
+ * @date 2022-07-25 20:07:41
113
+ * @protected
114
+ * @param {IPSAppView} appView
115
+ * @param {IBizContext} [context]
116
+ * @param {IParams} [params={}]
117
+ * @return {*} {Promise<void>}
118
+ */
119
+ async openUserCustom(appView, context, params = {}) {
120
+ return ibiz.openView.custom(appView, context, params);
121
+ }
122
+ }
123
+ OpenAppViewCommand.TAG = 'ibiz.app-view.open';
@@ -1,3 +1,5 @@
1
+ import { AppFuncCommand } from './app/app-func/app-func';
2
+ import { OpenAppViewCommand } from './app/open-app-view/open-app-view';
1
3
  /**
2
4
  * 安装指令
3
5
  *
@@ -6,4 +8,5 @@
6
8
  * @export
7
9
  */
8
10
  export declare function installCommand(): void;
11
+ export { AppFuncCommand, OpenAppViewCommand };
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { AppFuncCommand } from './app/app-func/app-func';
2
+ import { OpenAppViewCommand } from './app/open-app-view/open-app-view';
2
3
  /**
3
4
  * 安装指令
4
5
  *
@@ -8,4 +9,6 @@ import { AppFuncCommand } from './app/app-func/app-func';
8
9
  */
9
10
  export function installCommand() {
10
11
  new AppFuncCommand();
12
+ new OpenAppViewCommand();
11
13
  }
14
+ export { AppFuncCommand, OpenAppViewCommand };
@@ -1,2 +1,2 @@
1
- export { CommandConst } from './command/command';
1
+ export * from './view-mode';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- export { CommandConst } from './command/command';
1
+ export * from './view-mode';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 视图打开方式
3
+ *
4
+ * @author lxm
5
+ * @date 2022-09-01 10:09:04
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum ViewMode {
10
+ /**
11
+ * 路由(默认)
12
+ */
13
+ ROUTE = "ROUTE",
14
+ /**
15
+ * 模态
16
+ */
17
+ MODAL = "MODAL",
18
+ /**
19
+ * 抽屉
20
+ */
21
+ DRAWER = "DRAWER",
22
+ /**
23
+ * 嵌入
24
+ */
25
+ EMBED = "EMBED",
26
+ /**
27
+ * 气泡
28
+ */
29
+ POPOVER = "POPOVER"
30
+ }
31
+ //# sourceMappingURL=view-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-mode.d.ts","sourceRoot":"","sources":["../../src/constant/view-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,OAAO,YAAY;CACpB"}
@@ -0,0 +1,32 @@
1
+ /* eslint-disable no-shadow */
2
+ /**
3
+ * 视图打开方式
4
+ *
5
+ * @author lxm
6
+ * @date 2022-09-01 10:09:04
7
+ * @export
8
+ * @enum {number}
9
+ */
10
+ export var ViewMode;
11
+ (function (ViewMode) {
12
+ /**
13
+ * 路由(默认)
14
+ */
15
+ ViewMode["ROUTE"] = "ROUTE";
16
+ /**
17
+ * 模态
18
+ */
19
+ ViewMode["MODAL"] = "MODAL";
20
+ /**
21
+ * 抽屉
22
+ */
23
+ ViewMode["DRAWER"] = "DRAWER";
24
+ /**
25
+ * 嵌入
26
+ */
27
+ ViewMode["EMBED"] = "EMBED";
28
+ /**
29
+ * 气泡
30
+ */
31
+ ViewMode["POPOVER"] = "POPOVER";
32
+ })(ViewMode || (ViewMode = {}));
package/out/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
1
  import './types';
2
2
  export { install } from './install';
3
+ export * from './command';
4
+ export * from './constant';
5
+ export * from './interface';
6
+ export * from './register/register';
7
+ export * from './utils';
8
+ export * from './view-logic';
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/out/index.js CHANGED
@@ -1,2 +1,8 @@
1
1
  import './types';
2
2
  export { install } from './install';
3
+ export * from './command';
4
+ export * from './constant';
5
+ export * from './interface';
6
+ export * from './register/register';
7
+ export * from './utils';
8
+ export * from './view-logic';
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAI9B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAQ9B"}
package/out/install.js CHANGED
@@ -1,6 +1,6 @@
1
- import { install as useCore } from '@ibiz-template/core';
2
- import { install as useService } from '@ibiz-template/service';
3
- import { install as useController } from '@ibiz-template/controller';
1
+ import { commands } from '@ibiz-template/command';
2
+ import { Register } from './register/register';
3
+ import { installCommand } from './command';
4
4
  /**
5
5
  * 安装运行时
6
6
  *
@@ -9,7 +9,11 @@ import { install as useController } from '@ibiz-template/controller';
9
9
  * @export
10
10
  */
11
11
  export function install() {
12
- useCore();
13
- useService();
14
- useController();
12
+ const { ibiz } = window;
13
+ // 挂载指令控制器
14
+ ibiz.commands = commands;
15
+ // 挂载注册中心
16
+ ibiz.register = new Register();
17
+ // 安装默认指令
18
+ installCommand();
15
19
  }
@@ -0,0 +1,28 @@
1
+ import { ViewMode } from '../../constant';
2
+ /**
3
+ * 模态操作对象,在模态等形式打开视图时,操作类需给视图注入此对象实现类
4
+ *
5
+ * @author chitanda
6
+ * @date 2022-08-17 18:08:20
7
+ * @export
8
+ * @interface IModal
9
+ */
10
+ export interface IModal {
11
+ /**
12
+ * 打开方式(默认路由)
13
+ *
14
+ * @author lxm
15
+ * @date 2022-09-01 10:09:15
16
+ * @type {string}
17
+ */
18
+ mode: ViewMode;
19
+ /**
20
+ * 关闭模态窗
21
+ *
22
+ * @author chitanda
23
+ * @date 2022-08-17 18:08:58
24
+ * @param {(IData | IData[])} data
25
+ */
26
+ dismiss?: (data?: IData | IData[]) => void;
27
+ }
28
+ //# sourceMappingURL=i-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-modal.d.ts","sourceRoot":"","sources":["../../../src/interface/i-modal/i-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;OAMG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,CAAC;CAC5C"}
@@ -0,0 +1 @@
1
+ export {};