@mui/x-data-grid 7.0.0-beta.7 → 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 (190) hide show
  1. package/CHANGELOG.md +195 -12
  2. package/DataGrid/DataGrid.js +13 -17
  3. package/DataGrid/useDataGridProps.js +3 -5
  4. package/README.md +1 -1
  5. package/components/GridFooter.js +2 -3
  6. package/components/GridHeader.js +1 -2
  7. package/components/GridPagination.d.ts +6 -5
  8. package/components/GridPagination.js +12 -4
  9. package/components/GridRow.js +13 -17
  10. package/components/base/GridFooterPlaceholder.js +1 -2
  11. package/components/base/GridOverlays.js +3 -6
  12. package/components/cell/GridActionsCell.js +4 -6
  13. package/components/cell/GridActionsCellItem.d.ts +8 -25
  14. package/components/cell/GridActionsCellItem.js +8 -5
  15. package/components/cell/GridBooleanCell.d.ts +1 -0
  16. package/components/cell/GridBooleanCell.js +3 -2
  17. package/components/cell/GridCell.js +7 -8
  18. package/components/cell/GridEditBooleanCell.js +1 -2
  19. package/components/cell/GridEditDateCell.js +2 -3
  20. package/components/cell/GridEditInputCell.js +2 -2
  21. package/components/cell/GridEditSingleSelectCell.js +5 -8
  22. package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
  23. package/components/columnHeaders/GridColumnGroupHeader.js +4 -5
  24. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
  25. package/components/columnHeaders/GridColumnHeaderItem.js +5 -6
  26. package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
  27. package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
  28. package/components/columnHeaders/GridGenericColumnHeaderItem.js +1 -1
  29. package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
  30. package/components/columnSelection/GridHeaderCheckbox.js +1 -2
  31. package/components/columnsManagement/GridColumnsManagement.js +17 -21
  32. package/components/containers/GridRoot.js +3 -3
  33. package/components/menu/GridMenu.js +4 -6
  34. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  35. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
  36. package/components/panel/GridColumnsPanel.js +1 -2
  37. package/components/panel/GridPanel.d.ts +1 -10
  38. package/components/panel/GridPanel.js +1 -2
  39. package/components/panel/GridPreferencesPanel.js +2 -3
  40. package/components/panel/filterPanel/GridFilterForm.js +24 -27
  41. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
  42. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  43. package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
  44. package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
  45. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
  46. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
  47. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
  48. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
  49. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
  50. package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
  51. package/components/panel/filterPanel/GridFilterPanel.js +5 -9
  52. package/components/panel/filterPanel/filterPanelUtils.js +1 -1
  53. package/components/toolbar/GridToolbarColumnsButton.js +3 -5
  54. package/components/toolbar/GridToolbarDensitySelector.js +8 -10
  55. package/components/toolbar/GridToolbarExport.js +2 -2
  56. package/components/toolbar/GridToolbarExportContainer.js +3 -5
  57. package/components/toolbar/GridToolbarFilterButton.js +3 -5
  58. package/components/toolbar/GridToolbarQuickFilter.js +4 -5
  59. package/components/virtualization/GridVirtualScrollerContent.js +1 -2
  60. package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
  61. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +1 -2
  62. package/hooks/core/useGridApiInitialization.js +4 -6
  63. package/hooks/features/clipboard/useGridClipboard.js +6 -5
  64. package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
  65. package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
  66. package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
  67. package/hooks/features/columnHeaders/useGridColumnHeaders.js +6 -8
  68. package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
  69. package/hooks/features/columnResize/useGridColumnResize.js +9 -19
  70. package/hooks/features/columns/gridColumnsSelector.js +1 -2
  71. package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
  72. package/hooks/features/columns/gridColumnsUtils.js +2 -22
  73. package/hooks/features/columns/useGridColumnSpanning.js +1 -2
  74. package/hooks/features/columns/useGridColumns.js +11 -19
  75. package/hooks/features/density/densitySelector.d.ts +4 -2
  76. package/hooks/features/density/densitySelector.js +8 -2
  77. package/hooks/features/density/densityState.d.ts +1 -4
  78. package/hooks/features/density/useGridDensity.d.ts +2 -4
  79. package/hooks/features/density/useGridDensity.js +21 -29
  80. package/hooks/features/dimensions/useGridDimensions.js +3 -5
  81. package/hooks/features/editing/useGridCellEditing.js +4 -6
  82. package/hooks/features/editing/useGridEditing.js +1 -2
  83. package/hooks/features/editing/useGridRowEditing.js +4 -6
  84. package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
  85. package/hooks/features/export/serializers/csvSerializer.js +25 -16
  86. package/hooks/features/export/useGridCsvExport.js +9 -10
  87. package/hooks/features/export/useGridPrintExport.js +9 -15
  88. package/hooks/features/export/utils.js +2 -3
  89. package/hooks/features/filter/gridFilterSelector.js +15 -22
  90. package/hooks/features/filter/gridFilterUtils.js +10 -16
  91. package/hooks/features/filter/useGridFilter.js +9 -15
  92. package/hooks/features/focus/useGridFocus.js +5 -6
  93. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +1 -4
  94. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +12 -17
  95. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
  96. package/hooks/features/pagination/gridPaginationSelector.js +1 -2
  97. package/hooks/features/pagination/useGridPagination.js +2 -3
  98. package/hooks/features/pagination/useGridPaginationModel.js +6 -11
  99. package/hooks/features/pagination/useGridRowCount.js +3 -6
  100. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
  101. package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
  102. package/hooks/features/rows/gridRowsSelector.js +11 -19
  103. package/hooks/features/rows/gridRowsUtils.js +7 -9
  104. package/hooks/features/rows/useGridParamsApi.js +1 -1
  105. package/hooks/features/rows/useGridRows.js +4 -13
  106. package/hooks/features/rows/useGridRowsMeta.js +7 -13
  107. package/hooks/features/scroll/useGridScroll.js +2 -3
  108. package/hooks/features/sorting/gridSortingSelector.js +4 -7
  109. package/hooks/features/sorting/useGridSorting.js +8 -14
  110. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
  111. package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
  112. package/hooks/utils/useGridApiEventHandler.js +5 -10
  113. package/hooks/utils/useGridNativeEventListener.js +1 -2
  114. package/index.js +1 -1
  115. package/internals/index.d.ts +2 -0
  116. package/internals/index.js +1 -0
  117. package/internals/utils/useProps.js +1 -2
  118. package/joy/joySlots.js +7 -13
  119. package/models/api/gridRowsMetaApi.d.ts +1 -1
  120. package/models/api/index.d.ts +1 -1
  121. package/models/api/index.js +0 -1
  122. package/models/events/gridEventLookup.d.ts +7 -0
  123. package/models/gridExport.d.ts +6 -0
  124. package/models/gridStateCommunity.d.ts +1 -0
  125. package/models/props/DataGridProps.d.ts +23 -27
  126. package/modern/DataGrid/DataGrid.js +13 -17
  127. package/modern/DataGrid/useDataGridProps.js +3 -5
  128. package/modern/components/GridPagination.js +11 -2
  129. package/modern/components/cell/GridActionsCell.js +1 -1
  130. package/modern/components/cell/GridActionsCellItem.js +4 -0
  131. package/modern/components/cell/GridBooleanCell.js +3 -2
  132. package/modern/components/containers/GridRoot.js +3 -3
  133. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  134. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  135. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  136. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  137. package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
  138. package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
  139. package/modern/hooks/features/columnResize/useGridColumnResize.js +1 -1
  140. package/modern/hooks/features/columns/gridColumnsUtils.js +0 -19
  141. package/modern/hooks/features/density/densitySelector.js +8 -2
  142. package/modern/hooks/features/density/useGridDensity.js +21 -29
  143. package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
  144. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  145. package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
  146. package/modern/hooks/features/export/useGridCsvExport.js +2 -1
  147. package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
  148. package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -2
  149. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  150. package/modern/index.js +1 -1
  151. package/modern/internals/index.js +1 -0
  152. package/modern/models/api/index.js +0 -1
  153. package/modern/utils/createSelector.js +1 -1
  154. package/modern/utils/domUtils.js +1 -1
  155. package/modern/utils/keyboardUtils.js +1 -1
  156. package/node/DataGrid/DataGrid.js +13 -17
  157. package/node/DataGrid/useDataGridProps.js +3 -5
  158. package/node/components/GridPagination.js +9 -1
  159. package/node/components/cell/GridActionsCell.js +1 -1
  160. package/node/components/cell/GridActionsCellItem.js +4 -0
  161. package/node/components/cell/GridBooleanCell.js +3 -2
  162. package/node/components/containers/GridRoot.js +2 -2
  163. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  164. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
  165. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
  166. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
  167. package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
  168. package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
  169. package/node/hooks/features/columnResize/useGridColumnResize.js +1 -1
  170. package/node/hooks/features/columns/gridColumnsUtils.js +0 -20
  171. package/node/hooks/features/density/densitySelector.js +9 -3
  172. package/node/hooks/features/density/useGridDensity.js +22 -30
  173. package/node/hooks/features/editing/useGridCellEditing.js +1 -1
  174. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  175. package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
  176. package/node/hooks/features/export/useGridCsvExport.js +2 -1
  177. package/node/hooks/features/filter/gridFilterUtils.js +1 -1
  178. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
  179. package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
  180. package/node/index.js +1 -1
  181. package/node/internals/index.js +12 -0
  182. package/node/models/api/index.js +0 -11
  183. package/node/utils/createSelector.js +1 -1
  184. package/node/utils/domUtils.js +1 -1
  185. package/node/utils/keyboardUtils.js +1 -1
  186. package/package.json +4 -4
  187. package/utils/createSelector.js +9 -9
  188. package/utils/domUtils.js +4 -7
  189. package/utils/getGridLocalization.js +9 -12
  190. package/utils/keyboardUtils.js +1 -1
