@mui/x-data-grid 5.15.0 → 5.15.3

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 (137) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/DataGrid/DataGrid.js +2 -2
  3. package/README.md +2 -1
  4. package/components/ErrorBoundary.d.ts +1 -0
  5. package/components/GridAutoSizer.js +7 -0
  6. package/components/base/GridOverlays.js +1 -4
  7. package/components/cell/GridActionsCellItem.d.ts +2 -2
  8. package/components/cell/GridEditDateCell.js +1 -1
  9. package/components/cell/GridEditInputCell.d.ts +2 -5
  10. package/components/cell/GridEditInputCell.js +13 -14
  11. package/components/cell/GridEditSingleSelectCell.d.ts +4 -0
  12. package/components/cell/GridEditSingleSelectCell.js +20 -5
  13. package/components/containers/GridOverlay.js +7 -1
  14. package/components/menu/GridMenu.d.ts +3 -2
  15. package/components/menu/GridMenu.js +1 -0
  16. package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
  17. package/components/panel/GridPanel.d.ts +1 -1
  18. package/components/panel/GridPanel.js +1 -0
  19. package/components/panel/filterPanel/GridFilterForm.d.ts +4 -0
  20. package/components/panel/filterPanel/GridFilterForm.js +5 -0
  21. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +1 -1
  22. package/components/panel/filterPanel/GridFilterPanel.d.ts +4 -0
  23. package/components/panel/filterPanel/GridFilterPanel.js +5 -0
  24. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  25. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  26. package/components/toolbar/GridToolbarDensitySelector.js +13 -4
  27. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  28. package/components/toolbar/GridToolbarExportContainer.js +13 -2
  29. package/constants/envConstants.d.ts +1 -1
  30. package/constants/envConstants.js +2 -11
  31. package/hooks/features/editRows/useGridCellEditing.new.js +20 -13
  32. package/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  33. package/hooks/features/editRows/useGridRowEditing.new.js +14 -8
  34. package/hooks/features/filter/gridFilterState.d.ts +12 -1
  35. package/hooks/features/filter/gridFilterUtils.d.ts +8 -5
  36. package/hooks/features/filter/gridFilterUtils.js +74 -43
  37. package/hooks/features/filter/useGridFilter.js +16 -3
  38. package/hooks/features/focus/useGridFocus.js +11 -6
  39. package/hooks/features/rows/useGridRows.js +5 -2
  40. package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +3 -0
  41. package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
  42. package/hooks/utils/useGridNativeEventListener.js +2 -2
  43. package/index.js +1 -1
  44. package/internals/index.d.ts +1 -0
  45. package/internals/index.js +1 -0
  46. package/legacy/DataGrid/DataGrid.js +2 -2
  47. package/legacy/components/GridAutoSizer.js +7 -0
  48. package/legacy/components/base/GridOverlays.js +1 -4
  49. package/legacy/components/cell/GridEditDateCell.js +1 -1
  50. package/legacy/components/cell/GridEditInputCell.js +13 -14
  51. package/legacy/components/cell/GridEditSingleSelectCell.js +20 -4
  52. package/legacy/components/containers/GridOverlay.js +7 -1
  53. package/legacy/components/menu/GridMenu.js +1 -0
  54. package/legacy/components/panel/GridPanel.js +1 -0
  55. package/legacy/components/panel/filterPanel/GridFilterForm.js +5 -0
  56. package/legacy/components/panel/filterPanel/GridFilterPanel.js +5 -0
  57. package/legacy/components/toolbar/GridToolbarDensitySelector.js +14 -5
  58. package/legacy/components/toolbar/GridToolbarExportContainer.js +15 -2
  59. package/legacy/constants/envConstants.js +2 -11
  60. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +21 -14
  61. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  62. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +14 -8
  63. package/legacy/hooks/features/filter/gridFilterUtils.js +84 -55
  64. package/legacy/hooks/features/filter/useGridFilter.js +16 -3
  65. package/legacy/hooks/features/focus/useGridFocus.js +11 -6
  66. package/legacy/hooks/features/rows/useGridRows.js +5 -2
  67. package/legacy/hooks/utils/useGridNativeEventListener.js +2 -2
  68. package/legacy/index.js +1 -1
  69. package/legacy/internals/index.js +1 -0
  70. package/legacy/locales/deDE.js +8 -8
  71. package/legacy/locales/itIT.js +15 -15
  72. package/legacy/locales/koKR.js +34 -30
  73. package/legacy/utils/keyboardUtils.js +8 -5
  74. package/locales/deDE.js +8 -8
  75. package/locales/itIT.js +15 -15
  76. package/locales/koKR.js +30 -30
  77. package/models/params/gridMenuParams.d.ts +1 -2
  78. package/models/props/DataGridProps.d.ts +4 -4
  79. package/modern/DataGrid/DataGrid.js +2 -2
  80. package/modern/components/GridAutoSizer.js +7 -0
  81. package/modern/components/base/GridOverlays.js +1 -4
  82. package/modern/components/cell/GridEditDateCell.js +1 -1
  83. package/modern/components/cell/GridEditInputCell.js +13 -14
  84. package/modern/components/cell/GridEditSingleSelectCell.js +20 -5
  85. package/modern/components/containers/GridOverlay.js +7 -1
  86. package/modern/components/menu/GridMenu.js +1 -0
  87. package/modern/components/panel/GridPanel.js +1 -0
  88. package/modern/components/panel/filterPanel/GridFilterForm.js +5 -0
  89. package/modern/components/panel/filterPanel/GridFilterPanel.js +5 -0
  90. package/modern/components/toolbar/GridToolbarDensitySelector.js +11 -4
  91. package/modern/components/toolbar/GridToolbarExportContainer.js +11 -2
  92. package/modern/constants/envConstants.js +2 -11
  93. package/modern/hooks/features/editRows/useGridCellEditing.new.js +20 -13
  94. package/modern/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  95. package/modern/hooks/features/editRows/useGridRowEditing.new.js +14 -8
  96. package/modern/hooks/features/filter/gridFilterUtils.js +73 -42
  97. package/modern/hooks/features/filter/useGridFilter.js +16 -3
  98. package/modern/hooks/features/focus/useGridFocus.js +11 -6
  99. package/modern/hooks/features/rows/useGridRows.js +5 -2
  100. package/modern/hooks/utils/useGridNativeEventListener.js +2 -2
  101. package/modern/index.js +1 -1
  102. package/modern/internals/index.js +1 -0
  103. package/modern/locales/deDE.js +8 -8
  104. package/modern/locales/itIT.js +15 -15
  105. package/modern/locales/koKR.js +30 -30
  106. package/modern/utils/keyboardUtils.js +7 -2
  107. package/node/DataGrid/DataGrid.js +2 -2
  108. package/node/components/GridAutoSizer.js +7 -0
  109. package/node/components/base/GridOverlays.js +1 -4
  110. package/node/components/cell/GridEditDateCell.js +1 -1
  111. package/node/components/cell/GridEditInputCell.js +15 -16
  112. package/node/components/cell/GridEditSingleSelectCell.js +19 -5
  113. package/node/components/containers/GridOverlay.js +7 -1
  114. package/node/components/menu/GridMenu.js +1 -0
  115. package/node/components/panel/GridPanel.js +1 -0
  116. package/node/components/panel/filterPanel/GridFilterForm.js +5 -0
  117. package/node/components/panel/filterPanel/GridFilterPanel.js +5 -0
  118. package/node/components/toolbar/GridToolbarDensitySelector.js +13 -4
  119. package/node/components/toolbar/GridToolbarExportContainer.js +13 -2
  120. package/node/constants/envConstants.js +2 -13
  121. package/node/hooks/features/editRows/useGridCellEditing.new.js +20 -13
  122. package/node/hooks/features/editRows/useGridCellEditing.old.js +2 -2
  123. package/node/hooks/features/editRows/useGridRowEditing.new.js +14 -8
  124. package/node/hooks/features/filter/gridFilterUtils.js +81 -47
  125. package/node/hooks/features/filter/useGridFilter.js +15 -2
  126. package/node/hooks/features/focus/useGridFocus.js +11 -6
  127. package/node/hooks/features/rows/useGridRows.js +5 -2
  128. package/node/hooks/utils/useGridNativeEventListener.js +2 -2
  129. package/node/index.js +1 -1
  130. package/node/internals/index.js +8 -0
  131. package/node/locales/deDE.js +8 -8
  132. package/node/locales/itIT.js +15 -15
  133. package/node/locales/koKR.js +30 -30
  134. package/node/utils/keyboardUtils.js +10 -4
  135. package/package.json +1 -1
  136. package/utils/keyboardUtils.d.ts +2 -2
  137. package/utils/keyboardUtils.js +7 -2
