@mui/material 6.0.0-alpha.4 → 6.0.0-alpha.6
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/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +2 -2
- package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +2 -2
- package/Alert/alertClasses.d.ts +12 -12
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Backdrop/Backdrop.js +1 -1
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +2 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/Button/Button.js +1 -1
- package/Button/buttonClasses.d.ts +33 -33
- package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/CHANGELOG.md +86 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- package/Collapse/Collapse.js +66 -35
- package/Dialog/Dialog.js +105 -61
- package/DialogActions/DialogActions.js +16 -12
- package/DialogContent/DialogContent.js +25 -15
- package/DialogContentText/DialogContentText.js +3 -2
- package/DialogTitle/DialogTitle.js +2 -2
- package/Divider/Divider.d.ts +1 -1
- package/Divider/Divider.js +1 -1
- package/Drawer/Drawer.js +73 -32
- package/Fab/Fab.js +1 -1
- package/FilledInput/FilledInput.d.ts +1 -0
- package/FilledInput/FilledInput.js +170 -87
- package/FormControlLabel/FormControlLabel.d.ts +21 -14
- package/FormControlLabel/FormControlLabel.js +22 -4
- package/FormHelperText/FormHelperText.js +2 -2
- package/FormLabel/FormLabel.js +23 -13
- package/Grow/Grow.js +3 -1
- package/Icon/Icon.js +63 -23
- package/ImageList/ImageList.js +2 -2
- package/ImageListItem/ImageListItem.js +2 -2
- package/ImageListItemBar/ImageListItemBar.js +2 -2
- package/Input/Input.d.ts +1 -0
- package/Input/Input.js +84 -61
- package/InputAdornment/InputAdornment.js +37 -21
- package/InputBase/InputBase.js +58 -28
- package/InputLabel/InputLabel.js +120 -58
- package/Link/Link.js +99 -54
- package/Link/getTextDecoration.d.ts +2 -8
- package/Link/getTextDecoration.js +16 -8
- package/List/List.js +22 -13
- package/ListItem/ListItem.js +2 -2
- package/ListItemAvatar/ListItemAvatar.js +2 -2
- package/ListItemButton/ListItemButton.js +3 -2
- package/ListItemIcon/ListItemIcon.js +14 -9
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/ListItemText/ListItemText.js +2 -2
- package/ListSubheader/ListSubheader.js +5 -3
- package/Menu/Menu.js +3 -2
- package/MenuItem/MenuItem.js +47 -27
- package/NativeSelect/NativeSelectInput.js +78 -49
- package/OutlinedInput/NotchedOutline.js +60 -43
- package/OutlinedInput/OutlinedInput.js +97 -39
- package/Pagination/Pagination.js +2 -2
- package/PaginationItem/PaginationItem.d.ts +26 -14
- package/PaginationItem/PaginationItem.js +64 -20
- package/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/Paper/Paper.js +44 -21
- package/Radio/Radio.js +5 -3
- package/Radio/RadioButtonIcon.js +1 -1
- package/Rating/Rating.js +3 -2
- package/Select/Select.js +2 -1
- package/Select/SelectInput.js +8 -6
- package/Skeleton/Skeleton.js +109 -61
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.js +66 -40
- package/SnackbarContent/SnackbarContent.js +2 -2
- package/SpeedDial/SpeedDial.d.ts +28 -1
- package/SpeedDial/SpeedDial.js +107 -49
- package/SpeedDialAction/SpeedDialAction.js +50 -24
- package/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/StepLabel/StepLabel.d.ts +3 -3
- package/StepLabel/StepLabel.js +3 -3
- package/SvgIcon/SvgIcon.js +73 -21
- package/SwipeableDrawer/SwipeArea.js +39 -18
- package/Tab/Tab.js +127 -55
- package/TabScrollButton/TabScrollButton.js +27 -15
- package/Table/Table.js +2 -2
- package/TableBody/TableBody.js +2 -2
- package/TableCell/TableCell.js +2 -2
- package/TableContainer/TableContainer.js +2 -2
- package/TableFooter/TableFooter.js +2 -2
- package/TableHead/TableHead.js +2 -2
- package/TablePagination/TablePagination.js +2 -2
- package/TableRow/TableRow.js +2 -2
- package/TableSortLabel/TableSortLabel.js +2 -2
- package/Tabs/Tabs.js +107 -54
- package/TextField/TextField.js +2 -2
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
- package/Toolbar/Toolbar.js +3 -7
- package/Tooltip/Tooltip.js +185 -88
- package/Typography/Typography.js +89 -39
- package/index.js +1 -1
- package/internal/SwitchBase.js +39 -11
- package/modern/Accordion/Accordion.js +2 -2
- package/modern/Alert/Alert.js +2 -2
- package/modern/Avatar/Avatar.js +1 -1
- package/modern/Backdrop/Backdrop.js +1 -1
- package/modern/Badge/Badge.js +2 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/modern/Button/Button.js +1 -1
- package/modern/Checkbox/Checkbox.js +3 -1
- package/modern/Chip/chipClasses.js +1 -1
- package/modern/Collapse/Collapse.js +66 -35
- package/modern/Dialog/Dialog.js +105 -61
- package/modern/DialogActions/DialogActions.js +16 -12
- package/modern/DialogContent/DialogContent.js +25 -15
- package/modern/DialogContentText/DialogContentText.js +3 -2
- package/modern/DialogTitle/DialogTitle.js +2 -2
- package/modern/Divider/Divider.js +1 -1
- package/modern/Drawer/Drawer.js +73 -32
- package/modern/Fab/Fab.js +1 -1
- package/modern/FilledInput/FilledInput.js +170 -87
- package/modern/FormControlLabel/FormControlLabel.js +22 -4
- package/modern/FormHelperText/FormHelperText.js +2 -2
- package/modern/FormLabel/FormLabel.js +23 -13
- package/modern/Grow/Grow.js +3 -1
- package/modern/Icon/Icon.js +63 -23
- package/modern/ImageList/ImageList.js +2 -2
- package/modern/ImageListItem/ImageListItem.js +2 -2
- package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
- package/modern/Input/Input.js +84 -61
- package/modern/InputAdornment/InputAdornment.js +37 -21
- package/modern/InputBase/InputBase.js +58 -28
- package/modern/InputLabel/InputLabel.js +120 -58
- package/modern/Link/Link.js +99 -54
- package/modern/Link/getTextDecoration.js +16 -8
- package/modern/List/List.js +22 -13
- package/modern/ListItem/ListItem.js +2 -2
- package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
- package/modern/ListItemButton/ListItemButton.js +3 -2
- package/modern/ListItemIcon/ListItemIcon.js +14 -9
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/modern/ListItemText/ListItemText.js +2 -2
- package/modern/ListSubheader/ListSubheader.js +5 -3
- package/modern/Menu/Menu.js +3 -2
- package/modern/MenuItem/MenuItem.js +47 -27
- package/modern/NativeSelect/NativeSelectInput.js +78 -49
- package/modern/OutlinedInput/NotchedOutline.js +60 -43
- package/modern/OutlinedInput/OutlinedInput.js +97 -39
- package/modern/Pagination/Pagination.js +2 -2
- package/modern/PaginationItem/PaginationItem.js +64 -20
- package/modern/Paper/Paper.js +44 -21
- package/modern/Radio/Radio.js +5 -3
- package/modern/Radio/RadioButtonIcon.js +1 -1
- package/modern/Rating/Rating.js +3 -2
- package/modern/Select/Select.js +2 -1
- package/modern/Select/SelectInput.js +8 -6
- package/modern/Skeleton/Skeleton.js +109 -61
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +66 -40
- package/modern/SnackbarContent/SnackbarContent.js +2 -2
- package/modern/SpeedDial/SpeedDial.js +107 -49
- package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
- package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/modern/StepLabel/StepLabel.js +3 -3
- package/modern/SvgIcon/SvgIcon.js +73 -21
- package/modern/SwipeableDrawer/SwipeArea.js +39 -18
- package/modern/Tab/Tab.js +127 -55
- package/modern/TabScrollButton/TabScrollButton.js +27 -15
- package/modern/Table/Table.js +2 -2
- package/modern/TableBody/TableBody.js +2 -2
- package/modern/TableCell/TableCell.js +2 -2
- package/modern/TableContainer/TableContainer.js +2 -2
- package/modern/TableFooter/TableFooter.js +2 -2
- package/modern/TableHead/TableHead.js +2 -2
- package/modern/TablePagination/TablePagination.js +2 -2
- package/modern/TableRow/TableRow.js +2 -2
- package/modern/TableSortLabel/TableSortLabel.js +2 -2
- package/modern/Tabs/Tabs.js +107 -54
- package/modern/TextField/TextField.js +2 -2
- package/modern/Toolbar/Toolbar.js +3 -7
- package/modern/Tooltip/Tooltip.js +185 -88
- package/modern/Typography/Typography.js +89 -39
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +39 -11
- package/node/Accordion/Accordion.js +2 -2
- package/node/Alert/Alert.js +2 -2
- package/node/Avatar/Avatar.js +1 -1
- package/node/Backdrop/Backdrop.js +1 -1
- package/node/Badge/Badge.js +2 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
- package/node/Button/Button.js +2 -2
- package/node/Checkbox/Checkbox.js +3 -1
- package/node/Chip/chipClasses.js +1 -1
- package/node/Collapse/Collapse.js +70 -39
- package/node/Dialog/Dialog.js +110 -66
- package/node/DialogActions/DialogActions.js +18 -14
- package/node/DialogContent/DialogContent.js +27 -17
- package/node/DialogContentText/DialogContentText.js +6 -5
- package/node/DialogTitle/DialogTitle.js +4 -4
- package/node/Divider/Divider.js +1 -1
- package/node/Drawer/Drawer.js +78 -37
- package/node/Fab/Fab.js +2 -2
- package/node/FilledInput/FilledInput.js +176 -91
- package/node/FormControlLabel/FormControlLabel.js +23 -5
- package/node/FormHelperText/FormHelperText.js +4 -4
- package/node/FormLabel/FormLabel.js +26 -16
- package/node/Grow/Grow.js +3 -1
- package/node/Icon/Icon.js +65 -25
- package/node/ImageList/ImageList.js +4 -4
- package/node/ImageListItem/ImageListItem.js +4 -4
- package/node/ImageListItemBar/ImageListItemBar.js +8 -8
- package/node/Input/Input.js +87 -64
- package/node/InputAdornment/InputAdornment.js +39 -23
- package/node/InputBase/InputBase.js +61 -31
- package/node/InputLabel/InputLabel.js +123 -61
- package/node/Link/Link.js +101 -56
- package/node/Link/getTextDecoration.js +18 -10
- package/node/List/List.js +24 -15
- package/node/ListItem/ListItem.js +5 -5
- package/node/ListItemAvatar/ListItemAvatar.js +4 -4
- package/node/ListItemButton/ListItemButton.js +6 -5
- package/node/ListItemIcon/ListItemIcon.js +16 -11
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
- package/node/ListItemText/ListItemText.js +4 -4
- package/node/ListSubheader/ListSubheader.js +7 -5
- package/node/Menu/Menu.js +8 -7
- package/node/MenuItem/MenuItem.js +50 -30
- package/node/NativeSelect/NativeSelectInput.js +80 -53
- package/node/OutlinedInput/NotchedOutline.js +64 -47
- package/node/OutlinedInput/OutlinedInput.js +101 -43
- package/node/Pagination/Pagination.js +5 -5
- package/node/PaginationItem/PaginationItem.js +65 -20
- package/node/Paper/Paper.js +49 -28
- package/node/Radio/Radio.js +6 -4
- package/node/Radio/RadioButtonIcon.js +2 -2
- package/node/Rating/Rating.js +9 -8
- package/node/Select/Select.js +6 -5
- package/node/Select/SelectInput.js +9 -7
- package/node/Skeleton/Skeleton.js +113 -65
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +68 -42
- package/node/SnackbarContent/SnackbarContent.js +6 -6
- package/node/SpeedDial/SpeedDial.js +111 -53
- package/node/SpeedDialAction/SpeedDialAction.js +54 -28
- package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
- package/node/StepLabel/StepLabel.js +3 -3
- package/node/SvgIcon/SvgIcon.js +79 -24
- package/node/SwipeableDrawer/SwipeArea.js +41 -20
- package/node/Tab/Tab.js +129 -57
- package/node/TabScrollButton/TabScrollButton.js +29 -17
- package/node/Table/Table.js +4 -4
- package/node/TableBody/TableBody.js +4 -4
- package/node/TableCell/TableCell.js +4 -4
- package/node/TableContainer/TableContainer.js +4 -4
- package/node/TableFooter/TableFooter.js +4 -4
- package/node/TableHead/TableHead.js +4 -4
- package/node/TablePagination/TablePagination.js +10 -10
- package/node/TableRow/TableRow.js +4 -4
- package/node/TableSortLabel/TableSortLabel.js +5 -5
- package/node/Tabs/Tabs.js +113 -60
- package/node/TextField/TextField.js +4 -4
- package/node/Toolbar/Toolbar.js +5 -9
- package/node/Tooltip/Tooltip.js +189 -92
- package/node/Typography/Typography.js +90 -40
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +41 -13
- package/package.json +6 -6
- package/umd/material-ui.development.js +2777 -1334
- package/umd/material-ui.production.min.js +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -10,7 +10,8 @@ import refType from '@mui/utils/refType';
|
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import capitalize from '../utils/capitalize';
|
|
12
12
|
import nativeSelectClasses, { getNativeSelectUtilityClasses } from './nativeSelectClasses';
|
|
13
|
-
import
|
|
13
|
+
import { styled } from '../zero-styled';
|
|
14
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
const useUtilityClasses = ownerState => {
|
|
16
17
|
const {
|
|
@@ -27,27 +28,23 @@ const useUtilityClasses = ownerState => {
|
|
|
27
28
|
};
|
|
28
29
|
return composeClasses(slots, getNativeSelectUtilityClasses, classes);
|
|
29
30
|
};
|
|
30
|
-
export const
|
|
31
|
-
ownerState,
|
|
31
|
+
export const StyledSelectSelect = styled('select')(({
|
|
32
32
|
theme
|
|
33
|
-
}) =>
|
|
33
|
+
}) => ({
|
|
34
|
+
// Reset
|
|
34
35
|
MozAppearance: 'none',
|
|
35
36
|
// Reset
|
|
36
37
|
WebkitAppearance: 'none',
|
|
37
|
-
// Reset
|
|
38
38
|
// When interacting quickly, the text can end up selected.
|
|
39
39
|
// Native select can't be selected either.
|
|
40
40
|
userSelect: 'none',
|
|
41
|
-
borderRadius: 0,
|
|
42
41
|
// Reset
|
|
42
|
+
borderRadius: 0,
|
|
43
43
|
cursor: 'pointer',
|
|
44
|
-
'&:focus':
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, {
|
|
49
|
-
borderRadius: 0 // Reset Chrome style
|
|
50
|
-
}),
|
|
44
|
+
'&:focus': {
|
|
45
|
+
// Reset Chrome style
|
|
46
|
+
borderRadius: 0
|
|
47
|
+
},
|
|
51
48
|
// Remove IE11 arrow
|
|
52
49
|
'&::-ms-expand': {
|
|
53
50
|
display: 'none'
|
|
@@ -61,25 +58,42 @@ export const nativeSelectSelectStyles = ({
|
|
|
61
58
|
'&:not([multiple]) option, &:not([multiple]) optgroup': {
|
|
62
59
|
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
63
60
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
variants: [{
|
|
62
|
+
props: ({
|
|
63
|
+
ownerState
|
|
64
|
+
}) => ownerState.variant !== 'filled' && ownerState.variant !== 'outlined',
|
|
65
|
+
style: {
|
|
66
|
+
// Bump specificity to allow extending custom inputs
|
|
67
|
+
'&&&': {
|
|
68
|
+
paddingRight: 24,
|
|
69
|
+
minWidth: 16 // So it doesn't collapse.
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
props: {
|
|
74
|
+
variant: 'filled'
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
'&&&': {
|
|
78
|
+
paddingRight: 32
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
props: {
|
|
83
|
+
variant: 'outlined'
|
|
84
|
+
},
|
|
85
|
+
style: {
|
|
86
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
87
|
+
'&:focus': {
|
|
88
|
+
borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
|
|
89
|
+
},
|
|
90
|
+
'&&&': {
|
|
91
|
+
paddingRight: 32
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}]
|
|
95
|
+
}));
|
|
96
|
+
const NativeSelectSelect = styled(StyledSelectSelect, {
|
|
83
97
|
name: 'MuiNativeSelect',
|
|
84
98
|
slot: 'Select',
|
|
85
99
|
shouldForwardProp: rootShouldForwardProp,
|
|
@@ -91,31 +105,46 @@ const NativeSelectSelect = styled('select', {
|
|
|
91
105
|
[`&.${nativeSelectClasses.multiple}`]: styles.multiple
|
|
92
106
|
}];
|
|
93
107
|
}
|
|
94
|
-
})(
|
|
95
|
-
export const
|
|
96
|
-
ownerState,
|
|
108
|
+
})({});
|
|
109
|
+
export const StyledSelectIcon = styled('svg')(({
|
|
97
110
|
theme
|
|
98
|
-
}) =>
|
|
111
|
+
}) => ({
|
|
99
112
|
// We use a position absolute over a flexbox in order to forward the pointer events
|
|
100
113
|
// to the input and to support wrapping tags..
|
|
101
114
|
position: 'absolute',
|
|
102
115
|
right: 0,
|
|
103
|
-
top: 'calc(50% - .5em)',
|
|
104
116
|
// Center vertically, height is 1em
|
|
105
|
-
|
|
117
|
+
top: 'calc(50% - .5em)',
|
|
106
118
|
// Don't block pointer events on the select under the icon.
|
|
119
|
+
pointerEvents: 'none',
|
|
107
120
|
color: (theme.vars || theme).palette.action.active,
|
|
108
121
|
[`&.${nativeSelectClasses.disabled}`]: {
|
|
109
122
|
color: (theme.vars || theme).palette.action.disabled
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
123
|
+
},
|
|
124
|
+
variants: [{
|
|
125
|
+
props: ({
|
|
126
|
+
ownerState
|
|
127
|
+
}) => ownerState.open,
|
|
128
|
+
style: {
|
|
129
|
+
transform: 'rotate(180deg)'
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
props: {
|
|
133
|
+
variant: 'filled'
|
|
134
|
+
},
|
|
135
|
+
style: {
|
|
136
|
+
right: 7
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
props: {
|
|
140
|
+
variant: 'outlined'
|
|
141
|
+
},
|
|
142
|
+
style: {
|
|
143
|
+
right: 7
|
|
144
|
+
}
|
|
145
|
+
}]
|
|
146
|
+
}));
|
|
147
|
+
const NativeSelectIcon = styled(StyledSelectIcon, {
|
|
119
148
|
name: 'MuiNativeSelect',
|
|
120
149
|
slot: 'Icon',
|
|
121
150
|
overridesResolver: (props, styles) => {
|
|
@@ -124,7 +153,7 @@ const NativeSelectIcon = styled('svg', {
|
|
|
124
153
|
} = props;
|
|
125
154
|
return [styles.icon, ownerState.variant && styles[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles.iconOpen];
|
|
126
155
|
}
|
|
127
|
-
})(
|
|
156
|
+
})({});
|
|
128
157
|
|
|
129
158
|
/**
|
|
130
159
|
* @ignore - internal component.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
var _span;
|
|
6
6
|
const _excluded = ["children", "classes", "className", "label", "notched"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import
|
|
9
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
10
|
+
import { styled } from '../zero-styled';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
const NotchedOutlineRoot = styled('fieldset', {
|
|
12
13
|
shouldForwardProp: rootShouldForwardProp
|
|
@@ -29,51 +30,67 @@ const NotchedOutlineRoot = styled('fieldset', {
|
|
|
29
30
|
const NotchedOutlineLegend = styled('legend', {
|
|
30
31
|
shouldForwardProp: rootShouldForwardProp
|
|
31
32
|
})(({
|
|
32
|
-
ownerState,
|
|
33
33
|
theme
|
|
34
|
-
}) =>
|
|
34
|
+
}) => ({
|
|
35
35
|
float: 'unset',
|
|
36
36
|
// Fix conflict with bootstrap
|
|
37
37
|
width: 'auto',
|
|
38
38
|
// Fix conflict with bootstrap
|
|
39
|
-
overflow: 'hidden'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
// Fix Horizontal scroll when label too long
|
|
41
|
+
variants: [{
|
|
42
|
+
props: ({
|
|
43
|
+
ownerState
|
|
44
|
+
}) => !ownerState.withLabel,
|
|
45
|
+
style: {
|
|
46
|
+
padding: 0,
|
|
47
|
+
lineHeight: '11px',
|
|
48
|
+
// sync with `height` in `legend` styles
|
|
49
|
+
transition: theme.transitions.create('width', {
|
|
50
|
+
duration: 150,
|
|
51
|
+
easing: theme.transitions.easing.easeOut
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
props: ({
|
|
56
|
+
ownerState
|
|
57
|
+
}) => ownerState.withLabel,
|
|
58
|
+
style: {
|
|
59
|
+
display: 'block',
|
|
60
|
+
// Fix conflict with normalize.css and sanitize.css
|
|
61
|
+
padding: 0,
|
|
62
|
+
height: 11,
|
|
63
|
+
// sync with `lineHeight` in `legend` styles
|
|
64
|
+
fontSize: '0.75em',
|
|
65
|
+
visibility: 'hidden',
|
|
66
|
+
maxWidth: 0.01,
|
|
67
|
+
transition: theme.transitions.create('max-width', {
|
|
68
|
+
duration: 50,
|
|
69
|
+
easing: theme.transitions.easing.easeOut
|
|
70
|
+
}),
|
|
71
|
+
whiteSpace: 'nowrap',
|
|
72
|
+
'& > span': {
|
|
73
|
+
paddingLeft: 5,
|
|
74
|
+
paddingRight: 5,
|
|
75
|
+
display: 'inline-block',
|
|
76
|
+
opacity: 0,
|
|
77
|
+
visibility: 'visible'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
props: ({
|
|
82
|
+
ownerState
|
|
83
|
+
}) => ownerState.withLabel && ownerState.notched,
|
|
84
|
+
style: {
|
|
85
|
+
maxWidth: '100%',
|
|
86
|
+
transition: theme.transitions.create('max-width', {
|
|
87
|
+
duration: 100,
|
|
88
|
+
easing: theme.transitions.easing.easeOut,
|
|
89
|
+
delay: 50
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
93
|
+
}));
|
|
77
94
|
|
|
78
95
|
/**
|
|
79
96
|
* @ignore - internal component.
|
|
@@ -107,7 +124,7 @@ export default function NotchedOutline(props) {
|
|
|
107
124
|
})
|
|
108
125
|
}));
|
|
109
126
|
}
|
|
110
|
-
process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
|
|
127
|
+
process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes /* remove-proptypes */ = {
|
|
111
128
|
/**
|
|
112
129
|
* The content of the component.
|
|
113
130
|
*/
|
|
@@ -10,11 +10,12 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
10
10
|
import NotchedOutline from './NotchedOutline';
|
|
11
11
|
import useFormControl from '../FormControl/useFormControl';
|
|
12
12
|
import formControlState from '../FormControl/formControlState';
|
|
13
|
-
import
|
|
13
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
14
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
15
|
import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
|
|
15
|
-
import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot,
|
|
16
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
16
|
+
import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from '../InputBase/InputBase';
|
|
17
17
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
const useThemeProps = createUseThemeProps('MuiOutlinedInput');
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
19
20
|
const {
|
|
20
21
|
classes
|
|
@@ -33,41 +34,75 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
|
|
|
33
34
|
slot: 'Root',
|
|
34
35
|
overridesResolver: inputBaseRootOverridesResolver
|
|
35
36
|
})(({
|
|
36
|
-
theme
|
|
37
|
-
ownerState
|
|
37
|
+
theme
|
|
38
38
|
}) => {
|
|
39
39
|
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
40
|
-
return
|
|
40
|
+
return {
|
|
41
41
|
position: 'relative',
|
|
42
42
|
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
43
43
|
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
44
44
|
borderColor: (theme.vars || theme).palette.text.primary
|
|
45
45
|
},
|
|
46
|
-
// Reset on touch devices, it doesn't add specificity
|
|
47
|
-
'@media (hover: none)': {
|
|
48
|
-
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
49
|
-
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
46
|
[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
|
|
53
|
-
borderColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
54
47
|
borderWidth: 2
|
|
55
48
|
},
|
|
56
|
-
[
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
variants: [...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
|
|
50
|
+
props: {
|
|
51
|
+
color
|
|
52
|
+
},
|
|
53
|
+
style: {
|
|
54
|
+
[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
|
|
55
|
+
borderColor: (theme.vars || theme).palette[color].main
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
})), {
|
|
59
|
+
props: {},
|
|
60
|
+
// to overide the above style
|
|
61
|
+
style: {
|
|
62
|
+
// Reset on touch devices, it doesn't add specificity
|
|
63
|
+
'@media (hover: none)': {
|
|
64
|
+
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
|
65
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
|
|
69
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
70
|
+
},
|
|
71
|
+
[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
|
|
72
|
+
borderColor: (theme.vars || theme).palette.action.disabled
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
props: ({
|
|
77
|
+
ownerState
|
|
78
|
+
}) => ownerState.startAdornment,
|
|
79
|
+
style: {
|
|
80
|
+
paddingLeft: 14
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
props: ({
|
|
84
|
+
ownerState
|
|
85
|
+
}) => ownerState.endAdornment,
|
|
86
|
+
style: {
|
|
87
|
+
paddingRight: 14
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
props: ({
|
|
91
|
+
ownerState
|
|
92
|
+
}) => ownerState.multiline,
|
|
93
|
+
style: {
|
|
94
|
+
padding: '16.5px 14px'
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
props: ({
|
|
98
|
+
ownerState,
|
|
99
|
+
size
|
|
100
|
+
}) => ownerState.multiline && size === 'small',
|
|
101
|
+
style: {
|
|
102
|
+
padding: '8.5px 14px'
|
|
103
|
+
}
|
|
104
|
+
}]
|
|
105
|
+
};
|
|
71
106
|
});
|
|
72
107
|
const NotchedOutlineRoot = styled(NotchedOutline, {
|
|
73
108
|
name: 'MuiOutlinedInput',
|
|
@@ -86,8 +121,7 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
86
121
|
slot: 'Input',
|
|
87
122
|
overridesResolver: inputBaseInputOverridesResolver
|
|
88
123
|
})(({
|
|
89
|
-
theme
|
|
90
|
-
ownerState
|
|
124
|
+
theme
|
|
91
125
|
}) => _extends({
|
|
92
126
|
padding: '16.5px 14px'
|
|
93
127
|
}, !theme.vars && {
|
|
@@ -108,14 +142,36 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
108
142
|
caretColor: '#fff'
|
|
109
143
|
}
|
|
110
144
|
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
145
|
+
}, {
|
|
146
|
+
variants: [{
|
|
147
|
+
props: {
|
|
148
|
+
size: 'small'
|
|
149
|
+
},
|
|
150
|
+
style: {
|
|
151
|
+
padding: '8.5px 14px'
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
props: ({
|
|
155
|
+
ownerState
|
|
156
|
+
}) => ownerState.multiline,
|
|
157
|
+
style: {
|
|
158
|
+
padding: 0
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
props: ({
|
|
162
|
+
ownerState
|
|
163
|
+
}) => ownerState.startAdornment,
|
|
164
|
+
style: {
|
|
165
|
+
paddingLeft: 0
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
props: ({
|
|
169
|
+
ownerState
|
|
170
|
+
}) => ownerState.endAdornment,
|
|
171
|
+
style: {
|
|
172
|
+
paddingRight: 0
|
|
173
|
+
}
|
|
174
|
+
}]
|
|
119
175
|
}));
|
|
120
176
|
const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
121
177
|
var _React$Fragment;
|
|
@@ -345,5 +401,7 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes /* remove-propty
|
|
|
345
401
|
*/
|
|
346
402
|
value: PropTypes.any
|
|
347
403
|
} : void 0;
|
|
348
|
-
OutlinedInput
|
|
404
|
+
if (OutlinedInput) {
|
|
405
|
+
OutlinedInput.muiName = 'Input';
|
|
406
|
+
}
|
|
349
407
|
export default OutlinedInput;
|
|
@@ -8,12 +8,12 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import integerPropType from '@mui/utils/integerPropType';
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
12
11
|
import { getPaginationUtilityClass } from './paginationClasses';
|
|
13
12
|
import usePagination from '../usePagination';
|
|
14
13
|
import PaginationItem from '../PaginationItem';
|
|
15
|
-
import styled from '../
|
|
14
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
const useThemeProps = createUseThemeProps('MuiPagination');
|
|
17
17
|
const useUtilityClasses = ownerState => {
|
|
18
18
|
const {
|
|
19
19
|
classes,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
|
|
5
|
+
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "slotProps", "type", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -16,6 +16,7 @@ import FirstPageIcon from '../internal/svg-icons/FirstPage';
|
|
|
16
16
|
import LastPageIcon from '../internal/svg-icons/LastPage';
|
|
17
17
|
import NavigateBeforeIcon from '../internal/svg-icons/NavigateBefore';
|
|
18
18
|
import NavigateNextIcon from '../internal/svg-icons/NavigateNext';
|
|
19
|
+
import useSlot from '../utils/useSlot';
|
|
19
20
|
import { styled, createUseThemeProps } from '../zero-styled';
|
|
20
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const useThemeProps = createUseThemeProps('MuiPaginationItem');
|
|
@@ -281,6 +282,7 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
281
282
|
shape = 'circular',
|
|
282
283
|
size = 'medium',
|
|
283
284
|
slots = {},
|
|
285
|
+
slotProps = {},
|
|
284
286
|
type = 'page',
|
|
285
287
|
variant = 'text'
|
|
286
288
|
} = props,
|
|
@@ -296,18 +298,53 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
296
298
|
});
|
|
297
299
|
const isRtl = useRtl();
|
|
298
300
|
const classes = useUtilityClasses(ownerState);
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
first: slots.first || components.first || FirstPageIcon,
|
|
308
|
-
last: slots.last || components.last || LastPageIcon
|
|
301
|
+
const externalForwardedProps = {
|
|
302
|
+
slots: {
|
|
303
|
+
previous: slots.previous ?? components.previous,
|
|
304
|
+
next: slots.next ?? components.next,
|
|
305
|
+
first: slots.first ?? components.first,
|
|
306
|
+
last: slots.last ?? components.last
|
|
307
|
+
},
|
|
308
|
+
slotProps
|
|
309
309
|
};
|
|
310
|
-
const
|
|
310
|
+
const [PreviousSlot, previousSlotProps] = useSlot('previous', {
|
|
311
|
+
elementType: NavigateBeforeIcon,
|
|
312
|
+
externalForwardedProps,
|
|
313
|
+
ownerState
|
|
314
|
+
});
|
|
315
|
+
const [NextSlot, nextSlotProps] = useSlot('next', {
|
|
316
|
+
elementType: NavigateNextIcon,
|
|
317
|
+
externalForwardedProps,
|
|
318
|
+
ownerState
|
|
319
|
+
});
|
|
320
|
+
const [FirstSlot, firstSlotProps] = useSlot('first', {
|
|
321
|
+
elementType: FirstPageIcon,
|
|
322
|
+
externalForwardedProps,
|
|
323
|
+
ownerState
|
|
324
|
+
});
|
|
325
|
+
const [LastSlot, lastSlotProps] = useSlot('last', {
|
|
326
|
+
elementType: LastPageIcon,
|
|
327
|
+
externalForwardedProps,
|
|
328
|
+
ownerState
|
|
329
|
+
});
|
|
330
|
+
const rtlAwareType = isRtl ? {
|
|
331
|
+
previous: 'next',
|
|
332
|
+
next: 'previous',
|
|
333
|
+
first: 'last',
|
|
334
|
+
last: 'first'
|
|
335
|
+
}[type] : type;
|
|
336
|
+
const IconSlot = {
|
|
337
|
+
previous: PreviousSlot,
|
|
338
|
+
next: NextSlot,
|
|
339
|
+
first: FirstSlot,
|
|
340
|
+
last: LastSlot
|
|
341
|
+
}[rtlAwareType];
|
|
342
|
+
const iconSlotProps = {
|
|
343
|
+
previous: previousSlotProps,
|
|
344
|
+
next: nextSlotProps,
|
|
345
|
+
first: firstSlotProps,
|
|
346
|
+
last: lastSlotProps
|
|
347
|
+
}[rtlAwareType];
|
|
311
348
|
return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
|
|
312
349
|
ref: ref,
|
|
313
350
|
ownerState: ownerState,
|
|
@@ -320,11 +357,10 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
320
357
|
disabled: disabled,
|
|
321
358
|
className: clsx(classes.root, className)
|
|
322
359
|
}, other, {
|
|
323
|
-
children: [type === 'page' && page,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}) : null]
|
|
360
|
+
children: [type === 'page' && page, IconSlot ? /*#__PURE__*/_jsx(PaginationItemPageIcon, _extends({}, iconSlotProps, {
|
|
361
|
+
className: classes.icon,
|
|
362
|
+
as: IconSlot
|
|
363
|
+
})) : null]
|
|
328
364
|
}));
|
|
329
365
|
});
|
|
330
366
|
process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-proptypes */ = {
|
|
@@ -363,6 +399,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
|
|
|
363
399
|
* It's recommended to use the `slots` prop instead.
|
|
364
400
|
*
|
|
365
401
|
* @default {}
|
|
402
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
366
403
|
*/
|
|
367
404
|
components: PropTypes.shape({
|
|
368
405
|
first: PropTypes.elementType,
|
|
@@ -394,11 +431,18 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
|
|
|
394
431
|
* @default 'medium'
|
|
395
432
|
*/
|
|
396
433
|
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
|
434
|
+
/**
|
|
435
|
+
* The props used for each slot inside.
|
|
436
|
+
* @default {}
|
|
437
|
+
*/
|
|
438
|
+
slotProps: PropTypes.shape({
|
|
439
|
+
first: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
440
|
+
last: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
441
|
+
next: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
442
|
+
previous: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
443
|
+
}),
|
|
397
444
|
/**
|
|
398
445
|
* The components used for each slot inside.
|
|
399
|
-
*
|
|
400
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
401
|
-
*
|
|
402
446
|
* @default {}
|
|
403
447
|
*/
|
|
404
448
|
slots: PropTypes.shape({
|