@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
@@ -10,9 +10,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _utils = require("@mui/utils");
13
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
14
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
15
- var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
16
13
  var _styles = require("@mui/material/styles");
17
14
  var _clsx = _interopRequireDefault(require("clsx"));
18
15
  var _gridColumnsSelector = require("../../../hooks/features/columns/gridColumnsSelector");
@@ -51,7 +48,7 @@ const GridFilterFormRoot = (0, _styles.styled)('div', {
51
48
  display: 'flex',
52
49
  padding: theme.spacing(1)
53
50
  }));
54
- const FilterFormDeleteIcon = (0, _styles.styled)(_FormControl.default, {
51
+ const FilterFormDeleteIcon = (0, _styles.styled)('div', {
55
52
  name: 'MuiDataGrid',
56
53
  slot: 'FilterFormDeleteIcon',
57
54
  overridesResolver: (_, styles) => styles.filterFormDeleteIcon
@@ -63,7 +60,7 @@ const FilterFormDeleteIcon = (0, _styles.styled)(_FormControl.default, {
63
60
  marginRight: theme.spacing(0.5),
64
61
  marginBottom: theme.spacing(0.2)
65
62
  }));
66
- const FilterFormLogicOperatorInput = (0, _styles.styled)(_FormControl.default, {
63
+ const FilterFormLogicOperatorInput = (0, _styles.styled)('div', {
67
64
  name: 'MuiDataGrid',
68
65
  slot: 'FilterFormLogicOperatorInput',
69
66
  overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput
@@ -72,21 +69,21 @@ const FilterFormLogicOperatorInput = (0, _styles.styled)(_FormControl.default, {
72
69
  marginRight: 5,
73
70
  justifyContent: 'end'
74
71
  });
75
- const FilterFormColumnInput = (0, _styles.styled)(_FormControl.default, {
72
+ const FilterFormColumnInput = (0, _styles.styled)('div', {
76
73
  name: 'MuiDataGrid',
77
74
  slot: 'FilterFormColumnInput',
78
75
  overridesResolver: (_, styles) => styles.filterFormColumnInput
79
76
  })({
80
77
  width: 150
81
78
  });
82
- const FilterFormOperatorInput = (0, _styles.styled)(_FormControl.default, {
79
+ const FilterFormOperatorInput = (0, _styles.styled)('div', {
83
80
  name: 'MuiDataGrid',
84
81
  slot: 'FilterFormOperatorInput',
85
82
  overridesResolver: (_, styles) => styles.filterFormOperatorInput
86
83
  })({
87
84
  width: 120
88
85
  });
89
- const FilterFormValueInput = (0, _styles.styled)(_FormControl.default, {
86
+ const FilterFormValueInput = (0, _styles.styled)('div', {
90
87
  name: 'MuiDataGrid',
91
88
  slot: 'FilterFormValueInput',
92
89
  overridesResolver: (_, styles) => styles.filterFormValueInput
@@ -134,17 +131,15 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
134
131
  const operatorSelectId = (0, _utils.unstable_useId)();
135
132
  const operatorSelectLabelId = (0, _utils.unstable_useId)();
136
133
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
137
- const ownerState = {
138
- classes: rootProps.classes
139
- };
140
- const classes = useUtilityClasses(ownerState);
134
+ const classes = useUtilityClasses(rootProps);
141
135
  const valueRef = React.useRef(null);
142
136
  const filterSelectorRef = React.useRef(null);
143
137
  const hasLogicOperatorColumn = hasMultipleFilters && logicOperators.length > 0;
144
- const baseFormControlProps = rootProps.componentsProps?.baseFormControl || {};
145
- const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
138
+ const baseFormControlProps = rootProps.slotProps?.baseFormControl || {};
139
+ const baseSelectProps = rootProps.slotProps?.baseSelect || {};
146
140
  const isBaseSelectNative = baseSelectProps.native ?? true;
147
- const OptionComponent = isBaseSelectNative ? 'option' : _MenuItem.default;
141
+ const baseInputLabelProps = rootProps.slotProps?.baseInputLabel || {};
142
+ const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
148
143
  const {
149
144
  InputComponentProps
150
145
  } = valueInputProps,
@@ -235,33 +230,36 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
235
230
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridFilterFormRoot, (0, _extends2.default)({
236
231
  ref: ref,
237
232
  className: classes.root,
238
- "data-id": item.id
233
+ "data-id": item.id,
234
+ ownerState: rootProps
239
235
  }, other, {
240
236
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterFormDeleteIcon, (0, _extends2.default)({
241
237
  variant: "standard",
242
- as: rootProps.components.BaseFormControl
238
+ as: rootProps.slots.baseFormControl
243
239
  }, baseFormControlProps, deleteIconProps, {
244
240
  className: (0, _clsx.default)(classes.deleteIcon, baseFormControlProps.className, deleteIconProps.className),
245
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseIconButton, (0, _extends2.default)({
241
+ ownerState: rootProps,
242
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
246
243
  "aria-label": apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
247
244
  title: apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
248
245
  onClick: handleDeleteFilter,
249
246
  size: "small"
250
- }, rootProps.componentsProps?.baseIconButton, {
251
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.FilterPanelDeleteIcon, {
247
+ }, rootProps.slotProps?.baseIconButton, {
248
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.filterPanelDeleteIcon, {
252
249
  fontSize: "small"
253
250
  })
254
251
  }))
255
252
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterFormLogicOperatorInput, (0, _extends2.default)({
256
253
  variant: "standard",
257
- as: rootProps.components.BaseFormControl
254
+ as: rootProps.slots.baseFormControl
258
255
  }, baseFormControlProps, logicOperatorInputProps, {
259
256
  sx: (0, _extends2.default)({
260
257
  display: hasLogicOperatorColumn ? 'flex' : 'none',
261
258
  visibility: showMultiFilterOperators ? 'visible' : 'hidden'
262
259
  }, baseFormControlProps.sx || {}, logicOperatorInputProps.sx || {}),
263
260
  className: (0, _clsx.default)(classes.logicOperatorInput, baseFormControlProps.className, logicOperatorInputProps.className),
264
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseSelect, (0, _extends2.default)({
261
+ ownerState: rootProps,
262
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
265
263
  inputProps: {
266
264
  'aria-label': apiRef.current.getLocaleText('filterPanelLogicOperator')
267
265
  },
@@ -269,44 +267,48 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
269
267
  onChange: changeLogicOperator,
270
268
  disabled: !!disableMultiFilterOperator || logicOperators.length === 1,
271
269
  native: isBaseSelectNative
272
- }, rootProps.componentsProps?.baseSelect, {
273
- children: logicOperators.map(logicOperator => /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
274
- value: logicOperator.toString(),
275
- children: apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))
276
- }, logicOperator.toString()))
270
+ }, rootProps.slotProps?.baseSelect, {
271
+ children: logicOperators.map(logicOperator => /*#__PURE__*/(0, React.createElement)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
272
+ native: isBaseSelectNative,
273
+ key: logicOperator.toString(),
274
+ value: logicOperator.toString()
275
+ }), apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))))
277
276
  }))
278
277
  })), /*#__PURE__*/(0, _jsxRuntime.jsxs)(FilterFormColumnInput, (0, _extends2.default)({
279
278
  variant: "standard",
280
- as: rootProps.components.BaseFormControl
279
+ as: rootProps.slots.baseFormControl
281
280
  }, baseFormControlProps, columnInputProps, {
282
281
  className: (0, _clsx.default)(classes.columnInput, baseFormControlProps.className, columnInputProps.className),
283
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
282
+ ownerState: rootProps,
283
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, baseInputLabelProps, {
284
284
  htmlFor: columnSelectId,
285
285
  id: columnSelectLabelId,
286
286
  children: apiRef.current.getLocaleText('filterPanelColumns')
287
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseSelect, (0, _extends2.default)({
287
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
288
288
  labelId: columnSelectLabelId,
289
289
  id: columnSelectId,
290
290
  label: apiRef.current.getLocaleText('filterPanelColumns'),
291
291
  value: item.field || '',
292
292
  onChange: changeColumn,
293
293
  native: isBaseSelectNative
294
- }, rootProps.componentsProps?.baseSelect, {
295
- children: sortedFilteredColumns.map(col => /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
296
- value: col.field,
297
- children: getColumnLabel(col)
298
- }, col.field))
294
+ }, rootProps.slotProps?.baseSelect, {
295
+ children: sortedFilteredColumns.map(col => /*#__PURE__*/(0, React.createElement)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
296
+ native: isBaseSelectNative,
297
+ key: col.field,
298
+ value: col.field
299
+ }), getColumnLabel(col)))
299
300
  }))]
300
301
  })), /*#__PURE__*/(0, _jsxRuntime.jsxs)(FilterFormOperatorInput, (0, _extends2.default)({
301
302
  variant: "standard",
302
- as: rootProps.components.BaseFormControl
303
+ as: rootProps.slots.baseFormControl
303
304
  }, baseFormControlProps, operatorInputProps, {
304
305
  className: (0, _clsx.default)(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),
305
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
306
+ ownerState: rootProps,
307
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, baseInputLabelProps, {
306
308
  htmlFor: operatorSelectId,
307
309
  id: operatorSelectLabelId,
308
310
  children: apiRef.current.getLocaleText('filterPanelOperator')
309
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseSelect, (0, _extends2.default)({
311
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
310
312
  labelId: operatorSelectLabelId,
311
313
  label: apiRef.current.getLocaleText('filterPanelOperator'),
312
314
  id: operatorSelectId,
@@ -314,17 +316,19 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
314
316
  onChange: changeOperator,
315
317
  native: isBaseSelectNative,
316
318
  inputRef: filterSelectorRef
317
- }, rootProps.componentsProps?.baseSelect, {
318
- children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
319
- value: operator.value,
320
- children: operator.label || apiRef.current.getLocaleText(`filterOperator${(0, _utils.unstable_capitalize)(operator.value)}`)
321
- }, operator.value))
319
+ }, rootProps.slotProps?.baseSelect, {
320
+ children: currentColumn?.filterOperators?.map(operator => /*#__PURE__*/(0, React.createElement)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
321
+ native: isBaseSelectNative,
322
+ key: operator.value,
323
+ value: operator.value
324
+ }), operator.label || apiRef.current.getLocaleText(`filterOperator${(0, _utils.unstable_capitalize)(operator.value)}`)))
322
325
  }))]
