@mui/x-data-grid 8.0.0-alpha.7 → 8.0.0-alpha.9

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 (393) hide show
  1. package/CHANGELOG.md +551 -3
  2. package/DataGrid/DataGrid.js +4 -5
  3. package/DataGrid/useDataGridComponent.d.ts +2 -1
  4. package/DataGrid/useDataGridComponent.js +1 -1
  5. package/components/GridApiContext.js +2 -0
  6. package/components/GridConfigurationContext.js +2 -0
  7. package/components/GridHeaders.js +2 -2
  8. package/components/GridRow.d.ts +5 -9
  9. package/components/GridRow.js +28 -78
  10. package/components/GridScrollArea.js +2 -0
  11. package/components/GridSkeletonLoadingOverlay.js +18 -18
  12. package/components/cell/GridCell.d.ts +9 -16
  13. package/components/cell/GridCell.js +17 -35
  14. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
  15. package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  16. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
  17. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
  18. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
  19. package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  20. package/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  21. package/components/containers/GridRoot.d.ts +2 -2
  22. package/components/containers/GridRoot.js +14 -6
  23. package/components/containers/GridRootStyles.js +7 -0
  24. package/components/panel/GridPanel.js +2 -1
  25. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
  26. package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  27. package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
  28. package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  29. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  30. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  31. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
  32. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  33. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
  34. package/components/panel/filterPanel/GridFilterInputValue.js +34 -28
  35. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +2 -1
  36. package/components/toolbar/GridToolbarColumnsButton.js +6 -1
  37. package/components/toolbar/GridToolbarFilterButton.js +6 -1
  38. package/components/virtualization/GridVirtualScrollbar.js +11 -12
  39. package/components/virtualization/GridVirtualScroller.js +4 -4
  40. package/constants/gridClasses.d.ts +12 -0
  41. package/constants/gridClasses.js +1 -1
  42. package/constants/localeTextConstants.js +1 -0
  43. package/context/GridContextProvider.d.ts +2 -1
  44. package/context/GridRootPropsContext.js +2 -0
  45. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
  46. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
  47. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
  48. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
  49. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +2 -2
  50. package/hooks/core/useGridApiInitialization.d.ts +2 -2
  51. package/hooks/core/useGridInitialization.d.ts +2 -2
  52. package/hooks/core/useGridIsRtl.d.ts +2 -2
  53. package/hooks/core/useGridLocaleText.d.ts +2 -2
  54. package/hooks/core/useGridLoggerFactory.d.ts +2 -2
  55. package/hooks/core/useGridRefs.d.ts +2 -2
  56. package/hooks/core/useGridStateInitialization.d.ts +2 -2
  57. package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
  58. package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
  59. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
  60. package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  61. package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
  62. package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  63. package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
  64. package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
  65. package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
  66. package/hooks/features/columns/useGridColumns.d.ts +2 -2
  67. package/hooks/features/density/useGridDensity.d.ts +2 -2
  68. package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
  69. package/hooks/features/dimensions/useGridDimensions.js +1 -3
  70. package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
  71. package/hooks/features/editing/useGridCellEditing.js +1 -1
  72. package/hooks/features/editing/useGridEditing.d.ts +2 -2
  73. package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
  74. package/hooks/features/editing/useGridRowEditing.js +1 -1
  75. package/hooks/features/events/useGridEvents.d.ts +2 -2
  76. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
  77. package/hooks/features/export/useGridCsvExport.d.ts +2 -2
  78. package/hooks/features/export/useGridPrintExport.d.ts +2 -2
  79. package/hooks/features/export/utils.d.ts +2 -2
  80. package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
  81. package/hooks/features/filter/gridFilterSelector.js +6 -1
  82. package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
  83. package/hooks/features/filter/gridFilterUtils.js +3 -3
  84. package/hooks/features/filter/useGridFilter.d.ts +2 -2
  85. package/hooks/features/focus/useGridFocus.d.ts +2 -2
  86. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
  87. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
  88. package/hooks/features/keyboardNavigation/utils.d.ts +3 -3
  89. package/hooks/features/listView/useGridListView.d.ts +2 -2
  90. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
  91. package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
  92. package/hooks/features/pagination/gridPaginationSelector.js +39 -1
  93. package/hooks/features/pagination/useGridPagination.d.ts +3 -3
  94. package/hooks/features/pagination/useGridPagination.js +5 -3
  95. package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
  96. package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
  97. package/hooks/features/pagination/useGridPaginationModel.js +23 -1
  98. package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
  99. package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
  100. package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
  101. package/hooks/features/preferencesPanel/index.d.ts +1 -1
  102. package/hooks/features/preferencesPanel/index.js +1 -1
  103. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
  104. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  105. package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
  106. package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
  107. package/hooks/features/rowSelection/utils.d.ts +3 -2
  108. package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
  109. package/hooks/features/rows/gridRowsSelector.js +1 -1
  110. package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
  111. package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
  112. package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
  113. package/hooks/features/rows/useGridRows.d.ts +2 -2
  114. package/hooks/features/rows/useGridRows.js +2 -2
  115. package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
  116. package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
  117. package/hooks/features/scroll/useGridScroll.d.ts +2 -2
  118. package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
  119. package/hooks/features/sorting/gridSortingUtils.js +2 -2
  120. package/hooks/features/sorting/useGridSorting.d.ts +2 -2
  121. package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
  122. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
  123. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  124. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -1
  125. package/hooks/features/virtualization/useGridVirtualScroller.js +92 -50
  126. package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
  127. package/hooks/utils/useGridApiContext.d.ts +2 -2
  128. package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
  129. package/hooks/utils/useGridApiMethod.d.ts +2 -2
  130. package/hooks/utils/useGridApiRef.d.ts +2 -2
  131. package/hooks/utils/useGridApiRef.js +3 -1
  132. package/hooks/utils/useGridInitializeState.d.ts +3 -3
  133. package/hooks/utils/useGridLogger.d.ts +2 -2
  134. package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
  135. package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
  136. package/hooks/utils/useGridSelector.d.ts +2 -2
  137. package/hooks/utils/useGridVisibleRows.d.ts +8 -6
  138. package/hooks/utils/useGridVisibleRows.js +5 -28
  139. package/index.js +1 -1
  140. package/internals/constants.d.ts +6 -0
  141. package/internals/constants.js +8 -1
  142. package/internals/index.d.ts +1 -0
  143. package/internals/index.js +1 -0
  144. package/internals/utils/attachPinnedStyle.d.ts +2 -0
  145. package/internals/utils/attachPinnedStyle.js +9 -0
  146. package/internals/utils/getPinnedCellOffset.d.ts +3 -3
  147. package/internals/utils/getPinnedCellOffset.js +6 -7
  148. package/internals/utils/index.d.ts +1 -0
  149. package/internals/utils/index.js +2 -1
  150. package/locales/arSD.js +2 -0
  151. package/locales/beBY.js +1 -0
  152. package/locales/bgBG.js +2 -0
  153. package/locales/csCZ.js +2 -0
  154. package/locales/daDK.js +2 -0
  155. package/locales/deDE.js +2 -0
  156. package/locales/elGR.js +2 -0
  157. package/locales/esES.js +2 -0
  158. package/locales/faIR.js +7 -6
  159. package/locales/fiFI.js +2 -0
  160. package/locales/frFR.js +2 -0
  161. package/locales/heIL.js +2 -0
  162. package/locales/hrHR.js +2 -0
  163. package/locales/huHU.js +2 -0
  164. package/locales/isIS.js +2 -0
  165. package/locales/itIT.js +2 -0
  166. package/locales/jaJP.js +2 -0
  167. package/locales/koKR.js +2 -0
  168. package/locales/nbNO.js +2 -0
  169. package/locales/nlNL.js +2 -0
  170. package/locales/nnNO.js +2 -0
  171. package/locales/plPL.js +2 -0
  172. package/locales/ptBR.js +2 -0
  173. package/locales/ptPT.js +2 -0
  174. package/locales/roRO.js +2 -0
  175. package/locales/ruRU.js +2 -0
  176. package/locales/skSK.js +2 -0
  177. package/locales/svSE.js +2 -0
  178. package/locales/trTR.js +2 -0
  179. package/locales/ukUA.js +2 -0
  180. package/locales/urPK.js +11 -10
  181. package/locales/viVN.js +2 -0
  182. package/locales/zhCN.js +2 -0
  183. package/locales/zhHK.js +2 -0
  184. package/locales/zhTW.js +2 -0
  185. package/material/index.js +2 -1
  186. package/models/api/gridLocaleTextApi.d.ts +1 -0
  187. package/models/colDef/gridColDef.d.ts +9 -8
  188. package/models/events/gridEventLookup.d.ts +6 -1
  189. package/models/gridExport.d.ts +2 -2
  190. package/models/gridFilterOperator.d.ts +2 -1
  191. package/models/gridIconSlotsComponent.d.ts +5 -0
  192. package/models/gridStateCommunity.d.ts +4 -0
  193. package/models/props/DataGridProps.d.ts +2 -1
  194. package/modern/DataGrid/DataGrid.js +4 -5
  195. package/modern/DataGrid/useDataGridComponent.js +1 -1
  196. package/modern/components/GridApiContext.js +2 -0
  197. package/modern/components/GridConfigurationContext.js +2 -0
  198. package/modern/components/GridHeaders.js +2 -2
  199. package/modern/components/GridRow.js +28 -78
  200. package/modern/components/GridScrollArea.js +2 -0
  201. package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
  202. package/modern/components/cell/GridCell.js +17 -35
  203. package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  204. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
  205. package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  206. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  207. package/modern/components/containers/GridRoot.js +14 -6
  208. package/modern/components/containers/GridRootStyles.js +7 -0
  209. package/modern/components/panel/GridPanel.js +2 -1
  210. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  211. package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  212. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  213. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  214. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  215. package/modern/components/panel/filterPanel/GridFilterInputValue.js +34 -28
  216. package/modern/components/toolbar/GridToolbarColumnsButton.js +6 -1
  217. package/modern/components/toolbar/GridToolbarFilterButton.js +6 -1
  218. package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
  219. package/modern/components/virtualization/GridVirtualScroller.js +4 -4
  220. package/modern/constants/gridClasses.js +1 -1
  221. package/modern/constants/localeTextConstants.js +1 -0
  222. package/modern/context/GridRootPropsContext.js +2 -0
  223. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  224. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  225. package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
  226. package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
  227. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  228. package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
  229. package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
  230. package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
  231. package/modern/hooks/features/pagination/useGridPagination.js +5 -3
  232. package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
  233. package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
  234. package/modern/hooks/features/preferencesPanel/index.js +1 -1
  235. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  236. package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
  237. package/modern/hooks/features/rows/useGridRows.js +2 -2
  238. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
  239. package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  240. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +92 -50
  241. package/modern/hooks/utils/useGridApiRef.js +3 -1
  242. package/modern/hooks/utils/useGridVisibleRows.js +5 -28
  243. package/modern/index.js +1 -1
  244. package/modern/internals/constants.js +8 -1
  245. package/modern/internals/index.js +1 -0
  246. package/modern/internals/utils/attachPinnedStyle.js +9 -0
  247. package/modern/internals/utils/getPinnedCellOffset.js +6 -7
  248. package/modern/internals/utils/index.js +2 -1
  249. package/modern/locales/arSD.js +2 -0
  250. package/modern/locales/beBY.js +1 -0
  251. package/modern/locales/bgBG.js +2 -0
  252. package/modern/locales/csCZ.js +2 -0
  253. package/modern/locales/daDK.js +2 -0
  254. package/modern/locales/deDE.js +2 -0
  255. package/modern/locales/elGR.js +2 -0
  256. package/modern/locales/esES.js +2 -0
  257. package/modern/locales/faIR.js +7 -6
  258. package/modern/locales/fiFI.js +2 -0
  259. package/modern/locales/frFR.js +2 -0
  260. package/modern/locales/heIL.js +2 -0
  261. package/modern/locales/hrHR.js +2 -0
  262. package/modern/locales/huHU.js +2 -0
  263. package/modern/locales/isIS.js +2 -0
  264. package/modern/locales/itIT.js +2 -0
  265. package/modern/locales/jaJP.js +2 -0
  266. package/modern/locales/koKR.js +2 -0
  267. package/modern/locales/nbNO.js +2 -0
  268. package/modern/locales/nlNL.js +2 -0
  269. package/modern/locales/nnNO.js +2 -0
  270. package/modern/locales/plPL.js +2 -0
  271. package/modern/locales/ptBR.js +2 -0
  272. package/modern/locales/ptPT.js +2 -0
  273. package/modern/locales/roRO.js +2 -0
  274. package/modern/locales/ruRU.js +2 -0
  275. package/modern/locales/skSK.js +2 -0
  276. package/modern/locales/svSE.js +2 -0
  277. package/modern/locales/trTR.js +2 -0
  278. package/modern/locales/ukUA.js +2 -0
  279. package/modern/locales/urPK.js +11 -10
  280. package/modern/locales/viVN.js +2 -0
  281. package/modern/locales/zhCN.js +2 -0
  282. package/modern/locales/zhHK.js +2 -0
  283. package/modern/locales/zhTW.js +2 -0
  284. package/modern/material/index.js +2 -1
  285. package/modern/utils/cellBorderUtils.js +5 -5
  286. package/modern/utils/domUtils.js +7 -2
  287. package/modern/utils/isJSDOM.js +1 -0
  288. package/modern/utils/rtlFlipSide.js +22 -0
  289. package/node/DataGrid/DataGrid.js +2 -3
  290. package/node/DataGrid/useDataGridComponent.js +1 -1
  291. package/node/components/GridApiContext.js +1 -0
  292. package/node/components/GridConfigurationContext.js +1 -0
  293. package/node/components/GridHeaders.js +2 -2
  294. package/node/components/GridRow.js +26 -77
  295. package/node/components/GridScrollArea.js +1 -0
  296. package/node/components/GridSkeletonLoadingOverlay.js +17 -17
  297. package/node/components/cell/GridCell.js +18 -36
  298. package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  299. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +19 -5
  300. package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  301. package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
  302. package/node/components/containers/GridRoot.js +14 -6
  303. package/node/components/containers/GridRootStyles.js +7 -0
  304. package/node/components/panel/GridPanel.js +2 -1
  305. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  306. package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
  307. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  308. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  309. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  310. package/node/components/panel/filterPanel/GridFilterInputValue.js +33 -27
  311. package/node/components/toolbar/GridToolbarColumnsButton.js +6 -1
  312. package/node/components/toolbar/GridToolbarFilterButton.js +6 -1
  313. package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
  314. package/node/components/virtualization/GridVirtualScroller.js +4 -4
  315. package/node/constants/gridClasses.js +1 -1
  316. package/node/constants/localeTextConstants.js +1 -0
  317. package/node/context/GridRootPropsContext.js +1 -0
  318. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
  319. package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
  320. package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
  321. package/node/hooks/features/editing/useGridCellEditing.js +1 -1
  322. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  323. package/node/hooks/features/filter/gridFilterSelector.js +6 -1
  324. package/node/hooks/features/filter/gridFilterUtils.js +3 -3
  325. package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
  326. package/node/hooks/features/pagination/useGridPagination.js +5 -3
  327. package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
  328. package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
  329. package/node/hooks/features/preferencesPanel/index.js +11 -10
  330. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
  331. package/node/hooks/features/rows/gridRowsSelector.js +1 -1
  332. package/node/hooks/features/rows/useGridRows.js +1 -1
  333. package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
  334. package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
  335. package/node/hooks/features/virtualization/useGridVirtualScroller.js +94 -52
  336. package/node/hooks/utils/useGridApiRef.js +3 -1
  337. package/node/hooks/utils/useGridVisibleRows.js +3 -28
  338. package/node/index.js +1 -1
  339. package/node/internals/constants.js +9 -2
  340. package/node/internals/index.js +12 -0
  341. package/node/internals/utils/attachPinnedStyle.js +15 -0
  342. package/node/internals/utils/getPinnedCellOffset.js +6 -7
  343. package/node/internals/utils/index.js +11 -0
  344. package/node/locales/arSD.js +2 -0
  345. package/node/locales/beBY.js +1 -0
  346. package/node/locales/bgBG.js +2 -0
  347. package/node/locales/csCZ.js +2 -0
  348. package/node/locales/daDK.js +2 -0
  349. package/node/locales/deDE.js +2 -0
  350. package/node/locales/elGR.js +2 -0
  351. package/node/locales/esES.js +2 -0
  352. package/node/locales/faIR.js +7 -6
  353. package/node/locales/fiFI.js +2 -0
  354. package/node/locales/frFR.js +2 -0
  355. package/node/locales/heIL.js +2 -0
  356. package/node/locales/hrHR.js +2 -0
  357. package/node/locales/huHU.js +2 -0
  358. package/node/locales/isIS.js +2 -0
  359. package/node/locales/itIT.js +2 -0
  360. package/node/locales/jaJP.js +2 -0
  361. package/node/locales/koKR.js +2 -0
  362. package/node/locales/nbNO.js +2 -0
  363. package/node/locales/nlNL.js +2 -0
  364. package/node/locales/nnNO.js +2 -0
  365. package/node/locales/plPL.js +2 -0
  366. package/node/locales/ptBR.js +2 -0
  367. package/node/locales/ptPT.js +2 -0
  368. package/node/locales/roRO.js +2 -0
  369. package/node/locales/ruRU.js +2 -0
  370. package/node/locales/skSK.js +2 -0
  371. package/node/locales/svSE.js +2 -0
  372. package/node/locales/trTR.js +2 -0
  373. package/node/locales/ukUA.js +2 -0
  374. package/node/locales/urPK.js +11 -10
  375. package/node/locales/viVN.js +2 -0
  376. package/node/locales/zhCN.js +2 -0
  377. package/node/locales/zhHK.js +2 -0
  378. package/node/locales/zhTW.js +2 -0
  379. package/node/material/index.js +2 -1
  380. package/node/utils/cellBorderUtils.js +5 -5
  381. package/node/utils/domUtils.js +7 -2
  382. package/node/utils/isJSDOM.js +7 -0
  383. package/node/utils/rtlFlipSide.js +29 -0
  384. package/package.json +2 -2
  385. package/utils/cellBorderUtils.d.ts +3 -3
  386. package/utils/cellBorderUtils.js +5 -5
  387. package/utils/createSelector.d.ts +2 -2
  388. package/utils/domUtils.js +7 -2
  389. package/utils/getPublicApiRef.d.ts +2 -1
  390. package/utils/isJSDOM.d.ts +1 -0
  391. package/utils/isJSDOM.js +1 -0
  392. package/utils/rtlFlipSide.d.ts +2 -0
  393. package/utils/rtlFlipSide.js +22 -0
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  /**
@@ -10,4 +10,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
10
10
  * @requires useGridScroll (method) - can be after
11
11
  * @requires useGridColumnSpanning (method) - can be after
12
12
  */
