@mui/x-data-grid 6.18.2 → 6.18.3

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/components/GridRow.js +2 -4
  3. package/components/cell/GridEditDateCell.js +1 -20
  4. package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  5. package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  6. package/components/panel/filterPanel/GridFilterForm.js +2 -2
  7. package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  8. package/hooks/features/editing/useGridCellEditing.js +8 -21
  9. package/hooks/features/editing/useGridRowEditing.js +7 -21
  10. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  11. package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  12. package/index.js +1 -1
  13. package/internals/index.d.ts +1 -1
  14. package/internals/index.js +1 -1
  15. package/legacy/components/GridRow.js +2 -4
  16. package/legacy/components/cell/GridEditDateCell.js +1 -20
  17. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  18. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  19. package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
  20. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  21. package/legacy/hooks/features/editing/useGridCellEditing.js +8 -21
  22. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -23
  23. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  24. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  25. package/legacy/index.js +1 -1
  26. package/legacy/internals/index.js +1 -1
  27. package/legacy/locales/bgBG.js +33 -37
  28. package/legacy/models/params/gridEditCellParams.js +1 -0
  29. package/legacy/utils/domUtils.js +10 -1
  30. package/locales/bgBG.js +33 -37
  31. package/models/api/gridEditingApi.d.ts +2 -4
  32. package/models/params/gridEditCellParams.d.ts +3 -1
  33. package/models/params/gridEditCellParams.js +1 -0
  34. package/models/params/gridRowParams.d.ts +1 -0
  35. package/modern/components/GridRow.js +2 -4
  36. package/modern/components/cell/GridEditDateCell.js +1 -20
  37. package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  38. package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  39. package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
  40. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  41. package/modern/hooks/features/editing/useGridCellEditing.js +8 -21
  42. package/modern/hooks/features/editing/useGridRowEditing.js +7 -21
  43. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  44. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  45. package/modern/index.js +1 -1
  46. package/modern/internals/index.js +1 -1
  47. package/modern/locales/bgBG.js +33 -37
  48. package/modern/models/params/gridEditCellParams.js +1 -0
  49. package/modern/utils/domUtils.js +10 -1
  50. package/node/components/GridRow.js +1 -3
  51. package/node/components/cell/GridEditDateCell.js +1 -20
  52. package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  53. package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  54. package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
  55. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  56. package/node/hooks/features/editing/useGridCellEditing.js +7 -20
  57. package/node/hooks/features/editing/useGridRowEditing.js +6 -20
  58. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  59. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  60. package/node/index.js +1 -1
  61. package/node/internals/index.js +7 -0
  62. package/node/locales/bgBG.js +33 -37
  63. package/node/models/params/gridEditCellParams.js +1 -0
  64. package/node/utils/domUtils.js +11 -1
  65. package/package.json +1 -1
  66. package/utils/domUtils.d.ts +2 -0
  67. package/utils/domUtils.js +10 -1
@@ -12,6 +12,7 @@ var GridCellEditStartReasons = exports.GridCellEditStartReasons = /*#__PURE__*/f
12
12
  GridCellEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
13
13
  GridCellEditStartReasons["printableKeyDown"] = "printableKeyDown";
14
14
  GridCellEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
15
+ GridCellEditStartReasons["pasteKeyDown"] = "pasteKeyDown";
15
16
  return GridCellEditStartReasons;
16
17
  }(GridCellEditStartReasons || {});
17
18
  /**
@@ -9,6 +9,7 @@ exports.getGridCellElement = getGridCellElement;
9
9
  exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
10
10
  exports.getGridRowElement = getGridRowElement;
11
11
  exports.getRowEl = getRowEl;
12
+ exports.isEventTargetInPortal = isEventTargetInPortal;
12
13
  exports.isGridCellRoot = isGridCellRoot;
13
14
  exports.isGridHeaderCellRoot = isGridHeaderCellRoot;
14
15
  exports.isOverflown = isOverflown;
@@ -66,4 +67,13 @@ const getActiveElement = (root = document) => {
66
67
  }
67
68
  return activeEl;
68
69
  };
69
- exports.getActiveElement = getActiveElement;
70
+ exports.getActiveElement = getActiveElement;
71
+ function isEventTargetInPortal(event) {
72
+ if (
73
+ // The target is not an element when triggered by a Select inside the cell
74
+ // See https://github.com/mui/material-ui/issues/10534
75
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
76
+ return true;
77
+ }
78
+ return false;
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "6.18.2",
3
+ "version": "6.18.3",
4
4
  "description": "The community edition of the data grid component (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { GridRowId } from '../models/gridRows';
2
3
  export declare function isOverflown(element: Element): boolean;
3
4
  export declare function findParentElementFromClassName(elem: Element, className: string): Element | null;
@@ -11,3 +12,4 @@ export declare function getGridCellElement(root: Element, { id, field }: {
11
12
  field: string;
12
13
  }): HTMLDivElement | null;
13
14
  export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
15
+ export declare function isEventTargetInPortal(event: React.SyntheticEvent): boolean;
package/utils/domUtils.js CHANGED
@@ -51,4 +51,13 @@ export const getActiveElement = (root = document) => {
51
51
  return getActiveElement(activeEl.shadowRoot);
52
52
  }
53
53
  return activeEl;
54
- };
54
+ };
55
+ export function isEventTargetInPortal(event) {
56
+ if (
57
+ // The target is not an element when triggered by a Select inside the cell
58
+ // See https://github.com/mui/material-ui/issues/10534
59
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
60
+ return true;
61
+ }
62
+ return false;
63
+ }