@mui/x-data-grid 5.12.3 → 5.14.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 (370) hide show
  1. package/CHANGELOG.md +147 -1
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/DataGrid/useDataGridComponent.js +1 -1
  4. package/colDef/gridActionsColDef.js +2 -0
  5. package/colDef/gridBooleanColDef.js +3 -1
  6. package/colDef/gridCheckboxSelectionColDef.js +2 -0
  7. package/colDef/gridDateOperators.d.ts +1 -1
  8. package/colDef/gridDateOperators.js +4 -2
  9. package/colDef/gridNumericOperators.js +4 -2
  10. package/colDef/gridStringColDef.d.ts +3 -0
  11. package/colDef/gridStringColDef.js +6 -0
  12. package/colDef/gridStringOperators.d.ts +1 -1
  13. package/colDef/gridStringOperators.js +15 -8
  14. package/components/GridRow.js +1 -1
  15. package/components/base/GridOverlays.js +4 -1
  16. package/components/cell/GridActionsCellItem.d.ts +2 -2
  17. package/components/cell/GridBooleanCell.d.ts +5 -2
  18. package/components/cell/GridBooleanCell.js +93 -2
  19. package/components/cell/GridEditDateCell.js +5 -1
  20. package/components/cell/index.d.ts +1 -0
  21. package/components/cell/index.js +1 -0
  22. package/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
  23. package/components/containers/GridRootStyles.js +10 -0
  24. package/components/panel/GridPanel.d.ts +1 -1
  25. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  26. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  27. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  28. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -8
  29. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +30 -14
  30. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  31. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  32. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  33. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  34. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  35. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  36. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  37. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  38. package/components/toolbar/GridToolbarExport.js +20 -10
  39. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  40. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  41. package/constants/gridClasses.d.ts +25 -1
  42. package/constants/gridClasses.js +1 -1
  43. package/constants/localeTextConstants.js +8 -1
  44. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +2 -1
  45. package/hooks/features/columns/useGridColumnSpanning.js +9 -7
  46. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  47. package/hooks/features/columns/useGridColumns.js +13 -6
  48. package/hooks/features/dimensions/useGridDimensions.js +28 -15
  49. package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  50. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  51. package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  52. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  53. package/hooks/features/export/utils.d.ts +1 -1
  54. package/hooks/features/export/utils.js +9 -2
  55. package/hooks/features/filter/gridFilterUtils.js +6 -0
  56. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  57. package/hooks/features/filter/useGridFilter.js +30 -5
  58. package/hooks/features/pagination/useGridPage.js +4 -3
  59. package/hooks/features/pagination/useGridPageSize.js +4 -3
  60. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
  61. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  62. package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
  63. package/hooks/features/rows/useGridRows.js +1 -1
  64. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  65. package/hooks/features/selection/useGridSelection.js +24 -10
  66. package/hooks/features/sorting/gridSortingUtils.d.ts +1 -0
  67. package/hooks/features/sorting/gridSortingUtils.js +10 -11
  68. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  69. package/hooks/features/sorting/useGridSorting.js +34 -6
  70. package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +12 -1
  71. package/hooks/features/statePersistence/index.d.ts +1 -1
  72. package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  73. package/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
  74. package/hooks/utils/useGridApiContext.js +1 -1
  75. package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
  76. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  77. package/hooks/utils/useGridNativeEventListener.js +1 -1
  78. package/hooks/utils/useGridRootProps.js +1 -1
  79. package/index.js +1 -1
  80. package/internals/index.d.ts +2 -2
  81. package/internals/index.js +2 -2
  82. package/legacy/DataGrid/DataGrid.js +4 -4
  83. package/legacy/DataGrid/useDataGridComponent.js +1 -1
  84. package/legacy/colDef/gridActionsColDef.js +2 -0
  85. package/legacy/colDef/gridBooleanColDef.js +3 -1
  86. package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -0
  87. package/legacy/colDef/gridDateOperators.js +4 -2
  88. package/legacy/colDef/gridNumericOperators.js +4 -2
  89. package/legacy/colDef/gridStringColDef.js +6 -0
  90. package/legacy/colDef/gridStringOperators.js +17 -7
  91. package/legacy/components/GridRow.js +1 -1
  92. package/legacy/components/base/GridOverlays.js +4 -1
  93. package/legacy/components/cell/GridBooleanCell.js +93 -2
  94. package/legacy/components/cell/GridEditDateCell.js +5 -1
  95. package/legacy/components/cell/index.js +1 -0
  96. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +6 -1
  97. package/legacy/components/containers/GridRootStyles.js +3 -3
  98. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  99. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  100. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  101. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +22 -7
  102. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  103. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  104. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  105. package/legacy/components/toolbar/GridToolbarExport.js +20 -10
  106. package/legacy/constants/gridClasses.js +1 -1
  107. package/legacy/constants/localeTextConstants.js +8 -1
  108. package/legacy/hooks/features/columns/useGridColumnSpanning.js +9 -7
  109. package/legacy/hooks/features/columns/useGridColumns.js +13 -8
  110. package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
  111. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  112. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  113. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  114. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  115. package/legacy/hooks/features/export/utils.js +9 -2
  116. package/legacy/hooks/features/filter/gridFilterUtils.js +6 -0
  117. package/legacy/hooks/features/filter/useGridFilter.js +30 -5
  118. package/legacy/hooks/features/pagination/useGridPage.js +4 -3
  119. package/legacy/hooks/features/pagination/useGridPageSize.js +4 -3
  120. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  121. package/legacy/hooks/features/rows/useGridRows.js +1 -1
  122. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  123. package/legacy/hooks/features/selection/useGridSelection.js +26 -12
  124. package/legacy/hooks/features/sorting/gridSortingUtils.js +11 -12
  125. package/legacy/hooks/features/sorting/useGridSorting.js +34 -6
  126. package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -1
  127. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +22 -12
  128. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  129. package/legacy/hooks/utils/useGridNativeEventListener.js +1 -1
  130. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  131. package/legacy/index.js +1 -1
  132. package/legacy/internals/index.js +2 -2
  133. package/legacy/locales/arSD.js +7 -0
  134. package/legacy/locales/bgBG.js +7 -0
  135. package/legacy/locales/csCZ.js +7 -0
  136. package/legacy/locales/daDK.js +7 -0
  137. package/legacy/locales/deDE.js +12 -5
  138. package/legacy/locales/elGR.js +7 -0
  139. package/legacy/locales/esES.js +7 -0
  140. package/legacy/locales/faIR.js +7 -0
  141. package/legacy/locales/fiFI.js +7 -0
  142. package/legacy/locales/frFR.js +17 -10
  143. package/legacy/locales/heIL.js +8 -1
  144. package/legacy/locales/huHU.js +7 -0
  145. package/legacy/locales/index.js +4 -1
  146. package/legacy/locales/itIT.js +7 -0
  147. package/legacy/locales/jaJP.js +8 -1
  148. package/legacy/locales/koKR.js +7 -0
  149. package/legacy/locales/nbNO.js +8 -1
  150. package/legacy/locales/nlNL.js +21 -14
  151. package/legacy/locales/plPL.js +7 -0
  152. package/legacy/locales/ptBR.js +17 -10
  153. package/legacy/locales/roRO.js +135 -0
  154. package/legacy/locales/ruRU.js +7 -0
  155. package/legacy/locales/skSK.js +22 -15
  156. package/legacy/locales/svSE.js +8 -1
  157. package/legacy/locales/trTR.js +7 -0
  158. package/legacy/locales/ukUA.js +7 -0
  159. package/legacy/locales/viVN.js +7 -0
  160. package/legacy/locales/zhCN.js +7 -0
  161. package/legacy/locales/zhTW.js +135 -0
  162. package/legacy/models/events/gridEvents.js +1 -0
  163. package/legacy/utils/keyboardUtils.js +4 -3
  164. package/locales/arSD.js +7 -0
  165. package/locales/bgBG.js +7 -0
  166. package/locales/csCZ.js +7 -0
  167. package/locales/daDK.js +7 -0
  168. package/locales/deDE.js +12 -5
  169. package/locales/elGR.js +7 -0
  170. package/locales/esES.js +7 -0
  171. package/locales/faIR.js +7 -0
  172. package/locales/fiFI.js +7 -0
  173. package/locales/frFR.js +17 -10
  174. package/locales/heIL.js +8 -1
  175. package/locales/huHU.js +7 -0
  176. package/locales/index.d.ts +3 -0
  177. package/locales/index.js +4 -1
  178. package/locales/itIT.js +7 -0
  179. package/locales/jaJP.js +8 -1
  180. package/locales/koKR.js +7 -0
  181. package/locales/nbNO.js +8 -1
  182. package/locales/nlNL.js +21 -14
  183. package/locales/plPL.js +7 -0
  184. package/locales/ptBR.js +17 -10
  185. package/locales/roRO.d.ts +2 -0
  186. package/locales/roRO.js +123 -0
  187. package/locales/ruRU.js +7 -0
  188. package/locales/skSK.js +22 -15
  189. package/locales/svSE.js +8 -1
  190. package/locales/trTR.js +7 -0
  191. package/locales/ukUA.js +7 -0
  192. package/locales/viVN.js +7 -0
  193. package/locales/zhCN.js +7 -0
  194. package/locales/zhTW.d.ts +2 -0
  195. package/locales/zhTW.js +123 -0
  196. package/models/api/gridColumnSpanning.d.ts +2 -0
  197. package/models/api/gridLocaleTextApi.d.ts +8 -2
  198. package/models/api/gridSelectionApi.d.ts +6 -0
  199. package/models/events/gridEvents.d.ts +1 -0
  200. package/models/events/gridEvents.js +1 -0
  201. package/models/gridFilterOperator.d.ts +6 -0
  202. package/models/gridRows.d.ts +10 -1
  203. package/models/params/gridCellParams.d.ts +4 -4
  204. package/modern/DataGrid/DataGrid.js +4 -4
  205. package/modern/DataGrid/useDataGridComponent.js +1 -1
  206. package/modern/colDef/gridActionsColDef.js +2 -0
  207. package/modern/colDef/gridBooleanColDef.js +3 -1
  208. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -0
  209. package/modern/colDef/gridDateOperators.js +4 -2
  210. package/modern/colDef/gridNumericOperators.js +4 -2
  211. package/modern/colDef/gridStringColDef.js +6 -0
  212. package/modern/colDef/gridStringOperators.js +15 -8
  213. package/modern/components/GridRow.js +1 -1
  214. package/modern/components/base/GridOverlays.js +4 -1
  215. package/modern/components/cell/GridBooleanCell.js +93 -2
  216. package/modern/components/cell/GridEditDateCell.js +5 -1
  217. package/modern/components/cell/index.js +1 -0
  218. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
  219. package/modern/components/containers/GridRootStyles.js +10 -0
  220. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  221. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  222. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  223. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +20 -8
  224. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  225. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  226. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  227. package/modern/components/toolbar/GridToolbarExport.js +20 -10
  228. package/modern/constants/gridClasses.js +1 -1
  229. package/modern/constants/localeTextConstants.js +8 -1
  230. package/modern/hooks/features/columns/useGridColumnSpanning.js +9 -7
  231. package/modern/hooks/features/columns/useGridColumns.js +10 -5
  232. package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
  233. package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  234. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  235. package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  236. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  237. package/modern/hooks/features/export/utils.js +5 -2
  238. package/modern/hooks/features/filter/gridFilterUtils.js +6 -0
  239. package/modern/hooks/features/filter/useGridFilter.js +25 -4
  240. package/modern/hooks/features/pagination/useGridPage.js +4 -3
  241. package/modern/hooks/features/pagination/useGridPageSize.js +4 -3
  242. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +8 -4
  243. package/modern/hooks/features/rows/useGridRows.js +1 -1
  244. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  245. package/modern/hooks/features/selection/useGridSelection.js +22 -10
  246. package/modern/hooks/features/sorting/gridSortingUtils.js +10 -11
  247. package/modern/hooks/features/sorting/useGridSorting.js +30 -6
  248. package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  249. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +13 -7
  250. package/modern/hooks/utils/useGridApiContext.js +1 -1
  251. package/modern/hooks/utils/useGridNativeEventListener.js +1 -1
  252. package/modern/hooks/utils/useGridRootProps.js +1 -1
  253. package/modern/index.js +1 -1
  254. package/modern/internals/index.js +2 -2
  255. package/modern/locales/arSD.js +7 -0
  256. package/modern/locales/bgBG.js +7 -0
  257. package/modern/locales/csCZ.js +7 -0
  258. package/modern/locales/daDK.js +7 -0
  259. package/modern/locales/deDE.js +12 -5
  260. package/modern/locales/elGR.js +7 -0
  261. package/modern/locales/esES.js +7 -0
  262. package/modern/locales/faIR.js +7 -0
  263. package/modern/locales/fiFI.js +7 -0
  264. package/modern/locales/frFR.js +17 -10
  265. package/modern/locales/heIL.js +8 -1
  266. package/modern/locales/huHU.js +7 -0
  267. package/modern/locales/index.js +4 -1
  268. package/modern/locales/itIT.js +7 -0
  269. package/modern/locales/jaJP.js +8 -1
  270. package/modern/locales/koKR.js +7 -0
  271. package/modern/locales/nbNO.js +8 -1
  272. package/modern/locales/nlNL.js +21 -14
  273. package/modern/locales/plPL.js +7 -0
  274. package/modern/locales/ptBR.js +17 -10
  275. package/modern/locales/roRO.js +123 -0
  276. package/modern/locales/ruRU.js +7 -0
  277. package/modern/locales/skSK.js +22 -15
  278. package/modern/locales/svSE.js +8 -1
  279. package/modern/locales/trTR.js +7 -0
  280. package/modern/locales/ukUA.js +7 -0
  281. package/modern/locales/viVN.js +7 -0
  282. package/modern/locales/zhCN.js +7 -0
  283. package/modern/locales/zhTW.js +123 -0
  284. package/modern/models/events/gridEvents.js +1 -0
  285. package/modern/utils/keyboardUtils.js +4 -3
  286. package/node/DataGrid/DataGrid.js +4 -4
  287. package/node/DataGrid/useDataGridComponent.js +1 -1
  288. package/node/colDef/gridActionsColDef.js +2 -0
  289. package/node/colDef/gridBooleanColDef.js +3 -1
  290. package/node/colDef/gridCheckboxSelectionColDef.js +2 -0
  291. package/node/colDef/gridDateOperators.js +4 -2
  292. package/node/colDef/gridNumericOperators.js +4 -2
  293. package/node/colDef/gridStringColDef.js +5 -0
  294. package/node/colDef/gridStringOperators.js +15 -8
  295. package/node/components/GridRow.js +1 -1
  296. package/node/components/base/GridOverlays.js +4 -1
  297. package/node/components/cell/GridBooleanCell.js +93 -2
  298. package/node/components/cell/GridEditDateCell.js +7 -1
  299. package/node/components/cell/index.js +13 -0
  300. package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
  301. package/node/components/containers/GridRootStyles.js +10 -0
  302. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  303. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  304. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  305. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +31 -15
  306. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  307. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  308. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  309. package/node/components/toolbar/GridToolbarExport.js +16 -10
  310. package/node/constants/gridClasses.js +1 -1
  311. package/node/constants/localeTextConstants.js +8 -1
  312. package/node/hooks/features/columns/useGridColumnSpanning.js +9 -7
  313. package/node/hooks/features/columns/useGridColumns.js +13 -6
  314. package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
  315. package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
  316. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  317. package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
  318. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  319. package/node/hooks/features/export/utils.js +10 -2
  320. package/node/hooks/features/filter/gridFilterUtils.js +7 -0
  321. package/node/hooks/features/filter/useGridFilter.js +30 -5
  322. package/node/hooks/features/pagination/useGridPage.js +4 -3
  323. package/node/hooks/features/pagination/useGridPageSize.js +4 -3
  324. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  325. package/node/hooks/features/rows/useGridRows.js +1 -1
  326. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  327. package/node/hooks/features/selection/useGridSelection.js +24 -10
  328. package/node/hooks/features/sorting/gridSortingUtils.js +10 -11
  329. package/node/hooks/features/sorting/useGridSorting.js +34 -6
  330. package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  331. package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
  332. package/node/hooks/utils/useGridApiContext.js +1 -1
  333. package/node/hooks/utils/useGridNativeEventListener.js +1 -1
  334. package/node/hooks/utils/useGridRootProps.js +1 -1
  335. package/node/index.js +1 -1
  336. package/node/internals/index.js +18 -0
  337. package/node/locales/arSD.js +7 -0
  338. package/node/locales/bgBG.js +7 -0
  339. package/node/locales/csCZ.js +7 -0
  340. package/node/locales/daDK.js +7 -0
  341. package/node/locales/deDE.js +12 -5
  342. package/node/locales/elGR.js +7 -0
  343. package/node/locales/esES.js +7 -0
  344. package/node/locales/faIR.js +7 -0
  345. package/node/locales/fiFI.js +7 -0
  346. package/node/locales/frFR.js +17 -10
  347. package/node/locales/heIL.js +8 -1
  348. package/node/locales/huHU.js +7 -0
  349. package/node/locales/index.js +39 -0
  350. package/node/locales/itIT.js +7 -0
  351. package/node/locales/jaJP.js +8 -1
  352. package/node/locales/koKR.js +7 -0
  353. package/node/locales/nbNO.js +8 -1
  354. package/node/locales/nlNL.js +21 -14
  355. package/node/locales/plPL.js +7 -0
  356. package/node/locales/ptBR.js +17 -10
  357. package/node/locales/roRO.js +133 -0
  358. package/node/locales/ruRU.js +7 -0
  359. package/node/locales/skSK.js +22 -15
  360. package/node/locales/svSE.js +8 -1
  361. package/node/locales/trTR.js +7 -0
  362. package/node/locales/ukUA.js +7 -0
  363. package/node/locales/viVN.js +7 -0
  364. package/node/locales/zhCN.js +7 -0
  365. package/node/locales/zhTW.js +133 -0
  366. package/node/models/events/gridEvents.js +1 -0
  367. package/node/utils/keyboardUtils.js +4 -3
  368. package/package.json +3 -3
  369. package/utils/getGridLocalization.d.ts +1 -1
  370. package/utils/keyboardUtils.js +4 -3
