@mui/material 5.3.1 → 5.4.0
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/Accordion/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/Autocomplete.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +11 -3
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +76 -76
- package/ButtonBase/TouchRipple.js +1 -2
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +84 -0
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/chipClasses.d.ts +80 -80
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +22 -22
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -18
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +12 -10
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/Grid.js +2 -4
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +26 -26
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/InputAdornment.js +6 -9
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/inputBaseClasses.d.ts +44 -44
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +17 -17
- package/Radio/RadioButtonIcon.js +2 -6
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/SelectInput.js +7 -9
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +24 -24
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +24 -24
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/TextField.js +1 -1
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/darkScrollbar/index.d.ts +28 -28
- package/index.d.ts +7 -2
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Autocomplete/Autocomplete.js +12 -3
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- 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/InputAdornment/InputAdornment.js +6 -9
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Select/SelectInput.js +7 -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/useMediaQuery/useMediaQuery.js +86 -31
- package/locale/index.d.ts +68 -68
- package/modern/Autocomplete/Autocomplete.js +11 -3
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/TouchRipple.js +1 -2
- 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/InputAdornment/InputAdornment.js +6 -9
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Select/SelectInput.js +7 -9
- 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/useMediaQuery/useMediaQuery.js +68 -26
- package/node/Autocomplete/Autocomplete.js +11 -3
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/TouchRipple.js +1 -2
- 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/InputAdornment/InputAdornment.js +5 -9
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Select/SelectInput.js +6 -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/useMediaQuery/useMediaQuery.js +68 -26
- package/package.json +3 -3
- package/styles/ThemeProvider.d.ts +1 -1
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/umd/material-ui.development.js +5869 -8117
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +31 -27
- package/useMediaQuery/useMediaQuery.js +68 -26
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
@@ -136,7 +136,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
136
136
|
}, components),
|
|
137
137
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
138
138
|
className: classes.notchedOutline,
|
|
139
|
-
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
139
|
+
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
140
140
|
children: [label, "\xA0", '*']
|
|
141
141
|
})) : label,
|
|
142
142
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
@@ -10,15 +10,11 @@ const RadioButtonIconRoot = styled('span')({
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
display: 'flex'
|
|
12
12
|
});
|
|
13
|
-
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon
|
|
14
|
-
skipSx: true
|
|
15
|
-
})({
|
|
13
|
+
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({
|
|
16
14
|
// Scale applied to prevent dot misalignment in Safari
|
|
17
15
|
transform: 'scale(1)'
|
|
18
16
|
});
|
|
19
|
-
const RadioButtonIconDot = styled(RadioButtonCheckedIcon
|
|
20
|
-
skipSx: true
|
|
21
|
-
})(({
|
|
17
|
+
const RadioButtonIconDot = styled(RadioButtonCheckedIcon)(({
|
|
22
18
|
theme,
|
|
23
19
|
ownerState
|
|
24
20
|
}) => _extends({
|
|
@@ -1,6 +1,9 @@
|
|
|
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
|
+
|
|
5
|
+
var _span;
|
|
6
|
+
|
|
4
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';
|
|
@@ -482,16 +485,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
482
485
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
483
486
|
,
|
|
484
487
|
id: buttonId,
|
|
485
|
-
children: isEmpty(display) ?
|
|
486
|
-
/*#__PURE__*/
|
|
487
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
488
|
-
// eslint-disable-next-line react/no-danger
|
|
489
|
-
_jsx("span", {
|
|
488
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
489
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
490
490
|
className: "notranslate",
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
}) : display
|
|
491
|
+
children: "\u200B"
|
|
492
|
+
})) : display
|
|
495
493
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
496
494
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
497
495
|
name: name,
|
|
@@ -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.0
|
|
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,
|
|
@@ -5,32 +5,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
|
5
5
|
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
10
|
-
// All the browsers MUI support have this built-in.
|
|
11
|
-
// This defensive check is here for simplicity.
|
|
12
|
-
// Most of the time, the match media logic isn't central to people tests.
|
|
13
|
-
|
|
8
|
+
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
14
9
|
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
15
|
-
const {
|
|
16
|
-
defaultMatches = false,
|
|
17
|
-
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
18
|
-
noSsr = false,
|
|
19
|
-
ssrMatchMedia = null
|
|
20
|
-
} = getThemeProps({
|
|
21
|
-
name: 'MuiUseMediaQuery',
|
|
22
|
-
props: options,
|
|
23
|
-
theme
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
if (typeof queryInput === 'function' && theme === null) {
|
|
28
|
-
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
33
|
-
query = query.replace(/^@media( ?)/m, '');
|
|
34
10
|
const [match, setMatch] = React.useState(() => {
|
|
35
11
|
if (noSsr && supportMatchMedia) {
|
|
36
12
|
return matchMedia(query).matches;
|
|
@@ -62,13 +38,79 @@ export default function useMediaQuery(queryInput, options = {}) {
|
|
|
62
38
|
}
|
|
63
39
|
};
|
|
64
40
|
|
|
65
|
-
updateMatch();
|
|
41
|
+
updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
42
|
+
|
|
66
43
|
queryList.addListener(updateMatch);
|
|
67
44
|
return () => {
|
|
68
45
|
active = false;
|
|
69
46
|
queryList.removeListener(updateMatch);
|
|
70
47
|
};
|
|
71
48
|
}, [query, matchMedia, supportMatchMedia]);
|
|
49
|
+
return match;
|
|
50
|
+
} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
54
|
+
|
|
55
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
56
|
+
const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
|
|
57
|
+
const getServerSnapshot = React.useMemo(() => {
|
|
58
|
+
if (ssrMatchMedia !== null) {
|
|
59
|
+
const {
|
|
60
|
+
matches
|
|
61
|
+
} = ssrMatchMedia(query);
|
|
62
|
+
return () => matches;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return getDefaultSnapshot;
|
|
66
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
67
|
+
const [getSnapshot, subscribe] = React.useMemo(() => {
|
|
68
|
+
if (matchMedia === null) {
|
|
69
|
+
return [getDefaultSnapshot, () => () => {}];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const mediaQueryList = matchMedia(query);
|
|
73
|
+
return [() => mediaQueryList.matches, notify => {
|
|
74
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
75
|
+
mediaQueryList.addListener(notify);
|
|
76
|
+
return () => {
|
|
77
|
+
mediaQueryList.removeListener(notify);
|
|
78
|
+
};
|
|
79
|
+
}];
|
|
80
|
+
}, [getDefaultSnapshot, matchMedia, query]);
|
|
81
|
+
const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
82
|
+
return match;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function useMediaQuery(queryInput, options = {}) {
|
|
86
|
+
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
87
|
+
// All the browsers MUI support have this built-in.
|
|
88
|
+
// This defensive check is here for simplicity.
|
|
89
|
+
// Most of the time, the match media logic isn't central to people tests.
|
|
90
|
+
|
|
91
|
+
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
92
|
+
const {
|
|
93
|
+
defaultMatches = false,
|
|
94
|
+
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
95
|
+
ssrMatchMedia = null,
|
|
96
|
+
noSsr
|
|
97
|
+
} = getThemeProps({
|
|
98
|
+
name: 'MuiUseMediaQuery',
|
|
99
|
+
props: options,
|
|
100
|
+
theme
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
104
|
+
if (typeof queryInput === 'function' && theme === null) {
|
|
105
|
+
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
110
|
+
query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
|
|
111
|
+
|
|
112
|
+
const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
|
113
|
+
const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
|
72
114
|
|
|
73
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
116
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -63,7 +63,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
63
63
|
|
|
64
64
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
65
65
|
|
|
66
|
-
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
66
|
+
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
67
67
|
|
|
68
68
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
69
69
|
|
|
@@ -444,6 +444,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
444
444
|
PaperComponent = _Paper.default,
|
|
445
445
|
PopperComponent = _Popper.default,
|
|
446
446
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowDropDown.default, {})),
|
|
447
|
+
readOnly = false,
|
|
447
448
|
renderGroup: renderGroupProp,
|
|
448
449
|
renderInput,
|
|
449
450
|
renderOption: renderOptionProp,
|
|
@@ -476,7 +477,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
476
477
|
} = (0, _base.useAutocomplete)((0, _extends2.default)({}, props, {
|
|
477
478
|
componentName: 'Autocomplete'
|
|
478
479
|
}));
|
|
479
|
-
const hasClearIcon = !disableClearable && !disabled && dirty;
|
|
480
|
+
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
480
481
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
481
482
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
482
483
|
disablePortal,
|
|
@@ -593,7 +594,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
593
594
|
},
|
|
594
595
|
inputProps: (0, _extends2.default)({
|
|
595
596
|
className: (0, _clsx.default)(classes.input),
|
|
596
|
-
disabled
|
|
597
|
+
disabled,
|
|
598
|
+
readOnly
|
|
597
599
|
}, getInputProps())
|
|
598
600
|
})
|
|
599
601
|
})), popupOpen && anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
@@ -1034,6 +1036,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1034
1036
|
*/
|
|
1035
1037
|
popupIcon: _propTypes.default.node,
|
|
1036
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
1041
|
+
* @default false
|
|
1042
|
+
*/
|
|
1043
|
+
readOnly: _propTypes.default.bool,
|
|
1044
|
+
|
|
1037
1045
|
/**
|
|
1038
1046
|
* Render the group.
|
|
1039
1047
|
*
|
|
File without changes
|
|
@@ -27,9 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
-
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(({
|
|
30
|
+
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default)(({
|
|
33
31
|
theme
|
|
34
32
|
}) => (0, _extends2.default)({
|
|
35
33
|
display: 'flex',
|
|
@@ -33,6 +33,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
33
33
|
|
|
34
34
|
var _formControlLabelClasses = _interopRequireWildcard(require("./formControlLabelClasses"));
|
|
35
35
|
|
|
36
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
37
|
+
|
|
36
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
39
|
|
|
38
40
|
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"];
|
|
@@ -45,10 +47,11 @@ const useUtilityClasses = ownerState => {
|
|
|
45
47
|
const {
|
|
46
48
|
classes,
|
|
47
49
|
disabled,
|
|
48
|
-
labelPlacement
|
|
50
|
+
labelPlacement,
|
|
51
|
+
error
|
|
49
52
|
} = ownerState;
|
|
50
53
|
const slots = {
|
|
51
|
-
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}
|
|
54
|
+
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}`, error && 'error'],
|
|
52
55
|
label: ['label', disabled && 'disabled']
|
|
53
56
|
};
|
|
54
57
|
return (0, _base.unstable_composeClasses)(slots, _formControlLabelClasses.getFormControlLabelUtilityClasses, classes);
|
|
@@ -139,10 +142,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
139
142
|
controlProps[key] = props[key];
|
|
140
143
|
}
|
|
141
144
|
});
|
|
145
|
+
const fcs = (0, _formControlState.default)({
|
|
146
|
+
props,
|
|
147
|
+
muiFormControl,
|
|
148
|
+
states: ['error']
|
|
149
|
+
});
|
|
142
150
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
143
151
|
disabled,
|
|
144
152
|
label,
|
|
145
|
-
labelPlacement
|
|
153
|
+
labelPlacement,
|
|
154
|
+
error: fcs.error
|
|
146
155
|
});
|
|
147
156
|
const classes = useUtilityClasses(ownerState);
|
|
148
157
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FormControlLabelRoot, (0, _extends2.default)({
|
|
@@ -12,6 +12,6 @@ function getFormControlLabelUtilityClasses(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFormControlLabel', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
|
|
15
|
+
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
16
16
|
var _default = formControlLabelClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -25,6 +25,10 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
25
25
|
|
|
26
26
|
var _formGroupClasses = require("./formGroupClasses");
|
|
27
27
|
|
|
28
|
+
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
29
|
+
|
|
30
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
31
|
+
|
|
28
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
33
|
|
|
30
34
|
const _excluded = ["className", "row"];
|
|
@@ -36,10 +40,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
40
|
const useUtilityClasses = ownerState => {
|
|
37
41
|
const {
|
|
38
42
|
classes,
|
|
39
|
-
row
|
|
43
|
+
row,
|
|
44
|
+
error
|
|
40
45
|
} = ownerState;
|
|
41
46
|
const slots = {
|
|
42
|
-
root: ['root', row && 'row']
|
|
47
|
+
root: ['root', row && 'row', error && 'error']
|
|
43
48
|
};
|
|
44
49
|
return (0, _base.unstable_composeClasses)(slots, _formGroupClasses.getFormGroupUtilityClass, classes);
|
|
45
50
|
};
|
|
@@ -78,8 +83,15 @@ const FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref)
|
|
|
78
83
|
row = false
|
|
79
84
|
} = props,
|
|
80
85
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
86
|
+
const muiFormControl = (0, _useFormControl.default)();
|
|
87
|
+
const fcs = (0, _formControlState.default)({
|
|
88
|
+
props,
|
|
89
|
+
muiFormControl,
|
|
90
|
+
states: ['error']
|
|
91
|
+
});
|
|
81
92
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
82
|
-
row
|
|
93
|
+
row,
|
|
94
|
+
error: fcs.error
|
|
83
95
|
});
|
|
84
96
|
const classes = useUtilityClasses(ownerState);
|
|
85
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormGroupRoot, (0, _extends2.default)({
|
|
@@ -12,6 +12,6 @@ function getFormGroupUtilityClass(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFormGroup', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const formGroupClasses = (0, _base.generateUtilityClasses)('MuiFormGroup', ['root', 'row']);
|
|
15
|
+
const formGroupClasses = (0, _base.generateUtilityClasses)('MuiFormGroup', ['root', 'row', 'error']);
|
|
16
16
|
var _default = formGroupClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -33,6 +33,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
33
33
|
|
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
35
|
|
|
36
|
+
var _span;
|
|
37
|
+
|
|
36
38
|
const _excluded = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
37
39
|
|
|
38
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -123,16 +125,11 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
123
125
|
className: (0, _clsx.default)(classes.root, className),
|
|
124
126
|
ref: ref
|
|
125
127
|
}, other, {
|
|
126
|
-
children: children === ' ' ?
|
|
127
|
-
/*#__PURE__*/
|
|
128
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
129
|
-
// eslint-disable-next-line react/no-danger
|
|
130
|
-
(0, _jsxRuntime.jsx)("span", {
|
|
128
|
+
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
129
|
+
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
131
130
|
className: "notranslate",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
}) : children
|
|
131
|
+
children: "\u200B"
|
|
132
|
+
})) : children
|
|
136
133
|
}));
|
|
137
134
|
});
|
|
138
135
|
process.env.NODE_ENV !== "production" ? FormHelperText.propTypes
|
package/node/Grid/Grid.js
CHANGED
|
@@ -286,10 +286,8 @@ const GridRoot = (0, _styled.default)('div', {
|
|
|
286
286
|
|
|
287
287
|
}, ownerState.zeroMinWidth && {
|
|
288
288
|
minWidth: 0
|
|
289
|
-
}, ownerState.wrap
|
|
290
|
-
flexWrap:
|
|
291
|
-
}, ownerState.wrap === 'reverse' && {
|
|
292
|
-
flexWrap: 'wrap-reverse'
|
|
289
|
+
}, ownerState.wrap !== 'wrap' && {
|
|
290
|
+
flexWrap: ownerState.wrap
|
|
293
291
|
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
294
292
|
|
|
295
293
|
const useUtilityClasses = ownerState => {
|
|
@@ -35,6 +35,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
35
35
|
|
|
36
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
37
|
|
|
38
|
+
var _span;
|
|
39
|
+
|
|
38
40
|
const _excluded = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"];
|
|
39
41
|
|
|
40
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -144,17 +146,11 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
|
|
|
144
146
|
children: children
|
|
145
147
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
146
148
|
children: [position === 'start' ?
|
|
147
|
-
/*#__PURE__*/
|
|
148
|
-
|
|
149
149
|
/* notranslate needed while Google Translate will not fix zero-width space issue */
|
|
150
|
-
|
|
151
|
-
/* eslint-disable-next-line react/no-danger */
|
|
152
|
-
(0, _jsxRuntime.jsx)("span", {
|
|
150
|
+
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
153
151
|
className: "notranslate",
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
}) : null, children]
|
|
152
|
+
children: "\u200B"
|
|
153
|
+
})) : null, children]
|
|
158
154
|
})
|
|
159
155
|
}))
|
|
160
156
|
});
|
|
@@ -19,6 +19,8 @@ var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
|
19
19
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
|
+
var _span;
|
|
23
|
+
|
|
22
24
|
const _excluded = ["children", "classes", "className", "label", "notched"];
|
|
23
25
|
|
|
24
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -41,14 +43,12 @@ const NotchedOutlineRoot = (0, _styled.default)('fieldset')({
|
|
|
41
43
|
overflow: 'hidden',
|
|
42
44
|
minWidth: '0%'
|
|
43
45
|
});
|
|
44
|
-
const NotchedOutlineLegend = (0, _styled.default)('legend'
|
|
45
|
-
skipSx: true
|
|
46
|
-
})(({
|
|
46
|
+
const NotchedOutlineLegend = (0, _styled.default)('legend')(({
|
|
47
47
|
ownerState,
|
|
48
48
|
theme
|
|
49
49
|
}) => (0, _extends2.default)({
|
|
50
50
|
float: 'unset'
|
|
51
|
-
}, ownerState.
|
|
51
|
+
}, !ownerState.withLabel && {
|
|
52
52
|
padding: 0,
|
|
53
53
|
lineHeight: '11px',
|
|
54
54
|
// sync with `height` in `legend` styles
|
|
@@ -56,7 +56,7 @@ const NotchedOutlineLegend = (0, _styled.default)('legend', {
|
|
|
56
56
|
duration: 150,
|
|
57
57
|
easing: theme.transitions.easing.easeOut
|
|
58
58
|
})
|
|
59
|
-
}, ownerState.
|
|
59
|
+
}, ownerState.withLabel && (0, _extends2.default)({
|
|
60
60
|
display: 'block',
|
|
61
61
|
// Fix conflict with normalize.css and sanitize.css
|
|
62
62
|
width: 'auto',
|
|
@@ -96,9 +96,10 @@ function NotchedOutline(props) {
|
|
|
96
96
|
notched
|
|
97
97
|
} = props,
|
|
98
98
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
99
|
+
const withLabel = label != null && label !== '';
|
|
99
100
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
100
101
|
notched,
|
|
101
|
-
|
|
102
|
+
withLabel
|
|
102
103
|
});
|
|
103
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedOutlineRoot, (0, _extends2.default)({
|
|
104
105
|
"aria-hidden": true,
|
|
@@ -107,18 +108,13 @@ function NotchedOutline(props) {
|
|
|
107
108
|
}, other, {
|
|
108
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedOutlineLegend, {
|
|
109
110
|
ownerState: ownerState,
|
|
110
|
-
children:
|
|
111
|
+
children: withLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
111
112
|
children: label
|
|
112
|
-
}) :
|
|
113
|
-
/*#__PURE__*/
|
|
114
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
115
|
-
// eslint-disable-next-line react/no-danger
|
|
116
|
-
(0, _jsxRuntime.jsx)("span", {
|
|
113
|
+
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
114
|
+
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
117
115
|
className: "notranslate",
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
})
|
|
116
|
+
children: "\u200B"
|
|
117
|
+
}))
|
|
122
118
|
})
|
|
123
119
|
}));
|
|
124
120
|
}
|
|
@@ -160,7 +160,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
160
160
|
}, components),
|
|
161
161
|
renderSuffix: state => /*#__PURE__*/(0, _jsxRuntime.jsx)(NotchedOutlineRoot, {
|
|
162
162
|
className: classes.notchedOutline,
|
|
163
|
-
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
163
|
+
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
164
164
|
children: [label, "\xA0", '*']
|
|
165
165
|
})) : label,
|
|
166
166
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
@@ -29,15 +29,11 @@ const RadioButtonIconRoot = (0, _styled.default)('span')({
|
|
|
29
29
|
position: 'relative',
|
|
30
30
|
display: 'flex'
|
|
31
31
|
});
|
|
32
|
-
const RadioButtonIconBackground = (0, _styled.default)(_RadioButtonUnchecked.default
|
|
33
|
-
skipSx: true
|
|
34
|
-
})({
|
|
32
|
+
const RadioButtonIconBackground = (0, _styled.default)(_RadioButtonUnchecked.default)({
|
|
35
33
|
// Scale applied to prevent dot misalignment in Safari
|
|
36
34
|
transform: 'scale(1)'
|
|
37
35
|
});
|
|
38
|
-
const RadioButtonIconDot = (0, _styled.default)(_RadioButtonChecked.default
|
|
39
|
-
skipSx: true
|
|
40
|
-
})(({
|
|
36
|
+
const RadioButtonIconDot = (0, _styled.default)(_RadioButtonChecked.default)(({
|
|
41
37
|
theme,
|
|
42
38
|
ownerState
|
|
43
39
|
}) => (0, _extends2.default)({
|
|
@@ -43,6 +43,8 @@ var _selectClasses = _interopRequireWildcard(require("./selectClasses"));
|
|
|
43
43
|
|
|
44
44
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
45
45
|
|
|
46
|
+
var _span;
|
|
47
|
+
|
|
46
48
|
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"];
|
|
47
49
|
|
|
48
50
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -509,16 +511,11 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
509
511
|
className: (0, _clsx.default)(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
510
512
|
,
|
|
511
513
|
id: buttonId,
|
|
512
|
-
children: isEmpty(display) ?
|
|
513
|
-
/*#__PURE__*/
|
|
514
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
515
|
-
// eslint-disable-next-line react/no-danger
|
|
516
|
-
(0, _jsxRuntime.jsx)("span", {
|
|
514
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
515
|
+
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
517
516
|
className: "notranslate",
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
}) : display
|
|
517
|
+
children: "\u200B"
|
|
518
|
+
})) : display
|
|
522
519
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectNativeInput, (0, _extends2.default)({
|
|
523
520
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
524
521
|
name: name,
|
|
@@ -31,9 +31,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
33
|
|
|
34
|
-
const SwipeAreaRoot = (0, _styled.default)('div'
|
|
35
|
-
skipSx: true
|
|
36
|
-
})(({
|
|
34
|
+
const SwipeAreaRoot = (0, _styled.default)('div')(({
|
|
37
35
|
theme,
|
|
38
36
|
ownerState
|
|
39
37
|
}) => (0, _extends2.default)({
|