@mui/material 7.3.6 → 7.3.8
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 +2 -2
- package/Accordion/Accordion.js +3 -13
- package/AppBar/AppBar.js +3 -2
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +1 -1
- package/Backdrop/Backdrop.js +0 -1
- package/Badge/Badge.js +23 -104
- package/ButtonGroup/ButtonGroup.js +8 -11
- package/CHANGELOG.md +119 -1
- package/CardActionArea/CardActionArea.js +0 -1
- package/Chip/Chip.js +1 -3
- package/Collapse/Collapse.js +3 -3
- package/Dialog/Dialog.js +4 -3
- package/Dialog/dialogClasses.d.ts +2 -0
- package/Dialog/dialogClasses.js +1 -1
- package/Drawer/Drawer.js +1 -1
- package/GridLegacy/GridLegacy.js +1 -1
- package/Modal/ModalManager.js +1 -1
- package/Popover/Popover.js +2 -2
- package/Popper/BasePopper.js +2 -2
- package/README.md +2 -2
- package/Select/SelectInput.js +19 -4
- package/Slide/Slide.js +1 -1
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.js +2 -2
- package/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/esm/Accordion/Accordion.d.ts +2 -2
- package/esm/Accordion/Accordion.js +3 -13
- package/esm/AppBar/AppBar.js +3 -2
- package/esm/Autocomplete/Autocomplete.d.ts +1 -1
- package/esm/Autocomplete/Autocomplete.js +1 -1
- package/esm/Backdrop/Backdrop.js +0 -1
- package/esm/Badge/Badge.js +23 -104
- package/esm/ButtonGroup/ButtonGroup.js +8 -11
- package/esm/CardActionArea/CardActionArea.js +0 -1
- package/esm/Chip/Chip.js +1 -3
- package/esm/Collapse/Collapse.js +3 -3
- package/esm/Dialog/Dialog.js +4 -3
- package/esm/Dialog/dialogClasses.d.ts +2 -0
- package/esm/Dialog/dialogClasses.js +1 -1
- package/esm/Drawer/Drawer.js +1 -1
- package/esm/GridLegacy/GridLegacy.js +1 -1
- package/esm/Modal/ModalManager.js +1 -1
- package/esm/Popover/Popover.js +2 -2
- package/esm/Popper/BasePopper.js +2 -2
- package/esm/Select/SelectInput.js +19 -4
- package/esm/Slide/Slide.js +1 -1
- package/esm/Tabs/Tabs.d.ts +3 -2
- package/esm/Tabs/Tabs.js +2 -2
- package/esm/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internal/SwitchBase.js +1 -2
- 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/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/esm/useAutocomplete/useAutocomplete.js +54 -20
- package/esm/version/index.js +2 -2
- package/index.js +1 -1
- package/internal/SwitchBase.js +1 -2
- 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 +9 -9
- package/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/useAutocomplete/useAutocomplete.js +54 -20
- package/version/index.js +2 -2
|
@@ -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;
|
|
@@ -192,7 +192,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
192
192
|
additionalProps: {
|
|
193
193
|
centerRipple: true,
|
|
194
194
|
focusRipple: !disableFocusRipple,
|
|
195
|
-
disabled,
|
|
196
195
|
role: undefined,
|
|
197
196
|
tabIndex: null
|
|
198
197
|
}
|
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
|
@@ -362,7 +362,7 @@ export interface UseAutocompleteReturnValue<Value, Multiple extends boolean | un
|
|
|
362
362
|
* @returns props that should be spread on the li element
|
|
363
363
|
*/
|
|
364
364
|
getOptionProps: (renderedOption: UseAutocompleteRenderedOption<Value>) => React.HTMLAttributes<HTMLLIElement> & {
|
|
365
|
-
key:
|
|
365
|
+
key: React.Key;
|
|
366
366
|
};
|
|
367
367
|
/**
|
|
368
368
|
* Id for the Autocomplete.
|
|
@@ -486,10 +486,10 @@ function useAutocomplete(props) {
|
|
|
486
486
|
}, [componentName]);
|
|
487
487
|
}
|
|
488
488
|
React.useEffect(() => {
|
|
489
|
-
if (filteredOptionsChanged || popupOpen) {
|
|
489
|
+
if (filteredOptionsChanged || popupOpen && !disableCloseOnSelect) {
|
|
490
490
|
syncHighlightedIndex();
|
|
491
491
|
}
|
|
492
|
-
}, [syncHighlightedIndex, filteredOptionsChanged, popupOpen]);
|
|
492
|
+
}, [syncHighlightedIndex, filteredOptionsChanged, popupOpen, disableCloseOnSelect]);
|
|
493
493
|
const handleOpen = event => {
|
|
494
494
|
if (open) {
|
|
495
495
|
return;
|
|
@@ -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,13 +701,34 @@ function useAutocomplete(props) {
|
|
|
693
701
|
handleOpen(event);
|
|
694
702
|
break;
|
|
695
703
|
case 'ArrowLeft':
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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;
|
|
701
731
|
}
|
|
702
|
-
break;
|
|
703
732
|
case 'ArrowRight':
|
|
704
733
|
if (!multiple && renderValue) {
|
|
705
734
|
setFocusedItem(-1);
|
|
@@ -757,10 +786,10 @@ function useAutocomplete(props) {
|
|
|
757
786
|
option: value[index]
|
|
758
787
|
});
|
|
759
788
|
}
|
|
760
|
-
if (!multiple && renderValue && !readOnly) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
789
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
790
|
+
handleValue(event, null, 'removeOption', {
|
|
791
|
+
option: value
|
|
792
|
+
});
|
|
764
793
|
}
|
|
765
794
|
break;
|
|
766
795
|
case 'Delete':
|
|
@@ -773,10 +802,12 @@ function useAutocomplete(props) {
|
|
|
773
802
|
option: value[index]
|
|
774
803
|
});
|
|
775
804
|
}
|
|
776
|
-
if (!multiple && renderValue && !readOnly) {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
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
|
+
});
|
|
780
811
|
}
|
|
781
812
|
break;
|
|
782
813
|
default:
|
|
@@ -826,7 +857,9 @@ function useAutocomplete(props) {
|
|
|
826
857
|
}
|
|
827
858
|
}
|
|
828
859
|
if (newValue === '') {
|
|
829
|
-
|
|
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) {
|
|
830
863
|
handleValue(event, null, 'clear');
|
|
831
864
|
}
|
|
832
865
|
} else {
|
|
@@ -1010,6 +1043,7 @@ function useAutocomplete(props) {
|
|
|
1010
1043
|
role: 'listbox',
|
|
1011
1044
|
id: `${id}-listbox`,
|
|
1012
1045
|
'aria-labelledby': `${id}-label`,
|
|
1046
|
+
'aria-multiselectable': multiple || undefined,
|
|
1013
1047
|
ref: handleListboxRef,
|
|
1014
1048
|
onMouseDown: event => {
|
|
1015
1049
|
// Prevent blur
|
package/esm/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "7.3.
|
|
1
|
+
export const version = "7.3.8";
|
|
2
2
|
export const major = Number("7");
|
|
3
3
|
export const minor = Number("3");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("8");
|
|
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;
|
|
@@ -199,7 +199,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
199
199
|
additionalProps: {
|
|
200
200
|
centerRipple: true,
|
|
201
201
|
focusRipple: !disableFocusRipple,
|
|
202
|
-
disabled,
|
|
203
202
|
role: undefined,
|
|
204
203
|
tabIndex: null
|
|
205
204
|
}
|
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.8",
|
|
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": [
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"url": "https://opencollective.com/mui-org"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@babel/runtime": "^7.28.
|
|
28
|
+
"@babel/runtime": "^7.28.6",
|
|
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/types": "^7.4.
|
|
39
|
-
"@mui/utils": "^7.3.
|
|
36
|
+
"@mui/core-downloads-tracker": "^7.3.8",
|
|
37
|
+
"@mui/system": "^7.3.8",
|
|
38
|
+
"@mui/types": "^7.4.11",
|
|
39
|
+
"@mui/utils": "^7.3.8"
|
|
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.8"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@types/react": {
|
|
@@ -362,7 +362,7 @@ export interface UseAutocompleteReturnValue<Value, Multiple extends boolean | un
|
|
|
362
362
|
* @returns props that should be spread on the li element
|
|
363
363
|
*/
|
|
364
364
|
getOptionProps: (renderedOption: UseAutocompleteRenderedOption<Value>) => React.HTMLAttributes<HTMLLIElement> & {
|
|
365
|
-
key:
|
|
365
|
+
key: React.Key;
|
|
366
366
|
};
|
|
367
367
|
/**
|
|
368
368
|
* Id for the Autocomplete.
|
|
@@ -494,10 +494,10 @@ function useAutocomplete(props) {
|
|
|
494
494
|
}, [componentName]);
|
|
495
495
|
}
|
|
496
496
|
React.useEffect(() => {
|
|
497
|
-
if (filteredOptionsChanged || popupOpen) {
|
|
497
|
+
if (filteredOptionsChanged || popupOpen && !disableCloseOnSelect) {
|
|
498
498
|
syncHighlightedIndex();
|
|
499
499
|
}
|
|
500
|
-
}, [syncHighlightedIndex, filteredOptionsChanged, popupOpen]);
|
|
500
|
+
}, [syncHighlightedIndex, filteredOptionsChanged, popupOpen, disableCloseOnSelect]);
|
|
501
501
|
const handleOpen = event => {
|
|
502
502
|
if (open) {
|
|
503
503
|
return;
|
|
@@ -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,13 +709,34 @@ function useAutocomplete(props) {
|
|
|
701
709
|
handleOpen(event);
|
|
702
710
|
break;
|
|
703
711
|
case 'ArrowLeft':
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
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;
|
|
709
739
|
}
|
|
710
|
-
break;
|
|
711
740
|
case 'ArrowRight':
|
|
712
741
|
if (!multiple && renderValue) {
|
|
713
742
|
setFocusedItem(-1);
|
|
@@ -765,10 +794,10 @@ function useAutocomplete(props) {
|
|
|
765
794
|
option: value[index]
|
|
766
795
|
});
|
|
767
796
|
}
|
|
768
|
-
if (!multiple && renderValue && !readOnly) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
797
|
+
if (!multiple && renderValue && !readOnly && inputValue === '') {
|
|
798
|
+
handleValue(event, null, 'removeOption', {
|
|
799
|
+
option: value
|
|
800
|
+
});
|
|
772
801
|
}
|
|
773
802
|
break;
|
|
774
803
|
case 'Delete':
|
|
@@ -781,10 +810,12 @@ function useAutocomplete(props) {
|
|
|
781
810
|
option: value[index]
|
|
782
811
|
});
|
|
783
812
|
}
|
|
784
|
-
if (!multiple && renderValue && !readOnly) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
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
|
+
});
|
|
788
819
|
}
|
|
789
820
|
break;
|
|
790
821
|
default:
|
|
@@ -834,7 +865,9 @@ function useAutocomplete(props) {
|
|
|
834
865
|
}
|
|
835
866
|
}
|
|
836
867
|
if (newValue === '') {
|
|
837
|
-
|
|
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) {
|
|
838
871
|
handleValue(event, null, 'clear');
|
|
839
872
|
}
|
|
840
873
|
} else {
|
|
@@ -1018,6 +1051,7 @@ function useAutocomplete(props) {
|
|
|
1018
1051
|
role: 'listbox',
|
|
1019
1052
|
id: `${id}-listbox`,
|
|
1020
1053
|
'aria-labelledby': `${id}-label`,
|
|
1054
|
+
'aria-multiselectable': multiple || undefined,
|
|
1021
1055
|
ref: handleListboxRef,
|
|
1022
1056
|
onMouseDown: event => {
|
|
1023
1057
|
// Prevent blur
|
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.8";
|
|
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("8");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|