323
326
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterFormValueInput, (0, _extends2.default)({
324
327
  variant: "standard",
325
- as: rootProps.components.BaseFormControl
328
+ as: rootProps.slots.baseFormControl
326
329
  }, baseFormControlProps, valueInputPropsOther, {
327
330
  className: (0, _clsx.default)(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
331
+ ownerState: rootProps,
328
332
  children: currentOperator?.InputComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(currentOperator.InputComponent, (0, _extends2.default)({
329
333
  apiRef: apiRef,
330
334
  item: item,
@@ -8,7 +8,6 @@ exports.GridFilterInputBoolean = GridFilterInputBoolean;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
12
11
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
@@ -24,9 +23,9 @@ function GridFilterInputBoolean(props) {
24
23
  others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
25
24
  const [filterValueState, setFilterValueState] = React.useState(item.value || '');
26
25
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
27
- const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
26
+ const baseSelectProps = rootProps.slotProps?.baseSelect || {};
28
27
  const isSelectNative = baseSelectProps.native ?? true;
29
- const OptionComponent = isSelectNative ? 'option' : _MenuItem.default;
28
+ const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
30
29
  const onFilterChange = React.useCallback(event => {
31
30
  const value = event.target.value;
32
31
  setFilterValueState(value);
@@ -37,7 +36,8 @@ function GridFilterInputBoolean(props) {
37
36
  React.useEffect(() => {
38
37
  setFilterValueState(item.value || '');
39
38
  }, [item.value]);
40
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.components.BaseTextField, (0, _extends2.default)({
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseTextField, (0, _extends2.default)({
40
+ // TODO: use baseSelect slot
41
41
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
42
42
  value: filterValueState,
43
43
  onChange: onFilterChange,
@@ -46,21 +46,24 @@ function GridFilterInputBoolean(props) {
46
46
  SelectProps: (0, _extends2.default)({
47
47
  native: isSelectNative,
48
48
  displayEmpty: true
49
- }, rootProps.componentsProps?.baseSelect),
49
+ }, rootProps.slotProps?.baseSelect),
50
50
  InputLabelProps: {
51
51
  shrink: true
52
52
  },
53
53
  inputRef: focusElementRef
54
- }, others, rootProps.componentsProps?.baseTextField, {
55
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
54
+ }, others, rootProps.slotProps?.baseTextField, {
55
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
56
+ native: isSelectNative,
56
57
  value: "",
57
58
  children: apiRef.current.getLocaleText('filterValueAny')
58
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
59
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
60
+ native: isSelectNative,
59
61
  value: "true",
60
62
  children: apiRef.current.getLocaleText('filterValueTrue')
61
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
63
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
64
+ native: isSelectNative,
62
65
  value: "false",
63
66
  children: apiRef.current.getLocaleText('filterValueFalse')
64
- })]
67
+ }))]
65
68
  }));
66
69
  }
@@ -11,7 +11,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _utils = require("@mui/utils");
14
- var _icons = require("../../icons");
15
14
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
16
  const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps"];
@@ -55,7 +54,7 @@ function GridFilterInputDate(props) {
55
54
  const itemValue = item.value ?? '';
56
55
  setFilterValueState(String(itemValue));
57
56
  }, [item.value]);
58
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({
57
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
59
58
  id: id,
60
59
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
61
60
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
@@ -68,13 +67,13 @@ function GridFilterInputDate(props) {
68
67
  },
69
68
  inputRef: focusElementRef,
70
69
  InputProps: (0, _extends2.default)({}, applying ? {
71
- endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridLoadIcon, {})
70
+ endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {})
72
71
  } : {}, InputProps, {
73
72
  inputProps: (0, _extends2.default)({
74
73
  max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
75
74
  }, InputProps?.inputProps)
76
75
  })
77
- }, other, rootProps.componentsProps?.baseTextField));
76
+ }, other, rootProps.slotProps?.baseTextField));
78
77
  }
