@mui/x-data-grid 8.18.0 → 8.20.0

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 (162) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/DataGrid/useDataGridComponent.js +4 -3
  3. package/components/GridRow.js +5 -2
  4. package/components/GridRowDragAndDropOverlay.d.ts +7 -0
  5. package/components/GridRowDragAndDropOverlay.js +73 -0
  6. package/components/cell/GridActionsCell.d.ts +9 -0
  7. package/components/cell/GridActionsCell.js +54 -34
  8. package/components/cell/GridBooleanCell.js +0 -10
  9. package/components/cell/GridCell.js +4 -10
  10. package/components/columnHeaders/GridColumnHeaderItem.js +2 -2
  11. package/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
  12. package/components/containers/GridRootStyles.js +17 -40
  13. package/components/toolbarV8/Toolbar.js +1 -1
  14. package/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
  15. package/components/virtualization/GridVirtualScrollbar.js +13 -8
  16. package/components/virtualization/GridVirtualScroller.js +2 -1
  17. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
  18. package/constants/dataGridPropsDefaultValues.js +2 -1
  19. package/constants/gridClasses.d.ts +0 -8
  20. package/constants/gridClasses.js +1 -1
  21. package/esm/DataGrid/useDataGridComponent.js +5 -4
  22. package/esm/components/GridRow.js +5 -2
  23. package/esm/components/GridRowDragAndDropOverlay.d.ts +7 -0
  24. package/esm/components/GridRowDragAndDropOverlay.js +66 -0
  25. package/esm/components/cell/GridActionsCell.d.ts +9 -0
  26. package/esm/components/cell/GridActionsCell.js +55 -34
  27. package/esm/components/cell/GridBooleanCell.js +0 -10
  28. package/esm/components/cell/GridCell.js +4 -10
  29. package/esm/components/columnHeaders/GridColumnHeaderItem.js +2 -2
  30. package/esm/components/columnSelection/GridCellCheckboxRenderer.js +37 -22
  31. package/esm/components/containers/GridRootStyles.js +17 -40
  32. package/esm/components/toolbarV8/Toolbar.js +1 -1
  33. package/esm/components/virtualization/GridVirtualScrollbar.d.ts +1 -0
  34. package/esm/components/virtualization/GridVirtualScrollbar.js +12 -7
  35. package/esm/components/virtualization/GridVirtualScroller.js +2 -1
  36. package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
  37. package/esm/constants/dataGridPropsDefaultValues.js +2 -1
  38. package/esm/constants/gridClasses.d.ts +0 -8
  39. package/esm/constants/gridClasses.js +1 -1
  40. package/esm/hooks/core/gridPropsSelectors.d.ts +2 -1
  41. package/esm/hooks/core/gridPropsSelectors.js +3 -0
  42. package/esm/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
  43. package/esm/hooks/core/useGridProps.js +8 -2
  44. package/esm/hooks/core/useGridVirtualizer.d.ts +80 -6
  45. package/esm/hooks/core/useGridVirtualizer.js +27 -12
  46. package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
  47. package/esm/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
  48. package/esm/hooks/features/columns/useGridColumnSpanning.js +9 -4
  49. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
  50. package/esm/hooks/features/dimensions/useGridDimensions.js +12 -6
  51. package/esm/hooks/features/editing/useGridCellEditing.js +1 -1
  52. package/esm/hooks/features/editing/useGridRowEditing.js +1 -1
  53. package/esm/hooks/features/export/serializers/csvSerializer.js +2 -4
  54. package/esm/hooks/features/export/useGridPrintExport.js +18 -18
  55. package/esm/hooks/features/filter/gridFilterUtils.js +5 -11
  56. package/esm/hooks/features/filter/index.d.ts +1 -1
  57. package/esm/hooks/features/filter/index.js +1 -1
  58. package/esm/hooks/features/filter/useGridFilter.d.ts +1 -1
  59. package/esm/hooks/features/filter/useGridFilter.js +3 -1
  60. package/esm/hooks/features/focus/useGridFocus.js +0 -1
  61. package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  62. package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
  63. package/esm/hooks/features/pagination/useGridPaginationMeta.js +3 -3
  64. package/esm/hooks/features/pagination/useGridPaginationModel.js +7 -4
  65. package/esm/hooks/features/pagination/useGridRowCount.js +31 -15
  66. package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
  67. package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
  68. package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +19 -1
  69. package/esm/hooks/features/rowSelection/useGridRowSelection.js +17 -8
  70. package/esm/hooks/features/rowSelection/utils.d.ts +1 -0
  71. package/esm/hooks/features/rowSelection/utils.js +17 -4
  72. package/esm/hooks/features/rows/useGridRowSpanning.js +23 -60
  73. package/esm/hooks/features/rows/useGridRows.js +3 -1
  74. package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
  75. package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
  76. package/esm/hooks/features/scroll/useGridScroll.js +2 -3
  77. package/esm/hooks/features/sorting/gridSortingUtils.js +1 -3
  78. package/esm/hooks/features/sorting/useGridSorting.d.ts +1 -1
  79. package/esm/hooks/features/sorting/useGridSorting.js +3 -1
  80. package/esm/hooks/features/virtualization/useGridVirtualization.js +24 -5
  81. package/esm/hooks/utils/useGridEvent.js +6 -2
  82. package/esm/hooks/utils/useGridSelector.js +2 -4
  83. package/esm/hooks/utils/useRunOncePerLoop.d.ts +4 -1
  84. package/esm/hooks/utils/useRunOncePerLoop.js +28 -18
  85. package/esm/index.js +1 -1
  86. package/esm/internals/index.d.ts +5 -4
  87. package/esm/internals/index.js +3 -3
  88. package/esm/material/index.js +1 -4
  89. package/esm/models/api/gridRowApi.d.ts +14 -1
  90. package/esm/models/api/index.d.ts +1 -1
  91. package/esm/models/api/index.js +0 -1
  92. package/esm/models/colDef/gridColDef.d.ts +14 -0
  93. package/esm/models/configuration/gridConfiguration.d.ts +2 -2
  94. package/esm/models/configuration/gridRowConfiguration.d.ts +6 -5
  95. package/esm/models/events/gridEventLookup.d.ts +5 -0
  96. package/esm/models/gridStateCommunity.d.ts +1 -1
  97. package/esm/models/params/gridCellParams.d.ts +0 -10
  98. package/esm/models/props/DataGridProps.d.ts +13 -6
  99. package/esm/utils/keyboardUtils.d.ts +1 -8
  100. package/esm/utils/keyboardUtils.js +0 -7
  101. package/hooks/core/gridPropsSelectors.d.ts +2 -1
  102. package/hooks/core/gridPropsSelectors.js +4 -1
  103. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
  104. package/hooks/core/useGridProps.js +8 -2
  105. package/hooks/core/useGridVirtualizer.d.ts +80 -6
  106. package/hooks/core/useGridVirtualizer.js +26 -11
  107. package/hooks/features/columnGrouping/useGridColumnGrouping.js +6 -1
  108. package/hooks/features/columnMenu/useGridColumnMenu.js +14 -4
  109. package/hooks/features/columns/useGridColumnSpanning.js +9 -4
  110. package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
  111. package/hooks/features/dimensions/useGridDimensions.js +12 -6
  112. package/hooks/features/editing/useGridCellEditing.js +1 -1
  113. package/hooks/features/editing/useGridRowEditing.js +1 -1
  114. package/hooks/features/export/serializers/csvSerializer.js +2 -4
  115. package/hooks/features/export/useGridPrintExport.js +18 -18
  116. package/hooks/features/filter/gridFilterUtils.js +5 -11
  117. package/hooks/features/filter/index.d.ts +1 -1
  118. package/hooks/features/filter/index.js +6 -0
  119. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  120. package/hooks/features/filter/useGridFilter.js +3 -1
  121. package/hooks/features/focus/useGridFocus.js +0 -1
  122. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  123. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +189 -25
  124. package/hooks/features/pagination/useGridPaginationMeta.js +2 -2
  125. package/hooks/features/pagination/useGridPaginationModel.js +7 -4
  126. package/hooks/features/pagination/useGridRowCount.js +30 -14
  127. package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
  128. package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
  129. package/hooks/features/rowReorder/gridRowReorderSelector.js +20 -2
  130. package/hooks/features/rowSelection/useGridRowSelection.js +17 -8
  131. package/hooks/features/rowSelection/utils.d.ts +1 -0
  132. package/hooks/features/rowSelection/utils.js +16 -3
  133. package/hooks/features/rows/useGridRowSpanning.js +23 -60
  134. package/hooks/features/rows/useGridRows.js +3 -1
  135. package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
  136. package/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
  137. package/hooks/features/scroll/useGridScroll.js +2 -3
  138. package/hooks/features/sorting/gridSortingUtils.js +1 -3
  139. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  140. package/hooks/features/sorting/useGridSorting.js +3 -1
  141. package/hooks/features/virtualization/useGridVirtualization.js +24 -5
  142. package/hooks/utils/useGridEvent.js +6 -2
  143. package/hooks/utils/useGridSelector.js +2 -4
  144. package/hooks/utils/useRunOncePerLoop.d.ts +4 -1
  145. package/hooks/utils/useRunOncePerLoop.js +27 -18
  146. package/index.js +1 -1
  147. package/internals/index.d.ts +5 -4
  148. package/internals/index.js +16 -9
  149. package/material/index.js +1 -4
  150. package/models/api/gridRowApi.d.ts +14 -1
  151. package/models/api/index.d.ts +1 -1
  152. package/models/api/index.js +0 -11
  153. package/models/colDef/gridColDef.d.ts +14 -0
  154. package/models/configuration/gridConfiguration.d.ts +2 -2
  155. package/models/configuration/gridRowConfiguration.d.ts +6 -5
  156. package/models/events/gridEventLookup.d.ts +5 -0
  157. package/models/gridStateCommunity.d.ts +1 -1
  158. package/models/params/gridCellParams.d.ts +0 -10
  159. package/models/props/DataGridProps.d.ts +13 -6
  160. package/package.json +3 -3
  161. package/utils/keyboardUtils.d.ts +1 -8
  162. package/utils/keyboardUtils.js +1 -13
