@mui/x-data-grid 7.0.0-alpha.3 → 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 (86) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/colDef/gridCheckboxSelectionColDef.js +1 -1
  3. package/colDef/gridDefaultColumnTypes.d.ts +2 -2
  4. package/colDef/gridDefaultColumnTypes.js +2 -2
  5. package/components/GridRow.js +7 -2
  6. package/components/base/GridOverlays.js +0 -2
  7. package/components/cell/GridActionsCell.js +0 -1
  8. package/components/cell/GridCell.js +0 -2
  9. package/components/virtualization/GridVirtualScroller.js +0 -1
  10. package/hooks/features/editing/useGridCellEditing.js +0 -2
  11. package/hooks/features/editing/useGridRowEditing.js +0 -1
  12. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
  13. package/hooks/features/focus/gridFocusStateSelector.js +2 -6
  14. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
  15. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  16. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
  17. package/hooks/features/rows/useGridRowsMeta.js +0 -1
  18. package/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  19. package/index.js +1 -1
  20. package/internals/index.d.ts +1 -1
  21. package/internals/index.js +1 -1
  22. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
  23. package/legacy/colDef/gridDefaultColumnTypes.js +2 -2
  24. package/legacy/components/GridRow.js +7 -2
  25. package/legacy/components/base/GridOverlays.js +0 -2
  26. package/legacy/components/cell/GridActionsCell.js +0 -1
  27. package/legacy/components/cell/GridCell.js +0 -2
  28. package/legacy/components/virtualization/GridVirtualScroller.js +0 -1
  29. package/legacy/hooks/features/editing/useGridCellEditing.js +0 -2
  30. package/legacy/hooks/features/editing/useGridRowEditing.js +0 -1
  31. package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
  32. package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  33. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
  34. package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -1
  35. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  36. package/legacy/index.js +1 -1
  37. package/legacy/internals/index.js +1 -1
  38. package/legacy/locales/coreLocales.js +1 -0
  39. package/legacy/locales/daDK.js +37 -39
  40. package/legacy/locales/plPL.js +0 -1
  41. package/legacy/utils/utils.js +0 -1
  42. package/locales/coreLocales.js +1 -0
  43. package/locales/daDK.js +37 -39
  44. package/locales/plPL.js +0 -1
  45. package/models/colDef/gridColType.d.ts +2 -4
  46. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
  47. package/modern/colDef/gridDefaultColumnTypes.js +2 -2
  48. package/modern/components/GridRow.js +7 -2
  49. package/modern/components/base/GridOverlays.js +0 -2
  50. package/modern/components/cell/GridActionsCell.js +0 -1
  51. package/modern/components/cell/GridCell.js +0 -2
  52. package/modern/components/virtualization/GridVirtualScroller.js +0 -1
  53. package/modern/hooks/features/editing/useGridCellEditing.js +0 -2
  54. package/modern/hooks/features/editing/useGridRowEditing.js +0 -1
  55. package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
  56. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
  57. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
  58. package/modern/hooks/features/rows/useGridRowsMeta.js +0 -1
  59. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  60. package/modern/index.js +1 -1
  61. package/modern/internals/index.js +1 -1
  62. package/modern/locales/coreLocales.js +1 -0
  63. package/modern/locales/daDK.js +37 -39
  64. package/modern/locales/plPL.js +0 -1
  65. package/modern/utils/utils.js +0 -1
  66. package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
  67. package/node/colDef/gridDefaultColumnTypes.js +2 -2
  68. package/node/components/GridRow.js +7 -2
  69. package/node/components/base/GridOverlays.js +0 -2
  70. package/node/components/cell/GridActionsCell.js +0 -1
  71. package/node/components/cell/GridCell.js +0 -2
  72. package/node/components/virtualization/GridVirtualScroller.js +0 -1
  73. package/node/hooks/features/editing/useGridCellEditing.js +0 -2
  74. package/node/hooks/features/editing/useGridRowEditing.js +0 -1
  75. package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
  76. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -7
  77. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -4
  78. package/node/hooks/features/rows/useGridRowsMeta.js +0 -1
  79. package/node/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
  80. package/node/index.js +1 -1
  81. package/node/internals/index.js +14 -14
  82. package/node/locales/daDK.js +37 -39
  83. package/node/locales/plPL.js +0 -1
  84. package/node/utils/utils.js +0 -1
  85. package/package.json +4 -4
  86. package/utils/utils.js +0 -1
