From b7fc8b606499a3327270ed93ad760c8ba7f14ee0 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 25 Mar 2025 13:29:29 -0700 Subject: [PATCH] working on types.... --- src/components/@types/global.ts | 7 +++++++ src/components/Table/Table.svelte | 35 ++++++++++++++++++------------- src/components/Table/utils.ts | 34 ++++++++++++++++++++++-------- 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/components/@types/global.ts b/src/components/@types/global.ts index 5dfd180e..a96bd3cd 100644 --- a/src/components/@types/global.ts +++ b/src/components/@types/global.ts @@ -48,3 +48,10 @@ export interface ScrollerStep { */ foregroundProps?: object; } + +/** Datum type for data that goes into the Table component */ +type TableDatum = { + [key: string]: string | number | boolean | undefined | null; + searchStr?: string; +}; +export type TableData = TableDatum[]; diff --git a/src/components/Table/Table.svelte b/src/components/Table/Table.svelte index f6629eb0..10c068e9 100644 --- a/src/components/Table/Table.svelte +++ b/src/components/Table/Table.svelte @@ -1,7 +1,5 @@ @@ -234,7 +237,9 @@ truncateLength} + class:truncated={truncated && + !showAll && + searchableData.length > truncateLength} > @@ -310,7 +315,7 @@ {/if}
- {#if truncated && data.length > truncateLength} + {#if truncated && searchableData.length > truncateLength}