13
- export declare const useGridKeyboardNavigation: (apiRef: React.RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "experimentalFeatures" | "signature" | "headerFilters" | "unstable_listView">) => void;
13
+ export declare const useGridKeyboardNavigation: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "experimentalFeatures" | "signature" | "headerFilters" | "unstable_listView">) => void;
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridColDef, GridRowEntry, GridRowId } from '../../../models';
3
3
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
4
- export declare function enrichPageRowsWithPinnedRows(apiRef: React.MutableRefObject<GridApiCommunity>, rows: GridRowEntry[]): GridRowEntry<import("../../..").GridValidRowModel>[];
4
+ export declare function enrichPageRowsWithPinnedRows(apiRef: RefObject<GridApiCommunity>, rows: GridRowEntry[]): GridRowEntry<import("../../..").GridValidRowModel>[];
5
5
  export declare const getLeftColumnIndex: ({ currentColIndex, firstColIndex, lastColIndex, isRtl, }: {
6
6
  currentColIndex: number;
7
7
  firstColIndex: number;
@@ -14,4 +14,4 @@ export declare const getRightColumnIndex: ({ currentColIndex, firstColIndex, las
14
14
  lastColIndex: number;
15
15
  isRtl: boolean;
16
16
  }) => number | null;
17
- export declare function findNonRowSpannedCell(apiRef: React.MutableRefObject<GridApiCommunity>, rowId: GridRowId, field: GridColDef['field'], rowSpanScanDirection: 'up' | 'down'): GridRowId;
17
+ export declare function findNonRowSpannedCell(apiRef: RefObject<GridApiCommunity>, rowId: GridRowId, field: GridColDef['field'], rowSpanScanDirection: 'up' | 'down'): GridRowId;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import type { GridListColDef } from '../../../models/colDef/gridColDef';
3
3
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
4
4
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
@@ -7,4 +7,4 @@ export type GridListViewState = (GridListColDef & {
7
7
  computedWidth: number;
8
8
  }) | undefined;
9
9
  export declare const listViewStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_listColumn'>>;
10
- export declare function useGridListView(apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView' | 'unstable_listColumn'>): void;
10
+ export declare function useGridListView(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView' | 'unstable_listColumn'>): void;
@@ -1,8 +1,11 @@
1
+ import { GridFeatureMode } from '../../../models/gridFeatureMode';
1
2
  import { GridPaginationMeta, GridPaginationModel } from '../../../models/gridPaginationProps';
2
3
  export interface GridPaginationState {
3
4
  paginationModel: GridPaginationModel;
4
5
  rowCount: number;
5
6
  meta: GridPaginationMeta;
7
+ enabled: boolean;
8
+ paginationMode: GridFeatureMode;
6
9
  }
7
10
  export interface GridPaginationInitialState {
8
11
  paginationModel?: Partial<GridPaginationModel>;
@@ -1,9 +1,15 @@
1
1
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
2
+ import { GridValidRowModel } from '../../../models/gridRows';
2
3
  /**
3
4
  * @category Pagination
4
5
  * @ignore - do not document.
5
6
  */
6
7
  export declare const gridPaginationSelector: (state: GridStateCommunity) => import("./gridPaginationInterfaces").GridPaginationState;
8
+ /**
9
+ * @category Pagination
10
+ * @ignore - do not document.
11
+ */
12
+ export declare const gridPaginationEnabledClientSideSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridPaginationInterfaces").GridPaginationState, boolean>;
7
13
  /**
8
14
  * Get the pagination model
9
15
  * @category Pagination
@@ -38,7 +44,7 @@ export declare const gridPageCountSelector: import("../../..").OutputSelector<Gr
38
44
  * Get the index of the first and the last row to include in the current page if the pagination is enabled.
39
45
  * @category Pagination
40
46
  */
41
- export declare const gridPaginationRowRangeSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[], {
47
+ export declare const gridPaginationRowRangeSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<GridValidRowModel>[], {
42
48
  firstRowIndex: number;
43
49
  lastRowIndex: number;
44
50
  } | null>;
@@ -49,7 +55,7 @@ export declare const gridPaginationRowRangeSelector: import("../../..").OutputSe
49
55
  export declare const gridPaginatedVisibleSortedGridRowEntriesSelector: import("../../..").OutputSelector<GridStateCommunity, {
50
56
  firstRowIndex: number;
51
57
  lastRowIndex: number;
52
- } | null, import("../../..").GridRowEntry<import("../../..").GridValidRowModel>[]>;
58
+ } | null, import("../../..").GridRowEntry<GridValidRowModel>[]>;
53
59
  /**
54
60
  * Get the id of each row to include in the current page if the pagination is enabled.
55
61
  * @category Pagination
@@ -58,3 +64,16 @@ export declare const gridPaginatedVisibleSortedGridRowIdsSelector: import("../..
58
64
  firstRowIndex: number;
59
65
  lastRowIndex: number;
60
66
  } | null, import("../../..").GridRowId[]>;
67
+ /**
68
+ * Get the rows, range and rowIndex lookup map after filtering and sorting.
69
+ * Does not contain the collapsed children.
70
+ * @category Pagination
71
+ */
72
+ export declare const gridVisibleRowsSelector: import("../../..").OutputSelector<GridStateCommunity, import("../../..").GridRowEntry<GridValidRowModel>[], {
73
+ rows: import("../../..").GridRowEntry<GridValidRowModel>[];
74
+ range: {
75
+ firstRowIndex: number;
76
+ lastRowIndex: number;
77
+ } | null;
78
+ rowToIndexMap: Map<GridValidRowModel, number>;
79
+ }>;
@@ -10,6 +10,12 @@ const ALL_RESULTS_PAGE_VALUE = -1;
10
10
  */
11
11
  export const gridPaginationSelector = state => state.pagination;
12
12
 
13
+ /**
14
+ * @category Pagination
15
+ * @ignore - do not document.
16
+ */
17
+ export const gridPaginationEnabledClientSideSelector = createSelector(gridPaginationSelector, pagination => pagination.enabled && pagination.paginationMode === 'client');
18
+
13
19
  /**
14
20
  * Get the pagination model
15
21
  * @category Pagination
@@ -50,7 +56,10 @@ export const gridPageCountSelector = createSelector(gridPaginationModelSelector,
50
56
  * Get the index of the first and the last row to include in the current page if the pagination is enabled.
51
57
  * @category Pagination
52
58
  */
53
- export const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {
59
+ export const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationEnabledClientSideSelector, gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (clientSidePaginationEnabled, paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {
60
+ if (!clientSidePaginationEnabled) {
61
+ return null;
62
+ }
54
63
  const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;
55
64
  const topLevelFirstRowIndex = Math.min(paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1);
56
65
  const topLevelLastRowIndex = paginationModel.pageSize === ALL_RESULTS_PAGE_VALUE ? visibleTopLevelRowCount - 1 : Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);
@@ -112,4 +121,33 @@ export const gridPaginatedVisibleSortedGridRowIdsSelector = createSelectorMemoiz
112
121
  return [];
113
122
  }
114
123
  return visibleSortedRowIds.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);
124
+ });
125
+
126
+ /**
127
+ * Get the rows, range and rowIndex lookup map after filtering and sorting.
128
+ * Does not contain the collapsed children.
129
+ * @category Pagination
130
+ */
131
+ export const gridVisibleRowsSelector = createSelectorMemoized(gridPaginationEnabledClientSideSelector, gridPaginationRowRangeSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridExpandedSortedRowEntriesSelector, (clientPaginationEnabled, paginationRowRange, paginationRows, expandedSortedRowEntries) => {
132
+ if (clientPaginationEnabled) {
133
+ return {
134
+ rows: paginationRows,
135
+ range: paginationRowRange,
136
+ rowToIndexMap: paginationRows.reduce((lookup, row, index) => {
137
+ lookup.set(row.model, index);
138
+ return lookup;
139
+ }, new Map())
140
+ };
141
+ }
142
+ return {
143
+ rows: expandedSortedRowEntries,
144
+ range: expandedSortedRowEntries.length === 0 ? null : {
145
+ firstRowIndex: 0,
146
+ lastRowIndex: expandedSortedRowEntries.length - 1
147
+ },
148
+ rowToIndexMap: expandedSortedRowEntries.reduce((lookup, row, index) => {
149
+ lookup.set(row.model, index);
150
+ return lookup;
151
+ }, new Map())
152
+ };
115
153
  });
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
5
- export declare const paginationStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'paginationModel' | 'rowCount' | 'initialState' | 'autoPageSize' | 'signature' | 'paginationMeta'>>;
5
+ export declare const paginationStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'paginationModel' | 'rowCount' | 'initialState' | 'autoPageSize' | 'signature' | 'paginationMeta' | 'pagination' | 'paginationMode'>>;
6
6
  /**
7
7
  * @requires useGridFilter (state)
8
8
  * @requires useGridDimensions (event) - can be after
9
9
  */
10
- export declare const useGridPagination: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
10
+ export declare const useGridPagination: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
@@ -9,11 +9,13 @@ export const paginationStateInitializer = (state, props) => {
9
9
  const rowCount = props.rowCount ?? props.initialState?.pagination?.rowCount;
10
10
  const meta = props.paginationMeta ?? props.initialState?.pagination?.meta ?? {};
11
11
  return _extends({}, state, {
12
- pagination: {
12
+ pagination: _extends({}, state.pagination, {
13
13
  paginationModel,
14
14
  rowCount,
15
- meta
16
- }
15
+ meta,
16
+ enabled: props.pagination === true,
17
+ paginationMode: props.paginationMode
18
+ })
17
19
  });
18
20
  };
19
21
 
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
- export declare const useGridPaginationMeta: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationMeta" | "initialState" | "paginationMode" | "onPaginationMetaChange">) => void;
4
+ export declare const useGridPaginationMeta: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationMeta" | "initialState" | "paginationMode" | "onPaginationMetaChange">) => void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridPaginationState } from './gridPaginationInterfaces';
@@ -8,4 +8,4 @@ export declare const getDerivedPaginationModel: (paginationState: GridPagination
8
8
  * @requires useGridFilter (state)
9
9
  * @requires useGridDimensions (event) - can be after
10
10
  */
11
- export declare const useGridPaginationModel: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationModel" | "onPaginationModelChange" | "autoPageSize" | "initialState" | "paginationMode" | "signature" | "rowHeight">) => void;
11
+ export declare const useGridPaginationModel: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "paginationModel" | "onPaginationModelChange" | "autoPageSize" | "initialState" | "paginationMode" | "pagination" | "signature" | "rowHeight">) => void;
@@ -155,12 +155,34 @@ export const useGridPaginationModel = (apiRef, props) => {
155
155
  /**
156
156
  * EFFECTS
157
157
  */
158
+ const isFirstRender = React.useRef(true);
158
159
  React.useEffect(() => {
160
+ if (isFirstRender.current) {
161
+ isFirstRender.current = false;
162
+ return;
163
+ }
164
+ if (!props.pagination) {
165
+ return;
166
+ }
159
167
  apiRef.current.setState(state => _extends({}, state, {
160
168
  pagination: _extends({}, state.pagination, {
161
169
  paginationModel: getDerivedPaginationModel(state.pagination, props.signature, props.paginationModel)
162
170
  })
163
171
  }));
164
- }, [apiRef, props.paginationModel, props.paginationMode, props.signature]);
172
+ }, [apiRef, props.paginationModel, props.signature, props.pagination]);
173
+ React.useEffect(() => {
174
+ apiRef.current.setState(state => {
175
+ const isEnabled = props.pagination === true;
176
+ if (state.pagination.paginationMode === props.paginationMode || state.pagination.enabled === isEnabled) {
177
+ return state;
178
+ }
179
+ return _extends({}, state, {
180
+ pagination: _extends({}, state.pagination, {
181
+ paginationMode: props.paginationMode,
182
+ enabled: props.pagination === true
183
+ })
184
+ });
185
+ });
186
+ }, [apiRef, props.paginationMode, props.pagination]);
165
187
  React.useEffect(handleUpdateAutoPageSize, [handleUpdateAutoPageSize]);
166
188
  };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
- export declare const useGridRowCount: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rowCount" | "initialState" | "paginationMode" | "onRowCountChange">) => void;
4
+ export declare const useGridRowCount: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rowCount" | "initialState" | "paginationMode" | "onRowCountChange">) => void;
@@ -1,2 +1,3 @@
1
1
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
2
2
  export declare const gridPreferencePanelStateSelector: (state: GridStateCommunity) => import("./gridPreferencePanelState").GridPreferencePanelState;
3
+ export declare const gridPreferencePanelSelectorWithLabel: import("../../..").OutputSelector<GridStateCommunity, string, boolean>;
@@ -1 +1,8 @@
1
- export const gridPreferencePanelStateSelector = state => state.preferencePanel;
1
+ import { createSelector } from "../../../utils/createSelector.js";
2
+ export const gridPreferencePanelStateSelector = state => state.preferencePanel;
3
+ export const gridPreferencePanelSelectorWithLabel = createSelector(gridPreferencePanelStateSelector, (panel, labelId) => {
4
+ if (panel.open && panel.labelId === labelId) {
5
+ return true;
6
+ }
7
+ return false;
8
+ });
@@ -1,3 +1,3 @@
1
- export * from './gridPreferencePanelSelector';
1
+ export { gridPreferencePanelStateSelector } from './gridPreferencePanelSelector';
2
2
  export * from './gridPreferencePanelState';
3
3
  export * from './gridPreferencePanelsValue';
@@ -1,3 +1,3 @@
1
- export * from "./gridPreferencePanelSelector.js";
1
+ export { gridPreferencePanelStateSelector } from "./gridPreferencePanelSelector.js";
2
2
  export * from "./gridPreferencePanelState.js";
3
3
  export * from "./gridPreferencePanelsValue.js";
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
@@ -6,4 +6,4 @@ export declare const preferencePanelStateInitializer: GridStateInitializer<Pick<
6
6
  /**
7
7
  * TODO: Add a single `setPreferencePanel` method to avoid multiple `setState`
8
8
  */
9
- export declare const useGridPreferencesPanel: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "initialState">) => void;
9
+ export declare const useGridPreferencesPanel: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "initialState">) => void;
@@ -15,42 +15,29 @@ export const preferencePanelStateInitializer = (state, props) => _extends({}, st
15
15
  */
16
16
  export const useGridPreferencesPanel = (apiRef, props) => {
17
17
  const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
18
- const hideTimeout = React.useRef(undefined);
19
- const immediateTimeout = React.useRef(undefined);
20
18
 
21
19
  /**
22
20
  * API METHODS
23
21
  */
24
22
  const hidePreferences = React.useCallback(() => {
25
- logger.debug('Hiding Preferences Panel');
26
- const preferencePanelState = gridPreferencePanelStateSelector(apiRef.current.state);
27
- if (preferencePanelState.openedPanelValue) {
23
+ apiRef.current.setState(state => {
24
+ if (!state.preferencePanel.open) {
25
+ return state;
26
+ }
27
+ logger.debug('Hiding Preferences Panel');
28
+ const preferencePanelState = gridPreferencePanelStateSelector(state);
28
29
  apiRef.current.publishEvent('preferencePanelClose', {
29
30
  openedPanelValue: preferencePanelState.openedPanelValue
30
31
  });
31
- }
32
- apiRef.current.setState(state => _extends({}, state, {
33
- preferencePanel: {
34
- open: false
35
- }
36
- }));
37
- apiRef.current.forceUpdate();
32
+ return _extends({}, state, {
33
+ preferencePanel: {
34
+ open: false
35
+ }
36
+ });
37
+ });
38
38
  }, [apiRef, logger]);
39
-
40
- // This is to prevent the preferences from closing when you open a select box or another panel,
41
- // The issue is in MUI core V4 => Fixed in V5
42
- const doNotHidePanel = React.useCallback(() => {
43
- immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);
44
- }, []);
45
-
46
- // This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,
47
- // we can cancel the action if the trigger element still need the panel...
48
- const hidePreferencesDelayed = React.useCallback(() => {
49
- hideTimeout.current = setTimeout(hidePreferences, 100);
50
- }, [hidePreferences]);
51
39
  const showPreferences = React.useCallback((newValue, panelId, labelId) => {
52
40
  logger.debug('Opening Preferences Panel');
53
- doNotHidePanel();
54
41
  apiRef.current.setState(state => _extends({}, state, {
55
42
  preferencePanel: _extends({}, state.preferencePanel, {
56
43
  open: true,
@@ -62,11 +49,10 @@ export const useGridPreferencesPanel = (apiRef, props) => {
62
49
  apiRef.current.publishEvent('preferencePanelOpen', {
63
50
  openedPanelValue: newValue
64
51
  });
65
- apiRef.current.forceUpdate();
66
- }, [logger, doNotHidePanel, apiRef]);
52
+ }, [logger, apiRef]);
67
53
  useGridApiMethod(apiRef, {
68
54
  showPreferences,
69
- hidePreferences: hidePreferencesDelayed
55
+ hidePreferences
70
56
  }, 'public');
71
57
 
72
58
  /**
@@ -99,14 +85,4 @@ export const useGridPreferencesPanel = (apiRef, props) => {
99
85
  }, [apiRef]);
100
86
  useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
101
87
  useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
102
-
103
- /**
104
- * EFFECTS
105
- */
106
- React.useEffect(() => {
107
- return () => {
108
- clearTimeout(hideTimeout.current);
109
- clearTimeout(immediateTimeout.current);
110
- };
111
- }, []);
112
88
  };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
3
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
@@ -9,4 +9,4 @@ export declare const rowSelectionStateInitializer: GridStateInitializer<Pick<Dat
9
9
  * @requires useGridFocus (state) - can be after
10
10
  * @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)
11
11
  */
12
- export declare const useGridRowSelection: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
12
+ export declare const useGridRowSelection: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "checkboxSelection" | "rowSelectionModel" | "onRowSelectionModelChange" | "disableMultipleRowSelection" | "disableRowSelectionOnClick" | "isRowSelectable" | "checkboxSelectionVisibleOnly" | "pagination" | "paginationMode" | "filterMode" | "classes" | "keepNonExistentRowsSelected" | "rowSelection" | "rowSelectionPropagation" | "signature">) => void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
3
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
4
- export declare const useGridRowSelectionPreProcessors: (apiRef: React.RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
4
+ export declare const useGridRowSelectionPreProcessors: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
@@ -1,3 +1,4 @@
1
+ import { RefObject } from '@mui/x-internals/types';
1
2
  import type { GridRowId, GridRowTreeConfig } from '../../../models/gridRows';
2
3
  import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
4
  import type { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
@@ -8,5 +9,5 @@ export declare function getCheckboxPropsSelector(groupId: GridRowId, autoSelectP
8
9
  isChecked: boolean;
9
10
  }>;
10
11
  export declare function isMultipleRowSelectionEnabled(props: Pick<DataGridProcessedProps, 'signature' | 'disableMultipleRowSelection' | 'checkboxSelection'>): boolean;
11
- export declare const findRowsToSelect: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, selectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, addRow: (rowId: GridRowId) => void) => void;
12
- export declare const findRowsToDeselect: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, deselectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, removeRow: (rowId: GridRowId) => void) => void;
12
+ export declare const findRowsToSelect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, selectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, addRow: (rowId: GridRowId) => void) => void;
13
+ export declare const findRowsToDeselect: (apiRef: RefObject<GridPrivateApiCommunity>, tree: GridRowTreeConfig, deselectedRow: GridRowId, autoSelectDescendants: boolean, autoSelectParents: boolean, removeRow: (rowId: GridRowId) => void) => void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import type { GridRenderContext } from '../../../models';
3
3
  import type { GridValidRowModel } from '../../../models/gridRows';
4
4
  import type { GridColDef } from '../../../models/colDef';
@@ -7,4 +7,4 @@ import type { RowRange } from './useGridRowSpanning';
7
7
  export declare function getUnprocessedRange(testRange: RowRange, processedRange: RowRange): RowRange | null;
8
8
  export declare function isRowContextInitialized(renderContext: GridRenderContext): boolean;
9
9
  export declare function isRowRangeUpdated(range1: RowRange, range2: RowRange): boolean;
10
- export declare const getCellValue: (row: GridValidRowModel, colDef: GridColDef, apiRef: React.MutableRefObject<GridApiCommunity>) => any;
10
+ export declare const getCellValue: (row: GridValidRowModel, colDef: GridColDef, apiRef: RefObject<GridApiCommunity>) => any;
@@ -15,7 +15,7 @@ export const gridRowMaximumTreeDepthSelector = createSelectorMemoized(gridRowsSt
15
15
  if (entries.length === 0) {
16
16
  return 1;
17
17
  }
18
- return entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] + 1;
18
+ return (entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] ?? 0) + 1;
19
19
  });
