material-react-table 1.1.0-beta.0 → 1.1.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/cjs/MaterialReactTable.d.ts +3 -3
- package/dist/cjs/_locales/ja.d.ts +2 -0
- package/dist/cjs/body/MRT_TableBodyCell.d.ts +1 -0
- package/dist/cjs/body/MRT_TableBodyRow.d.ts +1 -0
- package/dist/cjs/index.js +422 -427
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/table/MRT_TableRoot.d.ts +3 -3
- package/dist/esm/MaterialReactTable.d.ts +3 -3
- package/dist/esm/_locales/ja.d.ts +2 -0
- package/dist/esm/body/MRT_TableBodyCell.d.ts +1 -0
- package/dist/esm/body/MRT_TableBodyRow.d.ts +1 -0
- package/dist/esm/material-react-table.esm.js +422 -427
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/table/MRT_TableRoot.d.ts +3 -3
- package/dist/index.d.ts +35 -35
- package/locales/ja.d.ts +2 -0
- package/locales/ja.esm.d.ts +2 -0
- package/locales/ja.esm.js +92 -0
- package/locales/ja.esm.js.map +1 -0
- package/locales/ja.js +96 -0
- package/locales/ja.js.map +1 -0
- package/package.json +13 -13
- package/src/MaterialReactTable.tsx +6 -6
- package/src/_locales/ja.ts +92 -1
- package/src/body/MRT_TableBody.tsx +6 -2
- package/src/body/MRT_TableBodyCell.tsx +37 -36
- package/src/body/MRT_TableBodyRow.tsx +15 -9
- package/src/head/MRT_TableHeadCell.tsx +19 -16
package/dist/cjs/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactTable = require('@tanstack/react-table');
|
|
7
|
-
var iconsMaterial = require('@mui/icons-material');
|
|
8
|
-
var matchSorterUtils = require('@tanstack/match-sorter-utils');
|
|
9
7
|
var material = require('@mui/material');
|
|
8
|
+
var matchSorterUtils = require('@tanstack/match-sorter-utils');
|
|
9
|
+
var iconsMaterial = require('@mui/icons-material');
|
|
10
10
|
var reactVirtual = require('react-virtual');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -42,37 +42,161 @@ function __rest(s, e) {
|
|
|
42
42
|
|
|
43
43
|
const MRT_AggregationFns = Object.assign({}, reactTable.aggregationFns);
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
45
|
+
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; };
|
|
46
|
+
const getAllLeafColumnDefs = (columns) => {
|
|
47
|
+
const allLeafColumnDefs = [];
|
|
48
|
+
const getLeafColumns = (cols) => {
|
|
49
|
+
cols.forEach((col) => {
|
|
50
|
+
if (col.columns) {
|
|
51
|
+
getLeafColumns(col.columns);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
allLeafColumnDefs.push(col);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
getLeafColumns(columns);
|
|
59
|
+
return allLeafColumnDefs;
|
|
60
|
+
};
|
|
61
|
+
const prepareColumns = ({ columnDefs, columnFilterFns, defaultDisplayColumn, filterFns, sortingFns, }) => columnDefs.map((columnDef) => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
if (!columnDef.id)
|
|
64
|
+
columnDef.id = getColumnId(columnDef);
|
|
65
|
+
if (process.env.NODE_ENV !== 'production' && !columnDef.id) {
|
|
66
|
+
console.error('Column definitions must have a valid `accessorKey` or `id` property');
|
|
67
|
+
}
|
|
68
|
+
if (!columnDef.columnDefType)
|
|
69
|
+
columnDef.columnDefType = 'data';
|
|
70
|
+
if (!!((_a = columnDef.columns) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
71
|
+
columnDef.columnDefType = 'group';
|
|
72
|
+
columnDef.columns = prepareColumns({
|
|
73
|
+
columnDefs: columnDef.columns,
|
|
74
|
+
columnFilterFns,
|
|
75
|
+
defaultDisplayColumn,
|
|
76
|
+
filterFns,
|
|
77
|
+
sortingFns,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else if (columnDef.columnDefType === 'data') {
|
|
81
|
+
if (Object.keys(filterFns).includes(columnFilterFns[columnDef.id])) {
|
|
82
|
+
columnDef.filterFn =
|
|
83
|
+
(_b = filterFns[columnFilterFns[columnDef.id]]) !== null && _b !== void 0 ? _b : filterFns.fuzzy;
|
|
84
|
+
columnDef._filterFn =
|
|
85
|
+
columnFilterFns[columnDef.id];
|
|
86
|
+
}
|
|
87
|
+
if (Object.keys(sortingFns).includes(columnDef.sortingFn)) {
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
columnDef.sortingFn = sortingFns[columnDef.sortingFn];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (columnDef.columnDefType === 'display') {
|
|
93
|
+
columnDef = Object.assign(Object.assign({}, defaultDisplayColumn), columnDef);
|
|
94
|
+
}
|
|
95
|
+
return columnDef;
|
|
96
|
+
});
|
|
97
|
+
const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
|
|
98
|
+
if (draggedColumn.getCanPin()) {
|
|
99
|
+
draggedColumn.pin(targetColumn.getIsPinned());
|
|
100
|
+
}
|
|
101
|
+
columnOrder.splice(columnOrder.indexOf(targetColumn.id), 0, columnOrder.splice(columnOrder.indexOf(draggedColumn.id), 1)[0]);
|
|
102
|
+
return [...columnOrder];
|
|
103
|
+
};
|
|
104
|
+
const showExpandColumn = (props, grouping) => !!(props.enableExpanding ||
|
|
105
|
+
(props.enableGrouping && (grouping === undefined || (grouping === null || grouping === void 0 ? void 0 : grouping.length))) ||
|
|
106
|
+
props.renderDetailPanel);
|
|
107
|
+
const getLeadingDisplayColumnIds = (props) => {
|
|
108
|
+
var _a;
|
|
109
|
+
return [
|
|
110
|
+
(props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
|
|
111
|
+
props.positionActionsColumn === 'first' &&
|
|
112
|
+
(props.enableRowActions ||
|
|
113
|
+
(props.enableEditing &&
|
|
114
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
115
|
+
'mrt-row-actions',
|
|
116
|
+
props.positionExpandColumn === 'first' &&
|
|
117
|
+
showExpandColumn(props) &&
|
|
118
|
+
'mrt-row-expand',
|
|
119
|
+
props.enableRowSelection && 'mrt-row-select',
|
|
120
|
+
props.enableRowNumbers && 'mrt-row-numbers',
|
|
121
|
+
].filter(Boolean);
|
|
122
|
+
};
|
|
123
|
+
const getTrailingDisplayColumnIds = (props) => {
|
|
124
|
+
var _a;
|
|
125
|
+
return [
|
|
126
|
+
props.positionActionsColumn === 'last' &&
|
|
127
|
+
(props.enableRowActions ||
|
|
128
|
+
(props.enableEditing &&
|
|
129
|
+
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
130
|
+
'mrt-row-actions',
|
|
131
|
+
props.positionExpandColumn === 'last' &&
|
|
132
|
+
showExpandColumn(props) &&
|
|
133
|
+
'mrt-row-expand',
|
|
134
|
+
];
|
|
135
|
+
};
|
|
136
|
+
const getDefaultColumnOrderIds = (props) => [
|
|
137
|
+
...getLeadingDisplayColumnIds(props),
|
|
138
|
+
...getAllLeafColumnDefs(props.columns).map((columnDef) => getColumnId(columnDef)),
|
|
139
|
+
...getTrailingDisplayColumnIds(props),
|
|
140
|
+
].filter(Boolean);
|
|
141
|
+
const getDefaultColumnFilterFn = (columnDef) => {
|
|
142
|
+
if (columnDef.filterVariant === 'multi-select')
|
|
143
|
+
return 'arrIncludesSome';
|
|
144
|
+
if (columnDef.filterVariant === 'range')
|
|
145
|
+
return 'betweenInclusive';
|
|
146
|
+
if (columnDef.filterVariant === 'select' ||
|
|
147
|
+
columnDef.filterVariant === 'checkbox')
|
|
148
|
+
return 'equals';
|
|
149
|
+
return 'fuzzy';
|
|
150
|
+
};
|
|
151
|
+
const getIsLastLeftPinnedColumn = (table, column) => {
|
|
152
|
+
return (column.getIsPinned() === 'left' &&
|
|
153
|
+
table.getLeftLeafHeaders().length - 1 === column.getPinnedIndex());
|
|
154
|
+
};
|
|
155
|
+
const getIsFirstRightPinnedColumn = (column) => {
|
|
156
|
+
return column.getIsPinned() === 'right' && column.getPinnedIndex() === 0;
|
|
157
|
+
};
|
|
158
|
+
const getTotalRight = (table, column) => {
|
|
159
|
+
return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 160);
|
|
160
|
+
};
|
|
161
|
+
const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, }) => {
|
|
162
|
+
var _a, _b, _c, _d;
|
|
163
|
+
return (Object.assign(Object.assign({ backgroundColor: column.getIsPinned() && column.columnDef.columnDefType !== 'group'
|
|
164
|
+
? material.alpha(material.lighten(theme.palette.background.default, 0.04), 0.97)
|
|
165
|
+
: 'inherit', backgroundImage: 'inherit', boxShadow: getIsLastLeftPinnedColumn(table, column)
|
|
166
|
+
? `-4px 0 8px -6px ${material.alpha(theme.palette.common.black, 0.2)} inset`
|
|
167
|
+
: getIsFirstRightPinnedColumn(column)
|
|
168
|
+
? `4px 0 8px -6px ${material.alpha(theme.palette.common.black, 0.2)} inset`
|
|
169
|
+
: undefined, left: column.getIsPinned() === 'left'
|
|
170
|
+
? `${column.getStart('left')}px`
|
|
171
|
+
: undefined, opacity: ((_a = table.getState().draggingColumn) === null || _a === void 0 ? void 0 : _a.id) === column.id ||
|
|
172
|
+
((_b = table.getState().hoveredColumn) === null || _b === void 0 ? void 0 : _b.id) === column.id
|
|
173
|
+
? 0.5
|
|
174
|
+
: 1, position: column.getIsPinned() && column.columnDef.columnDefType !== 'group'
|
|
175
|
+
? 'sticky'
|
|
176
|
+
: undefined, right: column.getIsPinned() === 'right'
|
|
177
|
+
? `${getTotalRight(table, column)}px`
|
|
178
|
+
: undefined, transition: `all ${column.getIsResizing() ? 0 : '150ms'} ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
|
179
|
+
? tableCellProps.sx(theme)
|
|
180
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { maxWidth: `min(${column.getSize()}px, fit-content)`, minWidth: `max(${column.getSize()}px, ${(_c = column.columnDef.minSize) !== null && _c !== void 0 ? _c : 30}px)`, width: (_d = header === null || header === void 0 ? void 0 : header.getSize()) !== null && _d !== void 0 ? _d : column.getSize() }));
|
|
181
|
+
};
|
|
182
|
+
const MRT_DefaultColumn = {
|
|
183
|
+
minSize: 40,
|
|
184
|
+
maxSize: 1000,
|
|
185
|
+
size: 180,
|
|
186
|
+
};
|
|
187
|
+
const MRT_DefaultDisplayColumn = {
|
|
188
|
+
columnDefType: 'display',
|
|
189
|
+
enableClickToCopy: false,
|
|
190
|
+
enableColumnActions: false,
|
|
191
|
+
enableColumnDragging: false,
|
|
192
|
+
enableColumnFilter: false,
|
|
193
|
+
enableColumnOrdering: false,
|
|
194
|
+
enableEditing: false,
|
|
195
|
+
enableGlobalFilter: false,
|
|
196
|
+
enableGrouping: false,
|
|
197
|
+
enableHiding: false,
|
|
198
|
+
enableResizing: false,
|
|
199
|
+
enableSorting: false,
|
|
76
200
|
};
|
|
77
201
|
|
|
78
202
|
const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
|
|
@@ -159,94 +283,37 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
|
|
|
159
283
|
notEquals,
|
|
160
284
|
startsWith });
|
|
161
285
|
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
filterIncludesString: 'Contains',
|
|
194
|
-
filterIncludesStringSensitive: 'Contains',
|
|
195
|
-
filterLessThan: 'Less Than',
|
|
196
|
-
filterLessThanOrEqualTo: 'Less Than Or Equal To',
|
|
197
|
-
filterMode: 'Filter Mode: {filterType}',
|
|
198
|
-
filterNotEmpty: 'Not Empty',
|
|
199
|
-
filterNotEquals: 'Not Equals',
|
|
200
|
-
filterStartsWith: 'Starts With',
|
|
201
|
-
filterWeakEquals: 'Equals',
|
|
202
|
-
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
|
203
|
-
goToFirstPage: 'Go to first page',
|
|
204
|
-
goToLastPage: 'Go to last page',
|
|
205
|
-
goToNextPage: 'Go to next page',
|
|
206
|
-
goToPreviousPage: 'Go to previous page',
|
|
207
|
-
grab: 'Grab',
|
|
208
|
-
groupByColumn: 'Group by {column}',
|
|
209
|
-
groupedBy: 'Grouped by ',
|
|
210
|
-
hideAll: 'Hide all',
|
|
211
|
-
hideColumn: 'Hide {column} column',
|
|
212
|
-
max: 'Max',
|
|
213
|
-
min: 'Min',
|
|
214
|
-
move: 'Move',
|
|
215
|
-
noRecordsToDisplay: 'No records to display',
|
|
216
|
-
noResultsFound: 'No results found',
|
|
217
|
-
of: 'of',
|
|
218
|
-
or: 'or',
|
|
219
|
-
pinToLeft: 'Pin to left',
|
|
220
|
-
pinToRight: 'Pin to right',
|
|
221
|
-
resetColumnSize: 'Reset column size',
|
|
222
|
-
resetOrder: 'Reset order',
|
|
223
|
-
rowActions: 'Row Actions',
|
|
224
|
-
rowNumber: '#',
|
|
225
|
-
rowNumbers: 'Row Numbers',
|
|
226
|
-
rowsPerPage: 'Rows per page',
|
|
227
|
-
save: 'Save',
|
|
228
|
-
search: 'Search',
|
|
229
|
-
selectedCountOfRowCountRowsSelected: '{selectedCount} of {rowCount} row(s) selected',
|
|
230
|
-
select: 'Select',
|
|
231
|
-
showAll: 'Show all',
|
|
232
|
-
showAllColumns: 'Show all columns',
|
|
233
|
-
showHideColumns: 'Show/Hide columns',
|
|
234
|
-
showHideFilters: 'Show/Hide filters',
|
|
235
|
-
showHideSearch: 'Show/Hide search',
|
|
236
|
-
sortByColumnAsc: 'Sort by {column} ascending',
|
|
237
|
-
sortByColumnDesc: 'Sort by {column} descending',
|
|
238
|
-
sortedByColumnAsc: 'Sorted by {column} ascending',
|
|
239
|
-
sortedByColumnDesc: 'Sorted by {column} descending',
|
|
240
|
-
thenBy: ', then by ',
|
|
241
|
-
toggleDensity: 'Toggle density',
|
|
242
|
-
toggleFullScreen: 'Toggle full screen',
|
|
243
|
-
toggleSelectAll: 'Toggle select all',
|
|
244
|
-
toggleSelectRow: 'Toggle select row',
|
|
245
|
-
toggleVisibility: 'Toggle visibility',
|
|
246
|
-
ungroupByColumn: 'Ungroup by {column}',
|
|
247
|
-
unpin: 'Unpin',
|
|
248
|
-
unpinAll: 'Unpin all',
|
|
249
|
-
unsorted: 'Unsorted',
|
|
286
|
+
const MRT_Default_Icons = {
|
|
287
|
+
ArrowRightIcon: iconsMaterial.ArrowRight,
|
|
288
|
+
CancelIcon: iconsMaterial.Cancel,
|
|
289
|
+
CheckBoxIcon: iconsMaterial.CheckBox,
|
|
290
|
+
ClearAllIcon: iconsMaterial.ClearAll,
|
|
291
|
+
CloseIcon: iconsMaterial.Close,
|
|
292
|
+
DensityLargeIcon: iconsMaterial.DensityLarge,
|
|
293
|
+
DensityMediumIcon: iconsMaterial.DensityMedium,
|
|
294
|
+
DensitySmallIcon: iconsMaterial.DensitySmall,
|
|
295
|
+
DragHandleIcon: iconsMaterial.DragHandle,
|
|
296
|
+
DynamicFeedIcon: iconsMaterial.DynamicFeed,
|
|
297
|
+
EditIcon: iconsMaterial.Edit,
|
|
298
|
+
ExpandLessIcon: iconsMaterial.ExpandLess,
|
|
299
|
+
ExpandMoreIcon: iconsMaterial.ExpandMore,
|
|
300
|
+
FilterAltIcon: iconsMaterial.FilterAlt,
|
|
301
|
+
FilterAltOffIcon: iconsMaterial.FilterAltOff,
|
|
302
|
+
FilterListIcon: iconsMaterial.FilterList,
|
|
303
|
+
FilterListOffIcon: iconsMaterial.FilterListOff,
|
|
304
|
+
FullscreenExitIcon: iconsMaterial.FullscreenExit,
|
|
305
|
+
FullscreenIcon: iconsMaterial.Fullscreen,
|
|
306
|
+
KeyboardDoubleArrowDownIcon: iconsMaterial.KeyboardDoubleArrowDown,
|
|
307
|
+
MoreHorizIcon: iconsMaterial.MoreHoriz,
|
|
308
|
+
MoreVertIcon: iconsMaterial.MoreVert,
|
|
309
|
+
PushPinIcon: iconsMaterial.PushPin,
|
|
310
|
+
RestartAltIcon: iconsMaterial.RestartAlt,
|
|
311
|
+
SaveIcon: iconsMaterial.Save,
|
|
312
|
+
SearchIcon: iconsMaterial.Search,
|
|
313
|
+
SearchOffIcon: iconsMaterial.SearchOff,
|
|
314
|
+
SortIcon: iconsMaterial.Sort,
|
|
315
|
+
ViewColumnIcon: iconsMaterial.ViewColumn,
|
|
316
|
+
VisibilityOffIcon: iconsMaterial.VisibilityOff,
|
|
250
317
|
};
|
|
251
318
|
|
|
252
319
|
const fuzzy = (rowA, rowB, columnId) => {
|
|
@@ -400,269 +467,112 @@ const mrtFilterOptions = (localization) => [
|
|
|
400
467
|
},
|
|
401
468
|
];
|
|
402
469
|
const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilterValue, table, }) => {
|
|
403
|
-
var _a, _b, _c, _d;
|
|
404
|
-
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
405
|
-
const { globalFilterFn, density } = getState();
|
|
406
|
-
const { column } = header !== null && header !== void 0 ? header : {};
|
|
407
|
-
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
408
|
-
const allowedColumnFilterOptions = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _a !== void 0 ? _a : columnFilterModeOptions;
|
|
409
|
-
const internalFilterOptions = React.useMemo(() => mrtFilterOptions(localization).filter((filterOption) => columnDef
|
|
410
|
-
? allowedColumnFilterOptions === undefined ||
|
|
411
|
-
(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.includes(filterOption.option))
|
|
412
|
-
: (!globalFilterModeOptions ||
|
|
413
|
-
globalFilterModeOptions.includes(filterOption.option)) &&
|
|
414
|
-
['fuzzy', 'contains', 'startsWith'].includes(filterOption.option)), []);
|
|
415
|
-
const handleSelectFilterMode = (option) => {
|
|
416
|
-
if (header && column) {
|
|
417
|
-
setColumnFilterFns((prev) => (Object.assign(Object.assign({}, prev), { [header.id]: option })));
|
|
418
|
-
if (['empty', 'notEmpty'].includes(option)) {
|
|
419
|
-
column.setFilterValue(' ');
|
|
420
|
-
}
|
|
421
|
-
else if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant) === 'multi-select' ||
|
|
422
|
-
['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'].includes(option)) {
|
|
423
|
-
column.setFilterValue([]);
|
|
424
|
-
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue([]);
|
|
425
|
-
}
|
|
426
|
-
else if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant) === 'range' ||
|
|
427
|
-
['between', 'betweenInclusive', 'inNumberRange'].includes(option)) {
|
|
428
|
-
column.setFilterValue(['', '']);
|
|
429
|
-
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue('');
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
column.setFilterValue('');
|
|
433
|
-
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue('');
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
else {
|
|
437
|
-
setGlobalFilterFn(option);
|
|
438
|
-
}
|
|
439
|
-
setAnchorEl(null);
|
|
440
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
441
|
-
};
|
|
442
|
-
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
443
|
-
return (React__default["default"].createElement(material.Menu, { anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
|
444
|
-
dense: density === 'compact',
|
|
445
|
-
} }, (_d = (header && column && columnDef
|
|
446
|
-
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
447
|
-
column: column,
|
|
448
|
-
internalFilterOptions,
|
|
449
|
-
onSelectFilterMode: handleSelectFilterMode,
|
|
450
|
-
table,
|
|
451
|
-
})) !== null && _c !== void 0 ? _c : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
|
452
|
-
column: column,
|
|
453
|
-
internalFilterOptions,
|
|
454
|
-
onSelectFilterMode: handleSelectFilterMode,
|
|
455
|
-
table,
|
|
456
|
-
})
|
|
457
|
-
: renderGlobalFilterModeMenuItems === null || renderGlobalFilterModeMenuItems === void 0 ? void 0 : renderGlobalFilterModeMenuItems({
|
|
458
|
-
internalFilterOptions,
|
|
459
|
-
onSelectFilterMode: handleSelectFilterMode,
|
|
460
|
-
table,
|
|
461
|
-
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (React__default["default"].createElement(material.MenuItem, { divider: divider, key: index, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
|
462
|
-
alignItems: 'center',
|
|
463
|
-
display: 'flex',
|
|
464
|
-
gap: '2ch',
|
|
465
|
-
my: 0,
|
|
466
|
-
py: '6px',
|
|
467
|
-
}, value: option },
|
|
468
|
-
React__default["default"].createElement(material.Box, { sx: { fontSize: '1.25rem', width: '2ch' } }, symbol),
|
|
469
|
-
label)))));
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
473
|
-
const { options: { icons: { PushPinIcon }, localization, }, } = table;
|
|
474
|
-
const handlePinColumn = (pinDirection) => {
|
|
475
|
-
column.pin(pinDirection);
|
|
476
|
-
};
|
|
477
|
-
return (React__default["default"].createElement(material.Box, { sx: { minWidth: '70px', textAlign: 'center' } }, column.getIsPinned() ? (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.unpin },
|
|
478
|
-
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn(false), size: "small" },
|
|
479
|
-
React__default["default"].createElement(PushPinIcon, null)))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
480
|
-
React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.pinToLeft },
|
|
481
|
-
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn('left'), size: "small" },
|
|
482
|
-
React__default["default"].createElement(PushPinIcon, { style: {
|
|
483
|
-
transform: 'rotate(90deg)',
|
|
484
|
-
} }))),
|
|
485
|
-
React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.pinToRight },
|
|
486
|
-
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn('right'), size: "small" },
|
|
487
|
-
React__default["default"].createElement(PushPinIcon, { style: {
|
|
488
|
-
transform: 'rotate(-90deg)',
|
|
489
|
-
} })))))));
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
|
|
493
|
-
var _a;
|
|
494
|
-
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
|
495
|
-
return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move },
|
|
496
|
-
React__default["default"].createElement(material.IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
|
497
|
-
var _a;
|
|
498
|
-
e.stopPropagation();
|
|
499
|
-
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
|
|
500
|
-
}, onDragStart: onDragStart, onDragEnd: onDragEnd, sx: (theme) => (Object.assign({ cursor: 'grab', m: 0, opacity: 0.5, p: '2px', transition: 'all 150ms ease-in-out', '&:hover': {
|
|
501
|
-
backgroundColor: 'transparent',
|
|
502
|
-
opacity: 1,
|
|
503
|
-
}, '&:active': {
|
|
504
|
-
cursor: 'grabbing',
|
|
505
|
-
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
506
|
-
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
|
507
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
508
|
-
React__default["default"].createElement(DragHandleIcon, null))));
|
|
509
|
-
};
|
|
510
|
-
|
|
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
|
-
const getAllLeafColumnDefs = (columns) => {
|
|
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
|
-
};
|
|
527
|
-
const prepareColumns = ({ columnDefs, columnFilterFns, defaultDisplayColumn, filterFns, sortingFns, }) => columnDefs.map((columnDef) => {
|
|
528
|
-
var _a, _b;
|
|
529
|
-
if (!columnDef.id)
|
|
530
|
-
columnDef.id = getColumnId(columnDef);
|
|
531
|
-
if (process.env.NODE_ENV !== 'production' && !columnDef.id) {
|
|
532
|
-
console.error('Column definitions must have a valid `accessorKey` or `id` property');
|
|
533
|
-
}
|
|
534
|
-
if (!columnDef.columnDefType)
|
|
535
|
-
columnDef.columnDefType = 'data';
|
|
536
|
-
if (!!((_a = columnDef.columns) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
537
|
-
columnDef.columnDefType = 'group';
|
|
538
|
-
columnDef.columns = prepareColumns({
|
|
539
|
-
columnDefs: columnDef.columns,
|
|
540
|
-
columnFilterFns,
|
|
541
|
-
defaultDisplayColumn,
|
|
542
|
-
filterFns,
|
|
543
|
-
sortingFns,
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
else if (columnDef.columnDefType === 'data') {
|
|
547
|
-
if (Object.keys(filterFns).includes(columnFilterFns[columnDef.id])) {
|
|
548
|
-
columnDef.filterFn =
|
|
549
|
-
(_b = filterFns[columnFilterFns[columnDef.id]]) !== null && _b !== void 0 ? _b : filterFns.fuzzy;
|
|
550
|
-
columnDef._filterFn =
|
|
551
|
-
columnFilterFns[columnDef.id];
|
|
552
|
-
}
|
|
553
|
-
if (Object.keys(sortingFns).includes(columnDef.sortingFn)) {
|
|
554
|
-
// @ts-ignore
|
|
555
|
-
columnDef.sortingFn = sortingFns[columnDef.sortingFn];
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
else if (columnDef.columnDefType === 'display') {
|
|
559
|
-
columnDef = Object.assign(Object.assign({}, defaultDisplayColumn), columnDef);
|
|
560
|
-
}
|
|
561
|
-
return columnDef;
|
|
562
|
-
});
|
|
563
|
-
const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
|
|
564
|
-
if (draggedColumn.getCanPin()) {
|
|
565
|
-
draggedColumn.pin(targetColumn.getIsPinned());
|
|
566
|
-
}
|
|
567
|
-
columnOrder.splice(columnOrder.indexOf(targetColumn.id), 0, columnOrder.splice(columnOrder.indexOf(draggedColumn.id), 1)[0]);
|
|
568
|
-
return [...columnOrder];
|
|
569
|
-
};
|
|
570
|
-
const showExpandColumn = (props, grouping) => !!(props.enableExpanding ||
|
|
571
|
-
(props.enableGrouping && (grouping === undefined || (grouping === null || grouping === void 0 ? void 0 : grouping.length))) ||
|
|
572
|
-
props.renderDetailPanel);
|
|
573
|
-
const getLeadingDisplayColumnIds = (props) => {
|
|
574
|
-
var _a;
|
|
575
|
-
return [
|
|
576
|
-
(props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
|
|
577
|
-
props.positionActionsColumn === 'first' &&
|
|
578
|
-
(props.enableRowActions ||
|
|
579
|
-
(props.enableEditing &&
|
|
580
|
-
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
581
|
-
'mrt-row-actions',
|
|
582
|
-
props.positionExpandColumn === 'first' &&
|
|
583
|
-
showExpandColumn(props) &&
|
|
584
|
-
'mrt-row-expand',
|
|
585
|
-
props.enableRowSelection && 'mrt-row-select',
|
|
586
|
-
props.enableRowNumbers && 'mrt-row-numbers',
|
|
587
|
-
].filter(Boolean);
|
|
588
|
-
};
|
|
589
|
-
const getTrailingDisplayColumnIds = (props) => {
|
|
590
|
-
var _a;
|
|
591
|
-
return [
|
|
592
|
-
props.positionActionsColumn === 'last' &&
|
|
593
|
-
(props.enableRowActions ||
|
|
594
|
-
(props.enableEditing &&
|
|
595
|
-
['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
|
|
596
|
-
'mrt-row-actions',
|
|
597
|
-
props.positionExpandColumn === 'last' &&
|
|
598
|
-
showExpandColumn(props) &&
|
|
599
|
-
'mrt-row-expand',
|
|
600
|
-
];
|
|
601
|
-
};
|
|
602
|
-
const getDefaultColumnOrderIds = (props) => [
|
|
603
|
-
...getLeadingDisplayColumnIds(props),
|
|
604
|
-
...getAllLeafColumnDefs(props.columns).map((columnDef) => getColumnId(columnDef)),
|
|
605
|
-
...getTrailingDisplayColumnIds(props),
|
|
606
|
-
].filter(Boolean);
|
|
607
|
-
const getDefaultColumnFilterFn = (columnDef) => {
|
|
608
|
-
if (columnDef.filterVariant === 'multi-select')
|
|
609
|
-
return 'arrIncludesSome';
|
|
610
|
-
if (columnDef.filterVariant === 'range')
|
|
611
|
-
return 'betweenInclusive';
|
|
612
|
-
if (columnDef.filterVariant === 'select' ||
|
|
613
|
-
columnDef.filterVariant === 'checkbox')
|
|
614
|
-
return 'equals';
|
|
615
|
-
return 'fuzzy';
|
|
616
|
-
};
|
|
617
|
-
const getIsLastLeftPinnedColumn = (table, column) => {
|
|
618
|
-
return (column.getIsPinned() === 'left' &&
|
|
619
|
-
table.getLeftLeafHeaders().length - 1 === column.getPinnedIndex());
|
|
620
|
-
};
|
|
621
|
-
const getIsFirstRightPinnedColumn = (column) => {
|
|
622
|
-
return column.getIsPinned() === 'right' && column.getPinnedIndex() === 0;
|
|
623
|
-
};
|
|
624
|
-
const getTotalRight = (table, column) => {
|
|
625
|
-
return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 160);
|
|
626
|
-
};
|
|
627
|
-
const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, }) => {
|
|
628
|
-
var _a, _b, _c, _d;
|
|
629
|
-
return (Object.assign(Object.assign({ backgroundColor: column.getIsPinned() && column.columnDef.columnDefType !== 'group'
|
|
630
|
-
? material.alpha(material.lighten(theme.palette.background.default, 0.04), 0.97)
|
|
631
|
-
: 'inherit', backgroundImage: 'inherit', boxShadow: getIsLastLeftPinnedColumn(table, column)
|
|
632
|
-
? `-4px 0 8px -6px ${material.alpha(theme.palette.common.black, 0.2)} inset`
|
|
633
|
-
: getIsFirstRightPinnedColumn(column)
|
|
634
|
-
? `4px 0 8px -6px ${material.alpha(theme.palette.common.black, 0.2)} inset`
|
|
635
|
-
: undefined, left: column.getIsPinned() === 'left'
|
|
636
|
-
? `${column.getStart('left')}px`
|
|
637
|
-
: undefined, opacity: ((_a = table.getState().draggingColumn) === null || _a === void 0 ? void 0 : _a.id) === column.id ||
|
|
638
|
-
((_b = table.getState().hoveredColumn) === null || _b === void 0 ? void 0 : _b.id) === column.id
|
|
639
|
-
? 0.5
|
|
640
|
-
: 1, position: column.getIsPinned() && column.columnDef.columnDefType !== 'group'
|
|
641
|
-
? 'sticky'
|
|
642
|
-
: undefined, right: column.getIsPinned() === 'right'
|
|
643
|
-
? `${getTotalRight(table, column)}px`
|
|
644
|
-
: undefined, transition: `all ${column.getIsResizing() ? 0 : '150ms'} ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
|
645
|
-
? tableCellProps.sx(theme)
|
|
646
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { maxWidth: `min(${column.getSize()}px, fit-content)`, minWidth: `max(${column.getSize()}px, ${(_c = column.columnDef.minSize) !== null && _c !== void 0 ? _c : 30}px)`, width: (_d = header === null || header === void 0 ? void 0 : header.getSize()) !== null && _d !== void 0 ? _d : column.getSize() }));
|
|
470
|
+
var _a, _b, _c, _d;
|
|
471
|
+
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
472
|
+
const { globalFilterFn, density } = getState();
|
|
473
|
+
const { column } = header !== null && header !== void 0 ? header : {};
|
|
474
|
+
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
475
|
+
const allowedColumnFilterOptions = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _a !== void 0 ? _a : columnFilterModeOptions;
|
|
476
|
+
const internalFilterOptions = React.useMemo(() => mrtFilterOptions(localization).filter((filterOption) => columnDef
|
|
477
|
+
? allowedColumnFilterOptions === undefined ||
|
|
478
|
+
(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.includes(filterOption.option))
|
|
479
|
+
: (!globalFilterModeOptions ||
|
|
480
|
+
globalFilterModeOptions.includes(filterOption.option)) &&
|
|
481
|
+
['fuzzy', 'contains', 'startsWith'].includes(filterOption.option)), []);
|
|
482
|
+
const handleSelectFilterMode = (option) => {
|
|
483
|
+
if (header && column) {
|
|
484
|
+
setColumnFilterFns((prev) => (Object.assign(Object.assign({}, prev), { [header.id]: option })));
|
|
485
|
+
if (['empty', 'notEmpty'].includes(option)) {
|
|
486
|
+
column.setFilterValue(' ');
|
|
487
|
+
}
|
|
488
|
+
else if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant) === 'multi-select' ||
|
|
489
|
+
['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'].includes(option)) {
|
|
490
|
+
column.setFilterValue([]);
|
|
491
|
+
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue([]);
|
|
492
|
+
}
|
|
493
|
+
else if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant) === 'range' ||
|
|
494
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(option)) {
|
|
495
|
+
column.setFilterValue(['', '']);
|
|
496
|
+
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue('');
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
column.setFilterValue('');
|
|
500
|
+
setFilterValue === null || setFilterValue === void 0 ? void 0 : setFilterValue('');
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
setGlobalFilterFn(option);
|
|
505
|
+
}
|
|
506
|
+
setAnchorEl(null);
|
|
507
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
508
|
+
};
|
|
509
|
+
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
510
|
+
return (React__default["default"].createElement(material.Menu, { anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
|
511
|
+
dense: density === 'compact',
|
|
512
|
+
} }, (_d = (header && column && columnDef
|
|
513
|
+
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
514
|
+
column: column,
|
|
515
|
+
internalFilterOptions,
|
|
516
|
+
onSelectFilterMode: handleSelectFilterMode,
|
|
517
|
+
table,
|
|
518
|
+
})) !== null && _c !== void 0 ? _c : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
|
519
|
+
column: column,
|
|
520
|
+
internalFilterOptions,
|
|
521
|
+
onSelectFilterMode: handleSelectFilterMode,
|
|
522
|
+
table,
|
|
523
|
+
})
|
|
524
|
+
: renderGlobalFilterModeMenuItems === null || renderGlobalFilterModeMenuItems === void 0 ? void 0 : renderGlobalFilterModeMenuItems({
|
|
525
|
+
internalFilterOptions,
|
|
526
|
+
onSelectFilterMode: handleSelectFilterMode,
|
|
527
|
+
table,
|
|
528
|
+
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (React__default["default"].createElement(material.MenuItem, { divider: divider, key: index, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
|
529
|
+
alignItems: 'center',
|
|
530
|
+
display: 'flex',
|
|
531
|
+
gap: '2ch',
|
|
532
|
+
my: 0,
|
|
533
|
+
py: '6px',
|
|
534
|
+
}, value: option },
|
|
535
|
+
React__default["default"].createElement(material.Box, { sx: { fontSize: '1.25rem', width: '2ch' } }, symbol),
|
|
536
|
+
label)))));
|
|
647
537
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
538
|
+
|
|
539
|
+
const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
540
|
+
const { options: { icons: { PushPinIcon }, localization, }, } = table;
|
|
541
|
+
const handlePinColumn = (pinDirection) => {
|
|
542
|
+
column.pin(pinDirection);
|
|
543
|
+
};
|
|
544
|
+
return (React__default["default"].createElement(material.Box, { sx: { minWidth: '70px', textAlign: 'center' } }, column.getIsPinned() ? (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.unpin },
|
|
545
|
+
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn(false), size: "small" },
|
|
546
|
+
React__default["default"].createElement(PushPinIcon, null)))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
547
|
+
React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.pinToLeft },
|
|
548
|
+
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn('left'), size: "small" },
|
|
549
|
+
React__default["default"].createElement(PushPinIcon, { style: {
|
|
550
|
+
transform: 'rotate(90deg)',
|
|
551
|
+
} }))),
|
|
552
|
+
React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.pinToRight },
|
|
553
|
+
React__default["default"].createElement(material.IconButton, { onClick: () => handlePinColumn('right'), size: "small" },
|
|
554
|
+
React__default["default"].createElement(PushPinIcon, { style: {
|
|
555
|
+
transform: 'rotate(-90deg)',
|
|
556
|
+
} })))))));
|
|
652
557
|
};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
558
|
+
|
|
559
|
+
const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
|
|
560
|
+
var _a;
|
|
561
|
+
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
|
562
|
+
return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move },
|
|
563
|
+
React__default["default"].createElement(material.IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
|
564
|
+
var _a;
|
|
565
|
+
e.stopPropagation();
|
|
566
|
+
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
|
|
567
|
+
}, onDragStart: onDragStart, onDragEnd: onDragEnd, sx: (theme) => (Object.assign({ cursor: 'grab', m: 0, opacity: 0.5, p: '2px', transition: 'all 150ms ease-in-out', '&:hover': {
|
|
568
|
+
backgroundColor: 'transparent',
|
|
569
|
+
opacity: 1,
|
|
570
|
+
}, '&:active': {
|
|
571
|
+
cursor: 'grabbing',
|
|
572
|
+
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
573
|
+
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
|
574
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
575
|
+
React__default["default"].createElement(DragHandleIcon, null))));
|
|
666
576
|
};
|
|
667
577
|
|
|
668
578
|
const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredColumn, column, isSubMenu, table, }) => {
|
|
@@ -1850,19 +1760,11 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1850
1760
|
? columnDef.muiTableHeadCellProps({ column, table })
|
|
1851
1761
|
: columnDef.muiTableHeadCellProps;
|
|
1852
1762
|
const tableCellProps = Object.assign(Object.assign({}, mTableHeadCellProps), mcTableHeadCellProps);
|
|
1853
|
-
const
|
|
1854
|
-
if (enableGrouping && (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
|
|
1855
|
-
setHoveredColumn(null);
|
|
1856
|
-
}
|
|
1857
|
-
if (enableColumnOrdering && draggingColumn && columnDefType !== 'group') {
|
|
1858
|
-
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
1859
|
-
}
|
|
1860
|
-
};
|
|
1861
|
-
const draggingBorder = (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
|
|
1763
|
+
const draggingBorder = React.useMemo(() => (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
|
|
1862
1764
|
? `1px dashed ${theme.palette.text.secondary}`
|
|
1863
1765
|
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
1864
1766
|
? `2px dashed ${theme.palette.primary.main}`
|
|
1865
|
-
: undefined;
|
|
1767
|
+
: undefined, [draggingColumn, hoveredColumn]);
|
|
1866
1768
|
const draggingBorders = draggingBorder
|
|
1867
1769
|
? {
|
|
1868
1770
|
borderLeft: draggingBorder,
|
|
@@ -1870,6 +1772,14 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1870
1772
|
borderTop: draggingBorder,
|
|
1871
1773
|
}
|
|
1872
1774
|
: undefined;
|
|
1775
|
+
const handleDragEnter = (_e) => {
|
|
1776
|
+
if (enableGrouping && (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
|
|
1777
|
+
setHoveredColumn(null);
|
|
1778
|
+
}
|
|
1779
|
+
if (enableColumnOrdering && draggingColumn && columnDefType !== 'group') {
|
|
1780
|
+
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1873
1783
|
const headerElement = ((_b = ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.Header) instanceof Function
|
|
1874
1784
|
? (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Header) === null || _a === void 0 ? void 0 : _a.call(columnDef, {
|
|
1875
1785
|
column,
|
|
@@ -2108,10 +2018,10 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
|
2108
2018
|
: (_b = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) !== null && _b !== void 0 ? _b : cell.renderValue()));
|
|
2109
2019
|
};
|
|
2110
2020
|
|
|
2111
|
-
const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
2021
|
+
const MRT_TableBodyCell = ({ cell, enableHover, numRows, rowIndex, rowRef, table, }) => {
|
|
2112
2022
|
var _a, _b;
|
|
2113
2023
|
const theme = material.useTheme();
|
|
2114
|
-
const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping,
|
|
2024
|
+
const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, muiTableBodyCellProps, muiTableBodyCellSkeletonProps, rowNumberMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
|
|
2115
2025
|
const { draggingColumn, editingCell, editingRow, hoveredColumn, density, isLoading, showSkeletons, } = getState();
|
|
2116
2026
|
const { column, row } = cell;
|
|
2117
2027
|
const { columnDef } = column;
|
|
@@ -2126,6 +2036,25 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
2126
2036
|
const skeletonProps = muiTableBodyCellSkeletonProps instanceof Function
|
|
2127
2037
|
? muiTableBodyCellSkeletonProps({ cell, column, row, table })
|
|
2128
2038
|
: muiTableBodyCellSkeletonProps;
|
|
2039
|
+
const [skeletonWidth, setSkeletonWidth] = React.useState(0);
|
|
2040
|
+
React.useEffect(() => setSkeletonWidth(isLoading || showSkeletons
|
|
2041
|
+
? columnDefType === 'display'
|
|
2042
|
+
? column.getSize() / 2
|
|
2043
|
+
: Math.round(Math.random() * (column.getSize() - column.getSize() / 3) +
|
|
2044
|
+
column.getSize() / 3)
|
|
2045
|
+
: 100), []);
|
|
2046
|
+
const draggingBorder = React.useMemo(() => (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
|
|
2047
|
+
? `1px dashed ${theme.palette.text.secondary}`
|
|
2048
|
+
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
2049
|
+
? `2px dashed ${theme.palette.primary.main}`
|
|
2050
|
+
: undefined, [draggingColumn, hoveredColumn]);
|
|
2051
|
+
const draggingBorders = React.useMemo(() => draggingBorder
|
|
2052
|
+
? {
|
|
2053
|
+
borderLeft: draggingBorder,
|
|
2054
|
+
borderRight: draggingBorder,
|
|
2055
|
+
borderBottom: rowIndex === numRows - 1 ? draggingBorder : undefined,
|
|
2056
|
+
}
|
|
2057
|
+
: undefined, [draggingBorder, numRows]);
|
|
2129
2058
|
const isEditable = (enableEditing || columnDef.enableEditing) &&
|
|
2130
2059
|
columnDef.enableEditing !== false;
|
|
2131
2060
|
const isEditing = isEditable &&
|
|
@@ -2133,13 +2062,6 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
2133
2062
|
(editingMode === 'table' ||
|
|
2134
2063
|
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id ||
|
|
2135
2064
|
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) === cell.id);
|
|
2136
|
-
const [skeletonWidth, setSkeletonWidth] = React.useState(0);
|
|
2137
|
-
React.useEffect(() => setSkeletonWidth(isLoading || showSkeletons
|
|
2138
|
-
? columnDefType === 'display'
|
|
2139
|
-
? column.getSize() / 2
|
|
2140
|
-
: Math.round(Math.random() * (column.getSize() - column.getSize() / 3) +
|
|
2141
|
-
column.getSize() / 3)
|
|
2142
|
-
: 100), [isLoading, showSkeletons]);
|
|
2143
2065
|
const handleDoubleClick = (event) => {
|
|
2144
2066
|
var _a;
|
|
2145
2067
|
(_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onDoubleClick) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
|
|
@@ -2166,24 +2088,6 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
|
|
|
2166
2088
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
2167
2089
|
}
|
|
2168
2090
|
};
|
|
2169
|
-
const draggingBorder = (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
|
|
2170
|
-
? `1px dashed ${theme.palette.text.secondary}`
|
|
2171
|
-
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
2172
|
-
? `2px dashed ${theme.palette.primary.main}`
|
|
2173
|
-
: undefined;
|
|
2174
|
-
const draggingBorders = draggingBorder
|
|
2175
|
-
? {
|
|
2176
|
-
borderLeft: draggingBorder,
|
|
2177
|
-
borderRight: draggingBorder,
|
|
2178
|
-
borderBottom: row.index ===
|
|
2179
|
-
(enablePagination
|
|
2180
|
-
? table.getRowModel()
|
|
2181
|
-
: table.getPrePaginationRowModel()).rows.length -
|
|
2182
|
-
1
|
|
2183
|
-
? draggingBorder
|
|
2184
|
-
: undefined,
|
|
2185
|
-
}
|
|
2186
|
-
: undefined;
|
|
2187
2091
|
return (React__default["default"].createElement(material.TableCell, Object.assign({}, tableCellProps, { onDragEnter: handleDragEnter, onDoubleClick: handleDoubleClick, sx: (theme) => (Object.assign(Object.assign({ cursor: isEditable && editingMode === 'cell' ? 'pointer' : 'inherit', overflow: 'hidden', p: density === 'compact'
|
|
2188
2092
|
? columnDefType === 'display'
|
|
2189
2093
|
? '0 0.5rem'
|
|
@@ -2240,8 +2144,7 @@ const MRT_TableDetailPanel = ({ row, table }) => {
|
|
|
2240
2144
|
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React__default["default"].createElement(material.Collapse, { in: row.getIsExpanded() }, renderDetailPanel({ row, table }))))));
|
|
2241
2145
|
};
|
|
2242
2146
|
|
|
2243
|
-
const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
|
|
2244
|
-
var _a, _b;
|
|
2147
|
+
const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|
|
2245
2148
|
const theme = material.useTheme();
|
|
2246
2149
|
const { getIsSomeColumnsPinned, getState, options: { enableRowOrdering, memoMode, muiTableBodyRowProps, renderDetailPanel, }, setHoveredRow, } = table;
|
|
2247
2150
|
const { draggingColumn, draggingRow, editingCell, editingRow, hoveredRow } = getState();
|
|
@@ -2254,11 +2157,11 @@ const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
|
|
|
2254
2157
|
}
|
|
2255
2158
|
};
|
|
2256
2159
|
const rowRef = React.useRef(null);
|
|
2257
|
-
const draggingBorder = (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id
|
|
2160
|
+
const draggingBorder = React.useMemo(() => (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id
|
|
2258
2161
|
? `1px dashed ${theme.palette.text.secondary}`
|
|
2259
2162
|
: (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id
|
|
2260
2163
|
? `2px dashed ${theme.palette.primary.main}`
|
|
2261
|
-
: undefined;
|
|
2164
|
+
: undefined, [draggingRow, hoveredRow]);
|
|
2262
2165
|
const draggingBorders = draggingBorder
|
|
2263
2166
|
? {
|
|
2264
2167
|
border: draggingBorder,
|
|
@@ -2278,16 +2181,17 @@ const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
|
|
|
2278
2181
|
: undefined,
|
|
2279
2182
|
} }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
|
2280
2183
|
? tableRowProps.sx(theme)
|
|
2281
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)), draggingBorders)) }),
|
|
2184
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)), draggingBorders)) }), row.getVisibleCells().map((cell) => {
|
|
2282
2185
|
const props = {
|
|
2283
2186
|
cell,
|
|
2284
2187
|
enableHover: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false,
|
|
2285
2188
|
key: cell.id,
|
|
2189
|
+
numRows,
|
|
2286
2190
|
rowIndex,
|
|
2287
2191
|
rowRef,
|
|
2288
2192
|
table,
|
|
2289
2193
|
};
|
|
2290
|
-
return memoMode === '
|
|
2194
|
+
return memoMode === 'cells' &&
|
|
2291
2195
|
cell.column.columnDef.columnDefType === 'data' &&
|
|
2292
2196
|
!draggingColumn &&
|
|
2293
2197
|
!draggingRow &&
|
|
@@ -2386,6 +2290,7 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2386
2290
|
: rowOrVirtualRow;
|
|
2387
2291
|
const props = {
|
|
2388
2292
|
key: row.id,
|
|
2293
|
+
numRows: rows.length,
|
|
2389
2294
|
row,
|
|
2390
2295
|
rowIndex: enableRowVirtualization
|
|
2391
2296
|
? rowOrVirtualRow.index
|
|
@@ -2393,12 +2298,12 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2393
2298
|
table,
|
|
2394
2299
|
virtualRow: enableRowVirtualization ? rowOrVirtualRow : null,
|
|
2395
2300
|
};
|
|
2396
|
-
return memoMode === '
|
|
2301
|
+
return memoMode === 'rows' ? (React__default["default"].createElement(Memo_MRT_TableBodyRow, Object.assign({}, props))) : (React__default["default"].createElement(MRT_TableBodyRow, Object.assign({}, props)));
|
|
2397
2302
|
}),
|
|
2398
2303
|
enableRowVirtualization && paddingBottom > 0 && (React__default["default"].createElement("tr", null,
|
|
2399
2304
|
React__default["default"].createElement("td", { style: { height: `${paddingBottom}px` } })))))));
|
|
2400
2305
|
};
|
|
2401
|
-
const Memo_MRT_TableBody = React.memo(MRT_TableBody, () =>
|
|
2306
|
+
const Memo_MRT_TableBody = React.memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
|
2402
2307
|
|
|
2403
2308
|
const MRT_TableFooterCell = ({ footer, table }) => {
|
|
2404
2309
|
var _a, _b, _c;
|
|
@@ -2719,6 +2624,96 @@ const MRT_TableRoot = (props) => {
|
|
|
2719
2624
|
editingRow && props.editingMode === 'modal' && (React__default["default"].createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
|
|
2720
2625
|
};
|
|
2721
2626
|
|
|
2627
|
+
const MRT_Localization_EN = {
|
|
2628
|
+
actions: 'Actions',
|
|
2629
|
+
and: 'and',
|
|
2630
|
+
cancel: 'Cancel',
|
|
2631
|
+
changeFilterMode: 'Change filter mode',
|
|
2632
|
+
changeSearchMode: 'Change search mode',
|
|
2633
|
+
clearFilter: 'Clear filter',
|
|
2634
|
+
clearSearch: 'Clear search',
|
|
2635
|
+
clearSort: 'Clear sort',
|
|
2636
|
+
clickToCopy: 'Click to copy',
|
|
2637
|
+
columnActions: 'Column Actions',
|
|
2638
|
+
copiedToClipboard: 'Copied to clipboard',
|
|
2639
|
+
dropToGroupBy: 'Drop to group by {column}',
|
|
2640
|
+
edit: 'Edit',
|
|
2641
|
+
expand: 'Expand',
|
|
2642
|
+
expandAll: 'Expand all',
|
|
2643
|
+
filterArrIncludes: 'Includes',
|
|
2644
|
+
filterArrIncludesAll: 'Includes all',
|
|
2645
|
+
filterArrIncludesSome: 'Includes',
|
|
2646
|
+
filterBetween: 'Between',
|
|
2647
|
+
filterBetweenInclusive: 'Between Inclusive',
|
|
2648
|
+
filterByColumn: 'Filter by {column}',
|
|
2649
|
+
filterContains: 'Contains',
|
|
2650
|
+
filterEmpty: 'Empty',
|
|
2651
|
+
filterEndsWith: 'Ends With',
|
|
2652
|
+
filterEquals: 'Equals',
|
|
2653
|
+
filterEqualsString: 'Equals',
|
|
2654
|
+
filterFuzzy: 'Fuzzy',
|
|
2655
|
+
filterGreaterThan: 'Greater Than',
|
|
2656
|
+
filterGreaterThanOrEqualTo: 'Greater Than Or Equal To',
|
|
2657
|
+
filterInNumberRange: 'Between',
|
|
2658
|
+
filterIncludesString: 'Contains',
|
|
2659
|
+
filterIncludesStringSensitive: 'Contains',
|
|
2660
|
+
filterLessThan: 'Less Than',
|
|
2661
|
+
filterLessThanOrEqualTo: 'Less Than Or Equal To',
|
|
2662
|
+
filterMode: 'Filter Mode: {filterType}',
|
|
2663
|
+
filterNotEmpty: 'Not Empty',
|
|
2664
|
+
filterNotEquals: 'Not Equals',
|
|
2665
|
+
filterStartsWith: 'Starts With',
|
|
2666
|
+
filterWeakEquals: 'Equals',
|
|
2667
|
+
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
|
2668
|
+
goToFirstPage: 'Go to first page',
|
|
2669
|
+
goToLastPage: 'Go to last page',
|
|
2670
|
+
goToNextPage: 'Go to next page',
|
|
2671
|
+
goToPreviousPage: 'Go to previous page',
|
|
2672
|
+
grab: 'Grab',
|
|
2673
|
+
groupByColumn: 'Group by {column}',
|
|
2674
|
+
groupedBy: 'Grouped by ',
|
|
2675
|
+
hideAll: 'Hide all',
|
|
2676
|
+
hideColumn: 'Hide {column} column',
|
|
2677
|
+
max: 'Max',
|
|
2678
|
+
min: 'Min',
|
|
2679
|
+
move: 'Move',
|
|
2680
|
+
noRecordsToDisplay: 'No records to display',
|
|
2681
|
+
noResultsFound: 'No results found',
|
|
2682
|
+
of: 'of',
|
|
2683
|
+
or: 'or',
|
|
2684
|
+
pinToLeft: 'Pin to left',
|
|
2685
|
+
pinToRight: 'Pin to right',
|
|
2686
|
+
resetColumnSize: 'Reset column size',
|
|
2687
|
+
resetOrder: 'Reset order',
|
|
2688
|
+
rowActions: 'Row Actions',
|
|
2689
|
+
rowNumber: '#',
|
|
2690
|
+
rowNumbers: 'Row Numbers',
|
|
2691
|
+
rowsPerPage: 'Rows per page',
|
|
2692
|
+
save: 'Save',
|
|
2693
|
+
search: 'Search',
|
|
2694
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} of {rowCount} row(s) selected',
|
|
2695
|
+
select: 'Select',
|
|
2696
|
+
showAll: 'Show all',
|
|
2697
|
+
showAllColumns: 'Show all columns',
|
|
2698
|
+
showHideColumns: 'Show/Hide columns',
|
|
2699
|
+
showHideFilters: 'Show/Hide filters',
|
|
2700
|
+
showHideSearch: 'Show/Hide search',
|
|
2701
|
+
sortByColumnAsc: 'Sort by {column} ascending',
|
|
2702
|
+
sortByColumnDesc: 'Sort by {column} descending',
|
|
2703
|
+
sortedByColumnAsc: 'Sorted by {column} ascending',
|
|
2704
|
+
sortedByColumnDesc: 'Sorted by {column} descending',
|
|
2705
|
+
thenBy: ', then by ',
|
|
2706
|
+
toggleDensity: 'Toggle density',
|
|
2707
|
+
toggleFullScreen: 'Toggle full screen',
|
|
2708
|
+
toggleSelectAll: 'Toggle select all',
|
|
2709
|
+
toggleSelectRow: 'Toggle select row',
|
|
2710
|
+
toggleVisibility: 'Toggle visibility',
|
|
2711
|
+
ungroupByColumn: 'Ungroup by {column}',
|
|
2712
|
+
unpin: 'Unpin',
|
|
2713
|
+
unpinAll: 'Unpin all',
|
|
2714
|
+
unsorted: 'Unsorted',
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2722
2717
|
const MaterialReactTable = (_a) => {
|
|
2723
2718
|
var { aggregationFns, autoResetExpanded = false, columnResizeMode = 'onEnd', defaultColumn, defaultDisplayColumn, editingMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, 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 = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnResizeMode", "defaultColumn", "defaultDisplayColumn", "editingMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "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"]);
|
|
2724
2719
|
const _icons = React.useMemo(() => (Object.assign(Object.assign({}, MRT_Default_Icons), icons)), []);
|