@mui/x-data-grid 7.0.0-alpha.2 → 7.0.0-alpha.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 (126) hide show
  1. package/CHANGELOG.md +241 -0
  2. package/DataGrid/DataGrid.d.ts +0 -10
  3. package/DataGrid/DataGrid.js +11 -23
  4. package/DataGrid/useDataGridProps.js +1 -1
  5. package/README.md +0 -1
  6. package/components/GridHeader.js +3 -2
  7. package/components/GridRow.js +2 -4
  8. package/components/cell/GridCell.js +3 -3
  9. package/components/cell/GridEditDateCell.js +1 -20
  10. package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  11. package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  12. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  13. package/components/panel/filterPanel/GridFilterForm.js +2 -2
  14. package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  15. package/components/panel/index.d.ts +0 -1
  16. package/components/panel/index.js +0 -1
  17. package/constants/defaultGridSlotsComponents.js +1 -2
  18. package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
  19. package/hooks/features/clipboard/useGridClipboard.js +1 -1
  20. package/hooks/features/editing/useGridCellEditing.js +8 -21
  21. package/hooks/features/editing/useGridRowEditing.js +7 -21
  22. package/hooks/features/export/useGridCsvExport.d.ts +1 -1
  23. package/hooks/features/export/useGridCsvExport.js +1 -1
  24. package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
  25. package/hooks/features/filter/gridFilterUtils.js +7 -4
  26. package/hooks/features/filter/useGridFilter.js +2 -2
  27. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  28. package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  29. package/hooks/features/sorting/useGridSorting.js +6 -5
  30. package/index.js +1 -1
  31. package/internals/index.d.ts +1 -1
  32. package/internals/index.js +1 -1
  33. package/legacy/DataGrid/DataGrid.js +11 -23
  34. package/legacy/DataGrid/useDataGridProps.js +1 -1
  35. package/legacy/components/GridHeader.js +3 -2
  36. package/legacy/components/GridRow.js +2 -4
  37. package/legacy/components/cell/GridCell.js +3 -3
  38. package/legacy/components/cell/GridEditDateCell.js +1 -20
  39. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  40. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  41. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  42. package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
  43. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  44. package/legacy/components/panel/index.js +0 -1
  45. package/legacy/constants/defaultGridSlotsComponents.js +1 -2
  46. package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -1
  47. package/legacy/hooks/features/editing/useGridCellEditing.js +8 -21
  48. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -23
  49. package/legacy/hooks/features/export/useGridCsvExport.js +1 -1
  50. package/legacy/hooks/features/filter/gridFilterUtils.js +7 -4
  51. package/legacy/hooks/features/filter/useGridFilter.js +2 -2
  52. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  53. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  54. package/legacy/hooks/features/sorting/useGridSorting.js +6 -5
  55. package/legacy/index.js +1 -1
  56. package/legacy/internals/index.js +1 -1
  57. package/legacy/locales/bgBG.js +33 -37
  58. package/legacy/models/params/gridEditCellParams.js +1 -0
  59. package/legacy/utils/domUtils.js +10 -1
  60. package/locales/bgBG.js +33 -37
  61. package/models/api/gridEditingApi.d.ts +2 -4
  62. package/models/api/gridSortApi.d.ts +2 -2
  63. package/models/gridFilterModel.d.ts +2 -2
  64. package/models/gridSlotsComponent.d.ts +0 -5
  65. package/models/gridSlotsComponentsProps.d.ts +0 -3
  66. package/models/params/gridEditCellParams.d.ts +3 -1
  67. package/models/params/gridEditCellParams.js +1 -0
  68. package/models/params/gridRowParams.d.ts +1 -0
  69. package/models/props/DataGridProps.d.ts +1 -1
  70. package/modern/DataGrid/DataGrid.js +11 -23
  71. package/modern/DataGrid/useDataGridProps.js +1 -1
  72. package/modern/components/GridHeader.js +2 -1
  73. package/modern/components/GridRow.js +2 -4
  74. package/modern/components/cell/GridCell.js +2 -2
  75. package/modern/components/cell/GridEditDateCell.js +1 -20
  76. package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  77. package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  78. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  79. package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
  80. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  81. package/modern/components/panel/index.js +0 -1
  82. package/modern/constants/defaultGridSlotsComponents.js +1 -2
  83. package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
  84. package/modern/hooks/features/editing/useGridCellEditing.js +8 -21
  85. package/modern/hooks/features/editing/useGridRowEditing.js +7 -21
  86. package/modern/hooks/features/export/useGridCsvExport.js +1 -1
  87. package/modern/hooks/features/filter/gridFilterUtils.js +4 -2
  88. package/modern/hooks/features/filter/useGridFilter.js +2 -2
  89. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  90. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  91. package/modern/hooks/features/sorting/useGridSorting.js +6 -5
  92. package/modern/index.js +1 -1
  93. package/modern/internals/index.js +1 -1
  94. package/modern/locales/bgBG.js +33 -37
  95. package/modern/models/params/gridEditCellParams.js +1 -0
  96. package/modern/utils/domUtils.js +10 -1
  97. package/node/DataGrid/DataGrid.js +11 -23
  98. package/node/DataGrid/useDataGridProps.js +1 -1
  99. package/node/components/GridHeader.js +2 -1
  100. package/node/components/GridRow.js +1 -3
  101. package/node/components/cell/GridCell.js +2 -2
  102. package/node/components/cell/GridEditDateCell.js +1 -20
  103. package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  104. package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  105. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  106. package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
  107. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  108. package/node/components/panel/index.js +0 -11
  109. package/node/constants/defaultGridSlotsComponents.js +0 -1
  110. package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
  111. package/node/hooks/features/editing/useGridCellEditing.js +7 -20
  112. package/node/hooks/features/editing/useGridRowEditing.js +6 -20
  113. package/node/hooks/features/export/useGridCsvExport.js +1 -1
  114. package/node/hooks/features/filter/gridFilterUtils.js +6 -3
  115. package/node/hooks/features/filter/useGridFilter.js +1 -1
  116. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
  117. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  118. package/node/hooks/features/sorting/useGridSorting.js +6 -5
  119. package/node/index.js +1 -1
  120. package/node/internals/index.js +7 -0
  121. package/node/locales/bgBG.js +33 -37
  122. package/node/models/params/gridEditCellParams.js +1 -0
  123. package/node/utils/domUtils.js +11 -1
  124. package/package.json +2 -2
  125. package/utils/domUtils.d.ts +2 -0
  126. 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
  /**
@@ -8,6 +8,7 @@ exports.getActiveElement = void 0;
8
8
  exports.getGridCellElement = getGridCellElement;
9
9
  exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
10
10
  exports.getGridRowElement = getGridRowElement;
11
+ exports.isEventTargetInPortal = isEventTargetInPortal;
11
12
  exports.isOverflown = isOverflown;
12
13
  var _gridClasses = require("../constants/gridClasses");
13
14
  function isOverflown(element) {
@@ -49,4 +50,13 @@ const getActiveElement = (root = document) => {
49
50
  }
50
51
  return activeEl;
51
52
  };
52
- exports.getActiveElement = getActiveElement;
53
+ exports.getActiveElement = getActiveElement;
54
+ function isEventTargetInPortal(event) {
55
+ if (
56
+ // The target is not an element when triggered by a Select inside the cell
57
+ // See https://github.com/mui/material-ui/issues/10534
58
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
59
+ return true;
60
+ }
61
+ return false;
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.0-alpha.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",
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.23.4",
40
+ "@mui/system": "^5.14.18",
40
41
  "@mui/utils": "^5.14.18",
41
42
  "clsx": "^2.0.0",
42
43
  "prop-types": "^15.8.1",
@@ -44,7 +45,6 @@
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@mui/material": "^5.4.1",
47
- "@mui/system": "^5.4.1",
48
48
  "react": "^17.0.0 || ^18.0.0",
49
49
  "react-dom": "^17.0.0 || ^18.0.0"
50
50
  },
@@ -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;
@@ -8,3 +9,4 @@ export declare function getGridCellElement(root: Element, { id, field }: {
8
9
  field: string;
9
10
  }): HTMLDivElement | null;
10
11
  export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
12
+ export declare function isEventTargetInPortal(event: React.SyntheticEvent): boolean;
package/utils/domUtils.js CHANGED
@@ -37,4 +37,13 @@ export const getActiveElement = (root = document) => {
37
37
  return getActiveElement(activeEl.shadowRoot);
38
38
  }
39
39
  return activeEl;
40
- };
40
+ };
41
+ export function isEventTargetInPortal(event) {
42
+ if (
43
+ // The target is not an element when triggered by a Select inside the cell
44
+ // See https://github.com/mui/material-ui/issues/10534
45
+ event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
46
+ return true;
47
+ }
48
+ return false;
49
+ }