material-react-table-narender 2.13.22 → 2.13.23

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);
@@ -4386,7 +4390,9 @@ const MRT_ToggleNavigationButton = (_a) => {
4386
4390
  const MRT_ToolbarInternalButtons = (_a) => {
4387
4391
  var _b;
4388
4392
  var { table } = _a, rest = __rest(_a, ["table"]);
4389
- const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions, enableKeyboardShortcuts }, } = table;
4393
+ const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions,
4394
+ // enableKeyboardShortcuts
4395
+ }, } = table;
4390
4396
  return (jsxRuntime.jsx(Box__default["default"], Object.assign({}, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', display: 'flex', zIndex: 3 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
4391
4397
  table,
4392
4398
  })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&