@@ -3,7 +3,7 @@ import { AutocompleteProps } from '@mui/material/Autocomplete';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export declare type GridFilterInputMultipleValueProps = {
5
5
  type?: 'text' | 'number';
6
- } & GridFilterInputValueProps & Omit<AutocompleteProps<any[], true, false, true>, 'options' | 'renderInput'>;
6
+ } & GridFilterInputValueProps & Omit<AutocompleteProps<string, true, false, true>, 'options' | 'renderInput'>;
7
7
  declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): JSX.Element;
8
8
  declare namespace GridFilterInputMultipleValue {
9
9
  var propTypes: any;
@@ -10,6 +10,10 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'linkOpe
10
10
  * Props passed to each filter form.
11
11
  */
12
12
  filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'linkOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps'>;
13
+ /**
14
+ * @ignore - do not document.
15
+ */
16
+ children?: React.ReactNode;
13
17
  }
14
18
  declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
15
19
  export { GridFilterPanel };
@@ -126,6 +126,11 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
126
126
  // | To update them edit the TypeScript types and run "yarn proptypes" |
127
127
  // ----------------------------------------------------------------------
128
128
 
129
+ /**
130
+ * @ignore - do not document.
131
+ */
132
+ children: PropTypes.node,
133
+
129
134
  /**
130
135
  * Changes how the options in the columns selector should be ordered.
131
136
  * If not specified, the order is derived from the `columns` prop.
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonProps } from '@mui/material/Button';
3
- export declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "children" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
3
+ export declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonProps } from '@mui/material/Button';
3
- export declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "children" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
3
+ export declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
@@ -59,11 +59,20 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
59
59
  }, [densityValue, rootProps]);
60
60
 
61
61
  const handleDensitySelectorOpen = event => {
62
- setOpen(true);
62
+ setOpen(prevOpen => !prevOpen);
63
63
  onClick == null ? void 0 : onClick(event);
64
64
  };
65
65
 
66
- const handleDensitySelectorClose = () => setOpen(false);
66
+ const handleDensitySelectorClickAway = event => {
67
+ var _buttonRef$current;
68
+
69
+ if (buttonRef.current === event.target || // if user clicked on the icon
70
+ (_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
71
+ return;
72
+ }
73
+
74
+ setOpen(false);
75
+ };
67
76
 
68
77
  const handleDensityUpdate = newDensity => {
69
78
  apiRef.current.setDensity(newDensity);
@@ -76,7 +85,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
76
85
  }
77
86
 
78
87
  if (isHideMenuKey(event.key)) {
79
- handleDensitySelectorClose();
88
+ setOpen(false);
80
89
  }
81
90
  }; // Disable the button if the corresponding is disabled
82
91
 
@@ -109,7 +118,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
109
118
  })), /*#__PURE__*/_jsx(GridMenu, {
110
119
  open: open,
111
120
  target: buttonRef.current,
112
- onClickAway: handleDensitySelectorClose,
121
+ onClickAway: handleDensitySelectorClickAway,
113
122
  position: "bottom-start",
114
123
  children: /*#__PURE__*/_jsx(MenuList, {
115
124
  id: densityMenuId,
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonProps } from '@mui/material/Button';
3
- export declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "children" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
3
+ export declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "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" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
@@ -29,7 +29,7 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
29
29
  const handleRef = useForkRef(ref, buttonRef);
30
30
 
31
31
  const handleMenuOpen = event => {
32
- setOpen(true);
32
+ setOpen(prevOpen => !prevOpen);
33
33
  onClick == null ? void 0 : onClick(event);
34
34
  };
35
35
 
@@ -45,6 +45,17 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
45
45
  }
46
46
  };
47
47
 
48
+ const handleMenuClickAway = event => {
49
+ var _buttonRef$current;
50
+
51
+ if (buttonRef.current === event.target || // if user clicked on the icon
52
+ (_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
53
+ return;
54
+ }
55
+
56
+ setOpen(false);
57
+ };
58
+
48
59
  if (children == null) {
49
60
  return null;
50
61
  }
@@ -66,7 +77,7 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
66
77
  })), /*#__PURE__*/_jsx(GridMenu, {
67
78
  open: open,
68
79
  target: buttonRef.current,
69
- onClickAway: handleMenuClose,
80
+ onClickAway: handleMenuClickAway,
70
81
  position: "bottom-start",
71
82
  children: /*#__PURE__*/_jsx(MenuList, {
72
83
  id: menuId,
@@ -1 +1 @@
1
- export declare const GRID_EXPERIMENTAL_ENABLED: boolean;
1
+ export declare const GRID_EXPERIMENTAL_ENABLED = false;
@@ -1,4 +1,4 @@
1
- import { localStorageAvailable } from '../utils/utils'; // A guide to feature toggling.
1
+ // A guide to feature toggling (deprecated)
2
2
  //
3
3
  // The feature toggle is:
4
4
  // - independent from the NODE_ENV
@@ -15,13 +15,4 @@ import { localStorageAvailable } from '../utils/utils'; // A guide to feature to
15
15
  //
16
16
  // Developers (users) are discouraged to enable the experimental feature by setting the GRID_EXPERIMENTAL_ENABLED env.
17
17
  // Instead, prefer exposing experimental APIs, for instance, a prop or a new `unstable_` module.
18
-
19
- let experimentalEnabled = false;
20
-
21
- if (typeof process !== 'undefined' && process.env.GRID_EXPERIMENTAL_ENABLED !== undefined && localStorageAvailable() && window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED')) {
22
- experimentalEnabled = window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED') === 'true';
23
- } else if (typeof process !== 'undefined') {
24
- experimentalEnabled = process.env.GRID_EXPERIMENTAL_ENABLED === 'true';
25
- }
26
-
27
- export const GRID_EXPERIMENTAL_ENABLED = experimentalEnabled;
18
+ export const GRID_EXPERIMENTAL_ENABLED = false;
@@ -15,6 +15,7 @@ import { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../mode
15
15
  const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');
16
16
  export const useGridCellEditing = (apiRef, props) => {
17
17
  const [cellModesModel, setCellModesModel] = React.useState({});
18
+ const cellModesModelRef = React.useRef(cellModesModel);
18
19
  const prevCellModesModel = React.useRef({});
19
20
  const {
20
21
  processRowUpdate,
@@ -62,6 +63,10 @@ export const useGridCellEditing = (apiRef, props) => {
62
63
  return;
63
64
  }
64
65
 
66
+ if (apiRef.current.getCellMode(params.id, params.field) === GridCellModes.View) {
67
+ return;
68
+ }
69
+
65
70
  const newParams = _extends({}, params, {
66
71
  reason: GridCellEditStopReasons.cellFocusOut
67
72
  });
@@ -97,15 +102,14 @@ export const useGridCellEditing = (apiRef, props) => {
97
102
  } else if (params.isEditable) {
98
103
  let reason;
99
104
 
100
- if (isPrintableKey(event.key)) {
101
- if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
102
- return;
103
- }
104
-
105
+ if (isPrintableKey(event)) {
106
+ reason = GridCellEditStartReasons.printableKeyDown;
107
+ } else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
105
108
  reason = GridCellEditStartReasons.printableKeyDown;
106
109
  } else if (event.key === 'Enter') {
107
110
  reason = GridCellEditStartReasons.enterKeyDown;
108
- } else if (event.key === 'Delete') {
111
+ } else if (event.key === 'Delete' || event.key === 'Backspace') {
112
+ // Delete on Windows, Backspace on macOS
109
113
  reason = GridCellEditStartReasons.deleteKeyDown;
110
114
  }
111
115
 
@@ -195,18 +199,21 @@ export const useGridCellEditing = (apiRef, props) => {
195
199
  }
196
200
 
197
201
  setCellModesModel(newModel);
202
+ cellModesModelRef.current = newModel;
198
203
  apiRef.current.publishEvent('cellModesModelChange', newModel);
199
204
  }, [apiRef, onCellModesModelChange, props.cellModesModel, signature]);
200
205
  const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {
201
- const newModel = _extends({}, cellModesModel);
206
+ // We use the ref because it always contain the up-to-date value, different from the state
207
+ // that needs a rerender to reflect the new value
208
+ const newModel = _extends({}, cellModesModelRef.current);
202
209
 
203
210
  if (newProps !== null) {
204
211
  newModel[id] = _extends({}, newModel[id], {
205
212
  [field]: _extends({}, newProps)
206
213
  });
207
214
  } else {
208
- const _cellModesModel$id = cellModesModel[id],
209
- otherFields = _objectWithoutPropertiesLoose(_cellModesModel$id, [field].map(_toPropertyKey)); // Ensure that we have a new object, not a reference
215
+ const _newModel$id = newModel[id],
216
+ otherFields = _objectWithoutPropertiesLoose(_newModel$id, [field].map(_toPropertyKey)); // Ensure that we have a new object, not a reference
210
217
 
211
218
 
212
219
  newModel[id] = otherFields;
@@ -217,7 +224,7 @@ export const useGridCellEditing = (apiRef, props) => {
217
224
  }
218
225
 
219
226
  updateCellModesModel(newModel);
220
- }, [cellModesModel, updateCellModesModel]);
227
+ }, [updateCellModesModel]);
221
228
  const updateOrDeleteFieldState = React.useCallback((id, field, newProps) => {
222
229
  apiRef.current.setState(state => {
223
230
  const newEditingState = _extends({}, state.editRows);
@@ -290,12 +297,12 @@ export const useGridCellEditing = (apiRef, props) => {
290
297
  apiRef.current.unstable_runPendingEditCellValueMutation(id, field);
291
298
 
292
299
  const finishCellEditMode = () => {
300
+ updateOrDeleteFieldState(id, field, null);
301
+ updateFieldInCellModesModel(id, field, null);
302
+
293
303
  if (cellToFocusAfter !== 'none') {
294
304
  apiRef.current.unstable_moveFocusToRelativeCell(id, field, cellToFocusAfter);
295
305
  }
296
-
297
- updateOrDeleteFieldState(id, field, null);
298
- updateFieldInCellModesModel(id, field, null);
299
306
  };
300
307
 
301
308
  if (ignoreModifications) {
@@ -199,7 +199,7 @@ export const useCellEditing = (apiRef, props) => {
199
199
  const isEditMode = cellMode === GridCellModes.Edit;
200
200
  const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
201
201
 
202
- if (!isEditMode && isCellEnterEditModeKeys(event.key) && !isModifierKeyPressed && !(event.key === ' ' && event.shiftKey)) {
202
+ if (!isEditMode && isCellEnterEditModeKeys(event) && !isModifierKeyPressed && !(event.key === ' ' && event.shiftKey)) {
203
203
  apiRef.current.publishEvent('cellEditStart', params, event);
204
204
  }
205
205
 
@@ -269,7 +269,7 @@ export const useCellEditing = (apiRef, props) => {
269
269
 
270
270
  apiRef.current.setCellMode(params.id, params.field, GridCellModes.Edit);
271
271
 
272
- if (isKeyboardEvent(event) && isPrintableKey(event.key)) {
272
+ if (isKeyboardEvent(event) && isPrintableKey(event)) {
273
273
  apiRef.current.unstable_setEditCellProps({
274
274
  id: params.id,
275
275
  field: params.field,
@@ -16,6 +16,7 @@ import { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models
16
16
  const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');
17
17
  export const useGridRowEditing = (apiRef, props) => {
18
18
  const [rowModesModel, setRowModesModel] = React.useState({});
19
+ const rowModesModelRef = React.useRef(rowModesModel);
19
20
  const prevRowModesModel = React.useRef({});
20
21
  const focusTimeout = React.useRef(null);
21
22
  const nextFocusedCell = React.useRef(null);
@@ -90,6 +91,11 @@ export const useGridRowEditing = (apiRef, props) => {
90
91
  // The row might have been deleted during the click
91
92
  if (!apiRef.current.getRow(params.id)) {
92
93
  return;
94
+ } // The row may already changed its mode
95
+
96
+
97
+ if (apiRef.current.getRowMode(params.id) === GridRowModes.View) {
98
+ return;
93
99
  }
94
100
 
95
101
  const rowParams = apiRef.current.getRowParams(params.id);
@@ -153,15 +159,14 @@ export const useGridRowEditing = (apiRef, props) => {
153
159
  } else if (params.isEditable) {
154
160
  let reason;
155
161
 
156
- if (isPrintableKey(event.key)) {
157
- if (event.ctrlKey && event.key !== 'v' || event.metaKey && event.key !== 'v' || event.altKey) {
158
- return;
159
- }
160
-
162
+ if (isPrintableKey(event)) {
163
+ reason = GridRowEditStartReasons.printableKeyDown;
164
+ } else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
161
165
  reason = GridRowEditStartReasons.printableKeyDown;
162
166
  } else if (event.key === 'Enter') {
163
167
  reason = GridRowEditStartReasons.enterKeyDown;
164
- } else if (event.key === 'Delete') {
168
+ } else if (event.key === 'Delete' || event.key === 'Backspace') {
169
+ // Delete on Windows, Backspace on macOS
165
170
  reason = GridRowEditStartReasons.deleteKeyDown;
166
171
  }
167
172
 
@@ -261,10 +266,11 @@ export const useGridRowEditing = (apiRef, props) => {
261
266
  }
262
267
 
263
268
  setRowModesModel(newModel);
269
+ rowModesModelRef.current = newModel;
264
270
  apiRef.current.publishEvent('rowModesModelChange', newModel);
265
271
  }, [apiRef, onRowModesModelChange, props.rowModesModel, signature]);
266
272
  const updateRowInRowModesModel = React.useCallback((id, newProps) => {
267
- const newModel = _extends({}, rowModesModel);
273
+ const newModel = _extends({}, rowModesModelRef.current);
268
274
 
269
275
  if (newProps !== null) {
270
276
  newModel[id] = _extends({}, newProps);
@@ -273,7 +279,7 @@ export const useGridRowEditing = (apiRef, props) => {
273
279
  }
274
280
 
275
281
  updateRowModesModel(newModel);
276
- }, [rowModesModel, updateRowModesModel]);
282
+ }, [updateRowModesModel]);
277
283
  const updateOrDeleteRowState = React.useCallback((id, newProps) => {
278
284
  apiRef.current.setState(state => {
279
285
  const newEditingState = _extends({}, state.editRows);
@@ -1,5 +1,12 @@
1
+ import { GridFilterItem } from '../../../models/gridFilterItem';
1
2
  import { GridFilterModel } from '../../../models/gridFilterModel';
2
3
  import { GridRowId } from '../../../models/gridRows';
4
+ export declare type GridFilterItemResult = {
5
+ [key: Required<GridFilterItem>['id']]: boolean;
6
+ };
7
+ export declare type GridQuickFilterValueResult = {
8
+ [key: string]: boolean;
9
+ };
3
10
  export declare const getDefaultGridFilterModel: () => GridFilterModel;
4
11
  export interface GridFilterState {
5
12
  filterModel: GridFilterModel;
@@ -31,8 +38,12 @@ export interface GridFilterInitialState {
31
38
  * @param {GridRowId} rowId The id of the row we want to filter.
32
39
  * @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
33
40
  */
34
- export declare type GridAggregatedFilterItemApplier = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) => boolean;
41
+ export declare type GridAggregatedFilterItemApplier = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) => {
42
+ passingFilterItems: null | GridFilterItemResult;
43
+ passingQuickFilterValues: null | GridQuickFilterValueResult;
44
+ };
35
45
  export interface GridFilteringMethodParams {
36
46
  isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
47
+ filterModel: GridFilterModel;
37
48
  }
38
49
  export declare type GridFilteringMethodValue = Omit<GridFilterState, 'filterModel'>;
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
- import { GridFilterItem, GridFilterModel } from '../../../models';
2
+ import { GridFilterItem, GridFilterModel, GridRowId } from '../../../models';
3
3
  import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
4
4
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
5
- import { GridAggregatedFilterItemApplier } from './gridFilterState';
5
+ import { GridAggregatedFilterItemApplier, GridFilterItemResult, GridQuickFilterValueResult } from './gridFilterState';
6
+ declare type GridFilterItemApplierNotAggregated = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) => GridFilterItemResult;
6
7
  /**
7
8
  * Adds default values to the optional fields of a filter items.
8
9
  * @param {GridFilterItem} item The raw filter item.
@@ -19,12 +20,14 @@ export declare const mergeStateWithFilterModel: (filterModel: GridFilterModel, d
19
20
  * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
20
21
  * @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
21
22
  */
22
- export declare const buildAggregatedFilterItemsApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier | null;
23
+ export declare const buildAggregatedFilterItemsApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridFilterItemApplierNotAggregated | null;
23
24
  /**
24
25
  * Generates a method to easily check if a row is matching the current quick filter.
25
26
  * @param {any[]} values The model with which we want to filter the rows.
26
27
  * @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
27
28
  * @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
28
29
  */
29
- export declare const buildAggregatedQuickFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier | null;
30
- export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier | null;
30
+ export declare const buildAggregatedQuickFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridFilterItemApplierNotAggregated | null;
31
+ export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier;
32
+ export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel) => boolean;
33
+ export {};