material-react-table 0.18.1 → 0.19.0-alpha.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/dist/MaterialReactTable.d.ts +166 -133
- package/dist/body/MRT_TableBody.d.ts +1 -1
- package/dist/body/MRT_TableBodyCell.d.ts +1 -1
- package/dist/body/MRT_TableBodyRow.d.ts +1 -1
- package/dist/body/MRT_TableDetailPanel.d.ts +1 -1
- package/dist/buttons/MRT_ColumnPinningButtons.d.ts +1 -1
- package/dist/buttons/MRT_CopyButton.d.ts +1 -1
- package/dist/buttons/MRT_EditActionButtons.d.ts +1 -1
- package/dist/buttons/MRT_ExpandAllButton.d.ts +1 -1
- package/dist/buttons/MRT_ExpandButton.d.ts +1 -1
- package/dist/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
- package/dist/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +1 -1
- package/dist/filtersFns.d.ts +31 -23
- package/dist/footer/MRT_TableFooter.d.ts +1 -1
- package/dist/footer/MRT_TableFooterCell.d.ts +1 -1
- package/dist/footer/MRT_TableFooterRow.d.ts +1 -1
- package/dist/head/MRT_DraggableTableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHead.d.ts +1 -1
- package/dist/head/MRT_TableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellColumnActionsButton.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterContainer.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellResizeHandle.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadRow.d.ts +1 -1
- package/dist/inputs/MRT_EditCellTextField.d.ts +1 -1
- package/dist/inputs/MRT_FilterRangeFields.d.ts +1 -1
- package/dist/inputs/MRT_FilterTextField.d.ts +1 -1
- package/dist/inputs/MRT_GlobalFilterTextField.d.ts +1 -1
- package/dist/inputs/MRT_SelectCheckbox.d.ts +1 -1
- package/dist/material-react-table.cjs.development.js +756 -756
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +757 -757
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +1 -1
- package/dist/menus/MRT_FilterOptionMenu.d.ts +1 -1
- package/dist/menus/MRT_RowActionMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
- package/dist/sortingFns.d.ts +10 -3
- package/dist/table/MRT_Table.d.ts +1 -1
- package/dist/table/MRT_TableContainer.d.ts +1 -1
- package/dist/table/MRT_TablePaper.d.ts +1 -1
- package/dist/toolbar/MRT_LinearProgressBar.d.ts +1 -1
- package/dist/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarBottom.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarTop.d.ts +1 -1
- package/dist/utils.d.ts +10 -16
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +163 -156
- package/src/body/MRT_TableBody.tsx +5 -6
- package/src/body/MRT_TableBodyCell.tsx +18 -27
- package/src/body/MRT_TableBodyRow.tsx +7 -7
- package/src/body/MRT_TableDetailPanel.tsx +7 -7
- package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -3
- package/src/buttons/MRT_CopyButton.tsx +5 -7
- package/src/buttons/MRT_EditActionButtons.tsx +4 -5
- package/src/buttons/MRT_ExpandAllButton.tsx +4 -5
- package/src/buttons/MRT_ExpandButton.tsx +4 -5
- package/src/buttons/MRT_FullScreenToggleButton.tsx +3 -7
- package/src/buttons/MRT_GrabHandleButton.tsx +39 -41
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -4
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +3 -7
- package/src/buttons/MRT_ToggleFiltersButton.tsx +3 -4
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +4 -8
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -6
- package/src/filtersFns.ts +24 -23
- package/src/footer/MRT_TableFooter.tsx +5 -6
- package/src/footer/MRT_TableFooterCell.tsx +8 -11
- package/src/footer/MRT_TableFooterRow.tsx +5 -9
- package/src/head/MRT_DraggableTableHeadCell.tsx +4 -6
- package/src/head/MRT_TableHead.tsx +5 -5
- package/src/head/MRT_TableHeadCell.tsx +18 -29
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +6 -8
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +5 -7
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +13 -19
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +12 -11
- package/src/head/MRT_TableHeadCellSortLabel.tsx +3 -5
- package/src/head/MRT_TableHeadRow.tsx +6 -6
- package/src/inputs/MRT_EditCellTextField.tsx +12 -14
- package/src/inputs/MRT_FilterRangeFields.tsx +4 -4
- package/src/inputs/MRT_FilterTextField.tsx +27 -38
- package/src/inputs/MRT_GlobalFilterTextField.tsx +5 -6
- package/src/inputs/MRT_SelectCheckbox.tsx +9 -12
- package/src/menus/MRT_ColumnActionMenu.tsx +5 -9
- package/src/menus/MRT_FilterOptionMenu.tsx +16 -48
- package/src/menus/MRT_RowActionMenu.tsx +4 -5
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +8 -9
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +11 -10
- package/src/sortingFns.ts +11 -3
- package/src/table/MRT_Table.tsx +7 -11
- package/src/table/MRT_TableContainer.tsx +5 -6
- package/src/table/MRT_TablePaper.tsx +7 -8
- package/src/table/MRT_TableRoot.tsx +118 -132
- package/src/toolbar/MRT_LinearProgressBar.tsx +4 -5
- package/src/toolbar/MRT_TablePagination.tsx +7 -9
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +6 -7
- package/src/toolbar/MRT_ToolbarBottom.tsx +8 -9
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -10
- package/src/toolbar/MRT_ToolbarTop.tsx +11 -11
- package/src/utils.ts +56 -50
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useMemo, forwardRef, useState, useCallback, Fragment, useLayoutEffect, useEffect } from 'react';
|
|
2
2
|
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';
|
|
3
|
-
import {
|
|
3
|
+
import { filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
4
4
|
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, TablePagination, Chip, Alert, AlertTitle, LinearProgress, useMediaQuery, Toolbar, lighten, alpha, Grow, TableSortLabel, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog } from '@mui/material';
|
|
5
|
-
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
6
5
|
import { useDrop, useDrag, DndProvider } from 'react-dnd';
|
|
6
|
+
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
7
7
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
8
8
|
import { useVirtual } from 'react-virtual';
|
|
9
9
|
|
|
@@ -141,23 +141,23 @@ var MRT_Default_Icons = {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
var MRT_ExpandAllButton = function MRT_ExpandAllButton(_ref) {
|
|
144
|
-
var
|
|
145
|
-
var getIsAllRowsExpanded =
|
|
146
|
-
getIsSomeRowsExpanded =
|
|
147
|
-
getCanSomeRowsExpand =
|
|
148
|
-
getState =
|
|
149
|
-
|
|
150
|
-
KeyboardDoubleArrowDownIcon =
|
|
151
|
-
localization =
|
|
152
|
-
muiExpandAllButtonProps =
|
|
153
|
-
renderDetailPanel =
|
|
154
|
-
toggleAllRowsExpanded =
|
|
144
|
+
var table = _ref.table;
|
|
145
|
+
var getIsAllRowsExpanded = table.getIsAllRowsExpanded,
|
|
146
|
+
getIsSomeRowsExpanded = table.getIsSomeRowsExpanded,
|
|
147
|
+
getCanSomeRowsExpand = table.getCanSomeRowsExpand,
|
|
148
|
+
getState = table.getState,
|
|
149
|
+
_table$options = table.options,
|
|
150
|
+
KeyboardDoubleArrowDownIcon = _table$options.icons.KeyboardDoubleArrowDownIcon,
|
|
151
|
+
localization = _table$options.localization,
|
|
152
|
+
muiExpandAllButtonProps = _table$options.muiExpandAllButtonProps,
|
|
153
|
+
renderDetailPanel = _table$options.renderDetailPanel,
|
|
154
|
+
toggleAllRowsExpanded = table.toggleAllRowsExpanded;
|
|
155
155
|
|
|
156
156
|
var _getState = getState(),
|
|
157
157
|
density = _getState.density;
|
|
158
158
|
|
|
159
159
|
var iconButtonProps = muiExpandAllButtonProps instanceof Function ? muiExpandAllButtonProps({
|
|
160
|
-
|
|
160
|
+
table: table
|
|
161
161
|
}) : muiExpandAllButtonProps;
|
|
162
162
|
return React.createElement(Tooltip, {
|
|
163
163
|
arrow: true,
|
|
@@ -185,19 +185,19 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton(_ref) {
|
|
|
185
185
|
|
|
186
186
|
var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
187
187
|
var row = _ref.row,
|
|
188
|
-
|
|
189
|
-
var getState =
|
|
190
|
-
|
|
191
|
-
ExpandMoreIcon =
|
|
192
|
-
localization =
|
|
193
|
-
muiExpandButtonProps =
|
|
194
|
-
renderDetailPanel =
|
|
188
|
+
table = _ref.table;
|
|
189
|
+
var getState = table.getState,
|
|
190
|
+
_table$options = table.options,
|
|
191
|
+
ExpandMoreIcon = _table$options.icons.ExpandMoreIcon,
|
|
192
|
+
localization = _table$options.localization,
|
|
193
|
+
muiExpandButtonProps = _table$options.muiExpandButtonProps,
|
|
194
|
+
renderDetailPanel = _table$options.renderDetailPanel;
|
|
195
195
|
|
|
196
196
|
var _getState = getState(),
|
|
197
197
|
density = _getState.density;
|
|
198
198
|
|
|
199
199
|
var iconButtonProps = muiExpandButtonProps instanceof Function ? muiExpandButtonProps({
|
|
200
|
-
|
|
200
|
+
table: table,
|
|
201
201
|
row: row
|
|
202
202
|
}) : muiExpandButtonProps;
|
|
203
203
|
|
|
@@ -227,112 +227,6 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
|
227
227
|
}))));
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
var fuzzy = function fuzzy(row, columnId, filterValue, addMeta) {
|
|
231
|
-
var itemRank = rankItem(row.getValue(columnId), filterValue, {
|
|
232
|
-
threshold: rankings.MATCHES
|
|
233
|
-
});
|
|
234
|
-
addMeta(itemRank);
|
|
235
|
-
return itemRank.passed;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
fuzzy.autoRemove = function (val) {
|
|
239
|
-
return !val;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
var contains = function contains(row, id, filterValue) {
|
|
243
|
-
return row.getValue(id).toString().toLowerCase().trim().includes(filterValue.toString().toLowerCase().trim());
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
contains.autoRemove = function (val) {
|
|
247
|
-
return !val;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
var startsWith = function startsWith(row, id, filterValue) {
|
|
251
|
-
return row.getValue(id).toString().toLowerCase().trim().startsWith(filterValue.toString().toLowerCase().trim());
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
startsWith.autoRemove = function (val) {
|
|
255
|
-
return !val;
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
var endsWith = function endsWith(row, id, filterValue) {
|
|
259
|
-
return row.getValue(id).toString().toLowerCase().trim().endsWith(filterValue.toString().toLowerCase().trim());
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
endsWith.autoRemove = function (val) {
|
|
263
|
-
return !val;
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
var equals = function equals(row, id, filterValue) {
|
|
267
|
-
return row.getValue(id).toString().toLowerCase().trim() === filterValue.toString().toLowerCase().trim();
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
equals.autoRemove = function (val) {
|
|
271
|
-
return !val;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
var notEquals = function notEquals(row, id, filterValue) {
|
|
275
|
-
return row.getValue(id).toString().toLowerCase().trim() !== filterValue.toString().toLowerCase().trim();
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
notEquals.autoRemove = function (val) {
|
|
279
|
-
return !val;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var greaterThan = function greaterThan(row, id, filterValue) {
|
|
283
|
-
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) >= +filterValue : row.getValue(id).toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
greaterThan.autoRemove = function (val) {
|
|
287
|
-
return !val;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
var lessThan = function lessThan(row, id, filterValue) {
|
|
291
|
-
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) <= +filterValue : row.getValue(id).toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
lessThan.autoRemove = function (val) {
|
|
295
|
-
return !val;
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
var between = function between(row, id, filterValues) {
|
|
299
|
-
return (['', undefined].includes(filterValues[0]) || greaterThan(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThan(row, id, filterValues[1]));
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
between.autoRemove = function (val) {
|
|
303
|
-
return !val;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
var empty = function empty(row, id, _filterValue) {
|
|
307
|
-
return !row.getValue(id).toString().trim();
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
empty.autoRemove = function (val) {
|
|
311
|
-
return !val;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
var notEmpty = function notEmpty(row, id, _filterValue) {
|
|
315
|
-
return !!row.getValue(id).toString().trim();
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
notEmpty.autoRemove = function (val) {
|
|
319
|
-
return !val;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
var MRT_FilterFns = {
|
|
323
|
-
between: between,
|
|
324
|
-
contains: contains,
|
|
325
|
-
empty: empty,
|
|
326
|
-
endsWith: endsWith,
|
|
327
|
-
equals: equals,
|
|
328
|
-
fuzzy: fuzzy,
|
|
329
|
-
greaterThan: greaterThan,
|
|
330
|
-
lessThan: lessThan,
|
|
331
|
-
notEmpty: notEmpty,
|
|
332
|
-
notEquals: notEquals,
|
|
333
|
-
startsWith: startsWith
|
|
334
|
-
};
|
|
335
|
-
|
|
336
230
|
var commonMenuItemStyles = {
|
|
337
231
|
py: '6px',
|
|
338
232
|
my: 0,
|
|
@@ -345,19 +239,19 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
|
345
239
|
header = _ref.header,
|
|
346
240
|
onSelect = _ref.onSelect,
|
|
347
241
|
setAnchorEl = _ref.setAnchorEl,
|
|
348
|
-
|
|
349
|
-
var getState =
|
|
350
|
-
|
|
351
|
-
enabledGlobalFilterOptions =
|
|
352
|
-
enabledColumnFilterOptions =
|
|
353
|
-
localization =
|
|
354
|
-
setCurrentFilterFns =
|
|
355
|
-
setCurrentGlobalFilterFn =
|
|
242
|
+
table = _ref.table;
|
|
243
|
+
var getState = table.getState,
|
|
244
|
+
_table$options = table.options,
|
|
245
|
+
enabledGlobalFilterOptions = _table$options.enabledGlobalFilterOptions,
|
|
246
|
+
enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
|
|
247
|
+
localization = _table$options.localization,
|
|
248
|
+
setCurrentFilterFns = table.setCurrentFilterFns,
|
|
249
|
+
setCurrentGlobalFilterFn = table.setCurrentGlobalFilterFn;
|
|
356
250
|
|
|
357
251
|
var _getState = getState(),
|
|
358
|
-
density = _getState.density,
|
|
359
252
|
currentFilterFns = _getState.currentFilterFns,
|
|
360
|
-
currentGlobalFilterFn = _getState.currentGlobalFilterFn
|
|
253
|
+
currentGlobalFilterFn = _getState.currentGlobalFilterFn,
|
|
254
|
+
density = _getState.density;
|
|
361
255
|
|
|
362
256
|
var _ref2 = header != null ? header : {},
|
|
363
257
|
column = _ref2.column;
|
|
@@ -370,80 +264,69 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
|
370
264
|
return [{
|
|
371
265
|
option: 'fuzzy',
|
|
372
266
|
label: localization.filterFuzzy,
|
|
373
|
-
divider: false
|
|
374
|
-
fn: fuzzy
|
|
267
|
+
divider: false
|
|
375
268
|
}, {
|
|
376
269
|
option: 'contains',
|
|
377
270
|
label: localization.filterContains,
|
|
378
|
-
divider: false
|
|
379
|
-
fn: contains
|
|
271
|
+
divider: false
|
|
380
272
|
}, {
|
|
381
273
|
option: 'startsWith',
|
|
382
274
|
label: localization.filterStartsWith,
|
|
383
|
-
divider: false
|
|
384
|
-
fn: startsWith
|
|
275
|
+
divider: false
|
|
385
276
|
}, {
|
|
386
277
|
option: 'endsWith',
|
|
387
278
|
label: localization.filterEndsWith,
|
|
388
|
-
divider: true
|
|
389
|
-
fn: endsWith
|
|
279
|
+
divider: true
|
|
390
280
|
}, {
|
|
391
281
|
option: 'equals',
|
|
392
282
|
label: localization.filterEquals,
|
|
393
|
-
divider: false
|
|
394
|
-
fn: equals
|
|
283
|
+
divider: false
|
|
395
284
|
}, {
|
|
396
285
|
option: 'notEquals',
|
|
397
286
|
label: localization.filterNotEquals,
|
|
398
|
-
divider: true
|
|
399
|
-
fn: notEquals
|
|
287
|
+
divider: true
|
|
400
288
|
}, {
|
|
401
289
|
option: 'between',
|
|
402
290
|
label: localization.filterBetween,
|
|
403
|
-
divider: false
|
|
404
|
-
fn: between
|
|
291
|
+
divider: false
|
|
405
292
|
}, {
|
|
406
293
|
option: 'greaterThan',
|
|
407
294
|
label: localization.filterGreaterThan,
|
|
408
|
-
divider: false
|
|
409
|
-
fn: greaterThan
|
|
295
|
+
divider: false
|
|
410
296
|
}, {
|
|
411
297
|
option: 'lessThan',
|
|
412
298
|
label: localization.filterLessThan,
|
|
413
|
-
divider: true
|
|
414
|
-
fn: lessThan
|
|
299
|
+
divider: true
|
|
415
300
|
}, {
|
|
416
301
|
option: 'empty',
|
|
417
302
|
label: localization.filterEmpty,
|
|
418
|
-
divider: false
|
|
419
|
-
fn: empty
|
|
303
|
+
divider: false
|
|
420
304
|
}, {
|
|
421
305
|
option: 'notEmpty',
|
|
422
306
|
label: localization.filterNotEmpty,
|
|
423
|
-
divider: false
|
|
424
|
-
fn: notEmpty
|
|
307
|
+
divider: false
|
|
425
308
|
}].filter(function (filterType) {
|
|
426
309
|
return columnDef ? allowedColumnFilterOptions === undefined || (allowedColumnFilterOptions == null ? void 0 : allowedColumnFilterOptions.includes(filterType.option)) : (!enabledGlobalFilterOptions || enabledGlobalFilterOptions.includes(filterType.option)) && ['fuzzy', 'contains'].includes(filterType.option);
|
|
427
310
|
});
|
|
428
311
|
}, []);
|
|
429
312
|
|
|
430
|
-
var handleSelectFilterType = function handleSelectFilterType(
|
|
313
|
+
var handleSelectFilterType = function handleSelectFilterType(option) {
|
|
431
314
|
if (header && column) {
|
|
432
315
|
setCurrentFilterFns(function (prev) {
|
|
433
316
|
var _extends2;
|
|
434
317
|
|
|
435
|
-
return _extends({}, prev, (_extends2 = {}, _extends2[header.id] =
|
|
318
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = option, _extends2));
|
|
436
319
|
});
|
|
437
320
|
|
|
438
|
-
if (['empty', 'notEmpty'].includes(
|
|
321
|
+
if (['empty', 'notEmpty'].includes(option)) {
|
|
439
322
|
column.setFilterValue(' ');
|
|
440
|
-
} else if (
|
|
323
|
+
} else if (option === 'between') {
|
|
441
324
|
column.setFilterValue(['', '']);
|
|
442
325
|
} else {
|
|
443
326
|
column.setFilterValue('');
|
|
444
327
|
}
|
|
445
328
|
} else {
|
|
446
|
-
setCurrentGlobalFilterFn(
|
|
329
|
+
setCurrentGlobalFilterFn(option);
|
|
447
330
|
}
|
|
448
331
|
|
|
449
332
|
setAnchorEl(null);
|
|
@@ -467,15 +350,14 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
|
467
350
|
}, filterOptions.map(function (_ref4, index) {
|
|
468
351
|
var option = _ref4.option,
|
|
469
352
|
label = _ref4.label,
|
|
470
|
-
divider = _ref4.divider
|
|
471
|
-
fn = _ref4.fn;
|
|
353
|
+
divider = _ref4.divider;
|
|
472
354
|
return React.createElement(MenuItem, {
|
|
473
355
|
divider: divider,
|
|
474
356
|
key: index,
|
|
475
357
|
onClick: function onClick() {
|
|
476
358
|
return handleSelectFilterType(option);
|
|
477
359
|
},
|
|
478
|
-
selected: option === filterOption
|
|
360
|
+
selected: option === filterOption,
|
|
479
361
|
sx: commonMenuItemStyles,
|
|
480
362
|
value: option
|
|
481
363
|
}, label);
|
|
@@ -484,10 +366,10 @@ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
|
|
|
484
366
|
|
|
485
367
|
var MRT_ColumnPinningButtons = function MRT_ColumnPinningButtons(_ref) {
|
|
486
368
|
var column = _ref.column,
|
|
487
|
-
|
|
488
|
-
var
|
|
489
|
-
PushPinIcon =
|
|
490
|
-
localization =
|
|
369
|
+
table = _ref.table;
|
|
370
|
+
var _table$options = table.options,
|
|
371
|
+
PushPinIcon = _table$options.icons.PushPinIcon,
|
|
372
|
+
localization = _table$options.localization;
|
|
491
373
|
|
|
492
374
|
var handlePinColumn = function handlePinColumn(pinDirection) {
|
|
493
375
|
column.pin(pinDirection);
|
|
@@ -534,10 +416,10 @@ var MRT_ColumnPinningButtons = function MRT_ColumnPinningButtons(_ref) {
|
|
|
534
416
|
};
|
|
535
417
|
|
|
536
418
|
var MRT_GrabHandleButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
DragHandleIcon =
|
|
540
|
-
localization =
|
|
419
|
+
var table = _ref.table;
|
|
420
|
+
var _table$options = table.options,
|
|
421
|
+
DragHandleIcon = _table$options.icons.DragHandleIcon,
|
|
422
|
+
localization = _table$options.localization;
|
|
541
423
|
return React.createElement(Tooltip, {
|
|
542
424
|
arrow: true,
|
|
543
425
|
enterDelay: 1000,
|
|
@@ -565,6 +447,140 @@ var MRT_GrabHandleButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
565
447
|
}, React.createElement(DragHandleIcon, null)));
|
|
566
448
|
});
|
|
567
449
|
|
|
450
|
+
var fuzzy = function fuzzy(row, columnId, filterValue, addMeta) {
|
|
451
|
+
var itemRank = rankItem(row.getValue(columnId), filterValue, {
|
|
452
|
+
threshold: rankings.MATCHES
|
|
453
|
+
});
|
|
454
|
+
addMeta(itemRank);
|
|
455
|
+
return itemRank.passed;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
fuzzy.autoRemove = function (val) {
|
|
459
|
+
return !val;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
var contains = function contains(row, id, filterValue) {
|
|
463
|
+
return row.getValue(id).toString().toLowerCase().trim().includes(filterValue.toString().toLowerCase().trim());
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
contains.autoRemove = function (val) {
|
|
467
|
+
return !val;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
var startsWith = function startsWith(row, id, filterValue) {
|
|
471
|
+
return row.getValue(id).toString().toLowerCase().trim().startsWith(filterValue.toString().toLowerCase().trim());
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
startsWith.autoRemove = function (val) {
|
|
475
|
+
return !val;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
var endsWith = function endsWith(row, id, filterValue) {
|
|
479
|
+
return row.getValue(id).toString().toLowerCase().trim().endsWith(filterValue.toString().toLowerCase().trim());
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
endsWith.autoRemove = function (val) {
|
|
483
|
+
return !val;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
var equals = function equals(row, id, filterValue) {
|
|
487
|
+
return row.getValue(id).toString().toLowerCase().trim() === filterValue.toString().toLowerCase().trim();
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
equals.autoRemove = function (val) {
|
|
491
|
+
return !val;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
var notEquals = function notEquals(row, id, filterValue) {
|
|
495
|
+
return row.getValue(id).toString().toLowerCase().trim() !== filterValue.toString().toLowerCase().trim();
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
notEquals.autoRemove = function (val) {
|
|
499
|
+
return !val;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
var greaterThan = function greaterThan(row, id, filterValue) {
|
|
503
|
+
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) >= +filterValue : row.getValue(id).toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
greaterThan.autoRemove = function (val) {
|
|
507
|
+
return !val;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
var lessThan = function lessThan(row, id, filterValue) {
|
|
511
|
+
return !isNaN(+filterValue) && !isNaN(+row.getValue(id)) ? +row.getValue(id) <= +filterValue : row.getValue(id).toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
lessThan.autoRemove = function (val) {
|
|
515
|
+
return !val;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
var between = function between(row, id, filterValues) {
|
|
519
|
+
return (['', undefined].includes(filterValues[0]) || greaterThan(row, id, filterValues[0])) && (!isNaN(+filterValues[0]) && !isNaN(+filterValues[1]) && +filterValues[0] > +filterValues[1] || ['', undefined].includes(filterValues[1]) || lessThan(row, id, filterValues[1]));
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
between.autoRemove = function (val) {
|
|
523
|
+
return !val;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
var empty = function empty(row, id, _filterValue) {
|
|
527
|
+
return !row.getValue(id).toString().trim();
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
empty.autoRemove = function (val) {
|
|
531
|
+
return !val;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
var notEmpty = function notEmpty(row, id, _filterValue) {
|
|
535
|
+
return !!row.getValue(id).toString().trim();
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
notEmpty.autoRemove = function (val) {
|
|
539
|
+
return !val;
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
var MRT_FilterFns = /*#__PURE__*/_extends({}, filterFns, {
|
|
543
|
+
between: between,
|
|
544
|
+
contains: contains,
|
|
545
|
+
empty: empty,
|
|
546
|
+
endsWith: endsWith,
|
|
547
|
+
equals: equals,
|
|
548
|
+
fuzzy: fuzzy,
|
|
549
|
+
greaterThan: greaterThan,
|
|
550
|
+
lessThan: lessThan,
|
|
551
|
+
notEmpty: notEmpty,
|
|
552
|
+
notEquals: notEquals,
|
|
553
|
+
startsWith: startsWith
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
var fuzzy$1 = function fuzzy(rowA, rowB, columnId) {
|
|
557
|
+
var dir = 0;
|
|
558
|
+
|
|
559
|
+
if (rowA.columnFiltersMeta[columnId]) {
|
|
560
|
+
dir = compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
|
|
561
|
+
} // Provide a fallback for when the item ranks are equal
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
return dir === 0 ? sortingFns.alphanumeric(rowA, rowB, columnId) : dir;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
var MRT_SortingFns = /*#__PURE__*/_extends({}, sortingFns, {
|
|
568
|
+
fuzzy: fuzzy$1
|
|
569
|
+
});
|
|
570
|
+
var rankGlobalFuzzy = function rankGlobalFuzzy(rowA, rowB) {
|
|
571
|
+
return Math.max.apply(Math, Object.values(rowB.columnFiltersMeta).map(function (v) {
|
|
572
|
+
return v.rank;
|
|
573
|
+
})) - Math.max.apply(Math, Object.values(rowA.columnFiltersMeta).map(function (v) {
|
|
574
|
+
return v.rank;
|
|
575
|
+
}));
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
var getColumnId = function getColumnId(columnDef) {
|
|
579
|
+
var _ref, _columnDef$id, _columnDef$accessorKe;
|
|
580
|
+
|
|
581
|
+
return (_ref = (_columnDef$id = columnDef.id) != null ? _columnDef$id : (_columnDef$accessorKe = columnDef.accessorKey) == null ? void 0 : _columnDef$accessorKe.toString == null ? void 0 : _columnDef$accessorKe.toString()) != null ? _ref : columnDef.header;
|
|
582
|
+
};
|
|
583
|
+
|
|
568
584
|
var getAllLeafColumnDefs = function getAllLeafColumnDefs(columns) {
|
|
569
585
|
var lowestLevelColumns = columns;
|
|
570
586
|
var currentCols = columns;
|
|
@@ -593,25 +609,36 @@ var getAllLeafColumnDefs = function getAllLeafColumnDefs(columns) {
|
|
|
593
609
|
return !col.columns;
|
|
594
610
|
});
|
|
595
611
|
};
|
|
596
|
-
var
|
|
597
|
-
|
|
612
|
+
var prepareColumns = function prepareColumns(columnDefs, currentFilterFns) {
|
|
613
|
+
return columnDefs.map(function (columnDef) {
|
|
614
|
+
var _columnDef$columns;
|
|
598
615
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
616
|
+
if (!columnDef.id) columnDef.id = getColumnId(columnDef);
|
|
617
|
+
|
|
618
|
+
if (process.env.NODE_ENV !== 'production' && !columnDef.id) {
|
|
619
|
+
console.error('Column definitions must have a valid `accessorKey` or `id` property');
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (!columnDef.columnDefType) columnDef.columnDefType = 'data';
|
|
623
|
+
|
|
624
|
+
if (!!((_columnDef$columns = columnDef.columns) != null && _columnDef$columns.length)) {
|
|
625
|
+
columnDef.columnDefType = 'group';
|
|
626
|
+
columnDef.columns = prepareColumns(columnDef.columns, currentFilterFns);
|
|
627
|
+
} else if (columnDef.columnDefType === 'data') {
|
|
628
|
+
if (Object.keys(MRT_FilterFns).includes(currentFilterFns[columnDef.id])) {
|
|
629
|
+
var _MRT_FilterFns$curren;
|
|
630
|
+
|
|
631
|
+
columnDef.filterFn = (_MRT_FilterFns$curren = MRT_FilterFns[currentFilterFns[columnDef.id]]) != null ? _MRT_FilterFns$curren : MRT_FilterFns.fuzzy;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (Object.keys(MRT_SortingFns).includes(columnDef.sortingFn)) {
|
|
635
|
+
// @ts-ignore
|
|
636
|
+
columnDef.sortingFn = MRT_SortingFns[columnDef.sortingFn];
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return columnDef;
|
|
641
|
+
});
|
|
615
642
|
};
|
|
616
643
|
var reorderColumn = function reorderColumn(movingColumn, receivingColumn, columnOrder) {
|
|
617
644
|
if (movingColumn.getCanPin()) {
|
|
@@ -628,8 +655,8 @@ var getTrailingDisplayColumnIds = function getTrailingDisplayColumnIds(props) {
|
|
|
628
655
|
return [(props.positionActionsColumn === 'last' && props.enableRowActions || props.enableEditing && props.editingMode === 'row') && 'mrt-row-actions'];
|
|
629
656
|
};
|
|
630
657
|
var getDefaultColumnOrderIds = function getDefaultColumnOrderIds(props) {
|
|
631
|
-
return [].concat(getLeadingDisplayColumnIds(props), getAllLeafColumnDefs(props.columns).map(function (
|
|
632
|
-
return
|
|
658
|
+
return [].concat(getLeadingDisplayColumnIds(props), getAllLeafColumnDefs(props.columns).map(function (columnDef) {
|
|
659
|
+
return getColumnId(columnDef);
|
|
633
660
|
}), getTrailingDisplayColumnIds(props)).filter(Boolean);
|
|
634
661
|
};
|
|
635
662
|
|
|
@@ -639,20 +666,20 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
|
|
|
639
666
|
var allColumns = _ref.allColumns,
|
|
640
667
|
column = _ref.column,
|
|
641
668
|
isSubMenu = _ref.isSubMenu,
|
|
642
|
-
|
|
643
|
-
var getState =
|
|
644
|
-
|
|
645
|
-
enableColumnOrdering =
|
|
646
|
-
enableHiding =
|
|
647
|
-
enablePinning =
|
|
648
|
-
localization =
|
|
649
|
-
setColumnOrder =
|
|
669
|
+
table = _ref.table;
|
|
670
|
+
var getState = table.getState,
|
|
671
|
+
_table$options = table.options,
|
|
672
|
+
enableColumnOrdering = _table$options.enableColumnOrdering,
|
|
673
|
+
enableHiding = _table$options.enableHiding,
|
|
674
|
+
enablePinning = _table$options.enablePinning,
|
|
675
|
+
localization = _table$options.localization,
|
|
676
|
+
setColumnOrder = table.setColumnOrder;
|
|
650
677
|
|
|
651
678
|
var _getState = getState(),
|
|
652
679
|
columnOrder = _getState.columnOrder;
|
|
653
680
|
|
|
654
|
-
var columnDef = column.columnDef
|
|
655
|
-
|
|
681
|
+
var columnDef = column.columnDef;
|
|
682
|
+
var columnDefType = columnDef.columnDefType;
|
|
656
683
|
|
|
657
684
|
var _useDrop = useDrop({
|
|
658
685
|
accept: 'column',
|
|
@@ -710,17 +737,17 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
|
|
|
710
737
|
gap: '8px'
|
|
711
738
|
}
|
|
712
739
|
}, columnDefType !== 'group' && enableColumnOrdering && !allColumns.some(function (col) {
|
|
713
|
-
return col.columnDefType === 'group';
|
|
740
|
+
return col.columnDef.columnDefType === 'group';
|
|
714
741
|
}) && (columnDef.enableColumnOrdering !== false ? React.createElement(MRT_GrabHandleButton, {
|
|
715
742
|
ref: dragRef,
|
|
716
|
-
|
|
743
|
+
table: table
|
|
717
744
|
}) : React.createElement(Box, {
|
|
718
745
|
sx: {
|
|
719
746
|
width: '28px'
|
|
720
747
|
}
|
|
721
748
|
})), enablePinning && !isSubMenu && (column.getCanPin() ? React.createElement(MRT_ColumnPinningButtons, {
|
|
722
749
|
column: column,
|
|
723
|
-
|
|
750
|
+
table: table
|
|
724
751
|
}) : React.createElement(Box, {
|
|
725
752
|
sx: {
|
|
726
753
|
width: '70px'
|
|
@@ -756,7 +783,7 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
|
|
|
756
783
|
key: i + "-" + c.id,
|
|
757
784
|
column: c,
|
|
758
785
|
isSubMenu: isSubMenu,
|
|
759
|
-
|
|
786
|
+
table: table
|
|
760
787
|
});
|
|
761
788
|
}));
|
|
762
789
|
};
|
|
@@ -765,21 +792,21 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
|
765
792
|
var anchorEl = _ref.anchorEl,
|
|
766
793
|
isSubMenu = _ref.isSubMenu,
|
|
767
794
|
setAnchorEl = _ref.setAnchorEl,
|
|
768
|
-
|
|
769
|
-
var getAllColumns =
|
|
770
|
-
getAllLeafColumns =
|
|
771
|
-
getCenterLeafColumns =
|
|
772
|
-
getIsAllColumnsVisible =
|
|
773
|
-
getIsSomeColumnsPinned =
|
|
774
|
-
getIsSomeColumnsVisible =
|
|
775
|
-
getLeftLeafColumns =
|
|
776
|
-
getRightLeafColumns =
|
|
777
|
-
getState =
|
|
778
|
-
toggleAllColumnsVisible =
|
|
779
|
-
|
|
780
|
-
localization =
|
|
781
|
-
enablePinning =
|
|
782
|
-
enableColumnOrdering =
|
|
795
|
+
table = _ref.table;
|
|
796
|
+
var getAllColumns = table.getAllColumns,
|
|
797
|
+
getAllLeafColumns = table.getAllLeafColumns,
|
|
798
|
+
getCenterLeafColumns = table.getCenterLeafColumns,
|
|
799
|
+
getIsAllColumnsVisible = table.getIsAllColumnsVisible,
|
|
800
|
+
getIsSomeColumnsPinned = table.getIsSomeColumnsPinned,
|
|
801
|
+
getIsSomeColumnsVisible = table.getIsSomeColumnsVisible,
|
|
802
|
+
getLeftLeafColumns = table.getLeftLeafColumns,
|
|
803
|
+
getRightLeafColumns = table.getRightLeafColumns,
|
|
804
|
+
getState = table.getState,
|
|
805
|
+
toggleAllColumnsVisible = table.toggleAllColumnsVisible,
|
|
806
|
+
_table$options = table.options,
|
|
807
|
+
localization = _table$options.localization,
|
|
808
|
+
enablePinning = _table$options.enablePinning,
|
|
809
|
+
enableColumnOrdering = _table$options.enableColumnOrdering;
|
|
783
810
|
|
|
784
811
|
var _getState = getState(),
|
|
785
812
|
density = _getState.density,
|
|
@@ -798,7 +825,7 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
|
798
825
|
var columns = getAllColumns();
|
|
799
826
|
|
|
800
827
|
if (columnOrder.length > 0 && !columns.some(function (col) {
|
|
801
|
-
return col.columnDefType === 'group';
|
|
828
|
+
return col.columnDef.columnDefType === 'group';
|
|
802
829
|
})) {
|
|
803
830
|
return [].concat(getLeftLeafColumns(), Array.from(new Set(columnOrder)).map(function (colId) {
|
|
804
831
|
return getCenterLeafColumns().find(function (col) {
|
|
@@ -830,12 +857,12 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
|
830
857
|
onClick: hideAllColumns
|
|
831
858
|
}, localization.hideAll), !isSubMenu && enableColumnOrdering && React.createElement(Button, {
|
|
832
859
|
onClick: function onClick() {
|
|
833
|
-
return
|
|
860
|
+
return table.setColumnOrder(getDefaultColumnOrderIds(table.options));
|
|
834
861
|
}
|
|
835
862
|
}, localization.resetOrder), !isSubMenu && enablePinning && React.createElement(Button, {
|
|
836
863
|
disabled: !getIsSomeColumnsPinned(),
|
|
837
864
|
onClick: function onClick() {
|
|
838
|
-
return
|
|
865
|
+
return table.resetColumnPinning(true);
|
|
839
866
|
}
|
|
840
867
|
}, localization.unpinAll), React.createElement(Button, {
|
|
841
868
|
disabled: getIsAllColumnsVisible(),
|
|
@@ -848,7 +875,7 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
|
848
875
|
column: column,
|
|
849
876
|
isSubMenu: isSubMenu,
|
|
850
877
|
key: index + "-" + column.id,
|
|
851
|
-
|
|
878
|
+
table: table
|
|
852
879
|
});
|
|
853
880
|
}));
|
|
854
881
|
};
|
|
@@ -869,33 +896,33 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
869
896
|
var anchorEl = _ref.anchorEl,
|
|
870
897
|
header = _ref.header,
|
|
871
898
|
setAnchorEl = _ref.setAnchorEl,
|
|
872
|
-
|
|
873
|
-
var getState =
|
|
874
|
-
toggleAllColumnsVisible =
|
|
875
|
-
setColumnOrder =
|
|
876
|
-
|
|
877
|
-
enableColumnFilterChangeMode =
|
|
878
|
-
enableColumnFilters =
|
|
879
|
-
enableColumnResizing =
|
|
880
|
-
enableGrouping =
|
|
881
|
-
enableHiding =
|
|
882
|
-
enablePinning =
|
|
883
|
-
enableSorting =
|
|
884
|
-
enabledColumnFilterOptions =
|
|
885
|
-
|
|
886
|
-
ArrowRightIcon =
|
|
887
|
-
ClearAllIcon =
|
|
888
|
-
ViewColumnIcon =
|
|
889
|
-
DynamicFeedIcon =
|
|
890
|
-
FilterListIcon =
|
|
891
|
-
FilterListOffIcon =
|
|
892
|
-
PushPinIcon =
|
|
893
|
-
SortIcon =
|
|
894
|
-
RestartAltIcon =
|
|
895
|
-
VisibilityOffIcon =
|
|
896
|
-
tableId =
|
|
897
|
-
localization =
|
|
898
|
-
setShowFilters =
|
|
899
|
+
table = _ref.table;
|
|
900
|
+
var getState = table.getState,
|
|
901
|
+
toggleAllColumnsVisible = table.toggleAllColumnsVisible,
|
|
902
|
+
setColumnOrder = table.setColumnOrder,
|
|
903
|
+
_table$options = table.options,
|
|
904
|
+
enableColumnFilterChangeMode = _table$options.enableColumnFilterChangeMode,
|
|
905
|
+
enableColumnFilters = _table$options.enableColumnFilters,
|
|
906
|
+
enableColumnResizing = _table$options.enableColumnResizing,
|
|
907
|
+
enableGrouping = _table$options.enableGrouping,
|
|
908
|
+
enableHiding = _table$options.enableHiding,
|
|
909
|
+
enablePinning = _table$options.enablePinning,
|
|
910
|
+
enableSorting = _table$options.enableSorting,
|
|
911
|
+
enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
|
|
912
|
+
_table$options$icons = _table$options.icons,
|
|
913
|
+
ArrowRightIcon = _table$options$icons.ArrowRightIcon,
|
|
914
|
+
ClearAllIcon = _table$options$icons.ClearAllIcon,
|
|
915
|
+
ViewColumnIcon = _table$options$icons.ViewColumnIcon,
|
|
916
|
+
DynamicFeedIcon = _table$options$icons.DynamicFeedIcon,
|
|
917
|
+
FilterListIcon = _table$options$icons.FilterListIcon,
|
|
918
|
+
FilterListOffIcon = _table$options$icons.FilterListOffIcon,
|
|
919
|
+
PushPinIcon = _table$options$icons.PushPinIcon,
|
|
920
|
+
SortIcon = _table$options$icons.SortIcon,
|
|
921
|
+
RestartAltIcon = _table$options$icons.RestartAltIcon,
|
|
922
|
+
VisibilityOffIcon = _table$options$icons.VisibilityOffIcon,
|
|
923
|
+
tableId = _table$options.tableId,
|
|
924
|
+
localization = _table$options.localization,
|
|
925
|
+
setShowFilters = table.setShowFilters;
|
|
899
926
|
var column = header.column;
|
|
900
927
|
var columnDef = column.columnDef;
|
|
901
928
|
|
|
@@ -1046,7 +1073,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1046
1073
|
key: 2,
|
|
1047
1074
|
onSelect: handleFilterByColumn,
|
|
1048
1075
|
setAnchorEl: setFilterMenuAnchorEl,
|
|
1049
|
-
|
|
1076
|
+
table: table
|
|
1050
1077
|
})].filter(Boolean), enableGrouping && column.getCanGroup() && [React.createElement(MenuItem, {
|
|
1051
1078
|
divider: enablePinning,
|
|
1052
1079
|
key: 0,
|
|
@@ -1125,7 +1152,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
1125
1152
|
isSubMenu: true,
|
|
1126
1153
|
key: 2,
|
|
1127
1154
|
setAnchorEl: setShowHideColumnsMenuAnchorEl,
|
|
1128
|
-
|
|
1155
|
+
table: table
|
|
1129
1156
|
})]);
|
|
1130
1157
|
};
|
|
1131
1158
|
|
|
@@ -1134,13 +1161,13 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
|
1134
1161
|
handleEdit = _ref.handleEdit,
|
|
1135
1162
|
row = _ref.row,
|
|
1136
1163
|
setAnchorEl = _ref.setAnchorEl,
|
|
1137
|
-
|
|
1138
|
-
var getState =
|
|
1139
|
-
|
|
1140
|
-
EditIcon =
|
|
1141
|
-
enableEditing =
|
|
1142
|
-
localization =
|
|
1143
|
-
renderRowActionMenuItems =
|
|
1164
|
+
table = _ref.table;
|
|
1165
|
+
var getState = table.getState,
|
|
1166
|
+
_table$options = table.options,
|
|
1167
|
+
EditIcon = _table$options.icons.EditIcon,
|
|
1168
|
+
enableEditing = _table$options.enableEditing,
|
|
1169
|
+
localization = _table$options.localization,
|
|
1170
|
+
renderRowActionMenuItems = _table$options.renderRowActionMenuItems;
|
|
1144
1171
|
|
|
1145
1172
|
var _getState = getState(),
|
|
1146
1173
|
density = _getState.density;
|
|
@@ -1161,7 +1188,7 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
|
1161
1188
|
sx: commonListItemStyles
|
|
1162
1189
|
}, React.createElement(ListItemIcon, null, React.createElement(EditIcon, null)), localization.edit)), renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems({
|
|
1163
1190
|
row: row,
|
|
1164
|
-
|
|
1191
|
+
table: table,
|
|
1165
1192
|
closeMenu: function closeMenu() {
|
|
1166
1193
|
return setAnchorEl(null);
|
|
1167
1194
|
}
|
|
@@ -1170,15 +1197,15 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
|
1170
1197
|
|
|
1171
1198
|
var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
1172
1199
|
var row = _ref.row,
|
|
1173
|
-
|
|
1174
|
-
var getState =
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
CancelIcon =
|
|
1178
|
-
SaveIcon =
|
|
1179
|
-
localization =
|
|
1180
|
-
onEditRowSubmit =
|
|
1181
|
-
setCurrentEditingRow =
|
|
1200
|
+
table = _ref.table;
|
|
1201
|
+
var getState = table.getState,
|
|
1202
|
+
_table$options = table.options,
|
|
1203
|
+
_table$options$icons = _table$options.icons,
|
|
1204
|
+
CancelIcon = _table$options$icons.CancelIcon,
|
|
1205
|
+
SaveIcon = _table$options$icons.SaveIcon,
|
|
1206
|
+
localization = _table$options.localization,
|
|
1207
|
+
onEditRowSubmit = _table$options.onEditRowSubmit,
|
|
1208
|
+
setCurrentEditingRow = table.setCurrentEditingRow;
|
|
1182
1209
|
|
|
1183
1210
|
var _getState = getState(),
|
|
1184
1211
|
currentEditingRow = _getState.currentEditingRow;
|
|
@@ -1193,7 +1220,7 @@ var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
|
1193
1220
|
var handleSave = function handleSave() {
|
|
1194
1221
|
onEditRowSubmit == null ? void 0 : onEditRowSubmit({
|
|
1195
1222
|
row: currentEditingRow != null ? currentEditingRow : row,
|
|
1196
|
-
|
|
1223
|
+
table: table
|
|
1197
1224
|
});
|
|
1198
1225
|
setCurrentEditingRow(null);
|
|
1199
1226
|
};
|
|
@@ -1231,17 +1258,17 @@ var commonIconButtonStyles = {
|
|
|
1231
1258
|
};
|
|
1232
1259
|
var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref) {
|
|
1233
1260
|
var row = _ref.row,
|
|
1234
|
-
|
|
1235
|
-
var getState =
|
|
1236
|
-
|
|
1237
|
-
enableEditing =
|
|
1238
|
-
|
|
1239
|
-
EditIcon =
|
|
1240
|
-
MoreHorizIcon =
|
|
1241
|
-
localization =
|
|
1242
|
-
renderRowActionMenuItems =
|
|
1243
|
-
renderRowActions =
|
|
1244
|
-
setCurrentEditingRow =
|
|
1261
|
+
table = _ref.table;
|
|
1262
|
+
var getState = table.getState,
|
|
1263
|
+
_table$options = table.options,
|
|
1264
|
+
enableEditing = _table$options.enableEditing,
|
|
1265
|
+
_table$options$icons = _table$options.icons,
|
|
1266
|
+
EditIcon = _table$options$icons.EditIcon,
|
|
1267
|
+
MoreHorizIcon = _table$options$icons.MoreHorizIcon,
|
|
1268
|
+
localization = _table$options.localization,
|
|
1269
|
+
renderRowActionMenuItems = _table$options.renderRowActionMenuItems,
|
|
1270
|
+
renderRowActions = _table$options.renderRowActions,
|
|
1271
|
+
setCurrentEditingRow = table.setCurrentEditingRow;
|
|
1245
1272
|
|
|
1246
1273
|
var _getState = getState(),
|
|
1247
1274
|
currentEditingRow = _getState.currentEditingRow;
|
|
@@ -1263,10 +1290,10 @@ var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref)
|
|
|
1263
1290
|
|
|
1264
1291
|
return React.createElement(React.Fragment, null, renderRowActions ? React.createElement(React.Fragment, null, renderRowActions({
|
|
1265
1292
|
row: row,
|
|
1266
|
-
|
|
1293
|
+
table: table
|
|
1267
1294
|
})) : row.id === (currentEditingRow == null ? void 0 : currentEditingRow.id) ? React.createElement(MRT_EditActionButtons, {
|
|
1268
1295
|
row: row,
|
|
1269
|
-
|
|
1296
|
+
table: table
|
|
1270
1297
|
}) : !renderRowActionMenuItems && enableEditing ? React.createElement(Tooltip, {
|
|
1271
1298
|
placement: "right",
|
|
1272
1299
|
arrow: true,
|
|
@@ -1289,20 +1316,20 @@ var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref)
|
|
|
1289
1316
|
handleEdit: handleStartEditMode,
|
|
1290
1317
|
row: row,
|
|
1291
1318
|
setAnchorEl: setAnchorEl,
|
|
1292
|
-
|
|
1319
|
+
table: table
|
|
1293
1320
|
})) : null);
|
|
1294
1321
|
};
|
|
1295
1322
|
|
|
1296
1323
|
var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
1297
1324
|
var row = _ref.row,
|
|
1298
1325
|
selectAll = _ref.selectAll,
|
|
1299
|
-
|
|
1300
|
-
var getState =
|
|
1301
|
-
|
|
1302
|
-
localization =
|
|
1303
|
-
muiSelectCheckboxProps =
|
|
1304
|
-
muiSelectAllCheckboxProps =
|
|
1305
|
-
selectAllMode =
|
|
1326
|
+
table = _ref.table;
|
|
1327
|
+
var getState = table.getState,
|
|
1328
|
+
_table$options = table.options,
|
|
1329
|
+
localization = _table$options.localization,
|
|
1330
|
+
muiSelectCheckboxProps = _table$options.muiSelectCheckboxProps,
|
|
1331
|
+
muiSelectAllCheckboxProps = _table$options.muiSelectAllCheckboxProps,
|
|
1332
|
+
selectAllMode = _table$options.selectAllMode;
|
|
1306
1333
|
|
|
1307
1334
|
var _getState = getState(),
|
|
1308
1335
|
density = _getState.density;
|
|
@@ -1310,9 +1337,9 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1310
1337
|
var handleSelectChange = function handleSelectChange(event) {
|
|
1311
1338
|
if (selectAll) {
|
|
1312
1339
|
if (selectAllMode === 'all') {
|
|
1313
|
-
|
|
1340
|
+
table.getToggleAllRowsSelectedHandler()(event);
|
|
1314
1341
|
} else if (selectAllMode === 'page') {
|
|
1315
|
-
|
|
1342
|
+
table.getToggleAllPageRowsSelectedHandler()(event);
|
|
1316
1343
|
}
|
|
1317
1344
|
} else if (row) {
|
|
1318
1345
|
row == null ? void 0 : row.getToggleSelectedHandler()(event);
|
|
@@ -1320,10 +1347,10 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1320
1347
|
};
|
|
1321
1348
|
|
|
1322
1349
|
var checkboxProps = selectAll ? muiSelectAllCheckboxProps instanceof Function ? muiSelectAllCheckboxProps({
|
|
1323
|
-
|
|
1350
|
+
table: table
|
|
1324
1351
|
}) : muiSelectAllCheckboxProps : muiSelectCheckboxProps instanceof Function ? muiSelectCheckboxProps({
|
|
1325
1352
|
row: row,
|
|
1326
|
-
|
|
1353
|
+
table: table
|
|
1327
1354
|
}) : muiSelectCheckboxProps;
|
|
1328
1355
|
return React.createElement(Tooltip, {
|
|
1329
1356
|
arrow: true,
|
|
@@ -1331,8 +1358,8 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1331
1358
|
enterNextDelay: 1000,
|
|
1332
1359
|
title: selectAll ? localization.toggleSelectAll : localization.toggleSelectRow
|
|
1333
1360
|
}, React.createElement(Checkbox, Object.assign({
|
|
1334
|
-
checked: selectAll ?
|
|
1335
|
-
indeterminate: selectAll ?
|
|
1361
|
+
checked: selectAll ? table.getIsAllRowsSelected() : row == null ? void 0 : row.getIsSelected(),
|
|
1362
|
+
indeterminate: selectAll ? table.getIsSomeRowsSelected() : row == null ? void 0 : row.getIsSomeSelected(),
|
|
1336
1363
|
inputProps: {
|
|
1337
1364
|
'aria-label': selectAll ? localization.toggleSelectAll : localization.toggleSelectRow
|
|
1338
1365
|
},
|
|
@@ -1346,18 +1373,18 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1346
1373
|
})));
|
|
1347
1374
|
};
|
|
1348
1375
|
|
|
1349
|
-
var _excluded = ["
|
|
1376
|
+
var _excluded = ["table"];
|
|
1350
1377
|
var MRT_FullScreenToggleButton = function MRT_FullScreenToggleButton(_ref) {
|
|
1351
|
-
var
|
|
1378
|
+
var table = _ref.table,
|
|
1352
1379
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1353
1380
|
|
|
1354
|
-
var getState =
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
FullscreenExitIcon =
|
|
1358
|
-
FullscreenIcon =
|
|
1359
|
-
localization =
|
|
1360
|
-
setIsFullScreen =
|
|
1381
|
+
var getState = table.getState,
|
|
1382
|
+
_table$options = table.options,
|
|
1383
|
+
_table$options$icons = _table$options.icons,
|
|
1384
|
+
FullscreenExitIcon = _table$options$icons.FullscreenExitIcon,
|
|
1385
|
+
FullscreenIcon = _table$options$icons.FullscreenIcon,
|
|
1386
|
+
localization = _table$options.localization,
|
|
1387
|
+
setIsFullScreen = table.setIsFullScreen;
|
|
1361
1388
|
|
|
1362
1389
|
var _getState = getState(),
|
|
1363
1390
|
isFullScreen = _getState.isFullScreen;
|
|
@@ -1375,14 +1402,14 @@ var MRT_FullScreenToggleButton = function MRT_FullScreenToggleButton(_ref) {
|
|
|
1375
1402
|
}, rest), isFullScreen ? React.createElement(FullscreenExitIcon, null) : React.createElement(FullscreenIcon, null)));
|
|
1376
1403
|
};
|
|
1377
1404
|
|
|
1378
|
-
var _excluded$1 = ["
|
|
1405
|
+
var _excluded$1 = ["table"];
|
|
1379
1406
|
var MRT_ShowHideColumnsButton = function MRT_ShowHideColumnsButton(_ref) {
|
|
1380
|
-
var
|
|
1407
|
+
var table = _ref.table,
|
|
1381
1408
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1382
1409
|
|
|
1383
|
-
var
|
|
1384
|
-
ViewColumnIcon =
|
|
1385
|
-
localization =
|
|
1410
|
+
var _table$options = table.options,
|
|
1411
|
+
ViewColumnIcon = _table$options.icons.ViewColumnIcon,
|
|
1412
|
+
localization = _table$options.localization;
|
|
1386
1413
|
|
|
1387
1414
|
var _useState = useState(null),
|
|
1388
1415
|
anchorEl = _useState[0],
|
|
@@ -1401,23 +1428,23 @@ var MRT_ShowHideColumnsButton = function MRT_ShowHideColumnsButton(_ref) {
|
|
|
1401
1428
|
}, rest), React.createElement(ViewColumnIcon, null))), React.createElement(MRT_ShowHideColumnsMenu, {
|
|
1402
1429
|
anchorEl: anchorEl,
|
|
1403
1430
|
setAnchorEl: setAnchorEl,
|
|
1404
|
-
|
|
1431
|
+
table: table
|
|
1405
1432
|
}));
|
|
1406
1433
|
};
|
|
1407
1434
|
|
|
1408
|
-
var _excluded$2 = ["
|
|
1435
|
+
var _excluded$2 = ["table"];
|
|
1409
1436
|
var MRT_ToggleDensePaddingButton = function MRT_ToggleDensePaddingButton(_ref) {
|
|
1410
|
-
var
|
|
1437
|
+
var table = _ref.table,
|
|
1411
1438
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1412
1439
|
|
|
1413
|
-
var getState =
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
DensityLargeIcon =
|
|
1417
|
-
DensityMediumIcon =
|
|
1418
|
-
DensitySmallIcon =
|
|
1419
|
-
localization =
|
|
1420
|
-
setDensity =
|
|
1440
|
+
var getState = table.getState,
|
|
1441
|
+
_table$options = table.options,
|
|
1442
|
+
_table$options$icons = _table$options.icons,
|
|
1443
|
+
DensityLargeIcon = _table$options$icons.DensityLargeIcon,
|
|
1444
|
+
DensityMediumIcon = _table$options$icons.DensityMediumIcon,
|
|
1445
|
+
DensitySmallIcon = _table$options$icons.DensitySmallIcon,
|
|
1446
|
+
localization = _table$options.localization,
|
|
1447
|
+
setDensity = table.setDensity;
|
|
1421
1448
|
|
|
1422
1449
|
var _getState = getState(),
|
|
1423
1450
|
density = _getState.density;
|
|
@@ -1436,18 +1463,18 @@ var MRT_ToggleDensePaddingButton = function MRT_ToggleDensePaddingButton(_ref) {
|
|
|
1436
1463
|
}, rest), density === 'compact' ? React.createElement(DensitySmallIcon, null) : density === 'comfortable' ? React.createElement(DensityMediumIcon, null) : React.createElement(DensityLargeIcon, null)));
|
|
1437
1464
|
};
|
|
1438
1465
|
|
|
1439
|
-
var _excluded$3 = ["
|
|
1466
|
+
var _excluded$3 = ["table"];
|
|
1440
1467
|
var MRT_ToggleFiltersButton = function MRT_ToggleFiltersButton(_ref) {
|
|
1441
|
-
var
|
|
1468
|
+
var table = _ref.table,
|
|
1442
1469
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1443
1470
|
|
|
1444
|
-
var getState =
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
FilterListIcon =
|
|
1448
|
-
FilterListOffIcon =
|
|
1449
|
-
localization =
|
|
1450
|
-
setShowFilters =
|
|
1471
|
+
var getState = table.getState,
|
|
1472
|
+
_table$options = table.options,
|
|
1473
|
+
_table$options$icons = _table$options.icons,
|
|
1474
|
+
FilterListIcon = _table$options$icons.FilterListIcon,
|
|
1475
|
+
FilterListOffIcon = _table$options$icons.FilterListOffIcon,
|
|
1476
|
+
localization = _table$options.localization,
|
|
1477
|
+
setShowFilters = table.setShowFilters;
|
|
1451
1478
|
|
|
1452
1479
|
var _getState = getState(),
|
|
1453
1480
|
showFilters = _getState.showFilters;
|
|
@@ -1465,26 +1492,26 @@ var MRT_ToggleFiltersButton = function MRT_ToggleFiltersButton(_ref) {
|
|
|
1465
1492
|
}, rest), showFilters ? React.createElement(FilterListOffIcon, null) : React.createElement(FilterListIcon, null)));
|
|
1466
1493
|
};
|
|
1467
1494
|
|
|
1468
|
-
var _excluded$4 = ["
|
|
1495
|
+
var _excluded$4 = ["table"];
|
|
1469
1496
|
var MRT_ToggleGlobalFilterButton = function MRT_ToggleGlobalFilterButton(_ref) {
|
|
1470
|
-
var
|
|
1497
|
+
var table = _ref.table,
|
|
1471
1498
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
1472
1499
|
|
|
1473
|
-
var getState =
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
SearchIcon =
|
|
1477
|
-
SearchOffIcon =
|
|
1478
|
-
tableId =
|
|
1479
|
-
localization =
|
|
1480
|
-
muiSearchTextFieldProps =
|
|
1481
|
-
setShowGlobalFilter =
|
|
1500
|
+
var getState = table.getState,
|
|
1501
|
+
_table$options = table.options,
|
|
1502
|
+
_table$options$icons = _table$options.icons,
|
|
1503
|
+
SearchIcon = _table$options$icons.SearchIcon,
|
|
1504
|
+
SearchOffIcon = _table$options$icons.SearchOffIcon,
|
|
1505
|
+
tableId = _table$options.tableId,
|
|
1506
|
+
localization = _table$options.localization,
|
|
1507
|
+
muiSearchTextFieldProps = _table$options.muiSearchTextFieldProps,
|
|
1508
|
+
setShowGlobalFilter = table.setShowGlobalFilter;
|
|
1482
1509
|
|
|
1483
1510
|
var _getState = getState(),
|
|
1484
1511
|
showGlobalFilter = _getState.showGlobalFilter;
|
|
1485
1512
|
|
|
1486
1513
|
var textFieldProps = muiSearchTextFieldProps instanceof Function ? muiSearchTextFieldProps({
|
|
1487
|
-
|
|
1514
|
+
table: table
|
|
1488
1515
|
}) : muiSearchTextFieldProps;
|
|
1489
1516
|
|
|
1490
1517
|
var handleToggleSearch = function handleToggleSearch() {
|
|
@@ -1507,17 +1534,17 @@ var MRT_ToggleGlobalFilterButton = function MRT_ToggleGlobalFilterButton(_ref) {
|
|
|
1507
1534
|
var MRT_GlobalFilterTextField = function MRT_GlobalFilterTextField(_ref) {
|
|
1508
1535
|
var _localization$clearSe;
|
|
1509
1536
|
|
|
1510
|
-
var
|
|
1511
|
-
var getState =
|
|
1512
|
-
setGlobalFilter =
|
|
1513
|
-
|
|
1514
|
-
enableGlobalFilterChangeMode =
|
|
1515
|
-
|
|
1516
|
-
SearchIcon =
|
|
1517
|
-
CloseIcon =
|
|
1518
|
-
localization =
|
|
1519
|
-
muiSearchTextFieldProps =
|
|
1520
|
-
tableId =
|
|
1537
|
+
var table = _ref.table;
|
|
1538
|
+
var getState = table.getState,
|
|
1539
|
+
setGlobalFilter = table.setGlobalFilter,
|
|
1540
|
+
_table$options = table.options,
|
|
1541
|
+
enableGlobalFilterChangeMode = _table$options.enableGlobalFilterChangeMode,
|
|
1542
|
+
_table$options$icons = _table$options.icons,
|
|
1543
|
+
SearchIcon = _table$options$icons.SearchIcon,
|
|
1544
|
+
CloseIcon = _table$options$icons.CloseIcon,
|
|
1545
|
+
localization = _table$options.localization,
|
|
1546
|
+
muiSearchTextFieldProps = _table$options.muiSearchTextFieldProps,
|
|
1547
|
+
tableId = _table$options.tableId;
|
|
1521
1548
|
|
|
1522
1549
|
var _getState = getState(),
|
|
1523
1550
|
globalFilter = _getState.globalFilter,
|
|
@@ -1552,7 +1579,7 @@ var MRT_GlobalFilterTextField = function MRT_GlobalFilterTextField(_ref) {
|
|
|
1552
1579
|
};
|
|
1553
1580
|
|
|
1554
1581
|
var textFieldProps = muiSearchTextFieldProps instanceof Function ? muiSearchTextFieldProps({
|
|
1555
|
-
|
|
1582
|
+
table: table
|
|
1556
1583
|
}) : muiSearchTextFieldProps;
|
|
1557
1584
|
return React.createElement(Collapse, {
|
|
1558
1585
|
"in": showGlobalFilter,
|
|
@@ -1593,25 +1620,25 @@ var MRT_GlobalFilterTextField = function MRT_GlobalFilterTextField(_ref) {
|
|
|
1593
1620
|
}, textFieldProps)), React.createElement(MRT_FilterOptionMenu, {
|
|
1594
1621
|
anchorEl: anchorEl,
|
|
1595
1622
|
setAnchorEl: setAnchorEl,
|
|
1596
|
-
|
|
1623
|
+
table: table
|
|
1597
1624
|
}));
|
|
1598
1625
|
};
|
|
1599
1626
|
|
|
1600
1627
|
var MRT_ToolbarInternalButtons = function MRT_ToolbarInternalButtons(_ref) {
|
|
1601
1628
|
var _renderToolbarInterna;
|
|
1602
1629
|
|
|
1603
|
-
var
|
|
1604
|
-
var
|
|
1605
|
-
enableColumnFilters =
|
|
1606
|
-
enableColumnOrdering =
|
|
1607
|
-
enableDensityToggle =
|
|
1608
|
-
enableFilters =
|
|
1609
|
-
enableFullScreenToggle =
|
|
1610
|
-
enableGlobalFilter =
|
|
1611
|
-
enableHiding =
|
|
1612
|
-
enablePinning =
|
|
1613
|
-
positionGlobalFilter =
|
|
1614
|
-
renderToolbarInternalActions =
|
|
1630
|
+
var table = _ref.table;
|
|
1631
|
+
var _table$options = table.options,
|
|
1632
|
+
enableColumnFilters = _table$options.enableColumnFilters,
|
|
1633
|
+
enableColumnOrdering = _table$options.enableColumnOrdering,
|
|
1634
|
+
enableDensityToggle = _table$options.enableDensityToggle,
|
|
1635
|
+
enableFilters = _table$options.enableFilters,
|
|
1636
|
+
enableFullScreenToggle = _table$options.enableFullScreenToggle,
|
|
1637
|
+
enableGlobalFilter = _table$options.enableGlobalFilter,
|
|
1638
|
+
enableHiding = _table$options.enableHiding,
|
|
1639
|
+
enablePinning = _table$options.enablePinning,
|
|
1640
|
+
positionGlobalFilter = _table$options.positionGlobalFilter,
|
|
1641
|
+
renderToolbarInternalActions = _table$options.renderToolbarInternalActions;
|
|
1615
1642
|
return React.createElement(Box, {
|
|
1616
1643
|
sx: {
|
|
1617
1644
|
alignItems: 'center',
|
|
@@ -1624,33 +1651,33 @@ var MRT_ToolbarInternalButtons = function MRT_ToolbarInternalButtons(_ref) {
|
|
|
1624
1651
|
MRT_ToggleDensePaddingButton: MRT_ToggleDensePaddingButton,
|
|
1625
1652
|
MRT_ToggleFiltersButton: MRT_ToggleFiltersButton,
|
|
1626
1653
|
MRT_ToggleGlobalFilterButton: MRT_ToggleGlobalFilterButton,
|
|
1627
|
-
|
|
1654
|
+
table: table
|
|
1628
1655
|
})) != null ? _renderToolbarInterna : React.createElement(React.Fragment, null, enableGlobalFilter && positionGlobalFilter === 'right' && React.createElement(MRT_GlobalFilterTextField, {
|
|
1629
|
-
|
|
1656
|
+
table: table
|
|
1630
1657
|
}), enableFilters && enableGlobalFilter && React.createElement(MRT_ToggleGlobalFilterButton, {
|
|
1631
|
-
|
|
1658
|
+
table: table
|
|
1632
1659
|
}), enableFilters && enableColumnFilters && React.createElement(MRT_ToggleFiltersButton, {
|
|
1633
|
-
|
|
1660
|
+
table: table
|
|
1634
1661
|
}), (enableHiding || enableColumnOrdering || enablePinning) && React.createElement(MRT_ShowHideColumnsButton, {
|
|
1635
|
-
|
|
1662
|
+
table: table
|
|
1636
1663
|
}), enableDensityToggle && React.createElement(MRT_ToggleDensePaddingButton, {
|
|
1637
|
-
|
|
1664
|
+
table: table
|
|
1638
1665
|
}), enableFullScreenToggle && React.createElement(MRT_FullScreenToggleButton, {
|
|
1639
|
-
|
|
1666
|
+
table: table
|
|
1640
1667
|
})));
|
|
1641
1668
|
};
|
|
1642
1669
|
|
|
1643
1670
|
var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
1644
|
-
var
|
|
1671
|
+
var table = _ref.table,
|
|
1645
1672
|
position = _ref.position;
|
|
1646
|
-
var getPrePaginationRowModel =
|
|
1647
|
-
getState =
|
|
1648
|
-
setPageIndex =
|
|
1649
|
-
setPageSize =
|
|
1650
|
-
|
|
1651
|
-
muiTablePaginationProps =
|
|
1652
|
-
enableToolbarInternalActions =
|
|
1653
|
-
rowCount =
|
|
1673
|
+
var getPrePaginationRowModel = table.getPrePaginationRowModel,
|
|
1674
|
+
getState = table.getState,
|
|
1675
|
+
setPageIndex = table.setPageIndex,
|
|
1676
|
+
setPageSize = table.setPageSize,
|
|
1677
|
+
_table$options = table.options,
|
|
1678
|
+
muiTablePaginationProps = _table$options.muiTablePaginationProps,
|
|
1679
|
+
enableToolbarInternalActions = _table$options.enableToolbarInternalActions,
|
|
1680
|
+
rowCount = _table$options.rowCount;
|
|
1654
1681
|
|
|
1655
1682
|
var _getState = getState(),
|
|
1656
1683
|
_getState$pagination = _getState.pagination,
|
|
@@ -1660,16 +1687,16 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
|
1660
1687
|
pageIndex = _getState$pagination$2 === void 0 ? 0 : _getState$pagination$2,
|
|
1661
1688
|
showGlobalFilter = _getState.showGlobalFilter;
|
|
1662
1689
|
|
|
1690
|
+
var totalRowCount = rowCount != null ? rowCount : getPrePaginationRowModel().rows.length;
|
|
1691
|
+
var showFirstLastPageButtons = totalRowCount / pageSize > 2;
|
|
1663
1692
|
var tablePaginationProps = muiTablePaginationProps instanceof Function ? muiTablePaginationProps({
|
|
1664
|
-
|
|
1693
|
+
table: table
|
|
1665
1694
|
}) : muiTablePaginationProps;
|
|
1666
1695
|
|
|
1667
1696
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
1668
1697
|
setPageSize(+event.target.value);
|
|
1669
1698
|
};
|
|
1670
1699
|
|
|
1671
|
-
var totalRowCount = rowCount != null ? rowCount : getPrePaginationRowModel().rows.length;
|
|
1672
|
-
var showFirstLastPageButtons = totalRowCount / pageSize > 2;
|
|
1673
1700
|
return React.createElement(TablePagination, Object.assign({
|
|
1674
1701
|
SelectProps: {
|
|
1675
1702
|
sx: {
|
|
@@ -1706,20 +1733,20 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
|
1706
1733
|
var _localization$selecte, _localization$selecte2;
|
|
1707
1734
|
|
|
1708
1735
|
var stackAlertBanner = _ref.stackAlertBanner,
|
|
1709
|
-
|
|
1710
|
-
var getPrePaginationRowModel =
|
|
1711
|
-
getSelectedRowModel =
|
|
1712
|
-
getState =
|
|
1713
|
-
|
|
1714
|
-
localization =
|
|
1715
|
-
muiTableToolbarAlertBannerProps =
|
|
1736
|
+
table = _ref.table;
|
|
1737
|
+
var getPrePaginationRowModel = table.getPrePaginationRowModel,
|
|
1738
|
+
getSelectedRowModel = table.getSelectedRowModel,
|
|
1739
|
+
getState = table.getState,
|
|
1740
|
+
_table$options = table.options,
|
|
1741
|
+
localization = _table$options.localization,
|
|
1742
|
+
muiTableToolbarAlertBannerProps = _table$options.muiTableToolbarAlertBannerProps;
|
|
1716
1743
|
|
|
1717
1744
|
var _getState = getState(),
|
|
1718
1745
|
grouping = _getState.grouping,
|
|
1719
1746
|
showAlertBanner = _getState.showAlertBanner;
|
|
1720
1747
|
|
|
1721
1748
|
var alertProps = muiTableToolbarAlertBannerProps instanceof Function ? muiTableToolbarAlertBannerProps({
|
|
1722
|
-
|
|
1749
|
+
table: table
|
|
1723
1750
|
}) : muiTableToolbarAlertBannerProps;
|
|
1724
1751
|
var selectMessage = getSelectedRowModel().rows.length > 0 ? (_localization$selecte = localization.selectedCountOfRowCountRowsSelected) == null ? void 0 : (_localization$selecte2 = _localization$selecte.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) == null ? void 0 : _localization$selecte2.replace('{rowCount}', getPrePaginationRowModel().rows.length.toString()) : null;
|
|
1725
1752
|
var groupedByMessage = grouping.length > 0 ? React.createElement("span", null, localization.groupedBy, ' ', grouping.map(function (columnId, index) {
|
|
@@ -1727,9 +1754,9 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
|
1727
1754
|
key: index + "-" + columnId
|
|
1728
1755
|
}, index > 0 ? localization.thenBy : '', React.createElement(Chip, {
|
|
1729
1756
|
color: "secondary",
|
|
1730
|
-
label:
|
|
1757
|
+
label: table.getColumn(columnId).columnDef.header,
|
|
1731
1758
|
onDelete: function onDelete() {
|
|
1732
|
-
return
|
|
1759
|
+
return table.getColumn(columnId).toggleGrouping();
|
|
1733
1760
|
}
|
|
1734
1761
|
}));
|
|
1735
1762
|
})) : null;
|
|
@@ -1760,16 +1787,16 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
|
1760
1787
|
|
|
1761
1788
|
var MRT_LinearProgressBar = function MRT_LinearProgressBar(_ref) {
|
|
1762
1789
|
var alignTo = _ref.alignTo,
|
|
1763
|
-
|
|
1764
|
-
var muiLinearProgressProps =
|
|
1765
|
-
getState =
|
|
1790
|
+
table = _ref.table;
|
|
1791
|
+
var muiLinearProgressProps = table.options.muiLinearProgressProps,
|
|
1792
|
+
getState = table.getState;
|
|
1766
1793
|
|
|
1767
1794
|
var _getState = getState(),
|
|
1768
1795
|
isLoading = _getState.isLoading,
|
|
1769
1796
|
showProgressBars = _getState.showProgressBars;
|
|
1770
1797
|
|
|
1771
1798
|
var linearProgressProps = muiLinearProgressProps instanceof Function ? muiLinearProgressProps({
|
|
1772
|
-
|
|
1799
|
+
table: table
|
|
1773
1800
|
}) : muiLinearProgressProps;
|
|
1774
1801
|
return React.createElement(Collapse, {
|
|
1775
1802
|
"in": isLoading || showProgressBars,
|
|
@@ -1806,18 +1833,18 @@ var commonToolbarStyles = function commonToolbarStyles(_ref) {
|
|
|
1806
1833
|
var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
1807
1834
|
var _renderToolbarTopCust;
|
|
1808
1835
|
|
|
1809
|
-
var
|
|
1810
|
-
var getState =
|
|
1811
|
-
|
|
1812
|
-
enableGlobalFilter =
|
|
1813
|
-
enablePagination =
|
|
1814
|
-
enableToolbarInternalActions =
|
|
1815
|
-
muiTableToolbarTopProps =
|
|
1816
|
-
positionGlobalFilter =
|
|
1817
|
-
positionPagination =
|
|
1818
|
-
positionToolbarAlertBanner =
|
|
1819
|
-
renderToolbarTopCustomActions =
|
|
1820
|
-
tableId =
|
|
1836
|
+
var table = _ref2.table;
|
|
1837
|
+
var getState = table.getState,
|
|
1838
|
+
_table$options = table.options,
|
|
1839
|
+
enableGlobalFilter = _table$options.enableGlobalFilter,
|
|
1840
|
+
enablePagination = _table$options.enablePagination,
|
|
1841
|
+
enableToolbarInternalActions = _table$options.enableToolbarInternalActions,
|
|
1842
|
+
muiTableToolbarTopProps = _table$options.muiTableToolbarTopProps,
|
|
1843
|
+
positionGlobalFilter = _table$options.positionGlobalFilter,
|
|
1844
|
+
positionPagination = _table$options.positionPagination,
|
|
1845
|
+
positionToolbarAlertBanner = _table$options.positionToolbarAlertBanner,
|
|
1846
|
+
renderToolbarTopCustomActions = _table$options.renderToolbarTopCustomActions,
|
|
1847
|
+
tableId = _table$options.tableId;
|
|
1821
1848
|
|
|
1822
1849
|
var _getState = getState(),
|
|
1823
1850
|
isFullScreen = _getState.isFullScreen,
|
|
@@ -1825,7 +1852,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
|
1825
1852
|
|
|
1826
1853
|
var isMobile = useMediaQuery('(max-width:720px)');
|
|
1827
1854
|
var toolbarProps = muiTableToolbarTopProps instanceof Function ? muiTableToolbarTopProps({
|
|
1828
|
-
|
|
1855
|
+
table: table
|
|
1829
1856
|
}) : muiTableToolbarTopProps;
|
|
1830
1857
|
var stackAlertBanner = isMobile || positionToolbarAlertBanner === 'top' && (!!renderToolbarTopCustomActions || showGlobalFilter);
|
|
1831
1858
|
return React.createElement(Toolbar, Object.assign({
|
|
@@ -1842,7 +1869,7 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
|
1842
1869
|
}
|
|
1843
1870
|
}), positionToolbarAlertBanner === 'top' && React.createElement(MRT_ToolbarAlertBanner, {
|
|
1844
1871
|
stackAlertBanner: stackAlertBanner,
|
|
1845
|
-
|
|
1872
|
+
table: table
|
|
1846
1873
|
}), React.createElement(Box, {
|
|
1847
1874
|
sx: {
|
|
1848
1875
|
alignItems: 'flex-start',
|
|
@@ -1856,39 +1883,39 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
|
1856
1883
|
width: '100%'
|
|
1857
1884
|
}
|
|
1858
1885
|
}, enableGlobalFilter && positionGlobalFilter === 'left' && React.createElement(MRT_GlobalFilterTextField, {
|
|
1859
|
-
|
|
1886
|
+
table: table
|
|
1860
1887
|
}), (_renderToolbarTopCust = renderToolbarTopCustomActions == null ? void 0 : renderToolbarTopCustomActions({
|
|
1861
|
-
|
|
1888
|
+
table: table
|
|
1862
1889
|
})) != null ? _renderToolbarTopCust : React.createElement("span", null), enableToolbarInternalActions ? React.createElement(MRT_ToolbarInternalButtons, {
|
|
1863
|
-
|
|
1890
|
+
table: table
|
|
1864
1891
|
}) : enableGlobalFilter && positionGlobalFilter === 'right' && React.createElement(MRT_GlobalFilterTextField, {
|
|
1865
|
-
|
|
1892
|
+
table: table
|
|
1866
1893
|
})), enablePagination && ['top', 'both'].includes(positionPagination != null ? positionPagination : '') && React.createElement(MRT_TablePagination, {
|
|
1867
|
-
|
|
1894
|
+
table: table,
|
|
1868
1895
|
position: "top"
|
|
1869
1896
|
}), React.createElement(MRT_LinearProgressBar, {
|
|
1870
1897
|
alignTo: "bottom",
|
|
1871
|
-
|
|
1898
|
+
table: table
|
|
1872
1899
|
}));
|
|
1873
1900
|
};
|
|
1874
1901
|
|
|
1875
1902
|
var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
1876
|
-
var
|
|
1877
|
-
var getState =
|
|
1878
|
-
|
|
1879
|
-
enablePagination =
|
|
1880
|
-
muiTableToolbarBottomProps =
|
|
1881
|
-
positionPagination =
|
|
1882
|
-
positionToolbarAlertBanner =
|
|
1883
|
-
renderToolbarBottomCustomActions =
|
|
1884
|
-
tableId =
|
|
1903
|
+
var table = _ref.table;
|
|
1904
|
+
var getState = table.getState,
|
|
1905
|
+
_table$options = table.options,
|
|
1906
|
+
enablePagination = _table$options.enablePagination,
|
|
1907
|
+
muiTableToolbarBottomProps = _table$options.muiTableToolbarBottomProps,
|
|
1908
|
+
positionPagination = _table$options.positionPagination,
|
|
1909
|
+
positionToolbarAlertBanner = _table$options.positionToolbarAlertBanner,
|
|
1910
|
+
renderToolbarBottomCustomActions = _table$options.renderToolbarBottomCustomActions,
|
|
1911
|
+
tableId = _table$options.tableId;
|
|
1885
1912
|
|
|
1886
1913
|
var _getState = getState(),
|
|
1887
1914
|
isFullScreen = _getState.isFullScreen;
|
|
1888
1915
|
|
|
1889
1916
|
var isMobile = useMediaQuery('(max-width:720px)');
|
|
1890
1917
|
var toolbarProps = muiTableToolbarBottomProps instanceof Function ? muiTableToolbarBottomProps({
|
|
1891
|
-
|
|
1918
|
+
table: table
|
|
1892
1919
|
}) : muiTableToolbarBottomProps;
|
|
1893
1920
|
var stackAlertBanner = isMobile || positionToolbarAlertBanner === 'bottom' && !!renderToolbarBottomCustomActions;
|
|
1894
1921
|
return React.createElement(Toolbar, Object.assign({
|
|
@@ -1908,9 +1935,9 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
|
1908
1935
|
}
|
|
1909
1936
|
}), React.createElement(MRT_LinearProgressBar, {
|
|
1910
1937
|
alignTo: "top",
|
|
1911
|
-
|
|
1938
|
+
table: table
|
|
1912
1939
|
}), positionToolbarAlertBanner === 'bottom' && React.createElement(MRT_ToolbarAlertBanner, {
|
|
1913
|
-
|
|
1940
|
+
table: table
|
|
1914
1941
|
}), React.createElement(Box, {
|
|
1915
1942
|
sx: {
|
|
1916
1943
|
display: 'flex',
|
|
@@ -1922,7 +1949,7 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
|
1922
1949
|
p: '0.5rem'
|
|
1923
1950
|
}
|
|
1924
1951
|
}, renderToolbarBottomCustomActions({
|
|
1925
|
-
|
|
1952
|
+
table: table
|
|
1926
1953
|
})) : React.createElement("span", null), React.createElement(Box, {
|
|
1927
1954
|
sx: {
|
|
1928
1955
|
display: 'flex',
|
|
@@ -1932,28 +1959,28 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
|
1932
1959
|
top: 0
|
|
1933
1960
|
}
|
|
1934
1961
|
}, enablePagination && ['bottom', 'both'].includes(positionPagination != null ? positionPagination : '') && React.createElement(MRT_TablePagination, {
|
|
1935
|
-
|
|
1962
|
+
table: table,
|
|
1936
1963
|
position: "bottom"
|
|
1937
1964
|
}))));
|
|
1938
1965
|
};
|
|
1939
1966
|
|
|
1940
1967
|
var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
1941
|
-
var _localization$filterB, _columnDef$enabledCol, _localization$
|
|
1968
|
+
var _localization$filterB, _columnDef$enabledCol, _localization$clearFi, _columnDef$filterSele;
|
|
1942
1969
|
|
|
1943
1970
|
var header = _ref.header,
|
|
1944
1971
|
inputIndex = _ref.inputIndex,
|
|
1945
|
-
|
|
1946
|
-
var getState =
|
|
1947
|
-
|
|
1948
|
-
enableColumnFilterChangeMode =
|
|
1949
|
-
enabledColumnFilterOptions =
|
|
1950
|
-
|
|
1951
|
-
FilterListIcon =
|
|
1952
|
-
CloseIcon =
|
|
1953
|
-
localization =
|
|
1954
|
-
muiTableHeadCellFilterTextFieldProps =
|
|
1955
|
-
tableId =
|
|
1956
|
-
setCurrentFilterFns =
|
|
1972
|
+
table = _ref.table;
|
|
1973
|
+
var getState = table.getState,
|
|
1974
|
+
_table$options = table.options,
|
|
1975
|
+
enableColumnFilterChangeMode = _table$options.enableColumnFilterChangeMode,
|
|
1976
|
+
enabledColumnFilterOptions = _table$options.enabledColumnFilterOptions,
|
|
1977
|
+
_table$options$icons = _table$options.icons,
|
|
1978
|
+
FilterListIcon = _table$options$icons.FilterListIcon,
|
|
1979
|
+
CloseIcon = _table$options$icons.CloseIcon,
|
|
1980
|
+
localization = _table$options.localization,
|
|
1981
|
+
muiTableHeadCellFilterTextFieldProps = _table$options.muiTableHeadCellFilterTextFieldProps,
|
|
1982
|
+
tableId = _table$options.tableId,
|
|
1983
|
+
setCurrentFilterFns = table.setCurrentFilterFns;
|
|
1957
1984
|
var column = header.column;
|
|
1958
1985
|
var columnDef = column.columnDef;
|
|
1959
1986
|
|
|
@@ -1966,11 +1993,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
1966
1993
|
|
|
1967
1994
|
var mTableHeadCellFilterTextFieldProps = muiTableHeadCellFilterTextFieldProps instanceof Function ? muiTableHeadCellFilterTextFieldProps({
|
|
1968
1995
|
column: column,
|
|
1969
|
-
|
|
1996
|
+
table: table
|
|
1970
1997
|
}) : muiTableHeadCellFilterTextFieldProps;
|
|
1971
1998
|
var mcTableHeadCellFilterTextFieldProps = columnDef.muiTableHeadCellFilterTextFieldProps instanceof Function ? columnDef.muiTableHeadCellFilterTextFieldProps({
|
|
1972
1999
|
column: column,
|
|
1973
|
-
|
|
2000
|
+
table: table
|
|
1974
2001
|
}) : columnDef.muiTableHeadCellFilterTextFieldProps;
|
|
1975
2002
|
|
|
1976
2003
|
var textFieldProps = _extends({}, mTableHeadCellFilterTextFieldProps, mcTableHeadCellFilterTextFieldProps);
|
|
@@ -2033,15 +2060,15 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2033
2060
|
if (columnDef.Filter) {
|
|
2034
2061
|
return React.createElement(React.Fragment, null, columnDef.Filter == null ? void 0 : columnDef.Filter({
|
|
2035
2062
|
header: header,
|
|
2036
|
-
|
|
2063
|
+
table: table
|
|
2037
2064
|
}));
|
|
2038
2065
|
}
|
|
2039
2066
|
|
|
2040
2067
|
var filterId = "mrt-" + tableId + "-" + header.id + "-filter-text-field" + (inputIndex != null ? inputIndex : '');
|
|
2041
|
-
var
|
|
2068
|
+
var currentFilterOption = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
|
|
2042
2069
|
var isSelectFilter = !!columnDef.filterSelectOptions;
|
|
2043
|
-
var filterChipLabel =
|
|
2044
|
-
localization["filter" + (
|
|
2070
|
+
var filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption) ? //@ts-ignore
|
|
2071
|
+
localization["filter" + (currentFilterOption.charAt(0).toUpperCase() + currentFilterOption.slice(1))] : '';
|
|
2045
2072
|
var filterPlaceholder = inputIndex === undefined ? (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(columnDef.header)) : inputIndex === 0 ? localization.min : inputIndex === 1 ? localization.max : '';
|
|
2046
2073
|
var allowedColumnFilterOptions = (_columnDef$enabledCol = columnDef == null ? void 0 : columnDef.enabledColumnFilterOptions) != null ? _columnDef$enabledCol : enabledColumnFilterOptions;
|
|
2047
2074
|
var showChangeModeButton = enableColumnFilterChangeMode && columnDef.enableColumnFilterChangeMode !== false && !isSelectFilter && !inputIndex && (allowedColumnFilterOptions === undefined || !!(allowedColumnFilterOptions != null && allowedColumnFilterOptions.length));
|
|
@@ -2058,9 +2085,8 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2058
2085
|
},
|
|
2059
2086
|
helperText: showChangeModeButton ? React.createElement("label", {
|
|
2060
2087
|
htmlFor: filterId
|
|
2061
|
-
},
|
|
2062
|
-
|
|
2063
|
-
localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))])) : null,
|
|
2088
|
+
}, localization.filterMode.replace('{filterType}', // @ts-ignore
|
|
2089
|
+
localization["filter" + (currentFilterOption.charAt(0).toUpperCase() + currentFilterOption.slice(1))])) : null,
|
|
2064
2090
|
FormHelperTextProps: {
|
|
2065
2091
|
sx: {
|
|
2066
2092
|
fontSize: '0.6rem',
|
|
@@ -2147,13 +2173,13 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2147
2173
|
anchorEl: anchorEl,
|
|
2148
2174
|
header: header,
|
|
2149
2175
|
setAnchorEl: setAnchorEl,
|
|
2150
|
-
|
|
2176
|
+
table: table
|
|
2151
2177
|
}));
|
|
2152
2178
|
};
|
|
2153
2179
|
|
|
2154
2180
|
var MRT_FilterRangeFields = function MRT_FilterRangeFields(_ref) {
|
|
2155
2181
|
var header = _ref.header,
|
|
2156
|
-
|
|
2182
|
+
table = _ref.table;
|
|
2157
2183
|
return React.createElement(Box, {
|
|
2158
2184
|
sx: {
|
|
2159
2185
|
display: 'grid',
|
|
@@ -2163,18 +2189,18 @@ var MRT_FilterRangeFields = function MRT_FilterRangeFields(_ref) {
|
|
|
2163
2189
|
}, React.createElement(MRT_FilterTextField, {
|
|
2164
2190
|
header: header,
|
|
2165
2191
|
inputIndex: 0,
|
|
2166
|
-
|
|
2192
|
+
table: table
|
|
2167
2193
|
}), React.createElement(MRT_FilterTextField, {
|
|
2168
2194
|
header: header,
|
|
2169
2195
|
inputIndex: 1,
|
|
2170
|
-
|
|
2196
|
+
table: table
|
|
2171
2197
|
}));
|
|
2172
2198
|
};
|
|
2173
2199
|
|
|
2174
2200
|
var MRT_TableHeadCellFilterContainer = function MRT_TableHeadCellFilterContainer(_ref) {
|
|
2175
2201
|
var header = _ref.header,
|
|
2176
|
-
|
|
2177
|
-
var getState =
|
|
2202
|
+
table = _ref.table;
|
|
2203
|
+
var getState = table.getState;
|
|
2178
2204
|
|
|
2179
2205
|
var _getState = getState(),
|
|
2180
2206
|
currentFilterFns = _getState.currentFilterFns,
|
|
@@ -2187,10 +2213,10 @@ var MRT_TableHeadCellFilterContainer = function MRT_TableHeadCellFilterContainer
|
|
|
2187
2213
|
unmountOnExit: true
|
|
2188
2214
|
}, currentFilterFns[column.id] === 'between' ? React.createElement(MRT_FilterRangeFields, {
|
|
2189
2215
|
header: header,
|
|
2190
|
-
|
|
2216
|
+
table: table
|
|
2191
2217
|
}) : React.createElement(MRT_FilterTextField, {
|
|
2192
2218
|
header: header,
|
|
2193
|
-
|
|
2219
|
+
table: table
|
|
2194
2220
|
}));
|
|
2195
2221
|
};
|
|
2196
2222
|
|
|
@@ -2198,23 +2224,23 @@ var MRT_TableHeadCellFilterLabel = function MRT_TableHeadCellFilterLabel(_ref) {
|
|
|
2198
2224
|
var _column$getFilterValu, _column$getFilterValu2;
|
|
2199
2225
|
|
|
2200
2226
|
var header = _ref.header,
|
|
2201
|
-
|
|
2202
|
-
var getState =
|
|
2203
|
-
|
|
2204
|
-
FilterAltIcon =
|
|
2205
|
-
localization =
|
|
2227
|
+
table = _ref.table;
|
|
2228
|
+
var getState = table.getState,
|
|
2229
|
+
_table$options = table.options,
|
|
2230
|
+
FilterAltIcon = _table$options.icons.FilterAltIcon,
|
|
2231
|
+
localization = _table$options.localization;
|
|
2206
2232
|
|
|
2207
2233
|
var _getState = getState(),
|
|
2208
2234
|
currentFilterFns = _getState.currentFilterFns;
|
|
2209
2235
|
|
|
2210
2236
|
var column = header.column;
|
|
2211
2237
|
var columnDef = column.columnDef;
|
|
2212
|
-
var
|
|
2213
|
-
var filterTooltip = localization.filteringByColumn.replace('{column}', String(columnDef.header)).replace('{filterType}',
|
|
2214
|
-
localization["filter" + (
|
|
2238
|
+
var currentFilterOption = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
|
|
2239
|
+
var filterTooltip = localization.filteringByColumn.replace('{column}', String(columnDef.header)).replace('{filterType}', // @ts-ignore
|
|
2240
|
+
localization["filter" + (currentFilterOption.charAt(0).toUpperCase() + currentFilterOption.slice(1))]).replace('{filterValue}', "\"" + (Array.isArray(column.getFilterValue()) ? column.getFilterValue().join("\" " + localization.and + " \"") : column.getFilterValue()) + "\"").replace('" "', '');
|
|
2215
2241
|
return React.createElement(Grow, {
|
|
2216
2242
|
unmountOnExit: true,
|
|
2217
|
-
"in": !!column.getFilterValue() &&
|
|
2243
|
+
"in": !!column.getFilterValue() && currentFilterOption !== 'between' || currentFilterOption === 'between' && ( // @ts-ignore
|
|
2218
2244
|
!!((_column$getFilterValu = column.getFilterValue()) != null && _column$getFilterValu[0]) || !!((_column$getFilterValu2 = column.getFilterValue()) != null && _column$getFilterValu2[1]))
|
|
2219
2245
|
}, React.createElement("span", null, React.createElement(Tooltip, {
|
|
2220
2246
|
arrow: true,
|
|
@@ -2237,16 +2263,20 @@ var MRT_TableHeadCellFilterLabel = function MRT_TableHeadCellFilterLabel(_ref) {
|
|
|
2237
2263
|
};
|
|
2238
2264
|
|
|
2239
2265
|
var MRT_TableHeadCellResizeHandle = function MRT_TableHeadCellResizeHandle(_ref) {
|
|
2266
|
+
var _getState$columnSizin;
|
|
2267
|
+
|
|
2240
2268
|
var header = _ref.header,
|
|
2241
|
-
|
|
2242
|
-
var getState =
|
|
2269
|
+
table = _ref.table;
|
|
2270
|
+
var getState = table.getState,
|
|
2271
|
+
columnResizeMode = table.options.columnResizeMode;
|
|
2243
2272
|
|
|
2244
2273
|
var _getState = getState(),
|
|
2245
2274
|
density = _getState.density,
|
|
2246
2275
|
showFilters = _getState.showFilters;
|
|
2247
2276
|
|
|
2248
2277
|
var column = header.column;
|
|
2249
|
-
var
|
|
2278
|
+
var columnDef = column.columnDef;
|
|
2279
|
+
var columnDefType = columnDef.columnDefType;
|
|
2250
2280
|
return React.createElement(Divider, {
|
|
2251
2281
|
flexItem: true,
|
|
2252
2282
|
orientation: "vertical",
|
|
@@ -2276,15 +2306,15 @@ var MRT_TableHeadCellResizeHandle = function MRT_TableHeadCellResizeHandle(_ref)
|
|
|
2276
2306
|
onMouseDown: header.getResizeHandler(),
|
|
2277
2307
|
onTouchStart: header.getResizeHandler(),
|
|
2278
2308
|
style: {
|
|
2279
|
-
transform: column.getIsResizing() ? "translateX(" + getState().columnSizingInfo.deltaOffset + "px)" : 'none'
|
|
2309
|
+
transform: column.getIsResizing() ? "translateX(" + ((_getState$columnSizin = getState().columnSizingInfo.deltaOffset) != null ? _getState$columnSizin : 0) / (columnResizeMode === 'onChange' ? 16 : 1) + "px)" : 'none'
|
|
2280
2310
|
}
|
|
2281
2311
|
});
|
|
2282
2312
|
};
|
|
2283
2313
|
|
|
2284
2314
|
var MRT_TableHeadCellSortLabel = function MRT_TableHeadCellSortLabel(_ref) {
|
|
2285
2315
|
var header = _ref.header,
|
|
2286
|
-
|
|
2287
|
-
var localization =
|
|
2316
|
+
table = _ref.table;
|
|
2317
|
+
var localization = table.options.localization;
|
|
2288
2318
|
var column = header.column;
|
|
2289
2319
|
var columnDef = column.columnDef;
|
|
2290
2320
|
var sortTooltip = !!column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.sortedByColumnDesc.replace('{column}', columnDef.header) : localization.sortedByColumnAsc.replace('{column}', columnDef.header) : localization.unsorted;
|
|
@@ -2305,11 +2335,11 @@ var MRT_TableHeadCellSortLabel = function MRT_TableHeadCellSortLabel(_ref) {
|
|
|
2305
2335
|
|
|
2306
2336
|
var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActionsButton(_ref) {
|
|
2307
2337
|
var header = _ref.header,
|
|
2308
|
-
|
|
2309
|
-
var
|
|
2310
|
-
MoreVertIcon =
|
|
2311
|
-
localization =
|
|
2312
|
-
muiTableHeadCellColumnActionsButtonProps =
|
|
2338
|
+
table = _ref.table;
|
|
2339
|
+
var _table$options = table.options,
|
|
2340
|
+
MoreVertIcon = _table$options.icons.MoreVertIcon,
|
|
2341
|
+
localization = _table$options.localization,
|
|
2342
|
+
muiTableHeadCellColumnActionsButtonProps = _table$options.muiTableHeadCellColumnActionsButtonProps;
|
|
2313
2343
|
var column = header.column;
|
|
2314
2344
|
var columnDef = column.columnDef;
|
|
2315
2345
|
|
|
@@ -2325,11 +2355,11 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
|
|
|
2325
2355
|
|
|
2326
2356
|
var mTableHeadCellColumnActionsButtonProps = muiTableHeadCellColumnActionsButtonProps instanceof Function ? muiTableHeadCellColumnActionsButtonProps({
|
|
2327
2357
|
column: column,
|
|
2328
|
-
|
|
2358
|
+
table: table
|
|
2329
2359
|
}) : muiTableHeadCellColumnActionsButtonProps;
|
|
2330
2360
|
var mcTableHeadCellColumnActionsButtonProps = columnDef.muiTableHeadCellColumnActionsButtonProps instanceof Function ? columnDef.muiTableHeadCellColumnActionsButtonProps({
|
|
2331
2361
|
column: column,
|
|
2332
|
-
|
|
2362
|
+
table: table
|
|
2333
2363
|
}) : columnDef.muiTableHeadCellColumnActionsButtonProps;
|
|
2334
2364
|
|
|
2335
2365
|
var iconButtonProps = _extends({}, mTableHeadCellColumnActionsButtonProps, mcTableHeadCellColumnActionsButtonProps);
|
|
@@ -2359,53 +2389,53 @@ var MRT_TableHeadCellColumnActionsButton = function MRT_TableHeadCellColumnActio
|
|
|
2359
2389
|
anchorEl: anchorEl,
|
|
2360
2390
|
header: header,
|
|
2361
2391
|
setAnchorEl: setAnchorEl,
|
|
2362
|
-
|
|
2392
|
+
table: table
|
|
2363
2393
|
}));
|
|
2364
2394
|
};
|
|
2365
2395
|
|
|
2366
2396
|
var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2367
|
-
var _ref2,
|
|
2397
|
+
var _ref2, _columnDef$header$len, _columnDef$header;
|
|
2368
2398
|
|
|
2369
2399
|
var dragRef = _ref.dragRef,
|
|
2370
2400
|
dropRef = _ref.dropRef,
|
|
2371
2401
|
header = _ref.header,
|
|
2372
|
-
|
|
2402
|
+
table = _ref.table,
|
|
2373
2403
|
isDragging = _ref.isDragging,
|
|
2374
2404
|
previewRef = _ref.previewRef;
|
|
2375
|
-
var getState =
|
|
2376
|
-
|
|
2377
|
-
enableColumnActions =
|
|
2378
|
-
enableColumnOrdering =
|
|
2379
|
-
enableColumnResizing =
|
|
2380
|
-
enableGrouping =
|
|
2381
|
-
enableMultiSort =
|
|
2382
|
-
muiTableHeadCellProps =
|
|
2405
|
+
var getState = table.getState,
|
|
2406
|
+
_table$options = table.options,
|
|
2407
|
+
enableColumnActions = _table$options.enableColumnActions,
|
|
2408
|
+
enableColumnOrdering = _table$options.enableColumnOrdering,
|
|
2409
|
+
enableColumnResizing = _table$options.enableColumnResizing,
|
|
2410
|
+
enableGrouping = _table$options.enableGrouping,
|
|
2411
|
+
enableMultiSort = _table$options.enableMultiSort,
|
|
2412
|
+
muiTableHeadCellProps = _table$options.muiTableHeadCellProps;
|
|
2383
2413
|
|
|
2384
2414
|
var _getState = getState(),
|
|
2385
2415
|
density = _getState.density,
|
|
2386
2416
|
showFilters = _getState.showFilters;
|
|
2387
2417
|
|
|
2388
2418
|
var column = header.column;
|
|
2389
|
-
var columnDef = column.columnDef
|
|
2390
|
-
|
|
2419
|
+
var columnDef = column.columnDef;
|
|
2420
|
+
var columnDefType = columnDef.columnDefType;
|
|
2391
2421
|
var mTableHeadCellProps = muiTableHeadCellProps instanceof Function ? muiTableHeadCellProps({
|
|
2392
2422
|
column: column,
|
|
2393
|
-
|
|
2423
|
+
table: table
|
|
2394
2424
|
}) : muiTableHeadCellProps;
|
|
2395
2425
|
var mcTableHeadCellProps = columnDef.muiTableHeadCellProps instanceof Function ? columnDef.muiTableHeadCellProps({
|
|
2396
2426
|
column: column,
|
|
2397
|
-
|
|
2427
|
+
table: table
|
|
2398
2428
|
}) : columnDef.muiTableHeadCellProps;
|
|
2399
2429
|
|
|
2400
2430
|
var tableCellProps = _extends({}, mTableHeadCellProps, mcTableHeadCellProps);
|
|
2401
2431
|
|
|
2402
|
-
var headerElement = (_ref2 = (
|
|
2432
|
+
var headerElement = (_ref2 = (columnDef == null ? void 0 : columnDef.Header) instanceof Function ? columnDef == null ? void 0 : columnDef.Header == null ? void 0 : columnDef.Header({
|
|
2403
2433
|
header: header,
|
|
2404
|
-
|
|
2405
|
-
}) : columnDef == null ? void 0 : columnDef.Header) != null ?
|
|
2434
|
+
table: table
|
|
2435
|
+
}) : columnDef == null ? void 0 : columnDef.Header) != null ? _ref2 : columnDef.header;
|
|
2406
2436
|
|
|
2407
2437
|
var getIsLastLeftPinnedColumn = function getIsLastLeftPinnedColumn() {
|
|
2408
|
-
return column.getIsPinned() === 'left' &&
|
|
2438
|
+
return column.getIsPinned() === 'left' && table.getLeftLeafHeaders().length - 1 === column.getPinnedIndex();
|
|
2409
2439
|
};
|
|
2410
2440
|
|
|
2411
2441
|
var getIsFirstRightPinnedColumn = function getIsFirstRightPinnedColumn() {
|
|
@@ -2413,7 +2443,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2413
2443
|
};
|
|
2414
2444
|
|
|
2415
2445
|
var getTotalRight = function getTotalRight() {
|
|
2416
|
-
return (
|
|
2446
|
+
return (table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 150;
|
|
2417
2447
|
};
|
|
2418
2448
|
|
|
2419
2449
|
return React.createElement(TableCell, Object.assign({
|
|
@@ -2438,7 +2468,7 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2438
2468
|
pt: columnDefType !== 'data' ? 0 : density === 'compact' ? '0.25' : density === 'comfortable' ? '.75rem' : '1.25rem',
|
|
2439
2469
|
right: column.getIsPinned() === 'right' ? getTotalRight() + "px" : undefined,
|
|
2440
2470
|
transition: "all " + (enableColumnResizing ? 0 : '0.2s') + " ease-in-out",
|
|
2441
|
-
userSelect: enableMultiSort ? 'none' : undefined,
|
|
2471
|
+
userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined,
|
|
2442
2472
|
verticalAlign: columnDefType === 'display' && showFilters ? 'center' : 'text-top',
|
|
2443
2473
|
zIndex: column.getIsResizing() ? 3 : column.getIsPinned() && columnDefType !== 'group' ? 2 : 1
|
|
2444
2474
|
}, tableCellProps == null ? void 0 : tableCellProps.sx, {
|
|
@@ -2468,34 +2498,34 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2468
2498
|
}
|
|
2469
2499
|
}, headerElement, columnDefType === 'data' && column.getCanSort() && React.createElement(MRT_TableHeadCellSortLabel, {
|
|
2470
2500
|
header: header,
|
|
2471
|
-
|
|
2501
|
+
table: table
|
|
2472
2502
|
}), columnDefType === 'data' && column.getCanFilter() && React.createElement(MRT_TableHeadCellFilterLabel, {
|
|
2473
2503
|
header: header,
|
|
2474
|
-
|
|
2504
|
+
table: table
|
|
2475
2505
|
})), React.createElement(Box, {
|
|
2476
2506
|
sx: {
|
|
2477
2507
|
whiteSpace: 'nowrap'
|
|
2478
2508
|
}
|
|
2479
2509
|
}, columnDefType === 'data' && (enableColumnOrdering && columnDef.enableColumnOrdering !== false || enableGrouping && columnDef.enableGrouping !== false) && React.createElement(MRT_GrabHandleButton, {
|
|
2480
2510
|
ref: dragRef,
|
|
2481
|
-
|
|
2511
|
+
table: table
|
|
2482
2512
|
}), (enableColumnActions || columnDef.enableColumnActions) && columnDef.enableColumnActions !== false && columnDefType !== 'group' && React.createElement(MRT_TableHeadCellColumnActionsButton, {
|
|
2483
2513
|
header: header,
|
|
2484
|
-
|
|
2514
|
+
table: table
|
|
2485
2515
|
})), column.getCanResize() && React.createElement(MRT_TableHeadCellResizeHandle, {
|
|
2486
2516
|
header: header,
|
|
2487
|
-
|
|
2517
|
+
table: table
|
|
2488
2518
|
})), columnDefType === 'data' && column.getCanFilter() && React.createElement(MRT_TableHeadCellFilterContainer, {
|
|
2489
2519
|
header: header,
|
|
2490
|
-
|
|
2520
|
+
table: table
|
|
2491
2521
|
}));
|
|
2492
2522
|
};
|
|
2493
2523
|
|
|
2494
2524
|
var MRT_DraggableTableHeadCell = function MRT_DraggableTableHeadCell(_ref) {
|
|
2495
2525
|
var header = _ref.header,
|
|
2496
|
-
|
|
2497
|
-
var getState =
|
|
2498
|
-
setColumnOrder =
|
|
2526
|
+
table = _ref.table;
|
|
2527
|
+
var getState = table.getState,
|
|
2528
|
+
setColumnOrder = table.setColumnOrder;
|
|
2499
2529
|
|
|
2500
2530
|
var _getState = getState(),
|
|
2501
2531
|
columnOrder = _getState.columnOrder;
|
|
@@ -2532,20 +2562,20 @@ var MRT_DraggableTableHeadCell = function MRT_DraggableTableHeadCell(_ref) {
|
|
|
2532
2562
|
header: header,
|
|
2533
2563
|
isDragging: isDragging,
|
|
2534
2564
|
previewRef: previewRef,
|
|
2535
|
-
|
|
2565
|
+
table: table
|
|
2536
2566
|
});
|
|
2537
2567
|
};
|
|
2538
2568
|
|
|
2539
2569
|
var MRT_TableHeadRow = function MRT_TableHeadRow(_ref) {
|
|
2540
2570
|
var headerGroup = _ref.headerGroup,
|
|
2541
|
-
|
|
2542
|
-
var
|
|
2543
|
-
enableColumnOrdering =
|
|
2544
|
-
enableGrouping =
|
|
2545
|
-
muiTableHeadRowProps =
|
|
2571
|
+
table = _ref.table;
|
|
2572
|
+
var _table$options = table.options,
|
|
2573
|
+
enableColumnOrdering = _table$options.enableColumnOrdering,
|
|
2574
|
+
enableGrouping = _table$options.enableGrouping,
|
|
2575
|
+
muiTableHeadRowProps = _table$options.muiTableHeadRowProps;
|
|
2546
2576
|
var tableRowProps = muiTableHeadRowProps instanceof Function ? muiTableHeadRowProps({
|
|
2547
2577
|
headerGroup: headerGroup,
|
|
2548
|
-
|
|
2578
|
+
table: table
|
|
2549
2579
|
}) : muiTableHeadRowProps;
|
|
2550
2580
|
return React.createElement(TableRow, Object.assign({}, tableRowProps, {
|
|
2551
2581
|
sx: function sx(theme) {
|
|
@@ -2558,63 +2588,62 @@ var MRT_TableHeadRow = function MRT_TableHeadRow(_ref) {
|
|
|
2558
2588
|
return enableColumnOrdering || enableGrouping ? React.createElement(MRT_DraggableTableHeadCell, {
|
|
2559
2589
|
header: header,
|
|
2560
2590
|
key: header.id || index,
|
|
2561
|
-
|
|
2591
|
+
table: table
|
|
2562
2592
|
}) : React.createElement(MRT_TableHeadCell, {
|
|
2563
2593
|
header: header,
|
|
2564
2594
|
key: header.id || index,
|
|
2565
|
-
|
|
2595
|
+
table: table
|
|
2566
2596
|
});
|
|
2567
2597
|
}));
|
|
2568
2598
|
};
|
|
2569
2599
|
|
|
2570
2600
|
var MRT_TableHead = function MRT_TableHead(_ref) {
|
|
2571
|
-
var
|
|
2572
|
-
var getHeaderGroups =
|
|
2573
|
-
muiTableHeadProps =
|
|
2601
|
+
var table = _ref.table;
|
|
2602
|
+
var getHeaderGroups = table.getHeaderGroups,
|
|
2603
|
+
muiTableHeadProps = table.options.muiTableHeadProps;
|
|
2574
2604
|
var tableHeadProps = muiTableHeadProps instanceof Function ? muiTableHeadProps({
|
|
2575
|
-
|
|
2605
|
+
table: table
|
|
2576
2606
|
}) : muiTableHeadProps;
|
|
2577
2607
|
return React.createElement(TableHead, Object.assign({}, tableHeadProps), getHeaderGroups().map(function (headerGroup) {
|
|
2578
2608
|
return React.createElement(MRT_TableHeadRow, {
|
|
2579
2609
|
headerGroup: headerGroup,
|
|
2580
2610
|
key: headerGroup.id,
|
|
2581
|
-
|
|
2611
|
+
table: table
|
|
2582
2612
|
});
|
|
2583
2613
|
}));
|
|
2584
2614
|
};
|
|
2585
2615
|
|
|
2586
2616
|
var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
|
|
2587
2617
|
var cell = _ref.cell,
|
|
2588
|
-
|
|
2589
|
-
var getState =
|
|
2590
|
-
|
|
2591
|
-
tableId =
|
|
2592
|
-
enableEditing =
|
|
2593
|
-
muiTableBodyCellEditTextFieldProps =
|
|
2594
|
-
onCellEditBlur =
|
|
2595
|
-
onCellEditChange =
|
|
2596
|
-
setCurrentEditingCell =
|
|
2597
|
-
setCurrentEditingRow =
|
|
2618
|
+
table = _ref.table;
|
|
2619
|
+
var getState = table.getState,
|
|
2620
|
+
_table$options = table.options,
|
|
2621
|
+
tableId = _table$options.tableId,
|
|
2622
|
+
enableEditing = _table$options.enableEditing,
|
|
2623
|
+
muiTableBodyCellEditTextFieldProps = _table$options.muiTableBodyCellEditTextFieldProps,
|
|
2624
|
+
onCellEditBlur = _table$options.onCellEditBlur,
|
|
2625
|
+
onCellEditChange = _table$options.onCellEditChange,
|
|
2626
|
+
setCurrentEditingCell = table.setCurrentEditingCell,
|
|
2627
|
+
setCurrentEditingRow = table.setCurrentEditingRow;
|
|
2628
|
+
var column = cell.column,
|
|
2629
|
+
row = cell.row;
|
|
2630
|
+
var columnDef = column.columnDef;
|
|
2598
2631
|
|
|
2599
2632
|
var _useState = useState(cell.getValue()),
|
|
2600
2633
|
value = _useState[0],
|
|
2601
2634
|
setValue = _useState[1];
|
|
2602
2635
|
|
|
2603
|
-
var column = cell.column,
|
|
2604
|
-
row = cell.row;
|
|
2605
|
-
var columnDef = column.columnDef;
|
|
2606
|
-
|
|
2607
2636
|
var handleChange = function handleChange(event) {
|
|
2608
2637
|
setValue(event.target.value);
|
|
2609
2638
|
columnDef.onCellEditChange == null ? void 0 : columnDef.onCellEditChange({
|
|
2610
2639
|
event: event,
|
|
2611
2640
|
cell: cell,
|
|
2612
|
-
|
|
2641
|
+
table: table
|
|
2613
2642
|
});
|
|
2614
2643
|
onCellEditChange == null ? void 0 : onCellEditChange({
|
|
2615
2644
|
event: event,
|
|
2616
2645
|
cell: cell,
|
|
2617
|
-
|
|
2646
|
+
table: table
|
|
2618
2647
|
});
|
|
2619
2648
|
};
|
|
2620
2649
|
|
|
@@ -2629,22 +2658,22 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
|
|
|
2629
2658
|
columnDef.onCellEditBlur == null ? void 0 : columnDef.onCellEditBlur({
|
|
2630
2659
|
event: event,
|
|
2631
2660
|
cell: cell,
|
|
2632
|
-
|
|
2661
|
+
table: table
|
|
2633
2662
|
});
|
|
2634
2663
|
onCellEditBlur == null ? void 0 : onCellEditBlur({
|
|
2635
2664
|
event: event,
|
|
2636
2665
|
cell: cell,
|
|
2637
|
-
|
|
2666
|
+
table: table
|
|
2638
2667
|
});
|
|
2639
2668
|
};
|
|
2640
2669
|
|
|
2641
2670
|
var mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function ? muiTableBodyCellEditTextFieldProps({
|
|
2642
2671
|
cell: cell,
|
|
2643
|
-
|
|
2672
|
+
table: table
|
|
2644
2673
|
}) : muiTableBodyCellEditTextFieldProps;
|
|
2645
2674
|
var mcTableBodyCellEditTextFieldProps = columnDef.muiTableBodyCellEditTextFieldProps instanceof Function ? columnDef.muiTableBodyCellEditTextFieldProps({
|
|
2646
2675
|
cell: cell,
|
|
2647
|
-
|
|
2676
|
+
table: table
|
|
2648
2677
|
}) : columnDef.muiTableBodyCellEditTextFieldProps;
|
|
2649
2678
|
|
|
2650
2679
|
var textFieldProps = _extends({}, mTableBodyCellEditTextFieldProps, mcTableBodyCellEditTextFieldProps);
|
|
@@ -2652,7 +2681,7 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
|
|
|
2652
2681
|
if (enableEditing && columnDef.enableEditing !== false && columnDef.Edit) {
|
|
2653
2682
|
return React.createElement(React.Fragment, null, columnDef.Edit == null ? void 0 : columnDef.Edit({
|
|
2654
2683
|
cell: cell,
|
|
2655
|
-
|
|
2684
|
+
table: table
|
|
2656
2685
|
}));
|
|
2657
2686
|
}
|
|
2658
2687
|
|
|
@@ -2673,10 +2702,10 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
|
|
|
2673
2702
|
var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
2674
2703
|
var cell = _ref.cell,
|
|
2675
2704
|
children = _ref.children,
|
|
2676
|
-
|
|
2677
|
-
var
|
|
2678
|
-
localization =
|
|
2679
|
-
muiTableBodyCellCopyButtonProps =
|
|
2705
|
+
table = _ref.table;
|
|
2706
|
+
var _table$options = table.options,
|
|
2707
|
+
localization = _table$options.localization,
|
|
2708
|
+
muiTableBodyCellCopyButtonProps = _table$options.muiTableBodyCellCopyButtonProps;
|
|
2680
2709
|
var column = cell.column;
|
|
2681
2710
|
var columnDef = column.columnDef;
|
|
2682
2711
|
|
|
@@ -2694,11 +2723,11 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
|
2694
2723
|
|
|
2695
2724
|
var mTableBodyCellCopyButtonProps = muiTableBodyCellCopyButtonProps instanceof Function ? muiTableBodyCellCopyButtonProps({
|
|
2696
2725
|
cell: cell,
|
|
2697
|
-
|
|
2726
|
+
table: table
|
|
2698
2727
|
}) : muiTableBodyCellCopyButtonProps;
|
|
2699
2728
|
var mcTableBodyCellCopyButtonProps = columnDef.muiTableBodyCellCopyButtonProps instanceof Function ? columnDef.muiTableBodyCellCopyButtonProps({
|
|
2700
2729
|
cell: cell,
|
|
2701
|
-
|
|
2730
|
+
table: table
|
|
2702
2731
|
}) : columnDef.muiTableBodyCellCopyButtonProps;
|
|
2703
2732
|
|
|
2704
2733
|
var buttonProps = _extends({}, mTableBodyCellCopyButtonProps, mcTableBodyCellCopyButtonProps);
|
|
@@ -2735,25 +2764,25 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
|
2735
2764
|
};
|
|
2736
2765
|
|
|
2737
2766
|
var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
2738
|
-
var _columnDef$
|
|
2767
|
+
var _columnDef$Cell, _row$subRows, _columnDef$Cell2, _row$subRows$length, _row$subRows2;
|
|
2739
2768
|
|
|
2740
2769
|
var cell = _ref.cell,
|
|
2741
2770
|
enableHover = _ref.enableHover,
|
|
2742
2771
|
rowIndex = _ref.rowIndex,
|
|
2743
|
-
|
|
2744
|
-
var getState =
|
|
2745
|
-
|
|
2746
|
-
editingMode =
|
|
2747
|
-
enableClickToCopy =
|
|
2748
|
-
enableColumnOrdering =
|
|
2749
|
-
enableEditing =
|
|
2750
|
-
enableRowNumbers =
|
|
2751
|
-
muiTableBodyCellProps =
|
|
2752
|
-
muiTableBodyCellSkeletonProps =
|
|
2753
|
-
rowNumberMode =
|
|
2754
|
-
tableId =
|
|
2755
|
-
setColumnOrder =
|
|
2756
|
-
setCurrentEditingCell =
|
|
2772
|
+
table = _ref.table;
|
|
2773
|
+
var getState = table.getState,
|
|
2774
|
+
_table$options = table.options,
|
|
2775
|
+
editingMode = _table$options.editingMode,
|
|
2776
|
+
enableClickToCopy = _table$options.enableClickToCopy,
|
|
2777
|
+
enableColumnOrdering = _table$options.enableColumnOrdering,
|
|
2778
|
+
enableEditing = _table$options.enableEditing,
|
|
2779
|
+
enableRowNumbers = _table$options.enableRowNumbers,
|
|
2780
|
+
muiTableBodyCellProps = _table$options.muiTableBodyCellProps,
|
|
2781
|
+
muiTableBodyCellSkeletonProps = _table$options.muiTableBodyCellSkeletonProps,
|
|
2782
|
+
rowNumberMode = _table$options.rowNumberMode,
|
|
2783
|
+
tableId = _table$options.tableId,
|
|
2784
|
+
setColumnOrder = table.setColumnOrder,
|
|
2785
|
+
setCurrentEditingCell = table.setCurrentEditingCell;
|
|
2757
2786
|
|
|
2758
2787
|
var _getState = getState(),
|
|
2759
2788
|
columnOrder = _getState.columnOrder,
|
|
@@ -2765,8 +2794,8 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2765
2794
|
|
|
2766
2795
|
var column = cell.column,
|
|
2767
2796
|
row = cell.row;
|
|
2768
|
-
var columnDef = column.columnDef
|
|
2769
|
-
|
|
2797
|
+
var columnDef = column.columnDef;
|
|
2798
|
+
var columnDefType = columnDef.columnDefType;
|
|
2770
2799
|
|
|
2771
2800
|
var _useDrop = useDrop({
|
|
2772
2801
|
accept: 'column',
|
|
@@ -2779,18 +2808,18 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2779
2808
|
|
|
2780
2809
|
var mTableCellBodyProps = muiTableBodyCellProps instanceof Function ? muiTableBodyCellProps({
|
|
2781
2810
|
cell: cell,
|
|
2782
|
-
|
|
2811
|
+
table: table
|
|
2783
2812
|
}) : muiTableBodyCellProps;
|
|
2784
2813
|
var mcTableCellBodyProps = columnDef.muiTableBodyCellProps instanceof Function ? columnDef.muiTableBodyCellProps({
|
|
2785
2814
|
cell: cell,
|
|
2786
|
-
|
|
2815
|
+
table: table
|
|
2787
2816
|
}) : columnDef.muiTableBodyCellProps;
|
|
2788
2817
|
|
|
2789
2818
|
var tableCellProps = _extends({}, mTableCellBodyProps, mcTableCellBodyProps);
|
|
2790
2819
|
|
|
2791
2820
|
var skeletonWidth = useMemo(function () {
|
|
2792
2821
|
return columnDefType === 'display' ? column.getSize() / 2 : Math.random() * (column.getSize() - column.getSize() / 3) + column.getSize() / 3;
|
|
2793
|
-
}, [
|
|
2822
|
+
}, []);
|
|
2794
2823
|
var isEditable = (enableEditing || columnDef.enableEditing) && columnDef.enableEditing !== false;
|
|
2795
2824
|
var isEditing = isEditable && (editingMode === 'table' || (currentEditingRow == null ? void 0 : currentEditingRow.id) === row.id || (currentEditingCell == null ? void 0 : currentEditingCell.id) === cell.id);
|
|
2796
2825
|
|
|
@@ -2809,7 +2838,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2809
2838
|
};
|
|
2810
2839
|
|
|
2811
2840
|
var getIsLastLeftPinnedColumn = function getIsLastLeftPinnedColumn() {
|
|
2812
|
-
return column.getIsPinned() === 'left' &&
|
|
2841
|
+
return column.getIsPinned() === 'left' && table.getLeftLeafHeaders().length - 1 === column.getPinnedIndex();
|
|
2813
2842
|
};
|
|
2814
2843
|
|
|
2815
2844
|
var getIsFirstRightPinnedColumn = function getIsFirstRightPinnedColumn() {
|
|
@@ -2817,7 +2846,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2817
2846
|
};
|
|
2818
2847
|
|
|
2819
2848
|
var getTotalRight = function getTotalRight() {
|
|
2820
|
-
return (
|
|
2849
|
+
return (table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 150;
|
|
2821
2850
|
};
|
|
2822
2851
|
|
|
2823
2852
|
return React.createElement(TableCell, Object.assign({
|
|
@@ -2850,46 +2879,43 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2850
2879
|
width: column.getSize()
|
|
2851
2880
|
});
|
|
2852
2881
|
}
|
|
2853
|
-
}), React.createElement(React.Fragment, null, isLoading || showSkeletons ? React.createElement(Skeleton, Object.assign({
|
|
2882
|
+
}), React.createElement(React.Fragment, null, cell.getIsPlaceholder() ? null : isLoading || showSkeletons ? React.createElement(Skeleton, Object.assign({
|
|
2854
2883
|
animation: "wave",
|
|
2855
2884
|
height: 20,
|
|
2856
2885
|
width: skeletonWidth
|
|
2857
2886
|
}, muiTableBodyCellSkeletonProps)) : enableRowNumbers && rowNumberMode === 'static' && column.id === 'mrt-row-numbers' ? rowIndex + 1 : columnDefType === 'display' ? columnDef.Cell == null ? void 0 : columnDef.Cell({
|
|
2858
2887
|
cell: cell,
|
|
2859
|
-
|
|
2860
|
-
}) :
|
|
2861
|
-
cell: cell,
|
|
2862
|
-
instance: instance
|
|
2863
|
-
})) != null ? _columnDef$Aggregated : cell.renderAggregatedCell() : isEditing ? React.createElement(MRT_EditCellTextField, {
|
|
2888
|
+
table: table
|
|
2889
|
+
}) : isEditing ? React.createElement(MRT_EditCellTextField, {
|
|
2864
2890
|
cell: cell,
|
|
2865
|
-
|
|
2891
|
+
table: table
|
|
2866
2892
|
}) : (enableClickToCopy || columnDef.enableClickToCopy) && columnDef.enableClickToCopy !== false ? React.createElement(React.Fragment, null, React.createElement(MRT_CopyButton, {
|
|
2867
2893
|
cell: cell,
|
|
2868
|
-
|
|
2894
|
+
table: table
|
|
2869
2895
|
}, React.createElement(React.Fragment, null, (_columnDef$Cell = columnDef == null ? void 0 : columnDef.Cell == null ? void 0 : columnDef.Cell({
|
|
2870
2896
|
cell: cell,
|
|
2871
|
-
|
|
2872
|
-
})) != null ? _columnDef$Cell : cell.
|
|
2897
|
+
table: table
|
|
2898
|
+
})) != null ? _columnDef$Cell : cell.renderValue())), cell.getIsGrouped() && React.createElement(React.Fragment, null, " (", (_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length, ")")) : React.createElement(React.Fragment, null, (_columnDef$Cell2 = columnDef == null ? void 0 : columnDef.Cell == null ? void 0 : columnDef.Cell({
|
|
2873
2899
|
cell: cell,
|
|
2874
|
-
|
|
2875
|
-
})) != null ? _columnDef$Cell2 : cell.
|
|
2900
|
+
table: table
|
|
2901
|
+
})) != null ? _columnDef$Cell2 : cell.renderValue(), cell.getIsGrouped() && React.createElement(React.Fragment, null, " (", (_row$subRows$length = (_row$subRows2 = row.subRows) == null ? void 0 : _row$subRows2.length) != null ? _row$subRows$length : '', ")"))));
|
|
2876
2902
|
};
|
|
2877
2903
|
|
|
2878
2904
|
var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
2879
2905
|
var row = _ref.row,
|
|
2880
|
-
|
|
2881
|
-
var getVisibleLeafColumns =
|
|
2882
|
-
|
|
2883
|
-
muiTableBodyRowProps =
|
|
2884
|
-
muiTableDetailPanelProps =
|
|
2885
|
-
renderDetailPanel =
|
|
2906
|
+
table = _ref.table;
|
|
2907
|
+
var getVisibleLeafColumns = table.getVisibleLeafColumns,
|
|
2908
|
+
_table$options = table.options,
|
|
2909
|
+
muiTableBodyRowProps = _table$options.muiTableBodyRowProps,
|
|
2910
|
+
muiTableDetailPanelProps = _table$options.muiTableDetailPanelProps,
|
|
2911
|
+
renderDetailPanel = _table$options.renderDetailPanel;
|
|
2886
2912
|
var tableRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps({
|
|
2887
2913
|
row: row,
|
|
2888
|
-
|
|
2914
|
+
table: table
|
|
2889
2915
|
}) : muiTableBodyRowProps;
|
|
2890
2916
|
var tableCellProps = muiTableDetailPanelProps instanceof Function ? muiTableDetailPanelProps({
|
|
2891
2917
|
row: row,
|
|
2892
|
-
|
|
2918
|
+
table: table
|
|
2893
2919
|
}) : muiTableDetailPanelProps;
|
|
2894
2920
|
return React.createElement(TableRow, Object.assign({}, tableRowProps), React.createElement(TableCell, Object.assign({
|
|
2895
2921
|
colSpan: getVisibleLeafColumns().length
|
|
@@ -2899,27 +2925,29 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
|
2899
2925
|
pb: row.getIsExpanded() ? '1rem' : 0,
|
|
2900
2926
|
pt: row.getIsExpanded() ? '1rem' : 0,
|
|
2901
2927
|
transition: 'all 0.2s ease-in-out',
|
|
2902
|
-
width:
|
|
2928
|
+
width: table.getTotalSize() + "px"
|
|
2903
2929
|
}, tableCellProps == null ? void 0 : tableCellProps.sx)
|
|
2904
2930
|
}), renderDetailPanel && React.createElement(Collapse, {
|
|
2905
2931
|
"in": row.getIsExpanded()
|
|
2906
2932
|
}, renderDetailPanel({
|
|
2907
2933
|
row: row,
|
|
2908
|
-
|
|
2934
|
+
table: table
|
|
2909
2935
|
}))));
|
|
2910
2936
|
};
|
|
2911
2937
|
|
|
2912
2938
|
var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
2939
|
+
var _row$getVisibleCells;
|
|
2940
|
+
|
|
2913
2941
|
var row = _ref.row,
|
|
2914
2942
|
rowIndex = _ref.rowIndex,
|
|
2915
|
-
|
|
2916
|
-
var getIsSomeColumnsPinned =
|
|
2917
|
-
|
|
2918
|
-
muiTableBodyRowProps =
|
|
2919
|
-
renderDetailPanel =
|
|
2943
|
+
table = _ref.table;
|
|
2944
|
+
var getIsSomeColumnsPinned = table.getIsSomeColumnsPinned,
|
|
2945
|
+
_table$options = table.options,
|
|
2946
|
+
muiTableBodyRowProps = _table$options.muiTableBodyRowProps,
|
|
2947
|
+
renderDetailPanel = _table$options.renderDetailPanel;
|
|
2920
2948
|
var tableRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps({
|
|
2921
2949
|
row: row,
|
|
2922
|
-
|
|
2950
|
+
table: table
|
|
2923
2951
|
}) : muiTableBodyRowProps;
|
|
2924
2952
|
return React.createElement(React.Fragment, null, React.createElement(TableRow, Object.assign({
|
|
2925
2953
|
hover: true,
|
|
@@ -2934,54 +2962,32 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
|
2934
2962
|
}
|
|
2935
2963
|
}, tableRowProps == null ? void 0 : tableRowProps.sx);
|
|
2936
2964
|
}
|
|
2937
|
-
}), row.getVisibleCells().map(function (cell) {
|
|
2965
|
+
}), row == null ? void 0 : (_row$getVisibleCells = row.getVisibleCells()) == null ? void 0 : _row$getVisibleCells.map == null ? void 0 : _row$getVisibleCells.map(function (cell) {
|
|
2938
2966
|
return React.createElement(MRT_TableBodyCell, {
|
|
2939
2967
|
cell: cell,
|
|
2940
2968
|
key: cell.id,
|
|
2941
2969
|
enableHover: (tableRowProps == null ? void 0 : tableRowProps.hover) !== false,
|
|
2942
2970
|
rowIndex: rowIndex,
|
|
2943
|
-
|
|
2971
|
+
table: table
|
|
2944
2972
|
});
|
|
2945
2973
|
})), renderDetailPanel && !row.getIsGrouped() && React.createElement(MRT_TableDetailPanel, {
|
|
2946
2974
|
row: row,
|
|
2947
|
-
|
|
2948
|
-
}));
|
|
2949
|
-
};
|
|
2950
|
-
|
|
2951
|
-
var fuzzy$1 = function fuzzy(rowA, rowB, columnId) {
|
|
2952
|
-
var dir = 0;
|
|
2953
|
-
|
|
2954
|
-
if (rowA.columnFiltersMeta[columnId]) {
|
|
2955
|
-
dir = compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
|
|
2956
|
-
} // Provide a fallback for when the item ranks are equal
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
return dir === 0 ? sortingFns.alphanumeric(rowA, rowB, columnId) : dir;
|
|
2960
|
-
};
|
|
2961
|
-
|
|
2962
|
-
var MRT_SortingFns = {
|
|
2963
|
-
fuzzy: fuzzy$1
|
|
2964
|
-
};
|
|
2965
|
-
var rankGlobalFuzzy = function rankGlobalFuzzy(rowA, rowB) {
|
|
2966
|
-
return Math.max.apply(Math, Object.values(rowB.columnFiltersMeta).map(function (v) {
|
|
2967
|
-
return v.rank;
|
|
2968
|
-
})) - Math.max.apply(Math, Object.values(rowA.columnFiltersMeta).map(function (v) {
|
|
2969
|
-
return v.rank;
|
|
2975
|
+
table: table
|
|
2970
2976
|
}));
|
|
2971
2977
|
};
|
|
2972
2978
|
|
|
2973
2979
|
var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
2974
|
-
var
|
|
2980
|
+
var table = _ref.table,
|
|
2975
2981
|
tableContainerRef = _ref.tableContainerRef;
|
|
2976
|
-
var getRowModel =
|
|
2977
|
-
getPrePaginationRowModel =
|
|
2978
|
-
getState =
|
|
2979
|
-
|
|
2980
|
-
enableGlobalFilterRankedResults =
|
|
2981
|
-
enablePagination =
|
|
2982
|
-
enableRowVirtualization =
|
|
2983
|
-
muiTableBodyProps =
|
|
2984
|
-
virtualizerProps =
|
|
2982
|
+
var getRowModel = table.getRowModel,
|
|
2983
|
+
getPrePaginationRowModel = table.getPrePaginationRowModel,
|
|
2984
|
+
getState = table.getState,
|
|
2985
|
+
_table$options = table.options,
|
|
2986
|
+
enableGlobalFilterRankedResults = _table$options.enableGlobalFilterRankedResults,
|
|
2987
|
+
enablePagination = _table$options.enablePagination,
|
|
2988
|
+
enableRowVirtualization = _table$options.enableRowVirtualization,
|
|
2989
|
+
muiTableBodyProps = _table$options.muiTableBodyProps,
|
|
2990
|
+
virtualizerProps = _table$options.virtualizerProps;
|
|
2985
2991
|
|
|
2986
2992
|
var _getState = getState(),
|
|
2987
2993
|
density = _getState.density,
|
|
@@ -2990,7 +2996,7 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
|
2990
2996
|
sorting = _getState.sorting;
|
|
2991
2997
|
|
|
2992
2998
|
var tableBodyProps = muiTableBodyProps instanceof Function ? muiTableBodyProps({
|
|
2993
|
-
|
|
2999
|
+
table: table
|
|
2994
3000
|
}) : muiTableBodyProps;
|
|
2995
3001
|
|
|
2996
3002
|
var getIsSomeColumnsSorted = function getIsSomeColumnsSorted() {
|
|
@@ -3030,7 +3036,7 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
|
3030
3036
|
key: row.id,
|
|
3031
3037
|
row: row,
|
|
3032
3038
|
rowIndex: enableRowVirtualization ? rowOrVirtualRow.index : rowIndex,
|
|
3033
|
-
|
|
3039
|
+
table: table
|
|
3034
3040
|
});
|
|
3035
3041
|
}), enableRowVirtualization && paddingBottom > 0 && React.createElement("tr", null, React.createElement("td", {
|
|
3036
3042
|
style: {
|
|
@@ -3040,28 +3046,28 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
|
3040
3046
|
};
|
|
3041
3047
|
|
|
3042
3048
|
var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
3043
|
-
var _ref2, _ref3
|
|
3049
|
+
var _ref2, _ref3;
|
|
3044
3050
|
|
|
3045
3051
|
var footer = _ref.footer,
|
|
3046
|
-
|
|
3047
|
-
var getState =
|
|
3048
|
-
|
|
3049
|
-
muiTableFooterCellProps =
|
|
3050
|
-
enableColumnResizing =
|
|
3052
|
+
table = _ref.table;
|
|
3053
|
+
var getState = table.getState,
|
|
3054
|
+
_table$options = table.options,
|
|
3055
|
+
muiTableFooterCellProps = _table$options.muiTableFooterCellProps,
|
|
3056
|
+
enableColumnResizing = _table$options.enableColumnResizing;
|
|
3051
3057
|
|
|
3052
3058
|
var _getState = getState(),
|
|
3053
3059
|
density = _getState.density;
|
|
3054
3060
|
|
|
3055
3061
|
var column = footer.column;
|
|
3056
|
-
var columnDef = column.columnDef
|
|
3057
|
-
|
|
3062
|
+
var columnDef = column.columnDef;
|
|
3063
|
+
var columnDefType = columnDef.columnDefType;
|
|
3058
3064
|
var mTableFooterCellProps = muiTableFooterCellProps instanceof Function ? muiTableFooterCellProps({
|
|
3059
3065
|
column: column,
|
|
3060
|
-
|
|
3066
|
+
table: table
|
|
3061
3067
|
}) : muiTableFooterCellProps;
|
|
3062
3068
|
var mcTableFooterCellProps = columnDef.muiTableFooterCellProps instanceof Function ? columnDef.muiTableFooterCellProps({
|
|
3063
3069
|
column: column,
|
|
3064
|
-
|
|
3070
|
+
table: table
|
|
3065
3071
|
}) : columnDef.muiTableFooterCellProps;
|
|
3066
3072
|
|
|
3067
3073
|
var tableCellProps = _extends({}, mTableFooterCellProps, mcTableFooterCellProps);
|
|
@@ -3084,68 +3090,68 @@ var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
|
3084
3090
|
verticalAlign: 'text-top'
|
|
3085
3091
|
}, tableCellProps == null ? void 0 : tableCellProps.sx);
|
|
3086
3092
|
}
|
|
3087
|
-
}), React.createElement(React.Fragment, null, footer.isPlaceholder ? null : (_ref2 = (_ref3 =
|
|
3093
|
+
}), React.createElement(React.Fragment, null, footer.isPlaceholder ? null : (_ref2 = (_ref3 = columnDef.Footer instanceof Function ? columnDef.Footer == null ? void 0 : columnDef.Footer({
|
|
3088
3094
|
footer: footer,
|
|
3089
|
-
|
|
3090
|
-
}) : columnDef.Footer) != null ?
|
|
3095
|
+
table: table
|
|
3096
|
+
}) : columnDef.Footer) != null ? _ref3 : columnDef.footer) != null ? _ref2 : null));
|
|
3091
3097
|
};
|
|
3092
3098
|
|
|
3093
3099
|
var MRT_TableFooterRow = function MRT_TableFooterRow(_ref) {
|
|
3094
3100
|
var _footerGroup$headers;
|
|
3095
3101
|
|
|
3096
3102
|
var footerGroup = _ref.footerGroup,
|
|
3097
|
-
|
|
3098
|
-
var muiTableFooterRowProps =
|
|
3103
|
+
table = _ref.table;
|
|
3104
|
+
var muiTableFooterRowProps = table.options.muiTableFooterRowProps; // if no content in row, skip row
|
|
3099
3105
|
|
|
3100
3106
|
if (!((_footerGroup$headers = footerGroup.headers) != null && _footerGroup$headers.some(function (header) {
|
|
3101
3107
|
return typeof header.column.columnDef.footer === 'string' && !!header.column.columnDef.footer || header.column.columnDef.Footer;
|
|
3102
3108
|
}))) return null;
|
|
3103
3109
|
var tableRowProps = muiTableFooterRowProps instanceof Function ? muiTableFooterRowProps({
|
|
3104
3110
|
footerGroup: footerGroup,
|
|
3105
|
-
|
|
3111
|
+
table: table
|
|
3106
3112
|
}) : muiTableFooterRowProps;
|
|
3107
3113
|
return React.createElement(TableRow, Object.assign({}, tableRowProps), footerGroup.headers.map(function (footer) {
|
|
3108
3114
|
return React.createElement(MRT_TableFooterCell, {
|
|
3109
3115
|
footer: footer,
|
|
3110
3116
|
key: footer.id,
|
|
3111
|
-
|
|
3117
|
+
table: table
|
|
3112
3118
|
});
|
|
3113
3119
|
}));
|
|
3114
3120
|
};
|
|
3115
3121
|
|
|
3116
3122
|
var MRT_TableFooter = function MRT_TableFooter(_ref) {
|
|
3117
|
-
var
|
|
3118
|
-
var getFooterGroups =
|
|
3119
|
-
muiTableFooterProps =
|
|
3123
|
+
var table = _ref.table;
|
|
3124
|
+
var getFooterGroups = table.getFooterGroups,
|
|
3125
|
+
muiTableFooterProps = table.options.muiTableFooterProps;
|
|
3120
3126
|
var tableFooterProps = muiTableFooterProps instanceof Function ? muiTableFooterProps({
|
|
3121
|
-
|
|
3127
|
+
table: table
|
|
3122
3128
|
}) : muiTableFooterProps;
|
|
3123
3129
|
return React.createElement(TableFooter, Object.assign({}, tableFooterProps), getFooterGroups().map(function (footerGroup) {
|
|
3124
3130
|
return React.createElement(MRT_TableFooterRow, {
|
|
3125
3131
|
footerGroup: footerGroup,
|
|
3126
3132
|
key: footerGroup.id,
|
|
3127
|
-
|
|
3133
|
+
table: table
|
|
3128
3134
|
});
|
|
3129
3135
|
}));
|
|
3130
3136
|
};
|
|
3131
3137
|
|
|
3132
3138
|
var MRT_Table = function MRT_Table(_ref) {
|
|
3133
3139
|
var tableContainerRef = _ref.tableContainerRef,
|
|
3134
|
-
|
|
3135
|
-
var getState =
|
|
3136
|
-
|
|
3137
|
-
enableColumnResizing =
|
|
3138
|
-
enableRowVirtualization =
|
|
3139
|
-
enableStickyHeader =
|
|
3140
|
-
enableTableFooter =
|
|
3141
|
-
enableTableHead =
|
|
3142
|
-
muiTableProps =
|
|
3140
|
+
table = _ref.table;
|
|
3141
|
+
var getState = table.getState,
|
|
3142
|
+
_table$options = table.options,
|
|
3143
|
+
enableColumnResizing = _table$options.enableColumnResizing,
|
|
3144
|
+
enableRowVirtualization = _table$options.enableRowVirtualization,
|
|
3145
|
+
enableStickyHeader = _table$options.enableStickyHeader,
|
|
3146
|
+
enableTableFooter = _table$options.enableTableFooter,
|
|
3147
|
+
enableTableHead = _table$options.enableTableHead,
|
|
3148
|
+
muiTableProps = _table$options.muiTableProps;
|
|
3143
3149
|
|
|
3144
3150
|
var _getState = getState(),
|
|
3145
3151
|
isFullScreen = _getState.isFullScreen;
|
|
3146
3152
|
|
|
3147
3153
|
var tableProps = muiTableProps instanceof Function ? muiTableProps({
|
|
3148
|
-
|
|
3154
|
+
table: table
|
|
3149
3155
|
}) : muiTableProps;
|
|
3150
3156
|
return React.createElement(Table, Object.assign({
|
|
3151
3157
|
stickyHeader: enableStickyHeader || enableRowVirtualization || isFullScreen
|
|
@@ -3154,24 +3160,24 @@ var MRT_Table = function MRT_Table(_ref) {
|
|
|
3154
3160
|
tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto'
|
|
3155
3161
|
}, tableProps == null ? void 0 : tableProps.sx)
|
|
3156
3162
|
}), enableTableHead && React.createElement(MRT_TableHead, {
|
|
3157
|
-
|
|
3163
|
+
table: table
|
|
3158
3164
|
}), React.createElement(MRT_TableBody, {
|
|
3159
3165
|
tableContainerRef: tableContainerRef,
|
|
3160
|
-
|
|
3166
|
+
table: table
|
|
3161
3167
|
}), enableTableFooter && React.createElement(MRT_TableFooter, {
|
|
3162
|
-
|
|
3168
|
+
table: table
|
|
3163
3169
|
}));
|
|
3164
3170
|
};
|
|
3165
3171
|
|
|
3166
3172
|
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
3167
3173
|
var MRT_TableContainer = function MRT_TableContainer(_ref) {
|
|
3168
|
-
var
|
|
3169
|
-
var getState =
|
|
3170
|
-
|
|
3171
|
-
enableStickyHeader =
|
|
3172
|
-
enableRowVirtualization =
|
|
3173
|
-
muiTableContainerProps =
|
|
3174
|
-
tableId =
|
|
3174
|
+
var table = _ref.table;
|
|
3175
|
+
var getState = table.getState,
|
|
3176
|
+
_table$options = table.options,
|
|
3177
|
+
enableStickyHeader = _table$options.enableStickyHeader,
|
|
3178
|
+
enableRowVirtualization = _table$options.enableRowVirtualization,
|
|
3179
|
+
muiTableContainerProps = _table$options.muiTableContainerProps,
|
|
3180
|
+
tableId = _table$options.tableId;
|
|
3175
3181
|
|
|
3176
3182
|
var _getState = getState(),
|
|
3177
3183
|
isFullScreen = _getState.isFullScreen;
|
|
@@ -3181,7 +3187,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref) {
|
|
|
3181
3187
|
setTotalToolbarHeight = _useState[1];
|
|
3182
3188
|
|
|
3183
3189
|
var tableContainerProps = muiTableContainerProps instanceof Function ? muiTableContainerProps({
|
|
3184
|
-
|
|
3190
|
+
table: table
|
|
3185
3191
|
}) : muiTableContainerProps;
|
|
3186
3192
|
useIsomorphicLayoutEffect(function () {
|
|
3187
3193
|
var _document$getElementB, _document, _document$getElementB2, _document$getElementB3, _document2, _document2$getElement;
|
|
@@ -3203,17 +3209,17 @@ var MRT_TableContainer = function MRT_TableContainer(_ref) {
|
|
|
3203
3209
|
}, tableContainerProps == null ? void 0 : tableContainerProps.style)
|
|
3204
3210
|
}), React.createElement(MRT_Table, {
|
|
3205
3211
|
tableContainerRef: tableContainerRef,
|
|
3206
|
-
|
|
3212
|
+
table: table
|
|
3207
3213
|
}));
|
|
3208
3214
|
};
|
|
3209
3215
|
|
|
3210
3216
|
var MRT_TablePaper = function MRT_TablePaper(_ref) {
|
|
3211
|
-
var
|
|
3212
|
-
var getState =
|
|
3213
|
-
|
|
3214
|
-
enableToolbarBottom =
|
|
3215
|
-
enableToolbarTop =
|
|
3216
|
-
muiTablePaperProps =
|
|
3217
|
+
var table = _ref.table;
|
|
3218
|
+
var getState = table.getState,
|
|
3219
|
+
_table$options = table.options,
|
|
3220
|
+
enableToolbarBottom = _table$options.enableToolbarBottom,
|
|
3221
|
+
enableToolbarTop = _table$options.enableToolbarTop,
|
|
3222
|
+
muiTablePaperProps = _table$options.muiTablePaperProps;
|
|
3217
3223
|
|
|
3218
3224
|
var _getState = getState(),
|
|
3219
3225
|
isFullScreen = _getState.isFullScreen;
|
|
@@ -3228,7 +3234,7 @@ var MRT_TablePaper = function MRT_TablePaper(_ref) {
|
|
|
3228
3234
|
}
|
|
3229
3235
|
}, [isFullScreen]);
|
|
3230
3236
|
var tablePaperProps = muiTablePaperProps instanceof Function ? muiTablePaperProps({
|
|
3231
|
-
|
|
3237
|
+
table: table
|
|
3232
3238
|
}) : muiTablePaperProps;
|
|
3233
3239
|
return React.createElement(DndProvider, {
|
|
3234
3240
|
backend: HTML5Backend
|
|
@@ -3247,16 +3253,16 @@ var MRT_TablePaper = function MRT_TablePaper(_ref) {
|
|
|
3247
3253
|
width: isFullScreen ? '100vw' : undefined
|
|
3248
3254
|
})
|
|
3249
3255
|
}), enableToolbarTop && React.createElement(MRT_ToolbarTop, {
|
|
3250
|
-
|
|
3256
|
+
table: table
|
|
3251
3257
|
}), React.createElement(MRT_TableContainer, {
|
|
3252
|
-
|
|
3258
|
+
table: table
|
|
3253
3259
|
}), enableToolbarBottom && React.createElement(MRT_ToolbarBottom, {
|
|
3254
|
-
|
|
3260
|
+
table: table
|
|
3255
3261
|
})));
|
|
3256
3262
|
};
|
|
3257
3263
|
|
|
3258
3264
|
var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
3259
|
-
var _initialState$columnO, _initialState$current, _initialState$current2, _initialState$density, _initialState$isFullS, _props$initialState$s, _props$initialState2, _initialState$showFil, _initialState$showGlo, _props$
|
|
3265
|
+
var _initialState$columnO, _initialState$current, _initialState$current2, _initialState$density, _initialState$isFullS, _props$initialState$s, _props$initialState2, _initialState$showFil, _initialState$showGlo, _props$state3, _props$state4, _MRT_FilterFns$curren, _props$onCurrentEditi, _props$onCurrentEditi2, _props$onCurrentFilte, _props$onCurrentGloba, _props$onDensityChang, _props$onIsFullScreen, _props$onShowAlertBan, _props$onShowFiltersC, _props$onShowGlobalFi;
|
|
3260
3266
|
|
|
3261
3267
|
var _useState = useState(props.tableId),
|
|
3262
3268
|
tableId = _useState[0],
|
|
@@ -3308,90 +3314,78 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3308
3314
|
setShowGlobalFilter = _useState9[1];
|
|
3309
3315
|
|
|
3310
3316
|
var _useState10 = useState(function () {
|
|
3311
|
-
return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (
|
|
3312
|
-
var _ref,
|
|
3317
|
+
return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (col) {
|
|
3318
|
+
var _ref, _col$id$toString, _col$id, _col$accessorKey, _col$filterFn$name, _ref2, _col$filterFn, _initialState$current3, _ref3, _col$id$toString2, _col$id2, _col$accessorKey2, _col$filterSelectOpti, _ref4;
|
|
3313
3319
|
|
|
3314
|
-
return
|
|
3320
|
+
return _ref4 = {}, _ref4[(_ref = (_col$id$toString = (_col$id = col.id) == null ? void 0 : _col$id.toString()) != null ? _col$id$toString : (_col$accessorKey = col.accessorKey) == null ? void 0 : _col$accessorKey.toString()) != null ? _ref : ''] = col.filterFn instanceof Function ? (_col$filterFn$name = col.filterFn.name) != null ? _col$filterFn$name : 'custom' : (_ref2 = (_col$filterFn = col.filterFn) != null ? _col$filterFn : initialState == null ? void 0 : (_initialState$current3 = initialState.currentFilterFns) == null ? void 0 : _initialState$current3[(_ref3 = (_col$id$toString2 = (_col$id2 = col.id) == null ? void 0 : _col$id2.toString()) != null ? _col$id$toString2 : (_col$accessorKey2 = col.accessorKey) == null ? void 0 : _col$accessorKey2.toString()) != null ? _ref3 : '']) != null ? _ref2 : !!((_col$filterSelectOpti = col.filterSelectOptions) != null && _col$filterSelectOpti.length) ? 'equals' : 'fuzzy', _ref4;
|
|
3315
3321
|
})));
|
|
3316
3322
|
}),
|
|
3317
3323
|
currentFilterFns = _useState10[0],
|
|
3318
3324
|
setCurrentFilterFns = _useState10[1];
|
|
3319
3325
|
|
|
3320
|
-
var _useState11 = useState(
|
|
3326
|
+
var _useState11 = useState(props.globalFilterFn instanceof String ? props.globalFilterFn : 'fuzzy'),
|
|
3321
3327
|
currentGlobalFilterFn = _useState11[0],
|
|
3322
3328
|
setCurrentGlobalFilterFn = _useState11[1];
|
|
3323
3329
|
|
|
3324
|
-
var table = useMemo(function () {
|
|
3325
|
-
return (// @ts-ignore
|
|
3326
|
-
createTable().setOptions({
|
|
3327
|
-
filterFns: _extends({}, filterFns, MRT_FilterFns, props.filterFns),
|
|
3328
|
-
getCoreRowModel: getCoreRowModel(),
|
|
3329
|
-
getExpandedRowModel: getExpandedRowModel(),
|
|
3330
|
-
getFacetedRowModel: getFacetedRowModel(),
|
|
3331
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
3332
|
-
getGroupedRowModel: getGroupedRowModel(),
|
|
3333
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
3334
|
-
getSortedRowModel: getSortedRowModel(),
|
|
3335
|
-
sortingFns: _extends({}, sortingFns, MRT_SortingFns, props.sortingFns)
|
|
3336
|
-
})
|
|
3337
|
-
);
|
|
3338
|
-
}, []);
|
|
3339
3330
|
var displayColumns = useMemo(function () {
|
|
3340
3331
|
var _props$localization, _props$localization2, _props$localization3, _props$localization5;
|
|
3341
3332
|
|
|
3342
|
-
return [columnOrder.includes('mrt-row-actions') &&
|
|
3343
|
-
Cell: function Cell(
|
|
3344
|
-
var cell =
|
|
3333
|
+
return [columnOrder.includes('mrt-row-actions') && {
|
|
3334
|
+
Cell: function Cell(_ref5) {
|
|
3335
|
+
var cell = _ref5.cell;
|
|
3345
3336
|
return React.createElement(MRT_ToggleRowActionMenuButton, {
|
|
3346
3337
|
row: cell.row,
|
|
3347
|
-
|
|
3338
|
+
table: table
|
|
3348
3339
|
});
|
|
3349
3340
|
},
|
|
3341
|
+
columnDefType: 'display',
|
|
3350
3342
|
header: (_props$localization = props.localization) == null ? void 0 : _props$localization.actions,
|
|
3351
3343
|
id: 'mrt-row-actions',
|
|
3352
3344
|
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
|
3353
3345
|
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
|
3354
3346
|
size: 70
|
|
3355
|
-
}
|
|
3356
|
-
Cell: function Cell(
|
|
3357
|
-
var cell =
|
|
3347
|
+
}, columnOrder.includes('mrt-expand') && {
|
|
3348
|
+
Cell: function Cell(_ref6) {
|
|
3349
|
+
var cell = _ref6.cell;
|
|
3358
3350
|
return React.createElement(MRT_ExpandButton, {
|
|
3359
3351
|
row: cell.row,
|
|
3360
|
-
|
|
3352
|
+
table: table
|
|
3361
3353
|
});
|
|
3362
3354
|
},
|
|
3363
3355
|
Header: function Header() {
|
|
3364
3356
|
return props.enableExpandAll ? React.createElement(MRT_ExpandAllButton, {
|
|
3365
|
-
|
|
3357
|
+
table: table
|
|
3366
3358
|
}) : null;
|
|
3367
3359
|
},
|
|
3360
|
+
columnDefType: 'display',
|
|
3368
3361
|
header: (_props$localization2 = props.localization) == null ? void 0 : _props$localization2.expand,
|
|
3369
3362
|
id: 'mrt-expand',
|
|
3370
3363
|
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
|
3371
3364
|
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
|
3372
3365
|
size: 60
|
|
3373
|
-
}
|
|
3374
|
-
Cell: function Cell(
|
|
3375
|
-
var cell =
|
|
3366
|
+
}, columnOrder.includes('mrt-select') && {
|
|
3367
|
+
Cell: function Cell(_ref7) {
|
|
3368
|
+
var cell = _ref7.cell;
|
|
3376
3369
|
return React.createElement(MRT_SelectCheckbox, {
|
|
3377
3370
|
row: cell.row,
|
|
3378
|
-
|
|
3371
|
+
table: table
|
|
3379
3372
|
});
|
|
3380
3373
|
},
|
|
3381
3374
|
Header: function Header() {
|
|
3382
3375
|
return props.enableSelectAll ? React.createElement(MRT_SelectCheckbox, {
|
|
3383
3376
|
selectAll: true,
|
|
3384
|
-
|
|
3377
|
+
table: table
|
|
3385
3378
|
}) : null;
|
|
3386
3379
|
},
|
|
3380
|
+
columnDefType: 'display',
|
|
3387
3381
|
header: (_props$localization3 = props.localization) == null ? void 0 : _props$localization3.select,
|
|
3388
3382
|
id: 'mrt-select',
|
|
3389
3383
|
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
|
3390
3384
|
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
|
3391
3385
|
size: 60
|
|
3392
|
-
}
|
|
3393
|
-
Cell: function Cell(
|
|
3394
|
-
var cell =
|
|
3386
|
+
}, columnOrder.includes('mrt-row-numbers') && {
|
|
3387
|
+
Cell: function Cell(_ref8) {
|
|
3388
|
+
var cell = _ref8.cell;
|
|
3395
3389
|
return cell.row.index + 1;
|
|
3396
3390
|
},
|
|
3397
3391
|
Header: function Header() {
|
|
@@ -3399,41 +3393,47 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3399
3393
|
|
|
3400
3394
|
return (_props$localization4 = props.localization) == null ? void 0 : _props$localization4.rowNumber;
|
|
3401
3395
|
},
|
|
3396
|
+
columnDefType: 'display',
|
|
3402
3397
|
header: (_props$localization5 = props.localization) == null ? void 0 : _props$localization5.rowNumbers,
|
|
3403
3398
|
id: 'mrt-row-numbers',
|
|
3404
3399
|
muiTableBodyCellProps: props.muiTableBodyCellProps,
|
|
3405
3400
|
muiTableHeadCellProps: props.muiTableHeadCellProps,
|
|
3406
3401
|
size: 60
|
|
3407
|
-
}
|
|
3408
|
-
}, [columnOrder, props.editingMode, props.enableEditing, props.enableExpandAll, props.enableExpanding, props.enableGrouping, props.enableRowActions, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization, props.muiTableBodyCellProps, props.muiTableHeadCellProps, props.positionActionsColumn
|
|
3409
|
-
var
|
|
3410
|
-
return [].concat(displayColumns, props.columns
|
|
3411
|
-
|
|
3412
|
-
}));
|
|
3413
|
-
}, [table, props.columns, currentFilterFns]);
|
|
3402
|
+
}].filter(Boolean);
|
|
3403
|
+
}, [columnOrder, props.editingMode, props.enableEditing, props.enableExpandAll, props.enableExpanding, props.enableGrouping, props.enableRowActions, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization, props.muiTableBodyCellProps, props.muiTableHeadCellProps, props.positionActionsColumn]);
|
|
3404
|
+
var columnDefs = useMemo(function () {
|
|
3405
|
+
return prepareColumns([].concat(displayColumns, props.columns), currentFilterFns);
|
|
3406
|
+
}, [currentFilterFns, displayColumns, props.columns]);
|
|
3414
3407
|
var data = useMemo(function () {
|
|
3415
3408
|
var _props$state, _props$state2;
|
|
3416
3409
|
|
|
3417
3410
|
return ((_props$state = props.state) != null && _props$state.isLoading || (_props$state2 = props.state) != null && _props$state2.showSkeletons) && !props.data.length ? [].concat(Array(10).fill(null)).map(function () {
|
|
3418
|
-
return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (
|
|
3419
|
-
var
|
|
3411
|
+
return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (col) {
|
|
3412
|
+
var _ref9, _col$id3, _ref10;
|
|
3420
3413
|
|
|
3421
|
-
return
|
|
3414
|
+
return _ref10 = {}, _ref10[(_ref9 = (_col$id3 = col.id) != null ? _col$id3 : col.accessorKey) != null ? _ref9 : ''] = null, _ref10;
|
|
3422
3415
|
})));
|
|
3423
3416
|
}) : props.data;
|
|
3424
3417
|
}, [props.data, (_props$state3 = props.state) == null ? void 0 : _props$state3.isLoading, (_props$state4 = props.state) == null ? void 0 : _props$state4.showSkeletons]); //@ts-ignore
|
|
3425
3418
|
|
|
3426
|
-
var
|
|
3419
|
+
var table = _extends({}, useReactTable(_extends({
|
|
3420
|
+
getCoreRowModel: getCoreRowModel(),
|
|
3421
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
3422
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
3423
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
3424
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
3425
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
3426
|
+
getSortedRowModel: getSortedRowModel(),
|
|
3427
3427
|
onColumnOrderChange: setColumnOrder
|
|
3428
3428
|
}, props, {
|
|
3429
3429
|
//@ts-ignore
|
|
3430
|
-
columns:
|
|
3430
|
+
columns: columnDefs,
|
|
3431
3431
|
data: data,
|
|
3432
3432
|
getSubRows: function getSubRows(row) {
|
|
3433
3433
|
return row == null ? void 0 : row.subRows;
|
|
3434
3434
|
},
|
|
3435
3435
|
//@ts-ignore
|
|
3436
|
-
globalFilterFn: currentGlobalFilterFn,
|
|
3436
|
+
globalFilterFn: (_MRT_FilterFns$curren = MRT_FilterFns[currentGlobalFilterFn]) != null ? _MRT_FilterFns$curren : MRT_FilterFns.fuzzy,
|
|
3437
3437
|
initialState: initialState,
|
|
3438
3438
|
state: _extends({
|
|
3439
3439
|
columnOrder: columnOrder,
|
|
@@ -3472,9 +3472,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3472
3472
|
open: isFullScreen,
|
|
3473
3473
|
transitionDuration: 400
|
|
3474
3474
|
}, React.createElement(MRT_TablePaper, {
|
|
3475
|
-
|
|
3475
|
+
table: table
|
|
3476
3476
|
})), !isFullScreen && React.createElement(MRT_TablePaper, {
|
|
3477
|
-
|
|
3477
|
+
table: table
|
|
3478
3478
|
}));
|
|
3479
3479
|
};
|
|
3480
3480
|
|