@mui/x-data-grid 7.0.0-beta.6 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/CHANGELOG.md +311 -12
  2. package/DataGrid/DataGrid.js +57 -17
  3. package/DataGrid/useDataGridComponent.js +3 -0
  4. package/DataGrid/useDataGridProps.js +6 -7
  5. package/README.md +1 -1
  6. package/components/GridColumnHeaders.d.ts +1 -2
  7. package/components/GridColumnHeaders.js +6 -17
  8. package/components/GridFooter.js +2 -3
  9. package/components/GridHeader.js +1 -2
  10. package/components/GridHeaders.js +1 -4
  11. package/components/GridPagination.d.ts +6 -5
  12. package/components/GridPagination.js +14 -11
  13. package/components/GridRow.d.ts +1 -1
  14. package/components/GridRow.js +17 -36
  15. package/components/GridScrollArea.d.ts +10 -0
  16. package/components/GridScrollArea.js +150 -0
  17. package/components/base/GridFooterPlaceholder.js +1 -2
  18. package/components/base/GridOverlays.js +3 -6
  19. package/components/cell/GridActionsCell.js +4 -6
  20. package/components/cell/GridActionsCellItem.d.ts +8 -25
  21. package/components/cell/GridActionsCellItem.js +8 -5
  22. package/components/cell/GridBooleanCell.d.ts +1 -0
  23. package/components/cell/GridBooleanCell.js +3 -2
  24. package/components/cell/GridCell.d.ts +7 -0
  25. package/components/cell/GridCell.js +18 -11
  26. package/components/cell/GridEditBooleanCell.js +1 -2
  27. package/components/cell/GridEditDateCell.js +2 -3
  28. package/components/cell/GridEditInputCell.js +2 -2
  29. package/components/cell/GridEditSingleSelectCell.js +5 -8
  30. package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
  31. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  32. package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
  33. package/components/columnHeaders/GridColumnGroupHeader.js +22 -13
  34. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
  35. package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
  36. package/components/columnHeaders/GridColumnHeaderItem.js +26 -12
  37. package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
  38. package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
  39. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
  40. package/components/columnHeaders/GridGenericColumnHeaderItem.js +7 -6
  41. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
  42. package/components/columnSelection/GridHeaderCheckbox.js +1 -2
  43. package/components/columnsManagement/GridColumnsManagement.js +17 -21
  44. package/components/containers/GridRoot.js +3 -3
  45. package/components/containers/GridRootStyles.js +12 -20
  46. package/components/menu/GridMenu.js +4 -6
  47. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  48. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
  49. package/components/panel/GridColumnsPanel.js +1 -2
  50. package/components/panel/GridPanel.d.ts +1 -10
  51. package/components/panel/GridPanel.js +1 -2
  52. package/components/panel/GridPreferencesPanel.js +2 -3
  53. package/components/panel/filterPanel/GridFilterForm.js +24 -27
  54. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
  55. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  56. package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
  57. package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  58. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
  59. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
  60. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
  61. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
  62. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
  63. package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
  64. package/components/panel/filterPanel/GridFilterPanel.js +5 -9
  65. package/components/panel/filterPanel/filterPanelUtils.js +1 -1
  66. package/components/toolbar/GridToolbarColumnsButton.js +3 -5
  67. package/components/toolbar/GridToolbarDensitySelector.js +8 -10
  68. package/components/toolbar/GridToolbarExport.js +2 -2
  69. package/components/toolbar/GridToolbarExportContainer.js +3 -5
  70. package/components/toolbar/GridToolbarFilterButton.js +3 -5
  71. package/components/toolbar/GridToolbarQuickFilter.js +4 -5
  72. package/components/virtualization/GridVirtualScrollbar.js +4 -0
  73. package/components/virtualization/GridVirtualScroller.js +6 -1
  74. package/components/virtualization/GridVirtualScrollerContent.js +1 -2
  75. package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  76. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  77. package/constants/gridClasses.d.ts +6 -32
  78. package/constants/gridClasses.js +1 -1
  79. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
  80. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -2
  81. package/hooks/core/useGridApiInitialization.js +4 -6
  82. package/hooks/features/clipboard/useGridClipboard.js +6 -5
  83. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
  84. package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
  85. package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
  86. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
  87. package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -101
  88. package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
  89. package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
  90. package/hooks/features/columnResize/columnResizeSelector.js +3 -0
  91. package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
  92. package/hooks/features/columnResize/columnResizeState.js +1 -0
  93. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
  94. package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  95. package/hooks/features/columnResize/index.d.ts +3 -0
  96. package/hooks/features/columnResize/index.js +3 -0
  97. package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
  98. package/hooks/features/columnResize/useGridColumnResize.js +553 -0
  99. package/hooks/features/columns/gridColumnsSelector.js +1 -2
  100. package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
  101. package/hooks/features/columns/gridColumnsUtils.js +5 -22
  102. package/hooks/features/columns/useGridColumnSpanning.js +1 -2
  103. package/hooks/features/columns/useGridColumns.js +11 -19
  104. package/hooks/features/density/densitySelector.d.ts +4 -2
  105. package/hooks/features/density/densitySelector.js +8 -2
  106. package/hooks/features/density/densityState.d.ts +1 -4
  107. package/hooks/features/density/useGridDensity.d.ts +2 -4
  108. package/hooks/features/density/useGridDensity.js +21 -29
  109. package/hooks/features/dimensions/useGridDimensions.js +7 -10
  110. package/hooks/features/editing/useGridCellEditing.js +25 -8
  111. package/hooks/features/editing/useGridEditing.js +1 -2
  112. package/hooks/features/editing/useGridRowEditing.js +4 -6
  113. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
  114. package/hooks/features/export/serializers/csvSerializer.js +25 -16
  115. package/hooks/features/export/useGridCsvExport.js +9 -10
  116. package/hooks/features/export/useGridPrintExport.js +17 -22
  117. package/hooks/features/export/utils.js +2 -3
  118. package/hooks/features/filter/gridFilterSelector.js +15 -22
  119. package/hooks/features/filter/gridFilterUtils.js +10 -16
  120. package/hooks/features/filter/useGridFilter.js +9 -15
  121. package/hooks/features/focus/useGridFocus.js +5 -6
  122. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
  123. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  124. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +23 -5
  125. package/hooks/features/index.d.ts +1 -0
  126. package/hooks/features/index.js +1 -0
  127. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
  128. package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
  129. package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
  130. package/hooks/features/pagination/gridPaginationSelector.js +9 -4
  131. package/hooks/features/pagination/useGridPagination.d.ts +1 -6
  132. package/hooks/features/pagination/useGridPagination.js +9 -158
  133. package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
  134. package/hooks/features/pagination/useGridPaginationModel.js +165 -0
  135. package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
  136. package/hooks/features/pagination/useGridRowCount.js +94 -0
  137. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
  138. package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
  139. package/hooks/features/rows/gridRowsSelector.js +11 -19
  140. package/hooks/features/rows/gridRowsUtils.js +7 -9
  141. package/hooks/features/rows/useGridParamsApi.js +1 -1
  142. package/hooks/features/rows/useGridRows.js +4 -13
  143. package/hooks/features/rows/useGridRowsMeta.js +7 -13
  144. package/hooks/features/scroll/useGridScroll.js +3 -4
  145. package/hooks/features/sorting/gridSortingSelector.js +4 -7
  146. package/hooks/features/sorting/useGridSorting.js +8 -14
  147. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
  148. package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  149. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
  150. package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
  151. package/hooks/utils/useGridApiEventHandler.js +5 -10
  152. package/hooks/utils/useGridNativeEventListener.js +1 -2
  153. package/hooks/utils/useLazyRef.d.ts +1 -2
  154. package/hooks/utils/useLazyRef.js +1 -11
  155. package/hooks/utils/useOnMount.d.ts +1 -2
  156. package/hooks/utils/useOnMount.js +1 -7
  157. package/hooks/utils/useTimeout.d.ts +1 -11
  158. package/hooks/utils/useTimeout.js +1 -36
  159. package/index.js +1 -1
  160. package/internals/index.d.ts +3 -1
  161. package/internals/index.js +2 -1
  162. package/internals/utils/getPinnedCellOffset.d.ts +3 -0
  163. package/internals/utils/getPinnedCellOffset.js +17 -0
  164. package/internals/utils/useProps.js +1 -2
  165. package/joy/joySlots.js +18 -63
  166. package/locales/jaJP.js +3 -4
  167. package/material/index.js +0 -2
  168. package/models/api/gridApiCommon.d.ts +3 -3
  169. package/models/api/gridCoreApi.d.ts +1 -5
  170. package/models/api/gridRowsMetaApi.d.ts +1 -1
  171. package/models/api/index.d.ts +1 -1
  172. package/models/api/index.js +0 -1
  173. package/models/events/gridEventLookup.d.ts +13 -0
  174. package/models/gridExport.d.ts +6 -0
  175. package/models/gridHeaderFilteringModel.d.ts +1 -0
  176. package/models/gridSlotsComponent.d.ts +0 -5
  177. package/models/gridStateCommunity.d.ts +3 -0
  178. package/models/params/gridScrollParams.d.ts +5 -3
  179. package/models/props/DataGridProps.d.ts +58 -28
  180. package/modern/DataGrid/DataGrid.js +57 -17
  181. package/modern/DataGrid/useDataGridComponent.js +3 -0
  182. package/modern/DataGrid/useDataGridProps.js +6 -7
  183. package/modern/components/GridColumnHeaders.js +6 -17
  184. package/modern/components/GridHeaders.js +1 -4
  185. package/modern/components/GridPagination.js +13 -6
  186. package/modern/components/GridRow.js +4 -19
  187. package/modern/components/GridScrollArea.js +150 -0
  188. package/modern/components/cell/GridActionsCell.js +1 -1
  189. package/modern/components/cell/GridActionsCellItem.js +4 -0
  190. package/modern/components/cell/GridBooleanCell.js +3 -2
  191. package/modern/components/cell/GridCell.js +11 -3
  192. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  193. package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  194. package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  195. package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  196. package/modern/components/containers/GridRoot.js +3 -3
  197. package/modern/components/containers/GridRootStyles.js +12 -20
  198. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  199. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  200. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  201. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  202. package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
  203. package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
  204. package/modern/components/virtualization/GridVirtualScroller.js +6 -1
  205. package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  206. package/modern/constants/gridClasses.js +1 -1
  207. package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
  208. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
  209. package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
  210. package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
  211. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
  212. package/modern/hooks/features/columnResize/index.js +3 -0
  213. package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
  214. package/modern/hooks/features/columns/gridColumnsUtils.js +4 -20
  215. package/modern/hooks/features/density/densitySelector.js +8 -2
  216. package/modern/hooks/features/density/useGridDensity.js +21 -29
  217. package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
  218. package/modern/hooks/features/editing/useGridCellEditing.js +22 -3
  219. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  220. package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
  221. package/modern/hooks/features/export/useGridCsvExport.js +2 -1
  222. package/modern/hooks/features/export/useGridPrintExport.js +8 -7
  223. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  224. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
  225. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  226. package/modern/hooks/features/index.js +1 -0
  227. package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
  228. package/modern/hooks/features/pagination/useGridPagination.js +8 -149
  229. package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
  230. package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
  231. package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  232. package/modern/hooks/features/scroll/useGridScroll.js +1 -1
  233. package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  234. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  235. package/modern/hooks/utils/useLazyRef.js +1 -11
  236. package/modern/hooks/utils/useOnMount.js +1 -7
  237. package/modern/hooks/utils/useTimeout.js +1 -36
  238. package/modern/index.js +1 -1
  239. package/modern/internals/index.js +2 -1
  240. package/modern/internals/utils/getPinnedCellOffset.js +17 -0
  241. package/modern/joy/joySlots.js +11 -50
  242. package/modern/locales/jaJP.js +3 -4
  243. package/modern/material/index.js +0 -2
  244. package/modern/models/api/index.js +0 -1
  245. package/modern/utils/cellBorderUtils.js +8 -0
  246. package/modern/utils/createSelector.js +1 -1
  247. package/modern/utils/domUtils.js +144 -0
  248. package/modern/utils/keyboardUtils.js +1 -1
  249. package/node/DataGrid/DataGrid.js +57 -17
  250. package/node/DataGrid/useDataGridComponent.js +3 -0
  251. package/node/DataGrid/useDataGridProps.js +6 -7
  252. package/node/components/GridColumnHeaders.js +6 -16
  253. package/node/components/GridHeaders.js +1 -4
  254. package/node/components/GridPagination.js +10 -4
  255. package/node/components/GridRow.js +3 -18
  256. package/node/components/GridScrollArea.js +158 -0
  257. package/node/components/cell/GridActionsCell.js +1 -1
  258. package/node/components/cell/GridActionsCellItem.js +4 -0
  259. package/node/components/cell/GridBooleanCell.js +3 -2
  260. package/node/components/cell/GridCell.js +12 -4
  261. package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
  262. package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
  263. package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
  264. package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
  265. package/node/components/containers/GridRoot.js +2 -2
  266. package/node/components/containers/GridRootStyles.js +12 -20
  267. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  268. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  269. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  270. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  271. package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
  272. package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
  273. package/node/components/virtualization/GridVirtualScroller.js +6 -1
  274. package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  275. package/node/constants/gridClasses.js +1 -1
  276. package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
  277. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
  278. package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
  279. package/node/hooks/features/columnResize/columnResizeState.js +5 -0
  280. package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
  281. package/node/hooks/features/columnResize/index.js +38 -0
  282. package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
  283. package/node/hooks/features/columns/gridColumnsUtils.js +4 -21
  284. package/node/hooks/features/density/densitySelector.js +9 -3
  285. package/node/hooks/features/density/useGridDensity.js +22 -30
  286. package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
  287. package/node/hooks/features/editing/useGridCellEditing.js +22 -3
  288. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  289. package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
  290. package/node/hooks/features/export/useGridCsvExport.js +2 -1
  291. package/node/hooks/features/export/useGridPrintExport.js +8 -7
  292. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  293. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
  294. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
  295. package/node/hooks/features/index.js +11 -0
  296. package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
  297. package/node/hooks/features/pagination/useGridPagination.js +9 -153
  298. package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
  299. package/node/hooks/features/pagination/useGridRowCount.js +103 -0
  300. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  301. package/node/hooks/features/scroll/useGridScroll.js +1 -1
  302. package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
  303. package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  304. package/node/hooks/utils/useLazyRef.js +7 -13
  305. package/node/hooks/utils/useOnMount.js +8 -10
  306. package/node/hooks/utils/useTimeout.js +7 -37
  307. package/node/index.js +1 -1
  308. package/node/internals/index.js +27 -8
  309. package/node/internals/utils/getPinnedCellOffset.js +24 -0
  310. package/node/joy/joySlots.js +11 -50
  311. package/node/locales/jaJP.js +3 -4
  312. package/node/material/index.js +0 -2
  313. package/node/models/api/index.js +0 -11
  314. package/node/utils/cellBorderUtils.js +16 -0
  315. package/node/utils/createSelector.js +1 -1
  316. package/node/utils/domUtils.js +155 -0
  317. package/node/utils/keyboardUtils.js +1 -1
  318. package/package.json +4 -4
  319. package/utils/cellBorderUtils.d.ts +3 -0
  320. package/utils/cellBorderUtils.js +8 -0
  321. package/utils/createSelector.js +9 -9
  322. package/utils/domUtils.d.ts +14 -1
  323. package/utils/domUtils.js +144 -0
  324. package/utils/getGridLocalization.js +9 -12
  325. package/utils/keyboardUtils.js +1 -1
  326. package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
  327. package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  328. package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
  329. package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
