@mui/material 6.0.0-alpha.5 → 6.0.0-alpha.7
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 +2 -2
- package/Accordion/Accordion.js +2 -2
- package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +2 -2
- package/Alert/alertClasses.d.ts +12 -12
- package/Autocomplete/Autocomplete.d.ts +78 -12
- package/Autocomplete/Autocomplete.js +120 -59
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Backdrop/Backdrop.js +1 -1
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +2 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/Button/Button.js +1 -1
- package/Button/buttonClasses.d.ts +33 -33
- package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/CHANGELOG.md +95 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- package/CircularProgress/circularProgressClasses.d.ts +6 -2
- package/Collapse/Collapse.js +66 -35
- package/Dialog/Dialog.js +105 -61
- package/DialogActions/DialogActions.js +16 -12
- package/DialogContent/DialogContent.js +25 -15
- package/DialogContentText/DialogContentText.js +3 -2
- package/DialogTitle/DialogTitle.js +2 -2
- package/Divider/Divider.d.ts +1 -1
- package/Divider/Divider.js +1 -1
- package/Drawer/Drawer.js +73 -32
- package/Fab/Fab.js +1 -1
- package/FilledInput/FilledInput.d.ts +1 -0
- package/FilledInput/FilledInput.js +170 -87
- package/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/FormControlLabel/FormControlLabel.js +1 -1
- package/FormHelperText/FormHelperText.js +2 -2
- package/FormLabel/FormLabel.js +23 -13
- package/Grow/Grow.js +3 -1
- package/Icon/Icon.js +63 -23
- package/ImageList/ImageList.js +2 -2
- package/ImageListItem/ImageListItem.js +2 -2
- package/ImageListItemBar/ImageListItemBar.js +2 -2
- package/Input/Input.d.ts +1 -0
- package/Input/Input.js +84 -61
- package/InputAdornment/InputAdornment.js +37 -21
- package/InputBase/InputBase.js +58 -28
- package/InputLabel/InputLabel.js +120 -58
- package/Link/Link.js +99 -54
- package/Link/getTextDecoration.d.ts +2 -8
- package/Link/getTextDecoration.js +16 -8
- package/List/List.js +22 -13
- package/ListItem/ListItem.js +2 -2
- package/ListItemAvatar/ListItemAvatar.js +2 -2
- package/ListItemButton/ListItemButton.js +3 -2
- package/ListItemIcon/ListItemIcon.js +14 -9
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/ListItemText/ListItemText.js +2 -2
- package/ListSubheader/ListSubheader.js +5 -3
- package/Menu/Menu.js +3 -2
- package/MenuItem/MenuItem.js +47 -27
- package/NativeSelect/NativeSelectInput.js +78 -49
- package/OutlinedInput/NotchedOutline.js +60 -43
- package/OutlinedInput/OutlinedInput.js +97 -39
- package/Pagination/Pagination.js +2 -2
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/Paper/Paper.js +44 -21
- package/Radio/Radio.js +5 -3
- package/Radio/RadioButtonIcon.js +1 -1
- package/Rating/Rating.js +3 -2
- package/Select/Select.js +2 -1
- package/Select/SelectInput.js +8 -6
- package/Skeleton/Skeleton.js +109 -61
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.js +66 -40
- package/SnackbarContent/SnackbarContent.js +2 -2
- package/SpeedDial/SpeedDial.d.ts +28 -1
- package/SpeedDial/SpeedDial.js +107 -49
- package/SpeedDialAction/SpeedDialAction.js +50 -24
- package/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/StepLabel/StepLabel.d.ts +3 -3
- package/StepLabel/StepLabel.js +3 -3
- package/SwipeableDrawer/SwipeArea.js +39 -18
- package/Tab/Tab.js +127 -55
- package/TabScrollButton/TabScrollButton.js +27 -15
- package/Table/Table.js +2 -2
- package/TableBody/TableBody.js +2 -2
- package/TableCell/TableCell.js +2 -2
- package/TableContainer/TableContainer.js +2 -2
- package/TableFooter/TableFooter.js +2 -2
- package/TableHead/TableHead.js +2 -2
- package/TablePagination/TablePagination.js +2 -2
- package/TableRow/TableRow.js +2 -2
- package/TableSortLabel/TableSortLabel.js +2 -2
- package/Tabs/Tabs.js +107 -54
- package/TextField/TextField.js +2 -2
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +4 -2
- package/Toolbar/Toolbar.js +3 -7
- package/Tooltip/Tooltip.js +185 -88
- package/Typography/Typography.js +89 -39
- package/index.js +1 -1
- package/internal/SwitchBase.js +39 -11
- package/modern/Accordion/Accordion.js +2 -2
- package/modern/Alert/Alert.js +2 -2
- package/modern/Autocomplete/Autocomplete.js +120 -59
- package/modern/Avatar/Avatar.js +1 -1
- package/modern/Backdrop/Backdrop.js +1 -1
- package/modern/Badge/Badge.js +2 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/modern/Button/Button.js +1 -1
- package/modern/Checkbox/Checkbox.js +3 -1
- package/modern/Chip/chipClasses.js +1 -1
- package/modern/Collapse/Collapse.js +66 -35
- package/modern/Dialog/Dialog.js +105 -61
- package/modern/DialogActions/DialogActions.js +16 -12
- package/modern/DialogContent/DialogContent.js +25 -15
- package/modern/DialogContentText/DialogContentText.js +3 -2
- package/modern/DialogTitle/DialogTitle.js +2 -2
- package/modern/Divider/Divider.js +1 -1
- package/modern/Drawer/Drawer.js +73 -32
- package/modern/Fab/Fab.js +1 -1
- package/modern/FilledInput/FilledInput.js +170 -87
- package/modern/FormControlLabel/FormControlLabel.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +2 -2
- package/modern/FormLabel/FormLabel.js +23 -13
- package/modern/Grow/Grow.js +3 -1
- package/modern/Icon/Icon.js +63 -23
- package/modern/ImageList/ImageList.js +2 -2
- package/modern/ImageListItem/ImageListItem.js +2 -2
- package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
- package/modern/Input/Input.js +84 -61
- package/modern/InputAdornment/InputAdornment.js +37 -21
- package/modern/InputBase/InputBase.js +58 -28
- package/modern/InputLabel/InputLabel.js +120 -58
- package/modern/Link/Link.js +99 -54
- package/modern/Link/getTextDecoration.js +16 -8
- package/modern/List/List.js +22 -13
- package/modern/ListItem/ListItem.js +2 -2
- package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
- package/modern/ListItemButton/ListItemButton.js +3 -2
- package/modern/ListItemIcon/ListItemIcon.js +14 -9
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/modern/ListItemText/ListItemText.js +2 -2
- package/modern/ListSubheader/ListSubheader.js +5 -3
- package/modern/Menu/Menu.js +3 -2
- package/modern/MenuItem/MenuItem.js +47 -27
- package/modern/NativeSelect/NativeSelectInput.js +78 -49
- package/modern/OutlinedInput/NotchedOutline.js +60 -43
- package/modern/OutlinedInput/OutlinedInput.js +97 -39
- package/modern/Pagination/Pagination.js +2 -2
- package/modern/PaginationItem/PaginationItem.js +1 -1
- package/modern/Paper/Paper.js +44 -21
- package/modern/Radio/Radio.js +5 -3
- package/modern/Radio/RadioButtonIcon.js +1 -1
- package/modern/Rating/Rating.js +3 -2
- package/modern/Select/Select.js +2 -1
- package/modern/Select/SelectInput.js +8 -6
- package/modern/Skeleton/Skeleton.js +109 -61
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +66 -40
- package/modern/SnackbarContent/SnackbarContent.js +2 -2
- package/modern/SpeedDial/SpeedDial.js +107 -49
- package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
- package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/modern/StepLabel/StepLabel.js +3 -3
- package/modern/SwipeableDrawer/SwipeArea.js +39 -18
- package/modern/Tab/Tab.js +127 -55
- package/modern/TabScrollButton/TabScrollButton.js +27 -15
- package/modern/Table/Table.js +2 -2
- package/modern/TableBody/TableBody.js +2 -2
- package/modern/TableCell/TableCell.js +2 -2
- package/modern/TableContainer/TableContainer.js +2 -2
- package/modern/TableFooter/TableFooter.js +2 -2
- package/modern/TableHead/TableHead.js +2 -2
- package/modern/TablePagination/TablePagination.js +2 -2
- package/modern/TableRow/TableRow.js +2 -2
- package/modern/TableSortLabel/TableSortLabel.js +2 -2
- package/modern/Tabs/Tabs.js +107 -54
- package/modern/TextField/TextField.js +2 -2
- package/modern/Toolbar/Toolbar.js +3 -7
- package/modern/Tooltip/Tooltip.js +185 -88
- package/modern/Typography/Typography.js +89 -39
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +39 -11
- package/node/Accordion/Accordion.js +2 -2
- package/node/Alert/Alert.js +2 -2
- package/node/Autocomplete/Autocomplete.js +120 -60
- package/node/Avatar/Avatar.js +1 -1
- package/node/Backdrop/Backdrop.js +1 -1
- package/node/Badge/Badge.js +2 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
- package/node/Button/Button.js +2 -2
- package/node/Checkbox/Checkbox.js +3 -1
- package/node/Chip/chipClasses.js +1 -1
- package/node/Collapse/Collapse.js +70 -39
- package/node/Dialog/Dialog.js +110 -66
- package/node/DialogActions/DialogActions.js +18 -14
- package/node/DialogContent/DialogContent.js +27 -17
- package/node/DialogContentText/DialogContentText.js +6 -5
- package/node/DialogTitle/DialogTitle.js +4 -4
- package/node/Divider/Divider.js +1 -1
- package/node/Drawer/Drawer.js +78 -37
- package/node/Fab/Fab.js +2 -2
- package/node/FilledInput/FilledInput.js +176 -91
- package/node/FormControlLabel/FormControlLabel.js +1 -1
- package/node/FormHelperText/FormHelperText.js +4 -4
- package/node/FormLabel/FormLabel.js +26 -16
- package/node/Grow/Grow.js +3 -1
- package/node/Icon/Icon.js +65 -25
- package/node/ImageList/ImageList.js +4 -4
- package/node/ImageListItem/ImageListItem.js +4 -4
- package/node/ImageListItemBar/ImageListItemBar.js +8 -8
- package/node/Input/Input.js +87 -64
- package/node/InputAdornment/InputAdornment.js +39 -23
- package/node/InputBase/InputBase.js +61 -31
- package/node/InputLabel/InputLabel.js +123 -61
- package/node/Link/Link.js +101 -56
- package/node/Link/getTextDecoration.js +18 -10
- package/node/List/List.js +24 -15
- package/node/ListItem/ListItem.js +5 -5
- package/node/ListItemAvatar/ListItemAvatar.js +4 -4
- package/node/ListItemButton/ListItemButton.js +6 -5
- package/node/ListItemIcon/ListItemIcon.js +16 -11
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
- package/node/ListItemText/ListItemText.js +4 -4
- package/node/ListSubheader/ListSubheader.js +7 -5
- package/node/Menu/Menu.js +8 -7
- package/node/MenuItem/MenuItem.js +50 -30
- package/node/NativeSelect/NativeSelectInput.js +80 -53
- package/node/OutlinedInput/NotchedOutline.js +64 -47
- package/node/OutlinedInput/OutlinedInput.js +101 -43
- package/node/Pagination/Pagination.js +5 -5
- package/node/PaginationItem/PaginationItem.js +1 -1
- package/node/Paper/Paper.js +49 -28
- package/node/Radio/Radio.js +6 -4
- package/node/Radio/RadioButtonIcon.js +2 -2
- package/node/Rating/Rating.js +9 -8
- package/node/Select/Select.js +6 -5
- package/node/Select/SelectInput.js +9 -7
- package/node/Skeleton/Skeleton.js +113 -65
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +68 -42
- package/node/SnackbarContent/SnackbarContent.js +6 -6
- package/node/SpeedDial/SpeedDial.js +111 -53
- package/node/SpeedDialAction/SpeedDialAction.js +54 -28
- package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
- package/node/StepLabel/StepLabel.js +3 -3
- package/node/SwipeableDrawer/SwipeArea.js +41 -20
- package/node/Tab/Tab.js +129 -57
- package/node/TabScrollButton/TabScrollButton.js +29 -17
- package/node/Table/Table.js +4 -4
- package/node/TableBody/TableBody.js +4 -4
- package/node/TableCell/TableCell.js +4 -4
- package/node/TableContainer/TableContainer.js +4 -4
- package/node/TableFooter/TableFooter.js +4 -4
- package/node/TableHead/TableHead.js +4 -4
- package/node/TablePagination/TablePagination.js +10 -10
- package/node/TableRow/TableRow.js +4 -4
- package/node/TableSortLabel/TableSortLabel.js +5 -5
- package/node/Tabs/Tabs.js +113 -60
- package/node/TextField/TextField.js +4 -4
- package/node/Toolbar/Toolbar.js +5 -9
- package/node/Tooltip/Tooltip.js +189 -92
- package/node/Typography/Typography.js +90 -40
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +41 -13
- package/package.json +6 -6
- package/umd/material-ui.development.js +2705 -1353
- package/umd/material-ui.production.min.js +4 -4
package/Accordion/Accordion.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export type AccordionTypeMap<
|
|
|
79
79
|
/**
|
|
80
80
|
* The component used for the transition.
|
|
81
81
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
82
|
-
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [
|
|
82
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
83
83
|
*/
|
|
84
84
|
TransitionComponent?: React.JSXElementConstructor<
|
|
85
85
|
TransitionProps & { children?: React.ReactElement<any, any> }
|
|
@@ -87,7 +87,7 @@ export type AccordionTypeMap<
|
|
|
87
87
|
/**
|
|
88
88
|
* Props applied to the transition element.
|
|
89
89
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
90
|
-
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [
|
|
90
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
91
91
|
*/
|
|
92
92
|
TransitionProps?: TransitionProps;
|
|
93
93
|
} & AccordionSlotsAndSlotProps;
|
package/Accordion/Accordion.js
CHANGED
|
@@ -282,13 +282,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
282
282
|
/**
|
|
283
283
|
* The component used for the transition.
|
|
284
284
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
285
|
-
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [
|
|
285
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
286
286
|
*/
|
|
287
287
|
TransitionComponent: PropTypes.elementType,
|
|
288
288
|
/**
|
|
289
289
|
* Props applied to the transition element.
|
|
290
290
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
291
|
-
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [
|
|
291
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
292
292
|
*/
|
|
293
293
|
TransitionProps: PropTypes.object
|
|
294
294
|
} : void 0;
|
|
@@ -11,7 +11,7 @@ export interface AccordionSummaryClasses {
|
|
|
11
11
|
gutters: string;
|
|
12
12
|
/**
|
|
13
13
|
* Styles applied to the children wrapper element unless `disableGutters={true}`.
|
|
14
|
-
* @deprecated Combine the [.MuiAccordionSummary-gutters](/material-ui/api/accordion-summary/#AccordionSummary-classes-gutters) and [.MuiAccordionSummary-content](/material-ui/api/accordion-summary/#AccordionSummary-classes-content) classes instead. [
|
|
14
|
+
* @deprecated Combine the [.MuiAccordionSummary-gutters](/material-ui/api/accordion-summary/#AccordionSummary-classes-gutters) and [.MuiAccordionSummary-content](/material-ui/api/accordion-summary/#AccordionSummary-classes-content) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
15
15
|
*/
|
|
16
16
|
contentGutters: string;
|
|
17
17
|
/** Styles applied to the children wrapper element. */
|
package/Alert/Alert.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface AlertProps extends StandardProps<PaperProps, 'variant'>, AlertS
|
|
|
58
58
|
/**
|
|
59
59
|
* The components used for each slot inside.
|
|
60
60
|
*
|
|
61
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
61
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
62
62
|
*
|
|
63
63
|
* @default {}
|
|
64
64
|
*/
|
|
@@ -70,7 +70,7 @@ export interface AlertProps extends StandardProps<PaperProps, 'variant'>, AlertS
|
|
|
70
70
|
* The extra props for the slot components.
|
|
71
71
|
* You can override the existing props or add new ones.
|
|
72
72
|
*
|
|
73
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
73
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
74
74
|
*
|
|
75
75
|
* @default {}
|
|
76
76
|
*/
|
package/Alert/Alert.js
CHANGED
|
@@ -264,7 +264,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
|
|
|
264
264
|
/**
|
|
265
265
|
* The components used for each slot inside.
|
|
266
266
|
*
|
|
267
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
267
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
268
268
|
*
|
|
269
269
|
* @default {}
|
|
270
270
|
*/
|
|
@@ -276,7 +276,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
|
|
|
276
276
|
* The extra props for the slot components.
|
|
277
277
|
* You can override the existing props or add new ones.
|
|
278
278
|
*
|
|
279
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
279
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
280
280
|
*
|
|
281
281
|
* @default {}
|
|
282
282
|
*/
|
package/Alert/alertClasses.d.ts
CHANGED
|
@@ -18,73 +18,73 @@ export interface AlertClasses {
|
|
|
18
18
|
/** Styles applied to the root element if `variant="standard"` and `color="success"`.
|
|
19
19
|
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
20
20
|
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
21
|
-
* [
|
|
21
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
22
22
|
*/
|
|
23
23
|
standardSuccess: string;
|
|
24
24
|
/** Styles applied to the root element if `variant="standard"` and `color="info"`.
|
|
25
25
|
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
26
26
|
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
27
|
-
* [
|
|
27
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
28
28
|
*/
|
|
29
29
|
standardInfo: string;
|
|
30
30
|
/** Styles applied to the root element if `variant="standard"` and `color="warning"`.
|
|
31
31
|
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
32
32
|
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
33
|
-
* [
|
|
33
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
34
34
|
*/
|
|
35
35
|
standardWarning: string;
|
|
36
36
|
/** Styles applied to the root element if `variant="standard"` and `color="error"`.
|
|
37
37
|
* @deprecated Combine the [.MuiAlert-standard](/material-ui/api/alert/#alert-classes-standard)
|
|
38
38
|
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
39
|
-
* [
|
|
39
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
40
40
|
*/
|
|
41
41
|
standardError: string;
|
|
42
42
|
/** Styles applied to the root element if `variant="outlined"` and `color="success"`.
|
|
43
43
|
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
44
44
|
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
45
|
-
* [
|
|
45
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
46
46
|
*/
|
|
47
47
|
outlinedSuccess: string;
|
|
48
48
|
/** Styles applied to the root element if `variant="outlined"` and `color="info"`.
|
|
49
49
|
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
50
50
|
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
51
|
-
* [
|
|
51
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
52
52
|
*/
|
|
53
53
|
outlinedInfo: string;
|
|
54
54
|
/** Styles applied to the root element if `variant="outlined"` and `color="warning"`.
|
|
55
55
|
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
56
56
|
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
57
|
-
* [
|
|
57
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
58
58
|
*/
|
|
59
59
|
outlinedWarning: string;
|
|
60
60
|
/** Styles applied to the root element if `variant="outlined"` and `color="error"`.
|
|
61
61
|
* @deprecated Combine the [.MuiAlert-outlined](/material-ui/api/alert/#alert-classes-outlined)
|
|
62
62
|
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
63
|
-
* [
|
|
63
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
64
64
|
*/
|
|
65
65
|
outlinedError: string;
|
|
66
66
|
/** Styles applied to the root element if `variant="filled"` and `color="success"`.
|
|
67
67
|
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
68
68
|
* and [.MuiAlert-colorSuccess](/material-ui/api/alert/#alert-classes-colorSuccess) classes instead.
|
|
69
|
-
* [
|
|
69
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
70
70
|
*/
|
|
71
71
|
filledSuccess: string;
|
|
72
72
|
/** Styles applied to the root element if `variant="filled"` and `color="info"`.
|
|
73
73
|
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
74
74
|
* and [.MuiAlert-colorInfo](/material-ui/api/alert/#alert-classes-colorInfo) classes instead.
|
|
75
|
-
* [
|
|
75
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
76
76
|
*/
|
|
77
77
|
filledInfo: string;
|
|
78
78
|
/** Styles applied to the root element if `variant="filled"` and `color="warning"`
|
|
79
79
|
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
80
80
|
* and [.MuiAlert-colorWarning](/material-ui/api/alert/#alert-classes-colorWarning) classes instead.
|
|
81
|
-
* [
|
|
81
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
82
82
|
*/
|
|
83
83
|
filledWarning: string;
|
|
84
84
|
/** Styles applied to the root element if `variant="filled"` and `color="error"`.
|
|
85
85
|
* @deprecated Combine the [.MuiAlert-filled](/material-ui/api/alert/#alert-classes-filled)
|
|
86
86
|
* and [.MuiAlert-colorError](/material-ui/api/alert/#alert-classes-colorError) classes instead.
|
|
87
|
-
* [
|
|
87
|
+
* See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
88
88
|
*/
|
|
89
89
|
filledError: string;
|
|
90
90
|
/** Styles applied to the icon wrapper element. */
|
|
@@ -17,6 +17,7 @@ import { ChipProps, ChipTypeMap } from '@mui/material/Chip';
|
|
|
17
17
|
import { PaperProps } from '@mui/material/Paper';
|
|
18
18
|
import { PopperProps } from '@mui/material/Popper';
|
|
19
19
|
import { AutocompleteClasses } from './autocompleteClasses';
|
|
20
|
+
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
|
20
21
|
|
|
21
22
|
export {
|
|
22
23
|
AutocompleteChangeDetails,
|
|
@@ -84,6 +85,75 @@ export interface AutocompleteRenderInputParams {
|
|
|
84
85
|
|
|
85
86
|
export interface AutocompletePropsSizeOverrides {}
|
|
86
87
|
|
|
88
|
+
export interface AutocompleteSlots {
|
|
89
|
+
/**
|
|
90
|
+
* The component used to render the listbox.
|
|
91
|
+
* @default 'ul'
|
|
92
|
+
*/
|
|
93
|
+
listbox?: React.JSXElementConstructor<React.HTMLAttributes<HTMLElement>>;
|
|
94
|
+
/**
|
|
95
|
+
* The component used to render the body of the popup.
|
|
96
|
+
* @default Paper
|
|
97
|
+
*/
|
|
98
|
+
paper?: React.JSXElementConstructor<PaperProps>;
|
|
99
|
+
/**
|
|
100
|
+
* The component used to position the popup.
|
|
101
|
+
* @default Popper
|
|
102
|
+
*/
|
|
103
|
+
popper?: React.JSXElementConstructor<PopperProps>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type AutocompleteSlotsAndSlotProps<
|
|
107
|
+
Value,
|
|
108
|
+
Multiple extends boolean | undefined,
|
|
109
|
+
DisableClearable extends boolean | undefined,
|
|
110
|
+
FreeSolo extends boolean | undefined,
|
|
111
|
+
ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
|
|
112
|
+
> = CreateSlotsAndSlotProps<
|
|
113
|
+
AutocompleteSlots,
|
|
114
|
+
{
|
|
115
|
+
chip: SlotProps<
|
|
116
|
+
React.ElementType<Partial<ChipProps<ChipComponent>>>,
|
|
117
|
+
{},
|
|
118
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
119
|
+
>;
|
|
120
|
+
clearIndicator: SlotProps<
|
|
121
|
+
React.ElementType<Partial<IconButtonProps>>,
|
|
122
|
+
{},
|
|
123
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
124
|
+
>;
|
|
125
|
+
/**
|
|
126
|
+
* Props applied to the Listbox element.
|
|
127
|
+
*/
|
|
128
|
+
listbox: SlotProps<
|
|
129
|
+
React.ElementType<
|
|
130
|
+
ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']> & {
|
|
131
|
+
sx?: SxProps<Theme>;
|
|
132
|
+
ref?: React.Ref<Element>;
|
|
133
|
+
}
|
|
134
|
+
>,
|
|
135
|
+
{},
|
|
136
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
137
|
+
>;
|
|
138
|
+
|
|
139
|
+
paper: SlotProps<
|
|
140
|
+
React.ElementType<Partial<PaperProps>>,
|
|
141
|
+
{},
|
|
142
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
143
|
+
>;
|
|
144
|
+
popper: SlotProps<
|
|
145
|
+
React.ElementType<Partial<PopperProps>>,
|
|
146
|
+
{},
|
|
147
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
148
|
+
>;
|
|
149
|
+
popupIndicator: SlotProps<
|
|
150
|
+
React.ElementType<Partial<IconButtonProps>>,
|
|
151
|
+
{},
|
|
152
|
+
AutocompleteOwnerState<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>
|
|
153
|
+
>;
|
|
154
|
+
}
|
|
155
|
+
>;
|
|
156
|
+
|
|
87
157
|
export interface AutocompleteProps<
|
|
88
158
|
Value,
|
|
89
159
|
Multiple extends boolean | undefined,
|
|
@@ -91,9 +161,11 @@ export interface AutocompleteProps<
|
|
|
91
161
|
FreeSolo extends boolean | undefined,
|
|
92
162
|
ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
|
|
93
163
|
> extends UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo>,
|
|
94
|
-
StandardProps<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'children'
|
|
164
|
+
StandardProps<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'children'>,
|
|
165
|
+
AutocompleteSlotsAndSlotProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent> {
|
|
95
166
|
/**
|
|
96
167
|
* Props applied to the [`Chip`](/material-ui/api/chip/) element.
|
|
168
|
+
* @deprecated Use `slotProps.chip` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
97
169
|
*/
|
|
98
170
|
ChipProps?: ChipProps<ChipComponent>;
|
|
99
171
|
/**
|
|
@@ -121,7 +193,7 @@ export interface AutocompleteProps<
|
|
|
121
193
|
closeText?: string;
|
|
122
194
|
/**
|
|
123
195
|
* The props used for each slot inside.
|
|
124
|
-
* @
|
|
196
|
+
* @deprecated Use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
125
197
|
*/
|
|
126
198
|
componentsProps?: {
|
|
127
199
|
clearIndicator?: Partial<IconButtonProps>;
|
|
@@ -160,10 +232,12 @@ export interface AutocompleteProps<
|
|
|
160
232
|
/**
|
|
161
233
|
* The component used to render the listbox.
|
|
162
234
|
* @default 'ul'
|
|
235
|
+
* @deprecated Use `slots.listbox` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
163
236
|
*/
|
|
164
237
|
ListboxComponent?: React.JSXElementConstructor<React.HTMLAttributes<HTMLElement>>;
|
|
165
238
|
/**
|
|
166
239
|
* Props applied to the Listbox element.
|
|
240
|
+
* @deprecated Use `slotProps.listbox` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
167
241
|
*/
|
|
168
242
|
ListboxProps?: ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']> & {
|
|
169
243
|
sx?: SxProps<Theme>;
|
|
@@ -208,11 +282,13 @@ export interface AutocompleteProps<
|
|
|
208
282
|
/**
|
|
209
283
|
* The component used to render the body of the popup.
|
|
210
284
|
* @default Paper
|
|
285
|
+
* @deprecated Use `slots.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
211
286
|
*/
|
|
212
287
|
PaperComponent?: React.JSXElementConstructor<React.HTMLAttributes<HTMLElement>>;
|
|
213
288
|
/**
|
|
214
289
|
* The component used to position the popup.
|
|
215
290
|
* @default Popper
|
|
291
|
+
* @deprecated Use `slots.popper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
216
292
|
*/
|
|
217
293
|
PopperComponent?: React.JSXElementConstructor<PopperProps>;
|
|
218
294
|
/**
|
|
@@ -272,16 +348,6 @@ export interface AutocompleteProps<
|
|
|
272
348
|
* @default 'medium'
|
|
273
349
|
*/
|
|
274
350
|
size?: OverridableStringUnion<'small' | 'medium', AutocompletePropsSizeOverrides>;
|
|
275
|
-
/**
|
|
276
|
-
* The props used for each slot inside.
|
|
277
|
-
* @default {}
|
|
278
|
-
*/
|
|
279
|
-
slotProps?: {
|
|
280
|
-
clearIndicator?: Partial<IconButtonProps>;
|
|
281
|
-
paper?: PaperProps;
|
|
282
|
-
popper?: Partial<PopperProps>;
|
|
283
|
-
popupIndicator?: Partial<IconButtonProps>;
|
|
284
|
-
};
|
|
285
351
|
/**
|
|
286
352
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
287
353
|
*/
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
6
|
-
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionKey", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "slotProps", "value"],
|
|
7
|
-
_excluded2 = ["ref"]
|
|
6
|
+
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionKey", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "slots", "slotProps", "value"],
|
|
7
|
+
_excluded2 = ["ref"],
|
|
8
|
+
_excluded3 = ["key"];
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import clsx from 'clsx';
|
|
@@ -27,7 +28,7 @@ import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown';
|
|
|
27
28
|
import { styled, createUseThemeProps } from '../zero-styled';
|
|
28
29
|
import autocompleteClasses, { getAutocompleteUtilityClass } from './autocompleteClasses';
|
|
29
30
|
import capitalize from '../utils/capitalize';
|
|
30
|
-
import
|
|
31
|
+
import useSlot from '../utils/useSlot';
|
|
31
32
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
33
|
import { createElement as _createElement } from "react";
|
|
33
34
|
const useThemeProps = createUseThemeProps('MuiAutocomplete');
|
|
@@ -90,21 +91,11 @@ const AutocompleteRoot = styled('div', {
|
|
|
90
91
|
}, styles.root, fullWidth && styles.fullWidth, hasPopupIcon && styles.hasPopupIcon, hasClearIcon && styles.hasClearIcon];
|
|
91
92
|
}
|
|
92
93
|
})({
|
|
93
|
-
[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]: {
|
|
94
|
-
visibility: 'visible'
|
|
95
|
-
},
|
|
96
|
-
/* Avoid double tap issue on iOS */
|
|
97
|
-
'@media (pointer: fine)': {
|
|
98
|
-
[`&:hover .${autocompleteClasses.clearIndicator}`]: {
|
|
99
|
-
visibility: 'visible'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
94
|
[`& .${autocompleteClasses.tag}`]: {
|
|
103
95
|
margin: 3,
|
|
104
96
|
maxWidth: 'calc(100% - 6px)'
|
|
105
97
|
},
|
|
106
98
|
[`& .${autocompleteClasses.inputRoot}`]: {
|
|
107
|
-
flexWrap: 'wrap',
|
|
108
99
|
[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]: {
|
|
109
100
|
paddingRight: 26 + 4
|
|
110
101
|
},
|
|
@@ -116,6 +107,23 @@ const AutocompleteRoot = styled('div', {
|
|
|
116
107
|
minWidth: 30
|
|
117
108
|
}
|
|
118
109
|
},
|
|
110
|
+
[`&.${autocompleteClasses.focused}`]: {
|
|
111
|
+
[`& .${autocompleteClasses.clearIndicator}`]: {
|
|
112
|
+
visibility: 'visible'
|
|
113
|
+
},
|
|
114
|
+
[`& .${autocompleteClasses.input}`]: {
|
|
115
|
+
minWidth: 0
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
/* Avoid double tap issue on iOS */
|
|
119
|
+
'@media (pointer: fine)': {
|
|
120
|
+
[`&:hover .${autocompleteClasses.clearIndicator}`]: {
|
|
121
|
+
visibility: 'visible'
|
|
122
|
+
},
|
|
123
|
+
[`&:hover .${autocompleteClasses.input}`]: {
|
|
124
|
+
minWidth: 0
|
|
125
|
+
}
|
|
126
|
+
},
|
|
119
127
|
[`& .${inputClasses.root}`]: {
|
|
120
128
|
paddingBottom: 1,
|
|
121
129
|
'& .MuiInput-input': {
|
|
@@ -222,6 +230,15 @@ const AutocompleteRoot = styled('div', {
|
|
|
222
230
|
opacity: 1
|
|
223
231
|
}
|
|
224
232
|
}
|
|
233
|
+
}, {
|
|
234
|
+
props: {
|
|
235
|
+
multiple: true
|
|
236
|
+
},
|
|
237
|
+
style: {
|
|
238
|
+
[`& .${autocompleteClasses.inputRoot}`]: {
|
|
239
|
+
flexWrap: 'wrap'
|
|
240
|
+
}
|
|
241
|
+
}
|
|
225
242
|
}]
|
|
226
243
|
});
|
|
227
244
|
const AutocompleteEndAdornment = styled('div', {
|
|
@@ -407,7 +424,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
407
424
|
autoHighlight = false,
|
|
408
425
|
autoSelect = false,
|
|
409
426
|
blurOnSelect = false,
|
|
410
|
-
ChipProps,
|
|
427
|
+
ChipProps: ChipPropsProp,
|
|
411
428
|
className,
|
|
412
429
|
clearIcon = _ClearIcon || (_ClearIcon = /*#__PURE__*/_jsx(ClearIcon, {
|
|
413
430
|
fontSize: "small"
|
|
@@ -416,7 +433,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
416
433
|
clearOnEscape = false,
|
|
417
434
|
clearText = 'Clear',
|
|
418
435
|
closeText = 'Close',
|
|
419
|
-
componentsProps
|
|
436
|
+
componentsProps,
|
|
420
437
|
defaultValue = props.multiple ? [] : null,
|
|
421
438
|
disableClearable = false,
|
|
422
439
|
disableCloseOnSelect = false,
|
|
@@ -434,16 +451,16 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
434
451
|
handleHomeEndKeys = !props.freeSolo,
|
|
435
452
|
includeInputInList = false,
|
|
436
453
|
limitTags = -1,
|
|
437
|
-
ListboxComponent
|
|
438
|
-
ListboxProps,
|
|
454
|
+
ListboxComponent: ListboxComponentProp,
|
|
455
|
+
ListboxProps: ListboxPropsProp,
|
|
439
456
|
loading = false,
|
|
440
457
|
loadingText = 'Loading…',
|
|
441
458
|
multiple = false,
|
|
442
459
|
noOptionsText = 'No options',
|
|
443
460
|
openOnFocus = false,
|
|
444
461
|
openText = 'Open',
|
|
445
|
-
PaperComponent
|
|
446
|
-
PopperComponent
|
|
462
|
+
PaperComponent: PaperComponentProp,
|
|
463
|
+
PopperComponent: PopperComponentProp,
|
|
447
464
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})),
|
|
448
465
|
readOnly = false,
|
|
449
466
|
renderGroup: renderGroupProp,
|
|
@@ -452,6 +469,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
452
469
|
renderTags,
|
|
453
470
|
selectOnFocus = !props.freeSolo,
|
|
454
471
|
size = 'medium',
|
|
472
|
+
slots = {},
|
|
455
473
|
slotProps = {}
|
|
456
474
|
} = props,
|
|
457
475
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -485,15 +503,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
485
503
|
const {
|
|
486
504
|
onMouseDown: handleInputMouseDown
|
|
487
505
|
} = getInputProps();
|
|
488
|
-
const {
|
|
489
|
-
ref: externalListboxRef
|
|
490
|
-
} = ListboxProps ?? {};
|
|
491
506
|
const _getListboxProps = getListboxProps(),
|
|
492
507
|
{
|
|
493
508
|
ref: listboxRef
|
|
494
509
|
} = _getListboxProps,
|
|
495
510
|
otherListboxProps = _objectWithoutPropertiesLoose(_getListboxProps, _excluded2);
|
|
496
|
-
const combinedListboxRef = useForkRef(listboxRef, externalListboxRef);
|
|
497
511
|
const defaultGetOptionLabel = option => option.label ?? option;
|
|
498
512
|
const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
|
|
499
513
|
|
|
@@ -511,6 +525,46 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
511
525
|
size
|
|
512
526
|
});
|
|
513
527
|
const classes = useUtilityClasses(ownerState);
|
|
528
|
+
const externalForwardedProps = {
|
|
529
|
+
slots: _extends({
|
|
530
|
+
listbox: ListboxComponentProp,
|
|
531
|
+
paper: PaperComponentProp,
|
|
532
|
+
popper: PopperComponentProp
|
|
533
|
+
}, slots),
|
|
534
|
+
slotProps: _extends({
|
|
535
|
+
chip: ChipPropsProp,
|
|
536
|
+
listbox: ListboxPropsProp
|
|
537
|
+
}, componentsProps, slotProps)
|
|
538
|
+
};
|
|
539
|
+
const [ListboxSlot, listboxProps] = useSlot('listbox', {
|
|
540
|
+
elementType: 'ul',
|
|
541
|
+
externalForwardedProps,
|
|
542
|
+
ownerState,
|
|
543
|
+
className: classes.listbox,
|
|
544
|
+
additionalProps: otherListboxProps,
|
|
545
|
+
ref: listboxRef
|
|
546
|
+
});
|
|
547
|
+
const [PaperSlot, paperProps] = useSlot('paper', {
|
|
548
|
+
elementType: Paper,
|
|
549
|
+
externalForwardedProps,
|
|
550
|
+
ownerState,
|
|
551
|
+
className: classes.paper
|
|
552
|
+
});
|
|
553
|
+
const [PopperSlot, popperProps] = useSlot('popper', {
|
|
554
|
+
elementType: Popper,
|
|
555
|
+
externalForwardedProps,
|
|
556
|
+
ownerState,
|
|
557
|
+
className: classes.popper,
|
|
558
|
+
additionalProps: {
|
|
559
|
+
disablePortal,
|
|
560
|
+
style: {
|
|
561
|
+
width: anchorEl ? anchorEl.clientWidth : null
|
|
562
|
+
},
|
|
563
|
+
role: 'presentation',
|
|
564
|
+
anchorEl,
|
|
565
|
+
open: popupOpen
|
|
566
|
+
}
|
|
567
|
+
});
|
|
514
568
|
let startAdornment;
|
|
515
569
|
if (multiple && value.length > 0) {
|
|
516
570
|
const getCustomizedTagProps = params => _extends({
|
|
@@ -520,12 +574,19 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
520
574
|
if (renderTags) {
|
|
521
575
|
startAdornment = renderTags(value, getCustomizedTagProps, ownerState);
|
|
522
576
|
} else {
|
|
523
|
-
startAdornment = value.map((option, index) =>
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
577
|
+
startAdornment = value.map((option, index) => {
|
|
578
|
+
const _getCustomizedTagProp = getCustomizedTagProps({
|
|
579
|
+
index
|
|
580
|
+
}),
|
|
581
|
+
{
|
|
582
|
+
key
|
|
583
|
+
} = _getCustomizedTagProp,
|
|
584
|
+
customTagProps = _objectWithoutPropertiesLoose(_getCustomizedTagProp, _excluded3);
|
|
585
|
+
return /*#__PURE__*/_jsx(Chip, _extends({
|
|
586
|
+
label: getOptionLabel(option),
|
|
587
|
+
size: size
|
|
588
|
+
}, customTagProps, externalForwardedProps.slotProps.chip), key);
|
|
589
|
+
});
|
|
529
590
|
}
|
|
530
591
|
}
|
|
531
592
|
if (limitTags > -1 && Array.isArray(startAdornment)) {
|
|
@@ -571,38 +632,22 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
571
632
|
inputValue
|
|
572
633
|
}, ownerState);
|
|
573
634
|
};
|
|
574
|
-
const clearIndicatorSlotProps = slotProps.clearIndicator
|
|
575
|
-
const
|
|
576
|
-
const popperSlotProps = slotProps.popper ?? componentsProps.popper;
|
|
577
|
-
const popupIndicatorSlotProps = slotProps.popupIndicator ?? componentsProps.popupIndicator;
|
|
635
|
+
const clearIndicatorSlotProps = externalForwardedProps.slotProps.clearIndicator;
|
|
636
|
+
const popupIndicatorSlotProps = externalForwardedProps.slotProps.popupIndicator;
|
|
578
637
|
const renderAutocompletePopperChildren = children => /*#__PURE__*/_jsx(AutocompletePopper, _extends({
|
|
579
|
-
as:
|
|
580
|
-
|
|
581
|
-
style: {
|
|
582
|
-
width: anchorEl ? anchorEl.clientWidth : null
|
|
583
|
-
},
|
|
584
|
-
ownerState: ownerState,
|
|
585
|
-
role: "presentation",
|
|
586
|
-
anchorEl: anchorEl,
|
|
587
|
-
open: popupOpen
|
|
588
|
-
}, popperSlotProps, {
|
|
589
|
-
className: clsx(classes.popper, popperSlotProps?.className),
|
|
638
|
+
as: PopperSlot
|
|
639
|
+
}, popperProps, {
|
|
590
640
|
children: /*#__PURE__*/_jsx(AutocompletePaper, _extends({
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}, paperSlotProps, {
|
|
594
|
-
className: clsx(classes.paper, paperSlotProps?.className),
|
|
641
|
+
as: PaperSlot
|
|
642
|
+
}, paperProps, {
|
|
595
643
|
children: children
|
|
596
644
|
}))
|
|
597
645
|
}));
|
|
598
646
|
let autocompletePopper = null;
|
|
599
647
|
if (groupedOptions.length > 0) {
|
|
600
648
|
autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
|
|
601
|
-
as:
|
|
602
|
-
|
|
603
|
-
ownerState: ownerState
|
|
604
|
-
}, otherListboxProps, ListboxProps, {
|
|
605
|
-
ref: combinedListboxRef,
|
|
649
|
+
as: ListboxSlot
|
|
650
|
+
}, listboxProps, {
|
|
606
651
|
children: groupedOptions.map((option, index) => {
|
|
607
652
|
if (groupBy) {
|
|
608
653
|
return renderGroup({
|
|
@@ -723,6 +768,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
723
768
|
blurOnSelect: PropTypes.oneOfType([PropTypes.oneOf(['mouse', 'touch']), PropTypes.bool]),
|
|
724
769
|
/**
|
|
725
770
|
* Props applied to the [`Chip`](/material-ui/api/chip/) element.
|
|
771
|
+
* @deprecated Use `slotProps.chip` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
726
772
|
*/
|
|
727
773
|
ChipProps: PropTypes.object,
|
|
728
774
|
/**
|
|
@@ -767,7 +813,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
767
813
|
closeText: PropTypes.string,
|
|
768
814
|
/**
|
|
769
815
|
* The props used for each slot inside.
|
|
770
|
-
* @
|
|
816
|
+
* @deprecated Use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
771
817
|
*/
|
|
772
818
|
componentsProps: PropTypes.shape({
|
|
773
819
|
clearIndicator: PropTypes.object,
|
|
@@ -925,10 +971,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
925
971
|
/**
|
|
926
972
|
* The component used to render the listbox.
|
|
927
973
|
* @default 'ul'
|
|
974
|
+
* @deprecated Use `slots.listbox` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
928
975
|
*/
|
|
929
976
|
ListboxComponent: PropTypes.elementType,
|
|
930
977
|
/**
|
|
931
978
|
* Props applied to the Listbox element.
|
|
979
|
+
* @deprecated Use `slotProps.listbox` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
932
980
|
*/
|
|
933
981
|
ListboxProps: PropTypes.object,
|
|
934
982
|
/**
|
|
@@ -1023,11 +1071,13 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1023
1071
|
/**
|
|
1024
1072
|
* The component used to render the body of the popup.
|
|
1025
1073
|
* @default Paper
|
|
1074
|
+
* @deprecated Use `slots.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1026
1075
|
*/
|
|
1027
1076
|
PaperComponent: PropTypes.elementType,
|
|
1028
1077
|
/**
|
|
1029
1078
|
* The component used to position the popup.
|
|
1030
1079
|
* @default Popper
|
|
1080
|
+
* @deprecated Use `slots.popper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1031
1081
|
*/
|
|
1032
1082
|
PopperComponent: PropTypes.elementType,
|
|
1033
1083
|
/**
|
|
@@ -1088,11 +1138,22 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1088
1138
|
* The props used for each slot inside.
|
|
1089
1139
|
* @default {}
|
|
1090
1140
|
*/
|
|
1091
|
-
slotProps: PropTypes
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1141
|
+
slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
|
|
1142
|
+
chip: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1143
|
+
clearIndicator: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1144
|
+
listbox: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1145
|
+
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1146
|
+
popper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1147
|
+
popupIndicator: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
1148
|
+
}),
|
|
1149
|
+
/**
|
|
1150
|
+
* The components used for each slot inside.
|
|
1151
|
+
* @default {}
|
|
1152
|
+
*/
|
|
1153
|
+
slots: PropTypes.shape({
|
|
1154
|
+
listbox: PropTypes.elementType,
|
|
1155
|
+
paper: PropTypes.elementType,
|
|
1156
|
+
popper: PropTypes.elementType
|
|
1096
1157
|
}),
|
|
1097
1158
|
/**
|
|
1098
1159
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|