@mui/x-data-grid 6.4.0 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/CHANGELOG.md +134 -2
  2. package/DataGrid/DataGrid.js +10 -3
  3. package/DataGrid/useDataGridProps.js +5 -12
  4. package/README.md +2 -2
  5. package/colDef/gridNumericOperators.js +0 -6
  6. package/components/GridColumnHeaders.js +4 -9
  7. package/components/GridHeader.d.ts +2 -2
  8. package/components/base/GridBody.d.ts +1 -1
  9. package/components/base/GridFooterPlaceholder.d.ts +2 -2
  10. package/components/base/GridOverlays.d.ts +2 -2
  11. package/components/cell/GridActionsCell.d.ts +3 -3
  12. package/components/cell/GridActionsCell.js +3 -3
  13. package/components/cell/GridBooleanCell.d.ts +1 -1
  14. package/components/cell/GridEditBooleanCell.d.ts +2 -2
  15. package/components/cell/GridEditDateCell.d.ts +2 -2
  16. package/components/cell/GridEditInputCell.d.ts +1 -1
  17. package/components/cell/GridEditInputCell.js +4 -1
  18. package/components/cell/GridEditSingleSelectCell.d.ts +3 -3
  19. package/components/cell/GridEditSingleSelectCell.js +5 -5
  20. package/components/cell/GridSkeletonCell.d.ts +1 -1
  21. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  22. package/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  23. package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -2
  24. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
  25. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  26. package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -2
  27. package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
  28. package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
  29. package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
  30. package/components/containers/GridRoot.js +1 -3
  31. package/components/index.d.ts +0 -1
  32. package/components/index.js +1 -2
  33. package/components/menu/GridMenu.d.ts +1 -1
  34. package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
  35. package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -2
  36. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -2
  37. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -2
  38. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -2
  39. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -2
  40. package/components/panel/GridColumnsPanel.d.ts +2 -2
  41. package/components/panel/GridPanelContent.d.ts +1 -1
  42. package/components/panel/GridPanelFooter.d.ts +1 -1
  43. package/components/panel/GridPanelHeader.d.ts +1 -1
  44. package/components/panel/GridPreferencesPanel.js +3 -1
  45. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
  46. package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  47. package/components/panel/filterPanel/GridFilterInputDate.d.ts +9 -2
  48. package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  49. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  50. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
  51. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +9 -2
  52. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
  53. package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
  54. package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  55. package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
  56. package/components/panel/filterPanel/GridFilterPanel.js +1 -1
  57. package/components/panel/filterPanel/index.d.ts +3 -1
  58. package/components/panel/filterPanel/index.js +2 -1
  59. package/components/toolbar/GridToolbarColumnsButton.js +11 -6
  60. package/components/toolbar/GridToolbarDensitySelector.js +2 -2
  61. package/components/toolbar/GridToolbarExport.d.ts +2 -2
  62. package/components/toolbar/GridToolbarExportContainer.js +7 -7
  63. package/components/toolbar/GridToolbarFilterButton.js +11 -4
  64. package/components/toolbar/GridToolbarQuickFilter.d.ts +2 -2
  65. package/constants/localeTextConstants.js +26 -0
  66. package/context/GridContextProvider.d.ts +1 -1
  67. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +10 -2
  68. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  69. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +10 -3
  70. package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  71. package/hooks/features/dimensions/useGridDimensions.js +2 -2
  72. package/hooks/features/editing/useGridEditing.js +0 -3
  73. package/hooks/features/filter/gridFilterSelector.d.ts +2 -2
  74. package/hooks/features/filter/gridFilterSelector.js +2 -2
  75. package/hooks/features/filter/gridFilterState.d.ts +6 -6
  76. package/hooks/features/filter/gridFilterState.js +6 -0
  77. package/hooks/features/filter/useGridFilter.js +29 -9
  78. package/hooks/features/focus/gridFocusState.d.ts +2 -0
  79. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
  80. package/hooks/features/focus/gridFocusStateSelector.js +6 -0
  81. package/hooks/features/focus/useGridFocus.js +55 -9
  82. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
  83. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  84. package/hooks/features/headerFiltering/index.d.ts +1 -0
  85. package/hooks/features/headerFiltering/index.js +1 -0
  86. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
  87. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
  88. package/hooks/features/index.d.ts +1 -0
  89. package/hooks/features/index.js +2 -1
  90. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  91. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  92. package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
  93. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  94. package/hooks/features/rows/useGridRows.js +16 -1
  95. package/hooks/features/rows/useGridRowsMeta.js +11 -12
  96. package/index.js +1 -1
  97. package/internals/index.d.ts +6 -1
  98. package/internals/index.js +4 -0
  99. package/internals/utils/index.d.ts +1 -0
  100. package/internals/utils/index.js +2 -1
  101. package/internals/utils/useProps.d.ts +8 -0
  102. package/internals/utils/useProps.js +33 -0
  103. package/legacy/DataGrid/DataGrid.js +10 -3
  104. package/legacy/DataGrid/useDataGridProps.js +8 -8
  105. package/legacy/colDef/gridNumericOperators.js +0 -6
  106. package/legacy/components/GridColumnHeaders.js +4 -9
  107. package/legacy/components/cell/GridActionsCell.js +3 -3
  108. package/legacy/components/cell/GridEditInputCell.js +4 -1
  109. package/legacy/components/cell/GridEditSingleSelectCell.js +5 -5
  110. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  111. package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  112. package/legacy/components/containers/GridRoot.js +1 -3
  113. package/legacy/components/index.js +1 -2
  114. package/legacy/components/panel/GridPreferencesPanel.js +3 -1
  115. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
  116. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
  117. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -31
  118. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
  119. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
  120. package/legacy/components/panel/filterPanel/index.js +2 -1
  121. package/legacy/components/toolbar/GridToolbarColumnsButton.js +11 -5
  122. package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -2
  123. package/legacy/components/toolbar/GridToolbarExportContainer.js +7 -7
  124. package/legacy/components/toolbar/GridToolbarFilterButton.js +11 -4
  125. package/legacy/constants/localeTextConstants.js +26 -0
  126. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  127. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
  128. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
  129. package/legacy/hooks/features/editing/useGridEditing.js +0 -3
  130. package/legacy/hooks/features/filter/gridFilterSelector.js +4 -4
  131. package/legacy/hooks/features/filter/gridFilterState.js +6 -0
  132. package/legacy/hooks/features/filter/useGridFilter.js +29 -9
  133. package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
  134. package/legacy/hooks/features/focus/useGridFocus.js +58 -9
  135. package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
  136. package/legacy/hooks/features/headerFiltering/index.js +1 -0
  137. package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
  138. package/legacy/hooks/features/index.js +2 -1
  139. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  140. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  141. package/legacy/hooks/features/rows/useGridRows.js +16 -1
  142. package/legacy/hooks/features/rows/useGridRowsMeta.js +12 -20
  143. package/legacy/index.js +1 -1
  144. package/legacy/internals/index.js +4 -0
  145. package/legacy/internals/utils/index.js +2 -1
  146. package/legacy/internals/utils/useProps.js +33 -0
  147. package/legacy/locales/arSD.js +28 -0
  148. package/legacy/locales/beBY.js +28 -0
  149. package/legacy/locales/bgBG.js +28 -0
  150. package/legacy/locales/csCZ.js +36 -8
  151. package/legacy/locales/daDK.js +28 -0
  152. package/legacy/locales/deDE.js +28 -0
  153. package/legacy/locales/elGR.js +27 -0
  154. package/legacy/locales/esES.js +28 -0
  155. package/legacy/locales/faIR.js +28 -0
  156. package/legacy/locales/fiFI.js +28 -0
  157. package/legacy/locales/frFR.js +26 -0
  158. package/legacy/locales/heIL.js +30 -2
  159. package/legacy/locales/huHU.js +28 -0
  160. package/legacy/locales/itIT.js +28 -0
  161. package/legacy/locales/jaJP.js +28 -0
  162. package/legacy/locales/koKR.js +28 -0
  163. package/legacy/locales/nbNO.js +28 -0
  164. package/legacy/locales/nlNL.js +26 -0
  165. package/legacy/locales/plPL.js +28 -0
  166. package/legacy/locales/ptBR.js +28 -0
  167. package/legacy/locales/roRO.js +28 -0
  168. package/legacy/locales/ruRU.js +28 -0
  169. package/legacy/locales/skSK.js +28 -0
  170. package/legacy/locales/svSE.js +28 -0
  171. package/legacy/locales/trTR.js +28 -0
  172. package/legacy/locales/ukUA.js +28 -0
  173. package/legacy/locales/urPK.js +28 -0
  174. package/legacy/locales/viVN.js +27 -0
  175. package/legacy/locales/zhCN.js +28 -0
  176. package/legacy/locales/zhTW.js +28 -0
  177. package/legacy/material/index.js +2 -0
  178. package/legacy/models/api/gridHeaderFilteringApi.js +1 -0
  179. package/legacy/models/gridFilterItem.js +1 -1
  180. package/legacy/models/gridHeaderFilteringModel.js +1 -0
  181. package/legacy/models/index.js +0 -1
  182. package/locales/arSD.js +28 -0
  183. package/locales/beBY.js +28 -0
  184. package/locales/bgBG.js +28 -0
  185. package/locales/csCZ.js +36 -8
  186. package/locales/daDK.js +28 -0
  187. package/locales/deDE.js +28 -0
  188. package/locales/elGR.js +27 -0
  189. package/locales/esES.js +28 -0
  190. package/locales/faIR.js +28 -0
  191. package/locales/fiFI.js +28 -0
  192. package/locales/frFR.js +26 -0
  193. package/locales/heIL.js +30 -2
  194. package/locales/huHU.js +28 -0
  195. package/locales/itIT.js +28 -0
  196. package/locales/jaJP.js +28 -0
  197. package/locales/koKR.js +28 -0
  198. package/locales/nbNO.js +28 -0
  199. package/locales/nlNL.js +26 -0
  200. package/locales/plPL.js +28 -0
  201. package/locales/ptBR.js +28 -0
  202. package/locales/roRO.js +28 -0
  203. package/locales/ruRU.js +28 -0
  204. package/locales/skSK.js +28 -0
  205. package/locales/svSE.js +28 -0
  206. package/locales/trTR.js +28 -0
  207. package/locales/ukUA.js +28 -0
  208. package/locales/urPK.js +28 -0
  209. package/locales/viVN.js +27 -0
  210. package/locales/zhCN.js +28 -0
  211. package/locales/zhTW.js +28 -0
  212. package/material/components/MUISelectOption.d.ts +2 -2
  213. package/material/index.d.ts +3 -66
  214. package/material/index.js +2 -0
  215. package/models/api/gridApiCommon.d.ts +3 -2
  216. package/models/api/gridCoreApi.d.ts +4 -0
  217. package/models/api/gridFilterApi.d.ts +3 -1
  218. package/models/api/gridFocusApi.d.ts +6 -0
  219. package/models/api/gridHeaderFilteringApi.d.ts +30 -0
  220. package/models/api/gridHeaderFilteringApi.js +1 -0
  221. package/models/api/gridLocaleTextApi.d.ts +25 -0
  222. package/models/api/gridPreferencesPanelApi.d.ts +3 -1
  223. package/models/events/gridEventLookup.d.ts +27 -1
  224. package/models/gridFilterItem.d.ts +1 -1
  225. package/models/gridFilterItem.js +1 -1
  226. package/models/gridFilterOperator.d.ts +5 -1
  227. package/models/gridHeaderFilteringModel.d.ts +5 -0
  228. package/models/gridHeaderFilteringModel.js +1 -0
  229. package/models/gridSlotsComponent.d.ts +16 -4
  230. package/models/gridStateCommunity.d.ts +4 -0
  231. package/models/index.d.ts +1 -1
  232. package/models/index.js +0 -1
  233. package/models/props/DataGridProps.d.ts +5 -0
  234. package/modern/DataGrid/DataGrid.js +10 -3
  235. package/modern/DataGrid/useDataGridProps.js +5 -12
  236. package/modern/colDef/gridNumericOperators.js +0 -6
  237. package/modern/components/GridColumnHeaders.js +4 -9
  238. package/modern/components/cell/GridActionsCell.js +3 -3
  239. package/modern/components/cell/GridEditInputCell.js +4 -1
  240. package/modern/components/cell/GridEditSingleSelectCell.js +5 -5
  241. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  242. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  243. package/modern/components/containers/GridRoot.js +1 -3
  244. package/modern/components/index.js +1 -2
  245. package/modern/components/panel/GridPreferencesPanel.js +3 -1
  246. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  247. package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  248. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
  249. package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  250. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
  251. package/modern/components/panel/filterPanel/index.js +2 -1
  252. package/modern/components/toolbar/GridToolbarColumnsButton.js +11 -6
  253. package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
  254. package/modern/components/toolbar/GridToolbarExportContainer.js +7 -7
  255. package/modern/components/toolbar/GridToolbarFilterButton.js +11 -4
  256. package/modern/constants/localeTextConstants.js +26 -0
  257. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  258. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  259. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
  260. package/modern/hooks/features/editing/useGridEditing.js +0 -3
  261. package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
  262. package/modern/hooks/features/filter/gridFilterState.js +6 -0
  263. package/modern/hooks/features/filter/useGridFilter.js +29 -9
  264. package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
  265. package/modern/hooks/features/focus/useGridFocus.js +55 -9
  266. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  267. package/modern/hooks/features/headerFiltering/index.js +1 -0
  268. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
  269. package/modern/hooks/features/index.js +2 -1
  270. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  271. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  272. package/modern/hooks/features/rows/useGridRows.js +16 -1
  273. package/modern/hooks/features/rows/useGridRowsMeta.js +11 -12
  274. package/modern/index.js +1 -1
  275. package/modern/internals/index.js +4 -0
  276. package/modern/internals/utils/index.js +2 -1
  277. package/modern/internals/utils/useProps.js +32 -0
  278. package/modern/locales/arSD.js +28 -0
  279. package/modern/locales/beBY.js +28 -0
  280. package/modern/locales/bgBG.js +28 -0
  281. package/modern/locales/csCZ.js +36 -8
  282. package/modern/locales/daDK.js +28 -0
  283. package/modern/locales/deDE.js +28 -0
  284. package/modern/locales/elGR.js +27 -0
  285. package/modern/locales/esES.js +28 -0
  286. package/modern/locales/faIR.js +28 -0
  287. package/modern/locales/fiFI.js +28 -0
  288. package/modern/locales/frFR.js +26 -0
  289. package/modern/locales/heIL.js +30 -2
  290. package/modern/locales/huHU.js +28 -0
  291. package/modern/locales/itIT.js +28 -0
  292. package/modern/locales/jaJP.js +28 -0
  293. package/modern/locales/koKR.js +28 -0
  294. package/modern/locales/nbNO.js +28 -0
  295. package/modern/locales/nlNL.js +26 -0
  296. package/modern/locales/plPL.js +28 -0
  297. package/modern/locales/ptBR.js +28 -0
  298. package/modern/locales/roRO.js +28 -0
  299. package/modern/locales/ruRU.js +28 -0
  300. package/modern/locales/skSK.js +28 -0
  301. package/modern/locales/svSE.js +28 -0
  302. package/modern/locales/trTR.js +28 -0
  303. package/modern/locales/ukUA.js +28 -0
  304. package/modern/locales/urPK.js +28 -0
  305. package/modern/locales/viVN.js +27 -0
  306. package/modern/locales/zhCN.js +28 -0
  307. package/modern/locales/zhTW.js +28 -0
  308. package/modern/material/index.js +2 -0
  309. package/modern/models/api/gridHeaderFilteringApi.js +1 -0
  310. package/modern/models/gridFilterItem.js +1 -1
  311. package/modern/models/gridHeaderFilteringModel.js +1 -0
  312. package/modern/models/index.js +0 -1
  313. package/node/DataGrid/DataGrid.js +10 -3
  314. package/node/DataGrid/useDataGridProps.js +4 -11
  315. package/node/colDef/gridNumericOperators.js +0 -6
  316. package/node/components/GridColumnHeaders.js +3 -8
  317. package/node/components/cell/GridActionsCell.js +3 -3
  318. package/node/components/cell/GridEditInputCell.js +4 -1
  319. package/node/components/cell/GridEditSingleSelectCell.js +5 -5
  320. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  321. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +12 -3
  322. package/node/components/containers/GridRoot.js +1 -3
  323. package/node/components/index.js +0 -11
  324. package/node/components/panel/GridPreferencesPanel.js +3 -1
  325. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
  326. package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  327. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
  328. package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  329. package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
  330. package/node/components/panel/filterPanel/index.js +26 -8
  331. package/node/components/toolbar/GridToolbarColumnsButton.js +11 -6
  332. package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
  333. package/node/components/toolbar/GridToolbarExportContainer.js +7 -7
  334. package/node/components/toolbar/GridToolbarFilterButton.js +10 -3
  335. package/node/constants/localeTextConstants.js +26 -0
  336. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  337. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  338. package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
  339. package/node/hooks/features/editing/useGridEditing.js +0 -3
  340. package/node/hooks/features/filter/gridFilterSelector.js +2 -2
  341. package/node/hooks/features/filter/gridFilterState.js +6 -0
  342. package/node/hooks/features/filter/useGridFilter.js +30 -10
  343. package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
  344. package/node/hooks/features/focus/useGridFocus.js +55 -9
  345. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
  346. package/node/hooks/features/headerFiltering/index.js +16 -0
  347. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
  348. package/node/hooks/features/index.js +11 -0
  349. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  350. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  351. package/node/hooks/features/rows/useGridRows.js +16 -1
  352. package/node/hooks/features/rows/useGridRowsMeta.js +11 -12
  353. package/node/index.js +1 -1
  354. package/node/internals/index.js +46 -0
  355. package/node/internals/utils/index.js +11 -0
  356. package/node/internals/utils/useProps.js +41 -0
  357. package/node/locales/arSD.js +28 -0
  358. package/node/locales/beBY.js +28 -0
  359. package/node/locales/bgBG.js +28 -0
  360. package/node/locales/csCZ.js +36 -8
  361. package/node/locales/daDK.js +28 -0
  362. package/node/locales/deDE.js +28 -0
  363. package/node/locales/elGR.js +27 -0
  364. package/node/locales/esES.js +28 -0
  365. package/node/locales/faIR.js +28 -0
  366. package/node/locales/fiFI.js +28 -0
  367. package/node/locales/frFR.js +26 -0
  368. package/node/locales/heIL.js +30 -2
  369. package/node/locales/huHU.js +28 -0
  370. package/node/locales/itIT.js +28 -0
  371. package/node/locales/jaJP.js +28 -0
  372. package/node/locales/koKR.js +28 -0
  373. package/node/locales/nbNO.js +28 -0
  374. package/node/locales/nlNL.js +26 -0
  375. package/node/locales/plPL.js +28 -0
  376. package/node/locales/ptBR.js +28 -0
  377. package/node/locales/roRO.js +28 -0
  378. package/node/locales/ruRU.js +28 -0
  379. package/node/locales/skSK.js +28 -0
  380. package/node/locales/svSE.js +28 -0
  381. package/node/locales/trTR.js +28 -0
  382. package/node/locales/ukUA.js +28 -0
  383. package/node/locales/urPK.js +28 -0
  384. package/node/locales/viVN.js +27 -0
  385. package/node/locales/zhCN.js +28 -0
  386. package/node/locales/zhTW.js +28 -0
  387. package/node/material/index.js +2 -0
  388. package/node/models/api/gridHeaderFilteringApi.js +5 -0
  389. package/node/models/gridFilterItem.js +1 -1
  390. package/node/models/gridHeaderFilteringModel.js +5 -0
  391. package/node/models/index.js +0 -11
  392. package/package.json +4 -4
  393. package/components/GridScrollArea.d.ts +0 -10
  394. package/components/GridScrollArea.js +0 -117
  395. package/legacy/components/GridScrollArea.js +0 -119
  396. package/legacy/lib/createDetectElementResize/index.js +0 -145
  397. package/lib/createDetectElementResize/index.d.ts +0 -18
  398. package/lib/createDetectElementResize/index.js +0 -145
  399. package/lib/createDetectElementResize/types.d.ts +0 -9
  400. package/modern/components/GridScrollArea.js +0 -117
  401. package/modern/lib/createDetectElementResize/index.js +0 -145
  402. package/node/components/GridScrollArea.js +0 -126
  403. package/node/lib/createDetectElementResize/index.js +0 -151
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "headerFilterMenu", "isFilterActive", "clearButton", "InputProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -14,7 +14,13 @@ function GridFilterInputValue(props) {
14
14
  applyValue,
