@gct-paas/design 0.0.1-dev.11 → 0.0.1-dev.12

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 (26) hide show
  1. package/es/constant/index.d.ts +1 -0
  2. package/es/constant/index.mjs +3 -0
  3. package/es/constant/variable-type/variable-type.d.ts +12 -0
  4. package/es/constant/variable-type/variable-type.mjs +13 -0
  5. package/es/interface/controller/i-design-drag.controller.d.ts +42 -0
  6. package/es/interface/controller/i-design-drag.controller.mjs +1 -0
  7. package/es/interface/controller/i-design-view.controller.d.ts +35 -0
  8. package/es/interface/controller/i-design-view.controller.mjs +1 -0
  9. package/es/interface/design-page/design-page.d.ts +141 -0
  10. package/es/interface/design-page/design-page.mjs +1 -0
  11. package/es/interface/i-drag-collect/i-drag-collect.d.ts +20 -0
  12. package/es/interface/i-drag-collect/i-drag-collect.mjs +1 -0
  13. package/es/interface/i-drag-data-item/i-drag-data-item.d.ts +46 -0
  14. package/es/interface/i-drag-data-item/i-drag-data-item.mjs +1 -0
  15. package/es/interface/i-drag-item/i-drag-item.d.ts +32 -0
  16. package/es/interface/i-drag-item/i-drag-item.mjs +1 -0
  17. package/es/interface/i-drop-collect/i-drop-collect.d.ts +32 -0
  18. package/es/interface/i-drop-collect/i-drop-collect.mjs +1 -0
  19. package/es/interface/i-drop-result/i-drop-result.d.ts +34 -0
  20. package/es/interface/i-drop-result/i-drop-result.mjs +1 -0
  21. package/es/interface/index.d.ts +10 -0
  22. package/es/interface/state/i-design-drag.state.d.ts +15 -0
  23. package/es/interface/state/i-design-drag.state.mjs +1 -0
  24. package/es/interface/state/i-design-view.state.d.ts +28 -0
  25. package/es/interface/state/i-design-view.state.mjs +1 -0
  26. package/package.json +9 -4
