@mui/material 7.3.5 → 7.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +56 -55
- package/Accordion/Accordion.js +3 -13
- package/Alert/Alert.js +1 -1
- package/AppBar/AppBar.d.ts +13 -2
- package/AppBar/AppBar.js +14 -2
- package/Backdrop/Backdrop.js +0 -1
- package/Button/Button.d.ts +1 -0
- package/ButtonBase/ButtonBase.js +8 -1
- package/ButtonBase/TouchRipple.js +1 -1
- package/ButtonGroup/ButtonGroup.js +8 -11
- package/CHANGELOG.md +144 -1
- package/CardActionArea/CardActionArea.js +0 -1
- package/Chip/Chip.js +1 -1
- package/CssBaseline/CssBaseline.d.ts +1 -1
- package/CssBaseline/CssBaseline.js +1 -1
- package/Dialog/Dialog.js +4 -3
- package/Dialog/dialogClasses.d.ts +2 -0
- package/Dialog/dialogClasses.js +1 -1
- package/FormControl/FormControl.d.ts +1 -0
- package/FormHelperText/FormHelperText.d.ts +1 -0
- package/FormLabel/FormLabel.d.ts +1 -0
- package/IconButton/IconButton.d.ts +1 -0
- package/InputLabel/InputLabel.d.ts +1 -0
- package/ListItem/ListItem.d.ts +5 -0
- package/ListItem/ListItem.js +19 -4
- package/MenuList/MenuList.js +2 -1
- package/Modal/ModalManager.js +1 -1
- package/OutlinedInput/OutlinedInput.d.ts +1 -0
- package/README.md +2 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/Select/SelectInput.d.ts +2 -0
- package/Select/SelectInput.js +25 -4
- package/Slider/Slider.d.ts +1 -1
- package/Slider/useSlider.types.d.ts +1 -1
- package/Snackbar/Snackbar.js +1 -3
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js +4 -3
- package/TextField/TextField.d.ts +10 -5
- package/Unstable_TrapFocus/FocusTrap.js +13 -8
- package/esm/Accordion/Accordion.d.ts +56 -55
- package/esm/Accordion/Accordion.js +3 -13
- package/esm/Alert/Alert.js +1 -1
- package/esm/AppBar/AppBar.d.ts +13 -2
- package/esm/AppBar/AppBar.js +14 -2
- package/esm/Backdrop/Backdrop.js +0 -1
- package/esm/Button/Button.d.ts +1 -0
- package/esm/ButtonBase/ButtonBase.js +8 -1
- package/esm/ButtonBase/TouchRipple.js +1 -1
- package/esm/ButtonGroup/ButtonGroup.js +8 -11
- package/esm/CardActionArea/CardActionArea.js +0 -1
- package/esm/Chip/Chip.js +1 -1
- package/esm/CssBaseline/CssBaseline.d.ts +1 -1
- package/esm/CssBaseline/CssBaseline.js +1 -1
- package/esm/Dialog/Dialog.js +4 -3
- package/esm/Dialog/dialogClasses.d.ts +2 -0
- package/esm/Dialog/dialogClasses.js +1 -1
- package/esm/FormControl/FormControl.d.ts +1 -0
- package/esm/FormHelperText/FormHelperText.d.ts +1 -0
- package/esm/FormLabel/FormLabel.d.ts +1 -0
- package/esm/IconButton/IconButton.d.ts +1 -0
- package/esm/InputLabel/InputLabel.d.ts +1 -0
- package/esm/ListItem/ListItem.d.ts +5 -0
- package/esm/ListItem/ListItem.js +19 -4
- package/esm/MenuList/MenuList.js +2 -1
- package/esm/Modal/ModalManager.js +1 -1
- package/esm/OutlinedInput/OutlinedInput.d.ts +1 -0
- package/esm/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
- package/esm/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/esm/Select/SelectInput.d.ts +2 -0
- package/esm/Select/SelectInput.js +25 -4
- package/esm/Slider/Slider.d.ts +1 -1
- package/esm/Slider/useSlider.types.d.ts +1 -1
- package/esm/Snackbar/Snackbar.js +1 -3
- package/esm/Tabs/Tabs.d.ts +1 -1
- package/esm/Tabs/Tabs.js +4 -3
- package/esm/TextField/TextField.d.ts +10 -5
- package/esm/Unstable_TrapFocus/FocusTrap.js +13 -8
- package/esm/index.js +1 -1
- package/esm/internal/SwitchBase.js +1 -1
- package/esm/locale/arEG.js +1 -1
- package/esm/locale/arSA.js +1 -1
- package/esm/locale/arSD.js +1 -1
- package/esm/locale/kuCKB.js +1 -1
- package/esm/locale/neNP.js +1 -1
- package/esm/styles/createThemeNoVars.d.ts +4 -3
- package/esm/styles/createThemeWithVars.d.ts +2 -2
- package/esm/useAutocomplete/useAutocomplete.js +62 -16
- package/esm/utils/getActiveElement.d.ts +2 -0
- package/esm/utils/getActiveElement.js +2 -0
- package/esm/version/index.js +2 -2
- package/index.js +1 -1
- package/internal/SwitchBase.js +1 -1
- package/locale/arEG.js +1 -1
- package/locale/arSA.js +1 -1
- package/locale/arSD.js +1 -1
- package/locale/kuCKB.js +1 -1
- package/locale/neNP.js +1 -1
- package/package.json +8 -8
- package/styles/createThemeNoVars.d.ts +4 -3
- package/styles/createThemeWithVars.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +62 -16
- package/utils/getActiveElement.d.ts +2 -0
- package/utils/getActiveElement.js +9 -0
- package/version/index.js +2 -2
|
@@ -47,22 +47,27 @@ export interface TextFieldSlots {
|
|
|
47
47
|
*/
|
|
48
48
|
select: React.ElementType;
|
|
49
49
|
}
|
|
50
|
+
export interface TextFieldRootSlotPropsOverrides {}
|
|
51
|
+
export interface TextFieldInputSlotPropsOverrides {}
|
|
52
|
+
export interface TextFieldInputLabelSlotPropsOverrides {}
|
|
53
|
+
export interface TextFieldFormHelperTextSlotPropsOverrides {}
|
|
54
|
+
export interface TextFieldSelectSlotPropsOverrides {}
|
|
50
55
|
export type TextFieldSlotsAndSlotProps<InputPropsType> = CreateSlotsAndSlotProps<TextFieldSlots, {
|
|
51
56
|
/**
|
|
52
57
|
* Props forwarded to the root slot.
|
|
53
58
|
* By default, the available props are based on the [FormControl](https://mui.com/material-ui/api/form-control/#props) component.
|
|
54
59
|
*/
|
|
55
|
-
root: SlotProps<React.ElementType<FormControlProps>,
|
|
60
|
+
root: SlotProps<React.ElementType<FormControlProps>, TextFieldRootSlotPropsOverrides, TextFieldOwnerState>;
|
|
56
61
|
/**
|
|
57
62
|
* Props forwarded to the input slot.
|
|
58
63
|
* By default, the available props are based on the [Input](https://mui.com/material-ui/api/input/#props) component.
|
|
59
64
|
*/
|
|
60
|
-
input: SlotProps<React.ElementType<InputPropsType>,
|
|
65
|
+
input: SlotProps<React.ElementType<InputPropsType>, TextFieldInputSlotPropsOverrides, TextFieldOwnerState>;
|
|
61
66
|
/**
|
|
62
67
|
* Props forwarded to the input label slot.
|
|
63
68
|
* By default, the available props are based on the [InputLabel](https://mui.com/material-ui/api/input-label/#props) component.
|
|
64
69
|
*/
|
|
65
|
-
inputLabel: SlotProps<React.ElementType<InputLabelProps>,
|
|
70
|
+
inputLabel: SlotProps<React.ElementType<InputLabelProps>, TextFieldInputLabelSlotPropsOverrides, TextFieldOwnerState>;
|
|
66
71
|
/**
|
|
67
72
|
* Props forwarded to the html input slot.
|
|
68
73
|
* By default, the available props are based on the html input element.
|
|
@@ -72,12 +77,12 @@ export type TextFieldSlotsAndSlotProps<InputPropsType> = CreateSlotsAndSlotProps
|
|
|
72
77
|
* Props forwarded to the form helper text slot.
|
|
73
78
|
* By default, the available props are based on the [FormHelperText](https://mui.com/material-ui/api/form-helper-text/#props) component.
|
|
74
79
|
*/
|
|
75
|
-
formHelperText: SlotProps<React.ElementType<FormHelperTextProps>,
|
|
80
|
+
formHelperText: SlotProps<React.ElementType<FormHelperTextProps>, TextFieldFormHelperTextSlotPropsOverrides, TextFieldOwnerState>;
|
|
76
81
|
/**
|
|
77
82
|
* Props forwarded to the select slot.
|
|
78
83
|
* By default, the available props are based on the [Select](https://mui.com/material-ui/api/select/#props) component.
|
|
79
84
|
*/
|
|
80
|
-
select: SlotProps<React.ElementType<SelectProps>,
|
|
85
|
+
select: SlotProps<React.ElementType<SelectProps>, TextFieldSelectSlotPropsOverrides, TextFieldOwnerState>;
|
|
81
86
|
}>;
|
|
82
87
|
export interface BaseTextFieldProps extends StandardProps<FormControlProps,
|
|
83
88
|
// event handlers are declared on derived interfaces
|
|
@@ -8,6 +8,7 @@ import ownerDocument from '@mui/utils/ownerDocument';
|
|
|
8
8
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
9
9
|
import exactProp from '@mui/utils/exactProp';
|
|
10
10
|
import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
|
|
11
|
+
import getActiveElement from "../utils/getActiveElement.js";
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
// Inspired by https://github.com/focus-trap/tabbable
|
|
13
14
|
const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
|
|
@@ -111,7 +112,8 @@ function FocusTrap(props) {
|
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
const doc = ownerDocument(rootRef.current);
|
|
114
|
-
|
|
115
|
+
const activeElement = getActiveElement(doc);
|
|
116
|
+
if (!rootRef.current.contains(activeElement)) {
|
|
115
117
|
if (!rootRef.current.hasAttribute('tabIndex')) {
|
|
116
118
|
if (process.env.NODE_ENV !== 'production') {
|
|
117
119
|
console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
|
|
@@ -151,10 +153,11 @@ function FocusTrap(props) {
|
|
|
151
153
|
if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
|
|
152
154
|
return;
|
|
153
155
|
}
|
|
156
|
+
const activeElement = getActiveElement(doc);
|
|
154
157
|
|
|
155
158
|
// Make sure the next tab starts from the right place.
|
|
156
|
-
//
|
|
157
|
-
if (
|
|
159
|
+
// activeElement refers to the origin.
|
|
160
|
+
if (activeElement === rootRef.current && nativeEvent.shiftKey) {
|
|
158
161
|
// We need to ignore the next contain as
|
|
159
162
|
// it will try to move the focus back to the rootRef element.
|
|
160
163
|
ignoreNextEnforceFocus.current = true;
|
|
@@ -171,23 +174,24 @@ function FocusTrap(props) {
|
|
|
171
174
|
if (rootElement === null) {
|
|
172
175
|
return;
|
|
173
176
|
}
|
|
177
|
+
const activeEl = getActiveElement(doc);
|
|
174
178
|
if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
|
|
175
179
|
ignoreNextEnforceFocus.current = false;
|
|
176
180
|
return;
|
|
177
181
|
}
|
|
178
182
|
|
|
179
183
|
// The focus is already inside
|
|
180
|
-
if (rootElement.contains(
|
|
184
|
+
if (rootElement.contains(activeEl)) {
|
|
181
185
|
return;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
// The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)
|
|
185
|
-
if (disableEnforceFocus &&
|
|
189
|
+
if (disableEnforceFocus && activeEl !== sentinelStart.current && activeEl !== sentinelEnd.current) {
|
|
186
190
|
return;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
// if the focus event is not coming from inside the children's react tree, reset the refs
|
|
190
|
-
if (
|
|
194
|
+
if (activeEl !== reactFocusEventTarget.current) {
|
|
191
195
|
reactFocusEventTarget.current = null;
|
|
192
196
|
} else if (reactFocusEventTarget.current !== null) {
|
|
193
197
|
return;
|
|
@@ -196,7 +200,7 @@ function FocusTrap(props) {
|
|
|
196
200
|
return;
|
|
197
201
|
}
|
|
198
202
|
let tabbable = [];
|
|
199
|
-
if (
|
|
203
|
+
if (activeEl === sentinelStart.current || activeEl === sentinelEnd.current) {
|
|
200
204
|
tabbable = getTabbable(rootRef.current);
|
|
201
205
|
}
|
|
202
206
|
|
|
@@ -228,7 +232,8 @@ function FocusTrap(props) {
|
|
|
228
232
|
// The whatwg spec defines how the browser should behave but does not explicitly mention any events:
|
|
229
233
|
// https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
|
|
230
234
|
const interval = setInterval(() => {
|
|
231
|
-
|
|
235
|
+
const activeEl = getActiveElement(doc);
|
|
236
|
+
if (activeEl && activeEl.tagName === 'BODY') {
|
|
232
237
|
contain();
|
|
233
238
|
}
|
|
234
239
|
}, 50);
|
package/esm/index.js
CHANGED
|
@@ -135,7 +135,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
135
135
|
};
|
|
136
136
|
const handleInputChange = event => {
|
|
137
137
|
// Workaround for https://github.com/facebook/react/issues/9023
|
|
138
|
-
if (event.nativeEvent.defaultPrevented) {
|
|
138
|
+
if (event.nativeEvent.defaultPrevented || readOnly) {
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
const newChecked = event.target.checked;
|
package/esm/locale/arEG.js
CHANGED
package/esm/locale/arSA.js
CHANGED
package/esm/locale/arSD.js
CHANGED
package/esm/locale/kuCKB.js
CHANGED
package/esm/locale/neNP.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
|
|
1
|
+
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig, ApplyStyles } from '@mui/system';
|
|
2
2
|
import { Mixins, MixinsOptions } from "./createMixins.js";
|
|
3
3
|
import { Palette, PaletteOptions } from "./createPalette.js";
|
|
4
4
|
import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
|
|
@@ -6,7 +6,7 @@ import { Shadows } from "./shadows.js";
|
|
|
6
6
|
import { Transitions, TransitionsOptions } from "./createTransitions.js";
|
|
7
7
|
import { ZIndex, ZIndexOptions } from "./zIndex.js";
|
|
8
8
|
import { Components } from "./components.js";
|
|
9
|
-
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeFoundation.js";
|
|
9
|
+
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions, SupportedColorScheme } from "./createThemeFoundation.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* To disable custom properties, use module augmentation
|
|
@@ -46,13 +46,14 @@ export interface BaseTheme extends SystemTheme {
|
|
|
46
46
|
typography: TypographyVariants;
|
|
47
47
|
zIndex: ZIndex;
|
|
48
48
|
unstable_strictMode?: boolean;
|
|
49
|
+
applyStyles: ApplyStyles<SupportedColorScheme>;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// shut off automatic exporting for the `BaseTheme` above
|
|
52
53
|
export {};
|
|
53
54
|
type CssVarsProperties = CssThemeVariables extends {
|
|
54
55
|
enabled: true;
|
|
55
|
-
} ? Pick<CssVarsTheme, '
|
|
56
|
+
} ? Pick<CssVarsTheme, 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
|
|
@@ -9,7 +9,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
9
9
|
* The strategy to generate CSS variables
|
|
10
10
|
*
|
|
11
11
|
* @example 'media'
|
|
12
|
-
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
|
|
12
|
+
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
|
|
13
13
|
*
|
|
14
14
|
* @example '.mode-%s'
|
|
15
15
|
* Generate CSS variables within a class .mode-light, .mode-dark
|
|
@@ -25,7 +25,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
25
25
|
cssVarPrefix?: string;
|
|
26
26
|
/**
|
|
27
27
|
* If `true`, the CSS color-scheme will not be set.
|
|
28
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
28
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/color-scheme
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
disableCssColorScheme?: boolean;
|
|
@@ -465,7 +465,7 @@ function useAutocomplete(props) {
|
|
|
465
465
|
filteredOptions.length,
|
|
466
466
|
// Don't sync the highlighted index with the value when multiple
|
|
467
467
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
468
|
-
multiple ? false : value,
|
|
468
|
+
multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
|
|
469
469
|
const handleListboxRef = useEventCallback(node => {
|
|
470
470
|
setRef(listboxRef, node);
|
|
471
471
|
if (!node) {
|
|
@@ -584,9 +584,17 @@ function useAutocomplete(props) {
|
|
|
584
584
|
handleClose(event, 'toggleInput');
|
|
585
585
|
}
|
|
586
586
|
let nextItem = focusedItem;
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
587
|
+
|
|
588
|
+
// When moving focus from the input to tags with ArrowLeft,
|
|
589
|
+
// always jump to the last tag (if any) from the input.
|
|
590
|
+
if (focusedItem === -1 && direction === 'previous') {
|
|
591
|
+
nextItem = value.length - 1;
|
|
592
|
+
// In freeSolo, clear any draft text so it doesn't "come back" later.
|
|
593
|
+
if (freeSolo && inputValue !== '') {
|
|
594
|
+
setInputValueState('');
|
|
595
|
+
if (onInputChange) {
|
|
596
|
+
onInputChange(event, '', 'reset');
|
|
597
|
+
}
|
|
590
598
|
}
|
|
591
599
|
} else {
|
|
592
600
|
nextItem += direction === 'next' ? 1 : -1;
|
|
@@ -693,14 +701,37 @@ function useAutocomplete(props) {
|
|
|
693
701
|
handleOpen(event);
|
|
694
702
|
break;
|
|
695
703
|
case 'ArrowLeft':
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
704
|
+
{
|
|
705
|
+
const input = inputRef.current;
|
|
706
|
+
// Only handle ArrowLeft when the caret is at the start of the input.
|
|
707
|
+
// Otherwise let the browser move the caret normally.
|
|
708
|
+
const caretAtStart = input && input.selectionStart === 0 && input.selectionEnd === 0;
|
|
709
|
+
if (!caretAtStart) {
|
|
710
|
+
// Let the browser handle normal cursor movement
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// Single-value rendering: move focus from input to the single tag.
|
|
715
|
+
if (!multiple && renderValue && value != null) {
|
|
716
|
+
// Moving from input to single tag; clear freeSolo draft text,
|
|
717
|
+
// so it doesn't reappear when we move back.
|
|
718
|
+
if (freeSolo && inputValue !== '') {
|
|
719
|
+
setInputValueState('');
|
|
720
|
+
if (onInputChange) {
|
|
721
|
+
onInputChange(event, '', 'reset');
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
setFocusedItem(0);
|
|
725
|
+
focusItem(0);
|
|
726
|
+
} else {
|
|
727
|
+
// Multi-value: delegate to tag navigation helper.
|
|
728
|
+
handleFocusItem(event, 'previous');
|
|
729
|
+
}
|
|
730
|
+
break;
|
|
700
731
|
}
|
|
701
|
-
break;
|
|
702
732
|
case 'ArrowRight':
|
|
703
733
|
if (!multiple && renderValue) {
|
|
734
|
+
setFocusedItem(-1);
|
|
704
735
|
focusItem(-1);
|
|
705
736
|
} else {
|
|
706
737
|
handleFocusItem(event, 'next');
|
|
@@ -755,9 +786,10 @@ function useAutocomplete(props) {
|
|
|
755
786
|
option: value[index]
|
|
756
787
|
});
|
|
757
788
|
}
|
|
758
|
-
if (!multiple && renderValue && !readOnly) {
|
|
759
|
-
|
|
760
|
-
|
|
789
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
790
|
+
handleValue(event, null, 'removeOption', {
|
|
791
|
+
option: value
|
|
792
|
+
});
|
|
761
793
|
}
|
|
762
794
|
break;
|
|
763
795
|
case 'Delete':
|
|
@@ -770,9 +802,12 @@ function useAutocomplete(props) {
|
|
|
770
802
|
option: value[index]
|
|
771
803
|
});
|
|
772
804
|
}
|
|
773
|
-
if (!multiple && renderValue && !readOnly) {
|
|
774
|
-
|
|
775
|
-
|
|
805
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
806
|
+
// Single-value rendering: Delete on empty input removes
|
|
807
|
+
// the single rendered option, same "removeOption" reason as multiple.
|
|
808
|
+
handleValue(event, null, 'removeOption', {
|
|
809
|
+
option: value
|
|
810
|
+
});
|
|
776
811
|
}
|
|
777
812
|
break;
|
|
778
813
|
default:
|
|
@@ -781,6 +816,15 @@ function useAutocomplete(props) {
|
|
|
781
816
|
};
|
|
782
817
|
const handleFocus = event => {
|
|
783
818
|
setFocused(true);
|
|
819
|
+
|
|
820
|
+
// When focusing the input, ensure any previously focused item (chip)
|
|
821
|
+
// is cleared so the input receives the visible caret and the
|
|
822
|
+
// input-focused styling is applied.
|
|
823
|
+
if (focusedItem !== -1) {
|
|
824
|
+
setFocusedItem(-1);
|
|
825
|
+
// Ensure DOM focus lands on the input
|
|
826
|
+
focusItem(-1);
|
|
827
|
+
}
|
|
784
828
|
if (openOnFocus && !ignoreFocus.current) {
|
|
785
829
|
handleOpen(event);
|
|
786
830
|
}
|
|
@@ -813,7 +857,9 @@ function useAutocomplete(props) {
|
|
|
813
857
|
}
|
|
814
858
|
}
|
|
815
859
|
if (newValue === '') {
|
|
816
|
-
|
|
860
|
+
// For normal single-select, clearing the input clears the value.
|
|
861
|
+
// For renderValue (chip-style single), only Backspace/Delete clear the value.
|
|
862
|
+
if (!disableClearable && !multiple && !renderValue) {
|
|
817
863
|
handleValue(event, null, 'clear');
|
|
818
864
|
}
|
|
819
865
|
} else {
|
package/esm/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "7.3.
|
|
1
|
+
export const version = "7.3.7";
|
|
2
2
|
export const major = Number("7");
|
|
3
3
|
export const minor = Number("3");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("7");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
package/index.js
CHANGED
package/internal/SwitchBase.js
CHANGED
|
@@ -142,7 +142,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
142
142
|
};
|
|
143
143
|
const handleInputChange = event => {
|
|
144
144
|
// Workaround for https://github.com/facebook/react/issues/9023
|
|
145
|
-
if (event.nativeEvent.defaultPrevented) {
|
|
145
|
+
if (event.nativeEvent.defaultPrevented || readOnly) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
const newChecked = event.target.checked;
|
package/locale/arEG.js
CHANGED
package/locale/arSA.js
CHANGED
package/locale/arSD.js
CHANGED
package/locale/kuCKB.js
CHANGED
package/locale/neNP.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.7",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"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.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"@popperjs/core": "^2.11.8",
|
|
30
30
|
"@types/react-transition-group": "^4.4.12",
|
|
31
31
|
"clsx": "^2.1.1",
|
|
32
|
-
"csstype": "^3.
|
|
32
|
+
"csstype": "^3.2.3",
|
|
33
33
|
"prop-types": "^15.8.1",
|
|
34
|
-
"react-is": "^19.2.
|
|
34
|
+
"react-is": "^19.2.3",
|
|
35
35
|
"react-transition-group": "^4.4.5",
|
|
36
|
-
"@mui/core-downloads-tracker": "^7.3.
|
|
37
|
-
"@mui/system": "^7.3.
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/
|
|
36
|
+
"@mui/core-downloads-tracker": "^7.3.7",
|
|
37
|
+
"@mui/system": "^7.3.7",
|
|
38
|
+
"@mui/utils": "^7.3.7",
|
|
39
|
+
"@mui/types": "^7.4.10"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@emotion/react": "^11.5.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
45
45
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
46
46
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
|
-
"@mui/material-pigment-css": "^7.3.
|
|
47
|
+
"@mui/material-pigment-css": "^7.3.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@types/react": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
|
|
1
|
+
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig, ApplyStyles } from '@mui/system';
|
|
2
2
|
import { Mixins, MixinsOptions } from "./createMixins.js";
|
|
3
3
|
import { Palette, PaletteOptions } from "./createPalette.js";
|
|
4
4
|
import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
|
|
@@ -6,7 +6,7 @@ import { Shadows } from "./shadows.js";
|
|
|
6
6
|
import { Transitions, TransitionsOptions } from "./createTransitions.js";
|
|
7
7
|
import { ZIndex, ZIndexOptions } from "./zIndex.js";
|
|
8
8
|
import { Components } from "./components.js";
|
|
9
|
-
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeFoundation.js";
|
|
9
|
+
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions, SupportedColorScheme } from "./createThemeFoundation.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* To disable custom properties, use module augmentation
|
|
@@ -46,13 +46,14 @@ export interface BaseTheme extends SystemTheme {
|
|
|
46
46
|
typography: TypographyVariants;
|
|
47
47
|
zIndex: ZIndex;
|
|
48
48
|
unstable_strictMode?: boolean;
|
|
49
|
+
applyStyles: ApplyStyles<SupportedColorScheme>;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
// shut off automatic exporting for the `BaseTheme` above
|
|
52
53
|
export {};
|
|
53
54
|
type CssVarsProperties = CssThemeVariables extends {
|
|
54
55
|
enabled: true;
|
|
55
|
-
} ? Pick<CssVarsTheme, '
|
|
56
|
+
} ? Pick<CssVarsTheme, 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
|
|
@@ -9,7 +9,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
9
9
|
* The strategy to generate CSS variables
|
|
10
10
|
*
|
|
11
11
|
* @example 'media'
|
|
12
|
-
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
|
|
12
|
+
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
|
|
13
13
|
*
|
|
14
14
|
* @example '.mode-%s'
|
|
15
15
|
* Generate CSS variables within a class .mode-light, .mode-dark
|
|
@@ -25,7 +25,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
25
25
|
cssVarPrefix?: string;
|
|
26
26
|
/**
|
|
27
27
|
* If `true`, the CSS color-scheme will not be set.
|
|
28
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
28
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/color-scheme
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
disableCssColorScheme?: boolean;
|