@tanstack/svelte-table 8.0.0-beta.7 → 8.0.3
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.map +1 -1
- package/build/cjs/svelte-table/src/render-component.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +41 -42
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +41 -42
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/umd/index.development.js +41 -42
- 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/build/stats-react.json +0 -205
- package/build/types/index.d.ts +0 -11
- package/build/types/placeholder.d.ts +0 -3
- package/build/types/render-component.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/index.ts"],"sourcesContent":["import {\n createTableFactory,\n createTableInstance as coreCreateTableInstance,\n PartialKeys,\n Table,\n TableGenerics,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\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 render(component: any, props: any) {\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\n if (isSvelteComponent(result)) {\n return result\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\nexport const createTable = createTableFactory({ render })\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createTableInstance<TGenerics extends TableGenerics>(\n table: Table<TGenerics>,\n options: ReadableOrVal<TableOptions<TGenerics>>\n) {\n let optionsStore: Readable<TableOptions<TGenerics>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let instance = coreCreateTableInstance(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ instance.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const instanceReadable = readable(instance, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n instance.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 instance\n set(instance)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return instanceReadable\n}\n"],"names":["isSvelteServerComponent","component","$$render","render","isSvelteClientComponent","isHMR","window","prototype","SvelteComponent","name","startsWith","endsWith","isSvelteComponent","document","wrapInPlaceholder","content","renderComponent","Placeholder","props","result","createTable","createTableFactory","createTableInstance","table","options","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","instance","coreCreateTableInstance","stateStore","writable","initialState","stateOptionsStore","derived","s","instanceReadable","start","set","unsubscribe","subscribe","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,SAASA,uBAAT,CAAiCC,SAAjC,EAAiD;AAC/C,EAAA,OACE,OAAOA,SAAP,KAAqB,QAArB,IACA,OAAOA,SAAS,CAACC,QAAjB,KAA8B,UAD9B,IAEA,OAAOD,SAAS,CAACE,MAAjB,KAA4B,UAH9B,CAAA;AAKD,CAAA;;AAED,SAASC,uBAAT,CAAiCH,SAAjC,EAAiD;AAAA,EAAA,IAAA,eAAA,EAAA,gBAAA,CAAA;;AAC/C,EAAA,IAAII,KAAK,IAAG,cAAkBC,IAAAA,MAArB,CAAT,CAAA;AAEA,EAAA,OACEL,SAAS,CAACM,SAAV,YAA+BC,wBAA/B,IACCH,KAAK,KAAA,CAAA,eAAA,GACJJ,SAAS,CAACQ,IADN,KAAA,IAAA,GAAA,KAAA,CAAA,GACJ,eAAgBC,CAAAA,UAAhB,CAA2B,QAA3B,CADI,CAAL,KAECT,CAAAA,gBAAAA,GAAAA,SAAS,CAACQ,IAFX,KAEC,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAgBE,QAAhB,CAAyB,GAAzB,CAFD,CAFH,CAAA;AAMD,CAAA;;AAED,SAASC,iBAAT,CAA2BX,SAA3B,EAA2C;AACzC,EAAA,IAAI,OAAOY,QAAP,KAAoB,WAAxB,EAAqC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/index.ts"],"sourcesContent":["import {\n createTableFactory,\n createTableInstance as coreCreateTableInstance,\n PartialKeys,\n Table,\n TableGenerics,\n TableOptions,\n TableOptionsResolved,\n} from '@tanstack/table-core'\nimport Placeholder from './placeholder'\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 render(component: any, props: any) {\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\n if (isSvelteComponent(result)) {\n return result\n }\n\n return wrapInPlaceholder(result)\n }\n\n return wrapInPlaceholder(component)\n}\n\nexport const createTable = createTableFactory({ render })\n\ntype ReadableOrVal<T> = T | Readable<T>\n\nexport function createTableInstance<TGenerics extends TableGenerics>(\n table: Table<TGenerics>,\n options: ReadableOrVal<TableOptions<TGenerics>>\n) {\n let optionsStore: Readable<TableOptions<TGenerics>>\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptionsResolved<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\n renderFallbackValue: null,\n ...get(optionsStore),\n }\n\n let instance = coreCreateTableInstance(resolvedOptions)\n\n let stateStore = writable(/** @type {number} */ instance.initialState)\n // combine stores\n let stateOptionsStore = derived([stateStore, optionsStore], s => s)\n const instanceReadable = readable(instance, function start(set) {\n const unsubscribe = stateOptionsStore.subscribe(([state, options]) => {\n instance.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 instance\n set(instance)\n })\n\n return function stop() {\n unsubscribe()\n }\n })\n\n return instanceReadable\n}\n"],"names":["isSvelteServerComponent","component","$$render","render","isSvelteClientComponent","isHMR","window","prototype","SvelteComponent","name","startsWith","endsWith","isSvelteComponent","document","wrapInPlaceholder","content","renderComponent","Placeholder","props","result","createTable","createTableFactory","createTableInstance","table","options","optionsStore","readable","resolvedOptions","state","onStateChange","renderFallbackValue","get","instance","coreCreateTableInstance","stateStore","writable","initialState","stateOptionsStore","derived","s","instanceReadable","start","set","unsubscribe","subscribe","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,SAASA,uBAAT,CAAiCC,SAAjC,EAAiD;AAC/C,EAAA,OACE,OAAOA,SAAP,KAAqB,QAArB,IACA,OAAOA,SAAS,CAACC,QAAjB,KAA8B,UAD9B,IAEA,OAAOD,SAAS,CAACE,MAAjB,KAA4B,UAH9B,CAAA;AAKD,CAAA;;AAED,SAASC,uBAAT,CAAiCH,SAAjC,EAAiD;AAAA,EAAA,IAAA,eAAA,EAAA,gBAAA,CAAA;;AAC/C,EAAA,IAAII,KAAK,IAAG,cAAkBC,IAAAA,MAArB,CAAT,CAAA;AAEA,EAAA,OACEL,SAAS,CAACM,SAAV,YAA+BC,wBAA/B,IACCH,KAAK,KAAA,CAAA,eAAA,GACJJ,SAAS,CAACQ,IADN,KAAA,IAAA,GAAA,KAAA,CAAA,GACJ,eAAgBC,CAAAA,UAAhB,CAA2B,QAA3B,CADI,CAAL,KAECT,CAAAA,gBAAAA,GAAAA,SAAS,CAACQ,IAFX,KAEC,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAgBE,QAAhB,CAAyB,GAAzB,CAFD,CAFH,CAAA;AAMD,CAAA;;AAED,SAASC,iBAAT,CAA2BX,SAA3B,EAA2C;AACzC,EAAA,IAAI,OAAOY,QA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AAe,CAACE,aAAhB,CAAgCkB,OAAhC,CAAA,CAAA;AACD,WAAA;SAdH,CAAA;AAgBD,OAjBD,EADoE;;MAqBpEL,GAAG,CAACV,QAAD,CAAH,CAAA;AACD,KAtBmB,CAApB,CAAA;IAwBA,OAAO,SAASkB,IAAT,GAAgB;MACrBP,WAAW,EAAA,CAAA;KADb,CAAA;AAGD,GA5BgC,CAAjC,CAAA;AA8BA,EAAA,OAAOH,gBAAP,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-component.js","sources":["../../../../src/render-component.ts"],"sourcesContent":["import {\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(Comp: any, props: any): any {\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 }\n}\n\nfunction renderServer(Comp: any, props: any) {\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\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":";;;;;;;;;;;;;;;;AAeA,SAASA,eAAT,CAAyBC,GAAzB,EAAmCC,IAAnC,EAA8CC,KAA9C,EAA0D;AACxD,EAAA,IAAIC,CAAJ,CAAA;AACA,EAAA,IAAIC,OAAJ,CAAA;
|
|
1
|
+
{"version":3,"file":"render-component.js","sources":["../../../../src/render-component.ts"],"sourcesContent":["import {\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(Comp: any, props: any): any {\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 }\n}\n\nfunction renderServer(Comp: any, props: any) {\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\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":";;;;;;;;;;;;;;;;AAeA,SAASA,eAAT,CAAyBC,GAAzB,EAAmCC,IAAnC,EAA8CC,KAA9C,EAA0D;AACxD,EAAA,IAAIC,CAAJ,CAAA;AACA,EAAA,IAAIC,OAAJ,CAAA;EACAD,CAAC,GAAG,IAAIF,IAAJ,CAAS;IAAEC,KAAF;AAASG,IAAAA,QAAQ,EAAE,IAAA;AAAnB,GAAT,CAAJ,CAAA;EAEA,OAAO;AACLF,IAAAA,CAAC,GAAG;AACFG,MAAAA,yBAAgB,CAACH,CAAC,CAACI,EAAF,CAAKC,QAAN,CAAhB,CAAA;KAFG;;IAILC,CAAC,CAACC,KAAD,EAAa;MACZC,wBAAe,CAACR,CAAC,CAACI,EAAF,CAAKC,QAAN,EAAgBE,KAAhB,CAAf,CAAA;KALG;;AAOLE,IAAAA,CAAC,CAACC,MAAD,EAAcC,MAAd,EAA2B;AAC1B;AACAC,MAAAA,wBAAe,CAACZ,CAAD,EAAIU,MAAJ,EAAYC,MAAZ,CAAf,CAAA;AACAV,MAAAA,OAAO,GAAG,IAAV,CAAA;KAVG;;AAYLY,IAAAA,CAAC,EAAEC,aAZE;;IAaLC,CAAC,CAACC,KAAD,EAAa;AACZ,MAAA,IAAIf,OAAJ,EAAa,OAAA;MACbgB,sBAAa,CAACjB,CAAC,CAACI,EAAF,CAAKC,QAAN,EAAgBW,KAAhB,CAAb,CAAA;AACAf,MAAAA,OAAO,G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|
983
983
|
};
|
|
984
984
|
|
|
985
985
|
const includesString = (row, columnId, filterValue) => {
|
|
986
|
+
var _row$getValue;
|
|
987
|
+
|
|
986
988
|
const search = filterValue.toLowerCase();
|
|
987
|
-
return row.getValue(columnId).toLowerCase().includes(search);
|
|
989
|
+
return (_row$getValue = row.getValue(columnId)) == null ? void 0 : _row$getValue.toLowerCase().includes(search);
|
|
988
990
|
};
|
|
989
991
|
|
|
990
992
|
includesString.autoRemove = val => testFalsey(val);
|
|
991
993
|
|
|
992
994
|
const includesStringSensitive = (row, columnId, filterValue) => {
|
|
993
|
-
|
|
995
|
+
var _row$getValue2;
|
|
996
|
+
|
|
997
|
+
return (_row$getValue2 = row.getValue(columnId)) == null ? void 0 : _row$getValue2.includes(filterValue);
|
|
994
998
|
};
|
|
995
999
|
|
|
996
1000
|
includesStringSensitive.autoRemove = val => testFalsey(val);
|
|
997
1001
|
|
|
998
1002
|
const equalsString = (row, columnId, filterValue) => {
|
|
999
|
-
|
|
1003
|
+
var _row$getValue3;
|
|
1004
|
+
|
|
1005
|
+
return ((_row$getValue3 = row.getValue(columnId)) == null ? void 0 : _row$getValue3.toLowerCase()) === filterValue.toLowerCase();
|
|
1000
1006
|
};
|
|
1001
1007
|
|
|
1002
1008
|
equalsString.autoRemove = val => testFalsey(val);
|
|
1003
1009
|
|
|
1004
1010
|
const arrIncludes = (row, columnId, filterValue) => {
|
|
1005
|
-
|
|
1011
|
+
var _row$getValue4;
|
|
1012
|
+
|
|
1013
|
+
return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
|
|
1006
1014
|
};
|
|
1007
1015
|
|
|
1008
1016
|
arrIncludes.autoRemove = val => testFalsey(val) || !(val != null && val.length);
|
|
1009
1017
|
|
|
1010
1018
|
const arrIncludesAll = (row, columnId, filterValue) => {
|
|
1011
|
-
return !filterValue.some(val =>
|
|
1019
|
+
return !filterValue.some(val => {
|
|
1020
|
+
var _row$getValue5;
|
|
1021
|
+
|
|
1022
|
+
return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
|
|
1023
|
+
});
|
|
1012
1024
|
};
|
|
1013
1025
|
|
|
1014
1026
|
arrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length);
|
|
1015
1027
|
|
|
1016
1028
|
const arrIncludesSome = (row, columnId, filterValue) => {
|
|
1017
|
-
return filterValue.some(val =>
|
|
1029
|
+
return filterValue.some(val => {
|
|
1030
|
+
var _row$getValue6;
|
|
1031
|
+
|
|
1032
|
+
return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
|
|
1033
|
+
});
|
|
1018
1034
|
};
|
|
1019
1035
|
|
|
1020
1036
|
arrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length);
|
|
@@ -1319,7 +1335,10 @@ function shouldAutoRemoveFilter(filterFn, value, column) {
|
|
|
1319
1335
|
const sum = (columnId, _leafRows, childRows) => {
|
|
1320
1336
|
// It's faster to just add the aggregations together instead of
|
|
1321
1337
|
// process leaf nodes individually
|
|
1322
|
-
return childRows.reduce((sum, next) =>
|
|
1338
|
+
return childRows.reduce((sum, next) => {
|
|
1339
|
+
const nextValue = next.getValue(columnId);
|
|
1340
|
+
return sum + (typeof nextValue === 'number' ? nextValue : 0);
|
|
1341
|
+
}, 0);
|
|
1323
1342
|
};
|
|
1324
1343
|
|
|
1325
1344
|
const min = (columnId, _leafRows, childRows) => {
|
|
@@ -1699,7 +1718,7 @@ const Pagination = {
|
|
|
1699
1718
|
setPageIndex: updater => {
|
|
1700
1719
|
instance.setPagination(old => {
|
|
1701
1720
|
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1702
|
-
const maxPageIndex = typeof
|
|
1721
|
+
const maxPageIndex = typeof instance.options.pageCount === 'undefined' || instance.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : instance.options.pageCount - 1;
|
|
1703
1722
|
pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
|
|
1704
1723
|
return { ...old,
|
|
1705
1724
|
pageIndex
|
|
@@ -1728,9 +1747,9 @@ const Pagination = {
|
|
|
1728
1747
|
});
|
|
1729
1748
|
},
|
|
1730
1749
|
setPageCount: updater => instance.setPagination(old => {
|
|
1731
|
-
var
|
|
1750
|
+
var _instance$options$pag;
|
|
1732
1751
|
|
|
1733
|
-
let newPageCount = functionalUpdate(updater, (
|
|
1752
|
+
let newPageCount = functionalUpdate(updater, (_instance$options$pag = instance.options.pageCount) != null ? _instance$options$pag : -1);
|
|
1734
1753
|
|
|
1735
1754
|
if (typeof newPageCount === 'number') {
|
|
1736
1755
|
newPageCount = Math.max(-1, newPageCount);
|
|
@@ -1740,7 +1759,7 @@ const Pagination = {
|
|
|
1740
1759
|
pageCount: newPageCount
|
|
1741
1760
|
};
|
|
1742
1761
|
}),
|
|
1743
|
-
getPageOptions: memo(() => [instance.
|
|
1762
|
+
getPageOptions: memo(() => [instance.getPageCount()], pageCount => {
|
|
1744
1763
|
let pageOptions = [];
|
|
1745
1764
|
|
|
1746
1765
|
if (pageCount && pageCount > 0) {
|
|
@@ -1794,15 +1813,9 @@ const Pagination = {
|
|
|
1794
1813
|
return instance._getPaginationRowModel();
|
|
1795
1814
|
},
|
|
1796
1815
|
getPageCount: () => {
|
|
1797
|
-
|
|
1798
|
-
pageCount
|
|
1799
|
-
} = instance.getState().pagination;
|
|
1816
|
+
var _instance$options$pag2;
|
|
1800
1817
|
|
|
1801
|
-
|
|
1802
|
-
return pageCount;
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
return Math.ceil(instance.getPrePaginationRowModel().rows.length / instance.getState().pagination.pageSize);
|
|
1818
|
+
return (_instance$options$pag2 = instance.options.pageCount) != null ? _instance$options$pag2 : Math.ceil(instance.getPrePaginationRowModel().rows.length / instance.getState().pagination.pageSize);
|
|
1806
1819
|
}
|
|
1807
1820
|
};
|
|
1808
1821
|
}
|
|
@@ -2298,9 +2311,6 @@ function selectRowsFn(instance, rowModel) {
|
|
|
2298
2311
|
const newSelectedRowsById = {}; // Filters top level and nested rows
|
|
2299
2312
|
|
|
2300
2313
|
const recurseRows = function (rows, depth) {
|
|
2301
|
-
if (depth === void 0) {
|
|
2302
|
-
depth = 0;
|
|
2303
|
-
}
|
|
2304
2314
|
|
|
2305
2315
|
return rows.map(row => {
|
|
2306
2316
|
var _row$subRows2;
|
|
@@ -2314,7 +2324,7 @@ function selectRowsFn(instance, rowModel) {
|
|
|
2314
2324
|
|
|
2315
2325
|
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
|
|
2316
2326
|
row = { ...row,
|
|
2317
|
-
subRows: recurseRows(row.subRows
|
|
2327
|
+
subRows: recurseRows(row.subRows)
|
|
2318
2328
|
};
|
|
2319
2329
|
}
|
|
2320
2330
|
|
|
@@ -3237,25 +3247,20 @@ function filterRows(rows, filterRowImpl, instance) {
|
|
|
3237
3247
|
function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
|
|
3238
3248
|
const newFilteredFlatRows = [];
|
|
3239
3249
|
const newFilteredRowsById = {};
|
|
3240
|
-
let row;
|
|
3241
|
-
let newRow;
|
|
3242
3250
|
|
|
3243
3251
|
const recurseFilterRows = function (rowsToFilter, depth) {
|
|
3244
|
-
if (depth === void 0) {
|
|
3245
|
-
depth = 0;
|
|
3246
|
-
}
|
|
3247
3252
|
|
|
3248
3253
|
const rows = []; // Filter from children up first
|
|
3249
3254
|
|
|
3250
3255
|
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
3251
3256
|
var _row$subRows;
|
|
3252
3257
|
|
|
3253
|
-
row = rowsToFilter[i];
|
|
3258
|
+
let row = rowsToFilter[i];
|
|
3254
3259
|
|
|
3255
3260
|
if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
|
|
3256
|
-
newRow = createRow(instance, row.id, row.original, row.index, row.depth);
|
|
3261
|
+
const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
|
|
3257
3262
|
newRow.columnFilters = row.columnFilters;
|
|
3258
|
-
newRow.subRows = recurseFilterRows(row.subRows
|
|
3263
|
+
newRow.subRows = recurseFilterRows(row.subRows);
|
|
3259
3264
|
|
|
3260
3265
|
if (!newRow.subRows.length) {
|
|
3261
3266
|
continue;
|
|
@@ -3282,29 +3287,23 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
|
|
|
3282
3287
|
}
|
|
3283
3288
|
function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
|
|
3284
3289
|
const newFilteredFlatRows = [];
|
|
3285
|
-
const newFilteredRowsById = {};
|
|
3286
|
-
let rows;
|
|
3287
|
-
let row;
|
|
3288
|
-
let newRow; // Filters top level and nested rows
|
|
3290
|
+
const newFilteredRowsById = {}; // Filters top level and nested rows
|
|
3289
3291
|
|
|
3290
3292
|
const recurseFilterRows = function (rowsToFilter, depth) {
|
|
3291
|
-
if (depth === void 0) {
|
|
3292
|
-
depth = 0;
|
|
3293
|
-
}
|
|
3294
3293
|
|
|
3295
3294
|
// Filter from parents downward first
|
|
3296
|
-
rows = []; // Apply the filter to any subRows
|
|
3295
|
+
const rows = []; // Apply the filter to any subRows
|
|
3297
3296
|
|
|
3298
3297
|
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
3299
|
-
row = rowsToFilter[i];
|
|
3298
|
+
let row = rowsToFilter[i];
|
|
3300
3299
|
const pass = filterRow(row);
|
|
3301
3300
|
|
|
3302
3301
|
if (pass) {
|
|
3303
3302
|
var _row$subRows2;
|
|
3304
3303
|
|
|
3305
3304
|
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
|
|
3306
|
-
newRow = createRow(instance, row.id, row.original, row.index, row.depth);
|
|
3307
|
-
newRow.subRows = recurseFilterRows(row.subRows
|
|
3305
|
+
const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
|
|
3306
|
+
newRow.subRows = recurseFilterRows(row.subRows);
|
|
3308
3307
|
row = newRow;
|
|
3309
3308
|
}
|
|
3310
3309
|
|