material-react-table 0.36.1 → 0.37.1
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 +7 -3
- package/dist/cjs/MaterialReactTable.d.ts +33 -15
- package/dist/cjs/body/MRT_EditRowModal.d.ts +8 -0
- package/dist/cjs/buttons/MRT_EditActionButtons.d.ts +5 -5
- package/dist/cjs/column.utils.d.ts +2 -1
- package/dist/cjs/index.js +187 -118
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/inputs/MRT_EditCellTextField.d.ts +5 -5
- package/dist/esm/MaterialReactTable.d.ts +33 -15
- package/dist/esm/body/MRT_EditRowModal.d.ts +8 -0
- package/dist/esm/buttons/MRT_EditActionButtons.d.ts +5 -5
- package/dist/esm/column.utils.d.ts +2 -1
- package/dist/esm/inputs/MRT_EditCellTextField.d.ts +5 -5
- package/dist/esm/material-react-table.esm.js +188 -119
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +33 -15
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +48 -12
- package/src/body/MRT_EditRowModal.tsx +59 -0
- package/src/body/MRT_TableBodyCell.tsx +12 -16
- package/src/body/MRT_TableBodyRow.tsx +1 -1
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +3 -2
- package/src/buttons/MRT_CopyButton.tsx +2 -2
- package/src/buttons/MRT_EditActionButtons.tsx +49 -25
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -16
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +2 -1
- package/src/column.utils.ts +19 -12
- package/src/inputs/MRT_EditCellTextField.tsx +33 -19
- package/src/inputs/MRT_FilterTextField.tsx +9 -6
- package/src/inputs/MRT_GlobalFilterTextField.tsx +7 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +2 -12
- package/src/table/MRT_TableContainer.tsx +10 -10
- package/src/table/MRT_TableRoot.tsx +48 -30
- package/src/toolbar/MRT_BottomToolbar.tsx +8 -2
- package/src/toolbar/MRT_TopToolbar.tsx +8 -2
|
@@ -2,7 +2,7 @@ import React, { useMemo, useRef, useState, useCallback, Fragment, useEffect, use
|
|
|
2
2
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
3
3
|
import { ArrowRight, Cancel, CheckBox, ClearAll, Close, DensityLarge, DensityMedium, DensitySmall, DragHandle, DynamicFeed, Edit, ExpandLess, ExpandMore, FilterAlt, FilterAltOff, FilterList, FilterListOff, FullscreenExit, Fullscreen, KeyboardDoubleArrowDown, MoreHoriz, MoreVert, PushPin, RestartAlt, Save, Search, SearchOff, Sort, ViewColumn, VisibilityOff } from '@mui/icons-material';
|
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
5
|
-
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, ListItemText, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog } from '@mui/material';
|
|
5
|
+
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, ListItemText, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, DialogTitle, DialogContent, Stack, DialogActions } from '@mui/material';
|
|
6
6
|
import { useVirtual } from 'react-virtual';
|
|
7
7
|
|
|
8
8
|
/******************************************************************************
|
|
@@ -500,10 +500,9 @@ const prepareColumns = (columnDefs, columnFilterFns, filterFns, sortingFns) => c
|
|
|
500
500
|
else if (columnDef.columnDefType === 'data') {
|
|
501
501
|
if (Object.keys(filterFns).includes(columnFilterFns[columnDef.id])) {
|
|
502
502
|
columnDef.filterFn =
|
|
503
|
-
// @ts-ignore
|
|
504
503
|
(_b = filterFns[columnFilterFns[columnDef.id]]) !== null && _b !== void 0 ? _b : filterFns.fuzzy;
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
columnDef._filterFn =
|
|
505
|
+
columnFilterFns[columnDef.id];
|
|
507
506
|
}
|
|
508
507
|
if (Object.keys(sortingFns).includes(columnDef.sortingFn)) {
|
|
509
508
|
// @ts-ignore
|
|
@@ -522,29 +521,36 @@ const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
|
|
|
522
521
|
columnOrder.splice(columnOrder.indexOf(targetColumn.id), 0, columnOrder.splice(columnOrder.indexOf(draggedColumn.id), 1)[0]);
|
|
523
522
|
return [...columnOrder];
|
|
524
523
|
};
|
|
525
|
-
const
|
|
526
|
-
(props.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
(props.
|
|
532
|
-
|
|
533
|
-
props.
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
'
|
|
547
|
-
|
|
524
|
+
const showExpandColumn = (props, grouping) => !!(props.enableExpanding ||
|
|
525
|
+
(props.enableGrouping && (grouping === undefined || (grouping === null || grouping === void 0 ? void 0 : grouping.length))) ||
|
|
526
|
+
props.renderDetailPanel);
|
|
527
|
+
const getLeadingDisplayColumnIds = (props) => {
|
|
528
|
+
var _a;
|
|
529
|
+
return [
|
|
530
|
+
(props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
|
|
531
|
+
((props.positionActionsColumn === 'first' && props.enableRowActions) ||
|
|
532
|
+
(props.enableEditing &&
|
|
533
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
534
|
+
'mrt-row-actions',
|
|
535
|
+
props.positionExpandColumn === 'first' &&
|
|
536
|
+
showExpandColumn(props) &&
|
|
537
|
+
'mrt-row-expand',
|
|
538
|
+
props.enableRowSelection && 'mrt-row-select',
|
|
539
|
+
props.enableRowNumbers && 'mrt-row-numbers',
|
|
540
|
+
].filter(Boolean);
|
|
541
|
+
};
|
|
542
|
+
const getTrailingDisplayColumnIds = (props) => {
|
|
543
|
+
var _a;
|
|
544
|
+
return [
|
|
545
|
+
((props.positionActionsColumn === 'last' && props.enableRowActions) ||
|
|
546
|
+
(props.enableEditing &&
|
|
547
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
548
|
+
'mrt-row-actions',
|
|
549
|
+
props.positionExpandColumn === 'last' &&
|
|
550
|
+
showExpandColumn(props) &&
|
|
551
|
+
'mrt-row-expand',
|
|
552
|
+
];
|
|
553
|
+
};
|
|
548
554
|
const getDefaultColumnOrderIds = (props) => [
|
|
549
555
|
...getLeadingDisplayColumnIds(props),
|
|
550
556
|
...getAllLeafColumnDefs(props.columns).map((columnDef) => getColumnId(columnDef)),
|
|
@@ -696,7 +702,7 @@ const commonListItemStyles = {
|
|
|
696
702
|
};
|
|
697
703
|
const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
698
704
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
699
|
-
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { enableColumnFilterChangeMode, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting, columnFilterModeOptions, icons: { ArrowRightIcon, ClearAllIcon, ViewColumnIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, SortIcon, RestartAltIcon, VisibilityOffIcon, },
|
|
705
|
+
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { enableColumnFilterChangeMode, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting, columnFilterModeOptions, icons: { ArrowRightIcon, ClearAllIcon, ViewColumnIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, SortIcon, RestartAltIcon, VisibilityOffIcon, }, localization, }, refs: { filterInputRefs }, setShowFilters, } = table;
|
|
700
706
|
const { column } = header;
|
|
701
707
|
const { columnDef } = column;
|
|
702
708
|
const { columnSizing, columnVisibility, density } = getState();
|
|
@@ -737,13 +743,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
737
743
|
};
|
|
738
744
|
const handleFilterByColumn = () => {
|
|
739
745
|
setShowFilters(true);
|
|
740
|
-
|
|
741
|
-
var _a, _b, _c;
|
|
742
|
-
return (_c = document
|
|
743
|
-
.getElementById(
|
|
744
|
-
// @ts-ignore
|
|
745
|
-
(_b = (_a = header.muiTableHeadCellFilterTextFieldProps) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : `mrt-${tableId}-${header.id}-filter-text-field`)) === null || _c === void 0 ? void 0 : _c.focus();
|
|
746
|
-
}, 200);
|
|
746
|
+
queueMicrotask(() => { var _a; return (_a = filterInputRefs.current[`${column.id}-0`]) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
747
747
|
setAnchorEl(null);
|
|
748
748
|
};
|
|
749
749
|
const handleShowAllColumns = () => {
|
|
@@ -873,29 +873,36 @@ const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) =
|
|
|
873
873
|
})));
|
|
874
874
|
};
|
|
875
875
|
|
|
876
|
-
const MRT_EditActionButtons = ({ row, table }) => {
|
|
877
|
-
const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onEditingRowSave, }, setEditingRow, } = table;
|
|
876
|
+
const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
877
|
+
const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onEditingRowSave, }, refs: { editInputRefs }, setEditingRow, } = table;
|
|
878
878
|
const { editingRow } = getState();
|
|
879
|
-
const handleCancel = () =>
|
|
880
|
-
row._valuesCache = Object.assign({}, row.original);
|
|
881
|
-
setEditingRow(null);
|
|
882
|
-
};
|
|
879
|
+
const handleCancel = () => setEditingRow(null);
|
|
883
880
|
const handleSave = () => {
|
|
884
|
-
var _a;
|
|
881
|
+
var _a, _b;
|
|
882
|
+
//look for auto-filled input values
|
|
883
|
+
(_a = Object.values(editInputRefs === null || editInputRefs === void 0 ? void 0 : editInputRefs.current)) === null || _a === void 0 ? void 0 : _a.forEach((input) => {
|
|
884
|
+
if (input.value !== undefined &&
|
|
885
|
+
Object.hasOwn(editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache, input.name)) {
|
|
886
|
+
// @ts-ignore
|
|
887
|
+
editingRow._valuesCache[input.name] = input.value;
|
|
888
|
+
}
|
|
889
|
+
});
|
|
885
890
|
onEditingRowSave === null || onEditingRowSave === void 0 ? void 0 : onEditingRowSave({
|
|
891
|
+
exitEditingMode: () => setEditingRow(null),
|
|
886
892
|
row: editingRow !== null && editingRow !== void 0 ? editingRow : row,
|
|
887
893
|
table,
|
|
888
|
-
values: (
|
|
894
|
+
values: (_b = editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache) !== null && _b !== void 0 ? _b : Object.assign({}, row.original),
|
|
889
895
|
});
|
|
890
|
-
setEditingRow(null);
|
|
891
896
|
};
|
|
892
|
-
return (React.createElement(Box, { sx: { display: 'flex', gap: '0.75rem' } },
|
|
897
|
+
return (React.createElement(Box, { sx: { display: 'flex', gap: '0.75rem' } }, variant === 'icon' ? (React.createElement(React.Fragment, null,
|
|
893
898
|
React.createElement(Tooltip, { arrow: true, title: localization.cancel },
|
|
894
899
|
React.createElement(IconButton, { "aria-label": localization.cancel, onClick: handleCancel },
|
|
895
900
|
React.createElement(CancelIcon, null))),
|
|
896
901
|
React.createElement(Tooltip, { arrow: true, title: localization.save },
|
|
897
902
|
React.createElement(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSave },
|
|
898
|
-
React.createElement(SaveIcon, null)))))
|
|
903
|
+
React.createElement(SaveIcon, null))))) : (React.createElement(React.Fragment, null,
|
|
904
|
+
React.createElement(Button, { onClick: handleCancel }, localization.cancel),
|
|
905
|
+
React.createElement(Button, { onClick: handleSave, variant: "contained" }, localization.save)))));
|
|
899
906
|
};
|
|
900
907
|
|
|
901
908
|
const commonIconButtonStyles = {
|
|
@@ -909,7 +916,7 @@ const commonIconButtonStyles = {
|
|
|
909
916
|
},
|
|
910
917
|
};
|
|
911
918
|
const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
|
|
912
|
-
const { getState, options: { enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
|
|
919
|
+
const { getState, options: { editingMode, enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
|
|
913
920
|
const { editingRow } = getState();
|
|
914
921
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
915
922
|
const handleOpenRowActionMenu = (event) => {
|
|
@@ -921,7 +928,7 @@ const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
|
|
|
921
928
|
setEditingRow(Object.assign({}, row));
|
|
922
929
|
setAnchorEl(null);
|
|
923
930
|
};
|
|
924
|
-
return (React.createElement(React.Fragment, null, renderRowActions ? (React.createElement(React.Fragment, null, renderRowActions({ row, table }))) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) ? (React.createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React.createElement(Tooltip, { placement: "right", arrow: true, title: localization.edit },
|
|
931
|
+
return (React.createElement(React.Fragment, null, renderRowActions ? (React.createElement(React.Fragment, null, renderRowActions({ row, table }))) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) && editingMode === 'row' ? (React.createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React.createElement(Tooltip, { placement: "right", arrow: true, title: localization.edit },
|
|
925
932
|
React.createElement(IconButton, { sx: commonIconButtonStyles, onClick: handleStartEditMode },
|
|
926
933
|
React.createElement(EditIcon, null)))) : renderRowActionMenuItems ? (React.createElement(React.Fragment, null,
|
|
927
934
|
React.createElement(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions },
|
|
@@ -956,7 +963,7 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
|
|
956
963
|
|
|
957
964
|
const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
958
965
|
var _a;
|
|
959
|
-
const { getState, setGlobalFilter, options: { enableGlobalFilterChangeMode, icons: { SearchIcon, CloseIcon }, localization, muiSearchTextFieldProps,
|
|
966
|
+
const { getState, setGlobalFilter, options: { enableGlobalFilterChangeMode, icons: { SearchIcon, CloseIcon }, localization, muiSearchTextFieldProps, }, refs: { searchInputRef }, } = table;
|
|
960
967
|
const { globalFilter, showGlobalFilter } = getState();
|
|
961
968
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
962
969
|
const [searchValue, setSearchValue] = useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
|
|
@@ -979,7 +986,7 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
979
986
|
? muiSearchTextFieldProps({ table })
|
|
980
987
|
: muiSearchTextFieldProps;
|
|
981
988
|
return (React.createElement(Collapse, { in: showGlobalFilter, orientation: "horizontal" },
|
|
982
|
-
React.createElement(TextField, Object.assign({
|
|
989
|
+
React.createElement(TextField, Object.assign({ placeholder: localization.search, onChange: handleChange, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard", InputProps: {
|
|
983
990
|
startAdornment: enableGlobalFilterChangeMode ? (React.createElement(InputAdornment, { position: "start" },
|
|
984
991
|
React.createElement(Tooltip, { arrow: true, title: localization.changeSearchMode },
|
|
985
992
|
React.createElement(IconButton, { "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' } },
|
|
@@ -989,7 +996,12 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
989
996
|
React.createElement("span", null,
|
|
990
997
|
React.createElement(IconButton, { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small" },
|
|
991
998
|
React.createElement(CloseIcon, null)))))),
|
|
992
|
-
} }, textFieldProps)
|
|
999
|
+
} }, textFieldProps, { inputRef: (inputRef) => {
|
|
1000
|
+
searchInputRef.current = inputRef;
|
|
1001
|
+
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
|
1002
|
+
textFieldProps.inputRef = inputRef;
|
|
1003
|
+
}
|
|
1004
|
+
} })),
|
|
993
1005
|
React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table })));
|
|
994
1006
|
};
|
|
995
1007
|
|
|
@@ -1114,18 +1126,11 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
|
1114
1126
|
|
|
1115
1127
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
1116
1128
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
1117
|
-
const { getState, options: { icons: { SearchIcon, SearchOffIcon },
|
|
1129
|
+
const { getState, options: { icons: { SearchIcon, SearchOffIcon }, localization, }, refs: { searchInputRef }, setShowGlobalFilter, } = table;
|
|
1118
1130
|
const { showGlobalFilter } = getState();
|
|
1119
|
-
const textFieldProps = muiSearchTextFieldProps instanceof Function
|
|
1120
|
-
? muiSearchTextFieldProps({ table })
|
|
1121
|
-
: muiSearchTextFieldProps;
|
|
1122
1131
|
const handleToggleSearch = () => {
|
|
1123
1132
|
setShowGlobalFilter(!showGlobalFilter);
|
|
1124
|
-
|
|
1125
|
-
var _a, _b;
|
|
1126
|
-
return (_b = document
|
|
1127
|
-
.getElementById((_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.id) !== null && _a !== void 0 ? _a : `mrt-${tableId}-search-text-field`)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1128
|
-
}, 200);
|
|
1133
|
+
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
1129
1134
|
};
|
|
1130
1135
|
return (React.createElement(Tooltip, { arrow: true, title: localization.showHideSearch },
|
|
1131
1136
|
React.createElement(IconButton, Object.assign({ onClick: handleToggleSearch }, rest), showGlobalFilter ? React.createElement(SearchOffIcon, null) : React.createElement(SearchIcon, null))));
|
|
@@ -1184,14 +1189,20 @@ const commonToolbarStyles = ({ theme }) => ({
|
|
|
1184
1189
|
});
|
|
1185
1190
|
const MRT_TopToolbar = ({ table }) => {
|
|
1186
1191
|
var _a;
|
|
1187
|
-
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTableTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions,
|
|
1192
|
+
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTableTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions, }, refs: { topToolbarRef }, } = table;
|
|
1188
1193
|
const { isFullScreen, showGlobalFilter } = getState();
|
|
1189
1194
|
const isMobile = useMediaQuery('(max-width:720px)');
|
|
1190
1195
|
const toolbarProps = muiTableTopToolbarProps instanceof Function
|
|
1191
1196
|
? muiTableTopToolbarProps({ table })
|
|
1192
1197
|
: muiTableTopToolbarProps;
|
|
1193
1198
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
|
1194
|
-
return (React.createElement(Toolbar, Object.assign({
|
|
1199
|
+
return (React.createElement(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
|
|
1200
|
+
topToolbarRef.current = ref;
|
|
1201
|
+
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
1202
|
+
// @ts-ignore
|
|
1203
|
+
toolbarProps.ref.current = ref;
|
|
1204
|
+
}
|
|
1205
|
+
}, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' : undefined, top: isFullScreen ? '0' : undefined }, commonToolbarStyles({ theme })), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
|
1195
1206
|
? toolbarProps.sx(theme)
|
|
1196
1207
|
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
|
1197
1208
|
positionToolbarAlertBanner === 'top' && (React.createElement(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })),
|
|
@@ -1216,14 +1227,20 @@ const MRT_TopToolbar = ({ table }) => {
|
|
|
1216
1227
|
};
|
|
1217
1228
|
|
|
1218
1229
|
const MRT_BottomToolbar = ({ table }) => {
|
|
1219
|
-
const { getState, options: { enablePagination, muiTableBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions,
|
|
1230
|
+
const { getState, options: { enablePagination, muiTableBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
|
|
1220
1231
|
const { isFullScreen } = getState();
|
|
1221
1232
|
const isMobile = useMediaQuery('(max-width:720px)');
|
|
1222
1233
|
const toolbarProps = muiTableBottomToolbarProps instanceof Function
|
|
1223
1234
|
? muiTableBottomToolbarProps({ table })
|
|
1224
1235
|
: muiTableBottomToolbarProps;
|
|
1225
1236
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
|
1226
|
-
return (React.createElement(Toolbar, Object.assign({
|
|
1237
|
+
return (React.createElement(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
|
|
1238
|
+
bottomToolbarRef.current = ref;
|
|
1239
|
+
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
1240
|
+
// @ts-ignore
|
|
1241
|
+
toolbarProps.ref.current = ref;
|
|
1242
|
+
}
|
|
1243
|
+
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `-3px 0 6px ${alpha(theme.palette.common.black, 0.1)}`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
|
1227
1244
|
? toolbarProps.sx(theme)
|
|
1228
1245
|
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
|
1229
1246
|
React.createElement(MRT_LinearProgressBar, { isTopToolbar: false, table: table }),
|
|
@@ -1278,7 +1295,7 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
|
1278
1295
|
|
|
1279
1296
|
const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1280
1297
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1281
|
-
const { getState, options: { enableColumnFilterChangeMode, columnFilterModeOptions, icons: { FilterListIcon, CloseIcon }, localization, muiTableHeadCellFilterTextFieldProps,
|
|
1298
|
+
const { getState, options: { enableColumnFilterChangeMode, columnFilterModeOptions, icons: { FilterListIcon, CloseIcon }, localization, muiTableHeadCellFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
|
|
1282
1299
|
const { column } = header;
|
|
1283
1300
|
const { columnDef } = column;
|
|
1284
1301
|
const { columnFilterFns } = getState();
|
|
@@ -1303,7 +1320,6 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1303
1320
|
const isTextboxFilter = columnDef.filterVariant === 'text' ||
|
|
1304
1321
|
(!isSelectFilter && !isMultiSelectFilter);
|
|
1305
1322
|
const currentFilterOption = columnFilterFns === null || columnFilterFns === void 0 ? void 0 : columnFilterFns[header.id];
|
|
1306
|
-
const filterId = `mrt-${tableId}-${header.id}-filter-text-field${rangeFilterIndex !== null && rangeFilterIndex !== void 0 ? rangeFilterIndex : ''}`;
|
|
1307
1323
|
const filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption)
|
|
1308
1324
|
? //@ts-ignore
|
|
1309
1325
|
localization[`filter${((_b = (_a = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt) === null || _a === void 0 ? void 0 : _a.call(currentFilterOption, 0)) === null || _b === void 0 ? void 0 : _b.toUpperCase()) +
|
|
@@ -1380,14 +1396,14 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1380
1396
|
return React.createElement(React.Fragment, null, (_e = columnDef.Filter) === null || _e === void 0 ? void 0 : _e.call(columnDef, { column, header, table }));
|
|
1381
1397
|
}
|
|
1382
1398
|
return (React.createElement(React.Fragment, null,
|
|
1383
|
-
React.createElement(TextField, Object.assign({ fullWidth: true,
|
|
1399
|
+
React.createElement(TextField, Object.assign({ fullWidth: true, inputProps: {
|
|
1384
1400
|
disabled: !!filterChipLabel,
|
|
1385
1401
|
sx: {
|
|
1386
1402
|
textOverflow: 'ellipsis',
|
|
1387
1403
|
width: filterChipLabel ? 0 : undefined,
|
|
1388
1404
|
},
|
|
1389
1405
|
title: filterPlaceholder,
|
|
1390
|
-
}, helperText: showChangeModeButton ? (React.createElement("label",
|
|
1406
|
+
}, helperText: showChangeModeButton ? (React.createElement("label", null, localization.filterMode.replace('{filterType}',
|
|
1391
1407
|
// @ts-ignore
|
|
1392
1408
|
localization[`filter${((_f = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _f === void 0 ? void 0 : _f.toUpperCase()) +
|
|
1393
1409
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]))) : null, FormHelperTextProps: {
|
|
@@ -1419,7 +1435,13 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1419
1435
|
renderValue: isMultiSelectFilter
|
|
1420
1436
|
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder)) : (React.createElement(Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' } }, selected === null || selected === void 0 ? void 0 : selected.map((value) => (React.createElement(Chip, { key: value, label: value })))))
|
|
1421
1437
|
: undefined,
|
|
1422
|
-
} }, textFieldProps, {
|
|
1438
|
+
} }, textFieldProps, { inputRef: (inputRef) => {
|
|
1439
|
+
filterInputRefs.current[`${column.id}-${rangeFilterIndex !== null && rangeFilterIndex !== void 0 ? rangeFilterIndex : 0}`] =
|
|
1440
|
+
inputRef;
|
|
1441
|
+
if (textFieldProps.inputRef) {
|
|
1442
|
+
textFieldProps.inputRef = inputRef;
|
|
1443
|
+
}
|
|
1444
|
+
}, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '6rem' : 'auto', width: '100%', '& .MuiSelect-icon': {
|
|
1423
1445
|
mr: '1.5rem',
|
|
1424
1446
|
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
|
1425
1447
|
? textFieldProps.sx(theme)
|
|
@@ -1731,19 +1753,21 @@ const MRT_TableHead = ({ table }) => {
|
|
|
1731
1753
|
return (React.createElement(TableHead, Object.assign({}, tableHeadProps), getHeaderGroups().map((headerGroup) => (React.createElement(MRT_TableHeadRow, { headerGroup: headerGroup, key: headerGroup.id, table: table })))));
|
|
1732
1754
|
};
|
|
1733
1755
|
|
|
1734
|
-
const MRT_EditCellTextField = ({ cell, table }) => {
|
|
1756
|
+
const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
1735
1757
|
var _a;
|
|
1736
|
-
const { getState, options: {
|
|
1758
|
+
const { getState, options: { muiTableBodyCellEditTextFieldProps }, refs: { editInputRefs }, setEditingCell, setEditingRow, } = table;
|
|
1737
1759
|
const { column, row } = cell;
|
|
1738
1760
|
const { columnDef } = column;
|
|
1739
1761
|
const { editingRow } = getState();
|
|
1740
1762
|
const [value, setValue] = useState(() => cell.getValue());
|
|
1741
1763
|
const mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function
|
|
1742
|
-
? muiTableBodyCellEditTextFieldProps({ cell, table })
|
|
1764
|
+
? muiTableBodyCellEditTextFieldProps({ cell, column, row, table })
|
|
1743
1765
|
: muiTableBodyCellEditTextFieldProps;
|
|
1744
1766
|
const mcTableBodyCellEditTextFieldProps = columnDef.muiTableBodyCellEditTextFieldProps instanceof Function
|
|
1745
1767
|
? columnDef.muiTableBodyCellEditTextFieldProps({
|
|
1746
1768
|
cell,
|
|
1769
|
+
column,
|
|
1770
|
+
row,
|
|
1747
1771
|
table,
|
|
1748
1772
|
})
|
|
1749
1773
|
: columnDef.muiTableBodyCellEditTextFieldProps;
|
|
@@ -1757,22 +1781,26 @@ const MRT_EditCellTextField = ({ cell, table }) => {
|
|
|
1757
1781
|
var _a;
|
|
1758
1782
|
(_a = textFieldProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
|
|
1759
1783
|
if (editingRow) {
|
|
1760
|
-
|
|
1761
|
-
row._valuesCache = {};
|
|
1762
|
-
row._valuesCache[column.id] = value;
|
|
1763
|
-
setEditingRow(Object.assign({}, editingRow));
|
|
1784
|
+
setEditingRow(Object.assign(Object.assign({}, editingRow), { _valuesCache: Object.assign(Object.assign({}, editingRow._valuesCache), { [column.id]: value }) }));
|
|
1764
1785
|
}
|
|
1765
1786
|
setEditingCell(null);
|
|
1766
1787
|
};
|
|
1767
1788
|
if (columnDef.Edit) {
|
|
1768
|
-
return React.createElement(React.Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table }));
|
|
1789
|
+
return React.createElement(React.Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }));
|
|
1769
1790
|
}
|
|
1770
|
-
return (React.createElement(TextField, Object.assign({
|
|
1791
|
+
return (React.createElement(TextField, Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, label: showLabel ? column.columnDef.header : undefined, margin: "none", name: cell.id, onClick: (e) => e.stopPropagation(), placeholder: columnDef.header, value: value, variant: "standard" }, textFieldProps, { inputRef: (inputRef) => {
|
|
1792
|
+
if (inputRef) {
|
|
1793
|
+
editInputRefs.current[column.id] = inputRef;
|
|
1794
|
+
if (textFieldProps.inputRef) {
|
|
1795
|
+
textFieldProps.inputRef = inputRef;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
}, onBlur: handleBlur, onChange: handleChange })));
|
|
1771
1799
|
};
|
|
1772
1800
|
|
|
1773
1801
|
const MRT_CopyButton = ({ cell, children, table }) => {
|
|
1774
1802
|
const { options: { localization, muiTableBodyCellCopyButtonProps }, } = table;
|
|
1775
|
-
const { column } = cell;
|
|
1803
|
+
const { column, row } = cell;
|
|
1776
1804
|
const { columnDef } = column;
|
|
1777
1805
|
const [copied, setCopied] = useState(false);
|
|
1778
1806
|
const handleCopy = (text) => {
|
|
@@ -1781,7 +1809,7 @@ const MRT_CopyButton = ({ cell, children, table }) => {
|
|
|
1781
1809
|
setTimeout(() => setCopied(false), 4000);
|
|
1782
1810
|
};
|
|
1783
1811
|
const mTableBodyCellCopyButtonProps = muiTableBodyCellCopyButtonProps instanceof Function
|
|
1784
|
-
? muiTableBodyCellCopyButtonProps({ cell, table })
|
|
1812
|
+
? muiTableBodyCellCopyButtonProps({ cell, column, row, table })
|
|
1785
1813
|
: muiTableBodyCellCopyButtonProps;
|
|
1786
1814
|
const mcTableBodyCellCopyButtonProps = columnDef.muiTableBodyCellCopyButtonProps instanceof Function
|
|
1787
1815
|
? columnDef.muiTableBodyCellCopyButtonProps({
|
|
@@ -1798,12 +1826,13 @@ const MRT_CopyButton = ({ cell, children, table }) => {
|
|
|
1798
1826
|
|
|
1799
1827
|
const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
|
|
1800
1828
|
const { options: { muiTableBodyRowDragHandleProps, onRowDrop }, } = table;
|
|
1829
|
+
const { row } = cell;
|
|
1801
1830
|
const iconButtonProps = muiTableBodyRowDragHandleProps instanceof Function
|
|
1802
|
-
? muiTableBodyRowDragHandleProps({ row
|
|
1831
|
+
? muiTableBodyRowDragHandleProps({ row, table })
|
|
1803
1832
|
: muiTableBodyRowDragHandleProps;
|
|
1804
1833
|
const handleDragStart = (e) => {
|
|
1805
1834
|
e.dataTransfer.setDragImage(rowRef.current, 0, 0);
|
|
1806
|
-
table.setDraggingRow(
|
|
1835
|
+
table.setDraggingRow(row);
|
|
1807
1836
|
};
|
|
1808
1837
|
const handleDragEnd = (event) => {
|
|
1809
1838
|
onRowDrop === null || onRowDrop === void 0 ? void 0 : onRowDrop({
|
|
@@ -1820,13 +1849,13 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
|
|
|
1820
1849
|
const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
1821
1850
|
var _a, _b, _c, _d, _f, _g, _h, _j;
|
|
1822
1851
|
const theme = useTheme();
|
|
1823
|
-
const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enablePagination, enableRowNumbers, muiTableBodyCellProps, muiTableBodyCellSkeletonProps, rowNumberMode,
|
|
1852
|
+
const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enablePagination, enableRowNumbers, muiTableBodyCellProps, muiTableBodyCellSkeletonProps, rowNumberMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
|
|
1824
1853
|
const { draggingColumn, editingCell, editingRow, hoveredColumn, density, isLoading, showSkeletons, } = getState();
|
|
1825
1854
|
const { column, row } = cell;
|
|
1826
1855
|
const { columnDef } = column;
|
|
1827
1856
|
const { columnDefType } = columnDef;
|
|
1828
1857
|
const mTableCellBodyProps = muiTableBodyCellProps instanceof Function
|
|
1829
|
-
? muiTableBodyCellProps({ cell, table })
|
|
1858
|
+
? muiTableBodyCellProps({ cell, column, row, table })
|
|
1830
1859
|
: muiTableBodyCellProps;
|
|
1831
1860
|
const mcTableCellBodyProps = columnDef.muiTableBodyCellProps instanceof Function
|
|
1832
1861
|
? columnDef.muiTableBodyCellProps({ cell, table })
|
|
@@ -1835,6 +1864,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
1835
1864
|
const isEditable = (enableEditing || columnDef.enableEditing) &&
|
|
1836
1865
|
columnDef.enableEditing !== false;
|
|
1837
1866
|
const isEditing = isEditable &&
|
|
1867
|
+
editingMode !== 'modal' &&
|
|
1838
1868
|
(editingMode === 'table' ||
|
|
1839
1869
|
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id ||
|
|
1840
1870
|
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) === cell.id);
|
|
@@ -1850,13 +1880,13 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
1850
1880
|
columnDef.enableEditing !== false &&
|
|
1851
1881
|
editingMode === 'cell') {
|
|
1852
1882
|
setEditingCell(cell);
|
|
1853
|
-
|
|
1854
|
-
const textField =
|
|
1883
|
+
queueMicrotask(() => {
|
|
1884
|
+
const textField = editInputRefs.current[column.id];
|
|
1855
1885
|
if (textField) {
|
|
1856
1886
|
textField.focus();
|
|
1857
1887
|
textField.select();
|
|
1858
1888
|
}
|
|
1859
|
-
}
|
|
1889
|
+
});
|
|
1860
1890
|
}
|
|
1861
1891
|
};
|
|
1862
1892
|
const getIsLastLeftPinnedColumn = () => {
|
|
@@ -1932,10 +1962,10 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
1932
1962
|
backgroundColor: enableHover &&
|
|
1933
1963
|
enableEditing &&
|
|
1934
1964
|
columnDef.enableEditing !== false &&
|
|
1935
|
-
editingMode !== '
|
|
1965
|
+
['table', 'cell'].includes(editingMode !== null && editingMode !== void 0 ? editingMode : '')
|
|
1936
1966
|
? theme.palette.mode === 'dark'
|
|
1937
|
-
? `${lighten(theme.palette.background.default, 0.
|
|
1938
|
-
: `${darken(theme.palette.background.default, 0.
|
|
1967
|
+
? `${lighten(theme.palette.background.default, 0.2)} !important`
|
|
1968
|
+
: `${darken(theme.palette.background.default, 0.1)} !important`
|
|
1939
1969
|
: undefined,
|
|
1940
1970
|
} }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
|
1941
1971
|
? tableCellProps.sx(theme)
|
|
@@ -1946,19 +1976,19 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
1946
1976
|
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (React.createElement(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
|
1947
1977
|
(column.id === 'mrt-row-select' ||
|
|
1948
1978
|
column.id === 'mrt-row-expand' ||
|
|
1949
|
-
!row.getIsGrouped()) ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table })) : isEditing ? (React.createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
1979
|
+
!row.getIsGrouped()) ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) : isEditing ? (React.createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
1950
1980
|
columnDef.enableClickToCopy !== false ? (React.createElement(React.Fragment, null,
|
|
1951
1981
|
React.createElement(MRT_CopyButton, { cell: cell, table: table },
|
|
1952
1982
|
React.createElement(React.Fragment, null, row.getIsGrouped() && !cell.getIsGrouped()
|
|
1953
1983
|
? null
|
|
1954
|
-
: (_c = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, table })) !== null && _c !== void 0 ? _c : cell.renderValue())),
|
|
1984
|
+
: (_c = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, row, table })) !== null && _c !== void 0 ? _c : cell.renderValue())),
|
|
1955
1985
|
cell.getIsGrouped() && React.createElement(React.Fragment, null,
|
|
1956
1986
|
" (", (_d = row.subRows) === null || _d === void 0 ? void 0 :
|
|
1957
1987
|
_d.length,
|
|
1958
1988
|
")"))) : (React.createElement(React.Fragment, null,
|
|
1959
1989
|
row.getIsGrouped() && !cell.getIsGrouped()
|
|
1960
1990
|
? null
|
|
1961
|
-
: (_g = (_f = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _f === void 0 ? void 0 : _f.call(columnDef, { cell, column, table })) !== null && _g !== void 0 ? _g : cell.renderValue(),
|
|
1991
|
+
: (_g = (_f = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _f === void 0 ? void 0 : _f.call(columnDef, { cell, column, row, table })) !== null && _g !== void 0 ? _g : cell.renderValue(),
|
|
1962
1992
|
cell.getIsGrouped() && React.createElement(React.Fragment, null,
|
|
1963
1993
|
" (", (_j = (_h = row.subRows) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : '',
|
|
1964
1994
|
")"))))));
|
|
@@ -2011,7 +2041,7 @@ const MRT_TableBodyRow = ({ row, rowIndex, table }) => {
|
|
|
2011
2041
|
: undefined,
|
|
2012
2042
|
} }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
|
2013
2043
|
? tableRowProps.sx(theme)
|
|
2014
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)), draggingBorders)) }), (_b = (_a = row === null || row === void 0 ? void 0 : row.getVisibleCells()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (cell) => (React.createElement(MRT_TableBodyCell, { cell: cell,
|
|
2044
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)), draggingBorders)) }), (_b = (_a = row === null || row === void 0 ? void 0 : row.getVisibleCells()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (cell) => (React.createElement(MRT_TableBodyCell, { cell: cell, enableHover: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false, key: cell.id, rowIndex: rowIndex, rowRef: rowRef, table: table })))),
|
|
2015
2045
|
renderDetailPanel && !row.getIsGrouped() && (React.createElement(MRT_TableDetailPanel, { row: row, table: table }))));
|
|
2016
2046
|
};
|
|
2017
2047
|
|
|
@@ -2159,25 +2189,29 @@ const MRT_Table = ({ tableContainerRef, table }) => {
|
|
|
2159
2189
|
|
|
2160
2190
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
2161
2191
|
const MRT_TableContainer = ({ table }) => {
|
|
2162
|
-
|
|
2163
|
-
const { getState, options: { enableStickyHeader, enableRowVirtualization, muiTableContainerProps, tableId, }, } = table;
|
|
2192
|
+
const { getState, options: { enableStickyHeader, enableRowVirtualization, muiTableContainerProps, }, refs: { tableContainerRef, bottomToolbarRef, topToolbarRef }, } = table;
|
|
2164
2193
|
const { isFullScreen } = getState();
|
|
2165
2194
|
const [totalToolbarHeight, setTotalToolbarHeight] = useState(0);
|
|
2166
2195
|
const tableContainerProps = muiTableContainerProps instanceof Function
|
|
2167
2196
|
? muiTableContainerProps({ table })
|
|
2168
2197
|
: muiTableContainerProps;
|
|
2169
|
-
const tableContainerRef = (_a = tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) !== null && _a !== void 0 ? _a : useRef(null);
|
|
2170
2198
|
useIsomorphicLayoutEffect(() => {
|
|
2171
2199
|
var _a, _b, _c, _d;
|
|
2172
2200
|
const topToolbarHeight = typeof document !== 'undefined'
|
|
2173
|
-
? (_b = (_a =
|
|
2201
|
+
? (_b = (_a = topToolbarRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0
|
|
2174
2202
|
: 0;
|
|
2175
2203
|
const bottomToolbarHeight = typeof document !== 'undefined'
|
|
2176
|
-
? (_d = (_c =
|
|
2204
|
+
? (_d = (_c = bottomToolbarRef === null || bottomToolbarRef === void 0 ? void 0 : bottomToolbarRef.current) === null || _c === void 0 ? void 0 : _c.offsetHeight) !== null && _d !== void 0 ? _d : 0
|
|
2177
2205
|
: 0;
|
|
2178
2206
|
setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
|
|
2179
2207
|
});
|
|
2180
|
-
return (React.createElement(TableContainer, Object.assign({
|
|
2208
|
+
return (React.createElement(TableContainer, Object.assign({}, tableContainerProps, { ref: (ref) => {
|
|
2209
|
+
tableContainerRef.current = ref;
|
|
2210
|
+
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
|
2211
|
+
//@ts-ignore
|
|
2212
|
+
tableContainerProps.ref.current = ref;
|
|
2213
|
+
}
|
|
2214
|
+
}, sx: (theme) => (Object.assign({ maxWidth: '100%', maxHeight: enableStickyHeader || enableRowVirtualization
|
|
2181
2215
|
? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
|
|
2182
2216
|
: undefined, overflow: 'auto' }, ((tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx) instanceof Function
|
|
2183
2217
|
? tableContainerProps.sx(theme)
|
|
@@ -2209,10 +2243,32 @@ const MRT_TablePaper = ({ table }) => {
|
|
|
2209
2243
|
enableBottomToolbar && React.createElement(MRT_BottomToolbar, { table: table })));
|
|
2210
2244
|
};
|
|
2211
2245
|
|
|
2246
|
+
const MRT_EditRowModal = ({ open, row, table, }) => {
|
|
2247
|
+
const { options: { localization }, } = table;
|
|
2248
|
+
return (React.createElement(Dialog, { open: open },
|
|
2249
|
+
React.createElement(DialogTitle, { textAlign: "center" }, localization.edit),
|
|
2250
|
+
React.createElement(DialogContent, null,
|
|
2251
|
+
React.createElement("form", { onSubmit: (e) => e.preventDefault() },
|
|
2252
|
+
React.createElement(Stack, { sx: {
|
|
2253
|
+
width: '100%',
|
|
2254
|
+
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
|
2255
|
+
gap: '1.5rem',
|
|
2256
|
+
} }, row
|
|
2257
|
+
.getAllCells()
|
|
2258
|
+
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
|
2259
|
+
.map((cell) => (React.createElement(MRT_EditCellTextField, { cell: cell, key: cell.id, showLabel: true, table: table })))))),
|
|
2260
|
+
React.createElement(DialogActions, { sx: { p: '1.25rem' } },
|
|
2261
|
+
React.createElement(MRT_EditActionButtons, { row: row, table: table, variant: "text" }))));
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2212
2264
|
const MRT_TableRoot = (props) => {
|
|
2213
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2265
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
2266
|
+
const bottomToolbarRef = useRef(null);
|
|
2267
|
+
const editInputRefs = useRef({});
|
|
2268
|
+
const filterInputRefs = useRef({});
|
|
2269
|
+
const searchInputRef = useRef(null);
|
|
2270
|
+
const tableContainerRef = useRef(null);
|
|
2271
|
+
const topToolbarRef = useRef(null);
|
|
2216
2272
|
const initialState = useMemo(() => {
|
|
2217
2273
|
var _a, _b;
|
|
2218
2274
|
const initState = (_a = props.initialState) !== null && _a !== void 0 ? _a : {};
|
|
@@ -2239,23 +2295,26 @@ const MRT_TableRoot = (props) => {
|
|
|
2239
2295
|
const [editingCell, setEditingCell] = useState((_e = initialState.editingCell) !== null && _e !== void 0 ? _e : null);
|
|
2240
2296
|
const [editingRow, setEditingRow] = useState((_f = initialState.editingRow) !== null && _f !== void 0 ? _f : null);
|
|
2241
2297
|
const [globalFilterFn, setGlobalFilterFn] = useState((_g = initialState.globalFilterFn) !== null && _g !== void 0 ? _g : 'fuzzy');
|
|
2242
|
-
const [
|
|
2243
|
-
const [
|
|
2244
|
-
const [
|
|
2245
|
-
const [
|
|
2246
|
-
const [
|
|
2247
|
-
const [
|
|
2298
|
+
const [grouping, setGrouping] = useState((_h = initialState.grouping) !== null && _h !== void 0 ? _h : []);
|
|
2299
|
+
const [hoveredColumn, setHoveredColumn] = useState((_j = initialState.hoveredColumn) !== null && _j !== void 0 ? _j : null);
|
|
2300
|
+
const [hoveredRow, setHoveredRow] = useState((_k = initialState.hoveredRow) !== null && _k !== void 0 ? _k : null);
|
|
2301
|
+
const [isFullScreen, setIsFullScreen] = useState((_l = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _l !== void 0 ? _l : false);
|
|
2302
|
+
const [showAlertBanner, setShowAlertBanner] = useState((_o = (_m = props.initialState) === null || _m === void 0 ? void 0 : _m.showAlertBanner) !== null && _o !== void 0 ? _o : false);
|
|
2303
|
+
const [showColumnFilters, setShowFilters] = useState((_p = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _p !== void 0 ? _p : false);
|
|
2304
|
+
const [showGlobalFilter, setShowGlobalFilter] = useState((_q = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _q !== void 0 ? _q : false);
|
|
2248
2305
|
const displayColumns = useMemo(() => {
|
|
2249
2306
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2250
2307
|
return [
|
|
2251
2308
|
columnOrder.includes('mrt-row-drag') && Object.assign(Object.assign(Object.assign({ header: (_a = props.localization) === null || _a === void 0 ? void 0 : _a.move, size: 60 }, defaultDisplayColumnDefOptions), (_b = props.displayColumnDefOptions) === null || _b === void 0 ? void 0 : _b['mrt-row-drag']), { id: 'mrt-row-drag' }),
|
|
2252
|
-
columnOrder.includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({
|
|
2253
|
-
columnOrder.includes('mrt-row-expand') &&
|
|
2254
|
-
|
|
2255
|
-
columnOrder.includes('mrt-row-
|
|
2309
|
+
columnOrder.includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (React.createElement(MRT_ToggleRowActionMenuButton, { row: row, table: table })), header: (_c = props.localization) === null || _c === void 0 ? void 0 : _c.actions, size: 70 }, defaultDisplayColumnDefOptions), (_d = props.displayColumnDefOptions) === null || _d === void 0 ? void 0 : _d['mrt-row-actions']), { id: 'mrt-row-actions' }),
|
|
2310
|
+
columnOrder.includes('mrt-row-expand') &&
|
|
2311
|
+
showExpandColumn(props, grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (React.createElement(MRT_ExpandButton, { row: row, table: table })), Header: () => props.enableExpandAll ? (React.createElement(MRT_ExpandAllButton, { table: table })) : null, header: (_e = props.localization) === null || _e === void 0 ? void 0 : _e.expand, size: 60 }, defaultDisplayColumnDefOptions), (_f = props.displayColumnDefOptions) === null || _f === void 0 ? void 0 : _f['mrt-row-expand']), { id: 'mrt-row-expand' }),
|
|
2312
|
+
columnOrder.includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (React.createElement(MRT_SelectCheckbox, { row: row, table: table })), Header: () => props.enableSelectAll ? (React.createElement(MRT_SelectCheckbox, { selectAll: true, table: table })) : null, header: (_g = props.localization) === null || _g === void 0 ? void 0 : _g.select, size: 60 }, defaultDisplayColumnDefOptions), (_h = props.displayColumnDefOptions) === null || _h === void 0 ? void 0 : _h['mrt-row-select']), { id: 'mrt-row-select' }),
|
|
2313
|
+
columnOrder.includes('mrt-row-numbers') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => row.index + 1, Header: () => { var _a; return (_a = props.localization) === null || _a === void 0 ? void 0 : _a.rowNumber; }, header: (_j = props.localization) === null || _j === void 0 ? void 0 : _j.rowNumbers, size: 60 }, defaultDisplayColumnDefOptions), (_k = props.displayColumnDefOptions) === null || _k === void 0 ? void 0 : _k['mrt-row-numbers']), { id: 'mrt-row-numbers' }),
|
|
2256
2314
|
].filter(Boolean);
|
|
2257
2315
|
}, [
|
|
2258
2316
|
columnOrder,
|
|
2317
|
+
grouping,
|
|
2259
2318
|
props.displayColumnDefOptions,
|
|
2260
2319
|
props.editingMode,
|
|
2261
2320
|
props.enableColumnDragging,
|
|
@@ -2272,6 +2331,7 @@ const MRT_TableRoot = (props) => {
|
|
|
2272
2331
|
props.enableSelectAll,
|
|
2273
2332
|
props.localization,
|
|
2274
2333
|
props.positionActionsColumn,
|
|
2334
|
+
props.renderDetailPanel,
|
|
2275
2335
|
]);
|
|
2276
2336
|
const columnDefs = useMemo(() => prepareColumns([...displayColumns, ...props.columns], columnFilterFns, props.filterFns, props.sortingFns), [columnFilterFns, displayColumns, props.columns]);
|
|
2277
2337
|
const data = useMemo(() => {
|
|
@@ -2289,11 +2349,11 @@ const MRT_TableRoot = (props) => {
|
|
|
2289
2349
|
});
|
|
2290
2350
|
})))
|
|
2291
2351
|
: props.data;
|
|
2292
|
-
}, [props.data, (
|
|
2352
|
+
}, [props.data, (_r = props.state) === null || _r === void 0 ? void 0 : _r.isLoading, (_s = props.state) === null || _s === void 0 ? void 0 : _s.showSkeletons]);
|
|
2293
2353
|
//@ts-ignore
|
|
2294
|
-
const table = Object.assign(Object.assign({}, useReactTable(Object.assign(Object.assign({ getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel(), getFacetedRowModel: getFacetedRowModel(), getFilteredRowModel: getFilteredRowModel(), getGroupedRowModel: getGroupedRowModel(), getPaginationRowModel: getPaginationRowModel(), getSortedRowModel: getSortedRowModel(), onColumnOrderChange: setColumnOrder, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows }, props), {
|
|
2354
|
+
const table = Object.assign(Object.assign({}, useReactTable(Object.assign(Object.assign({ getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel(), getFacetedRowModel: getFacetedRowModel(), getFilteredRowModel: getFilteredRowModel(), getGroupedRowModel: getGroupedRowModel(), getPaginationRowModel: getPaginationRowModel(), getSortedRowModel: getSortedRowModel(), onColumnOrderChange: setColumnOrder, onGroupingChange: setGrouping, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows }, props), {
|
|
2295
2355
|
//@ts-ignore
|
|
2296
|
-
columns: columnDefs, data, globalFilterFn: (
|
|
2356
|
+
columns: columnDefs, data, globalFilterFn: (_u = (_t = props.filterFns) === null || _t === void 0 ? void 0 : _t[globalFilterFn]) !== null && _u !== void 0 ? _u : (_v = props.filterFns) === null || _v === void 0 ? void 0 : _v.fuzzy, initialState, state: Object.assign({ columnFilterFns,
|
|
2297
2357
|
columnOrder,
|
|
2298
2358
|
density,
|
|
2299
2359
|
draggingColumn,
|
|
@@ -2301,20 +2361,29 @@ const MRT_TableRoot = (props) => {
|
|
|
2301
2361
|
editingCell,
|
|
2302
2362
|
editingRow,
|
|
2303
2363
|
globalFilterFn,
|
|
2364
|
+
grouping,
|
|
2304
2365
|
hoveredColumn,
|
|
2305
2366
|
hoveredRow,
|
|
2306
2367
|
isFullScreen,
|
|
2307
2368
|
showAlertBanner,
|
|
2308
2369
|
showColumnFilters,
|
|
2309
|
-
showGlobalFilter }, props.state)
|
|
2370
|
+
showGlobalFilter }, props.state) }))), { refs: {
|
|
2371
|
+
bottomToolbarRef,
|
|
2372
|
+
editInputRefs,
|
|
2373
|
+
filterInputRefs,
|
|
2374
|
+
searchInputRef,
|
|
2375
|
+
tableContainerRef,
|
|
2376
|
+
topToolbarRef,
|
|
2377
|
+
}, setColumnFilterFns: (_w = props.onFilterFnsChange) !== null && _w !== void 0 ? _w : setColumnFilterFns, setDensity: (_x = props.onDensityChange) !== null && _x !== void 0 ? _x : setDensity, setDraggingColumn: (_y = props.onDraggingColumnChange) !== null && _y !== void 0 ? _y : setDraggingColumn, setDraggingRow: (_z = props.onDraggingRowChange) !== null && _z !== void 0 ? _z : setDraggingRow, setEditingCell: (_0 = props.onEditingCellChange) !== null && _0 !== void 0 ? _0 : setEditingCell, setEditingRow: (_1 = props.onEditingRowChange) !== null && _1 !== void 0 ? _1 : setEditingRow, setGlobalFilterFn: (_2 = props.onGlobalFilterFnChange) !== null && _2 !== void 0 ? _2 : setGlobalFilterFn, setHoveredColumn: (_3 = props.onHoveredColumnChange) !== null && _3 !== void 0 ? _3 : setHoveredColumn, setHoveredRow: (_4 = props.onHoveredRowChange) !== null && _4 !== void 0 ? _4 : setHoveredRow, setIsFullScreen: (_5 = props.onIsFullScreenChange) !== null && _5 !== void 0 ? _5 : setIsFullScreen, setShowAlertBanner: (_6 = props.onShowAlertBannerChange) !== null && _6 !== void 0 ? _6 : setShowAlertBanner, setShowFilters: (_7 = props.onShowFiltersChange) !== null && _7 !== void 0 ? _7 : setShowFilters, setShowGlobalFilter: (_8 = props.onShowGlobalFilterChange) !== null && _8 !== void 0 ? _8 : setShowGlobalFilter });
|
|
2310
2378
|
return (React.createElement(React.Fragment, null,
|
|
2311
2379
|
React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => setIsFullScreen(false), open: isFullScreen, transitionDuration: 400 },
|
|
2312
2380
|
React.createElement(MRT_TablePaper, { table: table })),
|
|
2313
|
-
!isFullScreen && React.createElement(MRT_TablePaper, { table: table })
|
|
2381
|
+
!isFullScreen && React.createElement(MRT_TablePaper, { table: table }),
|
|
2382
|
+
editingRow && props.editingMode === 'modal' && (React.createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
|
|
2314
2383
|
};
|
|
2315
2384
|
|
|
2316
2385
|
var MaterialReactTable = (_a) => {
|
|
2317
|
-
var { aggregationFns, autoResetExpanded = false, columnResizeMode = 'onEnd', defaultColumn = { minSize: 40, maxSize: 1000, size: 180 }, editingMode = '
|
|
2386
|
+
var { aggregationFns, autoResetExpanded = false, columnResizeMode = 'onEnd', defaultColumn = { minSize: 40, maxSize: 1000, size: 180 }, editingMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilterChangeMode = false, enableColumnFilters = true, enableColumnOrdering = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterChangeMode = false, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enablePinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, localization, positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberMode = 'original', selectAllMode = 'all', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnResizeMode", "defaultColumn", "editingMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilterChangeMode", "enableColumnFilters", "enableColumnOrdering", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterChangeMode", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enablePinning", "enableRowSelection", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "localization", "positionActionsColumn", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberMode", "selectAllMode", "sortingFns"]);
|
|
2318
2387
|
return (React.createElement(MRT_TableRoot, Object.assign({ aggregationFns: Object.assign(Object.assign({}, MRT_AggregationFns), aggregationFns), autoResetExpanded: autoResetExpanded, columnResizeMode: columnResizeMode, defaultColumn: defaultColumn, editingMode: editingMode, enableBottomToolbar: enableBottomToolbar, enableColumnActions: enableColumnActions, enableColumnFilterChangeMode: enableColumnFilterChangeMode, enableColumnFilters: enableColumnFilters, enableColumnOrdering: enableColumnOrdering, enableColumnResizing: enableColumnResizing, enableDensityToggle: enableDensityToggle, enableExpandAll: enableExpandAll, enableFilters: enableFilters, enableFullScreenToggle: enableFullScreenToggle, enableGlobalFilter: enableGlobalFilter, enableGlobalFilterChangeMode: enableGlobalFilterChangeMode, enableGlobalFilterRankedResults: enableGlobalFilterRankedResults, enableGrouping: enableGrouping, enableHiding: enableHiding, enableMultiRowSelection: enableMultiRowSelection, enableMultiSort: enableMultiSort, enablePagination: enablePagination, enablePinning: enablePinning, enableRowSelection: enableRowSelection, enableSelectAll: enableSelectAll, enableSorting: enableSorting, enableStickyHeader: enableStickyHeader, enableTableFooter: enableTableFooter, enableTableHead: enableTableHead, enableToolbarInternalActions: enableToolbarInternalActions, enableTopToolbar: enableTopToolbar, filterFns: Object.assign(Object.assign({}, MRT_FilterFns), filterFns), icons: Object.assign(Object.assign({}, MRT_Default_Icons), icons), localization: Object.assign(Object.assign({}, MRT_DefaultLocalization_EN), localization), positionActionsColumn: positionActionsColumn, positionExpandColumn: positionExpandColumn, positionGlobalFilter: positionGlobalFilter, positionPagination: positionPagination, positionToolbarAlertBanner: positionToolbarAlertBanner, positionToolbarDropZone: positionToolbarDropZone, rowNumberMode: rowNumberMode, selectAllMode: selectAllMode, sortingFns: Object.assign(Object.assign({}, MRT_SortingFns), sortingFns) }, rest)));
|
|
2319
2388
|
};
|
|
2320
2389
|
|