mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 19:26:00 +00:00
feat: make summary table sortable, filtrable, with sticky header
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user