@mui/x-data-grid 8.0.0-alpha.1 → 8.0.0-alpha.11

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 (801) hide show
  1. package/CHANGELOG.md +2007 -230
  2. package/DataGrid/DataGrid.js +20 -38
  3. package/DataGrid/useDataGridComponent.d.ts +2 -1
  4. package/DataGrid/useDataGridComponent.js +3 -3
  5. package/DataGrid/useDataGridProps.js +3 -3
  6. package/README.md +1 -1
  7. package/colDef/gridDateOperators.d.ts +2 -1
  8. package/colDef/gridNumericOperators.d.ts +4 -1
  9. package/components/GridApiContext.js +2 -0
  10. package/components/GridColumnHeaders.d.ts +1 -1
  11. package/components/GridColumnHeaders.js +4 -4
  12. package/components/GridConfigurationContext.js +2 -0
  13. package/components/GridFooter.d.ts +2 -1
  14. package/components/GridFooter.js +4 -4
  15. package/components/GridHeaders.js +2 -2
  16. package/components/GridLoadingOverlay.d.ts +1 -1
  17. package/components/GridLoadingOverlay.js +10 -8
  18. package/components/GridNoResultsOverlay.d.ts +2 -1
  19. package/components/GridNoResultsOverlay.js +4 -4
  20. package/components/GridNoRowsOverlay.d.ts +2 -1
  21. package/components/GridNoRowsOverlay.js +4 -4
  22. package/components/GridPagination.d.ts +1 -1
  23. package/components/GridPagination.js +7 -4
  24. package/components/GridRow.d.ts +6 -11
  25. package/components/GridRow.js +60 -88
  26. package/components/GridRowCount.d.ts +1 -1
  27. package/components/GridRowCount.js +3 -2
  28. package/components/GridScrollArea.d.ts +5 -2
  29. package/components/GridScrollArea.js +33 -24
  30. package/components/GridSelectedRowCount.d.ts +4 -1
  31. package/components/GridSelectedRowCount.js +3 -2
  32. package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
  33. package/components/GridSkeletonLoadingOverlay.js +23 -21
  34. package/components/base/GridOverlays.d.ts +4 -3
  35. package/components/base/GridOverlays.js +2 -24
  36. package/components/base/index.d.ts +0 -1
  37. package/components/base/index.js +1 -2
  38. package/components/cell/GridActionsCell.js +8 -1
  39. package/components/cell/GridActionsCellItem.d.ts +17 -10
  40. package/components/cell/GridActionsCellItem.js +9 -8
  41. package/components/cell/GridCell.d.ts +19 -23
  42. package/components/cell/GridCell.js +49 -92
  43. package/components/cell/GridEditDateCell.js +1 -1
  44. package/components/cell/GridEditInputCell.d.ts +1 -1
  45. package/components/cell/GridEditInputCell.js +73 -4
  46. package/components/cell/GridEditSingleSelectCell.js +2 -2
  47. package/components/cell/GridSkeletonCell.js +1 -2
  48. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  49. package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
  50. package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  51. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
  52. package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  53. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
  54. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -7
  55. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
  56. package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  57. package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  58. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
  59. package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  60. package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
  61. package/components/columnHeaders/GridIconButtonContainer.js +5 -3
  62. package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
  63. package/components/columnSelection/GridCellCheckboxRenderer.js +11 -9
  64. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  65. package/components/columnSelection/GridHeaderCheckbox.js +17 -9
  66. package/components/columnsManagement/GridColumnsManagement.d.ts +1 -1
  67. package/components/columnsManagement/GridColumnsManagement.js +50 -27
  68. package/components/containers/GridFooterContainer.d.ts +1 -1
  69. package/components/containers/GridFooterContainer.js +5 -3
  70. package/components/containers/GridOverlay.d.ts +1 -1
  71. package/components/containers/GridOverlay.js +5 -3
  72. package/components/containers/GridRoot.d.ts +2 -2
  73. package/components/containers/GridRoot.js +29 -17
  74. package/components/containers/GridRootStyles.js +163 -53
  75. package/components/containers/GridToolbarContainer.d.ts +1 -1
  76. package/components/containers/GridToolbarContainer.js +3 -2
  77. package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
  78. package/components/menu/columnMenu/GridColumnMenu.js +5 -5
  79. package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
  80. package/components/menu/columnMenu/GridColumnMenuContainer.js +8 -4
  81. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
  82. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
  83. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
  84. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  85. package/components/panel/GridColumnsPanel.js +1 -2
  86. package/components/panel/GridPanel.d.ts +2 -2
  87. package/components/panel/GridPanel.js +5 -3
  88. package/components/panel/GridPanelContent.js +7 -3
  89. package/components/panel/GridPanelFooter.d.ts +1 -1
  90. package/components/panel/GridPanelFooter.js +4 -3
  91. package/components/panel/GridPanelWrapper.d.ts +1 -1
  92. package/components/panel/GridPanelWrapper.js +5 -3
  93. package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
  94. package/components/panel/filterPanel/GridFilterForm.js +22 -18
  95. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +4 -11
  96. package/components/panel/filterPanel/GridFilterInputBoolean.js +41 -31
  97. package/components/panel/filterPanel/GridFilterInputDate.d.ts +3 -9
  98. package/components/panel/filterPanel/GridFilterInputDate.js +50 -31
  99. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -3
  100. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
  101. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -3
  102. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
  103. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +3 -9
  104. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
  105. package/components/panel/filterPanel/GridFilterInputValue.d.ts +3 -9
  106. package/components/panel/filterPanel/GridFilterInputValue.js +63 -38
  107. package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
  108. package/components/panel/filterPanel/GridFilterPanel.js +4 -4
  109. package/components/panel/filterPanel/index.d.ts +2 -2
  110. package/components/panel/filterPanel/index.js +1 -2
  111. package/components/toolbar/GridToolbar.d.ts +1 -1
  112. package/components/toolbar/GridToolbar.js +11 -5
  113. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  114. package/components/toolbar/GridToolbarColumnsButton.js +12 -6
  115. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  116. package/components/toolbar/GridToolbarDensitySelector.js +9 -11
  117. package/components/toolbar/GridToolbarExport.d.ts +1 -1
  118. package/components/toolbar/GridToolbarExport.js +2 -1
  119. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  120. package/components/toolbar/GridToolbarExportContainer.js +6 -6
  121. package/components/toolbar/GridToolbarFilterButton.d.ts +3 -1
  122. package/components/toolbar/GridToolbarFilterButton.js +20 -9
  123. package/components/toolbar/GridToolbarQuickFilter.d.ts +6 -2
  124. package/components/toolbar/GridToolbarQuickFilter.js +39 -31
  125. package/components/virtualization/GridMainContainer.d.ts +13 -1
  126. package/components/virtualization/GridMainContainer.js +14 -5
  127. package/components/virtualization/GridVirtualScrollbar.d.ts +5 -1
  128. package/components/virtualization/GridVirtualScrollbar.js +17 -17
  129. package/components/virtualization/GridVirtualScroller.js +43 -21
  130. package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
  131. package/components/virtualization/GridVirtualScrollerContent.js +15 -6
  132. package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
  133. package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  134. package/constants/dataGridPropsDefaultValues.js +2 -4
  135. package/constants/gridClasses.d.ts +12 -12
  136. package/constants/gridClasses.js +1 -1
  137. package/constants/index.d.ts +1 -0
  138. package/constants/index.js +2 -1
  139. package/constants/localeTextConstants.js +1 -1
  140. package/constants/signature.d.ts +9 -0
  141. package/constants/signature.js +10 -0
  142. package/context/GridContextProvider.d.ts +2 -1
  143. package/context/GridRootPropsContext.js +2 -0
  144. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
  145. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
  146. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
  147. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  148. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
  149. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +7 -5
  150. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
  151. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
  152. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
  153. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +5 -8
  154. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  155. package/hooks/core/useGridApiInitialization.d.ts +2 -2
  156. package/hooks/core/useGridApiInitialization.js +3 -3
  157. package/hooks/core/useGridInitialization.d.ts +2 -2
  158. package/hooks/core/useGridIsRtl.d.ts +2 -2
  159. package/hooks/core/useGridLocaleText.d.ts +2 -2
  160. package/hooks/core/useGridLoggerFactory.d.ts +2 -2
  161. package/hooks/core/useGridRefs.d.ts +2 -2
  162. package/hooks/core/useGridStateInitialization.d.ts +2 -2
  163. package/hooks/core/useGridStateInitialization.js +6 -5
  164. package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
  165. package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
  166. package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
  167. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
  168. package/hooks/features/columnHeaders/useGridColumnHeaders.js +39 -78
  169. package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
  170. package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  171. package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
  172. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
  173. package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  174. package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
  175. package/hooks/features/columnResize/useGridColumnResize.js +17 -10
  176. package/hooks/features/columns/gridColumnsSelector.d.ts +11 -16
  177. package/hooks/features/columns/gridColumnsSelector.js +0 -12
  178. package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
  179. package/hooks/features/columns/gridColumnsUtils.js +2 -1
  180. package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
  181. package/hooks/features/columns/useGridColumns.d.ts +2 -2
  182. package/hooks/features/columns/useGridColumns.js +9 -4
  183. package/hooks/features/density/densitySelector.d.ts +1 -1
  184. package/hooks/features/density/useGridDensity.d.ts +2 -2
  185. package/hooks/features/dimensions/gridDimensionsApi.d.ts +0 -4
  186. package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +16 -0
  187. package/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
  188. package/hooks/features/dimensions/index.d.ts +1 -1
  189. package/hooks/features/dimensions/index.js +1 -2
  190. package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
  191. package/hooks/features/dimensions/useGridDimensions.js +104 -98
  192. package/hooks/features/editing/gridEditingSelectors.d.ts +10 -0
  193. package/hooks/features/editing/gridEditingSelectors.js +12 -1
  194. package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
  195. package/hooks/features/editing/useGridCellEditing.js +4 -4
  196. package/hooks/features/editing/useGridEditing.d.ts +2 -2
  197. package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
  198. package/hooks/features/editing/useGridRowEditing.js +10 -11
  199. package/hooks/features/events/useGridEvents.d.ts +2 -2
  200. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
  201. package/hooks/features/export/useGridCsvExport.d.ts +2 -2
  202. package/hooks/features/export/useGridPrintExport.d.ts +2 -2
  203. package/hooks/features/export/useGridPrintExport.js +1 -1
  204. package/hooks/features/export/utils.d.ts +2 -2
  205. package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
  206. package/hooks/features/filter/gridFilterSelector.js +8 -2
  207. package/hooks/features/filter/gridFilterState.d.ts +8 -3
  208. package/hooks/features/filter/gridFilterState.js +5 -0
  209. package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
  210. package/hooks/features/filter/gridFilterUtils.js +3 -3
  211. package/hooks/features/filter/useGridFilter.d.ts +2 -2
  212. package/hooks/features/filter/useGridFilter.js +10 -15
  213. package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
  214. package/hooks/features/focus/useGridFocus.d.ts +2 -2
  215. package/hooks/features/focus/useGridFocus.js +3 -2
  216. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
  217. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
  218. package/hooks/features/index.d.ts +1 -0
  219. package/hooks/features/index.js +1 -0
  220. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
  221. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
  222. package/hooks/features/keyboardNavigation/utils.d.ts +3 -4
  223. package/hooks/features/keyboardNavigation/utils.js +0 -5
  224. package/hooks/features/listView/gridListViewSelectors.d.ts +3 -1
  225. package/hooks/features/listView/gridListViewSelectors.js +3 -1
  226. package/hooks/features/listView/index.d.ts +1 -0
  227. package/hooks/features/listView/index.js +1 -0
  228. package/hooks/features/listView/useGridListView.d.ts +2 -2
  229. package/hooks/features/listView/useGridListView.js +2 -1
  230. package/hooks/features/overlays/useGridOverlays.d.ts +7 -4
  231. package/hooks/features/overlays/useGridOverlays.js +23 -3
  232. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
  233. package/hooks/features/pagination/gridPaginationSelector.d.ts +34 -9
  234. package/hooks/features/pagination/gridPaginationSelector.js +39 -1
  235. package/hooks/features/pagination/gridPaginationUtils.js +1 -1
  236. package/hooks/features/pagination/useGridPagination.d.ts +3 -3
  237. package/hooks/features/pagination/useGridPagination.js +6 -4
  238. package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
  239. package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
  240. package/hooks/features/pagination/useGridPaginationModel.js +23 -1
  241. package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
  242. package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
  243. package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
  244. package/hooks/features/preferencesPanel/index.d.ts +1 -1
  245. package/hooks/features/preferencesPanel/index.js +1 -1
  246. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
  247. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  248. package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  249. package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
  250. package/hooks/features/rowSelection/useGridRowSelection.js +11 -18
  251. package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
  252. package/hooks/features/rowSelection/utils.d.ts +4 -3
  253. package/hooks/features/rowSelection/utils.js +4 -4
  254. package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
  255. package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
  256. package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
  257. package/hooks/features/rows/gridRowsMetaState.d.ts +8 -0
  258. package/hooks/features/rows/gridRowsSelector.d.ts +23 -13
  259. package/hooks/features/rows/gridRowsSelector.js +1 -2
  260. package/hooks/features/rows/gridRowsUtils.d.ts +3 -7
  261. package/hooks/features/rows/gridRowsUtils.js +0 -25
  262. package/hooks/features/rows/index.d.ts +1 -1
  263. package/hooks/features/rows/index.js +1 -1
  264. package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
  265. package/hooks/features/rows/useGridParamsApi.js +33 -14
  266. package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
  267. package/hooks/features/rows/useGridRowSpanning.js +97 -86
  268. package/hooks/features/rows/useGridRows.d.ts +2 -2
  269. package/hooks/features/rows/useGridRows.js +27 -29
  270. package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
  271. package/hooks/features/rows/useGridRowsMeta.js +36 -19
  272. package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
  273. package/hooks/features/scroll/useGridScroll.d.ts +2 -2
  274. package/hooks/features/sorting/gridSortingSelector.d.ts +10 -5
  275. package/hooks/features/sorting/gridSortingSelector.js +21 -9
  276. package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
  277. package/hooks/features/sorting/gridSortingUtils.js +2 -2
  278. package/hooks/features/sorting/index.d.ts +2 -1
  279. package/hooks/features/sorting/index.js +1 -1
  280. package/hooks/features/sorting/useGridSorting.d.ts +2 -2
  281. package/hooks/features/sorting/useGridSorting.js +1 -1
  282. package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
  283. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
  284. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +33 -0
  285. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
  286. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +21 -6
  287. package/hooks/features/virtualization/useGridVirtualScroller.js +209 -118
  288. package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
  289. package/hooks/utils/index.d.ts +1 -1
  290. package/hooks/utils/index.js +1 -1
  291. package/hooks/utils/useGridApiContext.d.ts +2 -2
  292. package/hooks/utils/useGridApiEventHandler.d.ts +9 -19
  293. package/hooks/utils/useGridApiEventHandler.js +68 -75
  294. package/hooks/utils/useGridApiMethod.d.ts +2 -2
  295. package/hooks/utils/useGridApiRef.d.ts +2 -2
  296. package/hooks/utils/useGridApiRef.js +1 -1
  297. package/hooks/utils/useGridInitializeState.d.ts +3 -3
  298. package/hooks/utils/useGridLogger.d.ts +2 -2
  299. package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
  300. package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
  301. package/hooks/utils/useGridSelector.d.ts +5 -7
  302. package/hooks/utils/useGridSelector.js +29 -49
  303. package/hooks/utils/useGridVisibleRows.d.ts +8 -6
  304. package/hooks/utils/useGridVisibleRows.js +5 -28
  305. package/hooks/utils/useIsSSR.d.ts +1 -0
  306. package/hooks/utils/useIsSSR.js +5 -0
  307. package/index.js +1 -1
  308. package/internals/constants.d.ts +6 -0
  309. package/internals/constants.js +8 -1
  310. package/internals/index.d.ts +9 -5
  311. package/internals/index.js +7 -4
  312. package/internals/utils/attachPinnedStyle.d.ts +2 -0
  313. package/internals/utils/attachPinnedStyle.js +9 -0
  314. package/internals/utils/getPinnedCellOffset.d.ts +3 -3
  315. package/internals/utils/getPinnedCellOffset.js +6 -7
  316. package/internals/utils/index.d.ts +1 -1
  317. package/internals/utils/index.js +2 -2
  318. package/internals/utils/propValidation.js +1 -1
  319. package/locales/arSD.js +2 -1
  320. package/locales/beBY.js +1 -1
  321. package/locales/bgBG.js +2 -1
  322. package/locales/csCZ.js +2 -1
  323. package/locales/daDK.js +2 -1
  324. package/locales/deDE.js +12 -13
  325. package/locales/elGR.js +2 -1
  326. package/locales/esES.js +12 -13
  327. package/locales/faIR.js +7 -7
  328. package/locales/fiFI.js +2 -1
  329. package/locales/frFR.js +2 -1
  330. package/locales/heIL.js +16 -17
  331. package/locales/hrHR.js +2 -1
  332. package/locales/huHU.js +2 -1
  333. package/locales/isIS.js +2 -1
  334. package/locales/itIT.js +2 -1
  335. package/locales/jaJP.js +2 -1
  336. package/locales/koKR.js +46 -49
  337. package/locales/nbNO.js +2 -1
  338. package/locales/nlNL.js +7 -7
  339. package/locales/nnNO.js +2 -1
  340. package/locales/plPL.js +2 -1
  341. package/locales/ptBR.js +12 -13
  342. package/locales/ptPT.js +12 -13
  343. package/locales/roRO.js +20 -21
  344. package/locales/ruRU.js +2 -1
  345. package/locales/skSK.js +2 -1
  346. package/locales/svSE.js +2 -1
  347. package/locales/trTR.js +14 -15
  348. package/locales/ukUA.js +2 -1
  349. package/locales/urPK.js +11 -11
  350. package/locales/viVN.js +2 -1
  351. package/locales/zhCN.js +12 -13
  352. package/locales/zhHK.js +2 -1
  353. package/locales/zhTW.js +2 -1
  354. package/material/index.js +58 -7
  355. package/models/api/gridApiCommon.d.ts +2 -2
  356. package/models/api/gridCoreApi.d.ts +7 -7
  357. package/models/api/gridDensityApi.d.ts +1 -1
  358. package/models/api/gridLocaleTextApi.d.ts +1 -1
  359. package/models/api/gridParamsApi.d.ts +29 -2
  360. package/models/api/gridStateApi.d.ts +2 -1
  361. package/models/api/index.d.ts +1 -1
  362. package/models/api/index.js +0 -1
  363. package/models/colDef/gridColDef.d.ts +34 -33
  364. package/models/controlStateItem.d.ts +2 -2
  365. package/models/events/gridEventLookup.d.ts +13 -1
  366. package/models/gridBaseSlots.d.ts +95 -0
  367. package/models/gridDataSource.d.ts +1 -1
  368. package/models/gridExport.d.ts +2 -2
  369. package/models/gridFilterInputComponent.d.ts +32 -0
  370. package/models/gridFilterOperator.d.ts +6 -4
  371. package/models/gridIconSlotsComponent.d.ts +5 -0
  372. package/models/gridSlotsComponent.d.ts +16 -1
  373. package/models/gridSlotsComponentsProps.d.ts +45 -9
  374. package/models/gridStateCommunity.d.ts +4 -0
  375. package/models/index.d.ts +1 -0
  376. package/models/props/DataGridProps.d.ts +12 -24
  377. package/modern/DataGrid/DataGrid.js +20 -38
  378. package/modern/DataGrid/useDataGridComponent.js +3 -3
  379. package/modern/DataGrid/useDataGridProps.js +3 -3
  380. package/modern/components/GridApiContext.js +2 -0
  381. package/modern/components/GridColumnHeaders.js +4 -4
  382. package/modern/components/GridConfigurationContext.js +2 -0
  383. package/modern/components/GridFooter.js +4 -4
  384. package/modern/components/GridHeaders.js +2 -2
  385. package/modern/components/GridLoadingOverlay.js +10 -8
  386. package/modern/components/GridNoResultsOverlay.js +4 -4
  387. package/modern/components/GridNoRowsOverlay.js +4 -4
  388. package/modern/components/GridPagination.js +7 -4
  389. package/modern/components/GridRow.js +60 -88
  390. package/modern/components/GridRowCount.js +3 -2
  391. package/modern/components/GridScrollArea.js +33 -24
  392. package/modern/components/GridSelectedRowCount.js +3 -2
  393. package/modern/components/GridSkeletonLoadingOverlay.js +23 -21
  394. package/modern/components/base/GridOverlays.js +2 -24
  395. package/modern/components/base/index.js +1 -2
  396. package/modern/components/cell/GridActionsCell.js +8 -1
  397. package/modern/components/cell/GridActionsCellItem.js +9 -8
  398. package/modern/components/cell/GridCell.js +49 -92
  399. package/modern/components/cell/GridEditDateCell.js +1 -1
  400. package/modern/components/cell/GridEditInputCell.js +73 -4
  401. package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
  402. package/modern/components/cell/GridSkeletonCell.js +1 -2
  403. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  404. package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  405. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -7
  406. package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  407. package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  408. package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  409. package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
  410. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +11 -9
  411. package/modern/components/columnSelection/GridHeaderCheckbox.js +17 -9
  412. package/modern/components/columnsManagement/GridColumnsManagement.js +50 -27
  413. package/modern/components/containers/GridFooterContainer.js +5 -3
  414. package/modern/components/containers/GridOverlay.js +5 -3
  415. package/modern/components/containers/GridRoot.js +29 -17
  416. package/modern/components/containers/GridRootStyles.js +163 -53
  417. package/modern/components/containers/GridToolbarContainer.js +3 -2
  418. package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
  419. package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +8 -4
  420. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
  421. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
  422. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
  423. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  424. package/modern/components/panel/GridColumnsPanel.js +1 -2
  425. package/modern/components/panel/GridPanel.js +5 -3
  426. package/modern/components/panel/GridPanelContent.js +7 -3
  427. package/modern/components/panel/GridPanelFooter.js +4 -3
  428. package/modern/components/panel/GridPanelWrapper.js +5 -3
  429. package/modern/components/panel/filterPanel/GridFilterForm.js +22 -18
  430. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +41 -31
  431. package/modern/components/panel/filterPanel/GridFilterInputDate.js +50 -31
  432. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
  433. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
  434. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
  435. package/modern/components/panel/filterPanel/GridFilterInputValue.js +63 -38
  436. package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
  437. package/modern/components/panel/filterPanel/index.js +1 -2
  438. package/modern/components/toolbar/GridToolbar.js +11 -5
  439. package/modern/components/toolbar/GridToolbarColumnsButton.js +12 -6
  440. package/modern/components/toolbar/GridToolbarDensitySelector.js +9 -11
  441. package/modern/components/toolbar/GridToolbarExport.js +2 -1
  442. package/modern/components/toolbar/GridToolbarExportContainer.js +6 -6
  443. package/modern/components/toolbar/GridToolbarFilterButton.js +20 -9
  444. package/modern/components/toolbar/GridToolbarQuickFilter.js +39 -31
  445. package/modern/components/virtualization/GridMainContainer.js +14 -5
  446. package/modern/components/virtualization/GridVirtualScrollbar.js +17 -17
  447. package/modern/components/virtualization/GridVirtualScroller.js +43 -21
  448. package/modern/components/virtualization/GridVirtualScrollerContent.js +15 -6
  449. package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  450. package/modern/constants/dataGridPropsDefaultValues.js +2 -4
  451. package/modern/constants/gridClasses.js +1 -1
  452. package/modern/constants/index.js +2 -1
  453. package/modern/constants/localeTextConstants.js +1 -1
  454. package/modern/constants/signature.js +10 -0
  455. package/modern/context/GridRootPropsContext.js +2 -0
  456. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  457. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +7 -5
  458. package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
  459. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  460. package/modern/hooks/core/useGridApiInitialization.js +3 -3
  461. package/modern/hooks/core/useGridStateInitialization.js +6 -5
  462. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +39 -78
  463. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  464. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  465. package/modern/hooks/features/columnResize/useGridColumnResize.js +17 -10
  466. package/modern/hooks/features/columns/gridColumnsSelector.js +0 -12
  467. package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
  468. package/modern/hooks/features/columns/useGridColumns.js +9 -4
  469. package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +26 -1
  470. package/modern/hooks/features/dimensions/index.js +1 -2
  471. package/modern/hooks/features/dimensions/useGridDimensions.js +104 -98
  472. package/modern/hooks/features/editing/gridEditingSelectors.js +12 -1
  473. package/modern/hooks/features/editing/useGridCellEditing.js +4 -4
  474. package/modern/hooks/features/editing/useGridRowEditing.js +10 -11
  475. package/modern/hooks/features/export/useGridPrintExport.js +1 -1
  476. package/modern/hooks/features/filter/gridFilterSelector.js +8 -2
  477. package/modern/hooks/features/filter/gridFilterState.js +5 -0
  478. package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
  479. package/modern/hooks/features/filter/useGridFilter.js +10 -15
  480. package/modern/hooks/features/focus/useGridFocus.js +3 -2
  481. package/modern/hooks/features/index.js +1 -0
  482. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
  483. package/modern/hooks/features/keyboardNavigation/utils.js +0 -5
  484. package/modern/hooks/features/listView/gridListViewSelectors.js +3 -1
  485. package/modern/hooks/features/listView/index.js +1 -0
  486. package/modern/hooks/features/listView/useGridListView.js +2 -1
  487. package/modern/hooks/features/overlays/useGridOverlays.js +23 -3
  488. package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
  489. package/modern/hooks/features/pagination/gridPaginationUtils.js +1 -1
  490. package/modern/hooks/features/pagination/useGridPagination.js +6 -4
  491. package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
  492. package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
  493. package/modern/hooks/features/preferencesPanel/index.js +1 -1
  494. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  495. package/modern/hooks/features/rowSelection/useGridRowSelection.js +11 -18
  496. package/modern/hooks/features/rowSelection/utils.js +4 -4
  497. package/modern/hooks/features/rows/gridRowsSelector.js +1 -2
  498. package/modern/hooks/features/rows/gridRowsUtils.js +0 -25
  499. package/modern/hooks/features/rows/index.js +1 -1
  500. package/modern/hooks/features/rows/useGridParamsApi.js +33 -14
  501. package/modern/hooks/features/rows/useGridRowSpanning.js +97 -86
  502. package/modern/hooks/features/rows/useGridRows.js +27 -29
  503. package/modern/hooks/features/rows/useGridRowsMeta.js +36 -19
  504. package/modern/hooks/features/sorting/gridSortingSelector.js +21 -9
  505. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
  506. package/modern/hooks/features/sorting/index.js +1 -1
  507. package/modern/hooks/features/sorting/useGridSorting.js +1 -1
  508. package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +33 -0
  509. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +209 -118
  510. package/modern/hooks/utils/index.js +1 -1
  511. package/modern/hooks/utils/useGridApiEventHandler.js +68 -75
  512. package/modern/hooks/utils/useGridApiRef.js +1 -1
  513. package/modern/hooks/utils/useGridSelector.js +29 -49
  514. package/modern/hooks/utils/useGridVisibleRows.js +5 -28
  515. package/modern/hooks/utils/useIsSSR.js +5 -0
  516. package/modern/index.js +1 -1
  517. package/modern/internals/constants.js +8 -1
  518. package/modern/internals/index.js +7 -4
  519. package/modern/internals/utils/attachPinnedStyle.js +9 -0
  520. package/modern/internals/utils/getPinnedCellOffset.js +6 -7
  521. package/modern/internals/utils/index.js +2 -2
  522. package/modern/internals/utils/propValidation.js +1 -1
  523. package/modern/locales/arSD.js +2 -1
  524. package/modern/locales/beBY.js +1 -1
  525. package/modern/locales/bgBG.js +2 -1
  526. package/modern/locales/csCZ.js +2 -1
  527. package/modern/locales/daDK.js +2 -1
  528. package/modern/locales/deDE.js +12 -13
  529. package/modern/locales/elGR.js +2 -1
  530. package/modern/locales/esES.js +12 -13
  531. package/modern/locales/faIR.js +7 -7
  532. package/modern/locales/fiFI.js +2 -1
  533. package/modern/locales/frFR.js +2 -1
  534. package/modern/locales/heIL.js +16 -17
  535. package/modern/locales/hrHR.js +2 -1
  536. package/modern/locales/huHU.js +2 -1
  537. package/modern/locales/isIS.js +2 -1
  538. package/modern/locales/itIT.js +2 -1
  539. package/modern/locales/jaJP.js +2 -1
  540. package/modern/locales/koKR.js +46 -49
  541. package/modern/locales/nbNO.js +2 -1
  542. package/modern/locales/nlNL.js +7 -7
  543. package/modern/locales/nnNO.js +2 -1
  544. package/modern/locales/plPL.js +2 -1
  545. package/modern/locales/ptBR.js +12 -13
  546. package/modern/locales/ptPT.js +12 -13
  547. package/modern/locales/roRO.js +20 -21
  548. package/modern/locales/ruRU.js +2 -1
  549. package/modern/locales/skSK.js +2 -1
  550. package/modern/locales/svSE.js +2 -1
  551. package/modern/locales/trTR.js +14 -15
  552. package/modern/locales/ukUA.js +2 -1
  553. package/modern/locales/urPK.js +11 -11
  554. package/modern/locales/viVN.js +2 -1
  555. package/modern/locales/zhCN.js +12 -13
  556. package/modern/locales/zhHK.js +2 -1
  557. package/modern/locales/zhTW.js +2 -1
  558. package/modern/material/index.js +58 -7
  559. package/modern/models/api/index.js +0 -1
  560. package/modern/models/gridBaseSlots.js +1 -0
  561. package/modern/models/gridFilterInputComponent.js +1 -0
  562. package/modern/utils/assert.js +3 -0
  563. package/modern/utils/cellBorderUtils.js +5 -5
  564. package/modern/utils/createSelector.js +1 -120
  565. package/modern/utils/domUtils.js +7 -2
  566. package/modern/utils/isJSDOM.js +1 -0
  567. package/modern/utils/roundToDecimalPlaces.js +3 -0
  568. package/modern/utils/rtlFlipSide.js +22 -0
  569. package/modern/utils/utils.js +6 -1
  570. package/node/DataGrid/DataGrid.js +18 -36
  571. package/node/DataGrid/useDataGridComponent.js +3 -3
  572. package/node/DataGrid/useDataGridProps.js +2 -2
  573. package/node/components/GridApiContext.js +1 -0
  574. package/node/components/GridColumnHeaders.js +4 -4
  575. package/node/components/GridConfigurationContext.js +1 -0
  576. package/node/components/GridFooter.js +4 -4
  577. package/node/components/GridHeaders.js +2 -2
  578. package/node/components/GridLoadingOverlay.js +10 -8
  579. package/node/components/GridNoResultsOverlay.js +4 -4
  580. package/node/components/GridNoRowsOverlay.js +4 -4
  581. package/node/components/GridPagination.js +7 -4
  582. package/node/components/GridRow.js +56 -85
  583. package/node/components/GridRowCount.js +3 -2
  584. package/node/components/GridScrollArea.js +32 -24
  585. package/node/components/GridSelectedRowCount.js +3 -2
  586. package/node/components/GridSkeletonLoadingOverlay.js +23 -21
  587. package/node/components/base/GridOverlays.js +2 -24
  588. package/node/components/base/index.js +0 -11
  589. package/node/components/cell/GridActionsCell.js +8 -1
  590. package/node/components/cell/GridActionsCellItem.js +7 -8
  591. package/node/components/cell/GridCell.js +48 -91
  592. package/node/components/cell/GridEditDateCell.js +1 -1
  593. package/node/components/cell/GridEditInputCell.js +73 -4
  594. package/node/components/cell/GridEditSingleSelectCell.js +2 -2
  595. package/node/components/cell/GridSkeletonCell.js +1 -2
  596. package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
  597. package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  598. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +19 -6
  599. package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  600. package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
  601. package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
  602. package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
  603. package/node/components/columnSelection/GridCellCheckboxRenderer.js +10 -8
  604. package/node/components/columnSelection/GridHeaderCheckbox.js +17 -9
  605. package/node/components/columnsManagement/GridColumnsManagement.js +50 -27
  606. package/node/components/containers/GridFooterContainer.js +5 -3
  607. package/node/components/containers/GridOverlay.js +5 -3
  608. package/node/components/containers/GridRoot.js +27 -15
  609. package/node/components/containers/GridRootStyles.js +163 -53
  610. package/node/components/containers/GridToolbarContainer.js +3 -2
  611. package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
  612. package/node/components/menu/columnMenu/GridColumnMenuContainer.js +8 -4
  613. package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
  614. package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
  615. package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
  616. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  617. package/node/components/panel/GridColumnsPanel.js +1 -2
  618. package/node/components/panel/GridPanel.js +5 -3
  619. package/node/components/panel/GridPanelContent.js +7 -3
  620. package/node/components/panel/GridPanelFooter.js +5 -4
  621. package/node/components/panel/GridPanelWrapper.js +5 -3
  622. package/node/components/panel/filterPanel/GridFilterForm.js +22 -18
  623. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +42 -33
  624. package/node/components/panel/filterPanel/GridFilterInputDate.js +49 -30
  625. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +49 -24
  626. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +55 -33
  627. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +34 -25
  628. package/node/components/panel/filterPanel/GridFilterInputValue.js +62 -37
  629. package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
  630. package/node/components/panel/filterPanel/index.js +7 -23
  631. package/node/components/toolbar/GridToolbar.js +11 -5
  632. package/node/components/toolbar/GridToolbarColumnsButton.js +12 -6
  633. package/node/components/toolbar/GridToolbarDensitySelector.js +9 -11
  634. package/node/components/toolbar/GridToolbarExport.js +2 -1
  635. package/node/components/toolbar/GridToolbarExportContainer.js +6 -6
  636. package/node/components/toolbar/GridToolbarFilterButton.js +20 -9
  637. package/node/components/toolbar/GridToolbarQuickFilter.js +39 -31
  638. package/node/components/virtualization/GridMainContainer.js +14 -5
  639. package/node/components/virtualization/GridVirtualScrollbar.js +17 -17
  640. package/node/components/virtualization/GridVirtualScroller.js +43 -21
  641. package/node/components/virtualization/GridVirtualScrollerContent.js +15 -6
  642. package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
  643. package/node/constants/dataGridPropsDefaultValues.js +2 -4
  644. package/node/constants/gridClasses.js +1 -1
  645. package/node/constants/index.js +11 -0
  646. package/node/constants/localeTextConstants.js +1 -1
  647. package/node/constants/signature.js +16 -0
  648. package/node/context/GridRootPropsContext.js +1 -0
  649. package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  650. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +7 -5
  651. package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
  652. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
  653. package/node/hooks/core/useGridApiInitialization.js +4 -4
  654. package/node/hooks/core/useGridStateInitialization.js +6 -5
  655. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +37 -76
  656. package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  657. package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  658. package/node/hooks/features/columnResize/useGridColumnResize.js +17 -10
  659. package/node/hooks/features/columns/gridColumnsSelector.js +1 -13
  660. package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
  661. package/node/hooks/features/columns/useGridColumns.js +9 -4
  662. package/node/hooks/features/dimensions/gridDimensionsSelectors.js +38 -2
  663. package/node/hooks/features/dimensions/index.js +13 -11
  664. package/node/hooks/features/dimensions/useGridDimensions.js +102 -96
  665. package/node/hooks/features/editing/gridEditingSelectors.js +12 -2
  666. package/node/hooks/features/editing/useGridCellEditing.js +3 -3
  667. package/node/hooks/features/editing/useGridRowEditing.js +8 -9
  668. package/node/hooks/features/export/useGridPrintExport.js +1 -1
  669. package/node/hooks/features/filter/gridFilterSelector.js +8 -2
  670. package/node/hooks/features/filter/gridFilterState.js +6 -1
  671. package/node/hooks/features/filter/gridFilterUtils.js +3 -3
  672. package/node/hooks/features/filter/useGridFilter.js +9 -14
  673. package/node/hooks/features/focus/useGridFocus.js +3 -2
  674. package/node/hooks/features/index.js +11 -0
  675. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -15
  676. package/node/hooks/features/keyboardNavigation/utils.js +0 -6
  677. package/node/hooks/features/listView/gridListViewSelectors.js +3 -1
  678. package/node/hooks/features/listView/index.js +16 -0
  679. package/node/hooks/features/listView/useGridListView.js +2 -1
  680. package/node/hooks/features/overlays/useGridOverlays.js +25 -3
  681. package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
  682. package/node/hooks/features/pagination/gridPaginationUtils.js +2 -2
  683. package/node/hooks/features/pagination/useGridPagination.js +6 -4
  684. package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
  685. package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
  686. package/node/hooks/features/preferencesPanel/index.js +11 -10
  687. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  688. package/node/hooks/features/rowSelection/useGridRowSelection.js +12 -19
  689. package/node/hooks/features/rowSelection/utils.js +5 -5
  690. package/node/hooks/features/rows/gridRowsSelector.js +2 -3
  691. package/node/hooks/features/rows/gridRowsUtils.js +0 -26
  692. package/node/hooks/features/rows/index.js +0 -7
  693. package/node/hooks/features/rows/useGridParamsApi.js +33 -14
  694. package/node/hooks/features/rows/useGridRowSpanning.js +95 -84
  695. package/node/hooks/features/rows/useGridRows.js +27 -29
  696. package/node/hooks/features/rows/useGridRowsMeta.js +36 -19
  697. package/node/hooks/features/sorting/gridSortingSelector.js +22 -10
  698. package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
  699. package/node/hooks/features/sorting/index.js +24 -16
  700. package/node/hooks/features/sorting/useGridSorting.js +1 -1
  701. package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +40 -0
  702. package/node/hooks/features/virtualization/useGridVirtualScroller.js +210 -119
  703. package/node/hooks/utils/index.js +21 -11
  704. package/node/hooks/utils/useGridApiEventHandler.js +71 -78
  705. package/node/hooks/utils/useGridApiRef.js +1 -1
  706. package/node/hooks/utils/useGridSelector.js +31 -52
  707. package/node/hooks/utils/useGridVisibleRows.js +3 -28
  708. package/node/hooks/utils/useIsSSR.js +12 -0
  709. package/node/index.js +1 -1
  710. package/node/internals/constants.js +9 -2
  711. package/node/internals/index.js +57 -27
  712. package/node/internals/utils/attachPinnedStyle.js +15 -0
  713. package/node/internals/utils/getPinnedCellOffset.js +6 -7
  714. package/node/internals/utils/index.js +11 -11
  715. package/node/internals/utils/propValidation.js +2 -2
  716. package/node/locales/arSD.js +2 -1
  717. package/node/locales/beBY.js +1 -1
  718. package/node/locales/bgBG.js +2 -1
  719. package/node/locales/csCZ.js +2 -1
  720. package/node/locales/daDK.js +2 -1
  721. package/node/locales/deDE.js +12 -13
  722. package/node/locales/elGR.js +2 -1
  723. package/node/locales/esES.js +12 -13
  724. package/node/locales/faIR.js +7 -7
  725. package/node/locales/fiFI.js +2 -1
  726. package/node/locales/frFR.js +2 -1
  727. package/node/locales/heIL.js +16 -17
  728. package/node/locales/hrHR.js +2 -1
  729. package/node/locales/huHU.js +2 -1
  730. package/node/locales/isIS.js +2 -1
  731. package/node/locales/itIT.js +2 -1
  732. package/node/locales/jaJP.js +2 -1
  733. package/node/locales/koKR.js +46 -49
  734. package/node/locales/nbNO.js +2 -1
  735. package/node/locales/nlNL.js +7 -7
  736. package/node/locales/nnNO.js +2 -1
  737. package/node/locales/plPL.js +2 -1
  738. package/node/locales/ptBR.js +12 -13
  739. package/node/locales/ptPT.js +12 -13
  740. package/node/locales/roRO.js +20 -21
  741. package/node/locales/ruRU.js +2 -1
  742. package/node/locales/skSK.js +2 -1
  743. package/node/locales/svSE.js +2 -1
  744. package/node/locales/trTR.js +14 -15
  745. package/node/locales/ukUA.js +2 -1
  746. package/node/locales/urPK.js +11 -11
  747. package/node/locales/viVN.js +2 -1
  748. package/node/locales/zhCN.js +12 -13
  749. package/node/locales/zhHK.js +2 -1
  750. package/node/locales/zhTW.js +2 -1
  751. package/node/material/index.js +59 -7
  752. package/node/models/api/index.js +0 -11
  753. package/node/models/gridFilterInputComponent.js +5 -0
  754. package/node/utils/assert.js +9 -0
  755. package/node/utils/cellBorderUtils.js +5 -5
  756. package/node/utils/createSelector.js +4 -125
  757. package/node/utils/domUtils.js +7 -2
  758. package/node/utils/isJSDOM.js +7 -0
  759. package/node/utils/roundToDecimalPlaces.js +9 -0
  760. package/node/utils/rtlFlipSide.js +29 -0
  761. package/node/utils/utils.js +8 -1
  762. package/package.json +4 -3
  763. package/themeAugmentation/overrides.d.ts +10 -5
  764. package/utils/assert.d.ts +2 -0
  765. package/utils/assert.js +3 -0
  766. package/utils/cellBorderUtils.d.ts +3 -3
  767. package/utils/cellBorderUtils.js +5 -5
  768. package/utils/createSelector.d.ts +7 -19
  769. package/utils/createSelector.js +1 -120
  770. package/utils/domUtils.js +7 -2
  771. package/utils/getPublicApiRef.d.ts +2 -1
  772. package/utils/isJSDOM.d.ts +1 -0
  773. package/utils/isJSDOM.js +1 -0
  774. package/utils/keyboardUtils.d.ts +1 -1
  775. package/utils/roundToDecimalPlaces.d.ts +1 -0
  776. package/utils/roundToDecimalPlaces.js +3 -0
  777. package/utils/rtlFlipSide.d.ts +2 -0
  778. package/utils/rtlFlipSide.js +22 -0
  779. package/utils/utils.d.ts +1 -0
  780. package/utils/utils.js +6 -1
  781. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +0 -11
  782. package/internals/utils/useProps.d.ts +0 -1
  783. package/internals/utils/useProps.js +0 -24
  784. package/joy/icons.d.ts +0 -32
  785. package/joy/icons.js +0 -431
  786. package/joy/index.d.ts +0 -2
  787. package/joy/index.js +0 -2
  788. package/joy/joySlots.d.ts +0 -3
  789. package/joy/joySlots.js +0 -389
  790. package/joy/package.json +0 -6
  791. package/modern/internals/utils/useProps.js +0 -24
  792. package/modern/joy/icons.js +0 -431
  793. package/modern/joy/index.js +0 -2
  794. package/modern/joy/joySlots.js +0 -389
  795. package/node/internals/utils/useProps.js +0 -30
  796. package/node/joy/icons.js +0 -439
  797. package/node/joy/index.js +0 -13
  798. package/node/joy/joySlots.js +0 -397
  799. /package/{components/panel/filterPanel/GridFilterInputValueProps.js → models/gridBaseSlots.js} +0 -0
  800. /package/{modern/components/panel/filterPanel/GridFilterInputValueProps.js → models/gridFilterInputComponent.js} +0 -0
  801. /package/node/{components/panel/filterPanel/GridFilterInputValueProps.js → models/gridBaseSlots.js} +0 -0
