diff --git a/frontend/src/lib/components/dashboard/DashboardDataGrid.svelte b/frontend/src/lib/components/dashboard/DashboardDataGrid.svelte new file mode 100644 index 000000000..92d545e87 --- /dev/null +++ b/frontend/src/lib/components/dashboard/DashboardDataGrid.svelte @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{emptyText || $t.common?.no_data || "No items"}
+| + handleSelectAll((e.target as HTMLInputElement).checked)} + class="h-4 w-4 text-primary border-border-strong rounded focus-visible:ring-primary-ring" + aria-label="Select all" + /> + | + {/if} + {#each columns as col (col.key)} +handleSort(col.key) : undefined} + aria-sort={col.sortable && sortColumn === col.key ? (sortDirection === 'asc' ? 'ascending' : 'descending') : undefined} + > + {col.label} + {#if col.sortable} + {#if sortColumn === col.key} + {sortDirection === "asc" ? "↑" : "↓"} + {:else} + ⇅ + {/if} + {/if} + | + {/each} +
|---|---|
| + handleSelectionChange(item[keyField], (e.target as HTMLInputElement).checked)} + class="h-4 w-4 text-primary border-border-strong rounded focus-visible:ring-primary-ring" + /> + | + {/if} + {#each columns as col (col.key)} ++ {col.render ? col.render(item) : item[col.key]} + | + {/each} +