15
15
  type,
16
16
  apiRef,
17
- focusElementRef
17
+ focusElementRef,
18
+ tabIndex,
19
+ disabled,
20
+ headerFilterMenu,
21
+ isFilterActive,
22
+ clearButton,
23
+ InputProps
18
24
  } = props,
19
25
  others = _objectWithoutPropertiesLoose(props, _excluded);
20
26
  const filterTimeout = React.useRef();
@@ -46,9 +52,6 @@ function GridFilterInputValue(props) {
46
52
  const itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';
47
53
  setFilterValueState(String(itemValue));
48
54
  }, [item.value]);
49
- const InputProps = applying ? {
50
- endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
51
- } : others.InputProps;
52
55
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
53
56
  id: id,
54
57
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
@@ -57,7 +60,20 @@ function GridFilterInputValue(props) {
57
60
  onChange: onFilterChange,
58
61
  variant: "standard",
59
62
  type: type || 'text',
60
- InputProps: InputProps,
63
+ InputProps: _extends({}, applying || clearButton ? {
64
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
65
+ fontSize: "small",
66
+ color: "action"
67
+ }) : clearButton
68
+ } : {}, headerFilterMenu && isFilterActive ? {
69
+ startAdornment: headerFilterMenu
70
+ } : {}, {
71
+ disabled
72
+ }, InputProps, {
73
+ inputProps: _extends({
74
+ tabIndex
75
+ }, InputProps == null ? void 0 : InputProps.inputProps)
76
+ }),
61
77
  InputLabelProps: {
62
78
  shrink: true
63
79
  },
