@tanstack/svelte-table 8.0.0-alpha.67

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.
@@ -0,0 +1,78 @@
1
+ import {
2
+ SvelteComponent,
3
+ create_component,
4
+ destroy_component,
5
+ init,
6
+ mount_component,
7
+ noop,
8
+ safe_not_equal,
9
+ transition_in,
10
+ transition_out,
11
+ create_ssr_component,
12
+ validate_component,
13
+ } from 'svelte/internal'
14
+
15
+ function create_fragment(ctx: any, Comp: any, props: any) {
16
+ let c: any
17
+ let current: any
18
+ c = new Comp({ props, $$inline: true })
19
+
20
+ return {
21
+ c() {
22
+ create_component(c.$$.fragment)
23
+ },
24
+ m(target: any, anchor: any) {
25
+ // @ts-ignore
26
+ mount_component(c, target, anchor)
27
+ current = true
28
+ },
29
+ p: noop,
30
+ i(local: any) {
31
+ if (current) return
32
+ transition_in(c.$$.fragment, local)
33
+ current = true
34
+ },
35
+ o(local: any) {
36
+ transition_out(c.$$.fragment, local)
37
+ current = false
38
+ },
39
+ d(detaching: any) {
40
+ destroy_component(c, detaching)
41
+ },
42
+ }
43
+ }
44
+
45
+ function renderClient(Comp: any, props: any): any {
46
+ return class WrapperComp extends SvelteComponent {
47
+ constructor(options: any) {
48
+ super()
49
+ init(
50
+ this,
51
+ options,
52
+ null,
53
+ (ctx: any) => create_fragment(ctx, Comp, props),
54
+ safe_not_equal,
55
+ {},
56
+ undefined
57
+ )
58
+ }
59
+ }
60
+ }
61
+
62
+ function renderServer(Comp: any, props: any) {
63
+ const WrapperComp = create_ssr_component(
64
+ ($$result: any, $$props: any, $$bindings: any, slots: any) => {
65
+ return `${validate_component(Comp, 'Comp').$$render(
66
+ $$result,
67
+ props,
68
+ {},
69
+ {}
70
+ )}`
71
+ }
72
+ )
73
+
74
+ return WrapperComp
75
+ }
76
+
77
+ export const renderComponent =
78
+ typeof window === 'undefined' ? renderServer : renderClient