refactor(paneClick): rename onZoomPaneClick tp onPaneClick

This commit is contained in:
moklick
2020-08-01 12:13:51 +02:00
parent 2a0274b9a3
commit a095715e5f
4 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -39,7 +39,7 @@ export interface GraphViewProps {
onMove?: (flowTransform?: FlowTransform) => void;
onMoveStart?: (flowTransform?: FlowTransform) => void;
onMoveEnd?: (flowTransform?: FlowTransform) => void;
onZoomPaneClick?: () => void;
onPaneClick?: () => void;
selectionKeyCode: number;
nodeTypes: NodeTypesType;
edgeTypes: EdgeTypesType;
@@ -101,7 +101,7 @@ const GraphView = ({
zoomOnScroll,
zoomOnDoubleClick,
paneMoveable,
onZoomPaneClick,
onPaneClick,
}: GraphViewProps) => {
const zoomPane = useRef<HTMLDivElement>(null);
const rendererNode = useRef<HTMLDivElement>(null);
@@ -123,8 +123,8 @@ const GraphView = ({
const selectionKeyPressed = useKeyPress(selectionKeyCode);
const handleZoomPaneClick = () => {
onZoomPaneClick?.();
const onZoomPaneClick = () => {
onPaneClick?.();
setNodesSelection({ isActive: false });
};
@@ -259,7 +259,7 @@ const GraphView = ({
/>
<UserSelection selectionKeyPressed={selectionKeyPressed} />
{nodesSelectionActive && <NodesSelection />}
<div className="react-flow__zoompane" onClick={handleZoomPaneClick} ref={zoomPane} />
<div className="react-flow__zoompane" onClick={onZoomPaneClick} ref={zoomPane} />
</div>
);
};
+3 -3
View File
@@ -47,7 +47,7 @@ export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
onMoveStart?: (flowTransform?: FlowTransform) => void;
onMoveEnd?: (flowTransform?: FlowTransform) => void;
onSelectionChange?: (elements: Elements | null) => void;
onZoomPaneClick?: () => void;
onPaneClick?: () => void;
nodeTypes: NodeTypesType;
edgeTypes: EdgeTypesType;
connectionLineType: ConnectionLineType;
@@ -113,7 +113,7 @@ const ReactFlow = ({
zoomOnScroll,
zoomOnDoubleClick,
paneMoveable,
onZoomPaneClick,
onPaneClick,
}: ReactFlowProps) => {
const nodeTypesParsed = useMemo(() => createNodeTypes(nodeTypes), []);
const edgeTypesParsed = useMemo(() => createEdgeTypes(edgeTypes), []);
@@ -159,7 +159,7 @@ const ReactFlow = ({
zoomOnScroll={zoomOnScroll}
zoomOnDoubleClick={zoomOnDoubleClick}
paneMoveable={paneMoveable}
onZoomPaneClick={onZoomPaneClick}
onPaneClick={onPaneClick}
/>
{onSelectionChange && <SelectionListener onSelectionChange={onSelectionChange} />}
{children}