@@ -73,7 +89,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
73
89
  current: PropTypes.object.isRequired
74
90
  }).isRequired,
75
91
  applyValue: PropTypes.func.isRequired,
92
+ clearButton: PropTypes.node,
76
93
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
+ headerFilterMenu: PropTypes.node,
95
+ /**
96
+ * It is `true` if the filter either has a value or an operator with no value
97
+ * required is selected (e.g. `isEmpty`)
98
+ */
99
+ isFilterActive: PropTypes.bool,
77
100
  item: PropTypes.shape({
78
101
  field: PropTypes.string.isRequired,
79
102
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -29,5 +29,6 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
29
29
  */
30
30
  children?: React.ReactNode;
31
31
  }
32
+ declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
32
33
  declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
33
- export { GridFilterPanel };
34
+ export { GridFilterPanel, getGridFilter };
@@ -209,4 +209,4 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
209
209
  */
210
210
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
211
211
  } : void 0;
212
- export { GridFilterPanel };
212
+ export { GridFilterPanel, getGridFilter };
@@ -2,7 +2,9 @@ export * from './GridFilterForm';
2
2
  export * from './GridFilterInputValue';
3
3
  export * from './GridFilterInputDate';
4
4
  export * from './GridFilterInputSingleSelect';
5
+ export * from './GridFilterInputBoolean';
5
6
  export * from './GridFilterInputValueProps';