@@ -14,7 +14,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
15
  const hasActions = colDef => typeof colDef.getActions === 'function';
16
16
  function GridActionsCell(props) {
17
- var _rootProps$slotProps;
18
17
  const {
19
18
  colDef,
20
19
  id,
@@ -45,7 +44,7 @@ function GridActionsCell(props) {
45
44
  React.useLayoutEffect(() => {
46
45
  if (!hasFocus) {
47
46
  Object.entries(touchRippleRefs.current).forEach(([index, ref]) => {
48
- ref == null || ref.stop({}, () => {
47
+ ref?.stop({}, () => {
49
48
  delete touchRippleRefs.current[index];
50
49
  });
51
50
  });
@@ -107,7 +106,6 @@ function GridActionsCell(props) {
107
106
  return;
108
107
  }
109
108
  const getNewIndex = (index, direction) => {
110
- var _options;
111
109
  if (index < 0 || index > options.length) {
112
110
  return index;
113
111
  }
@@ -117,7 +115,7 @@ function GridActionsCell(props) {
117
115
  const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
118
116
 
119
117
  // if the button that should receive focus is disabled go one more step
120
- return (_options = options[index + indexMod]) != null && _options.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
118
+ return options[index + indexMod]?.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
121
119
  };
122
120
  let newIndex = focusedButtonIndex;
123
121
  if (event.key === 'ArrowRight') {
@@ -130,7 +128,7 @@ function GridActionsCell(props) {
130
128
  }
131
129
  if (newIndex !== focusedButtonIndex) {
132
130
  event.preventDefault(); // Prevent scrolling
133
- event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
131
+ event.stopPropagation(); // Don't stop propagation for other keys, for example ArrowUp
134
132
  setFocusedButtonIndex(newIndex);
135
133
  }
136
134
  };
@@ -166,7 +164,7 @@ function GridActionsCell(props) {
166
164
  onClick: showMenu,
167
165
  touchRippleRef: handleTouchRippleRef(buttonId),
168
166
  tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
169
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
167
+ }, rootProps.slotProps?.baseIconButton, {
170
168
  children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {
171
169
  fontSize: "small"
172
170
  })
@@ -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));
@@ -76,7 +76,6 @@ let warnedOnce = false;
76
76
  // TODO(v7): Removing the wrapper will break the docs performance visualization demo.
77
77
 
78
78
  const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
79
- var _getActions, _ref, _rootProps$cellSelect, _rootProps$experiment;
80
79
  const {
81
80
  column,
82
81
  rowId,
@@ -134,7 +133,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
134
133
  value,
135
134
  formattedValue
136
135
  } = cellParamsWithAPI;
137
- 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);
138
137
  const tabIndex = (cellMode === 'view' || !isEditable) && !canManageOwnFocus ? cellParamsWithAPI.tabIndex : -1;
139
138
  const {
140
139
  classes: rootClasses,
@@ -161,7 +160,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
161
160
  const handleRef = useForkRef(ref, cellRef);
162
161
  const focusElementRef = React.useRef(null);
163
162
  // @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
164
- const isSelectionMode = (_rootProps$cellSelect = rootProps.cellSelection) != null ? _rootProps$cellSelect : false;
163
+ const isSelectionMode = rootProps.cellSelection ?? false;
165
164
  const position = gridPinnedColumnPositionLookup[pinnedPosition];
166
165
  const showLeftBorder = shouldCellShowLeftBorder(position, sectionIndex);
167
166
  const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder);
@@ -244,17 +243,17 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
244
243
  return null;
245
244
  }
246
245
  let handleFocus = other.onFocus;
247
- if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {
246
+ if (process.env.NODE_ENV === 'test' && rootProps.experimentalFeatures?.warnIfFocusStateIsNotSynced) {
248
247
  handleFocus = event => {
249
248
  const focusedCell = gridFocusCellSelector(apiRef);
250
- if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {
249
+ if (focusedCell?.id === rowId && focusedCell.field === field) {
251
250
  if (typeof other.onFocus === 'function') {
252
251
  other.onFocus(event);
253
252
  }
254
253
  return;
255
254
  }
256
255
  if (!warnedOnce) {
257
- 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'));
258
257
  warnedOnce = true;
259
258
  }
260
259
  };
@@ -274,10 +273,10 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
274
273
  }, editCellStateRest);
275
274
  children = column.renderEditCell(params);
276
275
  classNames.push(gridClasses['cell--editing']);
277
- classNames.push(rootClasses == null ? void 0 : rootClasses['cell--editing']);
276
+ classNames.push(rootClasses?.['cell--editing']);
278
277
  }
279
278
  if (children === undefined) {
280
- const valueString = valueToRender == null ? void 0 : valueToRender.toString();
279
+ const valueString = valueToRender?.toString();
281
280
  children = valueString;
282
281
  title = valueString;
283
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
  })
@@ -29,7 +29,6 @@ const useUtilityClasses = ownerState => {
29
29
  return composeClasses(slots, getDataGridUtilityClass, classes);
30
30
  };
31
31
  function GridColumnGroupHeader(props) {
32
- var _columnGroupsLookup$g;
33
32
  const {
34
33
  groupId,
35
34
  width,
@@ -52,12 +51,12 @@ function GridColumnGroupHeader(props) {
52
51
  const columnGroupsLookup = useGridSelector(apiRef, gridColumnGroupsLookupSelector);
53
52
  const group = groupId ? columnGroupsLookup[groupId] : {};
54
53
  const {
55
- headerName = groupId != null ? groupId : '',
54
+ headerName = groupId ?? '',
56
55
  description = '',
57
56
  headerAlign = undefined
58
57
  } = group;
59
58
  let headerComponent;
60
- const render = groupId && ((_columnGroupsLookup$g = columnGroupsLookup[groupId]) == null ? void 0 : _columnGroupsLookup$g.renderHeaderGroup);
59
+ const render = groupId && columnGroupsLookup[groupId]?.renderHeaderGroup;
61
60
  const renderParams = React.useMemo(() => ({
62
61
  groupId,
63
62
  headerName,
@@ -81,7 +80,7 @@ function GridColumnGroupHeader(props) {
81
80
  depth,
82
81
  isDragging: false
83
82
  });
84
- const label = headerName != null ? headerName : groupId;
83
+ const label = headerName ?? groupId;
85
84
  const id = useId();
86
85
  const elementId = groupId === null ? `empty-group-cell-${id}` : groupId;
87
86
  const classes = useUtilityClasses(ownerState);
@@ -89,7 +88,7 @@ function GridColumnGroupHeader(props) {
89
88
  if (hasFocus) {
90
89
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
91
90
  const elementToFocus = focusableElement || headerCellRef.current;
92
- elementToFocus == null || elementToFocus.focus();
91
+ elementToFocus?.focus();
93
92
  }
94
93
  }, [apiRef, hasFocus]);
95
94
  const publish = React.useCallback(eventName => event => {
@@ -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,
@@ -38,7 +38,6 @@ const useUtilityClasses = ownerState => {
38
38
  return composeClasses(slots, getDataGridUtilityClass, classes);
39
39
  };
40
40
  function GridColumnHeaderItem(props) {
41
- var _rootProps$slotProps, _colDef$sortingOrder, _rootProps$slotProps2, _colDef$headerName;
42
41
  const {
43
42
  colDef,
44
43
  columnMenuOpen,
@@ -132,16 +131,16 @@ function GridColumnHeaderItem(props) {
132
131
  open: columnMenuOpen,
133
132
  target: iconButtonRef.current,
134
133
  ContentComponent: rootProps.slots.columnMenu,
135
- contentComponentProps: (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.columnMenu,
134
+ contentComponentProps: rootProps.slotProps?.columnMenu,
136
135
  onExited: handleExited
137
136
  });
138
- const sortingOrder = (_colDef$sortingOrder = colDef.sortingOrder) != null ? _colDef$sortingOrder : rootProps.sortingOrder;
137
+ const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;
139
138
  const showSortIcon = (colDef.sortable || sortDirection != null) && !colDef.hideSortIcons && !rootProps.disableColumnSorting;
140
139
  const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
141
140
  children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({
142
141
  field: colDef.field,
143
142
  counter: filterItemsCounter
144
- }, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.columnHeaderFilterIconButton)), showSortIcon && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
143
+ }, rootProps.slotProps?.columnHeaderFilterIconButton)), showSortIcon && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
145
144
  direction: sortDirection,
146
145
  index: sortIndex,
147
146
  sortingOrder: sortingOrder,
@@ -153,7 +152,7 @@ function GridColumnHeaderItem(props) {
153
152
  if (hasFocus && !columnMenuState.open) {
154
153
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
155
154
  const elementToFocus = focusableElement || headerCellRef.current;
156
- elementToFocus == null || elementToFocus.focus();
155
+ elementToFocus?.focus();
157
156
  apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
158
157
  }
159
158
  }, [apiRef, hasFocus]);
@@ -161,7 +160,7 @@ function GridColumnHeaderItem(props) {
161
160
  field: colDef.field,
162
161
  colDef
163
162
  }) : colDef.headerClassName;
164
- const label = (_colDef$headerName = colDef.headerName) != null ? _colDef$headerName : colDef.field;
163
+ const label = colDef.headerName ?? colDef.field;
165
164
  return /*#__PURE__*/_jsx(GridGenericColumnHeaderItem, _extends({
166
165
  ref: headerCellRef,
167
166
  classes: classes,
@@ -35,7 +35,6 @@ function getIcon(icons, direction, className, sortingOrder) {
35
35
  }, iconProps)) : null;
36
36
  }
37
37
  function GridColumnHeaderSortIconRaw(props) {
38
- var _rootProps$slotProps;
39
38
  const {
40
39
  direction,
41
40
  index,
@@ -58,7 +57,7 @@ function GridColumnHeaderSortIconRaw(props) {
58
57
  title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
59
58
  size: "small",
60
59
  disabled: disabled
61
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
60
+ }, rootProps.slotProps?.baseIconButton, {
62
61
  children: iconElement
63
62
  }));
64
63
  return /*#__PURE__*/_jsxs(GridIconButtonContainer, {
@@ -44,7 +44,6 @@ const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHead
44
44
  });
45
45
  // No React.memo here as if we display the sort icon, we need to recalculate the isOver
46
46
  function GridColumnHeaderTitle(props) {
47
- var _rootProps$slotProps;
48
47
  const {
49
48
  label,
50
49
  description
@@ -53,7 +52,7 @@ function GridColumnHeaderTitle(props) {
53
52
  const titleRef = React.useRef(null);
54
53
  const [tooltip, setTooltip] = React.useState('');
55
54
  const handleMouseOver = React.useCallback(() => {
56
- if (!description && titleRef != null && titleRef.current) {
55
+ if (!description && titleRef?.current) {
57
56
  const isOver = isOverflown(titleRef.current);
58
57
  if (isOver) {
59
58
  setTooltip(label);
@@ -64,7 +63,7 @@ function GridColumnHeaderTitle(props) {
64
63
  }, [description, label]);
65
64
  return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
66
65
  title: description || tooltip
67
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
66
+ }, rootProps.slotProps?.baseTooltip, {
68
67
  children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {
69
68
  onMouseOver: handleMouseOver,
70
69
  ref: titleRef,
@@ -55,7 +55,7 @@ const GridGenericColumnHeaderItem = /*#__PURE__*/React.forwardRef(function GridG
55
55
  if (hasFocus && !columnMenuState.open) {
56
56
  const focusableElement = headerCellRef.current.querySelector('[tabindex="0"]');
57
57
  const elementToFocus = focusableElement || headerCellRef.current;
58
- elementToFocus == null || elementToFocus.focus();
58
+ elementToFocus?.focus();
59
59
  apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
60
60
  }
61
61
  }, [apiRef, hasFocus]);
@@ -18,7 +18,6 @@ const useUtilityClasses = ownerState => {
18
18
  return composeClasses(slots, getDataGridUtilityClass, classes);
19
19
  };
20
20
  const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCellCheckboxRenderer(props, ref) {
21
- var _rootProps$slotProps;
22
21
  const {
23
22
  field,
24
23
  id,
@@ -54,9 +53,8 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
54
53
  }, [apiRef, tabIndex, id, field]);
55
54
  React.useEffect(() => {
56
55
  if (hasFocus) {
57
- var _checkboxElement$curr;
58
- const input = (_checkboxElement$curr = checkboxElement.current) == null ? void 0 : _checkboxElement$curr.querySelector('input');
59
- input == null || input.focus({
56
+ const input = checkboxElement.current?.querySelector('input');
57
+ input?.focus({
60
58
  preventScroll: true
61
59
  });
62
60
  } else if (rippleRef.current) {
@@ -88,7 +86,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
88
86
  onKeyDown: handleKeyDown,
89
87
  disabled: !isSelectable,
90
88
  touchRippleRef: rippleRef /* FIXME: typing error */
91
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox, other));
89
+ }, rootProps.slotProps?.baseCheckbox, other));
92
90
  });
93
91
  process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
94
92
  // ----------------------------- Warning --------------------------------
@@ -24,7 +24,6 @@ const useUtilityClasses = ownerState => {
24
24
  return composeClasses(slots, getDataGridUtilityClass, classes);
25
25
  };
26
26
  const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderCheckbox(props, ref) {
27
- var _rootProps$slotProps;
28
27
  const other = _objectWithoutPropertiesLoose(props, _excluded);
29
28
  const [, forceUpdate] = React.useState(false);
30
29
  const apiRef = useGridApiContext();
@@ -106,7 +105,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
106
105
  tabIndex: tabIndex,
107
106
  onKeyDown: handleKeyDown,
108
107
  disabled: !isMultipleRowSelectionEnabled(rootProps)
109
- }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseCheckbox, other));
108
+ }, rootProps.slotProps?.baseCheckbox, other));
110
109
  });
111
110
  process.env.NODE_ENV !== "production" ? GridHeaderCheckbox.propTypes = {
112
111
  // ----------------------------- Warning --------------------------------