@mui/x-data-grid 9.0.0-beta.0 → 9.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 (170) hide show
  1. package/CHANGELOG.md +267 -1
  2. package/DataGrid/DataGrid.js +1 -0
  3. package/DataGrid/DataGrid.mjs +1 -0
  4. package/components/GridColumnUnsortedIcon.d.mts +5 -2
  5. package/components/GridColumnUnsortedIcon.d.ts +5 -2
  6. package/components/GridColumnUnsortedIcon.js +20 -6
  7. package/components/GridColumnUnsortedIcon.mjs +20 -5
  8. package/components/GridDetailPanels.d.mts +1 -4
  9. package/components/GridDetailPanels.d.ts +1 -4
  10. package/components/GridPinnedRows.d.mts +0 -2
  11. package/components/GridPinnedRows.d.ts +0 -2
  12. package/components/GridRowDragAndDropOverlay.js +1 -1
  13. package/components/GridRowDragAndDropOverlay.mjs +2 -2
  14. package/components/GridScrollbarFillerCell.js +9 -1
  15. package/components/GridScrollbarFillerCell.mjs +9 -1
  16. package/components/cell/GridCell.js +4 -2
  17. package/components/cell/GridCell.mjs +4 -2
  18. package/components/columnHeaders/GridColumnGroupHeader.js +5 -3
  19. package/components/columnHeaders/GridColumnGroupHeader.mjs +5 -3
  20. package/components/columnHeaders/GridColumnHeaderItem.js +3 -1
  21. package/components/columnHeaders/GridColumnHeaderItem.mjs +3 -1
  22. package/components/containers/GridRootStyles.js +86 -5
  23. package/components/containers/GridRootStyles.mjs +86 -5
  24. package/components/index.d.mts +3 -1
  25. package/components/index.d.ts +3 -1
  26. package/components/index.js +10 -2
  27. package/components/index.mjs +2 -1
  28. package/components/panel/filterPanel/GridFilterForm.js +1 -1
  29. package/components/panel/filterPanel/GridFilterForm.mjs +1 -1
  30. package/components/virtualization/GridBottomContainer.js +4 -1
  31. package/components/virtualization/GridBottomContainer.mjs +4 -1
  32. package/components/virtualization/GridVirtualScroller.js +55 -30
  33. package/components/virtualization/GridVirtualScroller.mjs +56 -31
  34. package/components/virtualization/GridVirtualScrollerContent.js +5 -1
  35. package/components/virtualization/GridVirtualScrollerContent.mjs +5 -1
  36. package/constants/gridClasses.d.mts +40 -1
  37. package/constants/gridClasses.d.ts +40 -1
  38. package/constants/gridClasses.js +2 -2
  39. package/constants/gridClasses.mjs +2 -2
  40. package/constants/localeTextConstants.js +1 -1
  41. package/constants/localeTextConstants.mjs +1 -1
  42. package/hooks/core/useGridVirtualizer.js +1 -0
  43. package/hooks/core/useGridVirtualizer.mjs +1 -0
  44. package/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -4
  45. package/hooks/features/columnHeaders/useGridColumnHeaders.mjs +8 -4
  46. package/hooks/features/dimensions/useGridDimensions.js +1 -0
  47. package/hooks/features/dimensions/useGridDimensions.mjs +1 -0
  48. package/hooks/features/export/useGridPrintExport.js +5 -1
  49. package/hooks/features/export/useGridPrintExport.mjs +5 -1
  50. package/hooks/features/focus/useGridFocus.js +4 -0
  51. package/hooks/features/focus/useGridFocus.mjs +4 -0
  52. package/hooks/features/rowSelection/useGridRowSelection.js +17 -1
  53. package/hooks/features/rowSelection/useGridRowSelection.mjs +17 -1
  54. package/hooks/features/virtualization/gridVirtualizationSelectors.d.mts +8 -0
  55. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +8 -0
  56. package/hooks/features/virtualization/gridVirtualizationSelectors.js +8 -1
  57. package/hooks/features/virtualization/gridVirtualizationSelectors.mjs +7 -0
  58. package/hooks/features/virtualization/index.d.mts +1 -1
  59. package/hooks/features/virtualization/index.d.ts +1 -1
  60. package/hooks/features/virtualization/index.js +44 -13
  61. package/hooks/features/virtualization/index.mjs +1 -1
  62. package/hooks/utils/usePinnedScrollOffset.d.mts +3 -0
  63. package/hooks/utils/usePinnedScrollOffset.d.ts +3 -0
  64. package/hooks/utils/usePinnedScrollOffset.js +27 -0
  65. package/hooks/utils/usePinnedScrollOffset.mjs +21 -0
  66. package/index.js +1 -1
  67. package/index.mjs +1 -1
  68. package/internals/index.d.mts +3 -2
  69. package/internals/index.d.ts +3 -2
  70. package/internals/index.js +29 -0
  71. package/internals/index.mjs +3 -2
  72. package/locales/arSD.js +1 -1
  73. package/locales/arSD.mjs +1 -1
  74. package/locales/beBY.js +1 -1
  75. package/locales/beBY.mjs +1 -1
  76. package/locales/bgBG.js +1 -1
  77. package/locales/bgBG.mjs +1 -1
  78. package/locales/bnBD.js +1 -1
  79. package/locales/bnBD.mjs +1 -1
  80. package/locales/caES.js +1 -1
  81. package/locales/caES.mjs +1 -1
  82. package/locales/csCZ.js +1 -1
  83. package/locales/csCZ.mjs +1 -1
  84. package/locales/daDK.js +1 -1
  85. package/locales/daDK.mjs +1 -1
  86. package/locales/deDE.js +1 -1
  87. package/locales/deDE.mjs +1 -1
  88. package/locales/elGR.js +1 -1
  89. package/locales/elGR.mjs +1 -1
  90. package/locales/esES.js +1 -1
  91. package/locales/esES.mjs +1 -1
  92. package/locales/faIR.js +1 -1
  93. package/locales/faIR.mjs +1 -1
  94. package/locales/fiFI.js +1 -1
  95. package/locales/fiFI.mjs +1 -1
  96. package/locales/frFR.js +1 -1
  97. package/locales/frFR.mjs +1 -1
  98. package/locales/heIL.js +1 -1
  99. package/locales/heIL.mjs +1 -1
  100. package/locales/hrHR.js +1 -1
  101. package/locales/hrHR.mjs +1 -1
  102. package/locales/huHU.js +1 -1
  103. package/locales/huHU.mjs +1 -1
  104. package/locales/hyAM.js +1 -1
  105. package/locales/hyAM.mjs +1 -1
  106. package/locales/idID.js +1 -1
  107. package/locales/idID.mjs +1 -1
  108. package/locales/isIS.js +1 -1
  109. package/locales/isIS.mjs +1 -1
  110. package/locales/itIT.js +1 -1
  111. package/locales/itIT.mjs +1 -1
  112. package/locales/jaJP.js +1 -1
  113. package/locales/jaJP.mjs +1 -1
  114. package/locales/koKR.js +1 -1
  115. package/locales/koKR.mjs +1 -1
  116. package/locales/nbNO.js +1 -1
  117. package/locales/nbNO.mjs +1 -1
  118. package/locales/nlNL.js +1 -1
  119. package/locales/nlNL.mjs +1 -1
  120. package/locales/nnNO.js +1 -1
  121. package/locales/nnNO.mjs +1 -1
  122. package/locales/plPL.js +1 -1
  123. package/locales/plPL.mjs +1 -1
  124. package/locales/ptBR.js +1 -1
  125. package/locales/ptBR.mjs +1 -1
  126. package/locales/ptPT.js +1 -1
  127. package/locales/ptPT.mjs +1 -1
  128. package/locales/roRO.js +1 -1
  129. package/locales/roRO.mjs +1 -1
  130. package/locales/ruRU.js +1 -1
  131. package/locales/ruRU.mjs +1 -1
  132. package/locales/skSK.js +1 -1
  133. package/locales/skSK.mjs +1 -1
  134. package/locales/svSE.js +1 -1
  135. package/locales/svSE.mjs +1 -1
  136. package/locales/thTH.js +1 -1
  137. package/locales/thTH.mjs +1 -1
  138. package/locales/trTR.js +1 -1
  139. package/locales/trTR.mjs +1 -1
  140. package/locales/ukUA.js +1 -1
  141. package/locales/ukUA.mjs +1 -1
  142. package/locales/urPK.js +1 -1
  143. package/locales/urPK.mjs +1 -1
  144. package/locales/viVN.js +1 -1
  145. package/locales/viVN.mjs +1 -1
  146. package/locales/zhCN.js +1 -1
  147. package/locales/zhCN.mjs +1 -1
  148. package/locales/zhHK.js +1 -1
  149. package/locales/zhHK.mjs +1 -1
  150. package/locales/zhTW.js +1 -1
  151. package/locales/zhTW.mjs +1 -1
  152. package/material/index.js +26 -21
  153. package/material/index.mjs +26 -21
  154. package/material/variables.js +4 -4
  155. package/material/variables.mjs +4 -5
  156. package/models/api/gridLocaleTextApi.d.mts +1 -1
  157. package/models/api/gridLocaleTextApi.d.ts +1 -1
  158. package/models/gridBaseSlots.d.mts +4 -2
  159. package/models/gridBaseSlots.d.ts +4 -2
  160. package/models/props/DataGridProps.d.mts +9 -0
  161. package/models/props/DataGridProps.d.ts +9 -0
  162. package/package.json +6 -6
  163. package/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.mjs +2 -2
  164. package/utils/cleanupTracking/TimerBasedCleanupTracking.mjs +2 -2
  165. package/utils/domUtils.js +3 -2
  166. package/utils/domUtils.mjs +3 -2
  167. package/utils/keyboardUtils.d.mts +2 -0
  168. package/utils/keyboardUtils.d.ts +2 -0
  169. package/utils/keyboardUtils.js +8 -0
  170. package/utils/keyboardUtils.mjs +6 -0
