refactor(selectionMode): rename options
This commit is contained in:
@@ -64,7 +64,7 @@ const BasicFlow = () => {
|
||||
defaultNodes={initialNodes}
|
||||
defaultEdges={initialEdges}
|
||||
selectionOnDrag
|
||||
selectionMode={SelectionMode.Overlap}
|
||||
selectionMode={SelectionMode.Partial}
|
||||
panOnDrag={spaceBarPressed ? true : 'RightClick'}
|
||||
panOnScroll
|
||||
onPaneContextMenu={logEvent}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 & {
|
||||
|
||||
Reference in New Issue
Block a user