@mui/x-data-grid 7.0.0-alpha.2 → 7.0.0-alpha.4

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 (181) hide show
  1. package/CHANGELOG.md +364 -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/colDef/gridCheckboxSelectionColDef.js +1 -1
  7. package/colDef/gridDefaultColumnTypes.d.ts +2 -2
  8. package/colDef/gridDefaultColumnTypes.js +2 -2
  9. package/components/GridHeader.js +3 -2
  10. package/components/GridRow.js +9 -6
  11. package/components/base/GridOverlays.js +0 -2
  12. package/components/cell/GridActionsCell.js +0 -1
  13. package/components/cell/GridCell.js +3 -5
  14. package/components/cell/GridEditDateCell.js +1 -20
  15. package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  16. package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  17. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  18. package/components/panel/filterPanel/GridFilterForm.js +2 -2
  19. package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  20. package/components/panel/index.d.ts +0 -1
  21. package/components/panel/index.js +0 -1
  22. package/components/virtualization/GridVirtualScroller.js +0 -1
  23. package/constants/defaultGridSlotsComponents.js +1 -2
  24. package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
  25. package/hooks/features/clipboard/useGridClipboard.js +1 -1
  26. package/hooks/features/editing/useGridCellEditing.js +8 -23
  27. package/hooks/features/editing/useGridRowEditing.js +7 -22
  28. package/hooks/features/export/useGridCsvExport.d.ts +1 -1
  29. package/hooks/features/export/useGridCsvExport.js +1 -1
  30. package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
  31. package/hooks/features/filter/gridFilterUtils.js +7 -4
  32. package/hooks/features/filter/useGridFilter.js +2 -2
  33. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
  34. package/hooks/features/focus/gridFocusStateSelector.js +2 -6
  35. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
  36. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  37. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
  38. package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  39. package/hooks/features/rows/useGridRowsMeta.js +0 -1
  40. package/hooks/features/sorting/useGridSorting.js +6 -5
  41. package/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  42. package/index.js +1 -1
  43. package/internals/index.d.ts +2 -2
  44. package/internals/index.js +2 -2
  45. package/legacy/DataGrid/DataGrid.js +11 -23
  46. package/legacy/DataGrid/useDataGridProps.js +1 -1
  47. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
  48. package/legacy/colDef/gridDefaultColumnTypes.js +2 -2
  49. package/legacy/components/GridHeader.js +3 -2
  50. package/legacy/components/GridRow.js +9 -6
  51. package/legacy/components/base/GridOverlays.js +0 -2
  52. package/legacy/components/cell/GridActionsCell.js +0 -1
  53. package/legacy/components/cell/GridCell.js +3 -5
  54. package/legacy/components/cell/GridEditDateCell.js +1 -20
  55. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  56. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  57. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  58. package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
  59. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  60. package/legacy/components/panel/index.js +0 -1
  61. package/legacy/components/virtualization/GridVirtualScroller.js +0 -1
  62. package/legacy/constants/defaultGridSlotsComponents.js +1 -2
  63. package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -1
  64. package/legacy/hooks/features/editing/useGridCellEditing.js +8 -23
  65. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -24
  66. package/legacy/hooks/features/export/useGridCsvExport.js +1 -1
  67. package/legacy/hooks/features/filter/gridFilterUtils.js +7 -4
  68. package/legacy/hooks/features/filter/useGridFilter.js +2 -2
  69. package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
  70. package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  71. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
  72. package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  73. package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -1
  74. package/legacy/hooks/features/sorting/useGridSorting.js +6 -5
  75. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  76. package/legacy/index.js +1 -1
  77. package/legacy/internals/index.js +2 -2
  78. package/legacy/locales/bgBG.js +33 -37
  79. package/legacy/locales/coreLocales.js +1 -0
  80. package/legacy/locales/daDK.js +37 -39
  81. package/legacy/locales/plPL.js +0 -1
  82. package/legacy/models/params/gridEditCellParams.js +1 -0
  83. package/legacy/utils/domUtils.js +10 -1
  84. package/legacy/utils/utils.js +0 -1
  85. package/locales/bgBG.js +33 -37
  86. package/locales/coreLocales.js +1 -0
  87. package/locales/daDK.js +37 -39
  88. package/locales/plPL.js +0 -1
  89. package/models/api/gridEditingApi.d.ts +2 -4
  90. package/models/api/gridSortApi.d.ts +2 -2
  91. package/models/colDef/gridColType.d.ts +2 -4
  92. package/models/gridFilterModel.d.ts +2 -2
  93. package/models/gridSlotsComponent.d.ts +0 -5
  94. package/models/gridSlotsComponentsProps.d.ts +0 -3
  95. package/models/params/gridEditCellParams.d.ts +3 -1
  96. package/models/params/gridEditCellParams.js +1 -0
  97. package/models/params/gridRowParams.d.ts +1 -0
  98. package/models/props/DataGridProps.d.ts +1 -1
  99. package/modern/DataGrid/DataGrid.js +11 -23
  100. package/modern/DataGrid/useDataGridProps.js +1 -1
  101. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
  102. package/modern/colDef/gridDefaultColumnTypes.js +2 -2
  103. package/modern/components/GridHeader.js +2 -1
  104. package/modern/components/GridRow.js +9 -6
  105. package/modern/components/base/GridOverlays.js +0 -2
  106. package/modern/components/cell/GridActionsCell.js +0 -1
  107. package/modern/components/cell/GridCell.js +2 -4
  108. package/modern/components/cell/GridEditDateCell.js +1 -20
  109. package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  110. package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  111. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  112. package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
  113. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  114. package/modern/components/panel/index.js +0 -1
  115. package/modern/components/virtualization/GridVirtualScroller.js +0 -1
  116. package/modern/constants/defaultGridSlotsComponents.js +1 -2
  117. package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
  118. package/modern/hooks/features/editing/useGridCellEditing.js +8 -23
  119. package/modern/hooks/features/editing/useGridRowEditing.js +7 -22
  120. package/modern/hooks/features/export/useGridCsvExport.js +1 -1
  121. package/modern/hooks/features/filter/gridFilterUtils.js +4 -2
  122. package/modern/hooks/features/filter/useGridFilter.js +2 -2
  123. package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
  124. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  125. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +9 -6
  126. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  127. package/modern/hooks/features/rows/useGridRowsMeta.js +0 -1
  128. package/modern/hooks/features/sorting/useGridSorting.js +6 -5
  129. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  130. package/modern/index.js +1 -1
  131. package/modern/internals/index.js +2 -2
  132. package/modern/locales/bgBG.js +33 -37
  133. package/modern/locales/coreLocales.js +1 -0
  134. package/modern/locales/daDK.js +37 -39
  135. package/modern/locales/plPL.js +0 -1
  136. package/modern/models/params/gridEditCellParams.js +1 -0
  137. package/modern/utils/domUtils.js +10 -1
  138. package/modern/utils/utils.js +0 -1
  139. package/node/DataGrid/DataGrid.js +11 -23
  140. package/node/DataGrid/useDataGridProps.js +1 -1
  141. package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
  142. package/node/colDef/gridDefaultColumnTypes.js +2 -2
  143. package/node/components/GridHeader.js +2 -1
  144. package/node/components/GridRow.js +8 -5
  145. package/node/components/base/GridOverlays.js +0 -2
  146. package/node/components/cell/GridActionsCell.js +0 -1
  147. package/node/components/cell/GridCell.js +2 -4
  148. package/node/components/cell/GridEditDateCell.js +1 -20
  149. package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
  150. package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
  151. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
  152. package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
  153. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  154. package/node/components/panel/index.js +0 -11
  155. package/node/components/virtualization/GridVirtualScroller.js +0 -1
  156. package/node/constants/defaultGridSlotsComponents.js +0 -1
  157. package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
  158. package/node/hooks/features/editing/useGridCellEditing.js +7 -22
  159. package/node/hooks/features/editing/useGridRowEditing.js +6 -21
  160. package/node/hooks/features/export/useGridCsvExport.js +1 -1
  161. package/node/hooks/features/filter/gridFilterUtils.js +6 -3
  162. package/node/hooks/features/filter/useGridFilter.js +1 -1
  163. package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
  164. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -7
  165. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +8 -5
  166. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  167. package/node/hooks/features/rows/useGridRowsMeta.js +0 -1
  168. package/node/hooks/features/sorting/useGridSorting.js +6 -5
  169. package/node/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  170. package/node/index.js +1 -1
  171. package/node/internals/index.js +21 -14
  172. package/node/locales/bgBG.js +33 -37
  173. package/node/locales/daDK.js +37 -39
  174. package/node/locales/plPL.js +0 -1
  175. package/node/models/params/gridEditCellParams.js +1 -0
  176. package/node/utils/domUtils.js +11 -1
  177. package/node/utils/utils.js +0 -1
  178. package/package.json +4 -4
  179. package/utils/domUtils.d.ts +2 -0
  180. package/utils/domUtils.js +10 -1
  181. package/utils/utils.js +0 -1