79
78
  process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
80
79
  // ----------------------------- Warning --------------------------------
@@ -15,10 +15,9 @@ var _utils = require("@mui/utils");
15
15
  var _filterPanelUtils = require("./filterPanelUtils");
16
16
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant", "getOptionLabel"];
18
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant", "getOptionLabel", "getOptionValue"];
19
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
- const isOptionEqualToValue = (option, value) => (0, _filterPanelUtils.getValueFromOption)(option) === (0, _filterPanelUtils.getValueFromOption)(value);
22
21
  const filter = (0, _Autocomplete.createFilterOptions)();
23
22
  function GridFilterInputMultipleSingleSelect(props) {
24
23
  const {
@@ -31,7 +30,8 @@ function GridFilterInputMultipleSingleSelect(props) {
31
30
  helperText,
32
31
  size,
33
32
  variant = 'standard',
34
- getOptionLabel = _filterPanelUtils.getLabelFromValueOption
33
+ getOptionLabel: getOptionLabelProp,
34
+ getOptionValue: getOptionValueProp
35
35
  } = props,
36
36
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
37
37
  const TextFieldProps = {
@@ -50,6 +50,9 @@ function GridFilterInputMultipleSingleSelect(props) {
50
50
  resolvedColumn = column;
51
51
  }
52
52
  }
53
+ const getOptionValue = getOptionValueProp || resolvedColumn?.getOptionValue;
54
+ const getOptionLabel = getOptionLabelProp || resolvedColumn?.getOptionLabel;
55
+ const isOptionEqualToValue = React.useCallback((option, value) => getOptionValue(option) === getOptionValue(value), [getOptionValue]);
53
56
  const resolvedValueOptions = React.useMemo(() => {
54
57
  if (!resolvedColumn?.valueOptions) {
55
58
  return [];
@@ -62,8 +65,8 @@ function GridFilterInputMultipleSingleSelect(props) {
62
65
  return resolvedColumn.valueOptions;
63
66
  }, [resolvedColumn]);
64
67
  const resolvedFormattedValueOptions = React.useMemo(() => {
65
- return resolvedValueOptions?.map(_filterPanelUtils.getValueFromOption);
66
- }, [resolvedValueOptions]);
68
+ return resolvedValueOptions?.map(getOptionValue);
69
+ }, [resolvedValueOptions, getOptionValue]);
67
70
 
68
71
  // The value is computed from the item.value and used directly
69
72
  // If it was done by a useEffect/useState, the Autocomplete could receive incoherent value and options
@@ -73,10 +76,8 @@ function GridFilterInputMultipleSingleSelect(props) {
73
76
  }
74
77
  if (resolvedValueOptions !== undefined) {
75
78
  const itemValueIndexes = item.value.map(element => {
76
- // get the index matching between values and valueOptions
77
- const formattedElement = (0, _filterPanelUtils.getValueFromOption)(element);
78
- const index = resolvedFormattedValueOptions?.findIndex(formatedOption => formatedOption === formattedElement) || 0;
79
- return index;
79
+ // Gets the index matching between values and valueOptions
80
+ return resolvedFormattedValueOptions?.findIndex(formatedOption => formatedOption === element);
80
81
  });
81
82
  return itemValueIndexes.filter(index => index >= 0).map(index => resolvedValueOptions[index]);
82
83
  }
@@ -86,15 +87,15 @@ function GridFilterInputMultipleSingleSelect(props) {
86
87
  if (!Array.isArray(item.value) || filteredValues.length !== item.value.length) {
87
88
  // Updates the state if the filter value has been cleaned by the component
88
89
  applyValue((0, _extends2.default)({}, item, {
89
- value: filteredValues.map(_filterPanelUtils.getValueFromOption)
90
+ value: filteredValues.map(getOptionValue)
90
91
  }));
91
92
  }
92
- }, [item, filteredValues, applyValue]);
93
+ }, [item, filteredValues, applyValue, getOptionValue]);
93
94
  const handleChange = React.useCallback((event, value) => {
94
95
  applyValue((0, _extends2.default)({}, item, {
95
- value: [...value.map(_filterPanelUtils.getValueFromOption)]
96
+ value: value.map(getOptionValue)
96
97
  }));
97
- }, [applyValue, item]);
98
+ }, [applyValue, item, getOptionValue]);
98
99
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, (0, _extends2.default)({
99
100
  multiple: true,
100
101
  options: resolvedValueOptions,
@@ -111,7 +112,7 @@ function GridFilterInputMultipleSingleSelect(props) {
111
112
  }, getTagProps({
112
113
  index
113
114
  })))),
