@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
|
@@ -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
|
*/
|
|
@@ -182,35 +182,35 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
};
|
|
185
|
+
const childContext = React.useMemo(() => {
|
|
186
|
+
return {
|
|
187
|
+
adornedStart,
|
|
188
|
+
setAdornedStart,
|
|
189
|
+
color,
|
|
190
|
+
disabled,
|
|
191
|
+
error,
|
|
192
|
+
filled,
|
|
193
|
+
focused,
|
|
194
|
+
fullWidth,
|
|
195
|
+
hiddenLabel,
|
|
196
|
+
size,
|
|
197
|
+
onBlur: () => {
|
|
198
|
+
setFocused(false);
|
|
199
|
+
},
|
|
200
|
+
onEmpty: () => {
|
|
201
|
+
setFilled(false);
|
|
202
|
+
},
|
|
203
|
+
onFilled: () => {
|
|
204
|
+
setFilled(true);
|
|
205
|
+
},
|
|
206
|
+
onFocus: () => {
|
|
207
|
+
setFocused(true);
|
|
208
|
+
},
|
|
209
|
+
registerEffect,
|
|
210
|
+
required,
|
|
211
|
+
variant
|
|
212
|
+
};
|
|
213
|
+
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
|
|
214
214
|
return /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
215
215
|
value: childContext,
|
|
216
216
|
children: /*#__PURE__*/_jsx(FormControlRoot, _extends({
|
|
@@ -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
|
*/
|
|
@@ -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) {
|
|
@@ -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/modern/Modal/Modal.js
CHANGED
|
@@ -186,8 +186,11 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
186
186
|
component: PropTypes.elementType,
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
* The components used for each slot inside
|
|
190
|
-
*
|
|
189
|
+
* The components used for each slot inside.
|
|
190
|
+
*
|
|
191
|
+
* This prop is an alias for the `slots` prop.
|
|
192
|
+
* It's recommended to use the `slots` prop instead.
|
|
193
|
+
*
|
|
191
194
|
* @default {}
|
|
192
195
|
*/
|
|
193
196
|
components: PropTypes.shape({
|
|
@@ -196,7 +199,12 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
196
199
|
}),
|
|
197
200
|
|
|
198
201
|
/**
|
|
199
|
-
* The props
|
|
202
|
+
* The extra props for the slot components.
|
|
203
|
+
* You can override the existing props or add new ones.
|
|
204
|
+
*
|
|
205
|
+
* This prop is an alias for the `slotProps` prop.
|
|
206
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
207
|
+
*
|
|
200
208
|
* @default {}
|
|
201
209
|
*/
|
|
202
210
|
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)'
|