material-react-table 1.0.4 → 1.0.6
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
CHANGED
|
@@ -510,19 +510,19 @@ const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table,
|
|
|
510
510
|
|
|
511
511
|
const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
|
|
512
512
|
const getAllLeafColumnDefs = (columns) => {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return
|
|
513
|
+
const allLeafColumnDefs = [];
|
|
514
|
+
const getLeafColumns = (cols) => {
|
|
515
|
+
cols.forEach((col) => {
|
|
516
|
+
if (col.columns) {
|
|
517
|
+
getLeafColumns(col.columns);
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
allLeafColumnDefs.push(col);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
getLeafColumns(columns);
|
|
525
|
+
return allLeafColumnDefs;
|
|
526
526
|
};
|
|
527
527
|
const prepareColumns = ({ columnDefs, columnFilterFns, defaultDisplayColumn, filterFns, sortingFns, }) => columnDefs.map((columnDef) => {
|
|
528
528
|
var _a, _b;
|
|
@@ -574,9 +574,10 @@ const getLeadingDisplayColumnIds = (props) => {
|
|
|
574
574
|
var _a;
|
|
575
575
|
return [
|
|
576
576
|
(props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
|
|
577
|
-
|
|
578
|
-
(props.
|
|
579
|
-
|
|
577
|
+
props.positionActionsColumn === 'first' &&
|
|
578
|
+
(props.enableRowActions ||
|
|
579
|
+
(props.enableEditing &&
|
|
580
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
580
581
|
'mrt-row-actions',
|
|
581
582
|
props.positionExpandColumn === 'first' &&
|
|
582
583
|
showExpandColumn(props) &&
|
|
@@ -588,9 +589,10 @@ const getLeadingDisplayColumnIds = (props) => {
|
|
|
588
589
|
const getTrailingDisplayColumnIds = (props) => {
|
|
589
590
|
var _a;
|
|
590
591
|
return [
|
|
591
|
-
|
|
592
|
-
(props.
|
|
593
|
-
|
|
592
|
+
props.positionActionsColumn === 'last' &&
|
|
593
|
+
(props.enableRowActions ||
|
|
594
|
+
(props.enableEditing &&
|
|
595
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
594
596
|
'mrt-row-actions',
|
|
595
597
|
props.positionExpandColumn === 'last' &&
|
|
596
598
|
showExpandColumn(props) &&
|