114
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
115
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({}, params, {
115
116
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
116
117
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
117
118
  InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
@@ -119,7 +120,7 @@ function GridFilterInputMultipleSingleSelect(props) {
119
120
  }),
120
121
  inputRef: focusElementRef,
121
122
  type: "singleSelect"
122
- }, TextFieldProps, rootProps.componentsProps?.baseTextField))
123
+ }, TextFieldProps, rootProps.slotProps?.baseTextField))
123
124
  }, other));
124
125
  }
125
126
  process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.propTypes = {
@@ -133,11 +134,17 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.prop
133
134
  applyValue: _propTypes.default.func.isRequired,
134
135
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
135
136
  /**
136
- * Used to determine the text displayed for a given value option.
137
+ * Used to determine the label displayed for a given value option.
137
138
  * @param {ValueOptions} value The current value option.
138
139
  * @returns {string} The text to be displayed.
139
140
  */
140
141
  getOptionLabel: _propTypes.default.func,
142
+ /**
143
+ * Used to determine the value used for a value option.
144
+ * @param {ValueOptions} value The current value option.
145
+ * @returns {string} The value to be used.
146
+ */
147
+ getOptionValue: _propTypes.default.func,
141
148
  item: _propTypes.default.shape({
142
149
  field: _propTypes.default.string.isRequired,
143
150
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -71,7 +71,7 @@ function GridFilterInputMultipleValue(props) {
71
71
  }, getTagProps({
72
72
  index
73
73
  })))),
