@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/Toolbar/Toolbar.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ import { ToolbarClasses } from './toolbarClasses';
|
|
|
7
7
|
|
|
8
8
|
export interface ToolbarPropsVariantOverrides {}
|
|
9
9
|
|
|
10
|
-
export interface ToolbarTypeMap<
|
|
11
|
-
|
|
10
|
+
export interface ToolbarTypeMap<
|
|
11
|
+
AdditionalProps = {},
|
|
12
|
+
DefaultComponent extends React.ElementType = 'div',
|
|
13
|
+
> {
|
|
14
|
+
props: AdditionalProps & {
|
|
12
15
|
/**
|
|
13
16
|
* The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
|
|
14
17
|
* The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
|
|
@@ -33,7 +36,7 @@ export interface ToolbarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
33
36
|
*/
|
|
34
37
|
sx?: SxProps<Theme>;
|
|
35
38
|
};
|
|
36
|
-
defaultComponent:
|
|
39
|
+
defaultComponent: DefaultComponent;
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
39
42
|
*
|
|
@@ -48,8 +51,10 @@ export interface ToolbarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
48
51
|
declare const Toolbar: OverridableComponent<ToolbarTypeMap>;
|
|
49
52
|
|
|
50
53
|
export type ToolbarProps<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
> = OverrideProps<ToolbarTypeMap<
|
|
54
|
+
RootComponent extends React.ElementType = ToolbarTypeMap['defaultComponent'],
|
|
55
|
+
AdditionalProps = {},
|
|
56
|
+
> = OverrideProps<ToolbarTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
57
|
+
component?: React.ElementType;
|
|
58
|
+
};
|
|
54
59
|
|
|
55
60
|
export default Toolbar;
|
|
@@ -8,73 +8,77 @@ import { TypographyClasses } from './typographyClasses';
|
|
|
8
8
|
|
|
9
9
|
export interface TypographyPropsVariantOverrides {}
|
|
10
10
|
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
11
|
+
export interface TypographyOwnProps extends SystemProps<Theme> {
|
|
12
|
+
/**
|
|
13
|
+
* Set the text-align on the component.
|
|
14
|
+
* @default 'inherit'
|
|
15
|
+
*/
|
|
16
|
+
align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
|
|
17
|
+
/**
|
|
18
|
+
* The content of the component.
|
|
19
|
+
*/
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Override or extend the styles applied to the component.
|
|
23
|
+
*/
|
|
24
|
+
classes?: Partial<TypographyClasses>;
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, the text will have a bottom margin.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
gutterBottom?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
32
|
+
*
|
|
33
|
+
* Note that text overflow can only happen with block or inline-block level elements
|
|
34
|
+
* (the element needs to have a width in order to overflow).
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
noWrap?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If `true`, the element will be a paragraph element.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
paragraph?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
45
|
+
*/
|
|
46
|
+
sx?: SxProps<Theme>;
|
|
47
|
+
/**
|
|
48
|
+
* Applies the theme typography styles.
|
|
49
|
+
* @default 'body1'
|
|
50
|
+
*/
|
|
51
|
+
variant?: OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>;
|
|
52
|
+
/**
|
|
53
|
+
* The component maps the variant prop to a range of different HTML element types.
|
|
54
|
+
* For instance, subtitle1 to `<h6>`.
|
|
55
|
+
* If you wish to change that mapping, you can provide your own.
|
|
56
|
+
* Alternatively, you can use the `component` prop.
|
|
57
|
+
* @default {
|
|
58
|
+
* h1: 'h1',
|
|
59
|
+
* h2: 'h2',
|
|
60
|
+
* h3: 'h3',
|
|
61
|
+
* h4: 'h4',
|
|
62
|
+
* h5: 'h5',
|
|
63
|
+
* h6: 'h6',
|
|
64
|
+
* subtitle1: 'h6',
|
|
65
|
+
* subtitle2: 'h6',
|
|
66
|
+
* body1: 'p',
|
|
67
|
+
* body2: 'p',
|
|
68
|
+
* inherit: 'p',
|
|
69
|
+
* }
|
|
70
|
+
*/
|
|
71
|
+
variantMapping?: Partial<
|
|
72
|
+
Record<OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>, string>
|
|
73
|
+
>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface TypographyTypeMap<
|
|
77
|
+
AdditionalProps = {},
|
|
78
|
+
DefaultComponent extends React.ElementType = 'span',
|
|
79
|
+
> {
|
|
80
|
+
props: AdditionalProps & TypographyOwnProps;
|
|
81
|
+
defaultComponent: DefaultComponent;
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
/**
|
|
@@ -91,8 +95,10 @@ export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'span'>
|
|
|
91
95
|
declare const Typography: OverridableComponent<TypographyTypeMap>;
|
|
92
96
|
|
|
93
97
|
export type TypographyProps<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
> = OverrideProps<TypographyTypeMap<
|
|
98
|
+
RootComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
|
|
99
|
+
AdditionalProps = {},
|
|
100
|
+
> = OverrideProps<TypographyTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
101
|
+
component?: React.ElementType;
|
|
102
|
+
};
|
|
97
103
|
|
|
98
104
|
export default Typography;
|
package/index.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export { StyledComponentProps };
|
|
|
11
11
|
* @deprecated will be removed in v5 for internal usage only
|
|
12
12
|
*/
|
|
13
13
|
export type StandardProps<
|
|
14
|
-
|
|
14
|
+
ComponentProps,
|
|
15
15
|
ClassKey extends string,
|
|
16
|
-
Removals extends keyof
|
|
17
|
-
> = DistributiveOmit<
|
|
16
|
+
Removals extends keyof ComponentProps = never,
|
|
17
|
+
> = DistributiveOmit<ComponentProps, 'classes' | Removals> &
|
|
18
18
|
StyledComponentProps<ClassKey> & {
|
|
19
19
|
className?: string;
|
|
20
|
-
ref?:
|
|
20
|
+
ref?: ComponentProps extends { ref?: infer RefType } ? RefType : React.Ref<unknown>;
|
|
21
21
|
style?: React.CSSProperties;
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -29,13 +29,13 @@ export type StandardProps<
|
|
|
29
29
|
* However, we don't declare classes on this type.
|
|
30
30
|
* It is recommended to declare them manually with an interface so that each class can have a separate JSDoc.
|
|
31
31
|
*/
|
|
32
|
-
export type InternalStandardProps<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
> &
|
|
32
|
+
export type InternalStandardProps<
|
|
33
|
+
ComponentProps,
|
|
34
|
+
Removals extends keyof ComponentProps = never,
|
|
35
|
+
> = DistributiveOmit<ComponentProps, 'classes' | Removals> &
|
|
36
36
|
// each component declares it's classes in a separate interface for proper JSDoc
|
|
37
37
|
StyledComponentProps<never> & {
|
|
38
|
-
ref?:
|
|
38
|
+
ref?: ComponentProps extends { ref?: infer RefType } ? RefType : React.Ref<unknown>;
|
|
39
39
|
// TODO: Remove implicit props. Up to each component.
|
|
40
40
|
className?: string;
|
|
41
41
|
style?: React.CSSProperties;
|
package/index.js
CHANGED
|
@@ -333,6 +333,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
333
333
|
props: inProps,
|
|
334
334
|
name: 'MuiAutocomplete'
|
|
335
335
|
});
|
|
336
|
+
|
|
336
337
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
337
338
|
var _props$autoComplete = props.autoComplete,
|
|
338
339
|
autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete,
|
|
@@ -386,11 +387,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
386
387
|
return "+".concat(more);
|
|
387
388
|
} : _props$getLimitTagsTe,
|
|
388
389
|
getOptionDisabled = props.getOptionDisabled,
|
|
389
|
-
|
|
390
|
-
getOptionLabel = _props$getOptionLabel === void 0 ? function (option) {
|
|
391
|
-
var _option$label;
|
|
392
|
-
return (_option$label = option.label) != null ? _option$label : option;
|
|
393
|
-
} : _props$getOptionLabel,
|
|
390
|
+
getOptionLabelProp = props.getOptionLabel,
|
|
394
391
|
isOptionEqualToValue = props.isOptionEqualToValue,
|
|
395
392
|
groupBy = props.groupBy,
|
|
396
393
|
_props$handleHomeEndK = props.handleHomeEndKeys,
|
|
@@ -476,6 +473,11 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
476
473
|
listboxRef = _getListboxProps.ref,
|
|
477
474
|
otherListboxProps = _objectWithoutProperties(_getListboxProps, ["ref"]);
|
|
478
475
|
var combinedListboxRef = useForkRef(listboxRef, externalListboxRef);
|
|
476
|
+
var defaultGetOptionLabel = function defaultGetOptionLabel(option) {
|
|
477
|
+
var _option$label;
|
|
478
|
+
return (_option$label = option.label) != null ? _option$label : option;
|
|
479
|
+
};
|
|
480
|
+
var getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
479
481
|
|
|
480
482
|
// If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
|
|
481
483
|
var ownerState = _extends({}, props, {
|
|
@@ -483,6 +485,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
483
485
|
expanded: expanded,
|
|
484
486
|
focused: focused,
|
|
485
487
|
fullWidth: fullWidth,
|
|
488
|
+
getOptionLabel: getOptionLabel,
|
|
486
489
|
hasClearIcon: hasClearIcon,
|
|
487
490
|
hasPopupIcon: hasPopupIcon,
|
|
488
491
|
inputFocused: focusedTag === -1,
|
|
@@ -796,9 +799,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
796
799
|
* A function that determines the filtered options to be rendered on search.
|
|
797
800
|
*
|
|
798
801
|
* @default createFilterOptions()
|
|
799
|
-
* @param {
|
|
802
|
+
* @param {Value[]} options The options to render.
|
|
800
803
|
* @param {object} state The state of the component.
|
|
801
|
-
* @returns {
|
|
804
|
+
* @returns {Value[]}
|
|
802
805
|
*/
|
|
803
806
|
filterOptions: PropTypes.func,
|
|
804
807
|
/**
|
|
@@ -832,7 +835,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
832
835
|
/**
|
|
833
836
|
* Used to determine the disabled state for a given option.
|
|
834
837
|
*
|
|
835
|
-
* @param {
|
|
838
|
+
* @param {Value} option The option to test.
|
|
836
839
|
* @returns {boolean}
|
|
837
840
|
*/
|
|
838
841
|
getOptionDisabled: PropTypes.func,
|
|
@@ -842,7 +845,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
842
845
|
*
|
|
843
846
|
* If used in free solo mode, it must accept both the type of the options and a string.
|
|
844
847
|
*
|
|
845
|
-
* @param {
|
|
848
|
+
* @param {Value} option
|
|
846
849
|
* @returns {string}
|
|
847
850
|
* @default (option) => option.label ?? option
|
|
848
851
|
*/
|
|
@@ -851,7 +854,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
851
854
|
* If provided, the options will be grouped under the returned string.
|
|
852
855
|
* The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
|
|
853
856
|
*
|
|
854
|
-
* @param {
|
|
857
|
+
* @param {Value} options The options to group.
|
|
855
858
|
* @returns {string}
|
|
856
859
|
*/
|
|
857
860
|
groupBy: PropTypes.func,
|
|
@@ -880,8 +883,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
880
883
|
* Uses strict equality by default.
|
|
881
884
|
* ⚠️ Both arguments need to be handled, an option can only match with one value.
|
|
882
885
|
*
|
|
883
|
-
* @param {
|
|
884
|
-
* @param {
|
|
886
|
+
* @param {Value} option The option to test.
|
|
887
|
+
* @param {Value} value The value to test against.
|
|
885
888
|
* @returns {boolean}
|
|
886
889
|
*/
|
|
887
890
|
isOptionEqualToValue: PropTypes.func,
|
|
@@ -929,7 +932,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
929
932
|
* Callback fired when the value changes.
|
|
930
933
|
*
|
|
931
934
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
932
|
-
* @param {
|
|
935
|
+
* @param {Value|Value[]} value The new value of the component.
|
|
933
936
|
* @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
|
|
934
937
|
* @param {string} [details]
|
|
935
938
|
*/
|
|
@@ -946,7 +949,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
946
949
|
* Callback fired when the highlight option changes.
|
|
947
950
|
*
|
|
948
951
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
949
|
-
* @param {
|
|
952
|
+
* @param {Value} option The highlighted option.
|
|
950
953
|
* @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
|
|
951
954
|
*/
|
|
952
955
|
onHighlightChange: PropTypes.func,
|
|
@@ -1023,7 +1026,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1023
1026
|
* Render the option, use `getOptionLabel` by default.
|
|
1024
1027
|
*
|
|
1025
1028
|
* @param {object} props The props to apply on the li element.
|
|
1026
|
-
* @param {
|
|
1029
|
+
* @param {Value} option The option to render.
|
|
1027
1030
|
* @param {object} state The state of each option.
|
|
1028
1031
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1029
1032
|
* @returns {ReactNode}
|
|
@@ -1032,7 +1035,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1032
1035
|
/**
|
|
1033
1036
|
* Render the selected value.
|
|
1034
1037
|
*
|
|
1035
|
-
* @param {
|
|
1038
|
+
* @param {Value[]} value The `value` provided to the component.
|
|
1036
1039
|
* @param {function} getTagProps A tag props getter.
|
|
1037
1040
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1038
1041
|
* @returns {ReactNode}
|
|
@@ -184,6 +184,12 @@ var Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
|
|
|
184
184
|
}) : null
|
|
185
185
|
}));
|
|
186
186
|
});
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The following flag is used to ensure that this component isn't tabbable i.e.
|
|
190
|
+
* does not get highlight/focus inside of MUI List.
|
|
191
|
+
*/
|
|
192
|
+
Divider.muiSkipListHighlight = true;
|
|
187
193
|
process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */ = {
|
|
188
194
|
// ----------------------------- Warning --------------------------------
|
|
189
195
|
// | These PropTypes are generated from the TypeScript type definitions |
|
package/legacy/Menu/Menu.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { isFragment } from 'react-is';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
10
10
|
import { HTMLElementType } from '@mui/utils';
|
|
11
11
|
import MenuList from '../MenuList';
|
|
12
12
|
import Popover, { PopoverPaper } from '../Popover';
|
|
@@ -67,6 +67,7 @@ var MenuMenuList = styled(MenuList, {
|
|
|
67
67
|
outline: 0
|
|
68
68
|
});
|
|
69
69
|
var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
70
|
+
var _slots$paper, _slotProps$paper;
|
|
70
71
|
var props = useThemeProps({
|
|
71
72
|
props: inProps,
|
|
72
73
|
name: 'MuiMenu'
|
|
@@ -74,6 +75,7 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
74
75
|
var _props$autoFocus = props.autoFocus,
|
|
75
76
|
autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,
|
|
76
77
|
children = props.children,
|
|
78
|
+
className = props.className,
|
|
77
79
|
_props$disableAutoFoc = props.disableAutoFocusItem,
|
|
78
80
|
disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,
|
|
79
81
|
_props$MenuListProps = props.MenuListProps,
|
|
@@ -91,7 +93,11 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
91
93
|
TransitionProps = _objectWithoutProperties(_props$TransitionProp2, ["onEntering"]),
|
|
92
94
|
_props$variant = props.variant,
|
|
93
95
|
variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,
|
|
94
|
-
|
|
96
|
+
_props$slots = props.slots,
|
|
97
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
98
|
+
_props$slotProps = props.slotProps,
|
|
99
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
100
|
+
other = _objectWithoutProperties(props, ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"]);
|
|
95
101
|
var theme = useTheme();
|
|
96
102
|
var isRtl = theme.direction === 'rtl';
|
|
97
103
|
var ownerState = _extends({}, props, {
|
|
@@ -150,6 +156,20 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
158
|
});
|
|
159
|
+
var PaperSlot = (_slots$paper = slots.paper) != null ? _slots$paper : MenuPaper;
|
|
160
|
+
var paperExternalSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : PaperProps;
|
|
161
|
+
var rootSlotProps = useSlotProps({
|
|
162
|
+
elementType: slots.root,
|
|
163
|
+
externalSlotProps: slotProps.root,
|
|
164
|
+
ownerState: ownerState,
|
|
165
|
+
className: [classes.root, className]
|
|
166
|
+
});
|
|
167
|
+
var paperSlotProps = useSlotProps({
|
|
168
|
+
elementType: PaperSlot,
|
|
169
|
+
externalSlotProps: paperExternalSlotProps,
|
|
170
|
+
ownerState: ownerState,
|
|
171
|
+
className: classes.paper
|
|
172
|
+
});
|
|
153
173
|
return /*#__PURE__*/_jsx(MenuRoot, _extends({
|
|
154
174
|
onClose: onClose,
|
|
155
175
|
anchorOrigin: {
|
|
@@ -158,16 +178,13 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
158
178
|
},
|
|
159
179
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
160
180
|
slots: {
|
|
161
|
-
paper:
|
|
181
|
+
paper: PaperSlot,
|
|
182
|
+
root: slots.root
|
|
162
183
|
},
|
|
163
184
|
slotProps: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
root: classes.paper
|
|
167
|
-
})
|
|
168
|
-
})
|
|
185
|
+
root: rootSlotProps,
|
|
186
|
+
paper: paperSlotProps
|
|
169
187
|
},
|
|
170
|
-
className: classes.root,
|
|
171
188
|
open: open,
|
|
172
189
|
ref: ref,
|
|
173
190
|
transitionDuration: transitionDuration,
|
|
@@ -215,6 +232,10 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
215
232
|
* Override or extend the styles applied to the component.
|
|
216
233
|
*/
|
|
217
234
|
classes: PropTypes.object,
|
|
235
|
+
/**
|
|
236
|
+
* @ignore
|
|
237
|
+
*/
|
|
238
|
+
className: PropTypes.string,
|
|
218
239
|
/**
|
|
219
240
|
* When opening the menu will not focus the active item but the `[role="menu"]`
|
|
220
241
|
* unless `autoFocus` is also set to `false`. Not using the default means not
|
|
@@ -247,6 +268,25 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
247
268
|
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
|
248
269
|
*/
|
|
249
270
|
PopoverClasses: PropTypes.object,
|
|
271
|
+
/**
|
|
272
|
+
* The extra props for the slot components.
|
|
273
|
+
* You can override the existing props or add new ones.
|
|
274
|
+
*
|
|
275
|
+
* @default {}
|
|
276
|
+
*/
|
|
277
|
+
slotProps: PropTypes.shape({
|
|
278
|
+
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
279
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
280
|
+
}),
|
|
281
|
+
/**
|
|
282
|
+
* The components used for each slot inside.
|
|
283
|
+
*
|
|
284
|
+
* @default {}
|
|
285
|
+
*/
|
|
286
|
+
slots: PropTypes.shape({
|
|
287
|
+
paper: PropTypes.elementType,
|
|
288
|
+
root: PropTypes.elementType
|
|
289
|
+
}),
|
|
250
290
|
/**
|
|
251
291
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
252
292
|
*/
|
package/legacy/Select/Select.js
CHANGED
|
@@ -229,7 +229,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
|
|
|
229
229
|
/**
|
|
230
230
|
* Callback fired when a menu item is selected.
|
|
231
231
|
*
|
|
232
|
-
* @param {SelectChangeEvent<
|
|
232
|
+
* @param {SelectChangeEvent<Value>} event The event source of the callback.
|
|
233
233
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
234
234
|
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
235
235
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
package/legacy/index.js
CHANGED
|
@@ -372,6 +372,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
372
372
|
props: inProps,
|
|
373
373
|
name: 'MuiAutocomplete'
|
|
374
374
|
});
|
|
375
|
+
|
|
375
376
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
376
377
|
const {
|
|
377
378
|
autoComplete = false,
|
|
@@ -400,7 +401,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
400
401
|
freeSolo = false,
|
|
401
402
|
fullWidth = false,
|
|
402
403
|
getLimitTagsText = more => `+${more}`,
|
|
403
|
-
getOptionLabel
|
|
404
|
+
getOptionLabel: getOptionLabelProp,
|
|
404
405
|
groupBy,
|
|
405
406
|
handleHomeEndKeys = !props.freeSolo,
|
|
406
407
|
includeInputInList = false,
|
|
@@ -465,6 +466,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
465
466
|
} = _getListboxProps,
|
|
466
467
|
otherListboxProps = _objectWithoutPropertiesLoose(_getListboxProps, _excluded2);
|
|
467
468
|
const combinedListboxRef = useForkRef(listboxRef, externalListboxRef);
|
|
469
|
+
const defaultGetOptionLabel = option => option.label ?? option;
|
|
470
|
+
const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
468
471
|
|
|
469
472
|
// If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
|
|
470
473
|
const ownerState = _extends({}, props, {
|
|
@@ -472,6 +475,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
472
475
|
expanded,
|
|
473
476
|
focused,
|
|
474
477
|
fullWidth,
|
|
478
|
+
getOptionLabel,
|
|
475
479
|
hasClearIcon,
|
|
476
480
|
hasPopupIcon,
|
|
477
481
|
inputFocused: focusedTag === -1,
|
|
@@ -775,9 +779,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
775
779
|
* A function that determines the filtered options to be rendered on search.
|
|
776
780
|
*
|
|
777
781
|
* @default createFilterOptions()
|
|
778
|
-
* @param {
|
|
782
|
+
* @param {Value[]} options The options to render.
|
|
779
783
|
* @param {object} state The state of the component.
|
|
780
|
-
* @returns {
|
|
784
|
+
* @returns {Value[]}
|
|
781
785
|
*/
|
|
782
786
|
filterOptions: PropTypes.func,
|
|
783
787
|
/**
|
|
@@ -811,7 +815,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
811
815
|
/**
|
|
812
816
|
* Used to determine the disabled state for a given option.
|
|
813
817
|
*
|
|
814
|
-
* @param {
|
|
818
|
+
* @param {Value} option The option to test.
|
|
815
819
|
* @returns {boolean}
|
|
816
820
|
*/
|
|
817
821
|
getOptionDisabled: PropTypes.func,
|
|
@@ -821,7 +825,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
821
825
|
*
|
|
822
826
|
* If used in free solo mode, it must accept both the type of the options and a string.
|
|
823
827
|
*
|
|
824
|
-
* @param {
|
|
828
|
+
* @param {Value} option
|
|
825
829
|
* @returns {string}
|
|
826
830
|
* @default (option) => option.label ?? option
|
|
827
831
|
*/
|
|
@@ -830,7 +834,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
830
834
|
* If provided, the options will be grouped under the returned string.
|
|
831
835
|
* The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
|
|
832
836
|
*
|
|
833
|
-
* @param {
|
|
837
|
+
* @param {Value} options The options to group.
|
|
834
838
|
* @returns {string}
|
|
835
839
|
*/
|
|
836
840
|
groupBy: PropTypes.func,
|
|
@@ -859,8 +863,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
859
863
|
* Uses strict equality by default.
|
|
860
864
|
* ⚠️ Both arguments need to be handled, an option can only match with one value.
|
|
861
865
|
*
|
|
862
|
-
* @param {
|
|
863
|
-
* @param {
|
|
866
|
+
* @param {Value} option The option to test.
|
|
867
|
+
* @param {Value} value The value to test against.
|
|
864
868
|
* @returns {boolean}
|
|
865
869
|
*/
|
|
866
870
|
isOptionEqualToValue: PropTypes.func,
|
|
@@ -908,7 +912,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
908
912
|
* Callback fired when the value changes.
|
|
909
913
|
*
|
|
910
914
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
911
|
-
* @param {
|
|
915
|
+
* @param {Value|Value[]} value The new value of the component.
|
|
912
916
|
* @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
|
|
913
917
|
* @param {string} [details]
|
|
914
918
|
*/
|
|
@@ -925,7 +929,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
925
929
|
* Callback fired when the highlight option changes.
|
|
926
930
|
*
|
|
927
931
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
928
|
-
* @param {
|
|
932
|
+
* @param {Value} option The highlighted option.
|
|
929
933
|
* @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
|
|
930
934
|
*/
|
|
931
935
|
onHighlightChange: PropTypes.func,
|
|
@@ -1002,7 +1006,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1002
1006
|
* Render the option, use `getOptionLabel` by default.
|
|
1003
1007
|
*
|
|
1004
1008
|
* @param {object} props The props to apply on the li element.
|
|
1005
|
-
* @param {
|
|
1009
|
+
* @param {Value} option The option to render.
|
|
1006
1010
|
* @param {object} state The state of each option.
|
|
1007
1011
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1008
1012
|
* @returns {ReactNode}
|
|
@@ -1011,7 +1015,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1011
1015
|
/**
|
|
1012
1016
|
* Render the selected value.
|
|
1013
1017
|
*
|
|
1014
|
-
* @param {
|
|
1018
|
+
* @param {Value[]} value The `value` provided to the component.
|
|
1015
1019
|
* @param {function} getTagProps A tag props getter.
|
|
1016
1020
|
* @param {object} ownerState The state of the Autocomplete component.
|
|
1017
1021
|
* @returns {ReactNode}
|
|
@@ -179,6 +179,12 @@ const Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
|
|
|
179
179
|
}) : null
|
|
180
180
|
}));
|
|
181
181
|
});
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The following flag is used to ensure that this component isn't tabbable i.e.
|
|
185
|
+
* does not get highlight/focus inside of MUI List.
|
|
186
|
+
*/
|
|
187
|
+
Divider.muiSkipListHighlight = true;
|
|
182
188
|
process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */ = {
|
|
183
189
|
// ----------------------------- Warning --------------------------------
|
|
184
190
|
// | These PropTypes are generated from the TypeScript type definitions |
|