From 6b5d2114bfeb9c8b6185ff3132d15b3b71a96a2f Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sat, 31 Dec 2022 10:05:09 +0100 Subject: [PATCH] designer - column filter --- packages/web/src/designer/Designer.svelte | 35 ++++++++++++++++++- .../web/src/designer/DesignerTable.svelte | 3 +- packages/web/src/designer/DomTableRef.ts | 4 +-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/packages/web/src/designer/Designer.svelte b/packages/web/src/designer/Designer.svelte index 2dfabbda..1ab4740e 100644 --- a/packages/web/src/designer/Designer.svelte +++ b/packages/web/src/designer/Designer.svelte @@ -48,6 +48,8 @@ import ChooseColorModal from '../modals/ChooseColorModal.svelte'; import { currentThemeDefinition } from '../stores'; import { extendDatabaseInfoFromApps } from 'dbgate-tools'; + import SearchInput from '../elements/SearchInput.svelte'; + import CloseSearchButton from '../buttons/CloseSearchButton.svelte'; export let value; export let onChange; @@ -64,6 +66,7 @@ let canvasHeight = 3000; let dragStartPoint = null; let dragCurrentPoint = null; + let columnFilter; const sourceDragColumn$ = writable(null); const targetDragColumn$ = writable(null); @@ -80,7 +83,15 @@ const tableRefs = {}; const referenceRefs = {}; - $: domTables = _.pickBy(_.mapValues(tableRefs, (tbl: any) => tbl?.getDomTable())); + let domTables; + $: { + tableRefs; + recomputeDomTables(); + } + + function recomputeDomTables() { + domTables = _.pickBy(_.mapValues(tableRefs, (tbl: any) => tbl?.getDomTable())); + } function fixPositions(tables) { const minLeft = _.min(tables.map(x => x.left)); @@ -835,6 +846,14 @@ ], ]; } + + $: { + columnFilter; + tick().then(() => { + recomputeReferencePositions(); + recomputeDomTables(); + }); + }
@@ -896,6 +915,7 @@ onAddAllReferences={handleAddTableReferences} onChangeTableColor={handleChangeTableColor} onMoveReferences={recomputeReferencePositions} + {columnFilter} {table} {conid} {database} @@ -930,6 +950,12 @@ {/if}
+ {#if tables?.length > 0} + + {/if}