@mui/x-data-grid 7.23.4 → 7.23.6

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 (83) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/DataGrid/useDataGridComponent.d.ts +1 -1
  3. package/components/cell/GridActionsCellItem.d.ts +3 -3
  4. package/components/cell/GridEditDateCell.js +1 -1
  5. package/components/cell/GridEditInputCell.js +1 -1
  6. package/components/cell/GridEditSingleSelectCell.js +2 -2
  7. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  8. package/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
  9. package/components/columnSelection/GridHeaderCheckbox.js +6 -2
  10. package/components/panel/GridPanel.d.ts +1 -1
  11. package/components/panel/filterPanel/GridFilterInputValue.js +7 -10
  12. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +1 -1
  13. package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +1 -1
  14. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
  15. package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  16. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
  17. package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  18. package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
  19. package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +1 -1
  20. package/hooks/core/useGridApiInitialization.d.ts +1 -1
  21. package/hooks/core/useGridApiInitialization.js +2 -2
  22. package/hooks/core/useGridInitialization.d.ts +1 -1
  23. package/hooks/core/useGridIsRtl.d.ts +1 -1
  24. package/hooks/core/useGridLocaleText.d.ts +1 -1
  25. package/hooks/core/useGridLoggerFactory.d.ts +1 -1
  26. package/hooks/core/useGridRefs.d.ts +1 -1
  27. package/hooks/core/useGridStateInitialization.d.ts +1 -1
  28. package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
  29. package/hooks/features/columnResize/useGridColumnResize.js +4 -4
  30. package/hooks/features/dimensions/useGridDimensions.js +1 -1
  31. package/hooks/features/editing/useGridRowEditing.js +1 -1
  32. package/hooks/features/export/useGridPrintExport.js +1 -1
  33. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  34. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  35. package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +1 -1
  36. package/hooks/features/rows/useGridRowsPreProcessors.d.ts +1 -1
  37. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
  38. package/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
  39. package/hooks/utils/useGridApiEventHandler.js +1 -1
  40. package/hooks/utils/useGridApiMethod.d.ts +1 -1
  41. package/hooks/utils/useGridApiRef.d.ts +1 -1
  42. package/hooks/utils/useGridInitializeState.d.ts +2 -2
  43. package/hooks/utils/useGridLogger.d.ts +1 -1
  44. package/hooks/utils/useGridVisibleRows.d.ts +2 -2
  45. package/index.js +1 -1
  46. package/models/api/gridCoreApi.d.ts +7 -7
  47. package/models/api/gridDensityApi.d.ts +1 -1
  48. package/models/props/DataGridProps.d.ts +1 -1
  49. package/modern/components/cell/GridEditDateCell.js +1 -1
  50. package/modern/components/cell/GridEditInputCell.js +1 -1
  51. package/modern/components/cell/GridEditSingleSelectCell.js +2 -2
  52. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
  53. package/modern/components/columnSelection/GridHeaderCheckbox.js +6 -2
  54. package/modern/components/panel/filterPanel/GridFilterInputValue.js +7 -10
  55. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  56. package/modern/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  57. package/modern/hooks/core/useGridApiInitialization.js +2 -2
  58. package/modern/hooks/features/columnResize/useGridColumnResize.js +4 -4
  59. package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
  60. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  61. package/modern/hooks/features/export/useGridPrintExport.js +1 -1
  62. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  63. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
  64. package/modern/hooks/utils/useGridApiEventHandler.js +1 -1
  65. package/modern/index.js +1 -1
  66. package/node/components/cell/GridEditDateCell.js +1 -1
  67. package/node/components/cell/GridEditInputCell.js +1 -1
  68. package/node/components/cell/GridEditSingleSelectCell.js +2 -2
  69. package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -1
  70. package/node/components/columnSelection/GridHeaderCheckbox.js +6 -2
  71. package/node/components/panel/filterPanel/GridFilterInputValue.js +7 -10
  72. package/node/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +1 -1
  73. package/node/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +1 -1
  74. package/node/hooks/core/useGridApiInitialization.js +2 -2
  75. package/node/hooks/features/columnResize/useGridColumnResize.js +4 -4
  76. package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
  77. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  78. package/node/hooks/features/export/useGridPrintExport.js +1 -1
  79. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +2 -2
  80. package/node/hooks/features/virtualization/useGridVirtualScroller.js +5 -1
  81. package/node/hooks/utils/useGridApiEventHandler.js +1 -1
  82. package/node/index.js +1 -1
  83. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,110 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.23.6
