Default cell rendering.
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user