ronds-metadata 1.1.18 → 1.1.21
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/DragNode.js +5 -2
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +4 -1
- package/es/comps/DynamicPorts/index.d.ts +4 -0
- package/es/comps/DynamicPorts/index.js +5 -3
- package/es/framework/hooks/use-sync-scroll.js +5 -9
- package/package.json +1 -1
@@ -3,7 +3,7 @@ import React from "react";
|
|
3
3
|
/*
|
4
4
|
* @Author: wangxian
|
5
5
|
* @Date: 2022-05-26 08:50:06
|
6
|
-
* @LastEditTime: 2022-
|
6
|
+
* @LastEditTime: 2022-06-25 10:46:48
|
7
7
|
*/
|
8
8
|
import { DragSource } from 'react-dnd';
|
9
9
|
import { GlobalOutlined } from '@ant-design/icons';
|
@@ -16,7 +16,10 @@ var InnerNodeTitle = function InnerNodeTitle(props) {
|
|
16
16
|
connectDragPreview = props.connectDragPreview,
|
17
17
|
connectDragSource = props.connectDragSource;
|
18
18
|
return /*#__PURE__*/React.createElement("div", null, connectDragPreview(connectDragSource( /*#__PURE__*/React.createElement("div", {
|
19
|
-
className: "node-element"
|
19
|
+
className: "node-element",
|
20
|
+
style: {
|
21
|
+
width: '100%'
|
22
|
+
}
|
20
23
|
}, /*#__PURE__*/React.createElement("div", {
|
21
24
|
className: "icon"
|
22
25
|
}, (data === null || data === void 0 ? void 0 : data.icon) ? /*#__PURE__*/React.createElement(Icon, {
|
@@ -29,7 +29,7 @@ declare class DPGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
29
29
|
factory$: IFactory$;
|
30
30
|
dpGraphSub?: Subscription;
|
31
31
|
constructor(graphData?: NDPGraph.GraphData);
|
32
|
-
initialize(graphData
|
32
|
+
initialize(graphData?: NDPGraph.GraphData): Promise<void>;
|
33
33
|
loadDPGraph(graphData: any): Promise<void>;
|
34
34
|
isGraphReady(): boolean;
|
35
35
|
renderGraph: (wrapper: HTMLElement, container: HTMLElement) => void;
|
@@ -58,6 +58,6 @@ declare class DPGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
58
58
|
dispose(): void;
|
59
59
|
}
|
60
60
|
export declare let gDPGraph: DPGraph;
|
61
|
-
export declare const useDPGraph: (graphData
|
61
|
+
export declare const useDPGraph: (graphData?: NDPGraph.GraphData) => DPGraph;
|
62
62
|
export declare const useUnmountDPGraph: () => void;
|
63
63
|
export {};
|
@@ -239,7 +239,10 @@ var DPGraph = /*#__PURE__*/function (_GraphCore) {
|
|
239
239
|
this.factory$.loading.next(true);
|
240
240
|
_context.prev = 1;
|
241
241
|
_context.next = 4;
|
242
|
-
return this.loadDPGraph(graphData
|
242
|
+
return this.loadDPGraph(graphData || {
|
243
|
+
nodes: [],
|
244
|
+
edges: []
|
245
|
+
});
|
243
246
|
|
244
247
|
case 4:
|
245
248
|
this.factory$.loading.next(false);
|
@@ -14,6 +14,10 @@ interface IDynamicPortsProps {
|
|
14
14
|
* 节点选中事件
|
15
15
|
*/
|
16
16
|
onNodeSelect?: (data: NDPGraph.Node) => void;
|
17
|
+
/**
|
18
|
+
* 获取实例
|
19
|
+
*/
|
20
|
+
getDPGraphInstance?: (data: any) => void;
|
17
21
|
}
|
18
22
|
declare const DynamicPorts: (props: IDynamicPortsProps) => JSX.Element;
|
19
23
|
export default DynamicPorts;
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
/*
|
5
5
|
* @Author: wangxian
|
6
6
|
* @Date: 2022-05-16 18:53:31
|
7
|
-
* @LastEditTime: 2022-
|
7
|
+
* @LastEditTime: 2022-06-28 14:17:21
|
8
8
|
*/
|
9
9
|
import React from 'react';
|
10
10
|
import { filter } from 'rxjs';
|
@@ -20,7 +20,8 @@ import { GraphHandler } from './comps/GraphHandler';
|
|
20
20
|
var DynamicPorts = function DynamicPorts(props) {
|
21
21
|
var defaultValue = props.defaultValue,
|
22
22
|
onChange = props.onChange,
|
23
|
-
onNodeSelect = props.onNodeSelect
|
23
|
+
onNodeSelect = props.onNodeSelect,
|
24
|
+
getDPGraphInstance = props.getDPGraphInstance;
|
24
25
|
var divRef = React.useRef(null);
|
25
26
|
var containerRef = React.useRef(null);
|
26
27
|
|
@@ -55,9 +56,10 @@ var DynamicPorts = function DynamicPorts(props) {
|
|
55
56
|
onNodeSelect && onNodeSelect(v[0]);
|
56
57
|
});
|
57
58
|
|
59
|
+
getDPGraphInstance && getDPGraphInstance(_dpGraph);
|
58
60
|
firstLoadRef.current = false;
|
59
61
|
}
|
60
|
-
}, []); // 处理组件拖拽落下事件
|
62
|
+
}, [defaultValue]); // 处理组件拖拽落下事件
|
61
63
|
|
62
64
|
var _useDrop = useDrop({
|
63
65
|
accept: [DRAGGABLE_COMPONENT, DRAGGABLE_MODEL],
|
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
3
|
/*
|
4
4
|
* @Author: wangxian
|
5
5
|
* @Date: 2022-06-24 08:44:41
|
6
|
-
* @LastEditTime: 2022-06-24
|
6
|
+
* @LastEditTime: 2022-06-24 16:25:38
|
7
7
|
*/
|
8
8
|
import React from 'react';
|
9
9
|
|
@@ -37,13 +37,11 @@ export default function useSyncScroll(_ref) {
|
|
37
37
|
var target = _ref2.target;
|
38
38
|
|
39
39
|
if (locksRef.current > 0) {
|
40
|
-
locksRef.current -= 1;
|
41
|
-
|
40
|
+
locksRef.current -= 1;
|
42
41
|
return;
|
43
42
|
}
|
44
43
|
|
45
|
-
locksRef.current = refsRef.current.length - 1;
|
46
|
-
|
44
|
+
locksRef.current = refsRef.current.length - 1;
|
47
45
|
var others = refsRef.current.filter(function (ref) {
|
48
46
|
return ref !== target;
|
49
47
|
});
|
@@ -78,13 +76,11 @@ export function useSyncScrollByRefs(refsRef, _ref3) {
|
|
78
76
|
var target = _ref4.target;
|
79
77
|
|
80
78
|
if (locksRef.current > 0) {
|
81
|
-
locksRef.current -= 1;
|
82
|
-
|
79
|
+
locksRef.current -= 1;
|
83
80
|
return;
|
84
81
|
}
|
85
82
|
|
86
|
-
locksRef.current = refsRef.current.length - 1;
|
87
|
-
|
83
|
+
locksRef.current = refsRef.current.length - 1;
|
88
84
|
var others = refsRef.current.reduce(function (result, ref) {
|
89
85
|
if (ref.current && ref.current !== target) result.push(ref.current);
|
90
86
|
return result;
|