@@ -13,9 +13,12 @@ var _constants = require("../../../internals/constants");
13
13
  var _gridColumnsSelector = require("../columns/gridColumnsSelector");
14
14
  var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
15
15
  var _gridVirtualizationSelectors = require("../virtualization/gridVirtualizationSelectors");
16
- var _useGridSelector = require("../../utils/useGridSelector");
17
16
  var _gridRowSpanningUtils = require("./gridRowSpanningUtils");
18
17
  var _gridCheckboxSelectionColDef = require("../../../colDef/gridCheckboxSelectionColDef");
18
+ var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
19
+ var _utils = require("../../../utils/utils");
20
+ var _pagination = require("../pagination");
21
+ var _gridRowsSelector = require("./gridRowsSelector");
19
22
  const EMPTY_STATE = {
20
23
  spannedCells: {},
21
24
  hiddenCells: {},
@@ -43,7 +46,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
43
46
  if (skippedFields.has(colDef.field)) {
44
47
  return;
45
48
  }
46
- for (let index = rangeToProcess.firstRowIndex; index <= rangeToProcess.lastRowIndex; index += 1) {
49
+ for (let index = rangeToProcess.firstRowIndex; index < rangeToProcess.lastRowIndex; index += 1) {
47
50
  const row = visibleRows[index];
48
51
  if (hiddenCells[row.id]?.[colDef.field]) {
49
52
  continue;
@@ -60,8 +63,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
60
63
  const backwardsHiddenCells = [];
61
64
  if (index === rangeToProcess.firstRowIndex) {
62
65
  let prevIndex = index - 1;
63
- const prevRowEntry = visibleRows[prevIndex];
64
- while (prevIndex >= range.firstRowIndex && (0, _gridRowSpanningUtils.getCellValue)(prevRowEntry.model, colDef, apiRef) === cellValue) {
66
+ let prevRowEntry = visibleRows[prevIndex];
67
+ while (prevIndex >= range.firstRowIndex && prevRowEntry && (0, _gridRowSpanningUtils.getCellValue)(prevRowEntry.model, colDef, apiRef) === cellValue) {
65
68
  const currentRow = visibleRows[prevIndex + 1];
66
69
  if (hiddenCells[currentRow.id]) {
67
70
  hiddenCells[currentRow.id][colDef.field] = true;
@@ -75,6 +78,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
75
78
  spannedRowId = prevRowEntry.id;
76
79
  spannedRowIndex = prevIndex;
77
80
  prevIndex -= 1;
81
+ prevRowEntry = visibleRows[prevIndex];
78
82
  }
79
83
  }
80
84
  backwardsHiddenCells.forEach(hiddenCellIndex => {
@@ -130,6 +134,24 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
130
134
  processedRange
131
135
  };
132
136
  };
137
+ const getInitialRangeToProcess = (props, apiRef) => {
138
+ const rowCount = (0, _gridRowsSelector.gridDataRowIdsSelector)(apiRef).length;
139
+ if (props.pagination) {
140
+ const pageSize = (0, _pagination.gridPageSizeSelector)(apiRef);
141
+ let paginationLastRowIndex = DEFAULT_ROWS_TO_PROCESS;
142
+ if (pageSize > 0) {
143
+ paginationLastRowIndex = pageSize - 1;
144
+ }
145
+ return {
146
+ firstRowIndex: 0,
147
+ lastRowIndex: Math.min(paginationLastRowIndex, rowCount)
148
+ };
149
+ }
150
+ return {
151
+ firstRowIndex: 0,
152
+ lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, rowCount)
153
+ };
154
+ };
133
155
 
134
156
  /**
135
157
  * @requires columnsStateInitializer (method) - should be initialized before
@@ -137,74 +159,53 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
137
159
  * @requires filterStateInitializer (method) - should be initialized before
138
160
  */
139
161
  const rowSpanningStateInitializer = (state, props, apiRef) => {
140
- if (props.unstable_rowSpanning) {
141
- const rowIds = state.rows.dataRowIds || [];
142
- const orderedFields = state.columns.orderedFields || [];
143
- const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
144
- const columnsLookup = state.columns.lookup;
145
- const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
146
- if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
147
- return (0, _extends2.default)({}, state, {
148
- rowSpanning: EMPTY_STATE
149
- });
150
- }
151
- const rangeToProcess = {
152
- firstRowIndex: 0,
153
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(rowIds.length - 1, 0))
154
- };
155
- const rows = rowIds.map(id => ({
156
- id,
157
- model: dataRowIdToModelLookup[id]
158
- }));
159
- const colDefs = orderedFields.map(field => columnsLookup[field]);
160
- const {
161
- spannedCells,
162
- hiddenCells,
163
- hiddenCellOriginMap
164
- } = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
162
+ if (!props.rowSpanning) {
165
163
  return (0, _extends2.default)({}, state, {
166
- rowSpanning: {
167
- spannedCells,
168
- hiddenCells,
169
- hiddenCellOriginMap
170
- }
164
+ rowSpanning: EMPTY_STATE
171
165
  });
172
166
  }
167
+ const rowIds = state.rows.dataRowIds || [];
168
+ const orderedFields = state.columns.orderedFields || [];
169
+ const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
170
+ const columnsLookup = state.columns.lookup;
171
+ const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
172
+ if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
173
+ return (0, _extends2.default)({}, state, {
174
+ rowSpanning: EMPTY_STATE
175
+ });
176
+ }
177
+ const rangeToProcess = getInitialRangeToProcess(props, apiRef);
178
+ const rows = rowIds.map(id => ({
179
+ id,
180
+ model: dataRowIdToModelLookup[id]
181
+ }));
182
+ const colDefs = orderedFields.map(field => columnsLookup[field]);
183
+ const {
184
+ spannedCells,
185
+ hiddenCells,
186
+ hiddenCellOriginMap
187
+ } = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
173
188
  return (0, _extends2.default)({}, state, {
174
- rowSpanning: EMPTY_STATE
189
+ rowSpanning: {
190
+ spannedCells,
191
+ hiddenCells,
192
+ hiddenCellOriginMap
193
+ }
175
194
  });
176
195
  };
177
196
  exports.rowSpanningStateInitializer = rowSpanningStateInitializer;
178
197
  const useGridRowSpanning = (apiRef, props) => {
179
- const {
180
- range,
181
- rows: visibleRows
182
- } = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
183
- const renderContext = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridRenderContextSelector);
184
- const colDefs = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector);
185
198
  const processedRange = (0, _useLazyRef.default)(() => {
186
- return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
187
- firstRowIndex: 0,
188
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(apiRef.current.state.rows.dataRowIds.length - 1, 0))
189
- } : EMPTY_RANGE;
199
+ return apiRef.current.state.rowSpanning !== EMPTY_STATE ? getInitialRangeToProcess(props, apiRef) : EMPTY_RANGE;
190
200
  });
