@tanstack/svelte-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.
|
@@ -2018,13 +2018,13 @@
|
|
|
2018
2018
|
return isTop ? 'top' : isBottom ? 'bottom' : false;
|
|
2019
2019
|
};
|
|
2020
2020
|
row.getPinnedIndex = () => {
|
|
2021
|
-
var
|
|
2021
|
+
var _ref4, _visiblePinnedRowIds$;
|
|
2022
2022
|
const position = row.getIsPinned();
|
|
2023
2023
|
if (!position) return -1;
|
|
2024
|
-
const visiblePinnedRowIds = (
|
|
2024
|
+
const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
|
|
2025
2025
|
let {
|
|
2026
2026
|
id
|
|
2027
|
-
} =
|
|
2027
|
+
} = _ref5;
|
|
2028
2028
|
return id;
|
|
2029
2029
|
});
|
|
2030
2030
|
return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
|
|
@@ -2045,7 +2045,7 @@
|
|
|
2045
2045
|
}
|
|
2046
2046
|
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
2047
2047
|
};
|
|
2048
|
-
table._getPinnedRows =
|
|
2048
|
+
table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
|
|
2049
2049
|
var _table$options$keepPi;
|
|
2050
2050
|
const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
|
|
2051
2051
|
//get all rows that are pinned even if they would not be otherwise visible
|
|
@@ -2060,9 +2060,9 @@
|
|
|
2060
2060
|
...d,
|
|
2061
2061
|
position
|
|
2062
2062
|
}));
|
|
2063
|
-
}
|
|
2064
|
-
table.getTopRows = () => table._getPinnedRows('top');
|
|
2065
|
-
table.getBottomRows = () => table._getPinnedRows('bottom');
|
|
2063
|
+
};
|
|
2064
|
+
table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));
|
|
2065
|
+
table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));
|
|
2066
2066
|
table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
|
|
2067
2067
|
const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
|
|
2068
2068
|
return allRows.filter(d => !topAndBottom.has(d.id));
|