6
- export * from './GridFilterPanel';
7
+ export { GridFilterPanel } from './GridFilterPanel';
8
+ export type { GetColumnForNewFilterArgs } from './GridFilterPanel';
7
9
  export * from './GridFilterInputMultipleValue';
8
10
  export * from './GridFilterInputMultipleSingleSelect';
@@ -2,7 +2,8 @@ export * from './GridFilterForm';
2
2
  export * from './GridFilterInputValue';
3
3
  export * from './GridFilterInputDate';
4
4
  export * from './GridFilterInputSingleSelect';
5
+ export * from './GridFilterInputBoolean';
5
6
  export * from './GridFilterInputValueProps';
6
- export * from './GridFilterPanel';
7
+ export { GridFilterPanel } from './GridFilterPanel';
7
8
  export * from './GridFilterInputMultipleValue';
8
9
  export * from './GridFilterInputMultipleSingleSelect';
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["onClick"];
4
4
  import * as React from 'react';
5
+ import { unstable_useId as useId } from '@mui/material/utils';
5
6
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
6
7
  import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
7
8
  import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
@@ -14,17 +15,16 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
14
15
  onClick
15
16
  } = props,
16
17
  other = _objectWithoutPropertiesLoose(props, _excluded);
18
+ const columnButtonId = useId();
19
+ const columnPanelId = useId();
17
20
  const apiRef = useGridApiContext();
