@kayord/ui 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/custom/data-table/DataTable.svelte +6 -6
- package/dist/components/custom/data-table/DataTable.svelte.d.ts +1 -1
- package/dist/components/custom/data-table/DataTableHeader.svelte +6 -3
- package/dist/components/custom/data-table/DataTableHeader.svelte.d.ts +4 -3
- package/dist/components/custom/data-table/Pagination.svelte +1 -1
- package/dist/components/custom/data-table/Pagination.svelte.d.ts +1 -1
- package/dist/components/custom/data-table/VisibilitySelect.svelte +1 -1
- package/dist/components/custom/data-table/VisibilitySelect.svelte.d.ts +1 -1
- package/package.json +2 -2
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
let {
|
|
35
|
-
table,
|
|
35
|
+
table = $bindable(),
|
|
36
36
|
columns,
|
|
37
37
|
isLoading = false,
|
|
38
38
|
header,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
{/if}
|
|
98
98
|
{#if enableVisibility}
|
|
99
99
|
<div>
|
|
100
|
-
<VisibilitySelect
|
|
100
|
+
<VisibilitySelect bind:table />
|
|
101
101
|
</div>
|
|
102
102
|
{/if}
|
|
103
103
|
{#if enableFullscreen}
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
<Table.Root class="table-auto">
|
|
125
125
|
{#if !hideHeader}
|
|
126
126
|
<Table.Header>
|
|
127
|
-
{#each table.getHeaderGroups() as headerGroup}
|
|
127
|
+
{#each table.getHeaderGroups() as headerGroup, headerGroupIndex}
|
|
128
128
|
<Table.Row>
|
|
129
|
-
{#each headerGroup.headers as header}
|
|
130
|
-
<DataTableHeader {
|
|
129
|
+
{#each headerGroup.headers as header, headerIndex}
|
|
130
|
+
<DataTableHeader {headerGroupIndex} {headerIndex} bind:table {disableUISorting} />
|
|
131
131
|
{/each}
|
|
132
132
|
</Table.Row>
|
|
133
133
|
{/each}
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
{/if}
|
|
175
175
|
</div>
|
|
176
176
|
{#if isPaginationEnabled}
|
|
177
|
-
<Pagination
|
|
177
|
+
<Pagination bind:table />
|
|
178
178
|
{/if}
|
|
179
179
|
|
|
180
180
|
{#if footer}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<script lang="ts" generics="T">
|
|
2
2
|
import { FlexRender, Table } from "../../..";
|
|
3
3
|
import { type Header, type Table as TypeType } from "@tanstack/table-core";
|
|
4
|
-
import { ArrowUpDownIcon, ArrowDownIcon, ArrowUpIcon
|
|
4
|
+
import { ArrowUpDownIcon, ArrowDownIcon, ArrowUpIcon } from "@lucide/svelte";
|
|
5
5
|
|
|
6
6
|
interface Props<T> {
|
|
7
|
-
|
|
7
|
+
headerGroupIndex: number;
|
|
8
|
+
headerIndex: number;
|
|
8
9
|
table: TypeType<T>;
|
|
9
10
|
disableUISorting?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
let {
|
|
13
|
+
let { headerGroupIndex, headerIndex, table = $bindable(), disableUISorting = false }: Props<T> = $props();
|
|
13
14
|
|
|
14
15
|
const isSortingEnabled = $derived(table.options.getSortedRowModel !== undefined && disableUISorting !== true);
|
|
16
|
+
|
|
17
|
+
const header = table.getHeaderGroups()[headerGroupIndex].headers[headerIndex];
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
20
|
<Table.Head
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Table as TypeType } from "@tanstack/table-core";
|
|
2
2
|
interface Props<T> {
|
|
3
|
-
|
|
3
|
+
headerGroupIndex: number;
|
|
4
|
+
headerIndex: number;
|
|
4
5
|
table: TypeType<T>;
|
|
5
6
|
disableUISorting?: boolean;
|
|
6
7
|
}
|
|
@@ -8,7 +9,7 @@ declare class __sveltets_Render<T> {
|
|
|
8
9
|
props(): Props<T>;
|
|
9
10
|
events(): {};
|
|
10
11
|
slots(): {};
|
|
11
|
-
bindings(): "";
|
|
12
|
+
bindings(): "table";
|
|
12
13
|
exports(): {};
|
|
13
14
|
}
|
|
14
15
|
interface $$IsomorphicComponent {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
canChangePageSize?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
let { table, canChangePageSize = false }: Props<T> = $props();
|
|
14
|
+
let { table = $bindable(), canChangePageSize = false }: Props<T> = $props();
|
|
15
15
|
|
|
16
16
|
let value = $state(table.getState().pagination.pageSize.toString());
|
|
17
17
|
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.4",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"svelte-check": "^4.1.5",
|
|
69
69
|
"tailwindcss": "^4.0.14",
|
|
70
70
|
"tslib": "^2.8.1",
|
|
71
|
-
"tw-animate-css": "
|
|
71
|
+
"tw-animate-css": "1.2.4",
|
|
72
72
|
"typescript": "^5.8.2",
|
|
73
73
|
"vite": "^6.2.2",
|
|
74
74
|
"vitest": "^3.0.9",
|