@@ -1,15 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { IconButtonProps } from '@mui/material/IconButton';
3
3
  import { MenuItemProps } from '@mui/material/MenuItem';
4
- export type GridActionsCellItemProps = {
4
+ interface GridActionsCellItemCommonProps {
5
5
  label: string;
6
6
  icon?: React.ReactElement;
7
7
  /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
8
8
  component?: React.ElementType;
9
- } & (({
9
+ }
10
+ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
10
11
  showInMenu?: false;
11
12
  icon: React.ReactElement;
12
- } & IconButtonProps) | ({
13
+ } & Omit<IconButtonProps, 'component'>) | ({
13
14
  showInMenu: true;
14
15
  /**
15
16
  * If false, the menu will not close when this item is clicked.
@@ -17,25 +18,11 @@ export type GridActionsCellItemProps = {
17
18
  */
18
19
  closeMenuOnClick?: boolean;
19
20
  closeMenu?: () => void;
20
- } & MenuItemProps));
21
- declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
22
- label: string;
23
- icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
24
- /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
25
- component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
26
- } & {
21
+ } & Omit<MenuItemProps, 'component'>));
22
+ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
27
23
  showInMenu?: false | undefined;
28
24
  icon: React.ReactElement;
29
- } & import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
30
- ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
31
- }, "color" | "size" | "style" | "disabled" | "action" | "className" | "tabIndex" | "children" | "sx" | "classes" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
32
- component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
33
- }, "ref"> | Omit<{
34
- label: string;
35
- icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
36
- /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
37
- component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
38
- } & {
25
+ } & Omit<IconButtonProps, "component">, "ref"> | Omit<GridActionsCellItemCommonProps & {
39
26
  showInMenu: true;
40
27
  /**
41
28
  * If false, the menu will not close when this item is clicked.
@@ -43,9 +30,5 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
43
30
  */
44
31
  closeMenuOnClick?: boolean | undefined;
45
32
  closeMenu?: (() => void) | undefined;
46
- } & import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
47
- ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
48
- }, "style" | "dense" | "disabled" | "action" | "selected" | "autoFocus" | "className" | "tabIndex" | "children" | "sx" | "classes" | "disableGutters" | "divider" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef"> & {
49
- component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
50
- }, "ref">) & React.RefAttributes<HTMLElement>>;
33
+ } & Omit<MenuItemProps, "component">, "ref">) & React.RefAttributes<HTMLElement>>;
51
34
  export { GridActionsCellItem };
