@mui/x-data-grid 8.0.0-alpha.6 → 8.0.0-alpha.8

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 (397) hide show
  1. package/CHANGELOG.md +242 -1
  2. package/DataGrid/DataGrid.js +4 -5
  3. package/DataGrid/useDataGridComponent.d.ts +1 -1
  4. package/DataGrid/useDataGridComponent.js +1 -1
  5. package/components/GridHeaders.js +2 -2
  6. package/components/GridRow.d.ts +5 -9
  7. package/components/GridRow.js +26 -78
  8. package/components/GridSkeletonLoadingOverlay.js +18 -18
  9. package/components/cell/GridActionsCellItem.d.ts +16 -9
  10. package/components/cell/GridActionsCellItem.js +2 -0
  11. package/components/cell/GridCell.d.ts +9 -16
  12. package/components/cell/GridCell.js +17 -35
  13. package/components/cell/GridEditDateCell.js +1 -1
  14. package/components/cell/GridEditInputCell.js +1 -1
  15. package/components/cell/GridEditSingleSelectCell.js +2 -2
  16. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  17. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
  18. package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  19. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  20. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
  21. package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  22. package/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
  23. package/components/columnSelection/GridHeaderCheckbox.js +6 -2
  24. package/components/columnsManagement/GridColumnsManagement.js +2 -2
  25. package/components/containers/GridRoot.d.ts +2 -2
  26. package/components/containers/GridRoot.js +14 -6
  27. package/components/containers/GridRootStyles.js +7 -0
  28. package/components/panel/GridPanel.d.ts +1 -1
  29. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
  30. package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  31. package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
  32. package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  33. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  34. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  35. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
  36. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  37. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
  38. package/components/panel/filterPanel/GridFilterInputValue.js +40 -37
  39. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
  40. package/components/toolbar/GridToolbarQuickFilter.js +2 -2
  41. package/components/virtualization/GridVirtualScrollbar.js +11 -12
  42. package/components/virtualization/GridVirtualScroller.js +4 -4
  43. package/constants/gridClasses.d.ts +12 -0
  44. package/constants/gridClasses.js +1 -1
  45. package/constants/localeTextConstants.js +1 -0
  46. package/context/GridContextProvider.d.ts +1 -1
  47. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +9 -2
  48. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
  49. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
  50. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  51. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
  52. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  53. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
  54. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
  55. package/hooks/core/useGridApiInitialization.d.ts +1 -1
  56. package/hooks/core/useGridApiInitialization.js +2 -2
  57. package/hooks/core/useGridInitialization.d.ts +1 -1
  58. package/hooks/core/useGridIsRtl.d.ts +1 -1
  59. package/hooks/core/useGridLocaleText.d.ts +1 -1
  60. package/hooks/core/useGridLoggerFactory.d.ts +1 -1
  61. package/hooks/core/useGridRefs.d.ts +1 -1
  62. package/hooks/core/useGridStateInitialization.d.ts +1 -1
  63. package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
  64. package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
  65. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
  66. package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  67. package/hooks/features/columnMenu/useGridColumnMenu.d.ts +1 -1
  68. package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
  69. package/hooks/features/columnResize/useGridColumnResize.js +4 -4
  70. package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
  71. package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
  72. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  73. package/hooks/features/density/useGridDensity.d.ts +1 -1
  74. package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
  75. package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
  76. package/hooks/features/editing/useGridCellEditing.js +1 -1
  77. package/hooks/features/editing/useGridEditing.d.ts +1 -1
  78. package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
  79. package/hooks/features/editing/useGridRowEditing.js +2 -2
  80. package/hooks/features/events/useGridEvents.d.ts +1 -1
  81. package/hooks/features/export/serializers/csvSerializer.d.ts +1 -1
  82. package/hooks/features/export/useGridCsvExport.d.ts +1 -1
  83. package/hooks/features/export/useGridPrintExport.d.ts +1 -1
  84. package/hooks/features/export/useGridPrintExport.js +1 -1
  85. package/hooks/features/export/utils.d.ts +1 -1
  86. package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
  87. package/hooks/features/filter/gridFilterSelector.js +6 -1
  88. package/hooks/features/filter/gridFilterUtils.d.ts +6 -6
  89. package/hooks/features/filter/gridFilterUtils.js +3 -3
  90. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  91. package/hooks/features/focus/useGridFocus.d.ts +1 -1
  92. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
  93. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  94. package/hooks/features/keyboardNavigation/utils.d.ts +2 -2
  95. package/hooks/features/listView/useGridListView.d.ts +1 -1
  96. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
  97. package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
  98. package/hooks/features/pagination/gridPaginationSelector.js +39 -1
  99. package/hooks/features/pagination/useGridPagination.d.ts +2 -2
  100. package/hooks/features/pagination/useGridPagination.js +5 -3
  101. package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
  102. package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
  103. package/hooks/features/pagination/useGridPaginationModel.js +23 -1
  104. package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
  105. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
  106. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  107. package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
  108. package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
  109. package/hooks/features/rowSelection/utils.d.ts +2 -2
  110. package/hooks/features/rows/gridRowSpanningUtils.d.ts +1 -1
  111. package/hooks/features/rows/gridRowsSelector.js +1 -1
  112. package/hooks/features/rows/gridRowsUtils.d.ts +3 -3
  113. package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
  114. package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
  115. package/hooks/features/rows/useGridRows.d.ts +1 -1
  116. package/hooks/features/rows/useGridRows.js +2 -2
  117. package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
  118. package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
  119. package/hooks/features/scroll/useGridScroll.d.ts +1 -1
  120. package/hooks/features/sorting/gridSortingUtils.d.ts +2 -2
  121. package/hooks/features/sorting/gridSortingUtils.js +2 -2
  122. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  123. package/hooks/features/statePersistence/useGridStatePersistence.d.ts +1 -1
  124. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
  125. package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  126. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +5 -4
  127. package/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  128. package/hooks/features/virtualization/useGridVirtualization.d.ts +1 -1
  129. package/hooks/utils/useGridApiContext.d.ts +1 -1
  130. package/hooks/utils/useGridApiEventHandler.d.ts +3 -3
  131. package/hooks/utils/useGridApiEventHandler.js +1 -1
  132. package/hooks/utils/useGridApiMethod.d.ts +1 -1
  133. package/hooks/utils/useGridApiRef.d.ts +1 -1
  134. package/hooks/utils/useGridInitializeState.d.ts +2 -2
  135. package/hooks/utils/useGridLogger.d.ts +1 -1
  136. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  137. package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
  138. package/hooks/utils/useGridSelector.d.ts +1 -1
  139. package/hooks/utils/useGridVisibleRows.d.ts +7 -5
  140. package/hooks/utils/useGridVisibleRows.js +5 -28
  141. package/index.js +1 -1
  142. package/internals/constants.d.ts +6 -0
  143. package/internals/constants.js +8 -1
  144. package/internals/index.d.ts +2 -1
  145. package/internals/index.js +1 -0
  146. package/internals/utils/attachPinnedStyle.d.ts +2 -0
  147. package/internals/utils/attachPinnedStyle.js +9 -0
  148. package/internals/utils/getPinnedCellOffset.d.ts +3 -3
  149. package/internals/utils/getPinnedCellOffset.js +6 -7
  150. package/internals/utils/index.d.ts +1 -0
  151. package/internals/utils/index.js +2 -1
  152. package/locales/arSD.js +2 -0
  153. package/locales/beBY.js +1 -0
  154. package/locales/bgBG.js +2 -0
  155. package/locales/csCZ.js +2 -0
  156. package/locales/daDK.js +2 -0
  157. package/locales/deDE.js +2 -0
  158. package/locales/elGR.js +2 -0
  159. package/locales/esES.js +2 -0
  160. package/locales/faIR.js +2 -0
  161. package/locales/fiFI.js +2 -0
  162. package/locales/frFR.js +2 -0
  163. package/locales/heIL.js +2 -0
  164. package/locales/hrHR.js +2 -0
  165. package/locales/huHU.js +2 -0
  166. package/locales/isIS.js +2 -0
  167. package/locales/itIT.js +2 -0
  168. package/locales/jaJP.js +2 -0
  169. package/locales/koKR.js +2 -0
  170. package/locales/nbNO.js +2 -0
  171. package/locales/nlNL.js +2 -0
  172. package/locales/nnNO.js +2 -0
  173. package/locales/plPL.js +2 -0
  174. package/locales/ptBR.js +2 -0
  175. package/locales/ptPT.js +2 -0
  176. package/locales/roRO.js +2 -0
  177. package/locales/ruRU.js +2 -0
  178. package/locales/skSK.js +2 -0
  179. package/locales/svSE.js +2 -0
  180. package/locales/trTR.js +2 -0
  181. package/locales/ukUA.js +2 -0
  182. package/locales/urPK.js +2 -0
  183. package/locales/viVN.js +2 -0
  184. package/locales/zhCN.js +2 -0
  185. package/locales/zhHK.js +2 -0
  186. package/locales/zhTW.js +2 -0
  187. package/material/index.js +2 -1
  188. package/models/api/gridCoreApi.d.ts +7 -7
  189. package/models/api/gridDensityApi.d.ts +1 -1
  190. package/models/api/gridLocaleTextApi.d.ts +1 -0
  191. package/models/colDef/gridColDef.d.ts +8 -8
  192. package/models/events/gridEventLookup.d.ts +6 -1
  193. package/models/gridBaseSlots.d.ts +32 -2
  194. package/models/gridExport.d.ts +1 -1
  195. package/models/gridFilterOperator.d.ts +1 -1
  196. package/models/gridIconSlotsComponent.d.ts +5 -0
  197. package/models/gridSlotsComponentsProps.d.ts +12 -8
  198. package/models/gridStateCommunity.d.ts +4 -0
  199. package/models/props/DataGridProps.d.ts +1 -1
  200. package/modern/DataGrid/DataGrid.js +4 -5
  201. package/modern/DataGrid/useDataGridComponent.js +1 -1
  202. package/modern/components/GridHeaders.js +2 -2
  203. package/modern/components/GridRow.js +26 -78
  204. package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
  205. package/modern/components/cell/GridActionsCellItem.js +2 -0
  206. package/modern/components/cell/GridCell.js +17 -35
  207. package/modern/components/cell/GridEditDateCell.js +1 -1
  208. package/modern/components/cell/GridEditInputCell.js +1 -1
  209. package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
  210. package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  211. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  212. package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  213. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +4 -3
  214. package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -2
  215. package/modern/components/columnsManagement/GridColumnsManagement.js +2 -2
  216. package/modern/components/containers/GridRoot.js +14 -6
  217. package/modern/components/containers/GridRootStyles.js +7 -0
  218. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  219. package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
  220. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  221. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  222. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  223. package/modern/components/panel/filterPanel/GridFilterInputValue.js +40 -37
  224. package/modern/components/toolbar/GridToolbarQuickFilter.js +2 -2
  225. package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
  226. package/modern/components/virtualization/GridVirtualScroller.js +4 -4
  227. package/modern/constants/gridClasses.js +1 -1
  228. package/modern/constants/localeTextConstants.js +1 -0
  229. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  230. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  231. package/modern/hooks/core/useGridApiInitialization.js +2 -2
  232. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
  233. package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
  234. package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
  235. package/modern/hooks/features/editing/useGridRowEditing.js +2 -2
  236. package/modern/hooks/features/export/useGridPrintExport.js +1 -1
  237. package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
  238. package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
  239. package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
  240. package/modern/hooks/features/pagination/useGridPagination.js +5 -3
  241. package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
  242. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  243. package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
  244. package/modern/hooks/features/rows/useGridRows.js +2 -2
  245. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
  246. package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
  247. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  248. package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
  249. package/modern/hooks/utils/useGridVisibleRows.js +5 -28
  250. package/modern/index.js +1 -1
  251. package/modern/internals/constants.js +8 -1
  252. package/modern/internals/index.js +1 -0
  253. package/modern/internals/utils/attachPinnedStyle.js +9 -0
  254. package/modern/internals/utils/getPinnedCellOffset.js +6 -7
  255. package/modern/internals/utils/index.js +2 -1
  256. package/modern/locales/arSD.js +2 -0
  257. package/modern/locales/beBY.js +1 -0
  258. package/modern/locales/bgBG.js +2 -0
  259. package/modern/locales/csCZ.js +2 -0
  260. package/modern/locales/daDK.js +2 -0
  261. package/modern/locales/deDE.js +2 -0
  262. package/modern/locales/elGR.js +2 -0
  263. package/modern/locales/esES.js +2 -0
  264. package/modern/locales/faIR.js +2 -0
  265. package/modern/locales/fiFI.js +2 -0
  266. package/modern/locales/frFR.js +2 -0
  267. package/modern/locales/heIL.js +2 -0
  268. package/modern/locales/hrHR.js +2 -0
  269. package/modern/locales/huHU.js +2 -0
  270. package/modern/locales/isIS.js +2 -0
  271. package/modern/locales/itIT.js +2 -0
  272. package/modern/locales/jaJP.js +2 -0
  273. package/modern/locales/koKR.js +2 -0
  274. package/modern/locales/nbNO.js +2 -0
  275. package/modern/locales/nlNL.js +2 -0
  276. package/modern/locales/nnNO.js +2 -0
  277. package/modern/locales/plPL.js +2 -0
  278. package/modern/locales/ptBR.js +2 -0
  279. package/modern/locales/ptPT.js +2 -0
  280. package/modern/locales/roRO.js +2 -0
  281. package/modern/locales/ruRU.js +2 -0
  282. package/modern/locales/skSK.js +2 -0
  283. package/modern/locales/svSE.js +2 -0
  284. package/modern/locales/trTR.js +2 -0
  285. package/modern/locales/ukUA.js +2 -0
  286. package/modern/locales/urPK.js +2 -0
  287. package/modern/locales/viVN.js +2 -0
  288. package/modern/locales/zhCN.js +2 -0
  289. package/modern/locales/zhHK.js +2 -0
  290. package/modern/locales/zhTW.js +2 -0
  291. package/modern/material/index.js +2 -1
  292. package/modern/utils/cellBorderUtils.js +5 -5
  293. package/modern/utils/domUtils.js +7 -2
  294. package/modern/utils/rtlFlipSide.js +22 -0
  295. package/node/DataGrid/DataGrid.js +2 -3
  296. package/node/DataGrid/useDataGridComponent.js +1 -1
  297. package/node/components/GridHeaders.js +2 -2
  298. package/node/components/GridRow.js +25 -77
  299. package/node/components/GridSkeletonLoadingOverlay.js +17 -17
  300. package/node/components/cell/GridActionsCellItem.js +1 -1
  301. package/node/components/cell/GridCell.js +18 -36
  302. package/node/components/cell/GridEditDateCell.js +1 -1
  303. package/node/components/cell/GridEditInputCell.js +1 -1
  304. package/node/components/cell/GridEditSingleSelectCell.js +2 -2
  305. package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
  306. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -1
  307. package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
  308. package/node/components/columnSelection/GridCellCheckboxRenderer.js +3 -2
  309. package/node/components/columnSelection/GridHeaderCheckbox.js +6 -2
  310. package/node/components/columnsManagement/GridColumnsManagement.js +2 -2
  311. package/node/components/containers/GridRoot.js +14 -6
  312. package/node/components/containers/GridRootStyles.js +7 -0
  313. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
  314. package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
  315. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
  316. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  317. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
  318. package/node/components/panel/filterPanel/GridFilterInputValue.js +39 -36
  319. package/node/components/toolbar/GridToolbarQuickFilter.js +2 -2
  320. package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
  321. package/node/components/virtualization/GridVirtualScroller.js +4 -4
  322. package/node/constants/gridClasses.js +1 -1
  323. package/node/constants/localeTextConstants.js +1 -0
  324. package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  325. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  326. package/node/hooks/core/useGridApiInitialization.js +2 -2
  327. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
  328. package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
  329. package/node/hooks/features/editing/useGridCellEditing.js +1 -1
  330. package/node/hooks/features/editing/useGridRowEditing.js +2 -2
  331. package/node/hooks/features/export/useGridPrintExport.js +1 -1
  332. package/node/hooks/features/filter/gridFilterSelector.js +6 -1
  333. package/node/hooks/features/filter/gridFilterUtils.js +3 -3
  334. package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
  335. package/node/hooks/features/pagination/useGridPagination.js +5 -3
  336. package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
  337. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  338. package/node/hooks/features/rows/gridRowsSelector.js +1 -1
  339. package/node/hooks/features/rows/useGridRows.js +1 -1
  340. package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
  341. package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
  342. package/node/hooks/features/virtualization/useGridVirtualScroller.js +96 -43
  343. package/node/hooks/utils/useGridApiEventHandler.js +1 -1
  344. package/node/hooks/utils/useGridVisibleRows.js +3 -28
  345. package/node/index.js +1 -1
  346. package/node/internals/constants.js +9 -2
  347. package/node/internals/index.js +12 -0
  348. package/node/internals/utils/attachPinnedStyle.js +15 -0
  349. package/node/internals/utils/getPinnedCellOffset.js +6 -7
  350. package/node/internals/utils/index.js +11 -0
  351. package/node/locales/arSD.js +2 -0
  352. package/node/locales/beBY.js +1 -0
  353. package/node/locales/bgBG.js +2 -0
  354. package/node/locales/csCZ.js +2 -0
  355. package/node/locales/daDK.js +2 -0
  356. package/node/locales/deDE.js +2 -0
  357. package/node/locales/elGR.js +2 -0
  358. package/node/locales/esES.js +2 -0
  359. package/node/locales/faIR.js +2 -0
  360. package/node/locales/fiFI.js +2 -0
  361. package/node/locales/frFR.js +2 -0
  362. package/node/locales/heIL.js +2 -0
  363. package/node/locales/hrHR.js +2 -0
  364. package/node/locales/huHU.js +2 -0
  365. package/node/locales/isIS.js +2 -0
  366. package/node/locales/itIT.js +2 -0
  367. package/node/locales/jaJP.js +2 -0
  368. package/node/locales/koKR.js +2 -0
  369. package/node/locales/nbNO.js +2 -0
  370. package/node/locales/nlNL.js +2 -0
  371. package/node/locales/nnNO.js +2 -0
  372. package/node/locales/plPL.js +2 -0
  373. package/node/locales/ptBR.js +2 -0
  374. package/node/locales/ptPT.js +2 -0
  375. package/node/locales/roRO.js +2 -0
  376. package/node/locales/ruRU.js +2 -0
  377. package/node/locales/skSK.js +2 -0
  378. package/node/locales/svSE.js +2 -0
  379. package/node/locales/trTR.js +2 -0
  380. package/node/locales/ukUA.js +2 -0
  381. package/node/locales/urPK.js +2 -0
  382. package/node/locales/viVN.js +2 -0
  383. package/node/locales/zhCN.js +2 -0
  384. package/node/locales/zhHK.js +2 -0
  385. package/node/locales/zhTW.js +2 -0
  386. package/node/material/index.js +2 -1
  387. package/node/utils/cellBorderUtils.js +5 -5
  388. package/node/utils/domUtils.js +7 -2
  389. package/node/utils/rtlFlipSide.js +29 -0
  390. package/package.json +2 -2
  391. package/utils/cellBorderUtils.d.ts +3 -3
  392. package/utils/cellBorderUtils.js +5 -5
  393. package/utils/createSelector.d.ts +1 -1
  394. package/utils/domUtils.js +7 -2
  395. package/utils/getPublicApiRef.d.ts +1 -1
  396. package/utils/rtlFlipSide.d.ts +2 -0
  397. package/utils/rtlFlipSide.js +22 -0