@@ -14,7 +14,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPan
14
14
  import { gridPinnedRowsSelector } from '../rows/gridRowsSelector';
15
15
  import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
16
16
  import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
17
- import { unstable_gridHeaderFilteringEditFieldSelector, unstable_gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
17
+ import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
18
18
  import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
19
19
  import { isEventTargetInPortal } from '../../../utils/domUtils';
20
20
  function enrichPageRowsWithPinnedRows(apiRef, rows) {
@@ -72,7 +72,7 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
72
72
  }, [apiRef, initialCurrentPageRows]);
73
73
  var headerFilteringEnabled =
74
74
  // @ts-expect-error // TODO move relevant code to the `DataGridPro`
75
- props.signature !== 'DataGrid' && props.unstable_headerFilters;
75
+ props.signature !== 'DataGrid' && props.headerFilters;
76
76
 
77
77
  /**
78
78
  * @param {number} colIndex Index of the column to focus
@@ -240,8 +240,8 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
240
240
  if (!dimensions) {
241
241
  return;
242
242
  }
243
- var isEditing = unstable_gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
244
- var isHeaderMenuOpen = unstable_gridHeaderFilteringMenuSelector(apiRef) === params.field;
243
+ var isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
244
+ var isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
245
245
  if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
246
246
  return;
247
247
  }
@@ -507,7 +507,9 @@ export var useGridKeyboardNavigation = function useGridKeyboardNavigation(apiRef
507
507
  break;
508
508
  }
509
509
  var colDef = params.colDef;
510
- if (colDef && colDef.type === 'treeDataGroup') {
510
+ if (colDef &&
511
+ // `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
512
+ colDef.field === '__tree_data_group__') {
511
513
  break;
512
514
  }
513
515
  if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
@@ -68,7 +68,6 @@ export var useGridRowsMeta = function useGridRowsMeta(apiRef, props) {
68
68
  needsFirstMeasurement: true // Assume all rows will need to be measured by default
69
69
  };
70
70
  }
71
-
72
71
  var _rowsHeightLookup$cur = rowsHeightLookup.current[row.id],
73
72
  isResized = _rowsHeightLookup$cur.isResized,
74
73
  needsFirstMeasurement = _rowsHeightLookup$cur.needsFirstMeasurement,
@@ -585,7 +585,6 @@ export var useGridVirtualScroller = function useGridVirtualScroller(props) {
585
585
  if (rootProps.autoHeight && currentPage.rows.length === 0) {
586
586
  size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
587
587
  }
588
-
589
588
  return size;
590
589
  }, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
591
590
  React.useEffect(function () {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.0.0-alpha.3
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';
@@ -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 var beBYCore = {
7
8
  components: {
8
9
  MuiTablePagination: {
@@ -49,47 +49,45 @@ var daDKGrid = {
49
49
  filterPanelInputLabel: 'Værdi',
50
50
  filterPanelInputPlaceholder: 'Filter værdi',
51
51
  // Filter operators text
52
- filterOperatorContains: 'Indeholder',
53
- filterOperatorEquals: 'Lig med',
54
- filterOperatorStartsWith: 'Begynder med',
55
- filterOperatorEndsWith: 'Ender med',
56
- filterOperatorIs: 'Er lig med',
57
- filterOperatorNot: 'Er ikke lig med',
58
- filterOperatorAfter: 'Efter',
59
- filterOperatorOnOrAfter: ' eller efter',
60
- filterOperatorBefore: 'Før',
61
- filterOperatorOnOrBefore: ' eller før',
62
- filterOperatorIsEmpty: 'Indeholder ikke data',
63
- filterOperatorIsNotEmpty: 'Indeholder data',
52
+ filterOperatorContains: 'indeholder',
53
+ filterOperatorEquals: 'lig med',
54
+ filterOperatorStartsWith: 'begynder med',
55
+ filterOperatorEndsWith: 'ender med',
56
+ filterOperatorIs: 'er lig med',
57
+ filterOperatorNot: 'er ikke lig med',
58
+ filterOperatorAfter: 'efter',
59
+ filterOperatorOnOrAfter: ' eller efter',
60
+ filterOperatorBefore: 'før',
61
+ filterOperatorOnOrBefore: ' eller før',
62
+ filterOperatorIsEmpty: 'indeholder ikke data',
63
+ filterOperatorIsNotEmpty: 'indeholder data',
64
64
  filterOperatorIsAnyOf: 'indeholder en af',
65
- // 'filterOperator=': '=',
66
- // 'filterOperator!=': '!=',
67
- // 'filterOperator>': '>',
68
- // 'filterOperator>=': '>=',
69
- // 'filterOperator<': '<',
70
- // 'filterOperator<=': '<=',
71
-
65
+ 'filterOperator=': '=',
66
+ 'filterOperator!=': '!=',
67
+ 'filterOperator>': '>',
68
+ 'filterOperator>=': '>=',
69
+ 'filterOperator<': '<',
70
+ 'filterOperator<=': '<=',
72
71
  // Header filter operators text
73
- // headerFilterOperatorContains: 'Contains',
74
- // headerFilterOperatorEquals: 'Equals',
75
- // headerFilterOperatorStartsWith: 'Starts with',
76
- // headerFilterOperatorEndsWith: 'Ends with',
77
- // headerFilterOperatorIs: 'Is',
78
- // headerFilterOperatorNot: 'Is not',
79
- // headerFilterOperatorAfter: 'Is after',
80
- // headerFilterOperatorOnOrAfter: 'Is on or after',
81
- // headerFilterOperatorBefore: 'Is before',
82
- // headerFilterOperatorOnOrBefore: 'Is on or before',
83
- // headerFilterOperatorIsEmpty: 'Is empty',
84
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
85
- // headerFilterOperatorIsAnyOf: 'Is any of',
86
- // 'headerFilterOperator=': 'Equals',
87
- // 'headerFilterOperator!=': 'Not equals',
88
- // 'headerFilterOperator>': 'Greater than',
89
- // 'headerFilterOperator>=': 'Greater than or equal to',
90
- // 'headerFilterOperator<': 'Less than',
91
- // 'headerFilterOperator<=': 'Less than or equal to',
92
-
72
+ headerFilterOperatorContains: 'Indeholder',
73
+ headerFilterOperatorEquals: 'Lig med',
74
+ headerFilterOperatorStartsWith: 'Begynder med',
75
+ headerFilterOperatorEndsWith: 'Ender med',
76
+ headerFilterOperatorIs: 'Er lig med',
77
+ headerFilterOperatorNot: 'Er ikke lig med',
78
+ headerFilterOperatorAfter: 'Efter',
79
+ headerFilterOperatorOnOrAfter: ' eller efter',
80
+ headerFilterOperatorBefore: 'Før',
81
+ headerFilterOperatorOnOrBefore: ' eller før',
82
+ headerFilterOperatorIsEmpty: 'Indeholder ikke data',
83
+ headerFilterOperatorIsNotEmpty: 'Indeholder data',
84
+ headerFilterOperatorIsAnyOf: 'Indeholder en af',
85
+ 'headerFilterOperator=': 'Lig med',
86
+ 'headerFilterOperator!=': 'Ikke lig med',
87
+ 'headerFilterOperator>': 'Større end',
88
+ 'headerFilterOperator>=': 'Større end eller lig med',
89
+ 'headerFilterOperator<': 'Mindre end',
90
+ 'headerFilterOperator<=': 'Mindre end eller lig med',
93
91
  // Filter values text
94
92
  filterValueAny: 'hvilken som helst',
95
93
  filterValueTrue: 'positiv',
@@ -161,5 +161,4 @@ var plPLGrid = {
161
161
  // aggregationFunctionLabelMax: 'max',
162
162
  // aggregationFunctionLabelSize: 'size',
163
163
  };
164
-
165
164
  export var plPL = getGridLocalization(plPLGrid, plPLCore);
@@ -166,7 +166,6 @@ function mulberry32(a) {
166
166
  /* eslint-enable */