@@ -23,7 +23,9 @@ var _GridToolbarExportContainer = require("./GridToolbarExportContainer");
23
23
 
24
24
  var _jsxRuntime = require("react/jsx-runtime");
25
25
 
26
- const _excluded = ["csvOptions", "printOptions", "excelOptions"];
26
+ const _excluded = ["hideMenu", "options"],
27
+ _excluded2 = ["hideMenu", "options"],
28
+ _excluded3 = ["csvOptions", "printOptions", "excelOptions"];
27
29
 
28
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
31
 
@@ -34,14 +36,16 @@ const GridCsvExportMenuItem = props => {
34
36
  const {
35
37
  hideMenu,
36
38
  options
37
- } = props;
38
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
39
+ } = props,
40
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
41
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, (0, _extends2.default)({
39
42
  onClick: () => {
40
43
  apiRef.current.exportDataAsCsv(options);
41
44
  hideMenu == null ? void 0 : hideMenu();
42
- },
45
+ }
46
+ }, other, {
43
47
  children: apiRef.current.getLocaleText('toolbarExportCSV')
44
- });
48
+ }));
45
49
  };
46
50
 
47
51
  exports.GridCsvExportMenuItem = GridCsvExportMenuItem;
@@ -51,14 +55,16 @@ const GridPrintExportMenuItem = props => {
51
55
  const {
52
56
  hideMenu,
53
57
  options
54
- } = props;
55
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
58
+ } = props,
59
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, (0, _extends2.default)({
56
61
  onClick: () => {
57
62
  apiRef.current.exportDataAsPrint(options);
58
63
  hideMenu == null ? void 0 : hideMenu();
59
- },
64
+ }
65
+ }, other, {
60
66
  children: apiRef.current.getLocaleText('toolbarExportPrint')
61
- });
67
+ }));
62
68
  };
