@agilant/toga-blox 1.0.181 → 1.0.183
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.
|
@@ -32,13 +32,14 @@ const TableRow = ({ row, prepareRow, activeIndex, activeRowColor = "bg-pink-100"
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
// Fix: Key is discarded from the spread obj, react still gets key just not from spread i.e. key={rowUuid}
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
// Safely get the row props object (call if available, else fallback to empty object)
|
|
36
|
+
const rawRowProps = row.getRowProps?.() ?? {};
|
|
37
|
+
// Clone the props into a plain object to strip out inherited properties (if any)
|
|
38
|
+
// Destructure 'key' into _ignoredKey to discard it (React doesn't allow spreading 'key')
|
|
39
|
+
// Collect all remaining props into 'safeRowProps' using the rest operator (...)
|
|
40
|
+
const { key: _ignoredKey, ...safeRowProps } = Object.assign({}, rawRowProps); // Tell TypeScript to treat rawRowProps as an object with a key and other props
|
|
41
|
+
console.log("🚀 row.getRowProps():", row.getRowProps?.());
|
|
42
|
+
console.log("safeRowProps after removing key:", safeRowProps);
|
|
42
43
|
return (_jsxs(Fragment, { children: [_jsx("tr", { "data-testid": "table-row", className: `border-b border-b-navy-200 ${rowHoverClasses} ${rowClasses} ${rowClassNames}`, onClick: handleRowClick, ...safeRowProps, children: row.cells.map((cell, idx) => {
|
|
43
44
|
const cellKey = `${rowUuid ?? "no-uuid"}-${cell.column.id}`;
|
|
44
45
|
return (_jsx(TableCell, { cell: cell, isLastCell: idx === row.cells.length - 1, hasInfiniteScroll: hasInfiniteScroll, rowUuid: rowUuid, expanded: expandedCells[cellKey] ?? false, onToggle: () => toggleCell(cellKey), linkText: linkText }, cellKey));
|