feat(svelte) added connectionLineContainerStyle and connectionLineStyle props
This commit is contained in:
@@ -3,13 +3,16 @@
|
||||
|
||||
import { useStore } from '$lib/store';
|
||||
|
||||
export let containerStyle: string = '';
|
||||
export let style: string = '';
|
||||
|
||||
const { connectionPath, width, height, connection } = useStore();
|
||||
</script>
|
||||
|
||||
{#if $connectionPath}
|
||||
<svg width={$width} height={$height} class="svelte-flow__connectionline">
|
||||
<svg width={$width} height={$height} class="svelte-flow__connectionline" style={containerStyle}>
|
||||
<slot name="connectionLineComponent">
|
||||
<g class={cc(['svelte-flow__connection', $connection.connectionStatus])}>
|
||||
<g class={cc(['svelte-flow__connection', $connection.connectionStatus])} {style}>
|
||||
<path d={$connectionPath} fill="none" class="svelte-flow__connection-path" />
|
||||
</g>
|
||||
</slot>
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
export let connectionRadius: $$Props['connectionRadius'] = undefined;
|
||||
export let connectionLineType: $$Props['connectionLineType'] = undefined;
|
||||
export let connectionMode: $$Props['connectionMode'] = ConnectionMode.Strict;
|
||||
export let connectionLineStyle: $$Props['connectionLineStyle'] = '';
|
||||
export let connectionLineContainerStyle: $$Props['connectionLineContainerStyle'] = '';
|
||||
export let onMoveStart: $$Props['onMoveStart'] = undefined;
|
||||
export let onMove: $$Props['onMove'] = undefined;
|
||||
export let onMoveEnd: $$Props['onMoveEnd'] = undefined;
|
||||
@@ -154,7 +156,7 @@
|
||||
<Pane on:paneclick panOnDrag={panOnDrag === undefined ? true : panOnDrag}>
|
||||
<ViewportComponent>
|
||||
<EdgeRenderer on:edgeclick on:edgecontextmenu />
|
||||
<ConnectionLine>
|
||||
<ConnectionLine containerStyle={connectionLineContainerStyle} style={connectionLineStyle}>
|
||||
<slot name="connectionLineComponent" slot="connectionLineComponent" />
|
||||
</ConnectionLine>
|
||||
<div class="svelte-flow__edgelabel-renderer" />
|
||||
|
||||
@@ -39,6 +39,8 @@ export type SvelteFlowProps = DOMAttributes<HTMLDivElement> & {
|
||||
initialViewport?: Viewport;
|
||||
connectionRadius?: number;
|
||||
connectionMode?: ConnectionMode;
|
||||
connectionLineStyle?: string;
|
||||
connectionLineContainerStyle?: string;
|
||||
selectionMode?: SelectionMode;
|
||||
snapGrid?: SnapGrid;
|
||||
defaultMarkerColor?: string;
|
||||
|
||||
Reference in New Issue
Block a user