@mui/material 9.0.0-alpha.2 → 9.0.0-alpha.4
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.mts +0 -14
- package/Accordion/Accordion.d.ts +0 -14
- package/Accordion/Accordion.js +3 -25
- package/Accordion/Accordion.mjs +3 -25
- package/AccordionSummary/AccordionSummary.js +1 -1
- package/AccordionSummary/AccordionSummary.mjs +1 -1
- package/AccordionSummary/accordionSummaryClasses.d.mts +0 -5
- package/AccordionSummary/accordionSummaryClasses.d.ts +0 -5
- package/AccordionSummary/accordionSummaryClasses.js +1 -1
- package/AccordionSummary/accordionSummaryClasses.mjs +1 -1
- package/Alert/Alert.d.mts +0 -23
- package/Alert/Alert.d.ts +0 -23
- package/Alert/Alert.js +4 -36
- package/Alert/Alert.mjs +4 -36
- package/Alert/alertClasses.d.mts +0 -72
- package/Alert/alertClasses.d.ts +0 -72
- package/Alert/alertClasses.js +1 -1
- package/Alert/alertClasses.mjs +1 -1
- package/Autocomplete/Autocomplete.d.mts +26 -60
- package/Autocomplete/Autocomplete.d.ts +26 -60
- package/Autocomplete/Autocomplete.js +76 -119
- package/Autocomplete/Autocomplete.mjs +76 -119
- package/Avatar/Avatar.d.mts +0 -8
- package/Avatar/Avatar.d.ts +0 -8
- package/Avatar/Avatar.js +13 -35
- package/Avatar/Avatar.mjs +13 -35
- package/AvatarGroup/AvatarGroup.d.mts +0 -15
- package/AvatarGroup/AvatarGroup.d.ts +0 -15
- package/AvatarGroup/AvatarGroup.js +1 -18
- package/AvatarGroup/AvatarGroup.mjs +1 -18
- package/Backdrop/Backdrop.d.mts +1 -31
- package/Backdrop/Backdrop.d.ts +1 -31
- package/Backdrop/Backdrop.js +2 -42
- package/Backdrop/Backdrop.mjs +2 -42
- package/Badge/Badge.d.mts +0 -20
- package/Badge/Badge.d.ts +0 -20
- package/Badge/Badge.js +2 -35
- package/Badge/Badge.mjs +2 -35
- package/Box/Box.d.mts +1 -0
- package/Box/Box.d.ts +1 -0
- package/Button/Button.d.mts +1 -0
- package/Button/Button.d.ts +1 -0
- package/Button/Button.js +6 -6
- package/Button/Button.mjs +6 -6
- package/Button/buttonClasses.d.mts +0 -132
- package/Button/buttonClasses.d.ts +0 -132
- package/Button/buttonClasses.js +1 -1
- package/Button/buttonClasses.mjs +1 -1
- package/ButtonBase/ButtonBase.js +16 -2
- package/ButtonBase/ButtonBase.mjs +16 -2
- package/CHANGELOG.md +191 -0
- package/CardHeader/CardHeader.js +5 -1
- package/CardHeader/CardHeader.mjs +5 -1
- package/CircularProgress/CircularProgress.js +2 -2
- package/CircularProgress/CircularProgress.mjs +2 -2
- package/CircularProgress/circularProgressClasses.d.mts +0 -8
- package/CircularProgress/circularProgressClasses.d.ts +0 -8
- package/CircularProgress/circularProgressClasses.js +1 -1
- package/CircularProgress/circularProgressClasses.mjs +1 -1
- package/Divider/Divider.d.mts +1 -6
- package/Divider/Divider.d.ts +1 -6
- package/Divider/Divider.js +2 -18
- package/Divider/Divider.mjs +2 -18
- package/Divider/dividerClasses.d.mts +0 -4
- package/Divider/dividerClasses.d.ts +0 -4
- package/Divider/dividerClasses.js +1 -1
- package/Divider/dividerClasses.mjs +1 -1
- package/FormControlLabel/FormControlLabel.d.mts +1 -14
- package/FormControlLabel/FormControlLabel.d.ts +1 -14
- package/FormControlLabel/FormControlLabel.js +1 -13
- package/FormControlLabel/FormControlLabel.mjs +1 -13
- package/Input/Input.js +2 -1
- package/Input/Input.mjs +2 -1
- package/List/List.d.mts +1 -0
- package/List/List.d.ts +1 -0
- package/ListItemButton/ListItemButton.d.mts +1 -0
- package/ListItemButton/ListItemButton.d.ts +1 -0
- package/ListItemIcon/ListItemIcon.d.mts +1 -0
- package/ListItemIcon/ListItemIcon.d.ts +1 -0
- package/ListItemText/ListItemText.d.mts +1 -0
- package/ListItemText/ListItemText.d.ts +1 -0
- package/ListItemText/ListItemText.js +5 -1
- package/ListItemText/ListItemText.mjs +5 -1
- package/ListSubheader/ListSubheader.d.mts +1 -0
- package/ListSubheader/ListSubheader.d.ts +1 -0
- package/Menu/Menu.d.mts +0 -13
- package/Menu/Menu.d.ts +0 -13
- package/Menu/Menu.js +5 -44
- package/Menu/Menu.mjs +5 -44
- package/MenuItem/MenuItem.js +21 -1
- package/MenuItem/MenuItem.mjs +23 -1
- package/MenuList/MenuList.js +77 -109
- package/MenuList/MenuList.mjs +77 -109
- package/MobileStepper/MobileStepper.d.mts +0 -5
- package/MobileStepper/MobileStepper.d.ts +0 -5
- package/MobileStepper/MobileStepper.js +1 -10
- package/MobileStepper/MobileStepper.mjs +1 -10
- package/Paper/Paper.d.mts +1 -0
- package/Paper/Paper.d.ts +1 -0
- package/Popover/Popover.d.mts +4 -48
- package/Popover/Popover.d.ts +4 -48
- package/Popover/Popover.js +4 -64
- package/Popover/Popover.mjs +4 -64
- package/Popper/Popper.d.mts +0 -17
- package/Popper/Popper.d.ts +0 -17
- package/Popper/Popper.js +2 -26
- package/Popper/Popper.mjs +2 -26
- package/Popper/index.d.mts +1 -0
- package/Popper/index.d.ts +1 -0
- package/Popper/index.js +11 -2
- package/Popper/index.mjs +1 -0
- package/Select/SelectInput.js +50 -55
- package/Select/SelectInput.mjs +47 -52
- package/Select/index.d.mts +1 -0
- package/Select/index.d.ts +1 -0
- package/Select/index.js +12 -0
- package/Select/index.mjs +1 -0
- package/Select/utils/SelectFocusSourceContext.d.mts +4 -0
- package/Select/utils/SelectFocusSourceContext.d.ts +4 -0
- package/Select/utils/SelectFocusSourceContext.js +19 -0
- package/Select/utils/SelectFocusSourceContext.mjs +13 -0
- package/Select/utils/areEqualValues.d.mts +1 -0
- package/Select/utils/areEqualValues.d.ts +1 -0
- package/Select/utils/areEqualValues.js +14 -0
- package/Select/utils/areEqualValues.mjs +8 -0
- package/Select/utils/getOpenInteractionType.d.mts +1 -0
- package/Select/utils/getOpenInteractionType.d.ts +1 -0
- package/Select/utils/getOpenInteractionType.js +18 -0
- package/Select/utils/getOpenInteractionType.mjs +12 -0
- package/Select/utils/index.d.mts +4 -0
- package/Select/utils/index.d.ts +4 -0
- package/Select/utils/index.js +40 -0
- package/Select/utils/index.mjs +4 -0
- package/Select/utils/isEmpty.d.mts +1 -0
- package/Select/utils/isEmpty.d.ts +1 -0
- package/Select/utils/isEmpty.js +9 -0
- package/Select/utils/isEmpty.mjs +3 -0
- package/Slider/Slider.d.mts +109 -77
- package/Slider/Slider.d.ts +109 -77
- package/Slider/Slider.js +42 -119
- package/Slider/Slider.mjs +42 -119
- package/Slider/sliderClasses.d.mts +7 -7
- package/Slider/sliderClasses.d.ts +7 -7
- package/Slider/useSlider.js +50 -14
- package/Slider/useSlider.mjs +50 -14
- package/Snackbar/Snackbar.d.mts +1 -27
- package/Snackbar/Snackbar.d.ts +1 -27
- package/Snackbar/Snackbar.js +5 -58
- package/Snackbar/Snackbar.mjs +5 -58
- package/SpeedDial/SpeedDial.d.mts +0 -13
- package/SpeedDial/SpeedDial.d.ts +0 -13
- package/SpeedDial/SpeedDial.js +15 -40
- package/SpeedDial/SpeedDial.mjs +15 -40
- package/SpeedDialAction/SpeedDialAction.d.mts +0 -28
- package/SpeedDialAction/SpeedDialAction.d.ts +0 -28
- package/SpeedDialAction/SpeedDialAction.js +5 -46
- package/SpeedDialAction/SpeedDialAction.mjs +5 -46
- package/Step/Step.js +7 -5
- package/Step/Step.mjs +7 -5
- package/StepButton/StepButton.js +16 -6
- package/StepButton/StepButton.mjs +16 -6
- package/StepConnector/StepConnector.js +2 -2
- package/StepConnector/StepConnector.mjs +2 -2
- package/StepContent/StepContent.js +2 -2
- package/StepContent/StepContent.mjs +2 -2
- package/StepLabel/StepLabel.js +2 -2
- package/StepLabel/StepLabel.mjs +2 -2
- package/Stepper/Stepper.js +44 -7
- package/Stepper/Stepper.mjs +44 -7
- package/Stepper/StepperContext.d.mts +7 -0
- package/Stepper/StepperContext.d.ts +7 -0
- package/Stepper/StepperContext.js +2 -1
- package/Stepper/StepperContext.mjs +1 -0
- package/Stepper/index.d.mts +0 -1
- package/Stepper/index.d.ts +0 -1
- package/Tab/Tab.js +0 -1
- package/Tab/Tab.mjs +0 -1
- package/TablePagination/TablePagination.d.mts +1 -1
- package/TablePagination/TablePagination.d.ts +1 -1
- package/TablePagination/TablePagination.js +4 -2
- package/TablePagination/TablePagination.mjs +4 -2
- package/Tabs/Tabs.d.mts +2 -33
- package/Tabs/Tabs.d.ts +2 -33
- package/Tabs/Tabs.js +54 -135
- package/Tabs/Tabs.mjs +54 -135
- package/TextField/TextField.d.mts +6 -49
- package/TextField/TextField.d.ts +6 -49
- package/TextField/TextField.js +18 -53
- package/TextField/TextField.mjs +18 -53
- package/Tooltip/Tooltip.d.mts +1 -55
- package/Tooltip/Tooltip.d.ts +1 -55
- package/Tooltip/Tooltip.js +9 -87
- package/Tooltip/Tooltip.mjs +9 -87
- package/Typography/Typography.d.mts +1 -6
- package/Typography/Typography.d.ts +1 -6
- package/Typography/Typography.js +3 -19
- package/Typography/Typography.mjs +3 -19
- package/Typography/typographyClasses.d.mts +0 -5
- package/Typography/typographyClasses.d.ts +0 -5
- package/Typography/typographyClasses.js +1 -1
- package/Typography/typographyClasses.mjs +1 -1
- package/index.d.mts +0 -2
- package/index.d.ts +0 -2
- package/index.js +1 -9
- package/index.mjs +1 -2
- package/locale/amET.js +4 -1
- package/locale/amET.mjs +3 -1
- package/locale/arEG.js +4 -1
- package/locale/arEG.mjs +3 -1
- package/locale/arSA.js +4 -1
- package/locale/arSA.mjs +3 -1
- package/locale/arSD.js +4 -1
- package/locale/arSD.mjs +3 -1
- package/locale/beBY.js +4 -1
- package/locale/beBY.mjs +3 -1
- package/locale/bnBD.js +4 -1
- package/locale/bnBD.mjs +3 -1
- package/locale/caES.js +4 -1
- package/locale/caES.mjs +3 -1
- package/locale/csCZ.js +4 -1
- package/locale/csCZ.mjs +3 -1
- package/locale/daDK.js +4 -1
- package/locale/daDK.mjs +3 -1
- package/locale/deDE.js +4 -1
- package/locale/deDE.mjs +3 -1
- package/locale/elGR.js +4 -1
- package/locale/elGR.mjs +3 -1
- package/locale/esES.js +4 -1
- package/locale/esES.mjs +3 -1
- package/locale/etEE.js +4 -1
- package/locale/etEE.mjs +3 -1
- package/locale/faIR.js +4 -1
- package/locale/faIR.mjs +3 -1
- package/locale/fiFI.js +4 -1
- package/locale/fiFI.mjs +3 -1
- package/locale/frFR.js +4 -1
- package/locale/frFR.mjs +3 -1
- package/locale/heIL.js +4 -1
- package/locale/heIL.mjs +3 -1
- package/locale/hiIN.js +4 -1
- package/locale/hiIN.mjs +3 -1
- package/locale/hrHR.js +5 -1
- package/locale/hrHR.mjs +4 -1
- package/locale/isIS.js +4 -1
- package/locale/isIS.mjs +3 -1
- package/locale/itIT.js +4 -1
- package/locale/itIT.mjs +3 -1
- package/locale/jaJP.js +4 -1
- package/locale/jaJP.mjs +3 -1
- package/locale/khKH.js +4 -1
- package/locale/khKH.mjs +3 -1
- package/locale/kkKZ.js +4 -1
- package/locale/kkKZ.mjs +3 -1
- package/locale/koKR.js +4 -1
- package/locale/koKR.mjs +3 -1
- package/locale/kuCKB.js +4 -1
- package/locale/kuCKB.mjs +3 -1
- package/locale/kuLatn.js +4 -1
- package/locale/kuLatn.mjs +3 -1
- package/locale/mkMK.js +5 -1
- package/locale/mkMK.mjs +4 -1
- package/locale/msMS.js +5 -1
- package/locale/msMS.mjs +4 -1
- package/locale/myMY.js +5 -1
- package/locale/myMY.mjs +4 -1
- package/locale/nbNO.js +4 -1
- package/locale/nbNO.mjs +3 -1
- package/locale/neNP.js +5 -1
- package/locale/neNP.mjs +4 -1
- package/locale/nlNL.js +4 -1
- package/locale/nlNL.mjs +3 -1
- package/locale/nnNO.js +4 -1
- package/locale/nnNO.mjs +3 -1
- package/locale/plPL.js +4 -1
- package/locale/plPL.mjs +3 -1
- package/locale/psAF.js +4 -1
- package/locale/psAF.mjs +3 -1
- package/locale/ptBR.js +4 -1
- package/locale/ptBR.mjs +3 -1
- package/locale/ptPT.js +4 -1
- package/locale/ptPT.mjs +3 -1
- package/locale/roRO.js +4 -1
- package/locale/roRO.mjs +3 -1
- package/locale/ruRU.js +4 -1
- package/locale/ruRU.mjs +3 -1
- package/locale/siLK.js +4 -1
- package/locale/siLK.mjs +3 -1
- package/locale/skSK.js +4 -1
- package/locale/skSK.mjs +3 -1
- package/locale/srRS.js +5 -1
- package/locale/srRS.mjs +4 -1
- package/locale/svSE.js +4 -1
- package/locale/svSE.mjs +3 -1
- package/locale/thTH.js +4 -1
- package/locale/thTH.mjs +3 -1
- package/locale/tlTL.js +5 -1
- package/locale/tlTL.mjs +4 -1
- package/locale/trTR.js +4 -1
- package/locale/trTR.mjs +3 -1
- package/locale/ukUA.js +4 -1
- package/locale/ukUA.mjs +3 -1
- package/locale/urPK.js +4 -1
- package/locale/urPK.mjs +3 -1
- package/locale/utils/buildFormatNumber.d.mts +2 -0
- package/locale/utils/buildFormatNumber.d.ts +2 -0
- package/locale/utils/buildFormatNumber.js +23 -0
- package/locale/utils/buildFormatNumber.mjs +17 -0
- package/locale/viVN.js +4 -1
- package/locale/viVN.mjs +3 -1
- package/locale/zhCN.js +4 -1
- package/locale/zhCN.mjs +3 -1
- package/locale/zhHK.js +4 -1
- package/locale/zhHK.mjs +3 -1
- package/locale/zhTW.js +4 -1
- package/locale/zhTW.mjs +3 -1
- package/package.json +236 -236
- package/styles/components.d.mts +0 -5
- package/styles/components.d.ts +0 -5
- package/styles/overrides.d.mts +0 -2
- package/styles/overrides.d.ts +0 -2
- package/styles/props.d.mts +0 -2
- package/styles/props.d.ts +0 -2
- package/themeCssVarsAugmentation/index.js +5 -0
- package/themeCssVarsAugmentation/index.mjs +5 -0
- package/useAutocomplete/useAutocomplete.d.mts +0 -12
- package/useAutocomplete/useAutocomplete.d.ts +0 -12
- package/useAutocomplete/useAutocomplete.js +53 -28
- package/useAutocomplete/useAutocomplete.mjs +53 -28
- package/utils/index.d.mts +2 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +14 -0
- package/utils/index.mjs +2 -0
- package/utils/useRovingTabIndex.d.mts +2 -0
- package/utils/useRovingTabIndex.d.ts +2 -0
- package/utils/useRovingTabIndex.js +9 -0
- package/utils/useRovingTabIndex.mjs +2 -0
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
- package/GridLegacy/GridLegacy.d.mts +0 -160
- package/GridLegacy/GridLegacy.d.ts +0 -160
- package/GridLegacy/GridLegacy.js +0 -601
- package/GridLegacy/GridLegacy.mjs +0 -588
- package/GridLegacy/GridLegacyContext.js +0 -17
- package/GridLegacy/GridLegacyContext.mjs +0 -12
- package/GridLegacy/gridLegacyClasses.d.mts +0 -48
- package/GridLegacy/gridLegacyClasses.d.ts +0 -48
- package/GridLegacy/gridLegacyClasses.js +0 -27
- package/GridLegacy/gridLegacyClasses.mjs +0 -19
- package/GridLegacy/index.d.mts +0 -4
- package/GridLegacy/index.d.ts +0 -4
- package/GridLegacy/index.js +0 -35
- package/GridLegacy/index.mjs +0 -3
package/Popover/Popover.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import clsx from 'clsx';
|
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
8
8
|
import refType from '@mui/utils/refType';
|
|
9
|
-
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
10
9
|
import integerPropType from '@mui/utils/integerPropType';
|
|
11
10
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
12
11
|
import isHostComponent from '@mui/utils/isHostComponent';
|
|
@@ -101,19 +100,13 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
101
100
|
elevation = 8,
|
|
102
101
|
marginThreshold = 16,
|
|
103
102
|
open,
|
|
104
|
-
PaperProps: PaperPropsProp = {},
|
|
105
|
-
// TODO: remove in v7
|
|
106
103
|
slots = {},
|
|
107
104
|
slotProps = {},
|
|
108
105
|
transformOrigin = {
|
|
109
106
|
vertical: 'top',
|
|
110
107
|
horizontal: 'left'
|
|
111
108
|
},
|
|
112
|
-
TransitionComponent,
|
|
113
|
-
// TODO: remove in v7
|
|
114
109
|
transitionDuration: transitionDurationProp = 'auto',
|
|
115
|
-
TransitionProps = {},
|
|
116
|
-
// TODO: remove in v7
|
|
117
110
|
disableScrollLock = false,
|
|
118
111
|
...other
|
|
119
112
|
} = props;
|
|
@@ -125,9 +118,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
125
118
|
elevation,
|
|
126
119
|
marginThreshold,
|
|
127
120
|
transformOrigin,
|
|
128
|
-
|
|
129
|
-
transitionDuration: transitionDurationProp,
|
|
130
|
-
TransitionProps
|
|
121
|
+
transitionDuration: transitionDurationProp
|
|
131
122
|
};
|
|
132
123
|
const classes = useUtilityClasses(ownerState);
|
|
133
124
|
|
|
@@ -284,15 +275,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
284
275
|
}, [anchorEl, open, setPositioningStyles]);
|
|
285
276
|
let transitionDuration = transitionDurationProp;
|
|
286
277
|
const externalForwardedProps = {
|
|
287
|
-
slots
|
|
288
|
-
|
|
289
|
-
...slots
|
|
290
|
-
},
|
|
291
|
-
slotProps: {
|
|
292
|
-
transition: TransitionProps,
|
|
293
|
-
paper: PaperPropsProp,
|
|
294
|
-
...slotProps
|
|
295
|
-
}
|
|
278
|
+
slots,
|
|
279
|
+
slotProps
|
|
296
280
|
};
|
|
297
281
|
const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
|
|
298
282
|
elementType: Grow,
|
|
@@ -442,25 +426,6 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
442
426
|
* @default 'anchorEl'
|
|
443
427
|
*/
|
|
444
428
|
anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
|
|
445
|
-
/**
|
|
446
|
-
* A backdrop component. This prop enables custom backdrop rendering.
|
|
447
|
-
* @deprecated Use `slots.backdrop` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
448
|
-
* @default styled(Backdrop, {
|
|
449
|
-
* name: 'MuiModal',
|
|
450
|
-
* slot: 'Backdrop',
|
|
451
|
-
* overridesResolver: (props, styles) => {
|
|
452
|
-
* return styles.backdrop;
|
|
453
|
-
* },
|
|
454
|
-
* })({
|
|
455
|
-
* zIndex: -1,
|
|
456
|
-
* })
|
|
457
|
-
*/
|
|
458
|
-
BackdropComponent: PropTypes.elementType,
|
|
459
|
-
/**
|
|
460
|
-
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
461
|
-
* @deprecated Use `slotProps.backdrop` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
462
|
-
*/
|
|
463
|
-
BackdropProps: PropTypes.object,
|
|
464
429
|
/**
|
|
465
430
|
* The content of the component.
|
|
466
431
|
*/
|
|
@@ -506,17 +471,6 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
506
471
|
* If `true`, the component is shown.
|
|
507
472
|
*/
|
|
508
473
|
open: PropTypes.bool.isRequired,
|
|
509
|
-
/**
|
|
510
|
-
* Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
|
|
511
|
-
*
|
|
512
|
-
* This prop is an alias for `slotProps.paper` and will be overridden by it if both are used.
|
|
513
|
-
* @deprecated Use `slotProps.paper` instead.
|
|
514
|
-
*
|
|
515
|
-
* @default {}
|
|
516
|
-
*/
|
|
517
|
-
PaperProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
|
|
518
|
-
component: elementTypeAcceptingRef
|
|
519
|
-
}),
|
|
520
474
|
/**
|
|
521
475
|
* The props used for each slot inside.
|
|
522
476
|
* @default {}
|
|
@@ -557,13 +511,6 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
557
511
|
horizontal: PropTypes.oneOfType([PropTypes.oneOf(['center', 'left', 'right']), PropTypes.number]).isRequired,
|
|
558
512
|
vertical: PropTypes.oneOfType([PropTypes.oneOf(['bottom', 'center', 'top']), PropTypes.number]).isRequired
|
|
559
513
|
}),
|
|
560
|
-
/**
|
|
561
|
-
* The component used for the transition.
|
|
562
|
-
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
563
|
-
* @deprecated use the `slots.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
564
|
-
* @default Grow
|
|
565
|
-
*/
|
|
566
|
-
TransitionComponent: PropTypes.elementType,
|
|
567
514
|
/**
|
|
568
515
|
* Set to 'auto' to automatically calculate transition time based on height.
|
|
569
516
|
* @default 'auto'
|
|
@@ -572,13 +519,6 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
572
519
|
appear: PropTypes.number,
|
|
573
520
|
enter: PropTypes.number,
|
|
574
521
|
exit: PropTypes.number
|
|
575
|
-
})])
|
|
576
|
-
/**
|
|
577
|
-
* Props applied to the transition element.
|
|
578
|
-
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
579
|
-
* @deprecated use the `slotProps.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
580
|
-
* @default {}
|
|
581
|
-
*/
|
|
582
|
-
TransitionProps: PropTypes.object
|
|
522
|
+
})])
|
|
583
523
|
} : void 0;
|
|
584
524
|
export default Popover;
|
package/Popper/Popper.d.mts
CHANGED
|
@@ -8,23 +8,6 @@ export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
|
|
|
8
8
|
* Either a string to use a HTML element or a component.
|
|
9
9
|
*/
|
|
10
10
|
component?: React.ElementType | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* The components used for each slot inside the Popper.
|
|
13
|
-
* Either a string to use a HTML element or a component.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
16
|
-
* @default {}
|
|
17
|
-
*/
|
|
18
|
-
components?: {
|
|
19
|
-
Root?: React.ElementType | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* The props used for each slot inside the Popper.
|
|
23
|
-
*
|
|
24
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
25
|
-
* @default {}
|
|
26
|
-
*/
|
|
27
|
-
componentsProps?: BasePopperProps['slotProps'] | undefined;
|
|
28
11
|
/**
|
|
29
12
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
30
13
|
*/
|
package/Popper/Popper.d.ts
CHANGED
|
@@ -8,23 +8,6 @@ export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
|
|
|
8
8
|
* Either a string to use a HTML element or a component.
|
|
9
9
|
*/
|
|
10
10
|
component?: React.ElementType | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* The components used for each slot inside the Popper.
|
|
13
|
-
* Either a string to use a HTML element or a component.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
16
|
-
* @default {}
|
|
17
|
-
*/
|
|
18
|
-
components?: {
|
|
19
|
-
Root?: React.ElementType | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* The props used for each slot inside the Popper.
|
|
23
|
-
*
|
|
24
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
25
|
-
* @default {}
|
|
26
|
-
*/
|
|
27
|
-
componentsProps?: BasePopperProps['slotProps'] | undefined;
|
|
28
11
|
/**
|
|
29
12
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
30
13
|
*/
|
package/Popper/Popper.js
CHANGED
|
@@ -42,8 +42,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
42
42
|
const {
|
|
43
43
|
anchorEl,
|
|
44
44
|
component,
|
|
45
|
-
components,
|
|
46
|
-
componentsProps,
|
|
47
45
|
container,
|
|
48
46
|
disablePortal,
|
|
49
47
|
keepMounted,
|
|
@@ -57,7 +55,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
57
55
|
slotProps,
|
|
58
56
|
...other
|
|
59
57
|
} = props;
|
|
60
|
-
const RootComponent = slots?.root ?? components?.Root;
|
|
61
58
|
const otherProps = {
|
|
62
59
|
anchorEl,
|
|
63
60
|
container,
|
|
@@ -74,10 +71,8 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
74
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PopperRoot, {
|
|
75
72
|
as: component,
|
|
76
73
|
direction: isRtl ? 'rtl' : 'ltr',
|
|
77
|
-
slots:
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
slotProps: slotProps ?? componentsProps,
|
|
74
|
+
slots: slots,
|
|
75
|
+
slotProps: slotProps,
|
|
81
76
|
...otherProps,
|
|
82
77
|
ref: ref
|
|
83
78
|
});
|
|
@@ -103,25 +98,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
|
|
|
103
98
|
* Either a string to use a HTML element or a component.
|
|
104
99
|
*/
|
|
105
100
|
component: _propTypes.default.elementType,
|
|
106
|
-
/**
|
|
107
|
-
* The components used for each slot inside the Popper.
|
|
108
|
-
* Either a string to use a HTML element or a component.
|
|
109
|
-
*
|
|
110
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
111
|
-
* @default {}
|
|
112
|
-
*/
|
|
113
|
-
components: _propTypes.default.shape({
|
|
114
|
-
Root: _propTypes.default.elementType
|
|
115
|
-
}),
|
|
116
|
-
/**
|
|
117
|
-
* The props used for each slot inside the Popper.
|
|
118
|
-
*
|
|
119
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
120
|
-
* @default {}
|
|
121
|
-
*/
|
|
122
|
-
componentsProps: _propTypes.default.shape({
|
|
123
|
-
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
124
|
-
}),
|
|
125
101
|
/**
|
|
126
102
|
* An HTML element or function that returns one.
|
|
127
103
|
* The `container` will have the portal children appended to it.
|
package/Popper/Popper.mjs
CHANGED
|
@@ -35,8 +35,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
35
35
|
const {
|
|
36
36
|
anchorEl,
|
|
37
37
|
component,
|
|
38
|
-
components,
|
|
39
|
-
componentsProps,
|
|
40
38
|
container,
|
|
41
39
|
disablePortal,
|
|
42
40
|
keepMounted,
|
|
@@ -50,7 +48,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
50
48
|
slotProps,
|
|
51
49
|
...other
|
|
52
50
|
} = props;
|
|
53
|
-
const RootComponent = slots?.root ?? components?.Root;
|
|
54
51
|
const otherProps = {
|
|
55
52
|
anchorEl,
|
|
56
53
|
container,
|
|
@@ -67,10 +64,8 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
67
64
|
return /*#__PURE__*/_jsx(PopperRoot, {
|
|
68
65
|
as: component,
|
|
69
66
|
direction: isRtl ? 'rtl' : 'ltr',
|
|
70
|
-
slots:
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
slotProps: slotProps ?? componentsProps,
|
|
67
|
+
slots: slots,
|
|
68
|
+
slotProps: slotProps,
|
|
74
69
|
...otherProps,
|
|
75
70
|
ref: ref
|
|
76
71
|
});
|
|
@@ -96,25 +91,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
|
|
|
96
91
|
* Either a string to use a HTML element or a component.
|
|
97
92
|
*/
|
|
98
93
|
component: PropTypes.elementType,
|
|
99
|
-
/**
|
|
100
|
-
* The components used for each slot inside the Popper.
|
|
101
|
-
* Either a string to use a HTML element or a component.
|
|
102
|
-
*
|
|
103
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
104
|
-
* @default {}
|
|
105
|
-
*/
|
|
106
|
-
components: PropTypes.shape({
|
|
107
|
-
Root: PropTypes.elementType
|
|
108
|
-
}),
|
|
109
|
-
/**
|
|
110
|
-
* The props used for each slot inside the Popper.
|
|
111
|
-
*
|
|
112
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
113
|
-
* @default {}
|
|
114
|
-
*/
|
|
115
|
-
componentsProps: PropTypes.shape({
|
|
116
|
-
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
117
|
-
}),
|
|
118
94
|
/**
|
|
119
95
|
* An HTML element or function that returns one.
|
|
120
96
|
* The `container` will have the portal children appended to it.
|
package/Popper/index.d.mts
CHANGED
package/Popper/index.d.ts
CHANGED
package/Popper/index.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
var _exportNames = {
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
popperClasses: true
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "default", {
|
|
9
12
|
enumerable: true,
|
|
10
13
|
get: function () {
|
|
11
14
|
return _Popper.default;
|
|
12
15
|
}
|
|
13
16
|
});
|
|
17
|
+
Object.defineProperty(exports, "popperClasses", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _popperClasses.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
14
23
|
var _Popper = _interopRequireDefault(require("./Popper"));
|
|
15
|
-
var _popperClasses = require("./popperClasses");
|
|
24
|
+
var _popperClasses = _interopRequireWildcard(require("./popperClasses"));
|
|
16
25
|
Object.keys(_popperClasses).forEach(function (key) {
|
|
17
26
|
if (key === "default" || key === "__esModule") return;
|
|
18
27
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
package/Popper/index.mjs
CHANGED
package/Select/SelectInput.js
CHANGED
|
@@ -25,6 +25,8 @@ var _slotShouldForwardProp = _interopRequireDefault(require("../styles/slotShoul
|
|
|
25
25
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
26
26
|
var _useControlled = _interopRequireDefault(require("../utils/useControlled"));
|
|
27
27
|
var _selectClasses = _interopRequireWildcard(require("./selectClasses"));
|
|
28
|
+
var _utils2 = require("./utils");
|
|
29
|
+
var _SelectFocusSourceContext = require("./utils/SelectFocusSourceContext");
|
|
28
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
31
|
var _span;
|
|
30
32
|
const SelectSelect = (0, _zeroStyled.styled)(_NativeSelectInput.StyledSelectSelect, {
|
|
@@ -81,17 +83,6 @@ const SelectNativeInput = (0, _zeroStyled.styled)('input', {
|
|
|
81
83
|
width: '100%',
|
|
82
84
|
boxSizing: 'border-box'
|
|
83
85
|
});
|
|
84
|
-
function areEqualValues(a, b) {
|
|
85
|
-
if (typeof b === 'object' && b !== null) {
|
|
86
|
-
return a === b;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// The value could be a number, the DOM will stringify it anyway.
|
|
90
|
-
return String(a) === String(b);
|
|
91
|
-
}
|
|
92
|
-
function isEmpty(display) {
|
|
93
|
-
return display == null || typeof display === 'string' && !display.trim();
|
|
94
|
-
}
|
|
95
86
|
const useUtilityClasses = ownerState => {
|
|
96
87
|
const {
|
|
97
88
|
classes,
|
|
@@ -169,6 +160,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
169
160
|
current: isOpenControlled
|
|
170
161
|
} = React.useRef(openProp != null);
|
|
171
162
|
const [menuMinWidthState, setMenuMinWidthState] = React.useState();
|
|
163
|
+
const [openInteractionType, setOpenInteractionType] = React.useState(null);
|
|
172
164
|
const handleRef = (0, _useForkRef.default)(ref, inputRefProp);
|
|
173
165
|
const handleDisplayRef = React.useCallback(node => {
|
|
174
166
|
displayRef.current = node;
|
|
@@ -237,11 +229,15 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
237
229
|
}, [labelId]);
|
|
238
230
|
const update = (openParam, event) => {
|
|
239
231
|
if (openParam) {
|
|
232
|
+
setOpenInteractionType((0, _utils2.getOpenInteractionType)(event));
|
|
240
233
|
if (onOpen) {
|
|
241
234
|
onOpen(event);
|
|
242
235
|
}
|
|
243
|
-
} else
|
|
244
|
-
|
|
236
|
+
} else {
|
|
237
|
+
setOpenInteractionType(null);
|
|
238
|
+
if (onClose) {
|
|
239
|
+
onClose(event);
|
|
240
|
+
}
|
|
245
241
|
}
|
|
246
242
|
if (!isOpenControlled) {
|
|
247
243
|
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
|
@@ -377,12 +373,12 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
377
373
|
if (!Array.isArray(value)) {
|
|
378
374
|
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.' : (0, _formatMuiErrorMessage.default)(2));
|
|
379
375
|
}
|
|
380
|
-
selected = value.some(v => areEqualValues(v, child.props.value));
|
|
376
|
+
selected = value.some(v => (0, _utils2.areEqualValues)(v, child.props.value));
|
|
381
377
|
if (selected && computeDisplay) {
|
|
382
378
|
displayMultiple.push(child.props.children);
|
|
383
379
|
}
|
|
384
380
|
} else {
|
|
385
|
-
selected = areEqualValues(value, child.props.value);
|
|
381
|
+
selected = (0, _utils2.areEqualValues)(value, child.props.value);
|
|
386
382
|
if (selected && computeDisplay) {
|
|
387
383
|
displaySingle = child.props.children;
|
|
388
384
|
}
|
|
@@ -459,15 +455,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
459
455
|
error
|
|
460
456
|
};
|
|
461
457
|
const classes = useUtilityClasses(ownerState);
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
|
|
465
|
-
};
|
|
466
|
-
const listProps = {
|
|
467
|
-
...MenuProps.MenuListProps,
|
|
468
|
-
...(typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list)
|
|
469
|
-
};
|
|
458
|
+
const menuPaperSlotProps = typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper;
|
|
459
|
+
const menuListSlotProps = typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list;
|
|
470
460
|
const listboxId = (0, _useId.default)();
|
|
461
|
+
const nativeInputId = (0, _useId.default)();
|
|
471
462
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
472
463
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SelectSelect, {
|
|
473
464
|
as: "div",
|
|
@@ -493,7 +484,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
493
484
|
// The id is required for proper a11y
|
|
494
485
|
,
|
|
495
486
|
id: buttonId,
|
|
496
|
-
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
487
|
+
children: (0, _utils2.isEmpty)(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
497
488
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
498
489
|
className: "notranslate",
|
|
499
490
|
"aria-hidden": true,
|
|
@@ -512,44 +503,48 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
512
503
|
autoFocus: autoFocus,
|
|
513
504
|
required: required,
|
|
514
505
|
...other,
|
|
506
|
+
id: other.id ?? nativeInputId,
|
|
515
507
|
ownerState: ownerState
|
|
516
508
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectIcon, {
|
|
517
509
|
as: IconComponent,
|
|
518
510
|
className: classes.icon,
|
|
519
511
|
ownerState: ownerState
|
|
520
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
slotProps: {
|
|
535
|
-
...MenuProps.slotProps,
|
|
536
|
-
list: {
|
|
537
|
-
'aria-labelledby': labelId,
|
|
538
|
-
role: 'listbox',
|
|
539
|
-
'aria-multiselectable': multiple ? 'true' : undefined,
|
|
540
|
-
disableListWrap: true,
|
|
541
|
-
id: listboxId,
|
|
542
|
-
...listProps
|
|
512
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectFocusSourceContext.SelectFocusSourceProvider, {
|
|
513
|
+
value: openInteractionType,
|
|
514
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
515
|
+
id: `menu-${name || ''}`,
|
|
516
|
+
anchorEl: anchorElement,
|
|
517
|
+
open: open,
|
|
518
|
+
onClose: handleClose,
|
|
519
|
+
anchorOrigin: {
|
|
520
|
+
vertical: 'bottom',
|
|
521
|
+
horizontal: 'center'
|
|
522
|
+
},
|
|
523
|
+
transformOrigin: {
|
|
524
|
+
vertical: 'top',
|
|
525
|
+
horizontal: 'center'
|
|
543
526
|
},
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
527
|
+
...MenuProps,
|
|
528
|
+
slotProps: {
|
|
529
|
+
...MenuProps.slotProps,
|
|
530
|
+
list: {
|
|
531
|
+
'aria-labelledby': labelId,
|
|
532
|
+
role: 'listbox',
|
|
533
|
+
'aria-multiselectable': multiple ? 'true' : undefined,
|
|
534
|
+
disableListWrap: true,
|
|
535
|
+
id: listboxId,
|
|
536
|
+
...menuListSlotProps
|
|
537
|
+
},
|
|
538
|
+
paper: {
|
|
539
|
+
...menuPaperSlotProps,
|
|
540
|
+
style: {
|
|
541
|
+
minWidth: menuMinWidth,
|
|
542
|
+
...menuPaperSlotProps?.style
|
|
543
|
+
}
|
|
549
544
|
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
|
|
545
|
+
},
|
|
546
|
+
children: items
|
|
547
|
+
})
|
|
553
548
|
})]
|
|
554
549
|
});
|
|
555
550
|
});
|
package/Select/SelectInput.mjs
CHANGED
|
@@ -19,6 +19,8 @@ import slotShouldForwardProp from "../styles/slotShouldForwardProp.mjs";
|
|
|
19
19
|
import useForkRef from "../utils/useForkRef.mjs";
|
|
20
20
|
import useControlled from "../utils/useControlled.mjs";
|
|
21
21
|
import selectClasses, { getSelectUtilityClasses } from "./selectClasses.mjs";
|
|
22
|
+
import { areEqualValues, isEmpty, getOpenInteractionType } from "./utils/index.mjs";
|
|
23
|
+
import { SelectFocusSourceProvider } from "./utils/SelectFocusSourceContext.mjs";
|
|
22
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
25
|
const SelectSelect = styled(StyledSelectSelect, {
|
|
24
26
|
name: 'MuiSelect',
|
|
@@ -74,17 +76,6 @@ const SelectNativeInput = styled('input', {
|
|
|
74
76
|
width: '100%',
|
|
75
77
|
boxSizing: 'border-box'
|
|
76
78
|
});
|
|
77
|
-
function areEqualValues(a, b) {
|
|
78
|
-
if (typeof b === 'object' && b !== null) {
|
|
79
|
-
return a === b;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// The value could be a number, the DOM will stringify it anyway.
|
|
83
|
-
return String(a) === String(b);
|
|
84
|
-
}
|
|
85
|
-
function isEmpty(display) {
|
|
86
|
-
return display == null || typeof display === 'string' && !display.trim();
|
|
87
|
-
}
|
|
88
79
|
const useUtilityClasses = ownerState => {
|
|
89
80
|
const {
|
|
90
81
|
classes,
|
|
@@ -162,6 +153,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
162
153
|
current: isOpenControlled
|
|
163
154
|
} = React.useRef(openProp != null);
|
|
164
155
|
const [menuMinWidthState, setMenuMinWidthState] = React.useState();
|
|
156
|
+
const [openInteractionType, setOpenInteractionType] = React.useState(null);
|
|
165
157
|
const handleRef = useForkRef(ref, inputRefProp);
|
|
166
158
|
const handleDisplayRef = React.useCallback(node => {
|
|
167
159
|
displayRef.current = node;
|
|
@@ -230,11 +222,15 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
230
222
|
}, [labelId]);
|
|
231
223
|
const update = (openParam, event) => {
|
|
232
224
|
if (openParam) {
|
|
225
|
+
setOpenInteractionType(getOpenInteractionType(event));
|
|
233
226
|
if (onOpen) {
|
|
234
227
|
onOpen(event);
|
|
235
228
|
}
|
|
236
|
-
} else
|
|
237
|
-
|
|
229
|
+
} else {
|
|
230
|
+
setOpenInteractionType(null);
|
|
231
|
+
if (onClose) {
|
|
232
|
+
onClose(event);
|
|
233
|
+
}
|
|
238
234
|
}
|
|
239
235
|
if (!isOpenControlled) {
|
|
240
236
|
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
|
@@ -452,15 +448,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
452
448
|
error
|
|
453
449
|
};
|
|
454
450
|
const classes = useUtilityClasses(ownerState);
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
|
|
458
|
-
};
|
|
459
|
-
const listProps = {
|
|
460
|
-
...MenuProps.MenuListProps,
|
|
461
|
-
...(typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list)
|
|
462
|
-
};
|
|
451
|
+
const menuPaperSlotProps = typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper;
|
|
452
|
+
const menuListSlotProps = typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list;
|
|
463
453
|
const listboxId = useId();
|
|
454
|
+
const nativeInputId = useId();
|
|
464
455
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
465
456
|
children: [/*#__PURE__*/_jsx(SelectSelect, {
|
|
466
457
|
as: "div",
|
|
@@ -505,44 +496,48 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
505
496
|
autoFocus: autoFocus,
|
|
506
497
|
required: required,
|
|
507
498
|
...other,
|
|
499
|
+
id: other.id ?? nativeInputId,
|
|
508
500
|
ownerState: ownerState
|
|
509
501
|
}), /*#__PURE__*/_jsx(SelectIcon, {
|
|
510
502
|
as: IconComponent,
|
|
511
503
|
className: classes.icon,
|
|
512
504
|
ownerState: ownerState
|
|
513
|
-
}), /*#__PURE__*/_jsx(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
slotProps: {
|
|
528
|
-
...MenuProps.slotProps,
|
|
529
|
-
list: {
|
|
530
|
-
'aria-labelledby': labelId,
|
|
531
|
-
role: 'listbox',
|
|
532
|
-
'aria-multiselectable': multiple ? 'true' : undefined,
|
|
533
|
-
disableListWrap: true,
|
|
534
|
-
id: listboxId,
|
|
535
|
-
...listProps
|
|
505
|
+
}), /*#__PURE__*/_jsx(SelectFocusSourceProvider, {
|
|
506
|
+
value: openInteractionType,
|
|
507
|
+
children: /*#__PURE__*/_jsx(Menu, {
|
|
508
|
+
id: `menu-${name || ''}`,
|
|
509
|
+
anchorEl: anchorElement,
|
|
510
|
+
open: open,
|
|
511
|
+
onClose: handleClose,
|
|
512
|
+
anchorOrigin: {
|
|
513
|
+
vertical: 'bottom',
|
|
514
|
+
horizontal: 'center'
|
|
515
|
+
},
|
|
516
|
+
transformOrigin: {
|
|
517
|
+
vertical: 'top',
|
|
518
|
+
horizontal: 'center'
|
|
536
519
|
},
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
520
|
+
...MenuProps,
|
|
521
|
+
slotProps: {
|
|
522
|
+
...MenuProps.slotProps,
|
|
523
|
+
list: {
|
|
524
|
+
'aria-labelledby': labelId,
|
|
525
|
+
role: 'listbox',
|
|
526
|
+
'aria-multiselectable': multiple ? 'true' : undefined,
|
|
527
|
+
disableListWrap: true,
|
|
528
|
+
id: listboxId,
|
|
529
|
+
...menuListSlotProps
|
|
530
|
+
},
|
|
531
|
+
paper: {
|
|
532
|
+
...menuPaperSlotProps,
|
|
533
|
+
style: {
|
|
534
|
+
minWidth: menuMinWidth,
|
|
535
|
+
...menuPaperSlotProps?.style
|
|
536
|
+
}
|
|
542
537
|
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
538
|
+
},
|
|
539
|
+
children: items
|
|
540
|
+
})
|
|
546
541
|
})]
|
|
547
542
|
});
|
|
548
543
|
});
|