@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
|
@@ -473,7 +473,7 @@ function useAutocomplete(props) {
|
|
|
473
473
|
filteredOptions.length,
|
|
474
474
|
// Don't sync the highlighted index with the value when multiple
|
|
475
475
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
476
|
-
multiple ? false : value,
|
|
476
|
+
multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
|
|
477
477
|
const handleListboxRef = (0, _useEventCallback.default)(node => {
|
|
478
478
|
(0, _setRef.default)(listboxRef, node);
|
|
479
479
|
if (!node) {
|
|
@@ -592,9 +592,17 @@ function useAutocomplete(props) {
|
|
|
592
592
|
handleClose(event, 'toggleInput');
|
|
593
593
|
}
|
|
594
594
|
let nextItem = focusedItem;
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
595
|
+
|
|
596
|
+
// When moving focus from the input to tags with ArrowLeft,
|
|
597
|
+
// always jump to the last tag (if any) from the input.
|
|
598
|
+
if (focusedItem === -1 && direction === 'previous') {
|
|
599
|
+
nextItem = value.length - 1;
|
|
600
|
+
// In freeSolo, clear any draft text so it doesn't "come back" later.
|
|
601
|
+
if (freeSolo && inputValue !== '') {
|
|
602
|
+
setInputValueState('');
|
|
603
|
+
if (onInputChange) {
|
|
604
|
+
onInputChange(event, '', 'reset');
|
|
605
|
+
}
|
|
598
606
|
}
|
|
599
607
|
} else {
|
|
600
608
|
nextItem += direction === 'next' ? 1 : -1;
|
|
@@ -701,14 +709,37 @@ function useAutocomplete(props) {
|
|
|
701
709
|
handleOpen(event);
|
|
702
710
|
break;
|
|
703
711
|
case 'ArrowLeft':
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
712
|
+
{
|
|
713
|
+
const input = inputRef.current;
|
|
714
|
+
// Only handle ArrowLeft when the caret is at the start of the input.
|
|
715
|
+
// Otherwise let the browser move the caret normally.
|
|
716
|
+
const caretAtStart = input && input.selectionStart === 0 && input.selectionEnd === 0;
|
|
717
|
+
if (!caretAtStart) {
|
|
718
|
+
// Let the browser handle normal cursor movement
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// Single-value rendering: move focus from input to the single tag.
|
|
723
|
+
if (!multiple && renderValue && value != null) {
|
|
724
|
+
// Moving from input to single tag; clear freeSolo draft text,
|
|
725
|
+
// so it doesn't reappear when we move back.
|
|
726
|
+
if (freeSolo && inputValue !== '') {
|
|
727
|
+
setInputValueState('');
|
|
728
|
+
if (onInputChange) {
|
|
729
|
+
onInputChange(event, '', 'reset');
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
setFocusedItem(0);
|
|
733
|
+
focusItem(0);
|
|
734
|
+
} else {
|
|
735
|
+
// Multi-value: delegate to tag navigation helper.
|
|
736
|
+
handleFocusItem(event, 'previous');
|
|
737
|
+
}
|
|
738
|
+
break;
|
|
708
739
|
}
|
|
709
|
-
break;
|
|
710
740
|
case 'ArrowRight':
|
|
711
741
|
if (!multiple && renderValue) {
|
|
742
|
+
setFocusedItem(-1);
|
|
712
743
|
focusItem(-1);
|
|
713
744
|
} else {
|
|
714
745
|
handleFocusItem(event, 'next');
|
|
@@ -763,9 +794,10 @@ function useAutocomplete(props) {
|
|
|
763
794
|
option: value[index]
|
|
764
795
|
});
|
|
765
796
|
}
|
|
766
|
-
if (!multiple && renderValue && !readOnly) {
|
|
767
|
-
|
|
768
|
-
|
|
797
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
798
|
+
handleValue(event, null, 'removeOption', {
|
|
799
|
+
option: value
|
|
800
|
+
});
|
|
769
801
|
}
|
|
770
802
|
break;
|
|
771
803
|
case 'Delete':
|
|
@@ -778,9 +810,12 @@ function useAutocomplete(props) {
|
|
|
778
810
|
option: value[index]
|
|
779
811
|
});
|
|
780
812
|
}
|
|
781
|
-
if (!multiple && renderValue && !readOnly) {
|
|
782
|
-
|
|
783
|
-
|
|
813
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
814
|
+
// Single-value rendering: Delete on empty input removes
|
|
815
|
+
// the single rendered option, same "removeOption" reason as multiple.
|
|
816
|
+
handleValue(event, null, 'removeOption', {
|
|
817
|
+
option: value
|
|
818
|
+
});
|
|
784
819
|
}
|
|
785
820
|
break;
|
|
786
821
|
default:
|
|
@@ -789,6 +824,15 @@ function useAutocomplete(props) {
|
|
|
789
824
|
};
|
|
790
825
|
const handleFocus = event => {
|
|
791
826
|
setFocused(true);
|
|
827
|
+
|
|
828
|
+
// When focusing the input, ensure any previously focused item (chip)
|
|
829
|
+
// is cleared so the input receives the visible caret and the
|
|
830
|
+
// input-focused styling is applied.
|
|
831
|
+
if (focusedItem !== -1) {
|
|
832
|
+
setFocusedItem(-1);
|
|
833
|
+
// Ensure DOM focus lands on the input
|
|
834
|
+
focusItem(-1);
|
|
835
|
+
}
|
|
792
836
|
if (openOnFocus && !ignoreFocus.current) {
|
|
793
837
|
handleOpen(event);
|
|
794
838
|
}
|
|
@@ -821,7 +865,9 @@ function useAutocomplete(props) {
|
|
|
821
865
|
}
|
|
822
866
|
}
|
|
823
867
|
if (newValue === '') {
|
|
824
|
-
|
|
868
|
+
// For normal single-select, clearing the input clears the value.
|
|
869
|
+
// For renderValue (chip-style single), only Backspace/Delete clear the value.
|
|
870
|
+
if (!disableClearable && !multiple && !renderValue) {
|
|
825
871
|
handleValue(event, null, 'clear');
|
|
826
872
|
}
|
|
827
873
|
} else {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _getActiveElement = _interopRequireDefault(require("@mui/utils/getActiveElement"));
|
|
9
|
+
var _default = exports.default = _getActiveElement.default;
|
package/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "7.3.
|
|
7
|
+
const version = exports.version = "7.3.7";
|
|
8
8
|
const major = exports.major = Number("7");
|
|
9
9
|
const minor = exports.minor = Number("3");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("7");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|