@@ -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 = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
3
+ const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "showRightBorder", "showLeftBorder", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
4
4
  _excluded2 = ["changeReason", "unstable_updateValueOnRender"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
@@ -16,22 +16,16 @@ import { useGridSelector, objectShallowCompare } from "../../hooks/utils/useGrid
16
16
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
17
17
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
18
18
  import { gridFocusCellSelector } from "../../hooks/features/focus/gridFocusStateSelector.js";
19
- import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../../utils/cellBorderUtils.js";
20
19
  import { GridPinnedColumnPosition } from "../../hooks/features/columns/gridColumnsInterfaces.js";
20
+ import { PinnedColumnPosition } from "../../internals/constants.js";
21
21
  import { gridRowSpanningHiddenCellsSelector, gridRowSpanningSpannedCellsSelector } from "../../hooks/features/rows/gridRowSpanningSelectors.js";
22
+ import { attachPinnedStyle } from "../../internals/utils/index.js";
22
23
  import { jsx as _jsx } from "react/jsx-runtime";
23
- export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
24
- PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
25
- PinnedPosition[PinnedPosition["LEFT"] = 1] = "LEFT";
26
- PinnedPosition[PinnedPosition["RIGHT"] = 2] = "RIGHT";
27
- PinnedPosition[PinnedPosition["VIRTUAL"] = 3] = "VIRTUAL";
28
- return PinnedPosition;
29
- }({});
30
24
  export const gridPinnedColumnPositionLookup = {
31
- [PinnedPosition.LEFT]: GridPinnedColumnPosition.LEFT,
32
- [PinnedPosition.RIGHT]: GridPinnedColumnPosition.RIGHT,
33
- [PinnedPosition.NONE]: undefined,
34
- [PinnedPosition.VIRTUAL]: undefined
25
+ [PinnedColumnPosition.LEFT]: GridPinnedColumnPosition.LEFT,
26
+ [PinnedColumnPosition.RIGHT]: GridPinnedColumnPosition.RIGHT,
27
+ [PinnedColumnPosition.NONE]: undefined,
28
+ [PinnedColumnPosition.VIRTUAL]: undefined
35
29
  };
