@mui/material 6.4.0 → 6.4.1
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/ButtonBase/ButtonBase.d.ts +2 -0
- package/ButtonGroup/ButtonGroupButtonContext.js +2 -0
- package/ButtonGroup/ButtonGroupContext.js +2 -0
- package/CHANGELOG.md +42 -0
- 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/RadioGroup/RadioGroupContext.js +2 -0
- package/Step/StepContext.js +2 -0
- package/Stepper/StepperContext.js +2 -0
- package/Table/Tablelvl2Context.js +2 -0
- 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/RadioGroup/RadioGroupContext.js +2 -0
- package/modern/Step/StepContext.js +2 -0
- package/modern/Stepper/StepperContext.js +2 -0
- package/modern/Table/Tablelvl2Context.js +2 -0
- package/modern/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +2 -0
- package/modern/ToggleButtonGroup/ToggleButtonGroupContext.js +2 -0
- package/modern/index.js +1 -1
- 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/RadioGroup/RadioGroupContext.js +1 -0
- package/node/Step/StepContext.js +1 -0
- package/node/Stepper/StepperContext.js +1 -0
- package/node/Table/Tablelvl2Context.js +1 -0
- package/node/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +1 -0
- package/node/ToggleButtonGroup/ToggleButtonGroupContext.js +1 -0
- package/node/index.js +1 -1
- package/node/version/index.js +2 -2
- package/package.json +5 -5
- package/version/index.js +2 -2
package/modern/Dialog/Dialog.js
CHANGED
|
@@ -15,6 +15,7 @@ import Backdrop from "../Backdrop/index.js";
|
|
|
15
15
|
import { styled, useTheme } from "../zero-styled/index.js";
|
|
16
16
|
import memoTheme from "../utils/memoTheme.js";
|
|
17
17
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
18
|
+
import useSlot from "../utils/useSlot.js";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
const DialogBackdrop = styled(Backdrop, {
|
|
20
21
|
name: 'MuiDialog',
|
|
@@ -218,6 +219,8 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
218
219
|
PaperComponent = Paper,
|
|
219
220
|
PaperProps = {},
|
|
220
221
|
scroll = 'paper',
|
|
222
|
+
slots = {},
|
|
223
|
+
slotProps = {},
|
|
221
224
|
TransitionComponent = Fade,
|
|
222
225
|
transitionDuration = defaultTransitionDuration,
|
|
223
226
|
TransitionProps,
|
|
@@ -261,46 +264,89 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
261
264
|
titleId: ariaLabelledby
|
|
262
265
|
};
|
|
263
266
|
}, [ariaLabelledby]);
|
|
264
|
-
|
|
267
|
+
const backwardCompatibleSlots = {
|
|
268
|
+
transition: TransitionComponent,
|
|
269
|
+
...slots
|
|
270
|
+
};
|
|
271
|
+
const backwardCompatibleSlotProps = {
|
|
272
|
+
transition: TransitionProps,
|
|
273
|
+
paper: PaperProps,
|
|
274
|
+
backdrop: BackdropProps,
|
|
275
|
+
...slotProps
|
|
276
|
+
};
|
|
277
|
+
const externalForwardedProps = {
|
|
278
|
+
slots: backwardCompatibleSlots,
|
|
279
|
+
slotProps: backwardCompatibleSlotProps
|
|
280
|
+
};
|
|
281
|
+
const [RootSlot, rootSlotProps] = useSlot('root', {
|
|
282
|
+
elementType: DialogRoot,
|
|
283
|
+
shouldForwardComponentProp: true,
|
|
284
|
+
externalForwardedProps,
|
|
285
|
+
ownerState,
|
|
265
286
|
className: clsx(classes.root, className),
|
|
287
|
+
ref
|
|
288
|
+
});
|
|
289
|
+
const [BackdropSlot, backdropSlotProps] = useSlot('backdrop', {
|
|
290
|
+
elementType: DialogBackdrop,
|
|
291
|
+
shouldForwardComponentProp: true,
|
|
292
|
+
externalForwardedProps,
|
|
293
|
+
ownerState
|
|
294
|
+
});
|
|
295
|
+
const [PaperSlot, paperSlotProps] = useSlot('paper', {
|
|
296
|
+
elementType: DialogPaper,
|
|
297
|
+
shouldForwardComponentProp: true,
|
|
298
|
+
externalForwardedProps,
|
|
299
|
+
ownerState,
|
|
300
|
+
className: clsx(classes.paper, PaperProps.className)
|
|
301
|
+
});
|
|
302
|
+
const [ContainerSlot, containerSlotProps] = useSlot('container', {
|
|
303
|
+
elementType: DialogContainer,
|
|
304
|
+
externalForwardedProps,
|
|
305
|
+
ownerState,
|
|
306
|
+
className: clsx(classes.container)
|
|
307
|
+
});
|
|
308
|
+
const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
|
|
309
|
+
elementType: Fade,
|
|
310
|
+
externalForwardedProps,
|
|
311
|
+
ownerState,
|
|
312
|
+
additionalProps: {
|
|
313
|
+
appear: true,
|
|
314
|
+
in: open,
|
|
315
|
+
timeout: transitionDuration,
|
|
316
|
+
role: 'presentation'
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return /*#__PURE__*/_jsx(RootSlot, {
|
|
266
320
|
closeAfterTransition: true,
|
|
267
|
-
|
|
268
|
-
|
|
321
|
+
slots: {
|
|
322
|
+
backdrop: BackdropSlot
|
|
269
323
|
},
|
|
270
|
-
|
|
324
|
+
slotProps: {
|
|
271
325
|
backdrop: {
|
|
272
326
|
transitionDuration,
|
|
273
327
|
as: BackdropComponent,
|
|
274
|
-
...
|
|
328
|
+
...backdropSlotProps
|
|
275
329
|
}
|
|
276
330
|
},
|
|
277
331
|
disableEscapeKeyDown: disableEscapeKeyDown,
|
|
278
332
|
onClose: onClose,
|
|
279
333
|
open: open,
|
|
280
|
-
ref: ref,
|
|
281
334
|
onClick: handleBackdropClick,
|
|
282
|
-
|
|
335
|
+
...rootSlotProps,
|
|
283
336
|
...other,
|
|
284
|
-
children: /*#__PURE__*/_jsx(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
timeout: transitionDuration,
|
|
288
|
-
role: "presentation",
|
|
289
|
-
...TransitionProps,
|
|
290
|
-
children: /*#__PURE__*/_jsx(DialogContainer, {
|
|
291
|
-
className: clsx(classes.container),
|
|
337
|
+
children: /*#__PURE__*/_jsx(TransitionSlot, {
|
|
338
|
+
...transitionSlotProps,
|
|
339
|
+
children: /*#__PURE__*/_jsx(ContainerSlot, {
|
|
292
340
|
onMouseDown: handleMouseDown,
|
|
293
|
-
|
|
294
|
-
children: /*#__PURE__*/_jsx(
|
|
341
|
+
...containerSlotProps,
|
|
342
|
+
children: /*#__PURE__*/_jsx(PaperSlot, {
|
|
295
343
|
as: PaperComponent,
|
|
296
344
|
elevation: 24,
|
|
297
345
|
role: "dialog",
|
|
298
346
|
"aria-describedby": ariaDescribedby,
|
|
299
347
|
"aria-labelledby": ariaLabelledby,
|
|
300
348
|
"aria-modal": ariaModal,
|
|
301
|
-
...
|
|
302
|
-
className: clsx(classes.paper, PaperProps.className),
|
|
303
|
-
ownerState: ownerState,
|
|
349
|
+
...paperSlotProps,
|
|
304
350
|
children: /*#__PURE__*/_jsx(DialogContext.Provider, {
|
|
305
351
|
value: dialogContextValue,
|
|
306
352
|
children: children
|
|
@@ -412,6 +458,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
412
458
|
/**
|
|
413
459
|
* Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
|
|
414
460
|
* @default {}
|
|
461
|
+
* @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.
|
|
415
462
|
*/
|
|
416
463
|
PaperProps: PropTypes.object,
|
|
417
464
|
/**
|
|
@@ -419,6 +466,28 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
419
466
|
* @default 'paper'
|
|
420
467
|
*/
|
|
421
468
|
scroll: PropTypes.oneOf(['body', 'paper']),
|
|
469
|
+
/**
|
|
470
|
+
* The props used for each slot inside.
|
|
471
|
+
* @default {}
|
|
472
|
+
*/
|
|
473
|
+
slotProps: PropTypes.shape({
|
|
474
|
+
backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
475
|
+
container: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
476
|
+
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
477
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
478
|
+
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
479
|
+
}),
|
|
480
|
+
/**
|
|
481
|
+
* The components used for each slot inside.
|
|
482
|
+
* @default {}
|
|
483
|
+
*/
|
|
484
|
+
slots: PropTypes.shape({
|
|
485
|
+
backdrop: PropTypes.elementType,
|
|
486
|
+
container: PropTypes.elementType,
|
|
487
|
+
paper: PropTypes.elementType,
|
|
488
|
+
root: PropTypes.elementType,
|
|
489
|
+
transition: PropTypes.elementType
|
|
490
|
+
}),
|
|
422
491
|
/**
|
|
423
492
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
424
493
|
*/
|
|
@@ -427,6 +496,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
427
496
|
* The component used for the transition.
|
|
428
497
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
429
498
|
* @default Fade
|
|
499
|
+
* @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.
|
|
430
500
|
*/
|
|
431
501
|
TransitionComponent: PropTypes.elementType,
|
|
432
502
|
/**
|
|
@@ -445,6 +515,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
445
515
|
/**
|
|
446
516
|
* Props applied to the transition element.
|
|
447
517
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
518
|
+
* @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.
|
|
448
519
|
*/
|
|
449
520
|
TransitionProps: PropTypes.object
|
|
450
521
|
} : void 0;
|
package/modern/Drawer/Drawer.js
CHANGED
|
@@ -29,7 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
29
|
variant
|
|
30
30
|
} = ownerState;
|
|
31
31
|
const slots = {
|
|
32
|
-
root: ['root'],
|
|
32
|
+
root: ['root', `anchor${capitalize(anchor)}`],
|
|
33
33
|
docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'],
|
|
34
34
|
modal: ['modal'],
|
|
35
35
|
paper: ['paper', `paperAnchor${capitalize(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${capitalize(anchor)}`]
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getDrawerUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiDrawer', slot);
|
|
5
5
|
}
|
|
6
|
-
const drawerClasses = generateUtilityClasses('MuiDrawer', ['root', 'docked', 'paper', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
|
|
6
|
+
const drawerClasses = generateUtilityClasses('MuiDrawer', ['root', 'docked', 'paper', 'anchorLeft', 'anchorRight', 'anchorTop', 'anchorBottom', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
|
|
7
7
|
export default drawerClasses;
|
|
@@ -179,6 +179,12 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
179
179
|
};
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
+
const onFilled = React.useCallback(() => {
|
|
183
|
+
setFilled(true);
|
|
184
|
+
}, []);
|
|
185
|
+
const onEmpty = React.useCallback(() => {
|
|
186
|
+
setFilled(false);
|
|
187
|
+
}, []);
|
|
182
188
|
const childContext = React.useMemo(() => {
|
|
183
189
|
return {
|
|
184
190
|
adornedStart,
|
|
@@ -194,20 +200,16 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
194
200
|
onBlur: () => {
|
|
195
201
|
setFocused(false);
|
|
196
202
|
},
|
|
197
|
-
onEmpty: () => {
|
|
198
|
-
setFilled(false);
|
|
199
|
-
},
|
|
200
|
-
onFilled: () => {
|
|
201
|
-
setFilled(true);
|
|
202
|
-
},
|
|
203
203
|
onFocus: () => {
|
|
204
204
|
setFocused(true);
|
|
205
205
|
},
|
|
206
|
+
onEmpty,
|
|
207
|
+
onFilled,
|
|
206
208
|
registerEffect,
|
|
207
209
|
required,
|
|
208
210
|
variant
|
|
209
211
|
};
|
|
210
|
-
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
|
|
212
|
+
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, onEmpty, onFilled, required, size, variant]);
|
|
211
213
|
return /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
212
214
|
value: childContext,
|
|
213
215
|
children: /*#__PURE__*/_jsx(FormControlRoot, {
|
|
@@ -27,7 +27,8 @@ const useUtilityClasses = ownerState => {
|
|
|
27
27
|
} = ownerState;
|
|
28
28
|
const slots = {
|
|
29
29
|
root: ['root', loading && 'loading', disabled && 'disabled', color !== 'default' && `color${capitalize(color)}`, edge && `edge${capitalize(edge)}`, `size${capitalize(size)}`],
|
|
30
|
-
loadingIndicator: ['loadingIndicator']
|
|
30
|
+
loadingIndicator: ['loadingIndicator'],
|
|
31
|
+
loadingWrapper: ['loadingWrapper']
|
|
31
32
|
};
|
|
32
33
|
return composeClasses(slots, getIconButtonUtilityClass, classes);
|
|
33
34
|
};
|
|
@@ -188,7 +189,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
188
189
|
disableFocusRipple = false,
|
|
189
190
|
size = 'medium',
|
|
190
191
|
id: idProp,
|
|
191
|
-
loading =
|
|
192
|
+
loading = null,
|
|
192
193
|
loadingIndicator: loadingIndicatorProp,
|
|
193
194
|
...other
|
|
194
195
|
} = props;
|
|
@@ -218,10 +219,19 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
218
219
|
ref: ref,
|
|
219
220
|
...other,
|
|
220
221
|
ownerState: ownerState,
|
|
221
|
-
children: [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
children: [typeof loading === 'boolean' &&
|
|
223
|
+
/*#__PURE__*/
|
|
224
|
+
// use plain HTML span to minimize the runtime overhead
|
|
225
|
+
_jsx("span", {
|
|
226
|
+
className: classes.loadingWrapper,
|
|
227
|
+
style: {
|
|
228
|
+
display: 'contents'
|
|
229
|
+
},
|
|
230
|
+
children: /*#__PURE__*/_jsx(IconButtonLoadingIndicator, {
|
|
231
|
+
className: classes.loadingIndicator,
|
|
232
|
+
ownerState: ownerState,
|
|
233
|
+
children: loading && loadingIndicator
|
|
234
|
+
})
|
|
225
235
|
}), children]
|
|
226
236
|
});
|
|
227
237
|
});
|
|
@@ -287,7 +297,8 @@ process.env.NODE_ENV !== "production" ? IconButton.propTypes /* remove-proptypes
|
|
|
287
297
|
id: PropTypes.string,
|
|
288
298
|
/**
|
|
289
299
|
* If `true`, the loading indicator is visible and the button is disabled.
|
|
290
|
-
*
|
|
300
|
+
* 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).
|
|
301
|
+
* @default null
|
|
291
302
|
*/
|
|
292
303
|
loading: PropTypes.bool,
|
|
293
304
|
/**
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getIconButtonUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiIconButton', slot);
|
|
5
5
|
}
|
|
6
|
-
const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator']);
|
|
6
|
+
const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator', 'loadingWrapper']);
|
|
7
7
|
export default iconButtonClasses;
|
package/modern/index.js
CHANGED
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.1";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("1");
|
|
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, {
|