Skip to content

Commit d886325

Browse files
committed
feat: 迭代开发
1 parent 5462e3f commit d886325

File tree

8 files changed

+15
-2
lines changed

8 files changed

+15
-2
lines changed

docs/xflow/demo/log/runNode/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default () => {
2626
type: 'icon-model',
2727
bgColor: '#6172F3',
2828
},
29+
gradientHeight: '100%',
2930
settingSchema: {
3031
type: 'object',
3132
properties: {

packages/x-flow/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@xrenders/xflow",
3-
"version": "1.0.8-beta.6",
3+
"version": "1.0.8-beta.9",
44
"description": "一款功能强大、易用灵活的流程编辑器框架,帮助你轻松构建复杂的工作流和流程产品",
55
"keywords": [
66
"xflow"

packages/x-flow/src/components/NodeContainer/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default memo((props: any) => {
2222
isSwitchBottom,
2323
nodeSettingTitle,
2424
style,
25+
gradientHeight: _gradientHeight,
2526
} = props;
2627
const IconBox = useMemo(() => createIconFont(iconFontUrl), [iconFontUrl]);
2728
const containerRef = React.useRef<HTMLDivElement>(null);
@@ -60,7 +61,8 @@ export default memo((props: any) => {
6061

6162
const hasBody = !!children;
6263
const hasDesc = !!desc && !hideDesc;
63-
const gradientHeight = hasBody || hasDesc || NodeWidget ? '20%' : '100%';
64+
const gradientHeight = _gradientHeight || (hasBody || hasDesc || NodeWidget ? '20%' : '100%');
65+
debugger;
6466

6567
return (
6668
<div

packages/x-flow/src/nodes/node-common/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default memo((props: any) => {
99
const nodeSetting = settingMap[type] || {};
1010
const NodeWidget = widgets[nodeSetting?.nodeWidget] || undefined;
1111
const nodeDescription = nodeSetting?.description || '';
12+
const gradientHeight = nodeSetting?.gradientHeight;
1213

1314
const hideDesc = nodeSetting?.nodePanel?.hideDesc ?? globalConfig?.nodePanel?.hideDesc ?? false;
1415
const hideTitleTips = globalConfig?.nodeView?.hideTitleTips ?? false;
@@ -32,6 +33,7 @@ export default memo((props: any) => {
3233
iconSvg={SVGWidget ? <SVGWidget setting={nodeSetting} /> : false}
3334
hideTitleTips={hideTitleTips}
3435
nodeSettingTitle={nodeSetting.title}
36+
gradientHeight={gradientHeight}
3537
style={{...getColorfulModeBackground(nodeSetting?.icon?.bgColor, openColorfulMode)}}
3638
/>
3739
);

packages/x-flow/src/nodes/node-end/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default memo((props: any) => {
1010
const NodeWidget = widgets[nodeSetting?.nodeWidget] || undefined;
1111
const nodeDescription = nodeSetting?.description || '';
1212
const hideDesc = nodeSetting?.nodePanel?.hideDesc ?? globalConfig?.nodePanel?.hideDesc ?? false;
13+
const gradientHeight = nodeSetting?.gradientHeight;
1314
const hideTitleTips = globalConfig?.nodeView?.hideTitleTips ?? false;
1415
const SVGWidget = widgets[nodeSetting?.iconSvg]; // 自定义面板配置组件
1516

@@ -31,6 +32,7 @@ export default memo((props: any) => {
3132
iconSvg={SVGWidget ? <SVGWidget setting={nodeSetting} /> : false}
3233
hideTitleTips={hideTitleTips}
3334
nodeSettingTitle={nodeSetting.title||'结束'}
35+
gradientHeight={gradientHeight}
3436
style={{...getColorfulModeBackground(nodeSetting?.icon?.bgColor, openColorfulMode)}}
3537
/>
3638
);

packages/x-flow/src/nodes/node-parallel/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default memo((props: any) => {
2222
const nodeSetting = settingMap[type] || {};
2323
const NodeWidget = widgets[nodeSetting?.nodeWidget] || undefined;
2424
const nodeDescription = nodeSetting?.description || '';
25+
const gradientHeight = nodeSetting?.gradientHeight;
2526
const hideDesc =
2627
nodeSetting?.nodePanel?.hideDesc ??
2728
globalConfig?.nodePanel?.hideDesc ??
@@ -45,6 +46,7 @@ export default memo((props: any) => {
4546
hideDesc={hideDesc}
4647
desc={data?.desc}
4748
iconFontUrl={iconFontUrl}
49+
gradientHeight={gradientHeight}
4850
NodeWidget={
4951
<ParallelBuildInNodeWidget
5052
data={data}

packages/x-flow/src/nodes/node-start/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default memo((props: any) => {
99
useContext(ConfigContext);
1010
const nodeSetting = settingMap[type] || {};
1111
const NodeWidget = widgets[nodeSetting?.nodeWidget] || undefined;
12+
const gradientHeight = nodeSetting?.gradientHeight;
1213
const nodeDescription = nodeSetting?.description || '';
1314
const hideDesc =
1415
nodeSetting?.nodePanel?.hideDesc ??
@@ -35,6 +36,7 @@ export default memo((props: any) => {
3536
iconSvg={SVGWidget ? <SVGWidget setting={nodeSetting} /> : false}
3637
hideTitleTips={hideTitleTips}
3738
nodeSettingTitle={nodeSetting?.title || '开始'}
39+
gradientHeight={gradientHeight}
3840
style={{...getColorfulModeBackground(nodeSetting?.icon?.bgColor, openColorfulMode)}}
3941
/>
4042
);

packages/x-flow/src/nodes/node-switch/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default memo((props: any) => {
2525
const nodeSetting = settingMap[type] || {};
2626
const NodeWidget = widgets[nodeSetting?.nodeWidget] || undefined;
2727
const nodeDescription = nodeSetting?.description || '';
28+
const gradientHeight = nodeSetting?.gradientHeight;
2829
const hideDesc =
2930
nodeSetting?.nodePanel?.hideDesc ??
3031
globalConfig?.nodePanel?.hideDesc ??
@@ -69,6 +70,7 @@ export default memo((props: any) => {
6970
hideTitleTips={hideTitleTips}
7071
isSwitchBottom={isSwitchBottom}
7172
nodeSettingTitle={nodeSetting?.title || 'Switch'}
73+
gradientHeight={gradientHeight}
7274
style={{...getColorfulModeBackground(nodeSetting?.icon?.bgColor, openColorfulMode)}}
7375
/>
7476
);

0 commit comments

Comments
 (0)