@tanstack/react-table 8.15.3 → 8.17.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.
@@ -3499,17 +3499,20 @@
3499
3499
  var _sortEntry$desc;
3500
3500
  const sortEntry = availableSorting[i];
3501
3501
  const columnInfo = columnInfoById[sortEntry.id];
3502
+ const sortUndefined = columnInfo.sortUndefined;
3502
3503
  const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3503
3504
  let sortInt = 0;
3504
3505
 
3505
3506
  // All sorting ints should always return in ascending order
3506
- if (columnInfo.sortUndefined) {
3507
+ if (sortUndefined) {
3507
3508
  const aValue = rowA.getValue(sortEntry.id);
3508
3509
  const bValue = rowB.getValue(sortEntry.id);
3509
3510
  const aUndefined = aValue === undefined;
3510
3511
  const bUndefined = bValue === undefined;
3511
3512
  if (aUndefined || bUndefined) {
3512
- sortInt = aUndefined && bUndefined ? 0 : aUndefined ? columnInfo.sortUndefined : -columnInfo.sortUndefined;
3513
+ if (sortUndefined === 'first') return aUndefined ? -1 : 1;
3514
+ if (sortUndefined === 'last') return aUndefined ? 1 : -1;
3515
+ sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
3513
3516
  }
3514
3517
  }
3515
3518
  if (sortInt === 0) {