@mui/material 5.14.6 → 5.14.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/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.7
4
+
5
+ <!-- generated comparing v5.14.6..master -->
6
+
7
+ _Aug 29, 2023_
8
+
9
+ A big thanks to the 11 contributors who made this release possible. This release focuses primarily on 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements.
10
+
11
+ ### `@mui/material@5.14.7`
12
+
13
+ - &#8203;<!-- 17 -->[Autocomplete] Fix listbox opened unexpectedly when component is `disabled` (#38611) @mj12albert
14
+ - &#8203;<!-- 03 -->[Select][material-ui] Fix select menu moving on scroll when disableScrollLock is true (#37773) @VishruthR
15
+
16
+ ### `@mui/base@5.0.0-beta.13`
17
+
18
+ - &#8203;<!-- 16 -->[useButton][base-ui] Accept arbitrary props in getRootProps and forward them (#38475) @DiegoAndai
19
+
20
+ ### `@mui/zero-runtime@0.0.1-alpha.1`
21
+
22
+ - &#8203;<!-- 02 -->[system][zero][tag] Add support for sx prop (#38535) @brijeshb42
23
+
24
+ ### Docs
25
+
26
+ - &#8203;<!-- 10 -->[docs] Number Input docs fixes (#38521) @mj12albert
27
+ - &#8203;<!-- 09 -->[docs] Show all the code in the usage section (#38691) @oliviertassinari
28
+ - &#8203;<!-- 06 -->[docs][joy-ui] Change the customization and how-to guides docs tree (#38396) @danilo-leal
29
+ - &#8203;<!-- 05 -->[docs][lab][LoadingButton] Improve `loading` prop documentation (#38625) @sai6855
30
+ - &#8203;<!-- 04 -->[docs][material-ui] Format `key` prop JSDoc description in `Snackbar` component code correctly (#38603) @jaydenseric
31
+
32
+ ### Core
33
+
34
+ - &#8203;<!-- 15 -->[core] Add use-client to custom icons (#38132) @mj12albert
35
+ - &#8203;<!-- 14 -->[core] Remove unnecessary `@types/jsdom` (#38657) @renovate[bot]
36
+ - &#8203;<!-- 13 -->[core] Improve sponsors GA labels (#38649) @oliviertassinari
37
+ - &#8203;<!-- 12 -->[core] Fix ESM issues with regression tests (#37963) @Janpot
38
+ - &#8203;<!-- 11 -->[core] Potential fix for intermittent ci crashes in e2e test (#38614) @Janpot
39
+ - &#8203;<!-- 08 -->[docs-infra] Adjust the Material You playground demo design (#38636) @danilo-leal
40
+ - &#8203;<!-- 07 -->[docs-infra] Hide the SkipLink button if user prefers reduced motion (#38632) @DerTimonius
41
+ - &#8203;<!-- 01 -->[website] Add tiny fixes the homepage Sponsors section (#38635) @danilo-leal
42
+
43
+ All contributors of this release in alphabetical order: @brijeshb42, @danilo-leal, @DerTimonius, @DiegoAndai, @Janpot, @jaydenseric, @mj12albert, @oliviertassinari, @renovate[bot], @sai6855, @VishruthR
44
+
3
45
  ## 5.14.6
4
46
 
5
47
  <!-- generated comparing v5.14.5..master -->
@@ -91,9 +91,10 @@ export interface PopoverProps
91
91
  elevation?: number;
92
92
  /**
93
93
  * Specifies how close to the edge of the window the popover can appear.
94
+ * If null, the popover will not be constrained by the window.
94
95
  * @default 16
95
96
  */
96
- marginThreshold?: number;
97
+ marginThreshold?: number | null;
97
98
  onClose?: ModalProps['onClose'];
