@mui/x-data-grid 6.0.0-beta.4 → 6.0.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 (521) hide show
  1. package/CHANGELOG.md +204 -29
  2. package/DataGrid/DataGrid.js +10 -2
  3. package/DataGrid/useDataGridProps.js +25 -18
  4. package/colDef/gridSingleSelectColDef.js +13 -4
  5. package/components/GridColumnHeaders.d.ts +7 -0
  6. package/components/GridColumnHeaders.js +108 -0
  7. package/components/GridFooter.d.ts +1 -1
  8. package/components/GridFooter.js +2 -2
  9. package/components/GridHeader.js +2 -2
  10. package/components/GridLoadingOverlay.d.ts +1 -1
  11. package/components/GridNoResultsOverlay.d.ts +1 -1
  12. package/components/GridNoRowsOverlay.d.ts +1 -1
  13. package/components/GridRow.d.ts +13 -7
  14. package/components/GridRow.js +49 -31
  15. package/components/GridRowCount.d.ts +1 -1
  16. package/components/GridRowCount.js +4 -6
  17. package/components/GridScrollArea.js +4 -3
  18. package/components/GridSelectedRowCount.d.ts +1 -1
  19. package/components/GridSelectedRowCount.js +4 -6
  20. package/components/base/GridBody.d.ts +1 -4
  21. package/components/base/GridBody.js +43 -5
  22. package/components/base/GridFooterPlaceholder.js +2 -2
  23. package/components/base/GridOverlays.js +7 -7
  24. package/components/cell/GridActionsCell.js +4 -4
  25. package/components/cell/GridActionsCellItem.js +3 -3
  26. package/components/cell/GridBooleanCell.js +1 -1
  27. package/components/cell/GridCell.d.ts +2 -5
  28. package/components/cell/GridCell.js +14 -12
  29. package/components/cell/GridEditBooleanCell.js +3 -3
  30. package/components/cell/GridEditInputCell.js +3 -6
  31. package/components/cell/GridEditSingleSelectCell.d.ts +2 -8
  32. package/components/cell/GridEditSingleSelectCell.js +32 -16
  33. package/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
  34. package/components/columnHeaders/GridBaseColumnHeaders.d.ts +7 -0
  35. package/{modern/components/columnHeaders/GridColumnHeaders.js → components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
  36. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
  37. package/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  38. package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  39. package/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
  40. package/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
  41. package/components/columnHeaders/GridColumnHeadersInner.d.ts +1 -1
  42. package/components/columnHeaders/GridColumnHeadersInner.js +6 -6
  43. package/components/columnHeaders/GridIconButtonContainer.js +4 -6
  44. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
  45. package/components/columnSelection/GridHeaderCheckbox.js +3 -3
  46. package/components/containers/GridFooterContainer.d.ts +1 -1
  47. package/components/containers/GridFooterContainer.js +10 -15
  48. package/components/containers/GridMainContainer.js +3 -5
  49. package/components/containers/GridOverlay.d.ts +1 -2
  50. package/components/containers/GridOverlay.js +7 -11
  51. package/components/containers/GridRoot.js +4 -5
  52. package/components/containers/GridRootStyles.d.ts +5 -1
  53. package/components/containers/GridRootStyles.js +7 -3
  54. package/components/containers/GridToolbarContainer.d.ts +1 -1
  55. package/components/containers/GridToolbarContainer.js +4 -6
  56. package/components/index.d.ts +1 -1
  57. package/components/index.js +1 -1
  58. package/components/menu/GridMenu.js +5 -7
  59. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  60. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  61. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  62. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  63. package/components/panel/GridColumnsPanel.js +16 -18
  64. package/components/panel/GridPanel.d.ts +6 -2
  65. package/components/panel/GridPanel.js +4 -0
  66. package/components/panel/GridPanelContent.d.ts +1 -1
  67. package/components/panel/GridPanelContent.js +4 -6
  68. package/components/panel/GridPanelFooter.d.ts +1 -1
  69. package/components/panel/GridPanelFooter.js +4 -6
  70. package/components/panel/GridPanelHeader.d.ts +1 -1
  71. package/components/panel/GridPanelHeader.js +4 -6
  72. package/components/panel/GridPanelWrapper.js +3 -5
  73. package/components/panel/GridPreferencesPanel.js +4 -4
  74. package/components/panel/filterPanel/GridFilterForm.js +50 -45
  75. package/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
  76. package/components/panel/filterPanel/GridFilterInputDate.js +4 -5
  77. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -8
  78. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +28 -20
  79. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
  80. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -8
  81. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +53 -25
  82. package/components/panel/filterPanel/GridFilterInputValue.js +4 -5
  83. package/components/panel/filterPanel/GridFilterPanel.d.ts +5 -3
  84. package/components/panel/filterPanel/GridFilterPanel.js +35 -11
  85. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -2
  86. package/components/panel/filterPanel/filterPanelUtils.js +3 -9
  87. package/components/toolbar/GridToolbarColumnsButton.js +4 -4
  88. package/components/toolbar/GridToolbarDensitySelector.js +9 -9
  89. package/components/toolbar/GridToolbarExportContainer.js +4 -4
  90. package/components/toolbar/GridToolbarFilterButton.js +9 -11
  91. package/components/toolbar/GridToolbarQuickFilter.js +8 -7
  92. package/components/virtualization/GridVirtualScroller.d.ts +1 -1
  93. package/components/virtualization/GridVirtualScroller.js +4 -6
  94. package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
  95. package/components/virtualization/GridVirtualScrollerContent.js +4 -4
  96. package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
  97. package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
  98. package/constants/defaultGridSlotsComponents.js +5 -54
  99. package/constants/localeTextConstants.js +1 -0
  100. package/hooks/core/useGridLocaleText.js +2 -4
  101. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +22 -1
  102. package/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
  103. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  104. package/hooks/features/columns/useGridColumns.js +5 -5
  105. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  106. package/hooks/features/filter/useGridFilter.js +5 -5
  107. package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +2 -0
  108. package/hooks/features/virtualization/useGridVirtualScroller.js +36 -19
  109. package/index.d.ts +3 -0
  110. package/index.js +5 -1
  111. package/internals/index.d.ts +4 -1
  112. package/internals/index.js +3 -2
  113. package/internals/utils/computeSlots.d.ts +6 -0
  114. package/internals/utils/computeSlots.js +17 -0
  115. package/internals/utils/index.d.ts +2 -0
  116. package/internals/utils/index.js +2 -0
  117. package/internals/utils/slotsMigration.d.ts +4 -0
  118. package/internals/utils/slotsMigration.js +13 -0
  119. package/legacy/DataGrid/DataGrid.js +10 -2
  120. package/legacy/DataGrid/useDataGridProps.js +21 -20
  121. package/legacy/colDef/gridSingleSelectColDef.js +13 -4
  122. package/legacy/components/GridColumnHeaders.js +106 -0
  123. package/legacy/components/GridFooter.js +2 -2
  124. package/legacy/components/GridHeader.js +2 -2
  125. package/legacy/components/GridRow.js +47 -31
  126. package/legacy/components/GridRowCount.js +4 -6
  127. package/legacy/components/GridScrollArea.js +4 -3
  128. package/legacy/components/GridSelectedRowCount.js +4 -6
  129. package/legacy/components/base/GridBody.js +43 -5
  130. package/legacy/components/base/GridFooterPlaceholder.js +2 -2
  131. package/legacy/components/base/GridOverlays.js +7 -7
  132. package/legacy/components/cell/GridActionsCell.js +4 -4
  133. package/legacy/components/cell/GridActionsCellItem.js +3 -3
  134. package/legacy/components/cell/GridBooleanCell.js +2 -2
  135. package/legacy/components/cell/GridCell.js +14 -12
  136. package/legacy/components/cell/GridEditBooleanCell.js +3 -3
  137. package/legacy/components/cell/GridEditInputCell.js +3 -6
  138. package/legacy/components/cell/GridEditSingleSelectCell.js +40 -23
  139. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
  140. package/legacy/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +14 -19
  141. package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
  142. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -5
  143. package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  144. package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
  145. package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +12 -17
  146. package/legacy/components/columnHeaders/GridColumnHeadersInner.js +6 -6
  147. package/legacy/components/columnHeaders/GridIconButtonContainer.js +4 -6
  148. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
  149. package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
  150. package/legacy/components/containers/GridFooterContainer.js +10 -15
  151. package/legacy/components/containers/GridMainContainer.js +3 -5
  152. package/legacy/components/containers/GridOverlay.js +12 -17
  153. package/legacy/components/containers/GridRoot.js +5 -6
  154. package/legacy/components/containers/GridRootStyles.js +7 -3
  155. package/legacy/components/containers/GridToolbarContainer.js +4 -6
  156. package/legacy/components/index.js +1 -1
  157. package/legacy/components/menu/GridMenu.js +5 -7
  158. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  159. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  160. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  161. package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  162. package/legacy/components/panel/GridColumnsPanel.js +16 -20
  163. package/legacy/components/panel/GridPanel.js +4 -0
  164. package/legacy/components/panel/GridPanelContent.js +4 -6
  165. package/legacy/components/panel/GridPanelFooter.js +4 -6
  166. package/legacy/components/panel/GridPanelHeader.js +4 -6
  167. package/legacy/components/panel/GridPanelWrapper.js +3 -5
  168. package/legacy/components/panel/GridPreferencesPanel.js +4 -4
  169. package/legacy/components/panel/filterPanel/GridFilterForm.js +50 -45
  170. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
  171. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -5
  172. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -26
  173. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
  174. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -27
  175. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -5
  176. package/legacy/components/panel/filterPanel/GridFilterPanel.js +36 -10
  177. package/legacy/components/panel/filterPanel/filterPanelUtils.js +3 -9
  178. package/legacy/components/toolbar/GridToolbarColumnsButton.js +4 -4
  179. package/legacy/components/toolbar/GridToolbarDensitySelector.js +9 -9
  180. package/legacy/components/toolbar/GridToolbarExportContainer.js +4 -4
  181. package/legacy/components/toolbar/GridToolbarFilterButton.js +9 -11
  182. package/legacy/components/toolbar/GridToolbarQuickFilter.js +8 -7
  183. package/legacy/components/virtualization/GridVirtualScroller.js +4 -6
  184. package/legacy/components/virtualization/GridVirtualScrollerContent.js +4 -4
  185. package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
  186. package/legacy/constants/defaultGridSlotsComponents.js +5 -54
  187. package/legacy/constants/localeTextConstants.js +1 -0
  188. package/legacy/hooks/core/useGridLocaleText.js +2 -4
  189. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
  190. package/legacy/hooks/features/columns/useGridColumns.js +5 -5
  191. package/legacy/hooks/features/filter/useGridFilter.js +5 -5
  192. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +34 -17
  193. package/legacy/index.js +5 -1
  194. package/legacy/internals/index.js +3 -2
  195. package/legacy/internals/utils/computeSlots.js +16 -0
  196. package/legacy/internals/utils/index.js +2 -0
  197. package/legacy/internals/utils/slotsMigration.js +14 -0
  198. package/legacy/locales/arSD.js +15 -19
  199. package/legacy/locales/beBY.js +1 -0
  200. package/legacy/locales/bgBG.js +1 -0
  201. package/legacy/locales/csCZ.js +25 -32
  202. package/legacy/locales/daDK.js +1 -0
  203. package/legacy/locales/deDE.js +1 -0
  204. package/legacy/locales/elGR.js +1 -0
  205. package/legacy/locales/esES.js +2 -1
  206. package/legacy/locales/faIR.js +1 -0
  207. package/legacy/locales/fiFI.js +1 -0
  208. package/legacy/locales/frFR.js +1 -0
  209. package/legacy/locales/heIL.js +1 -0
  210. package/legacy/locales/huHU.js +1 -0
  211. package/legacy/locales/itIT.js +1 -0
  212. package/legacy/locales/jaJP.js +1 -0
  213. package/legacy/locales/koKR.js +1 -0
  214. package/legacy/locales/nbNO.js +1 -0
  215. package/legacy/locales/nlNL.js +1 -0
  216. package/legacy/locales/plPL.js +1 -0
  217. package/legacy/locales/ptBR.js +1 -0
  218. package/legacy/locales/roRO.js +1 -0
  219. package/legacy/locales/ruRU.js +1 -0
  220. package/legacy/locales/skSK.js +1 -0
  221. package/legacy/locales/svSE.js +1 -0
  222. package/legacy/locales/trTR.js +1 -0
  223. package/legacy/locales/ukUA.js +1 -0
  224. package/legacy/locales/urPK.js +1 -0
  225. package/legacy/locales/viVN.js +1 -0
  226. package/legacy/locales/zhCN.js +1 -0
  227. package/legacy/locales/zhTW.js +1 -0
  228. package/legacy/material/components/MUISelectOption.js +14 -0
  229. package/legacy/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
  230. package/legacy/{components → material}/icons/index.js +7 -1
  231. package/legacy/material/index.js +65 -0
  232. package/legacy/models/gridFilterItem.js +2 -0
  233. package/legacy/models/params/gridRowParams.js +4 -0
  234. package/locales/arSD.js +15 -19
  235. package/locales/beBY.js +1 -0
  236. package/locales/bgBG.js +1 -0
  237. package/locales/csCZ.js +24 -31
  238. package/locales/daDK.js +1 -0
  239. package/locales/deDE.js +1 -0
  240. package/locales/elGR.js +1 -0
  241. package/locales/esES.js +2 -1
  242. package/locales/faIR.js +1 -0
  243. package/locales/fiFI.js +1 -0
  244. package/locales/frFR.js +1 -0
  245. package/locales/heIL.js +1 -0
  246. package/locales/huHU.js +1 -0
  247. package/locales/itIT.js +1 -0
  248. package/locales/jaJP.js +1 -0
  249. package/locales/koKR.js +1 -0
  250. package/locales/nbNO.js +1 -0
  251. package/locales/nlNL.js +1 -0
  252. package/locales/plPL.js +1 -0
  253. package/locales/ptBR.js +1 -0
  254. package/locales/roRO.js +1 -0
  255. package/locales/ruRU.js +1 -0
  256. package/locales/skSK.js +1 -0
  257. package/locales/svSE.js +1 -0
  258. package/locales/trTR.js +1 -0
  259. package/locales/ukUA.js +1 -0
  260. package/locales/urPK.js +1 -0
  261. package/locales/viVN.js +1 -0
  262. package/locales/zhCN.js +1 -0
  263. package/locales/zhTW.js +1 -0
  264. package/material/components/MUISelectOption.d.ts +3 -0
  265. package/material/components/MUISelectOption.js +16 -0
  266. package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
  267. package/{components → material}/icons/index.d.ts +6 -0
  268. package/{components → material}/icons/index.js +7 -1
  269. package/material/index.d.ts +57 -0
  270. package/material/index.js +65 -0
  271. package/material/package.json +6 -0
  272. package/models/api/gridLocaleTextApi.d.ts +1 -0
  273. package/models/colDef/gridColDef.d.ts +19 -1
  274. package/models/gridExport.d.ts +4 -0
  275. package/models/gridFilterItem.d.ts +2 -0
  276. package/models/gridFilterItem.js +2 -0
  277. package/models/gridFilterModel.d.ts +2 -0
  278. package/models/gridFilterOperator.d.ts +2 -0
  279. package/models/gridIconSlotsComponent.d.ts +22 -2
  280. package/models/gridSlotsComponent.d.ts +18 -1
  281. package/models/gridSlotsComponentsProps.d.ts +103 -23
  282. package/models/params/gridRowParams.d.ts +6 -0
  283. package/models/params/gridRowParams.js +4 -0
  284. package/models/props/DataGridProps.d.ts +13 -2
  285. package/modern/DataGrid/DataGrid.js +10 -2
  286. package/modern/DataGrid/useDataGridProps.js +21 -17
  287. package/modern/colDef/gridSingleSelectColDef.js +13 -4
  288. package/modern/components/GridColumnHeaders.js +108 -0
  289. package/modern/components/GridFooter.js +1 -1
  290. package/modern/components/GridHeader.js +1 -1
  291. package/modern/components/GridRow.js +49 -28
  292. package/modern/components/GridRowCount.js +4 -6
  293. package/modern/components/GridScrollArea.js +4 -3
  294. package/modern/components/GridSelectedRowCount.js +4 -6
  295. package/modern/components/base/GridBody.js +43 -5
  296. package/modern/components/base/GridFooterPlaceholder.js +1 -1
  297. package/modern/components/base/GridOverlays.js +4 -4
  298. package/modern/components/cell/GridActionsCell.js +3 -3
  299. package/modern/components/cell/GridActionsCellItem.js +2 -2
  300. package/modern/components/cell/GridBooleanCell.js +1 -1
  301. package/modern/components/cell/GridCell.js +14 -12
  302. package/modern/components/cell/GridEditBooleanCell.js +2 -2
  303. package/modern/components/cell/GridEditInputCell.js +3 -6
  304. package/modern/components/cell/GridEditSingleSelectCell.js +30 -15
  305. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  306. package/{components/columnHeaders/GridColumnHeaders.js → modern/components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
  307. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
  308. package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -4
  309. package/modern/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  310. package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
  311. package/modern/components/columnHeaders/GridColumnHeaderTitle.js +9 -13
  312. package/modern/components/columnHeaders/GridColumnHeadersInner.js +6 -6
  313. package/modern/components/columnHeaders/GridIconButtonContainer.js +4 -6
  314. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  315. package/modern/components/columnSelection/GridHeaderCheckbox.js +2 -2
  316. package/modern/components/containers/GridFooterContainer.js +10 -15
  317. package/modern/components/containers/GridMainContainer.js +3 -5
  318. package/modern/components/containers/GridOverlay.js +7 -11
  319. package/modern/components/containers/GridRoot.js +4 -5
  320. package/modern/components/containers/GridRootStyles.js +7 -3
  321. package/modern/components/containers/GridToolbarContainer.js +4 -6
  322. package/modern/components/index.js +1 -1
  323. package/modern/components/menu/GridMenu.js +4 -6
  324. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  325. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  326. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  327. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  328. package/modern/components/panel/GridColumnsPanel.js +14 -16
  329. package/modern/components/panel/GridPanel.js +4 -0
  330. package/modern/components/panel/GridPanelContent.js +4 -6
  331. package/modern/components/panel/GridPanelFooter.js +4 -6
  332. package/modern/components/panel/GridPanelHeader.js +4 -6
  333. package/modern/components/panel/GridPanelWrapper.js +3 -5
  334. package/modern/components/panel/GridPreferencesPanel.js +3 -3
  335. package/modern/components/panel/filterPanel/GridFilterForm.js +49 -44
  336. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
  337. package/modern/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  338. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +24 -17
  339. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  340. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -24
  341. package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -4
  342. package/modern/components/panel/filterPanel/GridFilterPanel.js +34 -10
  343. package/modern/components/panel/filterPanel/filterPanelUtils.js +3 -9
  344. package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -3
  345. package/modern/components/toolbar/GridToolbarDensitySelector.js +8 -8
  346. package/modern/components/toolbar/GridToolbarExportContainer.js +3 -3
  347. package/modern/components/toolbar/GridToolbarFilterButton.js +8 -10
  348. package/modern/components/toolbar/GridToolbarQuickFilter.js +7 -6
  349. package/modern/components/virtualization/GridVirtualScroller.js +4 -6
  350. package/modern/components/virtualization/GridVirtualScrollerContent.js +4 -4
  351. package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
  352. package/modern/constants/defaultGridSlotsComponents.js +5 -54
  353. package/modern/constants/localeTextConstants.js +1 -0
  354. package/modern/hooks/core/useGridLocaleText.js +2 -4
  355. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
  356. package/modern/hooks/features/columns/useGridColumns.js +3 -3
  357. package/modern/hooks/features/filter/useGridFilter.js +3 -3
  358. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +34 -18
  359. package/modern/index.js +5 -1
  360. package/modern/internals/index.js +3 -2
  361. package/modern/internals/utils/computeSlots.js +17 -0
  362. package/modern/internals/utils/index.js +2 -0
  363. package/modern/internals/utils/slotsMigration.js +13 -0
  364. package/modern/locales/arSD.js +15 -19
  365. package/modern/locales/beBY.js +1 -0
  366. package/modern/locales/bgBG.js +1 -0
  367. package/modern/locales/csCZ.js +24 -31
  368. package/modern/locales/daDK.js +1 -0
  369. package/modern/locales/deDE.js +1 -0
  370. package/modern/locales/elGR.js +1 -0
  371. package/modern/locales/esES.js +2 -1
  372. package/modern/locales/faIR.js +1 -0
  373. package/modern/locales/fiFI.js +1 -0
  374. package/modern/locales/frFR.js +1 -0
  375. package/modern/locales/heIL.js +1 -0
  376. package/modern/locales/huHU.js +1 -0
  377. package/modern/locales/itIT.js +1 -0
  378. package/modern/locales/jaJP.js +1 -0
  379. package/modern/locales/koKR.js +1 -0
  380. package/modern/locales/nbNO.js +1 -0
  381. package/modern/locales/nlNL.js +1 -0
  382. package/modern/locales/plPL.js +1 -0
  383. package/modern/locales/ptBR.js +1 -0
  384. package/modern/locales/roRO.js +1 -0
  385. package/modern/locales/ruRU.js +1 -0
  386. package/modern/locales/skSK.js +1 -0
  387. package/modern/locales/svSE.js +1 -0
  388. package/modern/locales/trTR.js +1 -0
  389. package/modern/locales/ukUA.js +1 -0
  390. package/modern/locales/urPK.js +1 -0
  391. package/modern/locales/viVN.js +1 -0
  392. package/modern/locales/zhCN.js +1 -0
  393. package/modern/locales/zhTW.js +1 -0
  394. package/modern/material/components/MUISelectOption.js +16 -0
  395. package/modern/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
  396. package/modern/{components → material}/icons/index.js +7 -1
  397. package/modern/material/index.js +65 -0
  398. package/modern/models/gridFilterItem.js +2 -0
  399. package/modern/models/params/gridRowParams.js +4 -0
  400. package/node/DataGrid/DataGrid.js +10 -2
  401. package/node/DataGrid/useDataGridProps.js +21 -17
  402. package/node/colDef/gridSingleSelectColDef.js +12 -3
  403. package/node/components/GridColumnHeaders.js +116 -0
  404. package/node/components/GridFooter.js +1 -1
  405. package/node/components/GridHeader.js +1 -1
  406. package/node/components/GridRow.js +49 -28
  407. package/node/components/GridRowCount.js +5 -7
  408. package/node/components/GridScrollArea.js +5 -4
  409. package/node/components/GridSelectedRowCount.js +5 -7
  410. package/node/components/base/GridBody.js +43 -5
  411. package/node/components/base/GridFooterPlaceholder.js +1 -1
  412. package/node/components/base/GridOverlays.js +6 -6
  413. package/node/components/cell/GridActionsCell.js +3 -3
  414. package/node/components/cell/GridActionsCellItem.js +2 -2
  415. package/node/components/cell/GridBooleanCell.js +1 -1
  416. package/node/components/cell/GridCell.js +14 -11
  417. package/node/components/cell/GridEditBooleanCell.js +2 -2
  418. package/node/components/cell/GridEditInputCell.js +3 -6
  419. package/node/components/cell/GridEditSingleSelectCell.js +28 -14
  420. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  421. package/node/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +17 -23
  422. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
  423. package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -4
  424. package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
  425. package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
  426. package/node/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
  427. package/node/components/columnHeaders/GridColumnHeadersInner.js +7 -7
  428. package/node/components/columnHeaders/GridIconButtonContainer.js +5 -7
  429. package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
  430. package/node/components/columnSelection/GridHeaderCheckbox.js +2 -2
  431. package/node/components/containers/GridFooterContainer.js +11 -16
  432. package/node/components/containers/GridMainContainer.js +4 -6
  433. package/node/components/containers/GridOverlay.js +8 -12
  434. package/node/components/containers/GridRoot.js +4 -5
  435. package/node/components/containers/GridRootStyles.js +7 -3
  436. package/node/components/containers/GridToolbarContainer.js +5 -7
  437. package/node/components/index.js +1 -1
  438. package/node/components/menu/GridMenu.js +4 -6
  439. package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
  440. package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
  441. package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
  442. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
  443. package/node/components/panel/GridColumnsPanel.js +14 -16
  444. package/node/components/panel/GridPanel.js +4 -0
  445. package/node/components/panel/GridPanelContent.js +5 -7
  446. package/node/components/panel/GridPanelFooter.js +5 -7
  447. package/node/components/panel/GridPanelHeader.js +5 -7
  448. package/node/components/panel/GridPanelWrapper.js +3 -5
  449. package/node/components/panel/GridPreferencesPanel.js +3 -3
  450. package/node/components/panel/filterPanel/GridFilterForm.js +48 -44
  451. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
  452. package/node/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  453. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +23 -16
  454. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  455. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +50 -23
  456. package/node/components/panel/filterPanel/GridFilterInputValue.js +3 -4
  457. package/node/components/panel/filterPanel/GridFilterPanel.js +34 -10
  458. package/node/components/panel/filterPanel/filterPanelUtils.js +3 -10
  459. package/node/components/toolbar/GridToolbarColumnsButton.js +3 -3
  460. package/node/components/toolbar/GridToolbarDensitySelector.js +8 -8
  461. package/node/components/toolbar/GridToolbarExportContainer.js +3 -3
  462. package/node/components/toolbar/GridToolbarFilterButton.js +8 -10
  463. package/node/components/toolbar/GridToolbarQuickFilter.js +7 -6
  464. package/node/components/virtualization/GridVirtualScroller.js +5 -7
  465. package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
  466. package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -7
  467. package/node/constants/defaultGridSlotsComponents.js +4 -53
  468. package/node/constants/localeTextConstants.js +1 -0
  469. package/node/hooks/core/useGridLocaleText.js +2 -4
  470. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +21 -28
  471. package/node/hooks/features/columns/useGridColumns.js +3 -3
  472. package/node/hooks/features/filter/useGridFilter.js +3 -3
  473. package/node/hooks/features/virtualization/useGridVirtualScroller.js +33 -16
  474. package/node/index.js +9 -1
  475. package/node/internals/index.js +94 -4
  476. package/node/internals/utils/computeSlots.js +23 -0
  477. package/node/internals/utils/index.js +27 -0
  478. package/node/internals/utils/slotsMigration.js +21 -0
  479. package/node/locales/arSD.js +15 -19
  480. package/node/locales/beBY.js +1 -0
  481. package/node/locales/bgBG.js +1 -0
  482. package/node/locales/csCZ.js +24 -31
  483. package/node/locales/daDK.js +1 -0
  484. package/node/locales/deDE.js +1 -0
  485. package/node/locales/elGR.js +1 -0
  486. package/node/locales/esES.js +2 -1
  487. package/node/locales/faIR.js +1 -0
  488. package/node/locales/fiFI.js +1 -0
  489. package/node/locales/frFR.js +1 -0
  490. package/node/locales/heIL.js +1 -0
  491. package/node/locales/huHU.js +1 -0
  492. package/node/locales/itIT.js +1 -0
  493. package/node/locales/jaJP.js +1 -0
  494. package/node/locales/koKR.js +1 -0
  495. package/node/locales/nbNO.js +1 -0
  496. package/node/locales/nlNL.js +1 -0
  497. package/node/locales/plPL.js +1 -0
  498. package/node/locales/ptBR.js +1 -0
  499. package/node/locales/roRO.js +1 -0
  500. package/node/locales/ruRU.js +1 -0
  501. package/node/locales/skSK.js +1 -0
  502. package/node/locales/svSE.js +1 -0
  503. package/node/locales/trTR.js +1 -0
  504. package/node/locales/ukUA.js +1 -0
  505. package/node/locales/urPK.js +1 -0
  506. package/node/locales/viVN.js +1 -0
  507. package/node/locales/zhCN.js +1 -0
  508. package/node/locales/zhTW.js +1 -0
  509. package/node/{components/DataGridColumnHeaders.js → material/components/MUISelectOption.js} +13 -35
  510. package/node/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
  511. package/node/{components → material}/icons/index.js +10 -2
  512. package/node/material/index.js +73 -0
  513. package/node/models/gridFilterItem.js +2 -0
  514. package/node/models/params/gridRowParams.js +4 -0
  515. package/package.json +1 -1
  516. package/components/DataGridColumnHeaders.d.ts +0 -6
  517. package/components/DataGridColumnHeaders.js +0 -38
  518. package/components/columnHeaders/GridColumnHeaders.d.ts +0 -7
  519. package/legacy/components/DataGridColumnHeaders.js +0 -36
  520. package/modern/components/DataGridColumnHeaders.js +0 -38
  521. /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.d.ts +0 -0
@@ -5,7 +5,7 @@ const _excluded = ["align", "children", "colIndex", "colDef", "cellMode", "field
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
8
- import { unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
8
+ import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
9
9
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
10
  import { GridCellModes } from '../../models';
11
11
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
@@ -40,7 +40,7 @@ const useUtilityClasses = ownerState => {
40
40
  return composeClasses(slots, getDataGridUtilityClass, classes);
41
41
  };
42
42
  let warnedOnce = false;
43
- function GridCell(props) {
43
+ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
44
44
  var _rootProps$experiment;
45
45
  const {
46
46
  align,
@@ -74,6 +74,7 @@ function GridCell(props) {
74
74
  other = _objectWithoutPropertiesLoose(props, _excluded);
75
75
  const valueToRender = formattedValue == null ? value : formattedValue;
76
76
  const cellRef = React.useRef(null);
77
+ const handleRef = useForkRef(ref, cellRef);
77
78
  const focusElementRef = React.useRef(null);
78
79
  const apiRef = useGridApiContext();
79
80
  const rootProps = useGridRootProps();
@@ -175,7 +176,7 @@ function GridCell(props) {
175
176
  onDragOver: publish('cellDragOver', onDragOver)
176
177
  };
177
178
  return /*#__PURE__*/_jsx("div", _extends({
178
- ref: cellRef,
179
+ ref: handleRef,
179
180
  className: clsx(className, classes.root),
180
181
  role: "cell",
181
182
  "data-field": field,
@@ -195,23 +196,24 @@ function GridCell(props) {
195
196
  onFocus: handleFocus,
196
197
  children: renderChildren()
197
198
  }));
198
- }
199
+ });
200
+ const MemoizedCell = /*#__PURE__*/React.memo(GridCell);
199
201
  process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
200
202
  // ----------------------------- Warning --------------------------------
201
203
  // | These PropTypes are generated from the TypeScript type definitions |
202
204
  // | To update them edit the TypeScript types and run "yarn proptypes" |
203
205
  // ----------------------------------------------------------------------
204
- align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,
206
+ align: PropTypes.oneOf(['center', 'left', 'right']),
205
207
  cellMode: PropTypes.oneOf(['edit', 'view']),
206
208
  children: PropTypes.node,
207
209
  className: PropTypes.string,
208
- colIndex: PropTypes.number.isRequired,
210
+ colIndex: PropTypes.number,
209
211
  colSpan: PropTypes.number,
210
212
  disableDragEvents: PropTypes.bool,
211
- field: PropTypes.string.isRequired,
213
+ field: PropTypes.string,
212
214
  formattedValue: PropTypes.any,
213
215
  hasFocus: PropTypes.bool,
214
- height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
216
+ height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
215
217
  isEditable: PropTypes.bool,
216
218
  isSelected: PropTypes.bool,
217
219
  onClick: PropTypes.func,
@@ -221,10 +223,10 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
221
223
  onKeyDown: PropTypes.func,
222
224
  onMouseDown: PropTypes.func,
223
225
  onMouseUp: PropTypes.func,
224
- rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
226
+ rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
225
227
  showRightBorder: PropTypes.bool,
226
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
228
+ tabIndex: PropTypes.oneOf([-1, 0]),
227
229
  value: PropTypes.any,
228
- width: PropTypes.number.isRequired
230
+ width: PropTypes.number
229
231
  } : void 0;
230
- export { GridCell };
232
+ export { MemoizedCell as GridCell };
@@ -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 = {
@@ -8,7 +8,6 @@ import { styled } from '@mui/material/styles';
8
8
  import InputBase from '@mui/material/InputBase';
9
9
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
10
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
11
- import { GridLoadIcon } from '../icons/index';
12
11
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
  const useUtilityClasses = ownerState => {
@@ -49,10 +48,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
49
48
  const apiRef = useGridApiContext();
50
49
  const inputRef = React.useRef();
51
50
  const [valueState, setValueState] = React.useState(value);
52
- const ownerState = {
53
- classes: rootProps.classes
54
- };
55
- const classes = useUtilityClasses(ownerState);
51
+ const classes = useUtilityClasses(rootProps);
56
52
  const handleChange = React.useCallback(async event => {
57
53
  const newValue = event.target.value;
58
54
  if (onValueChange) {
@@ -87,11 +83,12 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
87
83
  ref: ref,
88
84
  inputRef: inputRef,
89
85
  className: classes.root,
86
+ ownerState: rootProps,
90
87
  fullWidth: true,
91
88
  type: colDef.type === 'number' ? colDef.type : 'text',
92
89
  value: valueState != null ? valueState : '',
93
90
  onChange: handleChange,
94
- endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(GridLoadIcon, {}) : undefined
91
+ endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {}) : undefined
95
92
  }, other));
96
93
  });
97
94
  process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
@@ -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,21 +1,21 @@
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';
7
- import MenuItem from '@mui/material/MenuItem';
8
7
  import { isEscapeKey } from '../../utils/keyboardUtils';
9
8
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
9
  import { GridEditModes } from '../../models/gridEditRowModel';
11
- import { getLabelFromValueOption, getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
10
+ import { getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
12
11
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
12
+ import { createElement as _createElement } from "react";
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
  }
@@ -91,8 +97,10 @@ function GridEditSingleSelectCell(props) {
91
97
  }
92
98
  setOpen(true);
93
99
  };
94
- const OptionComponent = isSelectNative ? 'option' : MenuItem;
95
- return /*#__PURE__*/_jsx(rootProps.components.BaseSelect, _extends({
100
+ if (!valueOptions || !colDef) {
101
+ return null;
102
+ }
103
+ return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
96
104
  ref: ref,
97
105
  inputRef: inputRef,
98
106
  value: valueProp,
@@ -105,13 +113,15 @@ function GridEditSingleSelectCell(props) {
105
113
  error: error,
106
114
  native: isSelectNative,
107
115
  fullWidth: true
108
- }, other, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect, {
116
+ }, other, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect, {
109
117
  children: valueOptions.map(valueOption => {
110
- const value = typeof valueOption === 'object' ? valueOption.value : valueOption;
111
- return /*#__PURE__*/_jsx(OptionComponent, {
112
- value: value,
113
- children: getOptionLabel(valueOption)
114
- }, value);
118
+ var _rootProps$slotProps3;
119
+ const value = getOptionValue(valueOption);
120
+ return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, ((_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelectOption) || {}, {
121
+ native: isSelectNative,
122
+ key: value,
123
+ value: value
124
+ }), getOptionLabel(valueOption));
115
125
  })
116
126
  }));
117
127
  }
@@ -142,11 +152,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
142
152
  */
143
153
  formattedValue: PropTypes.any,
144
154
  /**
145
- * Used to determine the text displayed for a given value option.
155
+ * Used to determine the label displayed for a given value option.
146
156
  * @param {ValueOptions} value The current value option.
147
157
  * @returns {string} The text to be displayed.
148
158
  */
149
159
  getOptionLabel: PropTypes.func,
160
+ /**
161
+ * Used to determine the value used for a value option.
162
+ * @param {ValueOptions} value The current value option.
163
+ * @returns {string} The value to be used.
164
+ */
165
+ getOptionValue: PropTypes.func,
150
166
  /**
151
167
  * If true, the cell is the active element.
152
168
  */
@@ -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
  }))
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/system';
3
+ interface GridBaseColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ sx?: SxProps<Theme>;
5
+ }
6
+ export declare const GridBaseColumnHeaders: React.ForwardRefExoticComponent<GridBaseColumnHeadersProps & React.RefAttributes<HTMLDivElement>>;
7
+ export {};
@@ -4,7 +4,7 @@ const _excluded = ["className"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
- import { styled } from '@mui/material/styles';
7
+ import { styled } from '@mui/system';
8
8
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,32 +21,26 @@ const GridColumnHeadersRoot = styled('div', {
21
21
  name: 'MuiDataGrid',
22
22
  slot: 'ColumnHeaders',
23
23
  overridesResolver: (props, styles) => styles.columnHeaders
24
- })(({
25
- theme
26
- }) => {
27
- return {
28
- position: 'relative',
29
- overflow: 'hidden',
30
- display: 'flex',
31
- alignItems: 'center',
32
- boxSizing: 'border-box',
33
- borderBottom: '1px solid',
34
- borderTopLeftRadius: theme.shape.borderRadius,
35
- borderTopRightRadius: theme.shape.borderRadius
36
- };
24
+ })({
25
+ position: 'relative',
26
+ overflow: 'hidden',
27
+ display: 'flex',
28
+ alignItems: 'center',
29
+ boxSizing: 'border-box',
30
+ borderBottom: '1px solid',
31
+ borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
32
+ borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
37
33
  });
38
- export const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
34
+ export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
39
35
  const {
40
36
  className
41
37
  } = props,
42
38
  other = _objectWithoutPropertiesLoose(props, _excluded);
43
39
  const rootProps = useGridRootProps();
44
- const ownerState = {
45
- classes: rootProps.classes
46
- };
47
- const classes = useUtilityClasses(ownerState);
40
+ const classes = useUtilityClasses(rootProps);
48
41
  return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
49
42
  ref: ref,
50
- className: clsx(className, classes.root)
43
+ className: clsx(className, classes.root),
44
+ ownerState: rootProps
51
45
  }, other));