191
- const lastRange = React.useRef(EMPTY_RANGE);
192
- const updateRowSpanningState = React.useCallback(
193
- // A reset needs to occur when:
194
- // - The `unstable_rowSpanning` prop is updated (feature flag)
195
- // - The filtering is applied
196
- // - The sorting is applied
197
- // - The `paginationModel` is updated
198
- // - The rows are updated
199
- (resetState = true) => {
200
- if (!props.unstable_rowSpanning) {
201
- if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
202
- apiRef.current.setState(state => (0, _extends2.default)({}, state, {
203
- rowSpanning: EMPTY_STATE
204
- }));
205
- }
206
- return;
207
- }
201
+ const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
202
+ const {
203
+ range,
204
+ rows: visibleRows
205
+ } = (0, _useGridVisibleRows.getVisibleRows)(apiRef, {
206
+ pagination: props.pagination,
207
+ paginationMode: props.paginationMode
208
+ });
208
209
  if (range === null || !(0, _gridRowSpanningUtils.isRowContextInitialized)(renderContext)) {
209
210
  return;
210
211
  }
@@ -213,11 +214,12 @@ const useGridRowSpanning = (apiRef, props) => {
213
214
  }
214
215
  const rangeToProcess = (0, _gridRowSpanningUtils.getUnprocessedRange)({
215
216
  firstRowIndex: renderContext.firstRowIndex,
216
- lastRowIndex: Math.min(renderContext.lastRowIndex - 1, range.lastRowIndex)
217
+ lastRowIndex: Math.min(renderContext.lastRowIndex, range.lastRowIndex + 1)
217
218
  }, processedRange.current);
218
219
  if (rangeToProcess === null) {
219
220
  return;
220
221
  }
222
+ const colDefs = (0, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector)(apiRef);
221
223
  const {
222
224
  spannedCells,
223
225
  hiddenCells,
@@ -230,7 +232,8 @@ const useGridRowSpanning = (apiRef, props) => {
230
232
  const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
231
233
  const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
232
234
  const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
233
- if (!shouldUpdateState) {
235
+ const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
236
+ if (!shouldUpdateState || hasNoSpannedCells) {
234
237
  return;
235
238
  }
236
239
  apiRef.current.setState(state => {
@@ -242,28 +245,36 @@ const useGridRowSpanning = (apiRef, props) => {
242
245
  }
243
246
  });
244
247
  });
245
- }, [apiRef, props.unstable_rowSpanning, range, renderContext, visibleRows, colDefs, processedRange]);
246
- const prevRenderContext = React.useRef(renderContext);
247
- const isFirstRender = React.useRef(true);
248
- const shouldResetState = React.useRef(false);
249
- React.useEffect(() => {
250
- const firstRender = isFirstRender.current;
251
- if (isFirstRender.current) {
252
- isFirstRender.current = false;
253
- }
254
- if (range && lastRange.current && (0, _gridRowSpanningUtils.isRowRangeUpdated)(range, lastRange.current)) {
255
- lastRange.current = range;
256
- shouldResetState.current = true;
248
+ }, [apiRef, processedRange, props.pagination, props.paginationMode]);
249
+
250
+ // Reset events trigger a full re-computation of the row spanning state:
251
+ // - The `unstable_rowSpanning` prop is updated (feature flag)
252
+ // - The filtering is applied
253
+ // - The sorting is applied
254
+ // - The `paginationModel` is updated
255
+ // - The rows are updated
256
+ const resetRowSpanningState = React.useCallback(() => {
257
+ const renderContext = (0, _gridVirtualizationSelectors.gridRenderContextSelector)(apiRef);
258
+ if (!(0, _gridRowSpanningUtils.isRowContextInitialized)(renderContext)) {
259
+ return;
257
260
  }
258
- if (!firstRender && prevRenderContext.current !== renderContext) {
259
- if ((0, _gridRowSpanningUtils.isRowRangeUpdated)(prevRenderContext.current, renderContext)) {
260
- updateRowSpanningState(shouldResetState.current);
261
- shouldResetState.current = false;
261
+ updateRowSpanningState(renderContext, true);
262
+ }, [apiRef, updateRowSpanningState]);
263
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'renderedRowsIntervalChange', (0, _utils.runIf)(props.rowSpanning, updateRowSpanningState));
264
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'sortedRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
265
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'paginationModelChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
266
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'filteredRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
267
+ (0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnsChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
268
+ React.useEffect(() => {
269
+ if (!props.rowSpanning) {
270
+ if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
271
+ apiRef.current.setState(state => (0, _extends2.default)({}, state, {
272
+ rowSpanning: EMPTY_STATE
273
+ }));
262
274
  }
263
- prevRenderContext.current = renderContext;
264
- return;
275
+ } else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
276
+ resetRowSpanningState();
265
277
  }
266
- updateRowSpanningState();
267
- }, [updateRowSpanningState, renderContext, range, lastRange]);
278
+ }, [apiRef, resetRowSpanningState, props.rowSpanning]);
268
279
  };
