@mui/material 6.4.0 → 6.4.2
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/AppBar/AppBar.d.ts +1 -1
- package/ButtonBase/ButtonBase.d.ts +2 -0
- package/ButtonGroup/ButtonGroupButtonContext.js +2 -0
- package/ButtonGroup/ButtonGroupContext.js +2 -0
- package/CHANGELOG.md +69 -0
- package/Card/Card.d.ts +1 -1
- package/Dialog/Dialog.d.ts +85 -1
- package/Dialog/Dialog.js +91 -20
- package/Dialog/DialogContext.js +2 -0
- package/Drawer/Drawer.js +1 -1
- package/Drawer/drawerClasses.d.ts +32 -8
- package/Drawer/drawerClasses.js +1 -1
- package/FormControl/FormControl.js +9 -7
- package/FormControl/FormControlContext.js +2 -0
- package/Hidden/withWidth.js +2 -0
- package/IconButton/IconButton.d.ts +3 -2
- package/IconButton/IconButton.js +18 -7
- package/IconButton/iconButtonClasses.d.ts +2 -0
- package/IconButton/iconButtonClasses.js +1 -1
- package/OverridableComponent/index.d.ts +41 -0
- package/OverridableComponent/index.js +1 -0
- package/OverridableComponent/package.json +6 -0
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/RadioGroup/RadioGroupContext.js +2 -0
- package/Slider/useSlider.js +2 -2
- package/Step/StepContext.js +2 -0
- package/Stepper/StepperContext.js +2 -0
- package/Table/Tablelvl2Context.js +2 -0
- package/TextareaAutosize/TextareaAutosize.js +50 -40
- package/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +2 -0
- package/ToggleButtonGroup/ToggleButtonGroupContext.js +2 -0
- package/index.js +1 -1
- package/modern/ButtonGroup/ButtonGroupButtonContext.js +2 -0
- package/modern/ButtonGroup/ButtonGroupContext.js +2 -0
- package/modern/Dialog/Dialog.js +91 -20
- package/modern/Dialog/DialogContext.js +2 -0
- package/modern/Drawer/Drawer.js +1 -1
- package/modern/Drawer/drawerClasses.js +1 -1
- package/modern/FormControl/FormControl.js +9 -7
- package/modern/FormControl/FormControlContext.js +2 -0
- package/modern/Hidden/withWidth.js +2 -0
- package/modern/IconButton/IconButton.js +18 -7
- package/modern/IconButton/iconButtonClasses.js +1 -1
- package/modern/OverridableComponent/index.js +1 -0
- package/modern/RadioGroup/RadioGroupContext.js +2 -0
- package/modern/Slider/useSlider.js +2 -2
- package/modern/Step/StepContext.js +2 -0
- package/modern/Stepper/StepperContext.js +2 -0
- package/modern/Table/Tablelvl2Context.js +2 -0
- package/modern/TextareaAutosize/TextareaAutosize.js +50 -40
- package/modern/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +2 -0
- package/modern/ToggleButtonGroup/ToggleButtonGroupContext.js +2 -0
- package/modern/index.js +1 -1
- package/modern/styles/components.js +1 -0
- package/modern/styles/overrides.js +1 -0
- package/modern/styles/props.js +1 -0
- package/modern/styles/variants.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +13 -10
- package/modern/version/index.js +2 -2
- package/node/ButtonGroup/ButtonGroupButtonContext.js +1 -0
- package/node/ButtonGroup/ButtonGroupContext.js +1 -0
- package/node/Dialog/Dialog.js +91 -20
- package/node/Dialog/DialogContext.js +1 -0
- package/node/Drawer/Drawer.js +1 -1
- package/node/Drawer/drawerClasses.js +1 -1
- package/node/FormControl/FormControl.js +9 -7
- package/node/FormControl/FormControlContext.js +1 -0
- package/node/Hidden/withWidth.js +1 -0
- package/node/IconButton/IconButton.js +18 -7
- package/node/IconButton/iconButtonClasses.js +1 -1
- package/node/OverridableComponent/index.js +5 -0
- package/node/RadioGroup/RadioGroupContext.js +1 -0
- package/node/Slider/useSlider.js +2 -2
- package/node/Step/StepContext.js +1 -0
- package/node/Stepper/StepperContext.js +1 -0
- package/node/Table/Tablelvl2Context.js +1 -0
- package/node/TextareaAutosize/TextareaAutosize.js +50 -40
- package/node/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +1 -0
- package/node/ToggleButtonGroup/ToggleButtonGroupContext.js +1 -0
- package/node/index.js +1 -1
- package/node/styles/components.js +5 -0
- package/node/styles/overrides.js +5 -0
- package/node/styles/props.js +5 -0
- package/node/styles/variants.js +5 -0
- package/node/useAutocomplete/useAutocomplete.js +13 -10
- package/node/version/index.js +2 -2
- package/package.json +5 -5
- package/styles/components.d.ts +590 -591
- package/styles/components.js +1 -0
- package/styles/createThemeNoVars.d.ts +1 -1
- package/styles/overrides.d.ts +123 -142
- package/styles/overrides.js +1 -0
- package/styles/props.d.ts +120 -122
- package/styles/props.js +1 -0
- package/styles/variants.d.ts +7 -10
- package/styles/variants.js +1 -0
- package/useAutocomplete/useAutocomplete.js +13 -10
- package/version/index.js +2 -2
- package/OverridableComponent.d.ts +0 -67
|
@@ -22,8 +22,15 @@ const styles = {
|
|
|
22
22
|
transform: 'translateZ(0)'
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
function isObjectEmpty(object) {
|
|
26
|
+
// eslint-disable-next-line
|
|
27
|
+
for (const _ in object) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
25
32
|
function isEmpty(obj) {
|
|
26
|
-
return
|
|
33
|
+
return isObjectEmpty(obj) || obj.outerHeightStyle === 0 && !obj.overflowing;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
/**
|
|
@@ -48,14 +55,18 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
48
55
|
const {
|
|
49
56
|
current: isControlled
|
|
50
57
|
} = React.useRef(value != null);
|
|
51
|
-
const
|
|
52
|
-
const handleRef = useForkRef(forwardedRef,
|
|
58
|
+
const textareaRef = React.useRef(null);
|
|
59
|
+
const handleRef = useForkRef(forwardedRef, textareaRef);
|
|
53
60
|
const heightRef = React.useRef(null);
|
|
54
|
-
const
|
|
61
|
+
const hiddenTextareaRef = React.useRef(null);
|
|
55
62
|
const calculateTextareaStyles = React.useCallback(() => {
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
63
|
+
const textarea = textareaRef.current;
|
|
64
|
+
const hiddenTextarea = hiddenTextareaRef.current;
|
|
65
|
+
if (!textarea || !hiddenTextarea) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const containerWindow = ownerWindow(textarea);
|
|
69
|
+
const computedStyle = containerWindow.getComputedStyle(textarea);
|
|
59
70
|
|
|
60
71
|
// If input's width is shrunk and it's not visible, don't sync height.
|
|
61
72
|
if (computedStyle.width === '0px') {
|
|
@@ -64,25 +75,24 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
64
75
|
overflowing: false
|
|
65
76
|
};
|
|
66
77
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (inputShallow.value.slice(-1) === '\n') {
|
|
78
|
+
hiddenTextarea.style.width = computedStyle.width;
|
|
79
|
+
hiddenTextarea.value = textarea.value || props.placeholder || 'x';
|
|
80
|
+
if (hiddenTextarea.value.slice(-1) === '\n') {
|
|
71
81
|
// Certain fonts which overflow the line height will cause the textarea
|
|
72
82
|
// to report a different scrollHeight depending on whether the last line
|
|
73
83
|
// is empty. Make it non-empty to avoid this issue.
|
|
74
|
-
|
|
84
|
+
hiddenTextarea.value += ' ';
|
|
75
85
|
}
|
|
76
86
|
const boxSizing = computedStyle.boxSizing;
|
|
77
87
|
const padding = getStyleValue(computedStyle.paddingBottom) + getStyleValue(computedStyle.paddingTop);
|
|
78
88
|
const border = getStyleValue(computedStyle.borderBottomWidth) + getStyleValue(computedStyle.borderTopWidth);
|
|
79
89
|
|
|
80
90
|
// The height of the inner content
|
|
81
|
-
const innerHeight =
|
|
91
|
+
const innerHeight = hiddenTextarea.scrollHeight;
|
|
82
92
|
|
|
83
93
|
// Measure height of a textarea with a single row
|
|
84
|
-
|
|
85
|
-
const singleRowHeight =
|
|
94
|
+
hiddenTextarea.value = 'x';
|
|
95
|
+
const singleRowHeight = hiddenTextarea.scrollHeight;
|
|
86
96
|
|
|
87
97
|
// The height of the outer content
|
|
88
98
|
let outerHeight = innerHeight;
|
|
@@ -103,45 +113,45 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
103
113
|
};
|
|
104
114
|
}, [maxRows, minRows, props.placeholder]);
|
|
105
115
|
const syncHeight = React.useCallback(() => {
|
|
116
|
+
const textarea = textareaRef.current;
|
|
106
117
|
const textareaStyles = calculateTextareaStyles();
|
|
107
|
-
if (isEmpty(textareaStyles)) {
|
|
118
|
+
if (!textarea || !textareaStyles || isEmpty(textareaStyles)) {
|
|
108
119
|
return;
|
|
109
120
|
}
|
|
110
121
|
const outerHeightStyle = textareaStyles.outerHeightStyle;
|
|
111
|
-
const input = inputRef.current;
|
|
112
122
|
if (heightRef.current !== outerHeightStyle) {
|
|
113
123
|
heightRef.current = outerHeightStyle;
|
|
114
|
-
|
|
124
|
+
textarea.style.height = `${outerHeightStyle}px`;
|
|
115
125
|
}
|
|
116
|
-
|
|
126
|
+
textarea.style.overflow = textareaStyles.overflowing ? 'hidden' : '';
|
|
117
127
|
}, [calculateTextareaStyles]);
|
|
128
|
+
const frameRef = React.useRef(-1);
|
|
118
129
|
useEnhancedEffect(() => {
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// Also see https://github.com/mui/mui-x/issues/8733
|
|
126
|
-
let rAF;
|
|
127
|
-
const rAFHandleResize = () => {
|
|
128
|
-
cancelAnimationFrame(rAF);
|
|
129
|
-
rAF = requestAnimationFrame(() => {
|
|
130
|
-
handleResize();
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
const debounceHandleResize = debounce(handleResize);
|
|
134
|
-
const input = inputRef.current;
|
|
135
|
-
const containerWindow = ownerWindow(input);
|
|
130
|
+
const debounceHandleResize = debounce(() => syncHeight());
|
|
131
|
+
const textarea = textareaRef?.current;
|
|
132
|
+
if (!textarea) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
const containerWindow = ownerWindow(textarea);
|
|
136
136
|
containerWindow.addEventListener('resize', debounceHandleResize);
|
|
137
137
|
let resizeObserver;
|
|
138
138
|
if (typeof ResizeObserver !== 'undefined') {
|
|
139
|
-
resizeObserver = new ResizeObserver(
|
|
140
|
-
|
|
139
|
+
resizeObserver = new ResizeObserver(() => {
|
|
140
|
+
// avoid "ResizeObserver loop completed with undelivered notifications" error
|
|
141
|
+
// by temporarily unobserving the textarea element while manipulating the height
|
|
142
|
+
// and reobserving one frame later
|
|
143
|
+
resizeObserver.unobserve(textarea);
|
|
144
|
+
cancelAnimationFrame(frameRef.current);
|
|
145
|
+
syncHeight();
|
|
146
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
147
|
+
resizeObserver.observe(textarea);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
resizeObserver.observe(textarea);
|
|
141
151
|
}
|
|
142
152
|
return () => {
|
|
143
153
|
debounceHandleResize.clear();
|
|
144
|
-
cancelAnimationFrame(
|
|
154
|
+
cancelAnimationFrame(frameRef.current);
|
|
145
155
|
containerWindow.removeEventListener('resize', debounceHandleResize);
|
|
146
156
|
if (resizeObserver) {
|
|
147
157
|
resizeObserver.disconnect();
|
|
@@ -173,7 +183,7 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
173
183
|
"aria-hidden": true,
|
|
174
184
|
className: props.className,
|
|
175
185
|
readOnly: true,
|
|
176
|
-
ref:
|
|
186
|
+
ref: hiddenTextareaRef,
|
|
177
187
|
tabIndex: -1,
|
|
178
188
|
style: {
|
|
179
189
|
...styles.shadow,
|
package/modern/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -47,6 +47,13 @@ const defaultFilterOptions = createFilterOptions();
|
|
|
47
47
|
const pageSize = 5;
|
|
48
48
|
const defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && listboxRef.current.parentElement?.contains(document.activeElement);
|
|
49
49
|
const MULTIPLE_DEFAULT_VALUE = [];
|
|
50
|
+
function getInputValue(value, multiple, getOptionLabel) {
|
|
51
|
+
if (multiple || value == null) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
const optionLabel = getOptionLabel(value);
|
|
55
|
+
return typeof optionLabel === 'string' ? optionLabel : '';
|
|
56
|
+
}
|
|
50
57
|
function useAutocomplete(props) {
|
|
51
58
|
const {
|
|
52
59
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -112,6 +119,10 @@ function useAutocomplete(props) {
|
|
|
112
119
|
const [focusedTag, setFocusedTag] = React.useState(-1);
|
|
113
120
|
const defaultHighlighted = autoHighlight ? 0 : -1;
|
|
114
121
|
const highlightedIndexRef = React.useRef(defaultHighlighted);
|
|
122
|
+
|
|
123
|
+
// Calculate the initial inputValue on mount only.
|
|
124
|
+
// Using useRef since defaultValue doesn't need to update inputValue dynamically.
|
|
125
|
+
const initialInputValue = React.useRef(getInputValue(defaultValue, multiple, getOptionLabel)).current;
|
|
115
126
|
const [value, setValueState] = useControlled({
|
|
116
127
|
controlled: valueProp,
|
|
117
128
|
default: defaultValue,
|
|
@@ -119,7 +130,7 @@ function useAutocomplete(props) {
|
|
|
119
130
|
});
|
|
120
131
|
const [inputValue, setInputValueState] = useControlled({
|
|
121
132
|
controlled: inputValueProp,
|
|
122
|
-
default:
|
|
133
|
+
default: initialInputValue,
|
|
123
134
|
name: componentName,
|
|
124
135
|
state: 'inputValue'
|
|
125
136
|
});
|
|
@@ -131,15 +142,7 @@ function useAutocomplete(props) {
|
|
|
131
142
|
if (!isOptionSelected && !clearOnBlur) {
|
|
132
143
|
return;
|
|
133
144
|
}
|
|
134
|
-
|
|
135
|
-
if (multiple) {
|
|
136
|
-
newInputValue = '';
|
|
137
|
-
} else if (newValue == null) {
|
|
138
|
-
newInputValue = '';
|
|
139
|
-
} else {
|
|
140
|
-
const optionLabel = getOptionLabel(newValue);
|
|
141
|
-
newInputValue = typeof optionLabel === 'string' ? optionLabel : '';
|
|
142
|
-
}
|
|
145
|
+
const newInputValue = getInputValue(newValue, multiple, getOptionLabel);
|
|
143
146
|
if (inputValue === newInputValue) {
|
|
144
147
|
return;
|
|
145
148
|
}
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.2";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("2");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
package/node/Dialog/Dialog.js
CHANGED
|
@@ -22,6 +22,7 @@ var _Backdrop = _interopRequireDefault(require("../Backdrop"));
|
|
|
22
22
|
var _zeroStyled = require("../zero-styled");
|
|
23
23
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
24
24
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
25
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
27
|
const DialogBackdrop = (0, _zeroStyled.styled)(_Backdrop.default, {
|
|
27
28
|
name: 'MuiDialog',
|
|
@@ -225,6 +226,8 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
225
226
|
PaperComponent = _Paper.default,
|
|
226
227
|
PaperProps = {},
|
|
227
228
|
scroll = 'paper',
|
|
229
|
+
slots = {},
|
|
230
|
+
slotProps = {},
|
|
228
231
|
TransitionComponent = _Fade.default,
|
|
229
232
|
transitionDuration = defaultTransitionDuration,
|
|
230
233
|
TransitionProps,
|
|
@@ -268,46 +271,89 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
268
271
|
titleId: ariaLabelledby
|
|
269
272
|
};
|
|
270
273
|
}, [ariaLabelledby]);
|
|
271
|
-
|
|
274
|
+
const backwardCompatibleSlots = {
|
|
275
|
+
transition: TransitionComponent,
|
|
276
|
+
...slots
|
|
277
|
+
};
|
|
278
|
+
const backwardCompatibleSlotProps = {
|
|
279
|
+
transition: TransitionProps,
|
|
280
|
+
paper: PaperProps,
|
|
281
|
+
backdrop: BackdropProps,
|
|
282
|
+
...slotProps
|
|
283
|
+
};
|
|
284
|
+
const externalForwardedProps = {
|
|
285
|
+
slots: backwardCompatibleSlots,
|
|
286
|
+
slotProps: backwardCompatibleSlotProps
|
|
287
|
+
};
|
|
288
|
+
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
289
|
+
elementType: DialogRoot,
|
|
290
|
+
shouldForwardComponentProp: true,
|
|
291
|
+
externalForwardedProps,
|
|
292
|
+
ownerState,
|
|
272
293
|
className: (0, _clsx.default)(classes.root, className),
|
|
294
|
+
ref
|
|
295
|
+
});
|
|
296
|
+
const [BackdropSlot, backdropSlotProps] = (0, _useSlot.default)('backdrop', {
|
|
297
|
+
elementType: DialogBackdrop,
|
|
298
|
+
shouldForwardComponentProp: true,
|
|
299
|
+
externalForwardedProps,
|
|
300
|
+
ownerState
|
|
301
|
+
});
|
|
302
|
+
const [PaperSlot, paperSlotProps] = (0, _useSlot.default)('paper', {
|
|
303
|
+
elementType: DialogPaper,
|
|
304
|
+
shouldForwardComponentProp: true,
|
|
305
|
+
externalForwardedProps,
|
|
306
|
+
ownerState,
|
|
307
|
+
className: (0, _clsx.default)(classes.paper, PaperProps.className)
|
|
308
|
+
});
|
|
309
|
+
const [ContainerSlot, containerSlotProps] = (0, _useSlot.default)('container', {
|
|
310
|
+
elementType: DialogContainer,
|
|
311
|
+
externalForwardedProps,
|
|
312
|
+
ownerState,
|
|
313
|
+
className: (0, _clsx.default)(classes.container)
|
|
314
|
+
});
|
|
315
|
+
const [TransitionSlot, transitionSlotProps] = (0, _useSlot.default)('transition', {
|
|
316
|
+
elementType: _Fade.default,
|
|
317
|
+
externalForwardedProps,
|
|
318
|
+
ownerState,
|
|
319
|
+
additionalProps: {
|
|
320
|
+
appear: true,
|
|
321
|
+
in: open,
|
|
322
|
+
timeout: transitionDuration,
|
|
323
|
+
role: 'presentation'
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, {
|
|
273
327
|
closeAfterTransition: true,
|
|
274
|
-
|
|
275
|
-
|
|
328
|
+
slots: {
|
|
329
|
+
backdrop: BackdropSlot
|
|
276
330
|
},
|
|
277
|
-
|
|
331
|
+
slotProps: {
|
|
278
332
|
backdrop: {
|
|
279
333
|
transitionDuration,
|
|
280
334
|
as: BackdropComponent,
|
|
281
|
-
...
|
|
335
|
+
...backdropSlotProps
|
|
282
336
|
}
|
|
283
337
|
},
|
|
284
338
|
disableEscapeKeyDown: disableEscapeKeyDown,
|
|
285
339
|
onClose: onClose,
|
|
286
340
|
open: open,
|
|
287
|
-
ref: ref,
|
|
288
341
|
onClick: handleBackdropClick,
|
|
289
|
-
|
|
342
|
+
...rootSlotProps,
|
|
290
343
|
...other,
|
|
291
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
timeout: transitionDuration,
|
|
295
|
-
role: "presentation",
|
|
296
|
-
...TransitionProps,
|
|
297
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogContainer, {
|
|
298
|
-
className: (0, _clsx.default)(classes.container),
|
|
344
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
345
|
+
...transitionSlotProps,
|
|
346
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ContainerSlot, {
|
|
299
347
|
onMouseDown: handleMouseDown,
|
|
300
|
-
|
|
301
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
348
|
+
...containerSlotProps,
|
|
349
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PaperSlot, {
|
|
302
350
|
as: PaperComponent,
|
|
303
351
|
elevation: 24,
|
|
304
352
|
role: "dialog",
|
|
305
353
|
"aria-describedby": ariaDescribedby,
|
|
306
354
|
"aria-labelledby": ariaLabelledby,
|
|
307
355
|
"aria-modal": ariaModal,
|
|
308
|
-
...
|
|
309
|
-
className: (0, _clsx.default)(classes.paper, PaperProps.className),
|
|
310
|
-
ownerState: ownerState,
|
|
356
|
+
...paperSlotProps,
|
|
311
357
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogContext.default.Provider, {
|
|
312
358
|
value: dialogContextValue,
|
|
313
359
|
children: children
|
|
@@ -419,6 +465,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
419
465
|
/**
|
|
420
466
|
* Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
|
|
421
467
|
* @default {}
|
|
468
|
+
* @deprecated Use `slotProps.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
422
469
|
*/
|
|
423
470
|
PaperProps: _propTypes.default.object,
|
|
424
471
|
/**
|
|
@@ -426,6 +473,28 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
426
473
|
* @default 'paper'
|
|
427
474
|
*/
|
|
428
475
|
scroll: _propTypes.default.oneOf(['body', 'paper']),
|
|
476
|
+
/**
|
|
477
|
+
* The props used for each slot inside.
|
|
478
|
+
* @default {}
|
|
479
|
+
*/
|
|
480
|
+
slotProps: _propTypes.default.shape({
|
|
481
|
+
backdrop: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
482
|
+
container: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
483
|
+
paper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
484
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
485
|
+
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
486
|
+
}),
|
|
487
|
+
/**
|
|
488
|
+
* The components used for each slot inside.
|
|
489
|
+
* @default {}
|
|
490
|
+
*/
|
|
491
|
+
slots: _propTypes.default.shape({
|
|
492
|
+
backdrop: _propTypes.default.elementType,
|
|
493
|
+
container: _propTypes.default.elementType,
|
|
494
|
+
paper: _propTypes.default.elementType,
|
|
495
|
+
root: _propTypes.default.elementType,
|
|
496
|
+
transition: _propTypes.default.elementType
|
|
497
|
+
}),
|
|
429
498
|
/**
|
|
430
499
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
431
500
|
*/
|
|
@@ -434,6 +503,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
434
503
|
* The component used for the transition.
|
|
435
504
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
436
505
|
* @default Fade
|
|
506
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
437
507
|
*/
|
|
438
508
|
TransitionComponent: _propTypes.default.elementType,
|
|
439
509
|
/**
|
|
@@ -452,6 +522,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
452
522
|
/**
|
|
453
523
|
* Props applied to the transition element.
|
|
454
524
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
525
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
455
526
|
*/
|
|
456
527
|
TransitionProps: _propTypes.default.object
|
|
457
528
|
} : void 0;
|
package/node/Drawer/Drawer.js
CHANGED
|
@@ -38,7 +38,7 @@ const useUtilityClasses = ownerState => {
|
|
|
38
38
|
variant
|
|
39
39
|
} = ownerState;
|
|
40
40
|
const slots = {
|
|
41
|
-
root: ['root'],
|
|
41
|
+
root: ['root', `anchor${(0, _capitalize.default)(anchor)}`],
|
|
42
42
|
docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'],
|
|
43
43
|
modal: ['modal'],
|
|
44
44
|
paper: ['paper', `paperAnchor${(0, _capitalize.default)(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${(0, _capitalize.default)(anchor)}`]
|
|
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
|
|
|
11
11
|
function getDrawerUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiDrawer', slot);
|
|
13
13
|
}
|
|
14
|
-
const drawerClasses = (0, _generateUtilityClasses.default)('MuiDrawer', ['root', 'docked', 'paper', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
|
|
14
|
+
const drawerClasses = (0, _generateUtilityClasses.default)('MuiDrawer', ['root', 'docked', 'paper', 'anchorLeft', 'anchorRight', 'anchorTop', 'anchorBottom', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
|
|
15
15
|
var _default = exports.default = drawerClasses;
|
|
@@ -186,6 +186,12 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
+
const onFilled = React.useCallback(() => {
|
|
190
|
+
setFilled(true);
|
|
191
|
+
}, []);
|
|
192
|
+
const onEmpty = React.useCallback(() => {
|
|
193
|
+
setFilled(false);
|
|
194
|
+
}, []);
|
|
189
195
|
const childContext = React.useMemo(() => {
|
|
190
196
|
return {
|
|
191
197
|
adornedStart,
|
|
@@ -201,20 +207,16 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
201
207
|
onBlur: () => {
|
|
202
208
|
setFocused(false);
|
|
203
209
|
},
|
|
204
|
-
onEmpty: () => {
|
|
205
|
-
setFilled(false);
|
|
206
|
-
},
|
|
207
|
-
onFilled: () => {
|
|
208
|
-
setFilled(true);
|
|
209
|
-
},
|
|
210
210
|
onFocus: () => {
|
|
211
211
|
setFocused(true);
|
|
212
212
|
},
|
|
213
|
+
onEmpty,
|
|
214
|
+
onFilled,
|
|
213
215
|
registerEffect,
|
|
214
216
|
required,
|
|
215
217
|
variant
|
|
216
218
|
};
|
|
217
|
-
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
|
|
219
|
+
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, onEmpty, onFilled, required, size, variant]);
|
|
218
220
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlContext.default.Provider, {
|
|
219
221
|
value: childContext,
|
|
220
222
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FormControlRoot, {
|
package/node/Hidden/withWidth.js
CHANGED
|
@@ -34,7 +34,8 @@ const useUtilityClasses = ownerState => {
|
|
|
34
34
|
} = ownerState;
|
|
35
35
|
const slots = {
|
|
36
36
|
root: ['root', loading && 'loading', disabled && 'disabled', color !== 'default' && `color${(0, _capitalize.default)(color)}`, edge && `edge${(0, _capitalize.default)(edge)}`, `size${(0, _capitalize.default)(size)}`],
|
|
37
|
-
loadingIndicator: ['loadingIndicator']
|
|
37
|
+
loadingIndicator: ['loadingIndicator'],
|
|
38
|
+
loadingWrapper: ['loadingWrapper']
|
|
38
39
|
};
|
|
39
40
|
return (0, _composeClasses.default)(slots, _iconButtonClasses.getIconButtonUtilityClass, classes);
|
|
40
41
|
};
|
|
@@ -195,7 +196,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
195
196
|
disableFocusRipple = false,
|
|
196
197
|
size = 'medium',
|
|
197
198
|
id: idProp,
|
|
198
|
-
loading =
|
|
199
|
+
loading = null,
|
|
199
200
|
loadingIndicator: loadingIndicatorProp,
|
|
200
201
|
...other
|
|
201
202
|
} = props;
|
|
@@ -225,10 +226,19 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
225
226
|
ref: ref,
|
|
226
227
|
...other,
|
|
227
228
|
ownerState: ownerState,
|
|
228
|
-
children: [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
children: [typeof loading === 'boolean' &&
|
|
230
|
+
/*#__PURE__*/
|
|
231
|
+
// use plain HTML span to minimize the runtime overhead
|
|
232
|
+
(0, _jsxRuntime.jsx)("span", {
|
|
233
|
+
className: classes.loadingWrapper,
|
|
234
|
+
style: {
|
|
235
|
+
display: 'contents'
|
|
236
|
+
},
|
|
237
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButtonLoadingIndicator, {
|
|
238
|
+
className: classes.loadingIndicator,
|
|
239
|
+
ownerState: ownerState,
|
|
240
|
+
children: loading && loadingIndicator
|
|
241
|
+
})
|
|
232
242
|
}), children]
|
|
233
243
|
});
|
|
234
244
|
});
|
|
@@ -294,7 +304,8 @@ process.env.NODE_ENV !== "production" ? IconButton.propTypes /* remove-proptypes
|
|
|
294
304
|
id: _propTypes.default.string,
|
|
295
305
|
/**
|
|
296
306
|
* If `true`, the loading indicator is visible and the button is disabled.
|
|
297
|
-
*
|
|
307
|
+
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
|
|
308
|
+
* @default null
|
|
298
309
|
*/
|
|
299
310
|
loading: _propTypes.default.bool,
|
|
300
311
|
/**
|
|
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
|
|
|
11
11
|
function getIconButtonUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiIconButton', slot);
|
|
13
13
|
}
|
|
14
|
-
const iconButtonClasses = (0, _generateUtilityClasses.default)('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator']);
|
|
14
|
+
const iconButtonClasses = (0, _generateUtilityClasses.default)('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator', 'loadingWrapper']);
|
|
15
15
|
var _default = exports.default = iconButtonClasses;
|
package/node/Slider/useSlider.js
CHANGED
|
@@ -255,9 +255,9 @@ function useSlider(parameters) {
|
|
|
255
255
|
let newValue = valueInput;
|
|
256
256
|
if (marks && step == null) {
|
|
257
257
|
const maxMarksValue = marksValues[marksValues.length - 1];
|
|
258
|
-
if (newValue
|
|
258
|
+
if (newValue >= maxMarksValue) {
|
|
259
259
|
newValue = maxMarksValue;
|
|
260
|
-
} else if (newValue
|
|
260
|
+
} else if (newValue <= marksValues[0]) {
|
|
261
261
|
newValue = marksValues[0];
|
|
262
262
|
} else {
|
|
263
263
|
newValue = newValue < value ? marksValues[marksIndex - 1] : marksValues[marksIndex + 1];
|
package/node/Step/StepContext.js
CHANGED