@mui/material 5.10.11 → 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/Alert/Alert.d.ts +34 -3
- package/Alert/Alert.js +46 -9
- package/Autocomplete/Autocomplete.d.ts +10 -0
- package/Autocomplete/Autocomplete.js +27 -11
- package/AvatarGroup/AvatarGroup.d.ts +18 -1
- package/AvatarGroup/AvatarGroup.js +25 -6
- package/Backdrop/Backdrop.d.ts +33 -3
- package/Backdrop/Backdrop.js +46 -11
- package/Badge/Badge.d.ts +11 -3
- package/Badge/Badge.js +11 -3
- package/ButtonBase/TouchRipple.js +1 -1
- package/CHANGELOG.md +134 -0
- package/Chip/Chip.js +8 -4
- package/FilledInput/FilledInput.js +48 -9
- package/FormControl/FormControl.js +29 -29
- package/FormControlLabel/FormControlLabel.d.ts +12 -0
- package/FormControlLabel/FormControlLabel.js +17 -5
- package/Input/Input.js +49 -10
- package/InputBase/InputBase.d.ts +34 -3
- package/InputBase/InputBase.js +45 -8
- package/ListItem/ListItem.d.ts +32 -3
- package/ListItem/ListItem.js +43 -11
- package/ListItemButton/ListItemButton.js +2 -2
- package/MenuItem/MenuItem.js +2 -2
- package/Modal/Modal.d.ts +11 -3
- package/Modal/Modal.js +11 -3
- package/NativeSelect/NativeSelectInput.js +11 -9
- package/OutlinedInput/OutlinedInput.js +26 -8
- package/PaginationItem/PaginationItem.d.ts +19 -7
- package/PaginationItem/PaginationItem.js +31 -22
- package/README.md +1 -0
- package/Radio/Radio.js +2 -1
- package/RadioGroup/RadioGroup.js +12 -12
- package/Select/Select.d.ts +3 -3
- package/Select/Select.js +3 -3
- package/Slider/Slider.d.ts +14 -2
- package/Slider/Slider.js +12 -3
- package/StepLabel/StepLabel.d.ts +11 -0
- package/StepLabel/StepLabel.js +15 -3
- package/SwipeableDrawer/SwipeableDrawer.js +10 -2
- package/Tooltip/Tooltip.d.ts +43 -6
- package/Tooltip/Tooltip.js +69 -32
- package/Unstable_Grid2/Grid2Props.d.ts +1 -1
- 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/ButtonBase/TouchRipple.js +1 -1
- package/esm/Chip/Chip.js +8 -4
- package/esm/FilledInput/FilledInput.js +48 -9
- package/esm/FormControl/FormControl.js +29 -29
- 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 +43 -11
- package/esm/ListItemButton/ListItemButton.js +2 -2
- package/esm/MenuItem/MenuItem.js +2 -2
- 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/Radio/Radio.js +2 -1
- package/esm/RadioGroup/RadioGroup.js +12 -12
- package/esm/Select/Select.js +3 -3
- package/esm/Slider/Slider.js +12 -3
- package/esm/StepLabel/StepLabel.js +15 -3
- package/esm/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/esm/Tooltip/Tooltip.js +69 -32
- package/index.js +1 -1
- 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/ButtonBase/TouchRipple.js +1 -1
- package/legacy/Chip/Chip.js +8 -4
- package/legacy/FilledInput/FilledInput.js +49 -9
- package/legacy/FormControl/FormControl.js +29 -29
- 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 +49 -13
- package/legacy/ListItemButton/ListItemButton.js +7 -5
- package/legacy/MenuItem/MenuItem.js +6 -4
- 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/Radio/Radio.js +2 -1
- package/legacy/RadioGroup/RadioGroup.js +14 -14
- package/legacy/Select/Select.js +3 -3
- package/legacy/Slider/Slider.js +12 -3
- package/legacy/StepLabel/StepLabel.js +16 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/legacy/Tooltip/Tooltip.js +64 -23
- package/legacy/index.js +1 -1
- 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/ButtonBase/TouchRipple.js +1 -1
- package/modern/Chip/Chip.js +8 -4
- package/modern/FilledInput/FilledInput.js +46 -9
- package/modern/FormControl/FormControl.js +29 -29
- 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 +43 -11
- package/modern/ListItemButton/ListItemButton.js +2 -2
- package/modern/MenuItem/MenuItem.js +2 -2
- 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/Radio/Radio.js +2 -1
- package/modern/RadioGroup/RadioGroup.js +12 -12
- package/modern/Select/Select.js +3 -3
- package/modern/Slider/Slider.js +12 -3
- package/modern/StepLabel/StepLabel.js +13 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/modern/Tooltip/Tooltip.js +59 -18
- package/modern/index.js +1 -1
- package/package.json +4 -4
- package/umd/material-ui.development.js +617 -234
- package/umd/material-ui.production.min.js +20 -20
package/esm/Slider/Slider.js
CHANGED
|
@@ -583,8 +583,11 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
583
583
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
584
584
|
|
|
585
585
|
/**
|
|
586
|
-
* The components used for each slot inside
|
|
587
|
-
*
|
|
586
|
+
* The components used for each slot inside.
|
|
587
|
+
*
|
|
588
|
+
* This prop is an alias for the `slots` prop.
|
|
589
|
+
* It's recommended to use the `slots` prop instead.
|
|
590
|
+
*
|
|
588
591
|
* @default {}
|
|
589
592
|
*/
|
|
590
593
|
components: PropTypes.shape({
|
|
@@ -599,7 +602,13 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
599
602
|
}),
|
|
600
603
|
|
|
601
604
|
/**
|
|
602
|
-
*
|
|
605
|
+
* The extra props for the slot components.
|
|
606
|
+
* You can override the existing props or add new ones.
|
|
607
|
+
*
|
|
608
|
+
* This prop is an alias for the `slotProps` prop.
|
|
609
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
610
|
+
*
|
|
611
|
+
* @default {}
|
|
603
612
|
*/
|
|
604
613
|
componentsProps: PropTypes.shape({
|
|
605
614
|
input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
@@ -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", "componentsProps", "error", "icon", "optional", "StepIconComponent", "StepIconProps"];
|
|
3
|
+
const _excluded = ["children", "className", "componentsProps", "error", "icon", "optional", "slotProps", "StepIconComponent", "StepIconProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -110,6 +110,8 @@ const StepLabelLabelContainer = styled('span', {
|
|
|
110
110
|
}
|
|
111
111
|
}));
|
|
112
112
|
const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
|
|
113
|
+
var _slotProps$label;
|
|
114
|
+
|
|
113
115
|
const props = useThemeProps({
|
|
114
116
|
props: inProps,
|
|
115
117
|
name: 'MuiStepLabel'
|
|
@@ -122,6 +124,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
122
124
|
error = false,
|
|
123
125
|
icon: iconProp,
|
|
124
126
|
optional,
|
|
127
|
+
slotProps = {},
|
|
125
128
|
StepIconComponent: StepIconComponentProp,
|
|
126
129
|
StepIconProps
|
|
127
130
|
} = props,
|
|
@@ -154,6 +157,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
154
157
|
});
|
|
155
158
|
|
|
156
159
|
const classes = useUtilityClasses(ownerState);
|
|
160
|
+
const labelSlotProps = (_slotProps$label = slotProps.label) != null ? _slotProps$label : componentsProps.label;
|
|
157
161
|
return /*#__PURE__*/_jsxs(StepLabelRoot, _extends({
|
|
158
162
|
className: clsx(classes.root, className),
|
|
159
163
|
ref: ref,
|
|
@@ -172,9 +176,9 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
172
176
|
className: classes.labelContainer,
|
|
173
177
|
ownerState: ownerState,
|
|
174
178
|
children: [children ? /*#__PURE__*/_jsx(StepLabelLabel, _extends({
|
|
175
|
-
className: classes.label,
|
|
176
179
|
ownerState: ownerState
|
|
177
|
-
},
|
|
180
|
+
}, labelSlotProps, {
|
|
181
|
+
className: clsx(classes.label, labelSlotProps == null ? void 0 : labelSlotProps.className),
|
|
178
182
|
children: children
|
|
179
183
|
})) : null, optional]
|
|
180
184
|
})]
|
|
@@ -227,6 +231,14 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
|
|
|
227
231
|
*/
|
|
228
232
|
optional: PropTypes.node,
|
|
229
233
|
|
|
234
|
+
/**
|
|
235
|
+
* The props used for each slot inside.
|
|
236
|
+
* @default {}
|
|
237
|
+
*/
|
|
238
|
+
slotProps: PropTypes.shape({
|
|
239
|
+
label: PropTypes.object
|
|
240
|
+
}),
|
|
241
|
+
|
|
230
242
|
/**
|
|
231
243
|
* The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/).
|
|
232
244
|
*/
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["BackdropProps"],
|
|
4
4
|
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import { flushSync } from 'react-dom';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { elementTypeAcceptingRef } from '@mui/utils';
|
|
8
9
|
import { useThemeProps } from '@mui/system';
|
|
@@ -218,7 +219,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
218
219
|
|
|
219
220
|
claimedSwipeInstance = null;
|
|
220
221
|
touchDetected.current = false;
|
|
221
|
-
|
|
222
|
+
flushSync(() => {
|
|
223
|
+
setMaybeSwiping(false);
|
|
224
|
+
}); // The swipe wasn't started.
|
|
222
225
|
|
|
223
226
|
if (!swipeInstance.current.isSwiping) {
|
|
224
227
|
swipeInstance.current.isSwiping = null;
|
|
@@ -420,7 +423,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
420
423
|
claimedSwipeInstance = null;
|
|
421
424
|
swipeInstance.current.startX = currentX;
|
|
422
425
|
swipeInstance.current.startY = currentY;
|
|
423
|
-
|
|
426
|
+
flushSync(() => {
|
|
427
|
+
setMaybeSwiping(true);
|
|
428
|
+
});
|
|
424
429
|
|
|
425
430
|
if (!open && paperRef.current) {
|
|
426
431
|
// The ref may be null when a parent component updates while swiping.
|
|
@@ -476,6 +481,8 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
476
481
|
BackdropProps: _extends({}, BackdropProps, {
|
|
477
482
|
ref: backdropRef
|
|
478
483
|
})
|
|
484
|
+
}, variant === 'temporary' && {
|
|
485
|
+
keepMounted: true
|
|
479
486
|
}, ModalPropsProp),
|
|
480
487
|
hideBackdrop: hideBackdrop,
|
|
481
488
|
PaperProps: _extends({}, PaperProps, {
|
package/esm/Tooltip/Tooltip.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 = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"];
|
|
3
|
+
const _excluded = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -215,7 +215,7 @@ function composeEventHandler(handler, eventHandler) {
|
|
|
215
215
|
|
|
216
216
|
|
|
217
217
|
const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
218
|
-
var
|
|
218
|
+
var _ref, _slots$popper, _ref2, _ref3, _slots$transition, _ref4, _slots$tooltip, _ref5, _slots$arrow, _slotProps$popper, _ref6, _slotProps$popper2, _slotProps$transition, _slotProps$tooltip, _ref7, _slotProps$tooltip2, _slotProps$arrow, _ref8, _slotProps$arrow2;
|
|
219
219
|
|
|
220
220
|
const props = useThemeProps({
|
|
221
221
|
props: inProps,
|
|
@@ -245,6 +245,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
245
245
|
placement = 'bottom',
|
|
246
246
|
PopperComponent: PopperComponentProp,
|
|
247
247
|
PopperProps = {},
|
|
248
|
+
slotProps = {},
|
|
249
|
+
slots = {},
|
|
248
250
|
title,
|
|
249
251
|
TransitionComponent: TransitionComponentProp = Grow,
|
|
250
252
|
TransitionProps
|
|
@@ -463,7 +465,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
463
465
|
}, [handleClose, open]);
|
|
464
466
|
const handleRef = useForkRef(children.ref, focusVisibleRef, setChildNode, ref); // There is no point in displaying an empty tooltip.
|
|
465
467
|
|
|
466
|
-
if (
|
|
468
|
+
if (!title && title !== 0) {
|
|
467
469
|
open = false;
|
|
468
470
|
}
|
|
469
471
|
|
|
@@ -583,14 +585,20 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
583
585
|
});
|
|
584
586
|
|
|
585
587
|
const classes = useUtilityClasses(ownerState);
|
|
586
|
-
const PopperComponent = (
|
|
587
|
-
const TransitionComponent = (
|
|
588
|
-
const TooltipComponent = (
|
|
589
|
-
const ArrowComponent = (
|
|
590
|
-
const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, componentsProps.popper
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
const
|
|
588
|
+
const PopperComponent = (_ref = (_slots$popper = slots.popper) != null ? _slots$popper : components.Popper) != null ? _ref : TooltipPopper;
|
|
589
|
+
const TransitionComponent = (_ref2 = (_ref3 = (_slots$transition = slots.transition) != null ? _slots$transition : components.Transition) != null ? _ref3 : TransitionComponentProp) != null ? _ref2 : Grow;
|
|
590
|
+
const TooltipComponent = (_ref4 = (_slots$tooltip = slots.tooltip) != null ? _slots$tooltip : components.Tooltip) != null ? _ref4 : TooltipTooltip;
|
|
591
|
+
const ArrowComponent = (_ref5 = (_slots$arrow = slots.arrow) != null ? _slots$arrow : components.Arrow) != null ? _ref5 : TooltipArrow;
|
|
592
|
+
const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper, {
|
|
593
|
+
className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_ref6 = (_slotProps$popper2 = slotProps.popper) != null ? _slotProps$popper2 : componentsProps.popper) == null ? void 0 : _ref6.className)
|
|
594
|
+
}), ownerState);
|
|
595
|
+
const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, (_slotProps$transition = slotProps.transition) != null ? _slotProps$transition : componentsProps.transition), ownerState);
|
|
596
|
+
const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, (_slotProps$tooltip = slotProps.tooltip) != null ? _slotProps$tooltip : componentsProps.tooltip, {
|
|
597
|
+
className: clsx(classes.tooltip, (_ref7 = (_slotProps$tooltip2 = slotProps.tooltip) != null ? _slotProps$tooltip2 : componentsProps.tooltip) == null ? void 0 : _ref7.className)
|
|
598
|
+
}), ownerState);
|
|
599
|
+
const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, (_slotProps$arrow = slotProps.arrow) != null ? _slotProps$arrow : componentsProps.arrow, {
|
|
600
|
+
className: clsx(classes.arrow, (_ref8 = (_slotProps$arrow2 = slotProps.arrow) != null ? _slotProps$arrow2 : componentsProps.arrow) == null ? void 0 : _ref8.className)
|
|
601
|
+
}), ownerState);
|
|
594
602
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
595
603
|
children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(PopperComponent, _extends({
|
|
596
604
|
as: PopperComponentProp != null ? PopperComponentProp : Popper,
|
|
@@ -610,25 +618,19 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
610
618
|
id: id,
|
|
611
619
|
transition: true
|
|
612
620
|
}, interactiveWrapperListeners, popperProps, {
|
|
613
|
-
className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),
|
|
614
621
|
popperOptions: popperOptions,
|
|
615
622
|
children: ({
|
|
616
623
|
TransitionProps: TransitionPropsInner
|
|
617
|
-
}) => {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
ref: setArrowRef
|
|
628
|
-
})) : null]
|
|
629
|
-
}))
|
|
630
|
-
}));
|
|
631
|
-
}
|
|
624
|
+
}) => /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
625
|
+
timeout: theme.transitions.duration.shorter
|
|
626
|
+
}, TransitionPropsInner, transitionProps, {
|
|
627
|
+
"data-foo": "bar",
|
|
628
|
+
children: /*#__PURE__*/_jsxs(TooltipComponent, _extends({}, tooltipProps, {
|
|
629
|
+
children: [title, arrow ? /*#__PURE__*/_jsx(ArrowComponent, _extends({}, tooltipArrowProps, {
|
|
630
|
+
ref: setArrowRef
|
|
631
|
+
})) : null]
|
|
632
|
+
}))
|
|
633
|
+
}))
|
|
632
634
|
}))]
|
|
633
635
|
});
|
|
634
636
|
});
|
|
@@ -662,8 +664,11 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
662
664
|
className: PropTypes.string,
|
|
663
665
|
|
|
664
666
|
/**
|
|
665
|
-
* The components used for each slot inside
|
|
666
|
-
*
|
|
667
|
+
* The components used for each slot inside.
|
|
668
|
+
*
|
|
669
|
+
* This prop is an alias for the `slots` prop.
|
|
670
|
+
* It's recommended to use the `slots` prop instead.
|
|
671
|
+
*
|
|
667
672
|
* @default {}
|
|
668
673
|
*/
|
|
669
674
|
components: PropTypes.shape({
|
|
@@ -674,9 +679,12 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
674
679
|
}),
|
|
675
680
|
|
|
676
681
|
/**
|
|
677
|
-
* The props
|
|
678
|
-
*
|
|
679
|
-
*
|
|
682
|
+
* The extra props for the slot components.
|
|
683
|
+
* You can override the existing props or add new ones.
|
|
684
|
+
*
|
|
685
|
+
* This prop is an alias for the `slotProps` prop.
|
|
686
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
687
|
+
*
|
|
680
688
|
* @default {}
|
|
681
689
|
*/
|
|
682
690
|
componentsProps: PropTypes.shape({
|
|
@@ -799,6 +807,35 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
799
807
|
*/
|
|
800
808
|
PopperProps: PropTypes.object,
|
|
801
809
|
|
|
810
|
+
/**
|
|
811
|
+
* The extra props for the slot components.
|
|
812
|
+
* You can override the existing props or add new ones.
|
|
813
|
+
*
|
|
814
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
815
|
+
*
|
|
816
|
+
* @default {}
|
|
817
|
+
*/
|
|
818
|
+
slotProps: PropTypes.shape({
|
|
819
|
+
arrow: PropTypes.object,
|
|
820
|
+
popper: PropTypes.object,
|
|
821
|
+
tooltip: PropTypes.object,
|
|
822
|
+
transition: PropTypes.object
|
|
823
|
+
}),
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* The components used for each slot inside.
|
|
827
|
+
*
|
|
828
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
829
|
+
*
|
|
830
|
+
* @default {}
|
|
831
|
+
*/
|
|
832
|
+
slots: PropTypes.shape({
|
|
833
|
+
arrow: PropTypes.elementType,
|
|
834
|
+
popper: PropTypes.elementType,
|
|
835
|
+
tooltip: PropTypes.elementType,
|
|
836
|
+
transition: PropTypes.elementType
|
|
837
|
+
}),
|
|
838
|
+
|
|
802
839
|
/**
|
|
803
840
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
804
841
|
*/
|
package/index.js
CHANGED
package/legacy/Alert/Alert.js
CHANGED
|
@@ -127,7 +127,7 @@ var defaultIconMapping = {
|
|
|
127
127
|
})
|
|
128
128
|
};
|
|
129
129
|
var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
|
130
|
-
var
|
|
130
|
+
var _ref4, _slots$closeButton, _ref5, _slots$closeIcon, _slotProps$closeButto, _slotProps$closeIcon;
|
|
131
131
|
|
|
132
132
|
var props = useThemeProps({
|
|
133
133
|
props: inProps,
|
|
@@ -152,9 +152,13 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
|
|
152
152
|
role = _props$role === void 0 ? 'alert' : _props$role,
|
|
153
153
|
_props$severity = props.severity,
|
|
154
154
|
severity = _props$severity === void 0 ? 'success' : _props$severity,
|
|
155
|
+
_props$slotProps = props.slotProps,
|
|
156
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
157
|
+
_props$slots = props.slots,
|
|
158
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
155
159
|
_props$variant = props.variant,
|
|
156
160
|
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
157
|
-
other = _objectWithoutProperties(props, ["action", "children", "className", "closeText", "color", "components", "componentsProps", "icon", "iconMapping", "onClose", "role", "severity", "variant"]);
|
|
161
|
+
other = _objectWithoutProperties(props, ["action", "children", "className", "closeText", "color", "components", "componentsProps", "icon", "iconMapping", "onClose", "role", "severity", "slotProps", "slots", "variant"]);
|
|
158
162
|
|
|
159
163
|
var ownerState = _extends({}, props, {
|
|
160
164
|
color: color,
|
|
@@ -163,8 +167,10 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
|
|
163
167
|
});
|
|
164
168
|
|
|
165
169
|
var classes = useUtilityClasses(ownerState);
|
|
166
|
-
var AlertCloseButton = (
|
|
167
|
-
var AlertCloseIcon = (
|
|
170
|
+
var AlertCloseButton = (_ref4 = (_slots$closeButton = slots.closeButton) != null ? _slots$closeButton : components.CloseButton) != null ? _ref4 : IconButton;
|
|
171
|
+
var AlertCloseIcon = (_ref5 = (_slots$closeIcon = slots.closeIcon) != null ? _slots$closeIcon : components.CloseIcon) != null ? _ref5 : CloseIcon;
|
|
172
|
+
var closeButtonProps = (_slotProps$closeButto = slotProps.closeButton) != null ? _slotProps$closeButto : componentsProps.closeButton;
|
|
173
|
+
var closeIconProps = (_slotProps$closeIcon = slotProps.closeIcon) != null ? _slotProps$closeIcon : componentsProps.closeIcon;
|
|
168
174
|
return /*#__PURE__*/_jsxs(AlertRoot, _extends({
|
|
169
175
|
role: role,
|
|
170
176
|
elevation: 0,
|
|
@@ -193,10 +199,10 @@ var Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
|
|
|
193
199
|
title: closeText,
|
|
194
200
|
color: "inherit",
|
|
195
201
|
onClick: onClose
|
|
196
|
-
},
|
|
202
|
+
}, closeButtonProps, {
|
|
197
203
|
children: /*#__PURE__*/_jsx(AlertCloseIcon, _extends({
|
|
198
204
|
fontSize: "small"
|
|
199
|
-
},
|
|
205
|
+
}, closeIconProps))
|
|
200
206
|
}))
|
|
201
207
|
}) : null]
|
|
202
208
|
}));
|
|
@@ -247,8 +253,11 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
|
|
|
247
253
|
.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
248
254
|
|
|
249
255
|
/**
|
|
250
|
-
* The components used for each slot inside
|
|
251
|
-
*
|
|
256
|
+
* The components used for each slot inside.
|
|
257
|
+
*
|
|
258
|
+
* This prop is an alias for the `slots` prop.
|
|
259
|
+
* It's recommended to use the `slots` prop instead.
|
|
260
|
+
*
|
|
252
261
|
* @default {}
|
|
253
262
|
*/
|
|
254
263
|
components: PropTypes.shape({
|
|
@@ -257,7 +266,12 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
|
|
|
257
266
|
}),
|
|
258
267
|
|
|
259
268
|
/**
|
|
260
|
-
* The props
|
|
269
|
+
* The extra props for the slot components.
|
|
270
|
+
* You can override the existing props or add new ones.
|
|
271
|
+
*
|
|
272
|
+
* This prop is an alias for the `slotProps` prop.
|
|
273
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
274
|
+
*
|
|
261
275
|
* @default {}
|
|
262
276
|
*/
|
|
263
277
|
componentsProps: PropTypes.shape({
|
|
@@ -304,6 +318,31 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes
|
|
|
304
318
|
*/
|
|
305
319
|
severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
|
|
306
320
|
|
|
321
|
+
/**
|
|
322
|
+
* The extra props for the slot components.
|
|
323
|
+
* You can override the existing props or add new ones.
|
|
324
|
+
*
|
|
325
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
326
|
+
*
|
|
327
|
+
* @default {}
|
|
328
|
+
*/
|
|
329
|
+
slotProps: PropTypes.shape({
|
|
330
|
+
closeButton: PropTypes.object,
|
|
331
|
+
closeIcon: PropTypes.object
|
|
332
|
+
}),
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* The components used for each slot inside.
|
|
336
|
+
*
|
|
337
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
338
|
+
*
|
|
339
|
+
* @default {}
|
|
340
|
+
*/
|
|
341
|
+
slots: PropTypes.shape({
|
|
342
|
+
closeButton: PropTypes.elementType,
|
|
343
|
+
closeIcon: PropTypes.elementType
|
|
344
|
+
}),
|
|
345
|
+
|
|
307
346
|
/**
|
|
308
347
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
309
348
|
*/
|
|
@@ -320,7 +320,7 @@ var AutocompleteGroupUl = styled('ul', {
|
|
|
320
320
|
}));
|
|
321
321
|
export { createFilterOptions };
|
|
322
322
|
var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
323
|
-
var
|
|
323
|
+
var _slotProps$clearIndic, _slotProps$paper, _slotProps$popper, _slotProps$popupIndic;
|
|
324
324
|
|
|
325
325
|
var props = useThemeProps({
|
|
326
326
|
props: inProps,
|
|
@@ -434,8 +434,10 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
434
434
|
selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
|
|
435
435
|
_props$size = props.size,
|
|
436
436
|
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
437
|
+
_props$slotProps = props.slotProps,
|
|
438
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
437
439
|
valueProp = props.value,
|
|
438
|
-
other = _objectWithoutProperties(props, ["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"]);
|
|
440
|
+
other = _objectWithoutProperties(props, ["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"]);
|
|
439
441
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
440
442
|
|
|
441
443
|
|
|
@@ -550,6 +552,10 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
550
552
|
});
|
|
551
553
|
};
|
|
552
554
|
|
|
555
|
+
var clearIndicatorSlotProps = (_slotProps$clearIndic = slotProps.clearIndicator) != null ? _slotProps$clearIndic : componentsProps.clearIndicator;
|
|
556
|
+
var paperSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : componentsProps.paper;
|
|
557
|
+
var popperSlotProps = (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper;
|
|
558
|
+
var popupIndicatorSlotProps = (_slotProps$popupIndic = slotProps.popupIndicator) != null ? _slotProps$popupIndic : componentsProps.popupIndicator;
|
|
553
559
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
554
560
|
children: [/*#__PURE__*/_jsx(AutocompleteRoot, _extends({
|
|
555
561
|
ref: ref,
|
|
@@ -574,16 +580,16 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
574
580
|
"aria-label": clearText,
|
|
575
581
|
title: clearText,
|
|
576
582
|
ownerState: ownerState
|
|
577
|
-
},
|
|
578
|
-
className: clsx(classes.clearIndicator,
|
|
583
|
+
}, clearIndicatorSlotProps, {
|
|
584
|
+
className: clsx(classes.clearIndicator, clearIndicatorSlotProps == null ? void 0 : clearIndicatorSlotProps.className),
|
|
579
585
|
children: clearIcon
|
|
580
586
|
})) : null, hasPopupIcon ? /*#__PURE__*/_jsx(AutocompletePopupIndicator, _extends({}, getPopupIndicatorProps(), {
|
|
581
587
|
disabled: disabled,
|
|
582
588
|
"aria-label": popupOpen ? closeText : openText,
|
|
583
589
|
title: popupOpen ? closeText : openText,
|
|
584
590
|
ownerState: ownerState
|
|
585
|
-
},
|
|
586
|
-
className: clsx(classes.popupIndicator,
|
|
591
|
+
}, popupIndicatorSlotProps, {
|
|
592
|
+
className: clsx(classes.popupIndicator, popupIndicatorSlotProps == null ? void 0 : popupIndicatorSlotProps.className),
|
|
587
593
|
children: popupIcon
|
|
588
594
|
})) : null]
|
|
589
595
|
})
|
|
@@ -604,13 +610,13 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
604
610
|
role: "presentation",
|
|
605
611
|
anchorEl: anchorEl,
|
|
606
612
|
open: popupOpen
|
|
607
|
-
},
|
|
608
|
-
className: clsx(classes.popper,
|
|
613
|
+
}, popperSlotProps, {
|
|
614
|
+
className: clsx(classes.popper, popperSlotProps == null ? void 0 : popperSlotProps.className),
|
|
609
615
|
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
610
616
|
ownerState: ownerState,
|
|
611
617
|
as: PaperComponent
|
|
612
|
-
},
|
|
613
|
-
className: clsx(classes.paper,
|
|
618
|
+
}, paperSlotProps, {
|
|
619
|
+
className: clsx(classes.paper, paperSlotProps == null ? void 0 : paperSlotProps.className),
|
|
614
620
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/_jsx(AutocompleteLoading, {
|
|
615
621
|
className: classes.loading,
|
|
616
622
|
ownerState: ownerState,
|
|
@@ -1096,6 +1102,17 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1096
1102
|
/* @typescript-to-proptypes-ignore */
|
|
1097
1103
|
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
1098
1104
|
|
|
1105
|
+
/**
|
|
1106
|
+
* The props used for each slot inside.
|
|
1107
|
+
* @default {}
|
|
1108
|
+
*/
|
|
1109
|
+
slotProps: PropTypes.shape({
|
|
1110
|
+
clearIndicator: PropTypes.object,
|
|
1111
|
+
paper: PropTypes.object,
|
|
1112
|
+
popper: PropTypes.object,
|
|
1113
|
+
popupIndicator: PropTypes.object
|
|
1114
|
+
}),
|
|
1115
|
+
|
|
1099
1116
|
/**
|
|
1100
1117
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1101
1118
|
*/
|
|
@@ -63,7 +63,7 @@ var AvatarGroupAvatar = styled(Avatar, {
|
|
|
63
63
|
};
|
|
64
64
|
});
|
|
65
65
|
var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
66
|
-
var
|
|
66
|
+
var _slotProps$additional;
|
|
67
67
|
|
|
68
68
|
var props = useThemeProps({
|
|
69
69
|
props: inProps,
|
|
@@ -78,12 +78,14 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
78
78
|
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
|
|
79
79
|
_props$max = props.max,
|
|
80
80
|
max = _props$max === void 0 ? 5 : _props$max,
|
|
81
|
+
_props$slotProps = props.slotProps,
|
|
82
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
81
83
|
_props$spacing = props.spacing,
|
|
82
84
|
spacing = _props$spacing === void 0 ? 'medium' : _props$spacing,
|
|
83
85
|
total = props.total,
|
|
84
86
|
_props$variant = props.variant,
|
|
85
87
|
variant = _props$variant === void 0 ? 'circular' : _props$variant,
|
|
86
|
-
other = _objectWithoutProperties(props, ["children", "className", "component", "componentsProps", "max", "spacing", "total", "variant"]);
|
|
88
|
+
other = _objectWithoutProperties(props, ["children", "className", "component", "componentsProps", "max", "slotProps", "spacing", "total", "variant"]);
|
|
87
89
|
|
|
88
90
|
var clampedMax = max < 2 ? 2 : max;
|
|
89
91
|
|
|
@@ -114,6 +116,7 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
114
116
|
var maxAvatars = Math.min(children.length, clampedMax - 1);
|
|
115
117
|
var extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
|
|
116
118
|
var marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
|
|
119
|
+
var additionalAvatarSlotProps = (_slotProps$additional = slotProps.additionalAvatar) != null ? _slotProps$additional : componentsProps.additionalAvatar;
|
|
117
120
|
return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
|
|
118
121
|
as: component,
|
|
119
122
|
ownerState: ownerState,
|
|
@@ -123,11 +126,11 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
|
|
|
123
126
|
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
124
127
|
ownerState: ownerState,
|
|
125
128
|
variant: variant
|
|
126
|
-
},
|
|
127
|
-
className: clsx(classes.avatar,
|
|
129
|
+
}, additionalAvatarSlotProps, {
|
|
130
|
+
className: clsx(classes.avatar, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.className),
|
|
128
131
|
style: _extends({
|
|
129
132
|
marginLeft: marginLeft
|
|
130
|
-
},
|
|
133
|
+
}, additionalAvatarSlotProps == null ? void 0 : additionalAvatarSlotProps.style),
|
|
131
134
|
children: ["+", extraAvatars]
|
|
132
135
|
})) : null, children.slice(0, maxAvatars).reverse().map(function (child, index) {
|
|
133
136
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -172,7 +175,12 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
172
175
|
component: PropTypes.elementType,
|
|
173
176
|
|
|
174
177
|
/**
|
|
175
|
-
* The props
|
|
178
|
+
* The extra props for the slot components.
|
|
179
|
+
* You can override the existing props or add new ones.
|
|
180
|
+
*
|
|
181
|
+
* This prop is an alias for the `slotProps` prop.
|
|
182
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
183
|
+
*
|
|
176
184
|
* @default {}
|
|
177
185
|
*/
|
|
178
186
|
componentsProps: PropTypes.shape({
|
|
@@ -191,6 +199,18 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
191
199
|
return null;
|
|
192
200
|
}),
|
|
193
201
|
|
|
202
|
+
/**
|
|
203
|
+
* The extra props for the slot components.
|
|
204
|
+
* You can override the existing props or add new ones.
|
|
205
|
+
*
|
|
206
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
207
|
+
*
|
|
208
|
+
* @default {}
|
|
209
|
+
*/
|
|
210
|
+
slotProps: PropTypes.shape({
|
|
211
|
+
additionalAvatar: PropTypes.object
|
|
212
|
+
}),
|
|
213
|
+
|
|
194
214
|
/**
|
|
195
215
|
* Spacing between avatars.
|
|
196
216
|
* @default 'medium'
|