@mui/material 5.2.6 → 5.3.1
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/Autocomplete/Autocomplete.d.ts +2 -0
- package/Autocomplete/Autocomplete.js +11 -7
- package/Avatar/Avatar.d.ts +3 -1
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.d.ts +10 -10
- package/Badge/Badge.js +6 -7
- package/Button/buttonClasses.d.ts +1 -1
- package/CHANGELOG.md +240 -33
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +3 -1
- package/Input/Input.js +4 -1
- package/InputBase/InputBase.js +4 -1
- package/InputLabel/InputLabel.js +4 -0
- package/ListItem/ListItem.js +3 -1
- package/Modal/Modal.js +3 -1
- package/README.md +5 -4
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +25 -4
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +28 -12
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/Tooltip/Tooltip.js +6 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +11 -7
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +6 -7
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +3 -1
- package/legacy/Input/Input.js +4 -1
- package/legacy/InputBase/InputBase.js +4 -1
- package/legacy/InputLabel/InputLabel.js +4 -0
- package/legacy/ListItem/ListItem.js +3 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +29 -7
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +29 -12
- package/legacy/TextField/TextField.js +1 -0
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +139 -128
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/locale/index.js +54 -44
- package/modern/Autocomplete/Autocomplete.js +10 -6
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +6 -7
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +3 -1
- package/modern/Input/Input.js +4 -1
- package/modern/InputBase/InputBase.js +4 -1
- package/modern/InputLabel/InputLabel.js +4 -0
- package/modern/ListItem/ListItem.js +3 -1
- package/modern/Modal/Modal.js +3 -1
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +25 -4
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +27 -11
- package/modern/TextField/TextField.js +1 -0
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +1 -1
- package/modern/locale/index.js +54 -44
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +11 -7
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +8 -8
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +3 -1
- package/node/Input/Input.js +4 -1
- package/node/InputBase/InputBase.js +4 -1
- package/node/InputLabel/InputLabel.js +4 -0
- package/node/ListItem/ListItem.js +3 -1
- package/node/Modal/Modal.js +3 -1
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +25 -4
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +28 -12
- package/node/TextField/TextField.js +1 -0
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +54 -44
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/umd/material-ui.development.js +619 -289
- package/umd/material-ui.production.min.js +21 -21
- package/utils/shouldSpreadAdditionalProps.js +7 -0
|
@@ -123,7 +123,9 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes
|
|
|
123
123
|
* The props used for each slot inside the Backdrop.
|
|
124
124
|
* @default {}
|
|
125
125
|
*/
|
|
126
|
-
componentsProps: PropTypes.
|
|
126
|
+
componentsProps: PropTypes.shape({
|
|
127
|
+
root: PropTypes.object
|
|
128
|
+
}),
|
|
127
129
|
|
|
128
130
|
/**
|
|
129
131
|
* If `true`, the backdrop is invisible.
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -5,10 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
|
-
import { generateUtilityClasses
|
|
8
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
9
9
|
import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
|
|
10
10
|
import styled from '../styles/styled';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
12
13
|
import capitalize from '../utils/capitalize';
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
@@ -144,11 +145,6 @@ var BadgeBadge = styled('span', {
|
|
|
144
145
|
})
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
|
-
|
|
148
|
-
var shouldSpreadAdditionalProps = function shouldSpreadAdditionalProps(Slot) {
|
|
149
|
-
return !Slot || !isHostComponent(Slot);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
148
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
153
149
|
var _componentsProps$root, _componentsProps$badg;
|
|
154
150
|
|
|
@@ -300,7 +296,10 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
300
296
|
* The props used for each slot inside the Badge.
|
|
301
297
|
* @default {}
|
|
302
298
|
*/
|
|
303
|
-
componentsProps: PropTypes.
|
|
299
|
+
componentsProps: PropTypes.shape({
|
|
300
|
+
badge: PropTypes.object,
|
|
301
|
+
root: PropTypes.object
|
|
302
|
+
}),
|
|
304
303
|
|
|
305
304
|
/**
|
|
306
305
|
* If `true`, the badge is invisible.
|
|
@@ -255,7 +255,10 @@ process.env.NODE_ENV !== "production" ? FilledInput.propTypes
|
|
|
255
255
|
* The props used for each slot inside the Input.
|
|
256
256
|
* @default {}
|
|
257
257
|
*/
|
|
258
|
-
componentsProps: PropTypes.
|
|
258
|
+
componentsProps: PropTypes.shape({
|
|
259
|
+
input: PropTypes.object,
|
|
260
|
+
root: PropTypes.object
|
|
261
|
+
}),
|
|
259
262
|
|
|
260
263
|
/**
|
|
261
264
|
* The default value. Use when the component is not controlled.
|
|
@@ -156,7 +156,9 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes
|
|
|
156
156
|
* The props used for each slot inside.
|
|
157
157
|
* @default {}
|
|
158
158
|
*/
|
|
159
|
-
componentsProps: PropTypes.
|
|
159
|
+
componentsProps: PropTypes.shape({
|
|
160
|
+
typography: PropTypes.object
|
|
161
|
+
}),
|
|
160
162
|
|
|
161
163
|
/**
|
|
162
164
|
* A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
|
package/legacy/Input/Input.js
CHANGED
|
@@ -190,7 +190,10 @@ process.env.NODE_ENV !== "production" ? Input.propTypes
|
|
|
190
190
|
* The props used for each slot inside the Input.
|
|
191
191
|
* @default {}
|
|
192
192
|
*/
|
|
193
|
-
componentsProps: PropTypes.
|
|
193
|
+
componentsProps: PropTypes.shape({
|
|
194
|
+
input: PropTypes.object,
|
|
195
|
+
root: PropTypes.object
|
|
196
|
+
}),
|
|
194
197
|
|
|
195
198
|
/**
|
|
196
199
|
* The default value. Use when the component is not controlled.
|
|
@@ -561,7 +561,10 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
561
561
|
* The props used for each slot inside the Input.
|
|
562
562
|
* @default {}
|
|
563
563
|
*/
|
|
564
|
-
componentsProps: PropTypes.
|
|
564
|
+
componentsProps: PropTypes.shape({
|
|
565
|
+
input: PropTypes.object,
|
|
566
|
+
root: PropTypes.object
|
|
567
|
+
}),
|
|
565
568
|
|
|
566
569
|
/**
|
|
567
570
|
* The default value. Use when the component is not controlled.
|
|
@@ -78,6 +78,8 @@ var InputLabelRoot = styled(FormLabel, {
|
|
|
78
78
|
}, ownerState.size === 'small' && {
|
|
79
79
|
transform: 'translate(12px, 13px) scale(1)'
|
|
80
80
|
}, ownerState.shrink && _extends({
|
|
81
|
+
userSelect: 'none',
|
|
82
|
+
pointerEvents: 'auto',
|
|
81
83
|
transform: 'translate(12px, 7px) scale(0.75)',
|
|
82
84
|
maxWidth: 'calc(133% - 24px)'
|
|
83
85
|
}, ownerState.size === 'small' && {
|
|
@@ -91,6 +93,8 @@ var InputLabelRoot = styled(FormLabel, {
|
|
|
91
93
|
}, ownerState.size === 'small' && {
|
|
92
94
|
transform: 'translate(14px, 9px) scale(1)'
|
|
93
95
|
}, ownerState.shrink && {
|
|
96
|
+
userSelect: 'none',
|
|
97
|
+
pointerEvents: 'auto',
|
|
94
98
|
maxWidth: 'calc(133% - 24px)',
|
|
95
99
|
transform: 'translate(14px, -9px) scale(0.75)'
|
|
96
100
|
}));
|
|
@@ -348,7 +348,9 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
348
348
|
* The props used for each slot inside the Input.
|
|
349
349
|
* @default {}
|
|
350
350
|
*/
|
|
351
|
-
componentsProps: PropTypes.
|
|
351
|
+
componentsProps: PropTypes.shape({
|
|
352
|
+
root: PropTypes.object
|
|
353
|
+
}),
|
|
352
354
|
|
|
353
355
|
/**
|
|
354
356
|
* The container component used when a `ListItemSecondaryAction` is the last child.
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -194,7 +194,9 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
194
194
|
* The props used for each slot inside the Modal.
|
|
195
195
|
* @default {}
|
|
196
196
|
*/
|
|
197
|
-
componentsProps: PropTypes.
|
|
197
|
+
componentsProps: PropTypes.shape({
|
|
198
|
+
root: PropTypes.object
|
|
199
|
+
}),
|
|
198
200
|
|
|
199
201
|
/**
|
|
200
202
|
* An HTML element or function that returns one.
|
package/legacy/Select/Select.js
CHANGED
|
@@ -36,6 +36,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
36
36
|
_props$classes = props.classes,
|
|
37
37
|
classesProp = _props$classes === void 0 ? {} : _props$classes,
|
|
38
38
|
className = props.className,
|
|
39
|
+
_props$defaultOpen = props.defaultOpen,
|
|
40
|
+
defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
|
|
39
41
|
_props$displayEmpty = props.displayEmpty,
|
|
40
42
|
displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty,
|
|
41
43
|
_props$IconComponent = props.IconComponent,
|
|
@@ -57,7 +59,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
57
59
|
SelectDisplayProps = props.SelectDisplayProps,
|
|
58
60
|
_props$variant = props.variant,
|
|
59
61
|
variantProps = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
60
|
-
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
62
|
+
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
61
63
|
|
|
62
64
|
var inputComponent = native ? NativeSelectInput : SelectInput;
|
|
63
65
|
var muiFormControl = useFormControl();
|
|
@@ -96,6 +98,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
96
98
|
id: id
|
|
97
99
|
} : {
|
|
98
100
|
autoWidth: autoWidth,
|
|
101
|
+
defaultOpen: defaultOpen,
|
|
99
102
|
displayEmpty: displayEmpty,
|
|
100
103
|
labelId: labelId,
|
|
101
104
|
MenuProps: MenuProps,
|
|
@@ -150,6 +153,13 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
150
153
|
*/
|
|
151
154
|
className: PropTypes.string,
|
|
152
155
|
|
|
156
|
+
/**
|
|
157
|
+
* If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
|
|
158
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
161
|
+
defaultOpen: PropTypes.bool,
|
|
162
|
+
|
|
153
163
|
/**
|
|
154
164
|
* The default value. Use when the component is not controlled.
|
|
155
165
|
*/
|
|
@@ -103,6 +103,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
103
103
|
autoWidth = props.autoWidth,
|
|
104
104
|
children = props.children,
|
|
105
105
|
className = props.className,
|
|
106
|
+
defaultOpen = props.defaultOpen,
|
|
106
107
|
defaultValue = props.defaultValue,
|
|
107
108
|
disabled = props.disabled,
|
|
108
109
|
displayEmpty = props.displayEmpty,
|
|
@@ -128,7 +129,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
128
129
|
valueProp = props.value,
|
|
129
130
|
_props$variant = props.variant,
|
|
130
131
|
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
131
|
-
other = _objectWithoutProperties(props, ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]);
|
|
132
|
+
other = _objectWithoutProperties(props, ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]);
|
|
132
133
|
|
|
133
134
|
var _useControlled = useControlled({
|
|
134
135
|
controlled: valueProp,
|
|
@@ -139,6 +140,15 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
139
140
|
value = _useControlled2[0],
|
|
140
141
|
setValueState = _useControlled2[1];
|
|
141
142
|
|
|
143
|
+
var _useControlled3 = useControlled({
|
|
144
|
+
controlled: openProp,
|
|
145
|
+
default: defaultOpen,
|
|
146
|
+
name: 'Select'
|
|
147
|
+
}),
|
|
148
|
+
_useControlled4 = _slicedToArray(_useControlled3, 2),
|
|
149
|
+
openState = _useControlled4[0],
|
|
150
|
+
setOpenState = _useControlled4[1];
|
|
151
|
+
|
|
142
152
|
var inputRef = React.useRef(null);
|
|
143
153
|
var displayRef = React.useRef(null);
|
|
144
154
|
|
|
@@ -153,10 +163,6 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
153
163
|
menuMinWidthState = _React$useState2[0],
|
|
154
164
|
setMenuMinWidthState = _React$useState2[1];
|
|
155
165
|
|
|
156
|
-
var _React$useState3 = React.useState(false),
|
|
157
|
-
openState = _React$useState3[0],
|
|
158
|
-
setOpenState = _React$useState3[1];
|
|
159
|
-
|
|
160
166
|
var handleRef = useForkRef(ref, inputRefProp);
|
|
161
167
|
var handleDisplayRef = React.useCallback(function (node) {
|
|
162
168
|
displayRef.current = node;
|
|
@@ -173,7 +179,17 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
173
179
|
node: inputRef.current,
|
|
174
180
|
value: value
|
|
175
181
|
};
|
|
176
|
-
}, [value]);
|
|
182
|
+
}, [value]); // Resize menu on `defaultOpen` automatic toggle.
|
|
183
|
+
|
|
184
|
+
React.useEffect(function () {
|
|
185
|
+
if (defaultOpen && openState && displayNode && !isOpenControlled) {
|
|
186
|
+
setMenuMinWidthState(autoWidth ? null : displayNode.clientWidth);
|
|
187
|
+
displayRef.current.focus();
|
|
188
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
|
+
|
|
190
|
+
}, [displayNode, autoWidth]); // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
|
|
191
|
+
// `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
|
|
192
|
+
|
|
177
193
|
React.useEffect(function () {
|
|
178
194
|
if (autoFocus) {
|
|
179
195
|
displayRef.current.focus();
|
|
@@ -313,7 +329,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
313
329
|
}
|
|
314
330
|
};
|
|
315
331
|
|
|
316
|
-
var open = displayNode !== null &&
|
|
332
|
+
var open = displayNode !== null && openState;
|
|
317
333
|
|
|
318
334
|
var handleBlur = function handleBlur(event) {
|
|
319
335
|
// if open event.stopImmediatePropagation
|
|
@@ -580,6 +596,12 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
|
|
580
596
|
*/
|
|
581
597
|
className: PropTypes.string,
|
|
582
598
|
|
|
599
|
+
/**
|
|
600
|
+
* If `true`, the component is toggled on mount. Use when the component open state is not controlled.
|
|
601
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
602
|
+
*/
|
|
603
|
+
defaultOpen: PropTypes.bool,
|
|
604
|
+
|
|
583
605
|
/**
|
|
584
606
|
* The default value. Use when the component is not controlled.
|
|
585
607
|
*/
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -6,16 +6,17 @@ import * as React from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { chainPropTypes } from '@mui/utils';
|
|
9
|
-
import { generateUtilityClasses
|
|
9
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
10
10
|
import SliderUnstyled, { SliderValueLabelUnstyled, sliderUnstyledClasses, getSliderUtilityClass } from '@mui/base/SliderUnstyled';
|
|
11
11
|
import { alpha, lighten, darken } from '@mui/system';
|
|
12
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
13
13
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
14
14
|
import useTheme from '../styles/useTheme';
|
|
15
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
15
16
|
import capitalize from '../utils/capitalize';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
export var sliderClasses = _extends({}, sliderUnstyledClasses, generateUtilityClasses('MuiSlider', ['colorPrimary', 'colorSecondary', 'thumbColorPrimary', 'thumbColorSecondary', 'sizeSmall', 'thumbSizeSmall']));
|
|
18
|
-
|
|
19
|
+
var SliderRoot = styled('span', {
|
|
19
20
|
name: 'MuiSlider',
|
|
20
21
|
slot: 'Root',
|
|
21
22
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -82,7 +83,21 @@ export var SliderRoot = styled('span', {
|
|
|
82
83
|
transition: 'none'
|
|
83
84
|
})), _extends2));
|
|
84
85
|
});
|
|
85
|
-
|
|
86
|
+
process.env.NODE_ENV !== "production" ? SliderRoot.propTypes
|
|
87
|
+
/* remove-proptypes */
|
|
88
|
+
= {
|
|
89
|
+
// ----------------------------- Warning --------------------------------
|
|
90
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
91
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
92
|
+
// ----------------------------------------------------------------------
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @ignore
|
|
96
|
+
*/
|
|
97
|
+
children: PropTypes.node
|
|
98
|
+
} : void 0;
|
|
99
|
+
export { SliderRoot };
|
|
100
|
+
var SliderRail = styled('span', {
|
|
86
101
|
name: 'MuiSlider',
|
|
87
102
|
slot: 'Rail',
|
|
88
103
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -110,7 +125,21 @@ export var SliderRail = styled('span', {
|
|
|
110
125
|
opacity: 1
|
|
111
126
|
});
|
|
112
127
|
});
|
|
113
|
-
|
|
128
|
+
process.env.NODE_ENV !== "production" ? SliderRail.propTypes
|
|
129
|
+
/* remove-proptypes */
|
|
130
|
+
= {
|
|
131
|
+
// ----------------------------- Warning --------------------------------
|
|
132
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
133
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
134
|
+
// ----------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @ignore
|
|
138
|
+
*/
|
|
139
|
+
children: PropTypes.node
|
|
140
|
+
} : void 0;
|
|
141
|
+
export { SliderRail };
|
|
142
|
+
var SliderTrack = styled('span', {
|
|
114
143
|
name: 'MuiSlider',
|
|
115
144
|
slot: 'Track',
|
|
116
145
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -147,7 +176,21 @@ export var SliderTrack = styled('span', {
|
|
|
147
176
|
borderColor: color
|
|
148
177
|
});
|
|
149
178
|
});
|
|
150
|
-
|
|
179
|
+
process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
|
|
180
|
+
/* remove-proptypes */
|
|
181
|
+
= {
|
|
182
|
+
// ----------------------------- Warning --------------------------------
|
|
183
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
184
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
185
|
+
// ----------------------------------------------------------------------
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @ignore
|
|
189
|
+
*/
|
|
190
|
+
children: PropTypes.node
|
|
191
|
+
} : void 0;
|
|
192
|
+
export { SliderTrack };
|
|
193
|
+
var SliderThumb = styled('span', {
|
|
151
194
|
name: 'MuiSlider',
|
|
152
195
|
slot: 'Thumb',
|
|
153
196
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -217,7 +260,21 @@ export var SliderThumb = styled('span', {
|
|
|
217
260
|
}
|
|
218
261
|
}), _extends3));
|
|
219
262
|
});
|
|
220
|
-
|
|
263
|
+
process.env.NODE_ENV !== "production" ? SliderThumb.propTypes
|
|
264
|
+
/* remove-proptypes */
|
|
265
|
+
= {
|
|
266
|
+
// ----------------------------- Warning --------------------------------
|
|
267
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
268
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
269
|
+
// ----------------------------------------------------------------------
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
274
|
+
children: PropTypes.node
|
|
275
|
+
} : void 0;
|
|
276
|
+
export { SliderThumb };
|
|
277
|
+
var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
221
278
|
name: 'MuiSlider',
|
|
222
279
|
slot: 'ValueLabel',
|
|
223
280
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -262,7 +319,21 @@ export var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
262
319
|
}
|
|
263
320
|
});
|
|
264
321
|
});
|
|
265
|
-
|
|
322
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
323
|
+
/* remove-proptypes */
|
|
324
|
+
= {
|
|
325
|
+
// ----------------------------- Warning --------------------------------
|
|
326
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
327
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
328
|
+
// ----------------------------------------------------------------------
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @ignore
|
|
332
|
+
*/
|
|
333
|
+
children: PropTypes.node
|
|
334
|
+
} : void 0;
|
|
335
|
+
export { SliderValueLabel };
|
|
336
|
+
var SliderMark = styled('span', {
|
|
266
337
|
name: 'MuiSlider',
|
|
267
338
|
slot: 'Mark',
|
|
268
339
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -292,7 +363,21 @@ export var SliderMark = styled('span', {
|
|
|
292
363
|
opacity: 0.8
|
|
293
364
|
});
|
|
294
365
|
});
|
|
295
|
-
|
|
366
|
+
process.env.NODE_ENV !== "production" ? SliderMark.propTypes
|
|
367
|
+
/* remove-proptypes */
|
|
368
|
+
= {
|
|
369
|
+
// ----------------------------- Warning --------------------------------
|
|
370
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
371
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
372
|
+
// ----------------------------------------------------------------------
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @ignore
|
|
376
|
+
*/
|
|
377
|
+
children: PropTypes.node
|
|
378
|
+
} : void 0;
|
|
379
|
+
export { SliderMark };
|
|
380
|
+
var SliderMarkLabel = styled('span', {
|
|
296
381
|
name: 'MuiSlider',
|
|
297
382
|
slot: 'MarkLabel',
|
|
298
383
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -325,7 +410,9 @@ export var SliderMarkLabel = styled('span', {
|
|
|
325
410
|
color: theme.palette.text.primary
|
|
326
411
|
});
|
|
327
412
|
});
|
|
328
|
-
|
|
413
|
+
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
414
|
+
/* remove-proptypes */
|
|
415
|
+
= {
|
|
329
416
|
// ----------------------------- Warning --------------------------------
|
|
330
417
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
331
418
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -334,40 +421,9 @@ SliderRoot.propTypes = {
|
|
|
334
421
|
/**
|
|
335
422
|
* @ignore
|
|
336
423
|
*/
|
|
337
|
-
children: PropTypes.node
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
* @ignore
|
|
341
|
-
*/
|
|
342
|
-
ownerState: PropTypes.shape({
|
|
343
|
-
'aria-label': PropTypes.string,
|
|
344
|
-
'aria-labelledby': PropTypes.string,
|
|
345
|
-
'aria-valuetext': PropTypes.string,
|
|
346
|
-
classes: PropTypes.object,
|
|
347
|
-
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
348
|
-
defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
349
|
-
disabled: PropTypes.bool,
|
|
350
|
-
getAriaLabel: PropTypes.func,
|
|
351
|
-
getAriaValueText: PropTypes.func,
|
|
352
|
-
isRtl: PropTypes.bool,
|
|
353
|
-
marks: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
354
|
-
label: PropTypes.node,
|
|
355
|
-
value: PropTypes.number.isRequired
|
|
356
|
-
})), PropTypes.bool]),
|
|
357
|
-
max: PropTypes.number,
|
|
358
|
-
min: PropTypes.number,
|
|
359
|
-
name: PropTypes.string,
|
|
360
|
-
onChange: PropTypes.func,
|
|
361
|
-
onChangeCommitted: PropTypes.func,
|
|
362
|
-
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
363
|
-
scale: PropTypes.func,
|
|
364
|
-
step: PropTypes.number,
|
|
365
|
-
track: PropTypes.oneOf(['inverted', 'normal', false]),
|
|
366
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
367
|
-
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on']),
|
|
368
|
-
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
369
|
-
})
|
|
370
|
-
};
|
|
424
|
+
children: PropTypes.node
|
|
425
|
+
} : void 0;
|
|
426
|
+
export { SliderMarkLabel };
|
|
371
427
|
|
|
372
428
|
var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
373
429
|
var color = ownerState.color,
|
|
@@ -380,10 +436,6 @@ var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
|
380
436
|
});
|
|
381
437
|
};
|
|
382
438
|
|
|
383
|
-
var shouldSpreadOwnerState = function shouldSpreadOwnerState(Component) {
|
|
384
|
-
return !Component || !isHostComponent(Component);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
439
|
var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
388
440
|
var _componentsProps$root, _componentsProps$thum, _componentsProps$trac, _componentsProps$valu;
|
|
389
441
|
|
|
@@ -394,7 +446,9 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
394
446
|
var theme = useTheme();
|
|
395
447
|
var isRtl = theme.direction === 'rtl';
|
|
396
448
|
|
|
397
|
-
var _props$
|
|
449
|
+
var _props$component = props.component,
|
|
450
|
+
component = _props$component === void 0 ? 'span' : _props$component,
|
|
451
|
+
_props$components = props.components,
|
|
398
452
|
components = _props$components === void 0 ? {} : _props$components,
|
|
399
453
|
_props$componentsProp = props.componentsProps,
|
|
400
454
|
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
|
|
@@ -402,7 +456,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
402
456
|
color = _props$color === void 0 ? 'primary' : _props$color,
|
|
403
457
|
_props$size = props.size,
|
|
404
458
|
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
405
|
-
other = _objectWithoutProperties(props, ["components", "componentsProps", "color", "size"]);
|
|
459
|
+
other = _objectWithoutProperties(props, ["component", "components", "componentsProps", "color", "size"]);
|
|
406
460
|
|
|
407
461
|
var ownerState = _extends({}, props, {
|
|
408
462
|
color: color,
|
|
@@ -422,25 +476,26 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
422
476
|
MarkLabel: SliderMarkLabel
|
|
423
477
|
}, components),
|
|
424
478
|
componentsProps: _extends({}, componentsProps, {
|
|
425
|
-
root: _extends({}, componentsProps.root,
|
|
479
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
480
|
+
as: component,
|
|
426
481
|
ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
427
482
|
color: color,
|
|
428
483
|
size: size
|
|
429
484
|
})
|
|
430
485
|
}),
|
|
431
|
-
thumb: _extends({}, componentsProps.thumb,
|
|
486
|
+
thumb: _extends({}, componentsProps.thumb, shouldSpreadAdditionalProps(components.Thumb) && {
|
|
432
487
|
ownerState: _extends({}, (_componentsProps$thum = componentsProps.thumb) == null ? void 0 : _componentsProps$thum.ownerState, {
|
|
433
488
|
color: color,
|
|
434
489
|
size: size
|
|
435
490
|
})
|
|
436
491
|
}),
|
|
437
|
-
track: _extends({}, componentsProps.track,
|
|
492
|
+
track: _extends({}, componentsProps.track, shouldSpreadAdditionalProps(components.Track) && {
|
|
438
493
|
ownerState: _extends({}, (_componentsProps$trac = componentsProps.track) == null ? void 0 : _componentsProps$trac.ownerState, {
|
|
439
494
|
color: color,
|
|
440
495
|
size: size
|
|
441
496
|
})
|
|
442
497
|
}),
|
|
443
|
-
valueLabel: _extends({}, componentsProps.valueLabel,
|
|
498
|
+
valueLabel: _extends({}, componentsProps.valueLabel, shouldSpreadAdditionalProps(components.ValueLabel) && {
|
|
444
499
|
ownerState: _extends({}, (_componentsProps$valu = componentsProps.valueLabel) == null ? void 0 : _componentsProps$valu.ownerState, {
|
|
445
500
|
color: color,
|
|
446
501
|
size: size
|
|
@@ -514,6 +569,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
514
569
|
* @default {}
|
|
515
570
|
*/
|
|
516
571
|
components: PropTypes.shape({
|
|
572
|
+
Input: PropTypes.elementType,
|
|
517
573
|
Mark: PropTypes.elementType,
|
|
518
574
|
MarkLabel: PropTypes.elementType,
|
|
519
575
|
Rail: PropTypes.elementType,
|
|
@@ -527,7 +583,24 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
527
583
|
* The props used for each slot inside the Slider.
|
|
528
584
|
* @default {}
|
|
529
585
|
*/
|
|
530
|
-
componentsProps: PropTypes.
|
|
586
|
+
componentsProps: PropTypes.shape({
|
|
587
|
+
input: PropTypes.object,
|
|
588
|
+
mark: PropTypes.object,
|
|
589
|
+
markLabel: PropTypes.object,
|
|
590
|
+
rail: PropTypes.object,
|
|
591
|
+
root: PropTypes.object,
|
|
592
|
+
thumb: PropTypes.object,
|
|
593
|
+
track: PropTypes.object,
|
|
594
|
+
valueLabel: PropTypes.shape({
|
|
595
|
+
className: PropTypes.string,
|
|
596
|
+
components: PropTypes.shape({
|
|
597
|
+
Root: PropTypes.elementType
|
|
598
|
+
}),
|
|
599
|
+
style: PropTypes.object,
|
|
600
|
+
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
601
|
+
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on'])
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
531
604
|
|
|
532
605
|
/**
|
|
533
606
|
* The default value. Use when the component is not controlled.
|
|
@@ -209,7 +209,9 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
|
|
|
209
209
|
* The props used for each slot inside.
|
|
210
210
|
* @default {}
|
|
211
211
|
*/
|
|
212
|
-
componentsProps: PropTypes.
|
|
212
|
+
componentsProps: PropTypes.shape({
|
|
213
|
+
label: PropTypes.object
|
|
214
|
+
}),
|
|
213
215
|
|
|
214
216
|
/**
|
|
215
217
|
* If `true`, the step is marked as failed.
|