@@ -41,7 +41,7 @@ export { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.
41
41
  export { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.js";
42
42
  export { defaultGridFilterLookup } from "../hooks/features/filter/gridFilterState.js";
43
43
  export { passFilterLogic } from "../hooks/features/filter/gridFilterUtils.js";
44
- export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridExpandedSortedRowIndexLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.js";
44
+ export { gridFilteredChildrenCountLookupSelector, gridExpandedSortedRowTreeLevelPositionLookupSelector, gridFilteredSortedDepthRowEntriesSelector } from "../hooks/features/filter/gridFilterSelector.js";
45
45
  export { isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
46
46
  export type { GridAggregatedFilterItemApplier, GridAggregatedFilterItemApplierResult } from "../hooks/features/filter/gridFilterState.js";
47
47
  export { useGridFocus, focusStateInitializer } from "../hooks/features/focus/useGridFocus.js";
@@ -54,7 +54,7 @@ export { useGridRows, rowsStateInitializer } from "../hooks/features/rows/useGri
54
54
  export { useGridRowSpanning, rowSpanningStateInitializer } from "../hooks/features/rows/useGridRowSpanning.js";
55
55
  export { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.js";
56
56
  export { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.js";
57
- export { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
57
+ export { useGridRowsOverridableMethods as useGridRowsOverridableMethodsCommunity } from "../hooks/features/rows/useGridRowsOverridableMethods.js";
58
58
  export { useGridParamsOverridableMethods } from "../hooks/features/rows/useGridParamsOverridableMethods.js";
59
59
  export { useIsCellEditable } from "../hooks/features/editing/useGridCellEditable.js";
60
60
  export { useGridRowsPreProcessors } from "../hooks/features/rows/useGridRowsPreProcessors.js";
@@ -66,7 +66,7 @@ export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hoo
66
66
  export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
67
67
  export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
68
68
  export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
69
- export { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
69
+ export { gridIsRowDragActiveSelector, gridRowDropPositionSelector, gridRowDropTargetRowIdSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
70
70
  export type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowReorderInterfaces.js";
71
71
  export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
72
72
  export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
@@ -121,4 +121,5 @@ export type { GridConfiguration } from "../models/configuration/gridConfiguratio
121
121
  export type { CellEditableConditionFn } from "../models/configuration/gridCellEditableConfiguration.js";
122
122
  export * from "../hooks/features/pivoting/index.js";
123
123
  export { createSvgIcon } from "../material/icons/createSvgIcon.js";
124
- export { useGridPanelContext } from "../components/panel/GridPanelContext.js";
124
+ export { useGridPanelContext } from "../components/panel/GridPanelContext.js";
125
+ export type { RowReorderDropPosition, RowReorderDragDirection } from "../models/api/gridRowApi.js";
@@ -46,7 +46,6 @@ var _exportNames = {
46
46
  passFilterLogic: true,
47
47
  gridFilteredChildrenCountLookupSelector: true,
48
48
  gridExpandedSortedRowTreeLevelPositionLookupSelector: true,
49
- gridExpandedSortedRowIndexLookupSelector: true,
50
49
  gridFilteredSortedDepthRowEntriesSelector: true,
51
50
  useGridFocus: true,
52
51
  focusStateInitializer: true,
@@ -64,7 +63,7 @@ var _exportNames = {
64
63
  rowSpanningStateInitializer: true,
65
64
  useGridAriaAttributes: true,
66
65
  useGridRowAriaAttributes: true,
67
- useGridRowsOverridableMethods: true,
66
+ useGridRowsOverridableMethodsCommunity: true,
68
67
  useGridParamsOverridableMethods: true,
69
68
  useIsCellEditable: true,
70
69
  useGridRowsPreProcessors: true,
@@ -85,6 +84,8 @@ var _exportNames = {
85
84
  useGridRowSelection: true,
86
85
  rowSelectionStateInitializer: true,
87
86
  gridIsRowDragActiveSelector: true,
87
+ gridRowDropPositionSelector: true,
88
+ gridRowDropTargetRowIdSelector: true,
88
89
  useGridRowSelectionPreProcessors: true,
89
90
  useGridSorting: true,
90
91
  sortingStateInitializer: true,
@@ -396,12 +397,6 @@ Object.defineProperty(exports, "gridEditRowsStateSelector", {
396
397
  return _gridEditingSelectors.gridEditRowsStateSelector;
397
398
  }
398
399
  });
399
- Object.defineProperty(exports, "gridExpandedSortedRowIndexLookupSelector", {
400
- enumerable: true,
401
- get: function () {
402
- return _gridFilterSelector.gridExpandedSortedRowIndexLookupSelector;
403
- }
404
- });
405
400
  Object.defineProperty(exports, "gridExpandedSortedRowTreeLevelPositionLookupSelector", {
406
401
  enumerable: true,
407
402
  get: function () {
@@ -450,6 +445,18 @@ Object.defineProperty(exports, "gridPinnedRowsSelector", {
450
445
  return _gridRowsSelector.gridPinnedRowsSelector;
451
446
  }
452
447
  });
448
+ Object.defineProperty(exports, "gridRowDropPositionSelector", {
449
+ enumerable: true,
450
+ get: function () {
451
+ return _gridRowReorderSelector.gridRowDropPositionSelector;
452
+ }
453
+ });
454
+ Object.defineProperty(exports, "gridRowDropTargetRowIdSelector", {
455
+ enumerable: true,
456
+ get: function () {
457
+ return _gridRowReorderSelector.gridRowDropTargetRowIdSelector;
458
+ }
459
+ });
453
460
  Object.defineProperty(exports, "gridRowGroupsToFetchSelector", {
454
461
  enumerable: true,
455
462
  get: function () {
@@ -792,7 +799,7 @@ Object.defineProperty(exports, "useGridRowsMeta", {
792
799
  return _useGridRowsMeta.useGridRowsMeta;
793
800
  }
794
801
  });
795
- Object.defineProperty(exports, "useGridRowsOverridableMethods", {
802
+ Object.defineProperty(exports, "useGridRowsOverridableMethodsCommunity", {
796
803
  enumerable: true,
797
804
  get: function () {
798
805
  return _useGridRowsOverridableMethods.useGridRowsOverridableMethods;
package/material/index.js CHANGED
@@ -602,10 +602,7 @@ function BasePopper(props) {
602
602
  if (flip) {
603
603
  result.push({
604
604
  name: 'flip',
605
- enabled: true,
606
- options: {
607
- rootBoundary: 'document'
608
- }
605
+ enabled: true
609
606
  });
610
607
  }
611
608
  if (onDidShow || onDidHide) {
@@ -1,4 +1,6 @@
1
1
  import { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.js";
2
+ export type RowReorderDropPosition = 'above' | 'below' | 'inside';
3
+ export type RowReorderDragDirection = 'up' | 'down';
2
4
  export interface GridRowGroupChildrenGetterParams {
3
5
  /**
4
6
  * The row id of the group
@@ -96,10 +98,21 @@ export interface GridRowApi {
96
98
  export interface GridRowProApi {
97
99
  /**
98
100
  * Moves a row from its original position to the position given by `targetIndex`.
101
+ * Doesn't support tree data ordering. Use `setRowPosition()` instead.
99
102
  * @param {GridRowId} rowId The row id
100
103
  * @param {number} targetIndex The new position (0-based).
104
+ * @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
105
+ * @deprecated Use `setRowPosition()` instead. This method will be removed in the next major version.
101
106
  */
102
- setRowIndex: (rowId: GridRowId, targetIndex: number) => void;
107
+ setRowIndex: (rowId: GridRowId, targetIndex: number) => void | Promise<void>;
108
+ /**
109
+ * Moves a row to a new position relative to another row.
110
+ * @param {GridRowId} sourceRowId The ID of the row to move
111
+ * @param {GridRowId} targetRowId The ID of the row to position relative to
112
+ * @param {DropPosition} position Where to place the source row: 'above', 'below', or 'over' (for tree data)
113
+ * @returns {void | Promise<void>} Returns a Promise when async operations are involved (e.g., processRowUpdate)
114
+ */
115
+ setRowPosition: (sourceRowId: GridRowId, targetRowId: GridRowId, position: RowReorderDropPosition) => void | Promise<void>;
103
116
  /**
104
117
  * Gets the rows of a grouping criteria.
105
118
  * Only contains the rows provided to the grid, not the rows automatically generated by it.
@@ -3,7 +3,7 @@ export type { GridParamsApi } from "./gridParamsApi.js";
3
3
  export type { GridCoreApi } from "./gridCoreApi.js";
4
4
  export * from "./gridColumnApi.js";
5
5
  export * from "./gridDensityApi.js";
6
- export * from "./gridRowApi.js";
6
+ export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi } from "./gridRowApi.js";
7
7
  export type { GridRowsMetaApi } from "./gridRowsMetaApi.js";
8
8
  export * from "./gridRowSelectionApi.js";
9
9
  export * from "./gridSortApi.js";
@@ -25,17 +25,6 @@ Object.keys(_gridDensityApi).forEach(function (key) {
25
25
  }
26
26
  });
27
27
  });
28
- var _gridRowApi = require("./gridRowApi");
29
- Object.keys(_gridRowApi).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _gridRowApi[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _gridRowApi[key];
36
- }
37
- });
38
- });
39
28
  var _gridRowSelectionApi = require("./gridRowSelectionApi");
40
29
  Object.keys(_gridRowSelectionApi).forEach(function (key) {
41
30
  if (key === "default" || key === "__esModule") return;
@@ -257,6 +257,20 @@ export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F
257
257
  * Function that returns the actions to be shown.
258
258
  * @param {GridRowParams} params The params for each row.
259
259
  * @returns {readonly React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
260
+ * @deprecated Use `renderCell` instead
261
+ * @example
262
+ * // Before
263
+ * getActions: (params) => [
264
+ * <GridActionsCellItem icon={...} onClick={...} label="Delete" />,
265
+ * <GridActionsCellItem icon={...} onClick={...} label="Print" showInMenu />,
266
+ * ],
267
+ * // After
268
+ * renderCell: (params) => (
269
+ * <GridActionsCell {...params}>
270
+ * <GridActionsCellItem icon={...} onClick={...} label="Delete" />
271
+ * <GridActionsCellItem icon={...} onClick={...} label="Print" showInMenu />
272
+ * </GridActionsCell>
273
+ * ),
260
274
  */
261
275
  getActions: (params: GridRowParams<R>) => readonly React.ReactElement<GridActionsCellItemProps>[];
262
276
  }
@@ -3,14 +3,14 @@ import type { GridRowAriaAttributesInternalHook, GridRowsOverridableMethodsInter
3
3
  import type { GridAggregationInternalHooks } from "./gridAggregationConfiguration.js";
4
4
  import type { GridCellEditableInternalHook } from "./gridCellEditableConfiguration.js";
5
5
  import type { GridCSSVariablesInterface } from "../../constants/cssVariables.js";
6
- import { DataGridProcessedProps } from "../props/DataGridProps.js";
7
6
  import type { GridPrivateApiCommon } from "../api/gridApiCommon.js";
8
7
  import type { GridPrivateApiCommunity } from "../api/gridApiCommunity.js";
8
+ import type { DataGridProcessedProps } from "../props/DataGridProps.js";
9
9
  import type { GridParamsOverridableMethodsInternalHook } from "./gridParamsConfiguration.js";
10
10
  export interface GridAriaAttributesInternalHook {
11
11
  useGridAriaAttributes: () => React.HTMLAttributes<HTMLElement>;
12
12
  }
13
- export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api>, GridParamsOverridableMethodsInternalHook<Api> {
13
+ export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
14
14
  useCSSVariables: () => {
15
15
  id: string;
16
16
  variables: GridCSSVariablesInterface;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { RefObject } from '@mui/x-internals/types';
3
- import { GridTreeNode, GridRowId } from "../gridRows.js";
4
- import { DataGridProcessedProps } from "../props/DataGridProps.js";
3
+ import { GridTreeNode } from "../gridRows.js";
4
+ import { GridRowProApi } from "../api/index.js";
5
5
  /**
6
6
  * Get the ARIA attributes for a row
7
7
  * @param {GridTreeNode} rowNode The row node
@@ -15,8 +15,9 @@ export interface GridRowAriaAttributesInternalHook {
15
15
  /**
16
16
  * Overridable row methods interface, these methods could be overriden in a higher plan package.
17
17
  */
18
- export interface GridRowsOverridableMethodsInternalHook<Api> {
19
- useGridRowsOverridableMethods: (apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, 'processRowUpdate' | 'onProcessRowUpdateError' | 'dataSource'>) => {
20
- setRowIndex: (rowId: GridRowId, targetIndex: number) => void;
18
+ export interface GridRowsOverridableMethodsInternalHook<Api, Props> {
19
+ useGridRowsOverridableMethods: (apiRef: RefObject<Api>, props: Props) => {
20
+ setRowIndex: GridRowProApi['setRowIndex'];
21
+ setRowPosition: GridRowProApi['setRowPosition'];
21
22
  };
22
23
  }
@@ -516,6 +516,11 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
516
516
  * @ignore - do not document
517
517
  */
518
518
  sortedRowsSet: {};
519
+ /**
520
+ * Fired when the aggregations are done
521
+ * @ignore - do not document
522
+ */
523
+ aggregationLookupSet: {};
519
524
  /**
520
525
  * Fired when the expansion of a row is changed. Called with a [[GridGroupNode]] object.
521
526
  */
@@ -13,7 +13,7 @@ import type { GridRowReorderState } from "../hooks/features/rowReorder/gridRowRe
13
13
  * Some props are passed on the state to enable grid selectors to select
14
14
  * and react to them.
15
15
  */
16
- export type GridStateProps = Pick<DataGridProcessedProps, 'getRowId' | 'listView' | 'isCellEditable'>;
16
+ export type GridStateProps = Pick<DataGridProcessedProps, 'getRowId' | 'listView' | 'isCellEditable' | 'isRowSelectable'>;
17
17
  /**
18
18
  * The state of Data Grid.
19
19
  */
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { GridCellMode } from "../gridCell.js";
3
2
  import { GridRowId, GridRowModel, GridTreeNode, GridTreeNodeWithRender, GridValidRowModel } from "../gridRows.js";
4
3
  import type { GridStateColDef } from "../colDef/gridColDef.js";
@@ -58,9 +57,6 @@ export interface GridCellParams<R extends GridValidRowModel = any, V = unknown,
58
57
  */
59
58
  api: GridApiCommunity;
60
59
  }
61
- export interface FocusElement {
62
- focus(): void;
63
- }
64
60
  /**
65
61
  * GridCellParams containing api.
66
62
  */
@@ -69,12 +65,6 @@ export interface GridRenderCellParams<R extends GridValidRowModel = any, V = any
69
65
  * GridApi that let you manipulate the grid.
70
66
  */
71
67
  api: GridApiCommunity;
72
- /**
73
- * A ref allowing to set imperative focus.
74
- * It can be passed to the element that should receive focus.
75
- * @ignore - do not document.
76
- */
77
- focusElementRef?: React.Ref<FocusElement>;
78
68
  }
79
69
  /**
80
70
  * GridEditCellProps containing api.
@@ -79,13 +79,11 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
79
79
  */
80
80
  export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = any> {
81
81
  /**
82
- * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
82
+ * If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
83
+ * Use it instead of a flex parent container approach, if:
84
+ * - you don't need to set a minimum or maximum height for the Data Grid
85
+ * - you want to avoid the scrollbar flickering when the content changes
83
86
  * @default false
84
- * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
85
- * @example
86
- * <div style={{ display: 'flex', flexDirection: 'column' }}>
87
- * <DataGrid />
88
- * </div>
89
87
  */
90
88
  autoHeight: boolean;
91
89
  /**
@@ -381,6 +379,15 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
381
379
  * @default false
382
380
  */
383
381
  virtualizeColumnsWithAutoRowHeight: boolean;
382
+ /**
383
+ * Sets the tab navigation behavior for the Data Grid.
384
+ * - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
385
+ * - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
386
+ * - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
387
+ * - "all": Combines the "content" and "header" behavior.
388
+ * @default "none"
389
+ */
390
+ tabNavigation: 'none' | 'content' | 'header' | 'all';
384
391
  }
385
392
  /**
386
393
  * The Data Grid props with no default value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.18.0",
3
+ "version": "8.20.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",
@@ -42,8 +42,8 @@
42
42
  "clsx": "^2.1.1",
43
43
  "prop-types": "^15.8.1",
44
44
  "use-sync-external-store": "^1.6.0",
45
- "@mui/x-internals": "8.18.0",
46
- "@mui/x-virtualizer": "0.2.8"
45
+ "@mui/x-internals": "8.19.0",
46
+ "@mui/x-virtualizer": "0.2.10"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",
@@ -1,14 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export declare function isPrintableKey(event: React.KeyboardEvent<HTMLElement>): boolean;
3
- export declare const GRID_MULTIPLE_SELECTION_KEYS: string[];
4
- export declare const GRID_CELL_EXIT_EDIT_MODE_KEYS: string[];
5
- export declare const GRID_CELL_EDIT_COMMIT_KEYS: string[];
6
- export declare const isMultipleKey: (key: string) => boolean;
7
- export declare const isCellEnterEditModeKeys: (event: React.KeyboardEvent<HTMLElement>) => boolean;
8
- export declare const isCellExitEditModeKeys: (key: string) => boolean;
9
- export declare const isCellEditCommitKeys: (key: string) => boolean;
10
3
  export declare const isNavigationKey: (key: string) => boolean;
11
4
  export declare const isKeyboardEvent: (event: any) => event is React.KeyboardEvent<HTMLElement>;
12
- export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is "Escape" | "Tab";
5
+ export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is "Tab" | "Escape";
13
6
  export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
14
7
  export declare function isCopyShortcut(event: KeyboardEvent): boolean;
@@ -3,9 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isCellExitEditModeKeys = exports.isCellEnterEditModeKeys = exports.isCellEditCommitKeys = exports.GRID_MULTIPLE_SELECTION_KEYS = exports.GRID_CELL_EXIT_EDIT_MODE_KEYS = exports.GRID_CELL_EDIT_COMMIT_KEYS = void 0;
7
6
  exports.isCopyShortcut = isCopyShortcut;
8
- exports.isNavigationKey = exports.isMultipleKey = exports.isKeyboardEvent = exports.isHideMenuKey = void 0;
7
+ exports.isNavigationKey = exports.isKeyboardEvent = exports.isHideMenuKey = void 0;
9
8
  exports.isPasteShortcut = isPasteShortcut;
10
9
  exports.isPrintableKey = isPrintableKey;
11
10
  // Non printable keys have a name, for example "ArrowRight", see the whole list:
@@ -18,17 +17,6 @@ exports.isPrintableKey = isPrintableKey;
18
17
  function isPrintableKey(event) {
19
18
  return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
20
19
  }
21
- const GRID_MULTIPLE_SELECTION_KEYS = exports.GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
22
- const GRID_CELL_EXIT_EDIT_MODE_KEYS = exports.GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
23
- const GRID_CELL_EDIT_COMMIT_KEYS = exports.GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
24
- const isMultipleKey = key => GRID_MULTIPLE_SELECTION_KEYS.indexOf(key) > -1;
25
- exports.isMultipleKey = isMultipleKey;
26
- const isCellEnterEditModeKeys = event => isPrintableKey(event) || event.key === 'Enter' || event.key === 'Backspace' || event.key === 'Delete';
27
- exports.isCellEnterEditModeKeys = isCellEnterEditModeKeys;
28
- const isCellExitEditModeKeys = key => GRID_CELL_EXIT_EDIT_MODE_KEYS.indexOf(key) > -1;
29
- exports.isCellExitEditModeKeys = isCellExitEditModeKeys;
30
- const isCellEditCommitKeys = key => GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;
31
- exports.isCellEditCommitKeys = isCellEditCommitKeys;
32
20
  const isNavigationKey = key => key.indexOf('Arrow') === 0 || key.indexOf('Page') === 0 || key === ' ' || key === 'Home' || key === 'End';
33
21
  exports.isNavigationKey = isNavigationKey;
34
22
  const isKeyboardEvent = event => !!event.key;