@mui/x-data-grid 9.11.0 → 9.13.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 (232) hide show
  1. package/CHANGELOG.md +317 -0
  2. package/DataGrid/DataGrid.js +4 -2
  3. package/DataGrid/DataGrid.mjs +4 -2
  4. package/DataGrid/useDataGridProps.d.mts +1 -1
  5. package/DataGrid/useDataGridProps.d.ts +1 -1
  6. package/components/GridPagination.js +1 -1
  7. package/components/GridPagination.mjs +1 -1
  8. package/components/GridRow.d.mts +1 -0
  9. package/components/GridRow.d.ts +1 -0
  10. package/components/GridRow.js +41 -6
  11. package/components/GridRow.mjs +41 -6
  12. package/components/cell/GridCell.js +21 -5
  13. package/components/cell/GridCell.mjs +21 -5
  14. package/components/cell/GridEditBooleanCell.d.mts +1 -1
  15. package/components/cell/GridEditBooleanCell.d.ts +1 -1
  16. package/components/cell/GridEditBooleanCell.js +4 -4
  17. package/components/cell/GridEditBooleanCell.mjs +4 -4
  18. package/components/cell/GridEditDateCell.d.mts +1 -1
  19. package/components/cell/GridEditDateCell.d.ts +1 -1
  20. package/components/cell/GridEditDateCell.js +5 -5
  21. package/components/cell/GridEditDateCell.mjs +5 -5
  22. package/components/cell/GridEditInputCell.d.mts +1 -1
  23. package/components/cell/GridEditInputCell.d.ts +1 -1
  24. package/components/cell/GridEditInputCell.js +1 -1
  25. package/components/cell/GridEditInputCell.mjs +1 -1
  26. package/components/cell/GridEditLongTextCell.d.mts +1 -1
  27. package/components/cell/GridEditLongTextCell.d.ts +1 -1
  28. package/components/cell/GridEditLongTextCell.js +2 -2
  29. package/components/cell/GridEditLongTextCell.mjs +2 -2
  30. package/components/cell/GridEditSingleSelectCell.d.mts +1 -1
  31. package/components/cell/GridEditSingleSelectCell.d.ts +1 -1
  32. package/components/cell/GridEditSingleSelectCell.js +4 -4
  33. package/components/cell/GridEditSingleSelectCell.mjs +4 -4
  34. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
  35. package/components/columnHeaders/GridBaseColumnHeaders.mjs +1 -1
  36. package/components/columnHeaders/GridColumnHeaderItem.js +4 -0
  37. package/components/columnHeaders/GridColumnHeaderItem.mjs +4 -0
  38. package/components/columnHeaders/GridGenericColumnHeaderItem.d.mts +7 -0
  39. package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +7 -0
  40. package/components/columnHeaders/GridGenericColumnHeaderItem.js +5 -4
  41. package/components/columnHeaders/GridGenericColumnHeaderItem.mjs +5 -4
  42. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +18 -6
  43. package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +18 -6
  44. package/components/toolbarV8/Toolbar.d.mts +5 -1
  45. package/components/toolbarV8/Toolbar.d.ts +5 -1
  46. package/components/toolbarV8/Toolbar.js +34 -12
  47. package/components/toolbarV8/Toolbar.mjs +33 -11
  48. package/constants/gridClasses.d.mts +12 -0
  49. package/constants/gridClasses.d.ts +12 -0
  50. package/constants/gridClasses.js +1 -1
  51. package/constants/gridClasses.mjs +1 -1
  52. package/constants/localeTextConstants.js +4 -0
  53. package/constants/localeTextConstants.mjs +4 -0
  54. package/hooks/core/useGridApiInitialization.js +5 -1
  55. package/hooks/core/useGridApiInitialization.mjs +5 -1
  56. package/hooks/core/useGridStateInitialization.js +3 -1
  57. package/hooks/core/useGridStateInitialization.mjs +3 -1
  58. package/hooks/core/useGridVirtualizer.js +17 -1
  59. package/hooks/core/useGridVirtualizer.mjs +17 -1
  60. package/hooks/features/columnResize/useGridColumnResize.js +5 -0
  61. package/hooks/features/columnResize/useGridColumnResize.mjs +5 -0
  62. package/hooks/features/columns/gridColumnsUtils.d.mts +1 -1
  63. package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
  64. package/hooks/features/columns/gridColumnsUtils.js +2 -2
  65. package/hooks/features/columns/gridColumnsUtils.mjs +2 -2
  66. package/hooks/features/dataSource/gridDataSourceSelector.js +6 -2
  67. package/hooks/features/dataSource/gridDataSourceSelector.mjs +6 -2
  68. package/hooks/features/dataSource/models.d.mts +2 -2
  69. package/hooks/features/dataSource/models.d.ts +2 -2
  70. package/hooks/features/dataSource/useGridDataSourceBase.js +25 -8
  71. package/hooks/features/dataSource/useGridDataSourceBase.mjs +26 -9
  72. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.d.mts +9 -0
  73. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.d.ts +9 -0
  74. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.js +57 -0
  75. package/hooks/features/dataSource/useGridDataSourceFilterModelChange.mjs +49 -0
  76. package/hooks/features/editing/useGridCellEditing.js +3 -1
  77. package/hooks/features/editing/useGridCellEditing.mjs +3 -1
  78. package/hooks/features/editing/useGridRowEditing.js +3 -1
  79. package/hooks/features/editing/useGridRowEditing.mjs +3 -1
  80. package/hooks/features/filter/gridFilterUtils.d.mts +13 -0
  81. package/hooks/features/filter/gridFilterUtils.d.ts +13 -0
  82. package/hooks/features/filter/gridFilterUtils.js +32 -1
  83. package/hooks/features/filter/gridFilterUtils.mjs +29 -1
  84. package/hooks/features/filter/useGridFilter.js +1 -21
  85. package/hooks/features/filter/useGridFilter.mjs +2 -22
  86. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +1 -1
  87. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.mjs +1 -1
  88. package/hooks/features/pivoting/gridPivotingInterfaces.d.mts +2 -2
  89. package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +2 -2
  90. package/hooks/features/rowSelection/useGridRowSelection.js +1 -1
  91. package/hooks/features/rowSelection/useGridRowSelection.mjs +2 -2
  92. package/hooks/features/rows/gridRowsUtils.d.mts +37 -3
  93. package/hooks/features/rows/gridRowsUtils.d.ts +37 -3
  94. package/hooks/features/rows/gridRowsUtils.js +120 -23
  95. package/hooks/features/rows/gridRowsUtils.mjs +115 -22
  96. package/hooks/features/rows/useGridRowSpanning.js +5 -0
  97. package/hooks/features/rows/useGridRowSpanning.mjs +5 -0
  98. package/hooks/features/rows/useGridRows.js +10 -1
  99. package/hooks/features/rows/useGridRows.mjs +10 -1
  100. package/hooks/features/virtualization/gridVirtualizationSelectors.d.mts +1 -1
  101. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +1 -1
  102. package/hooks/utils/useGridEvent.d.mts +2 -2
  103. package/hooks/utils/useGridEvent.d.ts +2 -2
  104. package/hooks/utils/useGridEvent.js +2 -0
  105. package/hooks/utils/useGridEvent.mjs +2 -0
  106. package/index.js +1 -1
  107. package/index.mjs +1 -1
  108. package/internals/index.d.mts +4 -2
  109. package/internals/index.d.ts +4 -2
  110. package/internals/index.js +48 -0
  111. package/internals/index.mjs +4 -2
  112. package/locales/arSD.js +5 -0
  113. package/locales/arSD.mjs +5 -0
  114. package/locales/beBY.js +5 -0
  115. package/locales/beBY.mjs +5 -0
  116. package/locales/bgBG.js +5 -0
  117. package/locales/bgBG.mjs +5 -0
  118. package/locales/bnBD.js +5 -0
  119. package/locales/bnBD.mjs +5 -0
  120. package/locales/caES.js +5 -0
  121. package/locales/caES.mjs +5 -0
  122. package/locales/csCZ.js +5 -0
  123. package/locales/csCZ.mjs +5 -0
  124. package/locales/daDK.js +5 -0
  125. package/locales/daDK.mjs +5 -0
  126. package/locales/deDE.js +5 -0
  127. package/locales/deDE.mjs +5 -0
  128. package/locales/elGR.js +5 -0
  129. package/locales/elGR.mjs +5 -0
  130. package/locales/esES.js +5 -0
  131. package/locales/esES.mjs +5 -0
  132. package/locales/faIR.js +5 -0
  133. package/locales/faIR.mjs +5 -0
  134. package/locales/fiFI.js +5 -0
  135. package/locales/fiFI.mjs +5 -0
  136. package/locales/frFR.js +5 -0
  137. package/locales/frFR.mjs +5 -0
  138. package/locales/heIL.js +5 -0
  139. package/locales/heIL.mjs +5 -0
  140. package/locales/hrHR.js +5 -0
  141. package/locales/hrHR.mjs +5 -0
  142. package/locales/huHU.js +5 -0
  143. package/locales/huHU.mjs +5 -0
  144. package/locales/hyAM.js +5 -0
  145. package/locales/hyAM.mjs +5 -0
  146. package/locales/idID.js +5 -0
  147. package/locales/idID.mjs +5 -0
  148. package/locales/isIS.js +5 -0
  149. package/locales/isIS.mjs +5 -0
  150. package/locales/itIT.js +5 -0
  151. package/locales/itIT.mjs +5 -0
  152. package/locales/jaJP.js +5 -0
  153. package/locales/jaJP.mjs +5 -0
  154. package/locales/koKR.js +5 -0
  155. package/locales/koKR.mjs +5 -0
  156. package/locales/nbNO.js +5 -0
  157. package/locales/nbNO.mjs +5 -0
  158. package/locales/nlNL.js +5 -0
  159. package/locales/nlNL.mjs +5 -0
  160. package/locales/nnNO.js +5 -0
  161. package/locales/nnNO.mjs +5 -0
  162. package/locales/plPL.js +5 -0
  163. package/locales/plPL.mjs +5 -0
  164. package/locales/ptBR.js +5 -0
  165. package/locales/ptBR.mjs +5 -0
  166. package/locales/ptPT.js +5 -0
  167. package/locales/ptPT.mjs +5 -0
  168. package/locales/roRO.js +5 -0
  169. package/locales/roRO.mjs +5 -0
  170. package/locales/ruRU.js +5 -0
  171. package/locales/ruRU.mjs +5 -0
  172. package/locales/skSK.js +5 -0
  173. package/locales/skSK.mjs +5 -0
  174. package/locales/svSE.js +5 -0
  175. package/locales/svSE.mjs +5 -0
  176. package/locales/thTH.js +5 -0
  177. package/locales/thTH.mjs +5 -0
  178. package/locales/trTR.js +5 -0
  179. package/locales/trTR.mjs +5 -0
  180. package/locales/ukUA.js +5 -0
  181. package/locales/ukUA.mjs +5 -0
  182. package/locales/urPK.js +5 -0
  183. package/locales/urPK.mjs +5 -0
  184. package/locales/viVN.js +5 -0
  185. package/locales/viVN.mjs +5 -0
  186. package/locales/zhCN.js +5 -0
  187. package/locales/zhCN.mjs +5 -0
  188. package/locales/zhHK.js +5 -0
  189. package/locales/zhHK.mjs +5 -0
  190. package/locales/zhTW.js +5 -0
  191. package/locales/zhTW.mjs +5 -0
  192. package/material/variables.d.mts +6 -1
  193. package/material/variables.d.ts +6 -1
  194. package/material/variables.js +17 -3
  195. package/material/variables.mjs +14 -4
  196. package/models/api/gridApiCommon.d.mts +2 -2
  197. package/models/api/gridApiCommon.d.ts +2 -2
  198. package/models/api/gridCallbackDetails.d.mts +11 -1
  199. package/models/api/gridCallbackDetails.d.ts +11 -1
  200. package/models/api/gridLocaleTextApi.d.mts +3 -0
  201. package/models/api/gridLocaleTextApi.d.ts +3 -0
  202. package/models/api/gridRowApi.d.mts +19 -7
  203. package/models/api/gridRowApi.d.ts +19 -7
  204. package/models/api/gridStateApi.d.mts +3 -2
  205. package/models/api/gridStateApi.d.ts +3 -2
  206. package/models/api/index.d.mts +1 -1
  207. package/models/api/index.d.ts +1 -1
  208. package/models/colDef/gridColDef.d.mts +5 -0
  209. package/models/colDef/gridColDef.d.ts +5 -0
  210. package/models/configuration/gridConfiguration.d.mts +13 -1
  211. package/models/configuration/gridConfiguration.d.ts +13 -1
  212. package/models/controlStateItem.d.mts +3 -2
  213. package/models/controlStateItem.d.ts +3 -2
  214. package/models/events/gridEventListener.d.mts +3 -2
  215. package/models/events/gridEventListener.d.ts +3 -2
  216. package/models/gridDataSource.d.mts +3 -0
  217. package/models/gridDataSource.d.ts +3 -0
  218. package/models/gridRows.d.mts +28 -1
  219. package/models/gridRows.d.ts +28 -1
  220. package/models/props/DataGridProps.d.mts +41 -38
  221. package/models/props/DataGridProps.d.ts +41 -38
  222. package/package.json +6 -6
  223. package/utils/domUtils.js +1 -1
  224. package/utils/domUtils.mjs +1 -1
  225. package/utils/getPublicApiRef.d.mts +2 -2
  226. package/utils/getPublicApiRef.d.ts +2 -2
  227. package/utils/getPublicApiRef.js +15 -3
  228. package/utils/getPublicApiRef.mjs +15 -3
  229. package/utils/keyboardUtils.d.mts +1 -0
  230. package/utils/keyboardUtils.d.ts +1 -0
  231. package/utils/keyboardUtils.js +6 -0
  232. package/utils/keyboardUtils.mjs +5 -0
