implement noWheelClass, noPanClass, noDragClass

This commit is contained in:
peterkogo
2025-04-29 19:03:09 +02:00
parent 86211fa753
commit fddd4be6f8
8 changed files with 39 additions and 9 deletions
@@ -107,7 +107,12 @@
y={position?.y}
width={size}
height={size}
class={['svelte-flow__edgeupdater nopan', `svelte-flow__edgeupdater-${type}`, className]}
class={[
'svelte-flow__edgeupdater',
`svelte-flow__edgeupdater-${type}`,
store.noPanClass,
className
]}
onpointerdown={onPointerDown}
transparent
{...rest}
@@ -205,8 +205,8 @@ The Handle component is the part of a node that can be used to connect nodes.
class={[
'svelte-flow__handle',
`svelte-flow__handle-${position}`,
'nodrag',
'nopan',
store.noDragClass,
store.noPanClass,
position,
className
]}
@@ -56,7 +56,7 @@
{#if store.selectionRectMode === 'nodes' && bounds && isNumeric(bounds.x) && isNumeric(bounds.y)}
<div
class="svelte-flow__selection-wrapper nopan"
class={['svelte-flow__selection-wrapper', store.noPanClass]}
style:width={toPxString(bounds.width)}
style:height={toPxString(bounds.height)}
style:transform="translate({bounds.x}px, {bounds.y}px)"
@@ -206,7 +206,7 @@
isSelectable: selectable,
disabled: !draggable,
handleSelector: dragHandle,
noDragClass: 'nodrag',
noDragClass: store.noDragClass,
nodeClickDistance,
onNodeMouseDown: store.handleNodeSelection,
onDrag: (event, _, targetNode, nodes) => {