feat(svelte): add selectionMode prop
This commit is contained in:
@@ -46,12 +46,12 @@
|
||||
selectionRect,
|
||||
selectionRectMode,
|
||||
selectionKeyPressed,
|
||||
resetSelectedElements
|
||||
resetSelectedElements,
|
||||
selectionMode
|
||||
} = useStore();
|
||||
|
||||
// @todo take from props
|
||||
const elementsSelectable = true;
|
||||
const selectionMode = SelectionMode.Partial;
|
||||
|
||||
let container: HTMLDivElement;
|
||||
let containerBounds: DOMRect | null = null;
|
||||
@@ -115,7 +115,7 @@
|
||||
$nodes,
|
||||
nextUserSelectRect,
|
||||
$transform,
|
||||
selectionMode === SelectionMode.Partial,
|
||||
$selectionMode === SelectionMode.Partial,
|
||||
true
|
||||
);
|
||||
const selectedEdgeIds = getConnectedEdges(selectedNodes, $edges).map((e) => e.id);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
export let nodeTypes: $$Props['nodeTypes'] = undefined;
|
||||
export let edgeTypes: $$Props['edgeTypes'] = undefined;
|
||||
export let selectionKey: $$Props['selectionKey'] = undefined;
|
||||
export let selectionMode: $$Props['selectionMode'] = undefined;
|
||||
export let deleteKey: $$Props['deleteKey'] = undefined;
|
||||
export let connectionRadius: $$Props['connectionRadius'] = undefined;
|
||||
export let connectionLineType: $$Props['connectionLineType'] = undefined;
|
||||
@@ -54,6 +55,7 @@
|
||||
id,
|
||||
connectionLineType,
|
||||
connectionRadius,
|
||||
selectionMode,
|
||||
isValidConnection
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ import type {
|
||||
ConnectionLineType,
|
||||
NodeOrigin,
|
||||
OnConnectStartParams,
|
||||
Viewport
|
||||
Viewport,
|
||||
SelectionMode
|
||||
} from '@reactflow/system';
|
||||
|
||||
import type {
|
||||
@@ -27,6 +28,7 @@ export type SvelteFlowProps = {
|
||||
maxZoom?: number;
|
||||
initialViewport?: Viewport;
|
||||
connectionRadius?: number;
|
||||
selectionMode?: SelectionMode;
|
||||
|
||||
class?: string;
|
||||
style?: string;
|
||||
|
||||
Reference in New Issue
Block a user