@mui/material 5.11.10 → 5.11.11
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 +3 -1
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.js +1 -1
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- 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 +89 -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 +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/Container.js +0 -1
- package/Container/containerClasses.d.ts +6 -6
- 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/FormControlContext.d.ts +17 -17
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControl/useFormControl.d.ts +2 -2
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +34 -34
- 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.js +2 -2
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/InputLabel.js +3 -1
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- 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/ListSubheader.js +1 -0
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MenuList/MenuList.js +7 -0
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +9 -1
- package/Modal/Modal.js +14 -9
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- 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 +55 -55
- package/README.md +0 -2
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/Rating.js +2 -2
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/SelectInput.js +2 -22
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/Slider.d.ts +5 -1
- package/Slider/Slider.js +16 -11
- package/Slider/SliderValueLabel.d.ts +15 -15
- package/Slider/SliderValueLabel.types.d.ts +24 -24
- package/Slider/sliderClasses.d.ts +58 -58
- package/Snackbar/Snackbar.js +21 -125
- 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/Stack/Stack.d.ts +0 -1
- package/Stack/Stack.js +9 -120
- package/Stack/index.d.ts +3 -0
- package/Stack/index.js +2 -1
- package/Stack/stackClasses.d.ts +6 -0
- package/Stack/stackClasses.js +7 -0
- package/Step/StepContext.d.ts +20 -20
- 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/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- 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/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/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2.js +2 -3
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Badge/Badge.js +1 -1
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Container/Container.js +0 -1
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/InputLabel/InputLabel.js +3 -1
- package/legacy/ListSubheader/ListSubheader.js +1 -0
- package/legacy/MenuList/MenuList.js +7 -0
- package/legacy/Modal/Modal.js +14 -9
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Rating/Rating.js +2 -2
- package/legacy/Select/SelectInput.js +2 -22
- package/legacy/Slider/Slider.js +16 -12
- package/legacy/Snackbar/Snackbar.js +20 -119
- package/legacy/Stack/Stack.js +13 -122
- package/legacy/Stack/index.js +2 -1
- package/legacy/Stack/stackClasses.js +7 -0
- package/legacy/Unstable_Grid2/Grid2.js +2 -3
- package/legacy/index.js +1 -1
- package/legacy/styles/createTheme.js +1 -0
- package/legacy/useAutocomplete/useAutocomplete.js +2 -2
- package/locale/index.d.ts +75 -75
- package/modern/Badge/Badge.js +1 -1
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Container/Container.js +0 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/InputLabel/InputLabel.js +3 -1
- package/modern/ListSubheader/ListSubheader.js +1 -0
- package/modern/MenuList/MenuList.js +7 -0
- package/modern/Modal/Modal.js +14 -9
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Rating/Rating.js +2 -2
- package/modern/Select/SelectInput.js +2 -18
- package/modern/Slider/Slider.js +16 -11
- package/modern/Snackbar/Snackbar.js +21 -125
- package/modern/Stack/Stack.js +9 -120
- package/modern/Stack/index.js +2 -1
- package/modern/Stack/stackClasses.js +7 -0
- package/modern/Unstable_Grid2/Grid2.js +2 -3
- package/modern/index.js +1 -1
- package/modern/styles/createTheme.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +2 -2
- package/node/Badge/Badge.js +2 -2
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Container/Container.js +0 -2
- package/node/InputBase/InputBase.js +2 -2
- package/node/InputLabel/InputLabel.js +3 -1
- package/node/ListSubheader/ListSubheader.js +1 -0
- package/node/MenuList/MenuList.js +7 -0
- package/node/Modal/Modal.js +14 -9
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Rating/Rating.js +2 -2
- package/node/Select/SelectInput.js +2 -22
- package/node/Slider/Slider.js +19 -14
- package/node/Snackbar/Snackbar.js +20 -124
- package/node/Stack/Stack.js +9 -122
- package/node/Stack/index.js +8 -1
- package/node/Stack/stackClasses.js +16 -0
- package/node/Unstable_Grid2/Grid2.js +0 -1
- package/node/index.js +1 -1
- package/node/styles/createTheme.js +1 -0
- package/node/useAutocomplete/useAutocomplete.js +8 -6
- package/package.json +6 -6
- package/styles/CssVarsProvider.d.ts +16 -16
- package/styles/createTheme.js +1 -0
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/styles/getOverlayAlpha.d.ts +2 -2
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/types/OverridableComponentAugmentation.d.ts +31 -31
- package/umd/material-ui.development.js +4132 -4060
- package/umd/material-ui.production.min.js +21 -21
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +2 -2
- package/useMediaQuery/useMediaQuery.d.ts +46 -46
- 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/Stack/Stack.js
CHANGED
|
@@ -1,130 +1,21 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
import * as React from 'react';
|
|
6
1
|
import PropTypes from 'prop-types';
|
|
7
|
-
import {
|
|
8
|
-
import { deepmerge } from '@mui/utils';
|
|
2
|
+
import { createStack } from '@mui/system';
|
|
9
3
|
import styled from '../styles/styled';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* [1,0,2,0,3]
|
|
18
|
-
*/
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
function joinChildren(children, separator) {
|
|
21
|
-
var childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
22
|
-
return childrenArray.reduce(function (output, child, index) {
|
|
23
|
-
output.push(child);
|
|
24
|
-
if (index < childrenArray.length - 1) {
|
|
25
|
-
output.push( /*#__PURE__*/React.cloneElement(separator, {
|
|
26
|
-
key: "separator-".concat(index)
|
|
27
|
-
}));
|
|
4
|
+
import _useThemeProps from '../styles/useThemeProps';
|
|
5
|
+
var Stack = createStack({
|
|
6
|
+
createStyledComponent: styled('div', {
|
|
7
|
+
name: 'MuiStack',
|
|
8
|
+
slot: 'Root',
|
|
9
|
+
overridesResolver: function overridesResolver(props, styles) {
|
|
10
|
+
return styles.root;
|
|
28
11
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
row: 'Left',
|
|
35
|
-
'row-reverse': 'Right',
|
|
36
|
-
column: 'Top',
|
|
37
|
-
'column-reverse': 'Bottom'
|
|
38
|
-
}[direction];
|
|
39
|
-
};
|
|
40
|
-
export var style = function style(_ref) {
|
|
41
|
-
var ownerState = _ref.ownerState,
|
|
42
|
-
theme = _ref.theme;
|
|
43
|
-
var styles = _extends({
|
|
44
|
-
display: 'flex',
|
|
45
|
-
flexDirection: 'column'
|
|
46
|
-
}, handleBreakpoints({
|
|
47
|
-
theme: theme
|
|
48
|
-
}, resolveBreakpointValues({
|
|
49
|
-
values: ownerState.direction,
|
|
50
|
-
breakpoints: theme.breakpoints.values
|
|
51
|
-
}), function (propValue) {
|
|
52
|
-
return {
|
|
53
|
-
flexDirection: propValue
|
|
54
|
-
};
|
|
55
|
-
}));
|
|
56
|
-
if (ownerState.spacing) {
|
|
57
|
-
var transformer = createUnarySpacing(theme);
|
|
58
|
-
var base = Object.keys(theme.breakpoints.values).reduce(function (acc, breakpoint) {
|
|
59
|
-
if (_typeof(ownerState.spacing) === 'object' && ownerState.spacing[breakpoint] != null || _typeof(ownerState.direction) === 'object' && ownerState.direction[breakpoint] != null) {
|
|
60
|
-
acc[breakpoint] = true;
|
|
61
|
-
}
|
|
62
|
-
return acc;
|
|
63
|
-
}, {});
|
|
64
|
-
var directionValues = resolveBreakpointValues({
|
|
65
|
-
values: ownerState.direction,
|
|
66
|
-
base: base
|
|
12
|
+
}),
|
|
13
|
+
useThemeProps: function useThemeProps(inProps) {
|
|
14
|
+
return _useThemeProps({
|
|
15
|
+
props: inProps,
|
|
16
|
+
name: 'MuiStack'
|
|
67
17
|
});
|
|
68
|
-
var spacingValues = resolveBreakpointValues({
|
|
69
|
-
values: ownerState.spacing,
|
|
70
|
-
base: base
|
|
71
|
-
});
|
|
72
|
-
if (_typeof(directionValues) === 'object') {
|
|
73
|
-
Object.keys(directionValues).forEach(function (breakpoint, index, breakpoints) {
|
|
74
|
-
var directionValue = directionValues[breakpoint];
|
|
75
|
-
if (!directionValue) {
|
|
76
|
-
var previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
|
|
77
|
-
directionValues[breakpoint] = previousDirectionValue;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
var styleFromPropValue = function styleFromPropValue(propValue, breakpoint) {
|
|
82
|
-
return {
|
|
83
|
-
'& > :not(style) + :not(style)': _defineProperty({
|
|
84
|
-
margin: 0
|
|
85
|
-
}, "margin".concat(getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)), getValue(transformer, propValue))
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
styles = deepmerge(styles, handleBreakpoints({
|
|
89
|
-
theme: theme
|
|
90
|
-
}, spacingValues, styleFromPropValue));
|
|
91
|
-
}
|
|
92
|
-
styles = mergeBreakpointsInOrder(theme.breakpoints, styles);
|
|
93
|
-
return styles;
|
|
94
|
-
};
|
|
95
|
-
var StackRoot = styled('div', {
|
|
96
|
-
name: 'MuiStack',
|
|
97
|
-
slot: 'Root',
|
|
98
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
99
|
-
return [styles.root];
|
|
100
18
|
}
|
|
101
|
-
})(style);
|
|
102
|
-
var Stack = /*#__PURE__*/React.forwardRef(function Stack(inProps, ref) {
|
|
103
|
-
var themeProps = useThemeProps({
|
|
104
|
-
props: inProps,
|
|
105
|
-
name: 'MuiStack'
|
|
106
|
-
});
|
|
107
|
-
var props = extendSxProp(themeProps);
|
|
108
|
-
var _props$component = props.component,
|
|
109
|
-
component = _props$component === void 0 ? 'div' : _props$component,
|
|
110
|
-
_props$direction = props.direction,
|
|
111
|
-
direction = _props$direction === void 0 ? 'column' : _props$direction,
|
|
112
|
-
_props$spacing = props.spacing,
|
|
113
|
-
spacing = _props$spacing === void 0 ? 0 : _props$spacing,
|
|
114
|
-
divider = props.divider,
|
|
115
|
-
children = props.children,
|
|
116
|
-
other = _objectWithoutProperties(props, ["component", "direction", "spacing", "divider", "children"]);
|
|
117
|
-
var ownerState = {
|
|
118
|
-
direction: direction,
|
|
119
|
-
spacing: spacing
|
|
120
|
-
};
|
|
121
|
-
return /*#__PURE__*/_jsx(StackRoot, _extends({
|
|
122
|
-
as: component,
|
|
123
|
-
ownerState: ownerState,
|
|
124
|
-
ref: ref
|
|
125
|
-
}, other, {
|
|
126
|
-
children: divider ? joinChildren(children, divider) : children
|
|
127
|
-
}));
|
|
128
19
|
});
|
|
129
20
|
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
|
|
130
21
|
// ----------------------------- Warning --------------------------------
|
package/legacy/Stack/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from './Stack';
|
|
1
|
+
export { default } from './Stack';
|
|
2
|
+
export { default as stackClasses } from './stackClasses';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
2
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
3
|
+
export function getStackUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiStack', slot);
|
|
5
|
+
}
|
|
6
|
+
var stackClasses = generateUtilityClasses('MuiStack', ['root']);
|
|
7
|
+
export default stackClasses;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { createGrid } from '@mui/system/Unstable_Grid';
|
|
2
|
+
import { createGrid as createGrid2 } from '@mui/system/Unstable_Grid';
|
|
3
3
|
import { styled, useThemeProps as _useThemeProps } from '../styles';
|
|
4
|
-
var Grid2 =
|
|
4
|
+
var Grid2 = createGrid2({
|
|
5
5
|
createStyledComponent: styled('div', {
|
|
6
6
|
name: 'MuiGrid2',
|
|
7
7
|
overridesResolver: function overridesResolver(props, styles) {
|
|
@@ -9,7 +9,6 @@ var Grid2 = createGrid({
|
|
|
9
9
|
}
|
|
10
10
|
}),
|
|
11
11
|
componentName: 'MuiGrid2',
|
|
12
|
-
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
13
12
|
useThemeProps: function useThemeProps(inProps) {
|
|
14
13
|
return _useThemeProps({
|
|
15
14
|
props: inProps,
|
package/legacy/index.js
CHANGED
|
@@ -47,6 +47,7 @@ function createTheme() {
|
|
|
47
47
|
return deepmerge(acc, argument);
|
|
48
48
|
}, muiTheme);
|
|
49
49
|
if (process.env.NODE_ENV !== 'production') {
|
|
50
|
+
// TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
|
|
50
51
|
var stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
|
|
51
52
|
var traverse = function traverse(node, component) {
|
|
52
53
|
var key;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export * from '@mui/base/
|
|
1
|
+
export { default } from '@mui/base/useAutocomplete';
|
|
2
|
+
export * from '@mui/base/useAutocomplete';
|
package/locale/index.d.ts
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
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 arSA: Localization;
|
|
27
|
-
export declare const arSD: Localization;
|
|
28
|
-
export declare const azAZ: Localization;
|
|
29
|
-
export declare const bnBD: Localization;
|
|
30
|
-
export declare const beBY: Localization;
|
|
31
|
-
export declare const bgBG: Localization;
|
|
32
|
-
export declare const caES: Localization;
|
|
33
|
-
export declare const csCZ: Localization;
|
|
34
|
-
export declare const daDK: Localization;
|
|
35
|
-
export declare const deDE: Localization;
|
|
36
|
-
export declare const elGR: Localization;
|
|
37
|
-
export declare const enUS: Localization;
|
|
38
|
-
export declare const esES: Localization;
|
|
39
|
-
export declare const etEE: Localization;
|
|
40
|
-
export declare const faIR: Localization;
|
|
41
|
-
export declare const fiFI: Localization;
|
|
42
|
-
export declare const frFR: Localization;
|
|
43
|
-
export declare const heIL: Localization;
|
|
44
|
-
export declare const hiIN: Localization;
|
|
45
|
-
export declare const hrHR: Localization;
|
|
46
|
-
export declare const huHU: Localization;
|
|
47
|
-
export declare const hyAM: Localization;
|
|
48
|
-
export declare const idID: Localization;
|
|
49
|
-
export declare const isIS: Localization;
|
|
50
|
-
export declare const itIT: Localization;
|
|
51
|
-
export declare const jaJP: Localization;
|
|
52
|
-
export declare const khKH: Localization;
|
|
53
|
-
export declare const koKR: Localization;
|
|
54
|
-
export declare const kuLatn: Localization;
|
|
55
|
-
export declare const kkKZ: Localization;
|
|
56
|
-
export declare const mkMK: Localization;
|
|
57
|
-
export declare const nbNO: Localization;
|
|
58
|
-
export declare const nlNL: Localization;
|
|
59
|
-
export declare const plPL: Localization;
|
|
60
|
-
export declare const ptBR: Localization;
|
|
61
|
-
export declare const ptPT: Localization;
|
|
62
|
-
export declare const roRO: Localization;
|
|
63
|
-
export declare const srRS: Localization;
|
|
64
|
-
export declare const ruRU: Localization;
|
|
65
|
-
export declare const siLK: Localization;
|
|
66
|
-
export declare const skSK: Localization;
|
|
67
|
-
export declare const svSE: Localization;
|
|
68
|
-
export declare const thTH: Localization;
|
|
69
|
-
export declare const trTR: Localization;
|
|
70
|
-
export declare const ukUA: Localization;
|
|
71
|
-
export declare const urPK: Localization;
|
|
72
|
-
export declare const viVN: Localization;
|
|
73
|
-
export declare const zhCN: Localization;
|
|
74
|
-
export declare const zhHK: Localization;
|
|
75
|
-
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 arSA: Localization;
|
|
27
|
+
export declare const arSD: Localization;
|
|
28
|
+
export declare const azAZ: Localization;
|
|
29
|
+
export declare const bnBD: Localization;
|
|
30
|
+
export declare const beBY: Localization;
|
|
31
|
+
export declare const bgBG: Localization;
|
|
32
|
+
export declare const caES: Localization;
|
|
33
|
+
export declare const csCZ: Localization;
|
|
34
|
+
export declare const daDK: Localization;
|
|
35
|
+
export declare const deDE: Localization;
|
|
36
|
+
export declare const elGR: Localization;
|
|
37
|
+
export declare const enUS: Localization;
|
|
38
|
+
export declare const esES: Localization;
|
|
39
|
+
export declare const etEE: Localization;
|
|
40
|
+
export declare const faIR: Localization;
|
|
41
|
+
export declare const fiFI: Localization;
|
|
42
|
+
export declare const frFR: Localization;
|
|
43
|
+
export declare const heIL: Localization;
|
|
44
|
+
export declare const hiIN: Localization;
|
|
45
|
+
export declare const hrHR: Localization;
|
|
46
|
+
export declare const huHU: Localization;
|
|
47
|
+
export declare const hyAM: Localization;
|
|
48
|
+
export declare const idID: Localization;
|
|
49
|
+
export declare const isIS: Localization;
|
|
50
|
+
export declare const itIT: Localization;
|
|
51
|
+
export declare const jaJP: Localization;
|
|
52
|
+
export declare const khKH: Localization;
|
|
53
|
+
export declare const koKR: Localization;
|
|
54
|
+
export declare const kuLatn: Localization;
|
|
55
|
+
export declare const kkKZ: Localization;
|
|
56
|
+
export declare const mkMK: Localization;
|
|
57
|
+
export declare const nbNO: Localization;
|
|
58
|
+
export declare const nlNL: Localization;
|
|
59
|
+
export declare const plPL: Localization;
|
|
60
|
+
export declare const ptBR: Localization;
|
|
61
|
+
export declare const ptPT: Localization;
|
|
62
|
+
export declare const roRO: Localization;
|
|
63
|
+
export declare const srRS: Localization;
|
|
64
|
+
export declare const ruRU: Localization;
|
|
65
|
+
export declare const siLK: Localization;
|
|
66
|
+
export declare const skSK: Localization;
|
|
67
|
+
export declare const svSE: Localization;
|
|
68
|
+
export declare const thTH: Localization;
|
|
69
|
+
export declare const trTR: Localization;
|
|
70
|
+
export declare const ukUA: Localization;
|
|
71
|
+
export declare const urPK: Localization;
|
|
72
|
+
export declare const viVN: Localization;
|
|
73
|
+
export declare const zhCN: Localization;
|
|
74
|
+
export declare const zhHK: Localization;
|
|
75
|
+
export declare const zhTW: Localization;
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
8
|
import composeClasses from '@mui/base/composeClasses';
|
|
9
|
-
import
|
|
9
|
+
import useBadge from '@mui/base/useBadge';
|
|
10
10
|
import { useSlotProps } from '@mui/base';
|
|
11
11
|
import styled from '../styles/styled';
|
|
12
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
File without changes
|
|
@@ -435,7 +435,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
435
435
|
ref: ref,
|
|
436
436
|
onClick: handleClick
|
|
437
437
|
}, other, {
|
|
438
|
-
className: clsx(classes.root, rootProps.className, className),
|
|
438
|
+
className: clsx(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
|
|
439
439
|
children: [startAdornment, /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
440
440
|
value: null,
|
|
441
441
|
children: /*#__PURE__*/_jsx(Input, _extends({
|
|
@@ -462,7 +462,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
462
462
|
ownerState: _extends({}, ownerState, inputProps.ownerState)
|
|
463
463
|
}, {
|
|
464
464
|
ref: handleInputRef,
|
|
465
|
-
className: clsx(classes.input, inputProps.className),
|
|
465
|
+
className: clsx(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
|
|
466
466
|
onBlur: handleBlur,
|
|
467
467
|
onChange: handleChange,
|
|
468
468
|
onFocus: handleFocus
|
|
@@ -98,7 +98,9 @@ const InputLabelRoot = styled(FormLabel, {
|
|
|
98
98
|
}, ownerState.shrink && {
|
|
99
99
|
userSelect: 'none',
|
|
100
100
|
pointerEvents: 'auto',
|
|
101
|
-
|
|
101
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
102
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
103
|
+
maxWidth: 'calc(133% - 32px)',
|
|
102
104
|
transform: 'translate(14px, -9px) scale(0.75)'
|
|
103
105
|
})));
|
|
104
106
|
const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
|
|
@@ -87,6 +87,7 @@ const ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inPro
|
|
|
87
87
|
ownerState: ownerState
|
|
88
88
|
}, other));
|
|
89
89
|
});
|
|
90
|
+
ListSubheader.muiSkipListHighlight = true;
|
|
90
91
|
process.env.NODE_ENV !== "production" ? ListSubheader.propTypes /* remove-proptypes */ = {
|
|
91
92
|
// ----------------------------- Warning --------------------------------
|
|
92
93
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -194,6 +194,13 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
194
194
|
activeItemIndex = index;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
+
if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
|
|
198
|
+
activeItemIndex += 1;
|
|
199
|
+
if (activeItemIndex >= children.length) {
|
|
200
|
+
// there are no focusable items within the list.
|
|
201
|
+
activeItemIndex = -1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
197
204
|
});
|
|
198
205
|
const items = React.Children.map(children, (child, index) => {
|
|
199
206
|
if (index === activeItemIndex) {
|
package/modern/Modal/Modal.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
3
|
+
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
|
|
7
8
|
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
8
9
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
@@ -11,9 +12,6 @@ import useThemeProps from '../styles/useThemeProps';
|
|
|
11
12
|
import Backdrop from '../Backdrop';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
export const modalClasses = modalUnstyledClasses;
|
|
14
|
-
const extendUtilityClasses = ownerState => {
|
|
15
|
-
return ownerState.classes;
|
|
16
|
-
};
|
|
17
15
|
const ModalRoot = styled('div', {
|
|
18
16
|
name: 'MuiModal',
|
|
19
17
|
slot: 'Root',
|
|
@@ -67,6 +65,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
67
65
|
const {
|
|
68
66
|
BackdropComponent = ModalBackdrop,
|
|
69
67
|
BackdropProps,
|
|
68
|
+
classes,
|
|
69
|
+
className,
|
|
70
70
|
closeAfterTransition = false,
|
|
71
71
|
children,
|
|
72
72
|
component,
|
|
@@ -101,7 +101,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
101
101
|
const ownerState = _extends({}, props, commonProps, {
|
|
102
102
|
exited
|
|
103
103
|
});
|
|
104
|
-
const classes = extendUtilityClasses(ownerState);
|
|
105
104
|
const RootSlot = slots?.root ?? components.Root ?? ModalRoot;
|
|
106
105
|
const BackdropSlot = slots?.backdrop ?? components.Backdrop ?? BackdropComponent;
|
|
107
106
|
const rootSlotProps = slotProps?.root ?? componentsProps.root;
|
|
@@ -115,15 +114,17 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
115
114
|
root: () => _extends({}, resolveComponentProps(rootSlotProps, ownerState), !isHostComponent(RootSlot) && {
|
|
116
115
|
as: component,
|
|
117
116
|
theme
|
|
117
|
+
}, {
|
|
118
|
+
className: clsx(className, rootSlotProps?.className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
|
|
118
119
|
}),
|
|
119
|
-
backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState)
|
|
120
|
+
backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
|
|
121
|
+
className: clsx(backdropSlotProps?.className, classes?.backdrop)
|
|
122
|
+
})
|
|
120
123
|
},
|
|
121
124
|
onTransitionEnter: () => setExited(false),
|
|
122
125
|
onTransitionExited: () => setExited(true),
|
|
123
126
|
ref: ref
|
|
124
|
-
}, other, {
|
|
125
|
-
classes: classes
|
|
126
|
-
}, commonProps, {
|
|
127
|
+
}, other, commonProps, {
|
|
127
128
|
children: children
|
|
128
129
|
}));
|
|
129
130
|
});
|
|
@@ -160,6 +161,10 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
160
161
|
* Override or extend the styles applied to the component.
|
|
161
162
|
*/
|
|
162
163
|
classes: PropTypes.object,
|
|
164
|
+
/**
|
|
165
|
+
* @ignore
|
|
166
|
+
*/
|
|
167
|
+
className: PropTypes.string,
|
|
163
168
|
/**
|
|
164
169
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
165
170
|
* @default false
|
|
@@ -163,7 +163,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
163
163
|
ownerState: ownerState,
|
|
164
164
|
className: classes.notchedOutline,
|
|
165
165
|
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
166
|
-
children: [label, "\
|
|
166
|
+
children: [label, "\u2009", '*']
|
|
167
167
|
})) : label,
|
|
168
168
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
169
169
|
}),
|
package/modern/Rating/Rating.js
CHANGED
|
@@ -46,7 +46,7 @@ const useUtilityClasses = ownerState => {
|
|
|
46
46
|
focusVisible
|
|
47
47
|
} = ownerState;
|
|
48
48
|
const slots = {
|
|
49
|
-
root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && '
|
|
49
|
+
root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && 'readOnly'],
|
|
50
50
|
label: ['label', 'pristine'],
|
|
51
51
|
labelEmptyValue: [emptyValueFocused && 'labelEmptyValueActive'],
|
|
52
52
|
icon: ['icon'],
|
|
@@ -444,7 +444,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
444
444
|
ref: handleRef,
|
|
445
445
|
onMouseMove: handleMouseMove,
|
|
446
446
|
onMouseLeave: handleMouseLeave,
|
|
447
|
-
className: clsx(classes.root, className),
|
|
447
|
+
className: clsx(classes.root, className, readOnly && 'MuiRating-readOnly'),
|
|
448
448
|
ownerState: ownerState,
|
|
449
449
|
role: readOnly ? 'img' : null,
|
|
450
450
|
"aria-label": readOnly ? getLabelText(value) : null
|
|
@@ -329,7 +329,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
329
329
|
computeDisplay = true;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
const items = childrenArray.map(
|
|
332
|
+
const items = childrenArray.map(child => {
|
|
333
333
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
334
334
|
return null;
|
|
335
335
|
}
|
|
@@ -356,22 +356,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
356
356
|
if (selected) {
|
|
357
357
|
foundMatch = true;
|
|
358
358
|
}
|
|
359
|
-
if (child.props.value === undefined) {
|
|
360
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
361
|
-
'aria-readonly': true,
|
|
362
|
-
role: 'option'
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
const isFirstSelectableElement = () => {
|
|
366
|
-
if (value) {
|
|
367
|
-
return selected;
|
|
368
|
-
}
|
|
369
|
-
const firstSelectableElement = arr.find(item => item?.props?.value !== undefined && item.props.disabled !== true);
|
|
370
|
-
if (child === firstSelectableElement) {
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
return selected;
|
|
374
|
-
};
|
|
375
359
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
376
360
|
'aria-selected': selected ? 'true' : 'false',
|
|
377
361
|
onClick: handleItemClick(child),
|
|
@@ -387,7 +371,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
387
371
|
}
|
|
388
372
|
},
|
|
389
373
|
role: 'option',
|
|
390
|
-
selected
|
|
374
|
+
selected,
|
|
391
375
|
value: undefined,
|
|
392
376
|
// The value is most likely not a valid HTML attribute.
|
|
393
377
|
'data-value': child.props.value // Instead, we provide it as a data attribute.
|
package/modern/Slider/Slider.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { chainPropTypes } from '@mui/utils';
|
|
8
8
|
import { isHostComponent, useSlotProps, unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
-
import {
|
|
9
|
+
import useSlider, { valueToPercent } from '@mui/base/useSlider';
|
|
10
10
|
import { alpha, lighten, darken } from '@mui/system';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
@@ -17,7 +17,6 @@ import SliderValueLabel from './SliderValueLabel';
|
|
|
17
17
|
import sliderClasses, { getSliderUtilityClass } from './sliderClasses';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
const valueToPercent = (value, min, max) => (value - min) * 100 / (max - min);
|
|
21
20
|
function Identity(x) {
|
|
22
21
|
return x;
|
|
23
22
|
}
|
|
@@ -457,7 +456,6 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
457
456
|
componentsProps = {},
|
|
458
457
|
color = 'primary',
|
|
459
458
|
classes: classesProp,
|
|
460
|
-
// eslint-disable-next-line react/prop-types
|
|
461
459
|
className,
|
|
462
460
|
disableSwap = false,
|
|
463
461
|
disabled = false,
|
|
@@ -564,7 +562,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
564
562
|
elementType: ThumbSlot,
|
|
565
563
|
getSlotProps: getThumbProps,
|
|
566
564
|
externalSlotProps: thumbSlotProps,
|
|
567
|
-
ownerState: _extends({}, ownerState, thumbSlotProps?.ownerState)
|
|
565
|
+
ownerState: _extends({}, ownerState, thumbSlotProps?.ownerState),
|
|
566
|
+
className: classes.thumb
|
|
568
567
|
});
|
|
569
568
|
const valueLabelProps = useSlotProps({
|
|
570
569
|
elementType: ValueLabelSlot,
|
|
@@ -581,7 +580,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
581
580
|
const markLabelProps = useSlotProps({
|
|
582
581
|
elementType: MarkLabelSlot,
|
|
583
582
|
externalSlotProps: markLabelSlotProps,
|
|
584
|
-
ownerState
|
|
583
|
+
ownerState,
|
|
584
|
+
className: classes.markLabel
|
|
585
585
|
});
|
|
586
586
|
const inputSliderProps = useSlotProps({
|
|
587
587
|
elementType: InputSlot,
|
|
@@ -622,8 +622,10 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
622
622
|
const percent = valueToPercent(value, min, max);
|
|
623
623
|
const style = axisProps[axis].offset(percent);
|
|
624
624
|
const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
625
|
-
return
|
|
626
|
-
|
|
625
|
+
return (
|
|
626
|
+
/*#__PURE__*/
|
|
627
|
+
/* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
|
|
628
|
+
_jsx(ValueLabelComponent, _extends({}, !isHostComponent(ValueLabelComponent) && {
|
|
627
629
|
valueLabelFormat,
|
|
628
630
|
valueLabelDisplay,
|
|
629
631
|
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
@@ -632,8 +634,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
632
634
|
disabled
|
|
633
635
|
}, valueLabelProps, {
|
|
634
636
|
children: /*#__PURE__*/_jsx(ThumbSlot, _extends({
|
|
635
|
-
"data-index": index
|
|
636
|
-
"data-focusvisible": focusedThumbIndex === index
|
|
637
|
+
"data-index": index
|
|
637
638
|
}, thumbProps, {
|
|
638
639
|
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
639
640
|
style: _extends({}, style, {
|
|
@@ -648,8 +649,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
648
649
|
value: values[index]
|
|
649
650
|
}, inputSliderProps))
|
|
650
651
|
}))
|
|
651
|
-
}))
|
|
652
|
-
|
|
652
|
+
}), index)
|
|
653
|
+
);
|
|
653
654
|
})]
|
|
654
655
|
}));
|
|
655
656
|
});
|
|
@@ -690,6 +691,10 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
690
691
|
* Override or extend the styles applied to the component.
|
|
691
692
|
*/
|
|
692
693
|
classes: PropTypes.object,
|
|
694
|
+
/**
|
|
695
|
+
* @ignore
|
|
696
|
+
*/
|
|
697
|
+
className: PropTypes.string,
|
|
693
698
|
/**
|
|
694
699
|
* The color of the component.
|
|
695
700
|
* It supports both default and custom theme colors, which can be added as shown in the
|