@mui/x-data-grid 5.17.4 → 5.17.5
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.
- package/CHANGELOG.md +31 -1
- package/components/GridPagination.d.ts +43 -1
- package/components/GridPagination.js +1 -2
- package/components/GridRow.d.ts +1 -4
- package/components/GridRow.js +5 -5
- package/components/toolbar/GridToolbarFilterButton.js +8 -4
- package/hooks/features/editRows/useGridCellEditing.new.js +12 -7
- package/hooks/features/editRows/useGridRowEditing.new.js +12 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
- package/index.js +1 -1
- package/legacy/components/GridPagination.js +1 -2
- package/legacy/components/GridRow.js +5 -5
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +12 -7
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +12 -7
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
- package/legacy/index.js +1 -1
- package/modern/components/GridPagination.js +1 -2
- package/modern/components/GridRow.js +5 -5
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -1
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +12 -7
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +12 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +6 -6
- package/modern/index.js +1 -1
- package/node/components/GridPagination.js +1 -2
- package/node/components/GridRow.js +6 -5
- package/node/components/toolbar/GridToolbarFilterButton.js +8 -4
- package/node/hooks/features/editRows/useGridCellEditing.new.js +15 -9
- package/node/hooks/features/editRows/useGridRowEditing.new.js +15 -9
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
- package/node/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,37 @@
|
|
|
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
|
-
##
|
|
6
|
+
## 5.17.5
|
|
7
|
+
|
|
8
|
+
_Sep 29, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Add theme augmentation module to DataGridPremium (#6316) @cherniavskii
|
|
13
|
+
- 👀 Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
14
|
+
- 📚 Improve controlled editing demo to make easier to reuse it (#6306) @cherniavskii
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
|
|
17
|
+
### `@mui/x-data-grid@v5.17.5` / `@mui/x-data-grid-pro@v5.17.5` / `@mui/x-data-grid-premium@v5.17.5`
|
|
18
|
+
|
|
19
|
+
#### Changes
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Fix `GridPagination` props typing (#6295) @cherniavskii
|
|
22
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6303) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6271) @cherniavskii
|
|
24
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
25
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6319) @m4theushw
|
|
26
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6316) @cherniavskii
|
|
27
|
+
|
|
28
|
+
### Docs
|
|
29
|
+
|
|
30
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6306) @cherniavskii
|
|
31
|
+
|
|
32
|
+
### Core
|
|
33
|
+
|
|
34
|
+
- [core] Reduce the amount of updated screenshots reported by Argos (#6310) @cherniavskii
|
|
35
|
+
|
|
36
|
+
## 5.17.4
|
|
7
37
|
|
|
8
38
|
_Sep 22, 2022_
|
|
9
39
|
|
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const GridPagination: React.ForwardRefExoticComponent<
|
|
2
|
+
export declare const GridPagination: React.ForwardRefExoticComponent<(Pick<Partial<import("@mui/material/TablePagination").TablePaginationBaseProps & {
|
|
3
|
+
ActionsComponent?: React.ElementType<import("@mui/material/TablePagination/TablePaginationActions").TablePaginationActionsProps> | undefined;
|
|
4
|
+
backIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
5
|
+
classes?: Partial<import("@mui/material/TablePagination").TablePaginationClasses> | undefined;
|
|
6
|
+
count: number;
|
|
7
|
+
getItemAriaLabel?: ((type: "first" | "last" | "next" | "previous") => string) | undefined;
|
|
8
|
+
labelDisplayedRows?: ((paginationInfo: import("@mui/material/TablePagination").LabelDisplayedRowsArgs) => React.ReactNode) | undefined;
|
|
9
|
+
labelRowsPerPage?: React.ReactNode;
|
|
10
|
+
nextIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
11
|
+
onPageChange: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | null, page: number) => void;
|
|
12
|
+
onRowsPerPageChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
13
|
+
page: number;
|
|
14
|
+
rowsPerPage: number;
|
|
15
|
+
rowsPerPageOptions?: (number | {
|
|
16
|
+
value: number;
|
|
17
|
+
label: string;
|
|
18
|
+
})[] | undefined;
|
|
19
|
+
SelectProps?: Partial<import("@mui/material").SelectProps<unknown>> | undefined;
|
|
20
|
+
showFirstButton?: boolean | undefined;
|
|
21
|
+
showLastButton?: boolean | undefined;
|
|
22
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
23
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<import("@mui/material/TablePagination").TablePaginationBaseProps, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "ref" | "colSpan" | "headers" | "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" | "rowSpan" | "scope" | "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" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "colSpan" | "headers" | "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" | "rowSpan" | "scope" | "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" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps"> | Pick<Partial<import("@mui/material/TablePagination").TablePaginationBaseProps & {
|
|
24
|
+
ActionsComponent?: React.ElementType<import("@mui/material/TablePagination/TablePaginationActions").TablePaginationActionsProps> | undefined;
|
|
25
|
+
backIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
26
|
+
classes?: Partial<import("@mui/material/TablePagination").TablePaginationClasses> | undefined;
|
|
27
|
+
count: number;
|
|
28
|
+
getItemAriaLabel?: ((type: "first" | "last" | "next" | "previous") => string) | undefined;
|
|
29
|
+
labelDisplayedRows?: ((paginationInfo: import("@mui/material/TablePagination").LabelDisplayedRowsArgs) => React.ReactNode) | undefined;
|
|
30
|
+
labelRowsPerPage?: React.ReactNode;
|
|
31
|
+
nextIconButtonProps?: Partial<import("@mui/material").IconButtonProps<"button", {}>> | undefined;
|
|
32
|
+
onPageChange: (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | null, page: number) => void;
|
|
33
|
+
onRowsPerPageChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
34
|
+
page: number;
|
|
35
|
+
rowsPerPage: number;
|
|
36
|
+
rowsPerPageOptions?: (number | {
|
|
37
|
+
value: number;
|
|
38
|
+
label: string;
|
|
39
|
+
})[] | undefined;
|
|
40
|
+
SelectProps?: Partial<import("@mui/material").SelectProps<unknown>> | undefined;
|
|
41
|
+
showFirstButton?: boolean | undefined;
|
|
42
|
+
showLastButton?: boolean | undefined;
|
|
43
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
44
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("@mui/material/TablePagination").TablePaginationBaseProps, "hidden" | "color" | "size" | "style" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "colSpan" | "headers" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "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" | "rowSpan" | "scope" | "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" | "align" | "valign" | "sx" | "variant" | "sortDirection"> & React.RefAttributes<React.Component<any, any, any>>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "ref" | "colSpan" | "headers" | "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" | "rowSpan" | "scope" | "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" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">>, "hidden" | "color" | "page" | "size" | "height" | "translate" | "width" | "padding" | "abbr" | "slot" | "title" | "key" | "colSpan" | "headers" | "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" | "rowSpan" | "scope" | "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" | "align" | "valign" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "count" | "getItemAriaLabel" | "labelDisplayedRows" | "labelRowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPage" | "rowsPerPageOptions" | "showFirstButton" | "showLastButton" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps">) & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -53,8 +53,7 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
|
|
56
|
-
ref: ref
|
|
57
|
-
,
|
|
56
|
+
ref: ref,
|
|
58
57
|
component: "div",
|
|
59
58
|
count: paginationState.rowCount,
|
|
60
59
|
page: paginationState.page <= lastPage ? paginationState.page : lastPage,
|
package/components/GridRow.d.ts
CHANGED
|
@@ -28,8 +28,5 @@ export interface GridRowProps {
|
|
|
28
28
|
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
29
29
|
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
30
30
|
}
|
|
31
|
-
declare
|
|
32
|
-
declare namespace GridRow {
|
|
33
|
-
var propTypes: any;
|
|
34
|
-
}
|
|
31
|
+
declare const GridRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & GridRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
32
|
export { GridRow };
|
package/components/GridRow.js
CHANGED
|
@@ -5,7 +5,7 @@ const _excluded = ["selected", "rowId", "row", "index", "style", "position", "ro
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, useForkRef } from '@mui/material';
|
|
9
9
|
import { GridEditModes, GridRowModes, GridCellModes } from '../models/gridEditRowModel';
|
|
10
10
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
11
|
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
@@ -55,7 +55,7 @@ const EmptyCell = ({
|
|
|
55
55
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
function GridRow(props) {
|
|
58
|
+
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
59
59
|
var _apiRef$current$getRo;
|
|
60
60
|
|
|
61
61
|
const {
|
|
@@ -90,6 +90,7 @@ function GridRow(props) {
|
|
|
90
90
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
91
91
|
const treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
92
92
|
const headerGroupingMaxDepth = useGridSelector(apiRef, gridDensityHeaderGroupingMaxDepthSelector);
|
|
93
|
+
const handleRef = useForkRef(ref, refProp);
|
|
93
94
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
94
95
|
|
|
95
96
|
const {
|
|
@@ -378,7 +379,7 @@ function GridRow(props) {
|
|
|
378
379
|
onMouseLeave: publish('rowMouseLeave', onMouseLeave)
|
|
379
380
|
} : null;
|
|
380
381
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
381
|
-
ref:
|
|
382
|
+
ref: handleRef,
|
|
382
383
|
"data-id": rowId,
|
|
383
384
|
"data-rowindex": index,
|
|
384
385
|
role: "row",
|
|
@@ -391,8 +392,7 @@ function GridRow(props) {
|
|
|
391
392
|
width: emptyCellWidth
|
|
392
393
|
})]
|
|
393
394
|
}));
|
|
394
|
-
}
|
|
395
|
-
|
|
395
|
+
});
|
|
396
396
|
process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
397
397
|
// ----------------------------- Warning --------------------------------
|
|
398
398
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -70,11 +70,15 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
70
70
|
return /*#__PURE__*/_jsxs("div", {
|
|
71
71
|
children: [apiRef.current.getLocaleText('toolbarFiltersTooltipActive')(activeFilters.length), /*#__PURE__*/_jsx(GridToolbarFilterListRoot, {
|
|
72
72
|
className: classes.root,
|
|
73
|
-
children: activeFilters.map((item, index) =>
|
|
74
|
-
|
|
73
|
+
children: activeFilters.map((item, index) => {
|
|
74
|
+
var _item$value;
|
|
75
|
+
|
|
76
|
+
return _extends({}, lookup[item.columnField] && /*#__PURE__*/_jsx("li", {
|
|
77
|
+
children: `${lookup[item.columnField].headerName || item.columnField}
|
|
75
78
|
${getOperatorLabel(item)}
|
|
76
|
-
${item.value}`
|
|
77
|
-
|
|
79
|
+
${(_item$value = item.value) != null ? _item$value : ''}`
|
|
80
|
+
}, index));
|
|
81
|
+
})
|
|
78
82
|
})]
|
|
79
83
|
});
|
|
80
84
|
}, [apiRef, preferencePanel.open, activeFilters, lookup, classes]);
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
const _excluded = ["id", "field"],
|
|
5
5
|
_excluded2 = ["id", "field"];
|
|
6
6
|
import * as React from 'react';
|
|
7
|
+
import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
7
8
|
import { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';
|
|
8
9
|
import { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';
|
|
9
10
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -185,7 +186,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
185
186
|
const isEditing = editingState[id] && editingState[id][field];
|
|
186
187
|
return isEditing ? GridCellModes.Edit : GridCellModes.View;
|
|
187
188
|
}, [apiRef]);
|
|
188
|
-
const updateCellModesModel =
|
|
189
|
+
const updateCellModesModel = useEventCallback(newModel => {
|
|
189
190
|
const isNewModelDifferentFromProp = newModel !== props.cellModesModel;
|
|
190
191
|
|
|
191
192
|
if (onCellModesModelChange && isNewModelDifferentFromProp) {
|
|
@@ -202,7 +203,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
202
203
|
setCellModesModel(newModel);
|
|
203
204
|
cellModesModelRef.current = newModel;
|
|
204
205
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
205
|
-
}
|
|
206
|
+
});
|
|
206
207
|
const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {
|
|
207
208
|
// We use the ref because it always contain the up-to-date value, different from the state
|
|
208
209
|
// that needs a rerender to reflect the new value
|
|
@@ -261,7 +262,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
261
262
|
mode: GridCellModes.Edit
|
|
262
263
|
}, other));
|
|
263
264
|
}, [throwIfNotEditable, throwIfNotInMode, updateFieldInCellModesModel]);
|
|
264
|
-
const updateStateToStartCellEditMode =
|
|
265
|
+
const updateStateToStartCellEditMode = useEventCallback(params => {
|
|
265
266
|
const {
|
|
266
267
|
id,
|
|
267
268
|
field,
|
|
@@ -274,7 +275,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
274
275
|
};
|
|
275
276
|
updateOrDeleteFieldState(id, field, newProps);
|
|
276
277
|
apiRef.current.setCellFocus(id, field);
|
|
277
|
-
}
|
|
278
|
+
});
|
|
278
279
|
const stopCellEditMode = React.useCallback(params => {
|
|
279
280
|
const {
|
|
280
281
|
id,
|
|
@@ -287,7 +288,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
287
288
|
mode: GridCellModes.View
|
|
288
289
|
}, other));
|
|
289
290
|
}, [throwIfNotInMode, updateFieldInCellModesModel]);
|
|
290
|
-
const updateStateToStopCellEditMode =
|
|
291
|
+
const updateStateToStopCellEditMode = useEventCallback(async params => {
|
|
291
292
|
const {
|
|
292
293
|
id,
|
|
293
294
|
field,
|
|
@@ -332,7 +333,11 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
332
333
|
|
|
333
334
|
if (processRowUpdate) {
|
|
334
335
|
const handleError = errorThrown => {
|
|
335
|
-
prevCellModesModel.current[id][field].mode = GridCellModes.Edit;
|
|
336
|
+
prevCellModesModel.current[id][field].mode = GridCellModes.Edit; // Revert the mode in the cellModesModel prop back to "edit"
|
|
337
|
+
|
|
338
|
+
updateFieldInCellModesModel(id, field, {
|
|
339
|
+
mode: GridCellModes.Edit
|
|
340
|
+
});
|
|
336
341
|
|
|
337
342
|
if (onProcessRowUpdateError) {
|
|
338
343
|
onProcessRowUpdateError(errorThrown);
|
|
@@ -354,7 +359,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
354
359
|
apiRef.current.updateRows([rowUpdate]);
|
|
355
360
|
finishCellEditMode();
|
|
356
361
|
}
|
|
357
|
-
}
|
|
362
|
+
});
|
|
358
363
|
const setCellEditingEditCellValue = React.useCallback(async params => {
|
|
359
364
|
var _editingState$id, _editingState$id$fiel;
|
|
360
365
|
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
const _excluded = ["id"],
|
|
5
5
|
_excluded2 = ["id"];
|
|
6
6
|
import * as React from 'react';
|
|
7
|
+
import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
7
8
|
import { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';
|
|
8
9
|
import { GridEditModes, GridRowModes } from '../../../models/gridEditRowModel';
|
|
9
10
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -252,7 +253,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
252
253
|
const isEditing = editingState[id] && Object.keys(editingState[id]).length > 0;
|
|
253
254
|
return isEditing ? GridRowModes.Edit : GridRowModes.View;
|
|
254
255
|
}, [apiRef, props.editMode]);
|
|
255
|
-
const updateRowModesModel =
|
|
256
|
+
const updateRowModesModel = useEventCallback(newModel => {
|
|
256
257
|
const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
|
|
257
258
|
|
|
258
259
|
if (onRowModesModelChange && isNewModelDifferentFromProp) {
|
|
@@ -269,7 +270,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
269
270
|
setRowModesModel(newModel);
|
|
270
271
|
rowModesModelRef.current = newModel;
|
|
271
272
|
apiRef.current.publishEvent('rowModesModelChange', newModel);
|
|
272
|
-
}
|
|
273
|
+
});
|
|
273
274
|
const updateRowInRowModesModel = React.useCallback((id, newProps) => {
|
|
274
275
|
const newModel = _extends({}, rowModesModelRef.current);
|
|
275
276
|
|
|
@@ -330,7 +331,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
330
331
|
mode: GridRowModes.Edit
|
|
331
332
|
}, other));
|
|
332
333
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
333
|
-
const updateStateToStartRowEditMode =
|
|
334
|
+
const updateStateToStartRowEditMode = useEventCallback(params => {
|
|
334
335
|
const {
|
|
335
336
|
id,
|
|
336
337
|
fieldToFocus,
|
|
@@ -357,7 +358,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
357
358
|
if (fieldToFocus) {
|
|
358
359
|
apiRef.current.setCellFocus(id, fieldToFocus);
|
|
359
360
|
}
|
|
360
|
-
}
|
|
361
|
+
});
|
|
361
362
|
const stopRowEditMode = React.useCallback(params => {
|
|
362
363
|
const {
|
|
363
364
|
id
|
|
@@ -369,7 +370,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
369
370
|
mode: GridRowModes.View
|
|
370
371
|
}, other));
|
|
371
372
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
372
|
-
const updateStateToStopRowEditMode =
|
|
373
|
+
const updateStateToStopRowEditMode = useEventCallback(params => {
|
|
373
374
|
const {
|
|
374
375
|
id,
|
|
375
376
|
ignoreModifications,
|
|
@@ -416,7 +417,11 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
416
417
|
|
|
417
418
|
if (processRowUpdate) {
|
|
418
419
|
const handleError = errorThrown => {
|
|
419
|
-
prevRowModesModel.current[id].mode = GridRowModes.Edit;
|
|
420
|
+
prevRowModesModel.current[id].mode = GridRowModes.Edit; // Revert the mode in the rowModesModel prop back to "edit"
|
|
421
|
+
|
|
422
|
+
updateRowInRowModesModel(id, {
|
|
423
|
+
mode: GridRowModes.Edit
|
|
424
|
+
});
|
|
420
425
|
|
|
421
426
|
if (onProcessRowUpdateError) {
|
|
422
427
|
onProcessRowUpdateError(errorThrown);
|
|
@@ -437,7 +442,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
437
442
|
apiRef.current.updateRows([rowUpdate]);
|
|
438
443
|
finishRowEditMode();
|
|
439
444
|
}
|
|
440
|
-
}
|
|
445
|
+
});
|
|
441
446
|
const setRowEditingEditCellValue = React.useCallback(params => {
|
|
442
447
|
const {
|
|
443
448
|
id,
|
|
@@ -91,16 +91,16 @@ export const useGridVirtualScroller = props => {
|
|
|
91
91
|
var _currentPage$range, _currentPage$range2;
|
|
92
92
|
|
|
93
93
|
const lastMeasuredIndexRelativeToAllRows = apiRef.current.unstable_getLastMeasuredRowIndex();
|
|
94
|
-
|
|
95
|
-
const lastMeasuredIndex = Math.max(0, lastMeasuredIndexRelativeToCurrentPage);
|
|
96
|
-
let allRowsMeasured = lastMeasuredIndex === Infinity;
|
|
94
|
+
let allRowsMeasured = lastMeasuredIndexRelativeToAllRows === Infinity;
|
|
97
95
|
|
|
98
|
-
if ((_currentPage$
|
|
96
|
+
if ((_currentPage$range = currentPage.range) != null && _currentPage$range.lastRowIndex && !allRowsMeasured) {
|
|
99
97
|
// Check if all rows in this page are already measured
|
|
100
|
-
allRowsMeasured =
|
|
98
|
+
allRowsMeasured = lastMeasuredIndexRelativeToAllRows >= currentPage.range.lastRowIndex;
|
|
101
99
|
}
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
const lastMeasuredIndexRelativeToCurrentPage = clamp(lastMeasuredIndexRelativeToAllRows - (((_currentPage$range2 = currentPage.range) == null ? void 0 : _currentPage$range2.firstRowIndex) || 0), 0, rowsMeta.positions.length);
|
|
102
|
+
|
|
103
|
+
if (allRowsMeasured || rowsMeta.positions[lastMeasuredIndexRelativeToCurrentPage] >= offset) {
|
|
104
104
|
// If all rows were measured (when no row has "auto" as height) or all rows before the offset
|
|
105
105
|
// were measured, then use a binary search because it's faster.
|
|
106
106
|
return binarySearch(offset, rowsMeta.positions);
|
|
@@ -110,7 +110,7 @@ export const useGridVirtualScroller = props => {
|
|
|
110
110
|
// Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
return exponentialSearch(offset, rowsMeta.positions,
|
|
113
|
+
return exponentialSearch(offset, rowsMeta.positions, lastMeasuredIndexRelativeToCurrentPage);
|
|
114
114
|
}, [apiRef, (_currentPage$range3 = currentPage.range) == null ? void 0 : _currentPage$range3.firstRowIndex, (_currentPage$range4 = currentPage.range) == null ? void 0 : _currentPage$range4.lastRowIndex, rowsMeta.positions]);
|
|
115
115
|
const computeRenderContext = React.useCallback(() => {
|
|
116
116
|
if (disableVirtualization) {
|
package/index.js
CHANGED
|
@@ -54,8 +54,7 @@ export var GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginatio
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({
|
|
57
|
-
ref: ref
|
|
58
|
-
,
|
|
57
|
+
ref: ref,
|
|
59
58
|
component: "div",
|
|
60
59
|
count: paginationState.rowCount,
|
|
61
60
|
page: paginationState.page <= lastPage ? paginationState.page : lastPage,
|
|
@@ -7,7 +7,7 @@ var _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowH
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
10
|
+
import { unstable_composeClasses as composeClasses, useForkRef } from '@mui/material';
|
|
11
11
|
import { GridEditModes, GridRowModes, GridCellModes } from '../models/gridEditRowModel';
|
|
12
12
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
13
13
|
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
@@ -55,7 +55,7 @@ var EmptyCell = function EmptyCell(_ref) {
|
|
|
55
55
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
function GridRow(props) {
|
|
58
|
+
var GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
59
59
|
var _apiRef$current$getRo;
|
|
60
60
|
|
|
61
61
|
var selected = props.selected,
|
|
@@ -90,6 +90,7 @@ function GridRow(props) {
|
|
|
90
90
|
var sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
91
91
|
var treeDepth = useGridSelector(apiRef, gridRowTreeDepthSelector);
|
|
92
92
|
var headerGroupingMaxDepth = useGridSelector(apiRef, gridDensityHeaderGroupingMaxDepthSelector);
|
|
93
|
+
var handleRef = useForkRef(ref, refProp);
|
|
93
94
|
var ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
94
95
|
|
|
95
96
|
var _ref2 = (_apiRef$current$getRo = apiRef.current.getRootDimensions()) != null ? _apiRef$current$getRo : {
|
|
@@ -387,7 +388,7 @@ function GridRow(props) {
|
|
|
387
388
|
onMouseLeave: publish('rowMouseLeave', onMouseLeave)
|
|
388
389
|
} : null;
|
|
389
390
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
390
|
-
ref:
|
|
391
|
+
ref: handleRef,
|
|
391
392
|
"data-id": rowId,
|
|
392
393
|
"data-rowindex": index,
|
|
393
394
|
role: "row",
|
|
@@ -400,8 +401,7 @@ function GridRow(props) {
|
|
|
400
401
|
width: emptyCellWidth
|
|
401
402
|
})]
|
|
402
403
|
}));
|
|
403
|
-
}
|
|
404
|
-
|
|
404
|
+
});
|
|
405
405
|
process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
406
406
|
// ----------------------------- Warning --------------------------------
|
|
407
407
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -75,8 +75,10 @@ var GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolbar
|
|
|
75
75
|
children: [apiRef.current.getLocaleText('toolbarFiltersTooltipActive')(activeFilters.length), /*#__PURE__*/_jsx(GridToolbarFilterListRoot, {
|
|
76
76
|
className: classes.root,
|
|
77
77
|
children: activeFilters.map(function (item, index) {
|
|
78
|
+
var _item$value;
|
|
79
|
+
|
|
78
80
|
return _extends({}, lookup[item.columnField] && /*#__PURE__*/_jsx("li", {
|
|
79
|
-
children: "".concat(lookup[item.columnField].headerName || item.columnField, "\n ").concat(getOperatorLabel(item), "\n ").concat(item.value)
|
|
81
|
+
children: "".concat(lookup[item.columnField].headerName || item.columnField, "\n ").concat(getOperatorLabel(item), "\n ").concat((_item$value = item.value) != null ? _item$value : '')
|
|
80
82
|
}, index));
|
|
81
83
|
})
|
|
82
84
|
})]
|
|
@@ -8,6 +8,7 @@ var _excluded = ["id", "field"],
|
|
|
8
8
|
_excluded2 = ["id", "field"];
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
import * as React from 'react';
|
|
11
|
+
import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
11
12
|
import { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';
|
|
12
13
|
import { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';
|
|
13
14
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -189,7 +190,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
189
190
|
var isEditing = editingState[id] && editingState[id][field];
|
|
190
191
|
return isEditing ? GridCellModes.Edit : GridCellModes.View;
|
|
191
192
|
}, [apiRef]);
|
|
192
|
-
var updateCellModesModel =
|
|
193
|
+
var updateCellModesModel = useEventCallback(function (newModel) {
|
|
193
194
|
var isNewModelDifferentFromProp = newModel !== props.cellModesModel;
|
|
194
195
|
|
|
195
196
|
if (onCellModesModelChange && isNewModelDifferentFromProp) {
|
|
@@ -206,7 +207,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
206
207
|
setCellModesModel(newModel);
|
|
207
208
|
cellModesModelRef.current = newModel;
|
|
208
209
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
209
|
-
}
|
|
210
|
+
});
|
|
210
211
|
var updateFieldInCellModesModel = React.useCallback(function (id, field, newProps) {
|
|
211
212
|
// We use the ref because it always contain the up-to-date value, different from the state
|
|
212
213
|
// that needs a rerender to reflect the new value
|
|
@@ -260,7 +261,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
260
261
|
mode: GridCellModes.Edit
|
|
261
262
|
}, other));
|
|
262
263
|
}, [throwIfNotEditable, throwIfNotInMode, updateFieldInCellModesModel]);
|
|
263
|
-
var updateStateToStartCellEditMode =
|
|
264
|
+
var updateStateToStartCellEditMode = useEventCallback(function (params) {
|
|
264
265
|
var id = params.id,
|
|
265
266
|
field = params.field,
|
|
266
267
|
deleteValue = params.deleteValue;
|
|
@@ -271,7 +272,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
271
272
|
};
|
|
272
273
|
updateOrDeleteFieldState(id, field, newProps);
|
|
273
274
|
apiRef.current.setCellFocus(id, field);
|
|
274
|
-
}
|
|
275
|
+
});
|
|
275
276
|
var stopCellEditMode = React.useCallback(function (params) {
|
|
276
277
|
var id = params.id,
|
|
277
278
|
field = params.field,
|
|
@@ -282,7 +283,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
282
283
|
mode: GridCellModes.View
|
|
283
284
|
}, other));
|
|
284
285
|
}, [throwIfNotInMode, updateFieldInCellModesModel]);
|
|
285
|
-
var updateStateToStopCellEditMode =
|
|
286
|
+
var updateStateToStopCellEditMode = useEventCallback( /*#__PURE__*/function () {
|
|
286
287
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
287
288
|
var id, field, ignoreModifications, _params$cellToFocusAf, cellToFocusAfter, finishCellEditMode, editingState, _editingState$id$fiel, error, isProcessingProps, rowUpdate, handleError, row;
|
|
288
289
|
|
|
@@ -334,7 +335,11 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
334
335
|
|
|
335
336
|
if (processRowUpdate) {
|
|
336
337
|
handleError = function handleError(errorThrown) {
|
|
337
|
-
prevCellModesModel.current[id][field].mode = GridCellModes.Edit;
|
|
338
|
+
prevCellModesModel.current[id][field].mode = GridCellModes.Edit; // Revert the mode in the cellModesModel prop back to "edit"
|
|
339
|
+
|
|
340
|
+
updateFieldInCellModesModel(id, field, {
|
|
341
|
+
mode: GridCellModes.Edit
|
|
342
|
+
});
|
|
338
343
|
|
|
339
344
|
if (onProcessRowUpdateError) {
|
|
340
345
|
onProcessRowUpdateError(errorThrown);
|
|
@@ -368,7 +373,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
368
373
|
return function (_x) {
|
|
369
374
|
return _ref.apply(this, arguments);
|
|
370
375
|
};
|
|
371
|
-
}()
|
|
376
|
+
}());
|
|
372
377
|
var setCellEditingEditCellValue = React.useCallback( /*#__PURE__*/function () {
|
|
373
378
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params) {
|
|
374
379
|
var _editingState$id, _editingState$id$fiel2;
|