package/locales/zhTW.mjs CHANGED
@@ -59,7 +59,7 @@ const zhTWGrid = {
59
59
  filterPanelOperator: '運算子',
60
60
  filterPanelOperatorAnd: '且',
61
61
  filterPanelOperatorOr: '或',
62
- filterPanelColumns: '欄位',
62
+ filterPanelColumn: '欄位',
63
63
  filterPanelInputLabel: '值',
64
64
  filterPanelInputPlaceholder: '篩選值',
65
65
  // Filter operators text
package/material/index.js CHANGED
@@ -64,7 +64,7 @@ var _variables = require("./variables");
64
64
  const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
65
65
  _excluded2 = ["onRowsPerPageChange", "material", "disabled"],
66
66
  _excluded3 = ["material"],
67
- _excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material"],
67
+ _excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
68
68
  _excluded5 = ["material"],
69
69
  _excluded6 = ["material"],
70
70
  _excluded7 = ["material"],
@@ -80,7 +80,7 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
80
80
  _excluded15 = ["slotProps", "material"],
81
81
  _excluded16 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
82
82
  _excluded17 = ["key"],
83
- _excluded18 = ["inputProps", "InputProps", "InputLabelProps"],
83
+ _excluded18 = ["slotProps"],
84
84
  _excluded19 = ["slotProps"],
85
85
  _excluded20 = ["slotProps"],
86
86
  _excluded21 = ["slotProps", "material"],
@@ -237,11 +237,15 @@ const BasePagination = (0, _forwardRef.forwardRef)(function BasePagination(props
237
237
  return undefined;
238
238
  }
239
239
  return {
240
- backIconButtonProps: {
241
- disabled: true
242
- },
243
- nextIconButtonProps: {
244
- disabled: true
240
+ slotProps: {
241
+ actions: {
242
+ previousButton: {
243
+ disabled: true
244
+ },
245
+ nextButton: {
246
+ disabled: true
247
+ }
248
+ }
245
249
  }
246
250
  };
247
251
  }, [disabled]);
@@ -282,12 +286,14 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
282
286
  fullWidth,
283
287
  slotProps,
284
288
  className,
285
- material
289
+ material,
290
+ inputRef
286
291
  } = props,
