@mui/x-data-grid 6.0.0-beta.4 → 6.0.0-beta.5

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 (441) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/DataGrid/DataGrid.js +10 -0
  3. package/DataGrid/useDataGridProps.js +25 -18
  4. package/colDef/gridSingleSelectColDef.js +13 -4
  5. package/components/GridFooter.js +2 -2
  6. package/components/GridHeader.js +2 -2
  7. package/components/GridRow.js +4 -4
  8. package/components/GridRowCount.js +3 -5
  9. package/components/GridScrollArea.js +3 -2
  10. package/components/GridSelectedRowCount.js +3 -5
  11. package/components/base/GridFooterPlaceholder.js +2 -2
  12. package/components/base/GridOverlays.js +6 -6
  13. package/components/cell/GridActionsCell.js +4 -4
  14. package/components/cell/GridActionsCellItem.js +3 -3
  15. package/components/cell/GridBooleanCell.js +1 -1
  16. package/components/cell/GridEditBooleanCell.js +3 -3
  17. package/components/cell/GridEditInputCell.js +2 -4
  18. package/components/cell/GridEditSingleSelectCell.d.ts +2 -8
  19. package/components/cell/GridEditSingleSelectCell.js +25 -10
  20. package/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
  21. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
  22. package/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  23. package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  24. package/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
  25. package/components/columnHeaders/GridColumnHeaderTitle.js +6 -8
  26. package/components/columnHeaders/GridColumnHeaders.js +3 -5
  27. package/components/columnHeaders/GridColumnHeadersInner.js +5 -5
  28. package/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
  29. package/components/columnHeaders/GridIconButtonContainer.js +3 -5
  30. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
  31. package/components/columnSelection/GridHeaderCheckbox.js +3 -3
  32. package/components/containers/GridFooterContainer.js +3 -5
  33. package/components/containers/GridMainContainer.js +2 -4
  34. package/components/containers/GridOverlay.js +3 -5
  35. package/components/containers/GridRoot.js +4 -5
  36. package/components/containers/GridRootStyles.d.ts +5 -1
  37. package/components/containers/GridToolbarContainer.js +3 -5
  38. package/components/icons/index.d.ts +6 -0
  39. package/components/icons/index.js +7 -1
  40. package/components/menu/GridMenu.js +5 -7
  41. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  42. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  43. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  44. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  45. package/components/panel/GridColumnsPanel.js +15 -16
  46. package/components/panel/GridPanel.d.ts +6 -2
  47. package/components/panel/GridPanel.js +4 -0
  48. package/components/panel/GridPanelContent.js +3 -5
  49. package/components/panel/GridPanelFooter.js +3 -5
  50. package/components/panel/GridPanelHeader.js +3 -5
  51. package/components/panel/GridPanelWrapper.js +3 -5
  52. package/components/panel/GridPreferencesPanel.js +4 -4
  53. package/components/panel/filterPanel/GridFilterForm.js +25 -22
  54. package/components/panel/filterPanel/GridFilterInputBoolean.js +5 -5
  55. package/components/panel/filterPanel/GridFilterInputDate.js +3 -3
  56. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -8
  57. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +28 -20
  58. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
  59. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -8
  60. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +28 -17
  61. package/components/panel/filterPanel/GridFilterInputValue.js +3 -3
  62. package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -0
  63. package/components/panel/filterPanel/GridFilterPanel.js +27 -10
  64. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -2
  65. package/components/panel/filterPanel/filterPanelUtils.js +3 -9
  66. package/components/toolbar/GridToolbarColumnsButton.js +4 -4
  67. package/components/toolbar/GridToolbarDensitySelector.js +9 -9
  68. package/components/toolbar/GridToolbarExportContainer.js +4 -4
  69. package/components/toolbar/GridToolbarFilterButton.js +9 -11
  70. package/components/toolbar/GridToolbarQuickFilter.js +8 -7
  71. package/components/virtualization/GridVirtualScroller.js +3 -5
  72. package/components/virtualization/GridVirtualScrollerContent.js +3 -3
  73. package/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
  74. package/constants/defaultGridSlotsComponents.js +4 -2
  75. package/constants/localeTextConstants.js +1 -0
  76. package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
  77. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  78. package/hooks/features/columns/useGridColumns.js +5 -5
  79. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  80. package/hooks/features/filter/useGridFilter.js +5 -5
  81. package/hooks/features/virtualization/useGridVirtualScroller.js +3 -3
  82. package/index.js +1 -1
  83. package/internals/index.d.ts +2 -0
  84. package/internals/index.js +2 -1
  85. package/internals/utils/computeSlots.d.ts +6 -0
  86. package/internals/utils/computeSlots.js +17 -0
  87. package/internals/utils/index.d.ts +2 -0
  88. package/internals/utils/index.js +2 -0
  89. package/internals/utils/slotsMigration.d.ts +4 -0
  90. package/internals/utils/slotsMigration.js +13 -0
  91. package/legacy/DataGrid/DataGrid.js +10 -0
  92. package/legacy/DataGrid/useDataGridProps.js +21 -20
  93. package/legacy/colDef/gridSingleSelectColDef.js +13 -4
  94. package/legacy/components/GridFooter.js +2 -2
  95. package/legacy/components/GridHeader.js +2 -2
  96. package/legacy/components/GridRow.js +4 -4
  97. package/legacy/components/GridRowCount.js +3 -5
  98. package/legacy/components/GridScrollArea.js +3 -2
  99. package/legacy/components/GridSelectedRowCount.js +3 -5
  100. package/legacy/components/base/GridFooterPlaceholder.js +2 -2
  101. package/legacy/components/base/GridOverlays.js +6 -6
  102. package/legacy/components/cell/GridActionsCell.js +4 -4
  103. package/legacy/components/cell/GridActionsCellItem.js +3 -3
  104. package/legacy/components/cell/GridBooleanCell.js +2 -2
  105. package/legacy/components/cell/GridEditBooleanCell.js +3 -3
  106. package/legacy/components/cell/GridEditInputCell.js +2 -4
  107. package/legacy/components/cell/GridEditSingleSelectCell.js +33 -17
  108. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
  109. package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
  110. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  111. package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  112. package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
  113. package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +6 -8
  114. package/legacy/components/columnHeaders/GridColumnHeaders.js +3 -5
  115. package/legacy/components/columnHeaders/GridColumnHeadersInner.js +5 -5
  116. package/legacy/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
  117. package/legacy/components/columnHeaders/GridIconButtonContainer.js +3 -5
  118. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
  119. package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
  120. package/legacy/components/containers/GridFooterContainer.js +3 -5
  121. package/legacy/components/containers/GridMainContainer.js +2 -4
  122. package/legacy/components/containers/GridOverlay.js +3 -5
  123. package/legacy/components/containers/GridRoot.js +5 -6
  124. package/legacy/components/containers/GridToolbarContainer.js +3 -5
  125. package/legacy/components/icons/index.js +7 -1
  126. package/legacy/components/menu/GridMenu.js +5 -7
  127. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  128. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  129. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  130. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  131. package/legacy/components/panel/GridColumnsPanel.js +15 -18
  132. package/legacy/components/panel/GridPanel.js +4 -0
  133. package/legacy/components/panel/GridPanelContent.js +3 -5
  134. package/legacy/components/panel/GridPanelFooter.js +3 -5
  135. package/legacy/components/panel/GridPanelHeader.js +3 -5
  136. package/legacy/components/panel/GridPanelWrapper.js +3 -5
  137. package/legacy/components/panel/GridPreferencesPanel.js +4 -4
  138. package/legacy/components/panel/filterPanel/GridFilterForm.js +25 -22
  139. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +5 -5
  140. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +3 -3
  141. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -26
  142. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
  143. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +28 -19
  144. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +3 -3
  145. package/legacy/components/panel/filterPanel/GridFilterPanel.js +28 -9
  146. package/legacy/components/panel/filterPanel/filterPanelUtils.js +3 -9
  147. package/legacy/components/toolbar/GridToolbarColumnsButton.js +4 -4
  148. package/legacy/components/toolbar/GridToolbarDensitySelector.js +9 -9
  149. package/legacy/components/toolbar/GridToolbarExportContainer.js +4 -4
  150. package/legacy/components/toolbar/GridToolbarFilterButton.js +9 -11
  151. package/legacy/components/toolbar/GridToolbarQuickFilter.js +8 -7
  152. package/legacy/components/virtualization/GridVirtualScroller.js +3 -5
  153. package/legacy/components/virtualization/GridVirtualScrollerContent.js +3 -3
  154. package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
  155. package/legacy/constants/defaultGridSlotsComponents.js +4 -2
  156. package/legacy/constants/localeTextConstants.js +1 -0
  157. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
  158. package/legacy/hooks/features/columns/useGridColumns.js +5 -5
  159. package/legacy/hooks/features/filter/useGridFilter.js +5 -5
  160. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +3 -3
  161. package/legacy/index.js +1 -1
  162. package/legacy/internals/index.js +2 -1
  163. package/legacy/internals/utils/computeSlots.js +16 -0
  164. package/legacy/internals/utils/index.js +2 -0
  165. package/legacy/internals/utils/slotsMigration.js +14 -0
  166. package/legacy/locales/arSD.js +1 -0
  167. package/legacy/locales/beBY.js +1 -0
  168. package/legacy/locales/bgBG.js +1 -0
  169. package/legacy/locales/csCZ.js +1 -0
  170. package/legacy/locales/daDK.js +1 -0
  171. package/legacy/locales/deDE.js +1 -0
  172. package/legacy/locales/elGR.js +1 -0
  173. package/legacy/locales/esES.js +1 -0
  174. package/legacy/locales/faIR.js +1 -0
  175. package/legacy/locales/fiFI.js +1 -0
  176. package/legacy/locales/frFR.js +1 -0
  177. package/legacy/locales/heIL.js +1 -0
  178. package/legacy/locales/huHU.js +1 -0
  179. package/legacy/locales/itIT.js +1 -0
  180. package/legacy/locales/jaJP.js +1 -0
  181. package/legacy/locales/koKR.js +1 -0
  182. package/legacy/locales/nbNO.js +1 -0
  183. package/legacy/locales/nlNL.js +1 -0
  184. package/legacy/locales/plPL.js +1 -0
  185. package/legacy/locales/ptBR.js +1 -0
  186. package/legacy/locales/roRO.js +1 -0
  187. package/legacy/locales/ruRU.js +1 -0
  188. package/legacy/locales/skSK.js +1 -0
  189. package/legacy/locales/svSE.js +1 -0
  190. package/legacy/locales/trTR.js +1 -0
  191. package/legacy/locales/ukUA.js +1 -0
  192. package/legacy/locales/urPK.js +1 -0
  193. package/legacy/locales/viVN.js +1 -0
  194. package/legacy/locales/zhCN.js +1 -0
  195. package/legacy/locales/zhTW.js +1 -0
  196. package/locales/arSD.js +1 -0
  197. package/locales/beBY.js +1 -0
  198. package/locales/bgBG.js +1 -0
  199. package/locales/csCZ.js +1 -0
  200. package/locales/daDK.js +1 -0
  201. package/locales/deDE.js +1 -0
  202. package/locales/elGR.js +1 -0
  203. package/locales/esES.js +1 -0
  204. package/locales/faIR.js +1 -0
  205. package/locales/fiFI.js +1 -0
  206. package/locales/frFR.js +1 -0
  207. package/locales/heIL.js +1 -0
  208. package/locales/huHU.js +1 -0
  209. package/locales/itIT.js +1 -0
  210. package/locales/jaJP.js +1 -0
  211. package/locales/koKR.js +1 -0
  212. package/locales/nbNO.js +1 -0
  213. package/locales/nlNL.js +1 -0
  214. package/locales/plPL.js +1 -0
  215. package/locales/ptBR.js +1 -0
  216. package/locales/roRO.js +1 -0
  217. package/locales/ruRU.js +1 -0
  218. package/locales/skSK.js +1 -0
  219. package/locales/svSE.js +1 -0
  220. package/locales/trTR.js +1 -0
  221. package/locales/ukUA.js +1 -0
  222. package/locales/urPK.js +1 -0
  223. package/locales/viVN.js +1 -0
  224. package/locales/zhCN.js +1 -0
  225. package/locales/zhTW.js +1 -0
  226. package/models/api/gridLocaleTextApi.d.ts +1 -0
  227. package/models/colDef/gridColDef.d.ts +13 -1
  228. package/models/gridIconSlotsComponent.d.ts +12 -2
  229. package/models/gridSlotsComponent.d.ts +3 -1
  230. package/models/props/DataGridProps.d.ts +13 -2
  231. package/modern/DataGrid/DataGrid.js +10 -0
  232. package/modern/DataGrid/useDataGridProps.js +21 -17
  233. package/modern/colDef/gridSingleSelectColDef.js +13 -4
  234. package/modern/components/GridFooter.js +1 -1
  235. package/modern/components/GridHeader.js +1 -1
  236. package/modern/components/GridRow.js +3 -3
  237. package/modern/components/GridRowCount.js +3 -5
  238. package/modern/components/GridScrollArea.js +3 -2
  239. package/modern/components/GridSelectedRowCount.js +3 -5
  240. package/modern/components/base/GridFooterPlaceholder.js +1 -1
  241. package/modern/components/base/GridOverlays.js +3 -3
  242. package/modern/components/cell/GridActionsCell.js +3 -3
  243. package/modern/components/cell/GridActionsCellItem.js +2 -2
  244. package/modern/components/cell/GridBooleanCell.js +1 -1
  245. package/modern/components/cell/GridEditBooleanCell.js +2 -2
  246. package/modern/components/cell/GridEditInputCell.js +2 -4
  247. package/modern/components/cell/GridEditSingleSelectCell.js +24 -9
  248. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  249. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
  250. package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -4
  251. package/modern/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  252. package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
  253. package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -7
  254. package/modern/components/columnHeaders/GridColumnHeaders.js +3 -5
  255. package/modern/components/columnHeaders/GridColumnHeadersInner.js +5 -5
  256. package/modern/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
  257. package/modern/components/columnHeaders/GridIconButtonContainer.js +3 -5
  258. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  259. package/modern/components/columnSelection/GridHeaderCheckbox.js +2 -2
  260. package/modern/components/containers/GridFooterContainer.js +3 -5
  261. package/modern/components/containers/GridMainContainer.js +2 -4
  262. package/modern/components/containers/GridOverlay.js +3 -5
  263. package/modern/components/containers/GridRoot.js +4 -5
  264. package/modern/components/containers/GridToolbarContainer.js +3 -5
  265. package/modern/components/icons/index.js +7 -1
  266. package/modern/components/menu/GridMenu.js +4 -6
  267. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  268. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  269. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  270. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  271. package/modern/components/panel/GridColumnsPanel.js +13 -14
  272. package/modern/components/panel/GridPanel.js +4 -0
  273. package/modern/components/panel/GridPanelContent.js +3 -5
  274. package/modern/components/panel/GridPanelFooter.js +3 -5
  275. package/modern/components/panel/GridPanelHeader.js +3 -5
  276. package/modern/components/panel/GridPanelWrapper.js +3 -5
  277. package/modern/components/panel/GridPreferencesPanel.js +3 -3
  278. package/modern/components/panel/filterPanel/GridFilterForm.js +24 -21
  279. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +4 -4
  280. package/modern/components/panel/filterPanel/GridFilterInputDate.js +2 -2
  281. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +24 -17
  282. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  283. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +27 -16
  284. package/modern/components/panel/filterPanel/GridFilterInputValue.js +2 -2
  285. package/modern/components/panel/filterPanel/GridFilterPanel.js +26 -9
  286. package/modern/components/panel/filterPanel/filterPanelUtils.js +3 -9
  287. package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -3
  288. package/modern/components/toolbar/GridToolbarDensitySelector.js +8 -8
  289. package/modern/components/toolbar/GridToolbarExportContainer.js +3 -3
  290. package/modern/components/toolbar/GridToolbarFilterButton.js +8 -10
  291. package/modern/components/toolbar/GridToolbarQuickFilter.js +7 -6
  292. package/modern/components/virtualization/GridVirtualScroller.js +3 -5
  293. package/modern/components/virtualization/GridVirtualScrollerContent.js +3 -3
  294. package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
  295. package/modern/constants/defaultGridSlotsComponents.js +4 -2
  296. package/modern/constants/localeTextConstants.js +1 -0
  297. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
  298. package/modern/hooks/features/columns/useGridColumns.js +3 -3
  299. package/modern/hooks/features/filter/useGridFilter.js +3 -3
  300. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  301. package/modern/index.js +1 -1
  302. package/modern/internals/index.js +2 -1
  303. package/modern/internals/utils/computeSlots.js +17 -0
  304. package/modern/internals/utils/index.js +2 -0
  305. package/modern/internals/utils/slotsMigration.js +13 -0
  306. package/modern/locales/arSD.js +1 -0
  307. package/modern/locales/beBY.js +1 -0
  308. package/modern/locales/bgBG.js +1 -0
  309. package/modern/locales/csCZ.js +1 -0
  310. package/modern/locales/daDK.js +1 -0
  311. package/modern/locales/deDE.js +1 -0
  312. package/modern/locales/elGR.js +1 -0
  313. package/modern/locales/esES.js +1 -0
  314. package/modern/locales/faIR.js +1 -0
  315. package/modern/locales/fiFI.js +1 -0
  316. package/modern/locales/frFR.js +1 -0
  317. package/modern/locales/heIL.js +1 -0
  318. package/modern/locales/huHU.js +1 -0
  319. package/modern/locales/itIT.js +1 -0
  320. package/modern/locales/jaJP.js +1 -0
  321. package/modern/locales/koKR.js +1 -0
  322. package/modern/locales/nbNO.js +1 -0
  323. package/modern/locales/nlNL.js +1 -0
  324. package/modern/locales/plPL.js +1 -0
  325. package/modern/locales/ptBR.js +1 -0
  326. package/modern/locales/roRO.js +1 -0
  327. package/modern/locales/ruRU.js +1 -0
  328. package/modern/locales/skSK.js +1 -0
  329. package/modern/locales/svSE.js +1 -0
  330. package/modern/locales/trTR.js +1 -0
  331. package/modern/locales/ukUA.js +1 -0
  332. package/modern/locales/urPK.js +1 -0
  333. package/modern/locales/viVN.js +1 -0
  334. package/modern/locales/zhCN.js +1 -0
  335. package/modern/locales/zhTW.js +1 -0
  336. package/node/DataGrid/DataGrid.js +10 -0
  337. package/node/DataGrid/useDataGridProps.js +21 -17
  338. package/node/colDef/gridSingleSelectColDef.js +12 -3
  339. package/node/components/GridFooter.js +1 -1
  340. package/node/components/GridHeader.js +1 -1
  341. package/node/components/GridRow.js +3 -3
  342. package/node/components/GridRowCount.js +3 -5
  343. package/node/components/GridScrollArea.js +3 -2
  344. package/node/components/GridSelectedRowCount.js +3 -5
  345. package/node/components/base/GridFooterPlaceholder.js +1 -1
  346. package/node/components/base/GridOverlays.js +3 -3
  347. package/node/components/cell/GridActionsCell.js +3 -3
  348. package/node/components/cell/GridActionsCellItem.js +2 -2
  349. package/node/components/cell/GridBooleanCell.js +1 -1
  350. package/node/components/cell/GridEditBooleanCell.js +2 -2
  351. package/node/components/cell/GridEditInputCell.js +2 -4
  352. package/node/components/cell/GridEditSingleSelectCell.js +23 -8
  353. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  354. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
  355. package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -4
  356. package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  357. package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
  358. package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -7
  359. package/node/components/columnHeaders/GridColumnHeaders.js +3 -5
  360. package/node/components/columnHeaders/GridColumnHeadersInner.js +5 -5
  361. package/node/components/columnHeaders/GridColumnUnsortedIcon.js +1 -1
  362. package/node/components/columnHeaders/GridIconButtonContainer.js +3 -5
  363. package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  364. package/node/components/columnSelection/GridHeaderCheckbox.js +2 -2
  365. package/node/components/containers/GridFooterContainer.js +3 -5
  366. package/node/components/containers/GridMainContainer.js +2 -4
  367. package/node/components/containers/GridOverlay.js +3 -5
  368. package/node/components/containers/GridRoot.js +4 -5
  369. package/node/components/containers/GridToolbarContainer.js +3 -5
  370. package/node/components/icons/index.js +10 -2
  371. package/node/components/menu/GridMenu.js +4 -6
  372. package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  373. package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  374. package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  375. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  376. package/node/components/panel/GridColumnsPanel.js +13 -14
  377. package/node/components/panel/GridPanel.js +4 -0
  378. package/node/components/panel/GridPanelContent.js +3 -5
  379. package/node/components/panel/GridPanelFooter.js +3 -5
  380. package/node/components/panel/GridPanelHeader.js +3 -5
  381. package/node/components/panel/GridPanelWrapper.js +3 -5
  382. package/node/components/panel/GridPreferencesPanel.js +3 -3
  383. package/node/components/panel/filterPanel/GridFilterForm.js +24 -21
  384. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +4 -4
  385. package/node/components/panel/filterPanel/GridFilterInputDate.js +2 -2
  386. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +23 -16
  387. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  388. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +26 -15
  389. package/node/components/panel/filterPanel/GridFilterInputValue.js +2 -2
  390. package/node/components/panel/filterPanel/GridFilterPanel.js +26 -9
  391. package/node/components/panel/filterPanel/filterPanelUtils.js +3 -10
  392. package/node/components/toolbar/GridToolbarColumnsButton.js +3 -3
  393. package/node/components/toolbar/GridToolbarDensitySelector.js +8 -8
  394. package/node/components/toolbar/GridToolbarExportContainer.js +3 -3
  395. package/node/components/toolbar/GridToolbarFilterButton.js +8 -10
  396. package/node/components/toolbar/GridToolbarQuickFilter.js +7 -6
  397. package/node/components/virtualization/GridVirtualScroller.js +3 -5
  398. package/node/components/virtualization/GridVirtualScrollerContent.js +3 -3
  399. package/node/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
  400. package/node/constants/defaultGridSlotsComponents.js +3 -1
  401. package/node/constants/localeTextConstants.js +1 -0
  402. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
  403. package/node/hooks/features/columns/useGridColumns.js +3 -3
  404. package/node/hooks/features/filter/useGridFilter.js +3 -3
  405. package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  406. package/node/index.js +1 -1
  407. package/node/internals/index.js +91 -1
  408. package/node/internals/utils/computeSlots.js +23 -0
  409. package/node/internals/utils/index.js +27 -0
  410. package/node/internals/utils/slotsMigration.js +21 -0
  411. package/node/locales/arSD.js +1 -0
  412. package/node/locales/beBY.js +1 -0
  413. package/node/locales/bgBG.js +1 -0
  414. package/node/locales/csCZ.js +1 -0
  415. package/node/locales/daDK.js +1 -0
  416. package/node/locales/deDE.js +1 -0
  417. package/node/locales/elGR.js +1 -0
  418. package/node/locales/esES.js +1 -0
  419. package/node/locales/faIR.js +1 -0
  420. package/node/locales/fiFI.js +1 -0
  421. package/node/locales/frFR.js +1 -0
  422. package/node/locales/heIL.js +1 -0
  423. package/node/locales/huHU.js +1 -0
  424. package/node/locales/itIT.js +1 -0
  425. package/node/locales/jaJP.js +1 -0
  426. package/node/locales/koKR.js +1 -0
  427. package/node/locales/nbNO.js +1 -0
  428. package/node/locales/nlNL.js +1 -0
  429. package/node/locales/plPL.js +1 -0
  430. package/node/locales/ptBR.js +1 -0
  431. package/node/locales/roRO.js +1 -0
  432. package/node/locales/ruRU.js +1 -0
  433. package/node/locales/skSK.js +1 -0
  434. package/node/locales/svSE.js +1 -0
  435. package/node/locales/trTR.js +1 -0
  436. package/node/locales/ukUA.js +1 -0
  437. package/node/locales/urPK.js +1 -0
  438. package/node/locales/viVN.js +1 -0
  439. package/node/locales/zhCN.js +1 -0
  440. package/node/locales/zhTW.js +1 -0
  441. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,60 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.0.0-beta.5
