@mui/x-internals 8.4.0 → 8.5.0

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
@@ -5,6 +5,109 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.5.0
9
+
10
+ _May 29, 2025_
11
+
12
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 Add support for exporting `RadarChartPro`, `FunnelChart` and `Heatmap` as image and PDF.
15
+ - 📊 `RadarChart` is now stable.
16
+
17
+ Special thanks go out to the community members for their valuable contributions:
18
+ @xBlizZer, @sai6855, @alisasanib.
19
+ Following are all team members who have contributed to this release:
20
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @oliviertassinari.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@8.5.0`
27
+
28
+ - [DataGrid] Avoid ResizeObserver loop error (#17984) @cherniavskii
29
+ - [DataGrid] Fix column management `toggleColumn` event type (#18023) @KenanYusuf
30
+ - [DataGrid] Remove unnecessary `any` type (#17979) @sai6855
31
+
32
+ #### `@mui/x-data-grid-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
33
+
34
+ Same changes as in `@mui/x-data-grid@8.5.0`, plus:
35
+
36
+ - [DataGridPro] Allow multi sorting without modifier key (#17925) @cherniavskii
37
+ - [DataGridPro] Row reordering icon improvements (#17947) @KenanYusuf
38
+ - [DataGridPro] Fix pinned columns order in column management (#17950) @alisasanib
39
+
40
+ #### `@mui/x-data-grid-premium@8.5.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
41
+
42
+ Same changes as in `@mui/x-data-grid-pro@8.5.0`, plus:
43
+
44
+ - [DataGridPremium] Export `GridApiPremium` type (#18037) @arminmeh
45
+
46
+ ### Date and Time Pickers
47
+
48
+ #### `@mui/x-date-pickers@8.5.0`
49
+
50
+ Internal changes.
51
+
52
+ #### `@mui/x-date-pickers-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
53
+
54
+ Same changes as in `@mui/x-date-pickers@8.5.0`, plus:
55
+
56
+ - [DateRangePicker] Allow to override the format in the field (#17972) @flaviendelangle
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.5.0`
61
+
62
+ - [charts] Add `render` prop to charts toolbar components (#17649) @bernardobelchior
63
+ - [charts] Add configurable slots to toolbar (#17712) @bernardobelchior
64
+ - [charts] Export `useFunnelSeries` and `useRadarSeries` (#18034) @JCQuintas
65
+ - [charts] Expose `ChartApi` through context (#18004) @bernardobelchior
66
+ - [charts] Mark Radar chart as stable (#17946) @alexfauquette
67
+ - [charts] Only update store if interaction item is different (#17851) @bernardobelchior
68
+ - [charts] Reuse shared date utils (#18014) @JCQuintas
69
+ - [charts] Use Map for string cache instead of object (#17982) @bernardobelchior
70
+ - [charts] Fix Population pyramid demo (#17987) @oliviertassinari
71
+
72
+ #### `@mui/x-charts-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-charts@8.5.0`, plus:
75
+
76
+ - [charts-pro] Add range selection to zoom slider (#17949) @bernardobelchior
77
+ - [charts-pro] Allow configuring zoom slider tooltip (#18030) @bernardobelchior
78
+ - [charts-pro] Allow exporting a funnel chart (#17957) @bernardobelchior
79
+ - [charts-pro] Allow exporting a heatmap chart (#17916) @bernardobelchior
80
+ - [charts-pro] Allow exporting a radar chart (#17968) @bernardobelchior
81
+ - [charts-pro] Always show both zoom slider tooltips (#18027) @bernardobelchior
82
+ - [charts-pro] Show zoom slider tooltip when selecting range (#18028) @bernardobelchior
83
+ - [charts-pro] Split `ChartAxisZoomSlider` into smaller files (#18011) @bernardobelchior
84
+ - [charts-pro] Update zoom slider range selection cursor (#17977) @bernardobelchior
85
+ - [charts-pro] Add support for Heatmap legend (#17943) @alexfauquette
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@8.5.0`
90
+
91
+ Internal changes.
92
+
93
+ #### `@mui/x-tree-view-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
94
+
95
+ Same changes as in `@mui/x-tree-view@8.5.0`.
96
+
97
+ ### Docs
98
+
99
+ - [docs] Fix derived column pivoting demo crash (#17944) @arminmeh
100
+ - [docs] Fix light/dark mode blink on pickers overview (#18002) @alexfauquette
101
+ - [docs] Fix scatter shape demo causing horizontal overflow (#17974) @bernardobelchior
102
+
103
+ ### Core
104
+
105
+ - [code-infra] Add bundle size monitor (#17754) @Janpot
106
+ - [code-infra] Enable `babel-plugin-display-name` in vitest (#17903) @JCQuintas
107
+ - [infra] Remove last deprecated `ponyfillGlobal` usage (#18003) @LukasTy
108
+ - [infra] Use `babel-plugin-display-name` from npm (#18040) @LukasTy
109
+ - [x-telemetry] Remove deprecated `ponyfillGlobal` (#17986) @xBlizZer
110
+
8
111
  ## 8.4.0
9
112
 
10
113
  _May 21, 2025_
@@ -0,0 +1 @@
1
+ export * from "./useComponentRenderer.js";
@@ -0,0 +1 @@
1
+ export * from "./useComponentRenderer.js";
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
3
+ /**
4
+ * Resolves the rendering logic for a component.
5
+ * Handles three scenarios:
6
+ * 1. A render function that receives props and state
7
+ * 2. A React element
8
+ * 3. A default element
9
+ *
10
+ * @ignore - internal hook.
11
+ */
12
+ export declare function useComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
@@ -0,0 +1,41 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ /**
4
+ * Resolves the rendering logic for a component.
5
+ * Handles three scenarios:
6
+ * 1. A render function that receives props and state
7
+ * 2. A React element
8
+ * 3. A default element
9
+ *
10
+ * @ignore - internal hook.
11
+ */
12
+ export function useComponentRenderer(defaultElement, render, props, state = {}) {
13
+ if (typeof render === 'function') {
14
+ return render(props, state);
15
+ }
16
+ if (render) {
17
+ if (render.props.className) {
18
+ props.className = mergeClassNames(render.props.className, props.className);
19
+ }
20
+ if (render.props.style || props.style) {
21
+ props.style = _extends({}, props.style, render.props.style);
22
+ }
23
+ if (render.props.sx || props.sx) {
24
+ props.sx = mergeSx(props.sx, render.props.sx);
25
+ }
26
+ return /*#__PURE__*/React.cloneElement(render, props);
27
+ }
28
+ return /*#__PURE__*/React.createElement(defaultElement, props);
29
+ }
30
+ function mergeClassNames(className, otherClassName) {
31
+ if (!className || !otherClassName) {
32
+ return className || otherClassName;
33
+ }
34
+ return `${className} ${otherClassName}`;
35
+ }
36
+ function mergeSx(sx1, sx2) {
37
+ if (!sx1 || !sx2) {
38
+ return sx1 || sx2;
39
+ }
40
+ return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
41
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
2
+ import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
3
3
  const isDevEnvironment = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
4
4
  const noop = () => {};
5
5
  export function useResizeObserver(ref, fn, enabled) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-internals",
3
- "version": "8.4.0",
3
+ "version": "8.5.0",
4
4
  "author": "MUI Team",
5
5
  "description": "Utility functions for the MUI X packages (internal use only).",
6
6
  "license": "MIT",
@@ -35,6 +35,7 @@
35
35
  "@mui/utils": "^7.0.2"
36
36
  },
37
37
  "peerDependencies": {
38
+ "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
38
39
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
39
40
  },
40
41
  "engines": {
@@ -0,0 +1 @@
1
+ export * from "./useComponentRenderer.js";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useComponentRenderer = require("./useComponentRenderer");
7
+ Object.keys(_useComponentRenderer).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useComponentRenderer[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useComponentRenderer[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
3
+ /**
4
+ * Resolves the rendering logic for a component.
5
+ * Handles three scenarios:
6
+ * 1. A render function that receives props and state
7
+ * 2. A React element
8
+ * 3. A default element
9
+ *
10
+ * @ignore - internal hook.
11
+ */
12
+ export declare function useComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useComponentRenderer = useComponentRenderer;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ /**
12
+ * Resolves the rendering logic for a component.
13
+ * Handles three scenarios:
14
+ * 1. A render function that receives props and state
15
+ * 2. A React element
16
+ * 3. A default element
17
+ *
18
+ * @ignore - internal hook.
19
+ */
20
+ function useComponentRenderer(defaultElement, render, props, state = {}) {
21
+ if (typeof render === 'function') {
22
+ return render(props, state);
23
+ }
24
+ if (render) {
25
+ if (render.props.className) {
26
+ props.className = mergeClassNames(render.props.className, props.className);
27
+ }
28
+ if (render.props.style || props.style) {
29
+ props.style = (0, _extends2.default)({}, props.style, render.props.style);
30
+ }
31
+ if (render.props.sx || props.sx) {
32
+ props.sx = mergeSx(props.sx, render.props.sx);
33
+ }
34
+ return /*#__PURE__*/React.cloneElement(render, props);
35
+ }
36
+ return /*#__PURE__*/React.createElement(defaultElement, props);
37
+ }
38
+ function mergeClassNames(className, otherClassName) {
39
+ if (!className || !otherClassName) {
40
+ return className || otherClassName;
41
+ }
42
+ return `${className} ${otherClassName}`;
43
+ }
44
+ function mergeSx(sx1, sx2) {
45
+ if (!sx1 || !sx2) {
46
+ return sx1 || sx2;
47
+ }
48
+ return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
49
+ }
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.useResizeObserver = useResizeObserver;
8
9
  var React = _interopRequireWildcard(require("react"));
9
- var _utils = require("@mui/utils");
10
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
10
11
  const isDevEnvironment = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
11
12
  const noop = () => {};
12
13
  function useResizeObserver(ref, fn, enabled) {
13
14
  const fnRef = React.useRef(null);
14
15
  fnRef.current = fn;
15
- (0, _utils.unstable_useEnhancedEffect)(() => {
16
+ (0, _useEnhancedEffect.default)(() => {
16
17
  if (enabled === false || typeof ResizeObserver === 'undefined') {
17
18
  return noop;
18
19
  }