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.
|
@@ -2143,7 +2143,8 @@ const MRT_TableBodyCell = ({ cell, enableHover, numRows, rowIndex, rowRef, table
|
|
|
2143
2143
|
const Memo_MRT_TableBodyCell = memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
|
2144
2144
|
|
|
2145
2145
|
const MRT_TableDetailPanel = ({ row, table }) => {
|
|
2146
|
-
const { getVisibleLeafColumns, options: { muiTableBodyRowProps, muiTableDetailPanelProps, renderDetailPanel, }, } = table;
|
|
2146
|
+
const { getVisibleLeafColumns, getState, options: { muiTableBodyRowProps, muiTableDetailPanelProps, renderDetailPanel, }, } = table;
|
|
2147
|
+
const { isLoading } = getState();
|
|
2147
2148
|
const tableRowProps = muiTableBodyRowProps instanceof Function
|
|
2148
2149
|
? muiTableBodyRowProps({ row, table })
|
|
2149
2150
|
: muiTableBodyRowProps;
|
|
@@ -2153,7 +2154,7 @@ const MRT_TableDetailPanel = ({ row, table }) => {
|
|
|
2153
2154
|
return (React.createElement(TableRow, Object.assign({}, tableRowProps),
|
|
2154
2155
|
React.createElement(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
|
|
2155
2156
|
? tableCellProps.sx(theme)
|
|
2156
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React.createElement(Collapse, { in: row.getIsExpanded() }, renderDetailPanel({ row, table }))))));
|
|
2157
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React.createElement(Collapse, { in: !isLoading && row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true }, renderDetailPanel({ row, table }))))));
|
|
2157
2158
|
};
|
|
2158
2159
|
|
|
2159
2160
|
const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|