@gct-paas/schema 0.1.4-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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.esm.min.mjs +95 -0
- package/dist/index.min.cjs +1 -0
- package/dist/index.system.min.js +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.mjs +9 -0
- package/es/interface/designer.d.ts +96 -0
- package/es/interface/index.d.ts +3 -0
- package/es/interface/modal/i-modal-body.d.ts +15 -0
- package/es/interface/modal/i-modal-bottom-button.d.ts +15 -0
- package/es/interface/modal/i-modal-footer.d.ts +15 -0
- package/es/interface/modal/i-modal-props.d.ts +26 -0
- package/es/interface/modal/i-modal.d.ts +52 -0
- package/es/interface/modal/index.d.ts +17 -0
- package/es/interface/widget/i-common.d.ts +42 -0
- package/es/interface/widget/i-editors.d.ts +239 -0
- package/es/interface/widget/i-events.d.ts +62 -0
- package/es/interface/widget/i-hooks-and-misc.d.ts +58 -0
- package/es/interface/widget/i-props.d.ts +186 -0
- package/es/interface/widget/i-schemas.d.ts +127 -0
- package/es/interface/widget/i-styles.d.ts +113 -0
- package/es/interface/widget/index.d.ts +46 -0
- package/es/schema/common-config/common-style.d.ts +3 -0
- package/es/schema/common-config/common-style.mjs +85 -0
- package/es/schema/index.d.ts +1 -0
- package/es/types/index.d.ts +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/schema/index.d.ts +11 -0
- package/es/utils/schema/index.mjs +7 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 冠骋信息技术有限公司
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { BorderStyle as o, TagTypeEnum as l, TextDecoration as t } from "@gct-paas/core";
|
|
2
|
+
import { has as i } from "lodash-es";
|
|
3
|
+
const b = {
|
|
4
|
+
position: "",
|
|
5
|
+
top: "",
|
|
6
|
+
left: "",
|
|
7
|
+
right: "",
|
|
8
|
+
bottom: "",
|
|
9
|
+
width: "",
|
|
10
|
+
height: "",
|
|
11
|
+
backgroundColor: "",
|
|
12
|
+
marginAll: "",
|
|
13
|
+
marginTop: "",
|
|
14
|
+
marginRight: "",
|
|
15
|
+
marginBottom: "",
|
|
16
|
+
marginLeft: "",
|
|
17
|
+
paddingAll: "",
|
|
18
|
+
paddingTop: "",
|
|
19
|
+
paddingRight: "",
|
|
20
|
+
paddingBottom: "",
|
|
21
|
+
paddingLeft: "",
|
|
22
|
+
labelFont: {
|
|
23
|
+
align: "left",
|
|
24
|
+
fontSize: "",
|
|
25
|
+
bold: !1,
|
|
26
|
+
italic: !1,
|
|
27
|
+
textDecoration: t.NONE,
|
|
28
|
+
color: ""
|
|
29
|
+
},
|
|
30
|
+
contentFont: {
|
|
31
|
+
align: "left",
|
|
32
|
+
fontSize: "",
|
|
33
|
+
bold: !1,
|
|
34
|
+
italic: !1,
|
|
35
|
+
textDecoration: t.NONE,
|
|
36
|
+
color: ""
|
|
37
|
+
},
|
|
38
|
+
tagStyle: {
|
|
39
|
+
color: "",
|
|
40
|
+
tagType: l.RADIUS
|
|
41
|
+
},
|
|
42
|
+
tagStyleOpen: !1,
|
|
43
|
+
borderAll: {
|
|
44
|
+
borderStyle: o.NONE,
|
|
45
|
+
borderColor: "#F0F0F0",
|
|
46
|
+
borderWidth: "1"
|
|
47
|
+
},
|
|
48
|
+
borderLeft: {
|
|
49
|
+
borderStyle: o.NONE,
|
|
50
|
+
borderColor: "#F0F0F0",
|
|
51
|
+
borderWidth: "1"
|
|
52
|
+
},
|
|
53
|
+
borderRight: {
|
|
54
|
+
borderStyle: o.NONE,
|
|
55
|
+
borderColor: "#F0F0F0",
|
|
56
|
+
borderWidth: "1"
|
|
57
|
+
},
|
|
58
|
+
borderBottom: {
|
|
59
|
+
borderStyle: o.NONE,
|
|
60
|
+
borderColor: "#F0F0F0",
|
|
61
|
+
borderWidth: "1"
|
|
62
|
+
},
|
|
63
|
+
borderTop: {
|
|
64
|
+
borderStyle: o.NONE,
|
|
65
|
+
borderColor: "#F0F0F0",
|
|
66
|
+
borderWidth: "1"
|
|
67
|
+
},
|
|
68
|
+
borderTopRightRadius: "0",
|
|
69
|
+
borderTopLeftRadius: "0",
|
|
70
|
+
borderBottomRightRadius: "0",
|
|
71
|
+
borderBottomLeftRadius: "0",
|
|
72
|
+
borderAllRadius: "0"
|
|
73
|
+
}, g = [
|
|
74
|
+
"position",
|
|
75
|
+
"backgroundColor",
|
|
76
|
+
"bold",
|
|
77
|
+
"italic",
|
|
78
|
+
"textDecoration",
|
|
79
|
+
"color",
|
|
80
|
+
"borderStyle",
|
|
81
|
+
"borderColor"
|
|
82
|
+
];
|
|
83
|
+
function p(r, e, d) {
|
|
84
|
+
return r.type === d && i(r, "preLocation") && new RegExp(`^${e}_`).test(r.preLocation);
|
|
85
|
+
}
|
|
86
|
+
const c = {
|
|
87
|
+
install() {
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
b as commonStyle,
|
|
92
|
+
c as default,
|
|
93
|
+
p as getCompPos,
|
|
94
|
+
g as notNeedPxStyle
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@gct-paas/core"),d=require("lodash-es"),l={position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:o.TextDecoration.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:o.TextDecoration.NONE,color:""},tagStyle:{color:"",tagType:o.TagTypeEnum.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:o.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:o.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:o.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:o.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:o.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"},i=["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"];function n(e,r,t){return e.type===t&&d.has(e,"preLocation")&&new RegExp(`^${r}_`).test(e.preLocation)}const a={install(){}};exports.commonStyle=l;exports.default=a;exports.getCompPos=n;exports.notNeedPxStyle=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["@gct-paas/core","lodash-es"],(function(e,c){"use strict";var o,l,r,i;return{setters:[t=>{o=t.BorderStyle,l=t.TagTypeEnum,r=t.TextDecoration},t=>{i=t.has}],execute:(function(){e("getCompPos",n);const t=e("commonStyle",{position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:r.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:r.NONE,color:""},tagStyle:{color:"",tagType:l.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:o.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:o.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:o.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:o.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:o.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"}),g=e("notNeedPxStyle",["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"]);function n(d,a,b){return d.type===b&&i(d,"preLocation")&&new RegExp(`^${a}_`).test(d.preLocation)}const s=e("default",{install(){}})})}}));
|
package/es/index.d.ts
ADDED
package/es/index.mjs
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { pageLayoutModeEnum } from '@gct-paas/core';
|
|
2
|
+
import { LowCodeWidget } from './widget';
|
|
3
|
+
import { LowCodeModal } from './modal';
|
|
4
|
+
export interface PageJson {
|
|
5
|
+
id: string;
|
|
6
|
+
keepAlive: boolean;
|
|
7
|
+
/**页面事件 */
|
|
8
|
+
pageEvents: {
|
|
9
|
+
/**页面加载前 */
|
|
10
|
+
pageBeforeMount?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
11
|
+
/**页面加载事件 */
|
|
12
|
+
pageMounted?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
13
|
+
/**页面离开事件 */
|
|
14
|
+
pageDestroyed?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
15
|
+
};
|
|
16
|
+
widgets: LowCodeWidget.BasicSchema[];
|
|
17
|
+
js: string;
|
|
18
|
+
css: string;
|
|
19
|
+
modals: LowCodeModal.Modal[];
|
|
20
|
+
timestamp?: number;
|
|
21
|
+
newDesigner?: boolean;
|
|
22
|
+
/**全局页面事件 */
|
|
23
|
+
globalEvents: {
|
|
24
|
+
/**页面加载公共事件ID */
|
|
25
|
+
pageMounted?: string;
|
|
26
|
+
/**页面离开公共事件ID */
|
|
27
|
+
pageDestroyed?: string;
|
|
28
|
+
};
|
|
29
|
+
permissions: Record<string, string | null>;
|
|
30
|
+
style: Partial<LowCodeWidget.BasicStyle>;
|
|
31
|
+
pageConfig: Partial<PageConfig>;
|
|
32
|
+
pageVars: LowCodeWidget.PageVars[];
|
|
33
|
+
/**滚动条适配方式 */
|
|
34
|
+
pageLayoutMode?: pageLayoutModeEnum;
|
|
35
|
+
plugins: PagePlugin[];
|
|
36
|
+
}
|
|
37
|
+
export interface PagePlugin {
|
|
38
|
+
key: string;
|
|
39
|
+
version: string;
|
|
40
|
+
url: string;
|
|
41
|
+
}
|
|
42
|
+
interface PageConfig {
|
|
43
|
+
title: string;
|
|
44
|
+
i18n: {
|
|
45
|
+
key?: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
};
|
|
48
|
+
hasFooter: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type ExportMethod = Record<string, {
|
|
51
|
+
params: string;
|
|
52
|
+
source: string;
|
|
53
|
+
type: string;
|
|
54
|
+
}>;
|
|
55
|
+
export interface History {
|
|
56
|
+
createTime: string;
|
|
57
|
+
createUserName: string;
|
|
58
|
+
designJson: string;
|
|
59
|
+
runtimeJson: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RuntimePageJson {
|
|
62
|
+
widgets: LowCodeWidget.BasicSchema[];
|
|
63
|
+
runJs: string;
|
|
64
|
+
modals: RuntimeModal[];
|
|
65
|
+
css: string;
|
|
66
|
+
keepAlive: boolean;
|
|
67
|
+
/**全局页面事件 */
|
|
68
|
+
globalEvents: {
|
|
69
|
+
/**页面加载公共事件ID */
|
|
70
|
+
pageMounted?: string;
|
|
71
|
+
/**页面激活公共事件ID */
|
|
72
|
+
pageActivated?: string;
|
|
73
|
+
/**页面离开公共事件ID */
|
|
74
|
+
pageDestroyed?: string;
|
|
75
|
+
};
|
|
76
|
+
/**页面加载事件 */
|
|
77
|
+
pageEvents: PageJson['pageEvents'];
|
|
78
|
+
permissions: Record<string, string | null>;
|
|
79
|
+
pageConfig: Partial<PageConfig>;
|
|
80
|
+
pageVars: LowCodeWidget.PageVars[];
|
|
81
|
+
pageStyle: Partial<LowCodeWidget.BasicStyle>;
|
|
82
|
+
pageLayoutMode?: pageLayoutModeEnum;
|
|
83
|
+
plugins: PagePlugin[];
|
|
84
|
+
}
|
|
85
|
+
export interface RuntimeModal {
|
|
86
|
+
props?: LowCodeModal.ModalProps;
|
|
87
|
+
css?: string;
|
|
88
|
+
modalName?: string;
|
|
89
|
+
id?: string;
|
|
90
|
+
i18n?: Record<string, string>;
|
|
91
|
+
events?: LowCodeWidget.BasicEvents;
|
|
92
|
+
children?: [LowCodeModal.ModalBody, LowCodeModal.ModalBody];
|
|
93
|
+
runJs?: string;
|
|
94
|
+
style: Partial<LowCodeWidget.BasicStyle>;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BuiltinType } from '@gct-paas/core';
|
|
2
|
+
import { LowCodeWidget } from '../widget';
|
|
3
|
+
/**
|
|
4
|
+
* 模态框主体接口
|
|
5
|
+
*
|
|
6
|
+
* 定义模态框主体区域的结构,包含子组件列表
|
|
7
|
+
*/
|
|
8
|
+
export interface IModalBody {
|
|
9
|
+
/** 唯一标识 */
|
|
10
|
+
id: string;
|
|
11
|
+
/** 组件类型 */
|
|
12
|
+
type: BuiltinType.MODAL_BODY;
|
|
13
|
+
/** 子组件列表 */
|
|
14
|
+
children: LowCodeWidget.BasicSchema[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BuiltinType } from '@gct-paas/core';
|
|
2
|
+
import { LowCodeWidget } from '../widget';
|
|
3
|
+
/**
|
|
4
|
+
* 模态框底部按钮容器接口
|
|
5
|
+
*
|
|
6
|
+
* 定义模态框底部按钮容器的结构,用于承载底部操作按钮
|
|
7
|
+
*/
|
|
8
|
+
export interface IModalBottomButton {
|
|
9
|
+
/** 唯一标识 */
|
|
10
|
+
id: string;
|
|
11
|
+
/** 组件类型 */
|
|
12
|
+
type: BuiltinType.BottomButtonContainer;
|
|
13
|
+
/** 子组件列表 */
|
|
14
|
+
children: LowCodeWidget.BasicSchema[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BuiltinType } from '@gct-paas/core';
|
|
2
|
+
import { LowCodeWidget } from '../widget';
|
|
3
|
+
/**
|
|
4
|
+
* 模态框底部接口
|
|
5
|
+
*
|
|
6
|
+
* 定义模态框底部区域的结构,通常用于放置操作按钮
|
|
7
|
+
*/
|
|
8
|
+
export interface IModalFooter {
|
|
9
|
+
/** 唯一标识 */
|
|
10
|
+
id: string;
|
|
11
|
+
/** 组件类型 */
|
|
12
|
+
type: BuiltinType.MODAL_FOOTER;
|
|
13
|
+
/** 子组件列表 */
|
|
14
|
+
children: LowCodeWidget.BasicSchema[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LowCodeWidget } from '../widget';
|
|
2
|
+
/**
|
|
3
|
+
* 模态框属性接口
|
|
4
|
+
*
|
|
5
|
+
* 定义模态框组件的所有可配置属性,包括标题、宽度、子表关联等
|
|
6
|
+
*/
|
|
7
|
+
export interface IModalProps extends LowCodeWidget.CommonProps {
|
|
8
|
+
/** 模态框标题 */
|
|
9
|
+
modalTitle?: string;
|
|
10
|
+
/** web端弹框宽度单位 */
|
|
11
|
+
unitType: 'px' | '%';
|
|
12
|
+
/** web端弹框宽度 */
|
|
13
|
+
modalWidth: number;
|
|
14
|
+
/** mobile端弹框宽度单位 */
|
|
15
|
+
mUnitType: '%';
|
|
16
|
+
/** mobile端弹框宽度 */
|
|
17
|
+
mModalWidth: number;
|
|
18
|
+
/** 是否子表下的模态框 */
|
|
19
|
+
isSubTableModal?: boolean;
|
|
20
|
+
/** 关联子表 id */
|
|
21
|
+
bindSubTableId?: string;
|
|
22
|
+
/** 子表弹框新建标题名称 */
|
|
23
|
+
createModalTitle?: string;
|
|
24
|
+
/** 子表弹框编辑标题名称 */
|
|
25
|
+
editModalTitle?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BuiltinType, Platform } from '@gct-paas/core';
|
|
2
|
+
import { LowCodeWidget } from '../widget';
|
|
3
|
+
import { IModalBody } from './i-modal-body';
|
|
4
|
+
import { IModalFooter } from './i-modal-footer';
|
|
5
|
+
import { IModalBottomButton } from './i-modal-bottom-button';
|
|
6
|
+
import { IModalProps } from './i-modal-props';
|
|
7
|
+
/**
|
|
8
|
+
* 模态框主接口
|
|
9
|
+
*
|
|
10
|
+
* 定义低代码平台中模态框组件的完整结构,包括基本属性、样式、事件、子组件等
|
|
11
|
+
* 模态框由三个子区域组成:主体区域(ModalBody)、底部区域(ModalFooter)和底部按钮容器(ModalBottomButton)
|
|
12
|
+
*/
|
|
13
|
+
export interface IModal {
|
|
14
|
+
/** 唯一标识 */
|
|
15
|
+
id: string;
|
|
16
|
+
/** 系统用的name */
|
|
17
|
+
alias: string;
|
|
18
|
+
/** 名称 */
|
|
19
|
+
name: string;
|
|
20
|
+
/** 平台类型,默认是WEB,添加的时候会根据当前环境改变 */
|
|
21
|
+
platform: Platform;
|
|
22
|
+
/** 用户新建编辑的name */
|
|
23
|
+
modalName: string;
|
|
24
|
+
/** 自定义展示组件的名字 */
|
|
25
|
+
compName?: string;
|
|
26
|
+
/** 自定义展示组件key的名字 */
|
|
27
|
+
compKey?: string;
|
|
28
|
+
/** 组件类型 */
|
|
29
|
+
type: BuiltinType.MODAL;
|
|
30
|
+
/** JavaScript 代码 */
|
|
31
|
+
js: string;
|
|
32
|
+
/** CSS 样式代码 */
|
|
33
|
+
css: string;
|
|
34
|
+
/** 子组件:主体、底部、底部按钮容器 */
|
|
35
|
+
children: [IModalBody, IModalFooter, IModalBottomButton];
|
|
36
|
+
/** 模态框属性配置 */
|
|
37
|
+
props: IModalProps;
|
|
38
|
+
/** 事件配置 */
|
|
39
|
+
events: LowCodeWidget.BasicEvents;
|
|
40
|
+
/** 国际化配置 */
|
|
41
|
+
i18n?: Record<string, string>;
|
|
42
|
+
/** 样式配置 */
|
|
43
|
+
style: Partial<LowCodeWidget.BasicStyle>;
|
|
44
|
+
/** 运行时需要的Js Code */
|
|
45
|
+
runJs?: string;
|
|
46
|
+
/** 本地数据源配置 */
|
|
47
|
+
los?: Record<string, IData>;
|
|
48
|
+
/** 图标 */
|
|
49
|
+
icon: string;
|
|
50
|
+
/** 是否是字段类型 */
|
|
51
|
+
isField: boolean;
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IModal } from './i-modal';
|
|
2
|
+
import { IModalBody } from './i-modal-body';
|
|
3
|
+
import { IModalFooter } from './i-modal-footer';
|
|
4
|
+
import { IModalBottomButton } from './i-modal-bottom-button';
|
|
5
|
+
import { IModalProps } from './i-modal-props';
|
|
6
|
+
export declare namespace LowCodeModal {
|
|
7
|
+
/** 模态框主接口 */
|
|
8
|
+
type Modal = IModal;
|
|
9
|
+
/** 模态框主体接口 */
|
|
10
|
+
type ModalBody = IModalBody;
|
|
11
|
+
/** 模态框底部接口 */
|
|
12
|
+
type ModalFooter = IModalFooter;
|
|
13
|
+
/** 模态框底部按钮容器接口 */
|
|
14
|
+
type ModalBottomButton = IModalBottomButton;
|
|
15
|
+
/** 模态框属性接口 */
|
|
16
|
+
type ModalProps = IModalProps;
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FIELD_TYPE, FormComponents, VERIFICATIONCONDITIONS_TYPE } from '@gct-paas/core';
|
|
2
|
+
import { IBasicSchema } from './i-schemas';
|
|
3
|
+
/**
|
|
4
|
+
* 字段组件基础结构
|
|
5
|
+
*
|
|
6
|
+
* @interface fieldWidgetSchema
|
|
7
|
+
*/
|
|
8
|
+
export interface fieldWidgetSchema {
|
|
9
|
+
/** 组件唯一标识 */
|
|
10
|
+
id: string;
|
|
11
|
+
/** i18n字段 */
|
|
12
|
+
i18n: Record<string, string>;
|
|
13
|
+
props: {
|
|
14
|
+
/** 字段key */
|
|
15
|
+
field: string;
|
|
16
|
+
/** 字段id */
|
|
17
|
+
fieldId: string;
|
|
18
|
+
/** 字段类型 */
|
|
19
|
+
fieldType?: FIELD_TYPE;
|
|
20
|
+
/** 字段名称 */
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 校验规则
|
|
26
|
+
*
|
|
27
|
+
* @interface validateRule
|
|
28
|
+
*/
|
|
29
|
+
export interface validateRule {
|
|
30
|
+
ruleName: string;
|
|
31
|
+
field: string;
|
|
32
|
+
ruleType: VERIFICATIONCONDITIONS_TYPE.JS;
|
|
33
|
+
trigger?: 'change' | 'bulr';
|
|
34
|
+
message?: string;
|
|
35
|
+
jsName?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 组件类型与组件Schema接口映射
|
|
39
|
+
*
|
|
40
|
+
* @type ComTypeMap
|
|
41
|
+
*/
|
|
42
|
+
export type ComTypeMap = Record<FormComponents, IBasicSchema>;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { PropGroup, StyleGroup, tableColumnWidthEnum, BindCmpStyleTypeEnum, FIELD_TYPE, CreateType, FormComponents } from '@gct-paas/core';
|
|
3
|
+
import { IBasicSchema } from './i-schemas';
|
|
4
|
+
import { IFieldToProp } from './i-props';
|
|
5
|
+
/**
|
|
6
|
+
* 样式编辑器
|
|
7
|
+
*
|
|
8
|
+
* @interface IStyleEditor
|
|
9
|
+
*/
|
|
10
|
+
export interface IStyleEditor {
|
|
11
|
+
/** style组件 */
|
|
12
|
+
component: string;
|
|
13
|
+
/** style名称 */
|
|
14
|
+
name?: string | Record<string, string>;
|
|
15
|
+
/** 右侧显示的名称 */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** style分组 */
|
|
18
|
+
group: StyleGroup;
|
|
19
|
+
/** style变时的callback */
|
|
20
|
+
changeCallback?: Function;
|
|
21
|
+
/** style是否隐藏逻辑 */
|
|
22
|
+
hidden?: (arg: IBasicSchema) => boolean;
|
|
23
|
+
/** editor内部的自定义config逻辑 */
|
|
24
|
+
_config?: Partial<IStyleEditorConfig>;
|
|
25
|
+
/** 表单编辑器额外配置 */
|
|
26
|
+
editor?: Record<string, any>;
|
|
27
|
+
/** 表单项配置 */
|
|
28
|
+
formItem?: Record<string, any>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 样式编辑器配置
|
|
32
|
+
*
|
|
33
|
+
* @interface IStyleEditorConfig
|
|
34
|
+
*/
|
|
35
|
+
export interface IStyleEditorConfig {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
options: Function | {
|
|
38
|
+
label: string;
|
|
39
|
+
value: string | boolean | number;
|
|
40
|
+
}[];
|
|
41
|
+
options2: Function | {
|
|
42
|
+
label: string;
|
|
43
|
+
value: string | boolean | number;
|
|
44
|
+
}[];
|
|
45
|
+
maxlength: number;
|
|
46
|
+
minlength: number;
|
|
47
|
+
showType: 'switch' | 'checkbox';
|
|
48
|
+
/** 新增对象的生成器 */
|
|
49
|
+
generator?: Function;
|
|
50
|
+
columnWidthEnum?: tableColumnWidthEnum[];
|
|
51
|
+
hiddenMarginOrPadding: 'margin' | 'padding';
|
|
52
|
+
/** form-item显示的名称 */
|
|
53
|
+
label?: string;
|
|
54
|
+
hiddenColor?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 属性编辑器
|
|
58
|
+
*
|
|
59
|
+
* @interface IPropEditor
|
|
60
|
+
*/
|
|
61
|
+
export interface IPropEditor {
|
|
62
|
+
/** prop组件 */
|
|
63
|
+
component: string;
|
|
64
|
+
/** prop名称 没有name的情况指的是:此editor改的不是组件的prop而是改的其他地方的数据 */
|
|
65
|
+
/** root:开头就全链路修改widget */
|
|
66
|
+
name?: string | Record<string, any>;
|
|
67
|
+
/**
|
|
68
|
+
* 组件所归属的套件,非清单中的配置界面不显示
|
|
69
|
+
*
|
|
70
|
+
* @author zhanghanrui
|
|
71
|
+
* @date 2024-05-31 09:05:49
|
|
72
|
+
* @type {string[]}
|
|
73
|
+
*/
|
|
74
|
+
kit?: string[];
|
|
75
|
+
/** 右侧显示的label名称 */
|
|
76
|
+
label: string;
|
|
77
|
+
/** prop是否必填 */
|
|
78
|
+
required?: boolean;
|
|
79
|
+
/** prop分组 */
|
|
80
|
+
group: PropGroup | string;
|
|
81
|
+
/** 自定义校验 */
|
|
82
|
+
validate?: Promise<any>;
|
|
83
|
+
/** editor内部的自定义config逻辑 */
|
|
84
|
+
_config?: Partial<IPropEditorConfig>;
|
|
85
|
+
/** 表单项额外配置 */
|
|
86
|
+
editor?: Record<string, any>;
|
|
87
|
+
/** 表单项配置 */
|
|
88
|
+
formItem?: Record<string, any>;
|
|
89
|
+
/** prop变时的callback */
|
|
90
|
+
changeCallback?: (arg: IBasicSchema, val: any) => void;
|
|
91
|
+
/** 是否是纯表单字段配置(在 hidden 方法之后执行,如果为 false 直接隐藏)只针对于字段 */
|
|
92
|
+
formField?: boolean;
|
|
93
|
+
/** editor的是否隐藏逻辑 */
|
|
94
|
+
hidden?: (arg: IBasicSchema) => boolean;
|
|
95
|
+
/** props依赖的字段,依赖的字段不存在会隐藏,变化了会刷新 */
|
|
96
|
+
dependentProps?: string[];
|
|
97
|
+
formItemStyle?: CSSProperties;
|
|
98
|
+
formItemClass?: string;
|
|
99
|
+
onMounted?: (widget: IBasicSchema) => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* editor属性
|
|
103
|
+
*
|
|
104
|
+
* @interface IPropEditorConfig
|
|
105
|
+
*/
|
|
106
|
+
export interface IPropEditorConfig {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
width?: number;
|
|
109
|
+
filterFields: FIELD_TYPE[];
|
|
110
|
+
filterTypes: CreateType[];
|
|
111
|
+
fieldToProp: IFieldToProp[];
|
|
112
|
+
options: Function | {
|
|
113
|
+
label?: string;
|
|
114
|
+
icon?: string;
|
|
115
|
+
value: string | boolean | number;
|
|
116
|
+
suffix?: string;
|
|
117
|
+
}[];
|
|
118
|
+
options2: Function | {
|
|
119
|
+
label?: string;
|
|
120
|
+
icon?: string;
|
|
121
|
+
value: string | boolean | number;
|
|
122
|
+
}[];
|
|
123
|
+
createField: Function;
|
|
124
|
+
updateAsyncField?: Function;
|
|
125
|
+
maxlength?: Function | number;
|
|
126
|
+
minlength?: Function | number;
|
|
127
|
+
max?: Function | number;
|
|
128
|
+
min?: Function | number;
|
|
129
|
+
precision?: Function | number;
|
|
130
|
+
i18n?: boolean;
|
|
131
|
+
clearable?: boolean;
|
|
132
|
+
/** 后置标签 */
|
|
133
|
+
addonAfter?: string;
|
|
134
|
+
disabled?: Function | boolean;
|
|
135
|
+
/** 标签提示 */
|
|
136
|
+
tooltip?: string | string[];
|
|
137
|
+
multiple?: boolean;
|
|
138
|
+
/** 多选最多选择的个数 */
|
|
139
|
+
maxMultiple?: number;
|
|
140
|
+
modelKey?: string;
|
|
141
|
+
type?: string;
|
|
142
|
+
eventCallback?: Function;
|
|
143
|
+
filterFn?: (arg: any) => boolean;
|
|
144
|
+
/** 是否展示字数 */
|
|
145
|
+
showCount?: boolean;
|
|
146
|
+
/** 需要显示的输入属性内容 */
|
|
147
|
+
needFieldAttrs?: string[];
|
|
148
|
+
/** 需要过滤的输入属性内容 */
|
|
149
|
+
getFilterAttrs?: Function;
|
|
150
|
+
/** 组件类型key */
|
|
151
|
+
bindCmpStyleKey?: BindCmpStyleTypeEnum | Function;
|
|
152
|
+
filterOptionsCallback?: Function;
|
|
153
|
+
/** 日期、日期时间默认值 */
|
|
154
|
+
initPickerType?: string;
|
|
155
|
+
/** 图标色 */
|
|
156
|
+
showColor?: boolean;
|
|
157
|
+
/** 图标背景色 */
|
|
158
|
+
showBackground?: boolean;
|
|
159
|
+
/** 下拉框返回值类型 */
|
|
160
|
+
valueType?: string;
|
|
161
|
+
/** 名称 */
|
|
162
|
+
name?: string;
|
|
163
|
+
/** 清除子组件 */
|
|
164
|
+
clearChildren?: boolean;
|
|
165
|
+
/** 支持搜索 */
|
|
166
|
+
showSearch?: boolean;
|
|
167
|
+
/** 过滤自身 */
|
|
168
|
+
filterSelf?: boolean;
|
|
169
|
+
/** 根据props中哪个值来查询model字段 */
|
|
170
|
+
modelByKey: string;
|
|
171
|
+
/** 支持使用全局字段数据 */
|
|
172
|
+
supportGlobData?: boolean;
|
|
173
|
+
/** 获取查询组件信息 */
|
|
174
|
+
getSearchWidgets?: Function;
|
|
175
|
+
/** 显示复选框 */
|
|
176
|
+
showcheckbox?: boolean;
|
|
177
|
+
/** 所属系统,web_module、mobile_module */
|
|
178
|
+
module?: string;
|
|
179
|
+
/** 选择字段按钮标题 */
|
|
180
|
+
selectFiledBtnTitle?: string;
|
|
181
|
+
/** 查询子表或非子表 不传查询全部(1 子模型, 0 非子模型) */
|
|
182
|
+
subModel?: number;
|
|
183
|
+
/** 模型种类:(entity/data/view) 多个类型逗号分隔 */
|
|
184
|
+
category?: string;
|
|
185
|
+
/** 选择字段能否被拖拽 */
|
|
186
|
+
draggable?: boolean;
|
|
187
|
+
/** 默认创建的按钮类型 */
|
|
188
|
+
defaultButtonType?: object;
|
|
189
|
+
/** 组件辅助提示文本 */
|
|
190
|
+
tips?: string;
|
|
191
|
+
/** 是否显示切换单位 */
|
|
192
|
+
filterUnitType?: 'px' | '%';
|
|
193
|
+
placeholder?: string;
|
|
194
|
+
/** 需要过滤的字段 */
|
|
195
|
+
excludeFieldType?: FIELD_TYPE[];
|
|
196
|
+
/** 最要过滤的字段key */
|
|
197
|
+
excludeFieldKey?: string[];
|
|
198
|
+
/** 默认展开所有节点 */
|
|
199
|
+
defaultExpandAll?: boolean;
|
|
200
|
+
/** 显示checkbox */
|
|
201
|
+
treeCheckable?: boolean;
|
|
202
|
+
/** tag显示的内容 */
|
|
203
|
+
tagName?: string;
|
|
204
|
+
/** 是否显示tag */
|
|
205
|
+
showTagFunc?: boolean | Function;
|
|
206
|
+
/** 是否一行显示 */
|
|
207
|
+
isInRow?: boolean;
|
|
208
|
+
/** 一行显示时是否居右显示 */
|
|
209
|
+
isRight?: boolean;
|
|
210
|
+
/** 获取modelkey */
|
|
211
|
+
getModelKey?: Function;
|
|
212
|
+
/** label行中右侧按钮 */
|
|
213
|
+
labelButton?: object;
|
|
214
|
+
/** label 水平布局时,左侧的label名称 */
|
|
215
|
+
label?: string;
|
|
216
|
+
/** linkage-editor 是否是tree */
|
|
217
|
+
isTreeSelect?: boolean | ((IData: any) => boolean);
|
|
218
|
+
/** 插槽 */
|
|
219
|
+
slots?: object;
|
|
220
|
+
/** 关联表单的模型key */
|
|
221
|
+
bindModelKey?: string;
|
|
222
|
+
/** 头部按钮 */
|
|
223
|
+
headerRightButton?: FormComponents[] | ((w: IBasicSchema) => FormComponents[]);
|
|
224
|
+
/** 批量按钮 */
|
|
225
|
+
headerLeftButton?: FormComponents[] | ((w: IBasicSchema) => FormComponents[]);
|
|
226
|
+
/** 单行按钮 */
|
|
227
|
+
columnsButton?: FormComponents[] | ((w: IBasicSchema) => FormComponents[]);
|
|
228
|
+
/** rdo单行按钮 */
|
|
229
|
+
columnsRdoButton?: [
|
|
230
|
+
{
|
|
231
|
+
value: FormComponents[] | ((w: IBasicSchema) => FormComponents[]);
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
value: FormComponents[] | ((w: IBasicSchema) => FormComponents[]);
|
|
235
|
+
}
|
|
236
|
+
];
|
|
237
|
+
/** 模块类型 */
|
|
238
|
+
moduleType?: string;
|
|
239
|
+
}
|