mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-21 16:48:18 +00:00
Merge remote-tracking branch 'origin/develop' into release/1.1.7-beta
This commit is contained in:
commit
c18cc9bff0
@ -52,7 +52,7 @@
|
|||||||
"yarn": "^1.22.17",
|
"yarn": "^1.22.17",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"@types/react-router": "5.1.18",
|
"@types/react-router": "5.1.18",
|
||||||
"build-plugin-component": "^1.12.0",
|
"@alilc/build-plugin-lce": "^0.0.3",
|
||||||
"babel-jest": "^26.5.2",
|
"babel-jest": "^26.5.2",
|
||||||
"@alilc/lowcode-test-mate": "^1.0.1"
|
"@alilc/lowcode-test-mate": "^1.0.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
],
|
],
|
||||||
"babelPlugins": [
|
"babelPlugins": [
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"es"
|
"es"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo",
|
"build": "build-scripts build",
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"build-plugin-fusion",
|
"build-plugin-fusion",
|
||||||
"./build.plugin.js"
|
"./build.plugin.js"
|
||||||
]
|
]
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"es"
|
"es"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alifd/next": "^1.19.16",
|
"@alifd/next": "^1.19.16",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"build-plugin-fusion",
|
"build-plugin-fusion",
|
||||||
["build-plugin-moment-locales", {
|
["build-plugin-moment-locales", {
|
||||||
"locales": ["zh-cn"]
|
"locales": ["zh-cn"]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
],
|
],
|
||||||
"babelPlugins": [
|
"babelPlugins": [
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lowcode",
|
"lowcode",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
[
|
[
|
||||||
"build-plugin-fusion",
|
"build-plugin-fusion",
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
[
|
[
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
{
|
{
|
||||||
"filename": "editor-preset-vision",
|
"filename": "editor-preset-vision",
|
||||||
"library": "LowcodeEditor",
|
"library": "LowcodeEditor",
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "build-scripts start",
|
"start": "build-scripts start",
|
||||||
"version:update": "node ./scripts/version.js",
|
"version:update": "node ./scripts/version.js",
|
||||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
|
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
|
||||||
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
|
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
|
||||||
"test": "build-scripts test --config build.test.json --jest-passWithNoTests"
|
"test": "build-scripts test --config build.test.json --jest-passWithNoTests"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"stylePath": "style.js",
|
"stylePath": "style.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lowcode",
|
"lowcode",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"build-plugin-fusion",
|
"build-plugin-fusion",
|
||||||
["build-plugin-moment-locales", {
|
["build-plugin-moment-locales", {
|
||||||
"locales": ["zh-cn"]
|
"locales": ["zh-cn"]
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alifd/next": "^1.19.16",
|
"@alifd/next": "^1.19.16",
|
||||||
|
|||||||
@ -35,6 +35,8 @@ enum EVENT_NAMES {
|
|||||||
titleLabelChanged = 'titleLabelChanged',
|
titleLabelChanged = 'titleLabelChanged',
|
||||||
|
|
||||||
expandableChanged = 'expandableChanged',
|
expandableChanged = 'expandableChanged',
|
||||||
|
|
||||||
|
conditionChanged = 'conditionChanged',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TreeNode {
|
export default class TreeNode {
|
||||||
@ -152,6 +154,10 @@ export default class TreeNode {
|
|||||||
return this.node.slots.map((node) => this.tree.getTreeNode(node));
|
return this.node.slots.map((node) => this.tree.getTreeNode(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get condition(): boolean {
|
||||||
|
return this.node.hasCondition() && !this.node.conditionGroup;
|
||||||
|
}
|
||||||
|
|
||||||
get children(): TreeNode[] | null {
|
get children(): TreeNode[] | null {
|
||||||
return this.node.children?.map((node) => this.tree.getTreeNode(node)) || null;
|
return this.node.children?.map((node) => this.tree.getTreeNode(node)) || null;
|
||||||
}
|
}
|
||||||
@ -203,6 +209,15 @@ export default class TreeNode {
|
|||||||
this.event.off(EVENT_NAMES.titleLabelChanged, fn);
|
this.event.off(EVENT_NAMES.titleLabelChanged, fn);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onConditionChanged(fn: (treeNode: TreeNode) => void): IPublicTypeDisposable {
|
||||||
|
this.event.on(EVENT_NAMES.conditionChanged, fn);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
this.event.off(EVENT_NAMES.conditionChanged, fn);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
onExpandableChanged(fn: (expandable: boolean) => void): IPublicTypeDisposable {
|
onExpandableChanged(fn: (expandable: boolean) => void): IPublicTypeDisposable {
|
||||||
this.event.on(EVENT_NAMES.expandableChanged, fn);
|
this.event.on(EVENT_NAMES.expandableChanged, fn);
|
||||||
return () => {
|
return () => {
|
||||||
@ -221,6 +236,10 @@ export default class TreeNode {
|
|||||||
this.event.emit(EVENT_NAMES.titleLabelChanged, this.title);
|
this.event.emit(EVENT_NAMES.titleLabelChanged, this.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notifyConditionChanged(): void {
|
||||||
|
this.event.emit(EVENT_NAMES.conditionChanged, this.condition);
|
||||||
|
}
|
||||||
|
|
||||||
setHidden(flag: boolean) {
|
setHidden(flag: boolean) {
|
||||||
if (this.node.conditionGroup) {
|
if (this.node.conditionGroup) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -35,6 +35,9 @@ export class Tree {
|
|||||||
if (key === '___title___') {
|
if (key === '___title___') {
|
||||||
const treeNode = this.getTreeNodeById(node.id);
|
const treeNode = this.getTreeNodeById(node.id);
|
||||||
treeNode?.notifyTitleLabelChanged();
|
treeNode?.notifyTitleLabelChanged();
|
||||||
|
} else if (key === '___condition___') {
|
||||||
|
const treeNode = this.getTreeNodeById(node.id);
|
||||||
|
treeNode?.notifyConditionChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export default class TreeTitle extends PureComponent<{
|
|||||||
state: {
|
state: {
|
||||||
editing: boolean;
|
editing: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
|
condition?: boolean;
|
||||||
} = {
|
} = {
|
||||||
editing: false,
|
editing: false,
|
||||||
title: '',
|
title: '',
|
||||||
@ -80,12 +81,18 @@ export default class TreeTitle extends PureComponent<{
|
|||||||
this.setState({
|
this.setState({
|
||||||
editing: false,
|
editing: false,
|
||||||
title: treeNode.titleLabel,
|
title: treeNode.titleLabel,
|
||||||
|
condition: treeNode.condition,
|
||||||
});
|
});
|
||||||
treeNode.onTitleLabelChanged(() => {
|
treeNode.onTitleLabelChanged(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
title: treeNode.titleLabel,
|
title: treeNode.titleLabel,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
treeNode.onConditionChanged(() => {
|
||||||
|
this.setState({
|
||||||
|
condition: treeNode.condition,
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -188,7 +195,7 @@ export default class TreeTitle extends PureComponent<{
|
|||||||
<Tip>{intlNode('Loop')}</Tip>
|
<Tip>{intlNode('Loop')}</Tip>
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
{node.hasCondition() && !node.conditionGroup && (
|
{this.state.condition && (
|
||||||
<a className="tree-node-tag cond">
|
<a className="tree-node-tag cond">
|
||||||
{/* todo: click todo something */}
|
{/* todo: click todo something */}
|
||||||
<IconCond />
|
<IconCond />
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["build-plugin-component", "./build.plugin.js"]
|
"plugins": ["@alilc/build-plugin-lce", "./build.plugin.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
|
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
|
||||||
"build:umd": "build-scripts build --config build.umd.json"
|
"build:umd": "build-scripts build --config build.umd.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"build-plugin-fusion",
|
"build-plugin-fusion",
|
||||||
["build-plugin-moment-locales", {
|
["build-plugin-moment-locales", {
|
||||||
"locales": ["zh-cn"]
|
"locales": ["zh-cn"]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"start": "build-scripts start",
|
"start": "build-scripts start",
|
||||||
"build": "build-scripts build --skip-demo",
|
"build": "build-scripts build",
|
||||||
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
|
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["build-plugin-component", "./build.plugin.js"]
|
"plugins": ["@alilc/build-plugin-lce", "./build.plugin.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
|
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
|
||||||
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
|
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
|
||||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
[
|
[
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
{
|
{
|
||||||
"babelPlugins": ["@babel/plugin-transform-typescript"]
|
"babelPlugins": ["@babel/plugin-transform-typescript"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"es"
|
"es"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo",
|
"build": "build-scripts build",
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,7 @@
|
|||||||
"es"
|
"es"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo",
|
"build": "build-scripts build"
|
||||||
"test": "build-scripts test --config build.test.json",
|
|
||||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alilc/lowcode-datasource-types": "^1.0.0",
|
"@alilc/lowcode-datasource-types": "^1.0.0",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"build": "build-scripts build --skip-demo"
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alifd/next": "^1.19.16",
|
"@alifd/next": "^1.19.16",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component"
|
"@alilc/build-plugin-lce"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"build-plugin-component",
|
"@alilc/build-plugin-lce",
|
||||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"es"
|
"es"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "build-scripts build --skip-demo",
|
"build": "build-scripts build",
|
||||||
"test": "build-scripts test --config build.test.json",
|
"test": "build-scripts test --config build.test.json",
|
||||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user