@tanstack/svelte-table 9.0.0-alpha.5 → 9.0.0-alpha.6
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/table.svelte.d.ts +2 -2
- package/dist/table.svelte.js +4 -4
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/table.svelte.ts +4 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/table.svelte.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type RowData, type TableOptions } from '@tanstack/table-core';
|
|
|
6
6
|
* @example
|
|
7
7
|
* ```svelte
|
|
8
8
|
* <script>
|
|
9
|
-
* const table =
|
|
9
|
+
* const table = createTable({ ... })
|
|
10
10
|
* </script>
|
|
11
11
|
*
|
|
12
12
|
* <table>
|
|
@@ -25,4 +25,4 @@ import { type RowData, type TableOptions } from '@tanstack/table-core';
|
|
|
25
25
|
* </table>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function createTable<TData extends RowData>(options: TableOptions<TData>): import("@tanstack/table-core").Table<TData>;
|
package/dist/table.svelte.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _createTable, } from '@tanstack/table-core';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a reactive TanStack table object for Svelte.
|
|
4
4
|
* @param options Table options to create the table with.
|
|
@@ -6,7 +6,7 @@ import { createTable, } from '@tanstack/table-core';
|
|
|
6
6
|
* @example
|
|
7
7
|
* ```svelte
|
|
8
8
|
* <script>
|
|
9
|
-
* const table =
|
|
9
|
+
* const table = createTable({ ... })
|
|
10
10
|
* </script>
|
|
11
11
|
*
|
|
12
12
|
* <table>
|
|
@@ -25,7 +25,7 @@ import { createTable, } from '@tanstack/table-core';
|
|
|
25
25
|
* </table>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export function
|
|
28
|
+
export function createTable(options) {
|
|
29
29
|
const resolvedOptions = mergeObjects({
|
|
30
30
|
state: {},
|
|
31
31
|
onStateChange() { },
|
|
@@ -34,7 +34,7 @@ export function createSvelteTable(options) {
|
|
|
34
34
|
return mergeObjects(defaultOptions, options);
|
|
35
35
|
},
|
|
36
36
|
}, options);
|
|
37
|
-
const table =
|
|
37
|
+
const table = _createTable(resolvedOptions);
|
|
38
38
|
let state = $state(table.initialState);
|
|
39
39
|
function updateOptions() {
|
|
40
40
|
table.setOptions(prev => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-table",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.6",
|
|
4
4
|
"description": "Headless UI for building powerful tables & datagrids for Svelte.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"src"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@tanstack/table-core": "9.0.0-alpha.
|
|
43
|
+
"@tanstack/table-core": "9.0.0-alpha.6"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@sveltejs/package": "^2.3.2",
|
package/src/index.ts
CHANGED
package/src/table.svelte.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
_createTable,
|
|
3
3
|
type RowData,
|
|
4
4
|
type TableOptions,
|
|
5
5
|
type TableOptionsResolved,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
* @example
|
|
14
14
|
* ```svelte
|
|
15
15
|
* <script>
|
|
16
|
-
* const table =
|
|
16
|
+
* const table = createTable({ ... })
|
|
17
17
|
* </script>
|
|
18
18
|
*
|
|
19
19
|
* <table>
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
* </table>
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export function
|
|
35
|
+
export function createTable<TData extends RowData>(
|
|
36
36
|
options: TableOptions<TData>
|
|
37
37
|
) {
|
|
38
38
|
const resolvedOptions: TableOptionsResolved<TData> = mergeObjects(
|
|
@@ -50,7 +50,7 @@ export function createSvelteTable<TData extends RowData>(
|
|
|
50
50
|
options
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
-
const table =
|
|
53
|
+
const table = _createTable(resolvedOptions)
|
|
54
54
|
let state = $state<Partial<TableState>>(table.initialState)
|
|
55
55
|
|
|
56
56
|
function updateOptions() {
|