@mui/material 5.11.9 → 5.11.11
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/Autocomplete.d.ts +3 -1
- package/Avatar/Avatar.js +1 -0
- package/Backdrop/Backdrop.d.ts +8 -0
- package/Backdrop/Backdrop.js +10 -5
- package/Badge/Badge.d.ts +0 -1
- package/Badge/Badge.js +47 -47
- package/CHANGELOG.md +135 -1
- package/Container/Container.js +0 -1
- package/Dialog/DialogContext.d.ts +2 -2
- package/Dialog/DialogContext.js +2 -2
- package/InputBase/InputBase.js +2 -2
- package/InputLabel/InputLabel.js +3 -1
- package/ListSubheader/ListSubheader.js +1 -0
- package/MenuList/MenuList.js +7 -0
- package/Modal/Modal.d.ts +9 -1
- package/Modal/Modal.js +14 -9
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +0 -2
- package/Rating/Rating.js +2 -2
- package/Select/SelectInput.js +2 -22
- package/Slider/Slider.d.ts +5 -1
- package/Slider/Slider.js +16 -11
- package/Snackbar/Snackbar.js +21 -125
- package/Stack/Stack.d.ts +0 -1
- package/Stack/Stack.js +9 -120
- package/Stack/index.d.ts +3 -0
- package/Stack/index.js +2 -1
- package/Stack/stackClasses.d.ts +6 -0
- package/Stack/stackClasses.js +7 -0
- package/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/Unstable_Grid2/Grid2.js +2 -3
- package/index.js +1 -1
- package/internal/SwitchBase.js +1 -1
- package/legacy/Avatar/Avatar.js +1 -0
- package/legacy/Backdrop/Backdrop.js +9 -3
- package/legacy/Badge/Badge.js +48 -48
- package/legacy/Container/Container.js +0 -1
- package/legacy/Dialog/DialogContext.js +2 -2
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/InputLabel/InputLabel.js +3 -1
- package/legacy/ListSubheader/ListSubheader.js +1 -0
- package/legacy/MenuList/MenuList.js +7 -0
- package/legacy/Modal/Modal.js +14 -9
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Rating/Rating.js +2 -2
- package/legacy/Select/SelectInput.js +2 -22
- package/legacy/Slider/Slider.js +16 -12
- package/legacy/Snackbar/Snackbar.js +20 -119
- package/legacy/Stack/Stack.js +13 -122
- package/legacy/Stack/index.js +2 -1
- package/legacy/Stack/stackClasses.js +7 -0
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/legacy/Unstable_Grid2/Grid2.js +2 -3
- package/legacy/index.js +1 -1
- package/legacy/internal/SwitchBase.js +1 -1
- package/legacy/styles/createTheme.js +1 -0
- package/legacy/useAutocomplete/useAutocomplete.js +2 -2
- package/legacy/useMediaQuery/useMediaQuery.js +12 -7
- package/modern/Avatar/Avatar.js +1 -0
- package/modern/Backdrop/Backdrop.js +10 -5
- package/modern/Badge/Badge.js +47 -47
- package/modern/Container/Container.js +0 -1
- package/modern/Dialog/DialogContext.js +2 -2
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/InputLabel/InputLabel.js +3 -1
- package/modern/ListSubheader/ListSubheader.js +1 -0
- package/modern/MenuList/MenuList.js +7 -0
- package/modern/Modal/Modal.js +14 -9
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Rating/Rating.js +2 -2
- package/modern/Select/SelectInput.js +2 -18
- package/modern/Slider/Slider.js +16 -11
- package/modern/Snackbar/Snackbar.js +21 -125
- package/modern/Stack/Stack.js +9 -120
- package/modern/Stack/index.js +2 -1
- package/modern/Stack/stackClasses.js +7 -0
- package/modern/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/modern/Unstable_Grid2/Grid2.js +2 -3
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +1 -1
- package/modern/styles/createTheme.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +2 -2
- package/modern/useMediaQuery/useMediaQuery.js +9 -7
- package/node/Avatar/Avatar.js +1 -0
- package/node/Backdrop/Backdrop.js +10 -5
- package/node/Badge/Badge.js +46 -47
- package/node/Container/Container.js +0 -2
- package/node/Dialog/DialogContext.js +4 -2
- package/node/InputBase/InputBase.js +2 -2
- package/node/InputLabel/InputLabel.js +3 -1
- package/node/ListSubheader/ListSubheader.js +1 -0
- package/node/MenuList/MenuList.js +7 -0
- package/node/Modal/Modal.js +14 -9
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Rating/Rating.js +2 -2
- package/node/Select/SelectInput.js +2 -22
- package/node/Slider/Slider.js +19 -14
- package/node/Snackbar/Snackbar.js +20 -124
- package/node/Stack/Stack.js +9 -122
- package/node/Stack/index.js +8 -1
- package/node/Stack/stackClasses.js +16 -0
- package/node/SwipeableDrawer/SwipeableDrawer.js +3 -3
- package/node/Unstable_Grid2/Grid2.js +0 -1
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +1 -1
- package/node/styles/createTheme.js +1 -0
- package/node/useAutocomplete/useAutocomplete.js +8 -6
- package/node/useMediaQuery/useMediaQuery.js +9 -7
- package/package.json +6 -6
- package/styles/createTheme.js +1 -0
- package/styles/props.d.ts +2 -2
- package/umd/material-ui.development.js +4209 -4241
- package/umd/material-ui.production.min.js +21 -21
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +2 -2
- package/useMediaQuery/useMediaQuery.d.ts +19 -4
- package/useMediaQuery/useMediaQuery.js +9 -7
|
@@ -9,13 +9,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
12
|
var _base = require("@mui/base");
|
|
14
13
|
var _ClickAwayListener = _interopRequireDefault(require("@mui/base/ClickAwayListener"));
|
|
14
|
+
var _useSnackbar = _interopRequireDefault(require("@mui/base/useSnackbar"));
|
|
15
15
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
16
16
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
17
17
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
18
|
-
var _useEventCallback = _interopRequireDefault(require("../utils/useEventCallback"));
|
|
19
18
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
20
19
|
var _Grow = _interopRequireDefault(require("../Grow"));
|
|
21
20
|
var _SnackbarContent = _interopRequireDefault(require("../SnackbarContent"));
|
|
@@ -109,13 +108,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
109
108
|
ContentProps,
|
|
110
109
|
disableWindowBlurListener = false,
|
|
111
110
|
message,
|
|
112
|
-
onBlur,
|
|
113
|
-
onClose,
|
|
114
|
-
onFocus,
|
|
115
|
-
onMouseEnter,
|
|
116
|
-
onMouseLeave,
|
|
117
111
|
open,
|
|
118
|
-
resumeHideDuration,
|
|
119
112
|
TransitionComponent = _Grow.default,
|
|
120
113
|
transitionDuration = defaultTransitionDuration,
|
|
121
114
|
TransitionProps: {
|
|
@@ -129,76 +122,27 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
129
122
|
anchorOrigin: {
|
|
130
123
|
vertical,
|
|
131
124
|
horizontal
|
|
132
|
-
}
|
|
125
|
+
},
|
|
126
|
+
autoHideDuration,
|
|
127
|
+
disableWindowBlurListener,
|
|
128
|
+
TransitionComponent,
|
|
129
|
+
transitionDuration
|
|
133
130
|
});
|
|
134
131
|
const classes = useUtilityClasses(ownerState);
|
|
135
|
-
const
|
|
132
|
+
const {
|
|
133
|
+
getRootProps,
|
|
134
|
+
onClickAway
|
|
135
|
+
} = (0, _useSnackbar.default)((0, _extends2.default)({}, ownerState, {
|
|
136
|
+
ref
|
|
137
|
+
}));
|
|
136
138
|
const [exited, setExited] = React.useState(true);
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
const rootProps = (0, _base.useSlotProps)({
|
|
140
|
+
elementType: SnackbarRoot,
|
|
141
|
+
getSlotProps: getRootProps,
|
|
142
|
+
externalForwardedProps: other,
|
|
143
|
+
ownerState,
|
|
144
|
+
className: [classes.root, className]
|
|
141
145
|
});
|
|
142
|
-
const setAutoHideTimer = (0, _useEventCallback.default)(autoHideDurationParam => {
|
|
143
|
-
if (!onClose || autoHideDurationParam == null) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
clearTimeout(timerAutoHide.current);
|
|
147
|
-
timerAutoHide.current = setTimeout(() => {
|
|
148
|
-
handleClose(null, 'timeout');
|
|
149
|
-
}, autoHideDurationParam);
|
|
150
|
-
});
|
|
151
|
-
React.useEffect(() => {
|
|
152
|
-
if (open) {
|
|
153
|
-
setAutoHideTimer(autoHideDuration);
|
|
154
|
-
}
|
|
155
|
-
return () => {
|
|
156
|
-
clearTimeout(timerAutoHide.current);
|
|
157
|
-
};
|
|
158
|
-
}, [open, autoHideDuration, setAutoHideTimer]);
|
|
159
|
-
|
|
160
|
-
// Pause the timer when the user is interacting with the Snackbar
|
|
161
|
-
// or when the user hide the window.
|
|
162
|
-
const handlePause = () => {
|
|
163
|
-
clearTimeout(timerAutoHide.current);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// Restart the timer when the user is no longer interacting with the Snackbar
|
|
167
|
-
// or when the window is shown back.
|
|
168
|
-
const handleResume = React.useCallback(() => {
|
|
169
|
-
if (autoHideDuration != null) {
|
|
170
|
-
setAutoHideTimer(resumeHideDuration != null ? resumeHideDuration : autoHideDuration * 0.5);
|
|
171
|
-
}
|
|
172
|
-
}, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
|
|
173
|
-
const handleFocus = event => {
|
|
174
|
-
if (onFocus) {
|
|
175
|
-
onFocus(event);
|
|
176
|
-
}
|
|
177
|
-
handlePause();
|
|
178
|
-
};
|
|
179
|
-
const handleMouseEnter = event => {
|
|
180
|
-
if (onMouseEnter) {
|
|
181
|
-
onMouseEnter(event);
|
|
182
|
-
}
|
|
183
|
-
handlePause();
|
|
184
|
-
};
|
|
185
|
-
const handleBlur = event => {
|
|
186
|
-
if (onBlur) {
|
|
187
|
-
onBlur(event);
|
|
188
|
-
}
|
|
189
|
-
handleResume();
|
|
190
|
-
};
|
|
191
|
-
const handleMouseLeave = event => {
|
|
192
|
-
if (onMouseLeave) {
|
|
193
|
-
onMouseLeave(event);
|
|
194
|
-
}
|
|
195
|
-
handleResume();
|
|
196
|
-
};
|
|
197
|
-
const handleClickAway = event => {
|
|
198
|
-
if (onClose) {
|
|
199
|
-
onClose(event, 'clickaway');
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
146
|
const handleExited = node => {
|
|
203
147
|
setExited(true);
|
|
204
148
|
if (onExited) {
|
|
@@ -211,63 +155,15 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
211
155
|
onEnter(node, isAppearing);
|
|
212
156
|
}
|
|
213
157
|
};
|
|
214
|
-
React.useEffect(() => {
|
|
215
|
-
// TODO: window global should be refactored here
|
|
216
|
-
if (!disableWindowBlurListener && open) {
|
|
217
|
-
window.addEventListener('focus', handleResume);
|
|
218
|
-
window.addEventListener('blur', handlePause);
|
|
219
|
-
return () => {
|
|
220
|
-
window.removeEventListener('focus', handleResume);
|
|
221
|
-
window.removeEventListener('blur', handlePause);
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
return undefined;
|
|
225
|
-
}, [disableWindowBlurListener, handleResume, open]);
|
|
226
|
-
React.useEffect(() => {
|
|
227
|
-
if (!open) {
|
|
228
|
-
return undefined;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @param {KeyboardEvent} nativeEvent
|
|
233
|
-
*/
|
|
234
|
-
function handleKeyDown(nativeEvent) {
|
|
235
|
-
if (!nativeEvent.defaultPrevented) {
|
|
236
|
-
// IE11, Edge (prior to using Bink?) use 'Esc'
|
|
237
|
-
if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
|
|
238
|
-
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
|
|
239
|
-
if (onClose) {
|
|
240
|
-
onClose(nativeEvent, 'escapeKeyDown');
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
246
|
-
return () => {
|
|
247
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
248
|
-
};
|
|
249
|
-
}, [exited, open, onClose]);
|
|
250
158
|
|
|
251
159
|
// So we only render active snackbars.
|
|
252
160
|
if (!open && exited) {
|
|
253
161
|
return null;
|
|
254
162
|
}
|
|
255
163
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickAwayListener.default, (0, _extends2.default)({
|
|
256
|
-
onClickAway:
|
|
164
|
+
onClickAway: onClickAway
|
|
257
165
|
}, ClickAwayListenerProps, {
|
|
258
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SnackbarRoot, (0, _extends2.default)({
|
|
259
|
-
className: (0, _clsx.default)(classes.root, className),
|
|
260
|
-
onBlur: handleBlur,
|
|
261
|
-
onFocus: handleFocus,
|
|
262
|
-
onMouseEnter: handleMouseEnter,
|
|
263
|
-
onMouseLeave: handleMouseLeave,
|
|
264
|
-
ownerState: ownerState,
|
|
265
|
-
ref: ref
|
|
266
|
-
// ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
267
|
-
// See https://github.com/mui/material-ui/issues/29080
|
|
268
|
-
,
|
|
269
|
-
role: "presentation"
|
|
270
|
-
}, other, {
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SnackbarRoot, (0, _extends2.default)({}, rootProps, {
|
|
271
167
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, (0, _extends2.default)({
|
|
272
168
|
appear: true,
|
|
273
169
|
in: open,
|
package/node/Stack/Stack.js
CHANGED
|
@@ -4,134 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
9
|
var _system = require("@mui/system");
|
|
13
|
-
var _utils = require("@mui/utils");
|
|
14
10
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
15
11
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* > joinChildren([1,2,3], 0)
|
|
25
|
-
* [1,0,2,0,3]
|
|
26
|
-
*/
|
|
27
|
-
function joinChildren(children, separator) {
|
|
28
|
-
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
29
|
-
return childrenArray.reduce((output, child, index) => {
|
|
30
|
-
output.push(child);
|
|
31
|
-
if (index < childrenArray.length - 1) {
|
|
32
|
-
output.push( /*#__PURE__*/React.cloneElement(separator, {
|
|
33
|
-
key: `separator-${index}`
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
return output;
|
|
37
|
-
}, []);
|
|
38
|
-
}
|
|
39
|
-
const getSideFromDirection = direction => {
|
|
40
|
-
return {
|
|
41
|
-
row: 'Left',
|
|
42
|
-
'row-reverse': 'Right',
|
|
43
|
-
column: 'Top',
|
|
44
|
-
'column-reverse': 'Bottom'
|
|
45
|
-
}[direction];
|
|
46
|
-
};
|
|
47
|
-
const style = ({
|
|
48
|
-
ownerState,
|
|
49
|
-
theme
|
|
50
|
-
}) => {
|
|
51
|
-
let styles = (0, _extends2.default)({
|
|
52
|
-
display: 'flex',
|
|
53
|
-
flexDirection: 'column'
|
|
54
|
-
}, (0, _system.handleBreakpoints)({
|
|
55
|
-
theme
|
|
56
|
-
}, (0, _system.unstable_resolveBreakpointValues)({
|
|
57
|
-
values: ownerState.direction,
|
|
58
|
-
breakpoints: theme.breakpoints.values
|
|
59
|
-
}), propValue => ({
|
|
60
|
-
flexDirection: propValue
|
|
61
|
-
})));
|
|
62
|
-
if (ownerState.spacing) {
|
|
63
|
-
const transformer = (0, _system.createUnarySpacing)(theme);
|
|
64
|
-
const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
|
|
65
|
-
if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
|
|
66
|
-
acc[breakpoint] = true;
|
|
67
|
-
}
|
|
68
|
-
return acc;
|
|
69
|
-
}, {});
|
|
70
|
-
const directionValues = (0, _system.unstable_resolveBreakpointValues)({
|
|
71
|
-
values: ownerState.direction,
|
|
72
|
-
base
|
|
73
|
-
});
|
|
74
|
-
const spacingValues = (0, _system.unstable_resolveBreakpointValues)({
|
|
75
|
-
values: ownerState.spacing,
|
|
76
|
-
base
|
|
77
|
-
});
|
|
78
|
-
if (typeof directionValues === 'object') {
|
|
79
|
-
Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {
|
|
80
|
-
const directionValue = directionValues[breakpoint];
|
|
81
|
-
if (!directionValue) {
|
|
82
|
-
const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
|
|
83
|
-
directionValues[breakpoint] = previousDirectionValue;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
const styleFromPropValue = (propValue, breakpoint) => {
|
|
88
|
-
return {
|
|
89
|
-
'& > :not(style) + :not(style)': {
|
|
90
|
-
margin: 0,
|
|
91
|
-
[`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: (0, _system.getValue)(transformer, propValue)
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
styles = (0, _utils.deepmerge)(styles, (0, _system.handleBreakpoints)({
|
|
96
|
-
theme
|
|
97
|
-
}, spacingValues, styleFromPropValue));
|
|
98
|
-
}
|
|
99
|
-
styles = (0, _system.mergeBreakpointsInOrder)(theme.breakpoints, styles);
|
|
100
|
-
return styles;
|
|
101
|
-
};
|
|
102
|
-
exports.style = style;
|
|
103
|
-
const StackRoot = (0, _styled.default)('div', {
|
|
104
|
-
name: 'MuiStack',
|
|
105
|
-
slot: 'Root',
|
|
106
|
-
overridesResolver: (props, styles) => {
|
|
107
|
-
return [styles.root];
|
|
108
|
-
}
|
|
109
|
-
})(style);
|
|
110
|
-
const Stack = /*#__PURE__*/React.forwardRef(function Stack(inProps, ref) {
|
|
111
|
-
const themeProps = (0, _useThemeProps.default)({
|
|
12
|
+
const Stack = (0, _system.createStack)({
|
|
13
|
+
createStyledComponent: (0, _styled.default)('div', {
|
|
14
|
+
name: 'MuiStack',
|
|
15
|
+
slot: 'Root',
|
|
16
|
+
overridesResolver: (props, styles) => styles.root
|
|
17
|
+
}),
|
|
18
|
+
useThemeProps: inProps => (0, _useThemeProps.default)({
|
|
112
19
|
props: inProps,
|
|
113
20
|
name: 'MuiStack'
|
|
114
|
-
})
|
|
115
|
-
const props = (0, _system.unstable_extendSxProp)(themeProps);
|
|
116
|
-
const {
|
|
117
|
-
component = 'div',
|
|
118
|
-
direction = 'column',
|
|
119
|
-
spacing = 0,
|
|
120
|
-
divider,
|
|
121
|
-
children
|
|
122
|
-
} = props,
|
|
123
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
124
|
-
const ownerState = {
|
|
125
|
-
direction,
|
|
126
|
-
spacing
|
|
127
|
-
};
|
|
128
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StackRoot, (0, _extends2.default)({
|
|
129
|
-
as: component,
|
|
130
|
-
ownerState: ownerState,
|
|
131
|
-
ref: ref
|
|
132
|
-
}, other, {
|
|
133
|
-
children: divider ? joinChildren(children, divider) : children
|
|
134
|
-
}));
|
|
21
|
+
})
|
|
135
22
|
});
|
|
136
23
|
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
|
|
137
24
|
// ----------------------------- Warning --------------------------------
|
package/node/Stack/index.js
CHANGED
|
@@ -10,4 +10,11 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
return _Stack.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
Object.defineProperty(exports, "stackClasses", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _stackClasses.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _Stack = _interopRequireDefault(require("./Stack"));
|
|
20
|
+
var _stackClasses = _interopRequireDefault(require("./stackClasses"));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
exports.getStackUtilityClass = getStackUtilityClass;
|
|
9
|
+
var _utils = require("@mui/utils");
|
|
10
|
+
var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityClass"));
|
|
11
|
+
function getStackUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiStack', slot);
|
|
13
|
+
}
|
|
14
|
+
const stackClasses = (0, _utils.unstable_generateUtilityClasses)('MuiStack', ['root']);
|
|
15
|
+
var _default = stackClasses;
|
|
16
|
+
exports.default = _default;
|
|
@@ -9,7 +9,7 @@ exports.reset = reset;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _system = require("@mui/system");
|
|
@@ -215,7 +215,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
215
215
|
}
|
|
216
216
|
claimedSwipeInstance = null;
|
|
217
217
|
touchDetected.current = false;
|
|
218
|
-
|
|
218
|
+
ReactDOM.flushSync(() => {
|
|
219
219
|
setMaybeSwiping(false);
|
|
220
220
|
});
|
|
221
221
|
|
|
@@ -267,7 +267,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
267
267
|
// this is because Safari Mobile will not fire any mouse events (still fires touch though) if the DOM changes during mousemove.
|
|
268
268
|
// so do this change on first touchmove instead of touchstart
|
|
269
269
|
if (force || !(disableDiscovery && allowSwipeInChildren)) {
|
|
270
|
-
|
|
270
|
+
ReactDOM.flushSync(() => {
|
|
271
271
|
setMaybeSwiping(true);
|
|
272
272
|
});
|
|
273
273
|
}
|
|
@@ -14,7 +14,6 @@ const Grid2 = (0, _Unstable_Grid.createGrid)({
|
|
|
14
14
|
overridesResolver: (props, styles) => styles.root
|
|
15
15
|
}),
|
|
16
16
|
componentName: 'MuiGrid2',
|
|
17
|
-
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
18
17
|
useThemeProps: inProps => (0, _styles.useThemeProps)({
|
|
19
18
|
props: inProps,
|
|
20
19
|
name: 'MuiGrid2'
|
package/node/index.js
CHANGED
|
@@ -154,7 +154,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
154
154
|
defaultChecked: defaultChecked,
|
|
155
155
|
className: classes.input,
|
|
156
156
|
disabled: disabled,
|
|
157
|
-
id: hasLabelFor
|
|
157
|
+
id: hasLabelFor ? id : undefined,
|
|
158
158
|
name: name,
|
|
159
159
|
onChange: handleInputChange,
|
|
160
160
|
readOnly: readOnly,
|
|
@@ -44,6 +44,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
44
44
|
muiTheme = (0, _utils.deepmerge)(muiTheme, other);
|
|
45
45
|
muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);
|
|
46
46
|
if (process.env.NODE_ENV !== 'production') {
|
|
47
|
+
// TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
|
|
47
48
|
const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
|
|
48
49
|
const traverse = (node, component) => {
|
|
49
50
|
let key;
|
|
@@ -7,18 +7,20 @@ var _exportNames = {};
|
|
|
7
7
|
Object.defineProperty(exports, "default", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _useAutocomplete.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
var
|
|
14
|
-
Object.keys(
|
|
13
|
+
var _useAutocomplete = _interopRequireWildcard(require("@mui/base/useAutocomplete"));
|
|
14
|
+
Object.keys(_useAutocomplete).forEach(function (key) {
|
|
15
15
|
if (key === "default" || key === "__esModule") return;
|
|
16
16
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] ===
|
|
17
|
+
if (key in exports && exports[key] === _useAutocomplete[key]) return;
|
|
18
18
|
Object.defineProperty(exports, key, {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _useAutocomplete[key];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
});
|
|
24
|
+
});
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
@@ -11,9 +11,8 @@ var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEff
|
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
13
|
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
14
|
-
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
15
14
|
const [match, setMatch] = React.useState(() => {
|
|
16
|
-
if (noSsr &&
|
|
15
|
+
if (noSsr && matchMedia) {
|
|
17
16
|
return matchMedia(query).matches;
|
|
18
17
|
}
|
|
19
18
|
if (ssrMatchMedia) {
|
|
@@ -26,7 +25,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
|
|
|
26
25
|
});
|
|
27
26
|
(0, _useEnhancedEffect.default)(() => {
|
|
28
27
|
let active = true;
|
|
29
|
-
if (!
|
|
28
|
+
if (!matchMedia) {
|
|
30
29
|
return undefined;
|
|
31
30
|
}
|
|
32
31
|
const queryList = matchMedia(query);
|
|
@@ -45,15 +44,18 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
|
|
|
45
44
|
active = false;
|
|
46
45
|
queryList.removeListener(updateMatch);
|
|
47
46
|
};
|
|
48
|
-
}, [query, matchMedia
|
|
47
|
+
}, [query, matchMedia]);
|
|
49
48
|
return match;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
53
52
|
const maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
54
|
-
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
53
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
55
54
|
const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
|
|
56
55
|
const getServerSnapshot = React.useMemo(() => {
|
|
56
|
+
if (noSsr && matchMedia) {
|
|
57
|
+
return () => matchMedia(query).matches;
|
|
58
|
+
}
|
|
57
59
|
if (ssrMatchMedia !== null) {
|
|
58
60
|
const {
|
|
59
61
|
matches
|
|
@@ -61,7 +63,7 @@ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
|
61
63
|
return () => matches;
|
|
62
64
|
}
|
|
63
65
|
return getDefaultSnapshot;
|
|
64
|
-
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
66
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
|
|
65
67
|
const [getSnapshot, subscribe] = React.useMemo(() => {
|
|
66
68
|
if (matchMedia === null) {
|
|
67
69
|
return [getDefaultSnapshot, () => () => {}];
|
|
@@ -89,7 +91,7 @@ function useMediaQuery(queryInput, options = {}) {
|
|
|
89
91
|
defaultMatches = false,
|
|
90
92
|
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
91
93
|
ssrMatchMedia = null,
|
|
92
|
-
noSsr
|
|
94
|
+
noSsr = false
|
|
93
95
|
} = (0, _system.getThemeProps)({
|
|
94
96
|
name: 'MuiUseMediaQuery',
|
|
95
97
|
props: options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@babel/runtime": "^7.
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/core-downloads-tracker": "^5.11.
|
|
51
|
-
"@mui/system": "^5.11.
|
|
48
|
+
"@babel/runtime": "^7.21.0",
|
|
49
|
+
"@mui/base": "5.0.0-alpha.119",
|
|
50
|
+
"@mui/core-downloads-tracker": "^5.11.11",
|
|
51
|
+
"@mui/system": "^5.11.11",
|
|
52
52
|
"@mui/types": "^7.2.3",
|
|
53
|
-
"@mui/utils": "^5.11.
|
|
53
|
+
"@mui/utils": "^5.11.11",
|
|
54
54
|
"@types/react-transition-group": "^4.4.5",
|
|
55
55
|
"clsx": "^1.2.1",
|
|
56
56
|
"csstype": "^3.1.1",
|
package/styles/createTheme.js
CHANGED
|
@@ -37,6 +37,7 @@ Please use another name.` : _formatMuiErrorMessage(18));
|
|
|
37
37
|
muiTheme = deepmerge(muiTheme, other);
|
|
38
38
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
39
39
|
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
+
// TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
|
|
40
41
|
const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
|
|
41
42
|
const traverse = (node, component) => {
|
|
42
43
|
let key;
|
package/styles/props.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ import { MenuProps } from '../Menu';
|
|
|
69
69
|
import { MobileStepperProps } from '../MobileStepper';
|
|
70
70
|
import { ModalProps } from '../Modal';
|
|
71
71
|
import { NativeSelectProps } from '../NativeSelect';
|
|
72
|
-
import {
|
|
72
|
+
import { UseMediaQueryOptions } from '../useMediaQuery';
|
|
73
73
|
import { OutlinedInputProps } from '../OutlinedInput';
|
|
74
74
|
import { PaginationProps } from '../Pagination';
|
|
75
75
|
import { PaginationItemProps } from '../PaginationItem';
|
|
@@ -241,5 +241,5 @@ export interface ComponentsPropsList {
|
|
|
241
241
|
MuiTooltip: TooltipProps;
|
|
242
242
|
MuiTouchRipple: TouchRippleProps;
|
|
243
243
|
MuiTypography: TypographyProps;
|
|
244
|
-
MuiUseMediaQuery:
|
|
244
|
+
MuiUseMediaQuery: UseMediaQueryOptions;
|
|
245
245
|
}
|