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