167
167
  };
168
168
  }
169
-
170
169
  export function randomNumberBetween(seed, min, max) {
171
170
  var random = mulberry32(seed);
172
171
  return function () {
@@ -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: {
package/locales/daDK.js CHANGED
@@ -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',
package/locales/plPL.js CHANGED
@@ -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);
@@ -1,4 +1,2 @@
1
- type LiteralUnion<LiteralType, BaseType> = LiteralType | (BaseType & Record<never, never>);
2
- export type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect' | 'actions';
3
- export type GridColType = LiteralUnion<GridNativeColTypes, string>;
4
- export {};
1
+ export type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect' | 'actions' | 'custom';
2
+ export type GridColType = GridNativeColTypes;
@@ -7,8 +7,8 @@ import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
9
9
  export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
10
+ type: 'custom',
10
11
  field: GRID_CHECKBOX_SELECTION_FIELD,
11
- type: 'checkboxSelection',
12
12
  width: 50,
13
13
  resizable: false,
14
14
  sortable: false,
@@ -4,7 +4,7 @@ import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
4
4
  import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
5
5
  import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
6
6
  import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
7
- export const DEFAULT_GRID_COL_TYPE_KEY = '__default__';
7
+ export const DEFAULT_GRID_COL_TYPE_KEY = 'string';
8
8
  export const getGridDefaultColumnTypes = () => {
9
9
  const nativeColumnTypes = {
10
10
  string: GRID_STRING_COL_DEF,
@@ -14,7 +14,7 @@ export const getGridDefaultColumnTypes = () => {
14
14
  boolean: GRID_BOOLEAN_COL_DEF,
15
15
  singleSelect: GRID_SINGLE_SELECT_COL_DEF,
16
16
  [GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,
17
- [DEFAULT_GRID_COL_TYPE_KEY]: GRID_STRING_COL_DEF
17
+ custom: GRID_STRING_COL_DEF
18
18
  };
19
19
  return nativeColumnTypes;
20
20
  };
@@ -53,7 +53,6 @@ function EmptyCell({
53
53
  style: style
54
54
  }); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
55
55
  }
56
-
57
56
  const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
58
57
  const {
59
58
  selected,
@@ -193,7 +192,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
193
192
  const CellComponent = slots.cell === GridCellV7 ? GridCellV7 : GridCellWrapper;
194
193
  const rowReordering = rootProps.rowReordering;
195
194
  const getCell = (column, cellProps) => {
196
- const disableDragEvents = disableColumnReorder && column.disableReorder || !rowReordering && !!sortModel.length && treeDepth > 1 && Object.keys(editRowsState).length > 0;
195
+ // when the cell is a reorder cell we are not allowing to reorder the col
196
+ // fixes https://github.com/mui/mui-x/issues/11126
197
+ const isReorderCell = column.field === '__reorder__';
198
+ const isEditingRows = Object.keys(editRowsState).length > 0;
199
+ const canReorderColumn = !(disableColumnReorder || column.disableReorder);
200
+ const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
201
+ const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
197
202
  const editCellState = editRowsState[rowId]?.[column.field] ?? null;
198
203
  let cellIsNotVisible = false;
199
204
  if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
@@ -31,7 +31,6 @@ const GridOverlayWrapperRoot = styled('div', {
31
31
  zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
32
32
  : 4 // Should be above pinned columns and detail panel
33
33
  }));
34
-
35
34
  const GridOverlayWrapperInner = styled('div', {
36
35
  name: 'MuiDataGrid',
37
36
  slot: 'OverlayWrapperInner',
@@ -62,7 +61,6 @@ function GridOverlayWrapper(props) {
62
61
  if (rootProps.autoHeight && height === 0) {
63
62
  height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
64
63
  }
65
-
66
64
  const classes = useUtilityClasses(_extends({}, props, {
67
65
  classes: rootProps.classes
68
66
  }));
@@ -126,7 +126,6 @@ function GridActionsCell(props) {
126
126
  if (newIndex < 0 || newIndex >= numberOfButtons) {
127
127
  return; // We're already in the first or last item = do nothing and let the grid listen the event
128
128
  }
129
-
130
129
  if (newIndex !== focusedButtonIndex) {
131
130
  event.preventDefault(); // Prevent scrolling
132
131
  event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
@@ -242,7 +242,6 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
242
242
  minHeight: height,
243
243
  maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
244
244
  };
245
-
246
245
  return cellStyle;
247
246
  }, [width, height, isNotVisible]);
248
247
  React.useEffect(() => {
@@ -510,7 +509,6 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
510
509
  minHeight: height,
511
510
  maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
512
511
  };
513
-
514
512
  return cellStyle;
515
513
  }, [width, height, isNotVisible]);
516
514
  React.useEffect(() => {
@@ -29,7 +29,6 @@ const VirtualScrollerRoot = styled('div', {
29
29
  },
30
30
  zIndex: 0 // See https://github.com/mui/mui-x/issues/10547
31
31
  });
32
-
33
32
  const GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
34
33
  const rootProps = useGridRootProps();
35
34
  const classes = useUtilityClasses(rootProps);
@@ -81,7 +81,6 @@ export const useGridCellEditing = (apiRef, props) => {
81
81
  reason = event.shiftKey ? GridCellEditStopReasons.shiftTabKeyDown : GridCellEditStopReasons.tabKeyDown;
82
82
  event.preventDefault(); // Prevent going to the next element in the tab sequence
83
83
  }
84
-
85
84
  if (reason) {
86
85
  const newParams = _extends({}, params, {
87
86
  reason
@@ -175,7 +174,6 @@ export const useGridCellEditing = (apiRef, props) => {
175
174
  if (props.cellModesModel && isNewModelDifferentFromProp) {
176
175
  return; // The prop always win
177
176
  }
178
-
179
177
  setCellModesModel(newModel);
180
178
  cellModesModelRef.current = newModel;
181
179
  apiRef.current.publishEvent('cellModesModelChange', newModel);
@@ -239,7 +239,6 @@ export const useGridRowEditing = (apiRef, props) => {
239
239
  if (props.rowModesModel && isNewModelDifferentFromProp) {
240
240
  return; // The prop always win
241
241
  }
242
-
243
242
  setRowModesModel(newModel);
244
243
  rowModesModelRef.current = newModel;
245
244
  apiRef.current.publishEvent('rowModesModelChange', newModel);
@@ -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,7 +13,7 @@ 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
18
  import { isEventTargetInPortal } from '../../../utils/domUtils';
19
19
  function enrichPageRowsWithPinnedRows(apiRef, rows) {
@@ -71,7 +71,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
71
71
  const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
72
72
  const headerFilteringEnabled =
73
73
  // @ts-expect-error // TODO move relevant code to the `DataGridPro`
74
- props.signature !== 'DataGrid' && props.unstable_headerFilters;
74
+ props.signature !== 'DataGrid' && props.headerFilters;
75
75
 
76
76
  /**
77
77
  * @param {number} colIndex Index of the column to focus
@@ -237,8 +237,8 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
237
237
  if (!dimensions) {
238
238
  return;
239
239
  }
240
- const isEditing = unstable_gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
241
- const isHeaderMenuOpen = unstable_gridHeaderFilteringMenuSelector(apiRef) === params.field;
240
+ const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
241
+ const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
242
242
  if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
243
243
  return;
244
244
  }
@@ -506,7 +506,9 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
506
506
  break;
507
507
  }
508
508
  const colDef = params.colDef;
509
- if (colDef && colDef.type === 'treeDataGroup') {
509
+ if (colDef &&
510
+ // `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
511
+ colDef.field === '__tree_data_group__') {
510
512
  break;
511
513
  }
512
514
  if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
@@ -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,
@@ -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.3
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';
@@ -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: {