18
21
  const rootProps = useGridRootProps();
19
- const {
20
- open,
21
- openedPanelValue
22
- } = useGridSelector(apiRef, gridPreferencePanelStateSelector);
22
+ const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
23
23
  const showColumns = event => {
24
- if (open && openedPanelValue === GridPreferencePanelsValue.columns) {
24
+ if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {
25
25
  apiRef.current.hidePreferences();
26
26
  } else {
27
- apiRef.current.showPreferences(GridPreferencePanelsValue.columns);
27
+ apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);
28
28
  }
29
29
  onClick == null ? void 0 : onClick(event);
30
30
  };
@@ -33,10 +33,15 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
33
33
  if (rootProps.disableColumnSelector) {
34
34
  return null;
35
35
  }
36
+ const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;
36
37
  return /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
37
38
  ref: ref,
39
+ id: columnButtonId,
38
40
  size: "small",
39
41
  "aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
42
+ "aria-haspopup": "menu",
43
+ "aria-expanded": isOpen,
44
+ "aria-controls": isOpen ? columnPanelId : undefined,
40
45
  startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})
41
46
  }, other, {
42
47
  onClick: showColumns
@@ -94,9 +94,9 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
94
94
  size: "small",
95
95
  startIcon: startIcon,
96
96
  "aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
97
- "aria-expanded": open ? 'true' : undefined,
98
97
  "aria-haspopup": "menu",
99
- "aria-controls": densityMenuId,
98
+ "aria-expanded": open,
99
+ "aria-controls": open ? densityMenuId : undefined,
100
100
  id: densityButtonId
101
101
  }, other, {
102
102
  onClick: handleDensitySelectorOpen
@@ -19,7 +19,7 @@ export interface GridToolbarExportProps extends ButtonProps {
19
19
  printOptions?: GridPrintExportOptions & GridExportDisplayOptions;
20
20
  [key: string]: any;
21
21
  }
22
- export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): JSX.Element;
23
- export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): JSX.Element;
22
+ export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
23
+ export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): React.JSX.Element;
24
24
  declare const GridToolbarExport: React.ForwardRefExoticComponent<Omit<GridToolbarExportProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
25
25
  export { GridToolbarExport };
@@ -20,8 +20,8 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
20
20
  other = _objectWithoutPropertiesLoose(props, _excluded);
21
21
  const apiRef = useGridApiContext();
22
22
  const rootProps = useGridRootProps();
23
- const buttonId = useId();
24
- const menuId = useId();
23
+ const exportButtonId = useId();
24
+ const exportMenuId = useId();
25
25
  const [open, setOpen] = React.useState(false);
26
26
  const buttonRef = React.useRef(null);
27
27
  const handleRef = useForkRef(ref, buttonRef);
@@ -54,11 +54,11 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
54
54
  ref: handleRef,
55
55
  size: "small",
56
56
  startIcon: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {}),
57
- "aria-expanded": open ? 'true' : undefined,
57
+ "aria-expanded": open,
58
58
  "aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
59
59
  "aria-haspopup": "menu",
