@gct-paas/core 0.0.1-dev.6 → 0.0.1-dev.7

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 (122) hide show
  1. package/dist/index.min.cjs +1 -1
  2. package/dist/index.system.min.js +1 -1
  3. package/es/_virtual/_commonjsHelpers.mjs +40 -0
  4. package/es/_virtual/index.mjs +7 -0
  5. package/es/constants/index.d.ts +1 -1
  6. package/es/constants/index.mjs +1 -1
  7. package/es/enums/app-designer/index.d.ts +80 -0
  8. package/es/enums/app-designer/index.mjs +58 -0
  9. package/es/enums/appEnum.d.ts +605 -0
  10. package/es/enums/appEnum.mjs +356 -0
  11. package/es/enums/appStateEnum.d.ts +14 -0
  12. package/es/enums/appStateEnum.mjs +12 -0
  13. package/es/enums/authActionEnum.d.ts +50 -0
  14. package/es/enums/authActionEnum.mjs +55 -0
  15. package/es/enums/breakpointEnum.d.ts +18 -0
  16. package/es/enums/breakpointEnum.mjs +28 -0
  17. package/es/enums/cacheEnum.d.ts +19 -0
  18. package/es/enums/cacheEnum.mjs +23 -0
  19. package/es/enums/designEnum.d.ts +82 -0
  20. package/es/enums/designEnum.mjs +72 -0
  21. package/es/enums/exceptionEnum.d.ts +17 -0
  22. package/es/enums/exceptionEnum.mjs +19 -0
  23. package/es/enums/httpEnum.d.ts +65 -0
  24. package/es/enums/httpEnum.mjs +63 -0
  25. package/es/enums/index.d.ts +15 -0
  26. package/es/enums/index.mjs +21 -0
  27. package/es/enums/menuEnum.d.ts +35 -0
  28. package/es/enums/menuEnum.mjs +40 -0
  29. package/es/enums/page-designer/designer.d.ts +277 -0
  30. package/es/enums/page-designer/designer.mjs +330 -0
  31. package/es/enums/page-designer/index.d.ts +4 -0
  32. package/es/enums/page-designer/index.mjs +6 -0
  33. package/es/enums/page-designer/panel.d.ts +243 -0
  34. package/es/enums/page-designer/panel.mjs +195 -0
  35. package/es/enums/page-designer/toolkit.d.ts +10 -0
  36. package/es/enums/page-designer/toolkit.mjs +14 -0
  37. package/es/enums/page-designer/widget.d.ts +316 -0
  38. package/es/enums/page-designer/widget.mjs +335 -0
  39. package/es/enums/pageEnum.d.ts +11 -0
  40. package/es/enums/pageEnum.mjs +15 -0
  41. package/es/enums/processEnum.d.ts +35 -0
  42. package/es/enums/processEnum.mjs +28 -0
  43. package/es/enums/roleEnum.d.ts +4 -0
  44. package/es/enums/roleEnum.mjs +8 -0
  45. package/es/enums/sizeEnum.d.ts +5 -0
  46. package/es/enums/sizeEnum.mjs +9 -0
  47. package/es/global/gct/gct.d.ts +47 -0
  48. package/es/global/gct/gct.mjs +49 -0
  49. package/es/global/index.d.ts +1 -0
  50. package/es/global/index.mjs +3 -0
  51. package/es/index.d.ts +14 -0
  52. package/es/index.mjs +41 -0
  53. package/es/interface/controller/i-designer-controller.d.ts +116 -0
  54. package/es/interface/controller/i-designer-controller.mjs +1 -0
  55. package/es/interface/controller/index.d.ts +1 -0
  56. package/es/interface/controller/index.mjs +1 -0
  57. package/es/interface/hooks/i-designer-hooks.d.ts +26 -0
  58. package/es/interface/hooks/i-designer-hooks.mjs +3 -0
  59. package/es/interface/hooks/index.d.ts +1 -0
  60. package/es/interface/hooks/index.mjs +1 -0
  61. package/es/interface/i-import-style-map/i-import-style-map.d.ts +15 -0
  62. package/es/interface/i-import-style-map/i-import-style-map.mjs +1 -0
  63. package/es/interface/i-pinia-action/i-global-actions.d.ts +14 -0
  64. package/es/interface/i-pinia-action/i-global-actions.mjs +1 -0
  65. package/es/interface/i-pinia-getter/i-global-getters.d.ts +16 -0
  66. package/es/interface/i-pinia-getter/i-global-getters.mjs +1 -0
  67. package/es/interface/i-pinia-state/i-global-state.d.ts +15 -0
  68. package/es/interface/i-pinia-state/i-global-state.mjs +1 -0
  69. package/es/interface/index.d.ts +8 -0
  70. package/es/interface/index.mjs +6 -0
  71. package/es/interface/low-code-types/index.d.ts +4 -0
  72. package/es/interface/low-code-types/index.mjs +5 -0
  73. package/es/interface/low-code-types/modal-types.d.ts +67 -0
  74. package/es/interface/low-code-types/modal-types.mjs +3 -0
  75. package/es/interface/low-code-types/model/index.d.ts +5338 -0
  76. package/es/interface/low-code-types/model/index.mjs +1 -0
  77. package/es/interface/low-code-types/schema/index.d.ts +12 -0
  78. package/es/interface/low-code-types/schema/index.mjs +1 -0
  79. package/es/interface/low-code-types/widget-basic-types.d.ts +655 -0
  80. package/es/interface/low-code-types/widget-basic-types.mjs +3 -0
  81. package/es/interface/state/i-designer-state.d.ts +39 -0
  82. package/es/interface/state/i-designer-state.mjs +1 -0
  83. package/es/interface/state/index.d.ts +1 -0
  84. package/es/interface/state/index.mjs +1 -0
  85. package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +541 -0
  86. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/async-series-hook/async-series-hook.mjs +73 -0
  87. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/index.mjs +2 -0
  88. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs +100 -0
  89. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs +2 -0
  90. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/array/array.mjs +47 -0
  91. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/index.mjs +5 -0
  92. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/object/object.mjs +24 -0
  93. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event/qx-event.mjs +94 -0
  94. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event-emitter/qx-event-emitter.mjs +146 -0
  95. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/type-util/type-util.mjs +149 -0
  96. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/util/util.mjs +227 -0
  97. package/es/provider/i-designer-provider/i-designer-provider.d.ts +102 -0
  98. package/es/provider/i-designer-provider/i-designer-provider.mjs +1 -0
  99. package/es/provider/index.d.ts +1 -0
  100. package/es/provider/index.mjs +1 -0
  101. package/es/register/designer-register/designer-register.d.ts +58 -0
  102. package/es/register/designer-register/designer-register.mjs +70 -0
  103. package/es/register/index.d.ts +2 -0
  104. package/es/register/index.mjs +4 -0
  105. package/es/register/render-register/render-register.d.ts +59 -0
  106. package/es/register/render-register/render-register.mjs +65 -0
  107. package/es/state/global-pinia-state/global-pinia-state.d.ts +16 -0
  108. package/es/state/global-pinia-state/global-pinia-state.mjs +11 -0
  109. package/es/state/index.d.ts +1 -0
  110. package/es/state/index.mjs +3 -0
  111. package/es/store/global-store.d.ts +2 -0
  112. package/es/store/global-store.mjs +22 -0
  113. package/es/store/index.d.ts +20 -0
  114. package/es/store/index.mjs +21 -0
  115. package/es/types/index.d.ts +46 -0
  116. package/es/utils/index.d.ts +2 -0
  117. package/es/utils/index.mjs +2 -0
  118. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +17 -0
  119. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +27 -0
  120. package/es/utils/plugin-static-resource/plugin-static-resource.d.ts +41 -0
  121. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -0
  122. package/package.json +15 -5