@@ -12,7 +12,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
12
12
  const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
13
13
  const rootProps = useGridRootProps();
14
14
  if (!props.showInMenu) {
15
- var _rootProps$slotProps;
16
15
  const {
17
16
  label,
18
17
  icon,
@@ -20,7 +19,7 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
20
19
  } = props,
21
20
  other = _objectWithoutPropertiesLoose(props, _excluded);
22
21
  const handleClick = event => {
23
- onClick == null || onClick(event);
22
+ onClick?.(event);
24
23
  };
25
24
  return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
26
25
  ref: ref,
@@ -29,7 +28,7 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
29
28
  "aria-label": label
30
29
  }, other, {
31
30
  onClick: handleClick
32
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
31
+ }, rootProps.slotProps?.baseIconButton, {
33
32
  children: /*#__PURE__*/React.cloneElement(icon, {
34
33
  fontSize: 'small'
35
34
  })
@@ -44,9 +43,9 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
44
43
  } = props,
45
44
  other = _objectWithoutPropertiesLoose(props, _excluded2);
46
45
  const handleClick = event => {
47
- onClick == null || onClick(event);
46
+ onClick?.(event);
48
47
  if (closeMenuOnClick) {
49
- closeMenu == null || closeMenu();
48
+ closeMenu?.();
50
49
  }
51
50
  };
