@mui/material 5.2.3 → 5.2.4
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/autocompleteClasses.d.ts +54 -54
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Badge/Badge.js +16 -3
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +76 -76
- 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 +72 -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/CssBaseline/CssBaseline.d.ts +1 -1
- 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/formControlLabelClasses.d.ts +18 -18
- package/FormGroup/formGroupClasses.d.ts +10 -10
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/GlobalStyles/GlobalStyles.d.ts +2 -1
- package/Grid/Grid.js +74 -66
- 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/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.d.ts +6 -0
- package/InputBase/InputBase.js +10 -2
- 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/ListItem.d.ts +1 -1
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/ListItemButton.d.ts +1 -1
- 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/MenuItem.d.ts +1 -1
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/OutlinedInput.js +14 -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/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 +11 -3
- 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/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 +2 -9
- 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.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Badge/Badge.js +18 -4
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Grid/Grid.js +84 -78
- package/legacy/InputBase/InputBase.js +10 -2
- package/legacy/OutlinedInput/OutlinedInput.js +14 -1
- package/legacy/Select/SelectInput.js +11 -5
- package/legacy/TextField/TextField.js +2 -9
- package/legacy/index.js +1 -1
- package/locale/index.d.ts +66 -66
- package/modern/Badge/Badge.js +16 -3
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Grid/Grid.js +74 -66
- package/modern/InputBase/InputBase.js +10 -2
- package/modern/OutlinedInput/OutlinedInput.js +14 -1
- package/modern/Select/SelectInput.js +11 -3
- package/modern/TextField/TextField.js +2 -7
- package/modern/index.js +1 -1
- package/node/Badge/Badge.js +16 -3
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Grid/Grid.js +75 -65
- package/node/InputBase/InputBase.js +10 -2
- package/node/OutlinedInput/OutlinedInput.js +15 -1
- package/node/Select/SelectInput.js +11 -3
- package/node/TextField/TextField.js +1 -8
- package/node/index.js +1 -1
- package/package.json +3 -3
- package/styles/createTheme.d.ts +1 -1
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -14
- package/transitions/utils.d.ts +23 -23
- package/umd/material-ui.development.js +160 -114
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +27 -27
- 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
package/legacy/index.js
CHANGED
package/locale/index.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { ComponentsPropsList } from '../styles/props';
|
|
2
|
-
export interface Localization {
|
|
3
|
-
components?: {
|
|
4
|
-
MuiAlert?: {
|
|
5
|
-
defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
|
|
6
|
-
};
|
|
7
|
-
MuiBreadcrumbs?: {
|
|
8
|
-
defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
|
|
9
|
-
};
|
|
10
|
-
MuiTablePagination?: {
|
|
11
|
-
defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
|
|
12
|
-
};
|
|
13
|
-
MuiRating?: {
|
|
14
|
-
defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
|
|
15
|
-
};
|
|
16
|
-
MuiAutocomplete?: {
|
|
17
|
-
defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
|
|
18
|
-
};
|
|
19
|
-
MuiPagination?: {
|
|
20
|
-
defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const amET: Localization;
|
|
25
|
-
export declare const arEG: Localization;
|
|
26
|
-
export declare const arSD: Localization;
|
|
27
|
-
export declare const azAZ: Localization;
|
|
28
|
-
export declare const bnBD: Localization;
|
|
29
|
-
export declare const bgBG: Localization;
|
|
30
|
-
export declare const caES: Localization;
|
|
31
|
-
export declare const csCZ: Localization;
|
|
32
|
-
export declare const deDE: Localization;
|
|
33
|
-
export declare const elGR: Localization;
|
|
34
|
-
export declare const enUS: Localization;
|
|
35
|
-
export declare const esES: Localization;
|
|
36
|
-
export declare const etEE: Localization;
|
|
37
|
-
export declare const faIR: Localization;
|
|
38
|
-
export declare const fiFI: Localization;
|
|
39
|
-
export declare const frFR: Localization;
|
|
40
|
-
export declare const heIL: Localization;
|
|
41
|
-
export declare const hiIN: Localization;
|
|
42
|
-
export declare const huHU: Localization;
|
|
43
|
-
export declare const hyAM: Localization;
|
|
44
|
-
export declare const idID: Localization;
|
|
45
|
-
export declare const isIS: Localization;
|
|
46
|
-
export declare const itIT: Localization;
|
|
47
|
-
export declare const jaJP: Localization;
|
|
48
|
-
export declare const khKH: Localization;
|
|
49
|
-
export declare const koKR: Localization;
|
|
50
|
-
export declare const kzKZ: Localization;
|
|
51
|
-
export declare const nlNL: Localization;
|
|
52
|
-
export declare const plPL: Localization;
|
|
53
|
-
export declare const ptBR: Localization;
|
|
54
|
-
export declare const ptPT: Localization;
|
|
55
|
-
export declare const roRO: Localization;
|
|
56
|
-
export declare const ruRU: Localization;
|
|
57
|
-
export declare const siLK: Localization;
|
|
58
|
-
export declare const skSK: Localization;
|
|
59
|
-
export declare const svSE: Localization;
|
|
60
|
-
export declare const thTH: Localization;
|
|
61
|
-
export declare const trTR: Localization;
|
|
62
|
-
export declare const ukUA: Localization;
|
|
63
|
-
export declare const viVN: Localization;
|
|
64
|
-
export declare const zhCN: Localization;
|
|
65
|
-
export declare const zhHK: Localization;
|
|
66
|
-
export declare const zhTW: Localization;
|
|
1
|
+
import { ComponentsPropsList } from '../styles/props';
|
|
2
|
+
export interface Localization {
|
|
3
|
+
components?: {
|
|
4
|
+
MuiAlert?: {
|
|
5
|
+
defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
|
|
6
|
+
};
|
|
7
|
+
MuiBreadcrumbs?: {
|
|
8
|
+
defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
|
|
9
|
+
};
|
|
10
|
+
MuiTablePagination?: {
|
|
11
|
+
defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
|
|
12
|
+
};
|
|
13
|
+
MuiRating?: {
|
|
14
|
+
defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
|
|
15
|
+
};
|
|
16
|
+
MuiAutocomplete?: {
|
|
17
|
+
defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
|
|
18
|
+
};
|
|
19
|
+
MuiPagination?: {
|
|
20
|
+
defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const amET: Localization;
|
|
25
|
+
export declare const arEG: Localization;
|
|
26
|
+
export declare const arSD: Localization;
|
|
27
|
+
export declare const azAZ: Localization;
|
|
28
|
+
export declare const bnBD: Localization;
|
|
29
|
+
export declare const bgBG: Localization;
|
|
30
|
+
export declare const caES: Localization;
|
|
31
|
+
export declare const csCZ: Localization;
|
|
32
|
+
export declare const deDE: Localization;
|
|
33
|
+
export declare const elGR: Localization;
|
|
34
|
+
export declare const enUS: Localization;
|
|
35
|
+
export declare const esES: Localization;
|
|
36
|
+
export declare const etEE: Localization;
|
|
37
|
+
export declare const faIR: Localization;
|
|
38
|
+
export declare const fiFI: Localization;
|
|
39
|
+
export declare const frFR: Localization;
|
|
40
|
+
export declare const heIL: Localization;
|
|
41
|
+
export declare const hiIN: Localization;
|
|
42
|
+
export declare const huHU: Localization;
|
|
43
|
+
export declare const hyAM: Localization;
|
|
44
|
+
export declare const idID: Localization;
|
|
45
|
+
export declare const isIS: Localization;
|
|
46
|
+
export declare const itIT: Localization;
|
|
47
|
+
export declare const jaJP: Localization;
|
|
48
|
+
export declare const khKH: Localization;
|
|
49
|
+
export declare const koKR: Localization;
|
|
50
|
+
export declare const kzKZ: Localization;
|
|
51
|
+
export declare const nlNL: Localization;
|
|
52
|
+
export declare const plPL: Localization;
|
|
53
|
+
export declare const ptBR: Localization;
|
|
54
|
+
export declare const ptPT: Localization;
|
|
55
|
+
export declare const roRO: Localization;
|
|
56
|
+
export declare const ruRU: Localization;
|
|
57
|
+
export declare const siLK: Localization;
|
|
58
|
+
export declare const skSK: Localization;
|
|
59
|
+
export declare const svSE: Localization;
|
|
60
|
+
export declare const thTH: Localization;
|
|
61
|
+
export declare const trTR: Localization;
|
|
62
|
+
export declare const ukUA: Localization;
|
|
63
|
+
export declare const viVN: Localization;
|
|
64
|
+
export declare const zhCN: Localization;
|
|
65
|
+
export declare const zhHK: Localization;
|
|
66
|
+
export declare const zhTW: Localization;
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
3
|
+
const _excluded = ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -149,6 +149,11 @@ const BadgeBadge = styled('span', {
|
|
|
149
149
|
duration: theme.transitions.duration.leavingScreen
|
|
150
150
|
})
|
|
151
151
|
}));
|
|
152
|
+
|
|
153
|
+
const shouldSpreadAdditionalProps = Slot => {
|
|
154
|
+
return !Slot || !isHostComponent(Slot);
|
|
155
|
+
};
|
|
156
|
+
|
|
152
157
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
153
158
|
const props = useThemeProps({
|
|
154
159
|
props: inProps,
|
|
@@ -156,6 +161,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
156
161
|
});
|
|
157
162
|
|
|
158
163
|
const {
|
|
164
|
+
component = 'span',
|
|
159
165
|
components = {},
|
|
160
166
|
componentsProps = {},
|
|
161
167
|
color: colorProp = 'default',
|
|
@@ -196,12 +202,13 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
196
202
|
Badge: BadgeBadge
|
|
197
203
|
}, components),
|
|
198
204
|
componentsProps: {
|
|
199
|
-
root: _extends({}, componentsProps.root, (
|
|
205
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
206
|
+
as: component,
|
|
200
207
|
ownerState: _extends({}, componentsProps.root?.ownerState, {
|
|
201
208
|
color
|
|
202
209
|
})
|
|
203
210
|
}),
|
|
204
|
-
badge: _extends({}, componentsProps.badge, (
|
|
211
|
+
badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
|
|
205
212
|
ownerState: _extends({}, componentsProps.badge?.ownerState, {
|
|
206
213
|
color
|
|
207
214
|
})
|
|
@@ -254,6 +261,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
254
261
|
/* @typescript-to-proptypes-ignore */
|
|
255
262
|
.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
256
263
|
|
|
264
|
+
/**
|
|
265
|
+
* The component used for the root node.
|
|
266
|
+
* Either a string to use a HTML element or a component.
|
|
267
|
+
*/
|
|
268
|
+
component: PropTypes.elementType,
|
|
269
|
+
|
|
257
270
|
/**
|
|
258
271
|
* The components used for each slot inside the Badge.
|
|
259
272
|
* Either a string to use a HTML element or a component.
|
|
File without changes
|
package/modern/Grid/Grid.js
CHANGED
|
@@ -28,69 +28,84 @@ function getOffset(val) {
|
|
|
28
28
|
return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function generateGrid(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (size === true) {
|
|
41
|
-
// For the auto layouting
|
|
42
|
-
styles = {
|
|
43
|
-
flexBasis: 0,
|
|
44
|
-
flexGrow: 1,
|
|
45
|
-
maxWidth: '100%'
|
|
46
|
-
};
|
|
47
|
-
} else if (size === 'auto') {
|
|
48
|
-
styles = {
|
|
49
|
-
flexBasis: 'auto',
|
|
50
|
-
flexGrow: 0,
|
|
51
|
-
flexShrink: 0,
|
|
52
|
-
maxWidth: 'none',
|
|
53
|
-
width: 'auto'
|
|
54
|
-
};
|
|
55
|
-
} else {
|
|
56
|
-
const columnsBreakpointValues = resolveBreakpointValues({
|
|
57
|
-
values: ownerState.columns,
|
|
58
|
-
breakpoints: theme.breakpoints.values
|
|
59
|
-
});
|
|
60
|
-
const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues; // Keep 7 significant numbers.
|
|
61
|
-
|
|
62
|
-
const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
|
|
63
|
-
let more = {};
|
|
64
|
-
|
|
65
|
-
if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
|
|
66
|
-
const themeSpacing = theme.spacing(ownerState.columnSpacing);
|
|
67
|
-
|
|
68
|
-
if (themeSpacing !== '0px') {
|
|
69
|
-
const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
|
|
70
|
-
more = {
|
|
71
|
-
flexBasis: fullWidth,
|
|
72
|
-
maxWidth: fullWidth
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
} // Close to the bootstrap implementation:
|
|
76
|
-
// https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
|
|
31
|
+
export function generateGrid({
|
|
32
|
+
theme,
|
|
33
|
+
ownerState
|
|
34
|
+
}) {
|
|
35
|
+
let size;
|
|
36
|
+
return theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
|
|
37
|
+
// Use side effect over immutability for better performance.
|
|
38
|
+
let styles = {};
|
|
77
39
|
|
|
40
|
+
if (ownerState[breakpoint]) {
|
|
41
|
+
size = ownerState[breakpoint];
|
|
42
|
+
}
|
|
78
43
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
maxWidth: width
|
|
83
|
-
}, more);
|
|
84
|
-
} // No need for a media query for the first size.
|
|
44
|
+
if (!size) {
|
|
45
|
+
return globalStyles;
|
|
46
|
+
}
|
|
85
47
|
|
|
48
|
+
if (size === true) {
|
|
49
|
+
// For the auto layouting
|
|
50
|
+
styles = {
|
|
51
|
+
flexBasis: 0,
|
|
52
|
+
flexGrow: 1,
|
|
53
|
+
maxWidth: '100%'
|
|
54
|
+
};
|
|
55
|
+
} else if (size === 'auto') {
|
|
56
|
+
styles = {
|
|
57
|
+
flexBasis: 'auto',
|
|
58
|
+
flexGrow: 0,
|
|
59
|
+
flexShrink: 0,
|
|
60
|
+
maxWidth: 'none',
|
|
61
|
+
width: 'auto'
|
|
62
|
+
};
|
|
63
|
+
} else {
|
|
64
|
+
const columnsBreakpointValues = resolveBreakpointValues({
|
|
65
|
+
values: ownerState.columns,
|
|
66
|
+
breakpoints: theme.breakpoints.values
|
|
67
|
+
});
|
|
68
|
+
const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues;
|
|
69
|
+
|
|
70
|
+
if (columnValue === undefined || columnValue === null) {
|
|
71
|
+
return globalStyles;
|
|
72
|
+
} // Keep 7 significant numbers.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
|
|
76
|
+
let more = {};
|
|
77
|
+
|
|
78
|
+
if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
|
|
79
|
+
const themeSpacing = theme.spacing(ownerState.columnSpacing);
|
|
80
|
+
|
|
81
|
+
if (themeSpacing !== '0px') {
|
|
82
|
+
const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
|
|
83
|
+
more = {
|
|
84
|
+
flexBasis: fullWidth,
|
|
85
|
+
maxWidth: fullWidth
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
} // Close to the bootstrap implementation:
|
|
89
|
+
// https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
styles = _extends({
|
|
93
|
+
flexBasis: width,
|
|
94
|
+
flexGrow: 0,
|
|
95
|
+
maxWidth: width
|
|
96
|
+
}, more);
|
|
97
|
+
} // No need for a media query for the first size.
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if (theme.breakpoints.values[breakpoint] === 0) {
|
|
101
|
+
Object.assign(globalStyles, styles);
|
|
102
|
+
} else {
|
|
103
|
+
globalStyles[theme.breakpoints.up(breakpoint)] = styles;
|
|
104
|
+
}
|
|
86
105
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} else {
|
|
90
|
-
globalStyles[theme.breakpoints.up(breakpoint)] = styles;
|
|
91
|
-
}
|
|
106
|
+
return globalStyles;
|
|
107
|
+
}, {});
|
|
92
108
|
}
|
|
93
|
-
|
|
94
109
|
export function generateDirection({
|
|
95
110
|
theme,
|
|
96
111
|
ownerState
|
|
@@ -249,14 +264,7 @@ const GridRoot = styled('div', {
|
|
|
249
264
|
flexWrap: 'nowrap'
|
|
250
265
|
}, ownerState.wrap === 'reverse' && {
|
|
251
266
|
flexWrap: 'wrap-reverse'
|
|
252
|
-
}), generateDirection, generateRowGap, generateColumnGap,
|
|
253
|
-
theme,
|
|
254
|
-
ownerState
|
|
255
|
-
}) => theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
|
|
256
|
-
// Use side effect over immutability for better performance.
|
|
257
|
-
generateGrid(globalStyles, theme, breakpoint, ownerState);
|
|
258
|
-
return globalStyles;
|
|
259
|
-
}, {}));
|
|
267
|
+
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
260
268
|
|
|
261
269
|
const useUtilityClasses = ownerState => {
|
|
262
270
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
|
-
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
|
|
4
|
+
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -220,6 +220,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
220
220
|
componentsProps = {},
|
|
221
221
|
defaultValue,
|
|
222
222
|
disabled,
|
|
223
|
+
disableInjectingGlobalStyles,
|
|
223
224
|
endAdornment,
|
|
224
225
|
fullWidth = false,
|
|
225
226
|
id,
|
|
@@ -450,7 +451,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
450
451
|
const Input = components.Input || InputBaseComponent;
|
|
451
452
|
inputProps = _extends({}, inputProps, componentsProps.input);
|
|
452
453
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
453
|
-
children: [inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
454
|
+
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
454
455
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
455
456
|
}, {
|
|
456
457
|
ref: ref,
|
|
@@ -564,6 +565,13 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
564
565
|
*/
|
|
565
566
|
disabled: PropTypes.bool,
|
|
566
567
|
|
|
568
|
+
/**
|
|
569
|
+
* If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
|
|
570
|
+
* This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
|
|
571
|
+
* @default false
|
|
572
|
+
*/
|
|
573
|
+
disableInjectingGlobalStyles: PropTypes.bool,
|
|
574
|
+
|
|
567
575
|
/**
|
|
568
576
|
* End `InputAdornment` for this component.
|
|
569
577
|
*/
|
|
@@ -6,10 +6,13 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { refType } from '@mui/utils';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
8
8
|
import NotchedOutline from './NotchedOutline';
|
|
9
|
+
import useFormControl from '../FormControl/useFormControl';
|
|
10
|
+
import formControlState from '../FormControl/formControlState';
|
|
9
11
|
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
10
12
|
import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
|
|
11
13
|
import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseComponent as InputBaseInput } from '../InputBase/InputBase';
|
|
12
14
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
17
|
|
|
15
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -101,6 +104,8 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
101
104
|
paddingRight: 0
|
|
102
105
|
}));
|
|
103
106
|
const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
107
|
+
var _React$Fragment;
|
|
108
|
+
|
|
104
109
|
const props = useThemeProps({
|
|
105
110
|
props: inProps,
|
|
106
111
|
name: 'MuiOutlinedInput'
|
|
@@ -118,6 +123,12 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
118
123
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
119
124
|
|
|
120
125
|
const classes = useUtilityClasses(props);
|
|
126
|
+
const muiFormControl = useFormControl();
|
|
127
|
+
const fcs = formControlState({
|
|
128
|
+
props,
|
|
129
|
+
muiFormControl,
|
|
130
|
+
states: ['required']
|
|
131
|
+
});
|
|
121
132
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
122
133
|
components: _extends({
|
|
123
134
|
Root: OutlinedInputRoot,
|
|
@@ -125,7 +136,9 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
125
136
|
}, components),
|
|
126
137
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
127
138
|
className: classes.notchedOutline,
|
|
128
|
-
label: label,
|
|
139
|
+
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
140
|
+
children: [label, "\xA0", '*']
|
|
141
|
+
})) : label,
|
|
129
142
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
130
143
|
}),
|
|
131
144
|
fullWidth: fullWidth,
|
|
@@ -405,10 +405,18 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
405
405
|
|
|
406
406
|
if (computeDisplay) {
|
|
407
407
|
if (multiple) {
|
|
408
|
-
if (
|
|
409
|
-
display =
|
|
408
|
+
if (displayMultiple.length === 0) {
|
|
409
|
+
display = null;
|
|
410
410
|
} else {
|
|
411
|
-
display = displayMultiple.reduce((
|
|
411
|
+
display = displayMultiple.reduce((output, child, index) => {
|
|
412
|
+
output.push(child);
|
|
413
|
+
|
|
414
|
+
if (index < displayMultiple.length - 1) {
|
|
415
|
+
output.push(', ');
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return output;
|
|
419
|
+
}, []);
|
|
412
420
|
}
|
|
413
421
|
} else {
|
|
414
422
|
display = displaySingle;
|
|
@@ -16,8 +16,8 @@ import FormControl from '../FormControl';
|
|
|
16
16
|
import FormHelperText from '../FormHelperText';
|
|
17
17
|
import Select from '../Select';
|
|
18
18
|
import { getTextFieldUtilityClass } from './textFieldClasses';
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
21
|
const variantComponent = {
|
|
22
22
|
standard: Input,
|
|
23
23
|
filled: FilledInput,
|
|
@@ -141,12 +141,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
141
141
|
InputMore.notched = InputLabelProps.shrink;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
const displayRequired = InputLabelProps?.required ?? required;
|
|
146
|
-
InputMore.label = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
147
|
-
children: [label, displayRequired && '\u00a0*']
|
|
148
|
-
});
|
|
149
|
-
}
|
|
144
|
+
InputMore.label = label;
|
|
150
145
|
}
|
|
151
146
|
|
|
152
147
|
if (select) {
|
package/modern/index.js
CHANGED
package/node/Badge/Badge.js
CHANGED
|
@@ -31,7 +31,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
|
31
31
|
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
|
|
34
|
-
const _excluded = ["components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
34
|
+
const _excluded = ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
|
|
35
35
|
|
|
36
36
|
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); }
|
|
37
37
|
|
|
@@ -176,6 +176,11 @@ const BadgeBadge = (0, _styled.default)('span', {
|
|
|
176
176
|
duration: theme.transitions.duration.leavingScreen
|
|
177
177
|
})
|
|
178
178
|
}));
|
|
179
|
+
|
|
180
|
+
const shouldSpreadAdditionalProps = Slot => {
|
|
181
|
+
return !Slot || !(0, _base.isHostComponent)(Slot);
|
|
182
|
+
};
|
|
183
|
+
|
|
179
184
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
180
185
|
var _componentsProps$root, _componentsProps$badg;
|
|
181
186
|
|
|
@@ -184,6 +189,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
184
189
|
name: 'MuiBadge'
|
|
185
190
|
});
|
|
186
191
|
const {
|
|
192
|
+
component = 'span',
|
|
187
193
|
components = {},
|
|
188
194
|
componentsProps = {},
|
|
189
195
|
color: colorProp = 'default',
|
|
@@ -221,12 +227,13 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
221
227
|
Badge: BadgeBadge
|
|
222
228
|
}, components),
|
|
223
229
|
componentsProps: {
|
|
224
|
-
root: (0, _extends2.default)({}, componentsProps.root, (
|
|
230
|
+
root: (0, _extends2.default)({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
231
|
+
as: component,
|
|
225
232
|
ownerState: (0, _extends2.default)({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
226
233
|
color
|
|
227
234
|
})
|
|
228
235
|
}),
|
|
229
|
-
badge: (0, _extends2.default)({}, componentsProps.badge, (
|
|
236
|
+
badge: (0, _extends2.default)({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
|
|
230
237
|
ownerState: (0, _extends2.default)({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
|
|
231
238
|
color
|
|
232
239
|
})
|
|
@@ -279,6 +286,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
279
286
|
/* @typescript-to-proptypes-ignore */
|
|
280
287
|
.oneOfType([_propTypes.default.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),
|
|
281
288
|
|
|
289
|
+
/**
|
|
290
|
+
* The component used for the root node.
|
|
291
|
+
* Either a string to use a HTML element or a component.
|
|
292
|
+
*/
|
|
293
|
+
component: _propTypes.default.elementType,
|
|
294
|
+
|
|
282
295
|
/**
|
|
283
296
|
* The components used for each slot inside the Badge.
|
|
284
297
|
* Either a string to use a HTML element or a component.
|
|
File without changes
|