ronds-metadata 1.1.6 → 1.1.9
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.
- package/es/comps/DynamicPorts/comps/ContextMenu.css +8 -0
- package/es/comps/DynamicPorts/comps/ContextMenu.d.ts +7 -0
- package/es/comps/DynamicPorts/comps/ContextMenu.js +44 -0
- package/es/comps/DynamicPorts/comps/DragNode.d.ts +7 -0
- package/es/comps/DynamicPorts/comps/DragNode.js +52 -0
- package/es/comps/DynamicPorts/comps/GraphHandler/index.css +27 -0
- package/es/comps/DynamicPorts/comps/GraphHandler/index.d.ts +11 -0
- package/es/comps/DynamicPorts/comps/GraphHandler/index.js +51 -0
- package/es/comps/DynamicPorts/comps/NodeElement.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElement.js +30 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.css +5 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.d.ts +8 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +42 -0
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.css +21 -0
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.d.ts +8 -0
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +40 -0
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.css +23 -0
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.d.ts +7 -0
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +55 -0
- package/es/comps/DynamicPorts/comps/shape/connector.d.ts +1 -0
- package/es/comps/DynamicPorts/comps/shape/connector.js +19 -0
- package/es/comps/DynamicPorts/comps/shape/edge.css +4 -0
- package/es/comps/DynamicPorts/comps/shape/edge.d.ts +10 -0
- package/es/comps/DynamicPorts/comps/shape/edge.js +91 -0
- package/es/comps/DynamicPorts/comps/shape/node.d.ts +11 -0
- package/es/comps/DynamicPorts/comps/shape/node.js +190 -0
- package/es/comps/DynamicPorts/constant/index.d.ts +7 -0
- package/es/comps/DynamicPorts/constant/index.js +19 -0
- package/es/comps/DynamicPorts/graph.d.ts +62 -0
- package/es/comps/DynamicPorts/graph.js +584 -0
- package/es/comps/DynamicPorts/index.css +167 -0
- package/es/comps/DynamicPorts/index.d.ts +18 -1
- package/es/comps/DynamicPorts/index.js +131 -70
- package/es/comps/DynamicPorts/interface.d.ts +44 -0
- package/es/comps/DynamicPorts/interface.js +6 -0
- package/es/comps/DynamicPorts/utils.d.ts +104 -0
- package/es/comps/DynamicPorts/utils.js +127 -0
- package/es/comps/Icons/index.d.ts +18 -0
- package/es/comps/Icons/index.js +23 -0
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +5 -3
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +63 -25
- package/es/comps/MetadataForm/utils.d.ts +1 -0
- package/es/comps/MetadataForm/utils.js +10 -1
- package/es/comps/locales/en-US.d.ts +4 -0
- package/es/comps/locales/en-US.js +10 -1
- package/es/comps/locales/zh-CN.d.ts +4 -0
- package/es/comps/locales/zh-CN.js +10 -1
- package/es/framework/graph/index.css +12 -0
- package/es/framework/graph/index.d.ts +60 -0
- package/es/framework/graph/index.js +425 -0
- package/es/framework/libs/iconfont/iconfont.css +187 -0
- package/es/framework/libs/iconfont/iconfont.ttf +0 -0
- package/es/framework/libs/iconfont/iconfont.woff +0 -0
- package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
- package/es/framework/rxjs-hooks/useObservableState.d.ts +3 -0
- package/es/framework/rxjs-hooks/useObservableState.js +45 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/package.json +7 -1
@@ -0,0 +1,190 @@
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
5
|
+
import { Dom, Node } from '@antv/x6';
|
6
|
+
import { ReactShape } from '@antv/x6-react-shape';
|
7
|
+
import { NODE_WIDTH, NODE_HEIGHT } from '../../constant';
|
8
|
+
export var BaseNode = /*#__PURE__*/function (_ReactShape) {
|
9
|
+
_inherits(BaseNode, _ReactShape);
|
10
|
+
|
11
|
+
var _super = _createSuper(BaseNode);
|
12
|
+
|
13
|
+
function BaseNode() {
|
14
|
+
_classCallCheck(this, BaseNode);
|
15
|
+
|
16
|
+
return _super.apply(this, arguments);
|
17
|
+
}
|
18
|
+
|
19
|
+
_createClass(BaseNode, [{
|
20
|
+
key: "isGroup",
|
21
|
+
value: // eslint-disable-next-line class-methods-use-this
|
22
|
+
function isGroup() {
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
}]);
|
26
|
+
|
27
|
+
return BaseNode;
|
28
|
+
}(ReactShape);
|
29
|
+
export var DPNode = /*#__PURE__*/function (_BaseNode) {
|
30
|
+
_inherits(DPNode, _BaseNode);
|
31
|
+
|
32
|
+
var _super2 = _createSuper(DPNode);
|
33
|
+
|
34
|
+
function DPNode() {
|
35
|
+
_classCallCheck(this, DPNode);
|
36
|
+
|
37
|
+
return _super2.apply(this, arguments);
|
38
|
+
}
|
39
|
+
|
40
|
+
_createClass(DPNode, [{
|
41
|
+
key: "getInPorts",
|
42
|
+
value: function getInPorts() {
|
43
|
+
return this.getPortsByGroup('in');
|
44
|
+
}
|
45
|
+
}, {
|
46
|
+
key: "getOutPorts",
|
47
|
+
value: function getOutPorts() {
|
48
|
+
return this.getPortsByGroup('out');
|
49
|
+
}
|
50
|
+
}]);
|
51
|
+
|
52
|
+
return DPNode;
|
53
|
+
}(BaseNode);
|
54
|
+
Node.registry.register('rz-rect-port', DPNode);
|
55
|
+
DPNode.config({
|
56
|
+
width: NODE_WIDTH,
|
57
|
+
height: NODE_HEIGHT,
|
58
|
+
shape: 'rz-rect-port',
|
59
|
+
ports: {
|
60
|
+
groups: {
|
61
|
+
in: {
|
62
|
+
position: {
|
63
|
+
name: 'top'
|
64
|
+
},
|
65
|
+
zIndex: 2
|
66
|
+
},
|
67
|
+
out: {
|
68
|
+
position: {
|
69
|
+
name: 'bottom'
|
70
|
+
},
|
71
|
+
zIndex: 2
|
72
|
+
}
|
73
|
+
}
|
74
|
+
},
|
75
|
+
attrs: {
|
76
|
+
body: {
|
77
|
+
magnet: false,
|
78
|
+
fill: 'none',
|
79
|
+
stroke: 'none',
|
80
|
+
refWidth: '100%',
|
81
|
+
refHeight: '100%',
|
82
|
+
zIndex: 1
|
83
|
+
}
|
84
|
+
},
|
85
|
+
portMarkup: [{
|
86
|
+
tagName: 'foreignObject',
|
87
|
+
selector: 'fo',
|
88
|
+
attrs: {
|
89
|
+
width: 6,
|
90
|
+
height: 6,
|
91
|
+
x: -3,
|
92
|
+
y: -3,
|
93
|
+
zIndex: 10,
|
94
|
+
// magnet决定是否可交互
|
95
|
+
magnet: 'true'
|
96
|
+
},
|
97
|
+
children: [{
|
98
|
+
ns: Dom.ns.xhtml,
|
99
|
+
tagName: 'body',
|
100
|
+
selector: 'foBody',
|
101
|
+
attrs: {
|
102
|
+
xmlns: Dom.ns.xhtml
|
103
|
+
},
|
104
|
+
style: {
|
105
|
+
width: '100%',
|
106
|
+
height: '100%'
|
107
|
+
},
|
108
|
+
children: [{
|
109
|
+
tagName: 'span',
|
110
|
+
selector: 'content',
|
111
|
+
style: {
|
112
|
+
width: '100%',
|
113
|
+
height: '100%'
|
114
|
+
}
|
115
|
+
}]
|
116
|
+
}]
|
117
|
+
}]
|
118
|
+
});
|
119
|
+
export var DPGroupNode = /*#__PURE__*/function (_BaseNode2) {
|
120
|
+
_inherits(DPGroupNode, _BaseNode2);
|
121
|
+
|
122
|
+
var _super3 = _createSuper(DPGroupNode);
|
123
|
+
|
124
|
+
function DPGroupNode() {
|
125
|
+
_classCallCheck(this, DPGroupNode);
|
126
|
+
|
127
|
+
return _super3.apply(this, arguments);
|
128
|
+
}
|
129
|
+
|
130
|
+
_createClass(DPGroupNode, [{
|
131
|
+
key: "isGroup",
|
132
|
+
value: // eslint-disable-next-line class-methods-use-this
|
133
|
+
function isGroup() {
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
}]);
|
137
|
+
|
138
|
+
return DPGroupNode;
|
139
|
+
}(BaseNode);
|
140
|
+
DPGroupNode.config({
|
141
|
+
ports: {
|
142
|
+
groups: {
|
143
|
+
in: {
|
144
|
+
position: {
|
145
|
+
name: 'top'
|
146
|
+
},
|
147
|
+
zIndex: 2
|
148
|
+
},
|
149
|
+
out: {
|
150
|
+
position: {
|
151
|
+
name: 'bottom'
|
152
|
+
},
|
153
|
+
zIndex: 2
|
154
|
+
}
|
155
|
+
}
|
156
|
+
},
|
157
|
+
portMarkup: [{
|
158
|
+
tagName: 'foreignObject',
|
159
|
+
selector: 'fo',
|
160
|
+
attrs: {
|
161
|
+
width: 6,
|
162
|
+
height: 6,
|
163
|
+
x: -3,
|
164
|
+
y: -3,
|
165
|
+
zIndex: 10,
|
166
|
+
// magnet决定是否可交互
|
167
|
+
magnet: 'true'
|
168
|
+
},
|
169
|
+
children: [{
|
170
|
+
ns: Dom.ns.xhtml,
|
171
|
+
tagName: 'body',
|
172
|
+
selector: 'foBody',
|
173
|
+
attrs: {
|
174
|
+
xmlns: Dom.ns.xhtml
|
175
|
+
},
|
176
|
+
style: {
|
177
|
+
width: '100%',
|
178
|
+
height: '100%'
|
179
|
+
},
|
180
|
+
children: [{
|
181
|
+
tagName: 'span',
|
182
|
+
selector: 'content',
|
183
|
+
style: {
|
184
|
+
width: '100%',
|
185
|
+
height: '100%'
|
186
|
+
}
|
187
|
+
}]
|
188
|
+
}]
|
189
|
+
}]
|
190
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare const GROUP_HORIZONTAL__PADDING = 24;
|
2
|
+
export declare const GROUP_VERTICAL__PADDING = 40;
|
3
|
+
export declare const NODE_WIDTH = 180;
|
4
|
+
export declare const NODE_HEIGHT = 32;
|
5
|
+
export declare const RERENDER_EVENT = "RERENDER_EVENT";
|
6
|
+
export declare const DRAGGABLE_COMPONENT = "DRAGGABLE_COMPONENT";
|
7
|
+
export declare const DRAGGABLE_MODEL = "DRAGGABLE_MODEL";
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: wangxian
|
3
|
+
* @Date: 2022-05-24 08:48:57
|
4
|
+
* @LastEditTime: 2022-05-25 11:37:48
|
5
|
+
*/
|
6
|
+
export var GROUP_HORIZONTAL__PADDING = 24; // 分组横向 padding
|
7
|
+
|
8
|
+
export var GROUP_VERTICAL__PADDING = 40; // 分组纵向 padding
|
9
|
+
|
10
|
+
export var NODE_WIDTH = 180;
|
11
|
+
export var NODE_HEIGHT = 32; // 触发画布重新渲染事件
|
12
|
+
|
13
|
+
export var RERENDER_EVENT = 'RERENDER_EVENT';
|
14
|
+
/*
|
15
|
+
* 以下是拖拽相关
|
16
|
+
*/
|
17
|
+
|
18
|
+
export var DRAGGABLE_COMPONENT = 'DRAGGABLE_COMPONENT';
|
19
|
+
export var DRAGGABLE_MODEL = 'DRAGGABLE_MODEL';
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
2
|
+
import { Subscription } from 'rxjs/internal/Subscription';
|
3
|
+
import { ConnectionRemovedArgs, ContextMenuInfo, GraphCore } from '../../framework/graph';
|
4
|
+
import { BaseEdge, DPEdge } from './comps/shape/edge';
|
5
|
+
import { BaseNode, DPNode } from './comps/shape/node';
|
6
|
+
import { NDPGraph } from './interface';
|
7
|
+
import { formatGraphData } from './utils';
|
8
|
+
declare type NodeMeta = ReturnType<typeof formatGraphData>['nodes'][number];
|
9
|
+
declare type EdgeMeta = ReturnType<typeof formatGraphData>['edges'][number];
|
10
|
+
interface IFactory$ {
|
11
|
+
/**
|
12
|
+
* 实验图加载状态
|
13
|
+
*/
|
14
|
+
loading: BehaviorSubject<boolean>;
|
15
|
+
/**
|
16
|
+
* 图数据流
|
17
|
+
*/
|
18
|
+
dpGraph: BehaviorSubject<NDPGraph.GraphData>;
|
19
|
+
/**
|
20
|
+
* 选中的节点
|
21
|
+
*/
|
22
|
+
selectedNodes: BehaviorSubject<NDPGraph.Node[]>;
|
23
|
+
/**
|
24
|
+
* 右击菜单
|
25
|
+
*/
|
26
|
+
contextMenuInfo: BehaviorSubject<ContextMenuInfo>;
|
27
|
+
}
|
28
|
+
declare class DPGraph extends GraphCore<BaseNode, BaseEdge> {
|
29
|
+
factory$: IFactory$;
|
30
|
+
dpGraphSub?: Subscription;
|
31
|
+
constructor(graphData?: NDPGraph.GraphData);
|
32
|
+
initialize(graphData: NDPGraph.GraphData): Promise<void>;
|
33
|
+
loadDPGraph(graphData: any): Promise<void>;
|
34
|
+
isGraphReady(): boolean;
|
35
|
+
renderGraph: (wrapper: HTMLElement, container: HTMLElement) => void;
|
36
|
+
renderNode(nodeMeta: NodeMeta): BaseNode | undefined;
|
37
|
+
renderEdge(edgeMeta: EdgeMeta): BaseEdge | undefined;
|
38
|
+
addDragNode(data: NDPGraph.Node): void;
|
39
|
+
updateDPGraph(nodes?: NDPGraph.Node[], edges?: NDPGraph.Edge[]): Promise<void>;
|
40
|
+
delDPGraphElement(nodes?: string[], edges?: NDPGraph.Edge[]): Promise<void>;
|
41
|
+
zoomGraph: (factor: number) => void;
|
42
|
+
zoomGraphToFit: () => void;
|
43
|
+
zoomGraphRealSize: () => void;
|
44
|
+
onConnectNode(args: any): Promise<{
|
45
|
+
success: boolean;
|
46
|
+
}>;
|
47
|
+
onSelectNodes(nodes: BaseNode[]): void;
|
48
|
+
onConnectionRemoved(args: ConnectionRemovedArgs): void;
|
49
|
+
onDeleteNodes: (ids: string[] | string) => void;
|
50
|
+
onDeleteEdges: (edges: BaseEdge | BaseEdge[]) => void;
|
51
|
+
onDeleteNodeOrEdge(args: {
|
52
|
+
nodes: DPNode[];
|
53
|
+
edges: DPEdge[];
|
54
|
+
}): void;
|
55
|
+
onContextMenu(data: ContextMenuInfo): any;
|
56
|
+
clearContextMenuInfo: () => void;
|
57
|
+
dispose(): void;
|
58
|
+
}
|
59
|
+
export declare let gDPGraph: DPGraph;
|
60
|
+
export declare const useDPGraph: (graphData: NDPGraph.GraphData) => DPGraph;
|
61
|
+
export declare const useUnmountDPGraph: () => void;
|
62
|
+
export {};
|