7
+
8
+ _Jan 9, 2025_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
13
+ - 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
14
+ - 🌍 Improve Dutch (nl-NL) locale on the Data Grid
15
+ - 🐞 Bugfixes
16
+
17
+ Special thanks go out to the community contributors who have helped make this release possible:
18
+ @josteinjhauge, @derek-0000, @nusr, @k-rajat19, @tomashauser.
19
+ Following are all team members who have contributed to this release:
20
+ @flaviendelangle, @LukasTy, @MBilalShafi, @arminmeh, @oliviertassinari, @cherniavskii.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@7.23.6`
27
+
28
+ - [DataGrid] Improve React 19 support (#16048) @LukasTy
29
+ - [DataGrid] Add `name` attribute to selection checkboxes (#16041) @derek-0000
30
+ - [DataGrid] Fix number filter field formatting values while typing (#16068) @arminmeh
31
+ - [DataGrid] Fix select all checkbox state reset with server side data (#16039) @MBilalShafi
32
+
33
+ #### `@mui/x-data-grid-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@7.23.6`.
36
+
37
+ #### `@mui/x-data-grid-premium@7.23.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
38
+
39
+ Same changes as in `@mui/x-data-grid-pro@7.23.6`.
40
+
41
+ ### Date and Time Pickers
42
+
43
+ #### `@mui/x-date-pickers@7.23.6`
44
+
45
+ - [pickers] Improve React 19 support (#16048) @LukasTy
46
+ - [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16057) @nusr
47
+ - [l10n] Improve Norwegian (nb-NO) locale (#16083) @josteinjhauge
48
+ - [pickers] Support `date-fns-jalali` v4 (#16013) @LukasTy
49
+
50
+ #### `@mui/x-date-pickers-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@7.23.6`.
53
+
54
+ ### Charts
55
+
56
+ #### `@mui/x-charts@7.23.6`
57
+
58
+ - [charts] Improve React 19 support (#16048) @LukasTy
59
+ - [charts] Fix 301 redirection in the API documentation @oliviertassinari
60
+
61
+ #### `@mui/x-charts-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
62
+
63
+ Same changes as in `@mui/x-charts@7.23.6`.
64
+
65
+ ### Tree View
66
+
67
+ #### `@mui/x-tree-view@7.23.6`
68
+
69
+ - [TreeView] Improve React 19 support (#16048) @LukasTy
70
+
71
+ #### `@mui/x-tree-view-pro@7.23.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
72
+
73
+ Same changes as in `@mui/x-tree-view@7.23.6`.
74
+
75
+ ### Docs
76
+
77
+ - [docs] Fix `EditingWithDatePickers` demo (#16047) @k-rajat19
78
+ - [docs] Fix doc warning for automatic children selection on tree view (#16037) @flaviendelangle
79
+ - [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16088) @tomashauser
80
+
81
+ ### Core
82
+
83
+ - [core] Clarify the release strategy (#16012) @MBilalShafi
84
+ - [core] Update the `release:version` docs (#16040) @cherniavskii
85
+
86
+ ## 7.23.5
87
+
88
+ _Dec 27, 2024_
89
+
90
+ Here are some highlights ✨:
91
+
92
+ - 🐞 Fix version mismatch issue in Data Grid codesandbox/stackblitz demos
93
+
94
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
95
+
96
+ ### Data Grid
97
+
98
+ #### `@mui/x-data-grid@7.23.5`
99
+
100
+ No changes since `@mui/x-data-grid@v7.23.4`.
101
+
102
+ #### `@mui/x-data-grid-pro@7.23.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
103
+
104
+ Same changes as in `@mui/x-data-grid@7.23.5`.
105
+
106
+ #### `@mui/x-data-grid-premium@7.23.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
107
+
108
+ Same changes as in `@mui/x-data-grid-pro@7.23.5`.
109
+
6
110
  ## v7.23.4
7
111
 
8
112
  _Dec 27, 2024_
@@ -1,3 +1,3 @@
1
1
  import { DataGridProcessedProps } from '../models/props/DataGridProps';
2
2
  import { GridApiCommunity, GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
3
- export declare const useDataGridComponent: (inputApiRef: React.MutableRefObject<GridApiCommunity> | undefined, props: DataGridProcessedProps) => import("react").MutableRefObject<GridPrivateApiCommunity>;
3
+ export declare const useDataGridComponent: (inputApiRef: React.RefObject<GridApiCommunity> | undefined, props: DataGridProcessedProps) => import("react").RefObject<GridPrivateApiCommunity>;
@@ -3,13 +3,13 @@ import { IconButtonProps } from '@mui/material/IconButton';
3
3
  import { MenuItemProps } from '@mui/material/MenuItem';
4
4
  interface GridActionsCellItemCommonProps {
5
5
  label: string;
6
- icon?: React.ReactElement;
6
+ icon?: React.ReactElement<any>;
7
7
  /** from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component */
8
8
  component?: React.ElementType;
9
9
  }
10
10
  export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
11
11
  showInMenu?: false;
12
- icon: React.ReactElement;
12
+ icon: React.ReactElement<any>;
13
13
  } & Omit<IconButtonProps, 'component'>) | ({
14
14
  showInMenu: true;
15
15
  /**
@@ -21,7 +21,7 @@ export type GridActionsCellItemProps = GridActionsCellItemCommonProps & (({
21
21
  } & Omit<MenuItemProps, 'component'>));
22
22
  declare const GridActionsCellItem: React.ForwardRefExoticComponent<GridActionsCellItemProps> | React.ForwardRefExoticComponent<(Omit<GridActionsCellItemCommonProps & {
23
23
  showInMenu?: false;
24
- icon: React.ReactElement;
24
+ icon: React.ReactElement<any>;
25
25
  } & Omit<IconButtonProps, "component">, "ref"> | Omit<GridActionsCellItemCommonProps & {
26
26
  showInMenu: true;
27
27
  /**
@@ -35,7 +35,7 @@ function GridEditDateCell(props) {
35
35
  other = _objectWithoutPropertiesLoose(props, _excluded);
36
36
  const isDateTime = colDef.type === 'dateTime';
37
37
  const apiRef = useGridApiContext();
38
- const inputRef = React.useRef();
38
+ const inputRef = React.useRef(null);
39
39
  const valueTransformed = React.useMemo(() => {
40
40
  let parsedDate;
41
41
  if (valueProp == null) {
@@ -47,7 +47,7 @@ const GridEditInputCell = forwardRef((props, ref) => {
47
47
  } = props,
48
48
  other = _objectWithoutPropertiesLoose(props, _excluded);
49
49
  const apiRef = useGridApiContext();
50
- const inputRef = React.useRef();
50
+ const inputRef = React.useRef(null);
51
51
  const [valueState, setValueState] = React.useState(value);
52
52
  const classes = useUtilityClasses(rootProps);
53
53
  const handleChange = React.useCallback(async event => {
@@ -30,8 +30,8 @@ function GridEditSingleSelectCell(props) {
30
30
  } = props,
31
31
  other = _objectWithoutPropertiesLoose(props, _excluded);
32
32
  const apiRef = useGridApiContext();
33
- const ref = React.useRef();
34
- const inputRef = React.useRef();
33
+ const ref = React.useRef(null);
34
+ const inputRef = React.useRef(null);
35
35
  const [open, setOpen] = React.useState(initialOpen);
36
36
  const baseSelectProps = rootProps.slotProps?.baseSelect || {};
37
37
  const isSelectNative = baseSelectProps.native ?? false;
@@ -5,6 +5,6 @@ export interface ColumnHeaderMenuIconProps {
5
5
  columnMenuId: string;
6
6
  columnMenuButtonId: string;
7
7
  open: boolean;
8
- iconButtonRef: React.RefObject<HTMLButtonElement>;
8
+ iconButtonRef: React.RefObject<HTMLButtonElement | null>;
9
9
  }
10
10
  export declare const ColumnHeaderMenuIcon: React.MemoExoticComponent<(props: ColumnHeaderMenuIconProps) => React.JSX.Element>;
@@ -88,7 +88,8 @@ const GridCellCheckboxForwardRef = forwardRef(function GridCellCheckboxRenderer(
88
88
  onChange: handleChange,
89
89
  className: classes.root,
90
90
  inputProps: {
91
- 'aria-label': label
91
+ 'aria-label': label,
92
+ name: 'select_row'
92
93
  },
93
94
  onKeyDown: handleKeyDown,
94
95
  indeterminate: isIndeterminate,
@@ -42,13 +42,16 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
42
42
  return selection;
43
43
  }
44
44
  return selection.filter(id => {
45
+ if (rootProps.keepNonExistentRowsSelected) {
46
+ return true;
47
+ }
45
48
  // The row might have been deleted
46
49
  if (!apiRef.current.getRow(id)) {
47
50
  return false;
48
51
  }
49
52
  return rootProps.isRowSelectable(apiRef.current.getRowParams(id));
50
53
  });
51
- }, [apiRef, rootProps.isRowSelectable, selection]);
54
+ }, [apiRef, rootProps.isRowSelectable, selection, rootProps.keepNonExistentRowsSelected]);
52
55
 
53
56
  // All the rows that could be selected / unselected by toggling this checkbox
54
57
  const selectionCandidates = React.useMemo(() => {
@@ -101,7 +104,8 @@ const GridHeaderCheckbox = forwardRef(function GridHeaderCheckbox(props, ref) {
101
104
  onChange: handleChange,
102
105
  className: classes.root,
103
106
  inputProps: {
104
- 'aria-label': label
107
+ 'aria-label': label,
108
+ name: 'select_all_rows'
105
109
  },
106
110
  tabIndex: tabIndex,
107
111
  onKeyDown: handleKeyDown,
@@ -16,7 +16,7 @@ export interface GridPanelProps extends Partial<React.ComponentProps<typeof Grid
16
16
  open: boolean;
17
17
  }
18
18
  export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
19
- declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
19
+ declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "id" | "children" | "tabIndex" | "color" | "content" | "translate" | "container" | "transition" | "slot" | "style" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "lang" | "nonce" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "components" | "componentsProps" | "slotProps" | "slots" | "open" | "component" | "disablePortal" | "anchorEl" | "keepMounted" | "modifiers" | "placement" | "popperOptions" | "popperRef"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
20
20
  ownerState: OwnerState;
21
21
  }, {}, {}>;
22
22
  declare const GridPanel: React.ForwardRefExoticComponent<GridPanelProps> | React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -22,17 +22,17 @@ function GridFilterInputValue(props) {
22
22
  } = props,
23
23
  others = _objectWithoutPropertiesLoose(props, _excluded);
24
24
  const filterTimeout = useTimeout();
25
- const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value, type));
25
+ const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value));
26
26
  const [applying, setIsApplying] = React.useState(false);
27
27
  const id = useId();
28
28
  const rootProps = useGridRootProps();
29
29
  const onFilterChange = React.useCallback(event => {
30
- const value = sanitizeFilterItemValue(event.target.value, type);
30
+ const value = sanitizeFilterItemValue(event.target.value);
31
31
  setFilterValueState(value);
32
32
  setIsApplying(true);
33
33
  filterTimeout.start(rootProps.filterDebounceMs, () => {
34
34
  const newItem = _extends({}, item, {
35
- value,
35
+ value: type === 'number' && !Number.isNaN(Number(value)) ? Number(value) : value,
36
36
  fromInput: id
37
37
  });
38
38
  applyValue(newItem);
@@ -42,14 +42,14 @@ function GridFilterInputValue(props) {
42
42
  React.useEffect(() => {
43
43
  const itemPlusTag = item;
44
44
  if (itemPlusTag.fromInput !== id || item.value == null) {
45
- setFilterValueState(sanitizeFilterItemValue(item.value, type));
45
+ setFilterValueState(sanitizeFilterItemValue(item.value));
46
46
  }
47
- }, [id, item, type]);
47
+ }, [id, item]);
48
48
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
49
49
  id: id,
50
50
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
51
51
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
52
- value: filterValueState === undefined ? '' : String(filterValueState),
52
+ value: filterValueState ?? '',
53
53
  onChange: onFilterChange,
54
54
  variant: variant,
55
55
  type: type || 'text',
@@ -71,13 +71,10 @@ function GridFilterInputValue(props) {
71
71
  inputRef: focusElementRef
72
72
  }, others, rootProps.slotProps?.baseTextField));
73
73
  }
74
- function sanitizeFilterItemValue(value, type) {
74
+ function sanitizeFilterItemValue(value) {
75
75
  if (value == null || value === '') {
76
76
  return undefined;
77
77
  }
78
- if (type === 'number') {
79
- return Number(value);
80
- }
81
78
  return String(value);
82
79
  }
83
80
  process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
@@ -29,7 +29,7 @@ export interface GridPipeProcessingLookup {
29
29
  };
30
30
  exportMenu: {
31
31
  value: {
32
- component: React.ReactElement;
32
+ component: React.ReactElement<any>;
33
33
  componentName: string;
34
34
  }[];
35
35
  context: any;
@@ -29,4 +29,4 @@ import { GridPrivateApiCommon } from '../../../models/api/gridApiCommon';
29
29
  * * a processor is registered.
30
30
  * * `apiRef.current.requestPipeProcessorsApplication` is called for the given group.
31
31
  */
32
- export declare const useGridPipeProcessing: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
32
+ export declare const useGridPipeProcessing: (apiRef: React.RefObject<GridPrivateApiCommon>) => void;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../../models/api/gridApiCommon';
3
3
  import { GridPipeProcessorGroup } from './gridPipeProcessingApi';
4
- export declare const useGridRegisterPipeApplier: <PrivateApi extends GridPrivateApiCommon, G extends GridPipeProcessorGroup>(apiRef: React.MutableRefObject<PrivateApi>, group: G, callback: () => void) => void;
4
+ export declare const useGridRegisterPipeApplier: <PrivateApi extends GridPrivateApiCommon, G extends GridPipeProcessorGroup>(apiRef: React.RefObject<PrivateApi>, group: G, callback: () => void) => void;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useFirstRender } from "../../utils/useFirstRender.js";
3
3
  export const useGridRegisterPipeApplier = (apiRef, group, callback) => {
4
- const cleanup = React.useRef();
4
+ const cleanup = React.useRef(null);
5
5
  const id = React.useRef(`mui-${Math.round(Math.random() * 1e9)}`);
6
6
  const registerPreProcessor = React.useCallback(() => {
7
7
  cleanup.current = apiRef.current.registerPipeApplier(group, id.current, callback);
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../../models/api/gridApiCommon';
3
3
  import { GridPipeProcessorGroup, GridPipeProcessor } from './gridPipeProcessingApi';
4
- export declare const useGridRegisterPipeProcessor: <PrivateApi extends GridPrivateApiCommon, G extends GridPipeProcessorGroup>(apiRef: React.MutableRefObject<PrivateApi>, group: G, callback: GridPipeProcessor<G>) => void;
4
+ export declare const useGridRegisterPipeProcessor: <PrivateApi extends GridPrivateApiCommon, G extends GridPipeProcessorGroup>(apiRef: React.RefObject<PrivateApi>, group: G, callback: GridPipeProcessor<G>) => void;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useFirstRender } from "../../utils/useFirstRender.js";
3
3
  export const useGridRegisterPipeProcessor = (apiRef, group, callback) => {
4
- const cleanup = React.useRef();
4
+ const cleanup = React.useRef(null);
5
5
  const id = React.useRef(`mui-${Math.round(Math.random() * 1e9)}`);
6
6
  const registerPreProcessor = React.useCallback(() => {
7
7
  cleanup.current = apiRef.current.registerPipeProcessor(group, id.current, callback);
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../../models/api/gridApiCommon';
3
3
  import { GridStrategyProcessorName, GridStrategyProcessor } from './gridStrategyProcessingApi';
4
- export declare const useGridRegisterStrategyProcessor: <Api extends GridPrivateApiCommon, G extends GridStrategyProcessorName>(apiRef: React.MutableRefObject<Api>, strategyName: string, group: G, processor: GridStrategyProcessor<G>) => void;
4
+ export declare const useGridRegisterStrategyProcessor: <Api extends GridPrivateApiCommon, G extends GridStrategyProcessorName>(apiRef: React.RefObject<Api>, strategyName: string, group: G, processor: GridStrategyProcessor<G>) => void;
@@ -45,4 +45,4 @@ export declare const GRID_STRATEGIES_PROCESSORS: {
45
45
  * - sorting algorithm.
46
46
  * - filtering algorithm.
47
47
  */
48
- export declare const useGridStrategyProcessing: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
48
+ export declare const useGridStrategyProcessing: (apiRef: React.RefObject<GridPrivateApiCommon>) => void;
@@ -2,4 +2,4 @@ import * as React from 'react';
2
2
  import { DataGridProcessedProps } from '../../models/props/DataGridProps';
3
3
  import type { GridApiCommon, GridPrivateApiCommon } from '../../models/api/gridApiCommon';
4
4
  export declare function unwrapPrivateAPI<PrivateApi extends GridPrivateApiCommon, Api extends GridApiCommon>(publicApi: Api): PrivateApi;
5
- export declare function useGridApiInitialization<PrivateApi extends GridPrivateApiCommon, Api extends GridApiCommon>(inputApiRef: React.MutableRefObject<Api> | undefined, props: Pick<DataGridProcessedProps, 'signature'>): React.MutableRefObject<PrivateApi>;
5
+ export declare function useGridApiInitialization<PrivateApi extends GridPrivateApiCommon, Api extends GridApiCommon>(inputApiRef: React.RefObject<Api> | undefined, props: Pick<DataGridProcessedProps, 'signature'>): React.RefObject<PrivateApi>;
@@ -68,8 +68,8 @@ function createPublicAPI(privateApiRef) {
68
68
  return publicApi;
69
69
  }
70
70
  export function useGridApiInitialization(inputApiRef, props) {
71
- const publicApiRef = React.useRef();
72
- const privateApiRef = React.useRef();
71
+ const publicApiRef = React.useRef(null);
72
+ const privateApiRef = React.useRef(null);
73
73
  if (!privateApiRef.current) {
74
74
  privateApiRef.current = createPrivateAPI(publicApiRef);
75
75
  }
@@ -4,4 +4,4 @@ import { DataGridProcessedProps } from '../../models/props/DataGridProps';
4
4
  /**
5
5
  * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs
6
6
  */
7
- export declare const useGridInitialization: <PrivateApi extends GridPrivateApiCommon, Api extends GridApiCommon>(inputApiRef: React.MutableRefObject<Api> | undefined, props: DataGridProcessedProps) => React.MutableRefObject<PrivateApi>;
7
+ export declare const useGridInitialization: <PrivateApi extends GridPrivateApiCommon, Api extends GridApiCommon>(inputApiRef: React.RefObject<Api> | undefined, props: DataGridProcessedProps) => React.RefObject<PrivateApi>;
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
- export declare const useGridIsRtl: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
3
+ export declare const useGridIsRtl: (apiRef: React.RefObject<GridPrivateApiCommon>) => void;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
3
  import { DataGridProcessedProps } from '../../models/props/DataGridProps';
4
- export declare const useGridLocaleText: (apiRef: React.MutableRefObject<GridPrivateApiCommon>, props: Pick<DataGridProcessedProps, "localeText">) => void;
4
+ export declare const useGridLocaleText: (apiRef: React.RefObject<GridPrivateApiCommon>, props: Pick<DataGridProcessedProps, "localeText">) => void;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
3
  import { DataGridProcessedProps } from '../../models/props/DataGridProps';
4
- export declare const useGridLoggerFactory: (apiRef: React.MutableRefObject<GridPrivateApiCommon>, props: Pick<DataGridProcessedProps, "logger" | "logLevel">) => void;
4
+ export declare const useGridLoggerFactory: (apiRef: React.RefObject<GridPrivateApiCommon>, props: Pick<DataGridProcessedProps, "logger" | "logLevel">) => void;
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import type { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
- export declare const useGridRefs: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.MutableRefObject<PrivateApi>) => void;
3
+ export declare const useGridRefs: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.RefObject<PrivateApi>) => void;
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import type { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
- export declare const useGridStateInitialization: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.MutableRefObject<PrivateApi>) => void;
3
+ export declare const useGridStateInitialization: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.RefObject<PrivateApi>) => void;
@@ -7,4 +7,4 @@ export declare const columnResizeStateInitializer: GridStateInitializer;
7
7
  * @requires useGridColumns (method, event)
8
8
  * TODO: improve experience for last column
9
9
  */
10
- export declare const useGridColumnResize: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "autosizeOptions" | "autosizeOnMount" | "disableAutosize" | "onColumnResize" | "onColumnWidthChange" | "disableVirtualization">) => void;
10
+ export declare const useGridColumnResize: (apiRef: React.RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "autosizeOptions" | "autosizeOnMount" | "disableAutosize" | "onColumnResize" | "onColumnWidthChange" | "disableVirtualization">) => void;
@@ -70,7 +70,7 @@ function preventClick(event) {
70
70
  * is disabled.
71
71
  */
72
72
  function useColumnVirtualizationDisabled(apiRef) {
73
- const promise = React.useRef();
73
+ const promise = React.useRef(undefined);
74
74
  const selector = () => gridVirtualizationColumnEnabledSelector(apiRef);
75
75
  const value = useGridSelector(apiRef, selector);
76
76
  React.useEffect(() => {
@@ -184,10 +184,10 @@ export const useGridColumnResize = (apiRef, props) => {
184
184
  // To improve accessibility, the separator has padding on both sides.
185
185
  // Clicking inside the padding area should be treated as a click in the separator.
186
186
  // This ref stores the offset between the click and the separator.
187
- const initialOffsetToSeparator = React.useRef();
188
- const resizeDirection = React.useRef();
187
+ const initialOffsetToSeparator = React.useRef(null);
188
+ const resizeDirection = React.useRef(null);
189
189
  const stopResizeEventTimeout = useTimeout();
190
- const touchId = React.useRef();
190
+ const touchId = React.useRef(undefined);
191
191
  const updateWidth = newWidth => {
192
192
  logger.debug(`Updating width to ${newWidth} for col ${refs.colDef.field}`);
193
193
  const prevWidth = refs.columnHeaderElement.offsetWidth;
@@ -67,7 +67,7 @@ export function useGridDimensions(apiRef, props) {
67
67
  const [savedSize, setSavedSize] = React.useState();
68
68
  const debouncedSetSavedSize = React.useMemo(() => throttle(setSavedSize, props.resizeThrottleMs), [props.resizeThrottleMs]);
69
69
  React.useEffect(() => debouncedSetSavedSize.clear, [debouncedSetSavedSize]);
70
- const previousSize = React.useRef();
70
+ const previousSize = React.useRef(undefined);
71
71
  const getRootDimensions = () => apiRef.current.state.dimensions;
72
72
  const setDimensions = useEventCallback(dimensions => {
73
73
  apiRef.current.setState(state => _extends({}, state, {
@@ -21,7 +21,7 @@ export const useGridRowEditing = (apiRef, props) => {
21
21
  const [rowModesModel, setRowModesModel] = React.useState({});
22
22
  const rowModesModelRef = React.useRef(rowModesModel);
23
23
  const prevRowModesModel = React.useRef({});
24
- const focusTimeout = React.useRef();
24
+ const focusTimeout = React.useRef(undefined);
25
25
  const nextFocusedCell = React.useRef(null);
26
26
  const {
27
27
  processRowUpdate,
@@ -44,7 +44,7 @@ export const useGridPrintExport = (apiRef, props) => {
44
44
  const previousGridState = React.useRef(null);
45
45
  const previousColumnVisibility = React.useRef({});
46
46
  const previousRows = React.useRef([]);
47
- const previousVirtualizationState = React.useRef();
47
+ const previousVirtualizationState = React.useRef(null);
48
48
  React.useEffect(() => {
49
49
  doc.current = ownerDocument(apiRef.current.rootElementRef.current);
50
50
  }, [apiRef, hasRootReference]);
@@ -10,4 +10,4 @@ import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
10
10
  * @requires useGridScroll (method) - can be after
11
11
  * @requires useGridColumnSpanning (method) - can be after
12
12
  */
13
- export declare const useGridKeyboardNavigation: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "experimentalFeatures" | "signature" | "headerFilters" | "unstable_listView">) => void;
13
+ export declare const useGridKeyboardNavigation: (apiRef: React.RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "pagination" | "paginationMode" | "getRowId" | "experimentalFeatures" | "signature" | "headerFilters" | "unstable_listView">) => void;
@@ -15,8 +15,8 @@ export const preferencePanelStateInitializer = (state, props) => _extends({}, st
15
15
  */
16
16
  export const useGridPreferencesPanel = (apiRef, props) => {
17
17
  const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
18
- const hideTimeout = React.useRef();
19
- const immediateTimeout = React.useRef();
18
+ const hideTimeout = React.useRef(undefined);
19
+ const immediateTimeout = React.useRef(undefined);
20
20
 
21
21
  /**
22
22
  * API METHODS
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
3
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
4
- export declare const useGridRowSelectionPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
4
+ export declare const useGridRowSelectionPreProcessors: (apiRef: React.RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps) => void;
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
- export declare const useGridRowsPreProcessors: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>) => void;
3
+ export declare const useGridRowsPreProcessors: (apiRef: React.RefObject<GridPrivateApiCommunity>) => void;
@@ -15,7 +15,7 @@ export declare const useGridVirtualScroller: () => {
15
15
  ref: (node: HTMLDivElement | null) => (() => void) | undefined;
16
16
  };
17
17
  getScrollerProps: () => {
18
- ref: React.RefObject<HTMLDivElement>;
18
+ ref: React.RefObject<HTMLDivElement | null>;
19
19
  onScroll: (event: React.UIEvent) => void;
20
20
  onWheel: (event: React.WheelEvent) => void;
21
21
  onTouchMove: (event: React.TouchEvent) => void;
@@ -31,11 +31,11 @@ export declare const useGridVirtualScroller: () => {
31
31
  role: string;
32
32
  };
33
33
  getScrollbarVerticalProps: () => {
34
- ref: React.RefObject<HTMLDivElement>;
34
+ ref: React.RefObject<HTMLDivElement | null>;
35
35
  role: string;
36
36
  };
37
37
  getScrollbarHorizontalProps: () => {
38
- ref: React.RefObject<HTMLDivElement>;
38
+ ref: React.RefObject<HTMLDivElement | null>;
39
39
  role: string;
40
40
  };
41
41
  };
@@ -86,6 +86,7 @@ export const useGridVirtualScroller = () => {
86
86
  const contentHeight = dimensions.contentSize.height;
87
87
  const columnsTotalWidth = dimensions.columnsTotalWidth;
88
88
  const hasColSpan = useGridSelector(apiRef, gridHasColSpanSelector);
89
+ const previousSize = React.useRef(null);
89
90
  const mainRefCallback = React.useCallback(node => {
90
91
  mainRef.current = node;
91
92
  if (!node) {
@@ -93,7 +94,10 @@ export const useGridVirtualScroller = () => {
93
94
  }
94
95
  const initialRect = node.getBoundingClientRect();
95
96
  let lastSize = roundDimensions(initialRect);
96
- apiRef.current.publishEvent('resize', lastSize);
97
+ if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
98
+ previousSize.current = lastSize;
99
+ apiRef.current.publishEvent('resize', lastSize);
100
+ }
97
101
  if (typeof ResizeObserver === 'undefined') {
98
102
  return undefined;
99
103
  }
@@ -24,7 +24,7 @@ export function createUseGridApiEventHandler(registryContainer) {
24
24
  }
25
25
  const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());
26
26
  const subscription = React.useRef(null);
27
- const handlerRef = React.useRef();
27
+ const handlerRef = React.useRef(null);
28
28
  handlerRef.current = handler;
29
29
  const cleanupTokenRef = React.useRef(null);
30
30
  if (!subscription.current && handlerRef.current) {
@@ -3,5 +3,5 @@ import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
3
  type GetPublicApiType<PrivateApi> = PrivateApi extends {
4
4
  getPublicApi: () => infer PublicApi;
5
5
  } ? PublicApi : never;
6
- export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: React.MutableRefObject<PrivateApi>, apiMethods: T, visibility: V): void;
6
+ export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: React.RefObject<PrivateApi>, apiMethods: T, visibility: V): void;
7
7
  export {};
@@ -4,4 +4,4 @@ import { GridApiCommunity } from '../../models/api/gridApiCommunity';
4
4
  /**
5
5
  * Hook that instantiate a [[GridApiRef]].
6
6
  */
7
- export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => React.MutableRefObject<Api>;
7
+ export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => React.RefObject<Api>;