@mui/x-charts-pro 8.5.3 → 8.7.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/ChartContainerPro/index.d.ts +7 -1
  3. package/ChartContainerPro/index.js +0 -11
  4. package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  5. package/ChartZoomSlider/index.d.ts +2 -1
  6. package/ChartZoomSlider/index.js +10 -2
  7. package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +4 -0
  8. package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +7 -1
  9. package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +9 -1
  10. package/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +15 -0
  11. package/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js +31 -0
  12. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +27 -0
  13. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +77 -0
  14. package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +33 -0
  15. package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +75 -0
  16. package/ChartsToolbarPro/ChartsToolbarPro.d.ts +16 -3
  17. package/ChartsToolbarPro/ChartsToolbarPro.js +118 -8
  18. package/ChartsToolbarPro/index.d.ts +3 -1
  19. package/ChartsToolbarPro/index.js +22 -0
  20. package/ChartsToolbarPro/internals/ChartsMenu.d.ts +14 -0
  21. package/ChartsToolbarPro/internals/ChartsMenu.js +73 -0
  22. package/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +5 -0
  23. package/ChartsToolbarPro/internals/ChartsToolbarDivider.js +47 -0
  24. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +43 -33
  25. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
  26. package/{ChartContainerPro → context}/ChartProApi.d.ts +2 -3
  27. package/context/index.d.ts +2 -1
  28. package/context/index.js +4 -4
  29. package/context/useChartProApiContext.d.ts +9 -0
  30. package/context/{useChartApiContext.js → useChartProApiContext.js} +4 -4
  31. package/esm/ChartContainerPro/index.d.ts +7 -1
  32. package/esm/ChartContainerPro/index.js +4 -1
  33. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  34. package/esm/ChartZoomSlider/index.d.ts +2 -1
  35. package/esm/ChartZoomSlider/index.js +2 -1
  36. package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +4 -0
  37. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -1
  38. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +10 -1
  39. package/esm/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +15 -0
  40. package/esm/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js +21 -0
  41. package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +27 -0
  42. package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +70 -0
  43. package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +33 -0
  44. package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +68 -0
  45. package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +16 -3
  46. package/esm/ChartsToolbarPro/ChartsToolbarPro.js +120 -8
  47. package/esm/ChartsToolbarPro/index.d.ts +3 -1
  48. package/esm/ChartsToolbarPro/index.js +3 -1
  49. package/esm/ChartsToolbarPro/internals/ChartsMenu.d.ts +14 -0
  50. package/esm/ChartsToolbarPro/internals/ChartsMenu.js +67 -0
  51. package/esm/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +5 -0
  52. package/esm/ChartsToolbarPro/internals/ChartsToolbarDivider.js +40 -0
  53. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +43 -33
  54. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
  55. package/esm/{ChartContainerPro → context}/ChartProApi.d.ts +2 -3
  56. package/esm/context/index.d.ts +2 -1
  57. package/esm/context/index.js +2 -1
  58. package/esm/context/useChartProApiContext.d.ts +9 -0
  59. package/esm/context/{useChartApiContext.js → useChartProApiContext.js} +3 -3
  60. package/esm/hooks/index.d.ts +2 -1
  61. package/esm/hooks/index.js +2 -1
  62. package/esm/hooks/useChartProApiRef.d.ts +23 -0
  63. package/esm/hooks/useChartProApiRef.js +20 -0
  64. package/esm/index.d.ts +6 -3
  65. package/esm/index.js +3 -3
  66. package/esm/internals/material/components/BaseMenuItem.d.ts +3 -0
  67. package/esm/internals/material/components/BaseMenuItem.js +27 -0
  68. package/esm/internals/material/components/BasePopper.d.ts +3 -0
  69. package/esm/internals/material/components/BasePopper.js +122 -0
  70. package/esm/internals/material/icons.d.ts +2 -1
  71. package/esm/internals/material/icons.js +4 -1
  72. package/esm/internals/material/index.d.ts +1 -0
  73. package/esm/internals/material/index.js +12 -3
  74. package/esm/internals/plugins/allPlugins.d.ts +2 -2
  75. package/esm/internals/plugins/useChartProExport/print.js +1 -1
  76. package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +7 -6
  77. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +8 -0
  78. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +58 -0
  79. package/esm/internals/plugins/useChartProZoom/{useChartProZoom.utils.d.ts → gestureHooks/useZoom.utils.d.ts} +14 -10
  80. package/esm/internals/plugins/useChartProZoom/{useChartProZoom.utils.js → gestureHooks/useZoom.utils.js} +41 -31
  81. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +8 -0
  82. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +59 -0
  83. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +8 -0
  84. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +79 -0
  85. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +15 -227
  86. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +4 -4
  87. package/esm/internals/slots/chartBaseSlotProps.d.ts +50 -3
  88. package/esm/internals/slots/chartsBaseSlots.d.ts +5 -1
  89. package/esm/internals/slots/chartsIconSlots.d.ts +5 -0
  90. package/hooks/index.d.ts +2 -1
  91. package/hooks/index.js +11 -0
  92. package/hooks/useChartProApiRef.d.ts +23 -0
  93. package/hooks/useChartProApiRef.js +28 -0
  94. package/index.d.ts +6 -3
  95. package/index.js +58 -22
  96. package/internals/material/components/BaseMenuItem.d.ts +3 -0
  97. package/internals/material/components/BaseMenuItem.js +35 -0
  98. package/internals/material/components/BasePopper.d.ts +3 -0
  99. package/internals/material/components/BasePopper.js +130 -0
  100. package/internals/material/icons.d.ts +2 -1
  101. package/internals/material/icons.js +5 -2
  102. package/internals/material/index.d.ts +1 -0
  103. package/internals/material/index.js +11 -2
  104. package/internals/plugins/allPlugins.d.ts +2 -2
  105. package/internals/plugins/useChartProExport/print.js +1 -1
  106. package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +7 -6
  107. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +8 -0
  108. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +65 -0
  109. package/internals/plugins/useChartProZoom/{useChartProZoom.utils.d.ts → gestureHooks/useZoom.utils.d.ts} +14 -10
  110. package/internals/plugins/useChartProZoom/{useChartProZoom.utils.js → gestureHooks/useZoom.utils.js} +43 -34
  111. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +8 -0
  112. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +66 -0
  113. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +8 -0
  114. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +86 -0
  115. package/internals/plugins/useChartProZoom/useChartProZoom.js +14 -226
  116. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +4 -4
  117. package/internals/slots/chartBaseSlotProps.d.ts +50 -3
  118. package/internals/slots/chartsBaseSlots.d.ts +5 -1
  119. package/internals/slots/chartsIconSlots.d.ts +5 -0
  120. package/package.json +5 -4
  121. package/context/useChartApiContext.d.ts +0 -9
  122. package/esm/context/useChartApiContext.d.ts +0 -9
  123. /package/{ChartContainerPro → context}/ChartProApi.js +0 -0
  124. /package/esm/{ChartContainerPro → context}/ChartProApi.js +0 -0
