@mui/x-data-grid 5.17.4 → 5.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -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 +16 -7
- package/hooks/features/editRows/useGridRowEditing.new.js +16 -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 +16 -7
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +16 -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 +16 -7
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +16 -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 +19 -9
- package/node/hooks/features/editRows/useGridRowEditing.new.js +19 -9
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +7 -7
- package/node/index.js +1 -1
- package/package.json +1 -1
- package/themeAugmentation/props.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,67 @@
|
|
|
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.6
|
|
7
|
+
|
|
8
|
+
_Oct 6, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Japanese (ja-JP) locale to pickers (#6365) @sho918
|
|
13
|
+
- 🎁 Improve support for theme augmentation in the DataGrid (#6406) @cherniavskii
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.6` / `@mui/x-data-grid-pro@v5.17.6` / `@mui/x-data-grid-premium@v5.17.6`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add missing `valueOptions` (#6400) @DanailH
|
|
21
|
+
- [DataGrid] Don't start edit mode when pressing <kbd>Shift</kbd> + <kbd>Space</kbd> (#6380) @m4theushw
|
|
22
|
+
- [DataGrid] Pass generics to the components in the theme augmentation (#6406) @cherniavskii
|
|
23
|
+
|
|
24
|
+
### `@mui/x-date-pickers@v5.0.4` / `@mui/x-date-pickers-pro@v5.0.4`
|
|
25
|
+
|
|
26
|
+
#### Changes
|
|
27
|
+
|
|
28
|
+
- [l10n] Add Japanese (ja-JP) locale to pickers (#6365) (#6382) @sho918
|
|
29
|
+
- [pickers] Prevent `CalendarPicker` getting focus when `autoFocus=false` (#6304) (#6362) @alexfauquette
|
|
30
|
+
- [pickers] Fix git repository location @oliviertassinari
|
|
31
|
+
|
|
32
|
+
### Docs
|
|
33
|
+
|
|
34
|
+
- [docs] Fix customized day rendering demo style (#6342) @Ambrish-git
|
|
35
|
+
|
|
36
|
+
## 5.17.5
|
|
37
|
+
|
|
38
|
+
_Sep 29, 2022_
|
|
39
|
+
|
|
40
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
41
|
+
|
|
42
|
+
- 🎁 Add theme augmentation module to DataGridPremium (#6316) @cherniavskii
|
|
43
|
+
- 👀 Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
44
|
+
- 📚 Improve controlled editing demo to make easier to reuse it (#6306) @cherniavskii
|
|
45
|
+
- 🐞 Bugfixes
|
|
46
|
+
|
|
47
|
+
### `@mui/x-data-grid@v5.17.5` / `@mui/x-data-grid-pro@v5.17.5` / `@mui/x-data-grid-premium@v5.17.5`
|
|
48
|
+
|
|
49
|
+
#### Changes
|
|
50
|
+
|
|
51
|
+
- [DataGrid] Fix `GridPagination` props typing (#6295) @cherniavskii
|
|
52
|
+
- [DataGrid] Fix `GridRow` not forwarding `ref` to the root element (#6303) @cherniavskii
|
|
53
|
+
- [DataGrid] Fix `undefined` value being showed in filter button tooltip text (#6271) @cherniavskii
|
|
54
|
+
- [DataGrid] Fix blank space when changing page with dynamic row height (#6320) @m4theushw
|
|
55
|
+
- [DataGrid] Revert cell/row mode if `processRowUpdate` fails (#6319) @m4theushw
|
|
56
|
+
- [DataGridPremium] Add missing `themeAugmentation` module (#6316) @cherniavskii
|
|
57
|
+
|
|
58
|
+
### Docs
|
|
59
|
+
|
|
60
|
+
- [docs] Pass model change callbacks in controlled grid editing demos (#6306) @cherniavskii
|
|
61
|
+
|
|
62
|
+
### Core
|
|
63
|
+
|
|
64
|
+
- [core] Reduce the amount of updated screenshots reported by Argos (#6310) @cherniavskii
|
|
65
|
+
|
|
66
|
+
## 5.17.4
|
|
7
67
|
|
|
8
68
|
_Sep 22, 2022_
|
|
9
69
|
|
|
@@ -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';
|
|
@@ -103,6 +104,10 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
103
104
|
} else if (params.isEditable) {
|
|
104
105
|
let reason;
|
|
105
106
|
|
|
107
|
+
if (event.key === ' ' && event.shiftKey) {
|
|
108
|
+
return; // Shift + Space is used to select the row
|
|
109
|
+
}
|
|
110
|
+
|
|
106
111
|
if (isPrintableKey(event)) {
|
|
107
112
|
reason = GridCellEditStartReasons.printableKeyDown;
|
|
108
113
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
@@ -185,7 +190,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
185
190
|
const isEditing = editingState[id] && editingState[id][field];
|
|
186
191
|
return isEditing ? GridCellModes.Edit : GridCellModes.View;
|
|
187
192
|
}, [apiRef]);
|
|
188
|
-
const updateCellModesModel =
|
|
193
|
+
const updateCellModesModel = useEventCallback(newModel => {
|
|
189
194
|
const isNewModelDifferentFromProp = newModel !== props.cellModesModel;
|
|
190
195
|
|
|
191
196
|
if (onCellModesModelChange && isNewModelDifferentFromProp) {
|
|
@@ -202,7 +207,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
202
207
|
setCellModesModel(newModel);
|
|
203
208
|
cellModesModelRef.current = newModel;
|
|
204
209
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
205
|
-
}
|
|
210
|
+
});
|
|
206
211
|
const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {
|
|
207
212
|
// We use the ref because it always contain the up-to-date value, different from the state
|
|
208
213
|
// that needs a rerender to reflect the new value
|
|
@@ -261,7 +266,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
261
266
|
mode: GridCellModes.Edit
|
|
262
267
|
}, other));
|
|
263
268
|
}, [throwIfNotEditable, throwIfNotInMode, updateFieldInCellModesModel]);
|
|
264
|
-
const updateStateToStartCellEditMode =
|
|
269
|
+
const updateStateToStartCellEditMode = useEventCallback(params => {
|
|
265
270
|
const {
|
|
266
271
|
id,
|
|
267
272
|
field,
|
|
@@ -274,7 +279,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
274
279
|
};
|
|
275
280
|
updateOrDeleteFieldState(id, field, newProps);
|
|
276
281
|
apiRef.current.setCellFocus(id, field);
|
|
277
|
-
}
|
|
282
|
+
});
|
|
278
283
|
const stopCellEditMode = React.useCallback(params => {
|
|
279
284
|
const {
|
|
280
285
|
id,
|
|
@@ -287,7 +292,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
287
292
|
mode: GridCellModes.View
|
|
288
293
|
}, other));
|
|
289
294
|
}, [throwIfNotInMode, updateFieldInCellModesModel]);
|
|
290
|
-
const updateStateToStopCellEditMode =
|
|
295
|
+
const updateStateToStopCellEditMode = useEventCallback(async params => {
|
|
291
296
|
const {
|
|
292
297
|
id,
|
|
293
298
|
field,
|
|
@@ -332,7 +337,11 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
332
337
|
|
|
333
338
|
if (processRowUpdate) {
|
|
334
339
|
const handleError = errorThrown => {
|
|
335
|
-
prevCellModesModel.current[id][field].mode = GridCellModes.Edit;
|
|
340
|
+
prevCellModesModel.current[id][field].mode = GridCellModes.Edit; // Revert the mode in the cellModesModel prop back to "edit"
|
|
341
|
+
|
|
342
|
+
updateFieldInCellModesModel(id, field, {
|
|
343
|
+
mode: GridCellModes.Edit
|
|
344
|
+
});
|
|
336
345
|
|
|
337
346
|
if (onProcessRowUpdateError) {
|
|
338
347
|
onProcessRowUpdateError(errorThrown);
|
|
@@ -354,7 +363,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
354
363
|
apiRef.current.updateRows([rowUpdate]);
|
|
355
364
|
finishCellEditMode();
|
|
356
365
|
}
|
|
357
|
-
}
|
|
366
|
+
});
|
|
358
367
|
const setCellEditingEditCellValue = React.useCallback(async params => {
|
|
359
368
|
var _editingState$id, _editingState$id$fiel;
|
|
360
369
|
|
|
@@ -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';
|
|
@@ -160,6 +161,10 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
160
161
|
} else if (params.isEditable) {
|
|
161
162
|
let reason;
|
|
162
163
|
|
|
164
|
+
if (event.key === ' ' && event.shiftKey) {
|
|
165
|
+
return; // Shift + Space is used to select the row
|
|
166
|
+
}
|
|
167
|
+
|
|
163
168
|
if (isPrintableKey(event)) {
|
|
164
169
|
reason = GridRowEditStartReasons.printableKeyDown;
|
|
165
170
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
@@ -252,7 +257,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
252
257
|
const isEditing = editingState[id] && Object.keys(editingState[id]).length > 0;
|
|
253
258
|
return isEditing ? GridRowModes.Edit : GridRowModes.View;
|
|
254
259
|
}, [apiRef, props.editMode]);
|
|
255
|
-
const updateRowModesModel =
|
|
260
|
+
const updateRowModesModel = useEventCallback(newModel => {
|
|
256
261
|
const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
|
|
257
262
|
|
|
258
263
|
if (onRowModesModelChange && isNewModelDifferentFromProp) {
|
|
@@ -269,7 +274,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
269
274
|
setRowModesModel(newModel);
|
|
270
275
|
rowModesModelRef.current = newModel;
|
|
271
276
|
apiRef.current.publishEvent('rowModesModelChange', newModel);
|
|
272
|
-
}
|
|
277
|
+
});
|
|
273
278
|
const updateRowInRowModesModel = React.useCallback((id, newProps) => {
|
|
274
279
|
const newModel = _extends({}, rowModesModelRef.current);
|
|
275
280
|
|
|
@@ -330,7 +335,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
330
335
|
mode: GridRowModes.Edit
|
|
331
336
|
}, other));
|
|
332
337
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
333
|
-
const updateStateToStartRowEditMode =
|
|
338
|
+
const updateStateToStartRowEditMode = useEventCallback(params => {
|
|
334
339
|
const {
|
|
335
340
|
id,
|
|
336
341
|
fieldToFocus,
|
|
@@ -357,7 +362,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
357
362
|
if (fieldToFocus) {
|
|
358
363
|
apiRef.current.setCellFocus(id, fieldToFocus);
|
|
359
364
|
}
|
|
360
|
-
}
|
|
365
|
+
});
|
|
361
366
|
const stopRowEditMode = React.useCallback(params => {
|
|
362
367
|
const {
|
|
363
368
|
id
|
|
@@ -369,7 +374,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
369
374
|
mode: GridRowModes.View
|
|
370
375
|
}, other));
|
|
371
376
|
}, [throwIfNotInMode, updateRowInRowModesModel]);
|
|
372
|
-
const updateStateToStopRowEditMode =
|
|
377
|
+
const updateStateToStopRowEditMode = useEventCallback(params => {
|
|
373
378
|
const {
|
|
374
379
|
id,
|
|
375
380
|
ignoreModifications,
|
|
@@ -416,7 +421,11 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
416
421
|
|
|
417
422
|
if (processRowUpdate) {
|
|
418
423
|
const handleError = errorThrown => {
|
|
419
|
-
prevRowModesModel.current[id].mode = GridRowModes.Edit;
|
|
424
|
+
prevRowModesModel.current[id].mode = GridRowModes.Edit; // Revert the mode in the rowModesModel prop back to "edit"
|
|
425
|
+
|
|
426
|
+
updateRowInRowModesModel(id, {
|
|
427
|
+
mode: GridRowModes.Edit
|
|
428
|
+
});
|
|
420
429
|
|
|
421
430
|
if (onProcessRowUpdateError) {
|
|
422
431
|
onProcessRowUpdateError(errorThrown);
|
|
@@ -437,7 +446,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
437
446
|
apiRef.current.updateRows([rowUpdate]);
|
|
438
447
|
finishRowEditMode();
|
|
439
448
|
}
|
|
440
|
-
}
|
|
449
|
+
});
|
|
441
450
|
const setRowEditingEditCellValue = React.useCallback(params => {
|
|
442
451
|
const {
|
|
443
452
|
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
|
})]
|