@mui/x-data-grid 6.0.0-alpha.2 → 6.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 (293) hide show
  1. package/CHANGELOG.md +493 -141
  2. package/DataGrid/DataGrid.js +14 -34
  3. package/DataGrid/useDataGridComponent.js +8 -14
  4. package/DataGrid/useDataGridProps.js +3 -3
  5. package/colDef/gridCheckboxSelectionColDef.js +1 -1
  6. package/colDef/gridNumericOperators.d.ts +1 -1
  7. package/colDef/gridSingleSelectOperators.d.ts +1 -1
  8. package/colDef/gridStringOperators.d.ts +1 -1
  9. package/components/GridFooter.js +1 -1
  10. package/components/GridRow.js +2 -2
  11. package/components/base/GridBody.js +2 -2
  12. package/components/cell/GridEditInputCell.js +3 -8
  13. package/components/cell/GridEditSingleSelectCell.js +6 -38
  14. package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -0
  15. package/components/columnHeaders/GridColumnGroupHeader.js +32 -5
  16. package/components/columnSelection/GridHeaderCheckbox.js +3 -3
  17. package/components/containers/GridRoot.js +4 -3
  18. package/components/panel/GridColumnsPanel.d.ts +2 -0
  19. package/components/panel/GridColumnsPanel.js +10 -4
  20. package/components/panel/filterPanel/GridFilterForm.d.ts +12 -0
  21. package/components/panel/filterPanel/GridFilterForm.js +29 -7
  22. package/components/panel/filterPanel/GridFilterPanel.d.ts +12 -0
  23. package/components/panel/filterPanel/GridFilterPanel.js +64 -19
  24. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
  25. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
  26. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
  27. package/hooks/core/useGridInitialization.d.ts +1 -1
  28. package/hooks/core/useGridStateInitialization.d.ts +1 -1
  29. package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.d.ts +10 -1
  30. package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +6 -0
  31. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +34 -1
  32. package/hooks/features/columnGrouping/gridColumnGroupsUtils.d.ts +15 -0
  33. package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +89 -0
  34. package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -15
  35. package/hooks/features/columnGrouping/useGridColumnGrouping.js +66 -66
  36. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
  37. package/hooks/features/columnHeaders/useGridColumnHeaders.js +60 -116
  38. package/hooks/features/density/densitySelector.d.ts +0 -2
  39. package/hooks/features/density/densitySelector.js +1 -3
  40. package/hooks/features/density/densityState.d.ts +0 -1
  41. package/hooks/features/density/useGridDensity.d.ts +1 -1
  42. package/hooks/features/density/useGridDensity.js +9 -45
  43. package/hooks/features/dimensions/useGridDimensions.js +3 -2
  44. package/hooks/features/{editRows/gridEditRowsSelector.d.ts → editing/gridEditingSelectors.d.ts} +0 -0
  45. package/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
  46. package/hooks/features/editing/index.d.ts +1 -0
  47. package/hooks/features/editing/index.js +1 -0
  48. package/hooks/features/{editRows/useGridCellEditing.new.d.ts → editing/useGridCellEditing.d.ts} +0 -0
  49. package/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
  50. package/hooks/features/{editRows/useGridEditing.new.d.ts → editing/useGridEditing.d.ts} +0 -0
  51. package/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
  52. package/hooks/features/{editRows/useGridRowEditing.new.d.ts → editing/useGridRowEditing.d.ts} +0 -0
  53. package/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
  54. package/hooks/features/export/useGridPrintExport.js +2 -2
  55. package/hooks/features/focus/gridFocusState.d.ts +6 -0
  56. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
  57. package/hooks/features/focus/gridFocusStateSelector.js +6 -2
  58. package/hooks/features/focus/useGridFocus.js +69 -11
  59. package/hooks/features/index.d.ts +2 -2
  60. package/hooks/features/index.js +2 -2
  61. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +135 -1
  62. package/hooks/features/{selection/gridSelectionSelector.d.ts → rowSelection/gridRowSelectionSelector.d.ts} +1 -1
  63. package/hooks/features/rowSelection/gridRowSelectionSelector.js +9 -0
  64. package/hooks/features/rowSelection/index.d.ts +1 -0
  65. package/hooks/features/rowSelection/index.js +1 -0
  66. package/hooks/features/rowSelection/useGridRowSelection.d.ts +12 -0
  67. package/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
  68. package/hooks/features/{selection/useGridSelectionPreProcessors.d.ts → rowSelection/useGridRowSelectionPreProcessors.d.ts} +1 -1
  69. package/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
  70. package/hooks/features/rows/gridRowsInterfaces.d.ts +4 -0
  71. package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
  72. package/hooks/features/rows/gridRowsUtils.js +5 -2
  73. package/hooks/features/rows/useGridRows.js +23 -7
  74. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
  75. package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  76. package/hooks/utils/useGridApi.d.ts +1 -1
  77. package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
  78. package/hooks/utils/useGridApiRef.d.ts +1 -1
  79. package/hooks/utils/useGridInitializeState.d.ts +1 -1
  80. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  81. package/hooks/utils/useGridSelector.d.ts +1 -1
  82. package/hooks/utils/useGridState.d.ts +1 -1
  83. package/hooks/utils/useGridVisibleRows.d.ts +2 -2
  84. package/index.js +1 -1
  85. package/internals/index.d.ts +3 -5
  86. package/internals/index.js +3 -5
  87. package/legacy/DataGrid/DataGrid.js +14 -34
  88. package/legacy/DataGrid/useDataGridComponent.js +8 -14
  89. package/legacy/DataGrid/useDataGridProps.js +3 -3
  90. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
  91. package/legacy/components/GridFooter.js +1 -1
  92. package/legacy/components/GridRow.js +2 -2
  93. package/legacy/components/base/GridBody.js +2 -2
  94. package/legacy/components/cell/GridEditInputCell.js +3 -8
  95. package/legacy/components/cell/GridEditSingleSelectCell.js +6 -52
  96. package/legacy/components/columnHeaders/GridColumnGroupHeader.js +46 -13
  97. package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
  98. package/legacy/components/containers/GridRoot.js +4 -3
  99. package/legacy/components/panel/GridColumnsPanel.js +10 -3
  100. package/legacy/components/panel/filterPanel/GridFilterForm.js +31 -7
  101. package/legacy/components/panel/filterPanel/GridFilterPanel.js +67 -18
  102. package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +33 -1
  103. package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +96 -0
  104. package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +64 -64
  105. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +70 -122
  106. package/legacy/hooks/features/density/densitySelector.js +0 -6
  107. package/legacy/hooks/features/density/useGridDensity.js +6 -44
  108. package/legacy/hooks/features/dimensions/useGridDimensions.js +3 -2
  109. package/legacy/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
  110. package/legacy/hooks/features/editing/index.js +1 -0
  111. package/legacy/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
  112. package/legacy/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
  113. package/legacy/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
  114. package/legacy/hooks/features/export/useGridPrintExport.js +2 -2
  115. package/legacy/hooks/features/focus/gridFocusStateSelector.js +8 -0
  116. package/legacy/hooks/features/focus/useGridFocus.js +72 -11
  117. package/legacy/hooks/features/index.js +2 -2
  118. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +129 -1
  119. package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +19 -0
  120. package/legacy/hooks/features/rowSelection/index.js +1 -0
  121. package/legacy/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
  122. package/legacy/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
  123. package/legacy/hooks/features/rows/gridRowsUtils.js +5 -2
  124. package/legacy/hooks/features/rows/useGridRows.js +25 -7
  125. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  126. package/legacy/index.js +1 -1
  127. package/legacy/internals/index.js +3 -5
  128. package/legacy/locales/trTR.js +17 -17
  129. package/legacy/models/api/{gridSelectionApi.js → gridRowSelectionApi.js} +0 -0
  130. package/legacy/models/api/index.js +1 -1
  131. package/legacy/models/{gridSelectionModel.js → gridRowSelectionModel.js} +0 -0
  132. package/legacy/models/index.js +1 -1
  133. package/{models/api/gridSelectionApi.js → legacy/models/params/gridColumnGroupHeaderParams.js} +0 -0
  134. package/legacy/models/params/gridEditCellParams.js +0 -4
  135. package/legacy/models/params/index.js +1 -0
  136. package/locales/trTR.js +17 -17
  137. package/models/api/gridApiCommon.d.ts +3 -6
  138. package/models/api/gridApiCommunity.d.ts +1 -7
  139. package/models/api/gridEditingApi.d.ts +36 -121
  140. package/models/api/gridFocusApi.d.ts +13 -0
  141. package/models/api/{gridSelectionApi.d.ts → gridRowSelectionApi.d.ts} +2 -2
  142. package/models/{gridSelectionModel.js → api/gridRowSelectionApi.js} +0 -0
  143. package/models/api/index.d.ts +2 -2
  144. package/models/api/index.js +1 -1
  145. package/models/colDef/gridColDef.d.ts +0 -8
  146. package/models/events/gridEventLookup.d.ts +30 -19
  147. package/models/gridColumnGrouping.d.ts +1 -26
  148. package/models/gridRowSelectionModel.d.ts +3 -0
  149. package/{modern/models/api/gridSelectionApi.js → models/gridRowSelectionModel.js} +0 -0
  150. package/models/gridStateCommunity.d.ts +2 -2
  151. package/models/index.d.ts +1 -1
  152. package/models/index.js +1 -1
  153. package/models/params/gridColumnGroupHeaderParams.d.ts +30 -0
  154. package/{modern/models/gridSelectionModel.js → models/params/gridColumnGroupHeaderParams.js} +0 -0
  155. package/models/params/gridEditCellParams.d.ts +4 -17
  156. package/models/params/gridEditCellParams.js +0 -4
  157. package/models/params/gridRowParams.d.ts +4 -4
  158. package/models/params/index.d.ts +1 -0
  159. package/models/params/index.js +1 -0
  160. package/models/props/DataGridProps.d.ts +8 -32
  161. package/modern/DataGrid/DataGrid.js +14 -34
  162. package/modern/DataGrid/useDataGridComponent.js +8 -12
  163. package/modern/DataGrid/useDataGridProps.js +3 -3
  164. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
  165. package/modern/components/GridFooter.js +1 -1
  166. package/modern/components/GridRow.js +2 -2
  167. package/modern/components/base/GridBody.js +2 -2
  168. package/modern/components/cell/GridEditInputCell.js +3 -4
  169. package/modern/components/cell/GridEditSingleSelectCell.js +6 -34
  170. package/modern/components/columnHeaders/GridColumnGroupHeader.js +32 -5
  171. package/modern/components/columnSelection/GridHeaderCheckbox.js +3 -3
  172. package/modern/components/containers/GridRoot.js +4 -3
  173. package/modern/components/panel/GridColumnsPanel.js +10 -4
  174. package/modern/components/panel/filterPanel/GridFilterForm.js +29 -7
  175. package/modern/components/panel/filterPanel/GridFilterPanel.js +62 -17
  176. package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +14 -1
  177. package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +83 -0
  178. package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +50 -62
  179. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +58 -98
  180. package/modern/hooks/features/density/densitySelector.js +1 -3
  181. package/modern/hooks/features/density/useGridDensity.js +9 -37
  182. package/modern/hooks/features/dimensions/useGridDimensions.js +3 -2
  183. package/modern/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
  184. package/modern/hooks/features/editing/index.js +1 -0
  185. package/modern/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
  186. package/modern/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
  187. package/modern/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
  188. package/modern/hooks/features/export/useGridPrintExport.js +2 -2
  189. package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -2
  190. package/modern/hooks/features/focus/useGridFocus.js +69 -11
  191. package/modern/hooks/features/index.js +2 -2
  192. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +135 -1
  193. package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +9 -0
  194. package/modern/hooks/features/rowSelection/index.js +1 -0
  195. package/modern/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
  196. package/modern/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
  197. package/modern/hooks/features/rows/gridRowsUtils.js +5 -2
  198. package/modern/hooks/features/rows/useGridRows.js +23 -7
  199. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  200. package/modern/index.js +1 -1
  201. package/modern/internals/index.js +3 -5
  202. package/modern/locales/trTR.js +17 -17
  203. package/modern/models/api/gridRowSelectionApi.js +1 -0
  204. package/modern/models/api/index.js +1 -1
  205. package/modern/models/gridRowSelectionModel.js +1 -0
  206. package/modern/models/index.js +1 -1
  207. package/modern/models/params/gridColumnGroupHeaderParams.js +1 -0
  208. package/modern/models/params/gridEditCellParams.js +0 -4
  209. package/modern/models/params/index.js +1 -0
  210. package/node/DataGrid/DataGrid.js +14 -34
  211. package/node/DataGrid/useDataGridComponent.js +9 -17
  212. package/node/DataGrid/useDataGridProps.js +3 -3
  213. package/node/colDef/gridCheckboxSelectionColDef.js +2 -2
  214. package/node/components/GridFooter.js +2 -2
  215. package/node/components/GridRow.js +2 -2
  216. package/node/components/base/GridBody.js +2 -2
  217. package/node/components/cell/GridEditInputCell.js +3 -9
  218. package/node/components/cell/GridEditSingleSelectCell.js +6 -38
  219. package/node/components/columnHeaders/GridColumnGroupHeader.js +32 -5
  220. package/node/components/columnSelection/GridHeaderCheckbox.js +3 -3
  221. package/node/components/containers/GridRoot.js +4 -2
  222. package/node/components/panel/GridColumnsPanel.js +10 -4
  223. package/node/components/panel/filterPanel/GridFilterForm.js +30 -7
  224. package/node/components/panel/filterPanel/GridFilterPanel.js +63 -19
  225. package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +40 -3
  226. package/node/hooks/features/columnGrouping/gridColumnGroupsUtils.js +102 -0
  227. package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +68 -71
  228. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +57 -113
  229. package/node/hooks/features/density/densitySelector.js +2 -6
  230. package/node/hooks/features/density/useGridDensity.js +9 -48
  231. package/node/hooks/features/dimensions/useGridDimensions.js +3 -1
  232. package/node/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
  233. package/node/hooks/features/{editRows → editing}/index.js +4 -4
  234. package/node/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +28 -13
  235. package/node/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +4 -4
  236. package/node/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +28 -14
  237. package/node/hooks/features/export/useGridPrintExport.js +2 -2
  238. package/node/hooks/features/focus/gridFocusStateSelector.js +10 -4
  239. package/node/hooks/features/focus/useGridFocus.js +68 -10
  240. package/node/hooks/features/index.js +8 -8
  241. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +138 -1
  242. package/node/hooks/features/{selection/gridSelectionSelector.js → rowSelection/gridRowSelectionSelector.js} +6 -6
  243. package/node/hooks/features/rowSelection/index.js +18 -0
  244. package/node/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +43 -43
  245. package/node/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +3 -3
  246. package/node/hooks/features/rows/gridRowsUtils.js +5 -2
  247. package/node/hooks/features/rows/useGridRows.js +23 -7
  248. package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  249. package/node/index.js +1 -1
  250. package/node/internals/index.js +23 -45
  251. package/node/locales/trTR.js +17 -17
  252. package/node/models/api/{gridSelectionApi.js → gridRowSelectionApi.js} +0 -0
  253. package/node/models/api/index.js +4 -4
  254. package/node/models/{gridSelectionModel.js → gridRowSelectionModel.js} +0 -0
  255. package/node/models/index.js +4 -4
  256. package/node/models/params/gridColumnGroupHeaderParams.js +5 -0
  257. package/node/models/params/gridEditCellParams.js +0 -3
  258. package/node/models/params/index.js +13 -0
  259. package/package.json +2 -2
  260. package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.d.ts +0 -4
  261. package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -35
  262. package/hooks/features/editRows/index.d.ts +0 -1
  263. package/hooks/features/editRows/index.js +0 -1
  264. package/hooks/features/editRows/useGridCellEditing.old.d.ts +0 -4
  265. package/hooks/features/editRows/useGridCellEditing.old.js +0 -359
  266. package/hooks/features/editRows/useGridEditing.old.d.ts +0 -11
  267. package/hooks/features/editRows/useGridEditing.old.js +0 -167
  268. package/hooks/features/editRows/useGridRowEditing.old.d.ts +0 -4
  269. package/hooks/features/editRows/useGridRowEditing.old.js +0 -334
  270. package/hooks/features/selection/gridSelectionSelector.js +0 -9
  271. package/hooks/features/selection/index.d.ts +0 -1
  272. package/hooks/features/selection/index.js +0 -1
  273. package/hooks/features/selection/useGridSelection.d.ts +0 -12
  274. package/legacy/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -35
  275. package/legacy/hooks/features/editRows/index.js +0 -1
  276. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +0 -411
  277. package/legacy/hooks/features/editRows/useGridEditing.old.js +0 -184
  278. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +0 -505
  279. package/legacy/hooks/features/selection/gridSelectionSelector.js +0 -19
  280. package/legacy/hooks/features/selection/index.js +0 -1
  281. package/models/gridSelectionModel.d.ts +0 -3
  282. package/modern/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -29
  283. package/modern/hooks/features/editRows/index.js +0 -1
  284. package/modern/hooks/features/editRows/useGridCellEditing.old.js +0 -355
  285. package/modern/hooks/features/editRows/useGridEditing.old.js +0 -163
  286. package/modern/hooks/features/editRows/useGridRowEditing.old.js +0 -326
  287. package/modern/hooks/features/selection/gridSelectionSelector.js +0 -9
  288. package/modern/hooks/features/selection/index.js +0 -1
  289. package/node/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -55
  290. package/node/hooks/features/editRows/useGridCellEditing.old.js +0 -380
  291. package/node/hooks/features/editRows/useGridEditing.old.js +0 -193
  292. package/node/hooks/features/editRows/useGridRowEditing.old.js +0 -358
  293. package/node/hooks/features/selection/index.js +0 -18
