material-react-table 0.24.1 → 0.25.0
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/MaterialReactTable.d.ts +18 -16
- package/dist/material-react-table.cjs.development.js +68 -75
- 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 +68 -75
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/package.json +3 -3
- package/src/MaterialReactTable.tsx +29 -24
- package/src/body/MRT_TableBodyCell.tsx +3 -1
- package/src/head/MRT_TableHeadCell.tsx +29 -29
- package/src/inputs/MRT_FilterTextField.tsx +4 -3
- package/src/inputs/MRT_SelectCheckbox.tsx +13 -18
- package/src/menus/MRT_ColumnActionMenu.tsx +16 -15
- package/src/table/MRT_TableRoot.tsx +45 -28
- package/src/utils.ts +2 -1
@@ -1141,8 +1141,8 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
1141
1141
|
sx: commonMenuItemStyles$1
|
1142
1142
|
}, React.createElement(Box, {
|
1143
1143
|
sx: commonListItemStyles
|
1144
|
-
}, React.createElement(ListItemIcon, null, React.createElement(PushPinIcon, null)), localization.unpin))], enableColumnResizing && [React.createElement(MenuItem, {
|
1145
|
-
disabled: !
|
1144
|
+
}, React.createElement(ListItemIcon, null, React.createElement(PushPinIcon, null)), localization.unpin))], enableColumnResizing && column.getCanResize() && [React.createElement(MenuItem, {
|
1145
|
+
disabled: !columnSizing[column.id],
|
1146
1146
|
key: 0,
|
1147
1147
|
onClick: handleResetColumnSize,
|
1148
1148
|
sx: commonMenuItemStyles$1
|
@@ -1358,19 +1358,7 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
1358
1358
|
var _getState = getState(),
|
1359
1359
|
density = _getState.density;
|
1360
1360
|
|
1361
|
-
var
|
1362
|
-
if (selectAll) {
|
1363
|
-
if (selectAllMode === 'all') {
|
1364
|
-
table.getToggleAllRowsSelectedHandler()(event);
|
1365
|
-
} else if (selectAllMode === 'page') {
|
1366
|
-
table.getToggleAllPageRowsSelectedHandler()(event);
|
1367
|
-
}
|
1368
|
-
} else if (row) {
|
1369
|
-
row == null ? void 0 : row.getToggleSelectedHandler()(event);
|
1370
|
-
}
|
1371
|
-
};
|
1372
|
-
|
1373
|
-
var checkboxProps = selectAll ? muiSelectAllCheckboxProps instanceof Function ? muiSelectAllCheckboxProps({
|
1361
|
+
var checkboxProps = !row ? muiSelectAllCheckboxProps instanceof Function ? muiSelectAllCheckboxProps({
|
1374
1362
|
table: table
|
1375
1363
|
}) : muiSelectAllCheckboxProps : muiSelectCheckboxProps instanceof Function ? muiSelectCheckboxProps({
|
1376
1364
|
row: row,
|
@@ -1387,12 +1375,13 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
1387
1375
|
inputProps: {
|
1388
1376
|
'aria-label': selectAll ? localization.toggleSelectAll : localization.toggleSelectRow
|
1389
1377
|
},
|
1390
|
-
onChange:
|
1378
|
+
onChange: !row ? selectAllMode === 'all' ? table.getToggleAllRowsSelectedHandler() : table.getToggleAllPageRowsSelectedHandler() : row.getToggleSelectedHandler(),
|
1391
1379
|
size: density === 'compact' ? 'small' : 'medium'
|
1392
1380
|
}, checkboxProps, {
|
1393
1381
|
sx: _extends({
|
1394
|
-
height: density === 'compact' ? '1.
|
1395
|
-
width: density === 'compact' ? '1.
|
1382
|
+
height: density === 'compact' ? '1.5rem' : '2rem',
|
1383
|
+
width: density === 'compact' ? '1.5rem' : '2rem',
|
1384
|
+
m: '-1re.m'
|
1396
1385
|
}, checkboxProps == null ? void 0 : checkboxProps.sx)
|
1397
1386
|
})));
|
1398
1387
|
};
|
@@ -2096,16 +2085,16 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
2096
2085
|
setFilterValue = _useState2[1];
|
2097
2086
|
|
2098
2087
|
var handleChangeDebounced = useCallback(debounce(function (event) {
|
2088
|
+
var value = textFieldProps.type === 'date' ? new Date(event.target.value) : event.target.value;
|
2089
|
+
|
2099
2090
|
if (inputIndex !== undefined) {
|
2100
2091
|
column.setFilterValue(function (old) {
|
2101
2092
|
var newFilterValues = old != null ? old : ['', ''];
|
2102
|
-
newFilterValues[inputIndex] =
|
2093
|
+
newFilterValues[inputIndex] = value;
|
2103
2094
|
return newFilterValues;
|
2104
2095
|
});
|
2105
2096
|
} else {
|
2106
|
-
|
2107
|
-
|
2108
|
-
column.setFilterValue((_event$target$value = event.target.value) != null ? _event$target$value : undefined);
|
2097
|
+
column.setFilterValue(value != null ? value : undefined);
|
2109
2098
|
}
|
2110
2099
|
}, 200), []);
|
2111
2100
|
|
@@ -2512,11 +2501,6 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2512
2501
|
|
2513
2502
|
var tableCellProps = _extends({}, mTableHeadCellProps, mcTableHeadCellProps);
|
2514
2503
|
|
2515
|
-
var headerElement = (_ref2 = (columnDef == null ? void 0 : columnDef.Header) instanceof Function ? columnDef == null ? void 0 : columnDef.Header == null ? void 0 : columnDef.Header({
|
2516
|
-
header: header,
|
2517
|
-
table: table
|
2518
|
-
}) : columnDef == null ? void 0 : columnDef.Header) != null ? _ref2 : columnDef.header;
|
2519
|
-
|
2520
2504
|
var getIsLastLeftPinnedColumn = function getIsLastLeftPinnedColumn() {
|
2521
2505
|
return column.getIsPinned() === 'left' && table.getLeftLeafHeaders().length - 1 === column.getPinnedIndex();
|
2522
2506
|
};
|
@@ -2531,17 +2515,21 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2531
2515
|
|
2532
2516
|
var handleDragEnter = function handleDragEnter(_e) {
|
2533
2517
|
if (enableColumnOrdering && currentDraggingColumn) {
|
2534
|
-
setCurrentHoveredColumn(
|
2518
|
+
setCurrentHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
2535
2519
|
}
|
2536
2520
|
};
|
2537
2521
|
|
2538
|
-
var tableHeadCellRef = React.useRef(null);
|
2539
2522
|
var draggingBorder = (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id ? "1px dashed " + theme.palette.divider : (currentHoveredColumn == null ? void 0 : currentHoveredColumn.id) === column.id ? "2px dashed " + theme.palette.primary.main : undefined;
|
2540
2523
|
var draggingBorders = draggingBorder ? {
|
2541
2524
|
borderLeft: draggingBorder,
|
2542
2525
|
borderRight: draggingBorder,
|
2543
2526
|
borderTop: draggingBorder
|
2544
2527
|
} : undefined;
|
2528
|
+
var headerElement = (_ref2 = (columnDef == null ? void 0 : columnDef.Header) instanceof Function ? columnDef == null ? void 0 : columnDef.Header == null ? void 0 : columnDef.Header({
|
2529
|
+
header: header,
|
2530
|
+
table: table
|
2531
|
+
}) : columnDef == null ? void 0 : columnDef.Header) != null ? _ref2 : columnDef.header;
|
2532
|
+
var tableHeadCellRef = React.useRef(null);
|
2545
2533
|
return React.createElement(TableCell, Object.assign({
|
2546
2534
|
align: columnDefType === 'group' ? 'center' : 'left',
|
2547
2535
|
colSpan: header.colSpan,
|
@@ -2566,7 +2554,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2566
2554
|
right: column.getIsPinned() === 'right' ? getTotalRight() + "px" : undefined,
|
2567
2555
|
transition: "all " + (enableColumnResizing ? 0 : '0.2s') + " ease-in-out",
|
2568
2556
|
userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined,
|
2569
|
-
verticalAlign: '
|
2557
|
+
verticalAlign: 'top',
|
2570
2558
|
zIndex: column.getIsResizing() || (currentDraggingColumn == null ? void 0 : currentDraggingColumn.id) === column.id ? 3 : column.getIsPinned() && columnDefType !== 'group' ? 2 : 1
|
2571
2559
|
}, tableCellProps == null ? void 0 : tableCellProps.sx, draggingBorders, {
|
2572
2560
|
maxWidth: "min(" + column.getSize() + "px, fit-content)",
|
@@ -2574,7 +2562,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2574
2562
|
width: header.getSize()
|
2575
2563
|
});
|
2576
2564
|
}
|
2577
|
-
}), header.isPlaceholder ? null :
|
2565
|
+
}), header.isPlaceholder ? null : React.createElement(Box, {
|
2578
2566
|
sx: {
|
2579
2567
|
alignItems: 'flex-start',
|
2580
2568
|
display: 'flex',
|
@@ -2591,27 +2579,27 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2591
2579
|
flexWrap: 'nowrap',
|
2592
2580
|
whiteSpace: ((_columnDef$header$len = (_columnDef$header = columnDef.header) == null ? void 0 : _columnDef$header.length) != null ? _columnDef$header$len : 0) < 24 ? 'nowrap' : 'normal'
|
2593
2581
|
}
|
2594
|
-
}, headerElement,
|
2582
|
+
}, headerElement, column.getCanSort() && React.createElement(MRT_TableHeadCellSortLabel, {
|
2595
2583
|
header: header,
|
2596
2584
|
table: table
|
2597
|
-
}),
|
2585
|
+
}), column.getCanFilter() && React.createElement(MRT_TableHeadCellFilterLabel, {
|
2598
2586
|
header: header,
|
2599
2587
|
table: table
|
2600
|
-
})), React.createElement(Box, {
|
2588
|
+
})), columnDefType !== 'group' && React.createElement(Box, {
|
2601
2589
|
sx: {
|
2602
2590
|
whiteSpace: 'nowrap'
|
2603
2591
|
}
|
2604
|
-
},
|
2592
|
+
}, (enableColumnDragging && columnDef.enableColumnDragging !== false || enableColumnOrdering && columnDef.enableColumnOrdering !== false || enableGrouping && columnDef.enableGrouping !== false) && React.createElement(MRT_TableHeadCellGrabHandle, {
|
2605
2593
|
column: column,
|
2606
2594
|
table: table,
|
2607
2595
|
tableHeadCellRef: tableHeadCellRef
|
2608
|
-
}), (enableColumnActions || columnDef.enableColumnActions) && columnDef.enableColumnActions !== false &&
|
2596
|
+
}), (enableColumnActions || columnDef.enableColumnActions) && columnDef.enableColumnActions !== false && React.createElement(MRT_TableHeadCellColumnActionsButton, {
|
2609
2597
|
header: header,
|
2610
2598
|
table: table
|
2611
2599
|
})), column.getCanResize() && React.createElement(MRT_TableHeadCellResizeHandle, {
|
2612
2600
|
header: header,
|
2613
2601
|
table: table
|
2614
|
-
})),
|
2602
|
+
})), column.getCanFilter() && React.createElement(MRT_TableHeadCellFilterContainer, {
|
2615
2603
|
header: header,
|
2616
2604
|
table: table
|
2617
2605
|
}));
|
@@ -2922,7 +2910,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
2922
2910
|
|
2923
2911
|
var handleDragEnter = function handleDragEnter(_e) {
|
2924
2912
|
if (enableColumnOrdering && currentDraggingColumn) {
|
2925
|
-
setCurrentHoveredColumn(
|
2913
|
+
setCurrentHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
2926
2914
|
}
|
2927
2915
|
};
|
2928
2916
|
|
@@ -3380,8 +3368,23 @@ var MRT_TablePaper = function MRT_TablePaper(_ref) {
|
|
3380
3368
|
}));
|
3381
3369
|
};
|
3382
3370
|
|
3371
|
+
var defaultDisplayColumnDefOptions = {
|
3372
|
+
columnDefType: 'display',
|
3373
|
+
enableClickToCopy: false,
|
3374
|
+
enableColumnActions: false,
|
3375
|
+
enableColumnDragging: false,
|
3376
|
+
enableColumnFilter: false,
|
3377
|
+
enableColumnOrdering: false,
|
3378
|
+
enableEditing: false,
|
3379
|
+
enableGlobalFilter: false,
|
3380
|
+
enableGrouping: false,
|
3381
|
+
enableHiding: false,
|
3382
|
+
enablePinning: false,
|
3383
|
+
enableResizing: false,
|
3384
|
+
enableSorting: false
|
3385
|
+
};
|
3383
3386
|
var MRT_TableRoot = function MRT_TableRoot(props) {
|
3384
|
-
var _initialState$columnO, _initialState$current, _initialState$current2, _initialState$density, _initialState$isFullS, _props$initialState$s, _props$initialState2, _initialState$showCol, _initialState$showGlo, _props$state3, _props$state4, _MRT_FilterFns$curren, _props$onCurrentDragg, _props$onCurrentDragg2, _props$onCurrentEditi, _props$onCurrentEditi2, _props$onCurrentFilte, _props$onCurrentGloba, _props$onCurrentHover, _props$onCurrentHover2, _props$onDensityChang, _props$onIsFullScreen, _props$onShowAlertBan, _props$onShowFiltersC, _props$onShowGlobalFi;
|
3387
|
+
var _initialState$columnO, _initialState$current, _initialState$current2, _initialState$current3, _initialState$current4, _initialState$current5, _initialState$current6, _initialState$density, _initialState$isFullS, _props$initialState$s, _props$initialState2, _initialState$showCol, _initialState$showGlo, _props$state3, _props$state4, _MRT_FilterFns$curren, _props$onCurrentDragg, _props$onCurrentDragg2, _props$onCurrentEditi, _props$onCurrentEditi2, _props$onCurrentFilte, _props$onCurrentGloba, _props$onCurrentHover, _props$onCurrentHover2, _props$onDensityChang, _props$onIsFullScreen, _props$onShowAlertBan, _props$onShowFiltersC, _props$onShowGlobalFi;
|
3385
3388
|
|
3386
3389
|
var _useState = useState(props.tableId),
|
3387
3390
|
tableId = _useState[0],
|
@@ -3404,27 +3407,27 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3404
3407
|
columnOrder = _useState2[0],
|
3405
3408
|
setColumnOrder = _useState2[1];
|
3406
3409
|
|
3407
|
-
var _useState3 = useState(null),
|
3410
|
+
var _useState3 = useState((_initialState$current = initialState.currentDraggingColumn) != null ? _initialState$current : null),
|
3408
3411
|
currentDraggingColumn = _useState3[0],
|
3409
3412
|
setCurrentDraggingColumn = _useState3[1];
|
3410
3413
|
|
3411
|
-
var _useState4 = useState(null),
|
3414
|
+
var _useState4 = useState((_initialState$current2 = initialState.currentDraggingRow) != null ? _initialState$current2 : null),
|
3412
3415
|
currentDraggingRow = _useState4[0],
|
3413
3416
|
setCurrentDraggingRow = _useState4[1];
|
3414
3417
|
|
3415
|
-
var _useState5 = useState((_initialState$
|
3418
|
+
var _useState5 = useState((_initialState$current3 = initialState.currentEditingCell) != null ? _initialState$current3 : null),
|
3416
3419
|
currentEditingCell = _useState5[0],
|
3417
3420
|
setCurrentEditingCell = _useState5[1];
|
3418
3421
|
|
3419
|
-
var _useState6 = useState((_initialState$
|
3422
|
+
var _useState6 = useState((_initialState$current4 = initialState.currentEditingRow) != null ? _initialState$current4 : null),
|
3420
3423
|
currentEditingRow = _useState6[0],
|
3421
3424
|
setCurrentEditingRow = _useState6[1];
|
3422
3425
|
|
3423
|
-
var _useState7 = useState(null),
|
3426
|
+
var _useState7 = useState((_initialState$current5 = initialState.currentHoveredColumn) != null ? _initialState$current5 : null),
|
3424
3427
|
currentHoveredColumn = _useState7[0],
|
3425
3428
|
setCurrentHoveredColumn = _useState7[1];
|
3426
3429
|
|
3427
|
-
var _useState8 = useState(null),
|
3430
|
+
var _useState8 = useState((_initialState$current6 = initialState.currentHoveredRow) != null ? _initialState$current6 : null),
|
3428
3431
|
currentHoveredRow = _useState8[0],
|
3429
3432
|
setCurrentHoveredRow = _useState8[1];
|
3430
3433
|
|
@@ -3450,9 +3453,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3450
3453
|
|
3451
3454
|
var _useState14 = useState(function () {
|
3452
3455
|
return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (col) {
|
3453
|
-
var _ref, _col$id$toString, _col$id, _col$accessorKey, _col$filterFn$name, _ref2, _col$filterFn, _initialState$
|
3456
|
+
var _ref, _col$id$toString, _col$id, _col$accessorKey, _col$filterFn$name, _ref2, _col$filterFn, _initialState$current7, _ref3, _col$id$toString2, _col$id2, _col$accessorKey2, _col$filterSelectOpti, _ref4;
|
3454
3457
|
|
3455
|
-
return _ref4 = {}, _ref4[(_ref = (_col$id$toString = (_col$id = col.id) == null ? void 0 : _col$id.toString()) != null ? _col$id$toString : (_col$accessorKey = col.accessorKey) == null ? void 0 : _col$accessorKey.toString()) != null ? _ref : ''] = col.filterFn instanceof Function ? (_col$filterFn$name = col.filterFn.name) != null ? _col$filterFn$name : 'custom' : (_ref2 = (_col$filterFn = col.filterFn) != null ? _col$filterFn : initialState == null ? void 0 : (_initialState$
|
3458
|
+
return _ref4 = {}, _ref4[(_ref = (_col$id$toString = (_col$id = col.id) == null ? void 0 : _col$id.toString()) != null ? _col$id$toString : (_col$accessorKey = col.accessorKey) == null ? void 0 : _col$accessorKey.toString()) != null ? _ref : ''] = col.filterFn instanceof Function ? (_col$filterFn$name = col.filterFn.name) != null ? _col$filterFn$name : 'custom' : (_ref2 = (_col$filterFn = col.filterFn) != null ? _col$filterFn : initialState == null ? void 0 : (_initialState$current7 = initialState.currentFilterFns) == null ? void 0 : _initialState$current7[(_ref3 = (_col$id$toString2 = (_col$id2 = col.id) == null ? void 0 : _col$id2.toString()) != null ? _col$id$toString2 : (_col$accessorKey2 = col.accessorKey) == null ? void 0 : _col$accessorKey2.toString()) != null ? _ref3 : '']) != null ? _ref2 : !!((_col$filterSelectOpti = col.filterSelectOptions) != null && _col$filterSelectOpti.length) ? 'equals' : 'fuzzy', _ref4;
|
3456
3459
|
})));
|
3457
3460
|
}),
|
3458
3461
|
currentFilterFns = _useState14[0],
|
@@ -3463,16 +3466,14 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3463
3466
|
setCurrentGlobalFilterFn = _useState15[1];
|
3464
3467
|
|
3465
3468
|
var displayColumns = useMemo(function () {
|
3466
|
-
var _props$localization, _props$localization2, _props$localization3, _props$localization4, _props$localization6;
|
3469
|
+
var _props$localization, _props$displayColumnD, _props$localization2, _props$displayColumnD2, _props$localization3, _props$displayColumnD3, _props$localization4, _props$displayColumnD4, _props$localization6, _props$displayColumnD5;
|
3467
3470
|
|
3468
|
-
return [columnOrder.includes('mrt-row-drag') && {
|
3469
|
-
columnDefType: 'display',
|
3471
|
+
return [columnOrder.includes('mrt-row-drag') && _extends({
|
3470
3472
|
header: (_props$localization = props.localization) == null ? void 0 : _props$localization.move,
|
3471
|
-
id: 'mrt-row-drag',
|
3472
|
-
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
3473
|
-
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
3474
3473
|
size: 60
|
3475
|
-
},
|
3474
|
+
}, defaultDisplayColumnDefOptions, (_props$displayColumnD = props.displayColumnDefOptions) == null ? void 0 : _props$displayColumnD['mrt-row-drag'], {
|
3475
|
+
id: 'mrt-row-drag'
|
3476
|
+
}), columnOrder.includes('mrt-row-actions') && _extends({
|
3476
3477
|
Cell: function Cell(_ref5) {
|
3477
3478
|
var cell = _ref5.cell;
|
3478
3479
|
return React.createElement(MRT_ToggleRowActionMenuButton, {
|
@@ -3480,13 +3481,11 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3480
3481
|
table: table
|
3481
3482
|
});
|
3482
3483
|
},
|
3483
|
-
columnDefType: 'display',
|
3484
3484
|
header: (_props$localization2 = props.localization) == null ? void 0 : _props$localization2.actions,
|
3485
|
-
id: 'mrt-row-actions',
|
3486
|
-
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
3487
|
-
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
3488
3485
|
size: 70
|
3489
|
-
},
|
3486
|
+
}, defaultDisplayColumnDefOptions, (_props$displayColumnD2 = props.displayColumnDefOptions) == null ? void 0 : _props$displayColumnD2['mrt-row-actions'], {
|
3487
|
+
id: 'mrt-row-actions'
|
3488
|
+
}), columnOrder.includes('mrt-row-expand') && _extends({
|
3490
3489
|
Cell: function Cell(_ref6) {
|
3491
3490
|
var cell = _ref6.cell;
|
3492
3491
|
return React.createElement(MRT_ExpandButton, {
|
@@ -3499,13 +3498,11 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3499
3498
|
table: table
|
3500
3499
|
}) : null;
|
3501
3500
|
},
|
3502
|
-
columnDefType: 'display',
|
3503
3501
|
header: (_props$localization3 = props.localization) == null ? void 0 : _props$localization3.expand,
|
3504
|
-
id: 'mrt-row-expand',
|
3505
|
-
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
3506
|
-
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
3507
3502
|
size: 60
|
3508
|
-
},
|
3503
|
+
}, defaultDisplayColumnDefOptions, (_props$displayColumnD3 = props.displayColumnDefOptions) == null ? void 0 : _props$displayColumnD3['mrt-row-expand'], {
|
3504
|
+
id: 'mrt-row-expand'
|
3505
|
+
}), columnOrder.includes('mrt-row-select') && _extends({
|
3509
3506
|
Cell: function Cell(_ref7) {
|
3510
3507
|
var cell = _ref7.cell;
|
3511
3508
|
return React.createElement(MRT_SelectCheckbox, {
|
@@ -3519,13 +3516,11 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3519
3516
|
table: table
|
3520
3517
|
}) : null;
|
3521
3518
|
},
|
3522
|
-
columnDefType: 'display',
|
3523
3519
|
header: (_props$localization4 = props.localization) == null ? void 0 : _props$localization4.select,
|
3524
|
-
id: 'mrt-row-select',
|
3525
|
-
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
3526
|
-
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
3527
3520
|
size: 60
|
3528
|
-
},
|
3521
|
+
}, defaultDisplayColumnDefOptions, (_props$displayColumnD4 = props.displayColumnDefOptions) == null ? void 0 : _props$displayColumnD4['mrt-row-select'], {
|
3522
|
+
id: 'mrt-row-select'
|
3523
|
+
}), columnOrder.includes('mrt-row-numbers') && _extends({
|
3529
3524
|
Cell: function Cell(_ref8) {
|
3530
3525
|
var cell = _ref8.cell;
|
3531
3526
|
return cell.row.index + 1;
|
@@ -3535,14 +3530,12 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3535
3530
|
|
3536
3531
|
return (_props$localization5 = props.localization) == null ? void 0 : _props$localization5.rowNumber;
|
3537
3532
|
},
|
3538
|
-
columnDefType: 'display',
|
3539
3533
|
header: (_props$localization6 = props.localization) == null ? void 0 : _props$localization6.rowNumbers,
|
3540
|
-
id: 'mrt-row-numbers',
|
3541
|
-
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
3542
|
-
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
3543
3534
|
size: 60
|
3544
|
-
}
|
3545
|
-
|
3535
|
+
}, defaultDisplayColumnDefOptions, (_props$displayColumnD5 = props.displayColumnDefOptions) == null ? void 0 : _props$displayColumnD5['mrt-row-numbers'], {
|
3536
|
+
id: 'mrt-row-numbers'
|
3537
|
+
})].filter(Boolean);
|
3538
|
+
}, [columnOrder, props.displayColumnDefOptions, props.editingMode, props.enableColumnDragging, props.enableColumnOrdering, props.enableEditing, props.enableExpandAll, props.enableExpanding, props.enableGrouping, props.enableRowActions, props.enableRowDragging, props.enableRowNumbers, props.enableRowOrdering, props.enableRowSelection, props.enableSelectAll, props.localization, props.muiTableBodyCellProps, props.muiTableHeadCellProps, props.positionActionsColumn]);
|
3546
3539
|
var columnDefs = useMemo(function () {
|
3547
3540
|
return prepareColumns([].concat(displayColumns, props.columns), currentFilterFns);
|
3548
3541
|
}, [currentFilterFns, displayColumns, props.columns]);
|