material-react-table 0.25.0 → 0.26.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 +13 -11
- package/dist/{utils.d.ts → column.utils.d.ts} +1 -1
- package/dist/filtersFns.d.ts +22 -54
- package/dist/localization.d.ts +3 -0
- package/dist/material-react-table.cjs.development.js +188 -103
- 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 +188 -103
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/table/MRT_TableRoot.d.ts +1 -1
- package/package.json +1 -1
- package/src/body/MRT_TableBodyCell.tsx +3 -1
- package/src/body/MRT_TableBodyRow.tsx +3 -1
- package/src/body/MRT_TableDetailPanel.tsx +5 -3
- package/src/buttons/MRT_CopyButton.tsx +5 -3
- package/src/buttons/MRT_ExpandButton.tsx +5 -3
- package/src/{utils.ts → column.utils.ts} +0 -0
- package/src/filtersFns.ts +47 -13
- package/src/footer/MRT_TableFooterCell.tsx +3 -1
- package/src/head/MRT_TableHeadCell.tsx +5 -1
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +5 -3
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +1 -1
- package/src/inputs/MRT_FilterTextField.tsx +9 -4
- package/src/inputs/MRT_SelectCheckbox.tsx +5 -3
- package/src/localization.ts +6 -0
- package/src/menus/MRT_FilterOptionMenu.tsx +105 -72
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +1 -1
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -1
- package/src/table/MRT_Table.tsx +5 -3
- package/src/table/MRT_TableContainer.tsx +5 -3
- package/src/table/MRT_TableRoot.tsx +12 -12
- package/src/toolbar/MRT_TablePagination.tsx +5 -3
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +5 -3
- package/src/toolbar/MRT_ToolbarBottom.tsx +3 -1
- package/src/toolbar/MRT_ToolbarTop.tsx +3 -1
@@ -60,6 +60,7 @@ var MRT_DefaultLocalization_EN = {
|
|
60
60
|
expand: 'Expand',
|
61
61
|
expandAll: 'Expand all',
|
62
62
|
filterBetween: 'Between',
|
63
|
+
filterBetweenInclusive: 'Between Inclusive',
|
63
64
|
filterByColumn: 'Filter by {column}',
|
64
65
|
filterContains: 'Contains',
|
65
66
|
filterEmpty: 'Empty',
|
@@ -67,7 +68,9 @@ var MRT_DefaultLocalization_EN = {
|
|
67
68
|
filterEquals: 'Equals',
|
68
69
|
filterFuzzy: 'Fuzzy',
|
69
70
|
filterGreaterThan: 'Greater Than',
|
71
|
+
filterGreaterThanOrEqualTo: 'Greater Than Or Equal To',
|
70
72
|
filterLessThan: 'Less Than',
|
73
|
+
filterLessThanOrEqualTo: 'Less Than Or Equal To',
|
71
74
|
filterMode: 'Filter Mode: {filterType}',
|
72
75
|
filterNotEmpty: 'Not Empty',
|
73
76
|
filterNotEquals: 'Not Equals',
|
@@ -221,10 +224,12 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
221
224
|
disabled: !row.getCanExpand() && !renderDetailPanel,
|
222
225
|
onClick: handleToggleExpand
|
223
226
|
}, iconButtonProps, {
|
224
|
-
sx:
|
225
|
-
|
226
|
-
|
227
|
-
|
227
|
+
sx: function sx(theme) {
|
228
|
+
return _extends({
|
229
|
+
height: density === 'compact' ? '1.75rem' : '2.25rem',
|
230
|
+
width: density === 'compact' ? '1.75rem' : '2.25rem'
|
231
|
+
}, (iconButtonProps == null ? void 0 : iconButtonProps.sx) instanceof Function ? iconButtonProps.sx(theme) : iconButtonProps == null ? void 0 : iconButtonProps.sx);
|
232
|
+
}
|
228
233
|
}), React__default.createElement(ExpandMoreIcon, {
|
229
234
|
style: {
|
230
235
|
transform: "rotate(" + (!row.getCanExpand() && !renderDetailPanel ? -90 : row.getIsExpanded() ? -180 : 0) + "deg)",
|
@@ -233,11 +238,6 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
233
238
|
}))));
|
234
239
|
};
|
235
240
|
|
236
|
-
var commonMenuItemStyles = {
|
237
|
-
py: '6px',
|
238
|
-
my: 0,
|
239
|
-
alignItems: 'center'
|
240
|
-
};
|
241
241
|
var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
242
242
|
var _columnDef$enabledCol;
|
243
243
|
|
@@ -269,46 +269,72 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
269
269
|
var filterOptions = React.useMemo(function () {
|
270
270
|
return [{
|
271
271
|
option: 'fuzzy',
|
272
|
+
symbol: '≈',
|
272
273
|
label: localization.filterFuzzy,
|
273
274
|
divider: false
|
274
275
|
}, {
|
275
276
|
option: 'contains',
|
277
|
+
symbol: '*',
|
276
278
|
label: localization.filterContains,
|
277
279
|
divider: false
|
278
280
|
}, {
|
279
281
|
option: 'startsWith',
|
282
|
+
symbol: 'a',
|
280
283
|
label: localization.filterStartsWith,
|
281
284
|
divider: false
|
282
285
|
}, {
|
283
286
|
option: 'endsWith',
|
287
|
+
symbol: 'z',
|
284
288
|
label: localization.filterEndsWith,
|
285
289
|
divider: true
|
286
290
|
}, {
|
287
291
|
option: 'equals',
|
292
|
+
symbol: '=',
|
288
293
|
label: localization.filterEquals,
|
289
294
|
divider: false
|
290
295
|
}, {
|
291
296
|
option: 'notEquals',
|
297
|
+
symbol: '≠',
|
292
298
|
label: localization.filterNotEquals,
|
293
299
|
divider: true
|
294
300
|
}, {
|
295
301
|
option: 'between',
|
302
|
+
symbol: '⇿',
|
296
303
|
label: localization.filterBetween,
|
297
304
|
divider: false
|
305
|
+
}, {
|
306
|
+
option: 'betweenInclusive',
|
307
|
+
symbol: '⬌',
|
308
|
+
label: localization.filterBetweenInclusive,
|
309
|
+
divider: true
|
298
310
|
}, {
|
299
311
|
option: 'greaterThan',
|
312
|
+
symbol: '>',
|
300
313
|
label: localization.filterGreaterThan,
|
301
314
|
divider: false
|
315
|
+
}, {
|
316
|
+
option: 'greaterThanOrEqualTo',
|
317
|
+
symbol: '≥',
|
318
|
+
label: localization.filterGreaterThanOrEqualTo,
|
319
|
+
divider: false
|
302
320
|
}, {
|
303
321
|
option: 'lessThan',
|
322
|
+
symbol: '<',
|
304
323
|
label: localization.filterLessThan,
|
324
|
+
divider: false
|
325
|
+
}, {
|
326
|
+
option: 'lessThanOrEqualTo',
|
327
|
+
symbol: '≤',
|
328
|
+
label: localization.filterLessThanOrEqualTo,
|
305
329
|
divider: true
|
306
330
|
}, {
|
307
331
|
option: 'empty',
|
332
|
+
symbol: '∅',
|
308
333
|
label: localization.filterEmpty,
|
309
334
|
divider: false
|
310
335
|
}, {
|
311
336
|
option: 'notEmpty',
|
337
|
+
symbol: '!∅',
|
312
338
|
label: localization.filterNotEmpty,
|
313
339
|
divider: false
|
314
340
|
}].filter(function (filterType) {
|
@@ -356,7 +382,8 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
356
382
|
}, filterOptions.map(function (_ref4, index) {
|
357
383
|
var option = _ref4.option,
|
358
384
|
label = _ref4.label,
|
359
|
-
divider = _ref4.divider
|
385
|
+
divider = _ref4.divider,
|
386
|
+
symbol = _ref4.symbol;
|
360
387
|
return React__default.createElement(material.MenuItem, {
|
361
388
|
divider: divider,
|
362
389
|
key: index,
|
@@ -364,9 +391,20 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
364
391
|
return handleSelectFilterType(option);
|
365
392
|
},
|
366
393
|
selected: option === filterOption,
|
367
|
-
sx:
|
394
|
+
sx: {
|
395
|
+
py: '6px',
|
396
|
+
my: 0,
|
397
|
+
alignItems: 'center',
|
398
|
+
display: 'flex',
|
399
|
+
gap: '2ch'
|
400
|
+
},
|
368
401
|
value: option
|
369
|
-
},
|
402
|
+
}, React__default.createElement(material.Box, {
|
403
|
+
sx: {
|
404
|
+
fontSize: '1.25rem',
|
405
|
+
width: '2ch'
|
406
|
+
}
|
407
|
+
}, symbol), label);
|
370
408
|
}));
|
371
409
|
};
|
372
410
|
|
@@ -512,21 +550,37 @@ notEquals.autoRemove = function (val) {
|
|
512
550
|
};
|
513
551
|
|
514
552
|
var greaterThan = function greaterThan(row, id, filterValue) {
|
515
|
-
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id)
|
553
|
+
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) > +filterValue : row.getValue(id).toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
|
516
554
|
};
|
517
555
|
|
518
556
|
greaterThan.autoRemove = function (val) {
|
519
557
|
return !val;
|
520
558
|
};
|
521
559
|
|
560
|
+
var greaterThanOrEqualTo = function greaterThanOrEqualTo(row, id, filterValue) {
|
561
|
+
return equals(row, id, filterValue) || greaterThan(row, id, filterValue);
|
562
|
+
};
|
563
|
+
|
564
|
+
greaterThanOrEqualTo.autoRemove = function (val) {
|
565
|
+
return !val;
|
566
|
+
};
|
567
|
+
|
522
568
|
var lessThan = function lessThan(row, id, filterValue) {
|
523
|
-
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id)
|
569
|
+
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) < +filterValue : row.getValue(id).toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
|
524
570
|
};
|
525
571
|
|
526
572
|
lessThan.autoRemove = function (val) {
|
527
573
|
return !val;
|
528
574
|
};
|
529
575
|
|
576
|
+
var lessThanOrEqualTo = function lessThanOrEqualTo(row, id, filterValue) {
|
577
|
+
return equals(row, id, filterValue) || lessThan(row, id, filterValue);
|
578
|
+
};
|
579
|
+
|
580
|
+
lessThanOrEqualTo.autoRemove = function (val) {
|
581
|
+
return !val;
|
582
|
+
};
|
583
|
+
|
530
584
|
var between = function between(row, id, filterValues) {
|
531
585
|
return (['', undefined].includes(filterValues[0]) || greaterThan(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThan(row, id, filterValues[1]));
|
532
586
|
};
|
@@ -535,6 +589,14 @@ between.autoRemove = function (val) {
|
|
535
589
|
return !val;
|
536
590
|
};
|
537
591
|
|
592
|
+
var betweenInclusive = function betweenInclusive(row, id, filterValues) {
|
593
|
+
return (['', undefined].includes(filterValues[0]) || greaterThanOrEqualTo(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThanOrEqualTo(row, id, filterValues[1]));
|
594
|
+
};
|
595
|
+
|
596
|
+
betweenInclusive.autoRemove = function (val) {
|
597
|
+
return !val;
|
598
|
+
};
|
599
|
+
|
538
600
|
var empty = function empty(row, id, _filterValue) {
|
539
601
|
return !row.getValue(id).toString().trim();
|
540
602
|
};
|
@@ -553,13 +615,16 @@ notEmpty.autoRemove = function (val) {
|
|
553
615
|
|
554
616
|
var MRT_FilterFns = /*#__PURE__*/_extends({}, reactTable.filterFns, {
|
555
617
|
between: between,
|
618
|
+
betweenInclusive: betweenInclusive,
|
556
619
|
contains: contains,
|
557
620
|
empty: empty,
|
558
621
|
endsWith: endsWith,
|
559
622
|
equals: equals,
|
560
623
|
fuzzy: fuzzy,
|
561
624
|
greaterThan: greaterThan,
|
625
|
+
greaterThanOrEqualTo: greaterThanOrEqualTo,
|
562
626
|
lessThan: lessThan,
|
627
|
+
lessThanOrEqualTo: lessThanOrEqualTo,
|
563
628
|
notEmpty: notEmpty,
|
564
629
|
notEquals: notEquals,
|
565
630
|
startsWith: startsWith
|
@@ -911,7 +976,7 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
911
976
|
}));
|
912
977
|
};
|
913
978
|
|
914
|
-
var commonMenuItemStyles
|
979
|
+
var commonMenuItemStyles = {
|
915
980
|
py: '6px',
|
916
981
|
my: 0,
|
917
982
|
justifyContent: 'space-between',
|
@@ -1055,14 +1120,14 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1055
1120
|
disabled: !column.getIsSorted(),
|
1056
1121
|
key: 0,
|
1057
1122
|
onClick: handleClearSort,
|
1058
|
-
sx: commonMenuItemStyles
|
1123
|
+
sx: commonMenuItemStyles
|
1059
1124
|
}, React__default.createElement(material.Box, {
|
1060
1125
|
sx: commonListItemStyles
|
1061
1126
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(ClearAllIcon, null)), localization.clearSort)), React__default.createElement(material.MenuItem, {
|
1062
1127
|
disabled: column.getIsSorted() === 'asc',
|
1063
1128
|
key: 1,
|
1064
1129
|
onClick: handleSortAsc,
|
1065
|
-
sx: commonMenuItemStyles
|
1130
|
+
sx: commonMenuItemStyles
|
1066
1131
|
}, React__default.createElement(material.Box, {
|
1067
1132
|
sx: commonListItemStyles
|
1068
1133
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, null)), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(columnDef.header)))), React__default.createElement(material.MenuItem, {
|
@@ -1070,7 +1135,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1070
1135
|
key: 2,
|
1071
1136
|
disabled: column.getIsSorted() === 'desc',
|
1072
1137
|
onClick: handleSortDesc,
|
1073
|
-
sx: commonMenuItemStyles
|
1138
|
+
sx: commonMenuItemStyles
|
1074
1139
|
}, React__default.createElement(material.Box, {
|
1075
1140
|
sx: commonListItemStyles
|
1076
1141
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, {
|
@@ -1081,14 +1146,14 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1081
1146
|
disabled: !column.getFilterValue(),
|
1082
1147
|
key: 0,
|
1083
1148
|
onClick: handleClearFilter,
|
1084
|
-
sx: commonMenuItemStyles
|
1149
|
+
sx: commonMenuItemStyles
|
1085
1150
|
}, React__default.createElement(material.Box, {
|
1086
1151
|
sx: commonListItemStyles
|
1087
1152
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(FilterListOffIcon, null)), localization.clearFilter)), React__default.createElement(material.MenuItem, {
|
1088
1153
|
divider: enableGrouping || enableHiding,
|
1089
1154
|
key: 1,
|
1090
1155
|
onClick: handleFilterByColumn,
|
1091
|
-
sx: commonMenuItemStyles
|
1156
|
+
sx: commonMenuItemStyles
|
1092
1157
|
}, React__default.createElement(material.Box, {
|
1093
1158
|
sx: commonListItemStyles
|
1094
1159
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(FilterListIcon, null)), (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(columnDef.header))), showFilterModeSubMenu && React__default.createElement(material.IconButton, {
|
@@ -1109,7 +1174,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1109
1174
|
divider: enablePinning,
|
1110
1175
|
key: 0,
|
1111
1176
|
onClick: handleGroupByColumn,
|
1112
|
-
sx: commonMenuItemStyles
|
1177
|
+
sx: commonMenuItemStyles
|
1113
1178
|
}, React__default.createElement(material.Box, {
|
1114
1179
|
sx: commonListItemStyles
|
1115
1180
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(DynamicFeedIcon, null)), (_localization = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) == null ? void 0 : _localization.replace('{column}', String(columnDef.header))))], enablePinning && column.getCanPin() && [React__default.createElement(material.MenuItem, {
|
@@ -1118,7 +1183,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1118
1183
|
onClick: function onClick() {
|
1119
1184
|
return handlePinColumn('left');
|
1120
1185
|
},
|
1121
|
-
sx: commonMenuItemStyles
|
1186
|
+
sx: commonMenuItemStyles
|
1122
1187
|
}, React__default.createElement(material.Box, {
|
1123
1188
|
sx: commonListItemStyles
|
1124
1189
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(PushPinIcon, {
|
@@ -1131,7 +1196,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1131
1196
|
onClick: function onClick() {
|
1132
1197
|
return handlePinColumn('right');
|
1133
1198
|
},
|
1134
|
-
sx: commonMenuItemStyles
|
1199
|
+
sx: commonMenuItemStyles
|
1135
1200
|
}, React__default.createElement(material.Box, {
|
1136
1201
|
sx: commonListItemStyles
|
1137
1202
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(PushPinIcon, {
|
@@ -1145,21 +1210,21 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1145
1210
|
onClick: function onClick() {
|
1146
1211
|
return handlePinColumn(false);
|
1147
1212
|
},
|
1148
|
-
sx: commonMenuItemStyles
|
1213
|
+
sx: commonMenuItemStyles
|
1149
1214
|
}, React__default.createElement(material.Box, {
|
1150
1215
|
sx: commonListItemStyles
|
1151
1216
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(PushPinIcon, null)), localization.unpin))], enableColumnResizing && column.getCanResize() && [React__default.createElement(material.MenuItem, {
|
1152
1217
|
disabled: !columnSizing[column.id],
|
1153
1218
|
key: 0,
|
1154
1219
|
onClick: handleResetColumnSize,
|
1155
|
-
sx: commonMenuItemStyles
|
1220
|
+
sx: commonMenuItemStyles
|
1156
1221
|
}, React__default.createElement(material.Box, {
|
1157
1222
|
sx: commonListItemStyles
|
1158
1223
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(RestartAltIcon, null)), localization.resetColumnSize))], enableHiding && [React__default.createElement(material.MenuItem, {
|
1159
1224
|
disabled: columnDef.enableHiding === false,
|
1160
1225
|
key: 0,
|
1161
1226
|
onClick: handleHideColumn,
|
1162
|
-
sx: commonMenuItemStyles
|
1227
|
+
sx: commonMenuItemStyles
|
1163
1228
|
}, React__default.createElement(material.Box, {
|
1164
1229
|
sx: commonListItemStyles
|
1165
1230
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(VisibilityOffIcon, null)), (_localization$hideCol = localization.hideColumn) == null ? void 0 : _localization$hideCol.replace('{column}', String(columnDef.header)))), React__default.createElement(material.MenuItem, {
|
@@ -1168,7 +1233,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1168
1233
|
}).length,
|
1169
1234
|
key: 1,
|
1170
1235
|
onClick: handleShowAllColumns,
|
1171
|
-
sx: commonMenuItemStyles
|
1236
|
+
sx: commonMenuItemStyles
|
1172
1237
|
}, React__default.createElement(material.Box, {
|
1173
1238
|
sx: commonListItemStyles
|
1174
1239
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(ViewColumnIcon, null)), (_localization$showAll = localization.showAllColumns) == null ? void 0 : _localization$showAll.replace('{column}', String(columnDef.header))), React__default.createElement(material.IconButton, {
|
@@ -1214,7 +1279,7 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
1214
1279
|
}
|
1215
1280
|
}, enableEditing && React__default.createElement(material.MenuItem, {
|
1216
1281
|
onClick: handleEdit,
|
1217
|
-
sx: commonMenuItemStyles
|
1282
|
+
sx: commonMenuItemStyles
|
1218
1283
|
}, React__default.createElement(material.Box, {
|
1219
1284
|
sx: commonListItemStyles
|
1220
1285
|
}, React__default.createElement(material.ListItemIcon, null, React__default.createElement(EditIcon, null)), localization.edit)), renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems({
|
@@ -1385,11 +1450,13 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
1385
1450
|
onChange: !row ? selectAllMode === 'all' ? table.getToggleAllRowsSelectedHandler() : table.getToggleAllPageRowsSelectedHandler() : row.getToggleSelectedHandler(),
|
1386
1451
|
size: density === 'compact' ? 'small' : 'medium'
|
1387
1452
|
}, checkboxProps, {
|
1388
|
-
sx:
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1453
|
+
sx: function sx(theme) {
|
1454
|
+
return _extends({
|
1455
|
+
height: density === 'compact' ? '1.5rem' : '2rem',
|
1456
|
+
width: density === 'compact' ? '1.5rem' : '2rem',
|
1457
|
+
m: '-1re.m'
|
1458
|
+
}, (checkboxProps == null ? void 0 : checkboxProps.sx) instanceof Function ? checkboxProps.sx(theme) : checkboxProps == null ? void 0 : checkboxProps.sx);
|
1459
|
+
}
|
1393
1460
|
})));
|
1394
1461
|
};
|
1395
1462
|
|
@@ -1740,12 +1807,14 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
1740
1807
|
showFirstButton: showFirstLastPageButtons,
|
1741
1808
|
showLastButton: showFirstLastPageButtons
|
1742
1809
|
}, tablePaginationProps, {
|
1743
|
-
sx:
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1810
|
+
sx: function sx(theme) {
|
1811
|
+
return _extends({
|
1812
|
+
m: '0 0.5rem',
|
1813
|
+
mt: position === 'top' && enableToolbarInternalActions && !showGlobalFilter ? '3.5rem' : undefined,
|
1814
|
+
position: 'relative',
|
1815
|
+
zIndex: 2
|
1816
|
+
}, (tablePaginationProps == null ? void 0 : tablePaginationProps.sx) instanceof Function ? tablePaginationProps.sx(theme) : tablePaginationProps == null ? void 0 : tablePaginationProps.sx);
|
1817
|
+
}
|
1749
1818
|
}));
|
1750
1819
|
};
|
1751
1820
|
|
@@ -1787,17 +1856,19 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
1787
1856
|
color: "info",
|
1788
1857
|
icon: false
|
1789
1858
|
}, alertProps, {
|
1790
|
-
sx:
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1859
|
+
sx: function sx(theme) {
|
1860
|
+
return _extends({
|
1861
|
+
borderRadius: 0,
|
1862
|
+
fontSize: '1rem',
|
1863
|
+
left: 0,
|
1864
|
+
p: 0,
|
1865
|
+
position: 'relative',
|
1866
|
+
right: 0,
|
1867
|
+
top: 0,
|
1868
|
+
width: '100%',
|
1869
|
+
zIndex: 2
|
1870
|
+
}, (alertProps == null ? void 0 : alertProps.sx) instanceof Function ? alertProps.sx(theme) : alertProps == null ? void 0 : alertProps.sx);
|
1871
|
+
}
|
1801
1872
|
}), (alertProps == null ? void 0 : alertProps.title) && React__default.createElement(material.AlertTitle, null, alertProps.title), React__default.createElement(material.Box, {
|
1802
1873
|
sx: {
|
1803
1874
|
p: '0.5rem 1rem'
|
@@ -1886,7 +1957,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
1886
1957
|
top: isFullScreen ? '0' : undefined
|
1887
1958
|
}, commonToolbarStyles({
|
1888
1959
|
theme: theme
|
1889
|
-
}), toolbarProps == null ? void 0 : toolbarProps.sx);
|
1960
|
+
}), (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
|
1890
1961
|
}
|
1891
1962
|
}), positionToolbarAlertBanner === 'top' && React__default.createElement(MRT_ToolbarAlertBanner, {
|
1892
1963
|
stackAlertBanner: stackAlertBanner,
|
@@ -1952,7 +2023,7 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
1952
2023
|
left: 0,
|
1953
2024
|
position: isFullScreen ? 'fixed' : 'relative',
|
1954
2025
|
right: 0
|
1955
|
-
}, toolbarProps == null ? void 0 : toolbarProps.sx);
|
2026
|
+
}, (toolbarProps == null ? void 0 : toolbarProps.sx) instanceof Function ? toolbarProps.sx(theme) : toolbarProps == null ? void 0 : toolbarProps.sx);
|
1956
2027
|
}
|
1957
2028
|
}), React__default.createElement(MRT_LinearProgressBar, {
|
1958
2029
|
isTopToolbar: false,
|
@@ -2027,16 +2098,18 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
|
|
2027
2098
|
onClick: handleClick,
|
2028
2099
|
size: "small"
|
2029
2100
|
}, iconButtonProps, {
|
2030
|
-
sx:
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2101
|
+
sx: function sx(theme) {
|
2102
|
+
return _extends({
|
2103
|
+
height: '2rem',
|
2104
|
+
mt: '-0.2rem',
|
2105
|
+
opacity: 0.5,
|
2106
|
+
transition: 'opacity 0.2s',
|
2107
|
+
width: '2rem',
|
2108
|
+
'&:hover': {
|
2109
|
+
opacity: 1
|
2110
|
+
}
|
2111
|
+
}, (iconButtonProps == null ? void 0 : iconButtonProps.sx) instanceof Function ? iconButtonProps.sx(theme) : iconButtonProps == null ? void 0 : iconButtonProps.sx);
|
2112
|
+
}
|
2040
2113
|
}), React__default.createElement(MoreVertIcon, null))), React__default.createElement(MRT_ColumnActionMenu, {
|
2041
2114
|
anchorEl: anchorEl,
|
2042
2115
|
header: header,
|
@@ -2221,15 +2294,17 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
2221
2294
|
}, React__default.createElement(CloseIcon, null)))))
|
2222
2295
|
}
|
2223
2296
|
}, textFieldProps, {
|
2224
|
-
sx:
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2297
|
+
sx: function sx(theme) {
|
2298
|
+
return _extends({
|
2299
|
+
m: '-0.25rem',
|
2300
|
+
p: 0,
|
2301
|
+
minWidth: !filterChipLabel ? '8rem' : 'auto',
|
2302
|
+
width: 'calc(100% + 0.5rem)',
|
2303
|
+
'& .MuiSelect-icon': {
|
2304
|
+
mr: '1.5rem'
|
2305
|
+
}
|
2306
|
+
}, (textFieldProps == null ? void 0 : textFieldProps.sx) instanceof Function ? textFieldProps.sx(theme) : textFieldProps == null ? void 0 : textFieldProps.sx);
|
2307
|
+
}
|
2233
2308
|
}), isSelectFilter && React__default.createElement(material.MenuItem, {
|
2234
2309
|
divider: true,
|
2235
2310
|
disabled: !filterValue,
|
@@ -2563,7 +2638,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2563
2638
|
userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined,
|
2564
2639
|
verticalAlign: 'top',
|
2565
2640
|
zIndex: column.getIsResizing() || (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id ? 3 : column.getIsPinned() && columnDefType !== 'group' ? 2 : 1
|
2566
|
-
}, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
|
2641
|
+
}, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
|
2567
2642
|
maxWidth: "min(" + column.getSize() + "px, fit-content)",
|
2568
2643
|
minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
|
2569
2644
|
width: header.getSize()
|
@@ -2584,6 +2659,8 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2584
2659
|
cursor: column.getCanSort() && columnDefType !== 'group' ? 'pointer' : undefined,
|
2585
2660
|
display: 'flex',
|
2586
2661
|
flexWrap: 'nowrap',
|
2662
|
+
m: (tableCellProps == null ? void 0 : tableCellProps.align) === 'center' ? 'auto' : undefined,
|
2663
|
+
pl: (tableCellProps == null ? void 0 : tableCellProps.align) === 'center' ? '1rem' : undefined,
|
2587
2664
|
whiteSpace: ((_columnDef$header$len = (_columnDef$header = columnDef.header) == null ? void 0 : _columnDef$header.length) != null ? _columnDef$header$len : 0) < 24 ? 'nowrap' : 'normal'
|
2588
2665
|
}
|
2589
2666
|
}, headerElement, column.getCanSort() && React__default.createElement(MRT_TableHeadCellSortLabel, {
|
@@ -2785,19 +2862,21 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
2785
2862
|
type: "button",
|
2786
2863
|
variant: "text"
|
2787
2864
|
}, buttonProps, {
|
2788
|
-
sx:
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2865
|
+
sx: function sx(theme) {
|
2866
|
+
return _extends({
|
2867
|
+
backgroundColor: 'transparent',
|
2868
|
+
border: 'none',
|
2869
|
+
color: 'inherit',
|
2870
|
+
cursor: 'copy',
|
2871
|
+
fontFamily: 'inherit',
|
2872
|
+
fontSize: 'inherit',
|
2873
|
+
letterSpacing: 'inherit',
|
2874
|
+
m: '-0.25rem',
|
2875
|
+
minWidth: 'unset',
|
2876
|
+
textAlign: 'inherit',
|
2877
|
+
textTransform: 'inherit'
|
2878
|
+
}, (buttonProps == null ? void 0 : buttonProps.sx) instanceof Function ? buttonProps.sx(theme) : buttonProps == null ? void 0 : buttonProps.sx);
|
2879
|
+
}
|
2801
2880
|
}), children));
|
2802
2881
|
};
|
2803
2882
|
|
@@ -2952,7 +3031,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
2952
3031
|
'&:hover': {
|
2953
3032
|
backgroundColor: enableHover && enableEditing && editingMode !== 'row' ? theme.palette.mode === 'dark' ? material.lighten(theme.palette.background["default"], 0.13) + " !important" : material.darken(theme.palette.background["default"], 0.07) + " !important" : undefined
|
2954
3033
|
}
|
2955
|
-
}, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
|
3034
|
+
}, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
|
2956
3035
|
maxWidth: "min(" + column.getSize() + "px, fit-content)",
|
2957
3036
|
minWidth: "max(" + column.getSize() + "px, " + ((_columnDef$minSize = columnDef.minSize) != null ? _columnDef$minSize : 30) + "px)",
|
2958
3037
|
width: column.getSize()
|
@@ -3003,13 +3082,15 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
3003
3082
|
return React__default.createElement(material.TableRow, Object.assign({}, tableRowProps), React__default.createElement(material.TableCell, Object.assign({
|
3004
3083
|
colSpan: getVisibleLeafColumns().length
|
3005
3084
|
}, tableCellProps, {
|
3006
|
-
sx:
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3085
|
+
sx: function sx(theme) {
|
3086
|
+
return _extends({
|
3087
|
+
borderBottom: !row.getIsExpanded() ? 'none' : undefined,
|
3088
|
+
pb: row.getIsExpanded() ? '1rem' : 0,
|
3089
|
+
pt: row.getIsExpanded() ? '1rem' : 0,
|
3090
|
+
transition: 'all 0.2s ease-in-out',
|
3091
|
+
width: table.getTotalSize() + "px"
|
3092
|
+
}, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
|
3093
|
+
}
|
3013
3094
|
}), renderDetailPanel && React__default.createElement(material.Collapse, {
|
3014
3095
|
"in": row.getIsExpanded()
|
3015
3096
|
}, renderDetailPanel({
|
@@ -3067,7 +3148,7 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
3067
3148
|
'&:hover td': {
|
3068
3149
|
backgroundColor: (tableRowProps == null ? void 0 : tableRowProps.hover) !== false && getIsSomeColumnsPinned() ? theme.palette.mode === 'dark' ? "" + material.lighten(theme.palette.background["default"], 0.12) : "" + material.darken(theme.palette.background["default"], 0.05) : undefined
|
3069
3150
|
}
|
3070
|
-
}, tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
|
3151
|
+
}, (tableRowProps == null ? void 0 : tableRowProps.sx) instanceof Function ? tableRowProps.sx(theme) : tableRowProps == null ? void 0 : tableRowProps.sx, draggingBorders);
|
3071
3152
|
}
|
3072
3153
|
}), row == null ? void 0 : (_row$getVisibleCells = row.getVisibleCells()) == null ? void 0 : _row$getVisibleCells.map == null ? void 0 : _row$getVisibleCells.map(function (cell) {
|
3073
3154
|
return React__default.createElement(MRT_TableBodyCell, {
|
@@ -3203,7 +3284,7 @@ var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
3203
3284
|
transition: "all " + (enableColumnResizing ? '10ms' : '0.2s') + " ease-in-out",
|
3204
3285
|
width: column.getSize(),
|
3205
3286
|
verticalAlign: 'text-top'
|
3206
|
-
}, tableCellProps == null ? void 0 : tableCellProps.sx);
|
3287
|
+
}, (tableCellProps == null ? void 0 : tableCellProps.sx) instanceof Function ? tableCellProps.sx(theme) : tableCellProps == null ? void 0 : tableCellProps.sx);
|
3207
3288
|
}
|
3208
3289
|
}), React__default.createElement(React__default.Fragment, null, footer.isPlaceholder ? null : (_ref2 = (_ref3 = columnDef.Footer instanceof Function ? columnDef.Footer == null ? void 0 : columnDef.Footer({
|
3209
3290
|
footer: footer,
|
@@ -3271,9 +3352,11 @@ var MRT_Table = function MRT_Table(_ref) {
|
|
3271
3352
|
return React__default.createElement(material.Table, Object.assign({
|
3272
3353
|
stickyHeader: enableStickyHeader || enableRowVirtualization || isFullScreen
|
3273
3354
|
}, tableProps, {
|
3274
|
-
sx:
|
3275
|
-
|
3276
|
-
|
3355
|
+
sx: function sx(theme) {
|
3356
|
+
return _extends({
|
3357
|
+
tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
|
3358
|
+
}, (tableProps == null ? void 0 : tableProps.sx) instanceof Function ? tableProps.sx(theme) : tableProps == null ? void 0 : tableProps.sx);
|
3359
|
+
}
|
3277
3360
|
}), enableTableHead && React__default.createElement(MRT_TableHead, {
|
3278
3361
|
table: table
|
3279
3362
|
}), React__default.createElement(MRT_TableBody, {
|
@@ -3315,11 +3398,13 @@ var MRT_TableContainer = function MRT_TableContainer(_ref) {
|
|
3315
3398
|
return React__default.createElement(material.TableContainer, Object.assign({
|
3316
3399
|
ref: tableContainerRef
|
3317
3400
|
}, tableContainerProps, {
|
3318
|
-
sx:
|
3319
|
-
|
3320
|
-
|
3321
|
-
|
3322
|
-
|
3401
|
+
sx: function sx(theme) {
|
3402
|
+
return _extends({
|
3403
|
+
maxWidth: '100%',
|
3404
|
+
maxHeight: enableStickyHeader || enableRowVirtualization ? "clamp(350px, calc(100vh - " + totalToolbarHeight + "px), 9999px)" : undefined,
|
3405
|
+
overflow: 'auto'
|
3406
|
+
}, (tableContainerProps == null ? void 0 : tableContainerProps.sx) instanceof Function ? tableContainerProps.sx(theme) : tableContainerProps == null ? void 0 : tableContainerProps.sx);
|
3407
|
+
},
|
3323
3408
|
style: _extends({
|
3324
3409
|
maxHeight: isFullScreen ? "calc(100vh - " + totalToolbarHeight + "px)" : undefined
|
3325
3410
|
}, tableContainerProps == null ? void 0 : tableContainerProps.style)
|