From 87e64cc69266d21a9f20bc359e4e10eb8b5e6de5 Mon Sep 17 00:00:00 2001 From: Etienne Burdet Date: Wed, 13 Nov 2024 11:05:15 +0100 Subject: [PATCH] fix: change implem to extra column to avoid formatting issues --- .../src/components/Table/Cell/Cell.svelte | 54 ++----------------- .../components/Table/Headers/Headers.svelte | 4 ++ .../src/components/Table/Row.svelte | 49 +++++++++++++---- .../src/components/Table/Table.svelte | 2 +- .../src/components/Table/TableCard.svelte | 1 + .../Table/{Cell => }/ZoomIcon.svelte | 0 6 files changed, 49 insertions(+), 61 deletions(-) rename packages/visualizations/src/components/Table/{Cell => }/ZoomIcon.svelte (100%) diff --git a/packages/visualizations/src/components/Table/Cell/Cell.svelte b/packages/visualizations/src/components/Table/Cell/Cell.svelte index f421f716..f501ce3d 100644 --- a/packages/visualizations/src/components/Table/Cell/Cell.svelte +++ b/packages/visualizations/src/components/Table/Cell/Cell.svelte @@ -1,44 +1,21 @@ -
- {#if onClick} - - {/if} -
- {#if isValidRawValue(rawValue)} - - {/if} -
-
+ {#if isValidRawValue(rawValue)} + + {/if} diff --git a/packages/visualizations/src/components/Table/Headers/Headers.svelte b/packages/visualizations/src/components/Table/Headers/Headers.svelte index fea4ce4f..d86c9c90 100644 --- a/packages/visualizations/src/components/Table/Headers/Headers.svelte +++ b/packages/visualizations/src/components/Table/Headers/Headers.svelte @@ -3,11 +3,15 @@ import type { Column } from '../types'; export let columns: Column[]; + export let extraButtonColumn = false; {#each columns as column} + {#if extraButtonColumn} + + {/if} {#if column.onClick} import Cell from './Cell'; + import ZoomIcon from './ZoomIcon.svelte'; import type { Column, Rows } from './types'; export let columns: Column[]; @@ -29,18 +30,18 @@ - {#each columns as column, index} - + {#if rows?.onClick} + + + + {/if} + {#each columns as column} + {/each} - - diff --git a/packages/visualizations/src/components/Table/Table.svelte b/packages/visualizations/src/components/Table/Table.svelte index 2da7999a..868474ae 100644 --- a/packages/visualizations/src/components/Table/Table.svelte +++ b/packages/visualizations/src/components/Table/Table.svelte @@ -16,7 +16,7 @@
- +
diff --git a/packages/visualizations/src/components/Table/TableCard.svelte b/packages/visualizations/src/components/Table/TableCard.svelte index fabb007a..b0d18c98 100644 --- a/packages/visualizations/src/components/Table/TableCard.svelte +++ b/packages/visualizations/src/components/Table/TableCard.svelte @@ -12,6 +12,7 @@ export let options: $$Props['options']; $: ({ value: records, loading: isLoading } = data); + $: ({ columns, rows, diff --git a/packages/visualizations/src/components/Table/Cell/ZoomIcon.svelte b/packages/visualizations/src/components/Table/ZoomIcon.svelte similarity index 100% rename from packages/visualizations/src/components/Table/Cell/ZoomIcon.svelte rename to packages/visualizations/src/components/Table/ZoomIcon.svelte