@tanstack/svelte-table 9.0.0-alpha.2 → 9.0.0-alpha.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.
@@ -1,8 +1,26 @@
1
1
  <script
2
2
  lang="ts"
3
3
  generics="TData, TValue, TContext extends HeaderContext<TData, TValue> | CellContext<TData, TValue>"
4
- >import { RenderComponentConfig } from "./render-component";
5
- let { content, context } = $props();
4
+ >
5
+ import type {
6
+ CellContext,
7
+ ColumnDefTemplate,
8
+ HeaderContext,
9
+ } from '@tanstack/table-core'
10
+ import { RenderComponentConfig } from './render-component'
11
+
12
+ type Props = {
13
+ /** The cell or header field of the current cell's column definition. */
14
+ content?: TContext extends HeaderContext<TData, TValue>
15
+ ? ColumnDefTemplate<HeaderContext<TData, TValue>>
16
+ : TContext extends CellContext<TData, TValue>
17
+ ? ColumnDefTemplate<CellContext<TData, TValue>>
18
+ : never
19
+ /** The result of the `getContext()` function of the header or cell */
20
+ context: TContext
21
+ }
22
+
23
+ let { content, context }: Props = $props()
6
24
  </script>
7
25
 
8
26
  {#if typeof content === 'string'}
@@ -26,11 +26,3 @@ import { type RowData, type TableOptions } from '@tanstack/table-core';
26
26
  * ```
27
27
  */
28
28
  export declare function createSvelteTable<TData extends RowData>(options: TableOptions<TData>): import("@tanstack/table-core").Table<TData>;
29
- /**
30
- * Merges objects together while keeping their getters alive.
31
- * Taken from SolidJS: {@link https://github.com/solidjs/solid/blob/24abc825c0996fd2bc8c1de1491efe9a7e743aff/packages/solid/src/server/rendering.ts#L82-L115}
32
- * */
33
- export declare function mergeObjects<T>(source: T): T;
34
- export declare function mergeObjects<T, U>(source: T, source1: U): T & U;
35
- export declare function mergeObjects<T, U, V>(source: T, source1: U, source2: V): T & U & V;
36
- export declare function mergeObjects<T, U, V, W>(source: T, source1: U, source2: V, source3: W): T & U & V & W;
@@ -56,7 +56,7 @@ export function createSvelteTable(options) {
56
56
  });
57
57
  return table;
58
58
  }
59
- export function mergeObjects(...sources) {
59
+ function mergeObjects(...sources) {
60
60
  const target = {};
61
61
  for (let i = 0; i < sources.length; i++) {
62
62
  let source = sources[i];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/svelte-table",
3
- "version": "9.0.0-alpha.2",
3
+ "version": "9.0.0-alpha.4",
4
4
  "description": "Headless UI for building powerful tables & datagrids for Svelte.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -40,16 +40,16 @@
40
40
  "src"
41
41
  ],
42
42
  "dependencies": {
43
- "@tanstack/table-core": "9.0.0-alpha.0"
43
+ "@tanstack/table-core": "9.0.0-alpha.4"
44
44
  },
45
45
  "devDependencies": {
46
- "@sveltejs/package": "^2.3.1"
46
+ "@sveltejs/package": "^2.3.1",
47
+ "@sveltejs/vite-plugin-svelte": "^4.0.0-next",
48
+ "svelte": "^5.0.0-next",
49
+ "svelte-check": "^3.7.0"
47
50
  },
48
51
  "peerDependencies": {
49
- "svelte": "^5.0.0-next",
50
- "@sveltejs/vite-plugin-svelte": "^3.0.2",
51
- "svelte-check": "^3.6.8",
52
- "svelte-eslint-parser": "^0.33.1"
52
+ "svelte": "^5.0.0-next"
53
53
  },
54
54
  "scripts": {}
55
55
  }
@@ -80,20 +80,16 @@ export function createSvelteTable<TData extends RowData>(
80
80
  * Merges objects together while keeping their getters alive.
81
81
  * Taken from SolidJS: {@link https://github.com/solidjs/solid/blob/24abc825c0996fd2bc8c1de1491efe9a7e743aff/packages/solid/src/server/rendering.ts#L82-L115}
82
82
  * */
83
- export function mergeObjects<T>(source: T): T
84
- export function mergeObjects<T, U>(source: T, source1: U): T & U
85
- export function mergeObjects<T, U, V>(
86
- source: T,
87
- source1: U,
88
- source2: V
89
- ): T & U & V
90
- export function mergeObjects<T, U, V, W>(
83
+ function mergeObjects<T>(source: T): T
84
+ function mergeObjects<T, U>(source: T, source1: U): T & U
85
+ function mergeObjects<T, U, V>(source: T, source1: U, source2: V): T & U & V
86
+ function mergeObjects<T, U, V, W>(
91
87
  source: T,
92
88
  source1: U,
93
89
  source2: V,
94
90
  source3: W
95
91
  ): T & U & V & W
96
- export function mergeObjects(...sources: any): any {
92
+ function mergeObjects(...sources: any): any {
97
93
  const target = {}
98
94
  for (let i = 0; i < sources.length; i++) {
99
95
  let source = sources[i]