material-react-table-narender 2.13.22 → 2.13.24

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/index.esm.js CHANGED
@@ -439,35 +439,39 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
439
439
  debugger;
440
440
  const { getState, setEnableKeyboardShortcuts, } = table;
441
441
  const { enableKeyboardShortcuts } = getState();
442
- // alt + n
443
- // if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
444
- // event.preventDefault();
445
- // setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
446
- // const currentCell = event.currentTarget;
447
- // if (enableKeyboardShortcuts) {
448
- // const input = currentCell.querySelector('input') as HTMLInputElement;
449
- // const select = currentCell.querySelector('select') as HTMLSelectElement;
450
- // const checkbox = currentCell.querySelector('input[type="checkbox"]') as HTMLInputElement;
451
- // const button = currentCell.querySelector('button') as HTMLButtonElement;
452
- // const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]') as HTMLInputElement;
453
- // if (autocomplete) {
454
- // autocomplete.focus();
455
- // autocomplete.select?.();
456
- // } else if (input) {
457
- // input.focus();
458
- // input.select?.();
459
- // } else if (select) {
460
- // select.focus();
461
- // } else if (checkbox) {
462
- // checkbox.focus();
463
- // // checkbox.click();
464
- // } else if (button) {
465
- // button.focus();
466
- // } else {
467
- // currentCell.focus();
468
- // }
469
- // }
470
- // }
442
+ if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
443
+ event.preventDefault();
444
+ setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
445
+ const currentCell = event.currentTarget;
446
+ if (enableKeyboardShortcuts) {
447
+ const input = currentCell.querySelector('input');
448
+ const select = currentCell.querySelector('select');
449
+ const checkbox = currentCell.querySelector('input[type="checkbox"]');
450
+ const button = currentCell.querySelector('button');
451
+ const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
452
+ if (autocomplete) {
453
+ autocomplete.focus();
454
+ // autocomplete.select?.();
455
+ }
456
+ else if (input) {
457
+ input.focus();
458
+ // input.select?.();
459
+ }
460
+ else if (select) {
461
+ select.focus();
462
+ }
463
+ else if (checkbox) {
464
+ checkbox.focus();
465
+ // checkbox.click();
466
+ }
467
+ else if (button) {
468
+ button.focus();
469
+ }
470
+ else {
471
+ currentCell.focus();
472
+ }
473
+ }
474
+ }
471
475
  // if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
472
476
  // event.preventDefault();
473
477
  // setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
@@ -4302,7 +4306,7 @@ const MRT_ToolbarInternalButtons = (_a) => {
4302
4306
  enableGlobalFilter &&
4303
4307
  !(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
4304
4308
  enableColumnFilters &&
4305
- columnFilterDisplayMode !== 'popover' && (jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsx(MRT_ToggleFullScreenButton, { table: table })), jsx(MRT_ToggleNavigationButton, { table: table })] })) })));
4309
+ columnFilterDisplayMode !== 'popover' && (jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsx(MRT_ToggleFullScreenButton, { table: table })), enableKeyboardShortcuts && (jsx(MRT_ToggleNavigationButton, { table: table }))] })) })));
4306
4310
  };
4307
4311
 
4308
4312
  const MRT_GlobalFilterTextField = (_a) => {