74
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
74
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({}, params, {
75
75
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
76
76
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
77
77
  InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
@@ -79,7 +79,7 @@ function GridFilterInputMultipleValue(props) {
79
79
  }),
80
80
  inputRef: focusElementRef,
81
81
  type: type || 'text'
82
- }, TextFieldProps, rootProps.componentsProps?.baseTextField))
82
+ }, TextFieldProps, rootProps.slotProps?.baseTextField))
83
83
  }, other));
84
84
  }
85
85
  process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes = {
@@ -5,33 +5,39 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.GridFilterInputSingleSelect = GridFilterInputSingleSelect;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
8
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _utils = require("@mui/utils");
13
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
14
13
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
15
14
  var _filterPanelUtils = require("./filterPanelUtils");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel"];
16
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue"];
18
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
19
  const renderSingleSelectOptions = ({
21
- valueOptions,
22
- field
23
- }, OptionComponent, getOptionLabel) => {
20
+ column: {
21
+ valueOptions,
22
+ field
23
+ },
24
+ OptionComponent,
25
+ getOptionLabel,
26
+ getOptionValue,
27
+ isSelectNative,
28
+ baseSelectOptionProps
29
+ }) => {
24
30
  const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({
25
31
  field
26
32
  })] : ['', ...(valueOptions || [])];