287
292
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded4);
288
293
  const elementRef = React.useRef(null);
289
294
  const handleRef = (0, _useForkRef.default)(elementRef, ref);
290
295
  const rippleRef = React.useRef(null);
296
+ const combinedInputRef = (0, _useForkRef.default)(inputRef, slotProps?.htmlInput?.ref, material?.slotProps?.input?.ref);
291
297
  React.useEffect(() => {
292
298
  if (autoFocus) {
293
299
  const input = elementRef.current?.querySelector('input');
@@ -300,12 +306,15 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
300
306
  rippleRef.current.stop({});
301
307
  }
302
308
  }, [autoFocus]);
309
+ const checkboxSlotProps = React.useMemo(() => (0, _extends2.default)({}, material?.slotProps, {
310
+ input: (0, _extends2.default)({}, material?.slotProps?.input, slotProps?.htmlInput, {
311
+ ref: combinedInputRef
312
+ })
313
+ }), [material?.slotProps, slotProps?.htmlInput, combinedInputRef]);
303
314
  if (!label) {
304
315
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Checkbox, (0, _extends2.default)({}, other, material, {
305
316
  className: (0, _clsx.default)(className, material?.className),
306
- slotProps: {
307
- input: slotProps?.htmlInput
308
- },
317
+ slotProps: checkboxSlotProps,
309
318
  ref: handleRef,
310
319
  touchRippleRef: rippleRef
311
320
  }));
