feat(svelte): add isValidConnection prop, cleanup handle classes

This commit is contained in:
moklick
2023-03-14 14:55:49 +01:00
parent 1df4736203
commit 233e6aedca
13 changed files with 120 additions and 32 deletions
@@ -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 = {