@@ -11,11 +11,12 @@ exports.useChartProZoom = void 0;
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _internals = require("@mui/x-charts/internals");
14
- var _utils = require("@mui/material/utils");
15
- var _rafThrottle = require("@mui/x-internals/rafThrottle");
16
14
  var _debounce = _interopRequireDefault(require("@mui/utils/debounce"));
15
+ var _utils = require("@mui/material/utils");
17
16
  var _calculateZoom = require("./calculateZoom");
18
- var _useChartProZoom = require("./useChartProZoom.utils");
17
+ var _useZoomOnWheel = require("./gestureHooks/useZoomOnWheel");
18
+ var _useZoomOnPinch = require("./gestureHooks/useZoomOnPinch");
19
+ var _usePanOnDrag = require("./gestureHooks/usePanOnDrag");
19
20
  // It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
20
21
  function initializeZoomData(options, zoomData) {
21
22
  const zoomDataMap = new Map();
@@ -50,10 +51,8 @@ const useChartProZoom = ({
50
51
  zoomData: paramsZoomData,
51
52
  onZoomChange: onZoomChangeProp
52
53
  } = params;
53
- const drawingArea = (0, _internals.useSelector)(store, _internals.selectorChartDrawingArea);
54
- const optionsLookup = (0, _internals.useSelector)(store, _internals.selectorChartZoomOptionsLookup);
55
- const isZoomEnabled = Object.keys(optionsLookup).length > 0;
56
54
  const onZoomChange = (0, _utils.useEventCallback)(onZoomChangeProp ?? (() => {}));
55
+ const optionsLookup = (0, _internals.useSelector)(store, _internals.selectorChartZoomOptionsLookup);
57
56
 
58
57
  // Manage controlled state
59
58
  React.useEffect(() => {
@@ -149,228 +148,17 @@ const useChartProZoom = ({
149
148
  return () => {
150
149
  removeIsInteracting.clear();
151
150
  };
152
- }, [setZoomDataCallback, removeIsInteracting]);
151
+ }, [removeIsInteracting]);
153
152
 
154
153
  // Add events
155
- const panningEventCacheRef = React.useRef([]);
156
- const zoomEventCacheRef = React.useRef([]);
157
- const eventPrevDiff = React.useRef(0);
158
-
159
- // Add event for chart panning
160
- const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
161
- const isDraggingRef = React.useRef(false);
162
- const touchStartRef = React.useRef(null);
163
- React.useEffect(() => {
164
- const element = svgRef.current;
165
- if (element === null || !isPanEnabled) {
166
- return () => {};
167
- }
168
- const throttledHandlePan = (0, _rafThrottle.rafThrottle)((touchStart, point) => {
169
- const movementX = point.x - touchStart.x;
170
- const movementY = (point.y - touchStart.y) * -1;
171
- const newZoomData = touchStart.zoomData.map(zoom => {
172
- const options = optionsLookup[zoom.axisId];
173
- if (!options || !options.panning) {
174
- return zoom;
175
- }
176
- const min = zoom.start;
177
- const max = zoom.end;
178
- const span = max - min;
179
- const MIN_PERCENT = options.minStart;
180
- const MAX_PERCENT = options.maxEnd;
181
- const movement = options.axisDirection === 'x' ? movementX : movementY;
182
- const dimension = options.axisDirection === 'x' ? drawingArea.width : drawingArea.height;
183
- let newMinPercent = min - movement / dimension * span;
184
- let newMaxPercent = max - movement / dimension * span;
185
- if (newMinPercent < MIN_PERCENT) {
186
- newMinPercent = MIN_PERCENT;
187
- newMaxPercent = newMinPercent + span;
188
- }
189
- if (newMaxPercent > MAX_PERCENT) {
190
- newMaxPercent = MAX_PERCENT;
191
- newMinPercent = newMaxPercent - span;
192
- }
193
- if (newMinPercent < MIN_PERCENT || newMaxPercent > MAX_PERCENT || span < options.minSpan || span > options.maxSpan) {
194
- return zoom;
195
- }
196
- return (0, _extends2.default)({}, zoom, {
197
- start: newMinPercent,
198
- end: newMaxPercent
199
- });
200
- });
201
- setZoomDataCallback(newZoomData);
202
- });
203
- const handlePan = event => {
204
- if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
205
- return;
206
- }
207
- if (touchStartRef.current == null) {
208
- return;
209
- }
210
- const touchStart = touchStartRef.current;
211
- const point = (0, _internals.getSVGPoint)(element, event);
212
- throttledHandlePan(touchStart, point);
213
- };
214
- const handleDown = event => {
215
- panningEventCacheRef.current.push(event);
216
- const point = (0, _internals.getSVGPoint)(element, event);
217
- if (!instance.isPointInside(point.x, point.y)) {
218
- return;
219
- }
220
- // If there is only one pointer, prevent selecting text
221
- if (panningEventCacheRef.current.length === 1) {
222
- event.preventDefault();
223
- }
224
- isDraggingRef.current = true;
225
- touchStartRef.current = {
226
- x: point.x,
227
- y: point.y,
228
- zoomData: store.getSnapshot().zoom.zoomData
229
- };
230
- };
231
- const handleUp = event => {
232
- panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
233
- isDraggingRef.current = false;
234
- touchStartRef.current = null;
235
- };
236
- element.addEventListener('pointerdown', handleDown);
237
- document.addEventListener('pointermove', handlePan);
238
- document.addEventListener('pointerup', handleUp);
239
- document.addEventListener('pointercancel', handleUp);
240
- document.addEventListener('pointerleave', handleUp);
241
- return () => {
242
- element.removeEventListener('pointerdown', handleDown);
243
- document.removeEventListener('pointermove', handlePan);
244
- document.removeEventListener('pointerup', handleUp);
245
- document.removeEventListener('pointercancel', handleUp);
246
- document.removeEventListener('pointerleave', handleUp);
247
- throttledHandlePan.clear();
248
- };
249
- }, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
250
-
251
- // Add event for chart zoom in/out
252
- React.useEffect(() => {
253
- const element = svgRef.current;
254
- if (element === null || !isZoomEnabled) {
255
- return () => {};
256
- }
257
- const rafThrottledSetZoomData = (0, _rafThrottle.rafThrottle)(setZoomDataCallback);
258
- const wheelHandler = event => {
259
- if (element === null) {
260
- return;
261
- }
262
- const point = (0, _internals.getSVGPoint)(element, event);
263
- if (!instance.isPointInside(point.x, point.y)) {
264
- return;
265
- }
266
- event.preventDefault();
267
-
268
- /*
269
- * Need to throttle `setZoomDataCallback` instead of `wheelHandler` because we're calling `event.preventDefault()`.
270
- * If we throttle the event, then some events' default behavior won't be prevented and the page will scroll while
271
- * the user is trying to zoom in.
272
- */
273
- rafThrottledSetZoomData(prevZoomData => {
274
- return prevZoomData.map(zoom => {
275
- const option = optionsLookup[zoom.axisId];
276
- if (!option) {
277
- return zoom;
278
- }
279
- const centerRatio = option.axisDirection === 'x' ? (0, _useChartProZoom.getHorizontalCenterRatio)(point, drawingArea) : (0, _useChartProZoom.getVerticalCenterRatio)(point, drawingArea);
280
- const {
281
- scaleRatio,
282
- isZoomIn
283
- } = (0, _useChartProZoom.getWheelScaleRatio)(event, option.step);
284
- const [newMinRange, newMaxRange] = (0, _useChartProZoom.zoomAtPoint)(centerRatio, scaleRatio, zoom, option);
285
- if (!(0, _useChartProZoom.isSpanValid)(newMinRange, newMaxRange, isZoomIn, option)) {
286
- return zoom;
287
- }
288
- return {
289
- axisId: zoom.axisId,
290
- start: newMinRange,
291
- end: newMaxRange
292
- };
293
- });
294
- });
295
- };
296
- function pointerDownHandler(event) {
297
- zoomEventCacheRef.current.push(event);
298
- }
299
- const pointerMoveHandler = (0, _rafThrottle.rafThrottle)(function pointerMoveHandler(event) {
300
- if (element === null) {
301
- return;
302
- }
303
- const index = zoomEventCacheRef.current.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
304
- zoomEventCacheRef.current[index] = event;
305
-
306
- // Not a pinch gesture
307
- if (zoomEventCacheRef.current.length !== 2) {
308
- return;
309
- }
310
- const firstEvent = zoomEventCacheRef.current[0];
311
- const curDiff = (0, _useChartProZoom.getDiff)(zoomEventCacheRef.current);
312
- setZoomDataCallback(prevZoomData => {
313
- const newZoomData = prevZoomData.map(zoom => {
314
- const option = optionsLookup[zoom.axisId];
315
- if (!option) {
316
- return zoom;
317
- }
318
- const {
319
- scaleRatio,
320
- isZoomIn
321
- } = (0, _useChartProZoom.getPinchScaleRatio)(curDiff, eventPrevDiff.current, option.step);
322
-
323
- // If the scale ratio is 0, it means the pinch gesture is not valid.
324
- if (scaleRatio === 0) {
325
- return zoom;
326
- }
327
- const point = (0, _internals.getSVGPoint)(element, firstEvent);
328
- const centerRatio = option.axisDirection === 'x' ? (0, _useChartProZoom.getHorizontalCenterRatio)(point, drawingArea) : (0, _useChartProZoom.getVerticalCenterRatio)(point, drawingArea);
329
- const [newMinRange, newMaxRange] = (0, _useChartProZoom.zoomAtPoint)(centerRatio, scaleRatio, zoom, option);
330
- if (!(0, _useChartProZoom.isSpanValid)(newMinRange, newMaxRange, isZoomIn, option)) {
331
- return zoom;
332
- }
333
- return {
334
- axisId: zoom.axisId,
335
- start: newMinRange,
336
- end: newMaxRange
337
- };
338
- });
339
- eventPrevDiff.current = curDiff;
340
- return newZoomData;
341
- });
342
- });
343
- function pointerUpHandler(event) {
344
- zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
345
- if (zoomEventCacheRef.current.length < 2) {
346
- eventPrevDiff.current = 0;
347
- }
348
- }
349
- element.addEventListener('wheel', wheelHandler);
350
- element.addEventListener('pointerdown', pointerDownHandler);
351
- element.addEventListener('pointermove', pointerMoveHandler);
352
- element.addEventListener('pointerup', pointerUpHandler);
353
- element.addEventListener('pointercancel', pointerUpHandler);
354
- element.addEventListener('pointerout', pointerUpHandler);
355
- element.addEventListener('pointerleave', pointerUpHandler);
356
-
357
- // Prevent zooming the entire page on touch devices
358
- element.addEventListener('touchstart', _useChartProZoom.preventDefault);
359
- element.addEventListener('touchmove', _useChartProZoom.preventDefault);
360
- return () => {
361
- element.removeEventListener('wheel', wheelHandler);
362
- element.removeEventListener('pointerdown', pointerDownHandler);
363
- element.removeEventListener('pointermove', pointerMoveHandler);
364
- element.removeEventListener('pointerup', pointerUpHandler);
365
- element.removeEventListener('pointercancel', pointerUpHandler);
366
- element.removeEventListener('pointerout', pointerUpHandler);
367
- element.removeEventListener('pointerleave', pointerUpHandler);
368
- element.removeEventListener('touchstart', _useChartProZoom.preventDefault);
369
- element.removeEventListener('touchmove', _useChartProZoom.preventDefault);
370
- pointerMoveHandler.clear();
371
- rafThrottledSetZoomData.clear();
372
- };
373
- }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
154
+ const pluginData = {
155
+ store,
156
+ instance,
157
+ svgRef
158
+ };
159
+ (0, _usePanOnDrag.usePanOnDrag)(pluginData, setZoomDataCallback);
160
+ (0, _useZoomOnWheel.useZoomOnWheel)(pluginData, setZoomDataCallback);
161
+ (0, _useZoomOnPinch.useZoomOnPinch)(pluginData, setZoomDataCallback);
374
162
  const zoom = React.useCallback(step => {
375
163
  setZoomDataCallback(prev => prev.map(zoomData => {
376
164
  const zoomOptions = (0, _internals.selectorChartAxisZoomOptionsLookup)(store.getSnapshot(), zoomData.axisId);
@@ -1,12 +1,12 @@
1
1
  import { AxisId, ChartRootSelector } from '@mui/x-charts/internals';
2
2
  import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
3
  export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
- export declare const selectorChartZoomIsInteracting: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
4
+ export declare const selectorChartZoomIsInteracting: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
5
5
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
6
  } & {
7
7
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
8
8
  }, boolean, any[]>;
9
- export declare const selectorChartZoomIsEnabled: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
9
+ export declare const selectorChartZoomIsEnabled: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
10
10
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
11
11
  } & {
12
12
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
@@ -14,7 +14,7 @@ export declare const selectorChartZoomIsEnabled: import("reselect").Selector<imp
14
14
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
15
15
  }, boolean, []>;
16
16
  export declare const selectorChartAxisZoomData: import("reselect").Selector<any, import("@mui/x-charts/internals").ZoomData | undefined, [axisId: AxisId]>;
17
- export declare const selectorChartCanZoomOut: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
17
+ export declare const selectorChartCanZoomOut: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
18
18
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
19
19
  } & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
20
20
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
@@ -23,7 +23,7 @@ export declare const selectorChartCanZoomOut: import("reselect").Selector<import
23
23
  } & {
24
24
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
25
25
  }, boolean, any[]>;
26
- export declare const selectorChartCanZoomIn: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
26
+ export declare const selectorChartCanZoomIn: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
27
27
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
28
28
  } & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
29
29
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
@@ -4,7 +4,54 @@ export type ChartBaseTooltipProps = ChartBaseCommonProps & {
4
4
  children: React.ReactElement<any, any>;
5
5
  enterDelay?: number;
6
6
  title: React.ReactNode;
7
+ disableInteractive?: boolean;
7
8
  };
8
- export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
9
- ref?: React.Ref<HTMLButtonElement>;
10
- };
9
+ type BasePlacement = 'top' | 'bottom' | 'left' | 'right';
10
+ type VariationPlacement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
11
+ type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';
12
+ export type Placement = AutoPlacement | BasePlacement | VariationPlacement;
13
+ type ClickAwayMouseEventHandler = 'onClick' | 'onMouseDown' | 'onMouseUp' | 'onPointerDown' | 'onPointerUp';
14
+ type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd';
15
+ export type ChartBasePopperProps = ChartBaseCommonProps & {
16
+ ref?: React.Ref<HTMLDivElement>;
17
+ open: boolean;
18
+ children?: React.ReactNode;
19
+ clickAwayTouchEvent?: false | ClickAwayTouchEventHandler;
20
+ clickAwayMouseEvent?: false | ClickAwayMouseEventHandler;
21
+ flip?: boolean;
22
+ focusTrap?: boolean;
23
+ onExited?: (node: HTMLElement | null) => void;
24
+ onClickAway?: (event: MouseEvent | TouchEvent) => void;
25
+ onDidShow?: () => void;
26
+ onDidHide?: () => void;
27
+ id?: string;
28
+ target?: Element | null;
29
+ transition?: boolean;
30
+ /** @default 'bottom' */
31
+ placement?: Placement;
32
+ };
33
+ export type ChartBaseMenuListProps = ChartBaseCommonProps & {
34
+ ref?: React.Ref<HTMLUListElement>;
35
+ id?: string;
36
+ children?: React.ReactNode;
37
+ autoFocus?: boolean;
38
+ autoFocusItem?: boolean;
39
+ };
40
+ export type ChartBaseMenuItemProps = ChartBaseCommonProps & {
41
+ autoFocus?: boolean;
42
+ children?: React.ReactNode;
43
+ /** For items that aren't interactive themselves (but may contain an interactive widget) */
44
+ inert?: boolean;
45
+ dense?: boolean;
46
+ disabled?: boolean;
47
+ iconStart?: React.ReactNode;
48
+ iconEnd?: React.ReactNode;
49
+ selected?: boolean;
50
+ value?: number | string | readonly string[];
51
+ style?: React.CSSProperties;
52
+ };
53
+ export type ChartBaseDividerProps = ChartBaseCommonProps & {
54
+ ref?: React.Ref<HTMLHRElement>;
55
+ orientation?: 'horizontal' | 'vertical';
56
+ };
57
+ export {};
@@ -1,6 +1,10 @@
1
1
  import { ChartsBaseSlots } from '@mui/x-charts/models';
2
2
  import * as React from 'react';
3
- import { ChartBaseTooltipProps } from "./chartBaseSlotProps.js";
3
+ import { ChartBaseDividerProps, ChartBaseMenuItemProps, ChartBaseMenuListProps, ChartBasePopperProps, ChartBaseTooltipProps } from "./chartBaseSlotProps.js";
4
4
  export interface ChartsBaseSlotsPro extends ChartsBaseSlots {
5
+ baseDivider: React.ComponentType<ChartBaseDividerProps>;
6
+ baseMenuItem: React.ComponentType<ChartBaseMenuItemProps>;
7
+ baseMenuList: React.ComponentType<ChartBaseMenuListProps>;
8
+ basePopper: React.ComponentType<ChartBasePopperProps>;
5
9
  baseTooltip: React.ComponentType<ChartBaseTooltipProps>;
6
10
  }
@@ -11,4 +11,9 @@ export interface ChartsIconSlotsPro extends ChartsIconSlots {
11
11
  * @default ChartsZoomOutIcon
12
12
  */
13
13
  zoomOutIcon: React.ComponentType<ChartBaseIconProps>;
14
+ /**
15
+ * Icon displayed on the toolbar's export button.
16
+ * @default ChartsExportIcon
17
+ */
18
+ exportIcon: React.ComponentType<ChartBaseIconProps>;
14
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-pro",
3
- "version": "8.5.3",
3
+ "version": "8.7.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Charts components.",
6
6
  "main": "./index.js",
@@ -33,10 +33,11 @@
33
33
  "@mui/utils": "^7.1.1",
34
34
  "clsx": "^2.1.1",
35
35
  "prop-types": "^15.8.1",
36
- "@mui/x-internals": "8.5.3",
36
+ "@mui/x-charts": "8.7.0",
37
+ "@mui/x-internal-gestures": "0.2.0",
37
38
  "@mui/x-charts-vendor": "8.5.3",
38
- "@mui/x-charts": "8.5.3",
39
- "@mui/x-license": "8.5.3"
39
+ "@mui/x-license": "8.7.0",
40
+ "@mui/x-internals": "8.7.0"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@emotion/react": "^11.9.0",
@@ -1,9 +0,0 @@
1
- import { ChartProApi } from "../ChartContainerPro/index.js";
2
- /**
3
- * The `useChartApiContext` hook provides access to the chart API.
4
- * This is only available when the chart is rendered within a chart or a `ChartDataProvider` component.
5
- * If you want to access the chart API outside those components, you should use the `apiRef` prop instead.
6
- * @example
7
- * const apiRef = useChartApiContext<ChartProApi<'bar'>>();
8
- */
9
- export declare function useChartApiContext<Api extends ChartProApi>(): import("react").RefObject<Api>;
@@ -1,9 +0,0 @@
1
- import { ChartProApi } from "../ChartContainerPro/index.js";
2
- /**
3
- * The `useChartApiContext` hook provides access to the chart API.
4
- * This is only available when the chart is rendered within a chart or a `ChartDataProvider` component.
5
- * If you want to access the chart API outside those components, you should use the `apiRef` prop instead.
6
- * @example
7
- * const apiRef = useChartApiContext<ChartProApi<'bar'>>();
8
- */
9
- export declare function useChartApiContext<Api extends ChartProApi>(): import("react").RefObject<Api>;
File without changes