@@ -174,6 +174,9 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
174
174
  filterItemsApplierId += 1;
175
175
  return filterItem;
176
176
  };
177
+ export const shouldQuickFilterExcludeHiddenColumns = filterModel => {
178
+ return filterModel.quickFilterExcludeHiddenColumns ?? true;
179
+ };
177
180
 
178
181
  /**
179
182
  * Generates a method to easily check if a row is matching the current quick filter.
@@ -186,8 +189,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
186
189
  if (quickFilterValues.length === 0) {
187
190
  return null;
188
191
  }
189
- const quickFilterExcludeHiddenColumns = filterModel.quickFilterExcludeHiddenColumns ?? false;
190
- const columnFields = quickFilterExcludeHiddenColumns ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);
192
+ const columnFields = shouldQuickFilterExcludeHiddenColumns(filterModel) ? gridVisibleColumnFieldsSelector(apiRef) : gridColumnFieldsSelector(apiRef);
191
193
  const appliersPerField = [];
192
194
  const {
193
195
  ignoreDiacritics
@@ -14,7 +14,7 @@ import { useFirstRender } from '../../utils/useFirstRender';
14
14
  import { gridRowsLookupSelector } from '../rows';
15
15
  import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
16
16
  import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from '../../core/strategyProcessing';
17
- import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic } from './gridFilterUtils';
17
+ import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns } from './gridFilterUtils';
18
18
  import { isDeepEqual } from '../../../utils/utils';
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  export const filterStateInitializer = (state, props, apiRef) => {
@@ -339,7 +339,7 @@ export const useGridFilter = (apiRef, props) => {
339
339
  useGridApiEventHandler(apiRef, 'rowExpansionChange', updateVisibleRowsLookupState);
340
340
  useGridApiEventHandler(apiRef, 'columnVisibilityModelChange', () => {
341
341
  const filterModel = gridFilterModelSelector(apiRef);
342
- if (filterModel.quickFilterValues && filterModel.quickFilterExcludeHiddenColumns) {
342
+ if (filterModel.quickFilterValues && shouldQuickFilterExcludeHiddenColumns(filterModel)) {
343
343
  // re-apply filters because the quick filter results may have changed
344
344
  apiRef.current.unstable_applyFilters();
345
345
  }
@@ -2,18 +2,14 @@ import { createSelector } from '../../../utils/createSelector';
2
2
  export const gridFocusStateSelector = state => state.focus;
3
3
  export const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);
4
4
  export const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);
5
-
6
- // eslint-disable-next-line @typescript-eslint/naming-convention
7
- export const unstable_gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
5
+ export const gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
8
6
 
9
7
  // eslint-disable-next-line @typescript-eslint/naming-convention
10
8
  export const unstable_gridFocusColumnGroupHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnGroupHeader);
11
9
  export const gridTabIndexStateSelector = state => state.tabIndex;
12
10
  export const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);
13
11
  export const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);
14
-
15
- // eslint-disable-next-line @typescript-eslint/naming-convention
16
- export const unstable_gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
12
+ export const gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
17
13
 
18
14
  // eslint-disable-next-line @typescript-eslint/naming-convention
19
15
  export const unstable_gridTabIndexColumnGroupHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnGroupHeader);
@@ -1,5 +1,4 @@
1
- /* eslint-disable @typescript-eslint/naming-convention */
2
1
  import { createSelector } from '../../../utils/createSelector';
