diff --git a/packages/web/src/designer/ColumnLine.svelte b/packages/web/src/designer/ColumnLine.svelte index c7854c42..606b9507 100644 --- a/packages/web/src/designer/ColumnLine.svelte +++ b/packages/web/src/designer/ColumnLine.svelte @@ -10,13 +10,14 @@ export let designer; export let designerId; export let onChangeColumn; + export let domLine; $: designerColumn = (designer.columns || []).find( x => x.designerId == designerId && x.columnName == column.columnName ); -
+
x.designerId == designerId && x.columnName == column.columnName && x.isOutput diff --git a/packages/web/src/designer/Designer.svelte b/packages/web/src/designer/Designer.svelte index 138a00f3..73c3805a 100644 --- a/packages/web/src/designer/Designer.svelte +++ b/packages/web/src/designer/Designer.svelte @@ -8,17 +8,23 @@ import { getTableInfo } from '../utility/metadataLoaders'; import cleanupDesignColumns from './cleanupDesignColumns'; import _ from 'lodash'; + import createRef from '../utility/createRef'; + import DesignerReference from './DesignerReference.svelte'; export let value; export let onChange; export let conid; export let database; - let domWrapper; + let domCanvas; $: tables = value?.tables as any[]; $: references = value?.references as any[]; + const tableRefs = {}; + const referenceRefs = {}; + $: domTables = _.mapValues(tableRefs, (tbl: any) => tbl.getDomTable()); + function fixPositions(tables) { const minLeft = _.min(tables.map(x => x.left)); const minTop = _.min(tables.map(x => x.top)); @@ -260,6 +266,12 @@ }; }); }; + + function handleMoveReferences() { + for(const ref of Object.values(referenceRefs) as any[]) { + ref.recomputePosition(); + } + }
@@ -267,18 +279,18 @@
Drag & drop tables or views from left panel here
{/if} -
e.preventDefault()} on:drop={handleDrop}> - + }} --> {#each tables || [] as table (table.designerId)} {/each} diff --git a/packages/web/src/designer/DesignerReference.svelte b/packages/web/src/designer/DesignerReference.svelte new file mode 100644 index 00000000..7195b491 --- /dev/null +++ b/packages/web/src/designer/DesignerReference.svelte @@ -0,0 +1,109 @@ + + +{#if src && dst && minpos} + + + {#each columnsY as coly} + + + {/each} + > +{/if} + + diff --git a/packages/web/src/designer/DesignerTable.svelte b/packages/web/src/designer/DesignerTable.svelte index 97b0af68..41621935 100644 --- a/packages/web/src/designer/DesignerTable.svelte +++ b/packages/web/src/designer/DesignerTable.svelte @@ -1,7 +1,10 @@
{#each columns || [] as column} - + {/each}