@mui/material 5.15.12 → 5.15.14
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.js +30 -23
- package/AccordionActions/AccordionActions.js +14 -12
- package/AccordionDetails/AccordionDetails.js +2 -2
- package/AccordionSummary/AccordionSummary.js +29 -23
- package/Alert/Alert.d.ts +2 -2
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +117 -82
- package/Autocomplete/autocompleteClasses.d.ts +3 -3
- package/CHANGELOG.md +203 -51
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +1 -1
- package/Drawer/Drawer.js +9 -3
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js +1 -1
- package/LinearProgress/LinearProgress.js +4 -4
- package/Menu/Menu.js +5 -4
- package/MenuList/MenuList.js +4 -2
- package/OverridableComponent.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +3 -3
- package/Popper/Popper.d.ts +3 -26
- package/README.md +2 -2
- package/Rating/Rating.js +3 -3
- package/Select/Select.d.ts +8 -20
- package/Slider/Slider.js +406 -226
- package/SvgIcon/SvgIcon.js +1 -1
- package/Switch/Switch.js +61 -41
- package/TabScrollButton/TabScrollButton.js +2 -3
- package/TablePagination/TablePaginationActions.js +14 -14
- package/Tabs/Tabs.js +3 -2
- package/Tooltip/Tooltip.js +5 -4
- package/index.js +1 -1
- package/legacy/Accordion/Accordion.js +33 -22
- package/legacy/AccordionActions/AccordionActions.js +17 -14
- package/legacy/AccordionDetails/AccordionDetails.js +2 -2
- package/legacy/AccordionSummary/AccordionSummary.js +31 -22
- package/legacy/Autocomplete/Autocomplete.js +194 -164
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/Drawer/Drawer.js +8 -3
- package/legacy/Icon/Icon.js +1 -1
- package/legacy/LinearProgress/LinearProgress.js +4 -4
- package/legacy/Menu/Menu.js +5 -4
- package/legacy/MenuList/MenuList.js +3 -2
- package/legacy/PaginationItem/PaginationItem.js +3 -3
- package/legacy/Rating/Rating.js +3 -3
- package/legacy/Slider/Slider.js +375 -194
- package/legacy/SvgIcon/SvgIcon.js +1 -1
- package/legacy/Switch/Switch.js +88 -59
- package/legacy/TabScrollButton/TabScrollButton.js +2 -3
- package/legacy/TablePagination/TablePaginationActions.js +14 -14
- package/legacy/Tabs/Tabs.js +3 -2
- package/legacy/Tooltip/Tooltip.js +7 -3
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +4 -1
- package/legacy/styles/rootShouldForwardProp.js +5 -0
- package/legacy/styles/slotShouldForwardProp.js +5 -0
- package/legacy/styles/styled.js +4 -5
- package/legacy/usePagination/usePagination.js +1 -1
- package/modern/Accordion/Accordion.js +30 -23
- package/modern/AccordionActions/AccordionActions.js +14 -12
- package/modern/AccordionDetails/AccordionDetails.js +2 -2
- package/modern/AccordionSummary/AccordionSummary.js +29 -23
- package/modern/Autocomplete/Autocomplete.js +117 -82
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/Drawer/Drawer.js +9 -3
- package/modern/Icon/Icon.js +1 -1
- package/modern/LinearProgress/LinearProgress.js +4 -4
- package/modern/Menu/Menu.js +5 -4
- package/modern/MenuList/MenuList.js +4 -2
- package/modern/PaginationItem/PaginationItem.js +3 -3
- package/modern/Rating/Rating.js +3 -3
- package/modern/Slider/Slider.js +339 -175
- package/modern/SvgIcon/SvgIcon.js +1 -1
- package/modern/Switch/Switch.js +61 -41
- package/modern/TabScrollButton/TabScrollButton.js +2 -3
- package/modern/TablePagination/TablePaginationActions.js +14 -14
- package/modern/Tabs/Tabs.js +3 -2
- package/modern/Tooltip/Tooltip.js +5 -4
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +4 -1
- package/modern/styles/rootShouldForwardProp.js +3 -0
- package/modern/styles/slotShouldForwardProp.js +5 -0
- package/modern/styles/styled.js +4 -3
- package/modern/usePagination/usePagination.js +1 -1
- package/node/Accordion/Accordion.js +32 -25
- package/node/AccordionActions/AccordionActions.js +16 -14
- package/node/AccordionDetails/AccordionDetails.js +4 -4
- package/node/AccordionSummary/AccordionSummary.js +33 -27
- package/node/Autocomplete/Autocomplete.js +129 -94
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/Drawer/Drawer.js +9 -3
- package/node/Icon/Icon.js +1 -1
- package/node/LinearProgress/LinearProgress.js +4 -4
- package/node/Menu/Menu.js +5 -4
- package/node/MenuList/MenuList.js +4 -2
- package/node/PaginationItem/PaginationItem.js +3 -3
- package/node/Rating/Rating.js +3 -3
- package/node/Slider/Slider.js +416 -236
- package/node/SvgIcon/SvgIcon.js +1 -1
- package/node/Switch/Switch.js +66 -46
- package/node/TabScrollButton/TabScrollButton.js +2 -3
- package/node/TablePagination/TablePaginationActions.js +14 -14
- package/node/Tabs/Tabs.js +3 -2
- package/node/Tooltip/Tooltip.js +5 -4
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +4 -1
- package/node/styles/rootShouldForwardProp.js +10 -0
- package/node/styles/slotShouldForwardProp.js +11 -0
- package/node/styles/styled.js +17 -8
- package/node/usePagination/usePagination.js +1 -1
- package/package.json +6 -6
- package/styles/experimental_extendTheme.d.ts +1 -0
- package/styles/experimental_extendTheme.js +4 -1
- package/styles/rootShouldForwardProp.d.ts +2 -0
- package/styles/rootShouldForwardProp.js +3 -0
- package/styles/slotShouldForwardProp.d.ts +2 -0
- package/styles/slotShouldForwardProp.js +5 -0
- package/styles/styled.d.ts +2 -3
- package/styles/styled.js +4 -3
- package/umd/material-ui.development.js +1048 -738
- package/umd/material-ui.production.min.js +2 -2
- package/usePagination/usePagination.js +1 -1
package/node/SvgIcon/SvgIcon.js
CHANGED
|
@@ -51,7 +51,7 @@ const SvgIconRoot = (0, _styled.default)('svg', {
|
|
|
51
51
|
height: '1em',
|
|
52
52
|
display: 'inline-block',
|
|
53
53
|
// the <svg> will define the property that has `currentColor`
|
|
54
|
-
//
|
|
54
|
+
// for example heroicons uses fill="none" and stroke="currentColor"
|
|
55
55
|
fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
|
|
56
56
|
flexShrink: 0,
|
|
57
57
|
transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
package/node/Switch/Switch.js
CHANGED
|
@@ -17,13 +17,13 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
17
17
|
var _colorManipulator = require("@mui/system/colorManipulator");
|
|
18
18
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
19
19
|
var _SwitchBase = _interopRequireDefault(require("../internal/SwitchBase"));
|
|
20
|
-
var
|
|
21
|
-
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
20
|
+
var _zeroStyled = require("../zero-styled");
|
|
22
21
|
var _switchClasses = _interopRequireWildcard(require("./switchClasses"));
|
|
23
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
23
|
const _excluded = ["className", "color", "edge", "size", "sx"];
|
|
25
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiSwitch');
|
|
27
27
|
const useUtilityClasses = ownerState => {
|
|
28
28
|
const {
|
|
29
29
|
classes,
|
|
@@ -43,7 +43,7 @@ const useUtilityClasses = ownerState => {
|
|
|
43
43
|
const composedClasses = (0, _composeClasses.default)(slots, _switchClasses.getSwitchUtilityClass, classes);
|
|
44
44
|
return (0, _extends2.default)({}, classes, composedClasses);
|
|
45
45
|
};
|
|
46
|
-
const SwitchRoot = (0,
|
|
46
|
+
const SwitchRoot = (0, _zeroStyled.styled)('span', {
|
|
47
47
|
name: 'MuiSwitch',
|
|
48
48
|
slot: 'Root',
|
|
49
49
|
overridesResolver: (props, styles) => {
|
|
@@ -52,9 +52,7 @@ const SwitchRoot = (0, _styled.default)('span', {
|
|
|
52
52
|
} = props;
|
|
53
53
|
return [styles.root, ownerState.edge && styles[`edge${(0, _capitalize.default)(ownerState.edge)}`], styles[`size${(0, _capitalize.default)(ownerState.size)}`]];
|
|
54
54
|
}
|
|
55
|
-
})(
|
|
56
|
-
ownerState
|
|
57
|
-
}) => (0, _extends2.default)({
|
|
55
|
+
})({
|
|
58
56
|
display: 'inline-flex',
|
|
59
57
|
width: 34 + 12 * 2,
|
|
60
58
|
height: 14 + 12 * 2,
|
|
@@ -69,27 +67,43 @@ const SwitchRoot = (0, _styled.default)('span', {
|
|
|
69
67
|
// For correct alignment with the text.
|
|
70
68
|
'@media print': {
|
|
71
69
|
colorAdjust: 'exact'
|
|
72
|
-
}
|
|
73
|
-
}, ownerState.edge === 'start' && {
|
|
74
|
-
marginLeft: -8
|
|
75
|
-
}, ownerState.edge === 'end' && {
|
|
76
|
-
marginRight: -8
|
|
77
|
-
}, ownerState.size === 'small' && {
|
|
78
|
-
width: 40,
|
|
79
|
-
height: 24,
|
|
80
|
-
padding: 7,
|
|
81
|
-
[`& .${_switchClasses.default.thumb}`]: {
|
|
82
|
-
width: 16,
|
|
83
|
-
height: 16
|
|
84
70
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
variants: [{
|
|
72
|
+
props: {
|
|
73
|
+
edge: 'start'
|
|
74
|
+
},
|
|
75
|
+
style: {
|
|
76
|
+
marginLeft: -8
|
|
89
77
|
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
}, {
|
|
79
|
+
props: {
|
|
80
|
+
edge: 'end'
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
marginRight: -8
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
props: {
|
|
87
|
+
size: 'small'
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
width: 40,
|
|
91
|
+
height: 24,
|
|
92
|
+
padding: 7,
|
|
93
|
+
[`& .${_switchClasses.default.thumb}`]: {
|
|
94
|
+
width: 16,
|
|
95
|
+
height: 16
|
|
96
|
+
},
|
|
97
|
+
[`& .${_switchClasses.default.switchBase}`]: {
|
|
98
|
+
padding: 4,
|
|
99
|
+
[`&.${_switchClasses.default.checked}`]: {
|
|
100
|
+
transform: 'translateX(16px)'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}]
|
|
105
|
+
});
|
|
106
|
+
const SwitchSwitchBase = (0, _zeroStyled.styled)(_SwitchBase.default, {
|
|
93
107
|
name: 'MuiSwitch',
|
|
94
108
|
slot: 'SwitchBase',
|
|
95
109
|
overridesResolver: (props, styles) => {
|
|
@@ -129,34 +143,40 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
129
143
|
width: '300%'
|
|
130
144
|
}
|
|
131
145
|
}), ({
|
|
132
|
-
theme
|
|
133
|
-
|
|
134
|
-
}) => (0, _extends2.default)({
|
|
146
|
+
theme
|
|
147
|
+
}) => ({
|
|
135
148
|
'&:hover': {
|
|
136
149
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
137
150
|
// Reset on touch devices, it doesn't add specificity
|
|
138
151
|
'@media (hover: none)': {
|
|
139
152
|
backgroundColor: 'transparent'
|
|
140
153
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
[
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
147
|
-
'@media (hover: none)': {
|
|
148
|
-
backgroundColor: 'transparent'
|
|
149
|
-
}
|
|
154
|
+
},
|
|
155
|
+
variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light) // check all the used fields in the style below
|
|
156
|
+
.map(([color]) => ({
|
|
157
|
+
props: {
|
|
158
|
+
color
|
|
150
159
|
},
|
|
151
|
-
|
|
152
|
-
|
|
160
|
+
style: {
|
|
161
|
+
[`&.${_switchClasses.default.checked}`]: {
|
|
162
|
+
color: (theme.vars || theme).palette[color].main,
|
|
163
|
+
'&:hover': {
|
|
164
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette[color].main, theme.palette.action.hoverOpacity),
|
|
165
|
+
'@media (hover: none)': {
|
|
166
|
+
backgroundColor: 'transparent'
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
[`&.${_switchClasses.default.disabled}`]: {
|
|
170
|
+
color: theme.vars ? theme.vars.palette.Switch[`${color}DisabledColor`] : `${theme.palette.mode === 'light' ? (0, _colorManipulator.lighten)(theme.palette[color].main, 0.62) : (0, _colorManipulator.darken)(theme.palette[color].main, 0.55)}`
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
174
|
+
backgroundColor: (theme.vars || theme).palette[color].main
|
|
175
|
+
}
|
|
153
176
|
}
|
|
154
|
-
}
|
|
155
|
-
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
156
|
-
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
157
|
-
}
|
|
177
|
+
}))]
|
|
158
178
|
}));
|
|
159
|
-
const SwitchTrack = (0,
|
|
179
|
+
const SwitchTrack = (0, _zeroStyled.styled)('span', {
|
|
160
180
|
name: 'MuiSwitch',
|
|
161
181
|
slot: 'Track',
|
|
162
182
|
overridesResolver: (props, styles) => styles.track
|
|
@@ -173,7 +193,7 @@ const SwitchTrack = (0, _styled.default)('span', {
|
|
|
173
193
|
backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : `${theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white}`,
|
|
174
194
|
opacity: theme.vars ? theme.vars.opacity.switchTrack : `${theme.palette.mode === 'light' ? 0.38 : 0.3}`
|
|
175
195
|
}));
|
|
176
|
-
const SwitchThumb = (0,
|
|
196
|
+
const SwitchThumb = (0, _zeroStyled.styled)('span', {
|
|
177
197
|
name: 'MuiSwitch',
|
|
178
198
|
slot: 'Thumb',
|
|
179
199
|
overridesResolver: (props, styles) => styles.thumb
|
|
@@ -187,7 +207,7 @@ const SwitchThumb = (0, _styled.default)('span', {
|
|
|
187
207
|
borderRadius: '50%'
|
|
188
208
|
}));
|
|
189
209
|
const Switch = /*#__PURE__*/React.forwardRef(function Switch(inProps, ref) {
|
|
190
|
-
const props = (
|
|
210
|
+
const props = useThemeProps({
|
|
191
211
|
props: inProps,
|
|
192
212
|
name: 'MuiSwitch'
|
|
193
213
|
});
|
|
@@ -14,10 +14,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
15
|
var _utils = require("@mui/base/utils");
|
|
16
16
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
17
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
17
18
|
var _KeyboardArrowLeft = _interopRequireDefault(require("../internal/svg-icons/KeyboardArrowLeft"));
|
|
18
19
|
var _KeyboardArrowRight = _interopRequireDefault(require("../internal/svg-icons/KeyboardArrowRight"));
|
|
19
20
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
20
|
-
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
21
21
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
22
22
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
23
23
|
var _tabScrollButtonClasses = _interopRequireWildcard(require("./tabScrollButtonClasses"));
|
|
@@ -74,8 +74,7 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
74
74
|
direction
|
|
75
75
|
} = props,
|
|
76
76
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
77
|
-
const
|
|
78
|
-
const isRtl = theme.direction === 'rtl';
|
|
77
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
79
78
|
const ownerState = (0, _extends2.default)({
|
|
80
79
|
isRtl
|
|
81
80
|
}, props);
|
|
@@ -10,9 +10,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
13
14
|
var _KeyboardArrowLeft = _interopRequireDefault(require("../internal/svg-icons/KeyboardArrowLeft"));
|
|
14
15
|
var _KeyboardArrowRight = _interopRequireDefault(require("../internal/svg-icons/KeyboardArrowRight"));
|
|
15
|
-
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
17
17
|
var _LastPage = _interopRequireDefault(require("../internal/svg-icons/LastPage"));
|
|
18
18
|
var _FirstPage = _interopRequireDefault(require("../internal/svg-icons/FirstPage"));
|
|
@@ -40,7 +40,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
40
40
|
slotProps = {}
|
|
41
41
|
} = props,
|
|
42
42
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
43
|
-
const
|
|
43
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
44
44
|
const handleFirstPageButtonClick = event => {
|
|
45
45
|
onPageChange(event, 0);
|
|
46
46
|
};
|
|
@@ -61,14 +61,14 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
61
61
|
const LastButtonIcon = (_slots$lastButtonIcon = slots.lastButtonIcon) != null ? _slots$lastButtonIcon : _LastPage.default;
|
|
62
62
|
const NextButtonIcon = (_slots$nextButtonIcon = slots.nextButtonIcon) != null ? _slots$nextButtonIcon : _KeyboardArrowRight.default;
|
|
63
63
|
const PreviousButtonIcon = (_slots$previousButton2 = slots.previousButtonIcon) != null ? _slots$previousButton2 : _KeyboardArrowLeft.default;
|
|
64
|
-
const FirstButtonSlot =
|
|
65
|
-
const PreviousButtonSlot =
|
|
66
|
-
const NextButtonSlot =
|
|
67
|
-
const LastButtonSlot =
|
|
68
|
-
const firstButtonSlotProps =
|
|
69
|
-
const previousButtonSlotProps =
|
|
70
|
-
const nextButtonSlotProps =
|
|
71
|
-
const lastButtonSlotProps =
|
|
64
|
+
const FirstButtonSlot = isRtl ? LastButton : FirstButton;
|
|
65
|
+
const PreviousButtonSlot = isRtl ? NextButton : PreviousButton;
|
|
66
|
+
const NextButtonSlot = isRtl ? PreviousButton : NextButton;
|
|
67
|
+
const LastButtonSlot = isRtl ? FirstButton : LastButton;
|
|
68
|
+
const firstButtonSlotProps = isRtl ? slotProps.lastButton : slotProps.firstButton;
|
|
69
|
+
const previousButtonSlotProps = isRtl ? slotProps.nextButton : slotProps.previousButton;
|
|
70
|
+
const nextButtonSlotProps = isRtl ? slotProps.previousButton : slotProps.nextButton;
|
|
71
|
+
const lastButtonSlotProps = isRtl ? slotProps.firstButton : slotProps.lastButton;
|
|
72
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
|
|
73
73
|
ref: ref
|
|
74
74
|
}, other, {
|
|
@@ -78,7 +78,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
78
78
|
"aria-label": getItemAriaLabel('first', page),
|
|
79
79
|
title: getItemAriaLabel('first', page)
|
|
80
80
|
}, firstButtonSlotProps, {
|
|
81
|
-
children:
|
|
81
|
+
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LastButtonIcon, (0, _extends2.default)({}, slotProps.lastButtonIcon)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(FirstButtonIcon, (0, _extends2.default)({}, slotProps.firstButtonIcon))
|
|
82
82
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviousButtonSlot, (0, _extends2.default)({
|
|
83
83
|
onClick: handleBackButtonClick,
|
|
84
84
|
disabled: disabled || page === 0,
|
|
@@ -86,7 +86,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
86
86
|
"aria-label": getItemAriaLabel('previous', page),
|
|
87
87
|
title: getItemAriaLabel('previous', page)
|
|
88
88
|
}, previousButtonSlotProps != null ? previousButtonSlotProps : backIconButtonProps, {
|
|
89
|
-
children:
|
|
89
|
+
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButtonIcon, (0, _extends2.default)({}, slotProps.nextButtonIcon)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviousButtonIcon, (0, _extends2.default)({}, slotProps.previousButtonIcon))
|
|
90
90
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButtonSlot, (0, _extends2.default)({
|
|
91
91
|
onClick: handleNextButtonClick,
|
|
92
92
|
disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
|
|
@@ -94,14 +94,14 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
94
94
|
"aria-label": getItemAriaLabel('next', page),
|
|
95
95
|
title: getItemAriaLabel('next', page)
|
|
96
96
|
}, nextButtonSlotProps != null ? nextButtonSlotProps : nextIconButtonProps, {
|
|
97
|
-
children:
|
|
97
|
+
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviousButtonIcon, (0, _extends2.default)({}, slotProps.previousButtonIcon)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NextButtonIcon, (0, _extends2.default)({}, slotProps.nextButtonIcon))
|
|
98
98
|
})), showLastButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(LastButtonSlot, (0, _extends2.default)({
|
|
99
99
|
onClick: handleLastPageButtonClick,
|
|
100
100
|
disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
|
|
101
101
|
"aria-label": getItemAriaLabel('last', page),
|
|
102
102
|
title: getItemAriaLabel('last', page)
|
|
103
103
|
}, lastButtonSlotProps, {
|
|
104
|
-
children:
|
|
104
|
+
children: isRtl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(FirstButtonIcon, (0, _extends2.default)({}, slotProps.firstButtonIcon)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(LastButtonIcon, (0, _extends2.default)({}, slotProps.lastButtonIcon))
|
|
105
105
|
}))]
|
|
106
106
|
}));
|
|
107
107
|
});
|
package/node/Tabs/Tabs.js
CHANGED
|
@@ -15,6 +15,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
15
15
|
var _refType = _interopRequireDefault(require("@mui/utils/refType"));
|
|
16
16
|
var _utils = require("@mui/base/utils");
|
|
17
17
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
18
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
18
19
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
19
20
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
20
21
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
@@ -216,7 +217,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
216
217
|
name: 'MuiTabs'
|
|
217
218
|
});
|
|
218
219
|
const theme = (0, _useTheme.default)();
|
|
219
|
-
const isRtl =
|
|
220
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
220
221
|
const {
|
|
221
222
|
'aria-label': ariaLabel,
|
|
222
223
|
'aria-labelledby': ariaLabelledBy,
|
|
@@ -304,7 +305,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
304
305
|
clientWidth: tabsNode.clientWidth,
|
|
305
306
|
scrollLeft: tabsNode.scrollLeft,
|
|
306
307
|
scrollTop: tabsNode.scrollTop,
|
|
307
|
-
scrollLeftNormalized: (0, _scrollLeft.getNormalizedScrollLeft)(tabsNode,
|
|
308
|
+
scrollLeftNormalized: (0, _scrollLeft.getNormalizedScrollLeft)(tabsNode, isRtl ? 'rtl' : 'ltr'),
|
|
308
309
|
scrollWidth: tabsNode.scrollWidth,
|
|
309
310
|
top: rect.top,
|
|
310
311
|
bottom: rect.bottom,
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -17,6 +17,7 @@ var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcc
|
|
|
17
17
|
var _utils = require("@mui/base/utils");
|
|
18
18
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
19
19
|
var _colorManipulator = require("@mui/system/colorManipulator");
|
|
20
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
20
21
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
21
22
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
22
23
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
@@ -214,11 +215,11 @@ function testReset() {
|
|
|
214
215
|
hystersisTimer.clear();
|
|
215
216
|
}
|
|
216
217
|
function composeEventHandler(handler, eventHandler) {
|
|
217
|
-
return event => {
|
|
218
|
+
return (event, ...params) => {
|
|
218
219
|
if (eventHandler) {
|
|
219
|
-
eventHandler(event);
|
|
220
|
+
eventHandler(event, ...params);
|
|
220
221
|
}
|
|
221
|
-
handler(event);
|
|
222
|
+
handler(event, ...params);
|
|
222
223
|
};
|
|
223
224
|
}
|
|
224
225
|
|
|
@@ -265,7 +266,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
265
266
|
children: childrenProp
|
|
266
267
|
});
|
|
267
268
|
const theme = (0, _useTheme.default)();
|
|
268
|
-
const isRtl =
|
|
269
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
269
270
|
const [childNode, setChildNode] = React.useState();
|
|
270
271
|
const [arrowRef, setArrowRef] = React.useState(null);
|
|
271
272
|
const ignoreNonTouchEvents = React.useRef(false);
|
package/node/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function setColorChannel(obj, key) {
|
|
|
48
48
|
if (!(`${key}Channel` in obj)) {
|
|
49
49
|
// custom channel token is not provided, generate one.
|
|
50
50
|
// if channel token can't be generated, show a warning.
|
|
51
|
-
obj[`${key}Channel`] = (0, _colorManipulator.private_safeColorChannel)(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format,
|
|
51
|
+
obj[`${key}Channel`] = (0, _colorManipulator.private_safeColorChannel)(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
const silent = fn => {
|
|
@@ -256,6 +256,9 @@ function extendTheme(options = {}, ...args) {
|
|
|
256
256
|
|
|
257
257
|
// MUI X - DataGrid needs this token.
|
|
258
258
|
setColorChannel(palette.background, 'default');
|
|
259
|
+
|
|
260
|
+
// added for consistency with the `background.default` token
|
|
261
|
+
setColorChannel(palette.background, 'paper');
|
|
259
262
|
setColorChannel(palette.common, 'background');
|
|
260
263
|
setColorChannel(palette.common, 'onBackground');
|
|
261
264
|
setColorChannel(palette, 'divider');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _slotShouldForwardProp = _interopRequireDefault(require("./slotShouldForwardProp"));
|
|
9
|
+
const rootShouldForwardProp = prop => (0, _slotShouldForwardProp.default)(prop) && prop !== 'classes';
|
|
10
|
+
var _default = exports.default = rootShouldForwardProp;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
// copied from @mui/system/createStyled
|
|
8
|
+
function slotShouldForwardProp(prop) {
|
|
9
|
+
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
10
|
+
}
|
|
11
|
+
var _default = exports.default = slotShouldForwardProp;
|
package/node/styles/styled.js
CHANGED
|
@@ -5,18 +5,27 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
Object.defineProperty(exports, "rootShouldForwardProp", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _rootShouldForwardProp.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "slotShouldForwardProp", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _slotShouldForwardProp.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _createStyled = _interopRequireDefault(require("@mui/system/createStyled"));
|
|
10
22
|
var _defaultTheme = _interopRequireDefault(require("./defaultTheme"));
|
|
11
23
|
var _identifier = _interopRequireDefault(require("./identifier"));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const rootShouldForwardProp = prop => (0, _createStyled.shouldForwardProp)(prop) && prop !== 'classes';
|
|
15
|
-
exports.rootShouldForwardProp = rootShouldForwardProp;
|
|
16
|
-
const slotShouldForwardProp = exports.slotShouldForwardProp = _createStyled.shouldForwardProp;
|
|
24
|
+
var _rootShouldForwardProp = _interopRequireDefault(require("./rootShouldForwardProp"));
|
|
25
|
+
var _slotShouldForwardProp = _interopRequireDefault(require("./slotShouldForwardProp"));
|
|
17
26
|
const styled = (0, _createStyled.default)({
|
|
18
27
|
themeId: _identifier.default,
|
|
19
28
|
defaultTheme: _defaultTheme.default,
|
|
20
|
-
rootShouldForwardProp
|
|
29
|
+
rootShouldForwardProp: _rootShouldForwardProp.default
|
|
21
30
|
});
|
|
22
31
|
var _default = exports.default = styled;
|
|
@@ -67,7 +67,7 @@ function usePagination(props = {}) {
|
|
|
67
67
|
endPages.length > 0 ? endPages[0] - 2 : count - 1);
|
|
68
68
|
|
|
69
69
|
// Basic list of items to render
|
|
70
|
-
//
|
|
70
|
+
// for example itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
|
|
71
71
|
const itemList = [...(showFirstButton ? ['first'] : []), ...(hidePrevButton ? [] : ['previous']), ...startPages,
|
|
72
72
|
// Start ellipsis
|
|
73
73
|
// eslint-disable-next-line no-nested-ternary
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"prop-types": "^15.8.1",
|
|
35
35
|
"react-is": "^18.2.0",
|
|
36
36
|
"react-transition-group": "^4.4.5",
|
|
37
|
-
"@mui/base": "5.0.0-beta.
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/core-downloads-tracker": "^5.15.
|
|
37
|
+
"@mui/base": "5.0.0-beta.40",
|
|
38
|
+
"@mui/system": "^5.15.14",
|
|
39
|
+
"@mui/utils": "^5.15.14",
|
|
40
|
+
"@mui/types": "^7.2.14",
|
|
41
|
+
"@mui/core-downloads-tracker": "^5.15.14"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -38,7 +38,7 @@ function setColorChannel(obj, key) {
|
|
|
38
38
|
if (!(`${key}Channel` in obj)) {
|
|
39
39
|
// custom channel token is not provided, generate one.
|
|
40
40
|
// if channel token can't be generated, show a warning.
|
|
41
|
-
obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format,
|
|
41
|
+
obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const silent = fn => {
|
|
@@ -245,6 +245,9 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
245
245
|
|
|
246
246
|
// MUI X - DataGrid needs this token.
|
|
247
247
|
setColorChannel(palette.background, 'default');
|
|
248
|
+
|
|
249
|
+
// added for consistency with the `background.default` token
|
|
250
|
+
setColorChannel(palette.background, 'paper');
|
|
248
251
|
setColorChannel(palette.common, 'background');
|
|
249
252
|
setColorChannel(palette.common, 'onBackground');
|
|
250
253
|
setColorChannel(palette, 'divider');
|
package/styles/styled.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CreateMUIStyled } from '@mui/system';
|
|
2
2
|
import { Theme } from './createTheme';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export function slotShouldForwardProp(prop: string): boolean;
|
|
4
|
+
export { default as slotShouldForwardProp } from './slotShouldForwardProp';
|
|
5
|
+
export { default as rootShouldForwardProp } from './rootShouldForwardProp';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Custom styled utility that has a default MUI theme.
|
package/styles/styled.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import createStyled
|
|
3
|
+
import createStyled from '@mui/system/createStyled';
|
|
4
4
|
import defaultTheme from './defaultTheme';
|
|
5
5
|
import THEME_ID from './identifier';
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
import rootShouldForwardProp from './rootShouldForwardProp';
|
|
7
|
+
export { default as slotShouldForwardProp } from './slotShouldForwardProp';
|
|
8
|
+
export { default as rootShouldForwardProp } from './rootShouldForwardProp';
|
|
8
9
|
const styled = createStyled({
|
|
9
10
|
themeId: THEME_ID,
|
|
10
11
|
defaultTheme,
|