@mui/material 5.2.8 → 5.4.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 +7 -0
- package/Autocomplete/Autocomplete.js +20 -10
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +5 -8
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +308 -28
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +9 -9
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +37 -14
- package/Slider/Slider.js +112 -55
- package/Snackbar/Snackbar.js +4 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.js +1 -1
- package/index.d.ts +8 -3
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +21 -10
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +6 -8
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +41 -17
- package/legacy/Slider/Slider.js +113 -56
- package/legacy/Snackbar/Snackbar.js +4 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/index.js +6 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +87 -32
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +19 -9
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +5 -8
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +37 -14
- package/modern/Slider/Slider.js +112 -55
- package/modern/Snackbar/Snackbar.js +4 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +1 -1
- package/modern/index.js +6 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +20 -10
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +7 -9
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +36 -14
- package/node/Slider/Slider.js +98 -47
- package/node/Snackbar/Snackbar.js +4 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +1 -1
- package/node/index.js +41 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +10 -10
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/makeStyles.js +1 -1
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5099 -7092
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
- package/utils/shouldSpreadAdditionalProps.js +7 -0
package/modern/Select/Select.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
|
|
4
4
|
var _Input, _FilledInput;
|
|
5
5
|
|
|
6
|
-
const _excluded = ["autoWidth", "children", "classes", "className", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
|
|
6
|
+
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -38,6 +38,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
38
38
|
children,
|
|
39
39
|
classes: classesProp = {},
|
|
40
40
|
className,
|
|
41
|
+
defaultOpen = false,
|
|
41
42
|
displayEmpty = false,
|
|
42
43
|
IconComponent = ArrowDropDownIcon,
|
|
43
44
|
id,
|
|
@@ -94,6 +95,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
94
95
|
id
|
|
95
96
|
} : {
|
|
96
97
|
autoWidth,
|
|
98
|
+
defaultOpen,
|
|
97
99
|
displayEmpty,
|
|
98
100
|
labelId,
|
|
99
101
|
MenuProps,
|
|
@@ -148,6 +150,13 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
148
150
|
*/
|
|
149
151
|
className: PropTypes.string,
|
|
150
152
|
|
|
153
|
+
/**
|
|
154
|
+
* If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
|
|
155
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
defaultOpen: PropTypes.bool,
|
|
159
|
+
|
|
151
160
|
/**
|
|
152
161
|
* The default value. Use when the component is not controlled.
|
|
153
162
|
*/
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
var _span;
|
|
6
|
+
|
|
7
|
+
const _excluded = ["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"];
|
|
5
8
|
import * as React from 'react';
|
|
6
9
|
import { isFragment } from 'react-is';
|
|
7
10
|
import PropTypes from 'prop-types';
|
|
@@ -113,6 +116,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
113
116
|
autoWidth,
|
|
114
117
|
children,
|
|
115
118
|
className,
|
|
119
|
+
defaultOpen,
|
|
116
120
|
defaultValue,
|
|
117
121
|
disabled,
|
|
118
122
|
displayEmpty,
|
|
@@ -142,6 +146,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
142
146
|
default: defaultValue,
|
|
143
147
|
name: 'Select'
|
|
144
148
|
});
|
|
149
|
+
const [openState, setOpenState] = useControlled({
|
|
150
|
+
controlled: openProp,
|
|
151
|
+
default: defaultOpen,
|
|
152
|
+
name: 'Select'
|
|
153
|
+
});
|
|
145
154
|
const inputRef = React.useRef(null);
|
|
146
155
|
const displayRef = React.useRef(null);
|
|
147
156
|
const [displayNode, setDisplayNode] = React.useState(null);
|
|
@@ -149,7 +158,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
149
158
|
current: isOpenControlled
|
|
150
159
|
} = React.useRef(openProp != null);
|
|
151
160
|
const [menuMinWidthState, setMenuMinWidthState] = React.useState();
|
|
152
|
-
const [openState, setOpenState] = React.useState(false);
|
|
153
161
|
const handleRef = useForkRef(ref, inputRefProp);
|
|
154
162
|
const handleDisplayRef = React.useCallback(node => {
|
|
155
163
|
displayRef.current = node;
|
|
@@ -164,13 +172,27 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
164
172
|
},
|
|
165
173
|
node: inputRef.current,
|
|
166
174
|
value
|
|
167
|
-
}), [value]);
|
|
175
|
+
}), [value]); // Resize menu on `defaultOpen` automatic toggle.
|
|
176
|
+
|
|
177
|
+
React.useEffect(() => {
|
|
178
|
+
if (defaultOpen && openState && displayNode && !isOpenControlled) {
|
|
179
|
+
setMenuMinWidthState(autoWidth ? null : displayNode.clientWidth);
|
|
180
|
+
displayRef.current.focus();
|
|
181
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
182
|
+
|
|
183
|
+
}, [displayNode, autoWidth]); // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
|
|
184
|
+
// `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
|
|
185
|
+
|
|
168
186
|
React.useEffect(() => {
|
|
169
187
|
if (autoFocus) {
|
|
170
188
|
displayRef.current.focus();
|
|
171
189
|
}
|
|
172
190
|
}, [autoFocus]);
|
|
173
191
|
React.useEffect(() => {
|
|
192
|
+
if (!labelId) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
|
|
174
196
|
const label = ownerDocument(displayRef.current).getElementById(labelId);
|
|
175
197
|
|
|
176
198
|
if (label) {
|
|
@@ -267,7 +289,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
267
289
|
if (onChange) {
|
|
268
290
|
// Redefine target to allow name and value to be read.
|
|
269
291
|
// This allows seamless integration with the most popular form libraries.
|
|
270
|
-
// https://github.com/mui
|
|
292
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
271
293
|
// Clone the event to not override `target` of the original event.
|
|
272
294
|
const nativeEvent = event.nativeEvent || event;
|
|
273
295
|
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
@@ -300,7 +322,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
300
322
|
}
|
|
301
323
|
};
|
|
302
324
|
|
|
303
|
-
const open = displayNode !== null &&
|
|
325
|
+
const open = displayNode !== null && openState;
|
|
304
326
|
|
|
305
327
|
const handleBlur = event => {
|
|
306
328
|
// if open event.stopImmediatePropagation
|
|
@@ -467,16 +489,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
467
489
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
468
490
|
,
|
|
469
491
|
id: buttonId,
|
|
470
|
-
children: isEmpty(display) ?
|
|
471
|
-
/*#__PURE__*/
|
|
472
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
473
|
-
// eslint-disable-next-line react/no-danger
|
|
474
|
-
_jsx("span", {
|
|
492
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
493
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
475
494
|
className: "notranslate",
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
}) : display
|
|
495
|
+
children: "\u200B"
|
|
496
|
+
})) : display
|
|
480
497
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
481
498
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
482
499
|
name: name,
|
|
@@ -559,6 +576,12 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
|
|
559
576
|
*/
|
|
560
577
|
className: PropTypes.string,
|
|
561
578
|
|
|
579
|
+
/**
|
|
580
|
+
* If `true`, the component is toggled on mount. Use when the component open state is not controlled.
|
|
581
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
582
|
+
*/
|
|
583
|
+
defaultOpen: PropTypes.bool,
|
|
584
|
+
|
|
562
585
|
/**
|
|
563
586
|
* The default value. Use when the component is not controlled.
|
|
564
587
|
*/
|
package/modern/Slider/Slider.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "color", "size"];
|
|
3
|
+
const _excluded = ["component", "components", "componentsProps", "color", "size"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { chainPropTypes } from '@mui/utils';
|
|
8
|
-
import { generateUtilityClasses
|
|
8
|
+
import { generateUtilityClasses } from '@mui/base';
|
|
9
9
|
import SliderUnstyled, { SliderValueLabelUnstyled, sliderUnstyledClasses, getSliderUtilityClass } from '@mui/base/SliderUnstyled';
|
|
10
10
|
import { alpha, lighten, darken } from '@mui/system';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
13
13
|
import useTheme from '../styles/useTheme';
|
|
14
|
+
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
14
15
|
import capitalize from '../utils/capitalize';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
export const sliderClasses = _extends({}, sliderUnstyledClasses, generateUtilityClasses('MuiSlider', ['colorPrimary', 'colorSecondary', 'thumbColorPrimary', 'thumbColorSecondary', 'sizeSmall', 'thumbSizeSmall']));
|
|
17
|
-
|
|
18
|
+
const SliderRoot = styled('span', {
|
|
18
19
|
name: 'MuiSlider',
|
|
19
20
|
slot: 'Root',
|
|
20
21
|
overridesResolver: (props, styles) => {
|
|
@@ -80,7 +81,21 @@ export const SliderRoot = styled('span', {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
}));
|
|
83
|
-
|
|
84
|
+
process.env.NODE_ENV !== "production" ? SliderRoot.propTypes
|
|
85
|
+
/* remove-proptypes */
|
|
86
|
+
= {
|
|
87
|
+
// ----------------------------- Warning --------------------------------
|
|
88
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
89
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
90
|
+
// ----------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @ignore
|
|
94
|
+
*/
|
|
95
|
+
children: PropTypes.node
|
|
96
|
+
} : void 0;
|
|
97
|
+
export { SliderRoot };
|
|
98
|
+
const SliderRail = styled('span', {
|
|
84
99
|
name: 'MuiSlider',
|
|
85
100
|
slot: 'Rail',
|
|
86
101
|
overridesResolver: (props, styles) => styles.rail
|
|
@@ -105,7 +120,21 @@ export const SliderRail = styled('span', {
|
|
|
105
120
|
}, ownerState.track === 'inverted' && {
|
|
106
121
|
opacity: 1
|
|
107
122
|
}));
|
|
108
|
-
|
|
123
|
+
process.env.NODE_ENV !== "production" ? SliderRail.propTypes
|
|
124
|
+
/* remove-proptypes */
|
|
125
|
+
= {
|
|
126
|
+
// ----------------------------- Warning --------------------------------
|
|
127
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
128
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
129
|
+
// ----------------------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @ignore
|
|
133
|
+
*/
|
|
134
|
+
children: PropTypes.node
|
|
135
|
+
} : void 0;
|
|
136
|
+
export { SliderRail };
|
|
137
|
+
const SliderTrack = styled('span', {
|
|
109
138
|
name: 'MuiSlider',
|
|
110
139
|
slot: 'Track',
|
|
111
140
|
overridesResolver: (props, styles) => styles.track
|
|
@@ -141,7 +170,21 @@ export const SliderTrack = styled('span', {
|
|
|
141
170
|
borderColor: color
|
|
142
171
|
});
|
|
143
172
|
});
|
|
144
|
-
|
|
173
|
+
process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
|
|
174
|
+
/* remove-proptypes */
|
|
175
|
+
= {
|
|
176
|
+
// ----------------------------- Warning --------------------------------
|
|
177
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
178
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
179
|
+
// ----------------------------------------------------------------------
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @ignore
|
|
183
|
+
*/
|
|
184
|
+
children: PropTypes.node
|
|
185
|
+
} : void 0;
|
|
186
|
+
export { SliderTrack };
|
|
187
|
+
const SliderThumb = styled('span', {
|
|
145
188
|
name: 'MuiSlider',
|
|
146
189
|
slot: 'Thumb',
|
|
147
190
|
overridesResolver: (props, styles) => {
|
|
@@ -213,7 +256,21 @@ export const SliderThumb = styled('span', {
|
|
|
213
256
|
}
|
|
214
257
|
}
|
|
215
258
|
}));
|
|
216
|
-
|
|
259
|
+
process.env.NODE_ENV !== "production" ? SliderThumb.propTypes
|
|
260
|
+
/* remove-proptypes */
|
|
261
|
+
= {
|
|
262
|
+
// ----------------------------- Warning --------------------------------
|
|
263
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
264
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
265
|
+
// ----------------------------------------------------------------------
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @ignore
|
|
269
|
+
*/
|
|
270
|
+
children: PropTypes.node
|
|
271
|
+
} : void 0;
|
|
272
|
+
export { SliderThumb };
|
|
273
|
+
const SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
217
274
|
name: 'MuiSlider',
|
|
218
275
|
slot: 'ValueLabel',
|
|
219
276
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -257,7 +314,21 @@ export const SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
257
314
|
backgroundColor: 'inherit'
|
|
258
315
|
}
|
|
259
316
|
}));
|
|
260
|
-
|
|
317
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
318
|
+
/* remove-proptypes */
|
|
319
|
+
= {
|
|
320
|
+
// ----------------------------- Warning --------------------------------
|
|
321
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
322
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
323
|
+
// ----------------------------------------------------------------------
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @ignore
|
|
327
|
+
*/
|
|
328
|
+
children: PropTypes.node
|
|
329
|
+
} : void 0;
|
|
330
|
+
export { SliderValueLabel };
|
|
331
|
+
const SliderMark = styled('span', {
|
|
261
332
|
name: 'MuiSlider',
|
|
262
333
|
slot: 'Mark',
|
|
263
334
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markActive',
|
|
@@ -282,7 +353,21 @@ export const SliderMark = styled('span', {
|
|
|
282
353
|
backgroundColor: theme.palette.background.paper,
|
|
283
354
|
opacity: 0.8
|
|
284
355
|
}));
|
|
285
|
-
|
|
356
|
+
process.env.NODE_ENV !== "production" ? SliderMark.propTypes
|
|
357
|
+
/* remove-proptypes */
|
|
358
|
+
= {
|
|
359
|
+
// ----------------------------- Warning --------------------------------
|
|
360
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
361
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
362
|
+
// ----------------------------------------------------------------------
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* @ignore
|
|
366
|
+
*/
|
|
367
|
+
children: PropTypes.node
|
|
368
|
+
} : void 0;
|
|
369
|
+
export { SliderMark };
|
|
370
|
+
const SliderMarkLabel = styled('span', {
|
|
286
371
|
name: 'MuiSlider',
|
|
287
372
|
slot: 'MarkLabel',
|
|
288
373
|
shouldForwardProp: prop => slotShouldForwardProp(prop) && prop !== 'markLabelActive',
|
|
@@ -310,7 +395,9 @@ export const SliderMarkLabel = styled('span', {
|
|
|
310
395
|
}, markLabelActive && {
|
|
311
396
|
color: theme.palette.text.primary
|
|
312
397
|
}));
|
|
313
|
-
|
|
398
|
+
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
399
|
+
/* remove-proptypes */
|
|
400
|
+
= {
|
|
314
401
|
// ----------------------------- Warning --------------------------------
|
|
315
402
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
316
403
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -319,40 +406,9 @@ SliderRoot.propTypes = {
|
|
|
319
406
|
/**
|
|
320
407
|
* @ignore
|
|
321
408
|
*/
|
|
322
|
-
children: PropTypes.node
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
* @ignore
|
|
326
|
-
*/
|
|
327
|
-
ownerState: PropTypes.shape({
|
|
328
|
-
'aria-label': PropTypes.string,
|
|
329
|
-
'aria-labelledby': PropTypes.string,
|
|
330
|
-
'aria-valuetext': PropTypes.string,
|
|
331
|
-
classes: PropTypes.object,
|
|
332
|
-
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
333
|
-
defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
334
|
-
disabled: PropTypes.bool,
|
|
335
|
-
getAriaLabel: PropTypes.func,
|
|
336
|
-
getAriaValueText: PropTypes.func,
|
|
337
|
-
isRtl: PropTypes.bool,
|
|
338
|
-
marks: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
339
|
-
label: PropTypes.node,
|
|
340
|
-
value: PropTypes.number.isRequired
|
|
341
|
-
})), PropTypes.bool]),
|
|
342
|
-
max: PropTypes.number,
|
|
343
|
-
min: PropTypes.number,
|
|
344
|
-
name: PropTypes.string,
|
|
345
|
-
onChange: PropTypes.func,
|
|
346
|
-
onChangeCommitted: PropTypes.func,
|
|
347
|
-
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
348
|
-
scale: PropTypes.func,
|
|
349
|
-
step: PropTypes.number,
|
|
350
|
-
track: PropTypes.oneOf(['inverted', 'normal', false]),
|
|
351
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
352
|
-
valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on']),
|
|
353
|
-
valueLabelFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
354
|
-
})
|
|
355
|
-
};
|
|
409
|
+
children: PropTypes.node
|
|
410
|
+
} : void 0;
|
|
411
|
+
export { SliderMarkLabel };
|
|
356
412
|
|
|
357
413
|
const extendUtilityClasses = ownerState => {
|
|
358
414
|
const {
|
|
@@ -366,19 +422,17 @@ const extendUtilityClasses = ownerState => {
|
|
|
366
422
|
});
|
|
367
423
|
};
|
|
368
424
|
|
|
369
|
-
const
|
|
370
|
-
return !Component || !isHostComponent(Component);
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
const Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
425
|
+
const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
374
426
|
const props = useThemeProps({
|
|
375
|
-
props:
|
|
427
|
+
props: inputProps,
|
|
376
428
|
name: 'MuiSlider'
|
|
377
429
|
});
|
|
378
430
|
const theme = useTheme();
|
|
379
431
|
const isRtl = theme.direction === 'rtl';
|
|
380
432
|
|
|
381
433
|
const {
|
|
434
|
+
// eslint-disable-next-line react/prop-types
|
|
435
|
+
component = 'span',
|
|
382
436
|
components = {},
|
|
383
437
|
componentsProps = {},
|
|
384
438
|
color = 'primary',
|
|
@@ -404,25 +458,26 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(sliderProps, ref) {
|
|
|
404
458
|
MarkLabel: SliderMarkLabel
|
|
405
459
|
}, components),
|
|
406
460
|
componentsProps: _extends({}, componentsProps, {
|
|
407
|
-
root: _extends({}, componentsProps.root,
|
|
461
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
462
|
+
as: component,
|
|
408
463
|
ownerState: _extends({}, componentsProps.root?.ownerState, {
|
|
409
464
|
color,
|
|
410
465
|
size
|
|
411
466
|
})
|
|
412
467
|
}),
|
|
413
|
-
thumb: _extends({}, componentsProps.thumb,
|
|
468
|
+
thumb: _extends({}, componentsProps.thumb, shouldSpreadAdditionalProps(components.Thumb) && {
|
|
414
469
|
ownerState: _extends({}, componentsProps.thumb?.ownerState, {
|
|
415
470
|
color,
|
|
416
471
|
size
|
|
417
472
|
})
|
|
418
473
|
}),
|
|
419
|
-
track: _extends({}, componentsProps.track,
|
|
474
|
+
track: _extends({}, componentsProps.track, shouldSpreadAdditionalProps(components.Track) && {
|
|
420
475
|
ownerState: _extends({}, componentsProps.track?.ownerState, {
|
|
421
476
|
color,
|
|
422
477
|
size
|
|
423
478
|
})
|
|
424
479
|
}),
|
|
425
|
-
valueLabel: _extends({}, componentsProps.valueLabel,
|
|
480
|
+
valueLabel: _extends({}, componentsProps.valueLabel, shouldSpreadAdditionalProps(components.ValueLabel) && {
|
|
426
481
|
ownerState: _extends({}, componentsProps.valueLabel?.ownerState, {
|
|
427
482
|
color,
|
|
428
483
|
size
|
|
@@ -634,7 +689,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
634
689
|
* The size of the slider.
|
|
635
690
|
* @default 'medium'
|
|
636
691
|
*/
|
|
637
|
-
size: PropTypes
|
|
692
|
+
size: PropTypes
|
|
693
|
+
/* @typescript-to-proptypes-ignore */
|
|
694
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
638
695
|
|
|
639
696
|
/**
|
|
640
697
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
@@ -290,7 +290,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
290
290
|
onMouseEnter: handleMouseEnter,
|
|
291
291
|
onMouseLeave: handleMouseLeave,
|
|
292
292
|
ownerState: ownerState,
|
|
293
|
-
ref: ref
|
|
293
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
294
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
295
|
+
,
|
|
296
|
+
role: "presentation"
|
|
294
297
|
}, other, {
|
|
295
298
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
296
299
|
appear: true,
|
|
@@ -43,19 +43,19 @@ const SvgIconRoot = styled('svg', {
|
|
|
43
43
|
display: 'inline-block',
|
|
44
44
|
fill: 'currentColor',
|
|
45
45
|
flexShrink: 0,
|
|
46
|
-
transition: theme.transitions
|
|
47
|
-
duration: theme.transitions
|
|
46
|
+
transition: theme.transitions?.create?.('fill', {
|
|
47
|
+
duration: theme.transitions?.duration?.shorter
|
|
48
48
|
}),
|
|
49
49
|
fontSize: {
|
|
50
50
|
inherit: 'inherit',
|
|
51
|
-
small: theme.typography
|
|
52
|
-
medium: theme.typography
|
|
53
|
-
large: theme.typography
|
|
51
|
+
small: theme.typography?.pxToRem?.(20) || '1.25rem',
|
|
52
|
+
medium: theme.typography?.pxToRem?.(24) || '1.5rem',
|
|
53
|
+
large: theme.typography?.pxToRem?.(35) || '2.1875'
|
|
54
54
|
}[ownerState.fontSize],
|
|
55
55
|
// TODO v5 deprecate, v6 remove for sx
|
|
56
|
-
color: theme.palette[ownerState.color]?.main ?? {
|
|
57
|
-
action: theme.palette
|
|
58
|
-
disabled: theme.palette
|
|
56
|
+
color: theme.palette?.[ownerState.color]?.main ?? {
|
|
57
|
+
action: theme.palette?.action?.active,
|
|
58
|
+
disabled: theme.palette?.action?.disabled,
|
|
59
59
|
inherit: undefined
|
|
60
60
|
}[ownerState.color]
|
|
61
61
|
}));
|
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(({
|
|
11
|
+
const SwipeAreaRoot = styled('div')(({
|
|
14
12
|
theme,
|
|
15
13
|
ownerState
|
|
16
14
|
}) => _extends({
|
|
@@ -191,7 +191,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
191
191
|
variant: variant,
|
|
192
192
|
ownerState: ownerState
|
|
193
193
|
}, other, {
|
|
194
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
194
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
195
195
|
htmlFor: id,
|
|
196
196
|
id: inputLabelId
|
|
197
197
|
}, InputLabelProps, {
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -273,4 +272,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
272
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
273
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
274
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
275
|
+
export { StyledEngineProvider } from './styles';
|
|
276
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
277
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
278
|
+
export * from '@mui/base/generateUtilityClass';
|
|
279
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
|
@@ -29,9 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
29
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const SwitchBaseRoot = styled(ButtonBase
|
|
33
|
-
skipSx: true
|
|
34
|
-
})(({
|
|
32
|
+
const SwitchBaseRoot = styled(ButtonBase)(({
|
|
35
33
|
ownerState
|
|
36
34
|
}) => _extends({
|
|
37
35
|
padding: 9,
|
|
@@ -41,9 +39,7 @@ const SwitchBaseRoot = styled(ButtonBase, {
|
|
|
41
39
|
}, ownerState.edge === 'end' && {
|
|
42
40
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
43
41
|
}));
|
|
44
|
-
const SwitchBaseInput = styled('input'
|
|
45
|
-
skipSx: true
|
|
46
|
-
})({
|
|
42
|
+
const SwitchBaseInput = styled('input')({
|
|
47
43
|
cursor: 'inherit',
|
|
48
44
|
position: 'absolute',
|
|
49
45
|
opacity: 0,
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function makeStyles() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function withStyles() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function withTheme() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
|
|
6
6
|
}
|