20
20
  export const gridDataRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIds);
21
21
 
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridAutoGeneratedGroupNode, GridAutoGeneratedPinnedRowNode, GridFooterNode, GridGroupNode, GridRowId, GridRowIdGetter, GridRowModel, GridRowModelUpdate, GridRowTreeConfig, GridSkeletonRowNode, GridTreeNode } from '../../../models';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridApiCommunity, GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
@@ -20,7 +20,7 @@ export declare const getTopLevelRowCount: ({ tree, rowCountProp, }: {
20
20
  rowCountProp: DataGridProcessedProps["rowCount"];
21
21
  }) => number;
22
22
  export declare const getRowsStateFromCache: ({ apiRef, rowCountProp, loadingProp, previousTree, previousTreeDepths, previousGroupsToFetch, }: Pick<GridRowTreeCreationParams, "previousTree" | "previousTreeDepths" | "previousGroupsToFetch"> & {
23
- apiRef: React.MutableRefObject<GridPrivateApiCommunity>;
23
+ apiRef: RefObject<GridPrivateApiCommunity>;
24
24
  rowCountProp: number | undefined;
25
25
  loadingProp: boolean | undefined;
26
26
  }) => GridRowsState;
@@ -33,12 +33,12 @@ export declare const updateCacheWithNewRows: ({ previousCache, getRowId, updates
33
33
  updates: GridRowModelUpdate[];
34
34
  groupKeys?: string[];
35
35
  }) => GridRowsInternalCache;