@@ -16,7 +16,8 @@ export var rowsStateInitializer = function rowsStateInitializer(state, props, ap
16
16
  apiRef.current.unstable_caches.rows = createRowsInternalCache({
17
17
  rows: props.rows,
18
18
  getRowId: props.getRowId,
19
- loading: props.loading
19
+ loading: props.loading,
20
+ rowCount: props.rowCount
20
21
  });
21
22
  return _extends({}, state, {
22
23
  rows: getRowsStateFromCache({
@@ -117,11 +118,12 @@ export var useGridRows = function useGridRows(apiRef, props) {
117
118
  cache: createRowsInternalCache({
118
119
  rows: rows,
119
120
  getRowId: props.getRowId,
120
- loading: props.loading
121
+ loading: props.loading,
122
+ rowCount: props.rowCount
121
123
  }),
122
124
  throttle: true
123
125
  });
124
- }, [logger, props.getRowId, props.loading, throttledRowsChange]);
126
+ }, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
125
127
  var updateRows = React.useCallback(function (updates) {
126
128
  if (props.signature === GridSignature.DataGrid && updates.length > 1) {
127
129
  // TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
@@ -374,7 +376,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
374
376
  cache = createRowsInternalCache({
375
377
  rows: props.rows,
376
378
  getRowId: props.getRowId,
377
- loading: props.loading
379
+ loading: props.loading,
380
+ rowCount: props.rowCount
378
381
  });
379
382
  }
380
383
 
@@ -382,7 +385,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
382
385
  cache: cache,
383
386
  throttle: false
384
387
  });
385
- }, [logger, apiRef, props.rows, props.getRowId, props.loading, throttledRowsChange]);
388
+ }, [logger, apiRef, props.rows, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
386
389
  var handleStrategyProcessorChange = React.useCallback(function (methodName) {
387
390
  if (methodName === 'rowTreeCreation') {
388
391
  groupRows();
@@ -445,7 +448,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
445
448
  }
446
449
 
447
450
  var areNewRowsAlreadyInState = apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows;
448
- var isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
451
+ var isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading;
452
+ var isNewRowCountAlreadyInState = apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates === props.rowCount; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
449
453
 
450
454
  if (areNewRowsAlreadyInState) {
451
455
  // If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`
@@ -461,6 +465,19 @@ export var useGridRows = function useGridRows(apiRef, props) {
461
465
  apiRef.current.forceUpdate();
462
466
  }
463
467
 
468
+ if (!isNewRowCountAlreadyInState) {
469
+ apiRef.current.setState(function (state) {
470
+ return _extends({}, state, {
471
+ rows: _extends({}, state.rows, {
472
+ totalRowCount: Math.max(props.rowCount || 0, state.rows.totalRowCount),
473
+ totalTopLevelRowCount: Math.max(props.rowCount || 0, state.rows.totalTopLevelRowCount)
474
+ })
475
+ });
476
+ });
477
+ apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates = props.rowCount;
478
+ apiRef.current.forceUpdate();
479
+ }
480
+
464
481
  return;
465
482
  }
466
483
 
@@ -469,7 +486,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
469
486
  cache: createRowsInternalCache({
470
487
  rows: props.rows,
471
488
  getRowId: props.getRowId,
472
- loading: props.loading
489
+ loading: props.loading,
490
+ rowCount: props.rowCount
473
491
  }),
474
492
  throttle: false
475
493
  });
@@ -10,11 +10,11 @@ import { useGridRootProps } from '../../utils/useGridRootProps';
10
10
  import { useGridSelector } from '../../utils/useGridSelector';
11
11
  import { gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from '../columns/gridColumnsSelector';
12
12
  import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
13
- import { gridEditRowsStateSelector } from '../editRows/gridEditRowsSelector';
13
+ import { gridEditRowsStateSelector } from '../editing/gridEditingSelectors';
14
14
  import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
15
15
  import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
16
16
  import { clamp } from '../../../utils/utils';
17
- import { selectedIdsLookupSelector } from '../selection/gridSelectionSelector';
17
+ import { selectedIdsLookupSelector } from '../rowSelection/gridRowSelectionSelector';
18
18
  import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
19
19
  import { getFirstNonSpannedColumnToRender } from '../columns/gridColumnsUtils';
20
20
  import { getMinimalContentHeight } from '../rows/gridRowsUtils'; // Uses binary search to avoid looping through all possible positions
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v6.0.0-alpha.2
1
+ /** @license MUI v6.0.0-alpha.4
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -12,7 +12,6 @@ export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features
12
12
  export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
13
13
  export { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
14
14
  export { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
15
- export { useGridColumnGroupingPreProcessors } from '../hooks/features/columnGrouping/useGridColumnGroupingPreProcessors';
16
15
  export { useGridDensity, densityStateInitializer } from '../hooks/features/density/useGridDensity';
17
16
  export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
18
17
  export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
@@ -22,8 +21,7 @@ export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/use
22
21
  export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
23
22
  export { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
24
23
  export { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
25
- export { useGridEditing as useGridEditing_new, editingStateInitializer as editingStateInitializer_new } from '../hooks/features/editRows/useGridEditing.new';
26
- export { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old } from '../hooks/features/editRows/useGridEditing.old';
24
+ export { useGridEditing, editingStateInitializer } from '../hooks/features/editing/useGridEditing';
27
25
  export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
28
26
  export { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';
29
27
  export { getTreeNodeDescendants, buildRootGroup } from '../hooks/features/rows/gridRowsUtils';
@@ -32,8 +30,8 @@ export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
32
30
  export { getRowIdFromRowModel } from '../hooks/features/rows/gridRowsUtils';
33
31
  export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from '../hooks/features/rows/gridRowsSelector';
34
32
  export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
35
- export { useGridSelection, selectionStateInitializer } from '../hooks/features/selection/useGridSelection';
36
- export { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';
33
+ export { useGridRowSelection, rowSelectionStateInitializer } from '../hooks/features/rowSelection/useGridRowSelection';
34
+ export { useGridRowSelectionPreProcessors } from '../hooks/features/rowSelection/useGridRowSelectionPreProcessors';
37
35
  export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
38
36
  export { useGridScroll } from '../hooks/features/scroll/useGridScroll';
39
37
  export { useGridEvents } from '../hooks/features/events/useGridEvents';
@@ -41,7 +41,7 @@ var trTRGrid = {
41
41
  // Filter panel text
42
42
  filterPanelAddFilter: 'Filtre Ekle',
43
43
  filterPanelDeleteIconLabel: 'Kaldır',
44
- // filterPanelLinkOperator: 'Logic operator',
44
+ filterPanelLinkOperator: 'Mantıksal operatörler',
45
45
  filterPanelOperators: 'Operatör',
46
46
  // TODO v6: rename to filterPanelOperator
47
47
  filterPanelOperatorAnd: 'Ve',
@@ -93,13 +93,13 @@ var trTRGrid = {
93
93
  },
94
94
  // Checkbox selection text
95
95
  checkboxSelectionHeaderName: 'Seçim',
96
- // checkboxSelectionSelectAllRows: 'Select all rows',
97
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
98
- // checkboxSelectionSelectRow: 'Select row',
99
- // checkboxSelectionUnselectRow: 'Unselect row',
96
+ checkboxSelectionSelectAllRows: 'Tüm satırları seç',
97
+ checkboxSelectionUnselectAllRows: 'Tüm satırların seçimini kaldır',
98
+ checkboxSelectionSelectRow: 'Satırı seç',
99
+ checkboxSelectionUnselectRow: 'Satır seçimini bırak',
100
100
  // Boolean cell text
101
- // booleanCellTrueLabel: 'yes',
102
- // booleanCellFalseLabel: 'no',
101
+ booleanCellTrueLabel: 'Evet',
102
+ booleanCellFalseLabel: 'Hayır',
103
103
  // Actions cell more text
104
104
  actionsCellMore: 'daha fazla',
105
105
  // Column pinning text
@@ -119,17 +119,17 @@ var trTRGrid = {
119
119
  return "".concat(name, " i\xE7in gruplamay\u0131 kald\u0131r");
120
120
  },
121
121
  // Master/detail
122
- // detailPanelToggle: 'Detail panel toggle',
122
+ detailPanelToggle: 'Detay görünümüne geçiş',
123
123
  expandDetailPanel: 'Genişlet',
124
- collapseDetailPanel: 'Gizle' // Row reordering text
125
- // rowReorderingHeaderName: 'Row reordering',
124
+ collapseDetailPanel: 'Gizle',
125
+ // Row reordering text
126
+ rowReorderingHeaderName: 'Satırı yeniden sırala',
126
127
  // Aggregation
127
- // aggregationMenuItemHeader: 'Aggregation',
128
- // aggregationFunctionLabelSum: 'sum',
129
- // aggregationFunctionLabelAvg: 'avg',
130
- // aggregationFunctionLabelMin: 'min',
131
- // aggregationFunctionLabelMax: 'max',
132
- // aggregationFunctionLabelSize: 'size',
133
-
128
+ aggregationMenuItemHeader: 'Toplama',
129
+ aggregationFunctionLabelSum: 'top',
130
+ aggregationFunctionLabelAvg: 'ort',
131
+ aggregationFunctionLabelMin: 'min',
132
+ aggregationFunctionLabelMax: 'maks',
133
+ aggregationFunctionLabelSize: 'boyut'
134
134
  };
135
135
  export var trTR = getGridLocalization(trTRGrid, trTRCore);
@@ -4,7 +4,7 @@ export * from './gridColumnApi';
4
4
  export * from './gridDensityApi';
5
5
  export * from './gridRowApi';
6
6
  export * from './gridRowsMetaApi';
7
- export * from './gridSelectionApi';
7
+ export * from './gridRowSelectionApi';
8
8
  export * from './gridSortApi';
9
9
  export * from './gridStateApi';
10
10
  export * from './gridLocaleTextApi';
@@ -8,7 +8,7 @@ export * from './gridFilterModel';
8
8
  export * from './gridRootContainerRef';
9
9
  export * from './gridRenderContextProps';
10
10
  export * from './gridRows';
11
- export * from './gridSelectionModel';
11
+ export * from './gridRowSelectionModel';
12
12
  export * from './params';
13
13
  export * from './gridCellClass';
14
14
  export * from './gridCell';
@@ -1,10 +1,6 @@
1
- // TODO v6 - remove
2
-
3
1
  /**
4
2
  * Params passed to `apiRef.current.setEditCellValue`.
5
3
  */
6
- // TODO v6 - remove
7
- // TODO v6 - remove
8
4
  var GridCellEditStartReasons;
9
5
  /**
10
6
  * Params passed to the `cellEditStart` event.
@@ -1,4 +1,5 @@
1
1
  export * from './gridColumnHeaderParams';
2
+ export * from './gridColumnGroupHeaderParams';
2
3
  export * from './gridColumnOrderChangeParams';
3
4
  export * from './gridColumnResizeParams';
4
5
  export * from './gridEditCellParams';
package/locales/trTR.js CHANGED
@@ -39,7 +39,7 @@ const trTRGrid = {
39
39
  // Filter panel text
40
40
  filterPanelAddFilter: 'Filtre Ekle',
41
41
  filterPanelDeleteIconLabel: 'Kaldır',
42
- // filterPanelLinkOperator: 'Logic operator',
42
+ filterPanelLinkOperator: 'Mantıksal operatörler',
43
43
  filterPanelOperators: 'Operatör',
44
44
  // TODO v6: rename to filterPanelOperator
45
45
  filterPanelOperatorAnd: 'Ve',
@@ -85,13 +85,13 @@ const trTRGrid = {
85
85
  footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} / ${totalCount.toLocaleString()}`,
86
86
  // Checkbox selection text
87
87
  checkboxSelectionHeaderName: 'Seçim',
88
- // checkboxSelectionSelectAllRows: 'Select all rows',
89
- // checkboxSelectionUnselectAllRows: 'Unselect all rows',
90
- // checkboxSelectionSelectRow: 'Select row',
91
- // checkboxSelectionUnselectRow: 'Unselect row',
88
+ checkboxSelectionSelectAllRows: 'Tüm satırları seç',
89
+ checkboxSelectionUnselectAllRows: 'Tüm satırların seçimini kaldır',
90
+ checkboxSelectionSelectRow: 'Satırı seç',
91
+ checkboxSelectionUnselectRow: 'Satır seçimini bırak',
92
92
  // Boolean cell text
93
- // booleanCellTrueLabel: 'yes',
94
- // booleanCellFalseLabel: 'no',
93
+ booleanCellTrueLabel: 'Evet',
94
+ booleanCellFalseLabel: 'Hayır',
95
95
  // Actions cell more text
96
96
  actionsCellMore: 'daha fazla',
97
97
  // Column pinning text
@@ -107,17 +107,17 @@ const trTRGrid = {
107
107
  groupColumn: name => `${name} için grupla`,
108
108
  unGroupColumn: name => `${name} için gruplamayı kaldır`,
109
109
  // Master/detail
110
- // detailPanelToggle: 'Detail panel toggle',
110
+ detailPanelToggle: 'Detay görünümüne geçiş',
111
111
  expandDetailPanel: 'Genişlet',
112
- collapseDetailPanel: 'Gizle' // Row reordering text
113
- // rowReorderingHeaderName: 'Row reordering',
112
+ collapseDetailPanel: 'Gizle',
113
+ // Row reordering text
114
+ rowReorderingHeaderName: 'Satırı yeniden sırala',
114
115
  // Aggregation
115
- // aggregationMenuItemHeader: 'Aggregation',
116
- // aggregationFunctionLabelSum: 'sum',
117
- // aggregationFunctionLabelAvg: 'avg',
118
- // aggregationFunctionLabelMin: 'min',
119
- // aggregationFunctionLabelMax: 'max',
120
- // aggregationFunctionLabelSize: 'size',
121
-
116
+ aggregationMenuItemHeader: 'Toplama',
117
+ aggregationFunctionLabelSum: 'top',
118
+ aggregationFunctionLabelAvg: 'ort',
119
+ aggregationFunctionLabelMin: 'min',
120
+ aggregationFunctionLabelMax: 'maks',
121
+ aggregationFunctionLabelSize: 'boyut'
122
122
  };
123
123
  export const trTR = getGridLocalization(trTRGrid, trTRCore);
@@ -14,7 +14,7 @@ import { GridPrintExportApi } from './gridPrintExportApi';
14
14
  import { GridDisableVirtualizationApi } from './gridDisableVirtualizationApi';
15
15
  import { GridRowApi } from './gridRowApi';
16
16
  import { GridRowsMetaApi } from './gridRowsMetaApi';
17
- import { GridSelectionApi } from './gridSelectionApi';
17
+ import { GridRowSelectionApi } from './gridRowSelectionApi';
18
18
  import { GridSortApi } from './gridSortApi';
19
19
  import { GridStateApi } from './gridStateApi';
20
20
  import { GridLoggerApi } from './gridLoggerApi';
@@ -27,9 +27,6 @@ import type { GridDimensionsApi } from '../../hooks/features/dimensions';
27
27
  import type { GridPaginationApi } from '../../hooks/features/pagination';
28
28
  import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
29
29
  import { GridColumnGroupingApi } from './gridColumnGroupingApi';
30
- declare type GridStateApiUntyped = {
31
- [key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
32
- };
33
- export interface GridApiCommon extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApiUntyped, GridColumnGroupingApi {
30
+ import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
31
+ export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi {
34
32
  }
35
- export {};
@@ -1,13 +1,7 @@
1
- import type { GridStateApi } from './gridStateApi';
2
1
  import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
3
2
  import type { GridApiCommon } from './gridApiCommon';
4
- import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
5
- declare type GridStateApiUntyped = {
6
- [key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
7
- };
8
3
  /**
9
4
  * The api of `DataGrid`.
10
5
  */
11
- export interface GridApiCommunity extends Omit<GridApiCommon, keyof GridStateApiUntyped>, GridStateApi<GridStateCommunity>, GridStatePersistenceApi<GridInitialStateCommunity> {
6
+ export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity> {
12
7
  }
13
- export {};
@@ -1,8 +1,8 @@
1
1
  import { GridCellMode, GridRowMode } from '../gridCell';
2
- import { GridEditRowsModel, GridEditCellProps, GridCellModes, GridRowModes } from '../gridEditRowModel';
2
+ import { GridCellModes, GridRowModes } from '../gridEditRowModel';
3
3
  import { GridRowId, GridRowModel } from '../gridRows';
4
4
  import { GridCellParams } from '../params/gridCellParams';
5
- import { GridCommitCellChangeParams, GridEditCellValueParams, GridEditCellPropsParams } from '../params/gridEditCellParams';
5
+ import { GridEditCellValueParams } from '../params/gridEditCellParams';
6
6
  import { MuiBaseEvent } from '../muiEvent';
7
7
  export declare type GridCellModesModelProps = ({
8
8
  mode: GridCellModes.View;
@@ -19,7 +19,7 @@ export declare type GridRowModesModel = Record<GridRowId, GridRowModesModelProps
19
19
  export interface GridEditCellMeta {
20
20
  changeReason?: 'debouncedSetEditCellValue' | 'setEditCellValue';
21
21
  }
22
- export interface GridNewEditingSharedApi {
22
+ export interface GridEditingSharedApi {
23
23
  /**
24
24
  * Controls if a cell is editable.
25
25
  * @param {GridCellParams} params The cell params.
@@ -31,7 +31,7 @@ export interface GridNewEditingSharedApi {
31
31
  * Commonly used inside the edit cell component.
32
32
  * @param {GridEditCellValueParams} params Contains the id, field and value to set.
33
33
  * @param {React.SyntheticEvent} event The event to pass forward.
34
- * @returns {Promise<boolean> | void} A promise with the validation status if `preventCommitWhileValidating` is `true`. Otherwise, void.
34
+ * @returns {Promise<boolean> | void} A promise with the validation status.
35
35
  */
36
36
  setEditCellValue: (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void;
37
37
  /**
@@ -57,116 +57,6 @@ export interface GridNewEditingSharedApi {
57
57
  */
58
58
  unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta;
59
59
  }
60
- /**
61
- * The shared methods used by the cell and row editing API.
62
- */
63
- export interface GridEditingSharedApi {
64
- /**
65
- * Set the edit rows model of the grid.
66
- * @param {GridEditRowsModel} model The new edit rows model.
67
- * @deprecated Prefer the new editing API.
68
- */
69
- setEditRowsModel: (model: GridEditRowsModel) => void;
70
- /**
71
- * Gets the edit rows model of the grid.
72
- * @returns {GridEditRowsModel} The edit rows model.
73
- * @deprecated Prefer the new editing API.
74
- */
75
- getEditRowsModel: () => GridEditRowsModel;
76
- /**
77
- * Controls if a cell is editable.
78
- * @param {GridCellParams} params The cell params.
79
- * @returns {boolean} A boolean value determining if the cell is editable.
80
- */
81
- isCellEditable: (params: GridCellParams) => boolean;
82
- /**
83
- * Sets the value of the edit cell.
84
- * Commonly used inside the edit cell component.
85
- * @param {GridEditCellValueParams} params Contains the id, field and value to set.
86
- * @param {React.SyntheticEvent} event The event to pass forward.
87
- * @returns {Promise<boolean> | void} A promise with the validation status if `preventCommitWhileValidating` is `true`. Otherwise, void.
88
- */
89
- setEditCellValue: (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void;
90
- /**
91
- * Immediatelly updates the value of the cell, without waiting for the debounce.
92
- * @param {GridRowId} id The row id.
93
- * @param {string} field The field to update. If not passed, updates all fields in the given row id.
94
- * @ignore - do not document.
95
- */
96
- unstable_runPendingEditCellValueMutation: (id: GridRowId, field?: string) => void;
97
- /**
98
- * @ignore - do not document.
99
- */
100
- unstable_setEditCellProps: (params: GridEditCellPropsParams) => GridEditCellProps;
101
- /**
102
- * @ignore - do not document.
103
- */
104
- unstable_parseValue: (id: GridRowId, field: string, value: any) => any;
105
- }
106
- /**
107
- * The row editing API interface.
108
- */
109
- export interface GridRowEditingApi extends GridEditingSharedApi {
110
- /**
111
- * Sets the mode of a row.
112
- * @param {GridRowId} id The id of the row.
113
- * @param {GridRowMode} mode Can be: `"edit"`, `"view"`.
114
- */
115
- setRowMode: (id: GridRowId, mode: GridRowMode) => void;
116
- /**
117
- * Gets the mode of a row.
118
- * @param {GridRowId} id The id of the row.
119
- * @returns {GridRowMode} Returns `"edit"` or `"view"`.
120
- */
121
- getRowMode: (id: GridRowId) => GridRowMode;
122
- /**
123
- * Updates the row corresponding to the given id with the values stored in the edit row model.
124
- * @param {GridRowId} id The id to commit to.
125
- * @param {React.SyntheticEvent} event The event to pass forward.
126
- * @returns {boolean} A boolean indicating if there is an error.
127
- */
128
- commitRowChange: (id: GridRowId, event?: MuiBaseEvent) => boolean | Promise<boolean>;
129
- /**
130
- * Updates the value of a cell and calls all `preProcessEditCellProps` if necessary.
131
- * @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
132
- * @returns {Promise<boolean>} Resolves with `true` when all values in the row are valid.
133
- * @ignore - do not document.
134
- */
135
- unstable_setRowEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
136
- }
137
- /**
138
- * The cell editing API interface.
139
- */
140
- export interface GridCellEditingApi extends GridEditingSharedApi {
141
- /**
142
- * Updates the field corresponding to the given id with the value stored in the edit row model.
143
- * @param {GridCommitCellChangeParams} params The id and field to commit to.
144
- * @param {React.SyntheticEvent} event The event to pass forward.
145
- * @returns {boolean} A boolean indicating if there is an error.
146
- */
147
- commitCellChange: (params: GridCommitCellChangeParams, event?: MuiBaseEvent) => boolean | Promise<boolean>;
148
- /**
149
- * Sets the mode of a cell.
150
- * @param {GridRowId} id The id of the row.
151
- * @param {string} field The field to change the mode.
152
- * @param {GridCellMode} mode Can be: `"edit"`, `"view"`.
153
- */
154
- setCellMode: (id: GridRowId, field: string, mode: GridCellMode) => void;
155
- /**
156
- * Gets the mode of a cell.
157
- * @param {GridRowId} id The id of the row.
158
- * @param {string} field The field to get the mode.
159
- * @returns {GridCellMode} Returns `"edit"` or `"view"`.
160
- */
161
- getCellMode: (id: GridRowId, field: string) => GridCellMode;
162
- /**
163
- * Updates the value of a cell and calls `preProcessEditCellProps` if necessary.
164
- * @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
165
- * @returns {Promise<boolean>} Resolves with `true` when the new value is valid.
166
- * @ignore - do not document.
167
- */
168
- unstable_setCellEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
169
- }
170
60
  /**
171
61
  * Params passed to `apiRef.current.startCellEditMode`.
172
62
  */
@@ -183,6 +73,11 @@ export interface GridStartCellEditModeParams {
183
73
  * If `true`, the value will be deleted before entering the edit mode.
184
74
  */
185
75
  deleteValue?: boolean;
76
+ /**
77
+ * The initial value for the field.
78
+ * If `deleteValue` is also true, this value is not used.
79
+ */
80
+ initialValue?: any;
186
81
  }
187
82
  /**
188
83
  * Params passed to `apiRef.current.stopCellEditMode`.
@@ -223,6 +118,11 @@ export interface GridStartRowEditModeParams {
223
118
  * If `true`, the value in `fieldToFocus` will be deleted before entering the edit mode.
224
119
  */
225
120
  deleteValue?: boolean;
121
+ /**
122
+ * The initial value for the given `fieldToFocus`.
123
+ * If `deleteValue` is also true, this value is not used.
124
+ */
125
+ initialValue?: string;
226
126
  }
227
127
  /**
228
128
  * Params passed to `apiRef.current.stopRowEditMode`.
@@ -249,7 +149,17 @@ export interface GridStopRowEditModeParams {
249
149
  */
250
150
  cellToFocusAfter?: 'none' | 'below' | 'right' | 'left';
251
151
  }
252
- export interface GridNewCellEditingApi extends GridNewEditingSharedApi, Pick<GridCellEditingApi, 'getCellMode'> {
152
+ /**
153
+ * The cell editing API interface.
154
+ */
155
+ export interface GridCellEditingApi extends GridEditingSharedApi {
156
+ /**
157
+ * Gets the mode of a cell.
158
+ * @param {GridRowId} id The id of the row.
159
+ * @param {string} field The field to get the mode.
160
+ * @returns {GridCellMode} Returns `"edit"` or `"view"`.
161
+ */
162
+ getCellMode: (id: GridRowId, field: string) => GridCellMode;
253
163
  /**
254
164
  * Puts the cell corresponding to the given row id and field into edit mode.
255
165
  * @param {GridStartCellEditModeParams} params The row id and field of the cell to edit.
@@ -277,7 +187,16 @@ export interface GridNewCellEditingApi extends GridNewEditingSharedApi, Pick<Gri
277
187
  */
278
188
  unstable_getRowWithUpdatedValuesFromCellEditing: (id: GridRowId, field: string) => GridRowModel;
279
189
  }
280
- export interface GridNewRowEditingApi extends GridNewEditingSharedApi, Pick<GridRowEditingApi, 'getRowMode'> {
190
+ /**
191
+ * The row editing API interface.
192
+ */
193
+ export interface GridRowEditingApi extends GridEditingSharedApi {
194
+ /**
195
+ * Gets the mode of a row.
196
+ * @param {GridRowId} id The id of the row.
197
+ * @returns {GridRowMode} Returns `"edit"` or `"view"`.
198
+ */
199
+ getRowMode: (id: GridRowId) => GridRowMode;
281
200
  /**
282
201
  * Puts the row corresponding to the given id into edit mode.
283
202
  * @param {GridStartCellEditModeParams} params The row id edit.
@@ -307,9 +226,5 @@ export interface GridNewRowEditingApi extends GridNewEditingSharedApi, Pick<Grid
307
226
  /**
308
227
  * The editing API interface that is available in the grid `apiRef`.
309
228
  */
310
- export interface GridEditingApi extends GridCellEditingApi, GridRowEditingApi, GridNewCellEditingApi, GridNewRowEditingApi {
311
- }
312
- export interface GridOldEditingApi extends GridCellEditingApi, GridRowEditingApi {
313
- }
314
- export interface GridNewEditingApi extends GridNewCellEditingApi, GridNewRowEditingApi {
229
+ export interface GridEditingApi extends GridCellEditingApi, GridRowEditingApi {
315
230
  }
@@ -1,5 +1,6 @@
1
1
  import { GridRowId } from '../gridRows';
2
2
  import { MuiBaseEvent } from '../muiEvent';
3
+ import { GridColumnGroupIdentifier } from '../../hooks/features/focus';
3
4
  export interface GridFocusApi {
4
5
  /**
5
6
  * Sets the focus to the cell at the given `id` and `field`.
@@ -13,6 +14,18 @@ export interface GridFocusApi {
13
14
  * @param {string} event The event that triggers the action.
14
15
  */
15
16
  setColumnHeaderFocus: (field: string, event?: MuiBaseEvent) => void;
17
+ /**
18
+ * Sets the focus to the column group header at the given `field` and given depth.
19
+ * @param {string} field The column field.
20
+ * @param {number} depth The group depth.
21
+ * @param {object} event The event that triggers the action.
22
+ */
23
+ unstable_setColumnGroupHeaderFocus: (field: string, depth: number, event?: MuiBaseEvent) => void;
24
+ /**
25
+ * Gets the focus to the column group header at the given `field` and given depth.
26
+ * @returns {GridColumnGroupIdentifier | null} focused
27
+ */
28
+ unstable_getColumnGroupHeaderFocus: () => GridColumnGroupIdentifier | null;
16
29
  /**
17
30
  * Moves the focus to the cell situated at the given direction.
18
31
  * If field is the last and direction=right, the focus goes to the next row.
@@ -2,7 +2,7 @@ import { GridRowId, GridRowModel } from '../gridRows';
2
2
  /**
3
3
  * The selection API interface that is available in the grid [[apiRef]].
4
4
  */
5
- export interface GridSelectionApi {
5
+ export interface GridRowSelectionApi {
6
6
  /**
7
7
  * Change the selection state of a row.
8
8
  * @param {GridRowId} id The id of the row.
@@ -51,5 +51,5 @@ export interface GridSelectionApi {
51
51
  * Any row already selected will be unselected.
52
52
  * @param {GridRowId[]} rowIds The row ids to select.
53
53
  */
54
- setSelectionModel: (rowIds: GridRowId[]) => void;
54
+ setRowSelectionModel: (rowIds: GridRowId[]) => void;
55
55
  }
@@ -5,7 +5,7 @@ export * from './gridColumnApi';
5
5
  export * from './gridDensityApi';
6
6
  export * from './gridRowApi';
7
7
  export * from './gridRowsMetaApi';
8
- export * from './gridSelectionApi';
8
+ export * from './gridRowSelectionApi';
9
9
  export * from './gridSortApi';
10
10
  export * from './gridStateApi';
11
11
  export * from './gridLocaleTextApi';
@@ -21,5 +21,5 @@ export * from './gridCallbackDetails';
21
21
  export * from './gridScrollApi';
22
22
  export * from './gridVirtualScrollerApi';
23
23
  export * from './gridApiCommon';
24
- export type { GridEditingApi, GridOldEditingApi, GridNewEditingApi, GridCellModesModel, GridRowModesModel, } from './gridEditingApi';
24
+ export type { GridEditingApi, GridCellModesModel, GridRowModesModel } from './gridEditingApi';
25
25
  export declare type GridEditRowApi = GridEditingApi;
@@ -4,7 +4,7 @@ export * from './gridColumnApi';
4
4
  export * from './gridDensityApi';
5
5
  export * from './gridRowApi';
6
6
  export * from './gridRowsMetaApi';
7
- export * from './gridSelectionApi';
7
+ export * from './gridRowSelectionApi';
8
8
  export * from './gridSortApi';
9
9
  export * from './gridStateApi';
10
10
  export * from './gridLocaleTextApi';
@@ -12,7 +12,6 @@ import { GridActionsCellItemProps } from '../../components/cell/GridActionsCellI
12
12
  import { GridEditCellProps } from '../gridEditRowModel';
13
13
  import type { GridValidRowModel } from '../gridRows';
14
14
  import { GridApiCommunity } from '../api/gridApiCommunity';
15
- import type { GridColumnGroup } from '../gridColumnGrouping';
16
15
  /**
17
16
  * Alignment used in position elements in Cells.
18
17
  */
@@ -252,13 +251,6 @@ export declare type GridStateColDef<R extends GridValidRowModel = any, V = any,
252
251
  * If `true`, it means that at least one of the dimension's property of this column has been modified since the last time the column prop has changed.
253
252
  */
254
253
  hasBeenResized?: boolean;
255
- /**
256
- * The id of the groups leading to the column.
257
- * The array is ordered by increasing depth (the last element is the direct parent of the column).
258
- * If not defined, the column is in no group (equivalent to a path equal to `[]`).
259
- * This parameter is computed from the `columnGroupingModel` prop.
260
- */
261
- groupPath?: GridColumnGroup['groupId'][];
262
254
  };
263
255
  /**
264
256
  * Meta Info about columns.