@tanstack/table-core 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.
@@ -2003,13 +2003,13 @@ const RowPinning = {
2003
2003
  return isTop ? 'top' : isBottom ? 'bottom' : false;
2004
2004
  };
2005
2005
  row.getPinnedIndex = () => {
2006
- var _table$_getPinnedRows, _visiblePinnedRowIds$;
2006
+ var _ref4, _visiblePinnedRowIds$;
2007
2007
  const position = row.getIsPinned();
2008
2008
  if (!position) return -1;
2009
- const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position)) == null ? void 0 : _table$_getPinnedRows.map(_ref4 => {
2009
+ const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
2010
2010
  let {
2011
2011
  id
2012
- } = _ref4;
2012
+ } = _ref5;
2013
2013
  return id;
2014
2014
  });
2015
2015
  return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
@@ -2030,7 +2030,7 @@ const RowPinning = {
2030
2030
  }
2031
2031
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
2032
2032
  };
2033
- table._getPinnedRows = memo(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
2033
+ table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
2034
2034
  var _table$options$keepPi;
2035
2035
  const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
2036
2036
  //get all rows that are pinned even if they would not be otherwise visible
@@ -2045,9 +2045,9 @@ const RowPinning = {
2045
2045
  ...d,
2046
2046
  position
2047
2047
  }));
2048
- }, getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
2049
- table.getTopRows = () => table._getPinnedRows('top');
2050
- table.getBottomRows = () => table._getPinnedRows('bottom');
2048
+ };
2049
+ table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));
2050
+ table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));
2051
2051
  table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
2052
2052
  const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
2053
2053
  return allRows.filter(d => !topAndBottom.has(d.id));