material-react-table 1.2.0 → 1.2.1
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.
package/dist/cjs/index.js
CHANGED
|
@@ -2151,7 +2151,8 @@ const MRT_TableBodyCell = ({ cell, enableHover, numRows, rowIndex, rowRef, table
|
|
|
2151
2151
|
const Memo_MRT_TableBodyCell = React.memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
|
2152
2152
|
|
|
2153
2153
|
const MRT_TableDetailPanel = ({ row, table }) => {
|
|
2154
|
-
const { getVisibleLeafColumns, options: { muiTableBodyRowProps, muiTableDetailPanelProps, renderDetailPanel, }, } = table;
|
|
2154
|
+
const { getVisibleLeafColumns, getState, options: { muiTableBodyRowProps, muiTableDetailPanelProps, renderDetailPanel, }, } = table;
|
|
2155
|
+
const { isLoading } = getState();
|
|
2155
2156
|
const tableRowProps = muiTableBodyRowProps instanceof Function
|
|
2156
2157
|
? muiTableBodyRowProps({ row, table })
|
|
2157
2158
|
: muiTableBodyRowProps;
|
|
@@ -2161,7 +2162,7 @@ const MRT_TableDetailPanel = ({ row, table }) => {
|
|
|
2161
2162
|
return (React__default["default"].createElement(material.TableRow, Object.assign({}, tableRowProps),
|
|
2162
2163
|
React__default["default"].createElement(material.TableCell, Object.assign({ colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ borderBottom: !row.getIsExpanded() ? 'none' : undefined, pb: row.getIsExpanded() ? '1rem' : 0, pt: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
|
2163
2164
|
? tableCellProps.sx(theme)
|
|
2164
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React__default["default"].createElement(material.Collapse, { in: row.getIsExpanded() }, renderDetailPanel({ row, table }))))));
|
|
2165
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React__default["default"].createElement(material.Collapse, { in: !isLoading && row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true }, renderDetailPanel({ row, table }))))));
|
|
2165
2166
|
};
|
|
2166
2167
|
|
|
2167
2168
|
const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|