Default cell rendering.

This commit is contained in:
2026-10-23 22:45:32 +02:00
parent e5e7df85be
commit e0d0631e74
2 changed files with 11 additions and 15 deletions
+5 -1
View File
@@ -30,7 +30,7 @@
columns: Column<T>[];
data: T[];
header?: Snippet<[Column<T>]>;
cell: Snippet<[Cell<T>]>;
cell?: Snippet<[Cell<T>]>;
};
type Sizing = {
@@ -107,11 +107,15 @@
(c.wrap ? ' wrap-break-words' : ' truncate') +
(s.target === 'header' ? ' contain-[inline-size]' : '')}
>
{#if cell}
{@render cell({
key: c.key,
value: d[c.key],
row: d
})}
{:else}
{d[c.key]}
{/if}
</td>
{/each}
</tr>
@@ -43,12 +43,4 @@
<title>Scheduled transactions | Expenses</title>
</svelte:head>
<Table {columns} {data}>
{#snippet cell(ctx)}
{#if ctx.key === 'name'}
{ctx.value}
{:else}
{ctx.value}
{/if}
{/snippet}
</Table>
<Table {columns} {data} />