52
51
  return /*#__PURE__*/_jsxs(MenuItem, _extends({
@@ -63,6 +62,10 @@ process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
63
62
  // | These PropTypes are generated from the TypeScript type definitions |
64
63
  // | To update them edit the TypeScript types and run "yarn proptypes" |
65
64
  // ----------------------------------------------------------------------
65
+ /**
66
+ * from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component
67
+ */
68
+ component: PropTypes.elementType,
66
69
  icon: PropTypes.element,
67
70
  label: PropTypes.string.isRequired,
68
71
  showInMenu: PropTypes.bool
@@ -3,6 +3,7 @@ import { SvgIconProps } from '@mui/material/SvgIcon';
3
3
  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
+ hideDescendantCount?: boolean;
6
7
  }
7
8
  declare function GridBooleanCellRaw(props: GridBooleanCellProps): React.JSX.Element;
8
9
  declare namespace GridBooleanCellRaw {
@@ -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", "hasFocus", "tabIndex"];
3
+ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "hasFocus", "tabIndex", "hideDescendantCount"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
@@ -76,6 +76,7 @@ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
76
76
  * If true, the cell is the active element.
77
77
  */
78
78
  hasFocus: PropTypes.bool.isRequired,
79
+ hideDescendantCount: PropTypes.bool,
79
80
  /**
80
81
  * The grid row id.
81
82
  */
@@ -105,7 +106,7 @@ process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
105
106
  const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
106
107
  export { GridBooleanCell };
107
108
  export const renderBooleanCell = params => {
108
- if (isAutoGeneratedRow(params.rowNode)) {
109
+ if (params.field !== '__row_group_by_columns_group__' && isAutoGeneratedRow(params.rowNode)) {
109
110
  return '';
110
111
  }
111
112
  return /*#__PURE__*/_jsx(GridBooleanCell, _extends({}, params));
@@ -1,12 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { GridRowId, GridEditCellProps } from '../../models';
3
3
  import { GridColDef, GridAlignment } from '../../models/colDef/gridColDef';
4
+ import { GridPinnedColumnPosition } from '../../hooks/features/columns/gridColumnsInterfaces';
4
5
  export declare enum PinnedPosition {
5
6
  NONE = 0,
6
7
  LEFT = 1,
7
8
  RIGHT = 2,
8
9
  VIRTUAL = 3
9
10
  }
11
+ export declare const gridPinnedColumnPositionLookup: {
12
+ 1: GridPinnedColumnPosition;
13
+ 2: GridPinnedColumnPosition;
14
+ 0: undefined;
15
+ 3: undefined;
16
+ };
10
17
  export type GridCellProps = {
11
18
  align: GridAlignment;
12
19
  className?: string;
@@ -15,6 +15,8 @@ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
15
15
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
16
16
  import { gridFocusCellSelector } from '../../hooks/features/focus/gridFocusStateSelector';
17
17
  import { MissingRowIdError } from '../../hooks/features/rows/useGridParamsApi';
18
+ import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from '../../utils/cellBorderUtils';
19
+ import { GridPinnedColumnPosition } from '../../hooks/features/columns/gridColumnsInterfaces';
18
20
  import { jsx as _jsx } from "react/jsx-runtime";
19
21
  export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
20
22
  PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
@@ -23,6 +25,12 @@ export let PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
23
25
  PinnedPosition[PinnedPosition["VIRTUAL"] = 3] = "VIRTUAL";
24
26
  return PinnedPosition;
25
27
  }({});
28
+ export const gridPinnedColumnPositionLookup = {
29
+ [PinnedPosition.LEFT]: GridPinnedColumnPosition.LEFT,
30
+ [PinnedPosition.RIGHT]: GridPinnedColumnPosition.RIGHT,
31
+ [PinnedPosition.NONE]: undefined,
32
+ [PinnedPosition.VIRTUAL]: undefined
33
+ };
26
34
  const EMPTY_CELL_PARAMS = {
27
35
  id: -1,
28
36
  field: '__unset__',
@@ -68,7 +76,6 @@ let warnedOnce = false;
68
76
  // TODO(v7): Removing the wrapper will break the docs performance visualization demo.
69
77
 
70
78
  const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
71
- var _getActions, _ref, _rootProps$cellSelect, _rootProps$experiment;
72
79
  const {
73
80
  column,
74
81
  rowId,
@@ -126,7 +133,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
126
133
  value,
127
134
  formattedValue
128
135
  } = cellParamsWithAPI;
129
- const canManageOwnFocus = column.type === 'actions' && ((_getActions = (_ref = column).getActions) == null ? void 0 : _getActions.call(_ref, apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled));
136
+ const canManageOwnFocus = column.type === 'actions' && column.getActions?.(apiRef.current.getRowParams(rowId)).some(action => !action.props.disabled);
130
137
  const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParamsWithAPI.tabIndex : -1;
131
138
  const {
132
139
  classes: rootClasses,
@@ -153,10 +160,10 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
153
160
  const handleRef = useForkRef(ref, cellRef);
154
161
  const focusElementRef = React.useRef(null);
155
162
  // @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
156
- const isSelectionMode = (_rootProps$cellSelect = rootProps.cellSelection) != null ? _rootProps$cellSelect : false;
157
- const isSectionLastCell = sectionIndex === sectionLength - 1;
158
- const showLeftBorder = pinnedPosition === PinnedPosition.RIGHT && sectionIndex === 0;
159
- const showRightBorder = rootProps.showCellVerticalBorder && (pinnedPosition !== PinnedPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === PinnedPosition.LEFT && isSectionLastCell;
163
+ 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);
160
167
  const ownerState = {
161
168
  align,
162
169
  showLeftBorder,
@@ -236,17 +243,17 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
236
243
  return null;
237
244
  }
238
245
  let handleFocus = other.onFocus;
239
- if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {
246
+ if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {
240
247
  handleFocus = event => {
241
248
  const focusedCell = gridFocusCellSelector(apiRef);
242
- if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {
249
+ if (focusedCell?.id === rowId && focusedCell.field === field) {
243
250
  if (typeof other.onFocus === 'function') {
244
251
  other.onFocus(event);
245
252
  }
246
253
  return;
247
254
  }
248
255
  if (!warnedOnce) {
249
- console.warn([`MUI X: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : focusedCell.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
256
+ console.warn([`MUI X: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell?.id}, field=${focusedCell?.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
250
257
  warnedOnce = true;
251
258
  }
252
259
  };
@@ -266,10 +273,10 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
266
273
  }, editCellStateRest);
267
274
  children = column.renderEditCell(params);
268
275
  classNames.push(gridClasses['cell--editing']);
269
- classNames.push(rootClasses == null ? void 0 : rootClasses['cell--editing']);
276
+ classNames.push(rootClasses?.['cell--editing']);
270
277
  }
271
278
  if (children === undefined) {
272
- const valueString = valueToRender == null ? void 0 : valueToRender.toString();
279
+ const valueString = valueToRender?.toString();
273
280
  children = valueString;
274
281
  title = valueString;
275
282
  }
@@ -19,7 +19,6 @@ const useUtilityClasses = ownerState => {
19
19
  return composeClasses(slots, getDataGridUtilityClass, classes);
20
20
  };
21
21
  function GridEditBooleanCell(props) {
22
- var _rootProps$slotProps;
23
22
  const {
24
23
  id: idProp,
25
24
  value,
@@ -68,7 +67,7 @@ function GridEditBooleanCell(props) {
68
67
  checked: Boolean(valueState),
69
68
  onChange: handleChange,
70
69
  size: "small"
71
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox))
70
+ }, rootProps.slotProps?.baseCheckbox))
72
71
  }));
73
72
  }
74
73
  process.env.NODE_ENV !== "production" ? GridEditBooleanCell.propTypes = {
@@ -43,7 +43,7 @@ function GridEditDateCell(props) {
43
43
  } else if (valueProp instanceof Date) {
44
44
  parsedDate = valueProp;
45
45
  } else {
46
- parsedDate = new Date((valueProp != null ? valueProp : '').toString());
46
+ parsedDate = new Date((valueProp ?? '').toString());
47
47
  }
48
48
  let formattedDate;
49
49
  if (parsedDate == null || Number.isNaN(parsedDate.getTime())) {
@@ -96,8 +96,7 @@ function GridEditDateCell(props) {
96
96
  }, [apiRef, field, id, onValueChange, parseValueToDate]);
97
97
  React.useEffect(() => {
98
98
  setValueState(state => {
99
- var _valueTransformed$par, _state$parsed;
100
- if (valueTransformed.parsed !== state.parsed && ((_valueTransformed$par = valueTransformed.parsed) == null ? void 0 : _valueTransformed$par.getTime()) !== ((_state$parsed = state.parsed) == null ? void 0 : _state$parsed.getTime())) {
99
+ if (valueTransformed.parsed !== state.parsed && valueTransformed.parsed?.getTime() !== state.parsed?.getTime()) {
101
100
  return valueTransformed;
102
101
  }
103
102
  return state;
@@ -70,7 +70,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
70
70
  }, [apiRef, debounceMs, field, id, onValueChange]);
71
71
  const meta = apiRef.current.unstable_getEditCellMeta(id, field);
72
72
  React.useEffect(() => {
73
- if ((meta == null ? void 0 : meta.changeReason) !== 'debouncedSetEditCellValue') {
73
+ if (meta?.changeReason !== 'debouncedSetEditCellValue') {
74
74
  setValueState(value);
75
75
  }
76
76
  }, [meta, value]);
@@ -86,7 +86,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
86
86
  ownerState: rootProps,
87
87
  fullWidth: true,
88
88
  type: colDef.type === 'number' ? colDef.type : 'text',
89
- value: valueState != null ? valueState : '',
89
+ value: valueState ?? '',
90
90
  onChange: handleChange,
91
91
  endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
92
92
  fontSize: "small",
@@ -17,7 +17,6 @@ function isKeyboardEvent(event) {
17
17
  return !!event.key;
18
18
  }
19
19
  function GridEditSingleSelectCell(props) {
20
- var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2;
21
20
  const rootProps = useGridRootProps();
22
21
  const {
23
22
  id,
@@ -35,17 +34,16 @@ function GridEditSingleSelectCell(props) {
35
34
  const ref = React.useRef();
36
35
  const inputRef = React.useRef();
37
36
  const [open, setOpen] = React.useState(initialOpen);
38
- const baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
39
- const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
40
- const _ref = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect) || {},
37
+ const baseSelectProps = rootProps.slotProps?.baseSelect || {};
38
+ const isSelectNative = baseSelectProps.native ?? false;
39
+ const _ref = rootProps.slotProps?.baseSelect || {},
41
40
  {
42
41
  MenuProps
43
42
  } = _ref,
44
43
  otherBaseSelectProps = _objectWithoutPropertiesLoose(_ref, _excluded2);
45
44
  useEnhancedEffect(() => {
46
45
  if (hasFocus) {
47
- var _inputRef$current;
48
- (_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
46
+ inputRef.current?.focus();
49
47
  }
50
48
  }, [hasFocus]);
51
49
  if (!isSingleSelectColDef(colDef)) {
@@ -113,9 +111,8 @@ function GridEditSingleSelectCell(props) {
113
111
  fullWidth: true
114
112
  }, other, otherBaseSelectProps, {
115
113
  children: valueOptions.map(valueOption => {
116
- var _rootProps$slotProps3;
117
114
  const value = getOptionValue(valueOption);
118
- return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, ((_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelectOption) || {}, {
115
+ return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, rootProps.slotProps?.baseSelectOption || {}, {
119
116
  native: isSelectNative,
120
117
  key: value,
121
118
  value: value
@@ -17,7 +17,6 @@ const useUtilityClasses = ownerState => {
17
17
  return composeClasses(slots, getDataGridUtilityClass, classes);
18
18
  };
19
19
  export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
20
- var _rootProps$slotProps, _rootProps$slotProps2;
21
20
  const {
22
21
  colDef,
23
22
  open,
@@ -41,7 +40,7 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
41
40
  children: /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
42
41
  title: apiRef.current.getLocaleText('columnMenuLabel'),
43
42
  enterDelay: 1000
44
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
43
+ }, rootProps.slotProps?.baseTooltip, {
45
44
  children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
46
45
  ref: iconButtonRef,
47
46
  tabIndex: -1,
@@ -53,7 +52,7 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
53
52
  "aria-expanded": open,
54
53
  "aria-controls": open ? columnMenuId : undefined,
55
54
  id: columnMenuButtonId
56
- }, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseIconButton, {
55
+ }, rootProps.slotProps?.baseIconButton, {
57
56
  children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
58
57
  fontSize: "small"
59
58
  })
@@ -23,6 +23,7 @@ const GridColumnHeadersRoot = styled('div', {
23
23
  overridesResolver: (props, styles) => styles.columnHeaders
24
24
  })({
25
25
  display: 'flex',
26
+ flexDirection: 'column',
26
27
  borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
27
28
  borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
28
29
  });
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { GridPinnedColumnPosition } from '../../hooks/features/columns/gridColumnsInterfaces';
2
3
  interface GridColumnGroupHeaderProps {
3
4
  groupId: string | null;
4
5
  width: number;
@@ -10,6 +11,10 @@ interface GridColumnGroupHeaderProps {
10
11
  height: number;
11
12
  hasFocus?: boolean;
12
13
  tabIndex: 0 | -1;
14
+ pinnedPosition?: GridPinnedColumnPosition;
15
+ style?: React.CSSProperties;
16
+ indexInSection: number;
17
+ sectionLength: number;
13
18
  }
14
19
  declare function GridColumnGroupHeader(props: GridColumnGroupHeaderProps): React.JSX.Element;
15
20
  export { GridColumnGroupHeader };
@@ -8,17 +8,20 @@ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
8
8
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
9
9
  import { GridGenericColumnHeaderItem } from './GridGenericColumnHeaderItem';
10
10
  import { isEventTargetInPortal } from '../../utils/domUtils';
11
+ import { shouldCellShowLeftBorder, shouldCellShowRightBorder } from '../../utils/cellBorderUtils';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const useUtilityClasses = ownerState => {
13
14
  const {
14
15
  classes,
15
16
  headerAlign,
16
17
  isDragging,
17
- showColumnBorder,
18
- groupId
18
+ showLeftBorder,
19
+ showRightBorder,
20
+ groupId,
21
+ pinnedPosition
19
22
  } = ownerState;
20
23
  const slots = {
21
- root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showColumnBorder && 'columnHeader--showColumnBorder', showColumnBorder && 'columnHeader--withRightBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup'],
24
+ 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'],
22
25
  draggableContainer: ['columnHeaderDraggableContainer'],
23
26
  titleContainer: ['columnHeaderTitleContainer', 'withBorderColor'],
24
27
  titleContainerContent: ['columnHeaderTitleContainerContent']
@@ -26,7 +29,6 @@ const useUtilityClasses = ownerState => {
26
29
  return composeClasses(slots, getDataGridUtilityClass, classes);
27
30
  };
28
31
  function GridColumnGroupHeader(props) {
29
- var _columnGroupsLookup$g;
30
32
  const {
31
33
  groupId,
32
34
  width,
@@ -37,7 +39,11 @@ function GridColumnGroupHeader(props) {
37
39
  colIndex,
38
40
  hasFocus,
39
41
  tabIndex,
40
- isLastColumn
42
+ isLastColumn,
43
+ pinnedPosition,
44
+ style,
45
+ indexInSection,
46
+ sectionLength
41
47
  } = props;
42
48
  const rootProps = useGridRootProps();
43
49
  const headerCellRef = React.useRef(null);
@@ -45,12 +51,12 @@ function GridColumnGroupHeader(props) {
45
51
  const columnGroupsLookup = useGridSelector(apiRef, gridColumnGroupsLookupSelector);
46
52
  const group = groupId ? columnGroupsLookup[groupId] : {};
47
53
  const {
48
- headerName = groupId != null ? groupId : '',
54
+ headerName = groupId ?? '',
49
55
  description = '',
50
56
  headerAlign = undefined
51
57
  } = group;
52
58
  let headerComponent;
53
- const render = groupId && ((_columnGroupsLookup$g = columnGroupsLookup[groupId]) == null ? void 0 : _columnGroupsLookup$g.renderHeaderGroup);
59
+ const render = groupId && columnGroupsLookup[groupId]?.renderHeaderGroup;
54
60
  const renderParams = React.useMemo(() => ({
55
61
  groupId,
56
62
  headerName,
@@ -64,15 +70,17 @@ function GridColumnGroupHeader(props) {
64
70
  if (groupId && render) {
65
71
  headerComponent = render(renderParams);
66
72
  }
67
- const showColumnBorder = rootProps.showColumnVerticalBorder;
73
+ const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
74
+ const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
68
75
  const ownerState = _extends({}, props, {
69
76
  classes: rootProps.classes,
70
- showColumnBorder,
77
+ showLeftBorder,
78
+ showRightBorder,
71
79
  headerAlign,
72
80
  depth,
73
81
  isDragging: false
74
82
  });
75
- const label = headerName != null ? headerName : groupId;
83
+ const label = headerName ?? groupId;
76
84
  const id = useId();
77
85
  const elementId = groupId === null ? `empty-group-cell-${id}` : groupId;
78
86
  const classes = useUtilityClasses(ownerState);
@@ -80,7 +88,7 @@ function GridColumnGroupHeader(props) {
80
88
  if (hasFocus) {
81
89
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
82
90
  const elementToFocus = focusableElement || headerCellRef.current;
83
- elementToFocus == null || elementToFocus.focus();
91
+ elementToFocus?.focus();
84
92
  }
85
93
  }, [apiRef, hasFocus]);
86
94
  const publish = React.useCallback(eventName => event => {
@@ -118,12 +126,13 @@ function GridColumnGroupHeader(props) {
118
126
  width: width,
119
127
  columnMenuIconButton: null,
120
128
  columnTitleIconButtons: null,
121
- resizable: false,
129
+ resizable: true,
122
130
  label: label,
123
131
  "aria-colspan": fields.length
124
132
  // The fields are wrapped between |-...-| to avoid confusion between fields "id" and "id2" when using selector data-fields~=
125
133
  ,
126
- "data-fields": `|-${fields.join('-|-')}-|`
134
+ "data-fields": `|-${fields.join('-|-')}-|`,
135
+ style: style
127
136
  }, mouseEventsHandlers));
128
137
  }
129
138
  export { GridColumnGroupHeader };
@@ -22,7 +22,6 @@ const useUtilityClasses = ownerState => {
22
22
  return composeClasses(slots, getDataGridUtilityClass, classes);
23
23
  };
24
24
  function GridColumnHeaderFilterIconButton(props) {
25
- var _rootProps$slotProps, _rootProps$slotProps2;
26
25
  const {
27
26
  counter,
28
27
  field,
@@ -67,7 +66,7 @@ function GridColumnHeaderFilterIconButton(props) {
67
66
  "aria-haspopup": "menu",
68
67
  "aria-expanded": open,
69
68
  "aria-controls": open ? panelId : undefined
70
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
69
+ }, rootProps.slotProps?.baseIconButton, {
71
70
  children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
72
71
  className: classes.icon,
73
72
  fontSize: "small"
@@ -76,7 +75,7 @@ function GridColumnHeaderFilterIconButton(props) {
76
75
  return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
77
76
  title: apiRef.current.getLocaleText('columnHeaderFiltersTooltipActive')(counter),
78
77
  enterDelay: 1000
79
- }, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseTooltip, {
78
+ }, rootProps.slotProps?.baseTooltip, {
80
79
  children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {
81
80
  children: [counter > 1 && /*#__PURE__*/_jsx(Badge, {
82
81
  badgeContent: counter,
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { GridStateColDef } from '../../models/colDef/gridColDef';
3
3
  import { GridSortDirection } from '../../models/gridSortModel';
4
4
  import { GridColumnHeaderSeparatorProps } from './GridColumnHeaderSeparator';
5
+ import { GridPinnedColumnPosition } from '../../hooks/features/columns/gridColumnsInterfaces';
5
6
  interface GridColumnHeaderItemProps {
6
7
  colIndex: number;
7
8
  colDef: GridStateColDef;
@@ -16,6 +17,10 @@ interface GridColumnHeaderItemProps {
16
17
  tabIndex: 0 | -1;
17
18
  disableReorder?: boolean;
18
19
  separatorSide?: GridColumnHeaderSeparatorProps['side'];
20
+ pinnedPosition?: GridPinnedColumnPosition;
21
+ style?: React.CSSProperties;
22
+ indexInSection: number;
23
+ sectionLength: number;
19
24
  }
20
25
  declare function GridColumnHeaderItem(props: GridColumnHeaderItemProps): React.JSX.Element;
21
26
  declare namespace GridColumnHeaderItem {