@@ -0,0 +1,227 @@
1
+ import { isArray, isString, isObject, isMap, isSet } from '../type-util/type-util.mjs';
2
+
3
+ /* eslint-disable no-restricted-globals */
4
+ /**
5
+ * 生成唯一标识
6
+ *
7
+ * @export
8
+ * @return {*} {string}
9
+ */
10
+ function S4() {
11
+ // eslint-disable-next-line no-bitwise
12
+ return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
13
+ }
14
+ function createUUID() {
15
+ return `${S4() + S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`;
16
+ }
17
+ /**
18
+ * 设置cookie
19
+ *
20
+ * @static
21
+ * @param {*} name 名称
22
+ * @param {*} value 值
23
+ * @param {*} day 过期天数
24
+ * @param {boolean} [isDomain=false] 是否设置在主域下
25
+ * @param {string} [path='/'] 默认归属路径
26
+ * @memberof Util
27
+ */
28
+ function setCookie(name, value, day = 0, isDomain = false, path = '/') {
29
+ let domain = '';
30
+ // 设置cookie到主域下
31
+ if (isDomain) {
32
+ // 是否为ip正则
33
+ const regExpr = /^(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)$/;
34
+ // 为ip时忽略
35
+ if (!regExpr.test(location.hostname)) {
36
+ const host = location.hostname;
37
+ if (host.indexOf('.') !== host.lastIndexOf('.')) {
38
+ domain = `;domain=${host.substring(host.indexOf('.'), host.length)}`;
39
+ }
40
+ }
41
+ }
42
+ // 当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除
43
+ if (day !== 0) {
44
+ const expires = day * 24 * 60 * 60 * 1000;
45
+ const date = new Date(new Date().getTime() + expires);
46
+ document.cookie = `${name}=${escape(value)};path=${path};expires=${date.toUTCString()}${domain}`;
47
+ }
48
+ else {
49
+ document.cookie = `${name}=${escape(value)};path=${path}${domain}`;
50
+ }
51
+ }
52
+ /**
53
+ * 清除cookie
54
+ *
55
+ * @static
56
+ * @param {string} cookieName
57
+ * @param {boolean} [isDomain] 是否在主域下
58
+ * @memberof Util
59
+ */
60
+ function clearCookie(cookieName, isDomain) {
61
+ setCookie(cookieName, '', -1, isDomain);
62
+ }
63
+ /**
64
+ * 获取cookie
65
+ *
66
+ * @static
67
+ * @param {string} name
68
+ * @return {*} {*}
69
+ * @memberof Util
70
+ */
71
+ function getCookie(name) {
72
+ const reg = new RegExp(`(^| )${name}=([^;]*)(;|$)`);
73
+ const arr = document.cookie.match(reg);
74
+ if (arr && arr.length > 1) {
75
+ return unescape(arr[2]);
76
+ }
77
+ return null;
78
+ }
79
+ /**
80
+ * 内部使用,是否为 null
81
+ *
82
+ * @author chitanda
83
+ * @date 2022-09-07 23:09:09
84
+ * @param {unknown} value
85
+ * @return {*} {boolean}
86
+ */
87
+ function isNil(value) {
88
+ return value == null;
89
+ }
90
+ /**
91
+ * 判断 对象、数组 以及字符串是否为空
92
+ *
93
+ * @author chitanda
94
+ * @date 2022-09-07 23:09:02
95
+ * @param {unknown} data
96
+ * @return {*} {boolean}
97
+ */
98
+ function isEmpty(data) {
99
+ if (isArray(data) || isString(data)) {
100
+ return data.length === 0;
101
+ }
102
+ if (isObject(data)) {
103
+ for (const key in data) {
104
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
105
+ return false;
106
+ }
107
+ }
108
+ return true;
109
+ }
110
+ if (isMap(data) || isSet(data)) {
111
+ return data.size === 0;
112
+ }
113
+ return data == null;
114
+ }
115
+ /**
116
+ * 存在并且不等于空,支持数据类型对象、数组、字符串。例:[]、{}都算为空值。
117
+ *
118
+ * @export
119
+ * @param {*} data
120
+ * @return {*} {boolean}
121
+ */
122
+ function notNilEmpty(data) {
123
+ if (!isNil(data) && !isEmpty(data)) {
124
+ return true;
125
+ }
126
+ return false;
127
+ }
128
+ /**
129
+ * 在当前类型中,不存在或者为空值。例:[]、{}都算为空值。
130
+ *
131
+ * @export
132
+ * @param {*} data
133
+ * @return {*} {boolean}
134
+ */
135
+ function isNilOrEmpty(data) {
136
+ if (isNil(data) || isEmpty(data)) {
137
+ return true;
138
+ }
139
+ return false;
140
+ }
141
+ /**
142
+ * 默认生成排序值方法
143
+ *
144
+ * @export
145
+ * @param {number} index 所在数据集下标
146
+ * @return {*} {number}
147
+ */
148
+ function generateOrderValue(index) {
149
+ return (index + 1) * 100;
150
+ }
151
+ /**
152
+ * 获取query查询数据
153
+ *
154
+ * @author chitanda
155
+ * @date 2021-05-18 11:05:34
156
+ * @export
157
+ * @param {string} variable 变量标识
158
+ * @param {string} [query=location.search] 指定query,模型从 location.search 取
159
+ * @return {*} {*}
160
+ */
161
+ function getQueryVariable(variable, query = location.search) {
162
+ if (query.startsWith('?')) {
163
+ query = query.substring(1);
164
+ }
165
+ const vars = query.split('&');
166
+ for (let i = 0; i < vars.length; i++) {
167
+ const pair = vars[i].split('=');
168
+ // eslint-disable-next-line eqeqeq
169
+ if (pair[0] == variable) {
170
+ return pair[1];
171
+ }
172
+ }
173
+ return false;
174
+ }
175
+ /**
176
+ * 请求参数转义处理
177
+ *
178
+ * @author chitanda
179
+ * @date 2021-05-31 16:05:48
180
+ * @export
181
+ * @param {Record<string, any>} opt
182
+ * @return {*} {string}
183
+ */
184
+ function formatHttpParams(opt) {
185
+ const params = {};
186
+ const postData = [];
187
+ Object.assign(params, opt);
188
+ const keys = Object.keys(params);
189
+ keys.forEach((key) => {
190
+ const val = params[key];
191
+ if (val instanceof Array || val instanceof Object) {
192
+ postData.push(`${key}=${encodeURIComponent(JSON.stringify(val))}`);
193
+ }
194
+ else {
195
+ postData.push(`${key}=${encodeURIComponent(val)}`);
196
+ }
197
+ });
198
+ return postData.join('&');
199
+ }
200
+ /**
201
+ * url最后补充query参数
202
+ *
203
+ * @author chitanda
204
+ * @date 2021-05-31 16:05:55
205
+ * @export
206
+ * @param {string} url
207
+ * @param {*} params
208
+ * @return {*} {string}
209
+ */
210
+ function setUrlQuery(url, params) {
211
+ const _strParams = formatHttpParams(params);
212
+ if (url.endsWith('?')) {
213
+ url = `${url}${_strParams}`;
214
+ }
215
+ else if (url.indexOf('?') !== -1 && url.endsWith('&')) {
216
+ url = `${url}${_strParams}`;
217
+ }
218
+ else if (url.indexOf('?') !== -1 && !url.endsWith('&')) {
219
+ url = `${url}&${_strParams}`;
220
+ }
221
+ else {
222
+ url = `${url}?${_strParams}`;
223
+ }
224
+ return url;
225
+ }
226
+
227
+ export { clearCookie, createUUID, formatHttpParams, generateOrderValue, getCookie, getQueryVariable, isNilOrEmpty, notNilEmpty, setCookie, setUrlQuery };
@@ -0,0 +1,102 @@
1
+ import { Component } from 'vue';
2
+ import { LowCodeWidget } from '../../interface';
3
+ /**
4
+ * 设计界面项
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-05-24 13:05:47
8
+ * @export
9
+ * @interface IDesignerProvider
10
+ */
11
+ export interface IDesignerProvider {
12
+ /**
13
+ * 套件类别,用于识别可使用的系统。取 getApp 中的 suiteKey,例如 MedPro 使用 kit=['MEDPRO']
14
+ *
15
+ * @author zhanghanrui
16
+ * @date 2024-05-28 09:05:32
17
+ * @type {string[]}
18
+ */
19
+ kit?: string[];
20
+ /**
21
+ * 项拖拽钩子
22
+ *
23
+ * @type {LowCodeWidget.hooks}
24
+ */
25
+ hooks?: LowCodeWidget.hooks;
26
+ /**
27
+ * 白名单,只允许在白名单中的组件拖入
28
+ *
29
+ * @type {(string | RegExp)[]}
30
+ */
31
+ whiteList?: (string | RegExp)[];
32
+ /**
33
+ * 黑名单,不允许拖入黑名单中的组件
34
+ *
35
+ * @type {(string | RegExp)[]}
36
+ */
37
+ blackList?: (string | RegExp)[];
38
+ /**
39
+ * render 绘制组件,目前只支持异步组件
40
+ *
41
+ * @author zhanghanrui
42
+ * @date 2024-05-24 17:05:17
43
+ * @type {Component}
44
+ */
45
+ component: Component;
46
+ /**
47
+ * 基础组件描述
48
+ *
49
+ * @author zhanghanrui
50
+ * @date 2024-05-24 16:05:12
51
+ * @type {LowCodeWidget.BasicSchema}
52
+ */
53
+ schema: LowCodeWidget.BasicSchema;
54
+ /**
55
+ * 组件支持配置事件描述
56
+ *
57
+ * @author zhanghanrui
58
+ * @date 2024-05-24 16:05:17
59
+ * @type {LowCodeWidget.EventsType[]}
60
+ */
61
+ events?: LowCodeWidget.EventsType[];
62
+ /**
63
+ * 组件右侧属性表单模型描述
64
+ *
65
+ * @author zhanghanrui
66
+ * @date 2024-05-24 16:05:43
67
+ * @type {LowCodeWidget.PropEditor[]}
68
+ */
69
+ propEditors: LowCodeWidget.PropEditor[];
70
+ /**
71
+ * 保存时钩子函数
72
+ *
73
+ * @author zhanghanrui
74
+ * @date 2024-05-24 18:05:15
75
+ * @type {LowCodeWidget.RunCallback}
76
+ */
77
+ callback?: LowCodeWidget.RunCallback;
78
+ /**
79
+ * 拖入时钩子函数
80
+ *
81
+ * @author zhanghanrui
82
+ * @date 2024-05-24 18:05:13
83
+ * @type {LowCodeWidget.beforeCreate}
84
+ */
85
+ beforeCreate?: LowCodeWidget.beforeCreate;
86
+ /**
87
+ * 样式编辑器配置
88
+ *
89
+ * @author zhanghanrui
90
+ * @date 2024-05-24 16:05:14
91
+ * @type {LowCodeWidget.StyleEditor[]}
92
+ */
93
+ styleEditors?: LowCodeWidget.StyleEditor[];
94
+ /**
95
+ * 设计页面配置信息
96
+ *
97
+ * @author zhanghanrui
98
+ * @date 2024-05-24 16:05:30
99
+ * @type {LowCodeWidget.DesignerConfig}
100
+ */
101
+ designerConfig?: LowCodeWidget.DesignerConfig;
102
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export type { IDesignerProvider } from './i-designer-provider/i-designer-provider';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,58 @@
1
+ import { SyncSeriesHook } from 'qx-util';
2
+ import { IDesignerProvider } from '../../provider';
3
+ /**
4
+ * 设计界面组件注册
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-05-24 16:05:18
8
+ * @export
9
+ * @class DesignerRegister
10
+ */
11
+ export declare class DesignerRegister {
12
+ /**
13
+ * 已注册组件
14
+ *
15
+ * @author zhanghanrui
16
+ * @date 2024-05-24 16:05:36
17
+ * @protected
18
+ */
19
+ protected map: Map<string, () => IDesignerProvider>;
20
+ private providers;
21
+ readonly hooks: {
22
+ register: SyncSeriesHook<IDesignerProvider, null>;
23
+ unregister: SyncSeriesHook<IDesignerProvider, null>;
24
+ };
25
+ /**
26
+ * 设计器项适配器注册
27
+ *
28
+ * @author zhanghanrui
29
+ * @date 2024-05-24 16:05:45
30
+ * @param {string} tag 适配器标识
31
+ * @param {() => IDesignerProvider} provider 设计器项
32
+ */
33
+ register(tag: string, provider: () => IDesignerProvider): void;
34
+ /**
35
+ * 设计器项适配器注销
36
+ *
37
+ * @author zhanghanrui
38
+ * @date 2024-05-24 16:05:55
39
+ * @param {string} tag
40
+ */
41
+ unregister(tag: string): void;
42
+ /**
43
+ * 获取当前所有组件 keys
44
+ *
45
+ * @author zhanghanrui
46
+ * @date 2024-05-24 17:05:56
47
+ * @return {*} {string[]}
48
+ */
49
+ getKeys(): string[];
50
+ /**
51
+ * 获取现有所有适配器
52
+ *
53
+ * @author zhanghanrui
54
+ * @date 2024-05-24 18:05:25
55
+ * @return {*} {IDesignerProvider[]}
56
+ */
57
+ getProviders(): IDesignerProvider[];
58
+ }
@@ -0,0 +1,70 @@
1
+ import '../../node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs';
2
+ import { SyncSeriesHook } from '../../node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs';
3
+
4
+ "use strict";
5
+ class DesignerRegister {
6
+ /**
7
+ * 已注册组件
8
+ *
9
+ * @author zhanghanrui
10
+ * @date 2024-05-24 16:05:36
11
+ * @protected
12
+ */
13
+ map = /* @__PURE__ */ new Map();
14
+ providers = /* @__PURE__ */ new Map();
15
+ hooks = {
16
+ register: new SyncSeriesHook(),
17
+ unregister: new SyncSeriesHook()
18
+ };
19
+ /**
20
+ * 设计器项适配器注册
21
+ *
22
+ * @author zhanghanrui
23
+ * @date 2024-05-24 16:05:45
24
+ * @param {string} tag 适配器标识
25
+ * @param {() => IDesignerProvider} provider 设计器项
26
+ */
27
+ register(tag, provider) {
28
+ this.map.set(tag, provider);
29
+ const instance = provider();
30
+ this.providers.set(tag, instance);
31
+ this.hooks.register.callSync(null, instance);
32
+ }
33
+ /**
34
+ * 设计器项适配器注销
35
+ *
36
+ * @author zhanghanrui
37
+ * @date 2024-05-24 16:05:55
38
+ * @param {string} tag
39
+ */
40
+ unregister(tag) {
41
+ this.map.delete(tag);
42
+ const instance = this.providers.get(tag);
43
+ if (instance) {
44
+ this.hooks.unregister.callSync(null, instance);
45
+ this.providers.delete(tag);
46
+ }
47
+ }
48
+ /**
49
+ * 获取当前所有组件 keys
50
+ *
51
+ * @author zhanghanrui
52
+ * @date 2024-05-24 17:05:56
53
+ * @return {*} {string[]}
54
+ */
55
+ getKeys() {
56
+ return Array.from(this.map.keys());
57
+ }
58
+ /**
59
+ * 获取现有所有适配器
60
+ *
61
+ * @author zhanghanrui
62
+ * @date 2024-05-24 18:05:25
63
+ * @return {*} {IDesignerProvider[]}
64
+ */
65
+ getProviders() {
66
+ return Array.from(this.providers.values());
67
+ }
68
+ }
69
+
70
+ export { DesignerRegister };
@@ -0,0 +1,2 @@
1
+ export { DesignerRegister } from './designer-register/designer-register';
2
+ export { RenderRegister } from './render-register/render-register';
@@ -0,0 +1,4 @@
1
+ export { DesignerRegister } from './designer-register/designer-register.mjs';
2
+ export { RenderRegister } from './render-register/render-register.mjs';
3
+
4
+ "use strict";
@@ -0,0 +1,59 @@
1
+ import { SyncSeriesHook } from 'qx-util';
2
+ import { Component } from 'vue';
3
+ /**
4
+ * 绘制组件注册
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-05-25 08:05:52
8
+ * @export
9
+ * @class RenderRegister
10
+ */
11
+ export declare class RenderRegister {
12
+ /**
13
+ * 组件清单
14
+ *
15
+ * @author zhanghanrui
16
+ * @date 2024-05-25 08:05:03
17
+ * @protected
18
+ * @type {Map<string, Component>}
19
+ */
20
+ protected map: Map<string, Component>;
21
+ readonly hooks: {
22
+ register: SyncSeriesHook<[string, Component], null>;
23
+ unregister: SyncSeriesHook<string, null>;
24
+ };
25
+ /**
26
+ * 注册界面绘制组件
27
+ *
28
+ * @author zhanghanrui
29
+ * @date 2024-05-25 08:05:05
30
+ * @param {string} tag
31
+ * @param {Component} com
32
+ */
33
+ register(tag: string, com: Component): void;
34
+ /**
35
+ * 取消组件注册
36
+ *
37
+ * @author zhanghanrui
38
+ * @date 2024-05-25 08:05:34
39
+ * @param {string} tag
40
+ */
41
+ unregister(tag: string): void;
42
+ /**
43
+ * 获取注册的组件
44
+ *
45
+ * @author zhanghanrui
46
+ * @date 2024-05-25 08:05:59
47
+ * @param {string} tag
48
+ * @return {*} {(Component | undefined)}
49
+ */
50
+ get(tag: string): Component | undefined;
51
+ /**
52
+ * 组件标识清单
53
+ *
54
+ * @author zhanghanrui
55
+ * @date 2024-05-25 08:05:19
56
+ * @return {*} {string[]}
57
+ */
58
+ keys(): string[];
59
+ }
@@ -0,0 +1,65 @@
1
+ import '../../node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs';
2
+ import { SyncSeriesHook } from '../../node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs';
3
+
4
+ "use strict";
5
+ class RenderRegister {
6
+ /**
7
+ * 组件清单
8
+ *
9
+ * @author zhanghanrui
10
+ * @date 2024-05-25 08:05:03
11
+ * @protected
12
+ * @type {Map<string, Component>}
13
+ */
14
+ map = /* @__PURE__ */ new Map();
15
+ hooks = {
16
+ register: new SyncSeriesHook(),
17
+ unregister: new SyncSeriesHook()
18
+ };
19
+ /**
20
+ * 注册界面绘制组件
21
+ *
22
+ * @author zhanghanrui
23
+ * @date 2024-05-25 08:05:05
24
+ * @param {string} tag
25
+ * @param {Component} com
26
+ */
27
+ register(tag, com) {
28
+ this.map.set(tag, com);
29
+ this.hooks.register.callSync(null, tag, com);
30
+ }
31
+ /**
32
+ * 取消组件注册
33
+ *
34
+ * @author zhanghanrui
35
+ * @date 2024-05-25 08:05:34
36
+ * @param {string} tag
37
+ */
38
+ unregister(tag) {
39
+ this.map.delete(tag);
40
+ this.hooks.unregister.callSync(null, tag);
41
+ }
42
+ /**
43
+ * 获取注册的组件
44
+ *
45
+ * @author zhanghanrui
46
+ * @date 2024-05-25 08:05:59
47
+ * @param {string} tag
48
+ * @return {*} {(Component | undefined)}
49
+ */
50
+ get(tag) {
51
+ return this.map.get(tag);
52
+ }
53
+ /**
54
+ * 组件标识清单
55
+ *
56
+ * @author zhanghanrui
57
+ * @date 2024-05-25 08:05:19
58
+ * @return {*} {string[]}
59
+ */
60
+ keys() {
61
+ return Array.from(this.map.keys());
62
+ }
63
+ }
64
+
65
+ export { RenderRegister };
@@ -0,0 +1,16 @@
1
+ import { IGlobalState } from '../../interface';
2
+ /**
3
+ * 全局pinia状态
4
+ *
5
+ * @export
6
+ * @class GlobalPiniaState
7
+ * @implements {IGlobalState}
8
+ */
9
+ export declare class GlobalPiniaState implements IGlobalState {
10
+ /**
11
+ * 应用信息, todo: 等 api 包完成后,实际类型从 api 导入
12
+ *
13
+ * @type {IObject}
14
+ */
15
+ appInfo: IObject;
16
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ class GlobalPiniaState {
3
+ /**
4
+ * 应用信息, todo: 等 api 包完成后,实际类型从 api 导入
5
+ *
6
+ * @type {IObject}
7
+ */
8
+ appInfo = {};
9
+ }
10
+
11
+ export { GlobalPiniaState };
@@ -0,0 +1 @@
1
+ export { GlobalPiniaState } from './global-pinia-state/global-pinia-state';
@@ -0,0 +1,3 @@
1
+ export { GlobalPiniaState } from './global-pinia-state/global-pinia-state.mjs';
2
+
3
+ "use strict";
@@ -0,0 +1,2 @@
1
+ import { IGlobalActions, IGlobalGetters, IGlobalState } from '../interface';
2
+ export declare const useGlobalStore: import('pinia').StoreDefinition<"global-store", IGlobalState, IGlobalGetters, IGlobalActions>;
@@ -0,0 +1,22 @@
1
+ import { defineStore } from 'pinia';
2
+ import '../state/index.mjs';
3
+ import { GlobalPiniaState } from '../state/global-pinia-state/global-pinia-state.mjs';
4
+
5
+ "use strict";
6
+ const useGlobalStore = defineStore("global-store", {
7
+ state() {
8
+ return new GlobalPiniaState();
9
+ },
10
+ getters: {
11
+ getAppInfo() {
12
+ return this.appInfo;
13
+ }
14
+ },
15
+ actions: {
16
+ getAppInfo() {
17
+ return this.appInfo;
18
+ }
19
+ }
20
+ });
21
+
22
+ export { useGlobalStore };
@@ -0,0 +1,20 @@
1
+ import { Store } from 'pinia';
2
+ import { IGlobalActions, IGlobalGetters, IGlobalState } from '../interface';
3
+ /**
4
+ * 全局的状态管理工具类
5
+ *
6
+ * @export
7
+ * @class GlobalStore
8
+ */
9
+ export declare class GlobalStoreUtil {
10
+ /**
11
+ * 全局唯一实例
12
+ */
13
+ readonly pinia: import('pinia').Pinia;
14
+ /**
15
+ * 全局状态管理实例
16
+ *
17
+ */
18
+ readonly store: Store<'global-store', IGlobalState, IGlobalGetters, IGlobalActions>;
19
+ constructor();
20
+ }