@mui/material 7.3.0 → 7.3.1

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,20 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 7.3.1
4
+
5
+ <!-- generated comparing v7.3.0..master -->
6
+
7
+ _Aug 6, 2025_
8
+
9
+ A big thanks to the 2 contributors who made this release possible.
10
+
11
+ ### `@mui/material@7.3.1`
12
+
13
+ - [PaginationItem] Fix inheritance of component (#46666) @sai6855
14
+ - [Select] Revert - Implement pointer cancellation PR 45789 (#46672) @ZeeshanTamboli
15
+
16
+ All contributors of this release in alphabetical order: @sai6855, @ZeeshanTamboli
17
+
3
18
  ## 7.3.0
4
19
 
5
20
  <!-- generated comparing v7.2.0..master -->
@@ -102,6 +102,7 @@ export interface PaginationItemTypeMap<AdditionalProps = {}, RootComponent exten
102
102
  * API:
103
103
  *
104
104
  * - [PaginationItem API](https://mui.com/material-ui/api/pagination-item/)
105
+ * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
105
106
  */
106
107
  declare const PaginationItem: OverridableComponent<PaginationItemTypeMap>;
107
108
  export type PaginationItemProps<RootComponent extends React.ElementType = PaginationItemTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<PaginationItemTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
@@ -160,27 +160,12 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
160
160
  });
161
161
  const inputRef = React.useRef(null);
162
162
  const displayRef = React.useRef(null);
163
- const paperRef = React.useRef(null);
164
- const didPointerDownRef = React.useRef(false);
165
163
  const [displayNode, setDisplayNode] = React.useState(null);
166
164
  const {
167
165
  current: isOpenControlled
168
166
  } = React.useRef(openProp != null);
169
167
  const [menuMinWidthState, setMenuMinWidthState] = React.useState();
170
- const open = displayNode !== null && openState;
171
- const ownerState = {
172
- ...props,
173
- variant,
174
- value,
175
- open,
176
- error
177
- };
178
- const paperProps = {
179
- ...MenuProps.PaperProps,
180
- ...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
181
- };
182
168
  const handleRef = (0, _useForkRef.default)(ref, inputRefProp);
183
- const handlePaperRef = (0, _useForkRef.default)(paperProps.ref, paperRef);
184
169
  const handleDisplayRef = React.useCallback(node => {
185
170
  displayRef.current = node;
186
171
  if (node) {
@@ -230,8 +215,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
230
215
  }
231
216
  return undefined;
232
217
  }, [labelId]);
233
- const update = (openParam, event) => {
234
- if (openParam) {
218
+ const update = (open, event) => {
219
+ if (open) {
235
220
  if (onOpen) {
236
221
  onOpen(event);
237
222
  }
@@ -240,7 +225,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
240
225
  }
241
226
  if (!isOpenControlled) {
242
227
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
243
- setOpenState(openParam);
228
+ setOpenState(open);
244
229
  }
245
230
  };
246
231
  const handleMouseDown = event => {
@@ -251,31 +236,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
251
236
  // Hijack the default focus behavior.
252
237
  event.preventDefault();
253
238
  displayRef.current.focus();
254
- const doc = (0, _ownerDocument.default)(event.currentTarget);
255
- function handleMouseUp(mouseEvent) {
256
- if (!displayRef.current) {
257
- return;
258
- }
259
-
260
- // mouse is over the options/menuitem, don't close the menu
261
- if (paperRef.current.contains(mouseEvent.target)) {
262
- return;
263
- }
264
- const triggerElement = displayRef.current.getBoundingClientRect();
265
-
266
- // mouse is inside the trigger, don't close the menu
267
- if (mouseEvent.clientX >= triggerElement.left && mouseEvent.clientX <= triggerElement.right && mouseEvent.clientY >= triggerElement.top && mouseEvent.clientY <= triggerElement.bottom) {
268
- return;
269
- }
270
-
271
- // close the menu
272
- update(false, mouseEvent);
273
- }
274
-
275
- // `{ once: true }` to automatically remove the listener, see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once
276
- doc.addEventListener('mouseup', handleMouseUp, {
277
- once: true
278
- });
279
239
  update(true, event);
280
240
  };
281
241
  const handleClose = event => {
@@ -294,7 +254,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
294
254
  onChange(event, child);
295
255
  }
296
256
  };
297
- const handleItemSelect = child => event => {
257
+ const handleItemClick = child => event => {
298
258
  let newValue;
299
259
 
300
260
  // We use the tabindex attribute to signal the available options.
@@ -312,6 +272,9 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
312
272
  } else {
313
273
  newValue = child.props.value;
314
274
  }
275
+ if (child.props.onClick) {
276
+ child.props.onClick(event);
277
+ }
315
278
  if (value !== newValue) {
316
279
  setValueState(newValue);
317
280
  if (onChange) {
@@ -347,6 +310,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
347
310
  }
348
311
  }
349
312
  };
313
+ const open = displayNode !== null && openState;
350
314
  const handleBlur = event => {
351
315
  // if open event.stopImmediatePropagation
352
316
  if (!open && onBlur) {
@@ -407,26 +371,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
407
371
  }
408
372
  return /*#__PURE__*/React.cloneElement(child, {
409
373
  'aria-selected': selected ? 'true' : 'false',
410
- onPointerDown: () => {
411
- didPointerDownRef.current = true;
412
- },
413
- onClick: event => {
414
- didPointerDownRef.current = false;
415
- if (child.props.onClick) {
416
- child.props.onClick(event);
417
- }
418
- handleItemSelect(child)(event);
419
- },
420
- onMouseUp: event => {
421
- if (didPointerDownRef.current) {
422
- didPointerDownRef.current = false;
423
- return;
424
- }
425
- if (child.props.onMouseUp) {
426
- child.props.onMouseUp(event);
427
- }
428
- handleItemSelect(child)(event);
429
- },
374
+ onClick: handleItemClick(child),
430
375
  onKeyUp: event => {
431
376
  if (event.key === ' ') {
432
377
  // otherwise our MenuItems dispatches a click event
@@ -485,7 +430,18 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
485
430
  tabIndex = disabled ? null : 0;
486
431
  }
487
432
  const buttonId = SelectDisplayProps.id || (name ? `mui-component-select-${name}` : undefined);
433
+ const ownerState = {
434
+ ...props,
435
+ variant,
436
+ value,
437
+ open,
438
+ error
439
+ };
488
440
  const classes = useUtilityClasses(ownerState);
441
+ const paperProps = {
442
+ ...MenuProps.PaperProps,
443
+ ...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
444
+ };
489
445
  const listProps = {
490
446
  ...MenuProps.MenuListProps,
491
447
  ...(typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list)
@@ -566,7 +522,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
566
522
  },
567
523
  paper: {
568
524
  ...paperProps,
569
- ref: handlePaperRef,
570
525
  style: {
571
526
  minWidth: menuMinWidth,
572
527
  ...(paperProps != null ? paperProps.style : null)
@@ -102,6 +102,7 @@ export interface PaginationItemTypeMap<AdditionalProps = {}, RootComponent exten
102
102
  * API:
103
103
  *
104
104
  * - [PaginationItem API](https://mui.com/material-ui/api/pagination-item/)
105
+ * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
105
106
  */
106
107
  declare const PaginationItem: OverridableComponent<PaginationItemTypeMap>;
107
108
  export type PaginationItemProps<RootComponent extends React.ElementType = PaginationItemTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<PaginationItemTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
@@ -153,27 +153,12 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
153
153
  });
154
154
  const inputRef = React.useRef(null);
155
155
  const displayRef = React.useRef(null);
156
- const paperRef = React.useRef(null);
157
- const didPointerDownRef = React.useRef(false);
158
156
  const [displayNode, setDisplayNode] = React.useState(null);
159
157
  const {
160
158
  current: isOpenControlled
161
159
  } = React.useRef(openProp != null);
162
160
  const [menuMinWidthState, setMenuMinWidthState] = React.useState();
163
- const open = displayNode !== null && openState;
164
- const ownerState = {
165
- ...props,
166
- variant,
167
- value,
168
- open,
169
- error
170
- };
171
- const paperProps = {
172
- ...MenuProps.PaperProps,
173
- ...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
174
- };
175
161
  const handleRef = useForkRef(ref, inputRefProp);
176
- const handlePaperRef = useForkRef(paperProps.ref, paperRef);
177
162
  const handleDisplayRef = React.useCallback(node => {
178
163
  displayRef.current = node;
179
164
  if (node) {
@@ -223,8 +208,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
223
208
  }
224
209
  return undefined;
225
210
  }, [labelId]);
226
- const update = (openParam, event) => {
227
- if (openParam) {
211
+ const update = (open, event) => {
212
+ if (open) {
228
213
  if (onOpen) {
229
214
  onOpen(event);
230
215
  }
@@ -233,7 +218,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
233
218
  }
234
219
  if (!isOpenControlled) {
235
220
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
236
- setOpenState(openParam);
221
+ setOpenState(open);
237
222
  }
238
223
  };
239
224
  const handleMouseDown = event => {
@@ -244,31 +229,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
244
229
  // Hijack the default focus behavior.
245
230
  event.preventDefault();
246
231
  displayRef.current.focus();
247
- const doc = ownerDocument(event.currentTarget);
248
- function handleMouseUp(mouseEvent) {
249
- if (!displayRef.current) {
250
- return;
251
- }
252
-
253
- // mouse is over the options/menuitem, don't close the menu
254
- if (paperRef.current.contains(mouseEvent.target)) {
255
- return;
256
- }
257
- const triggerElement = displayRef.current.getBoundingClientRect();
258
-
259
- // mouse is inside the trigger, don't close the menu
260
- if (mouseEvent.clientX >= triggerElement.left && mouseEvent.clientX <= triggerElement.right && mouseEvent.clientY >= triggerElement.top && mouseEvent.clientY <= triggerElement.bottom) {
261
- return;
262
- }
263
-
264
- // close the menu
265
- update(false, mouseEvent);
266
- }
267
-
268
- // `{ once: true }` to automatically remove the listener, see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once
269
- doc.addEventListener('mouseup', handleMouseUp, {
270
- once: true
271
- });
272
232
  update(true, event);
273
233
  };
274
234
  const handleClose = event => {
@@ -287,7 +247,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
287
247
  onChange(event, child);
288
248
  }
289
249
  };
290
- const handleItemSelect = child => event => {
250
+ const handleItemClick = child => event => {
291
251
  let newValue;
292
252
 
293
253
  // We use the tabindex attribute to signal the available options.
@@ -305,6 +265,9 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
305
265
  } else {
306
266
  newValue = child.props.value;
307
267
  }
268
+ if (child.props.onClick) {
269
+ child.props.onClick(event);
270
+ }
308
271
  if (value !== newValue) {
309
272
  setValueState(newValue);
310
273
  if (onChange) {
@@ -340,6 +303,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
340
303
  }
341
304
  }
342
305
  };
306
+ const open = displayNode !== null && openState;
343
307
  const handleBlur = event => {
344
308
  // if open event.stopImmediatePropagation
345
309
  if (!open && onBlur) {
@@ -400,26 +364,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
400
364
  }
401
365
  return /*#__PURE__*/React.cloneElement(child, {
402
366
  'aria-selected': selected ? 'true' : 'false',
403
- onPointerDown: () => {
404
- didPointerDownRef.current = true;
405
- },
406
- onClick: event => {
407
- didPointerDownRef.current = false;
408
- if (child.props.onClick) {
409
- child.props.onClick(event);
410
- }
411
- handleItemSelect(child)(event);
412
- },
413
- onMouseUp: event => {
414
- if (didPointerDownRef.current) {
415
- didPointerDownRef.current = false;
416
- return;
417
- }
418
- if (child.props.onMouseUp) {
419
- child.props.onMouseUp(event);
420
- }
421
- handleItemSelect(child)(event);
422
- },
367
+ onClick: handleItemClick(child),
423
368
  onKeyUp: event => {
424
369
  if (event.key === ' ') {
425
370
  // otherwise our MenuItems dispatches a click event
@@ -478,7 +423,18 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
478
423
  tabIndex = disabled ? null : 0;
479
424
  }
480
425
  const buttonId = SelectDisplayProps.id || (name ? `mui-component-select-${name}` : undefined);
426
+ const ownerState = {
427
+ ...props,
428
+ variant,
429
+ value,
430
+ open,
431
+ error
432
+ };
481
433
  const classes = useUtilityClasses(ownerState);
434
+ const paperProps = {
435
+ ...MenuProps.PaperProps,
436
+ ...(typeof MenuProps.slotProps?.paper === 'function' ? MenuProps.slotProps.paper(ownerState) : MenuProps.slotProps?.paper)
437
+ };
482
438
  const listProps = {
483
439
  ...MenuProps.MenuListProps,
484
440
  ...(typeof MenuProps.slotProps?.list === 'function' ? MenuProps.slotProps.list(ownerState) : MenuProps.slotProps?.list)
@@ -559,7 +515,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
559
515
  },
560
516
  paper: {
561
517
  ...paperProps,
562
- ref: handlePaperRef,
563
518
  style: {
564
519
  minWidth: menuMinWidth,
565
520
  ...(paperProps != null ? paperProps.style : null)
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v7.3.0
2
+ * @mui/material v7.3.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,6 @@
1
- export const version = "7.3.0";
1
+ export const version = "7.3.1";
2
2
  export const major = Number("7");
3
3
  export const minor = Number("3");
4
- export const patch = Number("0");
4
+ export const patch = Number("1");
5
5
  export const prerelease = undefined;
6
6
  export default version;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v7.3.0
2
+ * @mui/material v7.3.1
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": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "author": "MUI Team",
5
5
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
6
6
  "main": "./index.js",
@@ -34,10 +34,10 @@
34
34
  "prop-types": "^15.8.1",
35
35
  "react-is": "^19.1.1",
36
36
  "react-transition-group": "^4.4.5",
37
- "@mui/system": "^7.3.0",
37
+ "@mui/system": "^7.3.1",
38
38
  "@mui/types": "^7.4.5",
39
- "@mui/utils": "^7.3.0",
40
- "@mui/core-downloads-tracker": "^7.3.0"
39
+ "@mui/core-downloads-tracker": "^7.3.1",
40
+ "@mui/utils": "^7.3.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@emotion/react": "^11.5.0",
@@ -45,7 +45,7 @@
45
45
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
46
46
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
47
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
48
- "@mui/material-pigment-css": "^7.3.0"
48
+ "@mui/material-pigment-css": "^7.3.1"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "@types/react": {
package/version/index.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "7.3.0";
7
+ const version = exports.version = "7.3.1";
8
8
  const major = exports.major = Number("7");
9
9
  const minor = exports.minor = Number("3");
10
- const patch = exports.patch = Number("0");
10
+ const patch = exports.patch = Number("1");
11
11
  const prerelease = exports.prerelease = undefined;
12
12
  var _default = exports.default = version;