material-react-table-narender 2.13.4 → 2.13.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.esm.js +34 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -525,6 +525,7 @@ const openEditingCell = ({ cell, table, }) => {
|
|
525
525
|
};
|
526
526
|
const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement, event, header, parentElement, table, }) => {
|
527
527
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
528
|
+
debugger;
|
528
529
|
if (!table.options.enableKeyboardShortcuts)
|
529
530
|
return;
|
530
531
|
if (event.isPropagationStopped())
|
@@ -2307,7 +2308,17 @@ const MRT_TableBodyCell = (_a) => {
|
|
2307
2308
|
table.refs.actionCellRef.current = e.currentTarget;
|
2308
2309
|
}
|
2309
2310
|
};
|
2310
|
-
|
2311
|
+
const handleKeyDown = (event) => {
|
2312
|
+
var _a;
|
2313
|
+
(_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
|
2314
|
+
cellKeyboardShortcuts({
|
2315
|
+
cell,
|
2316
|
+
cellValue: cell.getValue(),
|
2317
|
+
event,
|
2318
|
+
table,
|
2319
|
+
});
|
2320
|
+
};
|
2321
|
+
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ align: theme.direction === 'rtl' ? 'right' : 'left', "data-index": staticColumnIndex, "data-pinned": !!isColumnPinned || undefined, tabIndex: enableKeyboardShortcuts ? 0 : undefined }, tableCellProps, { onKeyDown: handleKeyDown, onContextMenu: handleContextMenu, onDoubleClick: handleDoubleClick, onDragEnter: handleDragEnter, onDragOver: handleDragOver, sx: (theme) => (Object.assign(Object.assign({ '&:hover': {
|
2311
2322
|
outline: (actionCell === null || actionCell === void 0 ? void 0 : actionCell.id) === cell.id ||
|
2312
2323
|
(editDisplayMode === 'cell' && isEditable) ||
|
2313
2324
|
(editDisplayMode === 'table' && (isCreating || isEditing))
|
@@ -2577,11 +2588,20 @@ const MRT_TableFooterCell = (_a) => {
|
|
2577
2588
|
column.getIsPinned();
|
2578
2589
|
const args = { column, table };
|
2579
2590
|
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, args)), rest);
|
2591
|
+
const handleKeyDown = (event) => {
|
2592
|
+
var _a;
|
2593
|
+
(_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
|
2594
|
+
cellKeyboardShortcuts({
|
2595
|
+
event,
|
2596
|
+
cellValue: footer.column.columnDef.footer,
|
2597
|
+
table,
|
2598
|
+
});
|
2599
|
+
};
|
2580
2600
|
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ align: columnDefType === 'group'
|
2581
2601
|
? 'center'
|
2582
2602
|
: theme.direction === 'rtl'
|
2583
2603
|
? 'right'
|
2584
|
-
: 'left', colSpan: footer.colSpan, "data-index": staticColumnIndex, "data-pinned": !!isColumnPinned || undefined, tabIndex: enableKeyboardShortcuts ? 0 : undefined, variant: "footer" }, tableCellProps, { sx: (theme) => (Object.assign(Object.assign({ fontWeight: 'bold', p: density === 'compact'
|
2604
|
+
: 'left', colSpan: footer.colSpan, "data-index": staticColumnIndex, "data-pinned": !!isColumnPinned || undefined, tabIndex: enableKeyboardShortcuts ? 0 : undefined, variant: "footer" }, tableCellProps, { onKeyDown: handleKeyDown, sx: (theme) => (Object.assign(Object.assign({ fontWeight: 'bold', p: density === 'compact'
|
2585
2605
|
? '0.5rem'
|
2586
2606
|
: density === 'comfortable'
|
2587
2607
|
? '1rem'
|
@@ -3566,6 +3586,16 @@ const MRT_TableHeadCell = (_a) => {
|
|
3566
3586
|
e.preventDefault();
|
3567
3587
|
}
|
3568
3588
|
};
|
3589
|
+
const handleKeyDown = (event) => {
|
3590
|
+
var _a;
|
3591
|
+
(_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
|
3592
|
+
cellKeyboardShortcuts({
|
3593
|
+
event,
|
3594
|
+
cellValue: header.column.columnDef.header,
|
3595
|
+
table,
|
3596
|
+
header,
|
3597
|
+
});
|
3598
|
+
};
|
3569
3599
|
const HeaderElement = (_b = parseFromValuesOrFunc(columnDef.Header, {
|
3570
3600
|
column,
|
3571
3601
|
header,
|
@@ -3587,7 +3617,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
3587
3617
|
(_a = columnVirtualizer === null || columnVirtualizer === void 0 ? void 0 : columnVirtualizer.measureElement) === null || _a === void 0 ? void 0 : _a.call(columnVirtualizer, node);
|
3588
3618
|
}
|
3589
3619
|
}
|
3590
|
-
} }, tableCellProps, { sx: (theme) => (Object.assign(Object.assign({ '& :hover': {
|
3620
|
+
} }, tableCellProps, { onKeyDown: handleKeyDown, sx: (theme) => (Object.assign(Object.assign({ '& :hover': {
|
3591
3621
|
'.MuiButtonBase-root': {
|
3592
3622
|
opacity: 1,
|
3593
3623
|
},
|
@@ -4365,6 +4395,7 @@ const MRT_TablePaper = (_a) => {
|
|
4365
4395
|
const isTableInstanceProp = (props) => props.table !== undefined;
|
4366
4396
|
const MaterialReactTable = (props) => {
|
4367
4397
|
let table;
|
4398
|
+
debugger;
|
4368
4399
|
if (isTableInstanceProp(props)) {
|
4369
4400
|
table = props.table;
|
4370
4401
|
}
|