material-react-table 1.3.14 → 1.3.16
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 +6 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +6 -7
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/menus/MRT_ColumnActionMenu.tsx +1 -1
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +17 -8
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -5
package/package.json
CHANGED
@@ -33,7 +33,13 @@ export const MRT_ShowHideColumnsMenu = <
|
|
33
33
|
getRightLeafColumns,
|
34
34
|
getState,
|
35
35
|
toggleAllColumnsVisible,
|
36
|
-
options: {
|
36
|
+
options: {
|
37
|
+
enableColumnOrdering,
|
38
|
+
enableHiding,
|
39
|
+
enablePinning,
|
40
|
+
localization,
|
41
|
+
columns,
|
42
|
+
},
|
37
43
|
} = table;
|
38
44
|
const { density, columnOrder, columnPinning } = getState();
|
39
45
|
|
@@ -59,6 +65,7 @@ export const MRT_ShowHideColumnsMenu = <
|
|
59
65
|
}
|
60
66
|
return columns;
|
61
67
|
}, [
|
68
|
+
columns,
|
62
69
|
columnOrder,
|
63
70
|
columnPinning,
|
64
71
|
getAllColumns(),
|
@@ -88,7 +95,7 @@ export const MRT_ShowHideColumnsMenu = <
|
|
88
95
|
pt: 0,
|
89
96
|
}}
|
90
97
|
>
|
91
|
-
{!isSubMenu && (
|
98
|
+
{!isSubMenu && enableHiding && (
|
92
99
|
<Button
|
93
100
|
disabled={!getIsSomeColumnsVisible()}
|
94
101
|
onClick={hideAllColumns}
|
@@ -115,12 +122,14 @@ export const MRT_ShowHideColumnsMenu = <
|
|
115
122
|
{localization.unpinAll}
|
116
123
|
</Button>
|
117
124
|
)}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
125
|
+
{enableHiding && (
|
126
|
+
<Button
|
127
|
+
disabled={getIsAllColumnsVisible()}
|
128
|
+
onClick={() => toggleAllColumnsVisible(true)}
|
129
|
+
>
|
130
|
+
{localization.showAll}
|
131
|
+
</Button>
|
132
|
+
)}
|
124
133
|
</Box>
|
125
134
|
<Divider />
|
126
135
|
{allColumns.map((column, index) => (
|
@@ -157,11 +157,7 @@ export const MRT_ShowHideColumnsMenuItems = <
|
|
157
157
|
<Switch />
|
158
158
|
</Tooltip>
|
159
159
|
}
|
160
|
-
disabled={
|
161
|
-
(isSubMenu && switchChecked) ||
|
162
|
-
!column.getCanHide() ||
|
163
|
-
column.getIsGrouped()
|
164
|
-
}
|
160
|
+
disabled={(isSubMenu && switchChecked) || !column.getCanHide()}
|
165
161
|
label={columnDef.header}
|
166
162
|
onChange={() => handleToggleColumnHidden(column)}
|
167
163
|
/>
|