269
280
  exports.useGridRowSpanning = useGridRowSpanning;
@@ -9,16 +9,19 @@ exports.useGridRows = exports.rowsStateInitializer = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
12
+ var _isObjectEmpty = require("@mui/x-internals/isObjectEmpty");
12
13
  var _useGridApiMethod = require("../../utils/useGridApiMethod");
13
14
  var _useGridLogger = require("../../utils/useGridLogger");
14
15
  var _gridRowsSelector = require("./gridRowsSelector");
15
16
  var _useTimeout = require("../../utils/useTimeout");
17
+ var _signature = require("../../../constants/signature");
16
18
  var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
17
19
  var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
18
20
  var _gridSortingSelector = require("../sorting/gridSortingSelector");
19
21
  var _gridFilterSelector = require("../filter/gridFilterSelector");
20
22
  var _gridRowsUtils = require("./gridRowsUtils");
21
23
  var _pipeProcessing = require("../../core/pipeProcessing");
24
+ var _strategyProcessing = require("../../core/strategyProcessing");
22
25
  const rowsStateInitializer = (state, props, apiRef) => {
23
26
  const isDataSourceAvailable = !!props.unstable_dataSource;
24
27
  apiRef.current.caches.rows = (0, _gridRowsUtils.createRowsInternalCache)({
@@ -48,7 +51,6 @@ const useGridRows = (apiRef, props) => {
48
51
  }
49
52
  }
50
53
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridRows');
51
- const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
52
54
  const lastUpdateMs = React.useRef(Date.now());
53
55
  const lastRowCount = React.useRef(props.rowCount);
54
56
  const timeout = (0, _useTimeout.useTimeout)();
@@ -75,12 +77,6 @@ const useGridRows = (apiRef, props) => {
75
77
  }
76
78
  return row.id;
77
79
  }, [getRowIdProp]);
