material-react-table 0.13.1 → 0.13.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/README.md +9 -5
- package/dist/MaterialReactTable.d.ts +44 -35
- package/dist/material-react-table.cjs.development.js +28 -13
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +28 -13
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/MaterialReactTable.tsx +47 -35
- package/src/buttons/MRT_ExpandAllButton.tsx +8 -0
- package/src/buttons/MRT_ExpandButton.tsx +8 -0
- package/src/inputs/MRT_SelectCheckbox.tsx +14 -5
|
@@ -153,28 +153,33 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton(_ref) {
|
|
|
153
153
|
_instance$options = instance.options,
|
|
154
154
|
KeyboardDoubleArrowDownIcon = _instance$options.icons.KeyboardDoubleArrowDownIcon,
|
|
155
155
|
localization = _instance$options.localization,
|
|
156
|
+
muiExpandAllButtonProps = _instance$options.muiExpandAllButtonProps,
|
|
156
157
|
renderDetailPanel = _instance$options.renderDetailPanel,
|
|
157
158
|
toggleAllRowsExpanded = instance.toggleAllRowsExpanded;
|
|
158
159
|
|
|
159
160
|
var _getState = getState(),
|
|
160
161
|
density = _getState.density;
|
|
161
162
|
|
|
163
|
+
var iconButtonProps = muiExpandAllButtonProps instanceof Function ? muiExpandAllButtonProps({
|
|
164
|
+
instance: instance
|
|
165
|
+
}) : muiExpandAllButtonProps;
|
|
162
166
|
return React.createElement(Tooltip, {
|
|
163
167
|
arrow: true,
|
|
164
168
|
enterDelay: 1000,
|
|
165
169
|
enterNextDelay: 1000,
|
|
166
170
|
title: localization.expandAll
|
|
167
|
-
}, React.createElement(IconButton, {
|
|
171
|
+
}, React.createElement(IconButton, Object.assign({
|
|
168
172
|
"aria-label": localization.expandAll,
|
|
169
173
|
disabled: !getCanSomeRowsExpand() && !renderDetailPanel,
|
|
170
174
|
onClick: function onClick() {
|
|
171
175
|
return toggleAllRowsExpanded(!getIsAllRowsExpanded());
|
|
172
|
-
}
|
|
173
|
-
|
|
176
|
+
}
|
|
177
|
+
}, iconButtonProps, {
|
|
178
|
+
sx: _extends({
|
|
174
179
|
height: density === 'compact' ? '1.75rem' : '2.25rem',
|
|
175
180
|
width: density === 'compact' ? '1.75rem' : '2.25rem'
|
|
176
|
-
}
|
|
177
|
-
}, React.createElement(KeyboardDoubleArrowDownIcon, {
|
|
181
|
+
}, iconButtonProps == null ? void 0 : iconButtonProps.sx)
|
|
182
|
+
}), React.createElement(KeyboardDoubleArrowDownIcon, {
|
|
178
183
|
style: {
|
|
179
184
|
transform: "rotate(" + (getIsAllRowsExpanded() ? -180 : getIsSomeRowsExpanded() ? -90 : 0) + "deg)",
|
|
180
185
|
transition: 'transform 0.2s'
|
|
@@ -189,12 +194,18 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
|
189
194
|
_instance$options = instance.options,
|
|
190
195
|
ExpandMoreIcon = _instance$options.icons.ExpandMoreIcon,
|
|
191
196
|
localization = _instance$options.localization,
|
|
197
|
+
muiExpandButtonProps = _instance$options.muiExpandButtonProps,
|
|
192
198
|
onExpandChanged = _instance$options.onExpandChanged,
|
|
193
199
|
renderDetailPanel = _instance$options.renderDetailPanel;
|
|
194
200
|
|
|
195
201
|
var _getState = getState(),
|
|
196
202
|
density = _getState.density;
|
|
197
203
|
|
|
204
|
+
var iconButtonProps = muiExpandButtonProps instanceof Function ? muiExpandButtonProps({
|
|
205
|
+
instance: instance,
|
|
206
|
+
row: row
|
|
207
|
+
}) : muiExpandButtonProps;
|
|
208
|
+
|
|
198
209
|
var handleToggleExpand = function handleToggleExpand(event) {
|
|
199
210
|
row.toggleExpanded();
|
|
200
211
|
onExpandChanged == null ? void 0 : onExpandChanged({
|
|
@@ -209,15 +220,16 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
|
209
220
|
enterDelay: 1000,
|
|
210
221
|
enterNextDelay: 1000,
|
|
211
222
|
title: localization.expand
|
|
212
|
-
}, React.createElement(IconButton, {
|
|
223
|
+
}, React.createElement(IconButton, Object.assign({
|
|
213
224
|
"aria-label": localization.expand,
|
|
214
225
|
disabled: !row.getCanExpand() && !renderDetailPanel,
|
|
215
|
-
onClick: handleToggleExpand
|
|
216
|
-
|
|
226
|
+
onClick: handleToggleExpand
|
|
227
|
+
}, iconButtonProps, {
|
|
228
|
+
sx: _extends({
|
|
217
229
|
height: density === 'compact' ? '1.75rem' : '2.25rem',
|
|
218
230
|
width: density === 'compact' ? '1.75rem' : '2.25rem'
|
|
219
|
-
}
|
|
220
|
-
}, React.createElement(ExpandMoreIcon, {
|
|
231
|
+
}, iconButtonProps == null ? void 0 : iconButtonProps.sx)
|
|
232
|
+
}), React.createElement(ExpandMoreIcon, {
|
|
221
233
|
style: {
|
|
222
234
|
transform: "rotate(" + (!row.getCanExpand() && !renderDetailPanel ? -90 : row.getIsExpanded() ? -180 : 0) + "deg)",
|
|
223
235
|
transition: 'transform 0.2s'
|
|
@@ -1267,11 +1279,13 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1267
1279
|
selectAll = _ref.selectAll,
|
|
1268
1280
|
instance = _ref.instance;
|
|
1269
1281
|
var getRowModel = instance.getRowModel,
|
|
1282
|
+
getPaginationRowModel = instance.getPaginationRowModel,
|
|
1270
1283
|
getSelectedRowModel = instance.getSelectedRowModel,
|
|
1271
1284
|
getState = instance.getState,
|
|
1272
1285
|
_instance$options = instance.options,
|
|
1273
1286
|
localization = _instance$options.localization,
|
|
1274
1287
|
muiSelectCheckboxProps = _instance$options.muiSelectCheckboxProps,
|
|
1288
|
+
muiSelectAllCheckboxProps = _instance$options.muiSelectAllCheckboxProps,
|
|
1275
1289
|
onRowSelectionChanged = _instance$options.onRowSelectionChanged,
|
|
1276
1290
|
onRowSelectAllChanged = _instance$options.onRowSelectAllChanged,
|
|
1277
1291
|
selectAllMode = _instance$options.selectAllMode;
|
|
@@ -1289,7 +1303,7 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1289
1303
|
|
|
1290
1304
|
onRowSelectAllChanged == null ? void 0 : onRowSelectAllChanged({
|
|
1291
1305
|
event: event,
|
|
1292
|
-
selectedRows: event.target.checked ? getRowModel().flatRows : [],
|
|
1306
|
+
selectedRows: event.target.checked ? selectAllMode === 'all' ? getRowModel().flatRows : getPaginationRowModel().flatRows : [],
|
|
1293
1307
|
instance: instance
|
|
1294
1308
|
});
|
|
1295
1309
|
} else if (row) {
|
|
@@ -1305,8 +1319,9 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1305
1319
|
}
|
|
1306
1320
|
};
|
|
1307
1321
|
|
|
1308
|
-
var checkboxProps =
|
|
1309
|
-
|
|
1322
|
+
var checkboxProps = selectAll ? muiSelectAllCheckboxProps instanceof Function ? muiSelectAllCheckboxProps({
|
|
1323
|
+
instance: instance
|
|
1324
|
+
}) : muiSelectAllCheckboxProps : muiSelectCheckboxProps instanceof Function ? muiSelectCheckboxProps({
|
|
1310
1325
|
row: row,
|
|
1311
1326
|
instance: instance
|
|
1312
1327
|
}) : muiSelectCheckboxProps;
|