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.js CHANGED
@@ -530,35 +530,39 @@ const cellKeyboardShortcuts = ({ cell, cellElements, cellValue, containerElement
530
530
  debugger;
531
531
  const { getState, setEnableKeyboardShortcuts, } = table;
532
532
  const { enableKeyboardShortcuts } = getState();
533
- // alt + n
534
- // if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
535
- // event.preventDefault();
536
- // setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
537
- // const currentCell = event.currentTarget;
538
- // if (enableKeyboardShortcuts) {
539
- // const input = currentCell.querySelector('input') as HTMLInputElement;
540
- // const select = currentCell.querySelector('select') as HTMLSelectElement;
541
- // const checkbox = currentCell.querySelector('input[type="checkbox"]') as HTMLInputElement;
542
- // const button = currentCell.querySelector('button') as HTMLButtonElement;
543
- // const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]') as HTMLInputElement;
544
- // if (autocomplete) {
545
- // autocomplete.focus();
546
- // autocomplete.select?.();
547
- // } else if (input) {
548
- // input.focus();
549
- // input.select?.();
550
- // } else if (select) {
551
- // select.focus();
552
- // } else if (checkbox) {
553
- // checkbox.focus();
554
- // // checkbox.click();
555
- // } else if (button) {
556
- // button.focus();
557
- // } else {
558
- // currentCell.focus();
559
- // }
560
- // }
561
- // }
533
+ if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
534
+ event.preventDefault();
535
+ setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
536
+ const currentCell = event.currentTarget;
537
+ if (enableKeyboardShortcuts) {
538
+ const input = currentCell.querySelector('input');
539
+ const select = currentCell.querySelector('select');
540
+ const checkbox = currentCell.querySelector('input[type="checkbox"]');
541
+ const button = currentCell.querySelector('button');
542
+ const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]');
543
+ if (autocomplete) {
544
+ autocomplete.focus();
545
+ // autocomplete.select?.();
546
+ }
547
+ else if (input) {
548
+ input.focus();
549
+ // input.select?.();
550
+ }
551
+ else if (select) {
552
+ select.focus();
553
+ }
554
+ else if (checkbox) {
555
+ checkbox.focus();
556
+ // checkbox.click();
557
+ }
558
+ else if (button) {
559
+ button.focus();
560
+ }
561
+ else {
562
+ currentCell.focus();
563
+ }
564
+ }
565
+ }
562
566
  // if (event.altKey && event.key.toLocaleLowerCase() === 'n') {
563
567
  // event.preventDefault();
564
568
  // setEnableKeyboardShortcuts(!enableKeyboardShortcuts);
@@ -4393,7 +4397,7 @@ const MRT_ToolbarInternalButtons = (_a) => {
4393
4397
  enableGlobalFilter &&
4394
4398
  !(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
4395
4399
  enableColumnFilters &&
4396
- columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_ToggleFullScreenButton, { table: table })), jsxRuntime.jsx(MRT_ToggleNavigationButton, { table: table })] })) })));
4400
+ columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_ToggleFullScreenButton, { table: table })), enableKeyboardShortcuts && (jsxRuntime.jsx(MRT_ToggleNavigationButton, { table: table }))] })) })));
4397
4401
  };
4398
4402
 
4399
4403
  const MRT_GlobalFilterTextField = (_a) => {