63
69
 
64
70
  exports.GridPrintExportMenuItem = GridPrintExportMenuItem;
@@ -68,7 +74,7 @@ const GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExpo
68
74
  printOptions = {},
69
75
  excelOptions
70
76
  } = props,
71
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
77
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded3);
72
78
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
73
79
  const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {
74
80
  excelOptions,
@@ -12,5 +12,5 @@ function getDataGridUtilityClass(slot) {
12
12
  return (0, _material.generateUtilityClass)('MuiDataGrid', slot);
13
13
  }
14
14
 
15
- const gridClasses = (0, _material.generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
15
+ const gridClasses = (0, _material.generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
16
16
  exports.gridClasses = gridClasses;
@@ -117,6 +117,13 @@ const GRID_DEFAULT_LOCALE_TEXT = {
117
117
  // Used core components translation keys
118
118
  MuiTablePagination: {},
119
119
  // Row reordering text
120
- rowReorderingHeaderName: 'Row reordering'
120
+ rowReorderingHeaderName: 'Row reordering',
121
+ // Aggregation
122
+ aggregationMenuItemHeader: 'Aggregation',
123
+ aggregationFunctionLabelSum: 'sum',
124
+ aggregationFunctionLabelAvg: 'avg',
125
+ aggregationFunctionLabelMin: 'min',
126
+ aggregationFunctionLabelMax: 'max',
127
+ aggregationFunctionLabelSize: 'size'
121
128
  };
122
129
  exports.GRID_DEFAULT_LOCALE_TEXT = GRID_DEFAULT_LOCALE_TEXT;
@@ -41,11 +41,11 @@ const useGridColumnSpanning = apiRef => {
41
41
  columnIndex,
42
42
  rowId,
43
43
  minFirstColumnIndex,
44
- maxLastColumnIndex
44
+ maxLastColumnIndex,
45
+ columns
45
46
  } = params;
46
- const visibleColumns = apiRef.current.getVisibleColumns();
47
- const columnsLength = visibleColumns.length;
48
- const column = visibleColumns[columnIndex];
47
+ const columnsLength = columns.length;
48
+ const column = columns[columnIndex];
49
49
  const colSpan = typeof column.colSpan === 'function' ? column.colSpan(apiRef.current.getCellParams(rowId, column.field)) : column.colSpan;
50
50
 
51
51
  if (!colSpan || colSpan === 1) {
@@ -67,7 +67,7 @@ const useGridColumnSpanning = apiRef => {
67
67
  const nextColumnIndex = columnIndex + j; // Cells should be spanned only within their column section (left-pinned, right-pinned and unpinned).
68
68
 
69
69
  if (nextColumnIndex >= minFirstColumnIndex && nextColumnIndex < maxLastColumnIndex) {
70
- const nextColumn = visibleColumns[nextColumnIndex];
70
+ const nextColumn = columns[nextColumnIndex];
71
71
  width += nextColumn.computedWidth;
72
72
  setCellColSpanInfo(rowId, columnIndex + j, {
73
73
  spannedByColSpan: true,
@@ -93,14 +93,16 @@ const useGridColumnSpanning = apiRef => {
93
93
  const calculateColSpan = React.useCallback(({
94
94
  rowId,
95
95
  minFirstColumn,
96
- maxLastColumn
96
+ maxLastColumn,
97
+ columns
97
98
  }) => {
98
99
  for (let i = minFirstColumn; i < maxLastColumn; i += 1) {
99
100
  const cellProps = calculateCellColSpan({
100
101
  columnIndex: i,
101
102
  rowId,
102
103
  minFirstColumnIndex: minFirstColumn,
103
- maxLastColumnIndex: maxLastColumn
104
+ maxLastColumnIndex: maxLastColumn,
105
+ columns
104
106
  });
105
107
 
106
108
  if (cellProps.colSpan > 1) {
@@ -63,7 +63,7 @@ const columnsStateInitializer = (state, props, apiRef) => {
63
63
  exports.columnsStateInitializer = columnsStateInitializer;
64
64
 
65
65
  function useGridColumns(apiRef, props) {
66
- var _props$componentsProp2;
66
+ var _props$initialState5, _props$componentsProp2;
67
67
 
68
68
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridColumns');
69
69
  const columnTypes = React.useMemo(() => (0, _gridColumnsUtils.computeColumnTypes)(props.columnTypes), [props.columnTypes]);
@@ -214,14 +214,21 @@ function useGridColumns(apiRef, props) {
214
214
  * PRE-PROCESSING
215
215
  */
216
216
 
217
- const stateExportPreProcessing = React.useCallback(prevState => {
217
+ const stateExportPreProcessing = React.useCallback((prevState, context) => {
218
218
  const columnsStateToExport = {};
219
219
 
220
220
  if (apiRef.current.unstable_caches.columns.isUsingColumnVisibilityModel) {
221
- const columnVisibilityModelToExport = (0, _gridColumnsSelector.gridColumnVisibilityModelSelector)(apiRef);
222
- const hasHiddenColumns = Object.values(columnVisibilityModelToExport).some(value => value === false);
221
+ var _props$initialState$c2, _props$initialState4, _props$initialState4$;
223
222
 
224
- if (hasHiddenColumns) {
223
+ const columnVisibilityModelToExport = (0, _gridColumnsSelector.gridColumnVisibilityModelSelector)(apiRef);
224
+ const shouldExportColumnVisibilityModel = // Always export if the `exportOnlyDirtyModels` property is activated
225
+ !context.exportOnlyDirtyModels || // Always export if the model is controlled
226
+ props.columnVisibilityModel != null || // Always export if the model has been initialized
227
+ // TODO v6 Do a nullish check instead to export even if the initial model equals "{}"
228
+ Object.keys((_props$initialState$c2 = (_props$initialState4 = props.initialState) == null ? void 0 : (_props$initialState4$ = _props$initialState4.columns) == null ? void 0 : _props$initialState4$.columnVisibilityModel) != null ? _props$initialState$c2 : {}).length > 0 || // Always export if the model is not empty
229
+ Object.keys(columnVisibilityModelToExport).length > 0;
230
+
231
+ if (shouldExportColumnVisibilityModel) {
225
232
  columnsStateToExport.columnVisibilityModel = columnVisibilityModelToExport;
226
233
  }
227
234
  }
@@ -254,7 +261,7 @@ function useGridColumns(apiRef, props) {
254
261
  return (0, _extends2.default)({}, prevState, {
255
262
  columns: columnsStateToExport
256
263
  });
257
- }, [apiRef]);
264
+ }, [apiRef, props.columnVisibilityModel, (_props$initialState5 = props.initialState) == null ? void 0 : _props$initialState5.columns]);
258
265
  const stateRestorePreProcessing = React.useCallback((params, context) => {
259
266
  var _context$stateToResto;
260
267
 
@@ -92,21 +92,34 @@ function useGridDimensions(apiRef, props) {
92
92
  rootElement.removeChild(scrollDiv);
93
93
  }
94
94
 
95
- const viewportOuterSize = {
96
- width: rootDimensionsRef.current.width,
97
- height: props.autoHeight ? rowsMeta.currentPageTotalHeight : rootDimensionsRef.current.height - headerHeight
98
- };
99
- const {
100
- hasScrollX,
101
- hasScrollY
102
- } = hasScroll({
103
- content: {
104
- width: Math.round(columnsTotalWidth),
105
- height: rowsMeta.currentPageTotalHeight
106
- },
107
- container: viewportOuterSize,
108
- scrollBarSize
109
- });
95
+ let viewportOuterSize;
96
+ let hasScrollX;
97
+ let hasScrollY;
98
+
99
+ if (props.autoHeight) {
100
+ hasScrollY = false;
101
+ hasScrollX = Math.round(columnsTotalWidth) > rootDimensionsRef.current.width;
102
+ viewportOuterSize = {
103
+ width: rootDimensionsRef.current.width,
104
+ height: rowsMeta.currentPageTotalHeight + (hasScrollX ? scrollBarSize : 0)
105
+ };
106
+ } else {
107
+ viewportOuterSize = {
108
+ width: rootDimensionsRef.current.width,
109
+ height: rootDimensionsRef.current.height - headerHeight
110
+ };
111
+ const scrollInformation = hasScroll({
112
+ content: {
113
+ width: Math.round(columnsTotalWidth),
114
+ height: rowsMeta.currentPageTotalHeight
115
+ },
116
+ container: viewportOuterSize,
117
+ scrollBarSize
118
+ });
119
+ hasScrollY = scrollInformation.hasScrollY;
120
+ hasScrollX = scrollInformation.hasScrollX;
121
+ }
122
+
110
123
  const viewportInnerSize = {
111
124
  width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),
112
125
  height: viewportOuterSize.height - (hasScrollX ? scrollBarSize : 0)
@@ -95,6 +95,12 @@ const useGridCellEditing = (apiRef, props) => {
95
95
  }, [apiRef]);
96
96
  const handleCellKeyDown = React.useCallback((params, event) => {
97
97
  if (params.cellMode === _gridEditRowModel.GridCellModes.Edit) {
98
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
99
+ // TODO: `event.which` is depricated but this is a temporary workaround
100
+ if (event.which === 229) {
101
+ return;
102
+ }
103
+
98
104
  let reason;
99
105
 
100
106
  if (event.key === 'Escape') {
@@ -116,7 +122,7 @@ const useGridCellEditing = (apiRef, props) => {
116
122
  let reason;
117
123
 
118
124
  if ((0, _keyboardUtils.isPrintableKey)(event.key)) {
119
- if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {
125
+ if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
120
126
  return;
121
127
  }
122
128
 
@@ -199,6 +199,12 @@ const useCellEditing = (apiRef, props) => {
199
199
  };
200
200
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, cellEditingApi, 'EditRowApi');
201
201
  const handleCellKeyDown = React.useCallback(async (params, event) => {
202
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
203
+ // TODO: `event.which` is depricated but this is a temporary workaround
204
+ if (event.which === 229) {
205
+ return;
206
+ }
207
+
202
208
  const {
203
209
  id,
204
210
  field,
@@ -134,6 +134,12 @@ const useGridRowEditing = (apiRef, props) => {
134
134
  }, []);
135
135
  const handleCellKeyDown = React.useCallback((params, event) => {
136
136
  if (params.cellMode === _gridEditRowModel.GridRowModes.Edit) {
137
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
138
+ // TODO: `event.which` is depricated but this is a temporary workaround
139
+ if (event.which === 229) {
140
+ return;
141
+ }
142
+
137
143
  let reason;
138
144
 
139
145
  if (event.key === 'Escape') {
@@ -170,7 +176,7 @@ const useGridRowEditing = (apiRef, props) => {
170
176
  let reason;
171
177
 
172
178
  if ((0, _keyboardUtils.isPrintableKey)(event.key)) {
173
- if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {
179
+ if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
174
180
  return;
175
181
  }
176
182
 
@@ -199,6 +199,12 @@ const useGridRowEditing = (apiRef, props) => {
199
199
  };
200
200
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, rowEditingApi, 'EditRowApi');
201
201
  const handleCellKeyDown = React.useCallback(async (params, event) => {
202
+ // Wait until IME is settled for Asian languages like Japanese and Chinese
203
+ // TODO: `event.which` is depricated but this is a temporary workaround
204
+ if (event.which === 229) {
205
+ return;
206
+ }
207
+
202
208
  const {
203
209
  cellMode,
204
210
  isEditable
@@ -9,6 +9,8 @@ var _columns = require("../columns");
9
9
 
10
10
  var _filter = require("../filter");
11
11
 
12
+ var _gridRowsSelector = require("../rows/gridRowsSelector");
13
+
12
14
  const getColumnsToExport = ({
13
15
  apiRef,
14
16
  options
@@ -29,13 +31,19 @@ const defaultGetRowsToExport = ({
29
31
  apiRef
30
32
  }) => {
31
33
  const filteredSortedRowIds = (0, _filter.gridFilteredSortedRowIdsSelector)(apiRef);
34
+ const rowTree = (0, _gridRowsSelector.gridRowTreeSelector)(apiRef);
32
35
  const selectedRows = apiRef.current.getSelectedRows();
36
+ const bodyRows = filteredSortedRowIds.filter(id => {
37
+ var _rowTree$id$position;
38
+
39
+ return ((_rowTree$id$position = rowTree[id].position) != null ? _rowTree$id$position : 'body') === 'body';
40
+ });
33
41
 
34
42
  if (selectedRows.size > 0) {
35
- return filteredSortedRowIds.filter(id => selectedRows.has(id));
43
+ return bodyRows.filter(id => selectedRows.has(id));
36
44
  }
37
45
 
38
- return filteredSortedRowIds;
46
+ return bodyRows;
39
47
  };
40
48
 
41
49
  exports.defaultGetRowsToExport = defaultGetRowsToExport;
@@ -15,6 +15,8 @@ var _warning = require("../../../utils/warning");
15
15
 
16
16
  var _columns = require("../columns");
17
17
 
18
+ var _gridRowsSelector = require("../rows/gridRowsSelector");
19
+
18
20
  /**
19
21
  * Adds default values to the optional fields of a filter items.
20
22
  * @param {GridFilterItem} item The raw filter item.
@@ -101,6 +103,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef) => {
101
103
  items,
102
104
  linkOperator = _models.GridLinkOperator.And
103
105
  } = filterModel;
106
+ const tree = (0, _gridRowsSelector.gridRowTreeSelector)(apiRef);
104
107
 
105
108
  const getFilterCallbackFromItem = filterItem => {
106
109
  if (!filterItem.columnField || !filterItem.operatorValue) {
@@ -163,6 +166,10 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef) => {
163
166
  }
164
167
 
165
168
  return (rowId, shouldApplyFilter) => {
169
+ if (tree[rowId].position === 'footer') {
170
+ return true;
171
+ }
172
+
166
173
  const filteredAppliers = shouldApplyFilter ? appliers.filter(applier => shouldApplyFilter(applier.item.columnField)) : appliers; // Return `false` as soon as we have a failing filter
167
174
 
168
175
  if (linkOperator === _models.GridLinkOperator.And) {
@@ -67,7 +67,7 @@ const filterStateInitializer = (state, props, apiRef) => {
67
67
  exports.filterStateInitializer = filterStateInitializer;
68
68
 
69
69
  const useGridFilter = (apiRef, props) => {
70
- var _props$componentsProp2;
70
+ var _props$initialState3, _props$initialState3$, _props$componentsProp2;
71
71
 
72
72
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridFilter');
73
73
  apiRef.current.unstable_registerControlState({
@@ -146,7 +146,25 @@ const useGridFilter = (apiRef, props) => {
146
146
 
147
147
  if (targetColumnField) {
148
148
  const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
149
- const filterItemsWithValue = filterModel.items.filter(item => item.value !== undefined);
149
+ const filterItemsWithValue = filterModel.items.filter(item => {
150
+ var _column$filterOperato;
151
+
152
+ if (item.value !== undefined) {
153
+ return true;
154
+ }
155
+
156
+ const column = apiRef.current.getColumn(item.columnField);
157
+ const filterOperator = (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.find(operator => operator.value === item.operatorValue);
158
+ const requiresFilterValue = typeof (filterOperator == null ? void 0 : filterOperator.requiresFilterValue) === 'undefined' ? true : filterOperator == null ? void 0 : filterOperator.requiresFilterValue; // Operators like `isEmpty` don't have and don't require `item.value`.
159
+ // So we don't want to remove them from the filter model if `item.value === undefined`.
160
+ // See https://github.com/mui/mui-x/issues/5402
161
+
162
+ if (requiresFilterValue) {
163
+ return false;
164
+ }
165
+
166
+ return true;
167
+ });
150
168
  let newFilterItems;
151
169
  const filterItemOnTarget = filterItemsWithValue.find(item => item.columnField === targetColumnField);
152
170
 
@@ -225,10 +243,17 @@ const useGridFilter = (apiRef, props) => {
225
243
  * PRE-PROCESSING
226
244
  */
227
245
 
228
- const stateExportPreProcessing = React.useCallback(prevState => {
246
+ const stateExportPreProcessing = React.useCallback((prevState, context) => {
247
+ var _props$initialState2, _props$initialState2$;
248
+
229
249
  const filterModelToExport = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
250
+ const shouldExportFilterModel = // Always export if the `exportOnlyDirtyModels` property is activated
251
+ !context.exportOnlyDirtyModels || // Always export if the model is controlled
252
+ props.filterModel != null || // Always export if the model has been initialized
253
+ ((_props$initialState2 = props.initialState) == null ? void 0 : (_props$initialState2$ = _props$initialState2.filter) == null ? void 0 : _props$initialState2$.filterModel) != null || // Export if the model is not equal to the default value
254
+ !(0, _utils.isDeepEqual)(filterModelToExport, (0, _gridFilterState.getDefaultGridFilterModel)());
230
255
 
231
- if (filterModelToExport.items.length === 0 && filterModelToExport.linkOperator === (0, _gridFilterState.getDefaultGridFilterModel)().linkOperator) {
256
+ if (!shouldExportFilterModel) {
232
257
  return prevState;
233
258
  }
234
259
 
@@ -237,7 +262,7 @@ const useGridFilter = (apiRef, props) => {
237
262
  filterModel: filterModelToExport
238
263
  }
239
264
  });
240
- }, [apiRef]);
265
+ }, [apiRef, props.filterModel, (_props$initialState3 = props.initialState) == null ? void 0 : (_props$initialState3$ = _props$initialState3.filter) == null ? void 0 : _props$initialState3$.filterModel]);
241
266
  const stateRestorePreProcessing = React.useCallback((params, context) => {
242
267
  var _context$stateToResto;
243
268
 
@@ -85,13 +85,14 @@ const useGridPage = (apiRef, props) => {
85
85
  * PRE-PROCESSING
86
86
  */
87
87
 
88
- const stateExportPreProcessing = React.useCallback(prevState => {
88
+ const stateExportPreProcessing = React.useCallback((prevState, context) => {
89
89
  var _props$initialState, _props$initialState$p;
90
90
 
91
91
  const pageToExport = (0, _gridPaginationSelector.gridPageSelector)(apiRef);
92
- const shouldExportPage = // Always export if the page is controlled
92
+ const shouldExportPage = // Always export if the `exportOnlyDirtyModels` property is activated
93
+ !context.exportOnlyDirtyModels || // Always export if the page is controlled
93
94
  props.page != null || // Always export if the page has been initialized
94
- ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.page) != null || // Export if the page value is not equal to the default value
95
+ ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.page) != null || // Export if the page is not equal to the default value
95
96
  pageToExport !== 0;
96
97
 
97
98
  if (!shouldExportPage) {
@@ -70,13 +70,14 @@ const useGridPageSize = (apiRef, props) => {
70
70
  * PRE-PROCESSING
71
71
  */
72
72
 
73
- const stateExportPreProcessing = React.useCallback(prevState => {
73
+ const stateExportPreProcessing = React.useCallback((prevState, context) => {
74
74
  var _props$initialState, _props$initialState$p;
75
75
 
76
76
  const pageSizeToExport = (0, _gridPaginationSelector.gridPageSizeSelector)(apiRef);
77
- const shouldExportPageSize = // Always export if the page size is controlled
77
+ const shouldExportPageSize = // Always export if the `exportOnlyDirtyModels` property is activated
78
+ !context.exportOnlyDirtyModels || // Always export if the page size is controlled
78
79
  props.pageSize != null || // Always export if the page size has been initialized
79
- ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null || // Export if the page size value is not equal to the default value
80
+ ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null || // Export if the page size is not equal to the default value
80
81
  pageSizeToExport !== defaultPageSize(props.autoPageSize);
81
82
 
82
83
  if (!shouldExportPageSize) {
@@ -39,7 +39,9 @@ const preferencePanelStateInitializer = (state, props) => {
39
39
 
40
40
  exports.preferencePanelStateInitializer = preferencePanelStateInitializer;
41
41
 
42
- const useGridPreferencesPanel = apiRef => {
42
+ const useGridPreferencesPanel = (apiRef, props) => {
43
+ var _props$initialState3;
44
+
43
45
  const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridPreferencesPanel');
44
46
  const hideTimeout = React.useRef();
45
47
  const immediateTimeout = React.useRef();
@@ -96,17 +98,23 @@ const useGridPreferencesPanel = apiRef => {
96
98
  * PRE-PROCESSING
97
99
  */
98
100
 
99
- const stateExportPreProcessing = React.useCallback(prevState => {
101
+ const stateExportPreProcessing = React.useCallback((prevState, context) => {
102
+ var _props$initialState2;
103
+
100
104
  const preferencePanelToExport = (0, _gridPreferencePanelSelector.gridPreferencePanelStateSelector)(apiRef.current.state);
105
+ const shouldExportPreferencePanel = // Always export if the `exportOnlyDirtyModels` property is activated
106
+ !context.exportOnlyDirtyModels || // Always export if the panel was initialized
107
+ ((_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.preferencePanel) != null || // Always export if the panel is opened
108
+ preferencePanelToExport.open;
101
109
 
102
- if (!preferencePanelToExport.open && !preferencePanelToExport.openedPanelValue) {
110
+ if (!shouldExportPreferencePanel) {
103
111
  return prevState;
104
112
  }
105
113
 
106
114
  return (0, _extends2.default)({}, prevState, {
107
115
  preferencePanel: preferencePanelToExport
108
116
  });
109
- }, [apiRef]);
117
+ }, [apiRef, (_props$initialState3 = props.initialState) == null ? void 0 : _props$initialState3.preferencePanel]);
110
118
  const stateRestorePreProcessing = React.useCallback((params, context) => {
111
119
  const preferencePanel = context.stateToRestore.preferencePanel;
112
120
 
@@ -124,7 +124,7 @@ const useGridRows = (apiRef, props) => {
124
124
  const updateRows = React.useCallback(updates => {
125
125
  if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
126
126
  // TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
127
- throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to the DataGridPro component to unlock this feature.'].join('\n'));
127
+ throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
128
128
  } // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
129
129
 
130
130
 
@@ -18,7 +18,7 @@ const flatRowTreeCreationMethod = ({
18
18
  for (let i = 0; i < ids.length; i += 1) {
19
19
  const rowId = ids[i];
20
20
 
21
- if (previousTree && previousTree[rowId]) {
21
+ if (previousTree && previousTree[rowId] && previousTree[rowId].depth === 0 && previousTree[rowId].parent == null) {
22
22
  tree[rowId] = previousTree[rowId];
23
23
  } else {
24
24
  tree[rowId] = {
@@ -91,9 +91,9 @@ const useGridSelection = (apiRef, props) => {
91
91
  checkboxSelection,
92
92
  disableMultipleSelection,
93
93
  disableSelectionOnClick,
94
- isRowSelectable,
95
94
  pagination,
96
- paginationMode
95
+ paginationMode,
96
+ isRowSelectable: propIsRowSelectable
97
97
  } = props;
98
98
  const canHaveMultipleSelection = !disableMultipleSelection || checkboxSelection;
99
99
  const visibleRows = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
@@ -142,9 +142,22 @@ const useGridSelection = (apiRef, props) => {
142
142
  }
143
143
  }, [apiRef, logger]);
144
144
  const isRowSelected = React.useCallback(id => (0, _gridSelectionSelector.gridSelectionStateSelector)(apiRef.current.state).includes(id), [apiRef]);
145
+ const isRowSelectable = React.useCallback(id => {
146
+ var _apiRef$current$getRo;
147
+
148
+ if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {
149
+ return false;
150
+ }
151
+
152
+ if (((_apiRef$current$getRo = apiRef.current.getRowNode(id)) == null ? void 0 : _apiRef$current$getRo.position) === 'footer') {
153
+ return false;
154
+ }
155
+
156
+ return true;
157
+ }, [apiRef, propIsRowSelectable]);
145
158
  const getSelectedRows = React.useCallback(() => (0, _gridSelectionSelector.selectedGridRowsSelector)(apiRef), [apiRef]);
146
159
  const selectRow = React.useCallback((id, isSelected = true, resetSelection = false) => {
147
- if (isRowSelectable && !isRowSelectable(apiRef.current.getRowParams(id))) {
160
+ if (!apiRef.current.isRowSelectable(id)) {
148
161
  return;
149
162
  }
150
163
 
@@ -168,10 +181,10 @@ const useGridSelection = (apiRef, props) => {
168
181
  apiRef.current.setSelectionModel(newSelection);
169
182
  }
170
183
  }
171
- }, [apiRef, isRowSelectable, logger, canHaveMultipleSelection]);
184
+ }, [apiRef, logger, canHaveMultipleSelection]);
172
185
  const selectRows = React.useCallback((ids, isSelected = true, resetSelection = false) => {
173
186
  logger.debug(`Setting selection for several rows`);
174
- const selectableIds = isRowSelectable ? ids.filter(id => isRowSelectable(apiRef.current.getRowParams(id))) : ids;
187
+ const selectableIds = ids.filter(id => apiRef.current.isRowSelectable(id));
175
188
  let newSelection;
176
189
 
177
190
  if (resetSelection) {
@@ -194,7 +207,7 @@ const useGridSelection = (apiRef, props) => {
194
207
  if (isSelectionValid) {
195
208
  apiRef.current.setSelectionModel(newSelection);
196
209
  }
197
- }, [apiRef, isRowSelectable, logger, canHaveMultipleSelection]);
210
+ }, [apiRef, logger, canHaveMultipleSelection]);
198
211
  const selectRowRange = React.useCallback(({
199
212
  startId,
200
213
  endId
@@ -218,7 +231,8 @@ const useGridSelection = (apiRef, props) => {
218
231
  selectRowRange,
219
232
  setSelectionModel,
220
233
  getSelectedRows,
221
- isRowSelected
234
+ isRowSelected,
235
+ isRowSelectable
222
236
  };
223
237
  (0, _useGridApiMethod.useGridApiMethod)(apiRef, selectionApi, 'GridSelectionApi');
224
238
  /**
@@ -399,13 +413,13 @@ const useGridSelection = (apiRef, props) => {
399
413
  React.useEffect(() => {
400
414
  if (isStateControlled) {
401
415
  return;
402
- } // isRowSelectable changed
416
+ } // props.isRowSelectable changed
403
417
 
404
418
 
405
419
  const currentSelection = (0, _gridSelectionSelector.gridSelectionStateSelector)(apiRef.current.state);
406
420
 
407
421
  if (isRowSelectable) {
408
- const newSelection = currentSelection.filter(id => isRowSelectable(apiRef.current.getRowParams(id)));
422
+ const newSelection = currentSelection.filter(id => isRowSelectable(id));
409
423
 
410
424
  if (newSelection.length < currentSelection.length) {
411
425
  apiRef.current.setSelectionModel(newSelection);
@@ -432,7 +446,7 @@ const useGridSelection = (apiRef, props) => {
432
446
  let isSelectable = true;
433
447
 
434
448
  if (isRowSelectable) {
435
- isSelectable = isRowSelectable(apiRef.current.getRowParams(id));
449
+ isSelectable = isRowSelectable(id);
436
450
  }
437
451
 
438
452
  return isSelectable && currentPageRowsLookup[id]; // Check if the row is in the current page