@mui/material 5.14.2 → 5.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +11 -6
- package/AccordionSummary/AccordionSummary.d.ts +9 -7
- package/AppBar/AppBar.d.ts +11 -6
- package/Autocomplete/Autocomplete.d.ts +20 -16
- package/Autocomplete/Autocomplete.js +19 -15
- package/Avatar/Avatar.d.ts +11 -6
- package/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/Backdrop/Backdrop.d.ts +11 -6
- package/Badge/Badge.d.ts +11 -6
- package/BottomNavigation/BottomNavigation.d.ts +11 -6
- package/BottomNavigationAction/BottomNavigationAction.d.ts +9 -7
- package/Box/Box.d.ts +3 -3
- package/Breadcrumbs/Breadcrumbs.d.ts +11 -6
- package/Button/Button.d.ts +16 -14
- package/ButtonBase/ButtonBase.d.ts +17 -12
- package/ButtonGroup/ButtonGroup.d.ts +11 -6
- package/CHANGELOG.md +91 -1
- package/Card/Card.d.ts +13 -8
- package/CardActionArea/CardActionArea.d.ts +11 -6
- package/CardContent/CardContent.d.ts +11 -6
- package/CardMedia/CardMedia.d.ts +9 -7
- package/Chip/Chip.d.ts +11 -6
- package/Container/Container.d.ts +11 -6
- package/Dialog/Dialog.d.ts +1 -1
- package/DialogContentText/DialogContentText.d.ts +9 -7
- package/DialogTitle/DialogTitle.d.ts +9 -7
- package/Divider/Divider.d.ts +11 -6
- package/Divider/Divider.js +6 -0
- package/Drawer/Drawer.d.ts +1 -1
- package/Fab/Fab.d.ts +11 -6
- package/FormControl/FormControl.d.ts +11 -6
- package/FormHelperText/FormHelperText.d.ts +11 -6
- package/FormLabel/FormLabel.d.ts +14 -9
- package/Grid/Grid.d.ts +11 -6
- package/Icon/Icon.d.ts +11 -6
- package/IconButton/IconButton.d.ts +9 -7
- package/ImageList/ImageList.d.ts +11 -6
- package/ImageListItem/ImageListItem.d.ts +11 -6
- package/InputAdornment/InputAdornment.d.ts +11 -6
- package/InputLabel/InputLabel.d.ts +9 -7
- package/Link/Link.d.ts +20 -13
- package/List/List.d.ts +17 -10
- package/ListItem/ListItem.d.ts +9 -7
- package/ListItemButton/ListItemButton.d.ts +9 -7
- package/ListSubheader/ListSubheader.d.ts +11 -6
- package/Menu/Menu.d.ts +23 -2
- package/Menu/Menu.js +48 -10
- package/MenuItem/MenuItem.d.ts +11 -6
- package/MenuList/MenuList.d.ts +11 -6
- package/Modal/Modal.d.ts +11 -6
- package/OverridableComponent.d.ts +14 -14
- package/PaginationItem/PaginationItem.d.ts +12 -7
- package/Paper/Paper.d.ts +45 -38
- package/Paper/index.d.ts +1 -1
- package/Popover/Popover.d.ts +1 -1
- package/README.md +2 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +11 -6
- package/Select/Select.d.ts +8 -8
- package/Select/Select.js +1 -1
- package/Select/SelectInput.d.ts +7 -7
- package/Skeleton/Skeleton.d.ts +11 -6
- package/Slider/Slider.d.ts +11 -6
- package/Stack/Stack.d.ts +11 -6
- package/Step/Step.d.ts +11 -6
- package/StepButton/StepButton.d.ts +11 -6
- package/Stepper/Stepper.d.ts +11 -6
- package/SvgIcon/SvgIcon.d.ts +11 -6
- package/Tab/Tab.d.ts +11 -6
- package/Table/Table.d.ts +11 -6
- package/TableBody/TableBody.d.ts +11 -6
- package/TableContainer/TableContainer.d.ts +11 -6
- package/TableFooter/TableFooter.d.ts +11 -6
- package/TableHead/TableHead.d.ts +11 -6
- package/TablePagination/TablePagination.d.ts +11 -6
- package/TableRow/TableRow.d.ts +11 -6
- package/TableSortLabel/TableSortLabel.d.ts +9 -7
- package/Tabs/Tabs.d.ts +11 -6
- package/ToggleButton/ToggleButton.d.ts +9 -7
- package/Toolbar/Toolbar.d.ts +11 -6
- package/Typography/Typography.d.ts +76 -70
- package/index.d.ts +9 -9
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +19 -16
- package/legacy/Divider/Divider.js +6 -0
- package/legacy/Menu/Menu.js +49 -9
- package/legacy/Select/Select.js +1 -1
- package/legacy/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +16 -12
- package/modern/Divider/Divider.js +6 -0
- package/modern/Menu/Menu.js +47 -10
- package/modern/Select/Select.js +1 -1
- package/modern/index.js +1 -1
- package/node/Autocomplete/Autocomplete.js +19 -15
- package/node/Divider/Divider.js +6 -0
- package/node/Menu/Menu.js +47 -9
- package/node/Select/Select.js +1 -1
- package/node/index.js +1 -1
- package/package.json +6 -6
- package/styles/ThemeProvider.d.ts +3 -3
- package/styles/components.d.ts +1 -0
- package/styles/createTypography.d.ts +9 -10
- package/styles/overrides.d.ts +2 -0
- package/types/OverridableComponentAugmentation.d.ts +7 -7
- package/umd/material-ui.development.js +318 -275
- package/umd/material-ui.production.min.js +21 -21
package/modern/Menu/Menu.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["onEntering"],
|
|
6
|
-
_excluded2 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
|
|
6
|
+
_excluded2 = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { isFragment } from 'react-is';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import clsx from 'clsx';
|
|
11
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
11
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
12
12
|
import { HTMLElementType } from '@mui/utils';
|
|
13
13
|
import MenuList from '../MenuList';
|
|
14
14
|
import Popover, { PopoverPaper } from '../Popover';
|
|
@@ -70,6 +70,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
70
70
|
const {
|
|
71
71
|
autoFocus = true,
|
|
72
72
|
children,
|
|
73
|
+
className,
|
|
73
74
|
disableAutoFocusItem = false,
|
|
74
75
|
MenuListProps = {},
|
|
75
76
|
onClose,
|
|
@@ -80,7 +81,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
80
81
|
TransitionProps: {
|
|
81
82
|
onEntering
|
|
82
83
|
} = {},
|
|
83
|
-
variant = 'selectedMenu'
|
|
84
|
+
variant = 'selectedMenu',
|
|
85
|
+
slots = {},
|
|
86
|
+
slotProps = {}
|
|
84
87
|
} = props,
|
|
85
88
|
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
|
|
86
89
|
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
@@ -142,6 +145,20 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
147
|
});
|
|
148
|
+
const PaperSlot = slots.paper ?? MenuPaper;
|
|
149
|
+
const paperExternalSlotProps = slotProps.paper ?? PaperProps;
|
|
150
|
+
const rootSlotProps = useSlotProps({
|
|
151
|
+
elementType: slots.root,
|
|
152
|
+
externalSlotProps: slotProps.root,
|
|
153
|
+
ownerState,
|
|
154
|
+
className: [classes.root, className]
|
|
155
|
+
});
|
|
156
|
+
const paperSlotProps = useSlotProps({
|
|
157
|
+
elementType: PaperSlot,
|
|
158
|
+
externalSlotProps: paperExternalSlotProps,
|
|
159
|
+
ownerState,
|
|
160
|
+
className: classes.paper
|
|
161
|
+
});
|
|
145
162
|
return /*#__PURE__*/_jsx(MenuRoot, _extends({
|
|
146
163
|
onClose: onClose,
|
|
147
164
|
anchorOrigin: {
|
|
@@ -150,16 +167,13 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
150
167
|
},
|
|
151
168
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
152
169
|
slots: {
|
|
153
|
-
paper:
|
|
170
|
+
paper: PaperSlot,
|
|
171
|
+
root: slots.root
|
|
154
172
|
},
|
|
155
173
|
slotProps: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
root: classes.paper
|
|
159
|
-
})
|
|
160
|
-
})
|
|
174
|
+
root: rootSlotProps,
|
|
175
|
+
paper: paperSlotProps
|
|
161
176
|
},
|
|
162
|
-
className: classes.root,
|
|
163
177
|
open: open,
|
|
164
178
|
ref: ref,
|
|
165
179
|
transitionDuration: transitionDuration,
|
|
@@ -207,6 +221,10 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
207
221
|
* Override or extend the styles applied to the component.
|
|
208
222
|
*/
|
|
209
223
|
classes: PropTypes.object,
|
|
224
|
+
/**
|
|
225
|
+
* @ignore
|
|
226
|
+
*/
|
|
227
|
+
className: PropTypes.string,
|
|
210
228
|
/**
|
|
211
229
|
* When opening the menu will not focus the active item but the `[role="menu"]`
|
|
212
230
|
* unless `autoFocus` is also set to `false`. Not using the default means not
|
|
@@ -239,6 +257,25 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
239
257
|
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
|
240
258
|
*/
|
|
241
259
|
PopoverClasses: PropTypes.object,
|
|
260
|
+
/**
|
|
261
|
+
* The extra props for the slot components.
|
|
262
|
+
* You can override the existing props or add new ones.
|
|
263
|
+
*
|
|
264
|
+
* @default {}
|
|
265
|
+
*/
|
|
266
|
+
slotProps: PropTypes.shape({
|
|
267
|
+
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
268
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
269
|
+
}),
|
|
270
|
+
/**
|
|
271
|
+
* The components used for each slot inside.
|
|
272
|
+
*
|
|
273
|
+
* @default {}
|
|
274
|
+
*/
|
|
275
|
+
slots: PropTypes.shape({
|
|
276
|
+
paper: PropTypes.elementType,
|
|
277
|
+
root: PropTypes.elementType
|
|
278
|
+
}),
|
|
242
279
|
/**
|
|
243
280
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
244
281
|
*/
|
package/modern/Select/Select.js
CHANGED
|
@@ -222,7 +222,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
|
|
|
222
222
|
/**
|
|
223
223
|
* Callback fired when a menu item is selected.
|
|
224
224
|
*
|
|
225
|
-
* @param {SelectChangeEvent<
|
|
225
|
+
* @param {SelectChangeEvent<Value>} event The event source of the callback.
|
|
226
226
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
227
227
|
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
228
228
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
package/modern/index.js
CHANGED
|
@@ -385,6 +385,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
385
385
|
props: inProps,
|
|
386
386
|
name: 'MuiAutocomplete'
|
|
387
387
|
});
|
|
388
|
+
|
|
388
389
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
389
390
|
const {
|
|
390
391
|
autoComplete = false,
|
|
@@ -413,10 +414,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
413
414
|
freeSolo = false,
|
|
414
415
|
fullWidth = false,
|
|
415
416
|
getLimitTagsText = more => `+${more}`,
|
|
416
|
-
getOptionLabel
|
|
417
|
-
var _option$label;
|
|
418
|
-
return (_option$label = option.label) != null ? _option$label : option;
|
|
419
|
-
},
|
|
417
|
+
getOptionLabel: getOptionLabelProp,
|
|
420
418
|
groupBy,
|
|
421
419
|
handleHomeEndKeys = !props.freeSolo,
|
|
422
420
|
includeInputInList = false,
|
|
@@ -481,6 +479,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
481
479
|
} = _getListboxProps,
|
|
482
480
|
otherListboxProps = (0, _objectWithoutPropertiesLoose2.default)(_getListboxProps, _excluded2);
|
|
483
481
|
const combinedListboxRef = (0, _useForkRef.default)(listboxRef, externalListboxRef);
|
|
482
|
+
const defaultGetOptionLabel = option => {
|
|
483
|
+
var _option$label;
|
|
484
|
+
return (_option$label = option.label) != null ? _option$label : option;
|
|
485
|
+
};
|
|
486
|
+
const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
484
487
|
|
|
485
488
|
// If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
|
|
486
489
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
@@ -488,6 +491,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
488
491
|
expanded,
|
|
489
492
|
focused,
|
|
490
493
|
fullWidth,
|
|
494
|
+
getOptionLabel,
|
|
491
495
|
hasClearIcon,
|
|
492
496
|
hasPopupIcon,
|
|
493
497
|
inputFocused: focusedTag === -1,
|
|
@@ -791,9 +795,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
791
795
|
* A function that determines the filtered options to be rendered on search.
|
|
792
796
|
*
|
|
793
797
|
* @default createFilterOptions()
|
|
794
|
-
* @param {
|
|
798
|
+
* @param {Value[]} options The options to render.
|
|
795
799
|
* @param {object} state The state of the component.
|
|
796
|
-
* @returns {
|
|
800
|
+
* @returns {Value[]}
|
|
797
801
|
*/
|
|
798
802
|
filterOptions: _propTypes.default.func,
|
|
799
803
|
/**
|
|
@@ -827,7 +831,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
827
831
|
/**
|
|
828
832
|
* Used to determine the disabled state for a given option.
|
|
829
833
|
*
|
|
830
|
-
* @param {
|
|
834
|
+
* @param {Value} option The option to test.
|
|
831
835
|
* @returns {boolean}
|
|
832
836
|
*/
|
|
833
837
|
getOptionDisabled: _propTypes.default.func,
|
|
@@ -837,7 +841,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
837
841
|
*
|
|
838
842
|
* If used in free solo mode, it must accept both the type of the options and a string.
|
|
839
843
|
*
|
|
840
|
-
* @param {
|
|
844
|
+
* @param {Value} option
|
|
841
845
|
* @returns {string}
|
|
842
846
|
* @default (option) => option.label ?? option
|
|
843
847
|
*/
|
|
@@ -846,7 +850,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
846
850
|
* If provided, the options will be grouped under the returned string.
|
|
847
851
|
* The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
|
|
848
852
|
*
|
|
849
|
-
* @param {
|
|
853
|
+
* @param {Value} options The options to group.
|
|
850
854
|
* @returns {string}
|
|
851
855
|
*/
|
|
852
856
|
groupBy: _propTypes.default.func,
|
|
@@ -875,8 +879,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
875
879
|
* Uses strict equality by default.
|
|
876
880
|
* ⚠️ Both arguments need to be handled, an option can only match with one value.
|
|
877
881
|
*
|
|
878
|
-
* @param {
|
|
879
|
-
* @param {
|
|
882
|
+
* @param {Value} option The option to test.
|
|
883
|
+
* @param {Value} value The value to test against.
|
|
880
884
|
* @returns {boolean}
|
|
881
885
|
*/
|
|
882
886
|
isOptionEqualToValue: _propTypes.default.func,
|
|
@@ -924,7 +928,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
924
928
|
* Callback fired when the value changes.
|
|
925
929
|
*
|
|
926
930
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
927
|
-
* @param {
|
|
931
|
+
* @param {Value|Value[]} value The new value of the component.
|
|
928
932
|
* @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
|
|
929
933
|
* @param {string} [details]
|
|
930
934
|
*/
|
|
@@ -941,7 +945,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
941
945
|
* Callback fired when the highlight option changes.
|
|
942
946
|
*
|
|
943
947
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
944
|
-
* @param {
|
|
948
|
+
* @param {Value} option The highlighted option.
|
|
945
949
|
* @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
|
|
946
950
|
*/
|
|
947
951
|
onHighlightChange: _propTypes.default.func,
|
|
@@ -1018,7 +1022,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1018
1022
|
* Render the option, use `getOptionLabel` by default.
|
|
1019
1023
|
*
|
|
1020
1024
|
* @param {object} props The props to apply on the li element.
|
|
1021
|
-
* @param {
|
|
1025
|
+
* @param {Value} option The option to render.
|
|
1022
1026
|
* @param {object} state The state of each option.
|
|
1023
1027
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1024
1028
|
* @returns {ReactNode}
|
|
@@ -1027,7 +1031,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1027
1031
|
/**
|
|
1028
1032
|
* Render the selected value.
|
|
1029
1033
|
*
|
|
1030
|
-
* @param {
|
|
1034
|
+
* @param {Value[]} value The `value` provided to the component.
|
|
1031
1035
|
* @param {function} getTagProps A tag props getter.
|
|
1032
1036
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1033
1037
|
* @returns {ReactNode}
|
package/node/Divider/Divider.js
CHANGED
|
@@ -187,6 +187,12 @@ const Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
|
|
|
187
187
|
}) : null
|
|
188
188
|
}));
|
|
189
189
|
});
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The following flag is used to ensure that this component isn't tabbable i.e.
|
|
193
|
+
* does not get highlight/focus inside of MUI List.
|
|
194
|
+
*/
|
|
195
|
+
Divider.muiSkipListHighlight = true;
|
|
190
196
|
process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */ = {
|
|
191
197
|
// ----------------------------- Warning --------------------------------
|
|
192
198
|
// | These PropTypes are generated from the TypeScript type definitions |
|
package/node/Menu/Menu.js
CHANGED
|
@@ -22,7 +22,7 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
22
22
|
var _menuClasses = require("./menuClasses");
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
const _excluded = ["onEntering"],
|
|
25
|
-
_excluded2 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
|
|
25
|
+
_excluded2 = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"];
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
28
|
const RTL_ORIGIN = {
|
|
@@ -72,6 +72,7 @@ const MenuMenuList = (0, _styled.default)(_MenuList.default, {
|
|
|
72
72
|
outline: 0
|
|
73
73
|
});
|
|
74
74
|
const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
75
|
+
var _slots$paper, _slotProps$paper;
|
|
75
76
|
const props = (0, _useThemeProps.default)({
|
|
76
77
|
props: inProps,
|
|
77
78
|
name: 'MuiMenu'
|
|
@@ -79,6 +80,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
79
80
|
const {
|
|
80
81
|
autoFocus = true,
|
|
81
82
|
children,
|
|
83
|
+
className,
|
|
82
84
|
disableAutoFocusItem = false,
|
|
83
85
|
MenuListProps = {},
|
|
84
86
|
onClose,
|
|
@@ -89,7 +91,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
89
91
|
TransitionProps: {
|
|
90
92
|
onEntering
|
|
91
93
|
} = {},
|
|
92
|
-
variant = 'selectedMenu'
|
|
94
|
+
variant = 'selectedMenu',
|
|
95
|
+
slots = {},
|
|
96
|
+
slotProps = {}
|
|
93
97
|
} = props,
|
|
94
98
|
TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
|
|
95
99
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
@@ -151,6 +155,20 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
});
|
|
158
|
+
const PaperSlot = (_slots$paper = slots.paper) != null ? _slots$paper : MenuPaper;
|
|
159
|
+
const paperExternalSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : PaperProps;
|
|
160
|
+
const rootSlotProps = (0, _base.useSlotProps)({
|
|
161
|
+
elementType: slots.root,
|
|
162
|
+
externalSlotProps: slotProps.root,
|
|
163
|
+
ownerState,
|
|
164
|
+
className: [classes.root, className]
|
|
165
|
+
});
|
|
166
|
+
const paperSlotProps = (0, _base.useSlotProps)({
|
|
167
|
+
elementType: PaperSlot,
|
|
168
|
+
externalSlotProps: paperExternalSlotProps,
|
|
169
|
+
ownerState,
|
|
170
|
+
className: classes.paper
|
|
171
|
+
});
|
|
154
172
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuRoot, (0, _extends2.default)({
|
|
155
173
|
onClose: onClose,
|
|
156
174
|
anchorOrigin: {
|
|
@@ -159,16 +177,13 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
159
177
|
},
|
|
160
178
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
161
179
|
slots: {
|
|
162
|
-
paper:
|
|
180
|
+
paper: PaperSlot,
|
|
181
|
+
root: slots.root
|
|
163
182
|
},
|
|
164
183
|
slotProps: {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
root: classes.paper
|
|
168
|
-
})
|
|
169
|
-
})
|
|
184
|
+
root: rootSlotProps,
|
|
185
|
+
paper: paperSlotProps
|
|
170
186
|
},
|
|
171
|
-
className: classes.root,
|
|
172
187
|
open: open,
|
|
173
188
|
ref: ref,
|
|
174
189
|
transitionDuration: transitionDuration,
|
|
@@ -216,6 +231,10 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
216
231
|
* Override or extend the styles applied to the component.
|
|
217
232
|
*/
|
|
218
233
|
classes: _propTypes.default.object,
|
|
234
|
+
/**
|
|
235
|
+
* @ignore
|
|
236
|
+
*/
|
|
237
|
+
className: _propTypes.default.string,
|
|
219
238
|
/**
|
|
220
239
|
* When opening the menu will not focus the active item but the `[role="menu"]`
|
|
221
240
|
* unless `autoFocus` is also set to `false`. Not using the default means not
|
|
@@ -248,6 +267,25 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
248
267
|
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
|
249
268
|
*/
|
|
250
269
|
PopoverClasses: _propTypes.default.object,
|
|
270
|
+
/**
|
|
271
|
+
* The extra props for the slot components.
|
|
272
|
+
* You can override the existing props or add new ones.
|
|
273
|
+
*
|
|
274
|
+
* @default {}
|
|
275
|
+
*/
|
|
276
|
+
slotProps: _propTypes.default.shape({
|
|
277
|
+
paper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
278
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
279
|
+
}),
|
|
280
|
+
/**
|
|
281
|
+
* The components used for each slot inside.
|
|
282
|
+
*
|
|
283
|
+
* @default {}
|
|
284
|
+
*/
|
|
285
|
+
slots: _propTypes.default.shape({
|
|
286
|
+
paper: _propTypes.default.elementType,
|
|
287
|
+
root: _propTypes.default.elementType
|
|
288
|
+
}),
|
|
251
289
|
/**
|
|
252
290
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
253
291
|
*/
|
package/node/Select/Select.js
CHANGED
|
@@ -230,7 +230,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
|
|
|
230
230
|
/**
|
|
231
231
|
* Callback fired when a menu item is selected.
|
|
232
232
|
*
|
|
233
|
-
* @param {SelectChangeEvent<
|
|
233
|
+
* @param {SelectChangeEvent<Value>} event The event source of the callback.
|
|
234
234
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
235
235
|
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
236
236
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.22.6",
|
|
49
|
-
"@mui/base": "5.0.0-beta.
|
|
50
|
-
"@mui/core-downloads-tracker": "^5.14.
|
|
51
|
-
"@mui/system": "^5.14.
|
|
49
|
+
"@mui/base": "5.0.0-beta.9",
|
|
50
|
+
"@mui/core-downloads-tracker": "^5.14.3",
|
|
51
|
+
"@mui/system": "^5.14.3",
|
|
52
52
|
"@mui/types": "^7.2.4",
|
|
53
|
-
"@mui/utils": "^5.14.
|
|
53
|
+
"@mui/utils": "^5.14.3",
|
|
54
54
|
"@types/react-transition-group": "^4.4.6",
|
|
55
|
-
"clsx": "^
|
|
55
|
+
"clsx": "^2.0.0",
|
|
56
56
|
"csstype": "^3.1.2",
|
|
57
57
|
"prop-types": "^15.8.1",
|
|
58
58
|
"react-is": "^18.2.0",
|
|
@@ -12,6 +12,6 @@ export interface ThemeProviderProps<Theme = DefaultTheme> {
|
|
|
12
12
|
*
|
|
13
13
|
* - [ThemeProvider API](https://mui.com/material-ui/customization/theming/#themeprovider)
|
|
14
14
|
*/
|
|
15
|
-
export default function ThemeProvider<
|
|
16
|
-
props: ThemeProviderProps<
|
|
17
|
-
): React.ReactElement<ThemeProviderProps<
|
|
15
|
+
export default function ThemeProvider<Theme = DefaultTheme>(
|
|
16
|
+
props: ThemeProviderProps<Theme>,
|
|
17
|
+
): React.ReactElement<ThemeProviderProps<Theme>>;
|
package/styles/components.d.ts
CHANGED
|
@@ -17,16 +17,15 @@ export type Variant =
|
|
|
17
17
|
| 'button'
|
|
18
18
|
| 'overline';
|
|
19
19
|
|
|
20
|
-
export interface FontStyle
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}> {}
|
|
20
|
+
export interface FontStyle {
|
|
21
|
+
fontFamily: React.CSSProperties['fontFamily'];
|
|
22
|
+
fontSize: number;
|
|
23
|
+
fontWeightLight: React.CSSProperties['fontWeight'];
|
|
24
|
+
fontWeightRegular: React.CSSProperties['fontWeight'];
|
|
25
|
+
fontWeightMedium: React.CSSProperties['fontWeight'];
|
|
26
|
+
fontWeightBold: React.CSSProperties['fontWeight'];
|
|
27
|
+
htmlFontSize: number;
|
|
28
|
+
}
|
|
30
29
|
|
|
31
30
|
export type NormalCssProperties = CSS.Properties<number | string>;
|
|
32
31
|
export type Fontface = CSS.AtRule.FontFace & { fallbacks?: CSS.AtRule.FontFace[] };
|
package/styles/overrides.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ import { SnackbarContentClassKey } from '../SnackbarContent';
|
|
|
86
86
|
import { SpeedDialClassKey } from '../SpeedDial';
|
|
87
87
|
import { SpeedDialActionClassKey } from '../SpeedDialAction';
|
|
88
88
|
import { SpeedDialIconClassKey } from '../SpeedDialIcon';
|
|
89
|
+
import { StackClassKey } from '../Stack';
|
|
89
90
|
import { StepButtonClasskey } from '../StepButton';
|
|
90
91
|
import { StepClasskey } from '../Step';
|
|
91
92
|
import { StepConnectorClasskey } from '../StepConnector';
|
|
@@ -225,6 +226,7 @@ export interface ComponentNameToClassKey {
|
|
|
225
226
|
MuiSpeedDial: SpeedDialClassKey;
|
|
226
227
|
MuiSpeedDialAction: SpeedDialActionClassKey;
|
|
227
228
|
MuiSpeedDialIcon: SpeedDialIconClassKey;
|
|
229
|
+
MuiStack: StackClassKey;
|
|
228
230
|
MuiStep: StepClasskey;
|
|
229
231
|
MuiStepButton: StepButtonClasskey;
|
|
230
232
|
MuiStepConnector: StepConnectorClasskey;
|
|
@@ -6,26 +6,26 @@ declare module '@mui/material/OverridableComponent' {
|
|
|
6
6
|
*
|
|
7
7
|
* Adjusts valid props based on the type of `component`.
|
|
8
8
|
*/
|
|
9
|
-
interface OverridableComponent<
|
|
10
|
-
<
|
|
9
|
+
interface OverridableComponent<TypeMap extends OverridableTypeMap> {
|
|
10
|
+
<DefaultComponent extends React.ElementType>(props: {
|
|
11
11
|
/**
|
|
12
12
|
* The component used for the root node.
|
|
13
13
|
* Either a string to use a HTML element or a component.
|
|
14
14
|
*/
|
|
15
|
-
component:
|
|
16
|
-
} & OverridePropsVer2<
|
|
17
|
-
(props: DefaultComponentPropsVer2<
|
|
15
|
+
component: DefaultComponent;
|
|
16
|
+
} & OverridePropsVer2<TypeMap, DefaultComponent>): JSX.Element;
|
|
17
|
+
(props: DefaultComponentPropsVer2<TypeMap>): JSX.Element;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Props of the component if `component={Component}` is used.
|
|
21
21
|
*/
|
|
22
|
-
type OverridePropsVer2<
|
|
22
|
+
type OverridePropsVer2<TypeMap extends OverridableTypeMap, RootComponent extends React.ElementType> = (BaseProps<TypeMap> & DistributiveOmit<React.ComponentPropsWithoutRef<RootComponent>, keyof BaseProps<TypeMap>> & {
|
|
23
23
|
ref?: React.Ref<Element>;
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
26
|
* Props if `component={Component}` is NOT used.
|
|
27
27
|
*/
|
|
28
|
-
type DefaultComponentPropsVer2<
|
|
28
|
+
type DefaultComponentPropsVer2<TypeMap extends OverridableTypeMap> = BaseProps<TypeMap> & DistributiveOmit<React.ComponentPropsWithoutRef<TypeMap['defaultComponent']>, keyof BaseProps<TypeMap>> & {
|
|
29
29
|
ref?: React.Ref<Element>;
|
|
30
30
|
};
|
|
31
31
|
}
|