98
99
  /**
99
100
  * If `true`, the component is shown.
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["onEntering"],
6
- _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
6
+ _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
7
7
  _excluded3 = ["slotProps"];
8
8
  import * as React from 'react';
9
9
  import PropTypes from 'prop-types';
@@ -113,7 +113,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
113
113
  transitionDuration: transitionDurationProp = 'auto',
114
114
  TransitionProps: {
115
115
  onEntering
116
- } = {}
116
+ } = {},
117
+ disableScrollLock = false
117
118
  } = props,
118
119
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
119
120
  other = _objectWithoutPropertiesLoose(props, _excluded2);
@@ -201,11 +202,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
201
202
  const widthThreshold = containerWindow.innerWidth - marginThreshold;
202
203
 
203
204
  // Check if the vertical axis needs shifting
204
- if (top < marginThreshold) {
205
+ if (marginThreshold !== null && top < marginThreshold) {
205
206
  const diff = top - marginThreshold;
206
207
  top -= diff;
207
208
  elemTransformOrigin.vertical += diff;
208
- } else if (bottom > heightThreshold) {
209
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
209
210
  const diff = bottom - heightThreshold;
210
211
  top -= diff;
211
212
  elemTransformOrigin.vertical += diff;
@@ -217,7 +218,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
217
218
  }
218
219
 
219
220
  // Check if the horizontal axis needs shifting
220
- if (left < marginThreshold) {
221
+ if (marginThreshold !== null && left < marginThreshold) {
221
222
  const diff = left - marginThreshold;
222
223
  left -= diff;
223
224
  elemTransformOrigin.horizontal += diff;
@@ -248,6 +249,12 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
248
249
  element.style.transformOrigin = positioning.transformOrigin;
249
250
  setIsPositioned(true);
250
251
  }, [getPositioningStyle]);
252
+ React.useEffect(() => {
253
+ if (disableScrollLock) {
254
+ window.addEventListener('scroll', setPositioningStyles);
255
+ }
256
+ return () => window.removeEventListener('scroll', setPositioningStyles);
257
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
251
258
  const handleEntering = (element, isAppearing) => {
252
259
  if (onEntering) {
253
260
  onEntering(element, isAppearing);
@@ -328,7 +335,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
328
335
  } = _useSlotProps,
329
336
  rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
330
337
  return /*#__PURE__*/_jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
