@mui/material 5.14.10 → 5.14.11

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.
@@ -7,6 +7,7 @@ import {
7
7
  AutocompleteChangeReason,
8
8
  AutocompleteCloseReason,
9
9
  AutocompleteInputChangeReason,
10
+ AutocompleteValue,
10
11
  createFilterOptions,
11
12
  UseAutocompleteProps,
12
13
  AutocompleteFreeSoloValueMapping,
@@ -22,6 +23,7 @@ export {
22
23
  AutocompleteChangeReason,
23
24
  AutocompleteCloseReason,
24
25
  AutocompleteInputChangeReason,
26
+ AutocompleteValue,
25
27
  createFilterOptions,
26
28
  };
27
29
 
File without changes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.11
4
+
5
+ <!-- generated comparing v5.14.10..master -->
6
+
7
+ _Sep 26, 2023_
8
+
9
+ A big thanks to the 23 contributors who made this release possible.
10
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
11
+
12
+ ### `@mui/material@5.14.11`
13
+
14
+ - [Autocomplete] Re-export `AutocompleteValue` to make it available from path import (#38638) @vadimka123
15
+ - [Select][material-ui] Missing aria-multiselectable attribute on multiple Select component (#38855) @gitstart
16
+ - [l10n] labelDisplayedRows is added for trTR localization (#39056) @tebersefa
17
+
18
+ ### `@mui/utils@5.14.11`
19
+
20
+ - Support RSC in `isMuiElement` util (#38129) @sai6855
21
+
22
+ ### `@mui/base@5.0.0-beta.17`
23
+
24
+ - [NumberInput] Support adornments (#38900) @anle9650
25
+ - [Menu] Align external props handling for useMenu/MenuButton/MenuItem (#38946) @mj12albert
26
+ - [Select] Align external props handling (#39038) @mj12albert
27
+ - [TextareaAutosize] Simplify logic and add test (#38728) @oliviertassinari
28
+
29
+ ### `@mui/joy@5.0.0-beta.8`
30
+
31
+ - [Button] Fix disabled button styling when component prop is provided (#38996) @sai6855
32
+ - [Drawer] Add missing `JoyDrawer` in theme components (#39074) @Studio384
33
+
34
+ ### `@mui/material-next@6.0.0-alpha.103`
35
+
36
+ - [FormControl] Copy v5 FormControl (#39039) @mj12albert
37
+
38
+ ### `@mui/lab@5.0.0-alpha.146`
39
+
40
+ - [TreeView] Fix JSDoc comments in TreeView and TreeItem (#38874) @jergason
41
+
42
+ ### Docs
43
+
44
+ - Improve focus trap demo (#38985) @oliviertassinari
45
+ - Add Tailwind CSS + plain CSS demo on the Tabs page (#39000) @alisasanib
46
+ - Improve the default theme viewer design (#39049) @danilo-leal
47
+ - Add live demo with CssVarsProvider (#38792) @oliviertassinari
48
+ - Fix wrong hash on Card's page (#39151) @mnajdova
49
+ - Revise the Drawer page (#38988) @danilo-leal
50
+ - Simplify the button's loading indicator demo (#39082) @danilo-leal
51
+ - Fix the Templates link on the Overview page (#39086) @danilo-leal
52
+ - Refine the Sign in template (#38942) @zanivan
53
+ - Add `use-count-up` integration with the Circular Progress (#38952) @anon-phantom
54
+
55
+ ### Core
56
+
57
+ - [blog] Add a company values blog post (#38802) @mikailaread
58
+ - [core] Downgrade lerna to 7.2.0 (#39149) @michaldudak
59
+ - [core] Simplify docs feedback interaction (#39075) @alexfauquette
60
+ - [core] Improve ref type definition (#38903) @oliviertassinari
61
+ - [core] Simplify career (#39112) @oliviertassinari
62
+ - [core] Update Babel types along with source packages (#39070) @michaldudak
63
+ - [core] Add a comment to explain `useEnhancedEffect` (#39035) @Janpot
64
+ - [docs-infra] Fix code removal in table of content (#39165) @alexfauquette
65
+ - [docs-infra] Improve callouts design (#39084) @danilo-leal
66
+ - [docs-infra] Fix key warning in Base UI Slider slots section (#38954) @ZeeshanTamboli
67
+ - [docs-infra] Fix error when redirecting to the root page (#38451) @maheshguntur
68
+ - [docs-infra] Open demo crash in the right repository (#39006) @oliviertassinari
69
+ - [test] Split the test package (#39061) @michaldudak
70
+ - [website] React Engineer - xCharts role (#38976) @DanailH
71
+ - [website] Improve the highlighter component colors (#39087) @danilo-leal
72
+ - [website] Fix Pricing page row hover (#39097) @danilo-leal
73
+ - [website] Fix typo with straight quote @oliviertassinari
74
+ - [website] Sync about page @oliviertassinari
75
+ - [website] Update the about page (#38733) @danilo-leal
76
+ - [website] Small fixes on the X marketing page (#38975) @flaviendelangle
77
+ - [website] Add stray design tweaks to the X page (#38589) @danilo-leal
78
+
79
+ All contributors of this release in alphabetical order: @alexfauquette, @alisasanib, @anle9650, @anon-phantom, @DanailH, @danilo-leal, @DiegoAndai, @flaviendelangle, @gitstart, @Janpot, @jergason, @maheshguntur, @michaldudak, @mikailaread, @mj12albert, @mnajdova, @oliviertassinari, @sai6855, @Studio384, @tebersefa, @vadimka123, @zanivan, @ZeeshanTamboli
80
+
3
81
  ## 5.14.10
4
82
 
5
83
  <!-- generated comparing v5.14.9..master -->
@@ -493,6 +493,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
493
493
  MenuListProps: _extends({
494
494
  'aria-labelledby': labelId,
495
495
  role: 'listbox',
496
+ 'aria-multiselectable': multiple ? 'true' : undefined,
496
497
  disableListWrap: true
497
498
  }, MenuProps.MenuListProps),
498
499
  slotProps: {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.10
2
+ * @mui/material v5.14.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
File without changes
@@ -504,6 +504,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
504
504
  MenuListProps: _extends({
505
505
  'aria-labelledby': labelId,
506
506
  role: 'listbox',
507
+ 'aria-multiselectable': multiple ? 'true' : undefined,
507
508
  disableListWrap: true
508
509
  }, MenuProps.MenuListProps),
509
510
  slotProps: {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.10
2
+ * @mui/material v5.14.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3791,12 +3791,15 @@ export var trTR = {
3791
3791
  // if (type === 'previous') {
3792
3792
  return 'Önceki sayfaya git';
3793
3793
  },
3794
- labelRowsPerPage: 'Sayfa başına satır:'
3795
- // labelDisplayedRows: ({ from, to, count }) =>
3796
- // `${from}–${to} tanesinden ${count !== -1 ? count : `more than ${to}`}`,
3794
+ labelRowsPerPage: 'Sayfa başına satır:',
3795
+ labelDisplayedRows: function labelDisplayedRows(_ref41) {
3796
+ var from = _ref41.from,
3797
+ to = _ref41.to,
3798
+ count = _ref41.count;
3799
+ return "".concat(from, "-").concat(to, " / ").concat(count !== -1 ? count : "".concat(to, "'den fazla"));
3800
+ }
3797
3801
  }
3798
3802
  },
3799
-
3800
3803
  MuiRating: {
3801
3804
  defaultProps: {
3802
3805
  getLabelText: function getLabelText(value) {
@@ -3867,10 +3870,10 @@ export var tlTL = {
3867
3870
  return 'Pumunta sa nakaraang pahina';
3868
3871
  },
3869
3872
  labelRowsPerPage: 'Mga hilera bawat pahina:',
3870
- labelDisplayedRows: function labelDisplayedRows(_ref41) {
3871
- var from = _ref41.from,
3872
- to = _ref41.to,
3873
- count = _ref41.count;
3873
+ labelDisplayedRows: function labelDisplayedRows(_ref42) {
3874
+ var from = _ref42.from,
3875
+ to = _ref42.to,
3876
+ count = _ref42.count;
3874
3877
  return "".concat(from, "\u2013").concat(to, " ng ").concat(count !== -1 ? count : "higit sa ".concat(to));
3875
3878
  }
3876
3879
  }
@@ -3943,10 +3946,10 @@ export var ukUA = {
3943
3946
  return 'Перейти на попередню сторінку';
3944
3947
  },
3945
3948
  labelRowsPerPage: 'Рядків на сторінці:',
3946
- labelDisplayedRows: function labelDisplayedRows(_ref42) {
3947
- var from = _ref42.from,
3948
- to = _ref42.to,
3949
- count = _ref42.count;
3949
+ labelDisplayedRows: function labelDisplayedRows(_ref43) {
3950
+ var from = _ref43.from,
3951
+ to = _ref43.to,
3952
+ count = _ref43.count;
3950
3953
  return "".concat(from, "\u2013").concat(to, " \u0437 ").concat(count !== -1 ? count : "\u043F\u043E\u043D\u0430\u0434 ".concat(to));
3951
3954
  }
3952
3955
  }
@@ -4026,10 +4029,10 @@ export var urPK = {
4026
4029
  return 'پچھلے صفحے پر جائیں';
4027
4030
  },
4028
4031
  labelRowsPerPage: 'ایک صفحے پر قطاریں:',
4029
- labelDisplayedRows: function labelDisplayedRows(_ref43) {
4030
- var from = _ref43.from,
4031
- to = _ref43.to,
4032
- count = _ref43.count;
4032
+ labelDisplayedRows: function labelDisplayedRows(_ref44) {
4033
+ var from = _ref44.from,
4034
+ to = _ref44.to,
4035
+ count = _ref44.count;
4033
4036
  return "".concat(count !== -1 ? "".concat(count, " \u0645\u06CC\u06BA \u0633\u06D2") : "".concat(to, " \u0633\u06D2 \u0630\u06CC\u0627\u062F\u06C1 \u0645\u06CC\u06BA \u0633\u06D2"), " ").concat(from, " \u0633\u06D2 ").concat(to, " \u0642\u0637\u0627\u0631\u06CC\u06BA");
4034
4037
  }
4035
4038
  }
@@ -4102,10 +4105,10 @@ export var viVN = {
4102
4105
  return 'Về trang trước đó';
4103
4106
  },
4104
4107
  labelRowsPerPage: 'Số hàng mỗi trang:',
4105
- labelDisplayedRows: function labelDisplayedRows(_ref44) {
4106
- var from = _ref44.from,
4107
- to = _ref44.to,
4108
- count = _ref44.count;
4108
+ labelDisplayedRows: function labelDisplayedRows(_ref45) {
4109
+ var from = _ref45.from,
4110
+ to = _ref45.to,
4111
+ count = _ref45.count;
4109
4112
  return "".concat(from, "\u2013").concat(to, " trong ").concat(count !== -1 ? count : "nhi\u1EC1u h\u01A1n ".concat(to));
4110
4113
  }
4111
4114
  }
@@ -4177,10 +4180,10 @@ export var zhCN = {
4177
4180
  return '上一页';
4178
4181
  },
4179
4182
  labelRowsPerPage: '每页行数:',
4180
- labelDisplayedRows: function labelDisplayedRows(_ref45) {
4181
- var from = _ref45.from,
4182
- to = _ref45.to,
4183
- count = _ref45.count;
4183
+ labelDisplayedRows: function labelDisplayedRows(_ref46) {
4184
+ var from = _ref46.from,
4185
+ to = _ref46.to,
4186
+ count = _ref46.count;
4184
4187
  return "\u7B2C ".concat(from, " \u6761\u5230\u7B2C ").concat(to, " \u6761\uFF0C").concat(count !== -1 ? "\u5171 ".concat(count, " \u6761") : "\u81F3\u5C11 ".concat(to, " \u6761"));
4185
4188
  }
4186
4189
  }
@@ -4231,10 +4234,10 @@ export var zhHK = {
4231
4234
  return '上一頁';
4232
4235
  },
4233
4236
  labelRowsPerPage: '每頁行數:',
4234
- labelDisplayedRows: function labelDisplayedRows(_ref46) {
4235
- var from = _ref46.from,
4236
- to = _ref46.to,
4237
- count = _ref46.count;
4237
+ labelDisplayedRows: function labelDisplayedRows(_ref47) {
4238
+ var from = _ref47.from,
4239
+ to = _ref47.to,
4240
+ count = _ref47.count;
4238
4241
  return "\u7B2C ".concat(from, " \u9805\u81F3\u7B2C ").concat(to, " \u9805\uFF0C").concat(count !== -1 ? "\u5171 ".concat(count, " \u9805") : "\u8D85\u904E ".concat(to, " \u9805"));
4239
4242
  }
4240
4243
  }
@@ -4285,10 +4288,10 @@ export var zhTW = {
4285
4288
  return '上一頁';
4286
4289
  },
4287
4290
  labelRowsPerPage: '每頁數量:',
4288
- labelDisplayedRows: function labelDisplayedRows(_ref47) {
4289
- var from = _ref47.from,
4290
- to = _ref47.to,
4291
- count = _ref47.count;
4291
+ labelDisplayedRows: function labelDisplayedRows(_ref48) {
4292
+ var from = _ref48.from,
4293
+ to = _ref48.to,
4294
+ count = _ref48.count;
4292
4295
  return "".concat(from, " ~ ").concat(to, " / ").concat(count !== -1 ? count : "".concat(to, " \u4EE5\u4E0A"));
4293
4296
  }
4294
4297
  }
package/locale/index.js CHANGED
@@ -3679,12 +3679,14 @@ export const trTR = {
3679
3679
  // if (type === 'previous') {
3680
3680
  return 'Önceki sayfaya git';
3681
3681
  },
3682
- labelRowsPerPage: 'Sayfa başına satır:'
3683
- // labelDisplayedRows: ({ from, to, count }) =>
3684
- // `${from}–${to} tanesinden ${count !== -1 ? count : `more than ${to}`}`,
3682
+ labelRowsPerPage: 'Sayfa başına satır:',
3683
+ labelDisplayedRows: ({
3684
+ from,
3685
+ to,
3686
+ count
3687
+ }) => `${from}-${to} / ${count !== -1 ? count : `${to}'den fazla`}`
3685
3688
  }
3686
3689
  },
3687
-
3688
3690
  MuiRating: {
3689
3691
  defaultProps: {
3690
3692
  getLabelText: value => `${value} Yıldız`,
File without changes
@@ -492,6 +492,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
492
492
  MenuListProps: _extends({
493
493
  'aria-labelledby': labelId,
494
494
  role: 'listbox',
495
+ 'aria-multiselectable': multiple ? 'true' : undefined,
495
496
  disableListWrap: true
496
497
  }, MenuProps.MenuListProps),
497
498
  slotProps: {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.10
2
+ * @mui/material v5.14.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3679,12 +3679,14 @@ export const trTR = {
3679
3679
  // if (type === 'previous') {
3680
3680
  return 'Önceki sayfaya git';
3681
3681
  },
3682
- labelRowsPerPage: 'Sayfa başına satır:'
3683
- // labelDisplayedRows: ({ from, to, count }) =>
3684
- // `${from}–${to} tanesinden ${count !== -1 ? count : `more than ${to}`}`,
3682
+ labelRowsPerPage: 'Sayfa başına satır:',
3683
+ labelDisplayedRows: ({
3684
+ from,
3685
+ to,
3686
+ count
3687
+ }) => `${from}-${to} / ${count !== -1 ? count : `${to}'den fazla`}`
3685
3688
  }
3686
3689
  },
3687
-
3688
3690
  MuiRating: {
3689
3691
  defaultProps: {
3690
3692
  getLabelText: value => `${value} Yıldız`,
File without changes
@@ -499,6 +499,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
499
499
  MenuListProps: (0, _extends2.default)({
500
500
  'aria-labelledby': labelId,
501
501
  role: 'listbox',
502
+ 'aria-multiselectable': multiple ? 'true' : undefined,
502
503
  disableListWrap: true
503
504
  }, MenuProps.MenuListProps),
504
505
  slotProps: {
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
- var React = _interopRequireWildcard(require("react"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
12
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
14
  var _clsx = _interopRequireDefault(require("clsx"));
14
15
  var _utils = require("@mui/utils");
@@ -223,7 +224,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
223
224
  // TODO v5 remove `selectIcon`
224
225
  icon: (0, _clsx.default)(classes.selectIcon, (SelectProps.classes || {}).icon)
225
226
  }),
226
- children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/(0, React.createElement)(MenuItemComponent, (0, _extends2.default)({}, !(0, _base.isHostComponent)(MenuItemComponent) && {
227
+ children: rowsPerPageOptions.map(rowsPerPageOption => /*#__PURE__*/(0, _react.createElement)(MenuItemComponent, (0, _extends2.default)({}, !(0, _base.isHostComponent)(MenuItemComponent) && {
227
228
  ownerState
228
229
  }, {
229
230
  className: classes.menuItem,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.10
2
+ * @mui/material v5.14.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3730,12 +3730,14 @@ const trTR = {
3730
3730
  // if (type === 'previous') {
3731
3731
  return 'Önceki sayfaya git';
3732
3732
  },
3733
- labelRowsPerPage: 'Sayfa başına satır:'
3734
- // labelDisplayedRows: ({ from, to, count }) =>
3735
- // `${from}–${to} tanesinden ${count !== -1 ? count : `more than ${to}`}`,
3733
+ labelRowsPerPage: 'Sayfa başına satır:',
3734
+ labelDisplayedRows: ({
3735
+ from,
3736
+ to,
3737
+ count
3738
+ }) => `${from}-${to} / ${count !== -1 ? count : `${to}'den fazla`}`
3736
3739
  }
3737
3740
  },
3738
-
3739
3741
  MuiRating: {
3740
3742
  defaultProps: {
3741
3743
  getLabelText: value => `${value} Yıldız`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.14.10",
3
+ "version": "5.14.11",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "React components that implement Google's Material Design.",
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.22.15",
31
- "@mui/base": "5.0.0-beta.16",
32
- "@mui/core-downloads-tracker": "^5.14.10",
33
- "@mui/system": "^5.14.10",
31
+ "@mui/base": "5.0.0-beta.17",
32
+ "@mui/core-downloads-tracker": "^5.14.11",
33
+ "@mui/system": "^5.14.11",
34
34
  "@mui/types": "^7.2.4",
35
- "@mui/utils": "^5.14.10",
35
+ "@mui/utils": "^5.14.11",
36
36
  "@types/react-transition-group": "^4.4.6",
37
37
  "clsx": "^2.0.0",
38
38
  "csstype": "^3.1.2",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.10
2
+ * @mui/material v5.14.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1983,7 +1983,11 @@
1983
1983
  }
1984
1984
 
1985
1985
  function isMuiElement(element, muiNames) {
1986
- return /*#__PURE__*/React__namespace.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
1986
+ var _muiName, _element$type;
1987
+ return /*#__PURE__*/React__namespace.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
1988
+ // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
1989
+ // eslint-disable-next-line no-underscore-dangle
1990
+ (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
1987
1991
  }
1988
1992
 
1989
1993
  function ownerDocument(node) {
@@ -2037,6 +2041,13 @@
2037
2041
  }
2038
2042
  }
2039
2043
 
2044
+ /**
2045
+ * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
2046
+ * This is useful for effects that are only needed for client-side rendering but not for SSR.
2047
+ *
2048
+ * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
2049
+ * and confirm it doesn't apply to your use-case.
2050
+ */
2040
2051
  const useEnhancedEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
2041
2052
  var useEnhancedEffect$1 = useEnhancedEffect;
2042
2053
 
@@ -8867,11 +8878,11 @@ try {
8867
8878
  */
8868
8879
  disableStyleSheetGeneration: PropTypes.bool,
8869
8880
  /**
8870
- * Disable CSS transitions when switching between modes or color schemes
8881
+ * Disable CSS transitions when switching between modes or color schemes.
8871
8882
  */
8872
8883
  disableTransitionOnChange: PropTypes.bool,
8873
8884
  /**
8874
- * The document to attach the attribute to
8885
+ * The document to attach the attribute to.
8875
8886
  */
8876
8887
  documentNode: PropTypes.any,
8877
8888
  /**
@@ -8879,7 +8890,7 @@ try {
8879
8890
  */
8880
8891
  modeStorageKey: PropTypes.string,
8881
8892
  /**
8882
- * The window that attaches the 'storage' event listener
8893
+ * The window that attaches the 'storage' event listener.
8883
8894
  * @default window
8884
8895
  */
8885
8896
  storageWindow: PropTypes.any,
@@ -19600,64 +19611,51 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
19600
19611
  if (isEmpty$1(newState)) {
19601
19612
  return;
19602
19613
  }
19603
- setState(prevState => {
19604
- return updateState(prevState, newState);
19605
- });
19614
+ setState(prevState => updateState(prevState, newState));
19606
19615
  }, [getUpdatedState]);
19607
- const syncHeightWithFlushSync = () => {
19608
- const newState = getUpdatedState();
19609
- if (isEmpty$1(newState)) {
19610
- return;
19611
- }
19616
+ useEnhancedEffect$1(() => {
19617
+ const syncHeightWithFlushSync = () => {
19618
+ const newState = getUpdatedState();
19619
+ if (isEmpty$1(newState)) {
19620
+ return;
19621
+ }
19612
19622
 
19613
- // In React 18, state updates in a ResizeObserver's callback are happening after the paint which causes flickering
19614
- // when doing some visual updates in it. Using flushSync ensures that the dom will be painted after the states updates happen
19615
- // Related issue - https://github.com/facebook/react/issues/24331
19616
- ReactDOM__namespace.flushSync(() => {
19617
- setState(prevState => {
19618
- return updateState(prevState, newState);
19623
+ // In React 18, state updates in a ResizeObserver's callback are happening after
19624
+ // the paint, this leads to an infinite rendering.
19625
+ //
19626
+ // Using flushSync ensures that the states is updated before the next pain.
19627
+ // Related issue - https://github.com/facebook/react/issues/24331
19628
+ ReactDOM__namespace.flushSync(() => {
19629
+ setState(prevState => updateState(prevState, newState));
19619
19630
  });
19620
- });
19621
- };
19622
- React__namespace.useEffect(() => {
19631
+ };
19623
19632
  const handleResize = () => {
19624
19633
  renders.current = 0;
19625
-
19626
- // If the TextareaAutosize component is replaced by Suspense with a fallback, the last
19627
- // ResizeObserver's handler that runs because of the change in the layout is trying to
19628
- // access a dom node that is no longer there (as the fallback component is being shown instead).
19629
- // See https://github.com/mui/material-ui/issues/32640
19630
- if (inputRef.current) {
19631
- syncHeightWithFlushSync();
19632
- }
19634
+ syncHeightWithFlushSync();
19633
19635
  };
19634
- const handleResizeWindow = debounce$1(() => {
19635
- renders.current = 0;
19636
-
19637
- // If the TextareaAutosize component is replaced by Suspense with a fallback, the last
19638
- // ResizeObserver's handler that runs because of the change in the layout is trying to
19639
- // access a dom node that is no longer there (as the fallback component is being shown instead).
19640
- // See https://github.com/mui/material-ui/issues/32640
19641
- if (inputRef.current) {
19642
- syncHeightWithFlushSync();
19643
- }
19644
- });
19645
- let resizeObserver;
19636
+ // Workaround a "ResizeObserver loop completed with undelivered notifications" error
19637
+ // in test.
19638
+ // Note that we might need to use this logic in production per https://github.com/WICG/resize-observer/issues/38
19639
+ // Also see https://github.com/mui/mui-x/issues/8733
19640
+ let rAF;
19641
+ const debounceHandleResize = debounce$1(handleResize);
19646
19642
  const input = inputRef.current;
19647
19643
  const containerWindow = ownerWindow(input);
19648
- containerWindow.addEventListener('resize', handleResizeWindow);
19644
+ containerWindow.addEventListener('resize', debounceHandleResize);
19645
+ let resizeObserver;
19649
19646
  if (typeof ResizeObserver !== 'undefined') {
19650
19647
  resizeObserver = new ResizeObserver(handleResize);
19651
19648
  resizeObserver.observe(input);
19652
19649
  }
19653
19650
  return () => {
19654
- handleResizeWindow.clear();
19655
- containerWindow.removeEventListener('resize', handleResizeWindow);
19651
+ debounceHandleResize.clear();
19652
+ cancelAnimationFrame(rAF);
19653
+ containerWindow.removeEventListener('resize', debounceHandleResize);
19656
19654
  if (resizeObserver) {
19657
19655
  resizeObserver.disconnect();
19658
19656
  }
19659
19657
  };
19660
- });
19658
+ }, [getUpdatedState]);
19661
19659
  useEnhancedEffect$1(() => {
19662
19660
  syncHeight();
19663
19661
  });
@@ -40239,6 +40237,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
40239
40237
  MenuListProps: _extends({
40240
40238
  'aria-labelledby': labelId,
40241
40239
  role: 'listbox',
40240
+ 'aria-multiselectable': multiple ? 'true' : undefined,
40242
40241
  disableListWrap: true
40243
40242
  }, MenuProps.MenuListProps),
40244
40243
  slotProps: {