Skip to content

Commit ca45064

Browse files
authored
Merge pull request #1585 from alibaba/xflow
Xflow
2 parents 01919f1 + b0804b8 commit ca45064

File tree

40 files changed

+819
-356
lines changed

40 files changed

+819
-356
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
.yarn
1313
.turbo/cookies
14+
.turbo/daemon
15+
.turbo
1416

1517
# turbo
1618
*/*/.turbo

.turbo/daemon/9af73f40ad414c73-turbo.log.2024-12-04

Lines changed: 95 additions & 0 deletions
Large diffs are not rendered by default.

docs/xflow/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ title: API
1313
| layout | 节点布局的方向 | `LR \| TB` | LR | - |
1414
| widgets | 自定义组件 | `Record<string, ReactNode>` | - | - |
1515
| settings | 节点配置,定义页面中可拖动的节点配置 | ( [TNodeGroup](#tnodegroup) \| [TNodeItem](#tnodeitem) )[ ] | |
16-
| nodeSelector | 节点选择器配置,可控制节点的可搜索性 | `TNodeSelector` | |
16+
| nodeSelector | 节点选择器配置,可控制节点的可搜索性 | `TNodeSelector`
17+
| iconFontUrl | iconfont url,用于配置图标渲染 | `String` | |
18+
| |
1719

1820
### TNodeGroup
1921

docs/xflow/demo/basic/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default [
162162
type: 'Switch',
163163
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
164164
icon: {
165-
type: 'icon-switch',
165+
type: 'icon-fenzhi',
166166
bgColor: '#06AED4',
167167
},
168168
settingSchema: {

docs/xflow/demo/custom-flow/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default [
7474
type: 'Switch',
7575
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
7676
icon: {
77-
type: 'icon-switch',
77+
type: 'icon-fenzhi',
7878
bgColor: '#06AED4',
7979
},
8080
},

docs/xflow/demo/flow-provider/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default [
132132
type: 'Switch',
133133
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
134134
icon: {
135-
type: 'icon-switch',
135+
type: 'icon-fenzhi',
136136
bgColor: '#06AED4',
137137
},
138138
},

docs/xflow/demo/layout/LR/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default [
132132
type: 'Switch',
133133
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
134134
icon: {
135-
type: 'icon-switch',
135+
type: 'icon-fenzhi',
136136
bgColor: '#06AED4',
137137
},
138138
},

docs/xflow/demo/layout/TB/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default [
132132
type: 'Switch',
133133
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
134134
icon: {
135-
type: 'icon-switch',
135+
type: 'icon-fenzhi',
136136
bgColor: '#06AED4',
137137
},
138138
},

docs/xflow/demo/nodeSetting/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default [
132132
type: 'Switch',
133133
description: '允许你根据 if/else 条件将 workflow 拆分成两个分支',
134134
icon: {
135-
type: 'icon-switch',
135+
type: 'icon-fenzhi',
136136
bgColor: '#06AED4',
137137
},
138138
},
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import XFlow from '@xrenders/xflow';
2+
import settings from './setting';
3+
import React from 'react';
4+
5+
const customWidget = ({ data, key, item }) => {
6+
return <p style={{ wordWrap: 'break-word' }}>{item?.value}</p>;
7+
};
8+
9+
export default () => {
10+
const nodes = [
11+
{
12+
type: 'Switch',
13+
id: '2',
14+
position: { x: 171.25, y: 218.75 },
15+
data: { switchData:[{value:"条件1"}]}
16+
},
17+
];
18+
19+
const edges = [];
20+
21+
return (
22+
<div style={{ height: '600px' }}>
23+
<XFlow
24+
initialValues={{ nodes, edges }}
25+
settings={settings}
26+
nodeSelector={{
27+
showSearch: true,
28+
}}
29+
widgets={{ customWidget }}
30+
/>
31+
</div>
32+
);
33+
};

0 commit comments

Comments
 (0)