ronds-metadata 1.1.7 → 1.1.10

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.
Files changed (53) hide show
  1. package/es/comps/DynamicPorts/comps/ContextMenu.css +8 -0
  2. package/es/comps/DynamicPorts/comps/ContextMenu.d.ts +7 -0
  3. package/es/comps/DynamicPorts/comps/ContextMenu.js +44 -0
  4. package/es/comps/DynamicPorts/comps/DragNode.d.ts +7 -0
  5. package/es/comps/DynamicPorts/comps/DragNode.js +52 -0
  6. package/es/comps/DynamicPorts/comps/GraphHandler/index.css +27 -0
  7. package/es/comps/DynamicPorts/comps/GraphHandler/index.d.ts +11 -0
  8. package/es/comps/DynamicPorts/comps/GraphHandler/index.js +51 -0
  9. package/es/comps/DynamicPorts/comps/NodeElement.js +8 -4
  10. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.css +5 -0
  11. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.d.ts +8 -0
  12. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +42 -0
  13. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.css +21 -0
  14. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.d.ts +8 -0
  15. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +40 -0
  16. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.css +23 -0
  17. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.d.ts +7 -0
  18. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +55 -0
  19. package/es/comps/DynamicPorts/comps/shape/node.js +1 -1
  20. package/es/comps/DynamicPorts/constant/index.d.ts +2 -2
  21. package/es/comps/DynamicPorts/constant/index.js +3 -3
  22. package/es/comps/DynamicPorts/graph.d.ts +62 -0
  23. package/es/comps/DynamicPorts/graph.js +584 -0
  24. package/es/comps/DynamicPorts/index.css +29 -19
  25. package/es/comps/DynamicPorts/index.d.ts +16 -1
  26. package/es/comps/DynamicPorts/index.js +122 -168
  27. package/es/comps/DynamicPorts/interface.d.ts +44 -0
  28. package/es/comps/DynamicPorts/interface.js +6 -0
  29. package/es/comps/DynamicPorts/utils.d.ts +104 -0
  30. package/es/comps/DynamicPorts/utils.js +127 -0
  31. package/es/comps/Icons/index.d.ts +18 -0
  32. package/es/comps/Icons/index.js +23 -0
  33. package/es/comps/MetadataForm/DataCell/layout/TableArray.js +63 -25
  34. package/es/comps/MetadataForm/utils.d.ts +1 -0
  35. package/es/comps/MetadataForm/utils.js +10 -1
  36. package/es/comps/locales/en-US.d.ts +4 -0
  37. package/es/comps/locales/en-US.js +10 -1
  38. package/es/comps/locales/zh-CN.d.ts +4 -0
  39. package/es/comps/locales/zh-CN.js +10 -1
  40. package/es/config.js +1 -1
  41. package/es/framework/graph/index.css +12 -0
  42. package/es/framework/graph/index.d.ts +60 -1
  43. package/es/framework/graph/index.js +425 -0
  44. package/es/framework/libs/iconfont/iconfont.css +187 -0
  45. package/es/framework/libs/iconfont/iconfont.ttf +0 -0
  46. package/es/framework/libs/iconfont/iconfont.woff +0 -0
  47. package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
  48. package/es/framework/rxjs-hooks/useObservableState.d.ts +3 -0
  49. package/es/framework/rxjs-hooks/useObservableState.js +45 -0
  50. package/es/index.d.ts +2 -0
  51. package/es/index.js +3 -1
  52. package/es/theme.css +6 -0
  53. package/package.json +6 -1
@@ -1,4 +1,19 @@
1
1
  import './index.less';
2
2
  import './comps/shape/connector';
3
- declare const DynamicPorts: () => JSX.Element;
3
+ import { NDPGraph } from './interface';
4
+ interface IDynamicPortsProps {
5
+ /**
6
+ * 渲染图结构
7
+ */
8
+ defaultValue?: NDPGraph.GraphData;
9
+ /**
10
+ * 图更新事件
11
+ */
12
+ onChange?: (data: NDPGraph.GraphData) => void;
13
+ /**
14
+ * 节点选中事件
15
+ */
16
+ onNodeSelect?: (data: NDPGraph.Node) => void;
17
+ }
18
+ declare const DynamicPorts: (props: IDynamicPortsProps) => JSX.Element;
4
19
  export default DynamicPorts;
