refactor(selectionMode): rename options

This commit is contained in:
moklick
2022-12-12 16:19:06 +01:00
parent aaa0854c62
commit d34ecbf802
4 changed files with 6 additions and 6 deletions
@@ -64,7 +64,7 @@ const BasicFlow = () => {
defaultNodes={initialNodes} defaultNodes={initialNodes}
defaultEdges={initialEdges} defaultEdges={initialEdges}
selectionOnDrag selectionOnDrag
selectionMode={SelectionMode.Overlap} selectionMode={SelectionMode.Partial}
panOnDrag={spaceBarPressed ? true : 'RightClick'} panOnDrag={spaceBarPressed ? true : 'RightClick'}
panOnScroll panOnScroll
onPaneContextMenu={logEvent} onPaneContextMenu={logEvent}
@@ -57,7 +57,7 @@ const selector = (s: ReactFlowState) => ({
const UserSelection = memo( const UserSelection = memo(
({ ({
isSelecting, isSelecting,
selectionMode = SelectionMode.Contained, selectionMode = SelectionMode.Full,
panOnDrag, panOnDrag,
onSelectionStart, onSelectionStart,
onSelectionEnd, onSelectionEnd,
@@ -151,7 +151,7 @@ const UserSelection = memo(
nodeInternals, nodeInternals,
nextUserSelectRect, nextUserSelectRect,
transform, transform,
selectionMode === SelectionMode.Overlap, selectionMode === SelectionMode.Partial,
true, true,
nodeOrigin nodeOrigin
); );
@@ -102,7 +102,7 @@ const ReactFlow = forwardRef<ReactFlowRefType, ReactFlowProps>(
deleteKeyCode = 'Backspace', deleteKeyCode = 'Backspace',
selectionKeyCode = 'Shift', selectionKeyCode = 'Shift',
selectionOnDrag = false, selectionOnDrag = false,
selectionMode = SelectionMode.Contained, selectionMode = SelectionMode.Full,
multiSelectionKeyCode = 'Meta', multiSelectionKeyCode = 'Meta',
zoomActivationKeyCode = 'Meta', zoomActivationKeyCode = 'Meta',
snapToGrid = false, snapToGrid = false,
+2 -2
View File
@@ -252,8 +252,8 @@ export type ProOptions = {
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>; export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
export enum SelectionMode { export enum SelectionMode {
Overlap = 'overlap', Partial = 'partial',
Contained = 'contained', Full = 'full',
} }
export type SelectionRect = Rect & { export type SelectionRect = Rect & {