@tanstack/table-core 8.15.2 → 8.16.0
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/lib/features/ColumnGrouping.js +2 -2
- package/build/lib/features/ColumnGrouping.js.map +1 -1
- package/build/lib/features/RowSorting.d.ts +1 -1
- package/build/lib/features/RowSorting.js.map +1 -1
- package/build/lib/index.esm.js +7 -4
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +7 -4
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/utils/getSortedRowModel.js +5 -2
- package/build/lib/utils/getSortedRowModel.js.map +1 -1
- package/build/umd/index.development.js +7 -4
- 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 +1 -1
- package/src/features/ColumnGrouping.ts +3 -5
- package/src/features/RowSorting.ts +1 -1
- package/src/utils/getSortedRowModel.ts +7 -4
package/build/lib/index.mjs
CHANGED
|
@@ -940,8 +940,8 @@ const ColumnGrouping = {
|
|
|
940
940
|
});
|
|
941
941
|
};
|
|
942
942
|
column.getCanGroup = () => {
|
|
943
|
-
var
|
|
944
|
-
return (
|
|
943
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
944
|
+
return ((_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGrouping) != null ? _table$options$enable : true) && (!!column.accessorFn || !!column.columnDef.getGroupingValue);
|
|
945
945
|
};
|
|
946
946
|
column.getIsGrouped = () => {
|
|
947
947
|
var _table$getState$group;
|
|
@@ -3466,17 +3466,20 @@ function getSortedRowModel() {
|
|
|
3466
3466
|
var _sortEntry$desc;
|
|
3467
3467
|
const sortEntry = availableSorting[i];
|
|
3468
3468
|
const columnInfo = columnInfoById[sortEntry.id];
|
|
3469
|
+
const sortUndefined = columnInfo.sortUndefined;
|
|
3469
3470
|
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
3470
3471
|
let sortInt = 0;
|
|
3471
3472
|
|
|
3472
3473
|
// All sorting ints should always return in ascending order
|
|
3473
|
-
if (
|
|
3474
|
+
if (sortUndefined) {
|
|
3474
3475
|
const aValue = rowA.getValue(sortEntry.id);
|
|
3475
3476
|
const bValue = rowB.getValue(sortEntry.id);
|
|
3476
3477
|
const aUndefined = aValue === undefined;
|
|
3477
3478
|
const bUndefined = bValue === undefined;
|
|
3478
3479
|
if (aUndefined || bUndefined) {
|
|
3479
|
-
|
|
3480
|
+
if (sortUndefined === 'first') return aUndefined ? -1 : 1;
|
|
3481
|
+
if (sortUndefined === 'last') return aUndefined ? 1 : -1;
|
|
3482
|
+
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
|
|
3480
3483
|
}
|
|
3481
3484
|
}
|
|
3482
3485
|
if (sortInt === 0) {
|