@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
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { gridPinnedRowsSelector } from "./gridRowsSelector.js";
3
2
  export const GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;
4
3
  export const GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');
5
4
  export const buildRootGroup = () => ({
@@ -42,12 +41,10 @@ export const createRowsInternalCache = ({
42
41
  rows: []
43
42
  };
44
43
  const dataRowIdToModelLookup = {};
45
- const dataRowIdToIdLookup = {};
46
44
  for (let i = 0; i < rows.length; i += 1) {
47
45
  const model = rows[i];
48
46
  const id = getRowIdFromRowModel(model, getRowId);
49
47
  dataRowIdToModelLookup[id] = model;
50
- dataRowIdToIdLookup[id] = id;
51
48
  updates.rows.push(id);
52
49
  }
53
50
  return {
@@ -55,7 +52,6 @@ export const createRowsInternalCache = ({
55
52
  loadingPropBeforePartialUpdates: loading,
56
53
  rowCountPropBeforePartialUpdates: rowCount,
57
54
  updates,
58
- dataRowIdToIdLookup,
59
55
  dataRowIdToModelLookup
60
56
  };
61
57
  };
@@ -87,7 +83,6 @@ export const getRowsStateFromCache = ({
87
83
  previousTree,
88
84
  previousTreeDepths,
89
85
  updates: cache.updates,
90
- dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
91
86
  dataRowIdToModelLookup: cache.dataRowIdToModelLookup,
92
87
  previousGroupsToFetch
93
88
  });
@@ -96,7 +91,6 @@ export const getRowsStateFromCache = ({
96
91
  const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
97
92
  tree: unProcessedTree,
98
93
  treeDepths: unProcessedTreeDepths,
99
- dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
100
94
  dataRowIds: unProcessedDataRowIds,
101
95
  dataRowIdToModelLookup: cache.dataRowIdToModelLookup
102
96
  });
@@ -177,7 +171,6 @@ export const updateCacheWithNewRows = ({
177
171
  groupKeys
178
172
  };
179
173
  const dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);
180
- const dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);
181
174
  const alreadyAppliedActionsToRemove = {
182
175
  insert: {},
183
176
  modify: {},
@@ -210,7 +203,6 @@ export const updateCacheWithNewRows = ({
210
203
  // Remove the data row from the lookups and add it to the "delete" update.
211
204
  partialUpdates.actions.remove.push(id);
212
205
  delete dataRowIdToModelLookup[id];
213
- delete dataRowIdToIdLookup[id];
214
206
  return;
215
207
  }
216
208
  const oldRow = dataRowIdToModelLookup[id];
@@ -250,7 +242,6 @@ export const updateCacheWithNewRows = ({
250
242
 
251
243
  // Update the data row lookups.
252
244
  dataRowIdToModelLookup[id] = partialRow;
253
- dataRowIdToIdLookup[id] = id;
254
245
  });
255
246
  const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);
256
247
  for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {
@@ -262,28 +253,12 @@ export const updateCacheWithNewRows = ({
262
253
  }
263
254
  return {
264
255
  dataRowIdToModelLookup,
265
- dataRowIdToIdLookup,
266
256
  updates: partialUpdates,
267
257
  rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,
268
258
  loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,
269
259
  rowCountPropBeforePartialUpdates: previousCache.rowCountPropBeforePartialUpdates
270
260
  };
271
261
  };
272
- export function calculatePinnedRowsHeight(apiRef) {
273
- const pinnedRows = gridPinnedRowsSelector(apiRef);
274
- const topPinnedRowsHeight = pinnedRows?.top?.reduce((acc, value) => {
275
- acc += apiRef.current.unstable_getRowHeight(value.id);
276
- return acc;
277
- }, 0) || 0;
278
- const bottomPinnedRowsHeight = pinnedRows?.bottom?.reduce((acc, value) => {
279
- acc += apiRef.current.unstable_getRowHeight(value.id);
280
- return acc;
281
- }, 0) || 0;
282
- return {
283
- top: topPinnedRowsHeight,
284
- bottom: bottomPinnedRowsHeight
285
- };
286
- }
287
262
  export const minimalContentHeight = 'var(--DataGrid-overlayHeight, calc(var(--height) * 2))';
288
263
  export function computeRowsUpdates(apiRef, updates, getRowId) {
289
264
  const nonPinnedRowsUpdates = [];
@@ -1,4 +1,4 @@
1
1
  export * from "./gridRowsMetaSelector.js";
2
2
  export * from "./gridRowsMetaState.js";
3
- export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector, gridRowsDataRowIdToIdLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridRowMaximumTreeDepthSelector, gridDataRowIdsSelector } from "./gridRowsSelector.js";
3
+ export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridRowMaximumTreeDepthSelector, gridDataRowIdsSelector } from "./gridRowsSelector.js";
4
4
  export { GRID_ROOT_GROUP_ID, checkGridRowIdIsValid, isAutogeneratedRow } from "./gridRowsUtils.js";
@@ -30,37 +30,52 @@ export function useGridParamsApi(apiRef, props) {
30
30
  };
31
31
  return params;
32
32
  }, [apiRef]);
33
- const getCellParams = React.useCallback((id, field) => {
34
- const colDef = props.unstable_listView ? gridListColumnSelector(apiRef.current.state) : apiRef.current.getColumn(field);
35
- const row = apiRef.current.getRow(id);
36
- const rowNode = apiRef.current.getRowNode(id);
37
- if (!row || !rowNode) {
38
- throw new MissingRowIdError(`No row with id #${id} found`);
39
- }
33
+ const getCellParamsForRow = React.useCallback((id, field, row, {
34
+ cellMode,
35
+ colDef,
36
+ hasFocus,
37
+ rowNode,
38
+ tabIndex
39
+ }) => {
40
40
  const rawValue = row[field];
41
41
  const value = colDef?.valueGetter ? colDef.valueGetter(rawValue, row, colDef, apiRef) : rawValue;
42
- const cellFocus = gridFocusCellSelector(apiRef);
43
- const cellTabIndex = gridTabIndexCellSelector(apiRef);
44
42
  const params = {
45
43
  id,
46
44
  field,
47
45
  row,
48
46
  rowNode,
49
47
  colDef,
50
- cellMode: apiRef.current.getCellMode(id, field),
51
- hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,
52
- tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,
48
+ cellMode,
49
+ hasFocus,
50
+ tabIndex,
53
51
  value,
54
52
  formattedValue: value,
55
53
  isEditable: false,
56
- api: {}
54
+ api: null
57
55
  };
58
56
  if (colDef && colDef.valueFormatter) {
59
57
  params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);
60
58
  }
61
59
  params.isEditable = colDef && apiRef.current.isCellEditable(params);
62
60
  return params;
63
- }, [apiRef, props.unstable_listView]);
61
+ }, [apiRef]);
62
+ const getCellParams = React.useCallback((id, field) => {
63
+ const row = apiRef.current.getRow(id);
64
+ const rowNode = apiRef.current.getRowNode(id);
65
+ if (!row || !rowNode) {
66
+ throw new MissingRowIdError(`No row with id #${id} found`);
67
+ }
68
+ const cellFocus = gridFocusCellSelector(apiRef);
69
+ const cellTabIndex = gridTabIndexCellSelector(apiRef);
70
+ const cellMode = apiRef.current.getCellMode(id, field);
71
+ return apiRef.current.getCellParamsForRow(id, field, row, {
72
+ colDef: props.unstable_listView && props.unstable_listColumn?.field === field ? gridListColumnSelector(apiRef.current.state) : apiRef.current.getColumn(field),
73
+ rowNode,
74
+ hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,
75
+ tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,
76
+ cellMode
77
+ });
78
+ }, [apiRef, props.unstable_listView, props.unstable_listColumn?.field]);
64
79
  const getCellValue = React.useCallback((id, field) => {
65
80
  const colDef = apiRef.current.getColumn(field);
66
81
  const row = apiRef.current.getRow(id);
@@ -119,5 +134,9 @@ export function useGridParamsApi(apiRef, props) {
119
134
  getColumnHeaderParams,
120
135
  getColumnHeaderElement
121
136
  };
137
+ const paramsPrivateApi = {
138
+ getCellParamsForRow
139
+ };
122
140
  useGridApiMethod(apiRef, paramsApi, 'public');
141
+ useGridApiMethod(apiRef, paramsPrivateApi, 'private');
123
142
  }
@@ -3,11 +3,14 @@ import * as React from 'react';
3
3
  import useLazyRef from '@mui/utils/useLazyRef';
4
4
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
5
5
  import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
6
- import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
6
+ import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
7
7
  import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
8
- import { useGridSelector } from "../../utils/useGridSelector.js";
9
- import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
8
+ import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
10
9
  import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
10
+ import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
11
+ import { runIf } from "../../../utils/utils.js";
12
+ import { gridPageSizeSelector } from "../pagination/index.js";
13
+ import { gridDataRowIdsSelector } from "./gridRowsSelector.js";
11
14
  const EMPTY_STATE = {
12
15
  spannedCells: {},
13
16
  hiddenCells: {},
@@ -35,7 +38,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
35
38
  if (skippedFields.has(colDef.field)) {
36
39
  return;
37
40
  }
38
- for (let index = rangeToProcess.firstRowIndex; index <= rangeToProcess.lastRowIndex; index += 1) {
41
+ for (let index = rangeToProcess.firstRowIndex; index < rangeToProcess.lastRowIndex; index += 1) {
39
42
  const row = visibleRows[index];
40
43
  if (hiddenCells[row.id]?.[colDef.field]) {
41
44
  continue;
@@ -52,8 +55,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
52
55
  const backwardsHiddenCells = [];
53
56
  if (index === rangeToProcess.firstRowIndex) {
54
57
  let prevIndex = index - 1;
55
- const prevRowEntry = visibleRows[prevIndex];
56
- while (prevIndex >= range.firstRowIndex && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
58
+ let prevRowEntry = visibleRows[prevIndex];
59
+ while (prevIndex >= range.firstRowIndex && prevRowEntry && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
57
60
  const currentRow = visibleRows[prevIndex + 1];
58
61
  if (hiddenCells[currentRow.id]) {
59
62
  hiddenCells[currentRow.id][colDef.field] = true;
@@ -67,6 +70,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
67
70
  spannedRowId = prevRowEntry.id;
68
71
  spannedRowIndex = prevIndex;
69
72
  prevIndex -= 1;
73
+ prevRowEntry = visibleRows[prevIndex];
70
74
  }
71
75
  }
72
76
  backwardsHiddenCells.forEach(hiddenCellIndex => {
@@ -122,6 +126,24 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
122
126
  processedRange
123
127
  };
124
128
  };
129
+ const getInitialRangeToProcess = (props, apiRef) => {
130
+ const rowCount = gridDataRowIdsSelector(apiRef).length;
131
+ if (props.pagination) {
132
+ const pageSize = gridPageSizeSelector(apiRef);
133
+ let paginationLastRowIndex = DEFAULT_ROWS_TO_PROCESS;
134
+ if (pageSize > 0) {
135
+ paginationLastRowIndex = pageSize - 1;
136
+ }
137
+ return {
138
+ firstRowIndex: 0,
139
+ lastRowIndex: Math.min(paginationLastRowIndex, rowCount)
140
+ };
141
+ }
142
+ return {
143
+ firstRowIndex: 0,
144
+ lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, rowCount)
145
+ };
146
+ };
125
147
 
126
148
  /**
127
149
  * @requires columnsStateInitializer (method) - should be initialized before
@@ -129,73 +151,52 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
129
151
  * @requires filterStateInitializer (method) - should be initialized before
130
152
  */
131
153
  export const rowSpanningStateInitializer = (state, props, apiRef) => {
132
- if (props.unstable_rowSpanning) {
133
- const rowIds = state.rows.dataRowIds || [];
134
- const orderedFields = state.columns.orderedFields || [];
135
- const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
136
- const columnsLookup = state.columns.lookup;
137
- const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
138
- if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
139
- return _extends({}, state, {
140
- rowSpanning: EMPTY_STATE
141
- });
142
- }
143
- const rangeToProcess = {
144
- firstRowIndex: 0,
145
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(rowIds.length - 1, 0))
146
- };
147
- const rows = rowIds.map(id => ({
148
- id,
149
- model: dataRowIdToModelLookup[id]
150
- }));
151
- const colDefs = orderedFields.map(field => columnsLookup[field]);
152
- const {
153
- spannedCells,
154
- hiddenCells,
155
- hiddenCellOriginMap
156
- } = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
154
+ if (!props.rowSpanning) {
157
155
  return _extends({}, state, {
158
- rowSpanning: {
159
- spannedCells,
160
- hiddenCells,
161
- hiddenCellOriginMap
162
- }
156
+ rowSpanning: EMPTY_STATE
163
157
  });
164
158
  }
159
+ const rowIds = state.rows.dataRowIds || [];
160
+ const orderedFields = state.columns.orderedFields || [];
161
+ const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
162
+ const columnsLookup = state.columns.lookup;
163
+ const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
164
+ if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
165
+ return _extends({}, state, {
166
+ rowSpanning: EMPTY_STATE
167
+ });
168
+ }
169
+ const rangeToProcess = getInitialRangeToProcess(props, apiRef);
170
+ const rows = rowIds.map(id => ({
171
+ id,
172
+ model: dataRowIdToModelLookup[id]
173
+ }));
174
+ const colDefs = orderedFields.map(field => columnsLookup[field]);
175
+ const {
176
+ spannedCells,
177
+ hiddenCells,
178
+ hiddenCellOriginMap
179
+ } = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
165
180
  return _extends({}, state, {
166
- rowSpanning: EMPTY_STATE
181
+ rowSpanning: {
182
+ spannedCells,
183
+ hiddenCells,
184
+ hiddenCellOriginMap
185
+ }
167
186
  });
168
187
  };
169
188
  export const useGridRowSpanning = (apiRef, props) => {
170
- const {
171
- range,
172
- rows: visibleRows
173
- } = useGridVisibleRows(apiRef, props);
174
- const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
175
- const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
176
189
  const processedRange = useLazyRef(() => {
177
- return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
178
- firstRowIndex: 0,
179
- lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS - 1, Math.max(apiRef.current.state.rows.dataRowIds.length - 1, 0))
180
- } : EMPTY_RANGE;
190
+ return apiRef.current.state.rowSpanning !== EMPTY_STATE ? getInitialRangeToProcess(props, apiRef) : EMPTY_RANGE;
181
191
  });
182
- const lastRange = React.useRef(EMPTY_RANGE);
183
- const updateRowSpanningState = React.useCallback(
184
- // A reset needs to occur when:
185
- // - The `unstable_rowSpanning` prop is updated (feature flag)
186
- // - The filtering is applied
187
- // - The sorting is applied
188
- // - The `paginationModel` is updated
189
- // - The rows are updated
190
- (resetState = true) => {
191
- if (!props.unstable_rowSpanning) {
192
- if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
193
- apiRef.current.setState(state => _extends({}, state, {
194
- rowSpanning: EMPTY_STATE
195
- }));
196
- }
197
- return;
198
- }
192
+ const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
193
+ const {
194
+ range,
195
+ rows: visibleRows
196
+ } = getVisibleRows(apiRef, {
197
+ pagination: props.pagination,
198
+ paginationMode: props.paginationMode
199
+ });
199
200
  if (range === null || !isRowContextInitialized(renderContext)) {
200
201
  return;
201
202
  }
@@ -204,11 +205,12 @@ export const useGridRowSpanning = (apiRef, props) => {
204
205
  }
205
206
  const rangeToProcess = getUnprocessedRange({
206
207
  firstRowIndex: renderContext.firstRowIndex,
207
- lastRowIndex: Math.min(renderContext.lastRowIndex - 1, range.lastRowIndex)
208
+ lastRowIndex: Math.min(renderContext.lastRowIndex, range.lastRowIndex + 1)
208
209
  }, processedRange.current);
209
210
  if (rangeToProcess === null) {
210
211
  return;
211
212
  }
213
+ const colDefs = gridVisibleColumnDefinitionsSelector(apiRef);
212
214
  const {
213
215
  spannedCells,
214
216
  hiddenCells,
@@ -221,7 +223,8 @@ export const useGridRowSpanning = (apiRef, props) => {
221
223
  const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
222
224
  const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
223
225
  const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
224
- if (!shouldUpdateState) {
226
+ const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
227
+ if (!shouldUpdateState || hasNoSpannedCells) {
225
228
  return;
226
229
  }
227
230
  apiRef.current.setState(state => {
@@ -233,27 +236,35 @@ export const useGridRowSpanning = (apiRef, props) => {
233
236
  }
234
237
  });
235
238
  });
236
- }, [apiRef, props.unstable_rowSpanning, range, renderContext, visibleRows, colDefs, processedRange]);
237
- const prevRenderContext = React.useRef(renderContext);
238
- const isFirstRender = React.useRef(true);
239
- const shouldResetState = React.useRef(false);
240
- React.useEffect(() => {
241
- const firstRender = isFirstRender.current;
242
- if (isFirstRender.current) {
243
- isFirstRender.current = false;
244
- }
245
- if (range && lastRange.current && isRowRangeUpdated(range, lastRange.current)) {
246
- lastRange.current = range;
247
- shouldResetState.current = true;
239
+ }, [apiRef, processedRange, props.pagination, props.paginationMode]);
240
+
241
+ // Reset events trigger a full re-computation of the row spanning state:
242
+ // - The `unstable_rowSpanning` prop is updated (feature flag)
243
+ // - The filtering is applied
244
+ // - The sorting is applied
245
+ // - The `paginationModel` is updated
246
+ // - The rows are updated
247
+ const resetRowSpanningState = React.useCallback(() => {
248
+ const renderContext = gridRenderContextSelector(apiRef);
249
+ if (!isRowContextInitialized(renderContext)) {
250
+ return;
248
251
  }
249
- if (!firstRender && prevRenderContext.current !== renderContext) {
250
- if (isRowRangeUpdated(prevRenderContext.current, renderContext)) {
251
- updateRowSpanningState(shouldResetState.current);
252
- shouldResetState.current = false;
252
+ updateRowSpanningState(renderContext, true);
253
+ }, [apiRef, updateRowSpanningState]);
254
+ useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', runIf(props.rowSpanning, updateRowSpanningState));
255
+ useGridApiEventHandler(apiRef, 'sortedRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
256
+ useGridApiEventHandler(apiRef, 'paginationModelChange', runIf(props.rowSpanning, resetRowSpanningState));
257
+ useGridApiEventHandler(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
258
+ useGridApiEventHandler(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
259
+ React.useEffect(() => {
260
+ if (!props.rowSpanning) {
261
+ if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
262
+ apiRef.current.setState(state => _extends({}, state, {
263
+ rowSpanning: EMPTY_STATE
264
+ }));
253
265
  }
254
- prevRenderContext.current = renderContext;
255
- return;
266
+ } else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
267
+ resetRowSpanningState();
256
268
  }
257
- updateRowSpanningState();
258
- }, [updateRowSpanningState, renderContext, range, lastRange]);
269
+ }, [apiRef, resetRowSpanningState, props.rowSpanning]);
259
270
  };
@@ -1,16 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import useLazyRef from '@mui/utils/useLazyRef';
4
+ import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
4
5
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
5
6
  import { useGridLogger } from "../../utils/useGridLogger.js";
6
- import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowsDataRowIdToIdLookupSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
7
+ import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
7
8
  import { useTimeout } from "../../utils/useTimeout.js";
8
- import { GridSignature, useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
9
- import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
9
+ import { GridSignature } from "../../../constants/signature.js";
10
+ import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
11
+ import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
10
12
  import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
11
13
  import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
12
14
  import { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutogeneratedRowNode, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel, computeRowsUpdates } from "./gridRowsUtils.js";
13
15
  import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
16
+ import { GridStrategyGroup } from "../../core/strategyProcessing/index.js";
14
17
  export const rowsStateInitializer = (state, props, apiRef) => {
15
18
  const isDataSourceAvailable = !!props.unstable_dataSource;
16
19
  apiRef.current.caches.rows = createRowsInternalCache({
@@ -39,7 +42,6 @@ export const useGridRows = (apiRef, props) => {
39
42
  }
40
43
  }
41
44
  const logger = useGridLogger(apiRef, 'useGridRows');
42
- const currentPage = useGridVisibleRows(apiRef, props);
43
45
  const lastUpdateMs = React.useRef(Date.now());
44
46
  const lastRowCount = React.useRef(props.rowCount);
45
47
  const timeout = useTimeout();
@@ -66,12 +68,6 @@ export const useGridRows = (apiRef, props) => {
66
68
  }
67
69
  return row.id;
68
70
  }, [getRowIdProp]);
69
- const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {
70
- id
71
- }, index) => {
72
- acc[id] = index;
73
- return acc;
74
- }, {}), [currentPage.rows]);
75
71
  const throttledRowsChange = React.useCallback(({
76
72
  cache,
77
73
  throttle
@@ -170,7 +166,12 @@ export const useGridRows = (apiRef, props) => {
170
166
  }, [apiRef]);
171
167
  const getRowsCount = React.useCallback(() => gridRowCountSelector(apiRef), [apiRef]);
172
168
  const getAllRowIds = React.useCallback(() => gridDataRowIdsSelector(apiRef), [apiRef]);
173
- const getRowIndexRelativeToVisibleRows = React.useCallback(id => lookup[id], [lookup]);
169
+ const getRowIndexRelativeToVisibleRows = React.useCallback(id => {
170
+ const {
171
+ rowIdToIndexMap
172
+ } = getVisibleRows(apiRef);
173
+ return rowIdToIndexMap.get(id);
174
+ }, [apiRef]);
174
175
  const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {
175
176
  const currentNode = apiRef.current.getRowNode(id);
176
177
  if (!currentNode) {
@@ -222,7 +223,7 @@ export const useGridRows = (apiRef, props) => {
222
223
  }
223
224
  if (applyFiltering) {
224
225
  const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
225
- children = children.filter(childId => filteredRowsLookup[childId] !== false);
226
+ children = isObjectEmpty(filteredRowsLookup) ? children : children.filter(childId => filteredRowsLookup[childId] !== false);
226
227
  }
227
228
  return children;
228
229
  }, [apiRef]);
@@ -238,7 +239,7 @@ export const useGridRows = (apiRef, props) => {
238
239
  throw new Error(`MUI X: The row reordering do not support reordering of footer or grouping rows.`);
239
240
  }
240
241
  apiRef.current.setState(state => {
241
- const group = gridRowTreeSelector(state, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
242
+ const group = gridRowTreeSelector(state, undefined, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];
242
243
  const allRows = group.children;
243
244
  const oldIndex = allRows.findIndex(row => row === rowId);
244
245
  if (oldIndex === -1 || oldIndex === targetIndex) {
@@ -272,7 +273,6 @@ export const useGridRows = (apiRef, props) => {
272
273
  }
273
274
  const tree = _extends({}, gridRowTreeSelector(apiRef));
274
275
  const dataRowIdToModelLookup = _extends({}, gridRowsLookupSelector(apiRef));
275
- const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
276
276
  const rootGroup = tree[GRID_ROOT_GROUP_ID];
277
277
  const rootGroupChildren = [...rootGroup.children];
278
278
  const seenIds = new Set();
@@ -282,7 +282,6 @@ export const useGridRows = (apiRef, props) => {
282
282
  const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
283
283
  if (!seenIds.has(removedRowId)) {
284
284
  delete dataRowIdToModelLookup[removedRowId];
285
- delete dataRowIdToIdLookup[removedRowId];
286
285
  delete tree[removedRowId];
287
286
  }
288
287
  const rowTreeNodeConfig = {
@@ -293,7 +292,6 @@ export const useGridRows = (apiRef, props) => {
293
292
  groupingKey: null
294
293
  };
295
294
  dataRowIdToModelLookup[rowId] = rowModel;
296
- dataRowIdToIdLookup[rowId] = rowId;
297
295
  tree[rowId] = rowTreeNodeConfig;
298
296
  seenIds.add(rowId);
299
297
  }
@@ -304,17 +302,17 @@ export const useGridRows = (apiRef, props) => {
304
302
  // Removes potential remaining skeleton rows from the dataRowIds.
305
303
  const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
306
304
  apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
307
- apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
308
305
  apiRef.current.setState(state => _extends({}, state, {
309
306
  rows: _extends({}, state.rows, {
307
+ loading: props.loading,
308
+ totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
310
309
  dataRowIdToModelLookup,
311
- dataRowIdToIdLookup,
312
310
  dataRowIds,
313
311
  tree
314
312
  })
315
313
  }));
316
314
  apiRef.current.publishEvent('rowsSet');
317
- }, [apiRef, props.signature, props.getRowId]);
315
+ }, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
318
316
  const rowApi = {
319
317
  getRow,
320
318
  setLoading,
@@ -381,7 +379,7 @@ export const useGridRows = (apiRef, props) => {
381
379
  const handleStrategyActivityChange = React.useCallback(() => {
382
380
  // `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
383
381
  // All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
384
- if (apiRef.current.getActiveStrategy('rowTree') !== gridRowGroupingNameSelector(apiRef)) {
382
+ if (apiRef.current.getActiveStrategy(GridStrategyGroup.RowTree) !== gridRowGroupingNameSelector(apiRef)) {
385
383
  groupRows();
386
384
  }
387
385
  }, [apiRef, groupRows]);
@@ -394,11 +392,10 @@ export const useGridRows = (apiRef, props) => {
394
392
  const applyHydrateRowsProcessor = React.useCallback(() => {
395
393
  apiRef.current.setState(state => {
396
394
  const response = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
397
- tree: gridRowTreeSelector(state, apiRef.current.instanceId),
398
- treeDepths: gridRowTreeDepthsSelector(state, apiRef.current.instanceId),
399
- dataRowIds: gridDataRowIdsSelector(state, apiRef.current.instanceId),
400
- dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId),
401
- dataRowIdToIdLookup: gridRowsDataRowIdToIdLookupSelector(state, apiRef.current.instanceId)
395
+ tree: gridRowTreeSelector(state, undefined, apiRef.current.instanceId),
396
+ treeDepths: gridRowTreeDepthsSelector(state, undefined, apiRef.current.instanceId),
397
+ dataRowIds: gridDataRowIdsSelector(state, undefined, apiRef.current.instanceId),
398
+ dataRowIdToModelLookup: gridRowsLookupSelector(state, undefined, apiRef.current.instanceId)
402
399
  });
403
400
  return _extends({}, state, {
404
401
  rows: _extends({}, state.rows, response, {
@@ -430,7 +427,8 @@ export const useGridRows = (apiRef, props) => {
430
427
  isRowCountPropUpdated = true;
431
428
  lastRowCount.current = props.rowCount;
432
429
  }
433
- const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows;
430
+ const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
431
+ const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
434
432
  const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
435
433
  const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
436
434
 
@@ -460,15 +458,15 @@ export const useGridRows = (apiRef, props) => {
460
458
  return;
461
459
  }
462
460
  }
463
- logger.debug(`Updating all rows, new length ${props.rows?.length}`);
461
+ logger.debug(`Updating all rows, new length ${currentRows?.length}`);
464
462
  throttledRowsChange({
465
463
  cache: createRowsInternalCache({
466
- rows: props.rows,
464
+ rows: currentRows,
467
465
  getRowId: props.getRowId,
468
466
  loading: props.loading,
469
467
  rowCount: props.rowCount
470
468
  }),
471
469
  throttle: false
472
470
  });
473
- }, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
471
+ }, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
474
472
  };