@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/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.3",
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.3"
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.svelte'
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
- return component.prototype instanceof SvelteComponent
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
@@ -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, 'Comp').$$render(
69
+ return `${validate_component(Comp, 'TableComponent').$$render(
66
70
  $$result,
67
71
  props,
68
72
  {},