@mui/x-data-grid 6.19.3 → 6.19.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 +117 -0
- package/DataGrid/DataGrid.js +1 -1
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +8 -1
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridActionsCellItem.d.ts +13 -1
- package/components/cell/GridActionsCellItem.js +27 -15
- package/components/containers/GridRootStyles.js +6 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/hooks/features/export/useGridPrintExport.js +3 -1
- package/hooks/features/filter/gridFilterUtils.js +15 -22
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +1 -1
- package/legacy/components/GridPagination.js +8 -1
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridActionsCellItem.js +30 -17
- package/legacy/components/containers/GridRootStyles.js +5 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +6 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -5
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/hooks/features/export/useGridPrintExport.js +11 -7
- package/legacy/hooks/features/filter/gridFilterUtils.js +11 -14
- package/legacy/index.js +1 -1
- package/legacy/locales/daDK.js +12 -12
- package/locales/daDK.js +12 -12
- package/models/props/DataGridProps.d.ts +2 -2
- package/modern/DataGrid/DataGrid.js +1 -1
- package/modern/components/GridPagination.js +8 -1
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +27 -15
- package/modern/components/containers/GridRootStyles.js +6 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/modern/hooks/features/export/useGridPrintExport.js +3 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +15 -22
- package/modern/index.js +1 -1
- package/modern/locales/daDK.js +12 -12
- package/node/DataGrid/DataGrid.js +1 -1
- package/node/components/GridPagination.js +8 -1
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +27 -15
- package/node/components/containers/GridRootStyles.js +6 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -5
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/node/hooks/features/export/useGridPrintExport.js +3 -1
- package/node/hooks/features/filter/gridFilterUtils.js +15 -21
- package/node/index.js +1 -1
- package/node/locales/daDK.js +12 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,123 @@
|
|
|
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.19.5
|
|
7
|
+
|
|
8
|
+
_Feb 23, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
|
|
15
|
+
### Data Grid
|
|
16
|
+
|
|
17
|
+
#### `@mui/x-data-grid@6.19.5`
|
|
18
|
+
|
|
19
|
+
- [DataGrid] Fix styling grid filter input single select (#12079) @FreakDroid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
22
|
+
|
|
23
|
+
Same changes as in `@mui/x-data-grid@6.19.5`.
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid-premium@6.19.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
26
|
+
|
|
27
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.5`.
|
|
28
|
+
|
|
29
|
+
### Date Pickers
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-date-pickers@6.19.5`
|
|
32
|
+
|
|
33
|
+
- [pickers] Fix `referenceDate` day calendar focus (#12136) @LukasTy
|
|
34
|
+
- [pickers] Fix styling props propagation to `DateTimePickerTabs` (#12131) @LukasTy
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers-pro@6.19.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-date-pickers@6.19.5`.
|
|
39
|
+
|
|
40
|
+
### Charts / `@mui/x-charts@6.19.5`
|
|
41
|
+
|
|
42
|
+
- [charts] Allow to skip animation on sparkline bar (#12160) @alexfauquette
|
|
43
|
+
|
|
44
|
+
### Docs
|
|
45
|
+
|
|
46
|
+
- [docs] Clarify Pickers 'Component composition' section (#12147) @LukasTy
|
|
47
|
+
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
48
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
49
|
+
- [docs] Fix 301 to Material UI @oliviertassinari
|
|
50
|
+
- [docs] Fix 404 links to translation source @oliviertassinari
|
|
51
|
+
- [docs] Fix dead link to translations @oliviertassinari
|
|
52
|
+
- [docs] Fix the Treemap illustration (#12189) @danilo-leal
|
|
53
|
+
- [docs] Fix typo for `AdapterDateFnsV3` (#12037) @flaviendelangle
|
|
54
|
+
- [docs] Improve performance on Charts entry point @oliviertassinari
|
|
55
|
+
- [docs] Move Heatmap to pro (#12170) @alexfauquette
|
|
56
|
+
- [docs] Remove Charts installation next tag call-out (#12133) @LukasTy
|
|
57
|
+
- [docs] Removed `focused` prop from demo (#12126) @michelengelen
|
|
58
|
+
- [docs] Add missing Heatmap pro icon @oliviertassinari
|
|
59
|
+
- [docs] Add more illustrations to the Overview page (#12041) @danilo-leal
|
|
60
|
+
- [docs] Avoid use of shorthand (#12009) @oliviertassinari
|
|
61
|
+
|
|
62
|
+
### Core
|
|
63
|
+
|
|
64
|
+
- [core] Fix CI @oliviertassinari
|
|
65
|
+
- [core] Fix docs link check (#12137) @LukasTy
|
|
66
|
+
|
|
67
|
+
## 6.19.4
|
|
68
|
+
|
|
69
|
+
_Feb 9, 2024_
|
|
70
|
+
|
|
71
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
72
|
+
|
|
73
|
+
- 🌍 Improve Danish (da-DK) locale on the Data Grid (#11972) @ShahrazH
|
|
74
|
+
- 🐞 Bugfixes
|
|
75
|
+
- 📚 Documentation improvements
|
|
76
|
+
|
|
77
|
+
### Data Grid
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-data-grid@6.19.4`
|
|
80
|
+
|
|
81
|
+
- [DataGrid] Add support for dialogs in menu actions (#11937) @cherniavskii
|
|
82
|
+
- [DataGrid] Allow passing readonly arrays to `pageSizeOptions` prop (#11992) @pcorpet
|
|
83
|
+
- [DataGrid] Fix row reorder with cell selection (#11878) @PEsteves8
|
|
84
|
+
- [DataGrid] Replace `eval` with `new Function` (#11962) @cherniavskii
|
|
85
|
+
- [l10n] Improve Danish (da-DK) locale (#11972) @ShahrazH
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-data-grid-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-data-grid@6.19.4`.
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-data-grid-premium@6.19.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.4`, plus:
|
|
94
|
+
|
|
95
|
+
- [DataGridPremium] Fix autosize grouping cell (#11990) @romgrk
|
|
96
|
+
- [DataGridPremium] Fix error after closing print export (#11889) @cherniavskii
|
|
97
|
+
|
|
98
|
+
### Date Pickers
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-date-pickers@6.19.4`
|
|
101
|
+
|
|
102
|
+
- [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11940) @LukasTy
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-date-pickers-pro@6.19.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-date-pickers@6.19.4`.
|
|
107
|
+
|
|
108
|
+
### Charts / `@mui/x-charts@6.19.4`
|
|
109
|
+
|
|
110
|
+
- [charts] Add `reverse` property to axes (#11959) @alexfauquette
|
|
111
|
+
- [charts] Allow series ids to be numbers (#11960) @alexfauquette
|
|
112
|
+
- [charts] Fix Proptypes error by supporting string values for axes (#11953) @alexfauquette
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
|
|
116
|
+
- [docs] Add a note about `AdapterDateFnsV3` on the Getting Started page (#11987) @flaviendelangle
|
|
117
|
+
- [docs] Avoid the use of MUI Core @oliviertassinari
|
|
118
|
+
- [docs] Fix API links (#11930) @alexfauquette
|
|
119
|
+
- [docs] Fix `ChartsTooltip` typo (#11967) @thisisharsh7
|
|
120
|
+
- [docs] Refactor `Localization` documentation sections (#11997) @LukasTy
|
|
121
|
+
- [code] Simplify bug reproduction (#11932) @alexfauquette
|
|
122
|
+
|
|
6
123
|
## 6.19.3
|
|
7
124
|
|
|
8
125
|
_Feb 1, 2024_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -314,7 +314,7 @@ DataGridRaw.propTypes = {
|
|
|
314
314
|
loading: PropTypes.bool,
|
|
315
315
|
/**
|
|
316
316
|
* Set the locale text of the Data Grid.
|
|
317
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
317
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
318
318
|
*/
|
|
319
319
|
localeText: PropTypes.object,
|
|
320
320
|
/**
|
|
@@ -3,4 +3,4 @@ export declare const GridPagination: React.ForwardRefExoticComponent<(Omit<Parti
|
|
|
3
3
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
4
4
|
}>, "ref"> | Omit<Partial<import("@mui/material/TablePagination").TablePaginationOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("@mui/material/TablePagination").TablePaginationBaseProps, "ref"> & React.RefAttributes<React.Component<any, any, any>>, "hidden" | "color" | "page" | "content" | "size" | "style" | "height" | "translate" | "width" | "padding" | "disabled" | "abbr" | "slot" | "title" | "ref" | "colSpan" | "headers" | "rowSpan" | "scope" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "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" | "classes" | "variant" | "slotProps" | "slots" | "count" | "getItemAriaLabel" | "onPageChange" | "rowsPerPage" | "showFirstButton" | "showLastButton" | "labelDisplayedRows" | "labelRowsPerPage" | "onRowsPerPageChange" | "rowsPerPageOptions" | "backIconButtonProps" | "nextIconButtonProps" | "sortDirection" | "ActionsComponent" | "SelectProps"> & {
|
|
5
5
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
6
|
-
}>, "ref">) & React.RefAttributes<
|
|
6
|
+
}>, "ref">) & React.RefAttributes<unknown>>;
|
|
@@ -24,6 +24,9 @@ const GridPaginationRoot = styled(TablePagination)(({
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}));
|
|
27
|
+
|
|
28
|
+
// A mutable version of a readonly array.
|
|
29
|
+
|
|
27
30
|
export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
|
|
28
31
|
const apiRef = useGridApiContext();
|
|
29
32
|
const rootProps = useGridRootProps();
|
|
@@ -69,7 +72,11 @@ export const GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginat
|
|
|
69
72
|
ref: ref,
|
|
70
73
|
component: "div",
|
|
71
74
|
count: rowCount,
|
|
72
|
-
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
75
|
+
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
76
|
+
// TODO: Remove the cast once the type is fixed in Material UI and that the min Material UI version
|
|
77
|
+
// for x-data-grid is past the fix.
|
|
78
|
+
// Note that Material UI will not mutate the array, so this is safe.
|
|
79
|
+
,
|
|
73
80
|
rowsPerPageOptions: pageSizeOptions,
|
|
74
81
|
rowsPerPage: paginationModel.pageSize,
|
|
75
82
|
onPageChange: handlePageChange,
|
|
@@ -138,7 +138,7 @@ function GridActionsCell(props) {
|
|
|
138
138
|
if (event.key === 'Tab') {
|
|
139
139
|
event.preventDefault();
|
|
140
140
|
}
|
|
141
|
-
if (['Tab', '
|
|
141
|
+
if (['Tab', 'Escape'].includes(event.key)) {
|
|
142
142
|
hideMenu();
|
|
143
143
|
}
|
|
144
144
|
};
|
|
@@ -175,7 +175,6 @@ function GridActionsCell(props) {
|
|
|
175
175
|
target: buttonRef.current,
|
|
176
176
|
position: position,
|
|
177
177
|
onClose: hideMenu,
|
|
178
|
-
onClick: hideMenu,
|
|
179
178
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
180
179
|
id: menuId,
|
|
181
180
|
className: gridClasses.menuList,
|
|
@@ -184,7 +183,8 @@ function GridActionsCell(props) {
|
|
|
184
183
|
variant: "menu",
|
|
185
184
|
autoFocusItem: true,
|
|
186
185
|
children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
187
|
-
key: index
|
|
186
|
+
key: index,
|
|
187
|
+
closeMenu: hideMenu
|
|
188
188
|
}))
|
|
189
189
|
})
|
|
190
190
|
})]
|
|
@@ -11,6 +11,12 @@ export type GridActionsCellItemProps = {
|
|
|
11
11
|
icon: React.ReactElement;
|
|
12
12
|
} & IconButtonProps) | ({
|
|
13
13
|
showInMenu: true;
|
|
14
|
+
/**
|
|
15
|
+
* If false, the menu will not close when this item is clicked.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
closeMenuOnClick?: boolean;
|
|
19
|
+
closeMenu?: () => void;
|
|
14
20
|
} & MenuItemProps));
|
|
15
21
|
declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
16
22
|
label: string;
|
|
@@ -31,9 +37,15 @@ declare const GridActionsCellItem: React.ForwardRefExoticComponent<(Omit<{
|
|
|
31
37
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
32
38
|
} & {
|
|
33
39
|
showInMenu: true;
|
|
40
|
+
/**
|
|
41
|
+
* If false, the menu will not close when this item is clicked.
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
closeMenuOnClick?: boolean | undefined;
|
|
45
|
+
closeMenu?: (() => void) | undefined;
|
|
34
46
|
} & import("@mui/material/MenuItem").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
35
47
|
ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
|
|
36
48
|
}, "style" | "dense" | "disabled" | "action" | "selected" | "autoFocus" | "className" | "tabIndex" | "children" | "sx" | "classes" | "disableGutters" | "divider" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef"> & {
|
|
37
49
|
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
38
|
-
}, "ref">) & React.RefAttributes<
|
|
50
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
39
51
|
export { GridActionsCellItem };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["label", "icon", "showInMenu", "onClick"]
|
|
3
|
+
const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
4
|
+
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -9,21 +10,18 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
-
const {
|
|
13
|
-
label,
|
|
14
|
-
icon,
|
|
15
|
-
showInMenu,
|
|
16
|
-
onClick
|
|
17
|
-
} = props,
|
|
18
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
13
|
const rootProps = useGridRootProps();
|
|
20
|
-
|
|
21
|
-
if (onClick) {
|
|
22
|
-
onClick(event);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
if (!showInMenu) {
|
|
14
|
+
if (!props.showInMenu) {
|
|
26
15
|
var _rootProps$slotProps;
|
|
16
|
+
const {
|
|
17
|
+
label,
|
|
18
|
+
icon,
|
|
19
|
+
onClick
|
|
20
|
+
} = props,
|
|
21
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
|
+
const handleClick = event => {
|
|
23
|
+
onClick == null || onClick(event);
|
|
24
|
+
};
|
|
27
25
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
28
26
|
ref: ref,
|
|
29
27
|
size: "small",
|
|
@@ -37,10 +35,24 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
37
35
|
})
|
|
38
36
|
}));
|
|
39
37
|
}
|
|
38
|
+
const {
|
|
39
|
+
label,
|
|
40
|
+
icon,
|
|
41
|
+
onClick,
|
|
42
|
+
closeMenuOnClick = true,
|
|
43
|
+
closeMenu
|
|
44
|
+
} = props,
|
|
45
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
46
|
+
const handleClick = event => {
|
|
47
|
+
onClick == null || onClick(event);
|
|
48
|
+
if (closeMenuOnClick) {
|
|
49
|
+
closeMenu == null || closeMenu();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
40
52
|
return /*#__PURE__*/_jsxs(MenuItem, _extends({
|
|
41
53
|
ref: ref
|
|
42
54
|
}, other, {
|
|
43
|
-
onClick:
|
|
55
|
+
onClick: handleClick,
|
|
44
56
|
children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
|
|
45
57
|
children: icon
|
|
46
58
|
}), label]
|
|
@@ -193,6 +193,12 @@ export const GridRootStyles = styled('div', {
|
|
|
193
193
|
[`& .${gridClasses.cell} > *`]: {
|
|
194
194
|
overflow: 'visible !important',
|
|
195
195
|
whiteSpace: 'nowrap'
|
|
196
|
+
},
|
|
197
|
+
[`& .${gridClasses.groupingCriteriaCell}`]: {
|
|
198
|
+
width: 'unset'
|
|
199
|
+
},
|
|
200
|
+
[`& .${gridClasses.treeDataGroupingCell}`]: {
|
|
201
|
+
width: 'unset'
|
|
196
202
|
}
|
|
197
203
|
},
|
|
198
204
|
[`& .${gridClasses['virtualScrollerContent--overflowed']} .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -25,7 +25,8 @@ function GridFilterInputBoolean(props) {
|
|
|
25
25
|
focusElementRef,
|
|
26
26
|
clearButton,
|
|
27
27
|
tabIndex,
|
|
28
|
-
label: labelProp
|
|
28
|
+
label: labelProp,
|
|
29
|
+
variant = 'standard'
|
|
29
30
|
} = props,
|
|
30
31
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
32
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -52,7 +53,7 @@ function GridFilterInputBoolean(props) {
|
|
|
52
53
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
53
54
|
id: labelId,
|
|
54
55
|
shrink: true,
|
|
55
|
-
variant:
|
|
56
|
+
variant: variant,
|
|
56
57
|
children: label
|
|
57
58
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
58
59
|
labelId: labelId,
|
|
@@ -60,7 +61,8 @@ function GridFilterInputBoolean(props) {
|
|
|
60
61
|
label: label,
|
|
61
62
|
value: filterValueState,
|
|
62
63
|
onChange: onFilterChange,
|
|
63
|
-
variant:
|
|
64
|
+
variant: variant,
|
|
65
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
64
66
|
native: isSelectNative,
|
|
65
67
|
displayEmpty: true,
|
|
66
68
|
inputProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -55,6 +55,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
55
55
|
placeholder,
|
|
56
56
|
tabIndex,
|
|
57
57
|
label: labelProp,
|
|
58
|
+
variant = 'standard',
|
|
58
59
|
clearButton
|
|
59
60
|
} = props,
|
|
60
61
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -121,7 +122,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
121
122
|
id: labelId,
|
|
122
123
|
htmlFor: id,
|
|
123
124
|
shrink: true,
|
|
124
|
-
variant:
|
|
125
|
+
variant: variant,
|
|
125
126
|
children: label
|
|
126
127
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
127
128
|
id: id,
|
|
@@ -129,15 +130,16 @@ function GridFilterInputSingleSelect(props) {
|
|
|
129
130
|
labelId: labelId,
|
|
130
131
|
value: filterValueState,
|
|
131
132
|
onChange: onFilterChange,
|
|
132
|
-
variant:
|
|
133
|
+
variant: variant,
|
|
133
134
|
type: type || 'text',
|
|
134
135
|
inputProps: {
|
|
135
136
|
tabIndex,
|
|
136
137
|
ref: focusElementRef,
|
|
137
138
|
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
138
139
|
},
|
|
139
|
-
native: isSelectNative
|
|
140
|
-
|
|
140
|
+
native: isSelectNative,
|
|
141
|
+
notched: variant === 'outlined' ? true : undefined
|
|
142
|
+
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
141
143
|
children: renderSingleSelectOptions({
|
|
142
144
|
column: resolvedColumn,
|
|
143
145
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -18,7 +18,8 @@ function GridFilterInputValue(props) {
|
|
|
18
18
|
tabIndex,
|
|
19
19
|
disabled,
|
|
20
20
|
clearButton,
|
|
21
|
-
InputProps
|
|
21
|
+
InputProps,
|
|
22
|
+
variant = 'standard'
|
|
22
23
|
} = props,
|
|
23
24
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
25
|
const filterTimeout = useTimeout();
|
|
@@ -54,7 +55,7 @@ function GridFilterInputValue(props) {
|
|
|
54
55
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
55
56
|
value: filterValueState,
|
|
56
57
|
onChange: onFilterChange,
|
|
57
|
-
variant:
|
|
58
|
+
variant: variant,
|
|
58
59
|
type: type || 'text',
|
|
59
60
|
InputProps: _extends({}, applying || clearButton ? {
|
|
60
61
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -13,6 +13,7 @@ import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
|
13
13
|
import { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';
|
|
14
14
|
import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
15
15
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef/gridCheckboxSelectionColDef';
|
|
16
|
+
import { gridDataRowIdsSelector, gridRowsLookupSelector } from '../rows/gridRowsSelector';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
function raf() {
|
|
18
19
|
return new Promise(resolve => {
|
|
@@ -217,7 +218,8 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
217
218
|
previousGridState.current = apiRef.current.exportState();
|
|
218
219
|
// It appends that the visibility model is not exported, especially if columnVisibility is not controlled
|
|
219
220
|
previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);
|
|
220
|
-
|
|
221
|
+
const gridRowsLookup = gridRowsLookupSelector(apiRef);
|
|
222
|
+
previousRows.current = gridDataRowIdsSelector(apiRef).map(rowId => gridRowsLookup[rowId]);
|
|
221
223
|
if (props.pagination) {
|
|
222
224
|
const visibleRowCount = gridExpandedRowCountSelector(apiRef);
|
|
223
225
|
const paginationModel = {
|
|
@@ -5,22 +5,18 @@ import { getDefaultGridFilterModel } from './gridFilterState';
|
|
|
5
5
|
import { buildWarning } from '../../../utils/warning';
|
|
6
6
|
import { getPublicApiRef } from '../../../utils/getPublicApiRef';
|
|
7
7
|
import { gridColumnFieldsSelector, gridColumnLookupSelector, gridVisibleColumnFieldsSelector } from '../columns';
|
|
8
|
-
|
|
9
|
-
// Fixes https://github.com/mui/mui-x/issues/10056
|
|
10
|
-
const globalScope = typeof window === 'undefined' ? globalThis : window;
|
|
11
|
-
const evalCode = globalScope[atob('ZXZhbA==')];
|
|
12
8
|
let hasEval;
|
|
13
|
-
|
|
9
|
+
function getHasEval() {
|
|
14
10
|
if (hasEval !== undefined) {
|
|
15
11
|
return hasEval;
|
|
16
12
|
}
|
|
17
13
|
try {
|
|
18
|
-
hasEval =
|
|
14
|
+
hasEval = new Function('return true')();
|
|
19
15
|
} catch (_) {
|
|
20
16
|
hasEval = false;
|
|
21
17
|
}
|
|
22
18
|
return hasEval;
|
|
23
|
-
}
|
|
19
|
+
}
|
|
24
20
|
/**
|
|
25
21
|
* Adds default values to the optional fields of a filter items.
|
|
26
22
|
* @param {GridFilterItem} item The raw filter item.
|
|
@@ -184,25 +180,22 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
184
180
|
};
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
// We generate a new function with `
|
|
183
|
+
// We generate a new function with `new Function()` to avoid expensive patterns for JS engines
|
|
188
184
|
// such as a dynamic object assignment, e.g. `{ [dynamicKey]: value }`.
|
|
189
|
-
const
|
|
190
|
-
|
|
185
|
+
const filterItemCore = new Function('getRowId', 'appliers', 'row', 'shouldApplyFilter', `"use strict";
|
|
186
|
+
${appliers.map((applier, i) => `const shouldApply${i} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(applier.item.field)});`).join('\n')}
|
|
191
187
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
`).join('\n')}};
|
|
188
|
+
const result$$ = {
|
|
189
|
+
${appliers.map((applier, i) => ` ${JSON.stringify(String(applier.item.id))}: !shouldApply${i}
|
|
190
|
+
? false
|
|
191
|
+
: ${applier.v7 ? `appliers[${i}].fn(row)` : `appliers[${i}].fn(getRowId(row))`},`).join('\n')}
|
|
192
|
+
};
|
|
198
193
|
|
|
199
|
-
|
|
200
|
-
})`;
|
|
201
|
-
const filterItemCore = evalCode(filterItemTemplate.replaceAll('$$', String(filterItemsApplierId)));
|
|
202
|
-
const filterItem = (row, shouldApplyItem) => {
|
|
203
|
-
return filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
|
|
204
|
-
};
|
|
194
|
+
return result$$;`.replaceAll('$$', String(filterItemsApplierId)));
|
|
205
195
|
filterItemsApplierId += 1;
|
|
196
|
+
|
|
197
|
+
// Assign to the arrow function a name to help debugging
|
|
198
|
+
const filterItem = (row, shouldApplyItem) => filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
|
|
206
199
|
return filterItem;
|
|
207
200
|
};
|
|
208
201
|
|
package/index.js
CHANGED
|
@@ -316,7 +316,7 @@ DataGridRaw.propTypes = {
|
|
|
316
316
|
loading: PropTypes.bool,
|
|
317
317
|
/**
|
|
318
318
|
* Set the locale text of the Data Grid.
|
|
319
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/
|
|
319
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/v6.19.4/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
320
320
|
*/
|
|
321
321
|
localeText: PropTypes.object,
|
|
322
322
|
/**
|
|
@@ -21,6 +21,9 @@ var GridPaginationRoot = styled(TablePagination)(function (_ref) {
|
|
|
21
21
|
display: 'inline-flex'
|
|
22
22
|
}));
|
|
23
23
|
});
|
|
24
|
+
|
|
25
|
+
// A mutable version of a readonly array.
|
|
26
|
+
|
|
24
27
|
export var GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
|
|
25
28
|
var apiRef = useGridApiContext();
|
|
26
29
|
var rootProps = useGridRootProps();
|
|
@@ -68,7 +71,11 @@ export var GridPagination = /*#__PURE__*/React.forwardRef(function GridPaginatio
|
|
|
68
71
|
ref: ref,
|
|
69
72
|
component: "div",
|
|
70
73
|
count: rowCount,
|
|
71
|
-
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
74
|
+
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
75
|
+
// TODO: Remove the cast once the type is fixed in Material UI and that the min Material UI version
|
|
76
|
+
// for x-data-grid is past the fix.
|
|
77
|
+
// Note that Material UI will not mutate the array, so this is safe.
|
|
78
|
+
,
|
|
72
79
|
rowsPerPageOptions: pageSizeOptions,
|
|
73
80
|
rowsPerPage: paginationModel.pageSize,
|
|
74
81
|
onPageChange: handlePageChange,
|
|
@@ -169,7 +169,7 @@ function GridActionsCell(props) {
|
|
|
169
169
|
if (event.key === 'Tab') {
|
|
170
170
|
event.preventDefault();
|
|
171
171
|
}
|
|
172
|
-
if (['Tab', '
|
|
172
|
+
if (['Tab', 'Escape'].includes(event.key)) {
|
|
173
173
|
hideMenu();
|
|
174
174
|
}
|
|
175
175
|
};
|
|
@@ -208,7 +208,6 @@ function GridActionsCell(props) {
|
|
|
208
208
|
target: buttonRef.current,
|
|
209
209
|
position: position,
|
|
210
210
|
onClose: hideMenu,
|
|
211
|
-
onClick: hideMenu,
|
|
212
211
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
213
212
|
id: menuId,
|
|
214
213
|
className: gridClasses.menuList,
|
|
@@ -218,7 +217,8 @@ function GridActionsCell(props) {
|
|
|
218
217
|
autoFocusItem: true,
|
|
219
218
|
children: menuButtons.map(function (button, index) {
|
|
220
219
|
return /*#__PURE__*/React.cloneElement(button, {
|
|
221
|
-
key: index
|
|
220
|
+
key: index,
|
|
221
|
+
closeMenu: hideMenu
|
|
222
222
|
});
|
|
223
223
|
})
|
|
224
224
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["label", "icon", "showInMenu", "onClick"]
|
|
3
|
+
var _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
4
|
+
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -9,36 +10,48 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
var GridActionsCellItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
|
-
var label = props.label,
|
|
13
|
-
icon = props.icon,
|
|
14
|
-
showInMenu = props.showInMenu,
|
|
15
|
-
onClick = props.onClick,
|
|
16
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
17
13
|
var rootProps = useGridRootProps();
|
|
18
|
-
|
|
19
|
-
if (onClick) {
|
|
20
|
-
onClick(event);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
if (!showInMenu) {
|
|
14
|
+
if (!props.showInMenu) {
|
|
24
15
|
var _rootProps$slotProps;
|
|
16
|
+
var _label = props.label,
|
|
17
|
+
_icon = props.icon,
|
|
18
|
+
_showInMenu = props.showInMenu,
|
|
19
|
+
_onClick = props.onClick,
|
|
20
|
+
_other = _objectWithoutProperties(props, _excluded);
|
|
21
|
+
var _handleClick = function _handleClick(event) {
|
|
22
|
+
_onClick == null || _onClick(event);
|
|
23
|
+
};
|
|
25
24
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
26
25
|
ref: ref,
|
|
27
26
|
size: "small",
|
|
28
27
|
role: "menuitem",
|
|
29
|
-
"aria-label":
|
|
30
|
-
},
|
|
31
|
-
onClick:
|
|
28
|
+
"aria-label": _label
|
|
29
|
+
}, _other, {
|
|
30
|
+
onClick: _handleClick
|
|
32
31
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
33
|
-
children: /*#__PURE__*/React.cloneElement(
|
|
32
|
+
children: /*#__PURE__*/React.cloneElement(_icon, {
|
|
34
33
|
fontSize: 'small'
|
|
35
34
|
})
|
|
36
35
|
}));
|
|
37
36
|
}
|
|
37
|
+
var label = props.label,
|
|
38
|
+
icon = props.icon,
|
|
39
|
+
showInMenu = props.showInMenu,
|
|
40
|
+
onClick = props.onClick,
|
|
41
|
+
_props$closeMenuOnCli = props.closeMenuOnClick,
|
|
42
|
+
closeMenuOnClick = _props$closeMenuOnCli === void 0 ? true : _props$closeMenuOnCli,
|
|
43
|
+
closeMenu = props.closeMenu,
|
|
44
|
+
other = _objectWithoutProperties(props, _excluded2);
|
|
45
|
+
var handleClick = function handleClick(event) {
|
|
46
|
+
onClick == null || onClick(event);
|
|
47
|
+
if (closeMenuOnClick) {
|
|
48
|
+
closeMenu == null || closeMenu();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
38
51
|
return /*#__PURE__*/_jsxs(MenuItem, _extends({
|
|
39
52
|
ref: ref
|
|
40
53
|
}, other, {
|
|
41
|
-
onClick:
|
|
54
|
+
onClick: handleClick,
|
|
42
55
|
children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
|
|
43
56
|
children: icon
|
|
44
57
|
}), label]
|