package/locales/ukUA.mjs CHANGED
@@ -59,6 +59,11 @@ const ukUAGrid = {
59
59
  // Toolbar AI Assistant button
60
60
  // toolbarAssistant: 'AI Assistant',
61
61
 
62
+ // Formula bar (Premium formulas)
63
+ // formulaBarLabel: 'Formula bar',
64
+ // formulaBarInputLabel: 'Formula',
65
+ // formulaBarAddressLabel: 'Active cell',
66
+
62
67
  // Columns management text
63
68
  columnsManagementSearchTitle: 'Пошук',
64
69
  columnsManagementNoColumns: 'Немає стовпців',
package/locales/urPK.js CHANGED
@@ -50,6 +50,11 @@ const urPKGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  columnsManagementSearchTitle: 'تلاش',
55
60
  columnsManagementNoColumns: 'کوئی کالم نہیں',
package/locales/urPK.mjs CHANGED
@@ -44,6 +44,11 @@ const urPKGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  columnsManagementSearchTitle: 'تلاش',
49
54
  columnsManagementNoColumns: 'کوئی کالم نہیں',
package/locales/viVN.js CHANGED
@@ -50,6 +50,11 @@ const viVNGrid = {
50
50
  // Toolbar AI Assistant button
51
51
  // toolbarAssistant: 'AI Assistant',
52
52
 
53
+ // Formula bar (Premium formulas)
54
+ // formulaBarLabel: 'Formula bar',
55
+ // formulaBarInputLabel: 'Formula',
56
+ // formulaBarAddressLabel: 'Active cell',
57
+
53
58
  // Columns management text
54
59
  columnsManagementSearchTitle: 'Tìm kiếm',
55
60
  columnsManagementNoColumns: 'Không có cột',
package/locales/viVN.mjs CHANGED
@@ -44,6 +44,11 @@ const viVNGrid = {
44
44
  // Toolbar AI Assistant button
45
45
  // toolbarAssistant: 'AI Assistant',
46
46
 
47
+ // Formula bar (Premium formulas)
48
+ // formulaBarLabel: 'Formula bar',
49
+ // formulaBarInputLabel: 'Formula',
50
+ // formulaBarAddressLabel: 'Active cell',
51
+
47
52
  // Columns management text
48
53
  columnsManagementSearchTitle: 'Tìm kiếm',
49
54
  columnsManagementNoColumns: 'Không có cột',
package/locales/zhCN.js CHANGED
@@ -51,6 +51,11 @@ const zhCNGrid = {
51
51
  // Toolbar AI Assistant button
52
52
  // toolbarAssistant: 'AI Assistant',
53
53
 
54
+ // Formula bar (Premium formulas)
55
+ // formulaBarLabel: 'Formula bar',
56
+ // formulaBarInputLabel: 'Formula',
57
+ // formulaBarAddressLabel: 'Active cell',
58
+
54
59
  // Columns management text
55
60
  columnsManagementSearchTitle: '搜索',
56
61
  columnsManagementNoColumns: '没有列',
package/locales/zhCN.mjs CHANGED
@@ -45,6 +45,11 @@ const zhCNGrid = {
45
45
  // Toolbar AI Assistant button
46
46
  // toolbarAssistant: 'AI Assistant',
47
47
 
48
+ // Formula bar (Premium formulas)
49
+ // formulaBarLabel: 'Formula bar',
50
+ // formulaBarInputLabel: 'Formula',
51
+ // formulaBarAddressLabel: 'Active cell',
52
+
48
53
  // Columns management text
49
54
  columnsManagementSearchTitle: '搜索',
50
55
  columnsManagementNoColumns: '没有列',
package/locales/zhHK.js CHANGED
@@ -51,6 +51,11 @@ const zhHKGrid = {
51
51
  // Toolbar AI Assistant button
52
52
  // toolbarAssistant: 'AI Assistant',
53
53
 
54
+ // Formula bar (Premium formulas)
55
+ // formulaBarLabel: 'Formula bar',
56
+ // formulaBarInputLabel: 'Formula',
57
+ // formulaBarAddressLabel: 'Active cell',
58
+
54
59
  // Columns management text
55
60
  columnsManagementSearchTitle: '搜尋',
56
61
  columnsManagementNoColumns: '沒有列',
package/locales/zhHK.mjs CHANGED
@@ -45,6 +45,11 @@ const zhHKGrid = {
45
45
  // Toolbar AI Assistant button
46
46
  // toolbarAssistant: 'AI Assistant',
47
47
 
48
+ // Formula bar (Premium formulas)
49
+ // formulaBarLabel: 'Formula bar',
50
+ // formulaBarInputLabel: 'Formula',
51
+ // formulaBarAddressLabel: 'Active cell',
52
+
48
53
  // Columns management text
49
54
  columnsManagementSearchTitle: '搜尋',
50
55
  columnsManagementNoColumns: '沒有列',
package/locales/zhTW.js CHANGED
@@ -51,6 +51,11 @@ const zhTWGrid = {
51
51
  // Toolbar AI Assistant button
52
52
  // toolbarAssistant: 'AI Assistant',
53
53
 
54
+ // Formula bar (Premium formulas)
55
+ // formulaBarLabel: 'Formula bar',
56
+ // formulaBarInputLabel: 'Formula',
57
+ // formulaBarAddressLabel: 'Active cell',
58
+
54
59
  // Columns management text
55
60
  columnsManagementSearchTitle: '搜尋',
56
61
  columnsManagementNoColumns: '沒有欄位',
package/locales/zhTW.mjs CHANGED
@@ -45,6 +45,11 @@ const zhTWGrid = {
45
45
  // Toolbar AI Assistant button
46
46
  // toolbarAssistant: 'AI Assistant',
47
47
 
48
+ // Formula bar (Premium formulas)
49
+ // formulaBarLabel: 'Formula bar',
50
+ // formulaBarInputLabel: 'Formula',
51
+ // formulaBarAddressLabel: 'Active cell',
52
+
48
53
  // Columns management text
49
54
  columnsManagementSearchTitle: '搜尋',
50
55
  columnsManagementNoColumns: '沒有欄位',
@@ -1,5 +1,10 @@
1
+ import type { Theme } from '@mui/material/styles';
1
2
  import type { GridCSSVariablesInterface } from "../constants/cssVariables.mjs";
2
3
  export declare function useMaterialCSSVariables(): {
3
4
  id: string;
4
5
  variables: GridCSSVariablesInterface;
5
- };
6
+ };
7
+ export declare function getBackgroundBase(theme: Theme): string;
8
+ export declare function getFontBody(theme: Theme): any;
9
+ export declare function getSpacingUnit(theme: Theme): any;
10
+ export declare function getBorderColor(theme: Theme): string;
@@ -1,5 +1,10 @@
1
+ import type { Theme } from '@mui/material/styles';
1
2
  import type { GridCSSVariablesInterface } from "../constants/cssVariables.js";
2
3
  export declare function useMaterialCSSVariables(): {
3
4
  id: string;
4
5
  variables: GridCSSVariablesInterface;
5
- };
6
+ };
7
+ export declare function getBackgroundBase(theme: Theme): string;
8
+ export declare function getFontBody(theme: Theme): any;
9
+ export declare function getSpacingUnit(theme: Theme): any;
10
+ export declare function getBorderColor(theme: Theme): string;
@@ -4,6 +4,10 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.getBackgroundBase = getBackgroundBase;
8
+ exports.getBorderColor = getBorderColor;
9
+ exports.getFontBody = getFontBody;
10
+ exports.getSpacingUnit = getSpacingUnit;
7
11
  exports.useMaterialCSSVariables = useMaterialCSSVariables;
8
12
  var React = _interopRequireWildcard(require("react"));
9
13
  var _styles = require("@mui/material/styles");
@@ -25,19 +29,19 @@ function transformTheme(t) {
25
29
  const borderColor = getBorderColor(t);
26
30
  const dataGridPalette = (t.vars || t).palette.DataGrid;
27
31
  const paperColor = (t.vars || t).palette.background.paper;
28
- const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
32
+ const backgroundBase = getBackgroundBase(t);
29
33
  const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
30
34
  const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
31
35
  const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
32
36
  const backgroundOverlay = t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
33
37
  const selectedColor = (t.vars || t).palette.primary.main;
34
38
  const radius = getRadius(t);
35
- const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
39
+ const fontBody = getFontBody(t);
36
40
  const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
37
41
  const fontLarge = t.vars?.font?.body1 ?? formatFont(t.typography.body1);
38
42
  const k = _cssVariables.vars.keys;
39
43
  return {
40
- [k.spacingUnit]: t.vars ? t.vars.spacing ?? t.spacing(1) : t.spacing(1),
44
+ [k.spacingUnit]: getSpacingUnit(t),
41
45
  [k.colors.border.base]: borderColor,
42
46
  [k.colors.background.base]: backgroundBase,
43
47
  [k.colors.background.overlay]: backgroundOverlay,
@@ -85,6 +89,16 @@ function getRadius(theme) {
85
89
  }
86
90
  return typeof theme.shape.borderRadius === 'number' ? `${theme.shape.borderRadius}px` : theme.shape.borderRadius;
87
91
  }
92
+ function getBackgroundBase(theme) {
93
+ const paperColor = (theme.vars || theme).palette.background.paper;
94
+ return (theme.vars || theme).palette.DataGrid?.bg ?? (theme.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
95
+ }
96
+ function getFontBody(theme) {
97
+ return theme.vars?.font?.body2 ?? formatFont(theme.typography.body2);
98
+ }
99
+ function getSpacingUnit(theme) {
100
+ return theme.vars ? theme.vars.spacing ?? theme.spacing(1) : theme.spacing(1);
101
+ }
88
102
  function getBorderColor(theme) {
89
103
  if (theme.vars) {
90
104
  return theme.vars.palette.TableCell.border;
@@ -18,19 +18,19 @@ function transformTheme(t) {
18
18
  const borderColor = getBorderColor(t);
19
19
  const dataGridPalette = (t.vars || t).palette.DataGrid;
20
20
  const paperColor = (t.vars || t).palette.background.paper;
21
- const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
21
+ const backgroundBase = getBackgroundBase(t);
22
22
  const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
23
23
  const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
24
24
  const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
25
25
  const backgroundOverlay = t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
26
26
  const selectedColor = (t.vars || t).palette.primary.main;
27
27
  const radius = getRadius(t);
28
- const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
28
+ const fontBody = getFontBody(t);
29
29
  const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
30
30
  const fontLarge = t.vars?.font?.body1 ?? formatFont(t.typography.body1);
31
31
  const k = vars.keys;
32
32
  return {
33
- [k.spacingUnit]: t.vars ? t.vars.spacing ?? t.spacing(1) : t.spacing(1),
33
+ [k.spacingUnit]: getSpacingUnit(t),
34
34
  [k.colors.border.base]: borderColor,
35
35
  [k.colors.background.base]: backgroundBase,
36
36
  [k.colors.background.overlay]: backgroundOverlay,
@@ -78,7 +78,17 @@ function getRadius(theme) {
78
78
  }
79
79
  return typeof theme.shape.borderRadius === 'number' ? `${theme.shape.borderRadius}px` : theme.shape.borderRadius;
80
80
  }
81
- function getBorderColor(theme) {
81
+ export function getBackgroundBase(theme) {
82
+ const paperColor = (theme.vars || theme).palette.background.paper;
83
+ return (theme.vars || theme).palette.DataGrid?.bg ?? (theme.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
84
+ }
85
+ export function getFontBody(theme) {
86
+ return theme.vars?.font?.body2 ?? formatFont(theme.typography.body2);
87
+ }
88
+ export function getSpacingUnit(theme) {
89
+ return theme.vars ? theme.vars.spacing ?? theme.spacing(1) : theme.spacing(1);
90
+ }
91
+ export function getBorderColor(theme) {
82
92
  if (theme.vars) {
83
93
  return theme.vars.palette.TableCell.border;
84
94
  }
@@ -11,7 +11,7 @@ import type { GridLocaleTextApi } from "./gridLocaleTextApi.mjs";
11
11
  import type { GridParamsApi, GridParamsPrivateApi } from "./gridParamsApi.mjs";
12
12
  import type { GridPreferencesPanelApi } from "./gridPreferencesPanelApi.mjs";
13
13
  import type { GridPrintExportApi } from "./gridPrintExportApi.mjs";
14
- import type { GridRowApi, GridRowProPrivateApi } from "./gridRowApi.mjs";
14
+ import type { GridRowApi, GridRowProPrivateApi, GridRowSpanningPrivateApi } from "./gridRowApi.mjs";
15
15
  import type { GridRowsMetaApi, GridRowsMetaPrivateApi } from "./gridRowsMetaApi.mjs";
16
16
  import type { GridRowSelectionApi } from "./gridRowSelectionApi.mjs";
17
17
  import type { GridSortApi } from "./gridSortApi.mjs";
@@ -32,7 +32,7 @@ import type { DataGridProcessedProps } from "../props/DataGridProps.mjs";
32
32
  import type { GridColumnResizeApi } from "../../hooks/features/columnResize/index.mjs";
33
33
  import type { GridPivotingPrivateApiCommunity } from "../../hooks/features/pivoting/gridPivotingInterfaces.mjs";
34
34
  export interface GridApiCommon<GridState extends GridStateCommunity = GridStateCommunity, GridInitialState extends GridInitialStateCommunity = GridInitialStateCommunity> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi, GridColumnResizeApi {}
35
- export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
35
+ export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state'], Api>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridRowSpanningPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
36
36
  virtualizer: Virtualizer;
37
37
  }
38
38
  export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {}
@@ -11,7 +11,7 @@ import type { GridLocaleTextApi } from "./gridLocaleTextApi.js";
11
11
  import type { GridParamsApi, GridParamsPrivateApi } from "./gridParamsApi.js";
12
12
  import type { GridPreferencesPanelApi } from "./gridPreferencesPanelApi.js";
13
13
  import type { GridPrintExportApi } from "./gridPrintExportApi.js";
14
- import type { GridRowApi, GridRowProPrivateApi } from "./gridRowApi.js";
14
+ import type { GridRowApi, GridRowProPrivateApi, GridRowSpanningPrivateApi } from "./gridRowApi.js";
15
15
  import type { GridRowsMetaApi, GridRowsMetaPrivateApi } from "./gridRowsMetaApi.js";
16
16
  import type { GridRowSelectionApi } from "./gridRowSelectionApi.js";
17
17
  import type { GridSortApi } from "./gridSortApi.js";
@@ -32,7 +32,7 @@ import type { DataGridProcessedProps } from "../props/DataGridProps.js";
32
32
  import type { GridColumnResizeApi } from "../../hooks/features/columnResize/index.js";
33
33
  import type { GridPivotingPrivateApiCommunity } from "../../hooks/features/pivoting/gridPivotingInterfaces.js";
34
34
  export interface GridApiCommon<GridState extends GridStateCommunity = GridStateCommunity, GridInitialState extends GridInitialStateCommunity = GridInitialStateCommunity> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi, GridColumnResizeApi {}
35
- export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
35
+ export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<Api['state'], Api>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi, GridRowProPrivateApi, GridRowSpanningPrivateApi, GridParamsPrivateApi, GridPivotingPrivateApiCommunity {
36
36
  virtualizer: Virtualizer;
37
37
  }
38
38
  export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {}
@@ -1,9 +1,10 @@
1
+ import type { RefObject } from '@mui/x-internals/types';
1
2
  import type { GridControlledStateReasonLookup } from "../events/gridEventLookup.mjs";
2
3
  import type { GridApiCommon } from "./gridApiCommon.mjs";
3
4
  /**
4
5
  * Additional details passed to the callbacks
5
6
  */
6
- export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLookup = any> {
7
+ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLookup = any, Api extends GridApiCommon = GridApiCommon> {
7
8
  /**
8
9
  * The reason for this callback to have been called.
9
10
  */
@@ -12,4 +13,13 @@ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLo
12
13
  * GridApi that let you manipulate the grid.
13
14
  */
14
15
  api: GridApiCommon;
16
+ /**
17
+ * A ref to the GridApi that let you manipulate the grid.
18
+ * Can be used to call selectors without a separate `useGridApiRef`.
19
+ * @example
20
+ * onRowSelectionModelChange={(model, details) => {
21
+ * const rows = gridRowSelectionIdsSelector(details.apiRef);
22
+ * }}
23
+ */
24
+ apiRef: Readonly<RefObject<Api>>;
15
25
  }
@@ -1,9 +1,10 @@
1
+ import type { RefObject } from '@mui/x-internals/types';
1
2
  import type { GridControlledStateReasonLookup } from "../events/gridEventLookup.js";
2
3
  import type { GridApiCommon } from "./gridApiCommon.js";
3
4
  /**
4
5
  * Additional details passed to the callbacks
5
6
  */
6
- export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLookup = any> {
7
+ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLookup = any, Api extends GridApiCommon = GridApiCommon> {
7
8
  /**
8
9
  * The reason for this callback to have been called.
9
10
  */
@@ -12,4 +13,13 @@ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLo
12
13
  * GridApi that let you manipulate the grid.
13
14
  */
14
15
  api: GridApiCommon;
16
+ /**
17
+ * A ref to the GridApi that let you manipulate the grid.
18
+ * Can be used to call selectors without a separate `useGridApiRef`.
19
+ * @example
20
+ * onRowSelectionModelChange={(model, details) => {
21
+ * const rows = gridRowSelectionIdsSelector(details.apiRef);
22
+ * }}
23
+ */
24
+ apiRef: Readonly<RefObject<Api>>;
15
25
  }
@@ -34,6 +34,9 @@ export interface GridLocaleText {
34
34
  toolbarPivot: string;
35
35
  toolbarCharts: string;
36
36
  toolbarAssistant: React.ReactNode;
37
+ formulaBarLabel: string;
38
+ formulaBarInputLabel: string;
39
+ formulaBarAddressLabel: string;
37
40
  columnsManagementSearchTitle: string;
38
41
  columnsManagementNoColumns: string;
39
42
  columnsManagementShowHideAllText: string;
@@ -34,6 +34,9 @@ export interface GridLocaleText {
34
34
  toolbarPivot: string;
35
35
  toolbarCharts: string;
36
36
  toolbarAssistant: React.ReactNode;
37
+ formulaBarLabel: string;
38
+ formulaBarInputLabel: string;
39
+ formulaBarAddressLabel: string;
37
40
  columnsManagementSearchTitle: string;
38
41
  columnsManagementNoColumns: string;
39
42
  columnsManagementShowHideAllText: string;
@@ -1,4 +1,4 @@
1
- import type { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.mjs";
1
+ import type { GridRowModel, GridRowId, GridRowModelUpdate, GridRowModelReplace, GridValidRowModel, GridTreeNode } from "../gridRows.mjs";
2
2
  export type RowReorderDropPosition = 'above' | 'below' | 'inside';
3
3
  export type RowReorderDragDirection = 'up' | 'down';
4
4
  export interface GridRowGroupChildrenGetterParams {
@@ -58,10 +58,10 @@ export interface GridRowApi {
58
58
  */
59
59
  setRows: (rows: GridRowModel[]) => void;
60
60
  /**
61
- * Allows to update, insert and delete rows.
62
- * @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
61
+ * Allows to update, insert, replace and delete rows.
62
+ * @param {Array<GridRowModelUpdate | GridRowModelReplace>} updates An array of rows with an `action` specifying what to do.
63
63
  */
64
- updateRows: (updates: GridRowModelUpdate[]) => void;
64
+ updateRows: (updates: Array<GridRowModelUpdate | GridRowModelReplace>) => void;
65
65
  /**
66
66
  * Gets the row data with a given id.
67
67
  * @param {GridRowId} id The id of the row.
@@ -139,9 +139,21 @@ export interface GridRowProApi {
139
139
  }
140
140
  export interface GridRowProPrivateApi {
141
141
  /**
142
- * Allows to update, insert and delete rows at a specific nested level.
143
- * @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
142
+ * Allows to update, insert, replace and delete rows at a specific nested level.
143
+ * @param {Array<GridRowModelUpdate | GridRowModelReplace>} updates An array of rows with an `action` specifying what to do.
144
144
  * @param {string[]} nestedLevel The nested level of the rows to update, it represents the path to the row in the tree based on `node.groupingKey`.
145
145
  */
146
- updateNestedRows: (updates: GridRowModelUpdate[], nestedLevel?: string[]) => void;
146
+ updateNestedRows: (updates: Array<GridRowModelUpdate | GridRowModelReplace>, nestedLevel?: string[]) => void;
147
+ }
148
+ export interface GridRowSpanningPrivateApi {
149
+ /**
150
+ * Recomputes the row spanning state from scratch.
151
+ * Row spanning recomputes on its own after row, sort, filter, pagination,
152
+ * and column updates. Features that change the values cells resolve to
153
+ * without emitting any of those events (for example a formula evaluation
154
+ * pass, whose value overlay changes evaluated results in place) call this
155
+ * method to keep the spans in sync. No-op when the `rowSpanning` prop is
156
+ * not enabled.
157
+ */
158
+ resetRowSpanningState: () => void;
147
159
  }
@@ -1,4 +1,4 @@
1
- import type { GridRowModel, GridRowId, GridRowModelUpdate, GridValidRowModel, GridTreeNode } from "../gridRows.js";
1
+ import type { GridRowModel, GridRowId, GridRowModelUpdate, GridRowModelReplace, GridValidRowModel, GridTreeNode } from "../gridRows.js";
2
2
  export type RowReorderDropPosition = 'above' | 'below' | 'inside';
3
3
  export type RowReorderDragDirection = 'up' | 'down';
4
4
  export interface GridRowGroupChildrenGetterParams {
@@ -58,10 +58,10 @@ export interface GridRowApi {
58
58
  */
59
59
  setRows: (rows: GridRowModel[]) => void;
60
60
  /**
61
- * Allows to update, insert and delete rows.
62
- * @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
61
+ * Allows to update, insert, replace and delete rows.
62
+ * @param {Array<GridRowModelUpdate | GridRowModelReplace>} updates An array of rows with an `action` specifying what to do.
63
63
  */
64
- updateRows: (updates: GridRowModelUpdate[]) => void;
64
+ updateRows: (updates: Array<GridRowModelUpdate | GridRowModelReplace>) => void;
65
65
  /**
66
66
  * Gets the row data with a given id.
67
67
  * @param {GridRowId} id The id of the row.
@@ -139,9 +139,21 @@ export interface GridRowProApi {
139
139
  }
140
140
  export interface GridRowProPrivateApi {
141
141
  /**
142
- * Allows to update, insert and delete rows at a specific nested level.
143
- * @param {GridRowModelUpdate[]} updates An array of rows with an `action` specifying what to do.
142
+ * Allows to update, insert, replace and delete rows at a specific nested level.
143
+ * @param {Array<GridRowModelUpdate | GridRowModelReplace>} updates An array of rows with an `action` specifying what to do.
144
144
  * @param {string[]} nestedLevel The nested level of the rows to update, it represents the path to the row in the tree based on `node.groupingKey`.
145
145
  */
146
- updateNestedRows: (updates: GridRowModelUpdate[], nestedLevel?: string[]) => void;
146
+ updateNestedRows: (updates: Array<GridRowModelUpdate | GridRowModelReplace>, nestedLevel?: string[]) => void;
147
+ }
148
+ export interface GridRowSpanningPrivateApi {
149
+ /**
150
+ * Recomputes the row spanning state from scratch.
151
+ * Row spanning recomputes on its own after row, sort, filter, pagination,
152
+ * and column updates. Features that change the values cells resolve to
153
+ * without emitting any of those events (for example a formula evaluation
154
+ * pass, whose value overlay changes evaluated results in place) call this
155
+ * method to keep the spans in sync. No-op when the `rowSpanning` prop is
156
+ * not enabled.
157
+ */
158
+ resetRowSpanningState: () => void;
147
159
  }
@@ -1,6 +1,7 @@
1
1
  import type { GridStateCommunity } from "../gridStateCommunity.mjs";
2
2
  import type { GridControlledStateEventLookup, GridControlledStateReasonLookup } from "../events/index.mjs";
3
3
  import type { GridControlStateItem } from "../controlStateItem.mjs";
4
+ import type { GridApiCommon } from "./gridApiCommon.mjs";
4
5
  export interface GridStateApi<State extends GridStateCommunity> {
5
6
  /**
6
7
  * Property that contains the whole state of the grid.
@@ -15,7 +16,7 @@ export interface GridStateApi<State extends GridStateCommunity> {
15
16
  */
16
17
  setState: <S extends State, K extends keyof GridControlledStateReasonLookup>(state: S | ((previousState: S) => S), reason?: GridControlledStateReasonLookup[K]) => boolean;
17
18
  }
18
- export interface GridStatePrivateApi<State extends GridStateCommunity> {
19
+ export interface GridStatePrivateApi<State extends GridStateCommunity, Api extends GridApiCommon = GridApiCommon> {
19
20
  /**
20
21
  * Updates a single sub-state.
21
22
  * Publishes the `xxxChange` event and calls the `onXXXChange` prop.
@@ -29,5 +30,5 @@ export interface GridStatePrivateApi<State extends GridStateCommunity> {
29
30
  * Updates a control state that binds the model, the onChange prop, and the grid state together.
30
31
  * @param {GridControlStateItem>} controlState The [[GridControlStateItem]] to be registered.
31
32
  */
32
- registerControlState: <E extends keyof GridControlledStateEventLookup, Args>(controlState: GridControlStateItem<State, Args, E>) => void;
33
+ registerControlState: <E extends keyof GridControlledStateEventLookup, Args>(controlState: GridControlStateItem<State, Args, E, Api>) => void;
33
34
  }
@@ -1,6 +1,7 @@
1
1
  import type { GridStateCommunity } from "../gridStateCommunity.js";
2
2
  import type { GridControlledStateEventLookup, GridControlledStateReasonLookup } from "../events/index.js";
3
3
  import type { GridControlStateItem } from "../controlStateItem.js";
4
+ import type { GridApiCommon } from "./gridApiCommon.js";
4
5
  export interface GridStateApi<State extends GridStateCommunity> {
5
6
  /**
6
7
  * Property that contains the whole state of the grid.
@@ -15,7 +16,7 @@ export interface GridStateApi<State extends GridStateCommunity> {
15
16
  */
16
17
  setState: <S extends State, K extends keyof GridControlledStateReasonLookup>(state: S | ((previousState: S) => S), reason?: GridControlledStateReasonLookup[K]) => boolean;
17
18
  }
18
- export interface GridStatePrivateApi<State extends GridStateCommunity> {
19
+ export interface GridStatePrivateApi<State extends GridStateCommunity, Api extends GridApiCommon = GridApiCommon> {
19
20
  /**
20
21
  * Updates a single sub-state.
21
22
  * Publishes the `xxxChange` event and calls the `onXXXChange` prop.
@@ -29,5 +30,5 @@ export interface GridStatePrivateApi<State extends GridStateCommunity> {
29
30
  * Updates a control state that binds the model, the onChange prop, and the grid state together.
30
31
  * @param {GridControlStateItem>} controlState The [[GridControlStateItem]] to be registered.
31
32
  */
32
- registerControlState: <E extends keyof GridControlledStateEventLookup, Args>(controlState: GridControlStateItem<State, Args, E>) => void;
33
+ registerControlState: <E extends keyof GridControlledStateEventLookup, Args>(controlState: GridControlStateItem<State, Args, E, Api>) => void;
33
34
  }
@@ -3,7 +3,7 @@ export type { GridParamsApi } from "./gridParamsApi.mjs";
3
3
  export type { GridCoreApi } from "./gridCoreApi.mjs";
4
4
  export * from "./gridColumnApi.mjs";
5
5
  export * from "./gridDensityApi.mjs";
6
- export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi } from "./gridRowApi.mjs";
6
+ export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi, GridRowSpanningPrivateApi } from "./gridRowApi.mjs";
7
7
  export type { GridRowsMetaApi } from "./gridRowsMetaApi.mjs";
8
8
  export * from "./gridRowSelectionApi.mjs";
9
9
  export * from "./gridSortApi.mjs";
@@ -3,7 +3,7 @@ export type { GridParamsApi } from "./gridParamsApi.js";
3
3
  export type { GridCoreApi } from "./gridCoreApi.js";
4
4
  export * from "./gridColumnApi.js";
5
5
  export * from "./gridDensityApi.js";
6
- export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi } from "./gridRowApi.js";
6
+ export type { GridRowGroupChildrenGetterParams, GridRowApi, GridRowProApi, GridRowProPrivateApi, GridRowSpanningPrivateApi } from "./gridRowApi.js";
7
7
  export type { GridRowsMetaApi } from "./gridRowsMetaApi.js";
8
8
  export * from "./gridRowSelectionApi.js";
9
9
  export * from "./gridSortApi.js";
@@ -44,6 +44,11 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
44
44
  * The title displayed in the column header cell.
45
45
  */
46
46
  headerName?: string;
47
+ /**
48
+ * If `true`, the cells in this column identify their respective rows and receive the `rowheader` ARIA role.
49
+ * @default false
50
+ */
51
+ rowHeader?: boolean;
47
52
  /**
48
53
  * The tooltip text shown when the column header name is truncated.
49
54
  */
@@ -44,6 +44,11 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
44
44
  * The title displayed in the column header cell.
45
45
  */
46
46
  headerName?: string;
47
+ /**
48
+ * If `true`, the cells in this column identify their respective rows and receive the `rowheader` ARIA role.
49
+ * @default false
50
+ */
51
+ rowHeader?: boolean;
47
52
  /**
48
53
  * The tooltip text shown when the column header name is truncated.
49
54
  */
@@ -10,7 +10,19 @@ import type { GridParamsOverridableMethodsInternalHook } from "./gridParamsConfi
10
10
  export interface GridAriaAttributesInternalHook {
11
11
  useGridAriaAttributes: () => React.HTMLAttributes<HTMLElement>;
12
12
  }
13
- export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
13
+ export interface GridColumnHeaderAdornmentInternalHook {
14
+ /**
15
+ * Returns an optional adornment rendered inside a column header's title
16
+ * content, at the start, before the title label. Placing it inside the
17
+ * (non-reversed) title content keeps it on the same side of the title for
18
+ * both left- and right-aligned headers. Called once per rendered header
19
+ * cell, so the implementation may use hooks.
20
+ * @param {string} field The column field.
21
+ * @returns {React.ReactNode} The adornment node, or `null` for none.
22
+ */
23
+ useColumnHeaderAdornment: (field: string) => React.ReactNode;
24
+ }
25
+ export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridColumnHeaderAdornmentInternalHook, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
14
26
  useCSSVariables: () => {
15
27
  id: string;
16
28
  variables: GridCSSVariablesInterface;
@@ -10,7 +10,19 @@ import type { GridParamsOverridableMethodsInternalHook } from "./gridParamsConfi
10
10
  export interface GridAriaAttributesInternalHook {
11
11
  useGridAriaAttributes: () => React.HTMLAttributes<HTMLElement>;
12
12
  }
13
- export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
13
+ export interface GridColumnHeaderAdornmentInternalHook {
14
+ /**
15
+ * Returns an optional adornment rendered inside a column header's title
16
+ * content, at the start, before the title label. Placing it inside the
17
+ * (non-reversed) title content keeps it on the same side of the title for
18
+ * both left- and right-aligned headers. Called once per rendered header
19
+ * cell, so the implementation may use hooks.
20
+ * @param {string} field The column field.
21
+ * @returns {React.ReactNode} The adornment node, or `null` for none.
22
+ */
23
+ useColumnHeaderAdornment: (field: string) => React.ReactNode;
24
+ }
25
+ export interface GridInternalHook<Api, Props> extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook, GridCellEditableInternalHook<Api, Props>, GridAggregationInternalHooks<Api, Props>, GridColumnHeaderAdornmentInternalHook, GridRowsOverridableMethodsInternalHook<Api, Props>, GridParamsOverridableMethodsInternalHook<Api> {
14
26
  useCSSVariables: () => {
15
27
  id: string;
16
28
  variables: GridCSSVariablesInterface;
@@ -1,14 +1,15 @@
1
1
  import type { RefObject } from '@mui/x-internals/types';
2
2
  import type { GridCallbackDetails } from "./api/gridCallbackDetails.mjs";
3
+ import type { GridApiCommon } from "./api/gridApiCommon.mjs";
3
4
  import type { GridEventLookup, GridControlledStateEventLookup } from "./events/index.mjs";
4
5
  import type { OutputSelector } from "../utils/createSelector.mjs";
5
6
  import type { GridStateCommunity } from "./gridStateCommunity.mjs";
6
- export interface GridControlStateItem<State extends GridStateCommunity, Args, E extends keyof GridControlledStateEventLookup> {
7
+ export interface GridControlStateItem<State extends GridStateCommunity, Args, E extends keyof GridControlledStateEventLookup, Api extends GridApiCommon = GridApiCommon> {
7
8
  stateId: string;
8
9
  propModel?: GridEventLookup[E]['params'];
9
10
  stateSelector: OutputSelector<State, Args, GridControlledStateEventLookup[E]['params']> | ((apiRef: RefObject<{
10
11
  state: State;
11
12
  }>) => GridControlledStateEventLookup[E]['params']);
12
- propOnChange?: (model: GridControlledStateEventLookup[E]['params'], details: GridCallbackDetails) => void;
13
+ propOnChange?: (model: GridControlledStateEventLookup[E]['params'], details: GridCallbackDetails<any, Api>) => void;
13
14
  changeEvent: E;
14
15
  }