@mui/x-data-grid 5.8.0 → 5.11.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 (626) hide show
  1. package/CHANGELOG.md +333 -66
  2. package/DataGrid/DataGrid.js +36 -2
  3. package/DataGrid/useDataGridComponent.js +3 -1
  4. package/DataGrid/useDataGridProps.js +2 -1
  5. package/LICENSE +21 -0
  6. package/README.md +7 -5
  7. package/colDef/gridActionsColDef.js +2 -1
  8. package/colDef/gridBooleanColDef.js +2 -1
  9. package/colDef/gridCheckboxSelectionColDef.js +1 -0
  10. package/colDef/gridDateColDef.js +4 -2
  11. package/colDef/gridNumericColDef.js +3 -2
  12. package/colDef/gridNumericOperators.d.ts +2 -0
  13. package/colDef/gridNumericOperators.js +11 -0
  14. package/colDef/gridSingleSelectColDef.js +3 -2
  15. package/colDef/gridSingleSelectOperators.d.ts +3 -0
  16. package/colDef/gridSingleSelectOperators.js +52 -0
  17. package/colDef/gridStringColDef.js +3 -2
  18. package/colDef/gridStringOperators.d.ts +2 -0
  19. package/colDef/gridStringOperators.js +12 -0
  20. package/components/GridFooter.d.ts +4 -2
  21. package/components/GridFooter.js +11 -2
  22. package/components/GridRow.d.ts +4 -0
  23. package/components/GridRow.js +58 -28
  24. package/components/GridRowCount.d.ts +4 -1
  25. package/components/GridRowCount.js +1 -0
  26. package/components/GridScrollArea.js +3 -4
  27. package/components/GridSelectedRowCount.d.ts +4 -1
  28. package/components/GridSelectedRowCount.js +2 -1
  29. package/components/base/GridBody.js +1 -2
  30. package/components/base/GridOverlays.js +5 -5
  31. package/components/cell/GridActionsCell.d.ts +5 -1
  32. package/components/cell/GridActionsCell.js +179 -21
  33. package/components/cell/GridActionsCellItem.d.ts +66 -4
  34. package/components/cell/GridActionsCellItem.js +7 -5
  35. package/components/cell/GridCell.d.ts +1 -0
  36. package/components/cell/GridCell.js +36 -15
  37. package/components/cell/GridEditBooleanCell.d.ts +15 -3
  38. package/components/cell/GridEditBooleanCell.js +101 -6
  39. package/components/cell/GridEditDateCell.d.ts +16 -4
  40. package/components/cell/GridEditDateCell.js +99 -5
  41. package/components/cell/GridEditInputCell.d.ts +11 -5
  42. package/components/cell/GridEditInputCell.js +30 -6
  43. package/components/cell/GridEditSingleSelectCell.d.ts +12 -4
  44. package/components/cell/GridEditSingleSelectCell.js +50 -18
  45. package/components/cell/index.d.ts +2 -0
  46. package/components/cell/index.js +2 -0
  47. package/components/columnHeaders/GridColumnHeaderItem.js +19 -23
  48. package/components/columnHeaders/GridColumnHeaders.d.ts +2 -1
  49. package/components/columnHeaders/GridColumnHeaders.js +1 -1
  50. package/components/columnHeaders/GridColumnHeadersInner.d.ts +2 -0
  51. package/components/columnSelection/GridCellCheckboxRenderer.d.ts +3 -3
  52. package/components/columnSelection/GridCellCheckboxRenderer.js +22 -6
  53. package/components/columnSelection/GridHeaderCheckbox.js +4 -5
  54. package/components/containers/GridFooterContainer.d.ts +8 -2
  55. package/components/containers/GridFooterContainer.js +11 -2
  56. package/components/containers/GridRootStyles.js +36 -1
  57. package/components/containers/GridToolbarContainer.d.ts +8 -2
  58. package/components/containers/GridToolbarContainer.js +12 -2
  59. package/components/menu/GridMenu.js +1 -0
  60. package/components/panel/GridPanel.js +1 -0
  61. package/components/panel/GridPanelContent.d.ts +8 -1
  62. package/components/panel/GridPanelContent.js +13 -2
  63. package/components/panel/GridPanelFooter.d.ts +8 -1
  64. package/components/panel/GridPanelFooter.js +13 -2
  65. package/components/panel/GridPanelHeader.d.ts +8 -1
  66. package/components/panel/GridPanelHeader.js +13 -2
  67. package/components/panel/filterPanel/GridFilterForm.js +14 -10
  68. package/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
  69. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -15
  70. package/components/panel/filterPanel/GridFilterInputValue.js +22 -15
  71. package/components/toolbar/GridToolbar.d.ts +12 -2
  72. package/components/toolbar/GridToolbar.js +30 -7
  73. package/components/toolbar/GridToolbarDensitySelector.js +1 -1
  74. package/components/toolbar/GridToolbarExport.d.ts +5 -4
  75. package/components/toolbar/GridToolbarExport.js +15 -20
  76. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  77. package/components/toolbar/GridToolbarQuickFilter.d.ts +20 -0
  78. package/components/toolbar/GridToolbarQuickFilter.js +88 -0
  79. package/components/toolbar/index.d.ts +3 -1
  80. package/components/toolbar/index.js +3 -2
  81. package/components/virtualization/GridVirtualScroller.d.ts +4 -1
  82. package/components/virtualization/GridVirtualScroller.js +2 -0
  83. package/components/virtualization/GridVirtualScrollerContent.d.ts +4 -1
  84. package/components/virtualization/GridVirtualScrollerContent.js +1 -3
  85. package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +4 -1
  86. package/constants/defaultGridSlotsComponents.js +3 -2
  87. package/constants/gridClasses.d.ts +20 -0
  88. package/constants/gridClasses.js +1 -1
  89. package/constants/gridDetailPanelToggleField.d.ts +1 -0
  90. package/constants/gridDetailPanelToggleField.js +2 -0
  91. package/constants/localeTextConstants.js +8 -1
  92. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +39 -15
  93. package/hooks/core/pipeProcessing/index.d.ts +1 -0
  94. package/hooks/core/pipeProcessing/index.js +2 -1
  95. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +8 -3
  96. package/hooks/core/pipeProcessing/useGridPipeProcessing.js +53 -19
  97. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +3 -0
  98. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
  99. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +0 -3
  100. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
  101. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +4 -4
  102. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  103. package/hooks/core/useGridApiInitialization.js +3 -3
  104. package/hooks/core/useGridErrorHandler.js +1 -2
  105. package/hooks/core/useGridStateInitialization.js +1 -2
  106. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -1
  107. package/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -16
  108. package/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
  109. package/hooks/features/columns/gridColumnsInterfaces.d.ts +3 -1
  110. package/hooks/features/columns/gridColumnsUtils.d.ts +19 -1
  111. package/hooks/features/columns/gridColumnsUtils.js +61 -8
  112. package/hooks/features/columns/useGridColumnSpanning.d.ts +7 -0
  113. package/hooks/features/columns/useGridColumnSpanning.js +108 -0
  114. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  115. package/hooks/features/columns/useGridColumns.js +30 -25
  116. package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
  117. package/hooks/features/dimensions/useGridDimensions.js +10 -11
  118. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  119. package/hooks/features/editRows/useGridCellEditing.new.js +151 -42
  120. package/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  121. package/hooks/features/editRows/useGridEditing.new.js +7 -3
  122. package/hooks/features/editRows/useGridEditing.old.js +4 -5
  123. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  124. package/hooks/features/editRows/useGridRowEditing.new.js +145 -57
  125. package/hooks/features/editRows/useGridRowEditing.old.js +21 -22
  126. package/hooks/features/events/useGridEvents.js +17 -18
  127. package/hooks/features/export/serializers/csvSerializer.js +5 -5
  128. package/hooks/features/export/useGridCsvExport.js +23 -16
  129. package/hooks/features/export/useGridPrintExport.js +22 -0
  130. package/hooks/features/export/utils.d.ts +3 -1
  131. package/hooks/features/export/utils.js +13 -0
  132. package/hooks/features/filter/gridFilterState.d.ts +1 -2
  133. package/hooks/features/filter/gridFilterState.js +3 -1
  134. package/hooks/features/filter/gridFilterUtils.d.ts +8 -0
  135. package/hooks/features/filter/gridFilterUtils.js +84 -2
  136. package/hooks/features/filter/useGridFilter.js +32 -15
  137. package/hooks/features/focus/useGridFocus.d.ts +1 -1
  138. package/hooks/features/focus/useGridFocus.js +48 -42
  139. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -0
  140. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -12
  141. package/hooks/features/pagination/useGridPage.js +3 -4
  142. package/hooks/features/pagination/useGridPageSize.js +2 -3
  143. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  144. package/hooks/features/rows/gridRowsSelector.d.ts +2 -0
  145. package/hooks/features/rows/gridRowsSelector.js +2 -0
  146. package/hooks/features/rows/gridRowsState.d.ts +7 -7
  147. package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
  148. package/hooks/features/rows/gridRowsUtils.js +25 -1
  149. package/hooks/features/rows/useGridRows.d.ts +2 -2
  150. package/hooks/features/rows/useGridRows.js +121 -61
  151. package/hooks/features/rows/useGridRowsMeta.js +6 -13
  152. package/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  153. package/hooks/features/scroll/useGridScroll.d.ts +2 -0
  154. package/hooks/features/scroll/useGridScroll.js +31 -4
  155. package/hooks/features/selection/useGridSelection.d.ts +1 -1
  156. package/hooks/features/selection/useGridSelection.js +15 -11
  157. package/hooks/features/sorting/useGridSorting.js +17 -18
  158. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -0
  159. package/hooks/features/virtualization/useGridVirtualScroller.js +68 -32
  160. package/hooks/utils/useGridApiEventHandler.d.ts +4 -1
  161. package/hooks/utils/useGridApiEventHandler.js +22 -9
  162. package/hooks/utils/useGridNativeEventListener.js +1 -2
  163. package/hooks/utils/useGridSelector.js +1 -1
  164. package/index.d.ts +2 -0
  165. package/index.js +1 -1
  166. package/internals/index.d.ts +5 -1
  167. package/internals/index.js +6 -2
  168. package/legacy/DataGrid/DataGrid.js +36 -2
  169. package/legacy/DataGrid/useDataGridComponent.js +3 -1
  170. package/legacy/DataGrid/useDataGridProps.js +2 -1
  171. package/legacy/colDef/gridActionsColDef.js +2 -1
  172. package/legacy/colDef/gridBooleanColDef.js +2 -1
  173. package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -0
  174. package/legacy/colDef/gridDateColDef.js +4 -2
  175. package/legacy/colDef/gridNumericColDef.js +3 -2
  176. package/legacy/colDef/gridNumericOperators.js +28 -18
  177. package/legacy/colDef/gridSingleSelectColDef.js +3 -2
  178. package/legacy/colDef/gridSingleSelectOperators.js +55 -6
  179. package/legacy/colDef/gridStringColDef.js +3 -2
  180. package/legacy/colDef/gridStringOperators.js +25 -14
  181. package/legacy/components/GridFooter.js +11 -2
  182. package/legacy/components/GridRow.js +56 -28
  183. package/legacy/components/GridRowCount.js +1 -0
  184. package/legacy/components/GridScrollArea.js +3 -4
  185. package/legacy/components/GridSelectedRowCount.js +2 -1
  186. package/legacy/components/base/GridBody.js +1 -2
  187. package/legacy/components/base/GridOverlays.js +5 -5
  188. package/legacy/components/cell/GridActionsCell.js +197 -27
  189. package/legacy/components/cell/GridActionsCellItem.js +7 -5
  190. package/legacy/components/cell/GridCell.js +37 -15
  191. package/legacy/components/cell/GridEditBooleanCell.js +132 -11
  192. package/legacy/components/cell/GridEditDateCell.js +148 -42
  193. package/legacy/components/cell/GridEditInputCell.js +62 -13
  194. package/legacy/components/cell/GridEditSingleSelectCell.js +65 -28
  195. package/legacy/components/cell/index.js +2 -0
  196. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +19 -23
  197. package/legacy/components/columnHeaders/GridColumnHeaders.js +2 -3
  198. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +23 -6
  199. package/legacy/components/columnSelection/GridHeaderCheckbox.js +4 -5
  200. package/legacy/components/containers/GridFooterContainer.js +11 -2
  201. package/legacy/components/containers/GridRootStyles.js +26 -5
  202. package/legacy/components/containers/GridToolbarContainer.js +12 -2
  203. package/legacy/components/menu/GridMenu.js +1 -0
  204. package/legacy/components/panel/GridPanel.js +1 -0
  205. package/legacy/components/panel/GridPanelContent.js +13 -2
  206. package/legacy/components/panel/GridPanelFooter.js +13 -2
  207. package/legacy/components/panel/GridPanelHeader.js +13 -2
  208. package/legacy/components/panel/filterPanel/GridFilterForm.js +14 -10
  209. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +13 -8
  210. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +22 -17
  211. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +22 -17
  212. package/legacy/components/toolbar/GridToolbar.js +31 -6
  213. package/legacy/components/toolbar/GridToolbarDensitySelector.js +1 -1
  214. package/legacy/components/toolbar/GridToolbarExport.js +18 -19
  215. package/legacy/components/toolbar/GridToolbarQuickFilter.js +103 -0
  216. package/legacy/components/toolbar/index.js +3 -2
  217. package/legacy/components/virtualization/GridVirtualScroller.js +2 -0
  218. package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -3
  219. package/legacy/constants/defaultGridSlotsComponents.js +3 -2
  220. package/legacy/constants/gridClasses.js +1 -1
  221. package/legacy/constants/gridDetailPanelToggleField.js +2 -0
  222. package/legacy/constants/localeTextConstants.js +8 -1
  223. package/legacy/hooks/core/pipeProcessing/index.js +2 -1
  224. package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +60 -24
  225. package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
  226. package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
  227. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  228. package/legacy/hooks/core/useGridApiInitialization.js +3 -3
  229. package/legacy/hooks/core/useGridErrorHandler.js +1 -2
  230. package/legacy/hooks/core/useGridStateInitialization.js +1 -2
  231. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +94 -16
  232. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
  233. package/legacy/hooks/features/columns/gridColumnsUtils.js +79 -22
  234. package/legacy/hooks/features/columns/useGridColumnSpanning.js +106 -0
  235. package/legacy/hooks/features/columns/useGridColumns.js +30 -25
  236. package/legacy/hooks/features/dimensions/useGridDimensions.js +10 -11
  237. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +225 -89
  238. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  239. package/legacy/hooks/features/editRows/useGridEditing.new.js +7 -3
  240. package/legacy/hooks/features/editRows/useGridEditing.old.js +4 -5
  241. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +157 -65
  242. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +20 -21
  243. package/legacy/hooks/features/events/useGridEvents.js +17 -18
  244. package/legacy/hooks/features/export/serializers/csvSerializer.js +5 -5
  245. package/legacy/hooks/features/export/useGridCsvExport.js +24 -17
  246. package/legacy/hooks/features/export/useGridPrintExport.js +22 -0
  247. package/legacy/hooks/features/export/utils.js +14 -0
  248. package/legacy/hooks/features/filter/gridFilterState.js +3 -1
  249. package/legacy/hooks/features/filter/gridFilterUtils.js +96 -2
  250. package/legacy/hooks/features/filter/useGridFilter.js +32 -15
  251. package/legacy/hooks/features/focus/useGridFocus.js +50 -44
  252. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -11
  253. package/legacy/hooks/features/pagination/useGridPage.js +3 -4
  254. package/legacy/hooks/features/pagination/useGridPageSize.js +2 -3
  255. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  256. package/legacy/hooks/features/rows/gridRowsSelector.js +6 -0
  257. package/legacy/hooks/features/rows/gridRowsUtils.js +27 -1
  258. package/legacy/hooks/features/rows/useGridRows.js +131 -61
  259. package/legacy/hooks/features/rows/useGridRowsMeta.js +6 -13
  260. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  261. package/legacy/hooks/features/scroll/useGridScroll.js +31 -4
  262. package/legacy/hooks/features/selection/useGridSelection.js +15 -11
  263. package/legacy/hooks/features/sorting/useGridSorting.js +12 -15
  264. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +79 -42
  265. package/legacy/hooks/utils/useGridApiEventHandler.js +20 -9
  266. package/legacy/hooks/utils/useGridNativeEventListener.js +1 -2
  267. package/legacy/hooks/utils/useGridSelector.js +1 -1
  268. package/legacy/index.js +1 -1
  269. package/legacy/internals/index.js +6 -2
  270. package/legacy/locales/arSD.js +8 -1
  271. package/legacy/locales/bgBG.js +8 -1
  272. package/legacy/locales/csCZ.js +7 -0
  273. package/legacy/locales/daDK.js +8 -1
  274. package/legacy/locales/deDE.js +10 -3
  275. package/legacy/locales/elGR.js +7 -0
  276. package/legacy/locales/esES.js +7 -0
  277. package/legacy/locales/faIR.js +8 -1
  278. package/legacy/locales/fiFI.js +7 -0
  279. package/legacy/locales/frFR.js +7 -0
  280. package/legacy/locales/heIL.js +8 -1
  281. package/legacy/locales/huHU.js +127 -0
  282. package/legacy/locales/index.js +1 -0
  283. package/legacy/locales/itIT.js +7 -0
  284. package/legacy/locales/jaJP.js +7 -0
  285. package/legacy/locales/koKR.js +7 -0
  286. package/legacy/locales/nlNL.js +7 -0
  287. package/legacy/locales/plPL.js +8 -1
  288. package/legacy/locales/ptBR.js +8 -1
  289. package/legacy/locales/ruRU.js +7 -0
  290. package/legacy/locales/skSK.js +7 -0
  291. package/legacy/locales/trTR.js +8 -1
  292. package/legacy/locales/ukUA.js +7 -0
  293. package/legacy/locales/viVN.js +7 -0
  294. package/legacy/locales/zhCN.js +7 -0
  295. package/legacy/models/api/gridColumnSpanning.js +1 -0
  296. package/legacy/models/events/gridEvents.js +10 -3
  297. package/legacy/models/gridColumnSpanning.js +1 -0
  298. package/legacy/models/index.js +4 -3
  299. package/legacy/utils/createSelector.js +18 -2
  300. package/legacy/utils/exportAs.js +1 -1
  301. package/locales/arSD.js +8 -1
  302. package/locales/bgBG.js +8 -1
  303. package/locales/csCZ.js +7 -0
  304. package/locales/daDK.js +8 -1
  305. package/locales/deDE.js +10 -3
  306. package/locales/elGR.js +7 -0
  307. package/locales/esES.js +7 -0
  308. package/locales/faIR.js +8 -1
  309. package/locales/fiFI.js +7 -0
  310. package/locales/frFR.js +7 -0
  311. package/locales/heIL.js +8 -1
  312. package/locales/huHU.d.ts +2 -0
  313. package/locales/huHU.js +115 -0
  314. package/locales/index.d.ts +1 -0
  315. package/locales/index.js +1 -0
  316. package/locales/itIT.js +7 -0
  317. package/locales/jaJP.js +7 -0
  318. package/locales/koKR.js +7 -0
  319. package/locales/nlNL.js +7 -0
  320. package/locales/plPL.js +8 -1
  321. package/locales/ptBR.js +8 -1
  322. package/locales/ruRU.js +7 -0
  323. package/locales/skSK.js +7 -0
  324. package/locales/trTR.js +8 -1
  325. package/locales/ukUA.js +7 -0
  326. package/locales/viVN.js +7 -0
  327. package/locales/zhCN.js +7 -0
  328. package/models/api/gridApiCommon.d.ts +2 -1
  329. package/models/api/gridColumnSpanning.d.ts +28 -0
  330. package/models/api/gridColumnSpanning.js +1 -0
  331. package/models/api/gridCoreApi.d.ts +10 -0
  332. package/models/api/gridEditingApi.d.ts +72 -7
  333. package/models/api/gridFilterApi.d.ts +5 -0
  334. package/models/api/gridFocusApi.d.ts +1 -0
  335. package/models/api/gridLocaleTextApi.d.ts +5 -0
  336. package/models/api/gridRowApi.d.ts +34 -0
  337. package/models/api/index.d.ts +1 -1
  338. package/models/colDef/gridColDef.d.ts +18 -0
  339. package/models/events/gridEventLookup.d.ts +296 -11
  340. package/models/events/gridEvents.d.ts +10 -258
  341. package/models/events/gridEvents.js +10 -3
  342. package/models/gridColumnSpanning.d.ts +12 -0
  343. package/models/gridColumnSpanning.js +1 -0
  344. package/models/gridEditRowModel.d.ts +1 -1
  345. package/models/gridExport.d.ts +29 -2
  346. package/models/gridFilterModel.d.ts +11 -0
  347. package/models/gridFilterOperator.d.ts +1 -1
  348. package/models/gridIconSlotsComponent.d.ts +5 -0
  349. package/models/gridStateCommunity.d.ts +0 -2
  350. package/models/index.d.ts +1 -1
  351. package/models/index.js +4 -3
  352. package/models/params/gridCellParams.d.ts +12 -2
  353. package/models/params/gridRowParams.d.ts +5 -0
  354. package/models/props/DataGridProps.d.ts +57 -29
  355. package/modern/DataGrid/DataGrid.js +36 -2
  356. package/modern/DataGrid/useDataGridComponent.js +3 -1
  357. package/modern/DataGrid/useDataGridProps.js +2 -1
  358. package/modern/colDef/gridActionsColDef.js +2 -1
  359. package/modern/colDef/gridBooleanColDef.js +2 -1
  360. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
  361. package/modern/colDef/gridDateColDef.js +4 -2
  362. package/modern/colDef/gridNumericColDef.js +3 -2
  363. package/modern/colDef/gridNumericOperators.js +11 -0
  364. package/modern/colDef/gridSingleSelectColDef.js +3 -2
  365. package/modern/colDef/gridSingleSelectOperators.js +52 -0
  366. package/modern/colDef/gridStringColDef.js +3 -2
  367. package/modern/colDef/gridStringOperators.js +12 -0
  368. package/modern/components/GridFooter.js +11 -2
  369. package/modern/components/GridRow.js +56 -26
  370. package/modern/components/GridRowCount.js +1 -0
  371. package/modern/components/GridScrollArea.js +3 -4
  372. package/modern/components/GridSelectedRowCount.js +2 -1
  373. package/modern/components/base/GridBody.js +1 -2
  374. package/modern/components/base/GridOverlays.js +5 -5
  375. package/modern/components/cell/GridActionsCell.js +179 -21
  376. package/modern/components/cell/GridActionsCellItem.js +7 -5
  377. package/modern/components/cell/GridCell.js +36 -15
  378. package/modern/components/cell/GridEditBooleanCell.js +101 -6
  379. package/modern/components/cell/GridEditDateCell.js +99 -5
  380. package/modern/components/cell/GridEditInputCell.js +30 -6
  381. package/modern/components/cell/GridEditSingleSelectCell.js +48 -16
  382. package/modern/components/cell/index.js +2 -0
  383. package/modern/components/columnHeaders/GridColumnHeaderItem.js +19 -23
  384. package/modern/components/columnHeaders/GridColumnHeaders.js +1 -1
  385. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +22 -6
  386. package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -5
  387. package/modern/components/containers/GridFooterContainer.js +11 -2
  388. package/modern/components/containers/GridRootStyles.js +36 -1
  389. package/modern/components/containers/GridToolbarContainer.js +12 -2
  390. package/modern/components/menu/GridMenu.js +1 -0
  391. package/modern/components/panel/GridPanel.js +1 -0
  392. package/modern/components/panel/GridPanelContent.js +13 -2
  393. package/modern/components/panel/GridPanelFooter.js +13 -2
  394. package/modern/components/panel/GridPanelHeader.js +13 -2
  395. package/modern/components/panel/filterPanel/GridFilterForm.js +10 -6
  396. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +11 -6
  397. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +20 -13
  398. package/modern/components/panel/filterPanel/GridFilterInputValue.js +20 -13
  399. package/modern/components/toolbar/GridToolbar.js +30 -7
  400. package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
  401. package/modern/components/toolbar/GridToolbarExport.js +15 -20
  402. package/modern/components/toolbar/GridToolbarQuickFilter.js +86 -0
  403. package/modern/components/toolbar/index.js +3 -2
  404. package/modern/components/virtualization/GridVirtualScroller.js +2 -0
  405. package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -3
  406. package/modern/constants/defaultGridSlotsComponents.js +3 -2
  407. package/modern/constants/gridClasses.js +1 -1
  408. package/modern/constants/gridDetailPanelToggleField.js +2 -0
  409. package/modern/constants/localeTextConstants.js +8 -1
  410. package/modern/hooks/core/pipeProcessing/index.js +2 -1
  411. package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +53 -19
  412. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +27 -0
  413. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -4
  414. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -7
  415. package/modern/hooks/core/useGridApiInitialization.js +3 -3
  416. package/modern/hooks/core/useGridErrorHandler.js +1 -2
  417. package/modern/hooks/core/useGridStateInitialization.js +1 -2
  418. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +81 -16
  419. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
  420. package/modern/hooks/features/columns/gridColumnsUtils.js +61 -8
  421. package/modern/hooks/features/columns/useGridColumnSpanning.js +106 -0
  422. package/modern/hooks/features/columns/useGridColumns.js +30 -25
  423. package/modern/hooks/features/dimensions/useGridDimensions.js +10 -11
  424. package/modern/hooks/features/editRows/useGridCellEditing.new.js +149 -42
  425. package/modern/hooks/features/editRows/useGridCellEditing.old.js +20 -21
  426. package/modern/hooks/features/editRows/useGridEditing.new.js +7 -3
  427. package/modern/hooks/features/editRows/useGridEditing.old.js +4 -5
  428. package/modern/hooks/features/editRows/useGridRowEditing.new.js +143 -57
  429. package/modern/hooks/features/editRows/useGridRowEditing.old.js +21 -22
  430. package/modern/hooks/features/events/useGridEvents.js +17 -18
  431. package/modern/hooks/features/export/serializers/csvSerializer.js +5 -5
  432. package/modern/hooks/features/export/useGridCsvExport.js +21 -16
  433. package/modern/hooks/features/export/useGridPrintExport.js +20 -0
  434. package/modern/hooks/features/export/utils.js +13 -0
  435. package/modern/hooks/features/filter/gridFilterState.js +3 -1
  436. package/modern/hooks/features/filter/gridFilterUtils.js +80 -2
  437. package/modern/hooks/features/filter/useGridFilter.js +32 -15
  438. package/modern/hooks/features/focus/useGridFocus.js +48 -42
  439. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +41 -12
  440. package/modern/hooks/features/pagination/useGridPage.js +3 -4
  441. package/modern/hooks/features/pagination/useGridPageSize.js +2 -3
  442. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -6
  443. package/modern/hooks/features/rows/gridRowsSelector.js +2 -0
  444. package/modern/hooks/features/rows/gridRowsUtils.js +23 -1
  445. package/modern/hooks/features/rows/useGridRows.js +121 -61
  446. package/modern/hooks/features/rows/useGridRowsMeta.js +6 -13
  447. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  448. package/modern/hooks/features/scroll/useGridScroll.js +29 -4
  449. package/modern/hooks/features/selection/useGridSelection.js +15 -11
  450. package/modern/hooks/features/sorting/useGridSorting.js +17 -18
  451. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +68 -28
  452. package/modern/hooks/utils/useGridApiEventHandler.js +20 -9
  453. package/modern/hooks/utils/useGridNativeEventListener.js +1 -2
  454. package/modern/hooks/utils/useGridSelector.js +1 -1
  455. package/modern/index.js +1 -1
  456. package/modern/internals/index.js +6 -2
  457. package/modern/locales/arSD.js +8 -1
  458. package/modern/locales/bgBG.js +8 -1
  459. package/modern/locales/csCZ.js +7 -0
  460. package/modern/locales/daDK.js +8 -1
  461. package/modern/locales/deDE.js +10 -3
  462. package/modern/locales/elGR.js +7 -0
  463. package/modern/locales/esES.js +7 -0
  464. package/modern/locales/faIR.js +8 -1
  465. package/modern/locales/fiFI.js +7 -0
  466. package/modern/locales/frFR.js +7 -0
  467. package/modern/locales/heIL.js +8 -1
  468. package/modern/locales/huHU.js +115 -0
  469. package/modern/locales/index.js +1 -0
  470. package/modern/locales/itIT.js +7 -0
  471. package/modern/locales/jaJP.js +7 -0
  472. package/modern/locales/koKR.js +7 -0
  473. package/modern/locales/nlNL.js +7 -0
  474. package/modern/locales/plPL.js +8 -1
  475. package/modern/locales/ptBR.js +8 -1
  476. package/modern/locales/ruRU.js +7 -0
  477. package/modern/locales/skSK.js +7 -0
  478. package/modern/locales/trTR.js +8 -1
  479. package/modern/locales/ukUA.js +7 -0
  480. package/modern/locales/viVN.js +7 -0
  481. package/modern/locales/zhCN.js +7 -0
  482. package/modern/models/api/gridColumnSpanning.js +1 -0
  483. package/modern/models/events/gridEvents.js +10 -3
  484. package/modern/models/gridColumnSpanning.js +1 -0
  485. package/modern/models/index.js +4 -3
  486. package/modern/utils/createSelector.js +20 -2
  487. package/modern/utils/exportAs.js +1 -1
  488. package/node/DataGrid/DataGrid.js +36 -2
  489. package/node/DataGrid/useDataGridComponent.js +4 -1
  490. package/node/DataGrid/useDataGridProps.js +2 -1
  491. package/node/colDef/gridActionsColDef.js +2 -1
  492. package/node/colDef/gridBooleanColDef.js +2 -1
  493. package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
  494. package/node/colDef/gridDateColDef.js +4 -2
  495. package/node/colDef/gridNumericColDef.js +2 -1
  496. package/node/colDef/gridNumericOperators.js +15 -1
  497. package/node/colDef/gridSingleSelectColDef.js +2 -1
  498. package/node/colDef/gridSingleSelectOperators.js +56 -1
  499. package/node/colDef/gridStringColDef.js +2 -1
  500. package/node/colDef/gridStringOperators.js +16 -1
  501. package/node/components/GridFooter.js +10 -1
  502. package/node/components/GridRow.js +59 -29
  503. package/node/components/GridRowCount.js +1 -0
  504. package/node/components/GridScrollArea.js +3 -5
  505. package/node/components/GridSelectedRowCount.js +2 -1
  506. package/node/components/base/GridBody.js +1 -3
  507. package/node/components/base/GridOverlays.js +4 -5
  508. package/node/components/cell/GridActionsCell.js +181 -21
  509. package/node/components/cell/GridActionsCellItem.js +7 -4
  510. package/node/components/cell/GridCell.js +35 -14
  511. package/node/components/cell/GridEditBooleanCell.js +100 -5
  512. package/node/components/cell/GridEditDateCell.js +98 -4
  513. package/node/components/cell/GridEditInputCell.js +30 -6
  514. package/node/components/cell/GridEditSingleSelectCell.js +50 -18
  515. package/node/components/cell/index.js +26 -0
  516. package/node/components/columnHeaders/GridColumnHeaderItem.js +19 -24
  517. package/node/components/columnHeaders/GridColumnHeaders.js +1 -1
  518. package/node/components/columnSelection/GridCellCheckboxRenderer.js +22 -7
  519. package/node/components/columnSelection/GridHeaderCheckbox.js +4 -6
  520. package/node/components/containers/GridFooterContainer.js +10 -1
  521. package/node/components/containers/GridRootStyles.js +36 -1
  522. package/node/components/containers/GridToolbarContainer.js +11 -1
  523. package/node/components/menu/GridMenu.js +1 -0
  524. package/node/components/panel/GridPanel.js +1 -0
  525. package/node/components/panel/GridPanelContent.js +11 -1
  526. package/node/components/panel/GridPanelFooter.js +11 -1
  527. package/node/components/panel/GridPanelHeader.js +11 -1
  528. package/node/components/panel/filterPanel/GridFilterForm.js +15 -10
  529. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +14 -8
  530. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +23 -15
  531. package/node/components/panel/filterPanel/GridFilterInputValue.js +23 -15
  532. package/node/components/toolbar/GridToolbar.js +32 -7
  533. package/node/components/toolbar/GridToolbarDensitySelector.js +1 -1
  534. package/node/components/toolbar/GridToolbarExport.js +14 -19
  535. package/node/components/toolbar/GridToolbarQuickFilter.js +111 -0
  536. package/node/components/toolbar/index.js +42 -11
  537. package/node/components/virtualization/GridVirtualScroller.js +2 -0
  538. package/node/components/virtualization/GridVirtualScrollerContent.js +1 -3
  539. package/node/constants/defaultGridSlotsComponents.js +2 -1
  540. package/node/constants/gridClasses.js +1 -1
  541. package/node/constants/gridDetailPanelToggleField.js +9 -0
  542. package/node/constants/localeTextConstants.js +8 -1
  543. package/node/hooks/core/pipeProcessing/index.js +13 -0
  544. package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +51 -20
  545. package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +42 -0
  546. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -3
  547. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +6 -8
  548. package/node/hooks/core/useGridApiInitialization.js +3 -4
  549. package/node/hooks/core/useGridErrorHandler.js +1 -3
  550. package/node/hooks/core/useGridStateInitialization.js +1 -3
  551. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +85 -17
  552. package/node/hooks/features/columnMenu/useGridColumnMenu.js +3 -4
  553. package/node/hooks/features/columns/gridColumnsUtils.js +65 -9
  554. package/node/hooks/features/columns/useGridColumnSpanning.js +128 -0
  555. package/node/hooks/features/columns/useGridColumns.js +29 -25
  556. package/node/hooks/features/dimensions/useGridDimensions.js +10 -12
  557. package/node/hooks/features/editRows/useGridCellEditing.new.js +151 -42
  558. package/node/hooks/features/editRows/useGridCellEditing.old.js +20 -22
  559. package/node/hooks/features/editRows/useGridEditing.new.js +6 -2
  560. package/node/hooks/features/editRows/useGridEditing.old.js +4 -6
  561. package/node/hooks/features/editRows/useGridRowEditing.new.js +143 -57
  562. package/node/hooks/features/editRows/useGridRowEditing.old.js +21 -23
  563. package/node/hooks/features/events/useGridEvents.js +17 -19
  564. package/node/hooks/features/export/serializers/csvSerializer.js +5 -5
  565. package/node/hooks/features/export/useGridCsvExport.js +26 -17
  566. package/node/hooks/features/export/useGridPrintExport.js +25 -0
  567. package/node/hooks/features/export/utils.js +19 -2
  568. package/node/hooks/features/filter/gridFilterState.js +3 -1
  569. package/node/hooks/features/filter/gridFilterUtils.js +92 -3
  570. package/node/hooks/features/filter/useGridFilter.js +33 -16
  571. package/node/hooks/features/focus/useGridFocus.js +48 -43
  572. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +44 -13
  573. package/node/hooks/features/pagination/useGridPage.js +3 -5
  574. package/node/hooks/features/pagination/useGridPageSize.js +2 -4
  575. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -8
  576. package/node/hooks/features/rows/gridRowsSelector.js +5 -1
  577. package/node/hooks/features/rows/gridRowsUtils.js +29 -1
  578. package/node/hooks/features/rows/useGridRows.js +122 -61
  579. package/node/hooks/features/rows/useGridRowsMeta.js +6 -14
  580. package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -0
  581. package/node/hooks/features/scroll/useGridScroll.js +32 -3
  582. package/node/hooks/features/selection/useGridSelection.js +16 -12
  583. package/node/hooks/features/sorting/useGridSorting.js +17 -19
  584. package/node/hooks/features/virtualization/useGridVirtualScroller.js +73 -33
  585. package/node/hooks/utils/useGridApiEventHandler.js +22 -10
  586. package/node/hooks/utils/useGridNativeEventListener.js +1 -3
  587. package/node/hooks/utils/useGridSelector.js +1 -1
  588. package/node/index.js +1 -1
  589. package/node/internals/index.js +47 -3
  590. package/node/locales/arSD.js +8 -1
  591. package/node/locales/bgBG.js +8 -1
  592. package/node/locales/csCZ.js +7 -0
  593. package/node/locales/daDK.js +8 -1
  594. package/node/locales/deDE.js +10 -3
  595. package/node/locales/elGR.js +7 -0
  596. package/node/locales/esES.js +7 -0
  597. package/node/locales/faIR.js +8 -1
  598. package/node/locales/fiFI.js +7 -0
  599. package/node/locales/frFR.js +7 -0
  600. package/node/locales/heIL.js +8 -1
  601. package/node/locales/huHU.js +125 -0
  602. package/node/locales/index.js +13 -0
  603. package/node/locales/itIT.js +7 -0
  604. package/node/locales/jaJP.js +7 -0
  605. package/node/locales/koKR.js +7 -0
  606. package/node/locales/nlNL.js +7 -0
  607. package/node/locales/plPL.js +8 -1
  608. package/node/locales/ptBR.js +8 -1
  609. package/node/locales/ruRU.js +7 -0
  610. package/node/locales/skSK.js +7 -0
  611. package/node/locales/trTR.js +8 -1
  612. package/node/locales/ukUA.js +7 -0
  613. package/node/locales/viVN.js +7 -0
  614. package/node/locales/zhCN.js +7 -0
  615. package/node/models/api/gridColumnSpanning.js +5 -0
  616. package/node/models/events/gridEvents.js +10 -3
  617. package/node/models/gridColumnSpanning.js +5 -0
  618. package/node/models/index.js +0 -13
  619. package/node/utils/createSelector.js +25 -4
  620. package/node/utils/exportAs.js +1 -1
  621. package/package.json +4 -4
  622. package/utils/createSelector.d.ts +2 -1
  623. package/utils/createSelector.js +20 -2
  624. package/utils/domUtils.d.ts +2 -2
  625. package/utils/exportAs.d.ts +2 -2
  626. package/utils/exportAs.js +1 -1
