@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
@@ -1,10 +1,9 @@
1
- import { GridCellValue } from './gridCell';
2
1
  import { GridRowId, GridRowTreeNodeConfig } from './gridRows';
3
2
  export declare type GridSortDirection = 'asc' | 'desc' | null | undefined;
4
- export interface GridSortCellParams {
3
+ export interface GridSortCellParams<V = any> {
5
4
  id: GridRowId;
6
5
  field: string;
7
- value: GridCellValue;
6
+ value: V;
8
7
  rowNode: GridRowTreeNodeConfig;
9
8
  /**
10
9
  * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
@@ -14,7 +13,7 @@ export interface GridSortCellParams {
14
13
  /**
15
14
  * The type of the sort comparison function.
16
15
  */
17
- export declare type GridComparatorFn = (v1: GridCellValue, v2: GridCellValue, cellParams1: GridSortCellParams, cellParams2: GridSortCellParams) => number;
16
+ export declare type GridComparatorFn<V = any> = (v1: V, v2: V, cellParams1: GridSortCellParams<V>, cellParams2: GridSortCellParams<V>) => number;
18
17
  /**
19
18
  * Object that represents the column sorted data, part of the [[GridSortModel]].
20
19
  */
package/models/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export * from './gridEditRowModel';
5
5
  export * from './gridFeatureMode';
6
6
  export * from './gridFilterItem';
7
7
  export * from './gridFilterModel';
8
- export * from './gridFilterOperator';
9
8
  export * from './gridRootContainerRef';
10
9
  export * from './gridRenderContextProps';
11
10
  export * from './gridRows';
@@ -24,3 +23,4 @@ export * from './logger';
24
23
  export * from './muiEvent';
25
24
  export * from './events';
26
25
  export * from './gridSortModel';
26
+ export * from './gridFilterOperator';
package/models/index.js CHANGED
@@ -5,7 +5,6 @@ export * from './gridEditRowModel';
5
5
  export * from './gridFeatureMode';
6
6
  export * from './gridFilterItem';
7
7
  export * from './gridFilterModel';
8
- export * from './gridFilterOperator';
9
8
  export * from './gridRootContainerRef';
10
9
  export * from './gridRenderContextProps';
11
10
  export * from './gridRows';
@@ -23,4 +22,5 @@ export * from './gridExport';
23
22
  export * from './logger';
24
23
  export * from './muiEvent';
25
24
  export * from './events';
26
- export * from './gridSortModel';
25
+ export * from './gridSortModel';
26
+ export * from './gridFilterOperator';
@@ -1,11 +1,11 @@
1
- import { GridCellMode, GridCellValue } from '../gridCell';
2
- import { GridRowId, GridRowModel, GridRowTreeNodeConfig } from '../gridRows';
1
+ import { GridCellMode } from '../gridCell';
2
+ import { GridRowId, GridRowModel, GridRowTreeNodeConfig, GridValidRowModel } from '../gridRows';
3
3
  import type { GridStateColDef } from '../colDef/gridColDef';
4
4
  import { GridEditCellProps } from '../gridEditRowModel';
5
5
  /**
6
6
  * Object passed as parameter in the column [[GridColDef]] cell renderer.
7
7
  */
8
- export interface GridCellParams<V = any, R = any, F = V> {
8
+ export interface GridCellParams<V = any, R extends GridValidRowModel = any, F = V> {
9
9
  /**
10
10
  * The grid row id.
11
11
  */
@@ -17,7 +17,7 @@ export interface GridCellParams<V = any, R = any, F = V> {
17
17
  /**
18
18
  * The cell value, but if the column has valueGetter, use getValue.
19
19
  */
20
- value: V;
20
+ value: V | undefined;
21
21
  /**
22
22
  * The cell value formatted with the column valueFormatter.
23
23
  */
@@ -54,15 +54,15 @@ export interface GridCellParams<V = any, R = any, F = V> {
54
54
  * Get the cell value of a row and field.
55
55
  * @param {GridRowId} id The row id.
56
56
  * @param {string} field The field.
57
- * @returns {GridCellValue} The cell value.
57
+ * @returns {any} The cell value.
58
58
  * @deprecated Use `params.row` to directly access the fields you want instead.
59
59
  */
60
- getValue: (id: GridRowId, field: string) => GridCellValue;
60
+ getValue: (id: GridRowId, field: string) => any;
61
61
  }
62
62
  /**
63
63
  * GridCellParams containing api.
64
64
  */
65
- export interface GridRenderCellParams<V = any, R = any, F = V> extends GridCellParams<V, R, F> {
65
+ export interface GridRenderCellParams<V = any, R extends GridValidRowModel = any, F = V> extends GridCellParams<V, R, F> {
66
66
  /**
67
67
  * GridApi that let you manipulate the grid.
68
68
  * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
@@ -72,7 +72,7 @@ export interface GridRenderCellParams<V = any, R = any, F = V> extends GridCellP
72
72
  /**
73
73
  * GridEditCellProps containing api.
74
74
  */
75
- export interface GridRenderEditCellParams<V = any, R = any, F = V> extends GridCellParams<V, R, F>, GridEditCellProps<V> {
75
+ export interface GridRenderEditCellParams<V = any, R extends GridValidRowModel = any, F = V> extends GridCellParams<V, R, F>, GridEditCellProps<V> {
76
76
  /**
77
77
  * GridApi that let you manipulate the grid.
78
78
  * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
@@ -92,24 +92,24 @@ export interface GridValueGetterParams<V = any, R = any> extends Omit<GridCellPa
92
92
  /**
93
93
  * @deprecated Use `GridValueGetterParams` instead.
94
94
  */
95
- export declare type GridValueGetterFullParams<V = any, R = any> = GridValueGetterParams<V, R>;
95
+ export declare type GridValueGetterFullParams<V = any, R extends GridValidRowModel = any> = GridValueGetterParams<V, R>;
96
96
  /**
97
97
  * Object passed as parameter in the column [[GridColDef]] value setter callback.
98
98
  */
99
- export interface GridValueSetterParams {
99
+ export interface GridValueSetterParams<R extends GridValidRowModel = any, V = any> {
100
100
  /**
101
101
  * The new cell value.
102
102
  */
103
- value: GridCellValue;
103
+ value: V;
104
104
  /**
105
105
  * The row that is being edited.
106
106
  */
107
- row: GridRowModel;
107
+ row: R;
108
108
  }
109
109
  /**
110
110
  * Object passed as parameter in the column [[GridColDef]] value formatter callback.
111
111
  */
112
- export interface GridValueFormatterParams {
112
+ export interface GridValueFormatterParams<V = any> {
113
113
  /**
114
114
  * The grid row id.
115
115
  * It is not available when the value formatter is called by the filter panel.
@@ -122,7 +122,7 @@ export interface GridValueFormatterParams {
122
122
  /**
123
123
  * The cell value, if the column has valueGetter it is the value returned by it.
124
124
  */
125
- value: GridCellValue;
125
+ value: V;
126
126
  /**
127
127
  * GridApi that let you manipulate the grid.
128
128
  * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
@@ -1,8 +1,9 @@
1
1
  import type { GridStateColDef } from '../colDef/gridColDef';
2
+ import { GridValidRowModel } from '../gridRows';
2
3
  /**
3
4
  * Object passed as parameter in the column [[GridColDef]] header renderer.
4
5
  */
5
- export interface GridColumnHeaderParams {
6
+ export interface GridColumnHeaderParams<V = any, R extends GridValidRowModel = GridValidRowModel, F = V> {
6
7
  /**
7
8
  * The column field of the column that triggered the event
8
9
  */
@@ -10,5 +11,5 @@ export interface GridColumnHeaderParams {
10
11
  /**
11
12
  * The column of the current header component.
12
13
  */
13
- colDef: GridStateColDef;
14
+ colDef: GridStateColDef<R, V, F>;
14
15
  }
@@ -1,4 +1,3 @@
1
- import { GridCellValue } from '../gridCell';
2
1
  import { GridEditCellProps } from '../gridEditRowModel';
3
2
  import { GridRowId } from '../gridRows';
4
3
  import { GridCellParams } from './gridCellParams';
@@ -22,7 +21,7 @@ export interface GridEditCellValueParams {
22
21
  /**
23
22
  * The new value for the cell.
24
23
  */
25
- value: GridCellValue;
24
+ value: any;
26
25
  /**
27
26
  * The debounce time in milliseconds.
28
27
  */
@@ -35,7 +34,7 @@ export interface GridCommitCellChangeParams {
35
34
  export interface GridCellEditCommitParams {
36
35
  id: GridRowId;
37
36
  field: string;
38
- value: GridCellValue;
37
+ value: any;
39
38
  }
40
39
  declare enum GridCellEditStartReasons {
41
40
  enterKeyDown = "enterKeyDown",
@@ -0,0 +1,3 @@
1
+ import { GridPreferencePanelState } from '../../hooks/features/preferencesPanel/gridPreferencePanelState';
2
+ export interface GridPreferencePanelParams extends Omit<GridPreferencePanelState, 'open'> {
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,9 @@
1
- import { GridCellValue } from '../gridCell';
2
- import { GridRowEntry, GridRowId, GridRowModel } from '../gridRows';
1
+ import { GridValidRowModel, GridRowEntry, GridRowId } from '../gridRows';
3
2
  import type { GridColumns } from '../colDef/gridColDef';
4
3
  /**
5
4
  * Object passed as parameter in the row callbacks.
6
5
  */
7
- export interface GridRowParams<R extends GridRowModel = GridRowModel> {
6
+ export interface GridRowParams<R extends GridValidRowModel = any> {
8
7
  /**
9
8
  * The grid row id.
10
9
  */
@@ -21,10 +20,10 @@ export interface GridRowParams<R extends GridRowModel = GridRowModel> {
21
20
  * Get the cell value of a row and field.
22
21
  * @param {GridRowId} id The row id.
23
22
  * @param {string} field The field.
24
- * @returns {GridCellValue} The cell value.
23
+ * @returns {any} The cell value.
25
24
  * @deprecated Use `params.row` to directly access the fields you want instead.
26
25
  */
27
- getValue: (id: GridRowId, field: string) => GridCellValue;
26
+ getValue: (id: GridRowId, field: string) => any;
28
27
  }
29
28
  interface GridRowVisibilityParams {
30
29
  /**
@@ -39,7 +38,7 @@ interface GridRowVisibilityParams {
39
38
  /**
40
39
  * Object passed as parameter in the row `getRowClassName` callback prop.
41
40
  */
42
- export interface GridRowClassNameParams extends GridRowParams, GridRowVisibilityParams {
41
+ export interface GridRowClassNameParams<R extends GridValidRowModel = any> extends GridRowParams<R>, GridRowVisibilityParams {
43
42
  }
44
43
  /**
45
44
  * Object passed as parameter in the row `getRowHeight` callback prop.
@@ -63,7 +62,7 @@ declare enum GridRowEditStartReasons {
63
62
  /**
64
63
  * Params passed to the `rowEditStart` event.
65
64
  */
66
- export interface GridRowEditStartParams<R extends GridRowModel = GridRowModel> extends GridRowParams<R> {
65
+ export interface GridRowEditStartParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
67
66
  /**
68
67
  * Which field triggered this event.
69
68
  * Only applied if `props.experimentalFeatures.newEditingApi: true`.
@@ -82,7 +81,7 @@ declare enum GridRowEditStopReasons {
82
81
  tabKeyDown = "tabKeyDown",
83
82
  shiftTabKeyDown = "shiftTabKeyDown"
84
83
  }
85
- export interface GridRowEditStopParams<R extends GridRowModel = GridRowModel> extends GridRowParams<R> {
84
+ export interface GridRowEditStopParams<R extends GridValidRowModel = any> extends GridRowParams<R> {
86
85
  /**
87
86
  * Which field triggered this event.
88
87
  * Only applied if `props.experimentalFeatures.newEditingApi: true`.
@@ -1,8 +1,8 @@
1
- import { GridRowModel, GridRowId } from '../gridRows';
1
+ import { GridRowId, GridValidRowModel } from '../gridRows';
2
2
  /**
3
3
  * Object passed as parameter of the valueOptions function for singleSelect column.
4
4
  */
5
- export interface GridValueOptionsParams {
5
+ export interface GridValueOptionsParams<R extends GridValidRowModel = any> {
6
6
  /**
7
7
  * The field of the column to which options will be provided
8
8
  */
@@ -14,5 +14,5 @@ export interface GridValueOptionsParams {
14
14
  /**
15
15
  * The row model of the row that the current cell belongs to.
16
16
  */
17
- row?: GridRowModel;
17
+ row?: R;
18
18
  }
@@ -10,3 +10,4 @@ export * from './gridHeaderSelectionCheckboxParams';
10
10
  export * from './gridValueOptionsParams';
11
11
  export * from './gridCellParams';
12
12
  export * from './gridSortModelParams';
13
+ export * from './gridPreferencePanelParams';
@@ -9,4 +9,5 @@ export * from './gridRowSelectionCheckboxParams';
9
9
  export * from './gridHeaderSelectionCheckboxParams';
10
10
  export * from './gridValueOptionsParams';
11
11
  export * from './gridCellParams';
12
- export * from './gridSortModelParams';
12
+ export * from './gridSortModelParams';
13
+ export * from './gridPreferencePanelParams';
@@ -8,7 +8,7 @@ import { GridFeatureMode } from '../gridFeatureMode';
8
8
  import { Logger } from '../logger';
9
9
  import { GridSortDirection, GridSortModel } from '../gridSortModel';
10
10
  import { GridSlotsComponent } from '../gridSlotsComponent';
11
- import { GridRowIdGetter, GridRowsProp, GridRowModel } from '../gridRows';
11
+ import { GridRowIdGetter, GridRowsProp, GridValidRowModel } from '../gridRows';
12
12
  import { GridEventListener, GridEvents } from '../events';
13
13
  import { GridCallbackDetails, GridLocaleText } from '../api';
14
14
  import { GridApiCommunity } from '../api/gridApiCommunity';
@@ -40,13 +40,13 @@ export interface GridExperimentalFeatures {
40
40
  /**
41
41
  * The props users can give to the `DataGrid` component.
42
42
  */
43
- export declare type DataGridProps = Omit<Partial<DataGridPropsWithDefaultValues> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue, DataGridForcedPropsKey> & {
43
+ export declare type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<DataGridPropsWithDefaultValues> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue<R>, DataGridForcedPropsKey> & {
44
44
  pagination?: true;
45
45
  };
46
46
  /**
47
47
  * The props of the `DataGrid` component after the pre-processing phase.
48
48
  */
49
- export interface DataGridProcessedProps extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue {
49
+ export interface DataGridProcessedProps<R extends GridValidRowModel = any> extends DataGridPropsWithDefaultValues, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithoutDefaultValue<R> {
50
50
  }
51
51
  /**
52
52
  * The props of the `DataGrid` component after the pre-processing phase that the user should not be able to override.
@@ -293,7 +293,7 @@ export interface DataGridPropsWithDefaultValues {
293
293
  /**
294
294
  * The `DataGrid` props with no default value.
295
295
  */
296
- export interface DataGridPropsWithoutDefaultValue extends CommonProps {
296
+ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends CommonProps {
297
297
  /**
298
298
  * The ref object that allows grid manipulation. Can be instantiated with [[useGridApiRef()]].
299
299
  * TODO: Remove `@internal` when opening `apiRef` to Community plan
@@ -328,13 +328,13 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
328
328
  * @param {GridCellParams} params With all properties from [[GridCellParams]].
329
329
  * @returns {string} The CSS class to apply to the cell.
330
330
  */
331
- getCellClassName?: (params: GridCellParams) => string;
331
+ getCellClassName?: (params: GridCellParams<any, R>) => string;
332
332
  /**
333
333
  * Function that applies CSS classes dynamically on rows.
334
334
  * @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
335
335
  * @returns {string} The CSS class to apply to the row.
336
336
  */
337
- getRowClassName?: (params: GridRowClassNameParams) => string;
337
+ getRowClassName?: (params: GridRowClassNameParams<R>) => string;
338
338
  /**
339
339
  * Function that sets the row height per row.
340
340
  * @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
@@ -352,19 +352,19 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
352
352
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
353
353
  * @returns {JSX.Element} The row detail element.
354
354
  */
355
- getDetailPanelContent?: (params: GridRowParams) => React.ReactNode;
355
+ getDetailPanelContent?: (params: GridRowParams<R>) => React.ReactNode;
356
356
  /**
357
357
  * Callback fired when a cell is rendered, returns true if the cell is editable.
358
358
  * @param {GridCellParams} params With all properties from [[GridCellParams]].
359
359
  * @returns {boolean} A boolean indicating if the cell is editable.
360
360
  */
361
- isCellEditable?: (params: GridCellParams) => boolean;
361
+ isCellEditable?: (params: GridCellParams<any, R>) => boolean;
362
362
  /**
363
363
  * Determines if a row can be selected.
364
364
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
365
365
  * @returns {boolean} A boolean indicating if the cell is selectable.
366
366
  */
367
- isRowSelectable?: (params: GridRowParams) => boolean;
367
+ isRowSelectable?: (params: GridRowParams<R>) => boolean;
368
368
  /**
369
369
  * Callback fired when the edit cell value changes.
370
370
  * @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
@@ -556,6 +556,20 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
556
556
  * @param {GridCallbackDetails} details Additional details for this callback.
557
557
  */
558
558
  onPageSizeChange?: (pageSize: number, details: GridCallbackDetails) => void;
559
+ /**
560
+ * Callback fired when the preferences panel is closed.
561
+ * @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
562
+ * @param {MuiEvent<{}>} event The event object.
563
+ * @param {GridCallbackDetails} details Additional details for this callback.
564
+ */
565
+ onPreferencePanelClose?: GridEventListener<GridEvents.preferencePanelClose>;
566
+ /**
567
+ * Callback fired when the preferences panel is opened.
568
+ * @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
569
+ * @param {MuiEvent<{}>} event The event object.
570
+ * @param {GridCallbackDetails} details Additional details for this callback.
571
+ */
572
+ onPreferencePanelOpen?: GridEventListener<GridEvents.preferencePanelOpen>;
559
573
  /**
560
574
  * Set the edit rows model of the grid.
561
575
  */
@@ -618,7 +632,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
618
632
  /**
619
633
  * Set of columns of type [[GridColumns]].
620
634
  */
621
- columns: GridColumns;
635
+ columns: GridColumns<R>;
622
636
  /**
623
637
  * An error that will turn the grid into its error state and display the error component.
624
638
  */
@@ -626,7 +640,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
626
640
  /**
627
641
  * Return the id of a given [[GridRowModel]].
628
642
  */
629
- getRowId?: GridRowIdGetter;
643
+ getRowId?: GridRowIdGetter<R>;
630
644
  /**
631
645
  * If `true`, a loading overlay is displayed.
632
646
  */
@@ -638,7 +652,7 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
638
652
  /**
639
653
  * Set of rows of type [[GridRowsProp]].
640
654
  */
641
- rows: GridRowsProp;
655
+ rows: GridRowsProp<R>;
642
656
  /**
643
657
  * The initial state of the DataGrid.
644
658
  * The data in it will be set in the state on initialization but will not be controlled.
@@ -661,9 +675,15 @@ export interface DataGridPropsWithoutDefaultValue extends CommonProps {
661
675
  /**
662
676
  * Callback called before updating a row with new values in the row and cell editing.
663
677
  * Only applied if `props.experimentalFeatures.newEditingApi: true`.
664
- * @param {GridRowModel} newRow Row object with the new values.
665
- * @param {GridRowModel} oldRow Row object with the old values.
666
- * @returns {Promise<GridRowModel> | GridRowModel} The final values to update the row.
678
+ * @template R
679
+ * @param {R} newRow Row object with the new values.
680
+ * @param {R} oldRow Row object with the old values.
681
+ * @returns {Promise<R> | R} The final values to update the row.
682
+ */
683
+ processRowUpdate?: (newRow: R, oldRow: R) => Promise<R> | R;
684
+ /**
685
+ * Callback called when `processRowUpdate` throws an error or rejects.
686
+ * @param {any} error The error thrown.
667
687
  */
668
- processRowUpdate?: (newRow: GridRowModel, oldRow: GridRowModel) => Promise<GridRowModel> | GridRowModel;
688
+ onProcessRowUpdateError?: (error: any) => void;
669
689
  }
@@ -498,6 +498,28 @@ DataGridRaw.propTypes = {
498
498
  */
499
499
  onPageSizeChange: PropTypes.func,
500
500
 
501
+ /**
502
+ * Callback fired when the preferences panel is closed.
503
+ * @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
504
+ * @param {MuiEvent<{}>} event The event object.
505
+ * @param {GridCallbackDetails} details Additional details for this callback.
506
+ */
507
+ onPreferencePanelClose: PropTypes.func,
508
+
509
+ /**
510
+ * Callback fired when the preferences panel is opened.
511
+ * @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
512
+ * @param {MuiEvent<{}>} event The event object.
513
+ * @param {GridCallbackDetails} details Additional details for this callback.
514
+ */
515
+ onPreferencePanelOpen: PropTypes.func,
516
+
517
+ /**
518
+ * Callback called when `processRowUpdate` throws an error or rejects.
519
+ * @param {any} error The error thrown.
520
+ */
521
+ onProcessRowUpdateError: PropTypes.func,
522
+
501
523
  /**
502
524
  * Callback fired when the grid is resized.
503
525
  * @param {ElementSize} containerSize With all properties from [[ElementSize]].
@@ -604,9 +626,10 @@ DataGridRaw.propTypes = {
604
626
  /**
605
627
  * Callback called before updating a row with new values in the row and cell editing.
606
628
  * Only applied if `props.experimentalFeatures.newEditingApi: true`.
607
- * @param {GridRowModel} newRow Row object with the new values.
608
- * @param {GridRowModel} oldRow Row object with the old values.
609
- * @returns {Promise<GridRowModel> | GridRowModel} The final values to update the row.
629
+ * @template R
630
+ * @param {R} newRow Row object with the new values.
631
+ * @param {R} oldRow Row object with the old values.
632
+ * @returns {Promise<R> | R} The final values to update the row.
610
633
  */
611
634
  processRowUpdate: PropTypes.func,
612
635
 
@@ -631,7 +654,7 @@ DataGridRaw.propTypes = {
631
654
  /**
632
655
  * Set of rows of type [[GridRowsProp]].
633
656
  */
634
- rows: PropTypes.arrayOf(PropTypes.object).isRequired,
657
+ rows: PropTypes.array.isRequired,
635
658
 
636
659
  /**
637
660
  * Sets the type of space between rows added by `getRowSpacing`.
@@ -8,8 +8,7 @@ import { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
8
8
  import { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
9
9
  import { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
10
10
  import { focusStateInitializer, useGridFocus } from '../hooks/features/focus/useGridFocus';
11
- import { useGridKeyboard } from '../hooks/features/keyboard/useGridKeyboard';
12
- import { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
11
+ import { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
13
12
  import { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
14
13
  import { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
15
14
  import { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old } from '../hooks/features/editRows/useGridEditing.old';
@@ -49,6 +48,7 @@ export const useDataGridComponent = props => {
49
48
  useGridInitializeState(paginationStateInitializer, apiRef, props);
50
49
  useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
51
50
  useGridInitializeState(columnMenuStateInitializer, apiRef, props);
51
+ useGridKeyboardNavigation(apiRef, props);
52
52
  useGridSelection(apiRef, props);
53
53
  useGridColumns(apiRef, props);
54
54
  useGridRows(apiRef, props);
@@ -64,8 +64,6 @@ export const useDataGridComponent = props => {
64
64
  useGridRowsMeta(apiRef, props);
65
65
  useGridScroll(apiRef, props);
66
66
  useGridColumnMenu(apiRef);
67
- useGridKeyboard(apiRef);
68
- useGridKeyboardNavigation(apiRef, props);
69
67
  useGridCsvExport(apiRef);
70
68
  useGridPrintExport(apiRef, props);
71
69
  useGridClipboard(apiRef);
@@ -10,7 +10,7 @@ export function gridDateFormatter({
10
10
  return value.toLocaleDateString();
11
11
  }
12
12
 
13
- return value;
13
+ return value ?? '';
14
14
  }
15
15
  export function gridDateTimeFormatter({
16
16
  value
@@ -19,7 +19,7 @@ export function gridDateTimeFormatter({
19
19
  return value.toLocaleString();
20
20
  }
21
21
 
22
- return value;
22
+ return value ?? '';
23
23
  }
24
24
  export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
25
25
  type: 'date',
@@ -1,9 +1,9 @@
1
- import { GRID_STRING_COL_DEF } from '../../colDef/gridStringColDef';
2
- import { GRID_NUMERIC_COL_DEF } from '../../colDef/gridNumericColDef';
3
- import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '../../colDef/gridDateColDef';
4
- import { GRID_BOOLEAN_COL_DEF } from '../../colDef/gridBooleanColDef';
5
- import { GRID_SINGLE_SELECT_COL_DEF } from '../../colDef/gridSingleSelectColDef';
6
- import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../colDef/gridActionsColDef';
1
+ import { GRID_STRING_COL_DEF } from './gridStringColDef';
2
+ import { GRID_NUMERIC_COL_DEF } from './gridNumericColDef';
3
+ import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
4
+ import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
5
+ import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
6
+ import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
7
7
  export const DEFAULT_GRID_COL_TYPE_KEY = '__default__';
8
8
  export const getGridDefaultColumnTypes = () => {
9
9
  const nativeColumnTypes = {
@@ -9,4 +9,5 @@ export * from './gridBooleanOperators';
9
9
  export * from './gridDateOperators';
10
10
  export * from './gridNumericOperators';
11
11
  export * from './gridSingleSelectOperators';
12
- export * from './gridStringOperators';
12
+ export * from './gridStringOperators';
13
+ export * from './gridDefaultColumnTypes';
@@ -278,7 +278,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
278
278
  isLastVisible: PropTypes.bool,
279
279
  lastColumnToRender: PropTypes.number.isRequired,
280
280
  renderedColumns: PropTypes.arrayOf(PropTypes.object).isRequired,
281
- row: PropTypes.object.isRequired,
281
+ row: PropTypes.any.isRequired,
282
282
  rowHeight: PropTypes.number.isRequired,
283
283
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
284
284
  selected: PropTypes.bool.isRequired,
@@ -196,7 +196,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
196
196
  className: PropTypes.string,
197
197
  colIndex: PropTypes.number.isRequired,
198
198
  field: PropTypes.string.isRequired,
199
- formattedValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
199
+ formattedValue: PropTypes.any,
200
200
  hasFocus: PropTypes.bool,
201
201
  height: PropTypes.number.isRequired,
202
202
  isEditable: PropTypes.bool,
@@ -210,7 +210,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
210
210
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
211
211
  showRightBorder: PropTypes.bool,
212
212
  tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
213
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
213
+ value: PropTypes.any,
214
214
  width: PropTypes.number.isRequired
215
215
  } : void 0;
216
216
  export { GridCell };
@@ -124,7 +124,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
124
124
  * Get the cell value of a row and field.
125
125
  * @param {GridRowId} id The row id.
126
126
  * @param {string} field The field.
127
- * @returns {GridCellValue} The cell value.
127
+ * @returns {any} The cell value.
128
128
  * @deprecated Use `params.row` to directly access the fields you want instead.
129
129
  */
130
130
  getValue: PropTypes.func.isRequired,
@@ -149,7 +149,7 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
149
149
  /**
150
150
  * The row model of the row that the current cell belongs to.
151
151
  */
152
- row: PropTypes.any.isRequired,
152
+ row: PropTypes.object.isRequired,
153
153
 
154
154
  /**
155
155
  * The node of the row that the current cell belongs to.
@@ -181,7 +181,7 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
181
181
  * Get the cell value of a row and field.
182
182
  * @param {GridRowId} id The row id.
183
183
  * @param {string} field The field.
184
- * @returns {GridCellValue} The cell value.
184
+ * @returns {any} The cell value.
185
185
  * @deprecated Use `params.row` to directly access the fields you want instead.
186
186
  */
187
187
  getValue: PropTypes.func.isRequired,
@@ -206,7 +206,7 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
206
206
  /**
207
207
  * The row model of the row that the current cell belongs to.
208
208
  */
209
- row: PropTypes.any.isRequired,
209
+ row: PropTypes.object.isRequired,
210
210
 
211
211
  /**
212
212
  * The node of the row that the current cell belongs to.