@@ -1,187 +1,141 @@
1
- import "antd/es/tooltip/style";
2
- import _Tooltip from "antd/es/tooltip";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
 
4
4
  /*
5
5
  * @Author: wangxian
6
6
  * @Date: 2022-05-16 18:53:31
7
- * @LastEditTime: 2022-05-24 12:09:46
7
+ * @LastEditTime: 2022-05-27 14:24:06
8
8
  */
9
- import { Graph, Markup } from '@antv/x6';
10
9
  import React from 'react';
11
- import NodeElement from './comps/NodeElement';
12
- import { DPGroupEdge } from './comps/shape/edge';
13
- import { DPNode } from './comps/shape/node';
14
- import ReactDOM from 'react-dom';
10
+ import { filter } from 'rxjs';
11
+ import { useDrop } from 'react-dnd';
15
12
  import "./index.css";
16
13
  import './comps/shape/connector';
14
+ import { useDPGraph, useUnmountDPGraph } from './graph';
15
+ import { DRAGGABLE_COMPONENT, DRAGGABLE_MODEL } from './constant';
16
+ import { guid } from '../../utils';
17
+ import ContextMenu from './comps/ContextMenu';
18
+ import { GraphHandler } from './comps/GraphHandler';
17
19
 
18
- var DynamicPorts = function DynamicPorts() {
20
+ var DynamicPorts = function DynamicPorts(props) {
21
+ var defaultValue = props.defaultValue,
22
+ onChange = props.onChange,
23
+ onNodeSelect = props.onNodeSelect;
19
24
  var divRef = React.useRef(null);
25
+ var containerRef = React.useRef(null);
26
+
27
+ var _React$useState = React.useState(),
28
+ _React$useState2 = _slicedToArray(_React$useState, 2),
29
+ dpGraph = _React$useState2[0],
30
+ setGraph = _React$useState2[1];
31
+
32
+ var dpGraphRef = React.useRef();
33
+ var firstLoadRef = React.useRef(true); // 处理画布卸载
34
+
35
+ useUnmountDPGraph(); // 渲染画布
36
+
20
37
  React.useEffect(function () {
21
- if (divRef.current !== null) {
22
- var graph = new Graph({
23
- container: divRef.current,
24
- grid: true,
25
- onPortRendered: function onPortRendered(args) {
26
- var port = args.port;
27
- var contentSelectors = args.contentSelectors;
28
- var container = contentSelectors && contentSelectors.content;
29
- var placement = port.group === 'in' ? 'top' : 'bottom';
30
-
31
- if (container) {
32
- ReactDOM.render( /*#__PURE__*/React.createElement(_Tooltip, {
33
- title: port.description,
34
- placement: placement
35
- }, /*#__PURE__*/React.createElement("div", {
36
- className: "dp-port".concat(port.connected ? '.connected' : '')
37
- })), container);
38
- }
39
- }
38
+ if (firstLoadRef.current) {
39
+ var _dpGraph = useDPGraph(defaultValue);
40
+
41
+ dpGraphRef.current = _dpGraph;
42
+ setGraph(_dpGraph);
43
+
44
+ _dpGraph.renderGraph(containerRef.current, divRef.current); // 获取图信息的订阅
45
+
46
+
47
+ _dpGraph.factory$.dpGraph.pipe(filter(function (x) {
48
+ return !!x;
49
+ })).subscribe(function (v) {
50
+ onChange && onChange(v);
51
+ }); // 获取选中节点的订阅
52
+
53
+
54
+ _dpGraph.factory$.selectedNodes.subscribe(function (v) {
55
+ onNodeSelect && onNodeSelect(v[0]);
40
56
  });
41
- graph.addNode(new DPNode({
42
- id: '1',
43
- x: 40,
44
- y: 35,
45
- ports: {
46
- items: [{
47
- group: 'in',
48
- id: 'in11'
49
- }, {
50
- group: 'in',
51
- id: 'in22'
52
- }, {
53
- group: 'out',
54
- id: 'out11'
55
- }, {
56
- group: 'out',
57
- id: 'out22'
58
- }]
59
- },
60
- data: {
61
- id: '1',
62
- name: '算法'
63
- },
64
- shape: 'rz-rect-port',
65
- component: /*#__PURE__*/React.createElement(NodeElement, null)
66
- }));
67
- graph.addNode(new DPNode({
68
- id: '2',
69
- x: 300,
70
- y: 35,
71
- ports: {
72
- items: [{
73
- group: 'in',
74
- id: 'in1',
75
- connected: true
76
- }, {
77
- group: 'in',
78
- id: 'in2'
79
- }, {
80
- group: 'out',
81
- id: 'out1'
82
- }, {
83
- group: 'out',
84
- id: 'out2'
85
- }]
86
- },
87
- data: {
88
- id: '2',
89
- name: 'Kafka数据源'
90
- },
91
- shape: 'rz-rect-port',
92
- component: /*#__PURE__*/React.createElement(NodeElement, null)
93
- }));
94
- graph.addEdge(new DPGroupEdge({
95
- sourceAnchor: 'bottom',
96
- source: {
97
- cell: '1',
98
- port: 'out11',
99
- anchor: {
100
- name: 'bottom'
101
- }
102
- },
103
- target: {
104
- cell: '2',
105
- port: 'in1',
106
- anchor: {
107
- name: 'center'
108
- }
109
- },
110
- zIndex: 1
111
- }));
57
+
58
+ firstLoadRef.current = false;
59
+ }
60
+ }, []); // 处理组件拖拽落下事件
61
+
62
+ var _useDrop = useDrop({
63
+ accept: [DRAGGABLE_COMPONENT, DRAGGABLE_MODEL],
64
+ drop: function drop(item, monitor) {
65
+ var currentMouseOffset = monitor.getClientOffset();
66
+ var sourceMouseOffset = monitor.getInitialClientOffset();
67
+ var sourceElementOffset = monitor.getInitialSourceClientOffset();
68
+ var diffX = sourceMouseOffset.x - sourceElementOffset.x;
69
+ var diffY = sourceMouseOffset.y - sourceElementOffset.y;
70
+ var x = currentMouseOffset.x - diffX;
71
+ var y = currentMouseOffset.y - diffY;
72
+
73
+ if (dpGraphRef.current.isGraphReady()) {
74
+ dpGraphRef.current.addDragNode(_objectSpread(_objectSpread({}, item.comp), {}, {
75
+ libId: item.comp.id,
76
+ id: guid(),
77
+ x: x,
78
+ y: y
79
+ }));
80
+ } else {
81
+ console.warn('请稍后再尝试添加节点');
82
+ }
112
83
  }
113
- }, []);
84
+ }),
85
+ _useDrop2 = _slicedToArray(_useDrop, 2),
86
+ dropRef = _useDrop2[1]; // 画布侧边 toolbar handler
87
+
88
+
89
+ var onHandleSideToolbar = React.useCallback(function (action) {
90
+ return function () {
91
+ // 确保画布已渲染
92
+ if (dpGraphRef.current.isGraphReady()) {
93
+ switch (action) {
94
+ case 'in':
95
+ dpGraphRef.current.zoomGraph(0.1);
96
+ break;
97
+
98
+ case 'out':
99
+ dpGraphRef.current.zoomGraph(-0.1);
100
+ break;
101
+
102
+ case 'fit':
103
+ dpGraphRef.current.zoomGraphToFit();
104
+ break;
105
+
106
+ case 'real':
107
+ dpGraphRef.current.zoomGraphRealSize();
108
+ break;
109
+
110
+ default:
111
+ }
112
+ }
113
+ };
114
+ }, [dpGraph]);
114
115
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
116
+ ref: function ref(elem) {
117
+ containerRef.current = elem;
118
+ dropRef(elem);
119
+ },
120
+ className: "dynamic-ports",
121
+ style: {
122
+ height: '100%',
123
+ width: '100%'
124
+ }
125
+ }, /*#__PURE__*/React.createElement(ContextMenu, {
126
+ graph: dpGraph
127
+ }), /*#__PURE__*/React.createElement(GraphHandler, {
128
+ onZoomIn: onHandleSideToolbar('in'),
129
+ onZoomOut: onHandleSideToolbar('out'),
130
+ onFitContent: onHandleSideToolbar('fit'),
131
+ onRealContent: onHandleSideToolbar('real')
132
+ }), /*#__PURE__*/React.createElement("div", {
115
133
  style: {
116
- width: '100%',
117
- height: '100%'
134
+ height: '100%',
135
+ width: '100%'
118
136
  },
119
137
  ref: divRef
120
- }));
138
+ })));
121
139
  };
