@mui/material 5.13.3 → 5.13.4
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/Autocomplete/autocompleteClasses.d.ts +2 -0
- package/CHANGELOG.md +45 -0
- package/Menu/Menu.d.ts +3 -0
- package/Menu/Menu.js +11 -9
- package/MenuList/MenuList.js +7 -0
- package/MobileStepper/MobileStepper.js +9 -1
- package/Popover/Popover.d.ts +34 -3
- package/Popover/Popover.js +76 -28
- package/index.js +1 -1
- package/legacy/Menu/Menu.js +11 -9
- package/legacy/MenuList/MenuList.js +7 -0
- package/legacy/MobileStepper/MobileStepper.js +9 -1
- package/legacy/Popover/Popover.js +73 -28
- package/legacy/index.js +1 -1
- package/modern/Menu/Menu.js +11 -9
- package/modern/MenuList/MenuList.js +7 -0
- package/modern/MobileStepper/MobileStepper.js +9 -1
- package/modern/Popover/Popover.js +75 -28
- package/modern/index.js +1 -1
- package/node/Menu/Menu.js +13 -10
- package/node/MenuList/MenuList.js +7 -0
- package/node/MobileStepper/MobileStepper.js +9 -1
- package/node/Popover/Popover.js +75 -25
- package/node/index.js +1 -1
- package/package.json +3 -3
- package/umd/material-ui.development.js +107 -221
- package/umd/material-ui.production.min.js +6 -6
|
@@ -7,6 +7,8 @@ export interface AutocompleteClasses {
|
|
|
7
7
|
expanded: string;
|
|
8
8
|
/** State class applied to the root element if focused. */
|
|
9
9
|
focused: string;
|
|
10
|
+
/** Styles applied to the option elements if they are keyboard focused. */
|
|
11
|
+
focusVisible: string;
|
|
10
12
|
/** Styles applied to the tag elements, e.g. the chips. */
|
|
11
13
|
tag: string;
|
|
12
14
|
/** Styles applied to the tag elements, e.g. the chips if `size="small"`. */
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.13.4
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.13.3..master -->
|
|
6
|
+
|
|
7
|
+
_Jun 5, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
### `@mui/material@5.13.4`
|
|
12
|
+
|
|
13
|
+
- ​<!-- 20 -->[Autocomplete][material] Add missing `focusVisible` class in AutocompleteClasses (#37502) @sai6855
|
|
14
|
+
- ​<!-- 04 -->[Menu][material] Fix MenuPaper class composition precedence (#37390) @DiegoAndai
|
|
15
|
+
- ​<!-- 03 -->[MenuList] Fix to allow conditional rendering for a menu item under ListSubheader (#36890) @danielplewes
|
|
16
|
+
- ​<!-- 02 -->[Stepper] Handle progress bar of mobile stepper when `steps` is one (#37079) @gitstart
|
|
17
|
+
|
|
18
|
+
### `@mui/base@5.0.0-beta.4`
|
|
19
|
+
|
|
20
|
+
- ​<!-- 16 -->[Input][base] Fix calling slotProps event handlers (#37463) @sai6855
|
|
21
|
+
|
|
22
|
+
### `@mui/joy@5.0.0-alpha.82`
|
|
23
|
+
|
|
24
|
+
- ​<!-- 19 -->[Avatar][joy] Fallback to `alt` when `src` or `srcSet` are not defined (#37469) @vishalthatipamula0219
|
|
25
|
+
- ​<!-- 15 -->[Card][joy] Improve usability of card family (#37474) @siriwatknp
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
|
|
29
|
+
- ​<!-- 18 -->[docs][base] useAutocomplete demos & docs (#37029) @mj12albert
|
|
30
|
+
- ​<!-- 17 -->[docs][base] Remove usage of `component` prop in docs (#37462) @sai6855
|
|
31
|
+
- ​<!-- 13 -->[docs] Fix docs redirections @oliviertassinari
|
|
32
|
+
- ​<!-- 12 -->[docs] Fix Fluent -> Fluent UI @oliviertassinari
|
|
33
|
+
- ​<!-- 11 -->[docs] Fix MUI Base -> Base UI @oliviertassinari
|
|
34
|
+
- ​<!-- 10 -->[docs] Add base-vite-tailwind example repo (#36994) @mj12albert
|
|
35
|
+
- ​<!-- 09 -->[docs] Fix search bar layout shift (#37460) @oliviertassinari
|
|
36
|
+
- ​<!-- 08 -->[docs] Tweak Material UI's "Showcase" page design (#37259) @danilo-leal
|
|
37
|
+
- ​<!-- 07 -->[docs] Tweak Material UI's "Template" page design (#37260) @danilo-leal
|
|
38
|
+
- ​<!-- 06 -->[docs] Fix "Language" page removal leftovers (#37408) @danilo-leal
|
|
39
|
+
- ​<!-- 05 -->[docs] Move contents of css-variables to sibling pages (#37411) @brijeshb42
|
|
40
|
+
|
|
41
|
+
### Core
|
|
42
|
+
|
|
43
|
+
- ​<!-- 14 -->[core] Do not let Renovate handle `examples` packages updates (#37386) @ZeeshanTamboli
|
|
44
|
+
- ​<!-- 01 -->[website] Add header filters to the pricing table (#37455) @MBilalShafi
|
|
45
|
+
|
|
46
|
+
All contributors of this release in alphabetical order: @brijeshb42, @danielplewes, @danilo-leal, @DiegoAndai, @gitstart, @MBilalShafi, @mj12albert, @oliviertassinari, @sai6855, @siriwatknp, @vishalthatipamula0219, @ZeeshanTamboli
|
|
47
|
+
|
|
3
48
|
## 5.13.3
|
|
4
49
|
|
|
5
50
|
<!-- generated comparing v5.13.2..master -->
|
package/Menu/Menu.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { InternalStandardProps as StandardProps } from '..';
|
|
4
|
+
import { PaperProps } from '../Paper';
|
|
4
5
|
import { PopoverProps } from '../Popover';
|
|
5
6
|
import { MenuListProps } from '../MenuList';
|
|
6
7
|
import { Theme } from '../styles';
|
|
@@ -79,6 +80,8 @@ export interface MenuProps extends StandardProps<PopoverProps> {
|
|
|
79
80
|
variant?: 'menu' | 'selectedMenu';
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
export declare const MenuPaper: React.FC<PaperProps>;
|
|
84
|
+
|
|
82
85
|
/**
|
|
83
86
|
*
|
|
84
87
|
* Demos:
|
package/Menu/Menu.js
CHANGED
|
@@ -9,8 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
10
10
|
import { HTMLElementType } from '@mui/utils';
|
|
11
11
|
import MenuList from '../MenuList';
|
|
12
|
-
import
|
|
13
|
-
import Popover from '../Popover';
|
|
12
|
+
import Popover, { PopoverPaper } from '../Popover';
|
|
14
13
|
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
15
14
|
import useTheme from '../styles/useTheme';
|
|
16
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
@@ -41,7 +40,7 @@ const MenuRoot = styled(Popover, {
|
|
|
41
40
|
slot: 'Root',
|
|
42
41
|
overridesResolver: (props, styles) => styles.root
|
|
43
42
|
})({});
|
|
44
|
-
const MenuPaper = styled(
|
|
43
|
+
export const MenuPaper = styled(PopoverPaper, {
|
|
45
44
|
name: 'MuiMenu',
|
|
46
45
|
slot: 'Paper',
|
|
47
46
|
overridesResolver: (props, styles) => styles.paper
|
|
@@ -148,13 +147,16 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
148
147
|
horizontal: isRtl ? 'right' : 'left'
|
|
149
148
|
},
|
|
150
149
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
slots: {
|
|
151
|
+
paper: MenuPaper
|
|
152
|
+
},
|
|
153
|
+
slotProps: {
|
|
154
|
+
paper: _extends({}, PaperProps, {
|
|
155
|
+
classes: _extends({}, PaperProps.classes, {
|
|
156
|
+
root: classes.paper
|
|
157
|
+
})
|
|
156
158
|
})
|
|
157
|
-
}
|
|
159
|
+
},
|
|
158
160
|
className: classes.root,
|
|
159
161
|
open: open,
|
|
160
162
|
ref: ref,
|
package/MenuList/MenuList.js
CHANGED
|
@@ -180,6 +180,13 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
180
180
|
// item and use the first valid item as a fallback
|
|
181
181
|
React.Children.forEach(children, (child, index) => {
|
|
182
182
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
183
|
+
if (activeItemIndex === index) {
|
|
184
|
+
activeItemIndex += 1;
|
|
185
|
+
if (activeItemIndex >= children.length) {
|
|
186
|
+
// there are no focusable items within the list.
|
|
187
|
+
activeItemIndex = -1;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
183
190
|
return;
|
|
184
191
|
}
|
|
185
192
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -126,6 +126,14 @@ const MobileStepper = /*#__PURE__*/React.forwardRef(function MobileStepper(inPro
|
|
|
126
126
|
position,
|
|
127
127
|
variant
|
|
128
128
|
});
|
|
129
|
+
let value;
|
|
130
|
+
if (variant === 'progress') {
|
|
131
|
+
if (steps === 1) {
|
|
132
|
+
value = 100;
|
|
133
|
+
} else {
|
|
134
|
+
value = Math.ceil(activeStep / (steps - 1) * 100);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
129
137
|
const classes = useUtilityClasses(ownerState);
|
|
130
138
|
return /*#__PURE__*/_jsxs(MobileStepperRoot, _extends({
|
|
131
139
|
square: true,
|
|
@@ -148,7 +156,7 @@ const MobileStepper = /*#__PURE__*/React.forwardRef(function MobileStepper(inPro
|
|
|
148
156
|
ownerState: ownerState,
|
|
149
157
|
className: classes.progress,
|
|
150
158
|
variant: "determinate",
|
|
151
|
-
value:
|
|
159
|
+
value: value
|
|
152
160
|
}, LinearProgressProps)), nextButton]
|
|
153
161
|
}));
|
|
154
162
|
});
|
package/Popover/Popover.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
+
import { SlotComponentProps } from '@mui/base';
|
|
3
4
|
import { InternalStandardProps as StandardProps } from '..';
|
|
4
|
-
import { PaperProps } from '../Paper';
|
|
5
|
-
import { ModalProps } from '../Modal';
|
|
5
|
+
import Paper, { PaperProps } from '../Paper';
|
|
6
|
+
import Modal, { ModalOwnerState, ModalProps } from '../Modal';
|
|
6
7
|
import { Theme } from '../styles';
|
|
7
8
|
import { TransitionProps } from '../transitions/transition';
|
|
8
9
|
import { PopoverClasses } from './popoverClasses';
|
|
@@ -19,7 +20,8 @@ export interface PopoverPosition {
|
|
|
19
20
|
|
|
20
21
|
export type PopoverReference = 'anchorEl' | 'anchorPosition' | 'none';
|
|
21
22
|
|
|
22
|
-
export interface PopoverProps
|
|
23
|
+
export interface PopoverProps
|
|
24
|
+
extends StandardProps<Omit<ModalProps, 'slots' | 'slotProps'>, 'children'> {
|
|
23
25
|
/**
|
|
24
26
|
* A ref for imperative actions.
|
|
25
27
|
* It currently only supports updatePosition() action.
|
|
@@ -88,9 +90,32 @@ export interface PopoverProps extends StandardProps<ModalProps, 'children'> {
|
|
|
88
90
|
open: boolean;
|
|
89
91
|
/**
|
|
90
92
|
* Props applied to the [`Paper`](/material-ui/api/paper/) element.
|
|
93
|
+
*
|
|
94
|
+
* This prop is an alias for `slotProps.paper` and will be overriden by it if both are used.
|
|
95
|
+
* @deprecated Use `slotProps.paper` instead.
|
|
96
|
+
*
|
|
91
97
|
* @default {}
|
|
92
98
|
*/
|
|
93
99
|
PaperProps?: Partial<PaperProps>;
|
|
100
|
+
/**
|
|
101
|
+
* The components used for each slot inside.
|
|
102
|
+
*
|
|
103
|
+
* @default {}
|
|
104
|
+
*/
|
|
105
|
+
slots?: {
|
|
106
|
+
root?: React.ElementType;
|
|
107
|
+
paper?: React.ElementType;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* The extra props for the slot components.
|
|
111
|
+
* You can override the existing props or add new ones.
|
|
112
|
+
*
|
|
113
|
+
* @default {}
|
|
114
|
+
*/
|
|
115
|
+
slotProps?: {
|
|
116
|
+
root?: SlotComponentProps<typeof Modal, {}, ModalOwnerState>;
|
|
117
|
+
paper?: SlotComponentProps<typeof Paper, {}, {}>;
|
|
118
|
+
};
|
|
94
119
|
/**
|
|
95
120
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
96
121
|
*/
|
|
@@ -140,6 +165,12 @@ export function getOffsetLeft(
|
|
|
140
165
|
horizontal: number | 'center' | 'right' | 'left',
|
|
141
166
|
): number;
|
|
142
167
|
|
|
168
|
+
type PopoverRootProps = NonNullable<PopoverProps['slotProps']>['root'];
|
|
169
|
+
type PopoverPaperProps = NonNullable<PopoverProps['slotProps']>['paper'];
|
|
170
|
+
|
|
171
|
+
export declare const PopoverRoot: React.FC<PopoverRootProps>;
|
|
172
|
+
export declare const PopoverPaper: React.FC<PopoverPaperProps>;
|
|
173
|
+
|
|
143
174
|
/**
|
|
144
175
|
*
|
|
145
176
|
* Demos:
|
package/Popover/Popover.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["onEntering"],
|
|
4
|
-
_excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]
|
|
4
|
+
_excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
|
|
5
|
+
_excluded3 = ["slotProps"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import clsx from 'clsx';
|
|
8
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
+
import { unstable_composeClasses as composeClasses, useSlotProps, isHostComponent } from '@mui/base';
|
|
9
10
|
import { chainPropTypes, integerPropType, elementTypeAcceptingRef, refType, HTMLElementType } from '@mui/utils';
|
|
10
11
|
import styled from '../styles/styled';
|
|
11
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
@@ -15,7 +16,7 @@ import ownerWindow from '../utils/ownerWindow';
|
|
|
15
16
|
import useForkRef from '../utils/useForkRef';
|
|
16
17
|
import Grow from '../Grow';
|
|
17
18
|
import Modal from '../Modal';
|
|
18
|
-
import
|
|
19
|
+
import PaperBase from '../Paper';
|
|
19
20
|
import { getPopoverUtilityClass } from './popoverClasses';
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
export function getOffsetTop(rect, vertical) {
|
|
@@ -56,12 +57,12 @@ const useUtilityClasses = ownerState => {
|
|
|
56
57
|
};
|
|
57
58
|
return composeClasses(slots, getPopoverUtilityClass, classes);
|
|
58
59
|
};
|
|
59
|
-
const PopoverRoot = styled(Modal, {
|
|
60
|
+
export const PopoverRoot = styled(Modal, {
|
|
60
61
|
name: 'MuiPopover',
|
|
61
62
|
slot: 'Root',
|
|
62
63
|
overridesResolver: (props, styles) => styles.root
|
|
63
64
|
})({});
|
|
64
|
-
const PopoverPaper = styled(
|
|
65
|
+
export const PopoverPaper = styled(PaperBase, {
|
|
65
66
|
name: 'MuiPopover',
|
|
66
67
|
slot: 'Paper',
|
|
67
68
|
overridesResolver: (props, styles) => styles.paper
|
|
@@ -79,6 +80,7 @@ const PopoverPaper = styled(Paper, {
|
|
|
79
80
|
outline: 0
|
|
80
81
|
});
|
|
81
82
|
const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
83
|
+
var _slotProps$paper, _slots$root, _slots$paper;
|
|
82
84
|
const props = useThemeProps({
|
|
83
85
|
props: inProps,
|
|
84
86
|
name: 'MuiPopover'
|
|
@@ -98,7 +100,9 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
98
100
|
elevation = 8,
|
|
99
101
|
marginThreshold = 16,
|
|
100
102
|
open,
|
|
101
|
-
PaperProps = {},
|
|
103
|
+
PaperProps: PaperPropsProp = {},
|
|
104
|
+
slots,
|
|
105
|
+
slotProps,
|
|
102
106
|
transformOrigin = {
|
|
103
107
|
vertical: 'top',
|
|
104
108
|
horizontal: 'left'
|
|
@@ -111,14 +115,15 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
111
115
|
} = props,
|
|
112
116
|
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
|
|
113
117
|
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
118
|
+
const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
|
|
114
119
|
const paperRef = React.useRef();
|
|
115
|
-
const handlePaperRef = useForkRef(paperRef,
|
|
120
|
+
const handlePaperRef = useForkRef(paperRef, externalPaperSlotProps.ref);
|
|
116
121
|
const ownerState = _extends({}, props, {
|
|
117
122
|
anchorOrigin,
|
|
118
123
|
anchorReference,
|
|
119
124
|
elevation,
|
|
120
125
|
marginThreshold,
|
|
121
|
-
|
|
126
|
+
externalPaperSlotProps,
|
|
122
127
|
transformOrigin,
|
|
123
128
|
TransitionComponent,
|
|
124
129
|
transitionDuration: transitionDurationProp,
|
|
@@ -283,16 +288,46 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
283
288
|
// If the anchorEl prop is provided, use its parent body element as the container
|
|
284
289
|
// If neither are provided let the Modal take care of choosing the container
|
|
285
290
|
const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : undefined);
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
const RootSlot = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : PopoverRoot;
|
|
292
|
+
const PaperSlot = (_slots$paper = slots == null ? void 0 : slots.paper) != null ? _slots$paper : PopoverPaper;
|
|
293
|
+
const paperProps = useSlotProps({
|
|
294
|
+
elementType: PaperSlot,
|
|
295
|
+
externalSlotProps: _extends({}, externalPaperSlotProps, {
|
|
296
|
+
style: isPositioned ? externalPaperSlotProps.style : _extends({}, externalPaperSlotProps.style, {
|
|
297
|
+
opacity: 0
|
|
298
|
+
})
|
|
299
|
+
}),
|
|
300
|
+
additionalProps: {
|
|
301
|
+
elevation,
|
|
302
|
+
ref: handlePaperRef
|
|
289
303
|
},
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
304
|
+
ownerState,
|
|
305
|
+
className: clsx(classes.paper, externalPaperSlotProps == null ? void 0 : externalPaperSlotProps.className)
|
|
306
|
+
});
|
|
307
|
+
const _useSlotProps = useSlotProps({
|
|
308
|
+
elementType: RootSlot,
|
|
309
|
+
externalSlotProps: (slotProps == null ? void 0 : slotProps.root) || {},
|
|
310
|
+
externalForwardedProps: other,
|
|
311
|
+
additionalProps: {
|
|
312
|
+
ref,
|
|
313
|
+
slotProps: {
|
|
314
|
+
backdrop: {
|
|
315
|
+
invisible: true
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
container,
|
|
319
|
+
open
|
|
320
|
+
},
|
|
321
|
+
ownerState,
|
|
322
|
+
className: clsx(classes.root, className)
|
|
323
|
+
}),
|
|
324
|
+
{
|
|
325
|
+
slotProps: rootSlotPropsProp
|
|
326
|
+
} = _useSlotProps,
|
|
327
|
+
rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
|
|
328
|
+
return /*#__PURE__*/_jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
|
|
329
|
+
slotProps: rootSlotPropsProp
|
|
330
|
+
}, {
|
|
296
331
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
297
332
|
appear: true,
|
|
298
333
|
in: open,
|
|
@@ -300,17 +335,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
300
335
|
onExited: handleExited,
|
|
301
336
|
timeout: transitionDuration
|
|
302
337
|
}, TransitionProps, {
|
|
303
|
-
children: /*#__PURE__*/_jsx(
|
|
304
|
-
elevation: elevation
|
|
305
|
-
}, PaperProps, {
|
|
306
|
-
ref: handlePaperRef,
|
|
307
|
-
className: clsx(classes.paper, PaperProps.className)
|
|
308
|
-
}, isPositioned ? undefined : {
|
|
309
|
-
style: _extends({}, PaperProps.style, {
|
|
310
|
-
opacity: 0
|
|
311
|
-
})
|
|
312
|
-
}, {
|
|
313
|
-
ownerState: ownerState,
|
|
338
|
+
children: /*#__PURE__*/_jsx(PaperSlot, _extends({}, paperProps, {
|
|
314
339
|
children: children
|
|
315
340
|
}))
|
|
316
341
|
}))
|
|
@@ -416,11 +441,34 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
416
441
|
open: PropTypes.bool.isRequired,
|
|
417
442
|
/**
|
|
418
443
|
* Props applied to the [`Paper`](/material-ui/api/paper/) element.
|
|
444
|
+
*
|
|
445
|
+
* This prop is an alias for `slotProps.paper` and will be overriden by it if both are used.
|
|
446
|
+
* @deprecated Use `slotProps.paper` instead.
|
|
447
|
+
*
|
|
419
448
|
* @default {}
|
|
420
449
|
*/
|
|
421
450
|
PaperProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
|
|
422
451
|
component: elementTypeAcceptingRef
|
|
423
452
|
}),
|
|
453
|
+
/**
|
|
454
|
+
* The extra props for the slot components.
|
|
455
|
+
* You can override the existing props or add new ones.
|
|
456
|
+
*
|
|
457
|
+
* @default {}
|
|
458
|
+
*/
|
|
459
|
+
slotProps: PropTypes.shape({
|
|
460
|
+
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
461
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
462
|
+
}),
|
|
463
|
+
/**
|
|
464
|
+
* The components used for each slot inside.
|
|
465
|
+
*
|
|
466
|
+
* @default {}
|
|
467
|
+
*/
|
|
468
|
+
slots: PropTypes.shape({
|
|
469
|
+
paper: PropTypes.elementType,
|
|
470
|
+
root: PropTypes.elementType
|
|
471
|
+
}),
|
|
424
472
|
/**
|
|
425
473
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
426
474
|
*/
|
package/index.js
CHANGED
package/legacy/Menu/Menu.js
CHANGED
|
@@ -7,8 +7,7 @@ import clsx from 'clsx';
|
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
8
8
|
import { HTMLElementType } from '@mui/utils';
|
|
9
9
|
import MenuList from '../MenuList';
|
|
10
|
-
import
|
|
11
|
-
import Popover from '../Popover';
|
|
10
|
+
import Popover, { PopoverPaper } from '../Popover';
|
|
12
11
|
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
13
12
|
import useTheme from '../styles/useTheme';
|
|
14
13
|
import useThemeProps from '../styles/useThemeProps';
|
|
@@ -41,7 +40,7 @@ var MenuRoot = styled(Popover, {
|
|
|
41
40
|
return styles.root;
|
|
42
41
|
}
|
|
43
42
|
})({});
|
|
44
|
-
var MenuPaper = styled(
|
|
43
|
+
export var MenuPaper = styled(PopoverPaper, {
|
|
45
44
|
name: 'MuiMenu',
|
|
46
45
|
slot: 'Paper',
|
|
47
46
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -156,13 +155,16 @@ var Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
156
155
|
horizontal: isRtl ? 'right' : 'left'
|
|
157
156
|
},
|
|
158
157
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
slots: {
|
|
159
|
+
paper: MenuPaper
|
|
160
|
+
},
|
|
161
|
+
slotProps: {
|
|
162
|
+
paper: _extends({}, PaperProps, {
|
|
163
|
+
classes: _extends({}, PaperProps.classes, {
|
|
164
|
+
root: classes.paper
|
|
165
|
+
})
|
|
164
166
|
})
|
|
165
|
-
}
|
|
167
|
+
},
|
|
166
168
|
className: classes.root,
|
|
167
169
|
open: open,
|
|
168
170
|
ref: ref,
|
|
@@ -182,6 +182,13 @@ var MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
182
182
|
// item and use the first valid item as a fallback
|
|
183
183
|
React.Children.forEach(children, function (child, index) {
|
|
184
184
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
185
|
+
if (activeItemIndex === index) {
|
|
186
|
+
activeItemIndex += 1;
|
|
187
|
+
if (activeItemIndex >= children.length) {
|
|
188
|
+
// there are no focusable items within the list.
|
|
189
|
+
activeItemIndex = -1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
185
192
|
return;
|
|
186
193
|
}
|
|
187
194
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -131,6 +131,14 @@ var MobileStepper = /*#__PURE__*/React.forwardRef(function MobileStepper(inProps
|
|
|
131
131
|
position: position,
|
|
132
132
|
variant: variant
|
|
133
133
|
});
|
|
134
|
+
var value;
|
|
135
|
+
if (variant === 'progress') {
|
|
136
|
+
if (steps === 1) {
|
|
137
|
+
value = 100;
|
|
138
|
+
} else {
|
|
139
|
+
value = Math.ceil(activeStep / (steps - 1) * 100);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
134
142
|
var classes = useUtilityClasses(ownerState);
|
|
135
143
|
return /*#__PURE__*/_jsxs(MobileStepperRoot, _extends({
|
|
136
144
|
square: true,
|
|
@@ -155,7 +163,7 @@ var MobileStepper = /*#__PURE__*/React.forwardRef(function MobileStepper(inProps
|
|
|
155
163
|
ownerState: ownerState,
|
|
156
164
|
className: classes.progress,
|
|
157
165
|
variant: "determinate",
|
|
158
|
-
value:
|
|
166
|
+
value: value
|
|
159
167
|
}, LinearProgressProps)), nextButton]
|
|
160
168
|
}));
|
|
161
169
|
});
|