diff --git a/web/src/lib/components/table.svelte b/web/src/lib/components/table.svelte index abd9537..8ab6222 100644 --- a/web/src/lib/components/table.svelte +++ b/web/src/lib/components/table.svelte @@ -27,7 +27,8 @@ }[keyof T]; export type Style = 'highlight'; - export type StyleFn = (key: keyof T, row?: T) => Style[]; + export type StyleTarget = { key: keyof T; row?: T }; + export type StyleFn = (target: StyleTarget) => Style[]; export type TableProps = { columns: Column[]; @@ -89,7 +90,7 @@ {#each sizedColumns as { column: c, sizing: s } (c.key)} - {@const styles = style?.(c.key) ?? []} + {@const styles = style?.({ key: c.key }) ?? []} {#each sizedColumns as { column: c, sizing: s } (c.key)} - {@const styles = style?.(c.key, d) ?? []} + {@const styles = style?.({ key: c.key, row: d }) ?? []} Scheduled transactions | Expenses - (row?.checked ? ['highlight'] : [])}> +
(row?.checked ? ['highlight'] : [])}> {#snippet header({ key, label })} {#if key === 'checked'}