@tanstack/svelte-table 8.17.3 → 8.19.2

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.
@@ -14,7 +14,7 @@ import { SvelteComponent, init, safe_not_equal, text, claim_text, insert_hydrati
14
14
  import 'svelte/internal/disclose-version';
15
15
  import { readable, get, writable, derived } from 'svelte/store';
16
16
 
17
- /* src/placeholder.svelte generated by Svelte v4.2.15 */
17
+ /* src/placeholder.svelte generated by Svelte v4.2.18 */
18
18
 
19
19
  function create_fragment$1(ctx) {
20
20
  let t;
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/placeholder.svelte","../../src/placeholder.ts","../../src/render-component.ts","../../src/index.ts"],"sourcesContent":["<script>\n export let content\n</script>\n\n{content}\n","import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n","import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n","import {\n RowData,\n createTable,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\nimport type { ComponentType } from 'svelte'\nimport { SvelteComponent } from 'svelte/internal'\nimport { readable, writable, derived, Readable, get } from 'svelte/store'\nimport { renderComponent } from './render-component'\n\nexport { renderComponent } from './render-component'\n\nexport * from '@tanstack/table-core'\n\nfunction isSvelteServerComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$render === 'function' &&\n typeof component.render === 'function'\n )\n}\n\nfunction isSvelteClientComponent(component: any) {\n let isHMR = '__SVELTE_HMR' in window\n\n return (\n component.prototype instanceof SvelteComponent ||\n (isHMR &&\n component.name?.startsWith('Proxy<') &&\n component.name?.endsWith('>'))\n )\n}\n\nfunction isSvelteComponent(component: any) {\n if (typeof document === 'undefined') {\n return isSvelteServerComponent(component)\n } else {\n return isSvelteClientComponent(component)\n }\n}\n\nfunction wrapInPlaceholder(content: any) {\n return renderComponent(Placeholder, { content })\n}\n\nexport function flexRender(component: any, props: any): ComponentType | null {\n if (!component) return null\n\n if (isSvelteComponent(component)) {\n return renderComponent(component, props)\n }\n\n if (typeof component === 'function') {\n const result = component(props)\n if (result === null || result === undefined) return null\n\n if (isSvelteComponent(result)) {\n return renderComponent(result, props)\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createSvelteTable<TData extends RowData>(\n options: ReadableOrVal<TableOptions<TData>>\n) {\n let optionsStore: Readable<TableOptions<TData>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TData> = {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let table = createTable(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ table.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const tableReadable = readable(table, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n table.setOptions(prev => {\n return {\n ...prev,\n ...options,\n state: { ...state, ...options.state },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n if (updater instanceof Function) {\n stateStore.update(updater)\n } else {\n stateStore.set(updater)\n }\n\n resolvedOptions.onStateChange?.(updater)\n },\n }\n })\n\n // it didn't seem to rerender without setting the table\n set(table)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return tableReadable\n}\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient","create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","validate_component","$$render","renderComponent","window","isSvelteServerComponent","component","render","isSvelteClientComponent","_component$name","_component$name2","isHMR","prototype","name","startsWith","endsWith","isSvelteComponent","wrapInPlaceholder","Placeholder","flexRender","result","createSvelteTable","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","table","createTable","stateStore","writable","initialState","stateOptionsStore","derived","s","tableReadable","start","set","unsubscribe","subscribe","_ref","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBAIC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;qCAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;sDAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;OAHK,OAAO,EAAA,GAAA,OAAA,CAAA;;;;;;;;;;;;;;;;ACKpB,MAAMA,iBAAiB,GAAGC,oBAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OAAQ,GAAEC,MAAM,CAACH,OAAO,CAACI,OAAO,CAAE,CAAC,CAAA,CAAA;AACrC,CACF,CAAqC,CAAA;AAErC,kBAAe,OAAOC,QAAQ,KAAK,WAAW,GAC1CR,iBAAiB,GACjBS,aAAiB;;ACErB,SAASC,eAAeA,CAACC,GAAQ,EAAEC,IAAS,EAAEC,KAAU,EAAE;AACxD,EAAA,IAAIC,CAAM,CAAA;AACV,EAAA,IAAIC,OAAY,CAAA;EAChBD,CAAC,GAAG,IAAIF,IAAI,CAAC;IAAEC,KAAK;AAAEG,IAAAA,QAAQ,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;EAEvC,OAAO;AACLF,IAAAA,CAACA,GAAG;AACFG,MAAAA,gBAAgB,CAACH,CAAC,CAACI,EAAE,CAACC,QAAQ,CAAC,CAAA;KAChC;IACDC,CAACA,CAACC,KAAU,EAAE;MACZC,eAAe,CAACR,CAAC,CAACI,EAAE,CAACC,QAAQ,EAAEE,KAAK,CAAC,CAAA;KACtC;AACDE,IAAAA,CAACA,CAACC,MAAW,EAAEC,MAAW,EAAE;AAC1B;AACAC,MAAAA,eAAe,CAACZ,CAAC,EAAEU,MAAM,EAAEC,MAAM,CA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BAAiB,GAAGC,OAAO,CAAC,CAACJ,UAAU,EAAET,YAAY,CAAC,EAAEc,CAAC,IAAIA,CAAC,CAAC,CAAA;EACnE,MAAMC,aAAa,GAAGd,QAAQ,CAACM,KAAK,EAAE,SAASS,KAAKA,CAACC,GAAG,EAAE;AACxD,IAAA,MAAMC,WAAW,GAAGN,iBAAiB,CAACO,SAAS,CAACC,IAAA,IAAsB;AAAA,MAAA,IAArB,CAACjB,KAAK,EAAE7B,OAAO,CAAC,GAAA8C,IAAA,CAAA;AAC/Db,MAAAA,KAAK,CAACc,UAAU,CAACC,IAAI,IAAI;QACvB,OAAO;AACL,UAAA,GAAGA,IAAI;AACP,UAAA,GAAGhD,OAAO;AACV6B,UAAAA,KAAK,EAAE;AAAE,YAAA,GAAGA,KAAK;AAAE,YAAA,GAAG7B,OAAO,CAAC6B,KAAAA;WAAO;AACrC;AACA;UACAC,aAAa,EAAEmB,OAAO,IAAI;YACxB,IAAIA,OAAO,YAAYC,QAAQ,EAAE;AAC/Bf,cAAAA,UAAU,CAACgB,MAAM,CAACF,OAAO,CAAC,CAAA;AAC5B,aAAC,MAAM;AACLd,cAAAA,UAAU,CAACQ,GAAG,CAACM,OAAO,CAAC,CAAA;AACzB,aAAA;YAEArB,eAAe,CAACE,aAAa,IAA7BF,IAAAA,IAAAA,eAAe,CAACE,aAAa,CAAGmB,OAAO,CAAC,CAAA;AAC1C,WAAA;SACD,CAAA;AACH,OAAC,CAAC,CAAA;;AAEF;MACAN,GAAG,CAACV,KAAK,CAAC,CAAA;AACZ,KAAC,CAAC,CAAA;IAEF,OAAO,SAASmB,IAAIA,GAAG;AACrBR,MAAAA,WAAW,EAAE,CAAA;KACd,CAAA;AACH,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOH,aAAa,CAAA;AACtB;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/placeholder.svelte","../../src/placeholder.ts","../../src/render-component.ts","../../src/index.ts"],"sourcesContent":["<script>\n export let content\n</script>\n\n{content}\n","import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n","import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n","import {\n RowData,\n createTable,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\nimport type { ComponentType } from 'svelte'\nimport { SvelteComponent } from 'svelte/internal'\nimport { readable, writable, derived, Readable, get } from 'svelte/store'\nimport { renderComponent } from './render-component'\n\nexport { renderComponent } from './render-component'\n\nexport * from '@tanstack/table-core'\n\nfunction isSvelteServerComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$render === 'function' &&\n typeof component.render === 'function'\n )\n}\n\nfunction isSvelteClientComponent(component: any) {\n let isHMR = '__SVELTE_HMR' in window\n\n return (\n component.prototype instanceof SvelteComponent ||\n (isHMR &&\n component.name?.startsWith('Proxy<') &&\n component.name?.endsWith('>'))\n )\n}\n\nfunction isSvelteComponent(component: any) {\n if (typeof document === 'undefined') {\n return isSvelteServerComponent(component)\n } else {\n return isSvelteClientComponent(component)\n }\n}\n\nfunction wrapInPlaceholder(content: any) {\n return renderComponent(Placeholder, { content })\n}\n\nexport function flexRender(component: any, props: any): ComponentType | null {\n if (!component) return null\n\n if (isSvelteComponent(component)) {\n return renderComponent(component, props)\n }\n\n if (typeof component === 'function') {\n const result = component(props)\n if (result === null || result === undefined) return null\n\n if (isSvelteComponent(result)) {\n return renderComponent(result, props)\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createSvelteTable<TData extends RowData>(\n options: ReadableOrVal<TableOptions<TData>>\n) {\n let optionsStore: Readable<TableOptions<TData>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TData> = {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let table = createTable(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ table.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const tableReadable = readable(table, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n table.setOptions(prev => {\n return {\n ...prev,\n ...options,\n state: { ...state, ...options.state },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n if (updater instanceof Function) {\n stateStore.update(updater)\n } else {\n stateStore.set(updater)\n }\n\n resolvedOptions.onStateChange?.(updater)\n },\n }\n })\n\n // it didn't seem to rerender without setting the table\n set(table)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return tableReadable\n}\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient","create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","validate_component","$$render","renderComponent","window","isSvelteServerComponent","component","render","isSvelteClientComponent","_component$name","_component$name2","isHMR","prototype","name","startsWith","endsWith","isSvelteComponent","wrapInPlaceholder","Placeholder","flexRender","result","createSvelteTable","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","table","createTable","stateStore","writable","initialState","stateOptionsStore","derived","s","tableReadable","start","set","unsubscribe","subscribe","_ref","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBAIC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;qCAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;sDAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;OAHK,OAAO,EAAA,GAAA,OAAA,CAAA;;;;;;;;;;;;;;;;ACKpB,MAAMA,iBAAiB,GAAGC,oBAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OA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AE,YAAA,GAAG7B,OAAO,CAAC6B,KAAAA;WAAO;AACrC;AACA;UACAC,aAAa,EAAEmB,OAAO,IAAI;YACxB,IAAIA,OAAO,YAAYC,QAAQ,EAAE;AAC/Bf,cAAAA,UAAU,CAACgB,MAAM,CAACF,OAAO,CAAC,CAAA;AAC5B,aAAC,MAAM;AACLd,cAAAA,UAAU,CAACQ,GAAG,CAACM,OAAO,CAAC,CAAA;AACzB,aAAA;YAEArB,eAAe,CAACE,aAAa,IAA7BF,IAAAA,IAAAA,eAAe,CAACE,aAAa,CAAGmB,OAAO,CAAC,CAAA;AAC1C,WAAA;SACD,CAAA;AACH,OAAC,CAAC,CAAA;;AAEF;MACAN,GAAG,CAACV,KAAK,CAAC,CAAA;AACZ,KAAC,CAAC,CAAA;IAEF,OAAO,SAASmB,IAAIA,GAAG;AACrBR,MAAAA,WAAW,EAAE,CAAA;KACd,CAAA;AACH,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOH,aAAa,CAAA;AACtB;;;;"}
@@ -14,7 +14,7 @@ import { SvelteComponent, init, safe_not_equal, text, claim_text, insert_hydrati
14
14
  import 'svelte/internal/disclose-version';
15
15
  import { readable, get, writable, derived } from 'svelte/store';
16
16
 
17
- /* src/placeholder.svelte generated by Svelte v4.2.15 */
17
+ /* src/placeholder.svelte generated by Svelte v4.2.18 */
18
18
 
19
19
  function create_fragment$1(ctx) {
20
20
  let t;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/placeholder.svelte","../../src/placeholder.ts","../../src/render-component.ts","../../src/index.ts"],"sourcesContent":["<script>\n export let content\n</script>\n\n{content}\n","import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n","import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n","import {\n RowData,\n createTable,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\nimport type { ComponentType } from 'svelte'\nimport { SvelteComponent } from 'svelte/internal'\nimport { readable, writable, derived, Readable, get } from 'svelte/store'\nimport { renderComponent } from './render-component'\n\nexport { renderComponent } from './render-component'\n\nexport * from '@tanstack/table-core'\n\nfunction isSvelteServerComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$render === 'function' &&\n typeof component.render === 'function'\n )\n}\n\nfunction isSvelteClientComponent(component: any) {\n let isHMR = '__SVELTE_HMR' in window\n\n return (\n component.prototype instanceof SvelteComponent ||\n (isHMR &&\n component.name?.startsWith('Proxy<') &&\n component.name?.endsWith('>'))\n )\n}\n\nfunction isSvelteComponent(component: any) {\n if (typeof document === 'undefined') {\n return isSvelteServerComponent(component)\n } else {\n return isSvelteClientComponent(component)\n }\n}\n\nfunction wrapInPlaceholder(content: any) {\n return renderComponent(Placeholder, { content })\n}\n\nexport function flexRender(component: any, props: any): ComponentType | null {\n if (!component) return null\n\n if (isSvelteComponent(component)) {\n return renderComponent(component, props)\n }\n\n if (typeof component === 'function') {\n const result = component(props)\n if (result === null || result === undefined) return null\n\n if (isSvelteComponent(result)) {\n return renderComponent(result, props)\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createSvelteTable<TData extends RowData>(\n options: ReadableOrVal<TableOptions<TData>>\n) {\n let optionsStore: Readable<TableOptions<TData>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TData> = {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let table = createTable(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ table.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const tableReadable = readable(table, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n table.setOptions(prev => {\n return {\n ...prev,\n ...options,\n state: { ...state, ...options.state },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n if (updater instanceof Function) {\n stateStore.update(updater)\n } else {\n stateStore.set(updater)\n }\n\n resolvedOptions.onStateChange?.(updater)\n },\n }\n })\n\n // it didn't seem to rerender without setting the table\n set(table)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return tableReadable\n}\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient","create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","validate_component","$$render","renderComponent","window","isSvelteServerComponent","component","render","isSvelteClientComponent","_component$name","_component$name2","isHMR","prototype","name","startsWith","endsWith","isSvelteComponent","wrapInPlaceholder","Placeholder","flexRender","result","createSvelteTable","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","table","createTable","stateStore","writable","initialState","stateOptionsStore","derived","s","tableReadable","start","set","unsubscribe","subscribe","_ref","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBAIC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;qCAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;sDAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;OAHK,OAAO,EAAA,GAAA,OAAA,CAAA;;;;;;;;;;;;;;;;ACKpB,MAAMA,iBAAiB,GAAGC,oBAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OAAQ,GAAEC,MAAM,CAACH,OAAO,CAACI,OAAO,CAAE,CAAC,CAAA,CAAA;AACrC,CACF,CAAqC,CAAA;AAErC,kBAAe,OAAOC,QAAQ,KAAK,WAAW,GAC1CR,iBAAiB,GACjBS,aAAiB;;ACErB,SAASC,eAAeA,CAACC,GAAQ,EAAEC,IAAS,EAAEC,KAAU,EAAE;AACxD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ACQ,GAAG,CAACM,OAAO,CAAC,CAAA;AACzB,aAAA;YAEArB,eAAe,CAACE,aAAa,IAA7BF,IAAAA,IAAAA,eAAe,CAACE,aAAa,CAAGmB,OAAO,CAAC,CAAA;AAC1C,WAAA;SACD,CAAA;AACH,OAAC,CAAC,CAAA;;AAEF;MACAN,GAAG,CAACV,KAAK,CAAC,CAAA;AACZ,KAAC,CAAC,CAAA;IAEF,OAAO,SAASmB,IAAIA,GAAG;AACrBR,MAAAA,WAAW,EAAE,CAAA;KACd,CAAA;AACH,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOH,aAAa,CAAA;AACtB;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/placeholder.svelte","../../src/placeholder.ts","../../src/render-component.ts","../../src/index.ts"],"sourcesContent":["<script>\n export let content\n</script>\n\n{content}\n","import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n","import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n","import {\n RowData,\n createTable,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\nimport type { ComponentType } from 'svelte'\nimport { SvelteComponent } from 'svelte/internal'\nimport { readable, writable, derived, Readable, get } from 'svelte/store'\nimport { renderComponent } from './render-component'\n\nexport { renderComponent } from './render-component'\n\nexport * from '@tanstack/table-core'\n\nfunction isSvelteServerComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$render === 'function' &&\n typeof component.render === 'function'\n )\n}\n\nfunction isSvelteClientComponent(component: any) {\n let isHMR = '__SVELTE_HMR' in window\n\n return (\n component.prototype instanceof SvelteComponent ||\n (isHMR &&\n component.name?.startsWith('Proxy<') &&\n component.name?.endsWith('>'))\n )\n}\n\nfunction isSvelteComponent(component: any) {\n if (typeof document === 'undefined') {\n return isSvelteServerComponent(component)\n } else {\n return isSvelteClientComponent(component)\n }\n}\n\nfunction wrapInPlaceholder(content: any) {\n return renderComponent(Placeholder, { content })\n}\n\nexport function flexRender(component: any, props: any): ComponentType | null {\n if (!component) return null\n\n if (isSvelteComponent(component)) {\n return renderComponent(component, props)\n }\n\n if (typeof component === 'function') {\n const result = component(props)\n if (result === null || result === undefined) return null\n\n if (isSvelteComponent(result)) {\n return renderComponent(result, props)\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createSvelteTable<TData extends RowData>(\n options: ReadableOrVal<TableOptions<TData>>\n) {\n let optionsStore: Readable<TableOptions<TData>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TData> = {\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let table = createTable(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ table.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const tableReadable = readable(table, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n table.setOptions(prev => {\n return {\n ...prev,\n ...options,\n state: { ...state, ...options.state },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n if (updater instanceof Function) {\n stateStore.update(updater)\n } else {\n stateStore.set(updater)\n }\n\n resolvedOptions.onStateChange?.(updater)\n },\n }\n })\n\n // it didn't seem to rerender without setting the table\n set(table)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return tableReadable\n}\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient","create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","validate_component","$$render","renderComponent","window","isSvelteServerComponent","component","render","isSvelteClientComponent","_component$name","_component$name2","isHMR","prototype","name","startsWith","endsWith","isSvelteComponent","wrapInPlaceholder","Placeholder","flexRender","result","createSvelteTable","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","table","createTable","stateStore","writable","initialState","stateOptionsStore","derived","s","tableReadable","start","set","unsubscribe","subscribe","_ref","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBAIC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;qCAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;sDAAP,GAAO,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;OAHK,OAAO,EAAA,GAAA,OAAA,CAAA;;;;;;;;;;;;;;;;ACKpB,MAAMA,iBAAiB,GAAGC,oBAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OAAO,GAAGC,MAAM,CAACH,OAAO,CAACI,OAAO,CAAC,CAAE,CAAA,CAAA;AACrC,CACF,CAAqC,CAAA;AAErC,kBAAe,OAAOC,QAAQ,KAAK,WAAW,GAC1CR,iBAAiB,GACjBS,aAAiB;;ACErB,SAASC,eAAeA,CAACC,GAAQ,EAAEC,IAAS,EAAEC,KAAU,EAAE;AACxD,EAAA,IAAIC,CAAM,CAAA;AACV,EAAA,IAAIC,OAAY,CAAA;EAChBD,CAAC,GAAG,IAAIF,IAAI,CAAC;IAAEC,KAAK;AAAEG,IAAAA,QAAQ,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;EAEvC,OAAO;AACLF,IAAAA,CAACA,GAAG;AACFG,MAAAA,gBAAgB,CAACH,CAAC,CAACI,EAAE,CAACC,QAAQ,CAAC,CAAA;KAChC;IACDC,CAACA,CAACC,KAAU,EAAE;MACZC,eAAe,CAACR,CAAC,CAACI,EAAE,CAACC,QAAQ,EAAEE,KAAK,CAAC,CAAA;KACtC;AACDE,IAAAA,CAACA,CAACC,MAAW,EAAEC,MAAW,EAAE;AAC1B;AACAC,MAAAA,eAAe,CAACZ,CAAC,EAAEU,M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AACA,EAAA,IAAIC,iBAAiB,GAAGC,OAAO,CAAC,CAACJ,UAAU,EAAET,YAAY,CAAC,EAAEc,CAAC,IAAIA,CAAC,CAAC,CAAA;EACnE,MAAMC,aAAa,GAAGd,QAAQ,CAACM,KAAK,EAAE,SAASS,KAAKA,CAACC,GAAG,EAAE;AACxD,IAAA,MAAMC,WAAW,GAAGN,iBAAiB,CAACO,SAAS,CAACC,IAAA,IAAsB;AAAA,MAAA,IAArB,CAACjB,KAAK,EAAE7B,OAAO,CAAC,GAAA8C,IAAA,CAAA;AAC/Db,MAAAA,KAAK,CAACc,UAAU,CAACC,IAAI,IAAI;QACvB,OAAO;AACL,UAAA,GAAGA,IAAI;AACP,UAAA,GAAGhD,OAAO;AACV6B,UAAAA,KAAK,EAAE;AAAE,YAAA,GAAGA,KAAK;AAAE,YAAA,GAAG7B,OAAO,CAAC6B,KAAAA;WAAO;AACrC;AACA;UACAC,aAAa,EAAEmB,OAAO,IAAI;YACxB,IAAIA,OAAO,YAAYC,QAAQ,EAAE;AAC/Bf,cAAAA,UAAU,CAACgB,MAAM,CAACF,OAAO,CAAC,CAAA;AAC5B,aAAC,MAAM;AACLd,cAAAA,UAAU,CAACQ,GAAG,CAACM,OAAO,CAAC,CAAA;AACzB,aAAA;YAEArB,eAAe,CAACE,aAAa,IAA7BF,IAAAA,IAAAA,eAAe,CAACE,aAAa,CAAGmB,OAAO,CAAC,CAAA;AAC1C,WAAA;SACD,CAAA;AACH,OAAC,CAAC,CAAA;;AAEF;MACAN,GAAG,CAACV,KAAK,CAAC,CAAA;AACZ,KAAC,CAAC,CAAA;IAEF,OAAO,SAASmB,IAAIA,GAAG;AACrBR,MAAAA,WAAW,EAAE,CAAA;KACd,CAAA;AACH,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOH,aAAa,CAAA;AACtB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder.js","sources":["../../src/placeholder.ts"],"sourcesContent":["import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAMA,iBAAiB,GAAGC,6BAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OAAQ,GAAEC,eAAM,CAACH,OAAO,CAACI,OAAO,CAAE,CAAC,CAAA,CAAA;AACrC,CACF,CAAqC,CAAA;AAErC,kBAAe,OAAOC,QAAQ,KAAK,WAAW,GAC1CR,iBAAiB,GACjBS,mBAAiB;;;;"}
1
+ {"version":3,"file":"placeholder.js","sources":["../../src/placeholder.ts"],"sourcesContent":["import type { SvelteComponentDev } from 'svelte/internal'\nimport { create_ssr_component, escape } from 'svelte/internal'\nimport PlaceholderClient from './placeholder.svelte'\n\ntype X = typeof PlaceholderClient\n\nconst PlaceholderServer = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${escape($$props.content)}`\n }\n) as any as typeof SvelteComponentDev\n\nexport default typeof document === 'undefined'\n ? PlaceholderServer\n : PlaceholderClient\n"],"names":["PlaceholderServer","create_ssr_component","$$result","$$props","$$bindings","slots","escape","content","document","PlaceholderClient"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAMA,iBAAiB,GAAGC,6BAAoB,CAC5C,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;AAC5D,EAAA,OAAO,GAAGC,eAAM,CAACH,OAAO,CAACI,OAAO,CAAC,CAAE,CAAA,CAAA;AACrC,CACF,CAAqC,CAAA;AAErC,kBAAe,OAAOC,QAAQ,KAAK,WAAW,GAC1CR,iBAAiB,GACjBS,mBAAiB;;;;"}
@@ -15,7 +15,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
15
15
  var internal = require('svelte/internal');
16
16
  require('svelte/internal/disclose-version');
17
17
 
18
- /* src/placeholder.svelte generated by Svelte v4.2.15 */
18
+ /* src/placeholder.svelte generated by Svelte v4.2.18 */
19
19
 
20
20
  function create_fragment(ctx) {
21
21
  let t;
@@ -1 +1 @@
1
- {"version":3,"file":"render-component.js","sources":["../../src/render-component.ts"],"sourcesContent":["import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n"],"names":["create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","create_ssr_component","$$result","$$props","$$bindings","slots","validate_component","$$render","renderComponent","window"],"mappings":";;;;;;;;;;;;;;AAgBA,SAASA,eAAeA,CAACC,GAAQ,EAAEC,IAAS,EAAEC,KAAU,EAAE;AACxD,EAAA,IAAIC,CAAM,CAAA;AACV,EAAA,IAAIC,OAAY,CAAA;EAChBD,CAAC,GAAG,IAAIF,IAAI,CAAC;IAAEC,KAAK;AAAEG,IAAAA,QAAQ,EAAE,IAAA;AAAK,GAAC,CAAC,CAAA;EAEvC,OAAO;AACLF,IAAAA,CAACA,GAAG;AACFG,MAAAA,yBAAgB,CAACH,CAAC,CAACI,EAAE,CAACC,QAAQ,CAAC,CAAA;KAChC;IACDC,CAACA,CAACC,KAAU,EAAE;MACZC,wBAAe,CAACR,CAAC,CAACI,EAAE,CAACC,QAAQ,EAAEE,KAAK,CAAC,CAAA;KACtC;AACDE,IAAAA,CAACA,CAACC,MAAW,EAAEC,MAAW,EAAE;AAC1B;AACAC,MAAAA,wBAAe,CAACZ,CAAC,EAAEU,MAAM,EAAEC,MAAM,CAAC,CAAA;AAClCV,MAAAA,OAAO,GAAG,IAAI,CAAA;KACf;AACDY,IAAAA,CAAC,EAAEC,aAAI;IACPC,CAACA,CAACC,KAAU,EAAE;AACZ,MAAA,IAAIf,OAAO,EAAE,OAAA;MACbgB,sBAAa,CAACjB,CAAC,CAACI,EAAE,CAACC,QAAQ,EAAEW,KAAK,CAAC,CAAA;AACnCf,MAAAA,OAAO,GAAG,IAAI,CAAA;KACf;IACDiB,CAACA,CAACF,KAAU,EAAE;MACZG,uBAAc,CAACnB,CAAC,CAACI,EAAE,CAACC,QAAQ,EAAEW,KAAK,CAAC,CAAA;AACpCf,MAAAA,OAAO,GAAG,KAAK,CAAA;KAChB;IACDmB,CAACA,CAACC,SAAc,EAAE;AAChBC,MAAAA,0BAAiB,CAACtB,CAAC,EAAEqB,SAAS,CAAC,CAAA;AACjC,KAAA;GACD,CAAA;AACH,CAAA;AAEA,SAASE,YAAYA,CACnBzB,IAAO,EACPC,KAAiE,EACjE;AACA,EAAA,OAAO,MAAMyB,WAAW,SAASC,wBAAe,CAAC;IAC/CC,WAAWA,CAACC,OAAY,EAAE;AACxB,MAAA,KAAK,EAAE,CAAA;MACPC,aAAI,CACF,IAAI,EACJD,OAAO,EACP,IAAI,EACH9B,GAAQ,IAAKD,eAAe,CAACC,GAAG,EAAEC,IAAI,EAAEC,KAAK,CAAC,EAC/C8B,uBAAc,EACd,EAAE,EACFC,SACF,CAAC,CAAA;AACH,KAAA;GACD,CAAA;AACH,CAAA;AAEA,SAASC,YAAYA,CACnBjC,IAAO,EACPC,KAAiE,EACjE;AACA,EAAA,MAAMyB,WAAW,GAAGQ,6BAAoB,CACtC,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;IAC5D,OAAQ,CAAA,EAAEC,2BAAkB,CAACvC,IAAI,EAAE,gBAAgB,CAAC,CAACwC,QAAQ,CAC3DL,QAAQ,EACRlC,KAAK,EACL,EAAE,EACF,EACF,CAAE,CAAC,CAAA,CAAA;AACL,GACF,CAAC,CAAA;AAED,EAAA,OAAOyB,WAAW,CAAA;AACpB,CAAA;AAEO,MAAMe,eAAe,GAC1B,OAAOC,MAAM,KAAK,WAAW,GAAGT,YAAY,GAAGR;;;;"}
1
+ {"version":3,"file":"render-component.js","sources":["../../src/render-component.ts"],"sourcesContent":["import type { ComponentType, ComponentProps } from 'svelte'\nimport {\n SvelteComponent,\n claim_component,\n create_component,\n destroy_component,\n init,\n mount_component,\n noop,\n safe_not_equal,\n transition_in,\n transition_out,\n create_ssr_component,\n validate_component,\n} from 'svelte/internal'\n\nfunction create_fragment(ctx: any, Comp: any, props: any) {\n let c: any\n let current: any\n c = new Comp({ props, $$inline: true })\n\n return {\n c() {\n create_component(c.$$.fragment)\n },\n l(nodes: any) {\n claim_component(c.$$.fragment, nodes)\n },\n m(target: any, anchor: any) {\n // @ts-ignore\n mount_component(c, target, anchor)\n current = true\n },\n p: noop,\n i(local: any) {\n if (current) return\n transition_in(c.$$.fragment, local)\n current = true\n },\n o(local: any) {\n transition_out(c.$$.fragment, local)\n current = false\n },\n d(detaching: any) {\n destroy_component(c, detaching)\n },\n }\n}\n\nfunction renderClient<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n return class WrapperComp extends SvelteComponent {\n constructor(options: any) {\n super()\n init(\n this,\n options,\n null,\n (ctx: any) => create_fragment(ctx, Comp, props),\n safe_not_equal,\n {},\n undefined\n )\n }\n } as ComponentType\n}\n\nfunction renderServer<T>(\n Comp: T,\n props: T extends ComponentType<infer C> ? ComponentProps<C> : any\n) {\n const WrapperComp = create_ssr_component(\n ($$result: any, $$props: any, $$bindings: any, slots: any) => {\n return `${validate_component(Comp, 'TableComponent').$$render(\n $$result,\n props,\n {},\n {}\n )}`\n }\n )\n\n return WrapperComp as unknown as ComponentType\n}\n\nexport const renderComponent =\n typeof window === 'undefined' ? renderServer : renderClient\n"],"names":["create_fragment","ctx","Comp","props","c","current","$$inline","create_component","$$","fragment","l","nodes","claim_component","m","target","anchor","mount_component","p","noop","i","local","transition_in","o","transition_out","d","detaching","destroy_component","renderClient","WrapperComp","SvelteComponent","constructor","options","init","safe_not_equal","undefined","renderServer","create_ssr_component","$$result","$$props","$$bindings","slots","validate_component","$$render","renderComponent","window"],"mappings":";;;;;;;;;;;;;;AAgBA,SAASA,eAAeA,CAACC,GAAQ,EAAEC,IAAS,EAAEC,KAAU,EAAE;A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,CAAA;MACPC,aAAI,CACF,IAAI,EACJD,OAAO,EACP,IAAI,EACH9B,GAAQ,IAAKD,eAAe,CAACC,GAAG,EAAEC,IAAI,EAAEC,KAAK,CAAC,EAC/C8B,uBAAc,EACd,EAAE,EACFC,SACF,CAAC,CAAA;AACH,KAAA;GACD,CAAA;AACH,CAAA;AAEA,SAASC,YAAYA,CACnBjC,IAAO,EACPC,KAAiE,EACjE;AACA,EAAA,MAAMyB,WAAW,GAAGQ,6BAAoB,CACtC,CAACC,QAAa,EAAEC,OAAY,EAAEC,UAAe,EAAEC,KAAU,KAAK;IAC5D,OAAO,CAAA,EAAGC,2BAAkB,CAACvC,IAAI,EAAE,gBAAgB,CAAC,CAACwC,QAAQ,CAC3DL,QAAQ,EACRlC,KAAK,EACL,EAAE,EACF,EACF,CAAC,CAAE,CAAA,CAAA;AACL,GACF,CAAC,CAAA;AAED,EAAA,OAAOyB,WAAW,CAAA;AACpB,CAAA;AAEO,MAAMe,eAAe,GAC1B,OAAOC,MAAM,KAAK,WAAW,GAAGT,YAAY,GAAGR;;;;"}
@@ -2018,13 +2018,13 @@
2018
2018
  return isTop ? 'top' : isBottom ? 'bottom' : false;
2019
2019
  };
2020
2020
  row.getPinnedIndex = () => {
2021
- var _table$_getPinnedRows, _visiblePinnedRowIds$;
2021
+ var _ref4, _visiblePinnedRowIds$;
2022
2022
  const position = row.getIsPinned();
2023
2023
  if (!position) return -1;
2024
- const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position)) == null ? void 0 : _table$_getPinnedRows.map(_ref4 => {
2024
+ const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
2025
2025
  let {
2026
2026
  id
2027
- } = _ref4;
2027
+ } = _ref5;
2028
2028
  return id;
2029
2029
  });
2030
2030
  return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
@@ -2045,7 +2045,7 @@
2045
2045
  }
2046
2046
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
2047
2047
  };
2048
- table._getPinnedRows = memo(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
2048
+ table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
2049
2049
  var _table$options$keepPi;
2050
2050
  const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
2051
2051
  //get all rows that are pinned even if they would not be otherwise visible
@@ -2060,9 +2060,9 @@
2060
2060
  ...d,
2061
2061
  position
2062
2062
  }));
2063
- }, getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
2064
- table.getTopRows = () => table._getPinnedRows('top');
2065
- table.getBottomRows = () => table._getPinnedRows('bottom');
2063
+ };
2064
+ table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));
2065
+ table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));
2066
2066
  table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
2067
2067
  const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
2068
2068
  return allRows.filter(d => !topAndBottom.has(d.id));
@@ -3532,7 +3532,7 @@
3532
3532
  }, getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () => table._autoResetPageIndex()));
3533
3533
  }
3534
3534
 
3535
- /* src/placeholder.svelte generated by Svelte v4.2.15 */
3535
+ /* src/placeholder.svelte generated by Svelte v4.2.18 */
3536
3536
 
3537
3537
  function create_fragment$1(ctx) {
3538
3538
  let t;