3
- export const unstable_gridHeaderFilteringStateSelector = state => state.headerFiltering;
4
- export const unstable_gridHeaderFilteringEditFieldSelector = createSelector(unstable_gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
5
- export const unstable_gridHeaderFilteringMenuSelector = createSelector(unstable_gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
2
+ export const gridHeaderFilteringStateSelector = state => state.headerFiltering;
3
+ export const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
4
+ export const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
@@ -13,8 +13,9 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPan
13
13
  import { gridPinnedRowsSelector } from '../rows/gridRowsSelector';
14
14
  import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
15
15
  import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
16
- import { unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
16
+ import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
17
17
  import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
18
+ import { isEventTargetInPortal } from '../../../utils/domUtils';
18
19
  function enrichPageRowsWithPinnedRows(apiRef, rows) {
19
20
  const pinnedRows = gridPinnedRowsSelector(apiRef) || {};
20
21
  return [...(pinnedRows.top || []), ...rows, ...(pinnedRows.bottom || [])];
@@ -70,7 +71,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
70
71
  const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
71
72
  const headerFilteringEnabled =
72
73
  // @ts-expect-error // TODO move relevant code to the `DataGridPro`
73
- props.signature !== 'DataGrid' && props.unstable_headerFilters;
74
+ props.signature !== 'DataGrid' && props.headerFilters;
74
75
 
75
76
  /**
76
77
  * @param {number} colIndex Index of the column to focus
@@ -236,8 +237,8 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
236
237
  if (!dimensions) {
237
238
  return;
238
239
  }
239
- const isEditing = unstable_gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
240
- const isHeaderMenuOpen = unstable_gridHeaderFilteringMenuSelector(apiRef) === params.field;
240
+ const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
241
+ const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
241
242
  if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
242
243
  return;
243
244
  }
@@ -413,7 +414,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
413
414
  }, [apiRef, currentPageRows.length, goToHeader, goToGroupHeader, goToCell, getRowIdFromIndex]);
414
415
  const handleCellKeyDown = React.useCallback((params, event) => {
415
416
  // Ignore portal
416
- if (!event.currentTarget.contains(event.target)) {
417
+ if (isEventTargetInPortal(event)) {
417
418
  return;
418
419
  }
419
420
 
@@ -505,7 +506,9 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
505
506
  break;
506
507
  }
507
508
  const colDef = params.colDef;
508
- if (colDef && colDef.type === 'treeDataGroup') {
509
+ if (colDef &&
510
+ // `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
511
+ colDef.field === '__tree_data_group__') {
509
512
  break;
510
513
  }
511
514
  if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
@@ -14,6 +14,7 @@ import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
14
14
  import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
15
15
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';
16
16
  import { gridClasses } from '../../../constants/gridClasses';
17
+ import { isEventTargetInPortal } from '../../../utils/domUtils';
17
18
  const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
18
19
  if (selectionModelProp == null) {
19
20
  return selectionModelProp;
@@ -283,7 +284,7 @@ export const useGridRowSelection = (apiRef, props) => {
283
284
 
284
285
  // Ignore portal
285
286
  // Do not apply shortcuts if the focus is not on the cell root component
286
- if (!event.currentTarget.contains(event.target)) {
287
+ if (isEventTargetInPortal(event)) {
287
288
  return;
288
289
  }
289
290
  if (isNavigationKey(event.key) && event.shiftKey) {
@@ -67,7 +67,6 @@ export const useGridRowsMeta = (apiRef, props) => {
67
67
  needsFirstMeasurement: true // Assume all rows will need to be measured by default
68
68
  };
69
69
  }
70
-
71
70
  const {
72
71
  isResized,
73
72
  needsFirstMeasurement,
@@ -112,7 +112,8 @@ export const useGridSorting = (apiRef, props) => {
112
112
  apiRef.current.applySorting();
113
113
  }
114
114
  }, [apiRef, logger, props.disableMultipleColumnsSorting]);
115
- const sortColumn = React.useCallback((column, direction, allowMultipleSorting) => {
115
+ const sortColumn = React.useCallback((field, direction, allowMultipleSorting) => {
116
+ const column = apiRef.current.getColumn(field);
116
117
  if (!column.sortable) {
117
118
  return;
118
119
  }
@@ -193,17 +194,17 @@ export const useGridSorting = (apiRef, props) => {
193
194
  * EVENTS
194
195
  */
195
196
  const handleColumnHeaderClick = React.useCallback(({
196
- colDef
197
+ field
197
198
  }, event) => {
198
199
  const allowMultipleSorting = event.shiftKey || event.metaKey || event.ctrlKey;
199
- sortColumn(colDef, undefined, allowMultipleSorting);
200
+ sortColumn(field, undefined, allowMultipleSorting);
200
201
  }, [sortColumn]);
201
202
  const handleColumnHeaderKeyDown = React.useCallback(({
202
- colDef
203
+ field
203
204
  }, event) => {
204
205
  // Ctrl + Enter opens the column menu
205
206
  if (isEnterKey(event.key) && !event.ctrlKey && !event.metaKey) {
206
- sortColumn(colDef, undefined, event.shiftKey);
207
+ sortColumn(field, undefined, event.shiftKey);
207
208
  }
208
209
  }, [sortColumn]);
209
210
  const handleColumnsChange = React.useCallback(() => {
@@ -550,7 +550,6 @@ export const useGridVirtualScroller = props => {
550
550
  if (rootProps.autoHeight && currentPage.rows.length === 0) {
551
551
  size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
552
552
  }
553
-
554
553
  return size;
555
554
  }, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
556
555
  React.useEffect(() => {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.0.0-alpha.2
2
+ * @mui/x-data-grid v7.0.0-alpha.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,7 +11,7 @@ export { useGridInitialization } from '../hooks/core/useGridInitialization';
11
11
  export { unwrapPrivateAPI } from '../hooks/core/useGridApiInitialization';
12
12
  export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
13
13
  export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
14
- export { unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
14
+ export { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
15
15
  export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
16
16
  export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
17
17
  export { getTotalHeaderHeight } from '../hooks/features/columns/gridColumnsUtils';
@@ -54,7 +54,7 @@ export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
54
54
  export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
55
55
  export * from '../utils/createControllablePromise';
56
56
  export { createSelector, createSelectorMemoized, unstable_resetCreateSelectorCache } from '../utils/createSelector';
57
- export { findParentElementFromClassName, getActiveElement } from '../utils/domUtils';
57
+ export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal } from '../utils/domUtils';
58
58
  export { isNavigationKey } from '../utils/keyboardUtils';
59
59
  export { clamp, isDeepEqual, isNumber, isFunction, isObject } from '../utils/utils';
60
60
  export { buildWarning } from '../utils/warning';
@@ -60,34 +60,32 @@ const bgBGGrid = {
60
60
  filterOperatorIsEmpty: 'е празен',
61
61
  filterOperatorIsNotEmpty: 'не е празен',
62
62
  filterOperatorIsAnyOf: 'е някой от',
63
- // 'filterOperator=': '=',
64
- // 'filterOperator!=': '!=',
65
- // 'filterOperator>': '>',
66
- // 'filterOperator>=': '>=',
67
- // 'filterOperator<': '<',
68
- // 'filterOperator<=': '<=',
69
-
63
+ 'filterOperator=': '=',
64
+ 'filterOperator!=': '!=',
65
+ 'filterOperator>': '>',
66
+ 'filterOperator>=': '>=',
67
+ 'filterOperator<': '<',
68
+ 'filterOperator<=': '<=',
70
69
  // Header filter operators text
71
- // headerFilterOperatorContains: 'Contains',
72
- // headerFilterOperatorEquals: 'Equals',
73
- // headerFilterOperatorStartsWith: 'Starts with',
74
- // headerFilterOperatorEndsWith: 'Ends with',
75
- // headerFilterOperatorIs: 'Is',
76
- // headerFilterOperatorNot: 'Is not',
77
- // headerFilterOperatorAfter: 'Is after',
78
- // headerFilterOperatorOnOrAfter: 'Is on or after',
79
- // headerFilterOperatorBefore: 'Is before',
80
- // headerFilterOperatorOnOrBefore: 'Is on or before',
81
- // headerFilterOperatorIsEmpty: 'Is empty',
82
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
83
- // headerFilterOperatorIsAnyOf: 'Is any of',
84
- // 'headerFilterOperator=': 'Equals',
85
- // 'headerFilterOperator!=': 'Not equals',
86
- // 'headerFilterOperator>': 'Greater than',
87
- // 'headerFilterOperator>=': 'Greater than or equal to',
88
- // 'headerFilterOperator<': 'Less than',
89
- // 'headerFilterOperator<=': 'Less than or equal to',
90
-
70
+ headerFilterOperatorContains: 'Съдържа',
71
+ headerFilterOperatorEquals: 'Равнo',
72
+ headerFilterOperatorStartsWith: 'Започва с',
73
+ headerFilterOperatorEndsWith: 'Завършва с',
74
+ headerFilterOperatorIs: 'Равно е на',
75
+ headerFilterOperatorNot: 'Не се равнява на',
76
+ headerFilterOperatorAfter: 'След',
77
+ headerFilterOperatorOnOrAfter: 'След (включително)',
78
+ headerFilterOperatorBefore: 'Преди',
79
+ headerFilterOperatorOnOrBefore: 'Преди (включително)',
80
+ headerFilterOperatorIsEmpty: 'Празен',
81
+ headerFilterOperatorIsNotEmpty: 'Не е празен',
82
+ headerFilterOperatorIsAnyOf: 'Всичко от',
83
+ 'headerFilterOperator=': 'Равно',
84
+ 'headerFilterOperator!=': 'Различно',
85
+ 'headerFilterOperator>': 'По-голямо от',
86
+ 'headerFilterOperator>=': 'По-голямо или равно на',
87
+ 'headerFilterOperator<': 'По-малко от',
88
+ 'headerFilterOperator<=': 'По-малко или равно на',
91
89
  // Filter values text
92
90
  filterValueAny: 'всякакви',
93
91
  filterValueTrue: 'вярно',
@@ -135,19 +133,17 @@ const bgBGGrid = {
135
133
  groupColumn: name => `Групирай по ${name}`,
136
134
  unGroupColumn: name => `Спри групиране по ${name}`,
137
135
  // Master/detail
138
- // detailPanelToggle: 'Detail panel toggle',
136
+ detailPanelToggle: 'Превключване на панела с детайли',
139
137
  expandDetailPanel: 'Разгъване',
140
138
  collapseDetailPanel: 'Свиване',
141
139
  // Row reordering text
142
- rowReorderingHeaderName: 'Подредба на редове'
143
-
140
+ rowReorderingHeaderName: 'Подредба на редове',
144
141
  // Aggregation
145
- // aggregationMenuItemHeader: 'Aggregation',
146
- // aggregationFunctionLabelSum: 'sum',
147
- // aggregationFunctionLabelAvg: 'avg',
148
- // aggregationFunctionLabelMin: 'min',
149
- // aggregationFunctionLabelMax: 'max',
150
- // aggregationFunctionLabelSize: 'size',
142
+ aggregationMenuItemHeader: 'Агрегиране',
143
+ aggregationFunctionLabelSum: 'сума',
144
+ aggregationFunctionLabelAvg: 'срст',
145
+ aggregationFunctionLabelMin: 'мин',
146
+ aggregationFunctionLabelMax: 'макс',
147
+ aggregationFunctionLabelSize: 'размер'
151
148
  };
152
-
153
149
  export const bgBG = getGridLocalization(bgBGGrid, bgBGCore);
@@ -3,6 +3,7 @@
3
3
  // This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
4
4
  // in broader compatibility between the packages.
5
5
  // See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
6
+
6
7
  export const beBYCore = {
7
8
  components: {
8
9
  MuiTablePagination: {
@@ -47,47 +47,45 @@ const daDKGrid = {
47
47
  filterPanelInputLabel: 'Værdi',
48
48
  filterPanelInputPlaceholder: 'Filter værdi',
49
49
  // Filter operators text
50
- filterOperatorContains: 'Indeholder',
51
- filterOperatorEquals: 'Lig med',
52
- filterOperatorStartsWith: 'Begynder med',
53
- filterOperatorEndsWith: 'Ender med',
54
- filterOperatorIs: 'Er lig med',
55
- filterOperatorNot: 'Er ikke lig med',
56
- filterOperatorAfter: 'Efter',
57
- filterOperatorOnOrAfter: ' eller efter',
58
- filterOperatorBefore: 'Før',
59
- filterOperatorOnOrBefore: ' eller før',
60
- filterOperatorIsEmpty: 'Indeholder ikke data',
61
- filterOperatorIsNotEmpty: 'Indeholder data',
50
+ filterOperatorContains: 'indeholder',
51
+ filterOperatorEquals: 'lig med',
52
+ filterOperatorStartsWith: 'begynder med',
53
+ filterOperatorEndsWith: 'ender med',
54
+ filterOperatorIs: 'er lig med',
55
+ filterOperatorNot: 'er ikke lig med',
56
+ filterOperatorAfter: 'efter',
57
+ filterOperatorOnOrAfter: ' eller efter',
58
+ filterOperatorBefore: 'før',
59
+ filterOperatorOnOrBefore: ' eller før',
60
+ filterOperatorIsEmpty: 'indeholder ikke data',
61
+ filterOperatorIsNotEmpty: 'indeholder data',
62
62
  filterOperatorIsAnyOf: 'indeholder en af',
63
- // 'filterOperator=': '=',
64
- // 'filterOperator!=': '!=',
65
- // 'filterOperator>': '>',
66
- // 'filterOperator>=': '>=',
67
- // 'filterOperator<': '<',
68
- // 'filterOperator<=': '<=',
69
-
63
+ 'filterOperator=': '=',
64
+ 'filterOperator!=': '!=',
65
+ 'filterOperator>': '>',
66
+ 'filterOperator>=': '>=',
67
+ 'filterOperator<': '<',
68
+ 'filterOperator<=': '<=',
70
69
  // Header filter operators text
71
- // headerFilterOperatorContains: 'Contains',
72
- // headerFilterOperatorEquals: 'Equals',
73
- // headerFilterOperatorStartsWith: 'Starts with',
74
- // headerFilterOperatorEndsWith: 'Ends with',
75
- // headerFilterOperatorIs: 'Is',
76
- // headerFilterOperatorNot: 'Is not',
77
- // headerFilterOperatorAfter: 'Is after',
78
- // headerFilterOperatorOnOrAfter: 'Is on or after',
79
- // headerFilterOperatorBefore: 'Is before',
80
- // headerFilterOperatorOnOrBefore: 'Is on or before',
81
- // headerFilterOperatorIsEmpty: 'Is empty',
82
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
83
- // headerFilterOperatorIsAnyOf: 'Is any of',
84
- // 'headerFilterOperator=': 'Equals',
85
- // 'headerFilterOperator!=': 'Not equals',
86
- // 'headerFilterOperator>': 'Greater than',
87
- // 'headerFilterOperator>=': 'Greater than or equal to',
88
- // 'headerFilterOperator<': 'Less than',
89
- // 'headerFilterOperator<=': 'Less than or equal to',
90
-
70
+ headerFilterOperatorContains: 'Indeholder',
71
+ headerFilterOperatorEquals: 'Lig med',
72
+ headerFilterOperatorStartsWith: 'Begynder med',
73
+ headerFilterOperatorEndsWith: 'Ender med',
74
+ headerFilterOperatorIs: 'Er lig med',
75
+ headerFilterOperatorNot: 'Er ikke lig med',
76
+ headerFilterOperatorAfter: 'Efter',
77
+ headerFilterOperatorOnOrAfter: ' eller efter',
78
+ headerFilterOperatorBefore: 'Før',
79
+ headerFilterOperatorOnOrBefore: ' eller før',
80
+ headerFilterOperatorIsEmpty: 'Indeholder ikke data',
81
+ headerFilterOperatorIsNotEmpty: 'Indeholder data',
82
+ headerFilterOperatorIsAnyOf: 'Indeholder en af',
83
+ 'headerFilterOperator=': 'Lig med',
84
+ 'headerFilterOperator!=': 'Ikke lig med',
85
+ 'headerFilterOperator>': 'Større end',
86
+ 'headerFilterOperator>=': 'Større end eller lig med',
87
+ 'headerFilterOperator<': 'Mindre end',
88
+ 'headerFilterOperator<=': 'Mindre end eller lig med',
91
89
  // Filter values text
92
90
  filterValueAny: 'hvilken som helst',
93
91
  filterValueTrue: 'positiv',
@@ -149,5 +149,4 @@ const plPLGrid = {
149
149
  // aggregationFunctionLabelMax: 'max',
150
150
  // aggregationFunctionLabelSize: 'size',
151
151
  };
152
-
153
152
  export const plPL = getGridLocalization(plPLGrid, plPLCore);
@@ -6,6 +6,7 @@ var GridCellEditStartReasons = /*#__PURE__*/function (GridCellEditStartReasons)
6
6
  GridCellEditStartReasons["cellDoubleClick"] = "cellDoubleClick";
7
7
  GridCellEditStartReasons["printableKeyDown"] = "printableKeyDown";
8
8
  GridCellEditStartReasons["deleteKeyDown"] = "deleteKeyDown";
9
+ GridCellEditStartReasons["pasteKeyDown"] = "pasteKeyDown";
9
10
  return GridCellEditStartReasons;
10
11
  }(GridCellEditStartReasons || {});
11
12
  /**
@@ -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
+ }
@@ -163,7 +163,6 @@ function mulberry32(a) {
163
163
  /* eslint-enable */
164
164
  };
165
165
  }
166
-
167
166
  export function randomNumberBetween(seed, min, max) {
168
167
  const random = mulberry32(seed);
169
168
  return () => min + (max - min) * random();
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.SUBMIT_FILTER_STROKE_TIME = exports.SUBMIT_FILTER_DATE_STROKE_TIME = exports.DataGrid = void 0;
7
+ exports.DataGrid = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -43,18 +43,6 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
43
43
  * - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
44
44
  */
45
45
  const DataGrid = exports.DataGrid = /*#__PURE__*/React.memo(DataGridRaw);
46
-
47
- /**
48
- * Remove at v7
49
- * @deprecated
50
- */
51
- const SUBMIT_FILTER_STROKE_TIME = exports.SUBMIT_FILTER_STROKE_TIME = _useDataGridProps.DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
52
-
53
- /**
54
- * Remove at v7
55
- * @deprecated
56
- */
57
- const SUBMIT_FILTER_DATE_STROKE_TIME = exports.SUBMIT_FILTER_DATE_STROKE_TIME = _useDataGridProps.DATA_GRID_PROPS_DEFAULT_VALUES.filterDebounceMs;
58
46
  DataGridRaw.propTypes = {
59
47
  // ----------------------------- Warning --------------------------------
60
48
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -282,6 +270,15 @@ DataGridRaw.propTypes = {
282
270
  * @default false
283
271
  */
284
272
  ignoreDiacritics: _propTypes.default.bool,
273
+ /**
274
+ * If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
275
+ * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
276
+ * @default false
277
+ */
278
+ ignoreValueFormatterDuringExport: _propTypes.default.oneOfType([_propTypes.default.shape({
279
+ clipboardExport: _propTypes.default.bool,
280
+ csvExport: _propTypes.default.bool
281
+ }), _propTypes.default.bool]),
285
282
  /**
286
283
  * The initial state of the DataGrid.
287
284
  * The data in it will be set in the state on initialization but will not be controlled.
@@ -674,14 +671,5 @@ DataGridRaw.propTypes = {
674
671
  /**
675
672
  * The system prop that allows defining system overrides as well as additional CSS styles.
676
673
  */
677
- sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
678
- /**
679
- * If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
680
- * If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
681
- * @default false
682
- */
683
- unstable_ignoreValueFormatterDuringExport: _propTypes.default.oneOfType([_propTypes.default.shape({
684
- clipboardExport: _propTypes.default.bool,
685
- csvExport: _propTypes.default.bool
686
- }), _propTypes.default.bool])
674
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
687
675
  };
@@ -77,7 +77,7 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
77
77
  disableColumnResize: false,
78
78
  keepNonExistentRowsSelected: false,
79
79
  keepColumnPositionIfDraggedOutside: false,
80
- unstable_ignoreValueFormatterDuringExport: false,
80
+ ignoreValueFormatterDuringExport: false,
81
81
  clipboardCopyCellDelimiter: '\t',
82
82
  rowPositionsDebounceMs: 166
83
83
  };
@@ -16,8 +16,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  const GRID_CHECKBOX_SELECTION_FIELD = exports.GRID_CHECKBOX_SELECTION_FIELD = '__check__';
18
18
  const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanColDef.GRID_BOOLEAN_COL_DEF, {
19
+ type: 'custom',
19
20
  field: GRID_CHECKBOX_SELECTION_FIELD,
20
- type: 'checkboxSelection',
21
21
  width: 50,
22
22
  resizable: false,
23
23
  sortable: false,
@@ -10,7 +10,7 @@ var _gridDateColDef = require("./gridDateColDef");
10
10
  var _gridBooleanColDef = require("./gridBooleanColDef");
11
11
  var _gridSingleSelectColDef = require("./gridSingleSelectColDef");
12
12
  var _gridActionsColDef = require("./gridActionsColDef");
13
- const DEFAULT_GRID_COL_TYPE_KEY = exports.DEFAULT_GRID_COL_TYPE_KEY = '__default__';
13
+ const DEFAULT_GRID_COL_TYPE_KEY = exports.DEFAULT_GRID_COL_TYPE_KEY = 'string';
14
14
  const getGridDefaultColumnTypes = () => {
15
15
  const nativeColumnTypes = {
16
16
  string: _gridStringColDef.GRID_STRING_COL_DEF,
@@ -20,7 +20,7 @@ const getGridDefaultColumnTypes = () => {
20
20
  boolean: _gridBooleanColDef.GRID_BOOLEAN_COL_DEF,
21
21
  singleSelect: _gridSingleSelectColDef.GRID_SINGLE_SELECT_COL_DEF,
22
22
  [_gridActionsColDef.GRID_ACTIONS_COLUMN_TYPE]: _gridActionsColDef.GRID_ACTIONS_COL_DEF,
23
- [DEFAULT_GRID_COL_TYPE_KEY]: _gridStringColDef.GRID_STRING_COL_DEF
23
+ custom: _gridStringColDef.GRID_STRING_COL_DEF
24
24
  };
25
25
  return nativeColumnTypes;
26
26
  };
@@ -8,12 +8,13 @@ exports.GridHeader = GridHeader;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _useGridRootProps = require("../hooks/utils/useGridRootProps");
11
+ var _GridPreferencesPanel = require("./panel/GridPreferencesPanel");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
15
  function GridHeader() {
15
16
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
16
17
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
17
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.preferencesPanel, (0, _extends2.default)({}, rootProps.slotProps?.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.toolbar, (0, _extends2.default)({}, rootProps.slotProps?.toolbar))]
18
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridPreferencesPanel.GridPreferencesPanel, {}), rootProps.slots.toolbar && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.toolbar, (0, _extends2.default)({}, rootProps.slotProps?.toolbar))]
18
19
  });
19
20
  }
@@ -61,7 +61,6 @@ function EmptyCell({
61
61
  style: style
62
62
  }); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
63
63
  }
64
-
65
64
  const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
66
65
  const {
67
66
  selected,
@@ -145,9 +144,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
145
144
  }, [apiRef, currentPage.range, index, rowHeight, rowId, position]);
146
145
  const publish = React.useCallback((eventName, propHandler) => event => {
147
146
  // Ignore portal
148
- // The target is not an element when triggered by a Select inside the cell
149
- // See https://github.com/mui/material-ui/issues/10534
150
- if (event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
147
+ if ((0, _domUtils.isEventTargetInPortal)(event)) {
151
148
  return;
152
149
  }
153
150
 
@@ -203,7 +200,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
203
200
  const CellComponent = slots.cell === _GridCell.GridCellV7 ? _GridCell.GridCellV7 : _GridCell.GridCellWrapper;
204
201
  const rowReordering = rootProps.rowReordering;
205
202
  const getCell = (column, cellProps) => {
206
- const disableDragEvents = disableColumnReorder && column.disableReorder || !rowReordering && !!sortModel.length && treeDepth > 1 && Object.keys(editRowsState).length > 0;
203
+ // when the cell is a reorder cell we are not allowing to reorder the col
204
+ // fixes https://github.com/mui/mui-x/issues/11126
205
+ const isReorderCell = column.field === '__reorder__';
206
+ const isEditingRows = Object.keys(editRowsState).length > 0;
207
+ const canReorderColumn = !(disableColumnReorder || column.disableReorder);
208
+ const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
209
+ const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
207
210
  const editCellState = editRowsState[rowId]?.[column.field] ?? null;
208
211
  let cellIsNotVisible = false;
209
212
  if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
@@ -40,7 +40,6 @@ const GridOverlayWrapperRoot = (0, _system.styled)('div', {
40
40
  zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
41
41
  : 4 // Should be above pinned columns and detail panel
42
42
  }));
43
-
44
43
  const GridOverlayWrapperInner = (0, _system.styled)('div', {
45
44
  name: 'MuiDataGrid',
46
45
  slot: 'OverlayWrapperInner',
@@ -71,7 +70,6 @@ function GridOverlayWrapper(props) {
71
70
  if (rootProps.autoHeight && height === 0) {
72
71
  height = (0, _gridRowsUtils.getMinimalContentHeight)(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
73
72
  }
74
-
75
73
  const classes = useUtilityClasses((0, _extends2.default)({}, props, {
76
74
  classes: rootProps.classes
77
75
  }));
@@ -135,7 +135,6 @@ function GridActionsCell(props) {
135
135
  if (newIndex < 0 || newIndex >= numberOfButtons) {
136
136
  return; // We're already in the first or last item = do nothing and let the grid listen the event
137
137
  }
138
-
139
138
  if (newIndex !== focusedButtonIndex) {
140
139
  event.preventDefault(); // Prevent scrolling
141
140
  event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp