@mui/x-data-grid 5.7.0 → 5.8.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 (298) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/DataGrid/DataGrid.d.ts +8 -3
  3. package/DataGrid/DataGrid.js +27 -4
  4. package/DataGrid/useDataGridComponent.js +2 -4
  5. package/DataGrid/useDataGridProps.d.ts +2 -1
  6. package/colDef/gridBooleanColDef.d.ts +1 -1
  7. package/colDef/gridBooleanOperators.d.ts +1 -1
  8. package/colDef/gridDateColDef.d.ts +5 -9
  9. package/colDef/gridDateColDef.js +2 -2
  10. package/colDef/gridDateOperators.d.ts +1 -1
  11. package/{models/colDef → colDef}/gridDefaultColumnTypes.d.ts +1 -1
  12. package/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  13. package/colDef/gridNumericColDef.d.ts +1 -1
  14. package/colDef/gridNumericOperators.d.ts +2 -2
  15. package/colDef/gridStringColDef.d.ts +1 -1
  16. package/colDef/gridStringOperators.d.ts +1 -1
  17. package/colDef/index.d.ts +1 -0
  18. package/colDef/index.js +2 -1
  19. package/components/GridRow.js +1 -1
  20. package/components/cell/GridCell.d.ts +4 -4
  21. package/components/cell/GridCell.js +2 -2
  22. package/components/cell/GridEditInputCell.js +2 -2
  23. package/components/cell/GridEditSingleSelectCell.js +2 -2
  24. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +12 -0
  25. package/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  26. package/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  27. package/components/columnHeaders/index.d.ts +1 -0
  28. package/components/columnHeaders/index.js +1 -0
  29. package/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  30. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  31. package/components/containers/GridRoot.js +29 -17
  32. package/components/menu/columnMenu/GridColumnMenu.js +1 -1
  33. package/components/panel/GridPanel.d.ts +2 -2
  34. package/components/panel/GridPreferencesPanel.js +1 -1
  35. package/constants/defaultGridSlotsComponents.js +2 -1
  36. package/constants/gridClasses.d.ts +15 -3
  37. package/hooks/core/index.d.ts +1 -1
  38. package/hooks/core/{preProcessing/gridPreProcessingApi.d.ts → pipeProcessing/gridPipeProcessingApi.d.ts} +19 -18
  39. package/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  40. package/hooks/core/pipeProcessing/index.d.ts +3 -0
  41. package/hooks/core/pipeProcessing/index.js +3 -0
  42. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +27 -0
  43. package/hooks/core/pipeProcessing/useGridPipeProcessing.js +74 -0
  44. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +7 -0
  45. package/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +2 -2
  46. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +27 -16
  47. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  48. package/hooks/core/useGridInitialization.js +2 -2
  49. package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
  50. package/hooks/features/columns/gridColumnsSelector.d.ts +6 -6
  51. package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
  52. package/hooks/features/columns/gridColumnsUtils.js +49 -17
  53. package/hooks/features/columns/useGridColumns.js +36 -27
  54. package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
  55. package/hooks/features/dimensions/useGridDimensions.js +2 -1
  56. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  57. package/hooks/features/editRows/useGridCellEditing.new.js +22 -7
  58. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  59. package/hooks/features/editRows/useGridRowEditing.new.js +22 -7
  60. package/hooks/features/events/useGridEvents.d.ts +1 -1
  61. package/hooks/features/events/useGridEvents.js +2 -0
  62. package/hooks/features/filter/gridFilterSelector.d.ts +3 -9
  63. package/hooks/features/filter/useGridFilter.js +4 -4
  64. package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.d.ts +2 -5
  65. package/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +27 -6
  66. package/hooks/features/pagination/gridPaginationSelector.d.ts +1 -3
  67. package/hooks/features/pagination/useGridPage.js +9 -4
  68. package/hooks/features/pagination/useGridPageSize.js +3 -3
  69. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  70. package/hooks/features/rows/gridRowsSelector.d.ts +1 -1
  71. package/hooks/features/rows/gridRowsUtils.d.ts +8 -0
  72. package/hooks/features/rows/gridRowsUtils.js +11 -0
  73. package/hooks/features/rows/index.d.ts +1 -0
  74. package/hooks/features/rows/index.js +1 -1
  75. package/hooks/features/rows/useGridRows.js +3 -3
  76. package/hooks/features/rows/useGridRowsMeta.js +3 -3
  77. package/hooks/features/scroll/useGridScroll.js +4 -13
  78. package/hooks/features/selection/gridSelectionSelector.d.ts +1 -3
  79. package/hooks/features/selection/useGridSelection.d.ts +4 -2
  80. package/hooks/features/selection/useGridSelection.js +72 -25
  81. package/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  82. package/hooks/features/sorting/gridSortingSelector.d.ts +1 -3
  83. package/hooks/features/sorting/gridSortingUtils.d.ts +1 -2
  84. package/hooks/features/sorting/useGridSorting.js +3 -3
  85. package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  86. package/hooks/utils/useGridRootProps.d.ts +1 -1
  87. package/hooks/utils/useGridVisibleRows.d.ts +2 -2
  88. package/index.js +1 -1
  89. package/internals/index.d.ts +3 -6
  90. package/internals/index.js +2 -3
  91. package/legacy/DataGrid/DataGrid.js +27 -4
  92. package/legacy/DataGrid/useDataGridComponent.js +2 -4
  93. package/legacy/colDef/gridDateColDef.js +2 -2
  94. package/legacy/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  95. package/legacy/colDef/index.js +2 -1
  96. package/legacy/components/GridRow.js +1 -1
  97. package/legacy/components/cell/GridCell.js +2 -2
  98. package/legacy/components/cell/GridEditInputCell.js +2 -2
  99. package/legacy/components/cell/GridEditSingleSelectCell.js +2 -2
  100. package/legacy/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  101. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  102. package/legacy/components/columnHeaders/index.js +1 -0
  103. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  104. package/legacy/components/containers/GridRoot.js +34 -17
  105. package/legacy/components/menu/columnMenu/GridColumnMenu.js +1 -1
  106. package/legacy/components/panel/GridPreferencesPanel.js +1 -1
  107. package/legacy/constants/defaultGridSlotsComponents.js +2 -1
  108. package/legacy/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  109. package/legacy/hooks/core/pipeProcessing/index.js +3 -0
  110. package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +83 -0
  111. package/legacy/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +2 -2
  112. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  113. package/legacy/hooks/core/useGridInitialization.js +2 -2
  114. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
  115. package/legacy/hooks/features/columns/gridColumnsUtils.js +49 -18
  116. package/legacy/hooks/features/columns/useGridColumns.js +36 -27
  117. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -1
  118. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +22 -7
  119. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +22 -7
  120. package/legacy/hooks/features/events/useGridEvents.js +2 -0
  121. package/legacy/hooks/features/filter/useGridFilter.js +4 -4
  122. package/legacy/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +27 -6
  123. package/legacy/hooks/features/pagination/useGridPage.js +11 -4
  124. package/legacy/hooks/features/pagination/useGridPageSize.js +3 -3
  125. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  126. package/legacy/hooks/features/rows/gridRowsUtils.js +13 -0
  127. package/legacy/hooks/features/rows/index.js +1 -1
  128. package/legacy/hooks/features/rows/useGridRows.js +5 -5
  129. package/legacy/hooks/features/rows/useGridRowsMeta.js +3 -3
  130. package/legacy/hooks/features/scroll/useGridScroll.js +4 -13
  131. package/legacy/hooks/features/selection/useGridSelection.js +74 -25
  132. package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  133. package/legacy/hooks/features/sorting/useGridSorting.js +3 -3
  134. package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  135. package/legacy/index.js +1 -1
  136. package/legacy/internals/index.js +2 -3
  137. package/legacy/locales/daDK.js +36 -32
  138. package/legacy/models/colDef/index.js +1 -2
  139. package/legacy/models/events/gridEvents.js +4 -2
  140. package/legacy/models/gridRows.js +1 -33
  141. package/legacy/models/index.js +2 -2
  142. package/{modern/hooks/core/preProcessing/gridPreProcessingApi.js → legacy/models/params/gridPreferencePanelParams.js} +0 -0
  143. package/legacy/models/params/index.js +2 -1
  144. package/locales/daDK.js +32 -32
  145. package/models/api/gridApiCommon.d.ts +2 -2
  146. package/models/api/gridEditingApi.d.ts +2 -2
  147. package/models/api/gridParamsApi.d.ts +5 -5
  148. package/models/api/gridRowApi.d.ts +2 -2
  149. package/models/colDef/gridColDef.d.ts +33 -28
  150. package/models/colDef/index.d.ts +0 -1
  151. package/models/colDef/index.js +1 -2
  152. package/models/events/gridEventLookup.d.ts +12 -6
  153. package/models/events/gridEvents.d.ts +11 -5
  154. package/models/events/gridEvents.js +4 -2
  155. package/models/gridCell.d.ts +1 -0
  156. package/models/gridEditRowModel.d.ts +1 -1
  157. package/models/gridFilterOperator.d.ts +3 -2
  158. package/models/gridRows.d.ts +10 -18
  159. package/models/gridRows.js +1 -31
  160. package/models/gridSlotsComponent.d.ts +5 -0
  161. package/models/gridSlotsComponentsProps.d.ts +1 -0
  162. package/models/gridSortModel.d.ts +3 -4
  163. package/models/index.d.ts +1 -1
  164. package/models/index.js +2 -2
  165. package/models/params/gridCellParams.d.ts +14 -14
  166. package/models/params/gridColumnHeaderParams.d.ts +3 -2
  167. package/models/params/gridEditCellParams.d.ts +2 -3
  168. package/models/params/gridPreferencePanelParams.d.ts +3 -0
  169. package/models/params/gridPreferencePanelParams.js +1 -0
  170. package/models/params/gridRowParams.d.ts +7 -8
  171. package/models/params/gridValueOptionsParams.d.ts +3 -3
  172. package/models/params/index.d.ts +1 -0
  173. package/models/params/index.js +2 -1
  174. package/models/props/DataGridProps.d.ts +36 -16
  175. package/modern/DataGrid/DataGrid.js +27 -4
  176. package/modern/DataGrid/useDataGridComponent.js +2 -4
  177. package/modern/colDef/gridDateColDef.js +2 -2
  178. package/modern/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  179. package/modern/colDef/index.js +2 -1
  180. package/modern/components/GridRow.js +1 -1
  181. package/modern/components/cell/GridCell.js +2 -2
  182. package/modern/components/cell/GridEditInputCell.js +2 -2
  183. package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
  184. package/modern/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +22 -4
  185. package/modern/components/columnHeaders/GridColumnHeaderItem.js +3 -3
  186. package/modern/components/columnHeaders/index.js +1 -0
  187. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  188. package/modern/components/containers/GridRoot.js +29 -17
  189. package/modern/components/menu/columnMenu/GridColumnMenu.js +1 -1
  190. package/modern/components/panel/GridPreferencesPanel.js +1 -1
  191. package/modern/constants/defaultGridSlotsComponents.js +2 -1
  192. package/modern/hooks/core/pipeProcessing/gridPipeProcessingApi.js +1 -0
  193. package/modern/hooks/core/pipeProcessing/index.js +3 -0
  194. package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +74 -0
  195. package/modern/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +2 -2
  196. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  197. package/modern/hooks/core/useGridInitialization.js +2 -2
  198. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
  199. package/modern/hooks/features/columns/gridColumnsUtils.js +49 -17
  200. package/modern/hooks/features/columns/useGridColumns.js +36 -27
  201. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -1
  202. package/modern/hooks/features/editRows/useGridCellEditing.new.js +22 -7
  203. package/modern/hooks/features/editRows/useGridRowEditing.new.js +22 -7
  204. package/modern/hooks/features/events/useGridEvents.js +2 -0
  205. package/modern/hooks/features/filter/useGridFilter.js +4 -4
  206. package/modern/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +27 -6
  207. package/modern/hooks/features/pagination/useGridPage.js +9 -4
  208. package/modern/hooks/features/pagination/useGridPageSize.js +3 -3
  209. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +18 -5
  210. package/modern/hooks/features/rows/gridRowsUtils.js +11 -0
  211. package/modern/hooks/features/rows/index.js +1 -1
  212. package/modern/hooks/features/rows/useGridRows.js +1 -1
  213. package/modern/hooks/features/rows/useGridRowsMeta.js +3 -3
  214. package/modern/hooks/features/scroll/useGridScroll.js +4 -9
  215. package/modern/hooks/features/selection/useGridSelection.js +72 -25
  216. package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  217. package/modern/hooks/features/sorting/useGridSorting.js +3 -3
  218. package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  219. package/modern/index.js +1 -1
  220. package/modern/internals/index.js +2 -3
  221. package/modern/locales/daDK.js +32 -32
  222. package/modern/models/colDef/index.js +1 -2
  223. package/modern/models/events/gridEvents.js +4 -2
  224. package/modern/models/gridRows.js +1 -31
  225. package/modern/models/index.js +2 -2
  226. package/modern/models/params/gridPreferencePanelParams.js +1 -0
  227. package/modern/models/params/index.js +2 -1
  228. package/node/DataGrid/DataGrid.js +27 -4
  229. package/node/DataGrid/useDataGridComponent.js +2 -5
  230. package/node/colDef/gridDateColDef.js +2 -2
  231. package/node/{models/colDef → colDef}/gridDefaultColumnTypes.js +6 -6
  232. package/node/colDef/index.js +13 -0
  233. package/node/components/GridRow.js +1 -1
  234. package/node/components/cell/GridCell.js +2 -2
  235. package/node/components/cell/GridEditInputCell.js +2 -2
  236. package/node/components/cell/GridEditSingleSelectCell.js +2 -2
  237. package/node/components/columnHeaders/{ColumnHeaderFilterIcon.js → GridColumnHeaderFilterIconButton.js} +23 -5
  238. package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -6
  239. package/node/components/columnHeaders/index.js +13 -0
  240. package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  241. package/node/components/containers/GridRoot.js +28 -17
  242. package/node/components/menu/columnMenu/GridColumnMenu.js +1 -1
  243. package/node/components/panel/GridPreferencesPanel.js +1 -1
  244. package/node/constants/defaultGridSlotsComponents.js +1 -0
  245. package/node/hooks/core/{preProcessing/gridPreProcessingApi.js → pipeProcessing/gridPipeProcessingApi.js} +0 -0
  246. package/node/hooks/core/pipeProcessing/index.js +44 -0
  247. package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +93 -0
  248. package/node/hooks/core/{preProcessing/useGridRegisterPreProcessor.js → pipeProcessing/useGridRegisterPipeProcessor.js} +4 -4
  249. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +26 -15
  250. package/node/hooks/core/useGridInitialization.js +2 -2
  251. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
  252. package/node/hooks/features/columns/gridColumnsUtils.js +54 -21
  253. package/node/hooks/features/columns/useGridColumns.js +36 -27
  254. package/node/hooks/features/dimensions/useGridDimensions.js +2 -1
  255. package/node/hooks/features/editRows/useGridCellEditing.new.js +24 -7
  256. package/node/hooks/features/editRows/useGridRowEditing.new.js +24 -7
  257. package/node/hooks/features/events/useGridEvents.js +2 -0
  258. package/node/hooks/features/filter/useGridFilter.js +4 -4
  259. package/node/hooks/features/{keyboard → keyboardNavigation}/useGridKeyboardNavigation.js +29 -6
  260. package/node/hooks/features/pagination/useGridPage.js +8 -3
  261. package/node/hooks/features/pagination/useGridPageSize.js +3 -3
  262. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +20 -5
  263. package/node/hooks/features/rows/gridRowsUtils.js +18 -0
  264. package/node/hooks/features/rows/index.js +15 -1
  265. package/node/hooks/features/rows/useGridRows.js +5 -5
  266. package/node/hooks/features/rows/useGridRowsMeta.js +3 -3
  267. package/node/hooks/features/scroll/useGridScroll.js +3 -13
  268. package/node/hooks/features/selection/useGridSelection.js +71 -24
  269. package/node/hooks/features/selection/useGridSelectionPreProcessors.js +2 -2
  270. package/node/hooks/features/sorting/useGridSorting.js +3 -3
  271. package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  272. package/node/index.js +1 -1
  273. package/node/internals/index.js +4 -12
  274. package/node/locales/daDK.js +32 -32
  275. package/node/models/colDef/index.js +0 -13
  276. package/node/models/events/gridEvents.js +4 -2
  277. package/node/models/gridRows.js +1 -34
  278. package/node/models/index.js +13 -13
  279. package/node/models/params/gridPreferencePanelParams.js +5 -0
  280. package/node/models/params/index.js +13 -0
  281. package/package.json +1 -1
  282. package/components/columnHeaders/ColumnHeaderFilterIcon.d.ts +0 -5
  283. package/hooks/core/preProcessing/index.d.ts +0 -3
  284. package/hooks/core/preProcessing/index.js +0 -3
  285. package/hooks/core/preProcessing/useGridPreProcessing.d.ts +0 -6
  286. package/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
  287. package/hooks/core/preProcessing/useGridRegisterPreProcessor.d.ts +0 -7
  288. package/hooks/features/keyboard/useGridKeyboard.d.ts +0 -10
  289. package/hooks/features/keyboard/useGridKeyboard.js +0 -70
  290. package/legacy/hooks/core/preProcessing/index.js +0 -3
  291. package/legacy/hooks/core/preProcessing/useGridPreProcessing.js +0 -62
  292. package/legacy/hooks/features/keyboard/useGridKeyboard.js +0 -70
  293. package/modern/hooks/core/preProcessing/index.js +0 -3
  294. package/modern/hooks/core/preProcessing/useGridPreProcessing.js +0 -53
  295. package/modern/hooks/features/keyboard/useGridKeyboard.js +0 -70
  296. package/node/hooks/core/preProcessing/index.js +0 -44
  297. package/node/hooks/core/preProcessing/useGridPreProcessing.js +0 -72
  298. package/node/hooks/features/keyboard/useGridKeyboard.js +0 -91
@@ -4,7 +4,7 @@ import { GridEvents } from '../../../models/events';
4
4
  import { useGridLogger, useGridApiMethod, useGridApiEventHandler, useGridSelector } from '../../utils';
5
5
  import { gridPageSizeSelector } from './gridPaginationSelector';
6
6
  import { gridDensityRowHeightSelector } from '../density';
7
- import { useGridRegisterPreProcessor } from '../../core/preProcessing';
7
+ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
8
8
  export const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;
9
9
 
10
10
  const mergeStateWithPageSize = pageSize => state => _extends({}, state, {
@@ -84,8 +84,8 @@ export const useGridPageSize = (apiRef, props) => {
84
84
 
85
85
  return params;
86
86
  }, [apiRef]);
87
- useGridRegisterPreProcessor(apiRef, 'exportState', stateExportPreProcessing);
88
- useGridRegisterPreProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
87
+ useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
88
+ useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
89
89
  /**
90
90
  * EVENTS
91
91
  */
@@ -1,9 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import { GridEvents } from '../../../models/events';
3
4
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
4
5
  import { useGridLogger } from '../../utils/useGridLogger';
5
- import { useGridRegisterPreProcessor } from '../../core/preProcessing';
6
+ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
6
7
  import { gridPreferencePanelStateSelector } from './gridPreferencePanelSelector';
8
+ import { useGridSelector } from '../../utils/useGridSelector';
7
9
  export const preferencePanelStateInitializer = (state, props) => {
8
10
  var _props$initialState$p, _props$initialState;
9
11
 
@@ -19,6 +21,7 @@ export const preferencePanelStateInitializer = (state, props) => {
19
21
 
20
22
  export const useGridPreferencesPanel = apiRef => {
21
23
  const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
24
+ const preferencePanelState = useGridSelector(apiRef, gridPreferencePanelStateSelector);
22
25
  const hideTimeout = React.useRef();
23
26
  const immediateTimeout = React.useRef();
24
27
  /**
@@ -27,13 +30,20 @@ export const useGridPreferencesPanel = apiRef => {
27
30
 
28
31
  const hidePreferences = React.useCallback(() => {
29
32
  logger.debug('Hiding Preferences Panel');
33
+
34
+ if (preferencePanelState.openedPanelValue) {
35
+ apiRef.current.publishEvent(GridEvents.preferencePanelClose, {
36
+ openedPanelValue: preferencePanelState.openedPanelValue
37
+ });
38
+ }
39
+
30
40
  apiRef.current.setState(state => _extends({}, state, {
31
41
  preferencePanel: {
32
42
  open: false
33
43
  }
34
44
  }));
35
45
  apiRef.current.forceUpdate();
36
- }, [apiRef, logger]); // This is to prevent the preferences from closing when you open a select box or another panel,
46
+ }, [apiRef, logger, preferencePanelState.openedPanelValue]); // This is to prevent the preferences from closing when you open a select box or another panel,
37
47
  // The issue is in MUI core V4 => Fixed in V5
38
48
 
39
49
  const doNotHidePanel = React.useCallback(() => {
@@ -53,8 +63,11 @@ export const useGridPreferencesPanel = apiRef => {
53
63
  openedPanelValue: newValue
54
64
  })
55
65
  }));
66
+ apiRef.current.publishEvent(GridEvents.preferencePanelOpen, {
67
+ openedPanelValue: newValue
68
+ });
56
69
  apiRef.current.forceUpdate();
57
- }, [doNotHidePanel, apiRef, logger]);
70
+ }, [logger, doNotHidePanel, apiRef]);
58
71
  useGridApiMethod(apiRef, {
59
72
  showPreferences,
60
73
  hidePreferences: hidePreferencesDelayed
@@ -85,8 +98,8 @@ export const useGridPreferencesPanel = apiRef => {
85
98
 
86
99
  return params;
87
100
  }, [apiRef]);
88
- useGridRegisterPreProcessor(apiRef, 'exportState', stateExportPreProcessing);
89
- useGridRegisterPreProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
101
+ useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
102
+ useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
90
103
  /**
91
104
  * EFFECTS
92
105
  */
@@ -2,7 +2,7 @@ import { GridStateCommunity } from '../../../models/gridStateCommunity';
2
2
  export declare const gridRowsStateSelector: (state: GridStateCommunity) => import("./gridRowsState").GridRowsState;
3
3
  export declare const gridRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
4
4
  export declare const gridTopLevelRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
5
- export declare const gridRowsLookupSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowsLookup>;
5
+ export declare const gridRowsLookupSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowsLookup<any>>;
6
6
  export declare const gridRowTreeSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridRowTreeConfig>;
7
7
  export declare const gridRowGroupingNameSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, string>;
8
8
  export declare const gridRowTreeDepthSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
@@ -0,0 +1,8 @@
1
+ import { GridRowId, GridRowModel } from '../../../models';
2
+ /**
3
+ * A helper function to check if the id provided is valid.
4
+ * @param {GridRowId} id Id as [[GridRowId]].
5
+ * @param {GridRowModel | Partial<GridRowModel>} row Row as [[GridRowModel]].
6
+ * @param {string} detailErrorMessage A custom error message to display for invalid IDs
7
+ */
8
+ export declare function checkGridRowIdIsValid(id: GridRowId, row: GridRowModel | Partial<GridRowModel>, detailErrorMessage?: string): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A helper function to check if the id provided is valid.
3
+ * @param {GridRowId} id Id as [[GridRowId]].
4
+ * @param {GridRowModel | Partial<GridRowModel>} row Row as [[GridRowModel]].
5
+ * @param {string} detailErrorMessage A custom error message to display for invalid IDs
6
+ */
7
+ export function checkGridRowIdIsValid(id, row, detailErrorMessage = 'A row was provided without id in the rows prop:') {
8
+ if (id == null) {
9
+ throw new Error(['MUI: The data grid component requires all rows to have a unique `id` property.', 'Alternatively, you can use the `getRowId` prop to specify a custom id for each row.', detailErrorMessage, JSON.stringify(row)].join('\n'));
10
+ }
11
+ }
@@ -2,3 +2,4 @@ export * from './gridRowsMetaSelector';
2
2
  export * from './gridRowsMetaState';
3
3
  export * from './gridRowsSelector';
4
4
  export type { GridRowsState } from './gridRowsState';
5
+ export { checkGridRowIdIsValid } from './gridRowsUtils';
@@ -1,4 +1,4 @@
1
1
  export * from './gridRowsMetaSelector';
2
2
  export * from './gridRowsMetaState';
3
3
  export * from './gridRowsSelector';
4
- export {};
4
+ export { checkGridRowIdIsValid } from './gridRowsUtils';
@@ -1,12 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { GridEvents } from '../../../models/events';
4
- import { checkGridRowIdIsValid } from '../../../models/gridRows';
5
4
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
6
5
  import { useGridLogger } from '../../utils/useGridLogger';
7
6
  import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowIdsSelector, gridRowGroupingNameSelector } from './gridRowsSelector';
8
7
  import { GridSignature, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
9
8
  import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
9
+ import { checkGridRowIdIsValid } from './gridRowsUtils';
10
10
 
11
11
  function getGridRowId(rowModel, getRowId, detailErrorMessage) {
12
12
  const id = getRowId ? getRowId(rowModel) : rowModel.id;
@@ -91,9 +91,9 @@ export const useGridRows = (apiRef, props) => {
91
91
 
92
92
  const currentPage = useGridVisibleRows(apiRef, props);
93
93
  const getRow = React.useCallback(id => {
94
- var _gridRowsLookupSelect;
94
+ var _ref;
95
95
 
96
- return (_gridRowsLookupSelect = gridRowsLookupSelector(apiRef)[id]) != null ? _gridRowsLookupSelect : null;
96
+ return (_ref = gridRowsLookupSelector(apiRef)[id]) != null ? _ref : null;
97
97
  }, [apiRef]);
98
98
  const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {
99
99
  id
@@ -74,7 +74,7 @@ export const useGridRowsMeta = (apiRef, props) => {
74
74
  initialHeights.spacingBottom = (_spacing$bottom = spacing.bottom) != null ? _spacing$bottom : 0;
75
75
  }
76
76
 
77
- const sizes = apiRef.current.unstable_applyPreProcessors('rowHeight', initialHeights, row);
77
+ const sizes = apiRef.current.unstable_applyPipeProcessors('rowHeight', initialHeights, row);
78
78
  const finalRowHeight = Object.values(sizes).reduce((acc2, value) => acc2 + value, 0);
79
79
  rowsHeightLookup.current[row.id] = {
80
80
  value: baseRowHeight,
@@ -120,14 +120,14 @@ export const useGridRowsMeta = (apiRef, props) => {
120
120
  React.useEffect(() => {
121
121
  hydrateRowsMeta();
122
122
  }, [rowHeight, filterState, paginationState, sortingState, hydrateRowsMeta]);
123
- const handlePreProcessorRegister = React.useCallback(name => {
123
+ const handlepipeProcessorRegister = React.useCallback(name => {
124
124
  if (name !== 'rowHeight') {
125
125
  return;
126
126
  }
127
127
 
128
128
  hydrateRowsMeta();
129
129
  }, [hydrateRowsMeta]);
130
- useGridApiEventHandler(apiRef, GridEvents.preProcessorRegister, handlePreProcessorRegister);
130
+ useGridApiEventHandler(apiRef, GridEvents.pipeProcessorRegister, handlepipeProcessorRegister);
131
131
  const rowsMetaApi = {
132
132
  unstable_getRowHeight: getTargetRowHeight,
133
133
  unstable_getRowInternalSizes: getRowInternalSizes,
@@ -4,8 +4,7 @@ import { gridColumnPositionsSelector, gridVisibleColumnDefinitionsSelector } fro
4
4
  import { gridPageSelector, gridPageSizeSelector } from '../pagination/gridPaginationSelector';
5
5
  import { gridRowCountSelector } from '../rows/gridRowsSelector';
6
6
  import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
7
- import { useGridApiMethod } from '../../utils/useGridApiMethod';
8
- import { useGridNativeEventListener } from '../../utils/useGridNativeEventListener'; // Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js
7
+ import { useGridApiMethod } from '../../utils/useGridApiMethod'; // Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js
9
8
  // Similar to https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
10
9
 
11
10
  function scrollIntoView(dimensions) {
@@ -42,8 +41,9 @@ export const useGridScroll = (apiRef, props) => {
42
41
  const scrollToIndexes = React.useCallback(params => {
43
42
  const totalRowCount = gridRowCountSelector(apiRef);
44
43
  const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);
44
+ const scrollToHeader = params.rowIndex == null;
45
45
 
46
- if (totalRowCount === 0 || visibleColumns.length === 0) {
46
+ if (!scrollToHeader && totalRowCount === 0 || visibleColumns.length === 0) {
47
47
  return false;
48
48
  }
49
49
 
@@ -74,7 +74,7 @@ export const useGridScroll = (apiRef, props) => {
74
74
  });
75
75
  }
76
76
 
77
- scrollCoordinates = apiRef.current.unstable_applyPreProcessors('scrollToIndexes', scrollCoordinates, params);
77
+ scrollCoordinates = apiRef.current.unstable_applyPipeProcessors('scrollToIndexes', scrollCoordinates, params);
78
78
 
79
79
  if (typeof scrollCoordinates.left !== undefined || typeof scrollCoordinates.top !== undefined) {
80
80
  apiRef.current.scroll(scrollCoordinates);
@@ -116,13 +116,4 @@ export const useGridScroll = (apiRef, props) => {
116
116
  getScrollPosition
117
117
  };
118
118
  useGridApiMethod(apiRef, scrollApi, 'GridScrollApi');
119
- const preventScroll = React.useCallback(event => {
120
- event.target.scrollLeft = 0;
121
- event.target.scrollTop = 0;
122
- }, []);
123
- useGridNativeEventListener(apiRef, () => {
124
- var _apiRef$current, _apiRef$current$rende, _apiRef$current$rende2;
125
-
126
- return (_apiRef$current = apiRef.current) == null ? void 0 : (_apiRef$current$rende = _apiRef$current.renderingZoneRef) == null ? void 0 : (_apiRef$current$rende2 = _apiRef$current$rende.current) == null ? void 0 : _apiRef$current$rende2.parentElement;
127
- }, 'scroll', preventScroll);
128
119
  };
@@ -2,7 +2,5 @@ import { GridStateCommunity } from '../../../models/gridStateCommunity';
2
2
  import { GridRowId } from '../../../models/gridRows';
3
3
  export declare const gridSelectionStateSelector: (state: GridStateCommunity) => import("../../..").GridSelectionModel;
4
4
  export declare const selectedGridRowsCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
5
- export declare const selectedGridRowsSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, Map<GridRowId, {
6
- [key: string]: any;
7
- }>>;
5
+ export declare const selectedGridRowsSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, Map<GridRowId, any>>;
8
6
  export declare const selectedIdsLookupSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, Record<GridRowId, GridRowId>>;
@@ -4,7 +4,9 @@ import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
5
5
  export declare const selectionStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'selectionModel'>>;
6
6
  /**
7
- * @requires useGridRows (state, method)
8
- * @requires useGridParamsApi (method)
7
+ * @requires useGridRows (state, method) - can be after
8
+ * @requires useGridParamsApi (method) - can be after
9
+ * @requires useGridFocus (state) - can be after
10
+ * @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
9
11
  */
10
12
  export declare const useGridSelection: (apiRef: React.MutableRefObject<GridApiCommunity>, props: Pick<DataGridProcessedProps, 'checkboxSelection' | 'selectionModel' | 'onSelectionModelChange' | 'disableMultipleSelection' | 'disableSelectionOnClick' | 'isRowSelectable' | 'checkboxSelectionVisibleOnly' | 'pagination' | 'paginationMode' | 'classes'>) => void;
@@ -5,14 +5,14 @@ import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
5
5
  import { useGridApiMethod } from '../../utils/useGridApiMethod';
6
6
  import { useGridLogger } from '../../utils/useGridLogger';
7
7
  import { gridRowsLookupSelector } from '../rows/gridRowsSelector';
8
- import { isGridCellRoot } from '../../../utils/domUtils';
9
8
  import { gridSelectionStateSelector, selectedGridRowsSelector, selectedIdsLookupSelector } from './gridSelectionSelector';
10
9
  import { gridPaginatedVisibleSortedGridRowIdsSelector } from '../pagination';
10
+ import { gridFocusCellSelector } from '../focus/gridFocusStateSelector';
11
11
  import { gridVisibleSortedRowIdsSelector } from '../filter/gridFilterSelector';
12
12
  import { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
13
13
  import { GridCellModes } from '../../../models/gridEditRowModel';
14
- import { isKeyboardEvent } from '../../../utils/keyboardUtils';
15
- import { getVisibleRows } from '../../utils/useGridVisibleRows';
14
+ import { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';
15
+ import { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';
16
16
 
17
17
  const getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {
18
18
  if (selectionModelProp == null) {
@@ -38,8 +38,10 @@ export const selectionStateInitializer = (state, props) => {
38
38
  });
39
39
  };
40
40
  /**
41
- * @requires useGridRows (state, method)
42
- * @requires useGridParamsApi (method)
41
+ * @requires useGridRows (state, method) - can be after
42
+ * @requires useGridParamsApi (method) - can be after
43
+ * @requires useGridFocus (state) - can be after
44
+ * @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
43
45
  */
44
46
 
45
47
  export const useGridSelection = (apiRef, props) => {
@@ -64,7 +66,8 @@ export const useGridSelection = (apiRef, props) => {
64
66
  paginationMode
65
67
  } = props;
66
68
  const canHaveMultipleSelection = !disableMultipleSelection || checkboxSelection;
67
- const expandRowRangeSelection = React.useCallback(id => {
69
+ const visibleRows = useGridVisibleRows(apiRef, props);
70
+ const expandMouseRowRangeSelection = React.useCallback(id => {
68
71
  var _lastRowToggled$curre;
69
72
 
70
73
  let endId = id;
@@ -171,12 +174,13 @@ export const useGridSelection = (apiRef, props) => {
171
174
  return;
172
175
  }
173
176
 
174
- logger.debug(`Expanding selection from row ${startId} to row ${endId}`);
175
- const visibleRowIds = gridVisibleSortedRowIdsSelector(apiRef);
176
- const startIndex = visibleRowIds.indexOf(startId);
177
- const endIndex = visibleRowIds.indexOf(endId);
177
+ logger.debug(`Expanding selection from row ${startId} to row ${endId}`); // Using rows from all pages allow to select a range across several pages
178
+
179
+ const allPagesRowIds = gridVisibleSortedRowIdsSelector(apiRef);
180
+ const startIndex = allPagesRowIds.indexOf(startId);
181
+ const endIndex = allPagesRowIds.indexOf(endId);
178
182
  const [start, end] = startIndex > endIndex ? [endIndex, startIndex] : [startIndex, endIndex];
179
- const rowsBetweenStartAndEnd = visibleRowIds.slice(start, end + 1);
183
+ const rowsBetweenStartAndEnd = allPagesRowIds.slice(start, end + 1);
180
184
  apiRef.current.selectRows(rowsBetweenStartAndEnd, isSelected, resetSelection);
181
185
  }, [apiRef, logger]);
182
186
  const selectionApi = {
@@ -250,11 +254,11 @@ export const useGridSelection = (apiRef, props) => {
250
254
  }
251
255
 
252
256
  if (event.shiftKey && (canHaveMultipleSelection || checkboxSelection)) {
253
- expandRowRangeSelection(params.id);
257
+ expandMouseRowRangeSelection(params.id);
254
258
  } else {
255
259
  handleSingleRowSelection(params.id, event);
256
260
  }
257
- }, [disableSelectionOnClick, canHaveMultipleSelection, checkboxSelection, apiRef, expandRowRangeSelection, handleSingleRowSelection]);
261
+ }, [disableSelectionOnClick, canHaveMultipleSelection, checkboxSelection, apiRef, expandMouseRowRangeSelection, handleSingleRowSelection]);
258
262
  const preventSelectionOnShift = React.useCallback((params, event) => {
259
263
  if (canHaveMultipleSelection && event.shiftKey) {
260
264
  var _window$getSelection;
@@ -264,35 +268,78 @@ export const useGridSelection = (apiRef, props) => {
264
268
  }, [canHaveMultipleSelection]);
265
269
  const handleRowSelectionCheckboxChange = React.useCallback((params, event) => {
266
270
  if (event.nativeEvent.shiftKey) {
267
- expandRowRangeSelection(params.id);
271
+ expandMouseRowRangeSelection(params.id);
268
272
  } else {
269
273
  apiRef.current.selectRow(params.id, params.value);
270
274
  }
271
- }, [apiRef, expandRowRangeSelection]);
275
+ }, [apiRef, expandMouseRowRangeSelection]);
272
276
  const handleHeaderSelectionCheckboxChange = React.useCallback(params => {
273
277
  const shouldLimitSelectionToCurrentPage = props.checkboxSelectionVisibleOnly && props.pagination;
274
278
  const rowsToBeSelected = shouldLimitSelectionToCurrentPage ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridVisibleSortedRowIdsSelector(apiRef);
275
279
  apiRef.current.selectRows(rowsToBeSelected, params.value);
276
280
  }, [apiRef, props.checkboxSelectionVisibleOnly, props.pagination]);
277
281
  const handleCellKeyDown = React.useCallback((params, event) => {
278
- // Ignore portal
282
+ // Get the most recent cell mode because it may have been changed by another listener
283
+ if (apiRef.current.getCellMode(params.id, params.field) === GridCellModes.Edit) {
284
+ return;
285
+ } // Ignore portal
279
286
  // Do not apply shortcuts if the focus is not on the cell root component
280
- // TODO replace with !event.currentTarget.contains(event.target as Element)
281
- if (!isGridCellRoot(event.target)) {
287
+
288
+
289
+ if (!event.currentTarget.contains(event.target)) {
282
290
  return;
283
- } // Get the most recent params because the cell mode may have changed by another listener
291
+ }
284
292
 
293
+ if (isNavigationKey(event.key) && event.shiftKey) {
294
+ // The cell that has focus after the keyboard navigation
295
+ const focusCell = gridFocusCellSelector(apiRef);
285
296
 
286
- const cellParams = apiRef.current.getCellParams(params.id, params.field);
287
- const isEditMode = cellParams.cellMode === GridCellModes.Edit;
297
+ if (focusCell && focusCell.id !== params.id) {
298
+ event.preventDefault();
299
+ const isNextRowSelected = apiRef.current.isRowSelected(focusCell.id);
288
300
 
289
- if (isEditMode) {
290
- return;
301
+ if (!canHaveMultipleSelection) {
302
+ apiRef.current.selectRow(focusCell.id, !isNextRowSelected, true);
303
+ return;
304
+ }
305
+
306
+ const newRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(focusCell.id);
307
+ const previousRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);
308
+ let start;
309
+ let end;
310
+
311
+ if (newRowIndex > previousRowIndex) {
312
+ if (isNextRowSelected) {
313
+ // We are navigating to the bottom of the page and adding selected rows
314
+ start = previousRowIndex;
315
+ end = newRowIndex - 1;
316
+ } else {
317
+ // We are navigating to the bottom of the page and removing selected rows
318
+ start = previousRowIndex;
319
+ end = newRowIndex;
320
+ }
321
+ } else {
322
+ // eslint-disable-next-line no-lonely-if
323
+ if (isNextRowSelected) {
324
+ // We are navigating to the top of the page and removing selected rows
325
+ start = newRowIndex + 1;
326
+ end = previousRowIndex;
327
+ } else {
328
+ // We are navigating to the top of the page and adding selected rows
329
+ start = newRowIndex;
330
+ end = previousRowIndex;
331
+ }
332
+ }
333
+
334
+ const rowsBetweenStartAndEnd = visibleRows.rows.slice(start, end + 1).map(row => row.id);
335
+ apiRef.current.selectRows(rowsBetweenStartAndEnd, !isNextRowSelected);
336
+ return;
337
+ }
291
338
  }
292
339
 
293
340
  if (event.key === ' ' && event.shiftKey) {
294
341
  event.preventDefault();
295
- handleSingleRowSelection(cellParams.id, event);
342
+ handleSingleRowSelection(params.id, event);
296
343
  return;
297
344
  }
298
345
 
@@ -300,7 +347,7 @@ export const useGridSelection = (apiRef, props) => {
300
347
  event.preventDefault();
301
348
  selectRows(apiRef.current.getAllRowIds(), true);
302
349
  }
303
- }, [apiRef, handleSingleRowSelection, selectRows]);
350
+ }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);
304
351
  useGridApiEventHandler(apiRef, GridEvents.visibleRowsSet, removeOutdatedSelection);
305
352
  useGridApiEventHandler(apiRef, GridEvents.cellClick, handleCellClick);
306
353
  useGridApiEventHandler(apiRef, GridEvents.rowSelectionCheckboxChange, handleRowSelectionCheckboxChange);
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { unstable_composeClasses as composeClasses } from '@mui/material';
4
- import { useGridRegisterPreProcessor } from '../../core/preProcessing';
4
+ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
5
5
  import { getDataGridUtilityClass } from '../../../constants';
6
6
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef';
7
7
 
@@ -43,5 +43,5 @@ export const useGridSelectionPreProcessors = (apiRef, props) => {
43
43
 
44
44
  return columnsState;
45
45
  }, [apiRef, classes, props.checkboxSelection]);
46
- useGridRegisterPreProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);
46
+ useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);
47
47
  };
@@ -16,9 +16,7 @@ export declare const gridSortedRowIdsSelector: import("../../../utils/createSele
16
16
  */
17
17
  export declare const gridSortedRowEntriesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, {
18
18
  id: import("../../..").GridRowId;
19
- model: {
20
- [key: string]: any;
21
- };
19
+ model: any;
22
20
  }[]>;
23
21
  /**
24
22
  * Get the current sorting model.
@@ -1,5 +1,4 @@
1
1
  import { GridSortingModelApplier } from './gridSortingState';
2
- import type { GridCellValue } from '../../../models';
3
2
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
4
3
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
5
4
  import { GridComparatorFn, GridSortDirection, GridSortModel } from '../../../models/gridSortModel';
@@ -15,4 +14,4 @@ export declare const buildAggregatedSortingApplier: (sortModel: GridSortModel, a
15
14
  export declare const getNextGridSortDirection: (sortingOrder: GridSortDirection[], current?: GridSortDirection) => GridSortDirection;
16
15
  export declare const gridStringOrNumberComparator: GridComparatorFn;
17
16
  export declare const gridNumberComparator: GridComparatorFn;
18
- export declare const gridDateComparator: (value1: GridCellValue, value2: GridCellValue) => number;
17
+ export declare const gridDateComparator: GridComparatorFn;
@@ -12,7 +12,7 @@ import { gridRowIdsSelector, gridRowTreeSelector } from '../rows';
12
12
  import { useFirstRender } from '../../utils/useFirstRender';
13
13
  import { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from '../../core/strategyProcessing';
14
14
  import { buildAggregatedSortingApplier, mergeStateWithSortModel, getNextGridSortDirection, sanitizeSortModel } from './gridSortingUtils';
15
- import { useGridRegisterPreProcessor } from '../../core/preProcessing';
15
+ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
16
16
  export const sortingStateInitializer = (state, props) => {
17
17
  var _ref, _props$sortModel, _props$initialState, _props$initialState$s;
18
18
 
@@ -188,8 +188,8 @@ export const useGridSorting = (apiRef, props) => {
188
188
  const rowTree = gridRowTreeSelector(apiRef);
189
189
  return params.sortRowList(Object.values(rowTree));
190
190
  }, [apiRef]);
191
- useGridRegisterPreProcessor(apiRef, 'exportState', stateExportPreProcessing);
192
- useGridRegisterPreProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
191
+ useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
192
+ useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
193
193
  useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'sorting', flatSortingMethod);
194
194
  /**
195
195
  * EVENTS
@@ -2,11 +2,11 @@ import * as React from 'react';
2
2
  import { useGridApiMethod } from '../../utils';
3
3
  export const useGridStatePersistence = apiRef => {
4
4
  const exportState = React.useCallback(() => {
5
- const stateToExport = apiRef.current.unstable_applyPreProcessors('exportState', {});
5
+ const stateToExport = apiRef.current.unstable_applyPipeProcessors('exportState', {});
6
6
  return stateToExport;
7
7
  }, [apiRef]);
8
8
  const restoreState = React.useCallback(stateToRestore => {
9
- const response = apiRef.current.unstable_applyPreProcessors('restoreState', {
9
+ const response = apiRef.current.unstable_applyPipeProcessors('restoreState', {
10
10
  callbacks: []
11
11
  }, {
12
12
  stateToRestore
@@ -1,2 +1,2 @@
1
1
  import type { DataGridProcessedProps } from '../../models/props/DataGridProps';
2
- export declare const useGridRootProps: () => DataGridProcessedProps;
2
+ export declare const useGridRootProps: () => DataGridProcessedProps<any>;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { DataGridProcessedProps } from '../../models/props/DataGridProps';
3
3
  import type { GridApiCommon, GridRowEntry } from '../../models';
4
4
  export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.MutableRefObject<Api>, props: Pick<DataGridProcessedProps, 'pagination' | 'paginationMode'>) => {
5
- rows: GridRowEntry[];
5
+ rows: GridRowEntry<any>[];
6
6
  range: {
7
7
  firstRowIndex: number;
8
8
  lastRowIndex: number;
@@ -16,7 +16,7 @@ export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.M
16
16
  * - If the row tree is flat, it only contains up to `state.pageSize` rows.
17
17
  */
18
18
  export declare const useGridVisibleRows: <Api extends GridApiCommon>(apiRef: React.MutableRefObject<Api>, props: Pick<DataGridProcessedProps, 'pagination' | 'paginationMode'>) => {
19
- rows: GridRowEntry[];
19
+ rows: GridRowEntry<any>[];
20
20
  range: {
21
21
  firstRowIndex: number;
22
22
  lastRowIndex: number;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.7.0
1
+ /** @license MUI v5.8.0
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.
@@ -3,8 +3,8 @@ export { GridVirtualScrollerContent } from '../components/virtualization/GridVir
3
3
  export { GridVirtualScrollerRenderZone } from '../components/virtualization/GridVirtualScrollerRenderZone';
4
4
  export { GridColumnHeaders } from '../components/columnHeaders/GridColumnHeaders';
5
5
  export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
6
- export { useGridRegisterPreProcessor } from '../hooks/core/preProcessing';
7
- export type { GridPreProcessor } from '../hooks/core/preProcessing';
6
+ export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
7
+ export type { GridPipeProcessor } from '../hooks/core/pipeProcessing';
8
8
  export { useGridRegisterStrategyProcessor } from '../hooks/core/strategyProcessing';
9
9
  export type { GridStrategyProcessor } from '../hooks/core/strategyProcessing';
10
10
  export { useGridInitialization } from '../hooks/core/useGridInitialization';
@@ -19,8 +19,7 @@ export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport'
19
19
  export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
20
20
  export type { GridAggregatedFilterItemApplier } from '../hooks/features/filter/gridFilterState';
21
21
  export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
22
- export { useGridKeyboard } from '../hooks/features/keyboard/useGridKeyboard';
23
- export { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
22
+ export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
24
23
  export { useGridPagination, paginationStateInitializer, } from '../hooks/features/pagination/useGridPagination';
25
24
  export { useGridPreferencesPanel, preferencePanelStateInitializer, } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
26
25
  export { useGridEditing as useGridEditing_new, editingStateInitializer as editingStateInitializer_new, } from '../hooks/features/editRows/useGridEditing.new';
@@ -43,8 +42,6 @@ export { useGridVirtualScroller } from '../hooks/features/virtualization/useGrid
43
42
  export { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
44
43
  export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
45
44
  export type { GridStateInitializer } from '../hooks/utils/useGridInitializeState';
46
- export type { GridComparatorFn, GridSortCellParams } from '../models/gridSortModel';
47
- export type { GridSortModelParams } from '../models/params/gridSortModelParams';
48
45
  export type { GridExperimentalFeatures, DataGridPropsWithoutDefaultValue, DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing, } from '../models/props/DataGridProps';
49
46
  export { createSelector } from '../utils/createSelector';
50
47
  export { findParentElementFromClassName } from '../utils/domUtils';
@@ -3,7 +3,7 @@ export { GridVirtualScrollerContent } from '../components/virtualization/GridVir
3
3
  export { GridVirtualScrollerRenderZone } from '../components/virtualization/GridVirtualScrollerRenderZone';
4
4
  export { GridColumnHeaders } from '../components/columnHeaders/GridColumnHeaders';
5
5
  export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
6
- export { useGridRegisterPreProcessor } from '../hooks/core/preProcessing';
6
+ export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
7
7
  export { useGridRegisterStrategyProcessor } from '../hooks/core/strategyProcessing';
8
8
  export { useGridInitialization } from '../hooks/core/useGridInitialization';
9
9
  export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
@@ -15,8 +15,7 @@ export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
15
15
  export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
16
16
  export { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
17
17
  export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/useGridFocus';
18
- export { useGridKeyboard } from '../hooks/features/keyboard/useGridKeyboard';
19
- export { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
18
+ export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
20
19
  export { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
21
20
  export { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
22
21
  export { useGridEditing as useGridEditing_new, editingStateInitializer as editingStateInitializer_new } from '../hooks/features/editRows/useGridEditing.new';