@@ -58,6 +58,11 @@ DataGridRaw.propTypes = {
58
58
  */
59
59
  autoPageSize: PropTypes.bool,
60
60
 
61
+ /**
62
+ * Controls the modes of the cells.
63
+ */
64
+ cellModesModel: PropTypes.object,
65
+
61
66
  /**
62
67
  * If `true`, the grid get a first column with a checkbox that allows to select rows.
63
68
  * @default false
@@ -205,7 +210,9 @@ DataGridRaw.propTypes = {
205
210
  operatorValue: PropTypes.string,
206
211
  value: PropTypes.any
207
212
  })).isRequired,
208
- linkOperator: PropTypes.oneOf(['and', 'or'])
213
+ linkOperator: PropTypes.oneOf(['and', 'or']),
214
+ quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
215
+ quickFilterValues: PropTypes.array
209
216
  }),
210
217
 
211
218
  /**
@@ -293,6 +300,14 @@ DataGridRaw.propTypes = {
293
300
  */
294
301
  isRowSelectable: PropTypes.func,
295
302
 
303
+ /**
304
+ * If `true`, the selection model will retain selected rows that do not exist.
305
+ * Useful when using server side pagination and row selections need to be retained
306
+ * when changing pages.
307
+ * @default false
308
+ */
309
+ keepNonExistentRowsSelected: PropTypes.bool,
310
+
296
311
  /**
297
312
  * If `true`, a loading overlay is displayed.
298
313
  */
@@ -380,6 +395,13 @@ DataGridRaw.propTypes = {
380
395
  */
381
396
  onCellKeyDown: PropTypes.func,
382
397
 
398
+ /**
399
+ * Callback fired when the `cellModesModel` prop changes.
400
+ * @param {GridCellModesModel} cellModesModel Object containig which cells are in "edit" mode.
401
+ * @param {GridCallbackDetails} details Additional details for this callback.
402
+ */
403
+ onCellModesModelChange: PropTypes.func,
404
+
383
405
  /**
384
406
  * Callback fired when a click event comes from a column header element.
385
407
  * @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
@@ -458,7 +480,7 @@ DataGridRaw.propTypes = {
458
480
  * @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
459
481
  * @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
460
482
  * @param {GridCallbackDetails} details Additional details for this callback.
461
- * @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/api/data-grid/grid-col-def/)
483
+ * @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
462
484
  */
463
485
  onEditCellPropsChange: PropTypes.func,
464
486
 
@@ -566,6 +588,13 @@ DataGridRaw.propTypes = {
566
588
  */
567
589
  onRowEditStop: PropTypes.func,
568
590
 
591
+ /**
592
+ * Callback fired when the `rowModesModel` prop changes.
593
+ * @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
594
+ * @param {GridCallbackDetails} details Additional details for this callback.
595
+ */
596
+ onRowModesModelChange: PropTypes.func,
597
+
569
598
  /**
570
599
  * Callback fired when the selection state of one or multiple rows changes.
571
600
  * @param {GridSelectionModel} selectionModel With all the row ids [[GridSelectionModel]].
@@ -651,6 +680,11 @@ DataGridRaw.propTypes = {
651
680
  */
652
681
  rowHeight: PropTypes.number,
653
682
 
683
+ /**
684
+ * Controls the modes of the rows.
685
+ */
686
+ rowModesModel: PropTypes.object,
687
+
654
688
  /**
655
689
  * Set of rows of type [[GridRowsProp]].
656
690
  */
@@ -24,6 +24,7 @@ import { useGridEvents } from '../hooks/features/events/useGridEvents';
24
24
  import { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';
25
25
  import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
26
26
  import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
27
+ import { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
27
28
  export const useDataGridComponent = props => {
28
29
  var _props$experimentalFe, _props$experimentalFe2;
29
30
 
@@ -55,12 +56,13 @@ export const useDataGridComponent = props => {
55
56
  useGridColumns(apiRef, props);
56
57
  useGridRows(apiRef, props);
57
58
  useGridParamsApi(apiRef);
59
+ useGridColumnSpanning(apiRef);
58
60
  const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
59
61
  useGridEditing(apiRef, props);
60
62
  useGridFocus(apiRef, props);
61
- useGridSorting(apiRef, props);
62
63
  useGridPreferencesPanel(apiRef);
63
64
  useGridFilter(apiRef, props);
65
+ useGridSorting(apiRef, props);
64
66
  useGridDensity(apiRef, props);
65
67
  useGridPagination(apiRef, props);
66
68
  useGridRowsMeta(apiRef, props);
@@ -61,7 +61,8 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
61
61
  sortingMode: GridFeatureModeConstant.client,
62
62
  throttleRowsMs: 0,
63
63
  disableColumnReorder: false,
64
- disableColumnResize: false
64
+ disableColumnResize: false,
65
+ keepNonExistentRowsSelected: false
65
66
  };
66
67
  export const useDataGridProps = inProps => {
67
68
  if (inProps.pageSize > MAX_PAGE_SIZE) {
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Material-UI SAS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mui/x-data-grid
2
2
 
3
- This package is the community edition of the data grid component.
3
+ This package is the Community Plan edition of the data grid component.
4
4
  It's part of MUI X, an open core extension of MUI, with advanced components.
5
5
 
6
6
  ## Installation
@@ -15,15 +15,17 @@ npm install @mui/x-data-grid
15
15
  yarn add @mui/x-data-grid
16
16
  ```
17
17
 
18
- This component has three peer dependencies that you will need to install as well.
18
+ This component has the following peer dependencies that you will need to install as well.
19
19
 
20
20
  ```json
21
21
  "peerDependencies": {
22
- "@mui/material": "^5.0.0",
23
- "react": "^17.0.0"
22
+ "@mui/material": "^5.2.8",
23
+ "@mui/system": "^5.2.8",
24
+ "react": "^17.0.2 || ^18.0.0",
25
+ "react-dom": "^17.0.2 || ^18.0.0"
24
26
  },
25
27
  ```
26
28
 
27
29
  ## Documentation
28
30
 
29
- [The documentation](https://mui.com/components/data-grid/)
31
+ [The documentation](https://mui.com/x/react-data-grid/)
@@ -11,5 +11,6 @@ export const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
11
11
  headerName: '',
12
12
  disableColumnMenu: true,
13
13
  disableExport: true,
14
- renderCell: renderActionsCell
14
+ renderCell: renderActionsCell,
15
+ getApplyQuickFilterFn: undefined
15
16
  });
@@ -20,5 +20,6 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
20
20
  renderEditCell: renderEditBooleanCell,
21
21
  sortComparator: gridNumberComparator,
22
22
  valueFormatter: gridBooleanFormatter,
23
- filterOperators: getGridBooleanOperators()
23
+ filterOperators: getGridBooleanOperators(),
24
+ getApplyQuickFilterFn: undefined
24
25
  });
@@ -15,6 +15,7 @@ export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF
15
15
  disableColumnMenu: true,
16
16
  disableReorder: true,
17
17
  disableExport: true,
18
+ getApplyQuickFilterFn: undefined,
18
19
  valueGetter: params => {
19
20
  const selectionLookup = selectedIdsLookupSelector(params.api.state, params.api.instanceId);
20
21
  return selectionLookup[params.id] !== undefined;
@@ -26,12 +26,14 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
26
26
  sortComparator: gridDateComparator,
27
27
  valueFormatter: gridDateFormatter,
28
28
  filterOperators: getGridDateOperators(),
29
- renderEditCell: renderEditDateCell
29
+ renderEditCell: renderEditDateCell,
30
+ getApplyQuickFilterFn: undefined
30
31
  });
31
32
  export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
32
33
  type: 'dateTime',
33
34
  sortComparator: gridDateComparator,
34
35
  valueFormatter: gridDateTimeFormatter,
35
36
  filterOperators: getGridDateOperators(true),
36
- renderEditCell: renderEditDateCell
37
+ renderEditCell: renderEditDateCell,
38
+ getApplyQuickFilterFn: undefined
37
39
  });
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
3
3
  import { isNumber } from '../utils/utils';
4
- import { getGridNumericOperators } from './gridNumericOperators';
4
+ import { getGridNumericOperators, getGridNumericQuickFilterFn } from './gridNumericOperators';
5
5
  import { GRID_STRING_COL_DEF } from './gridStringColDef';
6
6
  export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
7
7
  type: 'number',
@@ -12,5 +12,6 @@ export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
12
12
  valueFormatter: ({
13
13
  value
14
14
  }) => value && isNumber(value) && value.toLocaleString() || value,
15
- filterOperators: getGridNumericOperators()
15
+ filterOperators: getGridNumericOperators(),
16
+ getApplyQuickFilterFn: getGridNumericQuickFilterFn
16
17
  });
@@ -1,4 +1,6 @@
1
1
  import { GridFilterOperator } from '../models/gridFilterOperator';
2
+ import { GridCellParams } from '../models';
3
+ export declare const getGridNumericQuickFilterFn: (value: any) => (({ value: columnValue }: GridCellParams) => boolean) | null;
2
4
  export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any>[];
3
5
  /**
4
6
  * @deprecated Use `getGridNumericOperators` instead.
@@ -10,6 +10,17 @@ const parseNumericValue = value => {
10
10
  return Number(value);
11
11
  };
12
12
 
13
+ export const getGridNumericQuickFilterFn = value => {
14
+ if (value == null || Number.isNaN(value) || value === '') {
15
+ return null;
16
+ }
17
+
18
+ return ({
19
+ value: columnValue
20
+ }) => {
21
+ return parseNumericValue(columnValue) === parseNumericValue(value);
22
+ };
23
+ };
13
24
  export const getGridNumericOperators = () => [{
14
25
  label: '=',
15
26
  value: '=',
@@ -1,9 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { GRID_STRING_COL_DEF } from './gridStringColDef';
3
3
  import { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';
4
- import { getGridSingleSelectOperators } from './gridSingleSelectOperators';
4
+ import { getGridSingleSelectOperators, getGridSingleSelectQuickFilterFn } from './gridSingleSelectOperators';
5
5
  export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
6
6
  type: 'singleSelect',
7
7
  renderEditCell: renderEditSingleSelectCell,
8
- filterOperators: getGridSingleSelectOperators()
8
+ filterOperators: getGridSingleSelectOperators(),
9
+ getApplyQuickFilterFn: getGridSingleSelectQuickFilterFn
9
10
  });
@@ -1,2 +1,5 @@
1
1
  import { GridFilterOperator } from '../models/gridFilterOperator';
2
+ import { GridCellParams, GridColDef } from '../models';
3
+ import { GridApiCommunity } from '../models/api/gridApiCommunity';
4
+ export declare const getGridSingleSelectQuickFilterFn: (value: any, column: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => (({ value: columnValue }: GridCellParams) => boolean) | null;
2
5
  export declare const getGridSingleSelectOperators: () => GridFilterOperator[];
@@ -9,6 +9,58 @@ const parseObjectValue = value => {
9
9
  return value.value;
10
10
  };
11
11
 
12
+ export const getGridSingleSelectQuickFilterFn = (value, column, apiRef) => {
13
+ if (!value) {
14
+ return null;
15
+ }
16
+
17
+ const {
18
+ valueOptions,
19
+ valueFormatter,
20
+ field
21
+ } = column;
22
+ const potentialValues = [parseObjectValue(value).toString()];
23
+ const iterableColumnValues = typeof valueOptions === 'function' ? valueOptions({
24
+ field
25
+ }) : valueOptions || [];
26
+
27
+ if (iterableColumnValues) {
28
+ iterableColumnValues.forEach(option => {
29
+ // for each valueOption, check if the formatted value
30
+ let optionValue;
31
+ let optionLabel;
32
+
33
+ if (typeof option === 'object') {
34
+ optionValue = option.value;
35
+ optionLabel = option.label;
36
+ } else {
37
+ optionValue = option;
38
+
39
+ if (valueFormatter) {
40
+ optionLabel = valueFormatter({
41
+ value: option,
42
+ field,
43
+ api: apiRef.current
44
+ });
45
+ } else {
46
+ optionLabel = option;
47
+ }
48
+ }
49
+
50
+ if (optionLabel.slice(0, value.length).toLowerCase() === value.toLowerCase()) {
51
+ if (!potentialValues.includes(optionValue)) {
52
+ potentialValues.push(optionValue.toString());
53
+ }
54
+ }
55
+ });
56
+ }
57
+
58
+ return ({
59
+ value: columnValue
60
+ }) => {
61
+ return columnValue != null ? potentialValues.includes(parseObjectValue(columnValue).toString()) : false;
62
+ };
63
+ };
12
64
  export const getGridSingleSelectOperators = () => [{
13
65
  value: 'is',
14
66
  getApplyFilterFn: filterItem => {
@@ -1,6 +1,6 @@
1
1
  import { renderEditInputCell } from '../components/cell/GridEditInputCell';
2
2
  import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
3
- import { getGridStringOperators } from './gridStringOperators';
3
+ import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
4
4
  export const GRID_STRING_COL_DEF = {
5
5
  width: 100,
6
6
  minWidth: 50,
@@ -17,5 +17,6 @@ export const GRID_STRING_COL_DEF = {
17
17
  type: 'string',
18
18
  align: 'left',
19
19
  filterOperators: getGridStringOperators(),
20
- renderEditCell: renderEditInputCell
20
+ renderEditCell: renderEditInputCell,
21
+ getApplyQuickFilterFn: getGridStringQuickFilterFn
21
22
  };
@@ -1,2 +1,4 @@
1
1
  import { GridFilterOperator } from '../models/gridFilterOperator';
2
+ import { GridCellParams } from '../models';
3
+ export declare const getGridStringQuickFilterFn: (value: any) => (({ value: columnValue }: GridCellParams) => boolean) | null;
2
4
  export declare const getGridStringOperators: () => GridFilterOperator<any, number | string | null, any>[];
@@ -1,6 +1,18 @@
1
1
  import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';
2
2
  import { escapeRegExp } from '../utils/utils';
3
3
  import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
4
+ export const getGridStringQuickFilterFn = value => {
5
+ if (!value) {
6
+ return null;
7
+ }
8
+
9
+ const filterRegex = new RegExp(escapeRegExp(value), 'i');
10
+ return ({
11
+ value: columnValue
12
+ }) => {
13
+ return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
14
+ };
15
+ };
4
16
  export const getGridStringOperators = () => [{
5
17
  value: 'contains',
6
18
  getApplyFilterFn: filterItem => {
@@ -1,3 +1,5 @@
1
1
  import * as React from 'react';
2
- import { GridFooterContainerProps } from './containers/GridFooterContainer';
3
- export declare const GridFooter: React.ForwardRefExoticComponent<GridFooterContainerProps & React.RefAttributes<HTMLDivElement>>;
2
+ declare const GridFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
3
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
4
+ } & React.RefAttributes<HTMLDivElement>>;
5
+ export { GridFooter };
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import PropTypes from 'prop-types';
3
4
  import { useGridSelector } from '../hooks/utils/useGridSelector';
4
5
  import { gridTopLevelRowCountSelector } from '../hooks/features/rows/gridRowsSelector';
5
6
  import { selectedGridRowsCountSelector } from '../hooks/features/selection/gridSelectionSelector';
@@ -11,7 +12,7 @@ import { GridFooterContainer } from './containers/GridFooterContainer';
11
12
  import { useGridRootProps } from '../hooks/utils/useGridRootProps';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- export const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
15
+ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
15
16
  var _rootProps$components;
16
17
 
17
18
  const apiRef = useGridApiContext();
@@ -34,4 +35,12 @@ export const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(prop
34
35
  }, props, {
35
36
  children: [selectedRowCountElement, rowCountElement, paginationElement]
36
37
  }));
37
- });
38
+ });
39
+ process.env.NODE_ENV !== "production" ? GridFooter.propTypes = {
40
+ // ----------------------------- Warning --------------------------------
41
+ // | These PropTypes are generated from the TypeScript type definitions |
42
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
43
+ // ----------------------------------------------------------------------
44
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
45
+ } : void 0;
46
+ export { GridFooter };
@@ -6,6 +6,10 @@ import { GridCellIdentifier } from '../hooks/features/focus/gridFocusState';
6
6
  export interface GridRowProps {
7
7
  rowId: GridRowId;
8
8
  selected: boolean;
9
+ /**
10
+ * Index of the row in the whole sorted and filtered dataset.
11
+ * If some rows above have expanded children, this index also take those children into account.
12
+ */
9
13
  index: number;
10
14
  rowHeight: number;
11
15
  containerWidth: number;
@@ -9,7 +9,6 @@ import * as React from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import clsx from 'clsx';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/material';
12
- import { GridEvents } from '../models/events';
13
12
  import { GridEditModes, GridRowModes, GridCellModes } from '../models/gridEditRowModel';
14
13
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
15
14
  import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
@@ -20,6 +19,7 @@ import { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
20
19
  import { findParentElementFromClassName } from '../utils/domUtils';
21
20
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
22
21
  import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
22
+ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../constants/gridDetailPanelToggleField';
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
25
 
@@ -61,6 +61,7 @@ function GridRow(props) {
61
61
  const {
62
62
  selected,
63
63
  rowId,
64
+ row,
64
65
  index,
65
66
  style: styleProp,
66
67
  rowHeight,
@@ -132,7 +133,12 @@ function GridRow(props) {
132
133
  } // User opened a detail panel
133
134
 
134
135
 
135
- if (field === '__detail_panel_toggle__') {
136
+ if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {
137
+ return;
138
+ } // User reorders a row
139
+
140
+
141
+ if (field === '__reorder__') {
136
142
  return;
137
143
  } // User is editing a cell
138
144
 
@@ -149,7 +155,7 @@ function GridRow(props) {
149
155
  }
150
156
  }
151
157
 
152
- publish(GridEvents.rowClick, onClick)(event);
158
+ publish('rowClick', onClick)(event);
153
159
  }, [apiRef, onClick, publish, rowId]);
154
160
 
155
161
  const style = _extends({}, styleProp, {
@@ -176,7 +182,8 @@ function GridRow(props) {
176
182
 
177
183
  const rowParams = _extends({}, apiRef.current.getRowParams(rowId), {
178
184
  isFirstVisible: indexRelativeToCurrentPage === 0,
179
- isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1
185
+ isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1,
186
+ indexRelativeToCurrentPage
180
187
  });
181
188
 
182
189
  rowClassName = rootProps.getRowClassName(rowParams);
@@ -185,8 +192,6 @@ function GridRow(props) {
185
192
  const cells = [];
186
193
 
187
194
  for (let i = 0; i < renderedColumns.length; i += 1) {
188
- var _rootProps$components;
189
-
190
195
  const column = renderedColumns[i];
191
196
  const indexRelativeToAllColumns = firstColumnToRender + i;
192
197
  const isLastColumn = indexRelativeToAllColumns === visibleColumns.length - 1;
@@ -215,7 +220,16 @@ function GridRow(props) {
215
220
  if (editCellState != null && column.renderEditCell) {
216
221
  var _rootProps$classes2;
217
222
 
218
- const params = _extends({}, cellParams, editCellState, {
223
+ let updatedRow = row;
224
+
225
+ if (apiRef.current.unstable_getRowWithUpdatedValues) {
226
+ // Only the new editing API has this method
227
+ updatedRow = apiRef.current.unstable_getRowWithUpdatedValues(rowId, column.field);
228
+ }
229
+
230
+ const params = _extends({}, cellParams, {
231
+ row: updatedRow
232
+ }, editCellState, {
219
233
  api: apiRef.current
220
234
  });
221
235
 
@@ -231,24 +245,35 @@ function GridRow(props) {
231
245
 
232
246
  const hasFocus = cellFocus !== null && cellFocus.id === rowId && cellFocus.field === column.field;
233
247
  const tabIndex = cellTabIndex !== null && cellTabIndex.id === rowId && cellTabIndex.field === column.field && cellParams.cellMode === 'view' ? 0 : -1;
234
- cells.push( /*#__PURE__*/_jsx(rootProps.components.Cell, _extends({
235
- value: cellParams.value,
236
- field: column.field,
237
- width: column.computedWidth,
238
- rowId: rowId,
239
- height: rowHeight,
240
- showRightBorder: showRightBorder,
241
- formattedValue: cellParams.formattedValue,
242
- align: column.align || 'left',
243
- cellMode: cellParams.cellMode,
244
- colIndex: indexRelativeToAllColumns,
245
- isEditable: cellParams.isEditable,
246
- hasFocus: hasFocus,
247
- tabIndex: tabIndex,
248
- className: clsx(classNames)
249
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.cell, {
250
- children: content
251
- }), column.field));
248
+ const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, indexRelativeToAllColumns);
249
+
250
+ if (cellColSpanInfo && !cellColSpanInfo.spannedByColSpan) {
251
+ var _rootProps$components;
252
+
253
+ const {
254
+ colSpan,
255
+ width
256
+ } = cellColSpanInfo.cellProps;
257
+ cells.push( /*#__PURE__*/_jsx(rootProps.components.Cell, _extends({
258
+ value: cellParams.value,
259
+ field: column.field,
260
+ width: width,
261
+ rowId: rowId,
262
+ height: rowHeight,
263
+ showRightBorder: showRightBorder,
264
+ formattedValue: cellParams.formattedValue,
265
+ align: column.align || 'left',
266
+ cellMode: cellParams.cellMode,
267
+ colIndex: indexRelativeToAllColumns,
268
+ isEditable: cellParams.isEditable,
269
+ hasFocus: hasFocus,
270
+ tabIndex: tabIndex,
271
+ className: clsx(classNames),
272
+ colSpan: colSpan
273
+ }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.cell, {
274
+ children: content
275
+ }), column.field));
276
+ }
252
277
  }
253
278
 
254
279
  const emptyCellWidth = containerWidth - columnsTotalWidth;
@@ -261,9 +286,9 @@ function GridRow(props) {
261
286
  "aria-selected": selected,
262
287
  style: style,
263
288
  onClick: publishClick,
264
- onDoubleClick: publish(GridEvents.rowDoubleClick, onDoubleClick),
265
- onMouseEnter: publish(GridEvents.rowMouseEnter, onMouseEnter),
266
- onMouseLeave: publish(GridEvents.rowMouseLeave, onMouseLeave)
289
+ onDoubleClick: publish('rowDoubleClick', onDoubleClick),
290
+ onMouseEnter: publish('rowMouseEnter', onMouseEnter),
291
+ onMouseLeave: publish('rowMouseLeave', onMouseLeave)
267
292
  }, other, {
268
293
  children: [cells, emptyCellWidth > 0 && /*#__PURE__*/_jsx(EmptyCell, {
269
294
  width: emptyCellWidth,
@@ -282,6 +307,11 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
282
307
  containerWidth: PropTypes.number.isRequired,
283
308
  editRowsState: PropTypes.object.isRequired,
284
309
  firstColumnToRender: PropTypes.number.isRequired,
310
+
311
+ /**
312
+ * Index of the row in the whole sorted and filtered dataset.
313
+ * If some rows above have expanded children, this index also take those children into account.
314
+ */
285
315
  index: PropTypes.number.isRequired,
286
316
  isLastVisible: PropTypes.bool,
287
317
  lastColumnToRender: PropTypes.number.isRequired,
@@ -1,7 +1,10 @@
1
1
  import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
2
3
  interface RowCountProps {
3
4
  rowCount: number;
4
5
  visibleRowCount: number;
5
6
  }
6
- declare const GridRowCount: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & RowCountProps & React.RefAttributes<HTMLDivElement>>;
7
+ declare const GridRowCount: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & RowCountProps & {
8
+ sx?: SxProps<Theme> | undefined;
9
+ } & React.RefAttributes<HTMLDivElement>>;
7
10
  export { GridRowCount };
@@ -65,6 +65,7 @@ process.env.NODE_ENV !== "production" ? GridRowCount.propTypes = {
65
65
  // | To update them edit the TypeScript types and run "yarn proptypes" |
66
66
  // ----------------------------------------------------------------------
67
67
  rowCount: PropTypes.number.isRequired,
68
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
68
69
  visibleRowCount: PropTypes.number.isRequired
69
70
  } : void 0;
70
71
  export { GridRowCount };
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import clsx from 'clsx';
5
5
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
6
  import { styled } from '@mui/material/styles';
7
- import { GridEvents } from '../models/events';
8
7
  import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
9
8
  import { useGridApiContext } from '../hooks/utils/useGridApiContext';
10
9
  import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
@@ -100,9 +99,9 @@ function GridScrollAreaRaw(props) {
100
99
  const toggleDragging = React.useCallback(() => {
101
100
  setDragging(prevDragging => !prevDragging);
102
101
  }, []);
103
- useGridApiEventHandler(apiRef, GridEvents.rowsScroll, handleScrolling);
104
- useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragStart, toggleDragging);
105
- useGridApiEventHandler(apiRef, GridEvents.columnHeaderDragEnd, toggleDragging);
102
+ useGridApiEventHandler(apiRef, 'rowsScroll', handleScrolling);
103
+ useGridApiEventHandler(apiRef, 'columnHeaderDragStart', toggleDragging);
104
+ useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', toggleDragging);
106
105
  return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
107
106
  ref: rootRef,
108
107
  className: clsx(classes.root),
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
2
3
  interface SelectedRowCountProps {
3
4
  selectedRowCount: number;
4
5
  }
5
- declare const GridSelectedRowCount: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & SelectedRowCountProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const GridSelectedRowCount: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & SelectedRowCountProps & {
7
+ sx?: SxProps<Theme> | undefined;
8
+ } & React.RefAttributes<HTMLDivElement>>;
6
9
  export { GridSelectedRowCount };