36
- export declare function calculatePinnedRowsHeight(apiRef: React.MutableRefObject<GridApiCommunity>): {
36
+ export declare function calculatePinnedRowsHeight(apiRef: RefObject<GridApiCommunity>): {
37
37
  top: number;
38
38
  bottom: number;
39
39
  };
40
40
  export declare const minimalContentHeight = "var(--DataGrid-overlayHeight, calc(var(--height) * 2))";
41
- export declare function computeRowsUpdates(apiRef: React.MutableRefObject<GridApiCommunity>, updates: GridRowModelUpdate[], getRowId: DataGridProcessedProps['getRowId']): GridRowModelUpdate[];
41
+ export declare function computeRowsUpdates(apiRef: RefObject<GridApiCommunity>, updates: GridRowModelUpdate[], getRowId: DataGridProcessedProps['getRowId']): GridRowModelUpdate[];
42
42
  export declare const getValidRowHeight: (rowHeightProp: any, defaultRowHeight: number, warningMessage: string) => number;
43
43
  export declare const rowHeightWarning: string;
44
44
  export declare const getRowHeightWarning: string;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  export declare class MissingRowIdError extends Error {
@@ -11,4 +11,4 @@ export declare class MissingRowIdError extends Error {
11
11
  * TODO: Impossible priority - useGridEditing also needs to be after useGridParamsApi
12
12
  * TODO: Impossible priority - useGridFocus also needs to be after useGridParamsApi
13
13
  */
14
- export declare function useGridParamsApi(apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView'>): void;
14
+ export declare function useGridParamsApi(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_listView'>): void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import type { GridColDef } from '../../../models/colDef';
3
3
  import type { GridRowId } from '../../../models/gridRows';
4
4
  import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
@@ -24,4 +24,4 @@ export type RowRange = {
24
24
  * @requires filterStateInitializer (method) - should be initialized before
25
25
  */
26
26
  export declare const rowSpanningStateInitializer: GridStateInitializer;
27
- export declare const useGridRowSpanning: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rowSpanning" | "pagination" | "paginationMode">) => void;
27
+ export declare const useGridRowSpanning: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rowSpanning" | "pagination" | "paginationMode">) => void;
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
3
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
5
5
  export declare const rowsStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'unstable_dataSource' | 'rows' | 'rowCount' | 'getRowId' | 'loading'>>;
6
- export declare const useGridRows: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "unstable_dataSource">) => void;
6
+ export declare const useGridRows: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "unstable_dataSource">) => void;
@@ -6,7 +6,7 @@ import { useGridLogger } from "../../utils/useGridLogger.js";
6
6
  import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
7
7
  import { useTimeout } from "../../utils/useTimeout.js";
8
8
  import { GridSignature, useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
9
- import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
9
+ import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
10
10
  import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
11
11
  import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
12
12
  import { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutogeneratedRowNode, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel, computeRowsUpdates } from "./gridRowsUtils.js";
@@ -40,7 +40,7 @@ export const useGridRows = (apiRef, props) => {
40
40
  }
41
41
  }
42
42
  const logger = useGridLogger(apiRef, 'useGridRows');
43
- const currentPage = useGridVisibleRows(apiRef, props);
43
+ const currentPage = getVisibleRows(apiRef);
44
44
  const lastUpdateMs = React.useRef(Date.now());
45
45
  const lastRowCount = React.useRef(props.rowCount);
46
46
  const timeout = useTimeout();
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  import { GridStateInitializer } from '../../utils/useGridInitializeState';
@@ -7,4 +7,4 @@ export declare const rowsMetaStateInitializer: GridStateInitializer;
7
7
  * @requires useGridPageSize (method)
8
8
  * @requires useGridPage (method)
9
9
  */
10
- export declare const useGridRowsMeta: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "getRowHeight" | "getEstimatedRowHeight" | "getRowSpacing" | "pagination" | "paginationMode" | "rowHeight">) => void;
10
+ export declare const useGridRowsMeta: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "getRowHeight" | "getEstimatedRowHeight" | "getRowSpacing" | "pagination" | "paginationMode" | "rowHeight">) => void;
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
- export declare const useGridRowsPreProcessors: (apiRef: React.RefObject<GridPrivateApiCommunity>) => void;
3
+ export declare const useGridRowsPreProcessors: (apiRef: RefObject<GridPrivateApiCommunity>) => void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
3
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
4
4
  /**
@@ -9,4 +9,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
9
9
  * @requires useGridFilter (state)
10
10
  * @requires useGridColumnSpanning (method)
11
11
  */
12
- export declare const useGridScroll: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "unstable_listView">) => void;
12
+ export declare const useGridScroll: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "unstable_listView">) => void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridSortingModelApplier } from './gridSortingState';
3
3
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
4
4
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
@@ -8,10 +8,10 @@ export declare const mergeStateWithSortModel: (sortModel: GridSortModel, disable
8
8
  /**
9
9
  * Generates a method to easily sort a list of rows according to the current sort model.
10
10
  * @param {GridSortModel} sortModel The model with which we want to sort the rows.
11
- * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
11
+ * @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
12
12
  * @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.
13
13
  */
14
- export declare const buildAggregatedSortingApplier: (sortModel: GridSortModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridSortingModelApplier | null;
14
+ export declare const buildAggregatedSortingApplier: (sortModel: GridSortModel, apiRef: RefObject<GridApiCommunity>) => GridSortingModelApplier | null;
15
15
  export declare const getNextGridSortDirection: (sortingOrder: readonly GridSortDirection[], current?: GridSortDirection) => GridSortDirection;
16
16
  export declare const gridStringOrNumberComparator: GridComparatorFn;
17
17
  export declare const gridNumberComparator: GridComparatorFn;
@@ -19,7 +19,7 @@ const isDesc = direction => direction === 'desc';
19
19
  /**
20
20
  * Transform an item of the sorting model into a method comparing two rows.
21
21
  * @param {GridSortItem} sortItem The sort item we want to apply.
22
- * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
22
+ * @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
23
23
  * @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
24
24
  */
25
25
  const parseSortItem = (sortItem, apiRef) => {
@@ -72,7 +72,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
72
72
  /**
73
73
  * Generates a method to easily sort a list of rows according to the current sort model.
74
74
  * @param {GridSortModel} sortModel The model with which we want to sort the rows.
75
- * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
75
+ * @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
76
76
  * @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.
77
77
  */
78
78
  export const buildAggregatedSortingApplier = (sortModel, apiRef) => {