feat: make summary table sortable, filtrable, with sticky header

This commit is contained in:
Pavel
2025-08-19 17:08:38 +02:00
parent 78215552bf
commit 114ce1ea3a
7 changed files with 140 additions and 19 deletions

View File

@@ -1,11 +1,16 @@
<script lang="ts">
import { writable } from 'svelte/store';
import TableControl from '../elements/TableControl.svelte';
import formatFileSize from '../utility/formatFileSize';
export let rows: any[] = [];
export let columns: any[] = [];
const filters = writable({});
const tableColumns = columns.map(col => ({
filterable: col.filterable,
sortable: col.sortable,
header: col.header,
fieldName: col.fieldName,
type: col.type || 'data',
@@ -19,7 +24,7 @@
</script>
<div>
<TableControl {rows} columns={tableColumns} />
<TableControl {filters} stickyHeader {rows} columns={tableColumns} />
</div>
<style>