122
140
 
123
- export default DynamicPorts;
124
- var testNode = {
125
- x: 40,
126
- y: 35,
127
- width: 160,
128
- height: 30,
129
- label: 'Hello',
130
- attrs: {
131
- body: {
132
- strokeWidth: 1,
133
- stroke: '#108ee9',
134
- fill: '#fff',
135
- rx: 5,
136
- ry: 5
137
- }
138
- },
139
- portMarkup: [Markup.getForeignObjectMarkup()],
140
- ports: {
141
- items: [{
142
- group: 'in',
143
- id: 'in1'
144
- }, {
145
- group: 'in',
146
- id: 'in2'
147
- }, {
148
- group: 'out',
149
- id: 'out1'
150
- }, {
151
- group: 'out',
152
- id: 'out2'
153
- }],
154
- groups: {
155
- in: {
156
- position: {
157
- name: 'top'
158
- },
159
- attrs: {
160
- fo: {
161
- width: 10,
162
- height: 10,
163
- x: -5,
164
- y: -5,
165
- magnet: 'true'
166
- }
167
- },
168
- zIndex: 1
169
- },
170
- out: {
171
- position: {
172
- name: 'bottom'
173
- },
174
- attrs: {
175
- fo: {
176
- width: 10,
177
- height: 10,
178
- x: -5,
179
- y: -5,
180
- magnet: 'true'
181
- }
182
- },
183
- zIndex: 1
184
- }
185
- }
186
- }
187
- };
141
+ export default DynamicPorts;
@@ -0,0 +1,44 @@
1
+ export declare namespace NDPGraph {
2
+ interface GraphData {
3
+ nodes: Node[];
4
+ edges: Edge[];
5
+ }
6
+ interface Node {
7
+ /**
8
+ * 图渲染的主键id
9
+ */
10
+ id: string;
11
+ /**
12
+ * 原始组件库的id
13
+ */
14
+ libId?: string;
15
+ /**
16
+ * 图标
17
+ */
18
+ icon?: string;
19
+ name: string;
20
+ inPorts: InPort[];
21
+ outPorts: OutPort[];
22
+ x: number;
23
+ y: number;
24
+ param?: Param;
25
+ }
26
+ interface Edge {
27
+ source: string;
28
+ target: string;
29
+ outPortId: string;
30
+ inPortId: string;
31
+ }
32
+ interface OutPort extends Port {
33
+ }
34
+ interface InPort extends Port {
35
+ }
36
+ interface Port {
37
+ id: string;
38
+ name: string;
39
+ seq: number;
40
+ }
41
+ interface Param {
42
+ [key: string]: any;
43
+ }
44
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * @Author: wangxian
3
+ * @Date: 2022-05-24 16:10:46
4
+ * @LastEditTime: 2022-05-28 10:57:33
5
+ */
6
+ export {};
@@ -0,0 +1,104 @@
1
+ import { NDPGraph } from './interface';
2
+ import { Graph } from '@antv/x6';
3
+ export declare function graphPointToOffsetPoint(graph: Graph, graphPoint: {
4
+ x: number;
5
+ y: number;
6
+ }, containerElem: HTMLElement): {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ export declare function formatNodeInfoToNodeMeta(nodeData: NDPGraph.Node, inputPortConnectedMap?: {
11
+ [k: string]: boolean;
12
+ }): {
13
+ x: number;
14
+ y: number;
15
+ type: string;
16
+ id: string;
17
+ width: number;
18
+ height: number;
19
+ data: {
20
+ type: string;
21
+ x: number;
22
+ y: number;
23
+ id: string;
24
+ libId?: string;
25
+ icon?: string;
26
+ name: string;
27
+ inPorts: NDPGraph.InPort[];
28
+ outPorts: NDPGraph.OutPort[];
29
+ param?: NDPGraph.Param;
30
+ };
31
+ ports: {
32
+ items: any[];
33
+ };
34
+ zIndex: number;
35
+ libId?: string;
36
+ icon?: string;
37
+ name: string;
38
+ inPorts: NDPGraph.InPort[];
39
+ outPorts: NDPGraph.OutPort[];
40
+ param?: NDPGraph.Param;
41
+ };
42
+ /**
43
+ * 将暴露给接口的图信息转换可渲染的结图结构信息
44
+ * @returns
45
+ */
46
+ export declare function formatGraphData(graphData: NDPGraph.GraphData): {
47
+ nodes: {
48
+ x: number;
49
+ y: number;
50
+ type: string;
51
+ id: string;
52
+ width: number;
53
+ height: number;
54
+ data: {
55
+ type: string;
56
+ x: number;
57
+ y: number;
58
+ id: string;
59
+ libId?: string;
60
+ icon?: string;
61
+ name: string;
62
+ inPorts: NDPGraph.InPort[];
63
+ outPorts: NDPGraph.OutPort[];
64
+ param?: NDPGraph.Param;
65
+ };
66
+ ports: {
67
+ items: any[];
68
+ };
69
+ zIndex: number;
70
+ libId?: string;
71
+ icon?: string;
72
+ name: string;
73
+ inPorts: NDPGraph.InPort[];
74
+ outPorts: NDPGraph.OutPort[];
75
+ param?: NDPGraph.Param;
76
+ }[];
77
+ edges: {
78
+ data: {
79
+ source: string;
80
+ target: string;
81
+ outPortId: string;
82
+ inPortId: string;
83
+ };
84
+ sourceAnchor: string;
85
+ source: {
86
+ cell: string;
87
+ port: string;
88
+ anchor: {
89
+ name: string;
90
+ };
91
+ };
92
+ target: {
93
+ cell: string;
94
+ port: string;
95
+ anchor: {
96
+ name: string;
97
+ };
98
+ };
99
+ label: string;
100
+ zIndex: number;
101
+ outPortId: string;
102
+ inPortId: string;
103
+ }[];
104
+ };
@@ -0,0 +1,127 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+
4
+ /*
5
+ * @Author: wangxian
6
+ * @Date: 2022-05-24 16:40:49
7
+ * @LastEditTime: 2022-05-27 16:02:48
8
+ */
9
+ import { sortBy } from 'lodash-es';
10
+ import { NODE_HEIGHT, NODE_WIDTH } from './constant'; // 将画布上的点转换成相对于 offset parent 的点
11
+
12
+ export function graphPointToOffsetPoint(graph, graphPoint, containerElem) {
13
+ if (graph) {
14
+ var point = graph.localToPage({
15
+ x: graphPoint.x,
16
+ y: graphPoint.y
17
+ });
18
+ var clientRect = containerElem === null || containerElem === void 0 ? void 0 : containerElem.getBoundingClientRect();
19
+ var y = point.y - ((clientRect === null || clientRect === void 0 ? void 0 : clientRect.y) || 0); // ! offset parent 不能是画布容器,否则会影响内部布局,所以 offset parent 在外部,算上上方 toolbar 的高度
20
+
21
+ var x = point.x - ((clientRect === null || clientRect === void 0 ? void 0 : clientRect.x) || 0);
22
+ return {
23
+ x: x,
24
+ y: y
25
+ };
26
+ }
27
+
28
+ return {
29
+ x: 0,
30
+ y: 0
31
+ };
32
+ } // 格式化单个节点,新增节点时复用
33
+
34
+ export function formatNodeInfoToNodeMeta(nodeData) {
35
+ var inputPortConnectedMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36
+ var portItems = [];
37
+ var id = nodeData.id,
38
+ _nodeData$x = nodeData.x,
39
+ x = _nodeData$x === void 0 ? 0 : _nodeData$x,
40
+ _nodeData$y = nodeData.y,
41
+ y = _nodeData$y === void 0 ? 0 : _nodeData$y,
42
+ inPorts = nodeData.inPorts,
43
+ outPorts = nodeData.outPorts;
44
+ sortBy(inPorts, 'seq').forEach(function (inPort) {
45
+ portItems.push(_objectSpread(_objectSpread({}, inPort), {}, {
46
+ group: 'in',
47
+ id: inPort.id.toString(),
48
+ connected: !!inputPortConnectedMap[inPort.id.toString()]
49
+ }));
50
+ });
51
+ sortBy(outPorts, 'seq').forEach(function (outPort) {
52
+ portItems.push(_objectSpread(_objectSpread({}, outPort), {}, {
53
+ group: 'out',
54
+ id: outPort.id.toString(),
55
+ connected: !!inputPortConnectedMap[outPort.id.toString()]
56
+ }));
57
+ });
58
+ return _objectSpread(_objectSpread({}, nodeData), {}, {
59
+ x: x,
60
+ y: y,
61
+ type: 'node',
62
+ id: id.toString(),
63
+ width: NODE_WIDTH,
64
+ height: NODE_HEIGHT,
65
+ data: _objectSpread(_objectSpread({}, nodeData), {}, {
66
+ type: 'node',
67
+ x: x,
68
+ y: y,
69
+ id: id.toString()
70
+ }),
71
+ ports: {
72
+ items: portItems
73
+ },
74
+ zIndex: 10
75
+ });
76
+ }
77
+ /**
78
+ * 将暴露给接口的图信息转换可渲染的结图结构信息
79
+ * @returns
80
+ */
81
+
82
+ export function formatGraphData(graphData) {
83
+ var _graphData$nodes = graphData.nodes,
84
+ nodes = _graphData$nodes === void 0 ? [] : _graphData$nodes,
85
+ _graphData$edges = graphData.edges,
86
+ edges = _graphData$edges === void 0 ? [] : _graphData$edges; // 格式化边
87
+
88
+ var formattedEdges = edges.map(function (edges) {
89
+ var source = edges.source,
90
+ outPortId = edges.outPortId,
91
+ target = edges.target,
92
+ inPortId = edges.inPortId;
93
+ return _objectSpread(_objectSpread({}, edges), {}, {
94
+ data: _objectSpread({}, edges),
95
+ sourceAnchor: 'bottom',
96
+ source: {
97
+ cell: source.toString(),
98
+ port: outPortId.toString(),
99
+ anchor: {
100
+ name: 'bottom'
101
+ }
102
+ },
103
+ target: {
104
+ cell: target.toString(),
105
+ port: inPortId.toString(),
106
+ anchor: {
107
+ name: 'center'
108
+ }
109
+ },
110
+ label: '',
111
+ zIndex: 1
112
+ });
113
+ }); // 记录所有已连线的输入桩
114
+
115
+ var inputPortConnectedMap = formattedEdges.reduce(function (acc, edge) {
116
+ acc[edge.inPortId] = true;
117
+ return acc;
118
+ }, {}); // 格式化算法组件节点
119
+
120
+ var formattedNodes = nodes.map(function (nodeData) {
121
+ return formatNodeInfoToNodeMeta(nodeData, inputPortConnectedMap);
122
+ });
123
+ return {
124
+ nodes: _toConsumableArray(formattedNodes),
125
+ edges: formattedEdges
126
+ };
127
+ }
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import '../../framework/libs/iconfont/iconfont.css';
3
+ interface Props {
4
+ /**
5
+ * 图标类型
6
+ */
7
+ type: string;
8
+ /**
9
+ * class样式
10
+ */
11
+ className?: string;
12
+ /**
13
+ * style
14
+ */
15
+ style?: React.CSSProperties;
16
+ }
17
+ declare const Icon: React.FC<Props>;
18
+ export default Icon;
@@ -0,0 +1,23 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import React from "react";
3
+
4
+ /*
5
+ * @Author: wangxian
6
+ * @Date: 2022-05-28 11:04:20
7
+ * @LastEditTime: 2022-05-28 11:15:23
8
+ */
9
+ import '../../framework/libs/iconfont/iconfont.css';
10
+
11
+ var Icon = function Icon(props) {
12
+ var type = props.type,
13
+ _props$className = props.className,
14
+ className = _props$className === void 0 ? '' : _props$className,
15
+ _props$style = props.style,
16
+ style = _props$style === void 0 ? {} : _props$style;
17
+ return /*#__PURE__*/React.createElement("span", {
18
+ className: "fa fa-".concat(type, " ").concat(className),
19
+ style: _objectSpread({}, style)
20
+ });
21
+ };
22
+
23
+ export default Icon;