@tanstack/svelte-table 8.0.0-alpha.78 → 8.0.0-alpha.82
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 +5 -0
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +33 -15
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +29 -16
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +38 -38
- package/build/umd/index.development.js +33 -15
- 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
|
@@ -128,10 +128,12 @@ exports.Pinning = index.Pinning;
|
|
|
128
128
|
exports.RowSelection = index.RowSelection;
|
|
129
129
|
exports.Sorting = index.Sorting;
|
|
130
130
|
exports.Visibility = index.Visibility;
|
|
131
|
+
exports.aggregationFns = index.aggregationFns;
|
|
131
132
|
exports.buildHeaderGroups = index.buildHeaderGroups;
|
|
132
133
|
exports.createTableFactory = index.createTableFactory;
|
|
133
134
|
exports.defaultColumnSizing = index.defaultColumnSizing;
|
|
134
135
|
exports.expandRows = index.expandRows;
|
|
136
|
+
exports.filterFns = index.filterFns;
|
|
135
137
|
exports.flattenBy = index.flattenBy;
|
|
136
138
|
exports.functionalUpdate = index.functionalUpdate;
|
|
137
139
|
exports.getCoreRowModel = index.getCoreRowModel;
|
|
@@ -146,12 +148,15 @@ exports.getSortedRowModel = index.getSortedRowModel;
|
|
|
146
148
|
exports.isFunction = index.isFunction;
|
|
147
149
|
exports.isRowSelected = index.isRowSelected;
|
|
148
150
|
exports.makeStateUpdater = index.makeStateUpdater;
|
|
151
|
+
exports.mean = index.mean;
|
|
149
152
|
exports.memo = index.memo;
|
|
150
153
|
exports.noop = index.noop;
|
|
151
154
|
exports.orderColumns = index.orderColumns;
|
|
152
155
|
exports.passiveEventSupported = index.passiveEventSupported;
|
|
156
|
+
exports.reSplitAlphaNumeric = index.reSplitAlphaNumeric;
|
|
153
157
|
exports.selectRowsFn = index.selectRowsFn;
|
|
154
158
|
exports.shouldAutoRemoveFilter = index.shouldAutoRemoveFilter;
|
|
159
|
+
exports.sortingFns = index.sortingFns;
|
|
155
160
|
exports.renderComponent = renderComponent.renderComponent;
|
|
156
161
|
exports.createTable = createTable;
|
|
157
162
|
exports.createTableInstance = createTableInstance;
|
|
@@ -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} from '@tanstack/table-core'\nimport Placeholder from './placeholder.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 return component.prototype instanceof SvelteComponent\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<\n PartialKeys<\n Omit<TableOptions<TGenerics>, 'render'>,\n 'state' | 'onStateChange'\n >\n >\n) {\n let optionsStore: Readable<\n PartialKeys<\n Omit<TableOptions<TGenerics>, 'render'>,\n 'state' | 'onStateChange'\n >\n >\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptions<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\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","prototype","SvelteComponent","isSvelteComponent","document","wrapInPlaceholder","content","renderComponent","Placeholder","props","result","createTable","createTableFactory","createTableInstance","table","options","optionsStore","readable","resolvedOptions","state","onStateChange","get","instance","coreCreateTableInstance","stateStore","writable","initialState","stateOptionsStore","derived","s","instanceReadable","start","set","unsubscribe","subscribe","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,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,UAH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aAAa,EAAEiB,OAAO,IAAI;AACxB,YAAIA,IAAAA,OAAO,YAAYC,QAAvB,EAAiC;AAC/Bd,cAAAA,UAAU,CAACe,MAAX,CAAkBF,OAAlB,CAAA,CAAA;AACD,aAFD,MAEO;AACLb,cAAAA,UAAU,CAACQ,GAAX,CAAeK,OAAf,CAAA,CAAA;AACD,aAAA;;AAEDnB,YAAAA,eAAe,CAACE,aAAhB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAF,eAAe,CAACE,aAAhB,CAAgCiB,OAAhC,CAAA,CAAA;AACD,WAAA;AAdI,SAAP,CAAA;AAgBD,OAjBD,EADoE;;AAqBpEL,MAAAA,GAAG,CAACV,QAAD,CAAH,CAAA;AACD,KAtBmB,CAApB,CAAA;AAwBA,IAAO,OAAA,SAASkB,IAAT,GAAgB;AACrBP,MAAAA,WAAW,EAAA,CAAA;AACZ,KAFD,CAAA;AAGD,GA5BgC,CAAjC,CAAA;AA8BA,EAAA,OAAOH,gBAAP,CAAA;AACD
|
|
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} from '@tanstack/table-core'\nimport Placeholder from './placeholder.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 return component.prototype instanceof SvelteComponent\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<\n PartialKeys<\n Omit<TableOptions<TGenerics>, 'render'>,\n 'state' | 'onStateChange'\n >\n >\n) {\n let optionsStore: Readable<\n PartialKeys<\n Omit<TableOptions<TGenerics>, 'render'>,\n 'state' | 'onStateChange'\n >\n >\n\n if ('subscribe' in options) {\n optionsStore = options\n } else {\n optionsStore = readable(options)\n }\n\n let resolvedOptions: TableOptions<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\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","prototype","SvelteComponent","isSvelteComponent","document","wrapInPlaceholder","content","renderComponent","Placeholder","props","result","createTable","createTableFactory","createTableInstance","table","options","optionsStore","readable","resolvedOptions","state","onStateChange","get","instance","coreCreateTableInstance","stateStore","writable","initialState","stateOptionsStore","derived","s","instanceReadable","start","set","unsubscribe","subscribe","setOptions","prev","updater","Function","update","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,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;AAC/C,EAAA,OAAOA,SAAS,CAACI,SAAV,YAA+BC,wBAAtC,CAAA;AACD,CAAA;;AAED,SAASC,iBAAT,CAA2BN,SAA3B,EAA2C;AACzC,EAAA,IAAI,OAAOO,QAAP,KAAoB,WAAxB,EAAqC;AACnC,IAAOR,OAAAA,uBAAuB,CAACC,SAAD,CAA9B,CAAA;AACD,GAFD,MAEO;AACL,IAAOG,OAAAA,uBAAuB,CAACH,SAAD,CAA9B,CAAA;AACD,GAAA;AACF,CAAA;;AAED,SAASQ,iBAAT,CAA2BC,OAA3B,EAAyC;AACvC,EAAOC,OAAAA,+BAAe,CAACC,sBAAD,EAAc;AAAEF,IAAAA,OAAAA;AAAF,GAAd,CAAtB,CAAA;AACD,CAAA;;AAEM,SAASP,MAAT,CAAgBF,SAAhB,EAAgCY,KAAhC,EAA4C;AACjD,EAAA,IAAI,CAACZ,SAAL,EAAgB,OAAO,IAAP,CAAA;;AAEhB,EAAA,IAAIM,iBAAiB,CAACN,SAAD,CAArB,EAAkC;AAChC,IAAA,OAAOU,+BAAe,CAACV,SAAD,EAAYY,KAAZ,CAAtB,CAAA;AACD,GAAA;;AAED,EAAA,IAAI,OAAOZ,SAAP,KAAqB,UAAzB,EAAqC;AACnC,IAAA,MAAMa,MAAM,GAAGb,SAAS,CAACY,KAAD,CAAxB,CAAA;;AAEA,IAAA,IAAIN,iBAAiB,CA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A;AAAA,MAAA,IAArB,CAACf,KAAD,EAAQJ,OAAR,CAAqB,GAAA,IAAA,CAAA;AACpEO,MAAAA,QAAQ,CAACa,UAAT,CAAoBC,IAAI,IAAI;AAC1B,QAAO,OAAA,EACL,GAAGA,IADE;AAEL,UAAA,GAAGrB,OAFE;AAGLI,UAAAA,KAAK,EAAE,EAAE,GAAGA,KAAL;AAAY,YAAA,GAAGJ,OAAO,CAACI,KAAAA;AAAvB,WAHF;AAIL;AACA;AACAC,UAAAA,aAAa,EAAEiB,OAAO,IAAI;AACxB,YAAIA,IAAAA,OAAO,YAAYC,QAAvB,EAAiC;AAC/Bd,cAAAA,UAAU,CAACe,MAAX,CAAkBF,OAAlB,CAAA,CAAA;AACD,aAFD,MAEO;AACLb,cAAAA,UAAU,CAACQ,GAAX,CAAeK,OAAf,CAAA,CAAA;AACD,aAAA;;AAEDnB,YAAAA,eAAe,CAACE,aAAhB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAF,eAAe,CAACE,aAAhB,CAAgCiB,OAAhC,CAAA,CAAA;AACD,WAAA;AAdI,SAAP,CAAA;AAgBD,OAjBD,EADoE;;AAqBpEL,MAAAA,GAAG,CAACV,QAAD,CAAH,CAAA;AACD,KAtBmB,CAApB,CAAA;AAwBA,IAAO,OAAA,SAASkB,IAAT,GAAgB;AACrBP,MAAAA,WAAW,EAAA,CAAA;AACZ,KAFD,CAAA;AAGD,GA5BgC,CAAjC,CAAA;AA8BA,EAAA,OAAOH,gBAAP,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -300,7 +300,7 @@ const Rows = {
|
|
|
300
300
|
const column = instance.getColumn(columnId);
|
|
301
301
|
|
|
302
302
|
if (!column.accessorFn) {
|
|
303
|
-
|
|
303
|
+
return undefined;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
row.valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
|
|
@@ -543,7 +543,7 @@ const ColumnSizing = {
|
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
-
const startSize =
|
|
546
|
+
const startSize = header.getSize();
|
|
547
547
|
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
548
548
|
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
549
549
|
|
|
@@ -1097,7 +1097,8 @@ const Filters = {
|
|
|
1097
1097
|
},
|
|
1098
1098
|
createRow: (row, instance) => {
|
|
1099
1099
|
return {
|
|
1100
|
-
|
|
1100
|
+
columnFilters: {},
|
|
1101
|
+
columnFiltersMeta: {},
|
|
1101
1102
|
subRowsByFacetId: {}
|
|
1102
1103
|
};
|
|
1103
1104
|
},
|
|
@@ -2339,7 +2340,7 @@ const Sorting = {
|
|
|
2339
2340
|
createColumn: (column, instance) => {
|
|
2340
2341
|
return {
|
|
2341
2342
|
getAutoSortingFn: () => {
|
|
2342
|
-
const firstRows = instance.getFilteredRowModel().flatRows.slice(
|
|
2343
|
+
const firstRows = instance.getFilteredRowModel().flatRows.slice(10);
|
|
2343
2344
|
let isString = false;
|
|
2344
2345
|
|
|
2345
2346
|
for (const row of firstRows) {
|
|
@@ -3187,6 +3188,7 @@ function createTable(_, __, options) {
|
|
|
3187
3188
|
setRowType: () => table,
|
|
3188
3189
|
setTableMetaType: () => table,
|
|
3189
3190
|
setColumnMetaType: () => table,
|
|
3191
|
+
setFilterMetaType: () => table,
|
|
3190
3192
|
setOptions: newOptions => createTable(_, __, { ...options,
|
|
3191
3193
|
...newOptions
|
|
3192
3194
|
}),
|
|
@@ -3314,7 +3316,7 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
|
|
|
3314
3316
|
|
|
3315
3317
|
if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
|
|
3316
3318
|
newRow = instance.createRow(row.id, row.original, row.index, row.depth);
|
|
3317
|
-
newRow.
|
|
3319
|
+
newRow.columnFilters = row.columnFilters;
|
|
3318
3320
|
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
3319
3321
|
|
|
3320
3322
|
if (!newRow.subRows.length) {
|
|
@@ -3387,6 +3389,11 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
|
|
|
3387
3389
|
function getFilteredRowModel() {
|
|
3388
3390
|
return instance => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
|
|
3389
3391
|
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
3392
|
+
for (let i = 0; i < rowModel.flatRows.length; i++) {
|
|
3393
|
+
rowModel.flatRows[i].columnFilters = {};
|
|
3394
|
+
rowModel.flatRows[i].columnFiltersMeta = {};
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3390
3397
|
return rowModel;
|
|
3391
3398
|
}
|
|
3392
3399
|
|
|
@@ -3441,28 +3448,34 @@ function getFilteredRowModel() {
|
|
|
3441
3448
|
|
|
3442
3449
|
for (let j = 0; j < rowModel.flatRows.length; j++) {
|
|
3443
3450
|
const row = rowModel.flatRows[j];
|
|
3444
|
-
row.
|
|
3451
|
+
row.columnFilters = {};
|
|
3445
3452
|
|
|
3446
3453
|
if (resolvedColumnFilters.length) {
|
|
3447
3454
|
for (let i = 0; i < resolvedColumnFilters.length; i++) {
|
|
3448
|
-
currentColumnFilter = resolvedColumnFilters[i];
|
|
3455
|
+
currentColumnFilter = resolvedColumnFilters[i];
|
|
3456
|
+
const id = currentColumnFilter.id; // Tag the row with the column filter state
|
|
3449
3457
|
|
|
3450
|
-
row.
|
|
3458
|
+
row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, filterMeta => {
|
|
3459
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
3460
|
+
});
|
|
3451
3461
|
}
|
|
3452
3462
|
}
|
|
3453
3463
|
|
|
3454
3464
|
if (resolvedGlobalFilters.length) {
|
|
3455
3465
|
for (let i = 0; i < resolvedGlobalFilters.length; i++) {
|
|
3456
|
-
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
3466
|
+
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
3467
|
+
const id = currentGlobalFilter.id; // Tag the row with the first truthy global filter state
|
|
3457
3468
|
|
|
3458
|
-
if (currentGlobalFilter.filterFn(row,
|
|
3459
|
-
row.
|
|
3469
|
+
if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, filterMeta => {
|
|
3470
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
3471
|
+
})) {
|
|
3472
|
+
row.columnFilters.__global__ = true;
|
|
3460
3473
|
break;
|
|
3461
3474
|
}
|
|
3462
3475
|
}
|
|
3463
3476
|
|
|
3464
|
-
if (row.
|
|
3465
|
-
row.
|
|
3477
|
+
if (row.columnFilters.__global__ !== true) {
|
|
3478
|
+
row.columnFilters.__global__ = false;
|
|
3466
3479
|
}
|
|
3467
3480
|
}
|
|
3468
3481
|
}
|
|
@@ -3470,7 +3483,7 @@ function getFilteredRowModel() {
|
|
|
3470
3483
|
const filterRowsImpl = row => {
|
|
3471
3484
|
// Horizontally filter rows through each column
|
|
3472
3485
|
for (let i = 0; i < filterableIds.length; i++) {
|
|
3473
|
-
if (row.
|
|
3486
|
+
if (row.columnFilters[filterableIds[i]] === false) {
|
|
3474
3487
|
return false;
|
|
3475
3488
|
}
|
|
3476
3489
|
}
|
|
@@ -3504,7 +3517,7 @@ function getFacetedRowModel() {
|
|
|
3504
3517
|
const filterRowsImpl = row => {
|
|
3505
3518
|
// Horizontally filter rows through each column
|
|
3506
3519
|
for (let i = 0; i < filterableIds.length; i++) {
|
|
3507
|
-
if (row.
|
|
3520
|
+
if (row.columnFilters[filterableIds[i]] === false) {
|
|
3508
3521
|
return false;
|
|
3509
3522
|
}
|
|
3510
3523
|
}
|
|
@@ -3923,11 +3936,13 @@ exports.Pinning = Pinning;
|
|
|
3923
3936
|
exports.RowSelection = RowSelection;
|
|
3924
3937
|
exports.Sorting = Sorting;
|
|
3925
3938
|
exports.Visibility = Visibility;
|
|
3939
|
+
exports.aggregationFns = aggregationFns;
|
|
3926
3940
|
exports.buildHeaderGroups = buildHeaderGroups;
|
|
3927
3941
|
exports.createTableFactory = createTableFactory;
|
|
3928
3942
|
exports.createTableInstance = createTableInstance;
|
|
3929
3943
|
exports.defaultColumnSizing = defaultColumnSizing;
|
|
3930
3944
|
exports.expandRows = expandRows;
|
|
3945
|
+
exports.filterFns = filterFns;
|
|
3931
3946
|
exports.flattenBy = flattenBy;
|
|
3932
3947
|
exports.functionalUpdate = functionalUpdate;
|
|
3933
3948
|
exports.getCoreRowModel = getCoreRowModel;
|
|
@@ -3942,10 +3957,13 @@ exports.getSortedRowModel = getSortedRowModel;
|
|
|
3942
3957
|
exports.isFunction = isFunction;
|
|
3943
3958
|
exports.isRowSelected = isRowSelected;
|
|
3944
3959
|
exports.makeStateUpdater = makeStateUpdater;
|
|
3960
|
+
exports.mean = mean;
|
|
3945
3961
|
exports.memo = memo;
|
|
3946
3962
|
exports.noop = noop;
|
|
3947
3963
|
exports.orderColumns = orderColumns;
|
|
3948
3964
|
exports.passiveEventSupported = passiveEventSupported;
|
|
3965
|
+
exports.reSplitAlphaNumeric = reSplitAlphaNumeric;
|
|
3949
3966
|
exports.selectRowsFn = selectRowsFn;
|
|
3950
3967
|
exports.shouldAutoRemoveFilter = shouldAutoRemoveFilter;
|
|
3968
|
+
exports.sortingFns = sortingFns;
|
|
3951
3969
|
//# sourceMappingURL=index.js.map
|