@@ -313,9 +322,7 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
313
322
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormControlLabel, {
314
323
  className: className,
315
324
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(Checkbox, (0, _extends2.default)({}, other, material, {
316
- slotProps: {
317
- input: slotProps?.htmlInput
318
- },
325
+ slotProps: checkboxSlotProps,
319
326
  ref: handleRef,
320
327
  touchRippleRef: rippleRef
321
328
  })),
@@ -542,9 +549,7 @@ function BaseAutocomplete(props) {
542
549
  }),
543
550
  renderInput: params => {
544
551
  const {
545
- inputProps: htmlInputProps,
546
- InputProps,
547
- InputLabelProps
552
+ slotProps: autocompleteSlotProps
548
553
  } = params,
549
554
  inputRest = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded18);
550
555
  const _ref = slotProps?.textField ?? {},
@@ -562,11 +567,11 @@ function BaseAutocomplete(props) {
562
567
  placeholder: placeholder
563
568
  }, textFieldRest, baseTextFieldRest, {
564
569
  slotProps: {
565
- htmlInput: (0, _extends2.default)({}, htmlInputProps, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
566
- input: (0, _extends2.default)({}, transformInputProps(InputProps, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
570
+ htmlInput: (0, _extends2.default)({}, autocompleteSlotProps.htmlInput, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
571
+ input: (0, _extends2.default)({}, transformInputProps(autocompleteSlotProps.input, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
567
572
  inputLabel: (0, _extends2.default)({
568
573
  shrink: true
569
- }, InputLabelProps, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
574
+ }, autocompleteSlotProps.inputLabel, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
570
575
  }
571
576
  }));
572
577
  }
@@ -749,7 +754,7 @@ const StyledTabs = (0, _styles.styled)(_Tabs.default, {
749
754
  })(({
750
755
  theme
751
756
  }) => ({
752
- borderBottom: `1px solid ${theme.palette.divider}`
757
+ borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
753
758
  }));
754
759
  const StyledTab = (0, _styles.styled)(_Tab.default, {
755
760
  name: 'MuiDataGrid',
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
4
4
  _excluded2 = ["onRowsPerPageChange", "material", "disabled"],
5
5
  _excluded3 = ["material"],
6
- _excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material"],
6
+ _excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
7
7
  _excluded5 = ["material"],
8
8
  _excluded6 = ["material"],
9
9
  _excluded7 = ["material"],
@@ -19,7 +19,7 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
19
19
  _excluded15 = ["slotProps", "material"],
20
20
  _excluded16 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
21
21
  _excluded17 = ["key"],
22
- _excluded18 = ["inputProps", "InputProps", "InputLabelProps"],
22
+ _excluded18 = ["slotProps"],
23
23
  _excluded19 = ["slotProps"],
24
24
  _excluded20 = ["slotProps"],
25
25
  _excluded21 = ["slotProps", "material"],
@@ -224,11 +224,15 @@ const BasePagination = forwardRef(function BasePagination(props, ref) {
224
224
  return undefined;
225
225
  }
226
226
  return {
227
- backIconButtonProps: {
228
- disabled: true
229
- },
230
- nextIconButtonProps: {
231
- disabled: true
227
+ slotProps: {
228
+ actions: {
229
+ previousButton: {
230
+ disabled: true
231
+ },
232
+ nextButton: {
233
+ disabled: true
234
+ }
235
+ }
232
236
  }
233
237
  };
234
238
  }, [disabled]);
@@ -269,12 +273,14 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
269
273
  fullWidth,
270
274
  slotProps,
271
275
  className,
272
- material
276
+ material,
277
+ inputRef
273
278
  } = props,
274
279
  other = _objectWithoutPropertiesLoose(props, _excluded4);
275
280
  const elementRef = React.useRef(null);
276
281
  const handleRef = useForkRef(elementRef, ref);
277
282
  const rippleRef = React.useRef(null);
283
+ const combinedInputRef = useForkRef(inputRef, slotProps?.htmlInput?.ref, material?.slotProps?.input?.ref);
278
284
  React.useEffect(() => {
279
285
  if (autoFocus) {
280
286
  const input = elementRef.current?.querySelector('input');
@@ -287,12 +293,15 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
287
293
  rippleRef.current.stop({});
288
294
  }
289
295
  }, [autoFocus]);
296
+ const checkboxSlotProps = React.useMemo(() => _extends({}, material?.slotProps, {
297
+ input: _extends({}, material?.slotProps?.input, slotProps?.htmlInput, {
298
+ ref: combinedInputRef
299
+ })
300
+ }), [material?.slotProps, slotProps?.htmlInput, combinedInputRef]);
290
301
  if (!label) {
291
302
  return /*#__PURE__*/_jsx(Checkbox, _extends({}, other, material, {
292
303
  className: clsx(className, material?.className),
293
- slotProps: {
294
- input: slotProps?.htmlInput
295
- },
304
+ slotProps: checkboxSlotProps,
296
305
  ref: handleRef,
297
306
  touchRippleRef: rippleRef
298
307
  }));
@@ -300,9 +309,7 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
300
309
  return /*#__PURE__*/_jsx(FormControlLabel, {
301
310
  className: className,
302
311
  control: /*#__PURE__*/_jsx(Checkbox, _extends({}, other, material, {
303
- slotProps: {
304
- input: slotProps?.htmlInput
305
- },
312
+ slotProps: checkboxSlotProps,
306
313
  ref: handleRef,
307
314
  touchRippleRef: rippleRef
308
315
  })),
@@ -529,9 +536,7 @@ function BaseAutocomplete(props) {
529
536
  }),
530
537
  renderInput: params => {
531
538
  const {
532
- inputProps: htmlInputProps,
533
- InputProps,
534
- InputLabelProps
539
+ slotProps: autocompleteSlotProps
535
540
  } = params,
536
541
  inputRest = _objectWithoutPropertiesLoose(params, _excluded18);
537
542
  const _ref = slotProps?.textField ?? {},
@@ -549,11 +554,11 @@ function BaseAutocomplete(props) {
549
554
  placeholder: placeholder
550
555
  }, textFieldRest, baseTextFieldRest, {
551
556
  slotProps: {
552
- htmlInput: _extends({}, htmlInputProps, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
553
- input: _extends({}, transformInputProps(InputProps, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
557
+ htmlInput: _extends({}, autocompleteSlotProps.htmlInput, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
558
+ input: _extends({}, transformInputProps(autocompleteSlotProps.input, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
554
559
  inputLabel: _extends({
555
560
  shrink: true
556
- }, InputLabelProps, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
561
+ }, autocompleteSlotProps.inputLabel, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
557
562
  }
558
563
  }));
559
564
  }
@@ -736,7 +741,7 @@ const StyledTabs = styled(MUITabs, {
736
741
  })(({
737
742
  theme
738
743
  }) => ({
739
- borderBottom: `1px solid ${theme.palette.divider}`
744
+ borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
740
745
  }));
741
746
  const StyledTab = styled(MUITab, {
742
747
  name: 'MuiDataGrid',
@@ -28,9 +28,9 @@ function transformTheme(t) {
28
28
  const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
29
29
  const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
30
30
  const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
31
- const backgroundBackdrop = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : (0, _styles.alpha)(t.palette.background.default, t.palette.action.disabledOpacity);
31
+ const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
32
32
  const backgroundOverlay = t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
33
- const selectedColor = t.vars ? `rgb(${t.vars.palette.primary.mainChannel})` : t.palette.primary.main;
33
+ const selectedColor = (t.vars || t).palette.primary.main;
34
34
  const radius = getRadius(t);
35
35
  const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
36
36
  const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
@@ -89,9 +89,9 @@ function getBorderColor(theme) {
89
89
  return theme.vars.palette.TableCell.border;
90
90
  }
91
91
  if (theme.palette.mode === 'light') {
92
- return (0, _styles.lighten)((0, _styles.alpha)(theme.palette.divider, 1), 0.88);
92
+ return theme.lighten(theme.alpha(theme.palette.divider, 1), 0.88);
93
93
  }
94
- return (0, _styles.darken)((0, _styles.alpha)(theme.palette.divider, 1), 0.68);
94
+ return theme.darken(theme.alpha(theme.palette.divider, 1), 0.68);
95
95
  }
96
96
  function setOpacity(color, opacity) {
97
97
  return `rgba(from ${color} r g b / ${opacity})`;
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { alpha, darken, lighten } from '@mui/material/styles';
3
2
  import { useTheme } from '@mui/material/styles';
4
3
  import { hash } from '@mui/x-internals/hash';
5
4
  import { vars } from "../constants/cssVariables.mjs";
@@ -22,9 +21,9 @@ function transformTheme(t) {
22
21
  const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
23
22
  const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
24
23
  const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
25
- const backgroundBackdrop = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : alpha(t.palette.background.default, t.palette.action.disabledOpacity);
24
+ const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
26
25
  const backgroundOverlay = t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
27
- const selectedColor = t.vars ? `rgb(${t.vars.palette.primary.mainChannel})` : t.palette.primary.main;
26
+ const selectedColor = (t.vars || t).palette.primary.main;
28
27
  const radius = getRadius(t);
29
28
  const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
30
29
  const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
@@ -83,9 +82,9 @@ function getBorderColor(theme) {
83
82
  return theme.vars.palette.TableCell.border;
84
83
  }
85
84
  if (theme.palette.mode === 'light') {
86
- return lighten(alpha(theme.palette.divider, 1), 0.88);
85
+ return theme.lighten(theme.alpha(theme.palette.divider, 1), 0.88);
87
86
  }
88
- return darken(alpha(theme.palette.divider, 1), 0.68);
87
+ return theme.darken(theme.alpha(theme.palette.divider, 1), 0.68);
89
88
  }
90
89
  function setOpacity(color, opacity) {
91
90
  return `rgba(from ${color} r g b / ${opacity})`;
@@ -46,7 +46,7 @@ export interface GridLocaleText {
46
46
  filterPanelOperator: React.ReactNode;
47
47
  filterPanelOperatorAnd: React.ReactNode;
48
48
  filterPanelOperatorOr: React.ReactNode;
49
- filterPanelColumns: React.ReactNode;
49
+ filterPanelColumn: React.ReactNode;
50
50
  filterPanelInputLabel: string;
51
51
  filterPanelInputPlaceholder: string;
52
52
  filterOperatorContains: string;
@@ -46,7 +46,7 @@ export interface GridLocaleText {
46
46
  filterPanelOperator: React.ReactNode;
47
47
  filterPanelOperatorAnd: React.ReactNode;
48
48
  filterPanelOperatorOr: React.ReactNode;
49
- filterPanelColumns: React.ReactNode;
49
+ filterPanelColumn: React.ReactNode;
50
50
  filterPanelInputLabel: string;
51
51
  filterPanelInputPlaceholder: string;
52
52
  filterOperatorContains: string;
@@ -96,7 +96,9 @@ export type CheckboxProps = CommonProps & {
96
96
  size?: 'small' | 'medium';
97
97
  density?: 'standard' | 'compact';
98
98
  slotProps?: {
99
- htmlInput?: React.InputHTMLAttributes<HTMLInputElement>;
99
+ htmlInput?: React.InputHTMLAttributes<HTMLInputElement> & {
100
+ ref?: React.Ref<HTMLInputElement>;
101
+ };
100
102
  };
101
103
  style?: React.CSSProperties;
102
104
  tabIndex?: number;
@@ -116,7 +118,7 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
116
118
  color?: 'default' | 'inherit' | 'primary';
117
119
  edge?: 'start' | 'end' | false;
118
120
  };
119
- export type ToggleButtonProps = CommonProps & {
121
+ export type ToggleButtonProps = Omit<CommonProps, 'onChange'> & {
120
122
  selected?: boolean;
121
123
  value: string;
122
124
  };
@@ -96,7 +96,9 @@ export type CheckboxProps = CommonProps & {
96
96
  size?: 'small' | 'medium';
97
97
  density?: 'standard' | 'compact';
98
98
  slotProps?: {
99
- htmlInput?: React.InputHTMLAttributes<HTMLInputElement>;
99
+ htmlInput?: React.InputHTMLAttributes<HTMLInputElement> & {
100
+ ref?: React.Ref<HTMLInputElement>;
101
+ };
100
102
  };
101
103
  style?: React.CSSProperties;
102
104
  tabIndex?: number;
@@ -116,7 +118,7 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
116
118
  color?: 'default' | 'inherit' | 'primary';
117
119
  edge?: 'start' | 'end' | false;
118
120
  };
119
- export type ToggleButtonProps = CommonProps & {
121
+ export type ToggleButtonProps = Omit<CommonProps, 'onChange'> & {
120
122
  selected?: boolean;
121
123
  value: string;
122
124
  };
@@ -37,6 +37,15 @@ export interface GridExperimentalFeatures {
37
37
  * Only works if NODE_ENV=test.
38
38
  */
39
39
  warnIfFocusStateIsNotSynced: boolean;
40
+ /**
41
+ * Sets the layout mode of the virtualizer.
42
+ * - `'uncontrolled'` (default): the browser controls scrolling and the virtualizer
43
+ * positions rows using a filler element.
44
+ * - `'controlled'`: the virtualizer controls scrolling by translating the viewport,
45
+ * enabling features such as sticky pinned rows and columns without extra DOM cost.
46
+ * @default 'uncontrolled'
47
+ */
48
+ virtualizerLayoutMode: 'controlled' | 'uncontrolled';
40
49
  }
41
50
  /**
42
51
  * The props users can give to the Data Grid component.
@@ -37,6 +37,15 @@ export interface GridExperimentalFeatures {
37
37
  * Only works if NODE_ENV=test.
38
38
  */
39
39
  warnIfFocusStateIsNotSynced: boolean;
40
+ /**
41
+ * Sets the layout mode of the virtualizer.
42
+ * - `'uncontrolled'` (default): the browser controls scrolling and the virtualizer
43
+ * positions rows using a filler element.
44
+ * - `'controlled'`: the virtualizer controls scrolling by translating the viewport,
45
+ * enabling features such as sticky pinned rows and columns without extra DOM cost.
46
+ * @default 'uncontrolled'
47
+ */
48
+ virtualizerLayoutMode: 'controlled' | 'uncontrolled';
40
49
  }
41
50
  /**
42
51
  * The props users can give to the Data Grid component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "9.0.0-beta.0",
3
+ "version": "9.0.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",
@@ -38,18 +38,18 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/runtime": "^7.28.6",
41
- "@mui/utils": "^7.3.7",
41
+ "@mui/utils": "9.0.0",
42
42
  "clsx": "^2.1.1",
43
43
  "prop-types": "^15.8.1",
44
44
  "use-sync-external-store": "^1.6.0",
45
- "@mui/x-virtualizer": "1.0.0-beta.1",
46
- "@mui/x-internals": "9.0.0-alpha.4"
45
+ "@mui/x-virtualizer": "9.0.0-alpha.0",
46
+ "@mui/x-internals": "^9.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",
50
50
  "@emotion/styled": "^11.8.1",
51
- "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
52
- "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
51
+ "@mui/material": "^7.3.0 || ^9.0.0",
52
+ "@mui/system": "^7.3.0 || ^9.0.0",
53
53
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
54
54
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
55
55
  },
@@ -1,9 +1,9 @@
1
1
  export class FinalizationRegistryBasedCleanupTracking {
2
- registry = (() => new FinalizationRegistry(unsubscribe => {
2
+ registry = new FinalizationRegistry(unsubscribe => {
3
3
  if (typeof unsubscribe === 'function') {
4
4
  unsubscribe();
5
5
  }
6
- }))();
6
+ });
7
7
  register(object, unsubscribe, unregisterToken) {
8
8
  this.registry.register(object, unsubscribe, unregisterToken);
9
9
  }
@@ -1,8 +1,8 @@
1
1
  // If no effect ran after this amount of time, we assume that the render was not committed by React
2
2
  const CLEANUP_TIMER_LOOP_MILLIS = 1000;
3
3
  export class TimerBasedCleanupTracking {
4
- timeouts = (() => new Map())();
5
- cleanupTimeout = (() => CLEANUP_TIMER_LOOP_MILLIS)();
4
+ timeouts = new Map();
5
+ cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
6
6
  constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
7
7
  this.cleanupTimeout = timeout;
8
8
  }
package/utils/domUtils.js CHANGED
@@ -221,12 +221,13 @@ function findGridHeaderFilter(api, field) {
221
221
  }
222
222
  function findGridCells(api, field) {
223
223
  const container = api.virtualScrollerRef.current;
224
- return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
224
+ return Array.from(container.querySelectorAll(`:scope > div > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
225
225
  }
226
226
  function queryRows(api) {
227
227
  return api.virtualScrollerRef.current.querySelectorAll(
228
228
  // Use > to ignore rows from nested Data Grids (for example in detail panel)
229
- `:scope > div > div > .${_gridClasses.gridClasses.row}`);
229
+ `:scope > div > div > div > .${_gridClasses.gridClasses.row},
230
+ :scope > div > div > div > div > .${_gridClasses.gridClasses.row}`);
230
231
  }
231
232
  function parseCellColIndex(col) {
232
233
  const ariaColIndex = col.getAttribute('aria-colindex');
@@ -193,12 +193,13 @@ export function findGridHeaderFilter(api, field) {
193
193
  }
194
194
  export function findGridCells(api, field) {
195
195
  const container = api.virtualScrollerRef.current;
196
- return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
196
+ return Array.from(container.querySelectorAll(`:scope > div > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
197
197
  }
198
198
  function queryRows(api) {
199
199
  return api.virtualScrollerRef.current.querySelectorAll(
200
200
  // Use > to ignore rows from nested Data Grids (for example in detail panel)
201
- `:scope > div > div > .${gridClasses.row}`);
201
+ `:scope > div > div > div > .${gridClasses.row},
202
+ :scope > div > div > div > div > .${gridClasses.row}`);
202
203
  }
203
204
  function parseCellColIndex(col) {
204
205
  const ariaColIndex = col.getAttribute('aria-colindex');
@@ -6,4 +6,6 @@ export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is
6
6
  export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
7
7
  export declare function isCopyShortcut(event: KeyboardEvent): boolean;
8
8
  export declare function isUndoShortcut(event: React.KeyboardEvent): boolean;
9
+ export declare function isFillDownShortcut(event: React.KeyboardEvent): boolean;
10
+ export declare function isFillRightShortcut(event: React.KeyboardEvent): boolean;
9
11
  export declare function isRedoShortcut(event: React.KeyboardEvent): boolean;
@@ -6,4 +6,6 @@ export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is
6
6
  export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
7
7
  export declare function isCopyShortcut(event: KeyboardEvent): boolean;
8
8
  export declare function isUndoShortcut(event: React.KeyboardEvent): boolean;
9
+ export declare function isFillDownShortcut(event: React.KeyboardEvent): boolean;
10
+ export declare function isFillRightShortcut(event: React.KeyboardEvent): boolean;
9
11
  export declare function isRedoShortcut(event: React.KeyboardEvent): boolean;
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isCopyShortcut = isCopyShortcut;
7
+ exports.isFillDownShortcut = isFillDownShortcut;
8
+ exports.isFillRightShortcut = isFillRightShortcut;
7
9
  exports.isNavigationKey = exports.isKeyboardEvent = exports.isHideMenuKey = void 0;
8
10
  exports.isPasteShortcut = isPasteShortcut;
9
11
  exports.isPrintableKey = isPrintableKey;
@@ -45,6 +47,12 @@ function isCopyShortcut(event) {
45
47
  function isUndoShortcut(event) {
46
48
  return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'Z' && !event.shiftKey && !event.altKey;
47
49
  }
50
+ function isFillDownShortcut(event) {
51
+ return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'D' && !event.shiftKey && !event.altKey;
52
+ }
53
+ function isFillRightShortcut(event) {
54
+ return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'R' && !event.shiftKey && !event.altKey;
55
+ }
48
56
  function isRedoShortcut(event) {
49
57
  return (event.ctrlKey || event.metaKey) && (String.fromCharCode(event.keyCode) === 'Z' && event.shiftKey || String.fromCharCode(event.keyCode) === 'Y' && !event.shiftKey) && !event.altKey;
50
58
  }
@@ -31,6 +31,12 @@ export function isCopyShortcut(event) {
31
31
  export function isUndoShortcut(event) {
32
32
  return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'Z' && !event.shiftKey && !event.altKey;
33
33
  }
34
+ export function isFillDownShortcut(event) {
35
+ return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'D' && !event.shiftKey && !event.altKey;
36
+ }
37
+ export function isFillRightShortcut(event) {
38
+ return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'R' && !event.shiftKey && !event.altKey;
39
+ }
34
40
  export function isRedoShortcut(event) {
35
41
  return (event.ctrlKey || event.metaKey) && (String.fromCharCode(event.keyCode) === 'Z' && event.shiftKey || String.fromCharCode(event.keyCode) === 'Y' && !event.shiftKey) && !event.altKey;
36
42
  }