material-react-table 1.2.1 → 1.2.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.
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +8 -8
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/body/MRT_TableDetailPanel.tsx +2 -6
- package/src/buttons/MRT_ExpandAllButton.tsx +4 -2
- package/src/head/MRT_TableHeadCell.tsx +3 -3
- package/src/inputs/MRT_SelectCheckbox.tsx +2 -1
package/package.json
CHANGED
|
@@ -46,12 +46,8 @@ export const MRT_TableDetailPanel: FC<Props> = ({ row, table }) => {
|
|
|
46
46
|
})}
|
|
47
47
|
>
|
|
48
48
|
{renderDetailPanel && (
|
|
49
|
-
<Collapse
|
|
50
|
-
|
|
51
|
-
mountOnEnter
|
|
52
|
-
unmountOnExit
|
|
53
|
-
>
|
|
54
|
-
{renderDetailPanel({ row, table })}
|
|
49
|
+
<Collapse in={row.getIsExpanded()} mountOnEnter unmountOnExit>
|
|
50
|
+
{!isLoading && renderDetailPanel({ row, table })}
|
|
55
51
|
</Collapse>
|
|
56
52
|
)}
|
|
57
53
|
</TableCell>
|
|
@@ -20,7 +20,7 @@ export const MRT_ExpandAllButton: FC<Props> = ({ table }) => {
|
|
|
20
20
|
},
|
|
21
21
|
toggleAllRowsExpanded,
|
|
22
22
|
} = table;
|
|
23
|
-
const { density } = getState();
|
|
23
|
+
const { density, isLoading } = getState();
|
|
24
24
|
|
|
25
25
|
const iconButtonProps =
|
|
26
26
|
muiExpandAllButtonProps instanceof Function
|
|
@@ -37,7 +37,9 @@ export const MRT_ExpandAllButton: FC<Props> = ({ table }) => {
|
|
|
37
37
|
<span>
|
|
38
38
|
<IconButton
|
|
39
39
|
aria-label={localization.expandAll}
|
|
40
|
-
disabled={
|
|
40
|
+
disabled={
|
|
41
|
+
isLoading || (!renderDetailPanel && !getCanSomeRowsExpand())
|
|
42
|
+
}
|
|
41
43
|
onClick={() => toggleAllRowsExpanded(!getIsAllRowsExpanded())}
|
|
42
44
|
{...iconButtonProps}
|
|
43
45
|
sx={(theme) => ({
|
|
@@ -198,7 +198,7 @@ export const MRT_TableHeadCell: FC<Props> = ({ header, table }) => {
|
|
|
198
198
|
display: 'flex',
|
|
199
199
|
flexDirection:
|
|
200
200
|
tableCellProps?.align === 'right' ? 'row-reverse' : 'row',
|
|
201
|
-
overflow: 'hidden',
|
|
201
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
|
202
202
|
pl:
|
|
203
203
|
tableCellProps?.align === 'center'
|
|
204
204
|
? `${headerPL}rem`
|
|
@@ -208,12 +208,12 @@ export const MRT_TableHeadCell: FC<Props> = ({ header, table }) => {
|
|
|
208
208
|
<Box
|
|
209
209
|
className="Mui-TableHeadCell-Content-Wrapper"
|
|
210
210
|
sx={{
|
|
211
|
-
overflow: 'hidden',
|
|
211
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
|
212
212
|
textOverflow: 'ellipsis',
|
|
213
213
|
whiteSpace:
|
|
214
214
|
(columnDef.header?.length ?? 0) < 20 ? 'nowrap' : 'normal',
|
|
215
215
|
}}
|
|
216
|
-
title={columnDef.header}
|
|
216
|
+
title={columnDefType === 'data' ? columnDef.header : undefined}
|
|
217
217
|
>
|
|
218
218
|
{headerElement}
|
|
219
219
|
</Box>
|
|
@@ -19,7 +19,7 @@ export const MRT_SelectCheckbox: FC<Props> = ({ row, selectAll, table }) => {
|
|
|
19
19
|
selectAllMode,
|
|
20
20
|
},
|
|
21
21
|
} = table;
|
|
22
|
-
const { density } = getState();
|
|
22
|
+
const { density, isLoading } = getState();
|
|
23
23
|
|
|
24
24
|
const checkboxProps = !row
|
|
25
25
|
? muiSelectAllCheckboxProps instanceof Function
|
|
@@ -35,6 +35,7 @@ export const MRT_SelectCheckbox: FC<Props> = ({ row, selectAll, table }) => {
|
|
|
35
35
|
? table.getIsAllPageRowsSelected()
|
|
36
36
|
: table.getIsAllRowsSelected()
|
|
37
37
|
: row?.getIsSelected(),
|
|
38
|
+
disabled: isLoading,
|
|
38
39
|
inputProps: {
|
|
39
40
|
'aria-label': selectAll
|
|
40
41
|
? localization.toggleSelectAll
|