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

View File

@@ -64,7 +64,7 @@ const BasicFlow = () => {
defaultNodes={initialNodes}
defaultEdges={initialEdges}
selectionOnDrag
selectionMode={SelectionMode.Overlap}
selectionMode={SelectionMode.Partial}
panOnDrag={spaceBarPressed ? true : 'RightClick'}
panOnScroll
onPaneContextMenu={logEvent}

View File

@@ -57,7 +57,7 @@ const selector = (s: ReactFlowState) => ({
const UserSelection = memo(
({
isSelecting,
selectionMode = SelectionMode.Contained,
selectionMode = SelectionMode.Full,
panOnDrag,
onSelectionStart,
onSelectionEnd,
@@ -151,7 +151,7 @@ const UserSelection = memo(
nodeInternals,
nextUserSelectRect,
transform,
selectionMode === SelectionMode.Overlap,
selectionMode === SelectionMode.Partial,
true,
nodeOrigin
);

View File

@@ -102,7 +102,7 @@ const ReactFlow = forwardRef<ReactFlowRefType, ReactFlowProps>(
deleteKeyCode = 'Backspace',
selectionKeyCode = 'Shift',
selectionOnDrag = false,
selectionMode = SelectionMode.Contained,
selectionMode = SelectionMode.Full,
multiSelectionKeyCode = 'Meta',
zoomActivationKeyCode = 'Meta',
snapToGrid = false,

View File

@@ -252,8 +252,8 @@ export type ProOptions = {
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
export enum SelectionMode {
Overlap = 'overlap',
Contained = 'contained',
Partial = 'partial',
Full = 'full',
}
export type SelectionRect = Rect & {