mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 04:40:32 +00:00
Merge branch 'components-panel' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into components-panel
This commit is contained in:
commit
dc09d4f1ef
@ -12,6 +12,13 @@
|
||||
"version": "1.19.18",
|
||||
"urls": ["https://unpkg.antfin-inc.com/@alife/next@1.19.18/dist/next.js", "https://unpkg.antfin-inc.com/@alife/next@1.19.18/dist/next.css"],
|
||||
"library": "Next"
|
||||
},
|
||||
{
|
||||
"title": "MCBreadcrumb",
|
||||
"package": "mc-breadcrumb",
|
||||
"version": "1.0.0",
|
||||
"urls": ["https://unpkg.alibaba-inc.com/mc-breadcrumb@1.0.0/dist/MCBreadcrumb.js", "https://unpkg.alibaba-inc.com/mc-breadcrumb@1.0.0/dist/MCBreadcrumb.css"],
|
||||
"library": "MCBreadcrumb"
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
@ -649,6 +656,87 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentName": "MCBreadcrumb",
|
||||
"title": "MCBreadcrumb",
|
||||
"docUrl": "",
|
||||
"screenshot": "",
|
||||
"npm": {
|
||||
"package": "mc-breadcrumb",
|
||||
"version": "1.0.0",
|
||||
"exportName": "MCBreadcrumb",
|
||||
"main": "lib/index.js",
|
||||
"destructuring": false,
|
||||
"subName": ""
|
||||
},
|
||||
"props": [
|
||||
{
|
||||
"name": "prefix",
|
||||
"propType": "string",
|
||||
"description": "样式类名的品牌前缀",
|
||||
"defaultValue": "next-"
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"propType": "string",
|
||||
"description": "标题",
|
||||
"defaultValue": "next-"
|
||||
},
|
||||
{
|
||||
"name": "rtl",
|
||||
"propType": "bool"
|
||||
},
|
||||
{
|
||||
"name": "children",
|
||||
"propType": {
|
||||
"type": "instanceOf",
|
||||
"value": "custom"
|
||||
},
|
||||
"description": "面包屑子节点,需传入 Breadcrumb.Item"
|
||||
},
|
||||
{
|
||||
"name": "maxNode",
|
||||
"propType": {
|
||||
"type": "oneOfType",
|
||||
"value": [
|
||||
"number",
|
||||
{
|
||||
"type": "oneOf",
|
||||
"value": [
|
||||
"auto"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "面包屑最多显示个数,超出部分会被隐藏, 设置为 auto 会自动根据父元素的宽度适配。",
|
||||
"defaultValue": 100
|
||||
},
|
||||
{
|
||||
"name": "separator",
|
||||
"propType": {
|
||||
"type": "instanceOf",
|
||||
"value": "node"
|
||||
},
|
||||
"description": "分隔符,可以是文本或 Icon"
|
||||
},
|
||||
{
|
||||
"name": "component",
|
||||
"propType": {
|
||||
"type": "oneOfType",
|
||||
"value": [
|
||||
"string",
|
||||
"func"
|
||||
]
|
||||
},
|
||||
"description": "设置标签类型",
|
||||
"defaultValue": "nav"
|
||||
},
|
||||
{
|
||||
"name": "className",
|
||||
"propType": "any"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentName": "Breadcrumb.Item",
|
||||
"title": "@alifd/next",
|
||||
@ -856,7 +944,7 @@
|
||||
},
|
||||
{
|
||||
"componentName": "Button.Group",
|
||||
"title": "@alifd/next",
|
||||
"title": "Button.Group",
|
||||
"docUrl": "",
|
||||
"screenshot": "",
|
||||
"npm": {
|
||||
@ -4079,7 +4167,7 @@
|
||||
},
|
||||
{
|
||||
"componentName": "Form",
|
||||
"title": "@alifd/next",
|
||||
"title": "Form",
|
||||
"docUrl": "",
|
||||
"screenshot": "",
|
||||
"npm": {
|
||||
@ -4241,7 +4329,7 @@
|
||||
},
|
||||
{
|
||||
"componentName": "Form.Item",
|
||||
"title": "@alifd/next",
|
||||
"title": "Form.Item",
|
||||
"docUrl": "",
|
||||
"screenshot": "",
|
||||
"npm": {
|
||||
@ -12189,6 +12277,27 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentName": "MCBreadcrumb",
|
||||
"title": "MC面包屑",
|
||||
"icon": "",
|
||||
"package": "mc-breadcrumb",
|
||||
"library": "MCBreadcrumb",
|
||||
"snippets": [
|
||||
{
|
||||
"title": "面包屑",
|
||||
"screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_breadcrumb.png",
|
||||
"schema": {
|
||||
"componentName": "MCBreadcrumb",
|
||||
"props": {
|
||||
"title": "物料中心",
|
||||
"prefix": "next-",
|
||||
"maxNode": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"componentName": "Nav",
|
||||
"title": "导航",
|
||||
|
||||
@ -69,7 +69,5 @@
|
||||
<body>
|
||||
<!-- lowcode engine globals -->
|
||||
<div id="lce-container"></div>
|
||||
<script src="/js/editor-preset-vision.js"></script>
|
||||
<script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
"componentName": "Div",
|
||||
"componentName": "Box",
|
||||
"props": {
|
||||
"style": {
|
||||
"textAlign": "center"
|
||||
|
||||
@ -826,7 +826,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
event: e,
|
||||
};
|
||||
|
||||
if (e.dragObject && e.dragObject.nodes && e.dragObject.nodes.length && e.dragObject.nodes[0].getPrototype().isModal()) {
|
||||
if (e.dragObject && e.dragObject.nodes && e.dragObject.nodes.length && e.dragObject.nodes[0].getPrototype()?.isModal()) {
|
||||
return this.designer.createLocation({
|
||||
target: this.document.rootNode,
|
||||
detail,
|
||||
|
||||
@ -161,7 +161,7 @@ class FormSetter extends Component<FormSetterProps> {
|
||||
constructor(props: RowSetterProps) {
|
||||
super(props);
|
||||
const { config, field } = props;
|
||||
this.items = (config.items || []).map((conf) => field.createField(conf));
|
||||
this.items = (config?.items || []).map((conf) => field.createField(conf));
|
||||
|
||||
// TODO: extraConfig for custom fields
|
||||
}
|
||||
|
||||
@ -158,5 +158,5 @@ function hoverNode(node: Node, flag: boolean) {
|
||||
node.hover(flag);
|
||||
}
|
||||
function selectNode(node: Node) {
|
||||
node.select();
|
||||
node?.select();
|
||||
}
|
||||
|
||||
@ -234,6 +234,7 @@ export default class SourceEditor extends Component<{
|
||||
let functionMap = transfrom.code2Schema(newCode);
|
||||
let schema = editor.get('designer').project.getSchema();
|
||||
let newSchema = transfrom.setFunction2Schema(functionMap,schema);
|
||||
editor.get('designer').project.load(newSchema);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
@ -40,15 +40,11 @@ const transfrom = {
|
||||
}
|
||||
})
|
||||
|
||||
console.log(JSON.stringify(a.state));
|
||||
|
||||
console.log(functionMap);
|
||||
|
||||
if (a.state){
|
||||
functionMap.state = a.state
|
||||
}
|
||||
|
||||
|
||||
return functionMap;
|
||||
|
||||
},
|
||||
@ -63,12 +59,33 @@ const transfrom = {
|
||||
if (key == 'state'){
|
||||
pageNode.state = functionMap[key];
|
||||
}else{
|
||||
// 判断是否属于lifeCycles节点
|
||||
if (LIFECYCLES_FUNCTION_MAP.react.indexOf(key)>=0){
|
||||
// 判断有没有lifecycles节点
|
||||
if (!pageNode.lifeCycles){
|
||||
pageNode.lifeCycles = {}
|
||||
}else{
|
||||
pageNode.lifeCycles[key] = {
|
||||
"type": "JSFunction",
|
||||
"value": functionMap[key],
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// methods节点
|
||||
if (!pageNode.methods){
|
||||
pageNode.methods = {}
|
||||
}else{
|
||||
pageNode.methods[key] = {
|
||||
"type": "JSFunction",
|
||||
"value": functionMap[key],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return schema;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user