78
- const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {
79
- id
80
- }, index) => {
81
- acc[id] = index;
82
- return acc;
83
- }, {}), [currentPage.rows]);
84
80
  const throttledRowsChange = React.useCallback(({
85
81
  cache,
86
82
  throttle
@@ -133,7 +129,7 @@ const useGridRows = (apiRef, props) => {
133
129
  });
134
130
  }, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange, apiRef]);
135
131
  const updateRows = React.useCallback(updates => {
136
- if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
132
+ if (props.signature === _signature.GridSignature.DataGrid && updates.length > 1) {
137
133
  throw new Error(['MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
138
134
  }
139
135
  const nonPinnedRowsUpdates = (0, _gridRowsUtils.computeRowsUpdates)(apiRef, updates, props.getRowId);
@@ -179,7 +175,12 @@ const useGridRows = (apiRef, props) => {
179
175
  }, [apiRef]);
180
176
  const getRowsCount = React.useCallback(() => (0, _gridRowsSelector.gridRowCountSelector)(apiRef), [apiRef]);
181
177
  const getAllRowIds = React.useCallback(() => (0, _gridRowsSelector.gridDataRowIdsSelector)(apiRef), [apiRef]);
182
- const getRowIndexRelativeToVisibleRows = React.useCallback(id => lookup[id], [lookup]);
178
+ const getRowIndexRelativeToVisibleRows = React.useCallback(id => {
179
+ const {
180
+ rowIdToIndexMap
181
+ } = (0, _useGridVisibleRows.getVisibleRows)(apiRef);
182
+ return rowIdToIndexMap.get(id);
183
+ }, [apiRef]);
183
184
  const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {
184
185
  const currentNode = apiRef.current.getRowNode(id);
185
186
  if (!currentNode) {
@@ -231,7 +232,7 @@ const useGridRows = (apiRef, props) => {
231
232
  }
232
233
  if (applyFiltering) {
233
234
  const filteredRowsLookup = (0, _gridFilterSelector.gridFilteredRowsLookupSelector)(apiRef);
234
- children = children.filter(childId => filteredRowsLookup[childId] !== false);
235
+ children = (0, _isObjectEmpty.isObjectEmpty)(filteredRowsLookup) ? children : children.filter(childId => filteredRowsLookup[childId] !== false);
235
236
  }
236
237
  return children;
237
238
  }, [apiRef]);
@@ -247,7 +248,7 @@ const useGridRows = (apiRef, props) => {
247
248
  throw new Error(`MUI X: The row reordering do not support reordering of footer or grouping rows.`);
248
249
  }
249
250
  apiRef.current.setState(state => {
250
- const group = (0, _gridRowsSelector.gridRowTreeSelector)(state, apiRef.current.instanceId)[_gridRowsUtils.GRID_ROOT_GROUP_ID];
251
+ const group = (0, _gridRowsSelector.gridRowTreeSelector)(state, undefined, apiRef.current.instanceId)[_gridRowsUtils.GRID_ROOT_GROUP_ID];
251
252
  const allRows = group.children;
252
253
  const oldIndex = allRows.findIndex(row => row === rowId);
253
254
  if (oldIndex === -1 || oldIndex === targetIndex) {
@@ -269,7 +270,7 @@ const useGridRows = (apiRef, props) => {
269
270
  apiRef.current.publishEvent('rowsSet');
270
271
  }, [apiRef, logger]);
271
272
  const replaceRows = React.useCallback((firstRowToRender, newRows) => {
272
- if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && newRows.length > 1) {
273
+ if (props.signature === _signature.GridSignature.DataGrid && newRows.length > 1) {
273
274
  throw new Error(['MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
274
275
  }
275
276
  if (newRows.length === 0) {
@@ -281,7 +282,6 @@ const useGridRows = (apiRef, props) => {
281
282
  }
282
283
  const tree = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowTreeSelector)(apiRef));
283
284
  const dataRowIdToModelLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsLookupSelector)(apiRef));
284
- const dataRowIdToIdLookup = (0, _extends2.default)({}, (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(apiRef));
285
285
  const rootGroup = tree[_gridRowsUtils.GRID_ROOT_GROUP_ID];
286
286
  const rootGroupChildren = [...rootGroup.children];
287
287
  const seenIds = new Set();
@@ -291,7 +291,6 @@ const useGridRows = (apiRef, props) => {
291
291
  const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
292
292
  if (!seenIds.has(removedRowId)) {
293
293
  delete dataRowIdToModelLookup[removedRowId];
294
- delete dataRowIdToIdLookup[removedRowId];
295
294
  delete tree[removedRowId];
296
295
  }
297
296
  const rowTreeNodeConfig = {
@@ -302,7 +301,6 @@ const useGridRows = (apiRef, props) => {
302
301
  groupingKey: null
303
302
  };
304
303
  dataRowIdToModelLookup[rowId] = rowModel;
305
- dataRowIdToIdLookup[rowId] = rowId;
306
304
  tree[rowId] = rowTreeNodeConfig;
307
305
  seenIds.add(rowId);
308
306
  }
@@ -313,17 +311,17 @@ const useGridRows = (apiRef, props) => {
313
311
  // Removes potential remaining skeleton rows from the dataRowIds.
314
312
  const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
315
313
  apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
316
- apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
317
314
  apiRef.current.setState(state => (0, _extends2.default)({}, state, {
318
315
  rows: (0, _extends2.default)({}, state.rows, {
316
+ loading: props.loading,
317
+ totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
319
318
  dataRowIdToModelLookup,
320
- dataRowIdToIdLookup,
321
319
  dataRowIds,
322
320
  tree
323
321
  })
324
322
  }));
325
323
  apiRef.current.publishEvent('rowsSet');
326
- }, [apiRef, props.signature, props.getRowId]);
324
+ }, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
327
325
  const rowApi = {
328
326
  getRow,
329
327
  setLoading,
@@ -390,7 +388,7 @@ const useGridRows = (apiRef, props) => {
390
388
  const handleStrategyActivityChange = React.useCallback(() => {
391
389
  // `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
392
390
  // All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
393
- if (apiRef.current.getActiveStrategy('rowTree') !== (0, _gridRowsSelector.gridRowGroupingNameSelector)(apiRef)) {
391
+ if (apiRef.current.getActiveStrategy(_strategyProcessing.GridStrategyGroup.RowTree) !== (0, _gridRowsSelector.gridRowGroupingNameSelector)(apiRef)) {
394
392
  groupRows();
395
393
  }
396
394
  }, [apiRef, groupRows]);
@@ -403,11 +401,10 @@ const useGridRows = (apiRef, props) => {
403
401
  const applyHydrateRowsProcessor = React.useCallback(() => {
404
402
  apiRef.current.setState(state => {
405
403
  const response = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
406
- tree: (0, _gridRowsSelector.gridRowTreeSelector)(state, apiRef.current.instanceId),
407
- treeDepths: (0, _gridRowsSelector.gridRowTreeDepthsSelector)(state, apiRef.current.instanceId),
408
- dataRowIds: (0, _gridRowsSelector.gridDataRowIdsSelector)(state, apiRef.current.instanceId),
409
- dataRowIdToModelLookup: (0, _gridRowsSelector.gridRowsLookupSelector)(state, apiRef.current.instanceId),
410
- dataRowIdToIdLookup: (0, _gridRowsSelector.gridRowsDataRowIdToIdLookupSelector)(state, apiRef.current.instanceId)
404
+ tree: (0, _gridRowsSelector.gridRowTreeSelector)(state, undefined, apiRef.current.instanceId),
405
+ treeDepths: (0, _gridRowsSelector.gridRowTreeDepthsSelector)(state, undefined, apiRef.current.instanceId),
406
+ dataRowIds: (0, _gridRowsSelector.gridDataRowIdsSelector)(state, undefined, apiRef.current.instanceId),
407
+ dataRowIdToModelLookup: (0, _gridRowsSelector.gridRowsLookupSelector)(state, undefined, apiRef.current.instanceId)
411
408
  });
412
409
  return (0, _extends2.default)({}, state, {
413
410
  rows: (0, _extends2.default)({}, state.rows, response, {
@@ -423,7 +420,7 @@ const useGridRows = (apiRef, props) => {
423
420
  }, [apiRef, props.rowCount]);
424
421
  (0, _pipeProcessing.useGridRegisterPipeApplier)(apiRef, 'hydrateRows', applyHydrateRowsProcessor);
425
422
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowApi, 'public');
426
- (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowProApi, props.signature === _useGridApiEventHandler.GridSignature.DataGrid ? 'private' : 'public');
423
+ (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowProApi, props.signature === _signature.GridSignature.DataGrid ? 'private' : 'public');
427
424
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowProPrivateApi, 'private');
428
425
 
429
426
  // The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridRows`
@@ -439,7 +436,8 @@ const useGridRows = (apiRef, props) => {
439
436
  isRowCountPropUpdated = true;
440
437
  lastRowCount.current = props.rowCount;
441
438
  }
442
- const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows;
439
+ const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
440
+ const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
443
441
  const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
444
442
  const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
445
443
 
@@ -469,16 +467,16 @@ const useGridRows = (apiRef, props) => {
469
467
  return;
470
468
  }
471
469
  }
472
- logger.debug(`Updating all rows, new length ${props.rows?.length}`);
470
+ logger.debug(`Updating all rows, new length ${currentRows?.length}`);
473
471
  throttledRowsChange({
474
472
  cache: (0, _gridRowsUtils.createRowsInternalCache)({
475
- rows: props.rows,
473
+ rows: currentRows,
476
474
  getRowId: props.getRowId,
477
475
  loading: props.loading,
478
476
  rowCount: props.rowCount
479
477
  }),
480
478
  throttle: false
481
479
  });
482
- }, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
480
+ }, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
483
481
  };
484
482
  exports.useGridRows = useGridRows;
@@ -9,15 +9,14 @@ exports.useGridRowsMeta = exports.rowsMetaStateInitializer = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
12
+ var _utils = require("@mui/utils");
12
13
  var _ResizeObserver = require("../../../utils/ResizeObserver");
13
14
  var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
14
- var _utils = require("../../../utils/utils");
15
+ var _utils2 = require("../../../utils/utils");
15
16
  var _useGridApiMethod = require("../../utils/useGridApiMethod");
16
17
  var _useGridSelector = require("../../utils/useGridSelector");
17
18
  var _densitySelector = require("../density/densitySelector");
18
- var _gridFilterSelector = require("../filter/gridFilterSelector");
19
19
  var _gridPaginationSelector = require("../pagination/gridPaginationSelector");
20
- var _gridSortingSelector = require("../sorting/gridSortingSelector");
21
20
  var _pipeProcessing = require("../../core/pipeProcessing");
22
21
  var _gridRowsSelector = require("./gridRowsSelector");
23
22
  var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
@@ -28,10 +27,18 @@ const rowsMetaStateInitializer = (state, props, apiRef) => {
28
27
  apiRef.current.caches.rowsMeta = {
29
28
  heights: new Map()
30
29
  };
30
+ const baseRowHeight = (0, _gridDimensionsSelectors.gridRowHeightSelector)(apiRef.current.state);
31
+ const dataRowCount = (0, _gridRowsSelector.gridRowCountSelector)(apiRef.current.state);
32
+ const pagination = (0, _gridPaginationSelector.gridPaginationSelector)(apiRef.current.state);
33
+ const rowCount = Math.min(pagination.enabled ? pagination.paginationModel.pageSize : dataRowCount, dataRowCount);
31
34
  return (0, _extends2.default)({}, state, {
32
35
  rowsMeta: {
33
- currentPageTotalHeight: 0,
34
- positions: []
36
+ currentPageTotalHeight: rowCount * baseRowHeight,
37
+ positions: Array.from({
38
+ length: rowCount
39
+ }, (_, i) => i * baseRowHeight),
40
+ pinnedTopRowsTotalHeight: 0,
41
+ pinnedBottomRowsTotalHeight: 0
35
42
  }
36
43
  });
37
44
  };
@@ -52,12 +59,9 @@ const useGridRowsMeta = (apiRef, props) => {
52
59
  const hasRowWithAutoHeight = React.useRef(false);
53
60
  const isHeightMetaValid = React.useRef(false);
54
61
  const densityFactor = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensityFactorSelector);
55
- const filterModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridFilterModelSelector);
56
- const paginationState = (0, _useGridSelector.useGridSelector)(apiRef, _gridPaginationSelector.gridPaginationSelector);
57
- const sortModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortModelSelector);
58
62
  const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
59
63
  const pinnedRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridPinnedRowsSelector);
60
- const rowHeight = (0, _useGridSelector.useGridSelector)(apiRef, () => (0, _gridDimensionsSelectors.gridDimensionsSelector)(apiRef.current.state).rowHeight);
64
+ const rowHeight = (0, _useGridSelector.useGridSelector)(apiRef, _gridDimensionsSelectors.gridRowHeightSelector);
61
65
  const getRowHeightEntry = rowId => {
62
66
  let entry = heightCache.get(rowId);
63
67
  if (entry === undefined) {
@@ -77,7 +81,7 @@ const useGridRowsMeta = (apiRef, props) => {
77
81
  // HACK: rowHeight trails behind the most up-to-date value just enough to
78
82
  // mess the initial rowsMeta hydration :/
79
83
  const baseRowHeight = (0, _gridDimensionsSelectors.gridDimensionsSelector)(apiRef.current.state).rowHeight;
80
- (0, _utils.eslintUseValue)(rowHeight);
84
+ (0, _utils2.eslintUseValue)(rowHeight);
81
85
  const entry = apiRef.current.getRowHeightEntry(row.id);
82
86
  if (!getRowHeightProp) {
83
87
  entry.content = baseRowHeight;
@@ -119,11 +123,17 @@ const useGridRowsMeta = (apiRef, props) => {
119
123
  }
120
124
  apiRef.current.unstable_applyPipeProcessors('rowHeight', entry, row);
121
125
  return entry;
122
- }, [apiRef, currentPage.rows.length, getRowHeightProp, getEstimatedRowHeight, rowHeight, getRowSpacing, densityFactor]);
126
+ }, [apiRef, currentPage.rows, getRowHeightProp, getEstimatedRowHeight, rowHeight, getRowSpacing, densityFactor]);
123
127
  const hydrateRowsMeta = React.useCallback(() => {
124
128
  hasRowWithAutoHeight.current = false;
125
- pinnedRows.top.forEach(processHeightEntry);
126
- pinnedRows.bottom.forEach(processHeightEntry);
129
+ const pinnedTopRowsTotalHeight = pinnedRows.top.reduce((acc, row) => {
130
+ const entry = processHeightEntry(row);
131
+ return acc + entry.content + entry.spacingTop + entry.spacingBottom + entry.detail;
132
+ }, 0);
133
+ const pinnedBottomRowsTotalHeight = pinnedRows.bottom.reduce((acc, row) => {
134
+ const entry = processHeightEntry(row);
135
+ return acc + entry.content + entry.spacingTop + entry.spacingBottom + entry.detail;
136
+ }, 0);
127
137
  const positions = [];
128
138
  const currentPageTotalHeight = currentPage.rows.reduce((acc, row) => {
129
139
  positions.push(acc);
@@ -135,14 +145,21 @@ const useGridRowsMeta = (apiRef, props) => {
135
145
  // No row has height=auto, so all rows are already measured
136
146
  lastMeasuredRowIndex.current = Infinity;
137
147
  }
148
+ const didHeightsChange = pinnedTopRowsTotalHeight !== apiRef.current.state.rowsMeta.pinnedTopRowsTotalHeight || pinnedBottomRowsTotalHeight !== apiRef.current.state.rowsMeta.pinnedBottomRowsTotalHeight || currentPageTotalHeight !== apiRef.current.state.rowsMeta.currentPageTotalHeight;
149
+ const rowsMeta = {
150
+ currentPageTotalHeight,
151
+ positions,
152
+ pinnedTopRowsTotalHeight,
153
+ pinnedBottomRowsTotalHeight
154
+ };
138
155
  apiRef.current.setState(state => {
139
156
  return (0, _extends2.default)({}, state, {
140
- rowsMeta: {
141
- currentPageTotalHeight,
142
- positions
143
- }
157
+ rowsMeta
144
158
  });
145
159
  });
160
+ if (didHeightsChange) {
161
+ apiRef.current.updateDimensions();
162
+ }
146
163
  isHeightMetaValid.current = true;
147
164
  }, [apiRef, pinnedRows, currentPage.rows, processHeightEntry]);
148
165
  const getRowHeight = rowId => {
@@ -190,9 +207,9 @@ const useGridRowsMeta = (apiRef, props) => {
190
207
 
191
208
  // The effect is used to build the rows meta data - currentPageTotalHeight and positions.
192
209
  // Because of variable row height this is needed for the virtualization
193
- React.useEffect(() => {
210
+ (0, _utils.unstable_useEnhancedEffect)(() => {
194
211
  hydrateRowsMeta();
195
- }, [filterModel, paginationState, sortModel, hydrateRowsMeta]);
212
+ }, [hydrateRowsMeta]);
196
213
  const rowsMetaApi = {
197
214
  unstable_getRowHeight: getRowHeight,
198
215
  unstable_setLastMeasuredRowIndex: setLastMeasuredRowIndex,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.gridSortedRowIdsSelector = exports.gridSortedRowEntriesSelector = exports.gridSortModelSelector = exports.gridSortColumnLookupSelector = void 0;
6
+ exports.gridSortedRowIndexLookupSelector = exports.gridSortedRowIdsSelector = exports.gridSortedRowEntriesSelector = exports.gridSortModelSelector = exports.gridSortColumnLookupSelector = void 0;
7
7
  var _createSelector = require("../../../utils/createSelector");
8
8
  var _gridRowsSelector = require("../rows/gridRowsSelector");
9
9
  var _gridRowsUtils = require("../rows/gridRowsUtils");
@@ -30,15 +30,16 @@ const gridSortedRowEntriesSelector = exports.gridSortedRowEntriesSelector = (0,
30
30
  id,
31
31
  model
32
32
  });
33
- }
34
- const rowNode = rowTree[id];
35
- if (rowNode && (0, _gridRowsUtils.isAutogeneratedRowNode)(rowNode)) {
36
- acc.push({
37
- id,
38
- model: {
39
- [_gridRowsUtils.GRID_ID_AUTOGENERATED]: id
40
- }
41
- });
33
+ } else {
34
+ const rowNode = rowTree[id];
35
+ if (rowNode && (0, _gridRowsUtils.isAutogeneratedRowNode)(rowNode)) {
36
+ acc.push({
37
+ id,
38
+ model: {
39
+ [_gridRowsUtils.GRID_ID_AUTOGENERATED]: id
40
+ }
41
+ });
42
+ }
42
43
  }
43
44
  return acc;
44
45
  }, []));
@@ -61,4 +62,15 @@ const gridSortColumnLookupSelector = exports.gridSortColumnLookupSelector = (0,
61
62
  return res;
62
63
  }, {});
63
64
  return result;
65
+ });
66
+
67
+ /**
68
+ * @category Sorting
69
+ * @ignore - do not document.
70
+ */
71
+ const gridSortedRowIndexLookupSelector = exports.gridSortedRowIndexLookupSelector = (0, _createSelector.createSelectorMemoized)(gridSortedRowIdsSelector, sortedIds => {
72
+ return sortedIds.reduce((acc, id, index) => {
73
+ acc[id] = index;
74
+ return acc;
75
+ }, Object.create(null));
64
76
  });
@@ -28,7 +28,7 @@ const isDesc = direction => direction === 'desc';
28
28
  /**
29
29
  * Transform an item of the sorting model into a method comparing two rows.
30
30
  * @param {GridSortItem} sortItem The sort item we want to apply.
31
- * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
31
+ * @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
32
32
  * @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
33
33
  */
34
34
  const parseSortItem = (sortItem, apiRef) => {
@@ -81,7 +81,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
81
81
  /**
82
82
  * Generates a method to easily sort a list of rows according to the current sort model.
83
83
  * @param {GridSortModel} sortModel The model with which we want to sort the rows.
84
- * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
84
+ * @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
85
85
  * @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.
86
86
  */
87
87
  const buildAggregatedSortingApplier = (sortModel, apiRef) => {