@tanstack/react-table 8.19.1 → 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.
@@ -2037,13 +2037,13 @@
2037
2037
  return isTop ? 'top' : isBottom ? 'bottom' : false;
2038
2038
  };
2039
2039
  row.getPinnedIndex = () => {
2040
- var _table$_getPinnedRows, _visiblePinnedRowIds$;
2040
+ var _ref4, _visiblePinnedRowIds$;
2041
2041
  const position = row.getIsPinned();
2042
2042
  if (!position) return -1;
2043
- const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position)) == null ? void 0 : _table$_getPinnedRows.map(_ref4 => {
2043
+ const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
2044
2044
  let {
2045
2045
  id
2046
- } = _ref4;
2046
+ } = _ref5;
2047
2047
  return id;
2048
2048
  });
2049
2049
  return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
@@ -2064,7 +2064,7 @@
2064
2064
  }
2065
2065
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
2066
2066
  };
2067
- table._getPinnedRows = memo(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
2067
+ table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
2068
2068
  var _table$options$keepPi;
2069
2069
  const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
2070
2070
  //get all rows that are pinned even if they would not be otherwise visible
@@ -2079,9 +2079,9 @@
2079
2079
  ...d,
2080
2080
  position
2081
2081
  }));
2082
- }, getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
2083
- table.getTopRows = () => table._getPinnedRows('top');
2084
- table.getBottomRows = () => table._getPinnedRows('bottom');
2082
+ };
2083
+ table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));
2084
+ table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));
2085
2085
  table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
2086
2086
  const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
2087
2087
  return allRows.filter(d => !topAndBottom.has(d.id));