@tanstack/svelte-table 8.0.0-beta.3 → 8.0.0-beta.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/build/cjs/svelte-table/src/index.js +6 -2
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/svelte-table/src/placeholder.js +24 -0
- package/build/cjs/svelte-table/src/placeholder.js.map +1 -0
- package/build/cjs/svelte-table/src/render-component.js +5 -1
- package/build/cjs/svelte-table/src/render-component.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +47 -13
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +68 -18
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +76 -44
- package/build/types/placeholder.d.ts +3 -0
- package/build/umd/index.development.js +63 -16
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +10 -2
- package/src/placeholder.ts +15 -0
- package/src/render-component.ts +5 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-table",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.0.0-beta.
|
|
4
|
+
"version": "8.0.0-beta.4",
|
|
5
5
|
"description": "Headless UI for building powerful tables & datagrids for Svelte.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/table#readme",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"src"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tanstack/table-core": "8.0.0-beta.
|
|
37
|
+
"@tanstack/table-core": "8.0.0-beta.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"svelte": "^3.48.0"
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
TableOptions,
|
|
8
8
|
TableOptionsResolved,
|
|
9
9
|
} from '@tanstack/table-core'
|
|
10
|
-
import Placeholder from './placeholder
|
|
10
|
+
import Placeholder from './placeholder'
|
|
11
11
|
import { SvelteComponent } from 'svelte/internal'
|
|
12
12
|
import { readable, writable, derived, Readable, get } from 'svelte/store'
|
|
13
13
|
import { renderComponent } from './render-component'
|
|
@@ -25,7 +25,14 @@ function isSvelteServerComponent(component: any) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function isSvelteClientComponent(component: any) {
|
|
28
|
-
|
|
28
|
+
let isHMR = '__SVELTE_HMR' in window
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
component.prototype instanceof SvelteComponent ||
|
|
32
|
+
(isHMR &&
|
|
33
|
+
component.name?.startsWith('Proxy<') &&
|
|
34
|
+
component.name?.endsWith('>'))
|
|
35
|
+
)
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
function isSvelteComponent(component: any) {
|
|
@@ -81,6 +88,7 @@ export function createTableInstance<TGenerics extends TableGenerics>(
|
|
|
81
88
|
state: {}, // Dummy state
|
|
82
89
|
onStateChange: () => {}, // noop
|
|
83
90
|
render,
|
|
91
|
+
renderFallbackValue: null,
|
|
84
92
|
...get(optionsStore),
|
|
85
93
|
}
|
|
86
94
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SvelteComponentDev } from 'svelte/internal'
|
|
2
|
+
import { create_ssr_component, escape } from 'svelte/internal'
|
|
3
|
+
import PlaceholderClient from './placeholder.svelte'
|
|
4
|
+
|
|
5
|
+
type X = typeof PlaceholderClient
|
|
6
|
+
|
|
7
|
+
const PlaceholderServer = create_ssr_component(
|
|
8
|
+
($$result: any, $$props: any, $$bindings: any, slots: any) => {
|
|
9
|
+
return `${escape($$props.content)}`
|
|
10
|
+
}
|
|
11
|
+
) as any as typeof SvelteComponentDev
|
|
12
|
+
|
|
13
|
+
export default typeof document === 'undefined'
|
|
14
|
+
? PlaceholderServer
|
|
15
|
+
: PlaceholderClient
|
package/src/render-component.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SvelteComponent,
|
|
3
|
+
claim_component,
|
|
3
4
|
create_component,
|
|
4
5
|
destroy_component,
|
|
5
6
|
init,
|
|
@@ -21,6 +22,9 @@ function create_fragment(ctx: any, Comp: any, props: any) {
|
|
|
21
22
|
c() {
|
|
22
23
|
create_component(c.$$.fragment)
|
|
23
24
|
},
|
|
25
|
+
l(nodes: any) {
|
|
26
|
+
claim_component(c.$$.fragment, nodes)
|
|
27
|
+
},
|
|
24
28
|
m(target: any, anchor: any) {
|
|
25
29
|
// @ts-ignore
|
|
26
30
|
mount_component(c, target, anchor)
|
|
@@ -62,7 +66,7 @@ function renderClient(Comp: any, props: any): any {
|
|
|
62
66
|
function renderServer(Comp: any, props: any) {
|
|
63
67
|
const WrapperComp = create_ssr_component(
|
|
64
68
|
($$result: any, $$props: any, $$bindings: any, slots: any) => {
|
|
65
|
-
return `${validate_component(Comp, '
|
|
69
|
+
return `${validate_component(Comp, 'TableComponent').$$render(
|
|
66
70
|
$$result,
|
|
67
71
|
props,
|
|
68
72
|
{},
|