@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.
@@ -2008,13 +2008,13 @@
2008
2008
  return isTop ? 'top' : isBottom ? 'bottom' : false;
2009
2009
  };
2010
2010
  row.getPinnedIndex = () => {
2011
- var _table$_getPinnedRows, _visiblePinnedRowIds$;
2011
+ var _ref4, _visiblePinnedRowIds$;
2012
2012
  const position = row.getIsPinned();
2013
2013
  if (!position) return -1;
2014
- const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position)) == null ? void 0 : _table$_getPinnedRows.map(_ref4 => {
2014
+ const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
2015
2015
  let {
2016
2016
  id
2017
- } = _ref4;
2017
+ } = _ref5;
2018
2018
  return id;
2019
2019
  });
2020
2020
  return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
@@ -2035,7 +2035,7 @@
2035
2035
  }
2036
2036
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
2037
2037
  };
2038
- table._getPinnedRows = memo(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
2038
+ table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
2039
2039
  var _table$options$keepPi;
2040
2040
  const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
2041
2041
  //get all rows that are pinned even if they would not be otherwise visible
@@ -2050,9 +2050,9 @@
2050
2050
  ...d,
2051
2051
  position
2052
2052
  }));
2053
- }, getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
2054
- table.getTopRows = () => table._getPinnedRows('top');
2055
- table.getBottomRows = () => table._getPinnedRows('bottom');
2053
+ };
2054
+ table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));
2055
+ table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));
2056
2056
  table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
2057
2057
  const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
2058
2058
  return allRows.filter(d => !topAndBottom.has(d.id));