@mui/x-data-grid 5.13.1 → 5.15.1

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 (374) hide show
  1. package/CHANGELOG.md +147 -6
  2. package/DataGrid/DataGrid.js +6 -0
  3. package/DataGrid/useDataGridComponent.js +1 -1
  4. package/DataGrid/useDataGridProps.js +1 -0
  5. package/colDef/gridActionsColDef.js +2 -0
  6. package/colDef/gridBooleanColDef.js +3 -1
  7. package/colDef/gridCheckboxSelectionColDef.js +2 -0
  8. package/colDef/gridDateOperators.d.ts +1 -1
  9. package/colDef/gridStringColDef.d.ts +3 -0
  10. package/colDef/gridStringColDef.js +6 -0
  11. package/components/GridRow.js +5 -1
  12. package/components/base/GridOverlays.js +4 -1
  13. package/components/cell/GridBooleanCell.d.ts +5 -2
  14. package/components/cell/GridBooleanCell.js +93 -2
  15. package/components/cell/GridEditDateCell.js +5 -1
  16. package/components/cell/GridEditInputCell.d.ts +2 -5
  17. package/components/cell/GridEditInputCell.js +13 -14
  18. package/components/cell/GridEditSingleSelectCell.d.ts +4 -0
  19. package/components/cell/GridEditSingleSelectCell.js +11 -4
  20. package/components/cell/index.d.ts +1 -0
  21. package/components/cell/index.js +1 -0
  22. package/components/columnSelection/GridCellCheckboxRenderer.js +12 -1
  23. package/components/containers/GridRoot.js +4 -2
  24. package/components/containers/GridRootStyles.js +10 -0
  25. package/components/toolbar/GridToolbarDensitySelector.js +13 -4
  26. package/components/toolbar/GridToolbarExport.js +20 -10
  27. package/components/toolbar/GridToolbarExportContainer.js +13 -2
  28. package/constants/envConstants.d.ts +1 -1
  29. package/constants/envConstants.js +2 -11
  30. package/constants/gridClasses.d.ts +41 -1
  31. package/constants/gridClasses.js +1 -1
  32. package/constants/localeTextConstants.js +9 -2
  33. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +2 -1
  34. package/hooks/features/columns/useGridColumnSpanning.js +9 -7
  35. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  36. package/hooks/features/columns/useGridColumns.js +13 -6
  37. package/hooks/features/dimensions/useGridDimensions.js +6 -1
  38. package/hooks/features/editRows/useGridCellEditing.new.d.ts +1 -1
  39. package/hooks/features/editRows/useGridCellEditing.new.js +11 -9
  40. package/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  41. package/hooks/features/editRows/useGridEditing.new.d.ts +1 -1
  42. package/hooks/features/editRows/useGridEditing.new.js +4 -0
  43. package/hooks/features/editRows/useGridEditing.old.js +1 -1
  44. package/hooks/features/editRows/useGridRowEditing.new.d.ts +1 -1
  45. package/hooks/features/editRows/useGridRowEditing.new.js +7 -8
  46. package/hooks/features/export/utils.d.ts +1 -1
  47. package/hooks/features/export/utils.js +16 -2
  48. package/hooks/features/filter/gridFilterUtils.js +6 -0
  49. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  50. package/hooks/features/filter/useGridFilter.js +11 -4
  51. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  52. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -34
  53. package/hooks/features/pagination/useGridPage.js +4 -3
  54. package/hooks/features/pagination/useGridPageSize.js +7 -4
  55. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
  56. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  57. package/hooks/features/rows/gridRowsSelector.d.ts +14 -0
  58. package/hooks/features/rows/gridRowsSelector.js +20 -1
  59. package/hooks/features/rows/gridRowsState.d.ts +8 -1
  60. package/hooks/features/rows/gridRowsUtils.d.ts +5 -1
  61. package/hooks/features/rows/gridRowsUtils.js +21 -3
  62. package/hooks/features/rows/index.d.ts +1 -1
  63. package/hooks/features/rows/index.js +1 -1
  64. package/hooks/features/rows/useGridRowsMeta.js +19 -4
  65. package/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  66. package/hooks/features/scroll/useGridScroll.js +7 -2
  67. package/hooks/features/selection/useGridSelection.js +28 -10
  68. package/hooks/features/sorting/gridSortingUtils.d.ts +1 -0
  69. package/hooks/features/sorting/gridSortingUtils.js +10 -11
  70. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  71. package/hooks/features/sorting/useGridSorting.js +42 -6
  72. package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +12 -1
  73. package/hooks/features/statePersistence/index.d.ts +1 -1
  74. package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  75. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -1
  76. package/hooks/features/virtualization/useGridVirtualScroller.js +32 -18
  77. package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
  78. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  79. package/hooks/utils/useGridNativeEventListener.js +1 -1
  80. package/index.js +1 -1
  81. package/internals/index.d.ts +6 -3
  82. package/internals/index.js +5 -2
  83. package/legacy/DataGrid/DataGrid.js +6 -0
  84. package/legacy/DataGrid/useDataGridComponent.js +1 -1
  85. package/legacy/DataGrid/useDataGridProps.js +1 -0
  86. package/legacy/colDef/gridActionsColDef.js +2 -0
  87. package/legacy/colDef/gridBooleanColDef.js +3 -1
  88. package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -0
  89. package/legacy/colDef/gridStringColDef.js +6 -0
  90. package/legacy/components/GridRow.js +5 -1
  91. package/legacy/components/base/GridOverlays.js +4 -1
  92. package/legacy/components/cell/GridBooleanCell.js +93 -2
  93. package/legacy/components/cell/GridEditDateCell.js +5 -1
  94. package/legacy/components/cell/GridEditInputCell.js +13 -14
  95. package/legacy/components/cell/GridEditSingleSelectCell.js +11 -3
  96. package/legacy/components/cell/index.js +1 -0
  97. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +11 -1
  98. package/legacy/components/containers/GridRoot.js +4 -2
  99. package/legacy/components/containers/GridRootStyles.js +3 -3
  100. package/legacy/components/toolbar/GridToolbarDensitySelector.js +14 -5
  101. package/legacy/components/toolbar/GridToolbarExport.js +20 -10
  102. package/legacy/components/toolbar/GridToolbarExportContainer.js +15 -2
  103. package/legacy/constants/envConstants.js +2 -11
  104. package/legacy/constants/gridClasses.js +1 -1
  105. package/legacy/constants/localeTextConstants.js +9 -2
  106. package/legacy/hooks/features/columns/useGridColumnSpanning.js +9 -7
  107. package/legacy/hooks/features/columns/useGridColumns.js +13 -8
  108. package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -1
  109. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +11 -9
  110. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  111. package/legacy/hooks/features/editRows/useGridEditing.new.js +4 -0
  112. package/legacy/hooks/features/editRows/useGridEditing.old.js +1 -1
  113. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -8
  114. package/legacy/hooks/features/export/utils.js +21 -2
  115. package/legacy/hooks/features/filter/gridFilterUtils.js +6 -0
  116. package/legacy/hooks/features/filter/useGridFilter.js +11 -4
  117. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +47 -34
  118. package/legacy/hooks/features/pagination/useGridPage.js +4 -3
  119. package/legacy/hooks/features/pagination/useGridPageSize.js +7 -4
  120. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  121. package/legacy/hooks/features/rows/gridRowsSelector.js +23 -0
  122. package/legacy/hooks/features/rows/gridRowsUtils.js +21 -3
  123. package/legacy/hooks/features/rows/index.js +1 -1
  124. package/legacy/hooks/features/rows/useGridRowsMeta.js +19 -4
  125. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  126. package/legacy/hooks/features/scroll/useGridScroll.js +7 -2
  127. package/legacy/hooks/features/selection/useGridSelection.js +30 -12
  128. package/legacy/hooks/features/sorting/gridSortingUtils.js +11 -12
  129. package/legacy/hooks/features/sorting/useGridSorting.js +42 -6
  130. package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -1
  131. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +33 -18
  132. package/legacy/hooks/utils/useGridNativeEventListener.js +1 -1
  133. package/legacy/index.js +1 -1
  134. package/legacy/internals/index.js +5 -2
  135. package/legacy/locales/arSD.js +8 -1
  136. package/legacy/locales/bgBG.js +8 -1
  137. package/legacy/locales/csCZ.js +8 -1
  138. package/legacy/locales/daDK.js +8 -1
  139. package/legacy/locales/deDE.js +9 -2
  140. package/legacy/locales/elGR.js +8 -1
  141. package/legacy/locales/esES.js +8 -1
  142. package/legacy/locales/faIR.js +8 -1
  143. package/legacy/locales/fiFI.js +8 -1
  144. package/legacy/locales/frFR.js +9 -2
  145. package/legacy/locales/heIL.js +9 -2
  146. package/legacy/locales/huHU.js +8 -1
  147. package/legacy/locales/index.js +2 -1
  148. package/legacy/locales/itIT.js +21 -14
  149. package/legacy/locales/jaJP.js +11 -4
  150. package/legacy/locales/koKR.js +35 -24
  151. package/legacy/locales/nbNO.js +9 -2
  152. package/legacy/locales/nlNL.js +9 -2
  153. package/legacy/locales/plPL.js +8 -1
  154. package/legacy/locales/ptBR.js +9 -2
  155. package/legacy/locales/roRO.js +9 -2
  156. package/legacy/locales/ruRU.js +8 -1
  157. package/legacy/locales/skSK.js +9 -2
  158. package/legacy/locales/svSE.js +9 -2
  159. package/legacy/locales/trTR.js +8 -1
  160. package/legacy/locales/ukUA.js +8 -1
  161. package/legacy/locales/viVN.js +8 -1
  162. package/legacy/locales/zhCN.js +38 -27
  163. package/legacy/locales/zhTW.js +135 -0
  164. package/legacy/models/events/gridEvents.js +1 -0
  165. package/legacy/utils/keyboardUtils.js +8 -5
  166. package/locales/arSD.js +8 -1
  167. package/locales/bgBG.js +8 -1
  168. package/locales/csCZ.js +8 -1
  169. package/locales/daDK.js +8 -1
  170. package/locales/deDE.js +9 -2
  171. package/locales/elGR.js +8 -1
  172. package/locales/esES.js +8 -1
  173. package/locales/faIR.js +8 -1
  174. package/locales/fiFI.js +8 -1
  175. package/locales/frFR.js +9 -2
  176. package/locales/heIL.js +9 -2
  177. package/locales/huHU.js +8 -1
  178. package/locales/index.d.ts +1 -0
  179. package/locales/index.js +2 -1
  180. package/locales/itIT.js +21 -14
  181. package/locales/jaJP.js +11 -4
  182. package/locales/koKR.js +31 -24
  183. package/locales/nbNO.js +9 -2
  184. package/locales/nlNL.js +9 -2
  185. package/locales/plPL.js +8 -1
  186. package/locales/ptBR.js +9 -2
  187. package/locales/roRO.js +9 -2
  188. package/locales/ruRU.js +8 -1
  189. package/locales/skSK.js +9 -2
  190. package/locales/svSE.js +9 -2
  191. package/locales/trTR.js +8 -1
  192. package/locales/ukUA.js +8 -1
  193. package/locales/viVN.js +8 -1
  194. package/locales/zhCN.js +34 -27
  195. package/locales/zhTW.d.ts +2 -0
  196. package/locales/zhTW.js +123 -0
  197. package/models/api/gridColumnSpanning.d.ts +2 -0
  198. package/models/api/gridLocaleTextApi.d.ts +8 -2
  199. package/models/api/gridSelectionApi.d.ts +6 -0
  200. package/models/events/gridEvents.d.ts +1 -0
  201. package/models/events/gridEvents.js +1 -0
  202. package/models/gridRows.d.ts +15 -1
  203. package/models/params/gridCellParams.d.ts +4 -4
  204. package/models/props/DataGridProps.d.ts +5 -0
  205. package/modern/DataGrid/DataGrid.js +6 -0
  206. package/modern/DataGrid/useDataGridComponent.js +1 -1
  207. package/modern/DataGrid/useDataGridProps.js +1 -0
  208. package/modern/colDef/gridActionsColDef.js +2 -0
  209. package/modern/colDef/gridBooleanColDef.js +3 -1
  210. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -0
  211. package/modern/colDef/gridStringColDef.js +6 -0
  212. package/modern/components/GridRow.js +5 -1
  213. package/modern/components/base/GridOverlays.js +4 -1
  214. package/modern/components/cell/GridBooleanCell.js +93 -2
  215. package/modern/components/cell/GridEditDateCell.js +5 -1
  216. package/modern/components/cell/GridEditInputCell.js +13 -14
  217. package/modern/components/cell/GridEditSingleSelectCell.js +11 -4
  218. package/modern/components/cell/index.js +1 -0
  219. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +12 -1
  220. package/modern/components/containers/GridRoot.js +4 -2
  221. package/modern/components/containers/GridRootStyles.js +10 -0
  222. package/modern/components/toolbar/GridToolbarDensitySelector.js +11 -4
  223. package/modern/components/toolbar/GridToolbarExport.js +20 -10
  224. package/modern/components/toolbar/GridToolbarExportContainer.js +11 -2
  225. package/modern/constants/envConstants.js +2 -11
  226. package/modern/constants/gridClasses.js +1 -1
  227. package/modern/constants/localeTextConstants.js +9 -2
  228. package/modern/hooks/features/columns/useGridColumnSpanning.js +9 -7
  229. package/modern/hooks/features/columns/useGridColumns.js +10 -5
  230. package/modern/hooks/features/dimensions/useGridDimensions.js +6 -1
  231. package/modern/hooks/features/editRows/useGridCellEditing.new.js +9 -9
  232. package/modern/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  233. package/modern/hooks/features/editRows/useGridEditing.new.js +4 -0
  234. package/modern/hooks/features/editRows/useGridEditing.old.js +1 -1
  235. package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -8
  236. package/modern/hooks/features/export/utils.js +10 -2
  237. package/modern/hooks/features/filter/gridFilterUtils.js +6 -0
  238. package/modern/hooks/features/filter/useGridFilter.js +8 -3
  239. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +42 -30
  240. package/modern/hooks/features/pagination/useGridPage.js +4 -3
  241. package/modern/hooks/features/pagination/useGridPageSize.js +7 -4
  242. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +8 -4
  243. package/modern/hooks/features/rows/gridRowsSelector.js +18 -1
  244. package/modern/hooks/features/rows/gridRowsUtils.js +19 -3
  245. package/modern/hooks/features/rows/index.js +1 -1
  246. package/modern/hooks/features/rows/useGridRowsMeta.js +17 -4
  247. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  248. package/modern/hooks/features/scroll/useGridScroll.js +5 -2
  249. package/modern/hooks/features/selection/useGridSelection.js +28 -10
  250. package/modern/hooks/features/sorting/gridSortingUtils.js +10 -11
  251. package/modern/hooks/features/sorting/useGridSorting.js +38 -6
  252. package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  253. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +31 -17
  254. package/modern/hooks/utils/useGridNativeEventListener.js +1 -1
  255. package/modern/index.js +1 -1
  256. package/modern/internals/index.js +5 -2
  257. package/modern/locales/arSD.js +8 -1
  258. package/modern/locales/bgBG.js +8 -1
  259. package/modern/locales/csCZ.js +8 -1
  260. package/modern/locales/daDK.js +8 -1
  261. package/modern/locales/deDE.js +9 -2
  262. package/modern/locales/elGR.js +8 -1
  263. package/modern/locales/esES.js +8 -1
  264. package/modern/locales/faIR.js +8 -1
  265. package/modern/locales/fiFI.js +8 -1
  266. package/modern/locales/frFR.js +9 -2
  267. package/modern/locales/heIL.js +9 -2
  268. package/modern/locales/huHU.js +8 -1
  269. package/modern/locales/index.js +2 -1
  270. package/modern/locales/itIT.js +21 -14
  271. package/modern/locales/jaJP.js +11 -4
  272. package/modern/locales/koKR.js +31 -24
  273. package/modern/locales/nbNO.js +9 -2
  274. package/modern/locales/nlNL.js +9 -2
  275. package/modern/locales/plPL.js +8 -1
  276. package/modern/locales/ptBR.js +9 -2
  277. package/modern/locales/roRO.js +9 -2
  278. package/modern/locales/ruRU.js +8 -1
  279. package/modern/locales/skSK.js +9 -2
  280. package/modern/locales/svSE.js +9 -2
  281. package/modern/locales/trTR.js +8 -1
  282. package/modern/locales/ukUA.js +8 -1
  283. package/modern/locales/viVN.js +8 -1
  284. package/modern/locales/zhCN.js +34 -27
  285. package/modern/locales/zhTW.js +123 -0
  286. package/modern/models/events/gridEvents.js +1 -0
  287. package/modern/utils/keyboardUtils.js +7 -2
  288. package/node/DataGrid/DataGrid.js +6 -0
  289. package/node/DataGrid/useDataGridComponent.js +1 -1
  290. package/node/DataGrid/useDataGridProps.js +1 -0
  291. package/node/colDef/gridActionsColDef.js +2 -0
  292. package/node/colDef/gridBooleanColDef.js +3 -1
  293. package/node/colDef/gridCheckboxSelectionColDef.js +2 -0
  294. package/node/colDef/gridStringColDef.js +5 -0
  295. package/node/components/GridRow.js +5 -1
  296. package/node/components/base/GridOverlays.js +4 -1
  297. package/node/components/cell/GridBooleanCell.js +93 -2
  298. package/node/components/cell/GridEditDateCell.js +7 -1
  299. package/node/components/cell/GridEditInputCell.js +15 -16
  300. package/node/components/cell/GridEditSingleSelectCell.js +10 -4
  301. package/node/components/cell/index.js +13 -0
  302. package/node/components/columnSelection/GridCellCheckboxRenderer.js +12 -1
  303. package/node/components/containers/GridRoot.js +3 -1
  304. package/node/components/containers/GridRootStyles.js +10 -0
  305. package/node/components/toolbar/GridToolbarDensitySelector.js +13 -4
  306. package/node/components/toolbar/GridToolbarExport.js +16 -10
  307. package/node/components/toolbar/GridToolbarExportContainer.js +13 -2
  308. package/node/constants/envConstants.js +2 -13
  309. package/node/constants/gridClasses.js +1 -1
  310. package/node/constants/localeTextConstants.js +9 -2
  311. package/node/hooks/features/columns/useGridColumnSpanning.js +9 -7
  312. package/node/hooks/features/columns/useGridColumns.js +13 -6
  313. package/node/hooks/features/dimensions/useGridDimensions.js +7 -1
  314. package/node/hooks/features/editRows/useGridCellEditing.new.js +11 -9
  315. package/node/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  316. package/node/hooks/features/editRows/useGridEditing.new.js +4 -0
  317. package/node/hooks/features/editRows/useGridEditing.old.js +1 -1
  318. package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -8
  319. package/node/hooks/features/export/utils.js +17 -2
  320. package/node/hooks/features/filter/gridFilterUtils.js +7 -0
  321. package/node/hooks/features/filter/useGridFilter.js +11 -4
  322. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +43 -34
  323. package/node/hooks/features/pagination/useGridPage.js +4 -3
  324. package/node/hooks/features/pagination/useGridPageSize.js +8 -4
  325. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
  326. package/node/hooks/features/rows/gridRowsSelector.js +24 -2
  327. package/node/hooks/features/rows/gridRowsUtils.js +23 -2
  328. package/node/hooks/features/rows/index.js +70 -12
  329. package/node/hooks/features/rows/useGridRowsMeta.js +20 -4
  330. package/node/hooks/features/rows/useGridRowsPreProcessors.js +2 -1
  331. package/node/hooks/features/scroll/useGridScroll.js +7 -1
  332. package/node/hooks/features/selection/useGridSelection.js +28 -10
  333. package/node/hooks/features/sorting/gridSortingUtils.js +10 -11
  334. package/node/hooks/features/sorting/useGridSorting.js +42 -6
  335. package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
  336. package/node/hooks/features/virtualization/useGridVirtualScroller.js +32 -18
  337. package/node/hooks/utils/useGridNativeEventListener.js +1 -1
  338. package/node/index.js +1 -1
  339. package/node/internals/index.js +46 -0
  340. package/node/locales/arSD.js +8 -1
  341. package/node/locales/bgBG.js +8 -1
  342. package/node/locales/csCZ.js +8 -1
  343. package/node/locales/daDK.js +8 -1
  344. package/node/locales/deDE.js +9 -2
  345. package/node/locales/elGR.js +8 -1
  346. package/node/locales/esES.js +8 -1
  347. package/node/locales/faIR.js +8 -1
  348. package/node/locales/fiFI.js +8 -1
  349. package/node/locales/frFR.js +9 -2
  350. package/node/locales/heIL.js +9 -2
  351. package/node/locales/huHU.js +8 -1
  352. package/node/locales/index.js +13 -0
  353. package/node/locales/itIT.js +21 -14
  354. package/node/locales/jaJP.js +11 -4
  355. package/node/locales/koKR.js +31 -24
  356. package/node/locales/nbNO.js +9 -2
  357. package/node/locales/nlNL.js +9 -2
  358. package/node/locales/plPL.js +8 -1
  359. package/node/locales/ptBR.js +9 -2
  360. package/node/locales/roRO.js +9 -2
  361. package/node/locales/ruRU.js +8 -1
  362. package/node/locales/skSK.js +9 -2
  363. package/node/locales/svSE.js +9 -2
  364. package/node/locales/trTR.js +8 -1
  365. package/node/locales/ukUA.js +8 -1
  366. package/node/locales/viVN.js +8 -1
  367. package/node/locales/zhCN.js +34 -27
  368. package/node/locales/zhTW.js +133 -0
  369. package/node/models/events/gridEvents.js +1 -0
  370. package/node/utils/keyboardUtils.js +10 -4
  371. package/package.json +1 -1
  372. package/utils/getGridLocalization.d.ts +1 -1
  373. package/utils/keyboardUtils.d.ts +2 -2
  374. package/utils/keyboardUtils.js +7 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,147 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.15.1