27
33
  return iterableColumnValues.map(option => {
28
- const isOptionTypeObject = typeof option === 'object';
29
- const value = isOptionTypeObject ? option.value : option;
34
+ const value = getOptionValue(option);
30
35
  const label = getOptionLabel(option);
31
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionComponent, {
32
- value: value,
33
- children: label
34
- }, value);
36
+ return /*#__PURE__*/(0, React.createElement)(OptionComponent, (0, _extends2.default)({}, baseSelectOptionProps, {
37
+ native: isSelectNative,
38
+ key: value,
39
+ value: value
40
+ }), label);
35
41
  });
36
42
  };
37
43
  function GridFilterInputSingleSelect(props) {
@@ -41,14 +47,16 @@ function GridFilterInputSingleSelect(props) {
41
47
  type,
42
48
  apiRef,
43
49
  focusElementRef,
44
- getOptionLabel = _filterPanelUtils.getLabelFromValueOption
50
+ getOptionLabel: getOptionLabelProp,
51
+ getOptionValue: getOptionValueProp
45
52
  } = props,
46
53
  others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
47
54
  const [filterValueState, setFilterValueState] = React.useState(item.value ?? '');
48
55
  const id = (0, _utils.unstable_useId)();
49
56
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
50
- const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
57
+ const baseSelectProps = rootProps.slotProps?.baseSelect || {};
51
58
  const isSelectNative = baseSelectProps.native ?? true;
59
+ const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
52
60
  let resolvedColumn = null;
53
61
  if (item.field) {
54
62
  const column = apiRef.current.getColumn(item.field);
@@ -56,6 +64,8 @@ function GridFilterInputSingleSelect(props) {
56
64
  resolvedColumn = column;
57
65
  }
58
66
  }
67
+ const getOptionValue = getOptionValueProp || resolvedColumn?.getOptionValue;
68
+ const getOptionLabel = getOptionLabelProp || resolvedColumn?.getOptionLabel;
59
69
  const currentValueOptions = React.useMemo(() => {
60
70
  if (!resolvedColumn) {
61
71
  return undefined;
@@ -68,17 +78,17 @@ function GridFilterInputSingleSelect(props) {
68
78
  let value = event.target.value;
69
79
 
70
80
  // NativeSelect casts the value to a string.
71
- value = (0, _filterPanelUtils.getValueFromValueOptions)(value, currentValueOptions);
81
+ value = (0, _filterPanelUtils.getValueFromValueOptions)(value, currentValueOptions, getOptionValue);
72
82
  setFilterValueState(String(value));
73
83
  applyValue((0, _extends2.default)({}, item, {
74
84
  value
75
85
  }));
76
- }, [applyValue, item, currentValueOptions]);
86
+ }, [currentValueOptions, getOptionValue, applyValue, item]);
77
87
  React.useEffect(() => {
78
88
  let itemValue;
79
89
  if (currentValueOptions !== undefined) {
80
90
  // sanitize if valueOptions are provided
81
- itemValue = (0, _filterPanelUtils.getValueFromValueOptions)(item.value, currentValueOptions);
91
+ itemValue = (0, _filterPanelUtils.getValueFromValueOptions)(item.value, currentValueOptions, getOptionValue);
82
92
  if (itemValue !== item.value) {
83
93
  applyValue((0, _extends2.default)({}, item, {
84
94
  value: itemValue
@@ -90,11 +100,15 @@ function GridFilterInputSingleSelect(props) {
90
100
  }
91
101
  itemValue = itemValue ?? '';
92
102
  setFilterValueState(String(itemValue));
93
- }, [item, currentValueOptions, applyValue]);
103
+ }, [item, currentValueOptions, applyValue, getOptionValue]);
94
104
  if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
95
105
  return null;
96
106
  }
97
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({
107
+ if (!(0, _filterPanelUtils.isSingleSelectColDef)(resolvedColumn)) {
108
+ return null;
109
+ }
110
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
111
+ // TODO: use baseSelect slot
98
112
  id: id,
99
113
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
100
114
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
@@ -109,9 +123,16 @@ function GridFilterInputSingleSelect(props) {
109
123
  select: true,
110
124
  SelectProps: (0, _extends2.default)({
111
125
  native: isSelectNative
112
- }, rootProps.componentsProps?.baseSelect)
113
- }, others, rootProps.componentsProps?.baseTextField, {
114
- children: renderSingleSelectOptions(resolvedColumn, isSelectNative ? 'option' : _MenuItem.default, getOptionLabel)
126
+ }, rootProps.slotProps?.baseSelect)
127
+ }, others, rootProps.slotProps?.baseTextField, {
128
+ children: renderSingleSelectOptions({
129
+ column: resolvedColumn,
130
+ OptionComponent: rootProps.slots.baseSelectOption,
131
+ getOptionLabel,
132
+ getOptionValue,
133
+ isSelectNative,
134
+ baseSelectOptionProps
135
+ })
115
136
  }));
116
137
  }
