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 CHANGED
@@ -435,6 +435,7 @@ const openEditingCell = ({ cell, table, }) => {
435
435
  };
436
436
  const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement, event, header, parentElement, table, }) => {
437
437
  var _a, _b, _c, _d, _e, _f, _g, _h;
438
+ debugger;
438
439
  if (!table.options.enableKeyboardShortcuts)
439
440
  return;
440
441
  if (event.isPropagationStopped())
@@ -2217,7 +2218,17 @@ const MRT_TableBodyCell = (_a) => {
2217
2218
  table.refs.actionCellRef.current = e.currentTarget;
2218
2219
  }
2219
2220
  };
2220
- return (jsx(TableCell, Object.assign({ align: theme.direction === 'rtl' ? 'right' : 'left', "data-index": staticColumnIndex, "data-pinned": !!isColumnPinned || undefined, tabIndex: enableKeyboardShortcuts ? 0 : undefined }, tableCellProps, { onContextMenu: handleContextMenu, onDoubleClick: handleDoubleClick, onDragEnter: handleDragEnter, onDragOver: handleDragOver, sx: (theme) => (Object.assign(Object.assign({ '&:hover': {
2221
+ const handleKeyDown = (event) => {
2222
+ var _a;
2223
+ (_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
2224
+ cellKeyboardShortcuts({
2225
+ cell,
2226
+ cellValue: cell.getValue(),
2227
+ event,
2228
+ table,
2229
+ });
2230
+ };
2231
+ return (jsx(TableCell, 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': {
2221
2232
  outline: (actionCell === null || actionCell === void 0 ? void 0 : actionCell.id) === cell.id ||
2222
2233
  (editDisplayMode === 'cell' && isEditable) ||
2223
2234
  (editDisplayMode === 'table' && (isCreating || isEditing))
@@ -2487,11 +2498,20 @@ const MRT_TableFooterCell = (_a) => {
2487
2498
  column.getIsPinned();
2488
2499
  const args = { column, table };
2489
2500
  const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, args)), rest);
2501
+ const handleKeyDown = (event) => {
2502
+ var _a;
2503
+ (_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
2504
+ cellKeyboardShortcuts({
2505
+ event,
2506
+ cellValue: footer.column.columnDef.footer,
2507
+ table,
2508
+ });
2509
+ };
2490
2510
  return (jsx(TableCell, Object.assign({ align: columnDefType === 'group'
2491
2511
  ? 'center'
2492
2512
  : theme.direction === 'rtl'
2493
2513
  ? 'right'
2494
- : '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'
2514
+ : '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'
2495
2515
  ? '0.5rem'
2496
2516
  : density === 'comfortable'
2497
2517
  ? '1rem'
@@ -3476,6 +3496,16 @@ const MRT_TableHeadCell = (_a) => {
3476
3496
  e.preventDefault();
3477
3497
  }
3478
3498
  };
3499
+ const handleKeyDown = (event) => {
3500
+ var _a;
3501
+ (_a = tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(tableCellProps, event);
3502
+ cellKeyboardShortcuts({
3503
+ event,
3504
+ cellValue: header.column.columnDef.header,
3505
+ table,
3506
+ header,
3507
+ });
3508
+ };
3479
3509
  const HeaderElement = (_b = parseFromValuesOrFunc(columnDef.Header, {
3480
3510
  column,
3481
3511
  header,
@@ -3497,7 +3527,7 @@ const MRT_TableHeadCell = (_a) => {
3497
3527
  (_a = columnVirtualizer === null || columnVirtualizer === void 0 ? void 0 : columnVirtualizer.measureElement) === null || _a === void 0 ? void 0 : _a.call(columnVirtualizer, node);
3498
3528
  }
3499
3529
  }
3500
- } }, tableCellProps, { sx: (theme) => (Object.assign(Object.assign({ '& :hover': {
3530
+ } }, tableCellProps, { onKeyDown: handleKeyDown, sx: (theme) => (Object.assign(Object.assign({ '& :hover': {
3501
3531
  '.MuiButtonBase-root': {
3502
3532
  opacity: 1,
3503
3533
  },
@@ -4275,6 +4305,7 @@ const MRT_TablePaper = (_a) => {
4275
4305
  const isTableInstanceProp = (props) => props.table !== undefined;
4276
4306
  const MaterialReactTable = (props) => {
4277
4307
  let table;
4308
+ debugger;
4278
4309
  if (isTableInstanceProp(props)) {
4279
4310
  table = props.table;
4280
4311
  }