fix: formatting
This commit is contained in:
parent
52a02c82d2
commit
9def0b27c9
@ -214,7 +214,7 @@
|
|||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
{#each headerGroup.headers as header}
|
{#each headerGroup.headers as header}
|
||||||
<TableHeader {header}></TableHeader>
|
<TableHeader {header} />
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
@ -245,7 +245,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="h-2" />
|
<div class="h-2" />
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<TableBottom {table} {selected}></TableBottom>
|
<TableBottom {table} {selected} />
|
||||||
|
@ -1,71 +1,71 @@
|
|||||||
<script>
|
<script>
|
||||||
|
export let table;
|
||||||
export let table;
|
export let selected;
|
||||||
export let selected;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
class="border rounded p-1"
|
class="border rounded p-1"
|
||||||
on:click={() => $table.setPageIndex(0)}
|
on:click={() => $table.setPageIndex(0)}
|
||||||
disabled={!$table.getCanPreviousPage()}
|
disabled={!$table.getCanPreviousPage()}
|
||||||
>
|
>
|
||||||
{"<<"}
|
{"<<"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="border rounded p-1"
|
class="border rounded p-1"
|
||||||
on:click={() => $table.previousPage()}
|
on:click={() => $table.previousPage()}
|
||||||
disabled={!$table.getCanPreviousPage()}
|
disabled={!$table.getCanPreviousPage()}
|
||||||
>
|
>
|
||||||
{"<"}
|
{"<"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="border rounded p-1"
|
class="border rounded p-1"
|
||||||
on:click={() => $table.nextPage()}
|
on:click={() => $table.nextPage()}
|
||||||
disabled={!$table.getCanNextPage()}
|
disabled={!$table.getCanNextPage()}
|
||||||
>
|
>
|
||||||
{">"}
|
{">"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="border rounded p-1"
|
class="border rounded p-1"
|
||||||
on:click={() => $table.setPageIndex($table.getPageCount() - 1)}
|
on:click={() => $table.setPageIndex($table.getPageCount() - 1)}
|
||||||
disabled={!$table.getCanNextPage()}
|
disabled={!$table.getCanNextPage()}
|
||||||
>
|
>
|
||||||
{">>"}
|
{">>"}
|
||||||
</button>
|
</button>
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
<div>Page</div>
|
<div>Page</div>
|
||||||
<strong>
|
<strong>
|
||||||
{$table.getState().pagination.pageIndex + 1} of{" "}
|
{$table.getState().pagination.pageIndex + 1} of{" "}
|
||||||
{$table.getPageCount()}
|
{$table.getPageCount()}
|
||||||
</strong>
|
</strong>
|
||||||
</span>
|
</span>
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
| Go to page:
|
| Go to page:
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
defaultValue={$table.getState().pagination.pageIndex + 1}
|
defaultValue={$table.getState().pagination.pageIndex + 1}
|
||||||
on:change={(e) => {
|
on:change={(e) => {
|
||||||
const page = e.target.value ? Number(e.target.value) - 1 : 0;
|
const page = e.target.value ? Number(e.target.value) - 1 : 0;
|
||||||
$table.setPageIndex(page);
|
$table.setPageIndex(page);
|
||||||
}}
|
|
||||||
class="border p-1 rounded w-16"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<select
|
|
||||||
value={$table.getState().pagination.pageSize}
|
|
||||||
on:input={(e) => {
|
|
||||||
const ps = Number(e.target.value);
|
|
||||||
console.log({ ps });
|
|
||||||
$table.setPageSize(Number(e.target.value));
|
|
||||||
}}
|
}}
|
||||||
>
|
class="border p-1 rounded w-16"
|
||||||
{#each [25, 50, 100, 250, 500] as pageSize}
|
/>
|
||||||
<option value={pageSize}>{pageSize}</option>
|
</span>
|
||||||
{/each}
|
<select
|
||||||
</select>
|
value={$table.getState().pagination.pageSize}
|
||||||
</div>
|
on:input={(e) => {
|
||||||
<!-- <pre>{JSON.stringify($table.getState(), null, 2)}</pre> -->
|
const ps = Number(e.target.value);
|
||||||
<div>
|
console.log({ ps });
|
||||||
{Object.keys(selected).length} of{" "}
|
$table.setPageSize(Number(e.target.value));
|
||||||
{$table.getPreFilteredRowModel().rows.length} Total Rows Selected
|
}}
|
||||||
</div>
|
>
|
||||||
|
{#each [25, 50, 100, 250, 500] as pageSize}
|
||||||
|
<option value={pageSize}>{pageSize}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<!-- <pre>{JSON.stringify($table.getState(), null, 2)}</pre> -->
|
||||||
|
<div>
|
||||||
|
{Object.keys(selected).length} of{" "}
|
||||||
|
{$table.getPreFilteredRowModel().rows.length} Total Rows Selected
|
||||||
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user