Added styled check button.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import Checkbox from '#lib/components/checkbox.svelte';
|
||||
import Table, { type Column } from '#lib/components/table.svelte';
|
||||
|
||||
const data: ScheduledTransaction[] = $state([
|
||||
@@ -55,8 +56,7 @@
|
||||
<Table {columns} {data} style={({ row }) => (row?.checked ? ['highlight'] : [])}>
|
||||
{#snippet header({ key, label })}
|
||||
{#if key === 'checked'}
|
||||
<input
|
||||
type="checkbox"
|
||||
<Checkbox
|
||||
onchange={(e) => data.forEach((row) => (row.checked = e.currentTarget.checked))}
|
||||
checked={data.every((row) => row.checked)}
|
||||
/>
|
||||
@@ -66,7 +66,7 @@
|
||||
{/snippet}
|
||||
{#snippet cell({ key, value, row })}
|
||||
{#if key === 'checked'}
|
||||
<input type="checkbox" bind:checked={row.checked} />
|
||||
<Checkbox bind:checked={row.checked} />
|
||||
{:else}
|
||||
{value}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user