7
+
8
+ _Feb 23, 2023_
9
+
10
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - ⚡️ Add web worker support for Excel export (#7770) @m4theushw
13
+ - 🎁 Add a button to remove all filters on the data grid filter panel (#7326) @MBilalShafi
14
+ - ⚙️ Allow to customize options label and value in the data grid `singleSelect` column (#7684) @m4theushw
15
+ - 📚 Documentation improvements
16
+ - 🐞 Bugfixes
17
+
18
+ ### `@mui/x-data-grid@v6.0.0-beta.5` / `@mui/x-data-grid-pro@v6.0.0-beta.5` / `@mui/x-data-grid-premium@v6.0.0-beta.5`
19
+
20
+ #### Changes
21
+
22
+ - [DataGrid] Allow to customize label and value for `singleSelect` (#7684) @m4theushw
23
+ - [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7964) @lolaignatova
24
+ - [DataGrid] Introduce `slots` and deprecate `components` (#7882) @MBilalShafi
25
+ - [DataGridPro] Add `Remove All` option in filter panel (#7326) @MBilalShafi
26
+ - [DataGridPremium] Add web worker support for Excel export (#7770) @m4theushw
27
+
28
+ ### `@mui/x-date-pickers@v6.0.0-beta.5` / `@mui/x-date-pickers-pro@v6.0.0-beta.5`
29
+
30
+ #### Breaking changes
31
+
32
+ - The `MuiDateSectionName` type was renamed to `FieldSectionType`
33
+
34
+ #### Changes
35
+
36
+ - [fields] Fix multi input range fields validation when uncontrolled (#8002) @LukasTy
37
+ - [fields] Fix single input time range fields slot props (#7988) @LukasTy
38
+ - [fields] Make the `ArrowUp` / `ArrowDown` edition only impact the active section (#7993) @flaviendelangle
39
+ - [fields] Fix single input range fields clearing (#7995) @flaviendelangle
40
+ - [fields] Clean the section object (#8009) @flaviendelangle
41
+ - [pickers] Fix `textField` slot `error` prop propagation (#7987) @LukasTy
42
+
43
+ ### `@mui/x-codemod@v6.0.0-beta.5`
44
+
45
+ #### Changes
46
+
47
+ - [codemod] Add `apiRef.current.getRowIndex` to `DataGrid` renaming codemod (#8001) @MBilalShafi
48
+
49
+ ### Docs
50
+
51
+ - [docs] Fine tune range fields demos (#7992) @LukasTy
52
+ - [docs] Fix a few scroll issues on mobile (#7900) @oliviertassinari
53
+ - [docs] Fix inconsistency in the data grid migration guide (#7963) @MBilalShafi
54
+
55
+ ### Core
56
+
57
+ - [core] Fix `moment` locale on adapter tests (#8020) @flaviendelangle
58
+ - [test] Support all adapters on the field tests about the formats (#7996) @flaviendelangle
59
+
6
60
  ## 6.0.0-beta.4
7
61
 
8
62
  _Feb 16, 2023_
@@ -2179,6 +2233,26 @@ You can find more information about the new api, including how to set those tran
2179
2233
  - [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
2180
2234
  - [website] Improve security header @oliviertassinari
2181
2235
 
2236
+ ## 5.17.25
2237
+
2238
+ _Feb 23, 2023_
2239
+
2240
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
2241
+
2242
+ - 🐞 Bugfixes
2243
+
2244
+ ### `@mui/x-data-grid@v5.17.25` / `@mui/x-data-grid-pro@v5.17.25` / `@mui/x-data-grid-premium@v5.17.25`
2245
+
2246
+ #### Changes
2247
+
2248
+ - [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7757) @lolaignatova
2249
+
2250
+ ### `@mui/x-date-pickers@v5.0.20` / `@mui/x-date-pickers-pro@v5.0.20`
2251
+
2252
+ #### Changes
2253
+
2254
+ - [DateTimePicker] Ensure toolbar `viewType` is correctly updated (#7942) @LukasTy
2255
+
2182
2256
  ## 5.17.24
2183
2257
 
2184
2258
  _Feb 16, 2023_
@@ -103,10 +103,12 @@ DataGridRaw.propTypes = {
103
103
  columnVisibilityModel: PropTypes.object,
104
104
  /**
105
105
  * Overrideable components.
106
+ * @deprecated Use `slots` instead.
106
107
  */
107
108
  components: PropTypes.object,
108
109
  /**
109
110
  * Overrideable components props dynamically passed to the component at rendering.
111
+ * @deprecated Use the `slotProps` prop instead.
110
112
  */
111
113
  componentsProps: PropTypes.object,
112
114
  /**
@@ -581,6 +583,14 @@ DataGridRaw.propTypes = {
581
583
  * @default false
582
584
  */
583
585
  showColumnVerticalBorder: PropTypes.bool,
586
+ /**
587
+ * Overrideable components props dynamically passed to the component at rendering.
588
+ */
589
+ slotProps: PropTypes.object,
590
+ /**
591
+ * Overrideable components.
592
+ */
593
+ slots: PropTypes.object,
584
594
  /**
585
595
  * Sorting can be processed on the server or client-side.
586
596
  * Set it to 'client' if you would like to handle sorting on the client-side.
@@ -1,9 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["components", "componentsProps"];
2
4
  import * as React from 'react';
3
5
  import { useThemeProps } from '@mui/material/styles';
4
6
  import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
5
7
  import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
6
8
  import { GridEditModes } from '../models';
9
+ import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
7
10
  const DATA_GRID_FORCED_PROPS = {
8
11
  disableMultipleColumnsFiltering: true,
9
12
  disableMultipleColumnsSorting: true,
@@ -65,25 +68,29 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
65
68
  keepNonExistentRowsSelected: false,
66
69
  keepColumnPositionIfDraggedOutside: false
67
70
  };
71
+ const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
68
72
  export const useDataGridProps = inProps => {
69
- const themedProps = useThemeProps({
70
- props: inProps,
71
- name: 'MuiDataGrid'
72
- });
73
+ const _useThemeProps = useThemeProps({
74
+ props: inProps,
75
+ name: 'MuiDataGrid'
76
+ }),
77
+ {
78
+ components,
79
+ componentsProps
80
+ } = _useThemeProps,
81
+ themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
73
82
  const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
74
- const components = React.useMemo(() => {
75
- const overrides = themedProps.components;
76
- if (!overrides) {
77
- return _extends({}, DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
78
- }
79
- const mergedComponents = {};
80
- Object.entries(DATA_GRID_DEFAULT_SLOTS_COMPONENTS).forEach(([key, defaultComponent]) => {
81
- mergedComponents[key] = overrides[key] === undefined ? defaultComponent : overrides[key];
82
- });
83
- return mergedComponents;
84
- }, [themedProps.components]);
85
- return React.useMemo(() => _extends({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
86
- localeText,
83
+ const slots = React.useMemo(() => computeSlots({
84
+ defaultSlots,
85
+ slots: themedProps.slots,
87
86
  components
88
- }, DATA_GRID_FORCED_PROPS), [themedProps, localeText, components]);
87
+ }), [components, themedProps.slots]);
88
+ return React.useMemo(() => {
89
+ var _themedProps$slotProp;
90
+ return _extends({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
91
+ localeText,
92
+ slots,
93
+ slotProps: (_themedProps$slotProp = themedProps.slotProps) != null ? _themedProps$slotProp : componentsProps
94
+ }, DATA_GRID_FORCED_PROPS);
95
+ }, [themedProps, localeText, slots, componentsProps]);
89
96
  };
@@ -2,12 +2,21 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { GRID_STRING_COL_DEF } from './gridStringColDef';
3
3
  import { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';
4
4
  import { getGridSingleSelectOperators } from './gridSingleSelectOperators';
5
- import { getLabelFromValueOption, isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
5
+ import { isSingleSelectColDef } from '../components/panel/filterPanel/filterPanelUtils';
6
+ import { isObject } from '../utils/utils';
6
7
  const isArrayOfObjects = options => {
7
8
  return typeof options[0] === 'object';
8
9
  };
10
+ const defaultGetOptionValue = value => {
11
+ return isObject(value) ? value.value : value;
12
+ };
13
+ const defaultGetOptionLabel = value => {
14
+ return isObject(value) ? value.label : String(value);
15
+ };
9
16
  export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
10
17
  type: 'singleSelect',
18
+ getOptionLabel: defaultGetOptionLabel,
19
+ getOptionValue: defaultGetOptionValue,
11
20
  valueFormatter(params) {
12
21
  const {
13
22
  id,
@@ -36,10 +45,10 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
36
45
  return value;
37
46
  }
38
47
  if (!isArrayOfObjects(valueOptions)) {
39
- return getLabelFromValueOption(value);
48
+ return colDef.getOptionLabel(value);
40
49
  }
41
- const valueOption = valueOptions.find(option => option.value === value);
42
- return valueOption ? getLabelFromValueOption(valueOption) : '';
50
+ const valueOption = valueOptions.find(option => colDef.getOptionValue(option) === value);
51
+ return valueOption ? colDef.getOptionLabel(valueOption) : '';
43
52
  },
44
53
  renderEditCell: renderEditSingleSelectCell,
45
54
  filterOperators: getGridSingleSelectOperators()
@@ -13,7 +13,7 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
15
  const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {
16
- var _rootProps$components;
16
+ var _rootProps$slotProps;
17
17
  const apiRef = useGridApiContext();
18
18
  const rootProps = useGridRootProps();
19
19
  const totalTopLevelRowCount = useGridSelector(apiRef, gridTopLevelRowCountSelector);
@@ -26,7 +26,7 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
26
26
  rowCount: totalTopLevelRowCount,
27
27
  visibleRowCount: visibleTopLevelRowCount
28
28
  }) : null;
29
- const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.components.Pagination && /*#__PURE__*/_jsx(rootProps.components.Pagination, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.pagination));
29
+ const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.pagination));
30
30
  return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
31
31
  ref: ref
32
32
  }, props, {
@@ -4,11 +4,11 @@ import { useGridRootProps } from '../hooks/utils/useGridRootProps';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
6
  export const GridHeader = /*#__PURE__*/React.forwardRef(function GridHeader(props, ref) {
7
- var _rootProps$components, _rootProps$components2;
7
+ var _rootProps$slotProps, _rootProps$slotProps2;
8
8
  const rootProps = useGridRootProps();
9
9
  return /*#__PURE__*/_jsxs("div", _extends({
10
10
  ref: ref
11
11
  }, props, {
12
- children: [/*#__PURE__*/_jsx(rootProps.components.PreferencesPanel, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.preferencesPanel)), rootProps.components.Toolbar && /*#__PURE__*/_jsx(rootProps.components.Toolbar, _extends({}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.toolbar))]
12
+ children: [/*#__PURE__*/_jsx(rootProps.slots.preferencesPanel, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.toolbar))]
13
13
  }));
14
14
  });
@@ -180,7 +180,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
180
180
  publish('rowClick', onClick)(event);
181
181
  }, [apiRef, onClick, publish, rowId]);
182
182
  const getCell = React.useCallback((column, cellProps) => {
183
- var _rootProps$components;
183
+ var _rootProps$slotProps;
184
184
  const cellParams = apiRef.current.getCellParams(rowId, column.field);
185
185
  const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
186
186
  id: rowId,
@@ -223,7 +223,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
223
223
  id: rowId,
224
224
  field: column.field
225
225
  });
226
- return /*#__PURE__*/_jsx(rootProps.components.Cell, _extends({
226
+ return /*#__PURE__*/_jsx(rootProps.slots.cell, _extends({
227
227
  value: cellParams.value,
228
228
  field: column.field,
229
229
  width: cellProps.width,
@@ -241,7 +241,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
241
241
  className: clsx(classNames),
242
242
  colSpan: cellProps.colSpan,
243
243
  disableDragEvents: disableDragEvents
244
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.cell, {
244
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.cell, {
245
245
  children: content
246
246
  }), column.field);
247
247
  }, [apiRef, cellTabIndex, editRowsState, cellFocus, rootProps, rowHeight, rowId, treeDepth, sortModel.length]);
@@ -319,7 +319,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
319
319
  width
320
320
  } = cellColSpanInfo.cellProps;
321
321
  const contentWidth = Math.round(randomNumber());
322
- cells.push( /*#__PURE__*/_jsx(rootProps.components.SkeletonCell, {
322
+ cells.push( /*#__PURE__*/_jsx(rootProps.slots.skeletonCell, {
323
323
  width: width,
324
324
  contentWidth: contentWidth,
325
325
  field: column.field,
@@ -38,10 +38,7 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
38
38
  } = props,
39
39
  other = _objectWithoutPropertiesLoose(props, _excluded);
40
40
  const apiRef = useGridApiContext();
41
- const rootProps = useGridRootProps();
42
- const ownerState = {
43
- classes: rootProps.classes
44
- };
41
+ const ownerState = useGridRootProps();
45
42
  const classes = useUtilityClasses(ownerState);
46
43
  if (rowCount === 0) {
47
44
  return null;
@@ -49,7 +46,8 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
49
46
  const text = visibleRowCount < rowCount ? apiRef.current.getLocaleText('footerTotalVisibleRows')(visibleRowCount, rowCount) : rowCount.toLocaleString();
50
47
  return /*#__PURE__*/_jsxs(GridRowCountRoot, _extends({
51
48
  ref: ref,
52
- className: clsx(classes.root, className)
49
+ className: clsx(classes.root, className),
50
+ ownerState: ownerState
53
51
  }, other, {
54
52
  children: [apiRef.current.getLocaleText('footerTotalRows'), " ", text]
55
53
  }));
@@ -58,8 +58,8 @@ function GridScrollAreaRaw(props) {
58
58
  top: 0
59
59
  });
60
60
  const rootProps = useGridRootProps();
61
- const ownerState = _extends({}, props, {
62
- classes: rootProps.classes
61
+ const ownerState = _extends({}, rootProps, {
62
+ scrollDirection
63
63
  });
64
64
  const classes = useUtilityClasses(ownerState);
65
65
  const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
@@ -99,6 +99,7 @@ function GridScrollAreaRaw(props) {
99
99
  return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
100
100
  ref: rootRef,
101
101
  className: clsx(classes.root),
102
+ ownerState: ownerState,
102
103
  onDragOver: handleDragOver,
103
104
  style: {
104
105
  height: headerHeight
@@ -45,15 +45,13 @@ const GridSelectedRowCount = /*#__PURE__*/React.forwardRef(function GridSelected
45
45
  } = props,
46
46
  other = _objectWithoutPropertiesLoose(props, _excluded);
47
47
  const apiRef = useGridApiContext();
48
- const rootProps = useGridRootProps();
49
- const ownerState = {
50
- classes: rootProps.classes
51
- };
48
+ const ownerState = useGridRootProps();
52
49
  const classes = useUtilityClasses(ownerState);
53
50
  const rowSelectedText = apiRef.current.getLocaleText('footerRowSelected')(selectedRowCount);
54
51
  return /*#__PURE__*/_jsx(GridSelectedRowCountRoot, _extends({
55
52
  ref: ref,
56
- className: clsx(classes.root, className)
53
+ className: clsx(classes.root, className),
54
+ ownerState: ownerState
57
55
  }, other, {
58
56
  children: rowSelectedText
59
57
  }));
@@ -3,10 +3,10 @@ import * as React from 'react';
3
3
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  export function GridFooterPlaceholder() {
6
- var _rootProps$components;
6
+ var _rootProps$slotProps;
7
7
  const rootProps = useGridRootProps();
8
8
  if (rootProps.hideFooter) {
9
9
  return null;
10
10
  }
11
- return /*#__PURE__*/_jsx(rootProps.components.Footer, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.footer));
11
+ return /*#__PURE__*/_jsx(rootProps.slots.footer, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.footer));
12
12
  }
@@ -89,16 +89,16 @@ export function GridOverlays() {
89
89
  const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
90
90
  let overlay = null;
91
91
  if (showNoRowsOverlay) {
92
- var _rootProps$components;
93
- overlay = /*#__PURE__*/_jsx(rootProps.components.NoRowsOverlay, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.noRowsOverlay));
92
+ var _rootProps$slotProps;
93
+ overlay = /*#__PURE__*/_jsx(rootProps.slots.noRowsOverlay, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.noRowsOverlay));
94
94
  }
95
95
  if (showNoResultsOverlay) {
96
- var _rootProps$components2;
97
- overlay = /*#__PURE__*/_jsx(rootProps.components.NoResultsOverlay, _extends({}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.noResultsOverlay));
96
+ var _rootProps$slotProps2;
97
+ overlay = /*#__PURE__*/_jsx(rootProps.slots.noResultsOverlay, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.noResultsOverlay));
98
98
  }
99
99
  if (loading) {
100
- var _rootProps$components3;
101
- overlay = /*#__PURE__*/_jsx(rootProps.components.LoadingOverlay, _extends({}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.loadingOverlay));
100
+ var _rootProps$slotProps3;
101
+ overlay = /*#__PURE__*/_jsx(rootProps.slots.loadingOverlay, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.loadingOverlay));
102
102
  }
103
103
  if (overlay === null) {
104
104
  return null;
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
15
  const hasActions = colDef => typeof colDef.getActions === 'function';
16
16
  function GridActionsCell(props) {
17
- var _rootProps$components;
17
+ var _rootProps$slotProps;
18
18
  const {
19
19
  colDef,
20
20
  id,
@@ -148,7 +148,7 @@ function GridActionsCell(props) {
148
148
  touchRippleRef: handleTouchRippleRef(index),
149
149
  onClick: handleButtonClick(index, button.props.onClick),
150
150
  tabIndex: focusedButtonIndex === index ? tabIndex : -1
151
- })), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
151
+ })), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
152
152
  ref: buttonRef,
153
153
  id: buttonId,
154
154
  "aria-label": apiRef.current.getLocaleText('actionsCellMore'),
@@ -160,8 +160,8 @@ function GridActionsCell(props) {
160
160
  onClick: showMenu,
161
161
  touchRippleRef: handleTouchRippleRef(buttonId),
162
162
  tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
163
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
164
- children: /*#__PURE__*/_jsx(rootProps.components.MoreActionsIcon, {
163
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
164
+ children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {
165
165
  fontSize: "small"
166
166
  })
167
167
  })), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
@@ -23,15 +23,15 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
23
23
  }
24
24
  };
25
25
  if (!showInMenu) {
26
- var _rootProps$components;
27
- return /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
26
+ var _rootProps$slotProps;
27
+ return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
28
28
  ref: ref,
29
29
  size: "small",
30
30
  role: "menuitem",
31
31
  "aria-label": label
32
32
  }, other, {
33
33
  onClick: handleClick
34
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
34
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
35
35
  children: /*#__PURE__*/React.cloneElement(icon, {
36
36
  fontSize: 'small'
37
37
  })
@@ -29,7 +29,7 @@ function GridBooleanCellRaw(props) {
29
29
  classes: rootProps.classes
30
30
  };
31
31
  const classes = useUtilityClasses(ownerState);
32
- const Icon = React.useMemo(() => value ? rootProps.components.BooleanCellTrueIcon : rootProps.components.BooleanCellFalseIcon, [rootProps.components.BooleanCellFalseIcon, rootProps.components.BooleanCellTrueIcon, value]);
32
+ const Icon = React.useMemo(() => value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);
33
33
  return /*#__PURE__*/_jsx(Icon, _extends({
34
34
  fontSize: "small",
35
35
  className: classes.root,
@@ -19,7 +19,7 @@ const useUtilityClasses = ownerState => {
19
19
  return composeClasses(slots, getDataGridUtilityClass, classes);
20
20
  };
21
21
  function GridEditBooleanCell(props) {
22
- var _rootProps$components;
22
+ var _rootProps$slotProps;
23
23
  const {
24
24
  id: idProp,
25
25
  value,
@@ -62,13 +62,13 @@ function GridEditBooleanCell(props) {
62
62
  htmlFor: id,
63
63
  className: clsx(classes.root, className)
64
64
  }, other, {
65
- children: /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
65
+ children: /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
66
66
  id: id,
67
67
  inputRef: inputRef,
68
68
  checked: Boolean(valueState),
69
69
  onChange: handleChange,
70
70
  size: "small"
71
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseCheckbox))
71
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox))
72
72
  }));
73
73
  }
74
74
  process.env.NODE_ENV !== "production" ? GridEditBooleanCell.propTypes = {
@@ -49,10 +49,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
49
49
  const apiRef = useGridApiContext();
50
50
  const inputRef = React.useRef();
51
51
  const [valueState, setValueState] = React.useState(value);
52
- const ownerState = {
53
- classes: rootProps.classes
54
- };
55
- const classes = useUtilityClasses(ownerState);
52
+ const classes = useUtilityClasses(rootProps);
56
53
  const handleChange = React.useCallback(async event => {
57
54
  const newValue = event.target.value;
58
55
  if (onValueChange) {
@@ -87,6 +84,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
87
84
  ref: ref,
88
85
  inputRef: inputRef,
89
86
  className: classes.root,
87
+ ownerState: rootProps,
90
88
  fullWidth: true,
91
89
  type: colDef.type === 'number' ? colDef.type : 'text',
92
90
  value: valueState != null ? valueState : '',
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectProps, SelectChangeEvent } from '@mui/material/Select';
3
3
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
4
- import { ValueOptions } from '../../models/colDef/gridColDef';
5
- export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams, Omit<SelectProps, 'id' | 'tabIndex' | 'value'> {
4
+ import { GridSingleSelectColDef } from '../../models/colDef/gridColDef';
5
+ export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams, Omit<SelectProps, 'id' | 'tabIndex' | 'value'>, Pick<GridSingleSelectColDef, 'getOptionLabel' | 'getOptionValue'> {
6
6
  /**
7
7
  * Callback called when the value is changed by the user.
8
8
  * @param {SelectChangeEvent<any>} event The event source of the callback.
@@ -14,12 +14,6 @@ export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams,
14
14
  * If true, the select opens by default.
15
15
  */
16
16
  initialOpen?: boolean;
17
- /**
18
- * Used to determine the text displayed for a given value option.
19
- * @param {ValueOptions} value The current value option.
20
- * @returns {string} The text to be displayed.
21
- */
22
- getOptionLabel?: (value: ValueOptions) => string;
23
17
  }
24
18
  declare function GridEditSingleSelectCell(props: GridEditSingleSelectCellProps): JSX.Element | null;
25
19
  declare namespace GridEditSingleSelectCell {
@@ -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 = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel", "getOptionValue"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
@@ -8,14 +8,14 @@ import MenuItem from '@mui/material/MenuItem';
8
8
  import { isEscapeKey } from '../../utils/keyboardUtils';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { GridEditModes } from '../../models/gridEditRowModel';
11
- import { getLabelFromValueOption, getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
11
+ import { getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
12
12
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  function isKeyboardEvent(event) {
15
15
  return !!event.key;
16
16
  }
17
17
  function GridEditSingleSelectCell(props) {
18
- var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
18
+ var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2;
19
19
  const rootProps = useGridRootProps();
20
20
  const {
21
21
  id,
@@ -27,14 +27,15 @@ function GridEditSingleSelectCell(props) {
27
27
  error,
28
28
  onValueChange,
29
29
  initialOpen = rootProps.editMode === GridEditModes.Cell,
30
- getOptionLabel = getLabelFromValueOption
30
+ getOptionLabel: getOptionLabelProp,
31
+ getOptionValue: getOptionValueProp
31
32
  } = props,
32
33
  other = _objectWithoutPropertiesLoose(props, _excluded);
33
34
  const apiRef = useGridApiContext();
34
35
  const ref = React.useRef();
35
36
  const inputRef = React.useRef();
36
37
  const [open, setOpen] = React.useState(initialOpen);
37
- const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
38
+ const baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
38
39
  const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
39
40
  useEnhancedEffect(() => {
40
41
  if (hasFocus) {
@@ -58,11 +59,16 @@ function GridEditSingleSelectCell(props) {
58
59
  if (!valueOptions) {
59
60
  return null;
60
61
  }
62
+ const getOptionValue = getOptionValueProp || colDef.getOptionValue;
63
+ const getOptionLabel = getOptionLabelProp || colDef.getOptionLabel;
61
64
  const handleChange = async event => {
65
+ if (!isSingleSelectColDef(colDef) || !valueOptions) {
66
+ return;
67
+ }
62
68
  setOpen(false);
63
69
  const target = event.target;
64
70
  // NativeSelect casts the value to a string.
65
- const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions);
71
+ const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions, getOptionValue);
66
72
  if (onValueChange) {
67
73
  await onValueChange(event, formattedTargetValue);
68
74
  }
@@ -92,7 +98,10 @@ function GridEditSingleSelectCell(props) {
92
98
  setOpen(true);
93
99
  };
94
100
  const OptionComponent = isSelectNative ? 'option' : MenuItem;
95
- return /*#__PURE__*/_jsx(rootProps.components.BaseSelect, _extends({
101
+ if (!valueOptions || !colDef) {
102
+ return null;
103
+ }
104
+ return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
96
105
  ref: ref,
97
106
  inputRef: inputRef,
98
107
  value: valueProp,
@@ -105,9 +114,9 @@ function GridEditSingleSelectCell(props) {
105
114
  error: error,
106
115
  native: isSelectNative,
107
116
  fullWidth: true
108
- }, other, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect, {
117
+ }, other, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect, {
109
118
  children: valueOptions.map(valueOption => {
110
- const value = typeof valueOption === 'object' ? valueOption.value : valueOption;
119
+ const value = getOptionValue(valueOption);
111
120
  return /*#__PURE__*/_jsx(OptionComponent, {
112
121
  value: value,
113
122
  children: getOptionLabel(valueOption)
@@ -142,11 +151,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
142
151
  */
143
152
  formattedValue: PropTypes.any,
144
153
  /**
145
- * Used to determine the text displayed for a given value option.
154
+ * Used to determine the label displayed for a given value option.
146
155
  * @param {ValueOptions} value The current value option.
147
156
  * @returns {string} The text to be displayed.
148
157
  */
149
158
  getOptionLabel: PropTypes.func,
159
+ /**
160
+ * Used to determine the value used for a value option.
161
+ * @param {ValueOptions} value The current value option.
162
+ * @returns {string} The value to be used.
163
+ */
164
+ getOptionValue: PropTypes.func,
150
165
  /**
151
166
  * If true, the cell is the active element.
152
167
  */
@@ -17,7 +17,7 @@ const useUtilityClasses = ownerState => {
17
17
  return composeClasses(slots, getDataGridUtilityClass, classes);
18
18
  };
19
19
  export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
20
- var _rootProps$components;
20
+ var _rootProps$slotProps;
21
21
  const {
22
22
  colDef,
23
23
  open,
@@ -38,7 +38,7 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
38
38
  }, [apiRef, colDef.field]);
39
39
  return /*#__PURE__*/_jsx("div", {
40
40
  className: classes.root,
41
- children: /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
41
+ children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
42
42
  ref: iconButtonRef,
43
43
  tabIndex: -1,
44
44
  className: classes.button,
@@ -50,8 +50,8 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
50
50
  "aria-haspopup": "true",
51
51
  "aria-controls": columnMenuId,
52
52
  id: columnMenuButtonId
53
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
54
- children: /*#__PURE__*/_jsx(rootProps.components.ColumnMenuIcon, {
53
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
54
+ children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
55
55
  fontSize: "small"
56
56
  })
57
57
  }))