material-react-table-narender 2.13.17 → 2.13.18

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.13.17",
2
+ "version": "2.13.18",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table-narender",
5
5
  "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
@@ -231,6 +231,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
231
231
 
232
232
  const handleKeyDown = (event: React.KeyboardEvent<HTMLTableCellElement>) => {
233
233
  tableCellProps?.onKeyDown?.(event);
234
+ debugger;
234
235
  cellKeyboardShortcuts({
235
236
  cell,
236
237
  cellValue: cell.getValue<string>(),
@@ -71,7 +71,7 @@ export const MRT_TableFooterCell = <TData extends MRT_RowData>({
71
71
  tabIndex={enableKeyboardShortcuts ? 0 : undefined}
72
72
  variant="footer"
73
73
  {...tableCellProps}
74
- onKeyDown={handleKeyDown}
74
+ onKeyDown={handleKeyDown}
75
75
  sx={(theme) => ({
76
76
  fontWeight: 'bold',
77
77
  p:
@@ -79,20 +79,32 @@ export const cellKeyboardShortcuts = <TData extends MRT_RowData = MRT_RowData>({
79
79
  parentElement?: HTMLTableRowElement;
80
80
  table: MRT_TableInstance<TData>;
81
81
  }) => {
82
+
82
83
  debugger;
83
-
84
84
  const {
85
85
  getState,
86
86
  setEnableKeyboardShortcuts,
87
87
  } = table;
88
88
 
89
+
90
+
89
91
  const { enableKeyboardShortcuts } = getState();
90
92
 
91
- if (event.altKey && event.key.toLowerCase() === 'n') {
93
+ if (event.altKey) {
92
94
  event.preventDefault();
93
95
  setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
94
96
  const currentCell = event.currentTarget;
95
- currentCell.focus();
97
+
98
+
99
+ if (enableKeyboardShortcuts) {
100
+ currentCell.style.outline = '2px solid red';
101
+ // setTimeout(() => {
102
+ // currentCell.style.outline = '';
103
+ // },
104
+ // 1000);
105
+ currentCell.focus();
106
+ return;
107
+ }
96
108
  }
97
109
 
98
110
  // if (!table.options.enableKeyboardShortcuts) return;