52
46
  });
@@ -21,7 +21,7 @@ const useUtilityClasses = ownerState => {
21
21
  return composeClasses(slots, getDataGridUtilityClass, classes);
22
22
  };
23
23
  function GridColumnHeaderFilterIconButton(props) {
24
- var _rootProps$components, _rootProps$components2;
24
+ var _rootProps$slotProps, _rootProps$slotProps2;
25
25
  const {
26
26
  counter,
27
27
  field,
@@ -52,22 +52,22 @@ function GridColumnHeaderFilterIconButton(props) {
52
52
  if (!counter) {
53
53
  return null;
54
54
  }
55
- const iconButton = /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
55
+ const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
56
56
  onClick: toggleFilter,
57
57
  color: "default",
58
58
  "aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
59
59
  size: "small",
60
60
  tabIndex: -1
61
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
62
- children: /*#__PURE__*/_jsx(rootProps.components.ColumnFilteredIcon, {
61
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
62
+ children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
63
63
  className: classes.icon,
64
64
  fontSize: "small"
65
65
  })
66
66
  }));
67
- return /*#__PURE__*/_jsx(rootProps.components.BaseTooltip, _extends({
67
+ return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
68
68
  title: apiRef.current.getLocaleText('columnHeaderFiltersTooltipActive')(counter),
69
69
  enterDelay: 1000
70
- }, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseTooltip, {
70
+ }, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseTooltip, {
71
71
  children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {
72
72
  children: [counter > 1 && /*#__PURE__*/_jsx(Badge, {
73
73
  badgeContent: counter,
@@ -33,7 +33,7 @@ const useUtilityClasses = ownerState => {
33
33
  return composeClasses(slots, getDataGridUtilityClass, classes);
34
34
  };
35
35
  function GridColumnHeaderItem(props) {
36
- var _rootProps$components, _colDef$sortingOrder, _rootProps$components2, _colDef$headerName;
36
+ var _rootProps$slotProps, _colDef$sortingOrder, _rootProps$slotProps2, _colDef$headerName;
37
37
  const {
38
38
  colDef,
39
39
  columnMenuOpen,
@@ -118,16 +118,16 @@ function GridColumnHeaderItem(props) {
118
118
  field: colDef.field,
119
119
  open: columnMenuOpen,
120
120
  target: iconButtonRef.current,
121
- ContentComponent: rootProps.components.ColumnMenu,
122
- contentComponentProps: (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.columnMenu,
121
+ ContentComponent: rootProps.slots.columnMenu,
122
+ contentComponentProps: (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.columnMenu,
123
123
  onExited: handleExited
124
124
  });
125
125
  const sortingOrder = (_colDef$sortingOrder = colDef.sortingOrder) != null ? _colDef$sortingOrder : rootProps.sortingOrder;
126
126
  const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
127
- children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.components.ColumnHeaderFilterIconButton, _extends({
127
+ children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({
128
128
  field: colDef.field,
129
129
  counter: filterItemsCounter
130
- }, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.columnHeaderFilterIconButton)), colDef.sortable && !colDef.hideSortIcons && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
130
+ }, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.columnHeaderFilterIconButton)), colDef.sortable && !colDef.hideSortIcons && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
131
131
  direction: sortDirection,
132
132
  index: sortIndex,
133
133
  sortingOrder: sortingOrder
@@ -52,7 +52,7 @@ function GridColumnHeaderSeparatorRaw(props) {
52
52
  }
53
53
  }, other, {
54
54
  onClick: stopClick,
55
- children: /*#__PURE__*/_jsx(rootProps.components.ColumnResizeIcon, {
55
+ children: /*#__PURE__*/_jsx(rootProps.slots.columnResizeIcon, {
56
56
  className: classes.icon
57
57
  })
58
58
  }))
@@ -22,11 +22,11 @@ function getIcon(icons, direction, className, sortingOrder) {
22
22
  let Icon;
23
23
  const iconProps = {};
24
24
  if (direction === 'asc') {
25
- Icon = icons.ColumnSortedAscendingIcon;
25
+ Icon = icons.columnSortedAscendingIcon;
26
26
  } else if (direction === 'desc') {
27
- Icon = icons.ColumnSortedDescendingIcon;
27
+ Icon = icons.columnSortedDescendingIcon;
28
28
  } else {
29
- Icon = icons.ColumnUnsortedIcon;
29
+ Icon = icons.columnUnsortedIcon;
30
30
  iconProps.sortingOrder = sortingOrder;
31
31
  }
32
32
  return Icon ? /*#__PURE__*/_jsx(Icon, _extends({
@@ -35,7 +35,7 @@ function getIcon(icons, direction, className, sortingOrder) {
35
35
  }, iconProps)) : null;
36
36
  }
37
37
  function GridColumnHeaderSortIconRaw(props) {
38
- var _rootProps$components;
38
+ var _rootProps$slotProps;
39
39
  const {
40
40
  direction,
41
41
  index,
@@ -47,16 +47,16 @@ function GridColumnHeaderSortIconRaw(props) {
47
47
  classes: rootProps.classes
48
48
  });
49
49
  const classes = useUtilityClasses(ownerState);
50
- const iconElement = getIcon(rootProps.components, direction, classes.icon, sortingOrder);
50
+ const iconElement = getIcon(rootProps.slots, direction, classes.icon, sortingOrder);
51
51
  if (!iconElement) {
52
52
  return null;
53
53
  }
54
- const iconButton = /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
54
+ const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
55
55
  tabIndex: -1,
56
56
  "aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
57
57
  title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
58
58
  size: "small"
59
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
59
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
60
60
  children: iconElement
61
61
  }));
62
62
  return /*#__PURE__*/_jsxs(GridIconButtonContainer, {
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
8
- import { styled } from '@mui/material/styles';
8
+ import { styled } from '@mui/system';
9
9
  import { isOverflown } from '../../utils/domUtils';
10
10
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
11
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
@@ -23,32 +23,28 @@ const GridColumnHeaderTitleRoot = styled('div', {
23
23
  name: 'MuiDataGrid',
24
24
  slot: 'ColumnHeaderTitle',
25
25
  overridesResolver: (props, styles) => styles.columnHeaderTitle
26
- })(({
27
- theme
28
- }) => ({
26
+ })({
29
27
  textOverflow: 'ellipsis',
30
28
  overflow: 'hidden',
31
29
  whiteSpace: 'nowrap',
32
- fontWeight: theme.typography.fontWeightMedium
33
- }));
30
+ fontWeight: 'var(--unstable_DataGrid-headWeight)'
31
+ });
34
32
  const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeaderInnerTitle(props, ref) {
35
33
  const {
36
34
  className
37
35
  } = props,
38
36
  other = _objectWithoutPropertiesLoose(props, _excluded);
39
37
  const rootProps = useGridRootProps();
40
- const ownerState = {
41
- classes: rootProps.classes
42
- };
43
- const classes = useUtilityClasses(ownerState);
38
+ const classes = useUtilityClasses(rootProps);
44
39
  return /*#__PURE__*/_jsx(GridColumnHeaderTitleRoot, _extends({
45
40
  ref: ref,
46
- className: clsx(classes.root, className)
41
+ className: clsx(classes.root, className),
42
+ ownerState: rootProps
47
43
  }, other));
48
44
  });
49
45
  // No React.memo here as if we display the sort icon, we need to recalculate the isOver
50
46
  function GridColumnHeaderTitle(props) {
51
- var _rootProps$components;
47
+ var _rootProps$slotProps;
52
48
  const {
53
49
  label,
54
50
  description,
@@ -67,9 +63,9 @@ function GridColumnHeaderTitle(props) {
67
63
  }
68
64
  }
69
65
  }, [titleRef, columnWidth, description, label]);
70
- return /*#__PURE__*/_jsx(rootProps.components.BaseTooltip, _extends({
66
+ return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
71
67
  title: description || tooltip
72
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTooltip, {
68
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
73
69
  children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {
74
70
  ref: titleRef,
75
71
  children: label
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SxProps, Theme } from '@mui/material/styles';
2
+ import { SxProps, Theme } from '@mui/system';
3
3
  interface GridColumnHeadersInnerProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  isDragging: boolean;
5
5
  sx?: SxProps<Theme>;
@@ -4,7 +4,7 @@ const _excluded = ["isDragging", "className"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
- import { styled } from '@mui/material/styles';
7
+ import { styled } from '@mui/system';
8
8
  import { gridClasses, getDataGridUtilityClass } from '../../constants/gridClasses';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
@@ -46,14 +46,14 @@ export const GridColumnHeadersInner = /*#__PURE__*/React.forwardRef(function Gri
46
46
  other = _objectWithoutPropertiesLoose(props, _excluded);
47
47
  const apiRef = useGridApiContext();
48
48
  const rootProps = useGridRootProps();
49
- const ownerState = {
49
+ const ownerState = _extends({}, rootProps, {
50
50
  isDragging,
51
- hasScrollX: (_apiRef$current$getRo = (_apiRef$current$getRo2 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo2.hasScrollX) != null ? _apiRef$current$getRo : false,
52
- classes: rootProps.classes
53
- };
51
+ hasScrollX: (_apiRef$current$getRo = (_apiRef$current$getRo2 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo2.hasScrollX) != null ? _apiRef$current$getRo : false
52
+ });
54
53
  const classes = useUtilityClasses(ownerState);
55
54
  return /*#__PURE__*/_jsx(GridColumnHeadersInnerRoot, _extends({
56
55
  ref: ref,
57
- className: clsx(className, classes.root)
56
+ className: clsx(className, classes.root),
57
+ ownerState: ownerState
58
58
  }, other));
59
59
  });
@@ -4,7 +4,7 @@ const _excluded = ["className"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
7
- import { styled } from '@mui/material/styles';
7
+ import { styled } from '@mui/system';
8
8
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -32,12 +32,10 @@ export const GridIconButtonContainer = /*#__PURE__*/React.forwardRef(function Gr
32
32
  } = props,
33
33
  other = _objectWithoutPropertiesLoose(props, _excluded);
34
34
  const rootProps = useGridRootProps();
35
- const ownerState = {
36
- classes: rootProps.classes
37
- };
38
- const classes = useUtilityClasses(ownerState);
35
+ const classes = useUtilityClasses(rootProps);
39
36
  return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({
40
37
  ref: ref,
41
- className: clsx(classes.root, className)
38
+ className: clsx(classes.root, className),
39
+ ownerState: rootProps
42
40
  }, other));
43
41
  });
@@ -19,7 +19,7 @@ const useUtilityClasses = ownerState => {
19
19
  return composeClasses(slots, getDataGridUtilityClass, classes);
20
20
  };
21
21
  const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCellCheckboxRenderer(props, ref) {
22
- var _rootProps$components;
22
+ var _rootProps$slotProps;
23
23
  const {
24
24
  field,
25
25
  id,
@@ -75,7 +75,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
75
75
  }
76
76
  const isSelectable = apiRef.current.isRowSelectable(id);
77
77
  const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
78
- return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
78
+ return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
79
79
  ref: handleRef,
80
80
  tabIndex: tabIndex,
81
81
  checked: isChecked,
@@ -87,7 +87,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
87
87
  onKeyDown: handleKeyDown,
88
88
  disabled: !isSelectable,
89
89
  touchRippleRef: rippleRef
90
- }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseCheckbox, other));
90
+ }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox, other));
91
91
  });
92
92
  process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
93
93
  // ----------------------------- Warning --------------------------------