@@ -0,0 +1 @@
1
+ export { VariableTypeEnum } from './variable-type/variable-type';
@@ -0,0 +1,3 @@
1
+ export { VariableTypeEnum } from './variable-type/variable-type.mjs';
2
+
3
+ "use strict";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 变量类型
3
+ */
4
+ export declare enum VariableTypeEnum {
5
+ String = "String",
6
+ Number = "Number",
7
+ Boolean = "Boolean",
8
+ Object = "Object",
9
+ Array = "Array",
10
+ DataTime = "DataTime",
11
+ Null = "Null"
12
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var VariableTypeEnum = /* @__PURE__ */ ((VariableTypeEnum2) => {
3
+ VariableTypeEnum2["String"] = "String";
4
+ VariableTypeEnum2["Number"] = "Number";
5
+ VariableTypeEnum2["Boolean"] = "Boolean";
6
+ VariableTypeEnum2["Object"] = "Object";
7
+ VariableTypeEnum2["Array"] = "Array";
8
+ VariableTypeEnum2["DataTime"] = "DataTime";
9
+ VariableTypeEnum2["Null"] = "Null";
10
+ return VariableTypeEnum2;
11
+ })(VariableTypeEnum || {});
12
+
13
+ export { VariableTypeEnum };
@@ -0,0 +1,42 @@
1
+ import { LowCodeWidget } from '@gct-paas/core';
2
+ import { IDesignDragState } from '../state/i-design-drag.state';
3
+ import { IDesignViewController } from './i-design-view.controller';
4
+ /**
5
+ * 设计界面单区域拖拽控制器
6
+ *
7
+ * @export
8
+ * @interface IDesignDragController
9
+ */
10
+ export interface IDesignDragController {
11
+ /**
12
+ * 设计界面控制器
13
+ *
14
+ * @type {IDesignViewController}
15
+ */
16
+ readonly view: IDesignViewController;
17
+ /**
18
+ * 设计界面单拖拽区域状态
19
+ *
20
+ * @type {IDesignDragState}
21
+ */
22
+ readonly state: IDesignDragState;
23
+ /**
24
+ * 新增组件
25
+ *
26
+ * @param {LowCodeWidget.BasicSchema} widget
27
+ * @returns {*} {LowCodeWidget.BasicSchema}
28
+ */
29
+ addWidget(widget: LowCodeWidget.BasicSchema): LowCodeWidget.BasicSchema;
30
+ /**
31
+ * 删除组件
32
+ *
33
+ * @param {LowCodeWidget.BasicSchema} widget
34
+ */
35
+ deleteWidget(widget: LowCodeWidget.BasicSchema): void;
36
+ /**
37
+ * 更新组件
38
+ *
39
+ * @param {LowCodeWidget.BasicSchema} widget
40
+ */
41
+ updateWidget(widget: LowCodeWidget.BasicSchema): void;
42
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,35 @@
1
+ import { IDesignerProvider, LowCodeWidget } from '@gct-paas/core';
2
+ import { IDesignViewState } from '../state/i-design-view.state';
3
+ /**
4
+ * 设计界面控制器
5
+ *
6
+ * @export
7
+ * @interface IDesignViewController
8
+ */
9
+ export interface IDesignViewController {
10
+ /**
11
+ * 设计界面状态
12
+ *
13
+ * @type {IDesignViewState}
14
+ */
15
+ readonly state: IDesignViewState;
16
+ /**
17
+ * 设计界面所有适配器
18
+ *
19
+ * @type {IDesignerProvider[]}
20
+ */
21
+ readonly providers: IDesignerProvider[];
22
+ /**
23
+ * 获取指定插件适配器
24
+ *
25
+ * @param {string} tag
26
+ * @returns {*} {(IDesignerProvider | undefined)}
27
+ */
28
+ getProvider(tag: string): IDesignerProvider | undefined;
29
+ /**
30
+ * 激活选中组件
31
+ *
32
+ * @param {LowCodeWidget.BasicSchema} widget
33
+ */
34
+ setSelect(widget: LowCodeWidget.BasicSchema): void;
35
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,141 @@
1
+ import { LowCodeModal, LowCodeWidget } from '@gct-paas/core';
2
+ import { VariableTypeEnum } from '../../constant';
3
+ /**
4
+ * 局部变量
5
+ */
6
+ export interface VariableInterface {
7
+ name: string;
8
+ type: VariableTypeEnum;
9
+ defaultValue: string;
10
+ description?: string;
11
+ }
12
+ export interface LoDataObject {
13
+ name: string;
14
+ title: string;
15
+ controls: Record<string, object>;
16
+ variables: VariableInterface[];
17
+ graphJSON: object;
18
+ runtimeJs: string;
19
+ createBy: string;
20
+ createTime: string;
21
+ modifyBy: string;
22
+ modifyTime: string;
23
+ bindTo: string[];
24
+ /**输入变量 */
25
+ parameter?: string[];
26
+ }
27
+ export interface PageJson {
28
+ id: string;
29
+ keepAlive: boolean;
30
+ /**页面事件 */
31
+ pageEvents: {
32
+ /**页面加载前 */
33
+ pageBeforeMount?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
34
+ /**页面加载事件 */
35
+ pageMounted?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
36
+ /**页面离开事件 */
37
+ pageDestroyed?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
38
+ };
39
+ widgets: LowCodeWidget.BasicSchema[];
40
+ js: string;
41
+ css: string;
42
+ modals: LowCodeModal.Modal[];
43
+ template: unknown[];
44
+ timestamp?: number;
45
+ newDesigner?: boolean;
46
+ /**全局页面事件 */
47
+ globalEvents: {
48
+ /**页面加载公共事件ID */
49
+ pageMounted?: string;
50
+ /**页面离开公共事件ID */
51
+ pageDestroyed?: string;
52
+ };
53
+ los?: Record<string, LoDataObject>;
54
+ permissions: Record<string, string | null>;
55
+ style: Partial<LowCodeWidget.BasicStyle>;
56
+ pageConfig: Partial<PageConfig>;
57
+ pageVars: LowCodeWidget.PageVars[];
58
+ }
59
+ interface PageConfig {
60
+ title: string;
61
+ i18n: {
62
+ key?: string;
63
+ title?: string;
64
+ };
65
+ hasFooter: boolean;
66
+ }
67
+ interface PageStyle {
68
+ enableHeaderBGColor?: boolean;
69
+ }
70
+ export type ExportMethod = Record<string, {
71
+ params: string;
72
+ source: string;
73
+ type: string;
74
+ }>;
75
+ export interface History {
76
+ createTime: string;
77
+ createUserName: string;
78
+ designJson: string;
79
+ runtimeJson: string;
80
+ }
81
+ export interface RuntimePageJson {
82
+ widgets: LowCodeWidget.BasicSchema[];
83
+ runJs: string;
84
+ modals: RuntimeModal[];
85
+ css: string;
86
+ keepAlive: boolean;
87
+ /**全局页面事件 */
88
+ globalEvents: {
89
+ /**页面加载公共事件ID */
90
+ pageMounted?: string;
91
+ /**页面激活公共事件ID */
92
+ pageActivated?: string;
93
+ /**页面离开公共事件ID */
94
+ pageDestroyed?: string;
95
+ };
96
+ /**页面加载事件 */
97
+ pageEvents: {
98
+ /**页面加载前 */
99
+ pageBeforeMount?: {
100
+ /**JS方法名称 */
101
+ name: string;
102
+ /**event额外参数 */
103
+ extraParams: Record<string, any> | string | number | boolean;
104
+ };
105
+ /**页面加载事件 */
106
+ pageMounted?: {
107
+ /**JS方法名称 */
108
+ name: string;
109
+ /**event额外参数 */
110
+ extraParams: Record<string, any> | string | number | boolean;
111
+ };
112
+ /**页面激活事件 */
113
+ pageActivated?: {
114
+ /**JS方法名称 */
115
+ name: string;
116
+ /**event额外参数 */
117
+ extraParams: Record<string, any> | string | number | boolean;
118
+ };
119
+ /**页面离开事件 */
120
+ pageDestroyed?: {
121
+ /**JS方法名称 */
122
+ name: string;
123
+ /**event额外参数 */
124
+ extraParams: Record<string, any> | string | number | boolean;
125
+ };
126
+ };
127
+ pageConfig: Partial<PageConfig>;
128
+ pageStyle: Partial<PageStyle>;
129
+ }
130
+ export interface RuntimeModal {
131
+ props?: LowCodeModal.ModalProps;
132
+ css?: string;
133
+ modalName?: string;
134
+ id?: string;
135
+ i18n?: Record<string, string>;
136
+ events?: LowCodeWidget.BasicEvents;
137
+ children?: [LowCodeModal.ModalBody, LowCodeModal.ModalBody];
138
+ runJs?: string;
139
+ style: Partial<LowCodeWidget.BasicStyle>;
140
+ }
141
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 拖拽状态收集器
3
+ *
4
+ * @export
5
+ * @interface IDragCollect
6
+ */
7
+ export interface IDragCollect {
8
+ /**
9
+ * 是否可以拖拽
10
+ *
11
+ * @type {boolean}
12
+ */
13
+ canDrag: boolean;
14
+ /**
15
+ * 是否正在拖拽
16
+ *
17
+ * @type {boolean}
18
+ */
19
+ isDragging: boolean;
20
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,46 @@
1
+ import { LowCodeWidget } from '@gct-paas/core';
2
+ /**
3
+ * 拖拽数据项
4
+ *
5
+ * @export
6
+ * @interface IDragDataItem
7
+ * @template O
8
+ */
9
+ export interface IDragDataItem<O = LowCodeWidget.BasicSchema> {
10
+ /**
11
+ * 当前数据标识,如果是新数据则主键为空
12
+ *
13
+ * @type {string}
14
+ */
15
+ id: string;
16
+ /**
17
+ * 拖拽分组实例标识
18
+ *
19
+ * @type {string}
20
+ */
21
+ group: string;
22
+ /**
23
+ * 拖拽项原位置索引
24
+ *
25
+ * @type {number}
26
+ */
27
+ index: number;
28
+ /**
29
+ * 当前拖拽数据
30
+ *
31
+ * @type {O}
32
+ */
33
+ data: O;
34
+ /**
35
+ * 数据模式
36
+ *
37
+ * @type {('create' | 'move')} 新建 | 移动
38
+ */
39
+ mode: 'create' | 'move';
40
+ /**
41
+ * 包含自身 + 所有子的类型,目前主要用于拖拽限制
42
+ *
43
+ * @type {string[]}
44
+ */
45
+ types: string[];
46
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 拖拽项
3
+ *
4
+ * @export
5
+ * @interface IDragItem
6
+ */
7
+ export interface IDragItem {
8
+ /**
9
+ * 下标
10
+ *
11
+ * @type {number}
12
+ */
13
+ index: number;
14
+ /**
15
+ * 标识
16
+ *
17
+ * @type {string}
18
+ */
19
+ id: string;
20
+ /**
21
+ * 类型
22
+ *
23
+ * @type {string}
24
+ */
25
+ type: string;
26
+ /**
27
+ * 拖拽数据
28
+ *
29
+ * @type {IObject}
30
+ */
31
+ data: IObject;
32
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 放置状态收集器
3
+ *
4
+ * @export
5
+ * @interface IDropCollect
6
+ */
7
+ export interface IDropCollect {
8
+ /**
9
+ * 拖拽元素标识
10
+ *
11
+ * @type {string}
12
+ */
13
+ handlerId: string;
14
+ /**
15
+ * 是否可以放置
16
+ *
17
+ * @type {boolean}
18
+ */
19
+ canDrop: boolean;
20
+ /**
21
+ * 是否只在单一元素放置
22
+ *
23
+ * @type {boolean}
24
+ */
25
+ isShallowOver: boolean;
26
+ /**
27
+ * 是否放置中
28
+ *
29
+ * @type {boolean}
30
+ */
31
+ isOver: boolean;
32
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 放置结果回执
3
+ *
4
+ * @export
5
+ * @interface IDropResult
6
+ */
7
+ export interface IDropResultData {
8
+ /**
9
+ * 放置分组标识
10
+ *
11
+ * @type {string}
12
+ */
13
+ group: string;
14
+ /**
15
+ * 是否成功放置
16
+ *
17
+ * @type {boolean}
18
+ */
19
+ success: boolean;
20
+ }
21
+ /**
22
+ * 拖拽操作返回值
23
+ *
24
+ * @export
25
+ * @interface IDropResult
26
+ */
27
+ export interface IDropResult {
28
+ /**
29
+ * 放置异步沟通操作
30
+ *
31
+ * @type {Promise<IDropResultData>}
32
+ */
33
+ asyncDrop: Promise<IDropResultData>;
34
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1 +1,11 @@
1
+ export type { IDesignDragController } from './controller/i-design-drag.controller';
2
+ export type { IDesignViewController } from './controller/i-design-view.controller';
3
+ export type { IDragCollect } from './i-drag-collect/i-drag-collect';
4
+ export type { IDragDataItem } from './i-drag-data-item/i-drag-data-item';
5
+ export type { IDragItem } from './i-drag-item/i-drag-item';
6
+ export type { IDropCollect } from './i-drop-collect/i-drop-collect';
7
+ export type { IDropResult, IDropResultData, } from './i-drop-result/i-drop-result';
8
+ export type { ExportMethod, History, LoDataObject, PageJson, RuntimeModal, RuntimePageJson, VariableInterface, } from './design-page/design-page';
1
9
  export * from './props';
10
+ export type { IDesignDragState } from './state/i-design-drag.state';
11
+ export type { IDesignViewState } from './state/i-design-view.state';
@@ -0,0 +1,15 @@
1
+ import { LowCodeWidget } from '@gct-paas/core';
2
+ /**
3
+ * 设计界面拖拽状态
4
+ *
5
+ * @export
6
+ * @interface IDesignDragState
7
+ */
8
+ export interface IDesignDragState {
9
+ /**
10
+ * 拖拽设计界面组件清单
11
+ *
12
+ * @type {LowCodeWidget.BasicSchema[]}
13
+ */
14
+ widgets: LowCodeWidget.BasicSchema[];
15
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,28 @@
1
+ import { LowCodeWidget } from '@gct-paas/core';
2
+ import { PageJson } from '../design-page/design-page';
3
+ /**
4
+ * 设计界面状态
5
+ *
6
+ * @export
7
+ * @interface IDesignViewState
8
+ */
9
+ export interface IDesignViewState {
10
+ /**
11
+ * 是否为移动端
12
+ *
13
+ * @type {boolean}
14
+ */
15
+ isMobile: boolean;
16
+ /**
17
+ * 界面模型
18
+ *
19
+ * @type {PageJson}
20
+ */
21
+ model: PageJson;
22
+ /**
23
+ * 当前选中激活的组件对象
24
+ *
25
+ * @type {(LowCodeWidget.BasicSchema | null)}
26
+ */
27
+ selectWidget: LowCodeWidget.BasicSchema | null;
28
+ }
@@ -0,0 +1 @@
1
+ "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/design",
3
- "version": "0.0.1-dev.11",
3
+ "version": "0.0.1-dev.12",
4
4
  "type": "module",
5
5
  "description": "paas 平台设计界面底包",
6
6
  "main": "dist/index.min.cjs",
@@ -41,14 +41,19 @@
41
41
  "publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
42
42
  },
43
43
  "dependencies": {
44
- "@gct-paas/build": "0.0.1-dev.11",
45
- "@gct-paas/core": "0.0.1-dev.11",
44
+ "@gct-paas/build": "0.0.1-dev.12",
45
+ "@gct-paas/core": "0.0.1-dev.12",
46
46
  "ant-design-vue": "3.2.20",
47
+ "lodash-es": "^4.17.21",
48
+ "lokijs": "^1.5.12",
47
49
  "qx-util": "^0.4.8",
48
50
  "vue": "^3.5.13"
49
51
  },
50
52
  "peerDependencies": {
51
53
  "vue": "^3.x"
52
54
  },
53
- "gitHead": "3f988584fd9450fa356f802a0316d75ee44a6a27"
55
+ "devDependencies": {
56
+ "@types/lokijs": "^1.5.14"
57
+ },
58
+ "gitHead": "b8e3713e94a27f7df471dae92fbc7ee050a7b4d5"
54
59
  }