36
30
  const EMPTY_CELL_PARAMS = {
37
31
  id: -1,
@@ -69,7 +63,7 @@ const useUtilityClasses = ownerState => {
69
63
  classes
70
64
  } = ownerState;
71
65
  const slots = {
72
- root: ['cell', `cell--text${capitalize(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition === PinnedPosition.LEFT && 'cell--pinnedLeft', pinnedPosition === PinnedPosition.RIGHT && 'cell--pinnedRight', isSelectionMode && !isEditable && 'cell--selectionMode']
66
+ root: ['cell', `cell--text${capitalize(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition === PinnedColumnPosition.LEFT && 'cell--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'cell--pinnedRight', isSelectionMode && !isEditable && 'cell--selectionMode']
73
67
  };
74
68
  return composeClasses(slots, getDataGridUtilityClass, classes);
75
69
  };
@@ -92,9 +86,8 @@ const GridCell = forwardRef(function GridCell(props, ref) {
92
86
  isNotVisible,
93
87
  pinnedOffset,
94
88
  pinnedPosition,
95
- sectionIndex,
96
- sectionLength,
97
- gridHasFiller,
89
+ showRightBorder,
90
+ showLeftBorder,
98
91
  onClick,
99
92
  onDoubleClick,
100
93
  onMouseDown,
@@ -161,9 +154,6 @@ const GridCell = forwardRef(function GridCell(props, ref) {
161
154
  const handleRef = useForkRef(ref, cellRef);
162
155
  const focusElementRef = React.useRef(null);
163
156
  const isSelectionMode = rootProps.cellSelection ?? false;
164
- const position = gridPinnedColumnPositionLookup[pinnedPosition];
165
- const showLeftBorder = shouldCellShowLeftBorder(position, sectionIndex);
166
- const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
167
157
  const ownerState = {
168
158
  align,
169
159
  showLeftBorder,
@@ -212,18 +202,11 @@ const GridCell = forwardRef(function GridCell(props, ref) {
212
202
  border: 0
213
203
  };
214
204
  }
215
- const cellStyle = _extends({
205
+ const cellStyle = attachPinnedStyle(_extends({
216
206
  '--width': `${width}px`
217
- }, styleProp);
218
- const isLeftPinned = pinnedPosition === PinnedPosition.LEFT;
219
- const isRightPinned = pinnedPosition === PinnedPosition.RIGHT;
220
- if (isLeftPinned || isRightPinned) {
221
- let side = isLeftPinned ? 'left' : 'right';
222
- if (isRtl) {
223
- side = isLeftPinned ? 'right' : 'left';
224
- }
225
- cellStyle[side] = pinnedOffset;
226
- }
207
+ }, styleProp), isRtl, pinnedPosition, pinnedOffset);
208
+ const isLeftPinned = pinnedPosition === PinnedColumnPosition.LEFT;
209
+ const isRightPinned = pinnedPosition === PinnedColumnPosition.RIGHT;
227
210
  if (rowSpan > 1) {
228
211
  cellStyle.height = `calc(var(--height) * ${rowSpan})`;
229
212
  cellStyle.zIndex = 5;
@@ -353,13 +336,12 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
353
336
  isValidating: PropTypes.bool,
354
337
  value: PropTypes.any
355
338
  }),
356
- gridHasFiller: PropTypes.bool.isRequired,
357
339
  isNotVisible: PropTypes.bool.isRequired,
358
- pinnedOffset: PropTypes.number.isRequired,
340
+ pinnedOffset: PropTypes.number,
359
341
  pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
360
342
  rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
361
- sectionIndex: PropTypes.number.isRequired,
362
- sectionLength: PropTypes.number.isRequired,
343
+ showLeftBorder: PropTypes.bool.isRequired,
344
+ showRightBorder: PropTypes.bool.isRequired,
363
345
  width: PropTypes.number.isRequired
364
346
  } : void 0;
365
347
  const MemoizedGridCell = fastMemo(GridCell);
@@ -35,7 +35,7 @@ function GridEditDateCell(props) {
35
35
  other = _objectWithoutPropertiesLoose(props, _excluded);
36
36
  const isDateTime = colDef.type === 'dateTime';
37
37
  const apiRef = useGridApiContext();
38
- const inputRef = React.useRef();
38
+ const inputRef = React.useRef(null);
39
39
  const valueTransformed = React.useMemo(() => {
40
40
  let parsedDate;
41
41
  if (valueProp == null) {
@@ -47,7 +47,7 @@ const GridEditInputCell = forwardRef((props, ref) => {
47
47
  } = props,
48
48
  other = _objectWithoutPropertiesLoose(props, _excluded);
49
49
  const apiRef = useGridApiContext();
50
- const inputRef = React.useRef();
50
+ const inputRef = React.useRef(null);
51
51
  const [valueState, setValueState] = React.useState(value);
52
52
  const classes = useUtilityClasses(rootProps);
53
53
  const handleChange = React.useCallback(async event => {
@@ -30,8 +30,8 @@ function GridEditSingleSelectCell(props) {
30
30
  } = props,
31
31
  other = _objectWithoutPropertiesLoose(props, _excluded);
32
32
  const apiRef = useGridApiContext();
33
- const ref = React.useRef();
34
- const inputRef = React.useRef();
33
+ const ref = React.useRef(null);
34
+ const inputRef = React.useRef(null);
35
35
  const [open, setOpen] = React.useState(initialOpen);
36
36
  const baseSelectProps = rootProps.slotProps?.baseSelect || {};
37
37
  const isSelectNative = baseSelectProps.native ?? false;
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { unstable_useId as useId, unstable_composeClasses as composeClasses } from '@mui/utils';
4
+ import { useRtl } from '@mui/system/RtlProvider';
4
5
  import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
5
6
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
6
7
  import { gridColumnGroupsLookupSelector } from "../../hooks/features/columnGrouping/gridColumnGroupsSelector.js";
@@ -8,7 +9,8 @@ import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
8
9
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
9
10
  import { GridGenericColumnHeaderItem } from "./GridGenericColumnHeaderItem.js";
10
11
  import { isEventTargetInPortal } from "../../utils/domUtils.js";
11
- import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../../utils/cellBorderUtils.js";
12
+ import { PinnedColumnPosition } from "../../internals/constants.js";
13
+ import { attachPinnedStyle } from "../../internals/utils/index.js";
12
14
  import { jsx as _jsx } from "react/jsx-runtime";
13
15
  const useUtilityClasses = ownerState => {
14
16
  const {
@@ -22,7 +24,7 @@ const useUtilityClasses = ownerState => {
22
24
  pinnedPosition
23
25
  } = ownerState;
24
26
  const slots = {
25
- root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition === 'left' && 'columnHeader--pinnedLeft', pinnedPosition === 'right' && 'columnHeader--pinnedRight', isLastColumn && 'columnHeader--last'],
27
+ root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition === PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight', isLastColumn && 'columnHeader--last'],
26
28
  draggableContainer: ['columnHeaderDraggableContainer'],
27
29
  titleContainer: ['columnHeaderTitleContainer', 'withBorderColor'],
28
30
  titleContainerContent: ['columnHeaderTitleContainerContent']
@@ -42,12 +44,10 @@ function GridColumnGroupHeader(props) {
42
44
  tabIndex,
43
45
  isLastColumn,
44
46
  pinnedPosition,
45
- style,
46
- indexInSection,
47
- sectionLength,
48
- gridHasFiller
47
+ pinnedOffset
49
48
  } = props;
50
49
  const rootProps = useGridRootProps();
50
+ const isRtl = useRtl();
51
51
  const headerCellRef = React.useRef(null);
52
52
  const apiRef = useGridApiContext();
53
53
  const columnGroupsLookup = useGridSelector(apiRef, gridColumnGroupsLookupSelector);
@@ -72,12 +72,8 @@ function GridColumnGroupHeader(props) {
72
72
  if (groupId && render) {
73
73
  headerComponent = render(renderParams);
74
74
  }
75
- const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
76
- const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
77
75
  const ownerState = _extends({}, props, {
78
76
  classes: rootProps.classes,
79
- showLeftBorder,
80
- showRightBorder,
81
77
  headerAlign,
82
78
  depth,
83
79
  isDragging: false
@@ -110,6 +106,7 @@ function GridColumnGroupHeader(props) {
110
106
  onBlur: publish('columnGroupHeaderBlur')
111
107
  }), [publish]);
112
108
  const headerClassName = typeof group.headerClassName === 'function' ? group.headerClassName(renderParams) : group.headerClassName;
109
+ const style = React.useMemo(() => attachPinnedStyle(_extends({}, props.style), isRtl, pinnedPosition, pinnedOffset), [pinnedPosition, pinnedOffset, props.style, isRtl]);
113
110
  return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({
114
111
  ref: headerCellRef,
115
112
  classes: classes,
@@ -57,7 +57,6 @@ function GridColumnHeaderFilterIconButton(props) {
57
57
  const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
58
58
  id: labelId,
59
59
  onClick: toggleFilter,
60
- color: "default",
61
60
  "aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
62
61
  size: "small",
63
62
  tabIndex: -1,
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import clsx from 'clsx';
5
5
  import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
6
6
  import { fastMemo } from '@mui/x-internals/fastMemo';
7
+ import { useRtl } from '@mui/system/RtlProvider';
7
8
  import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
8
9
  import { ColumnHeaderMenuIcon } from "./ColumnHeaderMenuIcon.js";
9
10
  import { GridColumnHeaderMenu } from "../menu/columnMenu/GridColumnHeaderMenu.js";
@@ -11,7 +12,8 @@ import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasse
11
12
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
12
13
  import { GridGenericColumnHeaderItem } from "./GridGenericColumnHeaderItem.js";
13
14
  import { isEventTargetInPortal } from "../../utils/domUtils.js";
14
- import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from "../../utils/cellBorderUtils.js";
15
+ import { PinnedColumnPosition } from "../../internals/constants.js";
16
+ import { attachPinnedStyle } from "../../internals/utils/index.js";
15
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
18
  const useUtilityClasses = ownerState => {
17
19
  const {
@@ -31,7 +33,7 @@ const useUtilityClasses = ownerState => {
31
33
  // todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
32
34
  const isColumnNumeric = colDef.type === 'number';
33
35
  const slots = {
34
- root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === 'left' && 'columnHeader--pinnedLeft', pinnedPosition === 'right' && 'columnHeader--pinnedRight',
36
+ root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight',
35
37
  // TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom
36
38
  // See https://github.com/mui/mui-x/pull/14559
37
39
  isLastUnpinned && 'columnHeader--lastUnpinned', isSiblingFocused && 'columnHeader--siblingFocused'],
@@ -56,14 +58,14 @@ function GridColumnHeaderItem(props) {
56
58
  tabIndex,
57
59
  disableReorder,
58
60
  separatorSide,
59
- style,
61
+ showLeftBorder,
62
+ showRightBorder,
60
63
  pinnedPosition,
61
- indexInSection,
62
- sectionLength,
63
- gridHasFiller
64
+ pinnedOffset
64
65
  } = props;
65
66
  const apiRef = useGridPrivateApiContext();
66
67
  const rootProps = useGridRootProps();
68
+ const isRtl = useRtl();
67
69
  const headerCellRef = React.useRef(null);
68
70
  const columnMenuId = useId();
69
71
  const columnMenuButtonId = useId();
@@ -74,8 +76,6 @@ function GridColumnHeaderItem(props) {
74
76
  if (colDef.renderHeader) {
75
77
  headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));
76
78
  }
77
- const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
78
- const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
79
79
  const ownerState = _extends({}, props, {
80
80
  classes: rootProps.classes,
81
81
  showRightBorder,
@@ -171,6 +171,7 @@ function GridColumnHeaderItem(props) {
171
171
  colDef
172
172
  }) : colDef.headerClassName;
173
173
  const label = colDef.headerName ?? colDef.field;
174
+ const style = React.useMemo(() => attachPinnedStyle(_extends({}, props.style), isRtl, pinnedPosition, pinnedOffset), [pinnedPosition, pinnedOffset, props.style, isRtl]);
174
175
  return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({
175
176
  ref: headerCellRef,
176
177
  classes: classes,
@@ -209,18 +210,18 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
209
210
  columnMenuOpen: PropTypes.bool.isRequired,
210
211
  disableReorder: PropTypes.bool,
211
212
  filterItemsCounter: PropTypes.number,
212
- gridHasFiller: PropTypes.bool.isRequired,
213
213
  hasFocus: PropTypes.bool,
214
214
  headerHeight: PropTypes.number.isRequired,
215
- indexInSection: PropTypes.number.isRequired,
216
215
  isDragging: PropTypes.bool.isRequired,
217
216
  isLast: PropTypes.bool.isRequired,
218
217
  isLastUnpinned: PropTypes.bool.isRequired,
219
218
  isResizing: PropTypes.bool.isRequired,
220
219
  isSiblingFocused: PropTypes.bool.isRequired,
221
- pinnedPosition: PropTypes.oneOf(['left', 'right']),
222
- sectionLength: PropTypes.number.isRequired,
220
+ pinnedOffset: PropTypes.number,
221
+ pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]),
223
222
  separatorSide: PropTypes.oneOf(['left', 'right']),
223
+ showLeftBorder: PropTypes.bool.isRequired,
224
+ showRightBorder: PropTypes.bool.isRequired,
224
225
  sortDirection: PropTypes.oneOf(['asc', 'desc']),
225
226
  sortIndex: PropTypes.number,
226
227
  style: PropTypes.object,
@@ -8,7 +8,7 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
8
8
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
9
9
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
10
10
  import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
11
- import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
11
+ import { objectShallowCompare, useGridSelector } from "../../hooks/utils/useGridSelector.js";
12
12
  import { getCheckboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const useUtilityClasses = ownerState => {
@@ -76,7 +76,7 @@ const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(
76
76
  const {
77
77
  isIndeterminate,
78
78
  isChecked
79
- } = useGridSelector(apiRef, checkboxPropsSelector);
79
+ } = useGridSelector(apiRef, checkboxPropsSelector, undefined, objectShallowCompare);
80
80
  if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
81
81
  return null;
82
82
  }
@@ -87,7 +87,8 @@ const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(
87
87
  onChange: handleChange,
88
88
  className: classes.root,
89
89
  inputProps: {
90
- 'aria-label': label
90
+ 'aria-label': label,
91
+ name: 'select_row'
91
92
  },
92
93
  onKeyDown: handleKeyDown,
93
94
  indeterminate: isIndeterminate,
@@ -42,13 +42,16 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
42
42
  return selection;
43
43
  }
44
44
  return selection.filter(id => {
45
+ if (rootProps.keepNonExistentRowsSelected) {
46
+ return true;
47
+ }
45
48
  // The row might have been deleted
46
49
  if (!apiRef.current.getRow(id)) {
47
50
  return false;
48
51
  }
49
52
  return rootProps.isRowSelectable(apiRef.current.getRowParams(id));
50
53
  });
51
- }, [apiRef, rootProps.isRowSelectable, selection]);
54
+ }, [apiRef, rootProps.isRowSelectable, selection, rootProps.keepNonExistentRowsSelected]);
52
55
 
53
56
  // All the rows that could be selected / unselected by toggling this checkbox
54
57
  const selectionCandidates = React.useMemo(() => {
@@ -103,7 +106,8 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
103
106
  onChange: handleChange,
104
107
  className: classes.root,
105
108
  inputProps: {
106
- 'aria-label': label
109
+ 'aria-label': label,
110
+ name: 'select_all_rows'
107
111
  },
108
112
  tabIndex: tabIndex,
109
113
  onKeyDown: handleKeyDown,
@@ -140,11 +140,11 @@ function GridColumnsManagement(props) {
140
140
  endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
141
141
  "aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
142
142
  size: "small",
143
- sx: [searchValue ? {
143
+ style: searchValue ? {
144
144
  visibility: 'visible'
145
145
  } : {
146
146
  visibility: 'hidden'
147
- }],
147
+ },
148
148
  tabIndex: -1,
149
149
  onClick: handleSearchReset
150
150
  }, rootProps.slotProps?.baseIconButton, {
@@ -1,10 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["className"];
3
+ const _excluded = ["className", "children"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
8
+ import { fastMemo } from '@mui/x-internals/fastMemo';
8
9
  import { forwardRef } from '@mui/x-internals/forwardRef';
9
10
  import { GridRootStyles } from "./GridRootStyles.js";
10
11
  import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
@@ -12,7 +13,9 @@ import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiCon
12
13
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
13
14
  import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
14
15
  import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { GridHeader } from "../GridHeader.js";
17
+ import { GridBody, GridFooterPlaceholder } from "../base/index.js";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
19
  const useUtilityClasses = (ownerState, density) => {
17
20
  const {
18
21
  autoHeight,
@@ -27,7 +30,8 @@ const useUtilityClasses = (ownerState, density) => {
27
30
  const GridRoot = forwardRef(function GridRoot(props, ref) {
28
31
  const rootProps = useGridRootProps();
29
32
  const {
30
- className
33
+ className,
34
+ children
31
35
  } = props,
32
36
  other = _objectWithoutPropertiesLoose(props, _excluded);
33
37
  const apiRef = useGridPrivateApiContext();
@@ -45,11 +49,14 @@ const GridRoot = forwardRef(function GridRoot(props, ref) {
45
49
  if (!mountedState) {
46
50
  return null;
47
51
  }
48
- return /*#__PURE__*/_jsx(GridRootStyles, _extends({
52
+ return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
49
53
  className: clsx(classes.root, className),
50
54
  ownerState: ownerState
51
55
  }, other, {
52
- ref: handleRef
56
+ ref: handleRef,
57
+ children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
58
+ children: children
59
+ }), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
53
60
  }));
54
61
  });
55
62
  process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
@@ -62,4 +69,5 @@ process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
62
69
  */
63
70
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
64
71
  } : void 0;
65
- export { GridRoot };
72
+ const MemoizedGridRoot = fastMemo(GridRoot);
73
+ export { MemoizedGridRoot as GridRoot };
@@ -331,6 +331,13 @@ export const GridRootStyles = styled('div', {
331
331
  display: 'flex',
332
332
  alignItems: 'center'
333
333
  },
334
+ [`& .${c['columnHeader--filter']}`]: {
335
+ paddingTop: 8,
336
+ paddingBottom: 8,
337
+ paddingRight: 5,
338
+ minHeight: 'min-content',
339
+ overflow: 'hidden'
340
+ },
334
341
  [`& .${c['virtualScroller--hasScrollX']} .${c['columnHeader--last']}`]: {
335
342
  overflow: 'hidden'
336
343
  },
@@ -1,30 +1,24 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
3
+ const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "label", "variant", "InputProps", "InputLabelProps", "sx"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { refType, unstable_useId as useId } from '@mui/utils';
7
- import { styled } from '@mui/material/styles';
8
7
  import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
9
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- const BooleanOperatorContainer = styled('div')({
11
- display: 'flex',
12
- alignItems: 'center',
13
- width: '100%',
14
- [`& button`]: {
15
- margin: 'auto 0px 5px 5px'
16
- }
17
- });
18
9
  function GridFilterInputBoolean(props) {
19
10
  const {
20
11
  item,
21
12
  applyValue,
22
13
  apiRef,
23
14
  focusElementRef,
15
+ headerFilterMenu,
24
16
  clearButton,
25
17
  tabIndex,
26
18
  label: labelProp,
27
- variant = 'standard'
19
+ variant = 'outlined',
20
+ InputProps,
21
+ sx
28
22
  } = props,
29
23
  others = _objectWithoutPropertiesLoose(props, _excluded);
30
24
  const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value));
@@ -45,9 +39,10 @@ function GridFilterInputBoolean(props) {
45
39
  setFilterValueState(sanitizeFilterItemValue(item.value));
46
40
  }, [item.value]);
47
41
  const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
48
- return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
42
+ return /*#__PURE__*/_jsxs(React.Fragment, {
49
43
  children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
50
44
  fullWidth: true,
45
+ sx: sx,
51
46
  children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
52
47
  id: labelId,
53
48
  shrink: true,
@@ -63,11 +58,11 @@ function GridFilterInputBoolean(props) {
63
58
  notched: variant === 'outlined' ? true : undefined,
64
59
  native: isSelectNative,
65
60
  displayEmpty: true,
66
- inputProps: {
61
+ inputProps: _extends({
67
62
  ref: focusElementRef,
68
63
  tabIndex
69
- }
70
- }, others /* FIXME: typing error */, baseSelectProps, {
64
+ }, InputProps?.inputProps)
65
+ }, baseSelectProps, others /* FIXME: typing error */, {
71
66
  children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
72
67
  native: isSelectNative,
73
68
  value: "",
@@ -82,7 +77,7 @@ function GridFilterInputBoolean(props) {
82
77
  children: apiRef.current.getLocaleText('filterValueFalse')
83
78
  }))]
84
79
  }))]
85
- }), clearButton]
80
+ }), headerFilterMenu, clearButton]
86
81
  });
87
82
  }
88
83
  export function sanitizeFilterItemValue(value) {
@@ -105,6 +100,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
105
100
  applyValue: PropTypes.func.isRequired,
106
101
  clearButton: PropTypes.node,
107
102
  focusElementRef: refType,
103
+ headerFilterMenu: PropTypes.node,
108
104
  /**
109
105
  * It is `true` if the filter either has a value or an operator with no value
110
106
  * required is selected (for example `isEmpty`)
@@ -1,12 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
7
7
  import { useTimeout } from "../../../hooks/utils/useTimeout.js";
8
8
  import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  function convertFilterItemValueToInputValue(itemValue, inputType) {
11
11
  if (itemValue == null) {
12
12
  return '';
@@ -35,6 +35,7 @@ function GridFilterInputDate(props) {
35
35
  apiRef,
36
36
  focusElementRef,
37
37
  InputProps,
38
+ headerFilterMenu,
38
39
  clearButton,
39
40
  tabIndex,
40
41
  disabled
@@ -62,33 +63,34 @@ function GridFilterInputDate(props) {
62
63
  const value = convertFilterItemValueToInputValue(item.value, type);
63
64
  setFilterValueState(value);
64
65
  }, [item.value, type]);
65
- return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
66
- fullWidth: true,
67
- id: id,
68
- label: apiRef.current.getLocaleText('filterPanelInputLabel'),
69
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
70
- value: filterValueState,
71
- onChange: onFilterChange,
72
- variant: "standard",
73
- type: type || 'text',
74
- InputLabelProps: {
75
- shrink: true
76
- },
77
- inputRef: focusElementRef,
78
- InputProps: _extends({}, applying || clearButton ? {
79
- endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
80
- fontSize: "small",
81
- color: "action"
82
- }) : clearButton
83
- } : {}, {
84
- disabled
85
- }, InputProps, {
86
- inputProps: _extends({
87
- max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
88
- tabIndex
89
- }, InputProps?.inputProps)
90
- })
91
- }, other, rootProps.slotProps?.baseTextField));
66
+ return /*#__PURE__*/_jsxs(React.Fragment, {
67
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
68
+ fullWidth: true,
69
+ id: id,
70
+ label: apiRef.current.getLocaleText('filterPanelInputLabel'),
71
+ placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
72
+ value: filterValueState,
73
+ onChange: onFilterChange,
74
+ variant: "standard",
75
+ type: type || 'text',
76
+ disabled: disabled,
77
+ InputLabelProps: {
78
+ shrink: true
79
+ },
80
+ inputRef: focusElementRef,
81
+ InputProps: _extends({
82
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
83
+ fontSize: "small",
84
+ color: "action"
85
+ }) : null
86
+ }, InputProps, {
87
+ inputProps: _extends({
88
+ max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
89
+ tabIndex
90
+ }, InputProps?.inputProps)
91
+ })
92
+ }, rootProps.slotProps?.baseTextField, other)), headerFilterMenu, clearButton]
93
+ });
92
94
  }
93
95
  process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
94
96
  // ----------------------------- Warning --------------------------------
@@ -101,6 +103,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
101
103
  applyValue: PropTypes.func.isRequired,
102
104
  clearButton: PropTypes.node,
103
105
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
106
+ headerFilterMenu: PropTypes.node,
104
107
  /**
105
108
  * It is `true` if the filter either has a value or an operator with no value
106
109
  * required is selected (for example `isEmpty`)
@@ -20,7 +20,7 @@ function GridFilterInputMultipleSingleSelect(props) {
20
20
  error,
21
21
  helperText,
22
22
  size,
23
- variant = 'standard'
23
+ variant = 'outlined'
24
24
  } = props,
25
25
  other = _objectWithoutPropertiesLoose(props, _excluded);
26
26
  const TextFieldProps = {
@@ -19,7 +19,7 @@ function GridFilterInputMultipleValue(props) {
19
19
  error,
20
20
  helperText,
21
21
  size,
22
- variant = 'standard'
22
+ variant = 'outlined'
23
23
  } = props,
24
24
  other = _objectWithoutPropertiesLoose(props, _excluded);
25
25
  const TextFieldProps = {