7
+
8
+ _Aug 4, 2022_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 📚 New [page presenting the `apiRef`](https://mui.com/x/react-data-grid/api-object/) (#5273) @flaviendelangle
13
+ - ✨ Better keyboard support for start editing cells (#5511) @oliviertassinari
14
+ - 🌍 Improvements to different locales
15
+ - 🐞 Bugfixes
16
+
17
+ ### `@mui/x-data-grid@v5.15.1` / `@mui/x-data-grid-pro@v5.15.1` / `@mui/x-data-grid-premium@v5.15.1`
18
+
19
+ #### Changes
20
+
21
+ - [DataGrid] Improve start edit UX (#5511) @oliviertassinari
22
+ - [DataGrid] Add `initialOpen` prop to `GridEditSingleSelectCell` to allow overriding initial open state (#5645) @shapaaa
23
+ - [DataGrid] Forward `ref` to root element in `GridEditInputCell` (#5631) @Zenoo
24
+ - [DataGrid] Toggle open state when clicking on buttons in the `GridToolbar` (#5503) @cherniavskii
25
+ - [DataGrid] Improve German (de-DE) locale (#5586) @sebastianfrey
26
+ - [DataGrid] Improve Korean (ko-KR) locale (#5668) @Einere
27
+ - [DataGrid] Complete Italian (it-IT) locale (#5487) @mamodev
28
+
29
+ ### `@mui/x-date-pickers@v5.0.0-beta.4` / `@mui/x-date-picker-pro@5.0.0-beta.4`
30
+
31
+ #### Changes
32
+
33
+ - [DatePicker] Customize day formatter in the calendar (#5373) @alexfauquette
34
+
35
+ ### Docs
36
+
37
+ - [docs] New location for the legal content (#5595) @oliviertassinari
38
+ - [docs] Update description of `maxDateTime` prop (#5639) @jurecuhalev
39
+ - [docs] Add missing `date-fns` dependency when opening Codesandbox demo (#5692) @cherniavskii
40
+
41
+ ### Core
42
+
43
+ - [core] Drop usage of `GRID_EXPERIMENTAL_ENABLED` env variable (#5669) @ar7casper
44
+ - [core] Isolate asset loading under /x/ (#5594) @oliviertassinari
45
+ - [core] Upgrade node to v14 (#4999) @cherniavskii
46
+
47
+ ## 5.15.0
48
+
49
+ _Jul 29, 2022_
50
+
51
+ We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
52
+
53
+ - 🎁 Introduce aggregation (#5592) @flaviendelangle
54
+
55
+ Premium users can now aggregate data in the grid.
56
+ Extract information like sum, average, count, and others with a couple of clicks.
57
+
58
+ https://user-images.githubusercontent.com/45398769/181581503-77cc412e-9d9e-4de1-8bc3-c3bccc54cdaa.mp4
59
+
60
+ To enable this feature, add `experimentalFeatures={{ aggregation: true }}`.
61
+ Aggregation functions are customizable and they combine well with row grouping.
62
+ See the [documentation](https://mui.com/x/react-data-grid/aggregation/) to explore everything it has to offer.
63
+
64
+ - 🚀 Introduce row pinning (#4863) @cherniavskii
65
+
66
+ Pro users can now pin rows on top or bottom of the grid.
67
+
68
+ https://user-images.githubusercontent.com/45398769/181581493-56c733a3-6dd5-4546-bf8d-3f2dff72b14a.mp4
69
+
70
+ To do so, enable the feature with `experimentalFeatures={{ rowPinning: true }}` and provide the pinned rows data to the `pinnedRows` prop.
71
+ For more details, see the [documentation](https://mui.com/x/react-data-grid/row-pinning/).
72
+
73
+ - 🌍 Add simplified Chinese (zh-CN) locale to pickers (#5584) @gamecss
74
+ - 📚 Documentation improvements
75
+
76
+ ### `@mui/x-data-grid@v5.15.0` / `@mui/x-data-grid-pro@v5.15.0` / `@mui/x-data-grid-premium@v5.15.0`
77
+
78
+ #### Changes
79
+
80
+ - [DataGrid] Add prop to keep modifications while processing props (#5309) @m4theushw
81
+ - [DataGrid] Fix container width change on React 18 (#5566) @m4theushw
82
+ - [DataGrid] Fix ellipsis style convention (#5587) @oliviertassinari
83
+ - [DataGridPro] Implement row pinning (#4863) @cherniavskii
84
+ - [DataGridPremium] Make aggregation public (#5592) @cherniavskii
85
+ - [l10n] Improve simplified Chinese (zh-CN) locale (#5584) @gamecss
86
+
87
+ ### `@mui/x-date-pickers@v5.0.0-beta.3` / `@mui/x-date-picker-pro@5.0.0-beta.3`
88
+
89
+ #### Changes
90
+
91
+ - [l10n] Add simplified Chinese (zh-CN) locale (#5584) @gamecss
92
+
93
+ ### Docs
94
+
95
+ - [docs] Split docs page about rows (#5195) @flaviendelangle
96
+ - [docs] Add warning clarifications (#5399) @alexfauquette
97
+ - [docs] Correct slot CSS classes for Pro and Premium components (#5452) @alexfauquette
98
+ - [docs] Fix internal link to `valueParser` (#5450) @alexfauquette
99
+
100
+ ### Core
101
+
102
+ - [core] Upgrade monorepo (#5560) @m4theushw
103
+
104
+ ## 5.14.0
105
+
106
+ _Jul 21, 2022_
107
+
108
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
109
+
110
+ - 🧪 Export `GridBooleanCell` component from data grid (#5537) @cliedeman
111
+ - ⚙️ Improve accessibility of the Export menu (#5486) @nogalpaulina
112
+ - 🌍 Improvements to different locales
113
+ - 📚 Documentation improvements
114
+ - 🐞 Bugfixes
115
+
116
+ ### `@mui/x-data-grid@5.14.0` / `@mui/x-data-grid-pro@5.14.0` / `@mui/x-data-grid-premium@5.14.0`
117
+
118
+ #### Changes
119
+
120
+ - [DataGrid] Add generics to `GridPreProcessEditCellProps` (#5510) @YunosukeY
121
+ - [DataGrid] Avoid inconsistent state export (#5390) @flaviendelangle
122
+ - [DataGrid] Export `GridBooleanCell` component (#5537) @cliedeman
123
+ - [DataGrid] Fix `date`/`dateTime` edit input font size to match view mode (#5304) @cherniavskii
124
+ - [DataGrid] Fix loading overlay position (#5558) @DanailH
125
+ - [DataGrid] Improve accessibility of the Export menu in the toolbar (#5486) @nogalpaulina
126
+ - [DataGridPremium] Implement Aggregation - not publicly released (#4208) @flaviendelangle
127
+ - [DataGridPremium] Fix crash when exporting all columns to Excel (#5425) @cherniavskii
128
+ - [l10n] Add Traditional Chinese (zh-TW) locale (#5498) @happyincent
129
+
130
+ ### `@mui/x-date-pickers@v5.0.0-beta.2` / `@mui/x-date-picker-pro@5.0.0-beta.2`
131
+
132
+ #### Changes
133
+
134
+ - [l10n] Add Norwegian (nb-NO) locale (#5475) @elkebab
135
+
136
+ ### Docs
137
+
138
+ - [docs] New page presenting the `apiRef` (#5273) @flaviendelangle
139
+ - [docs] Remove blank line @oliviertassinari
140
+
141
+ ### Core
142
+
143
+ - [core] Add missing comments on zh-TW translation (#5559) @flaviendelangle
144
+ - [core] Polish on the bug issue template (#5525) @oliviertassinari
145
+ - [test] Add more tests related to `isPrintableKey` (#5458) @mnajdova
146
+
6
147
  ## 5.13.1
7
148
 
8
149
  _Jul 15, 2022_
@@ -263,7 +404,7 @@ _May 31, 2022_
263
404
 
264
405
  We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
265
406
 
266
- - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/rows/#dynamic-row-height) (#4859) @m4theushw
407
+ - 🎁 Introduce support for [dynamic row height](https://mui.com/x/react-data-grid/row-height/#dynamic-row-height) (#4859) @m4theushw
267
408
 
268
409
  <img src="https://user-images.githubusercontent.com/42154031/171183167-718d7bcd-ec0f-459e-97fe-0f650abb4a99.gif" width="800">
269
410
 
@@ -580,7 +721,7 @@ _Apr 25, 2022_
580
721
 
581
722
  We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
582
723
 
583
- - 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/rows/#row-reorder) (#4034) @DanailH
724
+ - 🎁 Introduce [Row reorder](https://mui.com/x/react-data-grid/row-ordering/) (#4034) @DanailH
584
725
 
585
726
  <img src="https://user-images.githubusercontent.com/5858539/165091263-23472fbb-a989-44b8-849a-d2185adfe13b.gif" width="800">
586
727
 
@@ -844,7 +985,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
844
985
  <DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
845
986
  ```
846
987
 
847
- Check the [documentation](https://mui.com/x/react-data-grid/rows/#row-spacing) for more information.
988
+ Check the [documentation](https://mui.com/x/react-data-grid/row-height/#row-spacing) for more information.
848
989
 
849
990
  ### `@mui/x-data-grid@v5.6.1` / `@mui/x-data-grid-pro@v5.6.1`
850
991
 
@@ -1098,7 +1239,7 @@ _Jan 28, 2022_
1098
1239
 
1099
1240
  A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
1100
1241
 
1101
- - 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/rows/#variable-row-height) (#438) @DanailH
1242
+ - 🚣 Introduce [variable row height](https://mui.com/x/react-data-grid/row-height/#variable-row-height) (#438) @DanailH
1102
1243
 
1103
1244
  Allows for setting a row-specific height.
1104
1245
  By default, all rows have the same height, but now you can set the height on a per-row basis.
@@ -1466,7 +1607,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
1466
1607
  - [core] Fix `yarn prettier` script (#3292) @oliviertassinari
1467
1608
  - [core] Improve tests for Tree Data (#3366) @flaviendelangle
1468
1609
  - [core] Never import directly from the `__modules__` folder in the `x-data-grid-generator` package (#3379) @flaviendelangle
1469
- - [core] Transition to a new StackOverflow tag (#3308) @oliviertassinari
1610
+ - [core] Transition to a new Stack Overflow tag (#3308) @oliviertassinari
1470
1611
  - [core] Update monorepo (#3370) @flaviendelangle
1471
1612
  - [core] Use pre-processors for sorting and filtering (#3318) @flaviendelangle
1472
1613
  - [test] Replace `useFakeTimers` (#3323) @m4theushw
@@ -3750,7 +3891,7 @@ Big thanks to the 7 contributors who made this release possible. Here are some h
3750
3891
  - 🎁 Add `onRowsScrollEnd` to support infinite loading (#1199) @DanailH
3751
3892
  This is an XGrid feature. Provides the ability to tap into the `onRowsScrollEnd` which is called when the scroll reaches the bottom of the grid viewport allowing developers to load additional data. It can be used with a combination of `scrollBottomThreshold` to control the area in which the `onRowsScrollEnd` is called.
3752
3893
 
3753
- See the documentation for [more details](https://mui.com/x/react-data-grid/rows/#infinite-loading).
3894
+ See the documentation for [more details](https://mui.com/x/react-data-grid/row-updates/#infinite-loading).
3754
3895
 
3755
3896
  - 🕹 Provide the ability to sort by multiple columns using Shift+click (#1203) @dtassone
3756
3897
  - 🇵🇱 Added pl-PL locale (#1117) @LarsKumbier
@@ -155,6 +155,12 @@ DataGridRaw.propTypes = {
155
155
  */
156
156
  disableExtendRowFullWidth: PropTypes.bool,
157
157
 
158
+ /**
159
+ * If `true`, modification to a cell will not be discarded if the mode is changed from "edit" to "view" while processing props.
160
+ * @default false
161
+ */
162
+ disableIgnoreModificationsIfProcessingProps: PropTypes.bool,
163
+
158
164
  /**
159
165
  * If `true`, the selection on click on a row or cell is disabled.
160
166
  * @default false
@@ -60,7 +60,7 @@ export const useDataGridComponent = props => {
60
60
  const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;
61
61
  useGridEditing(apiRef, props);
62
62
  useGridFocus(apiRef, props);
63
- useGridPreferencesPanel(apiRef);
63
+ useGridPreferencesPanel(apiRef, props);
64
64
  useGridFilter(apiRef, props);
65
65
  useGridSorting(apiRef, props);
66
66
  useGridDensity(apiRef, props);
@@ -41,6 +41,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
41
41
  disableMultipleColumnsSorting: false,
42
42
  disableSelectionOnClick: false,
43
43
  disableVirtualization: false,
44
+ disableIgnoreModificationsIfProcessingProps: false,
44
45
  editMode: GridEditModes.Cell,
45
46
  filterMode: GridFeatureModeConstant.client,
46
47
  headerHeight: 56,
@@ -5,6 +5,8 @@ export const GRID_ACTIONS_COLUMN_TYPE = 'actions';
5
5
  export const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
6
6
  sortable: false,
7
7
  filterable: false,
8
+ // @ts-ignore
9
+ aggregable: false,
8
10
  width: 100,
9
11
  align: 'center',
10
12
  headerAlign: 'center',
@@ -21,5 +21,7 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
21
21
  sortComparator: gridNumberComparator,
22
22
  valueFormatter: gridBooleanFormatter,
23
23
  filterOperators: getGridBooleanOperators(),
24
- getApplyQuickFilterFn: undefined
24
+ getApplyQuickFilterFn: undefined,
25
+ // @ts-ignore
26
+ aggregable: false
25
27
  });
@@ -13,6 +13,8 @@ export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF
13
13
  resizable: false,
14
14
  sortable: false,
15
15
  filterable: false,
16
+ // @ts-ignore
17
+ aggregable: false,
16
18
  disableColumnMenu: true,
17
19
  disableReorder: true,
18
20
  disableExport: true,
@@ -1,2 +1,2 @@
1
1
  import { GridFilterOperator } from '../models/gridFilterOperator';
2
- export declare const getGridDateOperators: (showTime?: boolean | undefined) => GridFilterOperator<any, string | Date, any>[];
2
+ export declare const getGridDateOperators: (showTime?: boolean) => GridFilterOperator<any, string | Date, any>[];
@@ -1,2 +1,5 @@
1
1
  import { GridColTypeDef } from '../models/colDef/gridColDef';
2
+ /**
3
+ * TODO: Move pro and premium properties outside of this Community file
4
+ */
2
5
  export declare const GRID_STRING_COL_DEF: GridColTypeDef<any, any>;
@@ -1,6 +1,10 @@
1
1
  import { renderEditInputCell } from '../components/cell/GridEditInputCell';
2
2
  import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
3
3
  import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
4
+ /**
5
+ * TODO: Move pro and premium properties outside of this Community file
6
+ */
7
+
4
8
  export const GRID_STRING_COL_DEF = {
5
9
  width: 100,
6
10
  minWidth: 50,
@@ -12,6 +16,8 @@ export const GRID_STRING_COL_DEF = {
12
16
  filterable: true,
13
17
  groupable: true,
14
18
  pinnable: true,
19
+ // @ts-ignore
20
+ aggregable: true,
15
21
  editable: false,
16
22
  sortComparator: gridStringOrNumberComparator,
17
23
  type: 'string',
@@ -120,7 +120,11 @@ function GridRow(props) {
120
120
  // doesn't care about pagination and considers the rows from the current page only, so the
121
121
  // first row always has index=0. We need to subtract the index of the first row to make it
122
122
  // compatible with the index used by the virtualization.
123
- apiRef.current.unstable_setLastMeasuredRowIndex(index - currentPage.range.firstRowIndex);
123
+ const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId); // pinned rows are not part of the visible rows
124
+
125
+ if (rowIndex != null) {
126
+ apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
127
+ }
124
128
  }
125
129
 
126
130
  const rootElement = ref.current;
@@ -44,7 +44,10 @@ function GridOverlayWrapper(props) {
44
44
  width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0,
45
45
  position: 'absolute',
46
46
  top: headerHeight,
47
- bottom: height === 'auto' ? 0 : undefined
47
+ bottom: height === 'auto' ? 0 : undefined,
48
+ zIndex: 4,
49
+ // should be above pinned columns, pinned rows and detail panel
50
+ pointerEvents: 'none'
48
51
  }
49
52
  }, props));
50
53
  }
@@ -4,6 +4,9 @@ import { GridRenderCellParams } from '../../models/params/gridCellParams';
4
4
  import { GridColDef } from '../../models/colDef/gridColDef';
5
5
  interface GridBooleanCellProps extends GridRenderCellParams, Omit<SvgIconProps, 'tabIndex' | 'id'> {
6
6
  }
7
- export declare const GridBooleanCell: React.MemoExoticComponent<(props: GridBooleanCellProps) => JSX.Element>;
7
+ declare const GridBooleanCell: React.MemoExoticComponent<{
8
+ (props: GridBooleanCellProps): JSX.Element;
9
+ propTypes: any;
10
+ }>;
11
+ export { GridBooleanCell };
8
12
  export declare const renderBooleanCell: GridColDef['renderCell'];
9
- export {};
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "hasFocus", "tabIndex", "getValue"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
7
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
7
8
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
@@ -18,7 +19,7 @@ const useUtilityClasses = ownerState => {
18
19
  return composeClasses(slots, getDataGridUtilityClass, classes);
19
20
  };
20
21
 
21
- export const GridBooleanCell = /*#__PURE__*/React.memo(props => {
22
+ const GridBooleanCellRaw = props => {
22
23
  const {
23
24
  value
24
25
  } = props,
@@ -37,7 +38,97 @@ export const GridBooleanCell = /*#__PURE__*/React.memo(props => {
37
38
  titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
38
39
  "data-value": Boolean(value)
39
40
  }, other));
40
- });
41
+ };
42
+
43
+ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
44
+ // ----------------------------- Warning --------------------------------
45
+ // | These PropTypes are generated from the TypeScript type definitions |
46
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
47
+ // ----------------------------------------------------------------------
48
+
49
+ /**
50
+ * GridApi that let you manipulate the grid.
51
+ * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
52
+ */
53
+ api: PropTypes.any.isRequired,
54
+
55
+ /**
56
+ * The mode of the cell.
57
+ */
58
+ cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
59
+
60
+ /**
61
+ * The column of the row that the current cell belongs to.
62
+ */
63
+ colDef: PropTypes.object.isRequired,
64
+
65
+ /**
66
+ * The column field of the cell that triggered the event.
67
+ */
68
+ field: PropTypes.string.isRequired,
69
+
70
+ /**
71
+ * A ref allowing to set imperative focus.
72
+ * It can be passed to the element that should receive focus.
73
+ * @ignore - do not document.
74
+ */
75
+ focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
76
+ current: PropTypes.shape({
77
+ focus: PropTypes.func.isRequired
78
+ })
79
+ })]),
80
+
81
+ /**
82
+ * The cell value formatted with the column valueFormatter.
83
+ */
84
+ formattedValue: PropTypes.any,
85
+
86
+ /**
87
+ * Get the cell value of a row and field.
88
+ * @param {GridRowId} id The row id.
89
+ * @param {string} field The field.
90
+ * @returns {any} The cell value.
91
+ * @deprecated Use `params.row` to directly access the fields you want instead.
92
+ */
93
+ getValue: PropTypes.func.isRequired,
94
+
95
+ /**
96
+ * If true, the cell is the active element.
97
+ */
98
+ hasFocus: PropTypes.bool.isRequired,
99
+
100
+ /**
101
+ * The grid row id.
102
+ */
103
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
104
+
105
+ /**
106
+ * If true, the cell is editable.
107
+ */
108
+ isEditable: PropTypes.bool,
109
+
110
+ /**
111
+ * The row model of the row that the current cell belongs to.
112
+ */
113
+ row: PropTypes.object.isRequired,
114
+
115
+ /**
116
+ * The node of the row that the current cell belongs to.
117
+ */
118
+ rowNode: PropTypes.object.isRequired,
119
+
120
+ /**
121
+ * the tabIndex value.
122
+ */
123
+ tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
124
+
125
+ /**
126
+ * The cell value, but if the column has valueGetter, use getValue.
127
+ */
128
+ value: PropTypes.any
129
+ } : void 0;
130
+ const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
131
+ export { GridBooleanCell };
41
132
  export const renderBooleanCell = params => {
42
133
  if (params.rowNode.isAutoGenerated) {
43
134
  return '';
@@ -6,10 +6,14 @@ import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/material';
7
7
  import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
8
8
  import InputBase from '@mui/material/InputBase';
9
+ import { styled } from '@mui/material/styles';
9
10
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
11
12
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const StyledInputBase = styled(InputBase)({
15
+ fontSize: 'inherit'
16
+ });
13
17
 
14
18
  const useUtilityClasses = ownerState => {
15
19
  const {
@@ -116,7 +120,7 @@ function GridEditDateCell(props) {
116
120
  inputRef.current.focus();
117
121
  }
118
122
  }, [hasFocus]);
119
- return /*#__PURE__*/_jsx(InputBase, _extends({
123
+ return /*#__PURE__*/_jsx(StyledInputBase, _extends({
120
124
  inputRef: inputRef,
121
125
  fullWidth: true,
122
126
  className: classes.root,
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { InputBaseProps } from '@mui/material/InputBase';
3
3
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
4
- export interface GridEditInputCellProps extends GridRenderEditCellParams, Omit<InputBaseProps, 'id' | 'value' | 'tabIndex'> {
4
+ export interface GridEditInputCellProps extends GridRenderEditCellParams, Omit<InputBaseProps, 'id' | 'value' | 'tabIndex' | 'ref'> {
5
5
  debounceMs?: number;
6
6
  /**
7
7
  * Callback called when the value is changed by the user.
@@ -11,9 +11,6 @@ export interface GridEditInputCellProps extends GridRenderEditCellParams, Omit<I
11
11
  */
12
12
  onValueChange?: (event: React.ChangeEvent<HTMLInputElement>, newValue: string) => Promise<void> | void;
13
13
  }
14
- declare function GridEditInputCell(props: GridEditInputCellProps): JSX.Element;
15
- declare namespace GridEditInputCell {
16
- var propTypes: any;
17
- }
14
+ declare const GridEditInputCell: React.ForwardRefExoticComponent<Pick<GridEditInputCellProps, keyof GridEditInputCellProps> & React.RefAttributes<HTMLInputElement>>;
18
15
  export { GridEditInputCell };
19
16
  export declare const renderEditInputCell: (params: GridEditInputCellProps) => JSX.Element;
@@ -37,8 +37,7 @@ const GridEditInputCellRoot = styled(InputBase, {
37
37
  height: '100%'
38
38
  }
39
39
  }));
40
-
41
- function GridEditInputCell(props) {
40
+ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
42
41
  var _rootProps$experiment;
43
42
 
44
43
  const rootProps = useGridRootProps();
@@ -86,6 +85,7 @@ function GridEditInputCell(props) {
86
85
  }
87
86
  }, [hasFocus]);
88
87
  return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({
88
+ ref: ref,
89
89
  inputRef: inputRef,
90
90
  className: classes.root,
91
91
  fullWidth: true,
@@ -94,8 +94,7 @@ function GridEditInputCell(props) {
94
94
  onChange: handleChange,
95
95
  endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(GridLoadIcon, {}) : undefined
96
96
  }, other));
97
- }
98
-
97
+ });
99
98
  process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
100
99
  // ----------------------------- Warning --------------------------------
101
100
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -106,23 +105,23 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
106
105
  * GridApi that let you manipulate the grid.
107
106
  * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
108
107
  */
109
- api: PropTypes.any.isRequired,
108
+ api: PropTypes.any,
110
109
 
111
110
  /**
112
111
  * The mode of the cell.
113
112
  */
114
- cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
113
+ cellMode: PropTypes.oneOf(['edit', 'view']),
115
114
 
116
115
  /**
117
116
  * The column of the row that the current cell belongs to.
118
117
  */
119
- colDef: PropTypes.object.isRequired,
118
+ colDef: PropTypes.object,
120
119
  debounceMs: PropTypes.number,
121
120
 
122
121
  /**
123
122
  * The column field of the cell that triggered the event.
124
123
  */
125
- field: PropTypes.string.isRequired,
124
+ field: PropTypes.string,
126
125
 
127
126
  /**
128
127
  * The cell value formatted with the column valueFormatter.
@@ -136,17 +135,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
136
135
  * @returns {any} The cell value.
137
136
  * @deprecated Use `params.row` to directly access the fields you want instead.
138
137
  */
139
- getValue: PropTypes.func.isRequired,
138
+ getValue: PropTypes.func,
140
139
 
141
140
  /**
142
141
  * If true, the cell is the active element.
143
142
  */
144
- hasFocus: PropTypes.bool.isRequired,
143
+ hasFocus: PropTypes.bool,
145
144
 
146
145
  /**
147
146
  * The grid row id.
148
147
  */
149
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
148
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
150
149
 
151
150
  /**
152
151
  * If true, the cell is editable.
@@ -166,17 +165,17 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
166
165
  /**
167
166
  * The row model of the row that the current cell belongs to.
168
167
  */
169
- row: PropTypes.object.isRequired,
168
+ row: PropTypes.object,
170
169
 
171
170
  /**
172
171
  * The node of the row that the current cell belongs to.
173
172
  */
174
- rowNode: PropTypes.object.isRequired,
173
+ rowNode: PropTypes.object,
175
174
 
176
175
  /**
177
176
  * the tabIndex value.
178
177
  */
179
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
178
+ tabIndex: PropTypes.oneOf([-1, 0]),
180
179
 
181
180
  /**
182
181
  * The cell value, but if the column has valueGetter, use getValue.
@@ -9,6 +9,10 @@ export interface GridEditSingleSelectCellProps extends GridRenderEditCellParams,
9
9
  * @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
10
10
  */
11
11
  onValueChange?: (event: SelectChangeEvent<any>, newValue: any) => Promise<void> | void;
12
+ /**
13
+ * If true, the select opens by default.
14
+ */
15
+ initialOpen?: boolean;
12
16
  }
13
17
  declare function GridEditSingleSelectCell(props: GridEditSingleSelectCellProps): JSX.Element;
14
18
  declare namespace GridEditSingleSelectCell {
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
@@ -26,6 +26,8 @@ const renderSingleSelectOptions = (option, OptionComponent) => {
26
26
  function GridEditSingleSelectCell(props) {
27
27
  var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;
28
28
 
29
+ const rootProps = useGridRootProps();
30
+
29
31
  const {
30
32
  id,
31
33
  value,
@@ -35,15 +37,15 @@ function GridEditSingleSelectCell(props) {
35
37
  colDef,
36
38
  hasFocus,
37
39
  error,
38
- onValueChange
40
+ onValueChange,
41
+ initialOpen = rootProps.editMode === GridEditModes.Cell
39
42
  } = props,
40
43
  other = _objectWithoutPropertiesLoose(props, _excluded);
41
44
 
42
45
  const apiRef = useGridApiContext();
43
46
  const ref = React.useRef();
44
47
  const inputRef = React.useRef();
45
- const rootProps = useGridRootProps();
46
- const [open, setOpen] = React.useState(rootProps.editMode === 'cell');
48
+ const [open, setOpen] = React.useState(initialOpen);
47
49
  const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};
48
50
  const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
49
51
  let valueOptionsFormatted;
@@ -218,6 +220,11 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
218
220
  */
219
221
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
220
222
 
223
+ /**
224
+ * If true, the select opens by default.
225
+ */
226
+ initialOpen: PropTypes.bool,
227
+
221
228
  /**
222
229
  * If true, the cell is editable.
223
230
  */
@@ -1,4 +1,5 @@
1
1
  export * from './GridCell';
2
+ export * from './GridBooleanCell';
2
3
  export * from './GridEditBooleanCell';
3
4
  export * from './GridEditDateCell';
4
5
  export * from './GridEditInputCell';
@@ -1,4 +1,5 @@
1
1
  export * from './GridCell';
2
+ export * from './GridBooleanCell';
2
3
  export * from './GridEditBooleanCell';
3
4
  export * from './GridEditDateCell';
4
5
  export * from './GridEditInputCell';