@mui/material 5.14.1 → 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/Button/Button.js +1 -1
- package/ButtonBase/ButtonBase.d.ts +17 -12
- package/ButtonGroup/ButtonGroup.d.ts +11 -6
- package/CHANGELOG.md +152 -1
- package/Card/Card.d.ts +11 -6
- 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/Chip/Chip.js +0 -2
- package/Container/Container.d.ts +11 -6
- 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/Fab/Fab.d.ts +11 -6
- package/Fab/Fab.js +1 -1
- 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 +11 -6
- package/List/List.d.ts +17 -10
- package/ListItem/ListItem.d.ts +9 -7
- package/ListItem/ListItem.js +1 -1
- package/ListItemButton/ListItemButton.d.ts +9 -7
- package/ListItemButton/ListItemButton.js +1 -1
- 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/MenuItem/MenuItem.js +1 -1
- package/MenuList/MenuList.d.ts +11 -6
- package/Modal/Modal.d.ts +11 -6
- package/OverridableComponent.d.ts +14 -21
- package/PaginationItem/PaginationItem.d.ts +12 -7
- package/Paper/Paper.d.ts +14 -9
- package/Paper/index.d.ts +1 -1
- package/README.md +1 -1
- 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/Tabs/Tabs.js +39 -42
- package/ToggleButton/ToggleButton.d.ts +9 -7
- package/Toolbar/Toolbar.d.ts +11 -6
- package/Typography/Typography.d.ts +11 -6
- package/index.d.ts +9 -9
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +19 -16
- package/legacy/Button/Button.js +1 -1
- package/legacy/Chip/Chip.js +0 -2
- package/legacy/Divider/Divider.js +6 -0
- package/legacy/Fab/Fab.js +1 -1
- package/legacy/ListItem/ListItem.js +1 -1
- package/legacy/ListItemButton/ListItemButton.js +1 -1
- package/legacy/Menu/Menu.js +49 -9
- package/legacy/MenuItem/MenuItem.js +1 -1
- package/legacy/Select/Select.js +1 -1
- package/legacy/Tabs/Tabs.js +48 -48
- package/legacy/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +16 -12
- package/modern/Button/Button.js +1 -1
- package/modern/Chip/Chip.js +0 -2
- package/modern/Divider/Divider.js +6 -0
- package/modern/Fab/Fab.js +1 -1
- package/modern/ListItem/ListItem.js +1 -1
- package/modern/ListItemButton/ListItemButton.js +1 -1
- package/modern/Menu/Menu.js +47 -10
- package/modern/MenuItem/MenuItem.js +1 -1
- package/modern/Select/Select.js +1 -1
- package/modern/Tabs/Tabs.js +39 -42
- package/modern/index.js +1 -1
- package/node/Autocomplete/Autocomplete.js +19 -15
- package/node/Button/Button.js +1 -1
- package/node/Chip/Chip.js +0 -2
- package/node/Divider/Divider.js +6 -0
- package/node/Fab/Fab.js +1 -1
- package/node/ListItem/ListItem.js +1 -1
- package/node/ListItemButton/ListItemButton.js +1 -1
- package/node/Menu/Menu.js +47 -9
- package/node/MenuItem/MenuItem.js +1 -1
- package/node/Select/Select.js +1 -1
- package/node/Tabs/Tabs.js +39 -42
- 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/styles/props.d.ts +1 -1
- package/types/OverridableComponentAugmentation.d.ts +7 -7
- package/umd/material-ui.development.js +362 -324
- package/umd/material-ui.production.min.js +21 -21
package/Tabs/Tabs.js
CHANGED
|
@@ -280,10 +280,9 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
280
280
|
}
|
|
281
281
|
const [mounted, setMounted] = React.useState(false);
|
|
282
282
|
const [indicatorStyle, setIndicatorStyle] = React.useState(defaultIndicatorStyle);
|
|
283
|
-
const [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
});
|
|
283
|
+
const [displayStartScroll, setDisplayStartScroll] = React.useState(false);
|
|
284
|
+
const [displayEndScroll, setDisplayEndScroll] = React.useState(false);
|
|
285
|
+
const [updateScrollObserver, setUpdateScrollObserver] = React.useState(false);
|
|
287
286
|
const [scrollerStyle, setScrollerStyle] = React.useState({
|
|
288
287
|
overflow: 'hidden',
|
|
289
288
|
scrollbarWidth: 0
|
|
@@ -434,7 +433,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
434
433
|
onChange: handleScrollbarSizeChange,
|
|
435
434
|
className: clsx(classes.scrollableX, classes.hideScrollbar)
|
|
436
435
|
}) : null;
|
|
437
|
-
const scrollButtonsActive =
|
|
436
|
+
const scrollButtonsActive = displayStartScroll || displayEndScroll;
|
|
438
437
|
const showScrollButtons = scrollable && (scrollButtons === 'auto' && scrollButtonsActive || scrollButtons === true);
|
|
439
438
|
conditionalElements.scrollButtonStart = showScrollButtons ? /*#__PURE__*/_jsx(ScrollButtonComponent, _extends({
|
|
440
439
|
slots: {
|
|
@@ -446,7 +445,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
446
445
|
orientation: orientation,
|
|
447
446
|
direction: isRtl ? 'right' : 'left',
|
|
448
447
|
onClick: handleStartScrollClick,
|
|
449
|
-
disabled: !
|
|
448
|
+
disabled: !displayStartScroll
|
|
450
449
|
}, TabScrollButtonProps, {
|
|
451
450
|
className: clsx(classes.scrollButtons, TabScrollButtonProps.className)
|
|
452
451
|
})) : null;
|
|
@@ -460,7 +459,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
460
459
|
orientation: orientation,
|
|
461
460
|
direction: isRtl ? 'left' : 'right',
|
|
462
461
|
onClick: handleEndScrollClick,
|
|
463
|
-
disabled: !
|
|
462
|
+
disabled: !displayEndScroll
|
|
464
463
|
}, TabScrollButtonProps, {
|
|
465
464
|
className: clsx(classes.scrollButtons, TabScrollButtonProps.className)
|
|
466
465
|
})) : null;
|
|
@@ -490,30 +489,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
490
489
|
});
|
|
491
490
|
const updateScrollButtonState = useEventCallback(() => {
|
|
492
491
|
if (scrollable && scrollButtons !== false) {
|
|
493
|
-
|
|
494
|
-
scrollTop,
|
|
495
|
-
scrollHeight,
|
|
496
|
-
clientHeight,
|
|
497
|
-
scrollWidth,
|
|
498
|
-
clientWidth
|
|
499
|
-
} = tabsRef.current;
|
|
500
|
-
let showStartScroll;
|
|
501
|
-
let showEndScroll;
|
|
502
|
-
if (vertical) {
|
|
503
|
-
showStartScroll = scrollTop > 1;
|
|
504
|
-
showEndScroll = scrollTop < scrollHeight - clientHeight - 1;
|
|
505
|
-
} else {
|
|
506
|
-
const scrollLeft = getNormalizedScrollLeft(tabsRef.current, theme.direction);
|
|
507
|
-
// use 1 for the potential rounding error with browser zooms.
|
|
508
|
-
showStartScroll = isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
|
|
509
|
-
showEndScroll = !isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
|
|
510
|
-
}
|
|
511
|
-
if (showStartScroll !== displayScroll.start || showEndScroll !== displayScroll.end) {
|
|
512
|
-
setDisplayScroll({
|
|
513
|
-
start: showStartScroll,
|
|
514
|
-
end: showEndScroll
|
|
515
|
-
});
|
|
516
|
-
}
|
|
492
|
+
setUpdateScrollObserver(!updateScrollObserver);
|
|
517
493
|
}
|
|
518
494
|
});
|
|
519
495
|
React.useEffect(() => {
|
|
@@ -526,7 +502,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
526
502
|
// replaced by Suspense with a fallback, once React is updated to version 18
|
|
527
503
|
if (tabsRef.current) {
|
|
528
504
|
updateIndicatorState();
|
|
529
|
-
updateScrollButtonState();
|
|
530
505
|
}
|
|
531
506
|
});
|
|
532
507
|
const win = ownerWindow(tabsRef.current);
|
|
@@ -545,21 +520,44 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
545
520
|
resizeObserver.disconnect();
|
|
546
521
|
}
|
|
547
522
|
};
|
|
548
|
-
}, [updateIndicatorState
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
523
|
+
}, [updateIndicatorState]);
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Toggle visibility of start and end scroll buttons
|
|
527
|
+
* Using IntersectionObserver on first and last Tabs.
|
|
528
|
+
*/
|
|
552
529
|
React.useEffect(() => {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
530
|
+
const tabListChildren = Array.from(tabListRef.current.children);
|
|
531
|
+
const length = tabListChildren.length;
|
|
532
|
+
if (typeof IntersectionObserver !== 'undefined' && length > 0 && scrollable && scrollButtons !== false) {
|
|
533
|
+
const firstTab = tabListChildren[0];
|
|
534
|
+
const lastTab = tabListChildren[length - 1];
|
|
535
|
+
const observerOptions = {
|
|
536
|
+
root: tabsRef.current,
|
|
537
|
+
threshold: 0.99
|
|
538
|
+
};
|
|
539
|
+
const handleScrollButtonStart = entries => {
|
|
540
|
+
setDisplayStartScroll(!entries[0].isIntersecting);
|
|
541
|
+
};
|
|
542
|
+
const firstObserver = new IntersectionObserver(handleScrollButtonStart, observerOptions);
|
|
543
|
+
firstObserver.observe(firstTab);
|
|
544
|
+
const handleScrollButtonEnd = entries => {
|
|
545
|
+
setDisplayEndScroll(!entries[0].isIntersecting);
|
|
546
|
+
};
|
|
547
|
+
const lastObserver = new IntersectionObserver(handleScrollButtonEnd, observerOptions);
|
|
548
|
+
lastObserver.observe(lastTab);
|
|
549
|
+
return () => {
|
|
550
|
+
firstObserver.disconnect();
|
|
551
|
+
lastObserver.disconnect();
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
return undefined;
|
|
555
|
+
}, [scrollable, scrollButtons, updateScrollObserver, childrenProp == null ? void 0 : childrenProp.length]);
|
|
557
556
|
React.useEffect(() => {
|
|
558
557
|
setMounted(true);
|
|
559
558
|
}, []);
|
|
560
559
|
React.useEffect(() => {
|
|
561
560
|
updateIndicatorState();
|
|
562
|
-
updateScrollButtonState();
|
|
563
561
|
});
|
|
564
562
|
React.useEffect(() => {
|
|
565
563
|
// Don't animate on the first render.
|
|
@@ -653,7 +651,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
653
651
|
[vertical ? `margin${isRtl ? 'Left' : 'Right'}` : 'marginBottom']: visibleScrollbar ? undefined : -scrollerStyle.scrollbarWidth
|
|
654
652
|
},
|
|
655
653
|
ref: tabsRef,
|
|
656
|
-
onScroll: handleTabsScroll,
|
|
657
654
|
children: [/*#__PURE__*/_jsx(FlexContainer, {
|
|
658
655
|
"aria-label": ariaLabel,
|
|
659
656
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -11,10 +11,10 @@ export interface ToggleButtonPropsSizeOverrides {}
|
|
|
11
11
|
export interface ToggleButtonPropsColorOverrides {}
|
|
12
12
|
|
|
13
13
|
export type ToggleButtonTypeMap<
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
AdditionalProps = {},
|
|
15
|
+
DefaultComponent extends React.ElementType = 'button',
|
|
16
16
|
> = ExtendButtonBaseTypeMap<{
|
|
17
|
-
props:
|
|
17
|
+
props: AdditionalProps & {
|
|
18
18
|
/**
|
|
19
19
|
* The content of the component.
|
|
20
20
|
*/
|
|
@@ -82,7 +82,7 @@ export type ToggleButtonTypeMap<
|
|
|
82
82
|
*/
|
|
83
83
|
value: NonNullable<unknown>;
|
|
84
84
|
};
|
|
85
|
-
defaultComponent:
|
|
85
|
+
defaultComponent: DefaultComponent;
|
|
86
86
|
}>;
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -99,8 +99,10 @@ export type ToggleButtonTypeMap<
|
|
|
99
99
|
declare const ToggleButton: ExtendButtonBase<ToggleButtonTypeMap>;
|
|
100
100
|
|
|
101
101
|
export type ToggleButtonProps<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
> = OverrideProps<ToggleButtonTypeMap<
|
|
102
|
+
RootComponent extends React.ElementType = ToggleButtonTypeMap['defaultComponent'],
|
|
103
|
+
AdditionalProps = {},
|
|
104
|
+
> = OverrideProps<ToggleButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
105
|
+
component?: React.ElementType;
|
|
106
|
+
};
|
|
105
107
|
|
|
106
108
|
export default ToggleButton;
|
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;
|
|
@@ -73,9 +73,12 @@ export interface TypographyOwnProps extends SystemProps<Theme> {
|
|
|
73
73
|
>;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export interface TypographyTypeMap<
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
export interface TypographyTypeMap<
|
|
77
|
+
AdditionalProps = {},
|
|
78
|
+
DefaultComponent extends React.ElementType = 'span',
|
|
79
|
+
> {
|
|
80
|
+
props: AdditionalProps & TypographyOwnProps;
|
|
81
|
+
defaultComponent: DefaultComponent;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
/**
|
|
@@ -92,8 +95,10 @@ export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'span'>
|
|
|
92
95
|
declare const Typography: OverridableComponent<TypographyTypeMap>;
|
|
93
96
|
|
|
94
97
|
export type TypographyProps<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
> = OverrideProps<TypographyTypeMap<
|
|
98
|
+
RootComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
|
|
99
|
+
AdditionalProps = {},
|
|
100
|
+
> = OverrideProps<TypographyTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
101
|
+
component?: React.ElementType;
|
|
102
|
+
};
|
|
98
103
|
|
|
99
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}
|
package/legacy/Button/Button.js
CHANGED
|
@@ -307,7 +307,7 @@ process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */
|
|
|
307
307
|
* The component used for the root node.
|
|
308
308
|
* Either a string to use a HTML element or a component.
|
|
309
309
|
*/
|
|
310
|
-
component: PropTypes
|
|
310
|
+
component: PropTypes.elementType,
|
|
311
311
|
/**
|
|
312
312
|
* If `true`, the component is disabled.
|
|
313
313
|
* @default false
|
package/legacy/Chip/Chip.js
CHANGED
|
@@ -67,8 +67,6 @@ var ChipRoot = styled('div', {
|
|
|
67
67
|
borderRadius: 32 / 2,
|
|
68
68
|
whiteSpace: 'nowrap',
|
|
69
69
|
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
|
70
|
-
// label will inherit this from root, then `clickable` class overrides this for both
|
|
71
|
-
cursor: 'default',
|
|
72
70
|
// We disable the focus ring for mouse, touch and keyboard users.
|
|
73
71
|
outline: 0,
|
|
74
72
|
textDecoration: 'none',
|
|
@@ -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/Fab/Fab.js
CHANGED
|
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes /* remove-proptypes */ = {
|
|
|
186
186
|
* The component used for the root node.
|
|
187
187
|
* Either a string to use a HTML element or a component.
|
|
188
188
|
*/
|
|
189
|
-
component: PropTypes
|
|
189
|
+
component: PropTypes.elementType,
|
|
190
190
|
/**
|
|
191
191
|
* If `true`, the component is disabled.
|
|
192
192
|
* @default false
|
|
@@ -319,7 +319,7 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes /* remove-proptypes *
|
|
|
319
319
|
* The component used for the root node.
|
|
320
320
|
* Either a string to use a HTML element or a component.
|
|
321
321
|
*/
|
|
322
|
-
component: PropTypes
|
|
322
|
+
component: PropTypes.elementType,
|
|
323
323
|
/**
|
|
324
324
|
* The components used for each slot inside.
|
|
325
325
|
*
|
|
@@ -195,7 +195,7 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes /* remove-propt
|
|
|
195
195
|
* The component used for the root node.
|
|
196
196
|
* Either a string to use a HTML element or a component.
|
|
197
197
|
*/
|
|
198
|
-
component: PropTypes
|
|
198
|
+
component: PropTypes.elementType,
|
|
199
199
|
/**
|
|
200
200
|
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
|
201
201
|
* The prop defaults to the value inherited from the parent List component.
|
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
|
*/
|
|
@@ -201,7 +201,7 @@ process.env.NODE_ENV !== "production" ? MenuItem.propTypes /* remove-proptypes *
|
|
|
201
201
|
* The component used for the root node.
|
|
202
202
|
* Either a string to use a HTML element or a component.
|
|
203
203
|
*/
|
|
204
|
-
component: PropTypes
|
|
204
|
+
component: PropTypes.elementType,
|
|
205
205
|
/**
|
|
206
206
|
* If `true`, compact vertical padding designed for keyboard and mouse input is used.
|
|
207
207
|
* The prop defaults to the value inherited from the parent Menu component.
|
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).
|