117
138
  process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
@@ -125,11 +146,17 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
125
146
  applyValue: _propTypes.default.func.isRequired,
126
147
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
127
148
  /**
128
- * Used to determine the text displayed for a given value option.
149
+ * Used to determine the label displayed for a given value option.
129
150
  * @param {ValueOptions} value The current value option.
130
151
  * @returns {string} The text to be displayed.
131
152
  */
132
153
  getOptionLabel: _propTypes.default.func,
154
+ /**
155
+ * Used to determine the value used for a value option.
156
+ * @param {ValueOptions} value The current value option.
157
+ * @returns {string} The value to be used.
158
+ */
159
+ getOptionValue: _propTypes.default.func,
133
160
  item: _propTypes.default.shape({
134
161
  field: _propTypes.default.string.isRequired,
135
162
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -11,7 +11,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _utils = require("@mui/utils");
14
- var _icons = require("../../icons");
15
14
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
16
  const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
@@ -57,9 +56,9 @@ function GridFilterInputValue(props) {
57
56
  setFilterValueState(String(itemValue));
58
57
  }, [item.value]);
59
58
  const InputProps = applying ? {
60
- endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridLoadIcon, {})
59
+ endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {})
61
60
  } : others.InputProps;
62
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({
61
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
63
62
  id: id,
64
63
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
65
64
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
@@ -72,7 +71,7 @@ function GridFilterInputValue(props) {
72
71
  shrink: true
73
72
  },
74
73
  inputRef: focusElementRef
75
- }, others, rootProps.componentsProps?.baseTextField));
74
+ }, others, rootProps.slotProps?.baseTextField));
76
75
  }
77
76
  process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
78
77
  // ----------------------------- Warning --------------------------------