331
- slotProps: rootSlotPropsProp
338
+ slotProps: rootSlotPropsProp,
339
+ disableScrollLock
332
340
  }, {
333
341
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
334
342
  appear: true,
@@ -423,6 +431,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
423
431
  * so it's simply `document.body` most of the time.
424
432
  */
425
433
  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
434
+ /**
435
+ * Disable the scroll lock behavior.
436
+ * @default false
437
+ */
438
+ disableScrollLock: PropTypes.bool,
426
439
  /**
427
440
  * The elevation of the popover.
428
441
  * @default 8
@@ -430,6 +443,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
430
443
  elevation: integerPropType,
431
444
  /**
432
445
  * Specifies how close to the edge of the window the popover can appear.
446
+ * If null, the popover will not be constrained by the window.
433
447
  * @default 16
434
448
  */
435
449
  marginThreshold: PropTypes.number,
@@ -56,10 +56,10 @@ export interface SnackbarProps extends StandardProps<React.HTMLAttributes<HTMLDi
56
56
  */
57
57
  disableWindowBlurListener?: boolean;
58
58
  /**
59
- * When displaying multiple consecutive Snackbars from a parent rendering a single
60
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
61
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
62
- * features such as autoHideDuration may be canceled.
59
+ * When displaying multiple consecutive snackbars using a single parent-rendered
60
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
61
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
62
+ * in place, and features like `autoHideDuration` could be affected.
63
63
  */
64
64
  key?: any;
65
65
  /**
@@ -227,10 +227,10 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
227
227
  */
228
228
  disableWindowBlurListener: PropTypes.bool,
229
229
  /**
230
- * When displaying multiple consecutive Snackbars from a parent rendering a single
231
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
232
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
233
- * features such as autoHideDuration may be canceled.
230
+ * When displaying multiple consecutive snackbars using a single parent-rendered
231
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
232
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
233
+ * in place, and features like `autoHideDuration` could be affected.
234
234
  */
235
235
  key: () => null,
236
236
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.6
2
+ * @mui/material v5.14.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -123,7 +123,9 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
123
123
  _props$TransitionProp2 = _props$TransitionProp === void 0 ? {} : _props$TransitionProp,
124
124
  onEntering = _props$TransitionProp2.onEntering,
125
125
  TransitionProps = _objectWithoutProperties(_props$TransitionProp2, ["onEntering"]),
126
- other = _objectWithoutProperties(props, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]);
126
+ _props$disableScrollL = props.disableScrollLock,
127
+ disableScrollLock = _props$disableScrollL === void 0 ? false : _props$disableScrollL,
128
+ other = _objectWithoutProperties(props, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"]);
127
129
  var externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
128
130
  var paperRef = React.useRef();
129
131
  var handlePaperRef = useForkRef(paperRef, externalPaperSlotProps.ref);
@@ -208,11 +210,11 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
208
210
  var widthThreshold = containerWindow.innerWidth - marginThreshold;
209
211
 
210
212
  // Check if the vertical axis needs shifting
211
- if (top < marginThreshold) {
213
+ if (marginThreshold !== null && top < marginThreshold) {
212
214
  var diff = top - marginThreshold;
213
215
  top -= diff;
214
216
  elemTransformOrigin.vertical += diff;
215
- } else if (bottom > heightThreshold) {
217
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
216
218
  var _diff = bottom - heightThreshold;
217
219
  top -= _diff;
218
220
  elemTransformOrigin.vertical += _diff;
@@ -224,7 +226,7 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
224
226
  }
225
227
 
226
228
  // Check if the horizontal axis needs shifting
227
- if (left < marginThreshold) {
229
+ if (marginThreshold !== null && left < marginThreshold) {
228
230
  var _diff2 = left - marginThreshold;
229
231
  left -= _diff2;
230
232
  elemTransformOrigin.horizontal += _diff2;
@@ -257,6 +259,14 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
257
259
  element.style.transformOrigin = positioning.transformOrigin;
258
260
  setIsPositioned(true);
259
261
  }, [getPositioningStyle]);
262
+ React.useEffect(function () {
263
+ if (disableScrollLock) {
264
+ window.addEventListener('scroll', setPositioningStyles);
265
+ }
266
+ return function () {
267
+ return window.removeEventListener('scroll', setPositioningStyles);
268
+ };
269
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
260
270
  var handleEntering = function handleEntering(element, isAppearing) {
261
271
  if (onEntering) {
262
272
  onEntering(element, isAppearing);
@@ -337,7 +347,8 @@ var Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
337
347
  rootSlotPropsProp = _useSlotProps.slotProps,
338
348
  rootProps = _objectWithoutProperties(_useSlotProps, ["slotProps"]);
339
349
  return /*#__PURE__*/_jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
340
- slotProps: rootSlotPropsProp
350
+ slotProps: rootSlotPropsProp,
351
+ disableScrollLock: disableScrollLock
341
352
  }, {
342
353
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
343
354
  appear: true,
@@ -432,6 +443,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
432
443
  * so it's simply `document.body` most of the time.
433
444
  */
434
445
  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
446
+ /**
447
+ * Disable the scroll lock behavior.
448
+ * @default false
449
+ */
450
+ disableScrollLock: PropTypes.bool,
435
451
  /**
436
452
  * The elevation of the popover.
437
453
  * @default 8
@@ -439,6 +455,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
439
455
  elevation: integerPropType,
440
456
  /**
441
457
  * Specifies how close to the edge of the window the popover can appear.
458
+ * If null, the popover will not be constrained by the window.
442
459
  * @default 16
443
460
  */
444
461
  marginThreshold: PropTypes.number,
@@ -228,10 +228,10 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
228
228
  */
229
229
  disableWindowBlurListener: PropTypes.bool,
230
230
  /**
231
- * When displaying multiple consecutive Snackbars from a parent rendering a single
232
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
233
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
234
- * features such as autoHideDuration may be canceled.
231
+ * When displaying multiple consecutive snackbars using a single parent-rendered
232
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
233
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
234
+ * in place, and features like `autoHideDuration` could be affected.
235
235
  */
236
236
  key: function key() {
237
237
  return null;
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.6
2
+ * @mui/material v5.14.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["onEntering"],
6
- _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
6
+ _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
7
7
  _excluded3 = ["slotProps"];
8
8
  import * as React from 'react';
9
9
  import PropTypes from 'prop-types';
@@ -112,7 +112,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
112
112
  transitionDuration: transitionDurationProp = 'auto',
113
113
  TransitionProps: {
114
114
  onEntering
115
- } = {}
115
+ } = {},
116
+ disableScrollLock = false
116
117
  } = props,
117
118
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
118
119
  other = _objectWithoutPropertiesLoose(props, _excluded2);
@@ -200,11 +201,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
200
201
  const widthThreshold = containerWindow.innerWidth - marginThreshold;
201
202
 
202
203
  // Check if the vertical axis needs shifting
203
- if (top < marginThreshold) {
204
+ if (marginThreshold !== null && top < marginThreshold) {
204
205
  const diff = top - marginThreshold;
205
206
  top -= diff;
206
207
  elemTransformOrigin.vertical += diff;
207
- } else if (bottom > heightThreshold) {
208
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
208
209
  const diff = bottom - heightThreshold;
209
210
  top -= diff;
210
211
  elemTransformOrigin.vertical += diff;
@@ -216,7 +217,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
216
217
  }
217
218
 
218
219
  // Check if the horizontal axis needs shifting
219
- if (left < marginThreshold) {
220
+ if (marginThreshold !== null && left < marginThreshold) {
220
221
  const diff = left - marginThreshold;
221
222
  left -= diff;
222
223
  elemTransformOrigin.horizontal += diff;
@@ -247,6 +248,12 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
247
248
  element.style.transformOrigin = positioning.transformOrigin;
248
249
  setIsPositioned(true);
249
250
  }, [getPositioningStyle]);
251
+ React.useEffect(() => {
252
+ if (disableScrollLock) {
253
+ window.addEventListener('scroll', setPositioningStyles);
254
+ }
255
+ return () => window.removeEventListener('scroll', setPositioningStyles);
256
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
250
257
  const handleEntering = (element, isAppearing) => {
251
258
  if (onEntering) {
252
259
  onEntering(element, isAppearing);
@@ -327,7 +334,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
327
334
  } = _useSlotProps,
328
335
  rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
329
336
  return /*#__PURE__*/_jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
330
- slotProps: rootSlotPropsProp
337
+ slotProps: rootSlotPropsProp,
338
+ disableScrollLock
331
339
  }, {
332
340
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
333
341
  appear: true,
@@ -422,6 +430,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
422
430
  * so it's simply `document.body` most of the time.
423
431
  */
424
432
  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
433
+ /**
434
+ * Disable the scroll lock behavior.
435
+ * @default false
436
+ */
437
+ disableScrollLock: PropTypes.bool,
425
438
  /**
426
439
  * The elevation of the popover.
427
440
  * @default 8
@@ -429,6 +442,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
429
442
  elevation: integerPropType,
430
443
  /**
431
444
  * Specifies how close to the edge of the window the popover can appear.
445
+ * If null, the popover will not be constrained by the window.
432
446
  * @default 16
433
447
  */
434
448
  marginThreshold: PropTypes.number,
@@ -227,10 +227,10 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
227
227
  */
228
228
  disableWindowBlurListener: PropTypes.bool,
229
229
  /**
230
- * When displaying multiple consecutive Snackbars from a parent rendering a single
231
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
232
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
233
- * features such as autoHideDuration may be canceled.
230
+ * When displaying multiple consecutive snackbars using a single parent-rendered
231
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
232
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
233
+ * in place, and features like `autoHideDuration` could be affected.
234
234
  */
235
235
  key: () => null,
236
236
  /**
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.6
2
+ * @mui/material v5.14.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -27,7 +27,7 @@ var _Paper = _interopRequireDefault(require("../Paper"));
27
27
  var _popoverClasses = require("./popoverClasses");
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
  const _excluded = ["onEntering"],
30
- _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
30
+ _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
31
31
  _excluded3 = ["slotProps"];
32
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
33
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -125,7 +125,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
125
125
  transitionDuration: transitionDurationProp = 'auto',
126
126
  TransitionProps: {
127
127
  onEntering
128
- } = {}
128
+ } = {},
129
+ disableScrollLock = false
129
130
  } = props,
130
131
  TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
131
132
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
@@ -213,11 +214,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
213
214
  const widthThreshold = containerWindow.innerWidth - marginThreshold;
214
215
 
215
216
  // Check if the vertical axis needs shifting
216
- if (top < marginThreshold) {
217
+ if (marginThreshold !== null && top < marginThreshold) {
217
218
  const diff = top - marginThreshold;
218
219
  top -= diff;
219
220
  elemTransformOrigin.vertical += diff;
220
- } else if (bottom > heightThreshold) {
221
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
221
222
  const diff = bottom - heightThreshold;
222
223
  top -= diff;
223
224
  elemTransformOrigin.vertical += diff;
@@ -229,7 +230,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
229
230
  }
230
231
 
231
232
  // Check if the horizontal axis needs shifting
232
- if (left < marginThreshold) {
233
+ if (marginThreshold !== null && left < marginThreshold) {
233
234
  const diff = left - marginThreshold;
234
235
  left -= diff;
235
236
  elemTransformOrigin.horizontal += diff;
@@ -260,6 +261,12 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
260
261
  element.style.transformOrigin = positioning.transformOrigin;
261
262
  setIsPositioned(true);
262
263
  }, [getPositioningStyle]);
264
+ React.useEffect(() => {
265
+ if (disableScrollLock) {
266
+ window.addEventListener('scroll', setPositioningStyles);
267
+ }
268
+ return () => window.removeEventListener('scroll', setPositioningStyles);
269
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
263
270
  const handleEntering = (element, isAppearing) => {
264
271
  if (onEntering) {
265
272
  onEntering(element, isAppearing);
@@ -340,7 +347,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
340
347
  } = _useSlotProps,
341
348
  rootProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded3);
342
349
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, (0, _extends2.default)({}, rootProps, !(0, _base.isHostComponent)(RootSlot) && {
343
- slotProps: rootSlotPropsProp
350
+ slotProps: rootSlotPropsProp,
351
+ disableScrollLock
344
352
  }, {
345
353
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, (0, _extends2.default)({
346
354
  appear: true,
@@ -435,6 +443,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
435
443
  * so it's simply `document.body` most of the time.
436
444
  */
437
445
  container: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
446
+ /**
447
+ * Disable the scroll lock behavior.
448
+ * @default false
449
+ */
450
+ disableScrollLock: _propTypes.default.bool,
438
451
  /**
439
452
  * The elevation of the popover.
440
453
  * @default 8
@@ -442,6 +455,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
442
455
  elevation: _utils.integerPropType,
443
456
  /**
444
457
  * Specifies how close to the edge of the window the popover can appear.
458
+ * If null, the popover will not be constrained by the window.
445
459
  * @default 16
446
460
  */
447
461
  marginThreshold: _propTypes.default.number,
@@ -235,10 +235,10 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
235
235
  */
236
236
  disableWindowBlurListener: _propTypes.default.bool,
237
237
  /**
238
- * When displaying multiple consecutive Snackbars from a parent rendering a single
239
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
240
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
241
- * features such as autoHideDuration may be canceled.
238
+ * When displaying multiple consecutive snackbars using a single parent-rendered
239
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
240
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
241
+ * in place, and features like `autoHideDuration` could be affected.
242
242
  */
243
243
  key: () => null,
244
244
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.6
2
+ * @mui/material v5.14.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.14.6",
3
+ "version": "5.14.7",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "React components that implement Google's Material Design.",
@@ -46,11 +46,11 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.22.10",
49
- "@mui/base": "5.0.0-beta.12",
50
- "@mui/core-downloads-tracker": "^5.14.6",
51
- "@mui/system": "^5.14.6",
49
+ "@mui/base": "5.0.0-beta.13",
50
+ "@mui/core-downloads-tracker": "^5.14.7",
51
+ "@mui/system": "^5.14.7",
52
52
  "@mui/types": "^7.2.4",
53
- "@mui/utils": "^5.14.6",
53
+ "@mui/utils": "^5.14.7",
54
54
  "@types/react-transition-group": "^4.4.6",
55
55
  "clsx": "^2.0.0",
56
56
  "csstype": "^3.1.2",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.6
2
+ * @mui/material v5.14.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -20551,7 +20551,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
20551
20551
  firstFocus.current = false;
20552
20552
  };
20553
20553
  const handleInputMouseDown = event => {
20554
- if (inputValue === '' || !open) {
20554
+ if (!disabledProp && (inputValue === '' || !open)) {
20555
20555
  handlePopupIndicator(event);
20556
20556
  }
20557
20557
  };
@@ -35810,7 +35810,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
35810
35810
  var popoverClasses$1 = popoverClasses;
35811
35811
 
35812
35812
  const _excluded$S = ["onEntering"],
35813
- _excluded2$7 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
35813
+ _excluded2$7 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
35814
35814
  _excluded3$1 = ["slotProps"];
35815
35815
  function getOffsetTop(rect, vertical) {
35816
35816
  let offset = 0;
@@ -35904,7 +35904,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
35904
35904
  transitionDuration: transitionDurationProp = 'auto',
35905
35905
  TransitionProps: {
35906
35906
  onEntering
35907
- } = {}
35907
+ } = {},
35908
+ disableScrollLock = false
35908
35909
  } = props,
35909
35910
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$S),
35910
35911
  other = _objectWithoutPropertiesLoose(props, _excluded2$7);
@@ -35992,11 +35993,11 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
35992
35993
  const widthThreshold = containerWindow.innerWidth - marginThreshold;
35993
35994
 
35994
35995
  // Check if the vertical axis needs shifting
35995
- if (top < marginThreshold) {
35996
+ if (marginThreshold !== null && top < marginThreshold) {
35996
35997
  const diff = top - marginThreshold;
35997
35998
  top -= diff;
35998
35999
  elemTransformOrigin.vertical += diff;
35999
- } else if (bottom > heightThreshold) {
36000
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
36000
36001
  const diff = bottom - heightThreshold;
36001
36002
  top -= diff;
36002
36003
  elemTransformOrigin.vertical += diff;
@@ -36008,7 +36009,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36008
36009
  }
36009
36010
 
36010
36011
  // Check if the horizontal axis needs shifting
36011
- if (left < marginThreshold) {
36012
+ if (marginThreshold !== null && left < marginThreshold) {
36012
36013
  const diff = left - marginThreshold;
36013
36014
  left -= diff;
36014
36015
  elemTransformOrigin.horizontal += diff;
@@ -36039,6 +36040,12 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36039
36040
  element.style.transformOrigin = positioning.transformOrigin;
36040
36041
  setIsPositioned(true);
36041
36042
  }, [getPositioningStyle]);
36043
+ React__namespace.useEffect(() => {
36044
+ if (disableScrollLock) {
36045
+ window.addEventListener('scroll', setPositioningStyles);
36046
+ }
36047
+ return () => window.removeEventListener('scroll', setPositioningStyles);
36048
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
36042
36049
  const handleEntering = (element, isAppearing) => {
36043
36050
  if (onEntering) {
36044
36051
  onEntering(element, isAppearing);
@@ -36119,7 +36126,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36119
36126
  } = _useSlotProps,
36120
36127
  rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3$1);
36121
36128
  return /*#__PURE__*/jsxRuntime_1(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
36122
- slotProps: rootSlotPropsProp
36129
+ slotProps: rootSlotPropsProp,
36130
+ disableScrollLock
36123
36131
  }, {
36124
36132
  children: /*#__PURE__*/jsxRuntime_1(TransitionComponent, _extends({
36125
36133
  appear: true,
@@ -36214,6 +36222,11 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36214
36222
  * so it's simply `document.body` most of the time.
36215
36223
  */
36216
36224
  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
36225
+ /**
36226
+ * Disable the scroll lock behavior.
36227
+ * @default false
36228
+ */
36229
+ disableScrollLock: PropTypes.bool,
36217
36230
  /**
36218
36231
  * The elevation of the popover.
36219
36232
  * @default 8
@@ -36221,6 +36234,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
36221
36234
  elevation: integerPropType,
36222
36235
  /**
36223
36236
  * Specifies how close to the edge of the window the popover can appear.
36237
+ * If null, the popover will not be constrained by the window.
36224
36238
  * @default 16
36225
36239
  */
36226
36240
  marginThreshold: PropTypes.number,
@@ -42093,10 +42107,10 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
42093
42107
  */
42094
42108
  disableWindowBlurListener: PropTypes.bool,
42095
42109
  /**
42096
- * When displaying multiple consecutive Snackbars from a parent rendering a single
42097
- * <Snackbar/>, add the key prop to ensure independent treatment of each message.
42098
- * e.g. <Snackbar key={message} />, otherwise, the message may update-in-place and
42099
- * features such as autoHideDuration may be canceled.
42110
+ * When displaying multiple consecutive snackbars using a single parent-rendered
42111
+ * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
42112
+ * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
42113
+ * in place, and features like `autoHideDuration` could be affected.
42100
42114
  */
42101
42115
  key: () => null,
42102
42116
  /**