Skip to content

Commit

Permalink
Tabulator tables. nice in theory. Too bad nothing fucking works.
Browse files Browse the repository at this point in the history
  • Loading branch information
palmertab committed Nov 21, 2024
1 parent 39e9de6 commit e45ada1
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 93 deletions.
175 changes: 152 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@types/tabulator-tables": "^6.2.3",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.28.0",
Expand All @@ -50,10 +49,12 @@
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.27.6",
"dotenv": "^16.3.1",
"tabulator-tables": "^6.2.3",
"tsc-alias": "^1.8.10",
"typescript": "^5.0.0",
"vite": "^4.4.2",
"vitest": "^0.34.0"
"vitest": "^0.34.0",
"wx-svelte-core": "^1.3.1",
"wx-svelte-grid": "^1.3.3"
},
"eslintConfig": {
"extends": [
Expand Down
34 changes: 6 additions & 28 deletions src/lib/DataTable.svelte
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
<script lang='ts'>
import {TabulatorFull as Tabulator} from 'tabulator-tables';
import {onMount} from 'svelte';
import { Grid } from 'wx-svelte-grid';
import { Willow } from 'wx-svelte-grid';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export let data: any[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export let columns: any[] = [];
let tableComponent:HTMLDivElement;
onMount(() => {
new Tabulator(tableComponent, {
data,
columns,
layout : 'fitColumns',
reactiveData : true,
headerSortElement : '<i class="fas fas-sm fa-arrow-up"></i>',
autoColumns : columns.length > 0 ? false : true,
pagination : true,
paginationSize : 50,
});
});
</script>

<div bind:this={tableComponent}></div>
<Willow>
<Grid {data} {columns} />
</Willow>

<svelte:head>
<!-- <script
type="text/javascript"
src="https://oss.sheetjs.com/sheetjs/xlsx.full.min.js"
></script>
-->
<link
href="/css/tabulator.min.css"
rel="stylesheet"
>
<link href="/css/tabulator.css" rel="stylesheet">
</svelte:head>

Loading

0 comments on commit e45ada1

Please sign in to comment.