@mui/material 6.4.7 → 6.4.9
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 +20 -5
- package/Accordion/Accordion.js +18 -6
- package/AccordionActions/AccordionActions.d.ts +2 -2
- package/AccordionDetails/AccordionDetails.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +62 -7
- package/AccordionSummary/AccordionSummary.js +67 -16
- package/Alert/Alert.d.ts +3 -3
- package/AlertTitle/AlertTitle.d.ts +3 -3
- package/AppBar/AppBar.d.ts +3 -3
- package/Autocomplete/Autocomplete.d.ts +2 -2
- package/Autocomplete/Autocomplete.js +1 -1
- package/Avatar/Avatar.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/Backdrop/Backdrop.d.ts +3 -3
- package/Badge/Badge.d.ts +3 -3
- package/BottomNavigation/BottomNavigation.d.ts +2 -2
- package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
- package/Box/Box.d.ts +2 -2
- package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/Button/Button.d.ts +4 -4
- package/ButtonBase/ButtonBase.d.ts +2 -2
- package/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/CHANGELOG.md +78 -4
- package/Card/Card.d.ts +3 -3
- package/CardActionArea/CardActionArea.d.ts +3 -3
- package/CardActions/CardActions.d.ts +2 -2
- package/CardContent/CardContent.d.ts +2 -2
- package/CardHeader/CardHeader.d.ts +2 -2
- package/CardMedia/CardMedia.d.ts +2 -2
- package/Checkbox/Checkbox.d.ts +4 -4
- package/Chip/Chip.d.ts +2 -2
- package/CircularProgress/CircularProgress.d.ts +2 -2
- package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
- package/ClickAwayListener/ClickAwayListener.js +3 -3
- package/Collapse/Collapse.d.ts +5 -5
- package/Container/Container.d.ts +2 -2
- package/CssBaseline/CssBaseline.d.ts +2 -2
- package/Dialog/Dialog.d.ts +3 -3
- package/DialogActions/DialogActions.d.ts +2 -2
- package/DialogContent/DialogContent.d.ts +2 -2
- package/DialogContentText/DialogContentText.d.ts +3 -3
- package/DialogTitle/DialogTitle.d.ts +3 -3
- package/Divider/Divider.d.ts +3 -3
- package/Drawer/Drawer.d.ts +3 -3
- package/Fab/Fab.d.ts +3 -3
- package/Fade/Fade.d.ts +3 -3
- package/FilledInput/FilledInput.d.ts +3 -3
- package/FormControl/FormControl.d.ts +6 -6
- package/FormControlLabel/FormControlLabel.d.ts +4 -4
- package/FormGroup/FormGroup.d.ts +3 -3
- package/FormHelperText/FormHelperText.d.ts +2 -2
- package/FormLabel/FormLabel.d.ts +4 -4
- package/GlobalStyles/GlobalStyles.d.ts +2 -2
- package/Grid/Grid.d.ts +2 -2
- package/Grid2/Grid2.d.ts +2 -2
- package/Grid2/Grid2.js +2 -2
- package/Grow/Grow.d.ts +5 -5
- package/Hidden/Hidden.d.ts +2 -2
- package/Icon/Icon.d.ts +3 -3
- package/IconButton/IconButton.d.ts +4 -4
- package/ImageList/ImageList.d.ts +2 -2
- package/ImageListItem/ImageListItem.d.ts +2 -2
- package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
- package/Input/Input.d.ts +3 -3
- package/InputAdornment/InputAdornment.d.ts +2 -2
- package/InputBase/InputBase.d.ts +2 -2
- package/InputLabel/InputLabel.d.ts +3 -3
- package/LinearProgress/LinearProgress.d.ts +2 -2
- package/Link/Link.d.ts +4 -4
- package/List/List.d.ts +3 -3
- package/ListItem/ListItem.d.ts +3 -3
- package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
- package/ListItemButton/ListItemButton.d.ts +3 -3
- package/ListItemIcon/ListItemIcon.d.ts +2 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
- package/ListItemText/ListItemText.d.ts +12 -2
- package/ListItemText/ListItemText.js +14 -5
- package/ListSubheader/ListSubheader.d.ts +2 -2
- package/Menu/Menu.d.ts +4 -4
- package/MenuItem/MenuItem.d.ts +3 -3
- package/MenuList/MenuList.d.ts +4 -4
- package/MobileStepper/MobileStepper.d.ts +3 -3
- package/Modal/Modal.d.ts +7 -7
- package/NativeSelect/NativeSelect.d.ts +3 -3
- package/NoSsr/NoSsr.d.ts +2 -2
- package/NoSsr/NoSsr.js +2 -2
- package/OutlinedInput/OutlinedInput.d.ts +3 -3
- package/Pagination/Pagination.d.ts +2 -2
- package/PaginationItem/PaginationItem.d.ts +2 -2
- package/Paper/Paper.d.ts +3 -3
- package/PigmentContainer/PigmentContainer.d.ts +2 -2
- package/PigmentContainer/PigmentContainer.js +2 -2
- package/PigmentGrid/PigmentGrid.d.ts +2 -2
- package/PigmentGrid/PigmentGrid.js +2 -2
- package/PigmentHidden/PigmentHidden.d.ts +2 -2
- package/PigmentHidden/PigmentHidden.js +2 -2
- package/PigmentStack/PigmentStack.d.ts +2 -2
- package/PigmentStack/PigmentStack.js +2 -2
- package/Popover/Popover.d.ts +4 -4
- package/Popper/Popper.d.ts +4 -4
- package/Popper/Popper.js +4 -4
- package/Portal/Portal.d.ts +2 -2
- package/Portal/Portal.js +2 -2
- package/README.md +4 -2
- package/Radio/Radio.d.ts +3 -3
- package/RadioGroup/RadioGroup.d.ts +3 -3
- package/Rating/Rating.d.ts +2 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
- package/Select/Select.d.ts +3 -3
- package/Skeleton/Skeleton.d.ts +2 -2
- package/Slide/Slide.d.ts +4 -4
- package/Slider/Slider.d.ts +2 -2
- package/Snackbar/Snackbar.d.ts +2 -2
- package/Snackbar/Snackbar.js +7 -1
- package/SnackbarContent/SnackbarContent.d.ts +3 -3
- package/SpeedDial/SpeedDial.d.ts +12 -2
- package/SpeedDial/SpeedDial.js +40 -11
- package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
- package/SpeedDialAction/SpeedDialAction.js +1 -1
- package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/Step/Step.d.ts +2 -2
- package/StepButton/StepButton.d.ts +3 -3
- package/StepConnector/StepConnector.d.ts +2 -2
- package/StepContent/StepContent.d.ts +2 -2
- package/StepIcon/StepIcon.d.ts +3 -3
- package/StepLabel/StepLabel.d.ts +21 -3
- package/StepLabel/StepLabel.js +14 -5
- package/Stepper/Stepper.d.ts +2 -2
- package/SvgIcon/SvgIcon.d.ts +3 -3
- package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
- package/Switch/Switch.d.ts +78 -5
- package/Switch/Switch.js +71 -9
- package/Tab/Tab.d.ts +3 -3
- package/TabScrollButton/TabScrollButton.d.ts +2 -2
- package/Table/Table.d.ts +2 -2
- package/TableBody/TableBody.d.ts +2 -2
- package/TableCell/TableCell.d.ts +2 -2
- package/TableContainer/TableContainer.d.ts +2 -2
- package/TableFooter/TableFooter.d.ts +2 -2
- package/TableHead/TableHead.d.ts +2 -2
- package/TablePagination/TablePagination.d.ts +4 -4
- package/TableRow/TableRow.d.ts +2 -2
- package/TableSortLabel/TableSortLabel.d.ts +3 -3
- package/Tabs/Tabs.d.ts +2 -2
- package/Tabs/Tabs.js +4 -0
- package/TextField/TextField.d.ts +40 -10
- package/TextField/TextField.js +22 -11
- package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
- package/TextareaAutosize/TextareaAutosize.js +28 -17
- package/ToggleButton/ToggleButton.d.ts +3 -3
- package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
- package/Toolbar/Toolbar.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +3 -15
- package/Tooltip/Tooltip.js +1 -1
- package/Typography/Typography.d.ts +3 -3
- package/Zoom/Zoom.d.ts +3 -3
- package/index.js +1 -1
- package/modern/Accordion/Accordion.js +18 -6
- package/modern/AccordionSummary/AccordionSummary.js +67 -16
- package/modern/Autocomplete/Autocomplete.js +1 -1
- package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
- package/modern/Grid2/Grid2.js +2 -2
- package/modern/ListItemText/ListItemText.js +14 -5
- package/modern/NoSsr/NoSsr.js +2 -2
- package/modern/PigmentContainer/PigmentContainer.js +2 -2
- package/modern/PigmentGrid/PigmentGrid.js +2 -2
- package/modern/PigmentHidden/PigmentHidden.js +2 -2
- package/modern/PigmentStack/PigmentStack.js +2 -2
- package/modern/Popper/Popper.js +4 -4
- package/modern/Portal/Portal.js +2 -2
- package/modern/Snackbar/Snackbar.js +7 -1
- package/modern/SpeedDial/SpeedDial.js +40 -11
- package/modern/SpeedDialAction/SpeedDialAction.js +1 -1
- package/modern/StepLabel/StepLabel.js +14 -5
- package/modern/Switch/Switch.js +71 -9
- package/modern/Tabs/Tabs.js +4 -0
- package/modern/TextField/TextField.js +22 -11
- package/modern/TextareaAutosize/TextareaAutosize.js +28 -17
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/ThemeProvider.js +11 -0
- package/modern/styles/createThemeNoVars.js +1 -3
- package/modern/useAutocomplete/useAutocomplete.js +3 -3
- package/modern/useScrollTrigger/useScrollTrigger.js +3 -0
- package/modern/version/index.js +2 -2
- package/node/Accordion/Accordion.js +18 -6
- package/node/AccordionSummary/AccordionSummary.js +67 -16
- package/node/Autocomplete/Autocomplete.js +1 -1
- package/node/ClickAwayListener/ClickAwayListener.js +3 -3
- package/node/Grid2/Grid2.js +2 -2
- package/node/ListItemText/ListItemText.js +14 -5
- package/node/NoSsr/NoSsr.js +2 -2
- package/node/PigmentContainer/PigmentContainer.js +2 -2
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/PigmentHidden/PigmentHidden.js +2 -2
- package/node/PigmentStack/PigmentStack.js +2 -2
- package/node/Popper/Popper.js +4 -4
- package/node/Portal/Portal.js +2 -2
- package/node/Snackbar/Snackbar.js +7 -1
- package/node/SpeedDial/SpeedDial.js +40 -11
- package/node/SpeedDialAction/SpeedDialAction.js +1 -1
- package/node/StepLabel/StepLabel.js +14 -5
- package/node/Switch/Switch.js +71 -9
- package/node/Tabs/Tabs.js +4 -0
- package/node/TextField/TextField.js +22 -11
- package/node/TextareaAutosize/TextareaAutosize.js +27 -16
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/ThemeProvider.js +11 -0
- package/node/styles/createThemeNoVars.js +1 -3
- package/node/useAutocomplete/useAutocomplete.js +3 -3
- package/node/useScrollTrigger/useScrollTrigger.js +3 -0
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/ThemeProvider.js +11 -0
- package/styles/createThemeNoVars.js +1 -3
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +3 -3
- package/useScrollTrigger/useScrollTrigger.d.ts +1 -1
- package/useScrollTrigger/useScrollTrigger.js +3 -0
- package/version/index.js +2 -2
|
@@ -167,6 +167,25 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
167
167
|
}
|
|
168
168
|
inputAdditionalProps['aria-describedby'] = undefined;
|
|
169
169
|
}
|
|
170
|
+
const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
|
|
171
|
+
elementType: TextFieldRoot,
|
|
172
|
+
shouldForwardComponentProp: true,
|
|
173
|
+
externalForwardedProps: {
|
|
174
|
+
...externalForwardedProps,
|
|
175
|
+
...other
|
|
176
|
+
},
|
|
177
|
+
ownerState,
|
|
178
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
179
|
+
ref,
|
|
180
|
+
additionalProps: {
|
|
181
|
+
disabled,
|
|
182
|
+
error,
|
|
183
|
+
fullWidth,
|
|
184
|
+
required,
|
|
185
|
+
color,
|
|
186
|
+
variant
|
|
187
|
+
}
|
|
188
|
+
});
|
|
170
189
|
const [InputSlot, inputProps] = (0, _useSlot.default)('input', {
|
|
171
190
|
elementType: InputComponent,
|
|
172
191
|
externalForwardedProps,
|
|
@@ -218,17 +237,8 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
218
237
|
},
|
|
219
238
|
...inputProps
|
|
220
239
|
});
|
|
221
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
222
|
-
|
|
223
|
-
disabled: disabled,
|
|
224
|
-
error: error,
|
|
225
|
-
fullWidth: fullWidth,
|
|
226
|
-
ref: ref,
|
|
227
|
-
required: required,
|
|
228
|
-
color: color,
|
|
229
|
-
variant: variant,
|
|
230
|
-
ownerState: ownerState,
|
|
231
|
-
...other,
|
|
240
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
241
|
+
...rootProps,
|
|
232
242
|
children: [label != null && label !== '' && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputLabelSlot, {
|
|
233
243
|
htmlFor: id,
|
|
234
244
|
id: inputLabelId,
|
|
@@ -430,6 +440,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
430
440
|
htmlInput: _propTypes.default.elementType,
|
|
431
441
|
input: _propTypes.default.elementType,
|
|
432
442
|
inputLabel: _propTypes.default.elementType,
|
|
443
|
+
root: _propTypes.default.elementType,
|
|
433
444
|
select: _propTypes.default.elementType
|
|
434
445
|
}),
|
|
435
446
|
/**
|
|
@@ -44,11 +44,11 @@ function isEmpty(obj) {
|
|
|
44
44
|
*
|
|
45
45
|
* Demos:
|
|
46
46
|
*
|
|
47
|
-
* - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/)
|
|
47
|
+
* - [Textarea Autosize](https://v6.mui.com/material-ui/react-textarea-autosize/)
|
|
48
48
|
*
|
|
49
49
|
* API:
|
|
50
50
|
*
|
|
51
|
-
* - [TextareaAutosize API](https://mui.com/material-ui/api/textarea-autosize/)
|
|
51
|
+
* - [TextareaAutosize API](https://v6.mui.com/material-ui/api/textarea-autosize/)
|
|
52
52
|
*/
|
|
53
53
|
const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(props, forwardedRef) {
|
|
54
54
|
const {
|
|
@@ -119,6 +119,15 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
119
119
|
overflowing
|
|
120
120
|
};
|
|
121
121
|
}, [maxRows, minRows, props.placeholder]);
|
|
122
|
+
const didHeightChange = (0, _utils.unstable_useEventCallback)(() => {
|
|
123
|
+
const textarea = textareaRef.current;
|
|
124
|
+
const textareaStyles = calculateTextareaStyles();
|
|
125
|
+
if (!textarea || !textareaStyles || isEmpty(textareaStyles)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const outerHeightStyle = textareaStyles.outerHeightStyle;
|
|
129
|
+
return heightRef.current != null && heightRef.current !== outerHeightStyle;
|
|
130
|
+
});
|
|
122
131
|
const syncHeight = React.useCallback(() => {
|
|
123
132
|
const textarea = textareaRef.current;
|
|
124
133
|
const textareaStyles = calculateTextareaStyles();
|
|
@@ -134,37 +143,39 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
134
143
|
}, [calculateTextareaStyles]);
|
|
135
144
|
const frameRef = React.useRef(-1);
|
|
136
145
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
137
|
-
const
|
|
146
|
+
const debouncedHandleResize = (0, _utils.unstable_debounce)(syncHeight);
|
|
138
147
|
const textarea = textareaRef?.current;
|
|
139
148
|
if (!textarea) {
|
|
140
149
|
return undefined;
|
|
141
150
|
}
|
|
142
151
|
const containerWindow = (0, _utils.unstable_ownerWindow)(textarea);
|
|
143
|
-
containerWindow.addEventListener('resize',
|
|
152
|
+
containerWindow.addEventListener('resize', debouncedHandleResize);
|
|
144
153
|
let resizeObserver;
|
|
145
154
|
if (typeof ResizeObserver !== 'undefined') {
|
|
146
155
|
resizeObserver = new ResizeObserver(() => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
if (didHeightChange()) {
|
|
157
|
+
// avoid "ResizeObserver loop completed with undelivered notifications" error
|
|
158
|
+
// by temporarily unobserving the textarea element while manipulating the height
|
|
159
|
+
// and reobserving one frame later
|
|
160
|
+
resizeObserver.unobserve(textarea);
|
|
161
|
+
cancelAnimationFrame(frameRef.current);
|
|
162
|
+
syncHeight();
|
|
163
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
164
|
+
resizeObserver.observe(textarea);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
156
167
|
});
|
|
157
168
|
resizeObserver.observe(textarea);
|
|
158
169
|
}
|
|
159
170
|
return () => {
|
|
160
|
-
|
|
171
|
+
debouncedHandleResize.clear();
|
|
161
172
|
cancelAnimationFrame(frameRef.current);
|
|
162
|
-
containerWindow.removeEventListener('resize',
|
|
173
|
+
containerWindow.removeEventListener('resize', debouncedHandleResize);
|
|
163
174
|
if (resizeObserver) {
|
|
164
175
|
resizeObserver.disconnect();
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
|
-
}, [calculateTextareaStyles, syncHeight]);
|
|
178
|
+
}, [calculateTextareaStyles, syncHeight, didHeightChange]);
|
|
168
179
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
169
180
|
syncHeight();
|
|
170
181
|
});
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -849,7 +849,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
849
849
|
* Tooltip placement.
|
|
850
850
|
* @default 'bottom'
|
|
851
851
|
*/
|
|
852
|
-
placement: _propTypes.default.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
852
|
+
placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
853
853
|
/**
|
|
854
854
|
* The component used for the popper.
|
|
855
855
|
* @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
package/node/index.js
CHANGED
|
@@ -24,6 +24,17 @@ function ThemeProvider({
|
|
|
24
24
|
}
|
|
25
25
|
const muiTheme = _identifier.default in theme ? theme[_identifier.default] : theme;
|
|
26
26
|
if (!('colorSchemes' in muiTheme)) {
|
|
27
|
+
if (!('vars' in muiTheme)) {
|
|
28
|
+
// For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
|
|
29
|
+
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
|
|
31
|
+
theme: {
|
|
32
|
+
...theme,
|
|
33
|
+
vars: null
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
27
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
|
|
28
39
|
theme: theme,
|
|
29
40
|
...props
|
|
@@ -34,9 +34,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
34
34
|
// The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
35
35
|
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
36
36
|
options.generateThemeVars === undefined) {
|
|
37
|
-
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
|
|
38
|
-
// #host-reference
|
|
39
|
-
'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : (0, _formatMuiErrorMessage2.default)(20));
|
|
37
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : (0, _formatMuiErrorMessage2.default)(20));
|
|
40
38
|
}
|
|
41
39
|
const palette = (0, _createPalette.default)(paletteInput);
|
|
42
40
|
const systemTheme = (0, _createTheme.default)(options);
|
|
@@ -244,7 +244,7 @@ function useAutocomplete(props) {
|
|
|
244
244
|
const setHighlightedIndex = (0, _utils.unstable_useEventCallback)(({
|
|
245
245
|
event,
|
|
246
246
|
index,
|
|
247
|
-
reason
|
|
247
|
+
reason
|
|
248
248
|
}) => {
|
|
249
249
|
highlightedIndexRef.current = index;
|
|
250
250
|
|
|
@@ -254,7 +254,7 @@ function useAutocomplete(props) {
|
|
|
254
254
|
} else {
|
|
255
255
|
inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
|
|
256
256
|
}
|
|
257
|
-
if (onHighlightChange) {
|
|
257
|
+
if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
|
|
258
258
|
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
|
259
259
|
}
|
|
260
260
|
if (!listboxRef.current) {
|
|
@@ -307,7 +307,7 @@ function useAutocomplete(props) {
|
|
|
307
307
|
event,
|
|
308
308
|
diff,
|
|
309
309
|
direction = 'next',
|
|
310
|
-
reason
|
|
310
|
+
reason
|
|
311
311
|
}) => {
|
|
312
312
|
if (!popupOpen) {
|
|
313
313
|
return;
|
|
@@ -35,6 +35,9 @@ function useScrollTrigger(options = {}) {
|
|
|
35
35
|
const store = React.useRef();
|
|
36
36
|
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
37
37
|
React.useEffect(() => {
|
|
38
|
+
if (target === null) {
|
|
39
|
+
return setTrigger(false);
|
|
40
|
+
}
|
|
38
41
|
const handleScroll = () => {
|
|
39
42
|
setTrigger(getTrigger(store, {
|
|
40
43
|
target,
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.4.
|
|
7
|
+
const version = exports.version = "6.4.9";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
9
|
const minor = exports.minor = Number("4");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("9");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^19.0.0",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/system": "^6.4.
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/core-downloads-tracker": "^6.4.
|
|
38
|
+
"@mui/types": "~7.2.24",
|
|
39
|
+
"@mui/system": "^6.4.9",
|
|
40
|
+
"@mui/utils": "^6.4.8",
|
|
41
|
+
"@mui/core-downloads-tracker": "^6.4.9"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.4.
|
|
49
|
+
"@mui/material-pigment-css": "^6.4.9"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
package/styles/ThemeProvider.js
CHANGED
|
@@ -17,6 +17,17 @@ export default function ThemeProvider({
|
|
|
17
17
|
}
|
|
18
18
|
const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
|
|
19
19
|
if (!('colorSchemes' in muiTheme)) {
|
|
20
|
+
if (!('vars' in muiTheme)) {
|
|
21
|
+
// For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
|
|
22
|
+
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
23
|
+
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
24
|
+
theme: {
|
|
25
|
+
...theme,
|
|
26
|
+
vars: null
|
|
27
|
+
},
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
20
31
|
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
21
32
|
theme: theme,
|
|
22
33
|
...props
|
|
@@ -25,9 +25,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
25
25
|
// The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
26
26
|
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
27
27
|
options.generateThemeVars === undefined) {
|
|
28
|
-
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
|
|
29
|
-
// #host-reference
|
|
30
|
-
'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatMuiErrorMessage(20));
|
|
28
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatMuiErrorMessage(20));
|
|
31
29
|
}
|
|
32
30
|
const palette = createPalette(paletteInput);
|
|
33
31
|
const systemTheme = systemCreateTheme(options);
|
|
@@ -246,7 +246,7 @@ export interface UseAutocompleteProps<
|
|
|
246
246
|
*
|
|
247
247
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
248
248
|
* @param {Value} option The highlighted option.
|
|
249
|
-
* @param {string} reason Can be: `"keyboard"`, `"
|
|
249
|
+
* @param {string} reason Can be: `"keyboard"`, `"mouse"`, `"touch"`.
|
|
250
250
|
*/
|
|
251
251
|
onHighlightChange?: (
|
|
252
252
|
event: React.SyntheticEvent,
|
|
@@ -312,7 +312,7 @@ export interface UseAutocompleteParameters<
|
|
|
312
312
|
FreeSolo extends boolean | undefined,
|
|
313
313
|
> extends UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo> {}
|
|
314
314
|
|
|
315
|
-
export type AutocompleteHighlightChangeReason = 'keyboard' | 'mouse' | '
|
|
315
|
+
export type AutocompleteHighlightChangeReason = 'keyboard' | 'mouse' | 'touch';
|
|
316
316
|
|
|
317
317
|
export type AutocompleteChangeReason =
|
|
318
318
|
| 'createOption'
|
|
@@ -238,7 +238,7 @@ function useAutocomplete(props) {
|
|
|
238
238
|
const setHighlightedIndex = useEventCallback(({
|
|
239
239
|
event,
|
|
240
240
|
index,
|
|
241
|
-
reason
|
|
241
|
+
reason
|
|
242
242
|
}) => {
|
|
243
243
|
highlightedIndexRef.current = index;
|
|
244
244
|
|
|
@@ -248,7 +248,7 @@ function useAutocomplete(props) {
|
|
|
248
248
|
} else {
|
|
249
249
|
inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
|
|
250
250
|
}
|
|
251
|
-
if (onHighlightChange) {
|
|
251
|
+
if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
|
|
252
252
|
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
|
253
253
|
}
|
|
254
254
|
if (!listboxRef.current) {
|
|
@@ -301,7 +301,7 @@ function useAutocomplete(props) {
|
|
|
301
301
|
event,
|
|
302
302
|
diff,
|
|
303
303
|
direction = 'next',
|
|
304
|
-
reason
|
|
304
|
+
reason
|
|
305
305
|
}) => {
|
|
306
306
|
if (!popupOpen) {
|
|
307
307
|
return;
|
|
@@ -29,6 +29,9 @@ export default function useScrollTrigger(options = {}) {
|
|
|
29
29
|
const store = React.useRef();
|
|
30
30
|
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
31
31
|
React.useEffect(() => {
|
|
32
|
+
if (target === null) {
|
|
33
|
+
return setTrigger(false);
|
|
34
|
+
}
|
|
32
35
|
const handleScroll = () => {
|
|
33
36
|
setTrigger(getTrigger(store, {
|
|
34
37
|
target,
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.9";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("9");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|