@mui/material 5.10.12 → 5.10.13
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/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/Alert.d.ts +34 -3
- package/Alert/Alert.js +46 -9
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/Autocomplete.d.ts +10 -0
- package/Autocomplete/Autocomplete.js +27 -11
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/AvatarGroup.d.ts +18 -1
- package/AvatarGroup/AvatarGroup.js +25 -6
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/Backdrop.d.ts +33 -3
- package/Backdrop/Backdrop.js +46 -11
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.d.ts +11 -3
- package/Badge/Badge.js +11 -3
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +58 -0
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/chipClasses.d.ts +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/FilledInput.js +48 -9
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControlLabel/FormControlLabel.d.ts +12 -0
- package/FormControlLabel/FormControlLabel.js +17 -5
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +26 -26
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/Input.js +49 -10
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.d.ts +34 -3
- package/InputBase/InputBase.js +45 -8
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/ListItem.d.ts +32 -3
- package/ListItem/ListItem.js +41 -9
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +11 -3
- package/Modal/Modal.js +11 -3
- package/NativeSelect/NativeSelectInput.js +11 -9
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/OutlinedInput.js +26 -8
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/OverridableComponentAugmentation.d.ts +31 -31
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/PaginationItem.d.ts +19 -7
- package/PaginationItem/PaginationItem.js +31 -22
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +37 -37
- package/README.md +1 -0
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/Select.d.ts +3 -3
- package/Select/Select.js +3 -3
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/Slider.d.ts +14 -2
- package/Slider/Slider.js +12 -3
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/StepLabel.d.ts +11 -0
- package/StepLabel/StepLabel.js +15 -3
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/Tooltip.d.ts +43 -6
- package/Tooltip/Tooltip.js +68 -31
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/esm/Alert/Alert.js +46 -9
- package/esm/Autocomplete/Autocomplete.js +27 -11
- package/esm/AvatarGroup/AvatarGroup.js +25 -6
- package/esm/Backdrop/Backdrop.js +46 -11
- package/esm/Badge/Badge.js +11 -3
- package/esm/BottomNavigation/BottomNavigation.js +0 -0
- package/esm/FilledInput/FilledInput.js +48 -9
- package/esm/FormControlLabel/FormControlLabel.js +17 -5
- package/esm/Input/Input.js +49 -10
- package/esm/InputBase/InputBase.js +45 -8
- package/esm/ListItem/ListItem.js +41 -9
- package/esm/Modal/Modal.js +11 -3
- package/esm/NativeSelect/NativeSelectInput.js +11 -9
- package/esm/OutlinedInput/OutlinedInput.js +26 -8
- package/esm/PaginationItem/PaginationItem.js +31 -22
- package/esm/Select/Select.js +3 -3
- package/esm/Slider/Slider.js +12 -3
- package/esm/StepLabel/StepLabel.js +15 -3
- package/esm/Tooltip/Tooltip.js +68 -31
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Alert/Alert.js +48 -9
- package/legacy/Autocomplete/Autocomplete.js +27 -10
- package/legacy/AvatarGroup/AvatarGroup.js +26 -6
- package/legacy/Backdrop/Backdrop.js +48 -11
- package/legacy/Badge/Badge.js +11 -3
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/FilledInput/FilledInput.js +49 -9
- package/legacy/FormControlLabel/FormControlLabel.js +17 -4
- package/legacy/Input/Input.js +50 -10
- package/legacy/InputBase/InputBase.js +47 -8
- package/legacy/ListItem/ListItem.js +42 -8
- package/legacy/Modal/Modal.js +11 -3
- package/legacy/NativeSelect/NativeSelectInput.js +11 -9
- package/legacy/OutlinedInput/OutlinedInput.js +27 -8
- package/legacy/PaginationItem/PaginationItem.js +32 -22
- package/legacy/Select/Select.js +3 -3
- package/legacy/Slider/Slider.js +12 -3
- package/legacy/StepLabel/StepLabel.js +16 -3
- package/legacy/Tooltip/Tooltip.js +63 -22
- package/legacy/index.js +1 -1
- package/locale/index.d.ts +72 -72
- package/modern/Alert/Alert.js +45 -8
- package/modern/Autocomplete/Autocomplete.js +26 -10
- package/modern/AvatarGroup/AvatarGroup.js +24 -5
- package/modern/Backdrop/Backdrop.js +45 -10
- package/modern/Badge/Badge.js +11 -3
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/FilledInput/FilledInput.js +46 -9
- package/modern/FormControlLabel/FormControlLabel.js +15 -5
- package/modern/Input/Input.js +47 -10
- package/modern/InputBase/InputBase.js +43 -8
- package/modern/ListItem/ListItem.js +41 -9
- package/modern/Modal/Modal.js +11 -3
- package/modern/NativeSelect/NativeSelectInput.js +11 -9
- package/modern/OutlinedInput/OutlinedInput.js +25 -7
- package/modern/PaginationItem/PaginationItem.js +31 -22
- package/modern/Select/Select.js +3 -3
- package/modern/Slider/Slider.js +12 -3
- package/modern/StepLabel/StepLabel.js +13 -3
- package/modern/Tooltip/Tooltip.js +58 -17
- package/modern/index.js +1 -1
- package/package.json +4 -4
- package/styles/CssVarsProvider.d.ts +14 -14
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/umd/material-ui.development.js +534 -165
- package/umd/material-ui.production.min.js +14 -14
- package/useMediaQuery/useMediaQuery.d.ts +31 -31
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
|
|
4
4
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
5
5
|
|
|
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", "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", "value"];
|
|
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", "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
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -408,7 +408,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
408
408
|
renderOption: renderOptionProp,
|
|
409
409
|
renderTags,
|
|
410
410
|
selectOnFocus = !props.freeSolo,
|
|
411
|
-
size = 'medium'
|
|
411
|
+
size = 'medium',
|
|
412
|
+
slotProps = {}
|
|
412
413
|
} = props,
|
|
413
414
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
414
415
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -517,6 +518,10 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
517
518
|
});
|
|
518
519
|
};
|
|
519
520
|
|
|
521
|
+
const clearIndicatorSlotProps = slotProps.clearIndicator ?? componentsProps.clearIndicator;
|
|
522
|
+
const paperSlotProps = slotProps.paper ?? componentsProps.paper;
|
|
523
|
+
const popperSlotProps = slotProps.popper ?? componentsProps.popper;
|
|
524
|
+
const popupIndicatorSlotProps = slotProps.popupIndicator ?? componentsProps.popupIndicator;
|
|
520
525
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
521
526
|
children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
|
|
522
527
|
ref: ref,
|
|
@@ -541,16 +546,16 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
541
546
|
"aria-label": clearText,
|
|
542
547
|
title: clearText,
|
|
543
548
|
ownerState: ownerState
|
|
544
|
-
},
|
|
545
|
-
className: clsx(classes.clearIndicator,
|
|
549
|
+
}, clearIndicatorSlotProps, {
|
|
550
|
+
className: clsx(classes.clearIndicator, clearIndicatorSlotProps?.className),
|
|
546
551
|
children: clearIcon
|
|
547
552
|
})) : null, hasPopupIcon ? /*#__PURE__*/_jsx(AutocompletePopupIndicator, _extends({}, getPopupIndicatorProps(), {
|
|
548
553
|
disabled: disabled,
|
|
549
554
|
"aria-label": popupOpen ? closeText : openText,
|
|
550
555
|
title: popupOpen ? closeText : openText,
|
|
551
556
|
ownerState: ownerState
|
|
552
|
-
},
|
|
553
|
-
className: clsx(classes.popupIndicator,
|
|
557
|
+
}, popupIndicatorSlotProps, {
|
|
558
|
+
className: clsx(classes.popupIndicator, popupIndicatorSlotProps?.className),
|
|
554
559
|
children: popupIcon
|
|
555
560
|
})) : null]
|
|
556
561
|
})
|
|
@@ -571,13 +576,13 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
571
576
|
role: "presentation",
|
|
572
577
|
anchorEl: anchorEl,
|
|
573
578
|
open: popupOpen
|
|
574
|
-
},
|
|
575
|
-
className: clsx(classes.popper,
|
|
579
|
+
}, popperSlotProps, {
|
|
580
|
+
className: clsx(classes.popper, popperSlotProps?.className),
|
|
576
581
|
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
577
582
|
ownerState: ownerState,
|
|
578
583
|
as: PaperComponent
|
|
579
|
-
},
|
|
580
|
-
className: clsx(classes.paper,
|
|
584
|
+
}, paperSlotProps, {
|
|
585
|
+
className: clsx(classes.paper, paperSlotProps?.className),
|
|
581
586
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
582
587
|
className: classes.loading,
|
|
583
588
|
ownerState: ownerState,
|
|
@@ -1061,6 +1066,17 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1061
1066
|
/* @typescript-to-proptypes-ignore */
|
|
1062
1067
|
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
1063
1068
|
|
|
1069
|
+
/**
|
|
1070
|
+
* The props used for each slot inside.
|
|
1071
|
+
* @default {}
|
|
1072
|
+
*/
|
|
1073
|
+
slotProps: PropTypes.shape({
|
|
1074
|
+
clearIndicator: PropTypes.object,
|
|
1075
|
+
paper: PropTypes.object,
|
|
1076
|
+
popper: PropTypes.object,
|
|
1077
|
+
popupIndicator: PropTypes.object
|
|
1078
|
+
}),
|
|
1079
|
+
|
|
1064
1080
|
/**
|
|
1065
1081
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1066
1082
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "className", "component", "componentsProps", "max", "spacing", "total", "variant"];
|
|
3
|
+
const _excluded = ["children", "className", "component", "componentsProps", "max", "slotProps", "spacing", "total", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { isFragment } from 'react-is';
|
|
@@ -74,6 +74,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
74
74
|
component = 'div',
|
|
75
75
|
componentsProps = {},
|
|
76
76
|
max = 5,
|
|
77
|
+
slotProps = {},
|
|
77
78
|
spacing = 'medium',
|
|
78
79
|
total,
|
|
79
80
|
variant = 'circular'
|
|
@@ -109,6 +110,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
109
110
|
const maxAvatars = Math.min(children.length, clampedMax - 1);
|
|
110
111
|
const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
|
|
111
112
|
const marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
|
|
113
|
+
const additionalAvatarSlotProps = slotProps.additionalAvatar ?? componentsProps.additionalAvatar;
|
|
112
114
|
return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
|
|
113
115
|
as: component,
|
|
114
116
|
ownerState: ownerState,
|
|
@@ -118,11 +120,11 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
118
120
|
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
119
121
|
ownerState: ownerState,
|
|
120
122
|
variant: variant
|
|
121
|
-
},
|
|
122
|
-
className: clsx(classes.avatar,
|
|
123
|
+
}, additionalAvatarSlotProps, {
|
|
124
|
+
className: clsx(classes.avatar, additionalAvatarSlotProps?.className),
|
|
123
125
|
style: _extends({
|
|
124
126
|
marginLeft
|
|
125
|
-
},
|
|
127
|
+
}, additionalAvatarSlotProps?.style),
|
|
126
128
|
children: ["+", extraAvatars]
|
|
127
129
|
})) : null, children.slice(0, maxAvatars).reverse().map((child, index) => {
|
|
128
130
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -167,7 +169,12 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
167
169
|
component: PropTypes.elementType,
|
|
168
170
|
|
|
169
171
|
/**
|
|
170
|
-
* The props
|
|
172
|
+
* The extra props for the slot components.
|
|
173
|
+
* You can override the existing props or add new ones.
|
|
174
|
+
*
|
|
175
|
+
* This prop is an alias for the `slotProps` prop.
|
|
176
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
177
|
+
*
|
|
171
178
|
* @default {}
|
|
172
179
|
*/
|
|
173
180
|
componentsProps: PropTypes.shape({
|
|
@@ -186,6 +193,18 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
186
193
|
return null;
|
|
187
194
|
}),
|
|
188
195
|
|
|
196
|
+
/**
|
|
197
|
+
* The extra props for the slot components.
|
|
198
|
+
* You can override the existing props or add new ones.
|
|
199
|
+
*
|
|
200
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
201
|
+
*
|
|
202
|
+
* @default {}
|
|
203
|
+
*/
|
|
204
|
+
slotProps: PropTypes.shape({
|
|
205
|
+
additionalAvatar: PropTypes.object
|
|
206
|
+
}),
|
|
207
|
+
|
|
189
208
|
/**
|
|
190
209
|
* Spacing between avatars.
|
|
191
210
|
* @default 'medium'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "transitionDuration", "TransitionComponent"];
|
|
3
|
+
const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "slotProps", "slots", "transitionDuration", "TransitionComponent"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -61,6 +61,8 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
61
61
|
className,
|
|
62
62
|
invisible = false,
|
|
63
63
|
open,
|
|
64
|
+
slotProps = {},
|
|
65
|
+
slots = {},
|
|
64
66
|
transitionDuration,
|
|
65
67
|
// eslint-disable-next-line react/prop-types
|
|
66
68
|
TransitionComponent = Fade
|
|
@@ -73,19 +75,21 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
73
75
|
});
|
|
74
76
|
|
|
75
77
|
const classes = useUtilityClasses(ownerState);
|
|
78
|
+
const rootSlotProps = slotProps.root ?? componentsProps.root;
|
|
76
79
|
return /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
77
80
|
in: open,
|
|
78
81
|
timeout: transitionDuration
|
|
79
82
|
}, other, {
|
|
80
|
-
children: /*#__PURE__*/_jsx(BackdropRoot, {
|
|
81
|
-
"aria-hidden": true
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
children: /*#__PURE__*/_jsx(BackdropRoot, _extends({
|
|
84
|
+
"aria-hidden": true
|
|
85
|
+
}, rootSlotProps, {
|
|
86
|
+
as: slots.root ?? components.Root ?? component,
|
|
87
|
+
className: clsx(classes.root, className, rootSlotProps?.className),
|
|
88
|
+
ownerState: _extends({}, ownerState, rootSlotProps?.ownerState),
|
|
85
89
|
classes: classes,
|
|
86
90
|
ref: ref,
|
|
87
91
|
children: children
|
|
88
|
-
})
|
|
92
|
+
}))
|
|
89
93
|
}));
|
|
90
94
|
});
|
|
91
95
|
process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
@@ -118,8 +122,11 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
118
122
|
component: PropTypes.elementType,
|
|
119
123
|
|
|
120
124
|
/**
|
|
121
|
-
* The components used for each slot inside
|
|
122
|
-
*
|
|
125
|
+
* The components used for each slot inside.
|
|
126
|
+
*
|
|
127
|
+
* This prop is an alias for the `slots` prop.
|
|
128
|
+
* It's recommended to use the `slots` prop instead.
|
|
129
|
+
*
|
|
123
130
|
* @default {}
|
|
124
131
|
*/
|
|
125
132
|
components: PropTypes.shape({
|
|
@@ -127,7 +134,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
127
134
|
}),
|
|
128
135
|
|
|
129
136
|
/**
|
|
130
|
-
* The props
|
|
137
|
+
* The extra props for the slot components.
|
|
138
|
+
* You can override the existing props or add new ones.
|
|
139
|
+
*
|
|
140
|
+
* This prop is an alias for the `slotProps` prop.
|
|
141
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
142
|
+
*
|
|
131
143
|
* @default {}
|
|
132
144
|
*/
|
|
133
145
|
componentsProps: PropTypes.shape({
|
|
@@ -146,6 +158,29 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
146
158
|
*/
|
|
147
159
|
open: PropTypes.bool.isRequired,
|
|
148
160
|
|
|
161
|
+
/**
|
|
162
|
+
* The extra props for the slot components.
|
|
163
|
+
* You can override the existing props or add new ones.
|
|
164
|
+
*
|
|
165
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
166
|
+
*
|
|
167
|
+
* @default {}
|
|
168
|
+
*/
|
|
169
|
+
slotProps: PropTypes.shape({
|
|
170
|
+
root: PropTypes.object
|
|
171
|
+
}),
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The components used for each slot inside.
|
|
175
|
+
*
|
|
176
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
177
|
+
*
|
|
178
|
+
* @default {}
|
|
179
|
+
*/
|
|
180
|
+
slots: PropTypes.shape({
|
|
181
|
+
root: PropTypes.elementType
|
|
182
|
+
}),
|
|
183
|
+
|
|
149
184
|
/**
|
|
150
185
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
151
186
|
*/
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -314,8 +314,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
314
314
|
component: PropTypes.elementType,
|
|
315
315
|
|
|
316
316
|
/**
|
|
317
|
-
* The components used for each slot inside
|
|
318
|
-
*
|
|
317
|
+
* The components used for each slot inside.
|
|
318
|
+
*
|
|
319
|
+
* This prop is an alias for the `slots` prop.
|
|
320
|
+
* It's recommended to use the `slots` prop instead.
|
|
321
|
+
*
|
|
319
322
|
* @default {}
|
|
320
323
|
*/
|
|
321
324
|
components: PropTypes.shape({
|
|
@@ -324,7 +327,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
324
327
|
}),
|
|
325
328
|
|
|
326
329
|
/**
|
|
327
|
-
* The props
|
|
330
|
+
* The extra props for the slot components.
|
|
331
|
+
* You can override the existing props or add new ones.
|
|
332
|
+
*
|
|
333
|
+
* This prop is an alias for the `slotProps` prop.
|
|
334
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
335
|
+
*
|
|
328
336
|
* @default {}
|
|
329
337
|
*/
|
|
330
338
|
componentsProps: PropTypes.shape({
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "type"];
|
|
3
|
+
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { refType, deepmerge } from '@mui/utils';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -191,6 +191,8 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
191
191
|
// declare here to prevent spreading to DOM
|
|
192
192
|
inputComponent = 'input',
|
|
193
193
|
multiline = false,
|
|
194
|
+
slotProps,
|
|
195
|
+
slots = {},
|
|
194
196
|
type = 'text'
|
|
195
197
|
} = props,
|
|
196
198
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -211,12 +213,14 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
211
213
|
ownerState
|
|
212
214
|
}
|
|
213
215
|
};
|
|
214
|
-
const componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
|
|
216
|
+
const componentsProps = slotProps ?? componentsPropsProp ? deepmerge(slotProps ?? componentsPropsProp, filledInputComponentsProps) : filledInputComponentsProps;
|
|
217
|
+
const RootSlot = slots.root ?? components.Root ?? FilledInputRoot;
|
|
218
|
+
const InputSlot = slots.input ?? components.Input ?? FilledInputInput;
|
|
215
219
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
+
slots: {
|
|
221
|
+
root: RootSlot,
|
|
222
|
+
input: InputSlot
|
|
223
|
+
},
|
|
220
224
|
componentsProps: componentsProps,
|
|
221
225
|
fullWidth: fullWidth,
|
|
222
226
|
inputComponent: inputComponent,
|
|
@@ -263,8 +267,11 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
263
267
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
264
268
|
|
|
265
269
|
/**
|
|
266
|
-
* The components used for each slot inside
|
|
267
|
-
*
|
|
270
|
+
* The components used for each slot inside.
|
|
271
|
+
*
|
|
272
|
+
* This prop is an alias for the `slots` prop.
|
|
273
|
+
* It's recommended to use the `slots` prop instead.
|
|
274
|
+
*
|
|
268
275
|
* @default {}
|
|
269
276
|
*/
|
|
270
277
|
components: PropTypes.shape({
|
|
@@ -273,7 +280,12 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
273
280
|
}),
|
|
274
281
|
|
|
275
282
|
/**
|
|
276
|
-
* The props
|
|
283
|
+
* The extra props for the slot components.
|
|
284
|
+
* You can override the existing props or add new ones.
|
|
285
|
+
*
|
|
286
|
+
* This prop is an alias for the `slotProps` prop.
|
|
287
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
288
|
+
*
|
|
277
289
|
* @default {}
|
|
278
290
|
*/
|
|
279
291
|
componentsProps: PropTypes.shape({
|
|
@@ -403,6 +415,31 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
403
415
|
*/
|
|
404
416
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
405
417
|
|
|
418
|
+
/**
|
|
419
|
+
* The extra props for the slot components.
|
|
420
|
+
* You can override the existing props or add new ones.
|
|
421
|
+
*
|
|
422
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
423
|
+
*
|
|
424
|
+
* @default {}
|
|
425
|
+
*/
|
|
426
|
+
slotProps: PropTypes.shape({
|
|
427
|
+
input: PropTypes.object,
|
|
428
|
+
root: PropTypes.object
|
|
429
|
+
}),
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* The components used for each slot inside.
|
|
433
|
+
*
|
|
434
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
435
|
+
*
|
|
436
|
+
* @default {}
|
|
437
|
+
*/
|
|
438
|
+
slots: PropTypes.shape({
|
|
439
|
+
input: PropTypes.elementType,
|
|
440
|
+
root: PropTypes.elementType
|
|
441
|
+
}),
|
|
442
|
+
|
|
406
443
|
/**
|
|
407
444
|
* Start `InputAdornment` for this component.
|
|
408
445
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"];
|
|
3
|
+
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -93,7 +93,8 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
93
93
|
disabled: disabledProp,
|
|
94
94
|
disableTypography,
|
|
95
95
|
label: labelProp,
|
|
96
|
-
labelPlacement = 'end'
|
|
96
|
+
labelPlacement = 'end',
|
|
97
|
+
slotProps = {}
|
|
97
98
|
} = props,
|
|
98
99
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
99
100
|
|
|
@@ -129,13 +130,14 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
129
130
|
});
|
|
130
131
|
|
|
131
132
|
const classes = useUtilityClasses(ownerState);
|
|
133
|
+
const typographySlotProps = slotProps.typography ?? componentsProps.typography;
|
|
132
134
|
let label = labelProp;
|
|
133
135
|
|
|
134
136
|
if (label != null && label.type !== Typography && !disableTypography) {
|
|
135
137
|
label = /*#__PURE__*/_jsx(Typography, _extends({
|
|
136
|
-
component: "span"
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
component: "span"
|
|
139
|
+
}, typographySlotProps, {
|
|
140
|
+
className: clsx(classes.label, typographySlotProps?.className),
|
|
139
141
|
children: label
|
|
140
142
|
}));
|
|
141
143
|
}
|
|
@@ -223,6 +225,14 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
|
|
|
223
225
|
*/
|
|
224
226
|
onChange: PropTypes.func,
|
|
225
227
|
|
|
228
|
+
/**
|
|
229
|
+
* The props used for each slot inside.
|
|
230
|
+
* @default {}
|
|
231
|
+
*/
|
|
232
|
+
slotProps: PropTypes.shape({
|
|
233
|
+
typography: PropTypes.object
|
|
234
|
+
}),
|
|
235
|
+
|
|
226
236
|
/**
|
|
227
237
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
228
238
|
*/
|
package/modern/Input/Input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "type"];
|
|
3
|
+
const _excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
@@ -123,6 +123,8 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
123
123
|
fullWidth = false,
|
|
124
124
|
inputComponent = 'input',
|
|
125
125
|
multiline = false,
|
|
126
|
+
slotProps,
|
|
127
|
+
slots = {},
|
|
126
128
|
type = 'text'
|
|
127
129
|
} = props,
|
|
128
130
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -136,13 +138,15 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
136
138
|
ownerState
|
|
137
139
|
}
|
|
138
140
|
};
|
|
139
|
-
const componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, inputComponentsProps) : inputComponentsProps;
|
|
141
|
+
const componentsProps = slotProps ?? componentsPropsProp ? deepmerge(slotProps ?? componentsPropsProp, inputComponentsProps) : inputComponentsProps;
|
|
142
|
+
const RootSlot = slots.root ?? components.Root ?? InputRoot;
|
|
143
|
+
const InputSlot = slots.input ?? components.Input ?? InputInput;
|
|
140
144
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
|
|
145
|
+
slots: {
|
|
146
|
+
root: RootSlot,
|
|
147
|
+
input: InputSlot
|
|
148
|
+
},
|
|
149
|
+
slotProps: componentsProps,
|
|
146
150
|
fullWidth: fullWidth,
|
|
147
151
|
inputComponent: inputComponent,
|
|
148
152
|
multiline: multiline,
|
|
@@ -188,8 +192,11 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
188
192
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
189
193
|
|
|
190
194
|
/**
|
|
191
|
-
* The components used for each slot inside
|
|
192
|
-
*
|
|
195
|
+
* The components used for each slot inside.
|
|
196
|
+
*
|
|
197
|
+
* This prop is an alias for the `slots` prop.
|
|
198
|
+
* It's recommended to use the `slots` prop instead.
|
|
199
|
+
*
|
|
193
200
|
* @default {}
|
|
194
201
|
*/
|
|
195
202
|
components: PropTypes.shape({
|
|
@@ -198,7 +205,12 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
198
205
|
}),
|
|
199
206
|
|
|
200
207
|
/**
|
|
201
|
-
* The props
|
|
208
|
+
* The extra props for the slot components.
|
|
209
|
+
* You can override the existing props or add new ones.
|
|
210
|
+
*
|
|
211
|
+
* This prop is an alias for the `slotProps` prop.
|
|
212
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
213
|
+
*
|
|
202
214
|
* @default {}
|
|
203
215
|
*/
|
|
204
216
|
componentsProps: PropTypes.shape({
|
|
@@ -320,6 +332,31 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
320
332
|
*/
|
|
321
333
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
322
334
|
|
|
335
|
+
/**
|
|
336
|
+
* The extra props for the slot components.
|
|
337
|
+
* You can override the existing props or add new ones.
|
|
338
|
+
*
|
|
339
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
340
|
+
*
|
|
341
|
+
* @default {}
|
|
342
|
+
*/
|
|
343
|
+
slotProps: PropTypes.shape({
|
|
344
|
+
input: PropTypes.object,
|
|
345
|
+
root: PropTypes.object
|
|
346
|
+
}),
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* The components used for each slot inside.
|
|
350
|
+
*
|
|
351
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
352
|
+
*
|
|
353
|
+
* @default {}
|
|
354
|
+
*/
|
|
355
|
+
slots: PropTypes.shape({
|
|
356
|
+
input: PropTypes.elementType,
|
|
357
|
+
root: PropTypes.elementType
|
|
358
|
+
}),
|
|
359
|
+
|
|
323
360
|
/**
|
|
324
361
|
* Start `InputAdornment` for this component.
|
|
325
362
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
|
-
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
|
|
4
|
+
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -250,6 +250,8 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
250
250
|
readOnly,
|
|
251
251
|
renderSuffix,
|
|
252
252
|
rows,
|
|
253
|
+
slotProps = {},
|
|
254
|
+
slots = {},
|
|
253
255
|
startAdornment,
|
|
254
256
|
type = 'text',
|
|
255
257
|
value: valueProp
|
|
@@ -453,10 +455,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
453
455
|
});
|
|
454
456
|
|
|
455
457
|
const classes = useUtilityClasses(ownerState);
|
|
456
|
-
const Root = components.Root || InputBaseRoot;
|
|
457
|
-
const rootProps = componentsProps.root || {};
|
|
458
|
-
const Input = components.Input || InputBaseComponent;
|
|
459
|
-
inputProps = _extends({}, inputProps, componentsProps.input);
|
|
458
|
+
const Root = slots.root || components.Root || InputBaseRoot;
|
|
459
|
+
const rootProps = slotProps.root || componentsProps.root || {};
|
|
460
|
+
const Input = slots.input || components.Input || InputBaseComponent;
|
|
461
|
+
inputProps = _extends({}, inputProps, slotProps.input ?? componentsProps.input);
|
|
460
462
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
461
463
|
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
462
464
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
@@ -548,8 +550,11 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
548
550
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
549
551
|
|
|
550
552
|
/**
|
|
551
|
-
* The components used for each slot inside
|
|
552
|
-
*
|
|
553
|
+
* The components used for each slot inside.
|
|
554
|
+
*
|
|
555
|
+
* This prop is an alias for the `slots` prop.
|
|
556
|
+
* It's recommended to use the `slots` prop instead.
|
|
557
|
+
*
|
|
553
558
|
* @default {}
|
|
554
559
|
*/
|
|
555
560
|
components: PropTypes.shape({
|
|
@@ -558,7 +563,12 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
558
563
|
}),
|
|
559
564
|
|
|
560
565
|
/**
|
|
561
|
-
* The props
|
|
566
|
+
* The extra props for the slot components.
|
|
567
|
+
* You can override the existing props or add new ones.
|
|
568
|
+
*
|
|
569
|
+
* This prop is an alias for the `slotProps` prop.
|
|
570
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
571
|
+
*
|
|
562
572
|
* @default {}
|
|
563
573
|
*/
|
|
564
574
|
componentsProps: PropTypes.shape({
|
|
@@ -726,6 +736,31 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
726
736
|
/* @typescript-to-proptypes-ignore */
|
|
727
737
|
.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
|
728
738
|
|
|
739
|
+
/**
|
|
740
|
+
* The extra props for the slot components.
|
|
741
|
+
* You can override the existing props or add new ones.
|
|
742
|
+
*
|
|
743
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
744
|
+
*
|
|
745
|
+
* @default {}
|
|
746
|
+
*/
|
|
747
|
+
slotProps: PropTypes.shape({
|
|
748
|
+
input: PropTypes.object,
|
|
749
|
+
root: PropTypes.object
|
|
750
|
+
}),
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* The components used for each slot inside.
|
|
754
|
+
*
|
|
755
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
756
|
+
*
|
|
757
|
+
* @default {}
|
|
758
|
+
*/
|
|
759
|
+
slots: PropTypes.shape({
|
|
760
|
+
input: PropTypes.elementType,
|
|
761
|
+
root: PropTypes.elementType
|
|
762
|
+
}),
|
|
763
|
+
|
|
729
764
|
/**
|
|
730
765
|
* Start `InputAdornment` for this component.
|
|
731
766
|
*/
|