@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/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';
|
|
@@ -111,6 +111,8 @@ const InputInput = styled(InputBaseInput, {
|
|
|
111
111
|
overridesResolver: inputBaseInputOverridesResolver
|
|
112
112
|
})({});
|
|
113
113
|
const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
114
|
+
var _ref, _slots$root, _ref2, _slots$input;
|
|
115
|
+
|
|
114
116
|
const props = useThemeProps({
|
|
115
117
|
props: inProps,
|
|
116
118
|
name: 'MuiInput'
|
|
@@ -123,6 +125,8 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
123
125
|
fullWidth = false,
|
|
124
126
|
inputComponent = 'input',
|
|
125
127
|
multiline = false,
|
|
128
|
+
slotProps,
|
|
129
|
+
slots = {},
|
|
126
130
|
type = 'text'
|
|
127
131
|
} = props,
|
|
128
132
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -136,13 +140,15 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
136
140
|
ownerState
|
|
137
141
|
}
|
|
138
142
|
};
|
|
139
|
-
const componentsProps = componentsPropsProp ? deepmerge(componentsPropsProp, inputComponentsProps) : inputComponentsProps;
|
|
143
|
+
const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, inputComponentsProps) : inputComponentsProps;
|
|
144
|
+
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : InputRoot;
|
|
145
|
+
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : InputInput;
|
|
140
146
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
|
|
147
|
+
slots: {
|
|
148
|
+
root: RootSlot,
|
|
149
|
+
input: InputSlot
|
|
150
|
+
},
|
|
151
|
+
slotProps: componentsProps,
|
|
146
152
|
fullWidth: fullWidth,
|
|
147
153
|
inputComponent: inputComponent,
|
|
148
154
|
multiline: multiline,
|
|
@@ -188,8 +194,11 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
188
194
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
189
195
|
|
|
190
196
|
/**
|
|
191
|
-
* The components used for each slot inside
|
|
192
|
-
*
|
|
197
|
+
* The components used for each slot inside.
|
|
198
|
+
*
|
|
199
|
+
* This prop is an alias for the `slots` prop.
|
|
200
|
+
* It's recommended to use the `slots` prop instead.
|
|
201
|
+
*
|
|
193
202
|
* @default {}
|
|
194
203
|
*/
|
|
195
204
|
components: PropTypes.shape({
|
|
@@ -198,7 +207,12 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
198
207
|
}),
|
|
199
208
|
|
|
200
209
|
/**
|
|
201
|
-
* The props
|
|
210
|
+
* The extra props for the slot components.
|
|
211
|
+
* You can override the existing props or add new ones.
|
|
212
|
+
*
|
|
213
|
+
* This prop is an alias for the `slotProps` prop.
|
|
214
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
215
|
+
*
|
|
202
216
|
* @default {}
|
|
203
217
|
*/
|
|
204
218
|
componentsProps: PropTypes.shape({
|
|
@@ -320,6 +334,31 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
320
334
|
*/
|
|
321
335
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
322
336
|
|
|
337
|
+
/**
|
|
338
|
+
* The extra props for the slot components.
|
|
339
|
+
* You can override the existing props or add new ones.
|
|
340
|
+
*
|
|
341
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
342
|
+
*
|
|
343
|
+
* @default {}
|
|
344
|
+
*/
|
|
345
|
+
slotProps: PropTypes.shape({
|
|
346
|
+
input: PropTypes.object,
|
|
347
|
+
root: PropTypes.object
|
|
348
|
+
}),
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The components used for each slot inside.
|
|
352
|
+
*
|
|
353
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
354
|
+
*
|
|
355
|
+
* @default {}
|
|
356
|
+
*/
|
|
357
|
+
slots: PropTypes.shape({
|
|
358
|
+
input: PropTypes.elementType,
|
|
359
|
+
root: PropTypes.elementType
|
|
360
|
+
}),
|
|
361
|
+
|
|
323
362
|
/**
|
|
324
363
|
* Start `InputAdornment` for this component.
|
|
325
364
|
*/
|
|
@@ -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';
|
|
@@ -215,6 +215,8 @@ const inputGlobalStyles = /*#__PURE__*/_jsx(GlobalStyles, {
|
|
|
215
215
|
|
|
216
216
|
|
|
217
217
|
const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
|
|
218
|
+
var _slotProps$input;
|
|
219
|
+
|
|
218
220
|
const props = useThemeProps({
|
|
219
221
|
props: inProps,
|
|
220
222
|
name: 'MuiInputBase'
|
|
@@ -250,6 +252,8 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
250
252
|
readOnly,
|
|
251
253
|
renderSuffix,
|
|
252
254
|
rows,
|
|
255
|
+
slotProps = {},
|
|
256
|
+
slots = {},
|
|
253
257
|
startAdornment,
|
|
254
258
|
type = 'text',
|
|
255
259
|
value: valueProp
|
|
@@ -453,10 +457,10 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
453
457
|
});
|
|
454
458
|
|
|
455
459
|
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);
|
|
460
|
+
const Root = slots.root || components.Root || InputBaseRoot;
|
|
461
|
+
const rootProps = slotProps.root || componentsProps.root || {};
|
|
462
|
+
const Input = slots.input || components.Input || InputBaseComponent;
|
|
463
|
+
inputProps = _extends({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
|
|
460
464
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
461
465
|
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
462
466
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
@@ -548,8 +552,11 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
548
552
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
549
553
|
|
|
550
554
|
/**
|
|
551
|
-
* The components used for each slot inside
|
|
552
|
-
*
|
|
555
|
+
* The components used for each slot inside.
|
|
556
|
+
*
|
|
557
|
+
* This prop is an alias for the `slots` prop.
|
|
558
|
+
* It's recommended to use the `slots` prop instead.
|
|
559
|
+
*
|
|
553
560
|
* @default {}
|
|
554
561
|
*/
|
|
555
562
|
components: PropTypes.shape({
|
|
@@ -558,7 +565,12 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
558
565
|
}),
|
|
559
566
|
|
|
560
567
|
/**
|
|
561
|
-
* The props
|
|
568
|
+
* The extra props for the slot components.
|
|
569
|
+
* You can override the existing props or add new ones.
|
|
570
|
+
*
|
|
571
|
+
* This prop is an alias for the `slotProps` prop.
|
|
572
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
573
|
+
*
|
|
562
574
|
* @default {}
|
|
563
575
|
*/
|
|
564
576
|
componentsProps: PropTypes.shape({
|
|
@@ -726,6 +738,31 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
726
738
|
/* @typescript-to-proptypes-ignore */
|
|
727
739
|
.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
|
728
740
|
|
|
741
|
+
/**
|
|
742
|
+
* The extra props for the slot components.
|
|
743
|
+
* You can override the existing props or add new ones.
|
|
744
|
+
*
|
|
745
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
746
|
+
*
|
|
747
|
+
* @default {}
|
|
748
|
+
*/
|
|
749
|
+
slotProps: PropTypes.shape({
|
|
750
|
+
input: PropTypes.object,
|
|
751
|
+
root: PropTypes.object
|
|
752
|
+
}),
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* The components used for each slot inside.
|
|
756
|
+
*
|
|
757
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
758
|
+
*
|
|
759
|
+
* @default {}
|
|
760
|
+
*/
|
|
761
|
+
slots: PropTypes.shape({
|
|
762
|
+
input: PropTypes.elementType,
|
|
763
|
+
root: PropTypes.elementType
|
|
764
|
+
}),
|
|
765
|
+
|
|
729
766
|
/**
|
|
730
767
|
* Start `InputAdornment` for this component.
|
|
731
768
|
*/
|
package/esm/ListItem/ListItem.js
CHANGED
|
@@ -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
|
const _excluded = ["className"],
|
|
4
|
-
_excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected"];
|
|
4
|
+
_excluded2 = ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected", "slotProps", "slots"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -159,17 +159,19 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
159
159
|
divider = false,
|
|
160
160
|
focusVisibleClassName,
|
|
161
161
|
secondaryAction,
|
|
162
|
-
selected = false
|
|
162
|
+
selected = false,
|
|
163
|
+
slotProps = {},
|
|
164
|
+
slots = {}
|
|
163
165
|
} = props,
|
|
164
166
|
ContainerProps = _objectWithoutPropertiesLoose(props.ContainerProps, _excluded),
|
|
165
167
|
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
166
168
|
|
|
167
169
|
const context = React.useContext(ListContext);
|
|
168
|
-
const childContext = {
|
|
170
|
+
const childContext = React.useMemo(() => ({
|
|
169
171
|
dense: dense || context.dense || false,
|
|
170
172
|
alignItems,
|
|
171
173
|
disableGutters
|
|
172
|
-
};
|
|
174
|
+
}), [alignItems, context.dense, dense, disableGutters]);
|
|
173
175
|
const listItemRef = React.useRef(null);
|
|
174
176
|
useEnhancedEffect(() => {
|
|
175
177
|
if (autoFocus) {
|
|
@@ -199,8 +201,8 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
199
201
|
|
|
200
202
|
const classes = useUtilityClasses(ownerState);
|
|
201
203
|
const handleRef = useForkRef(listItemRef, ref);
|
|
202
|
-
const Root = components.Root || ListItemRoot;
|
|
203
|
-
const rootProps = componentsProps.root || {};
|
|
204
|
+
const Root = slots.root || components.Root || ListItemRoot;
|
|
205
|
+
const rootProps = slotProps.root || componentsProps.root || {};
|
|
204
206
|
|
|
205
207
|
const componentProps = _extends({
|
|
206
208
|
className: clsx(classes.root, rootProps.className, className),
|
|
@@ -250,8 +252,7 @@ const ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
250
252
|
value: childContext,
|
|
251
253
|
children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
252
254
|
as: Component,
|
|
253
|
-
ref: handleRef
|
|
254
|
-
ownerState: ownerState
|
|
255
|
+
ref: handleRef
|
|
255
256
|
}, !isHostComponent(Root) && {
|
|
256
257
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
257
258
|
}, componentProps, {
|
|
@@ -334,8 +335,11 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
334
335
|
component: PropTypes.elementType,
|
|
335
336
|
|
|
336
337
|
/**
|
|
337
|
-
* The components used for each slot inside
|
|
338
|
-
*
|
|
338
|
+
* The components used for each slot inside.
|
|
339
|
+
*
|
|
340
|
+
* This prop is an alias for the `slots` prop.
|
|
341
|
+
* It's recommended to use the `slots` prop instead.
|
|
342
|
+
*
|
|
339
343
|
* @default {}
|
|
340
344
|
*/
|
|
341
345
|
components: PropTypes.shape({
|
|
@@ -343,7 +347,12 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
343
347
|
}),
|
|
344
348
|
|
|
345
349
|
/**
|
|
346
|
-
* The props
|
|
350
|
+
* The extra props for the slot components.
|
|
351
|
+
* You can override the existing props or add new ones.
|
|
352
|
+
*
|
|
353
|
+
* This prop is an alias for the `slotProps` prop.
|
|
354
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
355
|
+
*
|
|
347
356
|
* @default {}
|
|
348
357
|
*/
|
|
349
358
|
componentsProps: PropTypes.shape({
|
|
@@ -413,6 +422,29 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
413
422
|
*/
|
|
414
423
|
selected: PropTypes.bool,
|
|
415
424
|
|
|
425
|
+
/**
|
|
426
|
+
* The extra props for the slot components.
|
|
427
|
+
* You can override the existing props or add new ones.
|
|
428
|
+
*
|
|
429
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
430
|
+
*
|
|
431
|
+
* @default {}
|
|
432
|
+
*/
|
|
433
|
+
slotProps: PropTypes.shape({
|
|
434
|
+
root: PropTypes.object
|
|
435
|
+
}),
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The components used for each slot inside.
|
|
439
|
+
*
|
|
440
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
441
|
+
*
|
|
442
|
+
* @default {}
|
|
443
|
+
*/
|
|
444
|
+
slots: PropTypes.shape({
|
|
445
|
+
root: PropTypes.elementType
|
|
446
|
+
}),
|
|
447
|
+
|
|
416
448
|
/**
|
|
417
449
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
418
450
|
*/
|
|
@@ -121,11 +121,11 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
121
121
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
122
122
|
|
|
123
123
|
const context = React.useContext(ListContext);
|
|
124
|
-
const childContext = {
|
|
124
|
+
const childContext = React.useMemo(() => ({
|
|
125
125
|
dense: dense || context.dense || false,
|
|
126
126
|
alignItems,
|
|
127
127
|
disableGutters
|
|
128
|
-
};
|
|
128
|
+
}), [alignItems, context.dense, dense, disableGutters]);
|
|
129
129
|
const listItemRef = React.useRef(null);
|
|
130
130
|
useEnhancedEffect(() => {
|
|
131
131
|
if (autoFocus) {
|
package/esm/MenuItem/MenuItem.js
CHANGED
|
@@ -144,10 +144,10 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
144
144
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
145
145
|
|
|
146
146
|
const context = React.useContext(ListContext);
|
|
147
|
-
const childContext = {
|
|
147
|
+
const childContext = React.useMemo(() => ({
|
|
148
148
|
dense: dense || context.dense || false,
|
|
149
149
|
disableGutters
|
|
150
|
-
};
|
|
150
|
+
}), [context.dense, dense, disableGutters]);
|
|
151
151
|
const menuItemRef = React.useRef(null);
|
|
152
152
|
useEnhancedEffect(() => {
|
|
153
153
|
if (autoFocus) {
|
package/esm/Modal/Modal.js
CHANGED
|
@@ -188,8 +188,11 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
188
188
|
component: PropTypes.elementType,
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
|
-
* The components used for each slot inside
|
|
192
|
-
*
|
|
191
|
+
* The components used for each slot inside.
|
|
192
|
+
*
|
|
193
|
+
* This prop is an alias for the `slots` prop.
|
|
194
|
+
* It's recommended to use the `slots` prop instead.
|
|
195
|
+
*
|
|
193
196
|
* @default {}
|
|
194
197
|
*/
|
|
195
198
|
components: PropTypes.shape({
|
|
@@ -198,7 +201,12 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
198
201
|
}),
|
|
199
202
|
|
|
200
203
|
/**
|
|
201
|
-
* The props
|
|
204
|
+
* The extra props for the slot components.
|
|
205
|
+
* You can override the existing props or add new ones.
|
|
206
|
+
*
|
|
207
|
+
* This prop is an alias for the `slotProps` prop.
|
|
208
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
209
|
+
*
|
|
202
210
|
* @default {}
|
|
203
211
|
*/
|
|
204
212
|
componentsProps: PropTypes.shape({
|
|
@@ -41,12 +41,14 @@ export const nativeSelectSelectStyles = ({
|
|
|
41
41
|
borderRadius: 0,
|
|
42
42
|
// Reset
|
|
43
43
|
cursor: 'pointer',
|
|
44
|
-
'&:focus': {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
'&:focus': _extends({}, theme.vars ? {
|
|
45
|
+
backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
|
|
46
|
+
} : {
|
|
47
|
+
backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
|
|
48
|
+
}, {
|
|
47
49
|
borderRadius: 0 // Reset Chrome style
|
|
48
50
|
|
|
49
|
-
},
|
|
51
|
+
}),
|
|
50
52
|
// Remove IE11 arrow
|
|
51
53
|
'&::-ms-expand': {
|
|
52
54
|
display: 'none'
|
|
@@ -58,7 +60,7 @@ export const nativeSelectSelectStyles = ({
|
|
|
58
60
|
height: 'auto'
|
|
59
61
|
},
|
|
60
62
|
'&:not([multiple]) option, &:not([multiple]) optgroup': {
|
|
61
|
-
backgroundColor: theme.palette.background.paper
|
|
63
|
+
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
62
64
|
},
|
|
63
65
|
// Bump specificity to allow extending custom inputs
|
|
64
66
|
'&&&': {
|
|
@@ -71,9 +73,9 @@ export const nativeSelectSelectStyles = ({
|
|
|
71
73
|
paddingRight: 32
|
|
72
74
|
}
|
|
73
75
|
}, ownerState.variant === 'outlined' && {
|
|
74
|
-
borderRadius: theme.shape.borderRadius,
|
|
76
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
75
77
|
'&:focus': {
|
|
76
|
-
borderRadius: theme.shape.borderRadius // Reset the reset for Chrome style
|
|
78
|
+
borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
|
|
77
79
|
|
|
78
80
|
},
|
|
79
81
|
'&&&': {
|
|
@@ -105,9 +107,9 @@ export const nativeSelectIconStyles = ({
|
|
|
105
107
|
// Center vertically, height is 1em
|
|
106
108
|
pointerEvents: 'none',
|
|
107
109
|
// Don't block pointer events on the select under the icon.
|
|
108
|
-
color: theme.palette.action.active,
|
|
110
|
+
color: (theme.vars || theme).palette.action.active,
|
|
109
111
|
[`&.${nativeSelectClasses.disabled}`]: {
|
|
110
|
-
color: theme.palette.action.disabled
|
|
112
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
111
113
|
}
|
|
112
114
|
}, ownerState.open && {
|
|
113
115
|
transform: 'rotate(180deg)'
|
|
@@ -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 = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"];
|
|
3
|
+
const _excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType } from '@mui/utils';
|
|
@@ -119,7 +119,7 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
119
119
|
paddingRight: 0
|
|
120
120
|
}));
|
|
121
121
|
const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
122
|
-
var _React$Fragment;
|
|
122
|
+
var _ref, _slots$root, _ref2, _slots$input, _React$Fragment;
|
|
123
123
|
|
|
124
124
|
const props = useThemeProps({
|
|
125
125
|
props: inProps,
|
|
@@ -133,6 +133,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
133
133
|
label,
|
|
134
134
|
multiline = false,
|
|
135
135
|
notched,
|
|
136
|
+
slots = {},
|
|
136
137
|
type = 'text'
|
|
137
138
|
} = props,
|
|
138
139
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -158,11 +159,13 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
158
159
|
type
|
|
159
160
|
});
|
|
160
161
|
|
|
162
|
+
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : OutlinedInputRoot;
|
|
163
|
+
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : OutlinedInputInput;
|
|
161
164
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
165
|
+
slots: {
|
|
166
|
+
root: RootSlot,
|
|
167
|
+
input: InputSlot
|
|
168
|
+
},
|
|
166
169
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
167
170
|
ownerState: ownerState,
|
|
168
171
|
className: classes.notchedOutline,
|
|
@@ -218,8 +221,11 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
218
221
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
219
222
|
|
|
220
223
|
/**
|
|
221
|
-
* The components used for each slot inside
|
|
222
|
-
*
|
|
224
|
+
* The components used for each slot inside.
|
|
225
|
+
*
|
|
226
|
+
* This prop is an alias for the `slots` prop.
|
|
227
|
+
* It's recommended to use the `slots` prop instead.
|
|
228
|
+
*
|
|
223
229
|
* @default {}
|
|
224
230
|
*/
|
|
225
231
|
components: PropTypes.shape({
|
|
@@ -347,6 +353,18 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
347
353
|
*/
|
|
348
354
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
349
355
|
|
|
356
|
+
/**
|
|
357
|
+
* The components used for each slot inside.
|
|
358
|
+
*
|
|
359
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
360
|
+
*
|
|
361
|
+
* @default {}
|
|
362
|
+
*/
|
|
363
|
+
slots: PropTypes.shape({
|
|
364
|
+
input: PropTypes.elementType,
|
|
365
|
+
root: PropTypes.elementType
|
|
366
|
+
}),
|
|
367
|
+
|
|
350
368
|
/**
|
|
351
369
|
* Start `InputAdornment` for this component.
|
|
352
370
|
*/
|
|
@@ -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 = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "type", "variant"];
|
|
3
|
+
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -216,17 +216,13 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
216
216
|
className,
|
|
217
217
|
color = 'standard',
|
|
218
218
|
component,
|
|
219
|
-
components = {
|
|
220
|
-
first: FirstPageIcon,
|
|
221
|
-
last: LastPageIcon,
|
|
222
|
-
next: NavigateNextIcon,
|
|
223
|
-
previous: NavigateBeforeIcon
|
|
224
|
-
},
|
|
219
|
+
components = {},
|
|
225
220
|
disabled = false,
|
|
226
221
|
page,
|
|
227
222
|
selected = false,
|
|
228
223
|
shape = 'circular',
|
|
229
224
|
size = 'medium',
|
|
225
|
+
slots = {},
|
|
230
226
|
type = 'page',
|
|
231
227
|
variant = 'text'
|
|
232
228
|
} = props,
|
|
@@ -245,15 +241,15 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
245
241
|
const theme = useTheme();
|
|
246
242
|
const classes = useUtilityClasses(ownerState);
|
|
247
243
|
const normalizedIcons = theme.direction === 'rtl' ? {
|
|
248
|
-
previous: components.next || NavigateNextIcon,
|
|
249
|
-
next: components.previous || NavigateBeforeIcon,
|
|
250
|
-
last: components.first || FirstPageIcon,
|
|
251
|
-
first: components.last || LastPageIcon
|
|
244
|
+
previous: slots.next || components.next || NavigateNextIcon,
|
|
245
|
+
next: slots.previous || components.previous || NavigateBeforeIcon,
|
|
246
|
+
last: slots.first || components.first || FirstPageIcon,
|
|
247
|
+
first: slots.last || components.last || LastPageIcon
|
|
252
248
|
} : {
|
|
253
|
-
previous: components.previous || NavigateBeforeIcon,
|
|
254
|
-
next: components.next || NavigateNextIcon,
|
|
255
|
-
first: components.first || FirstPageIcon,
|
|
256
|
-
last: components.last || LastPageIcon
|
|
249
|
+
previous: slots.previous || components.previous || NavigateBeforeIcon,
|
|
250
|
+
next: slots.next || components.next || NavigateNextIcon,
|
|
251
|
+
first: slots.first || components.first || FirstPageIcon,
|
|
252
|
+
last: slots.last || components.last || LastPageIcon
|
|
257
253
|
};
|
|
258
254
|
const Icon = normalizedIcons[type];
|
|
259
255
|
return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
|
|
@@ -315,13 +311,12 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
315
311
|
component: PropTypes.elementType,
|
|
316
312
|
|
|
317
313
|
/**
|
|
318
|
-
* The components used for
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* }
|
|
314
|
+
* The components used for each slot inside.
|
|
315
|
+
*
|
|
316
|
+
* This prop is an alias for the `slots` prop.
|
|
317
|
+
* It's recommended to use the `slots` prop instead.
|
|
318
|
+
*
|
|
319
|
+
* @default {}
|
|
325
320
|
*/
|
|
326
321
|
components: PropTypes.shape({
|
|
327
322
|
first: PropTypes.elementType,
|
|
@@ -361,6 +356,20 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
361
356
|
/* @typescript-to-proptypes-ignore */
|
|
362
357
|
.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
|
363
358
|
|
|
359
|
+
/**
|
|
360
|
+
* The components used for each slot inside.
|
|
361
|
+
*
|
|
362
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
363
|
+
*
|
|
364
|
+
* @default {}
|
|
365
|
+
*/
|
|
366
|
+
slots: PropTypes.shape({
|
|
367
|
+
first: PropTypes.elementType,
|
|
368
|
+
last: PropTypes.elementType,
|
|
369
|
+
next: PropTypes.elementType,
|
|
370
|
+
previous: PropTypes.elementType
|
|
371
|
+
}),
|
|
372
|
+
|
|
364
373
|
/**
|
|
365
374
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
366
375
|
*/
|
package/esm/Radio/Radio.js
CHANGED
|
@@ -42,7 +42,8 @@ const RadioRoot = styled(SwitchBase, {
|
|
|
42
42
|
theme,
|
|
43
43
|
ownerState
|
|
44
44
|
}) => _extends({
|
|
45
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
45
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
46
|
+
}, !ownerState.disableRipple && {
|
|
46
47
|
'&:hover': {
|
|
47
48
|
backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
48
49
|
// Reset on touch devices, it doesn't add specificity
|
|
@@ -42,22 +42,22 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
|
|
|
42
42
|
}
|
|
43
43
|
}), []);
|
|
44
44
|
const handleRef = useForkRef(ref, rootRef);
|
|
45
|
+
const name = useId(nameProp);
|
|
46
|
+
const contextValue = React.useMemo(() => ({
|
|
47
|
+
name,
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
onChange(event) {
|
|
50
|
+
setValueState(event.target.value);
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (onChange) {
|
|
53
|
+
onChange(event, event.target.value);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
value
|
|
58
|
+
}), [name, onChange, setValueState, value]);
|
|
55
59
|
return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
|
|
56
|
-
value:
|
|
57
|
-
name,
|
|
58
|
-
onChange: handleChange,
|
|
59
|
-
value
|
|
60
|
-
},
|
|
60
|
+
value: contextValue,
|
|
61
61
|
children: /*#__PURE__*/_jsx(FormGroup, _extends({
|
|
62
62
|
role: "radiogroup",
|
|
63
63
|
ref: handleRef
|
package/esm/Select/Select.js
CHANGED
|
@@ -244,14 +244,14 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
244
244
|
*
|
|
245
245
|
* @param {SelectChangeEvent<T>} event The event source of the callback.
|
|
246
246
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
247
|
-
* **Warning**: This is a generic event not a change event unless the change event is caused by browser autofill.
|
|
247
|
+
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
248
248
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
|
249
249
|
*/
|
|
250
250
|
onChange: PropTypes.func,
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
253
|
* Callback fired when the component requests to be closed.
|
|
254
|
-
* Use in controlled
|
|
254
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
|
|
255
255
|
*
|
|
256
256
|
* @param {object} event The event source of the callback.
|
|
257
257
|
*/
|
|
@@ -259,7 +259,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* Callback fired when the component requests to be opened.
|
|
262
|
-
* Use in controlled
|
|
262
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select expands).
|
|
263
263
|
*
|
|
264
264
|
* @param {object} event The event source of the callback.
|
|
265
265
|
*/
|