60
- "aria-labelledby": menuId,
61
- id: buttonId
60
+ "aria-controls": open ? exportMenuId : undefined,
61
+ id: exportButtonId
62
62
  }, other, {
63
63
  onClick: handleMenuOpen
64
64
  }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseButton, {
@@ -69,9 +69,9 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
69
69
  onClickAway: handleMenuClickAway,
70
70
  position: "bottom-start",
71
71
  children: /*#__PURE__*/_jsx(MenuList, {
72
- id: menuId,
72
+ id: exportMenuId,
73
73
  className: gridClasses.menuList,
74
- "aria-labelledby": buttonId,
74
+ "aria-labelledby": exportButtonId,
75
75
  onKeyDown: handleListKeyDown,
76
76
  autoFocusItem: open,
77
77
  children: React.Children.map(children, child => {
@@ -4,7 +4,7 @@ const _excluded = ["componentsProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
7
+ import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
8
8
  import Badge from '@mui/material/Badge';
9
9
  import { gridColumnLookupSelector } from '../../hooks/features/columns/gridColumnsSelector';
10
10
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
@@ -28,7 +28,7 @@ const useUtilityClasses = ownerState => {
28
28
  const GridToolbarFilterListRoot = styled('ul', {
29
29
  name: 'MuiDataGrid',
30
30
  slot: 'ToolbarFilterList',
31
- overridesResolver: (props, styles) => styles.toolbarFilterList
31
+ overridesResolver: (_props, styles) => styles.toolbarFilterList
32
32
  })(({
33
33
  theme
34
34
  }) => ({
@@ -48,6 +48,8 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
48
48
  const lookup = useGridSelector(apiRef, gridColumnLookupSelector);
49
49
  const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
50
50
  const classes = useUtilityClasses(rootProps);
51
+ const filterButtonId = useId();
52
+ const filterPanelId = useId();
51
53
  const tooltipContentNode = React.useMemo(() => {
52
54
  if (preferencePanel.open) {
53
55
  return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');
@@ -83,9 +85,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
83
85
  openedPanelValue
84
86
  } = preferencePanel;
85
87
  if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
86
- apiRef.current.hideFilterPanel();
88
+ apiRef.current.hidePreferences();
87
89
  } else {
88
- apiRef.current.showFilterPanel();
90
+ apiRef.current.showPreferences(GridPreferencePanelsValue.filters, filterPanelId, filterButtonId);
89
91
  }
90
92
  (_buttonProps$onClick = buttonProps.onClick) == null ? void 0 : _buttonProps$onClick.call(buttonProps, event);
91
93
  };
@@ -94,14 +96,19 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
94
96
  if (rootProps.disableColumnFilter) {
95
97
  return null;
96
98
  }
99
+ const isOpen = preferencePanel.open && preferencePanel.panelId === filterPanelId;
97
100
  return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
98
101
  title: tooltipContentNode,
99
102
  enterDelay: 1000
100
103
  }, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
101
104
  children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
102
105
  ref: ref,
106
+ id: filterButtonId,
103
107
  size: "small",
104
108
  "aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
109
+ "aria-controls": isOpen ? filterPanelId : undefined,
110
+ "aria-expanded": isOpen,
111
+ "aria-haspopup": true,
105
112
  startIcon: /*#__PURE__*/_jsx(Badge, {
106
113
  badgeContent: activeFilters.length,
107
114
  color: "primary",
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterModel } from '../../models/gridFilterModel';
4
4
  export type GridToolbarQuickFilterProps = TextFieldProps & {
@@ -20,7 +20,7 @@ export type GridToolbarQuickFilterProps = TextFieldProps & {
20
20
  */
21
21
  debounceMs?: number;
22
22
  };
23
- declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): JSX.Element;
23
+ declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): React.JSX.Element;
24
24
  declare namespace GridToolbarQuickFilter {
25
25
  var propTypes: any;
26
26
  }
@@ -58,6 +58,32 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
58
58
  filterOperatorIsEmpty: 'is empty',
59
59
  filterOperatorIsNotEmpty: 'is not empty',
60
60
  filterOperatorIsAnyOf: 'is any of',
61
+ 'filterOperator=': '=',
62
+ 'filterOperator!=': '!=',
63
+ 'filterOperator>': '>',
64
+ 'filterOperator>=': '>=',
65
+ 'filterOperator<': '<',
66
+ 'filterOperator<=': '<=',
67
+ // Header filter operators text
68
+ headerFilterOperatorContains: 'Contains',
69
+ headerFilterOperatorEquals: 'Equals',
70
+ headerFilterOperatorStartsWith: 'Starts with',
71
+ headerFilterOperatorEndsWith: 'Ends with',
72
+ headerFilterOperatorIs: 'Is',
73
+ headerFilterOperatorNot: 'Is not',
74
+ headerFilterOperatorAfter: 'Is after',
75
+ headerFilterOperatorOnOrAfter: 'Is on or after',
76
+ headerFilterOperatorBefore: 'Is before',
77
+ headerFilterOperatorOnOrBefore: 'Is on or before',
78
+ headerFilterOperatorIsEmpty: 'Is empty',
79
+ headerFilterOperatorIsNotEmpty: 'Is not empty',
80
+ headerFilterOperatorIsAnyOf: 'Is any of',
81
+ 'headerFilterOperator=': 'Equals',
82
+ 'headerFilterOperator!=': 'Not equals',
83
+ 'headerFilterOperator>': 'Is greater than',
84
+ 'headerFilterOperator>=': 'Is greater than or equal to',
85
+ 'headerFilterOperator<': 'Is less than',
86
+ 'headerFilterOperator<=': 'Is less than or equal to',
61
87
  // Filter values text
62
88
  filterValueAny: 'any',
63
89
  filterValueTrue: 'true',
@@ -5,5 +5,5 @@ type GridContextProviderProps = {
5
5
  props: {};
6
6
  children: React.ReactNode;
7
7
  };
8
- export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): JSX.Element;
8
+ export declare function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps): React.JSX.Element;
9
9
  export {};
@@ -1,5 +1,5 @@
1
- import { GridRowTreeCreationParams, GridRowTreeCreationValue } from '../../features/rows/gridRowsInterfaces';
2
- import { GridFilteringMethodParams, GridFilteringMethodValue } from '../../features/filter/gridFilterState';
1
+ import { GridRowTreeCreationParams, GridRowTreeCreationValue, GridRowsState } from '../../features/rows/gridRowsInterfaces';
2
+ import { GridFilteringMethodParams, GridFilteringMethodValue, GridFilterState, GridVisibleRowsLookupState } from '../../features/filter/gridFilterState';
3
3
  import { GridSortingMethodParams, GridSortingMethodValue } from '../../features/sorting/gridSortingState';
4
4
  export type GridStrategyProcessorName = keyof GridStrategyProcessingLookup;
5
5
  export type GridStrategyGroup = GridStrategyProcessingLookup[keyof GridStrategyProcessingLookup]['group'];
@@ -19,6 +19,14 @@ export interface GridStrategyProcessingLookup {
19
19
  params: GridSortingMethodParams;
20
20
  value: GridSortingMethodValue;
21
21
  };
22
+ visibleRowsLookupCreation: {
23
+ group: 'rowTree';
24
+ params: {
25
+ tree: GridRowsState['tree'];
26
+ filteredRowsLookup: GridFilterState['filteredRowsLookup'];
27
+ };
28
+ value: GridVisibleRowsLookupState;
29
+ };
22
30
  }
23
31
  export type GridStrategyProcessor<P extends GridStrategyProcessorName> = (params: GridStrategyProcessingLookup[P]['params']) => GridStrategyProcessingLookup[P]['value'];
24
32
  export interface GridStrategyProcessingApi {
@@ -6,7 +6,8 @@ export const GRID_DEFAULT_STRATEGY = 'none';
6
6
  export const GRID_STRATEGIES_PROCESSORS = {
7
7
  rowTreeCreation: 'rowTree',
8
8
  filtering: 'rowTree',
9
- sorting: 'rowTree'
9
+ sorting: 'rowTree',
10
+ visibleRowsLookupCreation: 'rowTree'
10
11
  };
11
12
  /**
12
13
  * Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
@@ -25,14 +25,21 @@ export interface UseGridColumnHeadersProps {
25
25
  columnGroupsHeaderStructure: GridGroupingStructure[][];
26
26
  hasOtherElementInTabSequence: boolean;
27
27
  }
28
- interface GetHeadersParams {
28
+ export interface GetHeadersParams {
29
29
  renderContext: GridRenderContext | null;
30
30
  minFirstColumn?: number;
31
31
  maxLastColumn?: number;
32
32
  }
33
33
  export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
34
34
  renderContext: GridRenderContext | null;
35
- getColumnHeaders: (params?: GetHeadersParams, other?: {}) => JSX.Element | null;
35
+ getColumnHeaders: (params?: GetHeadersParams, other?: {}) => React.JSX.Element | null;
36
+ getColumnsToRender: (params?: GetHeadersParams) => {
37
+ renderedColumns: GridStateColDef[];
38
+ firstColumnToRender: number;
39
+ lastColumnToRender: number;
40
+ minFirstColumn: number;
41
+ maxLastColumn: number;
42
+ } | null;
36
43
  getColumnGroupHeaders: (params?: GetHeadersParams) => JSX.Element[] | null;
37
44
  isDragging: boolean;
38
45
  getRootProps: (other?: {}) => {
@@ -46,5 +53,5 @@ export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) =>
46
53
  ref: ((instance: HTMLDivElement | null) => void) | null;
47
54
  role: string;
48
55
  };
56
+ headerHeight: number;
49
57
  };
50
- export {};
@@ -263,7 +263,7 @@ export const useGridColumnHeaders = props => {
263
263
  const tabIndex = columnGroupHeaderTabIndexState !== null && columnGroupHeaderTabIndexState.depth === depth && columnFields.includes(columnGroupHeaderTabIndexState.field) ? 0 : -1;
264
264
  const headerInfo = {
265
265
  groupId,
266
- width: columnFields.map(field => apiRef.current.getColumn(field).computedWidth).reduce((acc, val) => acc + val, 0),
266
+ width: columnFields.reduce((acc, field) => acc + apiRef.current.getColumn(field).computedWidth, 0),
267
267
  fields: columnFields,
268
268
  colIndex: columnIndex,
269
269
  hasFocus,
@@ -319,6 +319,7 @@ export const useGridColumnHeaders = props => {
319
319
  return {
320
320
  renderContext,
321
321
  getColumnHeaders,
322
+ getColumnsToRender,
322
323
  getColumnGroupHeaders,
323
324
  isDragging: !!dragCol,
324
325
  getRootProps: (other = {}) => _extends({
@@ -327,6 +328,7 @@ export const useGridColumnHeaders = props => {
327
328
  getInnerProps: () => ({
328
329
  ref: handleInnerRef,
329
330
  role: 'rowgroup'
330
- })
331
+ }),
332
+ headerHeight
331
333
  };
332
334
  };
@@ -155,8 +155,8 @@ export function useGridDimensions(apiRef, props) {
155
155
  if (!mainEl) {
156
156
  return;
157
157
  }
158
- const height = mainEl.offsetHeight || 0;
159
- const width = mainEl.offsetWidth || 0;
158
+ const height = mainEl.clientHeight || 0;
159
+ const width = mainEl.clientWidth || 0;
160
160
  const win = ownerWindow(mainEl);
161
161
  const computedStyle = win.getComputedStyle(mainEl);
162
162
  const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;
@@ -29,9 +29,6 @@ export const useGridEditing = (apiRef, props) => {
29
29
  if (isCellEditableProp) {
30
30
  return isCellEditableProp(params);
31
31
  }
32
- if (params.rowNode.type === 'pinnedRow') {
33
- return false;
34
- }
35
32
  return true;
36
33
  }, [isCellEditableProp]);
37
34
  const maybeDebounce = (id, field, debounceMs, callback) => {
@@ -11,10 +11,10 @@ export declare const gridFilterModelSelector: import("../../../utils/createSelec
11
11
  */
12
12
  export declare const gridQuickFilterValuesSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, any[] | undefined>;
13
13
  /**
14
- * @category Filtering
14
+ * @category Visible rows
15
15
  * @ignore - do not document.
16
16
  */
17
- export declare const gridVisibleRowsLookupSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, Record<import("../../..").GridRowId, boolean>>;
17
+ export declare const gridVisibleRowsLookupSelector: (state: GridStateCommunity) => import("./gridFilterState").GridVisibleRowsLookupState;
18
18
  /**
19
19
  * @category Filtering
20
20
  * @ignore - do not document.
@@ -21,10 +21,10 @@ export const gridFilterModelSelector = createSelector(gridFilterStateSelector, f
21
21
  export const gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, filterModel => filterModel.quickFilterValues);
22
22
 
23
23
  /**
24
- * @category Filtering
24
+ * @category Visible rows
25
25
  * @ignore - do not document.
26
26
  */
27
- export const gridVisibleRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.visibleRowsLookup);
27
+ export const gridVisibleRowsLookupSelector = state => state.visibleRowsLookup;
28
28
 
29
29
  /**
30
30
  * @category Filtering
@@ -17,12 +17,6 @@ export interface GridFilterState {
17
17
  * This is the equivalent of the `visibleRowsLookup` if all the groups were expanded.
18
18
  */
19
19
  filteredRowsLookup: Record<GridRowId, boolean>;
20
- /**
21
- * Visibility status for each row.
22
- * A row is visible if it is passing the filters AND if its parents are expanded.
23
- * If a row is not registered in this lookup, it is visible.
24
- */
25
- visibleRowsLookup: Record<GridRowId, boolean>;
26
20
  /**
27
21
  * Amount of descendants that are passing the filters.
28
22
  * For the Tree Data, it includes all the intermediate depth levels (= amount of children + amount of grand children + ...).
@@ -47,3 +41,9 @@ export interface GridFilteringMethodParams {
47
41
  filterModel: GridFilterModel;
48
42
  }
49
43
  export type GridFilteringMethodValue = Omit<GridFilterState, 'filterModel'>;
44
+ /**
45
+ * Visibility status for each row.
46
+ * A row is visible if it is passing the filters AND if its parents are expanded.
47
+ * If a row is not registered in this lookup, it is visible.
48
+ */
49
+ export type GridVisibleRowsLookupState = Record<GridRowId, boolean>;
@@ -9,4 +9,10 @@ export const getDefaultGridFilterModel = () => ({
9
9
  /**
10
10
  * @param {GridRowId} rowId The id of the row we want to filter.
11
11
  * @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
12
+ */
13
+
14
+ /**
15
+ * Visibility status for each row.
16
+ * A row is visible if it is passing the filters AND if its parents are expanded.
17
+ * If a row is not registered in this lookup, it is visible.
12
18
  */
@@ -20,11 +20,21 @@ export const filterStateInitializer = (state, props, apiRef) => {
20
20
  return _extends({}, state, {
21
21
  filter: {
22
22
  filterModel: sanitizeFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef),
23
- visibleRowsLookup: {},
24
23
  filteredDescendantCountLookup: {}
25
- }
24
+ },
25
+ visibleRowsLookup: {}
26
26
  });
27
27
  };
28
+ const getVisibleRowsLookup = params => {
29
+ // For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
30
+ return params.filteredRowsLookup;
31
+ };
32
+ function getVisibleRowsLookupState(apiRef, state) {
33
+ return apiRef.current.applyStrategyProcessor('visibleRowsLookupCreation', {
34
+ tree: state.rows.tree,
35
+ filteredRowsLookup: state.filter.filteredRowsLookup
36
+ });
37
+ }
28
38
 
29
39
  /**
30
40
  * @requires useGridColumns (method, event)
@@ -49,9 +59,13 @@ export const useGridFilter = (apiRef, props) => {
49
59
  isRowMatchingFilters,
50
60
  filterModel: filterModel != null ? filterModel : getDefaultGridFilterModel()
51
61
  });
52
- return _extends({}, state, {
62
+ const newState = _extends({}, state, {
53
63
  filter: _extends({}, state.filter, filteringResult)
54
64
  });
65
+ const visibleRowsLookupState = getVisibleRowsLookupState(apiRef, newState);
66
+ return _extends({}, newState, {
67
+ visibleRowsLookup: visibleRowsLookupState
68
+ });
55
69
  });
56
70
  apiRef.current.publishEvent('filteredRowsSet');
57
71
  }, [props.filterMode, apiRef]);
@@ -107,7 +121,7 @@ export const useGridFilter = (apiRef, props) => {
107
121
  items
108
122
  }), 'deleteFilterItem');
109
123
  }, [apiRef]);
110
- const showFilterPanel = React.useCallback(targetColumnField => {
124
+ const showFilterPanel = React.useCallback((targetColumnField, panelId, labelId) => {
111
125
  logger.debug('Displaying filter panel');
112
126
  if (targetColumnField) {
113
127
  const filterModel = gridFilterModelSelector(apiRef);
@@ -153,7 +167,7 @@ export const useGridFilter = (apiRef, props) => {
153
167
  items: newFilterItems
154
168
  }));
155
169
  }
156
- apiRef.current.showPreferences(GridPreferencePanelsValue.filters);
170
+ apiRef.current.showPreferences(GridPreferencePanelsValue.filters, panelId, labelId);
157
171
  }, [apiRef, logger, props.disableMultipleColumnsFiltering]);
158
172
  const hideFilterPanel = React.useCallback(() => {
159
173
  logger.debug('Hiding filter panel');
@@ -262,13 +276,10 @@ export const useGridFilter = (apiRef, props) => {
262
276
  }
263
277
  return {
264
278
  filteredRowsLookup,
265
- // For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` are equals since no row is collapsed.
266
- visibleRowsLookup: filteredRowsLookup,
267
279
  filteredDescendantCountLookup: {}
268
280
  };
269
281
  }
270
282
  return {
271
- visibleRowsLookup: {},
272
283
  filteredRowsLookup: {},
273
284
  filteredDescendantCountLookup: {}
274
285
  };
@@ -278,6 +289,7 @@ export const useGridFilter = (apiRef, props) => {
278
289
  useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
279
290
  useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);
280
291
  useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'filtering', flatFilteringMethod);
292
+ useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'visibleRowsLookupCreation', getVisibleRowsLookup);
281
293
 
282
294
  /**
283
295
  * EVENTS
@@ -298,13 +310,21 @@ export const useGridFilter = (apiRef, props) => {
298
310
  apiRef.current.unstable_applyFilters();
299
311
  }
300
312
  }, [apiRef]);
313
+ const updateVisibleRowsLookupState = React.useCallback(() => {
314
+ apiRef.current.setState(state => {
315
+ return _extends({}, state, {
316
+ visibleRowsLookup: getVisibleRowsLookupState(apiRef, state)
317
+ });
318
+ });
319
+ apiRef.current.forceUpdate();
320
+ }, [apiRef]);
301
321
 
302
322
  // Do not call `apiRef.current.forceUpdate` to avoid re-render before updating the sorted rows.
303
323
  // Otherwise, the state is not consistent during the render
304
324
  useGridApiEventHandler(apiRef, 'rowsSet', updateFilteredRows);
305
- useGridApiEventHandler(apiRef, 'rowExpansionChange', apiRef.current.unstable_applyFilters);
306
325
  useGridApiEventHandler(apiRef, 'columnsChange', handleColumnsChange);
307
326
  useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);
327
+ useGridApiEventHandler(apiRef, 'rowExpansionChange', updateVisibleRowsLookupState);
308
328
 
309
329
  /**
310
330
  * 1ST RENDER
@@ -9,10 +9,12 @@ export type GridColumnGroupIdentifier = {
9
9
  export interface GridFocusState {
10
10
  cell: GridCellCoordinates | null;
11
11
  columnHeader: GridColumnIdentifier | null;
12
+ columnHeaderFilter: GridColumnIdentifier | null;
12
13
  columnGroupHeader: GridColumnGroupIdentifier | null;
13
14
  }
14
15
  export interface GridTabIndexState {
15
16
  cell: GridCellCoordinates | null;
16
17
  columnHeader: GridColumnIdentifier | null;
18
+ columnHeaderFilter: GridColumnIdentifier | null;
17
19
  columnGroupHeader: GridColumnGroupIdentifier | null;
18
20
  }
@@ -3,8 +3,10 @@ import { GridFocusState, GridTabIndexState } from './gridFocusState';
3
3
  export declare const gridFocusStateSelector: (state: GridStateCommunity) => GridFocusState;
4
4
  export declare const gridFocusCellSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridCellCoordinates | null>;
5
5
  export declare const gridFocusColumnHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
6
+ export declare const unstable_gridFocusColumnHeaderFilterSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
6
7
  export declare const unstable_gridFocusColumnGroupHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnGroupIdentifier | null>;
7
8
  export declare const gridTabIndexStateSelector: (state: GridStateCommunity) => GridTabIndexState;
8
9
  export declare const gridTabIndexCellSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("../../..").GridCellCoordinates | null>;
9
10
  export declare const gridTabIndexColumnHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
11
+ export declare const unstable_gridTabIndexColumnHeaderFilterSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnIdentifier | null>;
10
12
  export declare const unstable_gridTabIndexColumnGroupHeaderSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridFocusState").GridColumnGroupIdentifier | null>;