feat(svelte): add isValidConnection prop, cleanup handle classes
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
data={node.data}
|
||||
selected={node.selected}
|
||||
draggable={node.draggable || node.draggable === undefined}
|
||||
connectable={node.connectable || node.connectable === undefined}
|
||||
positionAbsolute={node.positionAbsolute}
|
||||
positionOrigin={posOrigin}
|
||||
width={node.width}
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
export let selectionKey: $$Props['selectionKey'] = undefined;
|
||||
export let deleteKey: $$Props['deleteKey'] = undefined;
|
||||
export let connectionRadius: $$Props['connectionRadius'] = undefined;
|
||||
export let connectionLineType: $$Props['connectionLineType'] = undefined
|
||||
export let connectionLineType: $$Props['connectionLineType'] = undefined;
|
||||
export let isValidConnection: $$Props['isValidConnection'] = undefined;
|
||||
|
||||
export let style: $$Props['style'] = undefined;
|
||||
let className: $$Props['class'] = undefined;
|
||||
export { className as class };
|
||||
@@ -52,6 +54,7 @@
|
||||
id,
|
||||
connectionLineType,
|
||||
connectionRadius,
|
||||
isValidConnection
|
||||
};
|
||||
|
||||
Object.keys(updatableProps).forEach(prop => {
|
||||
|
||||
@@ -6,9 +6,14 @@ import type {
|
||||
Viewport
|
||||
} from '@reactflow/system';
|
||||
|
||||
import type { Edge, Node, NodeTypes, KeyDefinition, EdgeTypes } from '$lib/types';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import type { createNodes } from '$lib/utils';
|
||||
import type {
|
||||
Edge,
|
||||
Node,
|
||||
NodeTypes,
|
||||
KeyDefinition,
|
||||
EdgeTypes,
|
||||
IsValidConnection
|
||||
} from '$lib/types';
|
||||
|
||||
export type SvelteFlowProps = {
|
||||
id?: string;
|
||||
@@ -27,6 +32,7 @@ export type SvelteFlowProps = {
|
||||
style?: string;
|
||||
|
||||
connectionLineType?: ConnectionLineType;
|
||||
isValidConnection?: IsValidConnection;
|
||||
};
|
||||
|
||||
export type SvelteFlowEvents = {
|
||||
|
||||
Reference in New Issue
Block a user