@mui/x-charts 7.7.1 → 7.9.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/BarChart/BarChart.d.ts +3 -3
- package/BarChart/BarElement.d.ts +225 -228
- package/BarChart/BarLabel/BarLabel.d.ts +225 -228
- package/BarChart/BarLabel/getBarLabel.d.ts +1 -1
- package/BarChart/useBarChartProps.d.ts +20 -88
- package/CHANGELOG.md +166 -1
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/ChartContainer.js +3 -1
- package/ChartContainer/useChartContainerHooks.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/ChartsReferenceLine/common.d.ts +0 -1
- package/ChartsSurface.js +5 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +3 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.js +4 -39
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +7 -6
- package/ChartsTooltip/ChartsItemTooltipContent.js +4 -27
- package/ChartsTooltip/ChartsTooltip.d.ts +10 -9
- package/ChartsTooltip/ChartsTooltip.js +8 -2
- package/ChartsTooltip/ChartsTooltipTable.d.ts +15 -1
- package/ChartsTooltip/ChartsTooltipTable.js +19 -0
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +11 -0
- package/ChartsTooltip/utils.d.ts +7 -6
- package/ChartsTooltip/utils.js +24 -30
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +6 -6
- package/ChartsXAxis/ChartsXAxis.js +7 -5
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/LineChart/AnimatedArea.d.ts +225 -228
- package/LineChart/AnimatedLine.d.ts +225 -228
- package/LineChart/LineChart.d.ts +3 -3
- package/LineChart/MarkPlot.js +6 -2
- package/LineChart/useLineChartProps.d.ts +26 -103
- package/LineChart/useLineChartProps.js +3 -3
- package/PieChart/PieArc.d.ts +0 -1
- package/PieChart/PieArcLabel.d.ts +0 -1
- package/PieChart/PieChart.d.ts +3 -3
- package/PieChart/dataTransform/transition.d.ts +0 -1
- package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -2
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/ScatterChart/Scatter.js +7 -5
- package/ScatterChart/ScatterChart.d.ts +3 -3
- package/ScatterChart/ScatterChart.js +3 -1
- package/ScatterChart/useScatterChartProps.d.ts +20 -75
- package/SparkLineChart/SparkLineChart.d.ts +3 -3
- package/context/CartesianProvider/computeValue.d.ts +2 -2
- package/context/CartesianProvider/computeValue.js +36 -5
- package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
- package/context/ZAxisContextProvider.js +7 -2
- package/esm/BarChart/useBarChartProps.js +0 -1
- package/esm/ChartContainer/ChartContainer.js +3 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/esm/ChartsSurface.js +5 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +3 -38
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +3 -26
- package/esm/ChartsTooltip/ChartsTooltip.js +8 -2
- package/esm/ChartsTooltip/ChartsTooltipTable.js +20 -0
- package/esm/ChartsTooltip/index.js +2 -1
- package/esm/ChartsTooltip/utils.js +23 -30
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +6 -6
- package/esm/ChartsXAxis/ChartsXAxis.js +7 -5
- package/esm/ChartsYAxis/ChartsYAxis.js +3 -1
- package/esm/LineChart/MarkPlot.js +6 -2
- package/esm/LineChart/useLineChartProps.js +3 -3
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/esm/ScatterChart/Scatter.js +7 -5
- package/esm/ScatterChart/ScatterChart.js +3 -1
- package/esm/context/CartesianProvider/computeValue.js +37 -6
- package/esm/context/ZAxisContextProvider.js +7 -2
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useAxis.js +17 -0
- package/esm/hooks/useAxisEvents.js +25 -17
- package/esm/hooks/useInteractionItemProps.js +11 -4
- package/esm/hooks/useScale.js +7 -14
- package/esm/hooks/useTicks.js +2 -1
- package/esm/internals/getSVGPoint.js +11 -0
- package/esm/internals/index.js +4 -0
- package/esm/internals/utils.js +0 -12
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useAxis.d.ts +2 -0
- package/hooks/useAxis.js +24 -0
- package/hooks/useAxisEvents.js +25 -17
- package/hooks/useChartDimensions.d.ts +1 -1
- package/hooks/useColor.d.ts +1 -1
- package/hooks/useInteractionItemProps.d.ts +4 -2
- package/hooks/useInteractionItemProps.js +11 -4
- package/hooks/useScale.js +6 -14
- package/hooks/useTicks.js +2 -1
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +68 -68
- package/internals/getSVGPoint.d.ts +6 -0
- package/internals/getSVGPoint.js +17 -0
- package/internals/getWordsByLines.d.ts +0 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +40 -0
- package/internals/useAnimatedPath.d.ts +0 -1
- package/internals/utils.d.ts +0 -6
- package/internals/utils.js +0 -13
- package/models/axis.d.ts +1 -2
- package/models/colorMapping.d.ts +1 -1
- package/models/z-axis.d.ts +8 -0
- package/modern/BarChart/useBarChartProps.js +0 -1
- package/modern/ChartContainer/ChartContainer.js +3 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/modern/ChartsSurface.js +5 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -38
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -26
- package/modern/ChartsTooltip/ChartsTooltip.js +8 -2
- package/modern/ChartsTooltip/ChartsTooltipTable.js +20 -0
- package/modern/ChartsTooltip/index.js +2 -1
- package/modern/ChartsTooltip/utils.js +23 -30
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +6 -6
- package/modern/ChartsXAxis/ChartsXAxis.js +7 -5
- package/modern/ChartsYAxis/ChartsYAxis.js +3 -1
- package/modern/LineChart/MarkPlot.js +6 -2
- package/modern/LineChart/useLineChartProps.js +3 -3
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/modern/ScatterChart/Scatter.js +7 -5
- package/modern/ScatterChart/ScatterChart.js +3 -1
- package/modern/context/CartesianProvider/computeValue.js +37 -6
- package/modern/context/ZAxisContextProvider.js +7 -2
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useAxis.js +17 -0
- package/modern/hooks/useAxisEvents.js +25 -17
- package/modern/hooks/useInteractionItemProps.js +11 -4
- package/modern/hooks/useScale.js +7 -14
- package/modern/hooks/useTicks.js +2 -1
- package/modern/index.js +1 -1
- package/modern/internals/getSVGPoint.js +11 -0
- package/modern/internals/index.js +4 -0
- package/modern/internals/utils.js +0 -12
- package/package.json +3 -3
- package/themeAugmentation/props.d.ts +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SeriesId } from '../../models/seriesType/common';
|
|
2
2
|
import { BarLabelFunction } from './BarLabel.types';
|
|
3
3
|
export declare const getBarLabel: (options: {
|
|
4
|
-
barLabel:
|
|
4
|
+
barLabel: "value" | BarLabelFunction;
|
|
5
5
|
value: number | null;
|
|
6
6
|
dataIndex: number;
|
|
7
7
|
seriesId: SeriesId;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { BarChartProps } from './BarChart';
|
|
2
|
+
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
3
|
+
import { BarPlotProps } from './BarPlot';
|
|
4
|
+
import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
|
|
5
|
+
import { ChartsGridProps } from '../ChartsGrid';
|
|
6
|
+
import { ChartsClipPathProps } from '../ChartsClipPath';
|
|
7
|
+
import { ChartsOverlayProps } from '../ChartsOverlay';
|
|
8
|
+
import { ChartsAxisProps } from '../ChartsAxis';
|
|
9
|
+
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
|
+
import { ChartsLegendProps } from '../ChartsLegend';
|
|
11
|
+
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
3
12
|
/**
|
|
4
13
|
* A helper function that extracts BarChartProps from the input props
|
|
5
14
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -8,95 +17,18 @@ import type { BarChartProps } from './BarChart';
|
|
|
8
17
|
* @returns An object with props for the children components of BarChart
|
|
9
18
|
*/
|
|
10
19
|
export declare const useBarChartProps: (props: BarChartProps) => {
|
|
11
|
-
chartContainerProps:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
17
|
-
id?: import("../internals").SeriesId | undefined;
|
|
18
|
-
dataKey?: string | undefined;
|
|
19
|
-
stackOffset?: import("..").StackOffsetType | undefined;
|
|
20
|
-
valueFormatter?: import("../internals").SeriesValueFormatter<number | null> | undefined;
|
|
21
|
-
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
22
|
-
xAxisKey?: string | undefined;
|
|
23
|
-
yAxisKey?: string | undefined;
|
|
24
|
-
stack?: string | undefined;
|
|
25
|
-
stackOrder?: import("..").StackOrderType | undefined;
|
|
26
|
-
type: "bar";
|
|
27
|
-
}[];
|
|
28
|
-
width: number | undefined;
|
|
29
|
-
height: number | undefined;
|
|
30
|
-
margin: Partial<import("..").CardinalDirections<number>> | undefined;
|
|
31
|
-
colors: import("..").ChartsColorPalette | undefined;
|
|
32
|
-
dataset: import("../internals").DatasetType | undefined;
|
|
33
|
-
xAxis: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsXAxisProps>, "id">[] | undefined;
|
|
34
|
-
yAxis: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsYAxisProps>, "id">[] | undefined;
|
|
35
|
-
sx: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
36
|
-
highlightedItem: import("..").HighlightItemData | null | undefined;
|
|
37
|
-
onHighlightChange: ((highlightedItem: import("..").HighlightItemData | null) => void) | undefined;
|
|
38
|
-
disableAxisListener: boolean;
|
|
39
|
-
};
|
|
40
|
-
barPlotProps: {
|
|
41
|
-
onItemClick: ((event: import("react").MouseEvent<SVGElement, MouseEvent>, barItemIdentifier: import("..").BarItemIdentifier) => void) | undefined;
|
|
42
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
43
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
44
|
-
skipAnimation: boolean | undefined;
|
|
45
|
-
borderRadius: number | undefined;
|
|
46
|
-
barLabel: "value" | ((item: import("./BarLabel").BarItem, context: import("./BarLabel").BarLabelContext) => string | null | undefined) | undefined;
|
|
47
|
-
};
|
|
48
|
-
axisClickHandlerProps: {
|
|
49
|
-
onAxisClick: ((event: MouseEvent, data: {
|
|
50
|
-
dataIndex: number;
|
|
51
|
-
axisValue?: string | number | Date | undefined;
|
|
52
|
-
seriesValues: Record<string, number | null | undefined>;
|
|
53
|
-
} | null) => void) | undefined;
|
|
54
|
-
};
|
|
55
|
-
gridProps: {
|
|
56
|
-
vertical: boolean | undefined;
|
|
57
|
-
horizontal: boolean | undefined;
|
|
58
|
-
};
|
|
59
|
-
clipPathProps: {
|
|
60
|
-
id: string;
|
|
61
|
-
};
|
|
20
|
+
chartContainerProps: ResponsiveChartContainerProps;
|
|
21
|
+
barPlotProps: BarPlotProps;
|
|
22
|
+
axisClickHandlerProps: ChartsOnAxisClickHandlerProps;
|
|
23
|
+
gridProps: ChartsGridProps;
|
|
24
|
+
clipPathProps: ChartsClipPathProps;
|
|
62
25
|
clipPathGroupProps: {
|
|
63
26
|
clipPath: string;
|
|
64
27
|
};
|
|
65
|
-
overlayProps:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
chartsAxisProps: {
|
|
71
|
-
topAxis: string | import("..").ChartsXAxisProps | null | undefined;
|
|
72
|
-
leftAxis: string | import("..").ChartsYAxisProps | null | undefined;
|
|
73
|
-
rightAxis: string | import("..").ChartsYAxisProps | null | undefined;
|
|
74
|
-
bottomAxis: string | import("..").ChartsXAxisProps | null | undefined;
|
|
75
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
76
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
77
|
-
};
|
|
78
|
-
axisHighlightProps: {
|
|
79
|
-
x?: ("none" | "line" | "band") | undefined;
|
|
80
|
-
y: "none" | "line" | "band";
|
|
81
|
-
} | {
|
|
82
|
-
x: "none" | "line" | "band";
|
|
83
|
-
y?: ("none" | "line" | "band") | undefined;
|
|
84
|
-
};
|
|
85
|
-
legendProps: {
|
|
86
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
87
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
88
|
-
position?: import("..").AnchorPosition | undefined;
|
|
89
|
-
classes?: Partial<import("..").ChartsLegendClasses> | undefined;
|
|
90
|
-
hidden?: boolean | undefined;
|
|
91
|
-
direction?: import("..").Direction | undefined;
|
|
92
|
-
};
|
|
93
|
-
tooltipProps: {
|
|
94
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
95
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
96
|
-
trigger?: import("../ChartsTooltip/utils").TriggerOptions | undefined;
|
|
97
|
-
itemContent?: import("react").ElementType<import("..").ChartsItemContentProps<any>, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
98
|
-
axisContent?: import("react").ElementType<import("..").ChartsAxisContentProps, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
99
|
-
classes?: Partial<import("..").ChartsTooltipClasses> | undefined;
|
|
100
|
-
};
|
|
28
|
+
overlayProps: ChartsOverlayProps;
|
|
29
|
+
chartsAxisProps: ChartsAxisProps;
|
|
30
|
+
axisHighlightProps: ChartsAxisHighlightProps;
|
|
31
|
+
legendProps: ChartsLegendProps;
|
|
32
|
+
tooltipProps: ChartsTooltipProps<"bar">;
|
|
101
33
|
children: import("react").ReactNode;
|
|
102
34
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,171 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.9.0
|
|
7
|
+
|
|
8
|
+
_Jul 5, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🔄 Add loading overlay variants, including a skeleton loader option to the Data Grid component. See [Loading overlay docs](https://mui.com/x/react-data-grid/overlays/#loading-overlay) for more details.
|
|
13
|
+
- 🌳 Add `selectItem` and `getItemDOMElement` methods to the TreeView component public API
|
|
14
|
+
- ⛏️ Make the `usePickersTranslations` hook public in the pickers component
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
|
|
17
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@7.9.0`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Add skeleton loading overlay support (#13293) @KenanYusuf
|
|
24
|
+
- [DataGrid] Fix pagination when `pagination={undefined}` (#13349) @sai6855
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@7.9.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@7.9.0`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@7.9.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@7.9.0`.
|
|
33
|
+
|
|
34
|
+
### Date and Time Pickers
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers@7.9.0`
|
|
37
|
+
|
|
38
|
+
- [pickers] Make the `usePickersTranslations` hook public (#13657) @flaviendelangle
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@7.9.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@7.9.0`.
|
|
43
|
+
|
|
44
|
+
### Charts
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-charts@7.9.0`
|
|
47
|
+
|
|
48
|
+
- [charts] Add Heatmap (unreleased) (#13209) @alexfauquette
|
|
49
|
+
- [charts] Add initial `Zoom&Pan` to the Pro charts (unreleased) (#13405) @JCQuintas
|
|
50
|
+
- [charts] Fix Axis Highlight on horizontal bar charts regression (#13717) @JCQuintas
|
|
51
|
+
- [charts] Improve charts interaction for mobile users (#13692) @JCQuintas
|
|
52
|
+
- [charts] Add documentation on how to disable the tooltip on charts (#13724) @JCQuintas
|
|
53
|
+
|
|
54
|
+
### Tree View
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-tree-view@7.9.0`
|
|
57
|
+
|
|
58
|
+
- [TreeView] Add `selectItem` and `getItemDOMElement` methods to the public API (#13485) @flaviendelangle
|
|
59
|
+
|
|
60
|
+
### Docs
|
|
61
|
+
|
|
62
|
+
- [docs] Fix custom "no results overlay" demo in dark mode (#13715) @KenanYusuf
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [core] Add `react_next` workflow in CircleCI (#13360) @cherniavskii
|
|
67
|
+
- [core] Create a new package to share utils across X packages (#13528) @flaviendelangle
|
|
68
|
+
- [core] Fix dependency setup (#13684) @LukasTy
|
|
69
|
+
- [core] Remove `jscodeshift-add-imports` package (#13720) @LukasTy
|
|
70
|
+
- [code-infra] Cleanup monorepo and `@mui/docs` usage (#13713) @LukasTy
|
|
71
|
+
|
|
72
|
+
## 7.8.0
|
|
73
|
+
|
|
74
|
+
_Jun 28, 2024_
|
|
75
|
+
|
|
76
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
77
|
+
|
|
78
|
+
- 🛰 Introduce server-side data source for improved server integration in the Data Grid.
|
|
79
|
+
|
|
80
|
+
Supports server-side pagination, sorting and filtering on plain and tree data, and automatic caching.
|
|
81
|
+
|
|
82
|
+
To enable, provide a `getRows` function to the `unstable_dataSource` prop on the Data Grid component.
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
const dataSource = {
|
|
86
|
+
getRows: async (params: GridServerGetRowsParams) => {
|
|
87
|
+
const data = await fetch(
|
|
88
|
+
`https://api.example.com/data?${new URLSearchParams({
|
|
89
|
+
page: params.page,
|
|
90
|
+
pageSize: params.pageSize,
|
|
91
|
+
sortModel: JSON.stringify(params.sortModel),
|
|
92
|
+
filterModel: JSON.stringify(params.filterModel),
|
|
93
|
+
}).toString()}`,
|
|
94
|
+
);
|
|
95
|
+
return {
|
|
96
|
+
rows: data.rows,
|
|
97
|
+
totalRows: data.totalRows,
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
<DataGridPro
|
|
102
|
+
unstable_dataSource={dataSource}
|
|
103
|
+
{...otherProps}
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
See [server-side data documentation](https://mui.com/x/react-data-grid/server-side-data/) for more details.
|
|
108
|
+
|
|
109
|
+
- 📈 Support Date data on the BarChart component
|
|
110
|
+
- ↕️ Support custom column sort icons on the Data Grid
|
|
111
|
+
- 🖱️ Support modifying the expansion trigger on the Tree View components
|
|
112
|
+
|
|
113
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
114
|
+
|
|
115
|
+
### Data Grid
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-data-grid@7.8.0`
|
|
118
|
+
|
|
119
|
+
- [DataGrid] Add `columnHeaderSortIcon` slot (#13563) @arminmeh
|
|
120
|
+
- [DataGrid] Fix dimensions lag issue after autosize (#13587) @MBilalShafi
|
|
121
|
+
- [DataGrid] Fix print export failure when `hideFooter` option is set (#13034) @tarunrajput
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-data-grid-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
124
|
+
|
|
125
|
+
Same changes as in `@mui/x-data-grid@7.8.0`, plus:
|
|
126
|
+
|
|
127
|
+
- [DataGridPro] Fix multi-sorting indicator being cut off (#13625) @KenanYusuf
|
|
128
|
+
- [DataGridPro] Server-side tree data support (#12317) @MBilalShafi
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-data-grid-premium@7.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-data-grid-pro@7.8.0`.
|
|
133
|
+
|
|
134
|
+
### Date and Time Pickers
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-date-pickers@7.8.0`
|
|
137
|
+
|
|
138
|
+
- [fields] Fix section clearing behavior on Android (#13652) @LukasTy
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-date-pickers-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
141
|
+
|
|
142
|
+
Same changes as in `@mui/x-date-pickers@7.8.0`.
|
|
143
|
+
|
|
144
|
+
### Charts
|
|
145
|
+
|
|
146
|
+
#### `@mui/x-charts@7.8.0`
|
|
147
|
+
|
|
148
|
+
- [charts] Fix line chart props not passing correct event handlers (#13609) @JCQuintas
|
|
149
|
+
- [charts] Support BarChart with `Date` data (#13471) @alexfauquette
|
|
150
|
+
- [charts] Support RTL for y-axis (#13614) @alexfauquette
|
|
151
|
+
- [charts] Use default values instead of non-null assertion to prevent error being thrown (#13637) @JCQuintas
|
|
152
|
+
|
|
153
|
+
### Tree View
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-tree-view@7.8.0`
|
|
156
|
+
|
|
157
|
+
- [TreeView] Add `expansionTrigger` prop (#13533) @noraleonte
|
|
158
|
+
- [TreeView] Support experimental features from plugin's dependencies (#13632) @flaviendelangle
|
|
159
|
+
|
|
160
|
+
### Docs
|
|
161
|
+
|
|
162
|
+
- [docs] Add callout for `Luxon` `throwOnInvalid` support (#13621) @LukasTy
|
|
163
|
+
- [docs] Add "Overlays" section to the Data Grid documentation (#13624) @KenanYusuf
|
|
164
|
+
|
|
165
|
+
### Core
|
|
166
|
+
|
|
167
|
+
- [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
|
|
168
|
+
- [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
|
|
169
|
+
- [license] Allow usage of charts and tree view pro package for old premium licenses (#13619) @flaviendelangle
|
|
170
|
+
|
|
6
171
|
## 7.7.1
|
|
7
172
|
|
|
8
173
|
_Jun 21, 2024_
|
|
@@ -44,7 +209,7 @@ Same changes as in `@mui/x-data-grid-pro@7.7.1`.
|
|
|
44
209
|
- [pickers] Always use the same timezone in the field, the view and the layout components (#13481) @flaviendelangle
|
|
45
210
|
- [pickers] Fix `AdapterDateFnsV3` generated method types (#13464) @alexey-kozlenkov
|
|
46
211
|
- [pickers] Fix controlled `view` behavior (#13552) @LukasTy
|
|
47
|
-
- [TimePicker] Improves RTL verification for the time pickers default views
|
|
212
|
+
- [TimePicker] Improves RTL verification for the time pickers default views (#13447) @arthurbalduini
|
|
48
213
|
|
|
49
214
|
#### `@mui/x-date-pickers-pro@7.7.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
215
|
|
|
@@ -20,6 +20,6 @@ declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurface
|
|
|
20
20
|
* An array of plugins defining how to preprocess data.
|
|
21
21
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
22
22
|
*/
|
|
23
|
-
plugins?: ChartsPluginType<
|
|
23
|
+
plugins?: ChartsPluginType<ChartSeriesType>[];
|
|
24
24
|
} & React.RefAttributes<unknown>>;
|
|
25
25
|
export { ChartContainer };
|
|
@@ -292,6 +292,8 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
292
292
|
})]),
|
|
293
293
|
data: _propTypes.default.array,
|
|
294
294
|
dataKey: _propTypes.default.string,
|
|
295
|
-
id: _propTypes.default.string
|
|
295
|
+
id: _propTypes.default.string,
|
|
296
|
+
max: _propTypes.default.number,
|
|
297
|
+
min: _propTypes.default.number
|
|
296
298
|
}))
|
|
297
299
|
} : void 0;
|
|
@@ -3,7 +3,7 @@ import { ChartsPluginType } from '../models';
|
|
|
3
3
|
import { ChartSeriesType } from '../models/seriesType/config';
|
|
4
4
|
export declare const useChartContainerHooks: (ref: React.ForwardedRef<unknown> | null, plugins?: ChartsPluginType<ChartSeriesType>[]) => {
|
|
5
5
|
svgRef: React.RefObject<SVGSVGElement>;
|
|
6
|
-
handleRef: ((instance: unknown) => void) | null;
|
|
6
|
+
handleRef: ((instance: unknown) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
|
|
7
7
|
xExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
8
8
|
yExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
9
9
|
seriesFormatters: import("../internals").SeriesFormatterConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
@@ -77,15 +77,30 @@ function ChartsAxisHighlight(props) {
|
|
|
77
77
|
} = React.useContext(_InteractionProvider.InteractionContext);
|
|
78
78
|
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
79
79
|
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
80
|
+
const axisX = axis.x;
|
|
81
|
+
const axisY = axis.y;
|
|
82
|
+
const isBandScaleX = xAxisHighlight === 'band' && axisX !== null && (0, _isBandScale.isBandScale)(xScale);
|
|
83
|
+
const isBandScaleY = yAxisHighlight === 'band' && axisY !== null && (0, _isBandScale.isBandScale)(yScale);
|
|
84
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
85
|
+
const isXError = isBandScaleX && xScale(axisX.value) === undefined;
|
|
86
|
+
const isYError = isBandScaleY && yScale(axisY.value) === undefined;
|
|
87
|
+
if (isXError || isYError) {
|
|
88
|
+
console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
80
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
81
|
-
children: [
|
|
82
|
-
|
|
92
|
+
children: [isBandScaleX && xScale(axisX.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath
|
|
93
|
+
// @ts-expect-error, xScale value is checked in the statement above
|
|
94
|
+
, {
|
|
95
|
+
d: `M ${xScale(axisX.value) - (xScale.step() - xScale.bandwidth()) / 2} ${yScale.range()[0]} l ${xScale.step()} 0 l 0 ${yScale.range()[1] - yScale.range()[0]} l ${-xScale.step()} 0 Z`,
|
|
83
96
|
className: classes.root,
|
|
84
97
|
ownerState: {
|
|
85
98
|
axisHighlight: 'band'
|
|
86
99
|
}
|
|
87
|
-
}),
|
|
88
|
-
d: `M ${xScale.range()[0]} ${
|
|
100
|
+
}), isBandScaleY && yScale(axisY.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
101
|
+
d: `M ${xScale.range()[0]} ${
|
|
102
|
+
// @ts-expect-error, yScale value is checked in the statement above
|
|
103
|
+
yScale(axisY.value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${xScale.range()[1] - xScale.range()[0]} 0 l 0 ${-yScale.step()} Z`,
|
|
89
104
|
className: classes.root,
|
|
90
105
|
ownerState: {
|
|
91
106
|
axisHighlight: 'band'
|
package/ChartsSurface.js
CHANGED
|
@@ -18,7 +18,11 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
const ChartChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
19
19
|
name: 'MuiChartsSurface',
|
|
20
20
|
slot: 'Root'
|
|
21
|
-
})(() => ({
|
|
21
|
+
})(() => ({
|
|
22
|
+
// This prevents default touch actions when using the svg on mobile devices.
|
|
23
|
+
// For example, prevent page scroll & zoom.
|
|
24
|
+
touchAction: 'none'
|
|
25
|
+
}));
|
|
22
26
|
const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
|
|
23
27
|
const {
|
|
24
28
|
children,
|
|
@@ -34,6 +34,9 @@ export type ChartsAxisContentProps = {
|
|
|
34
34
|
classes: ChartsTooltipClasses;
|
|
35
35
|
sx?: SxProps<Theme>;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* @ignore - internal component.
|
|
39
|
+
*/
|
|
37
40
|
declare function ChartsAxisTooltipContent(props: {
|
|
38
41
|
axisData: AxisInteractionData;
|
|
39
42
|
content?: React.ElementType<ChartsAxisContentProps>;
|
|
@@ -41,7 +44,4 @@ declare function ChartsAxisTooltipContent(props: {
|
|
|
41
44
|
sx?: SxProps<Theme>;
|
|
42
45
|
classes: ChartsAxisContentProps['classes'];
|
|
43
46
|
}): React.JSX.Element;
|
|
44
|
-
declare namespace ChartsAxisTooltipContent {
|
|
45
|
-
var propTypes: any;
|
|
46
|
-
}
|
|
47
47
|
export { ChartsAxisTooltipContent };
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ChartsAxisTooltipContent = ChartsAxisTooltipContent;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
10
|
var _utils = require("@mui/base/utils");
|
|
12
11
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
13
12
|
var _DefaultChartsAxisTooltipContent = require("./DefaultChartsAxisTooltipContent");
|
|
@@ -18,6 +17,9 @@ var _useSeries = require("../hooks/useSeries");
|
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
/**
|
|
21
|
+
* @ignore - internal component.
|
|
22
|
+
*/
|
|
21
23
|
function ChartsAxisTooltipContent(props) {
|
|
22
24
|
const {
|
|
23
25
|
content,
|
|
@@ -79,41 +81,4 @@ function ChartsAxisTooltipContent(props) {
|
|
|
79
81
|
ownerState: {}
|
|
80
82
|
});
|
|
81
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, (0, _extends2.default)({}, chartTooltipContentProps));
|
|
82
|
-
}
|
|
83
|
-
process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
84
|
-
// ----------------------------- Warning --------------------------------
|
|
85
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
86
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
87
|
-
// ----------------------------------------------------------------------
|
|
88
|
-
axisData: _propTypes.default.shape({
|
|
89
|
-
x: _propTypes.default.shape({
|
|
90
|
-
index: _propTypes.default.number,
|
|
91
|
-
value: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
|
|
92
|
-
}),
|
|
93
|
-
y: _propTypes.default.shape({
|
|
94
|
-
index: _propTypes.default.number,
|
|
95
|
-
value: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
|
|
96
|
-
})
|
|
97
|
-
}).isRequired,
|
|
98
|
-
classes: _propTypes.default.object.isRequired,
|
|
99
|
-
content: _propTypes.default.elementType,
|
|
100
|
-
contentProps: _propTypes.default.shape({
|
|
101
|
-
axis: _propTypes.default.object,
|
|
102
|
-
axisData: _propTypes.default.shape({
|
|
103
|
-
x: _propTypes.default.shape({
|
|
104
|
-
index: _propTypes.default.number,
|
|
105
|
-
value: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
|
|
106
|
-
}),
|
|
107
|
-
y: _propTypes.default.shape({
|
|
108
|
-
index: _propTypes.default.number,
|
|
109
|
-
value: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
|
|
110
|
-
})
|
|
111
|
-
}),
|
|
112
|
-
axisValue: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]),
|
|
113
|
-
classes: _propTypes.default.object,
|
|
114
|
-
dataIndex: _propTypes.default.number,
|
|
115
|
-
series: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
116
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
117
|
-
}),
|
|
118
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
119
|
-
} : void 0;
|
|
84
|
+
}
|
|
@@ -3,7 +3,7 @@ import { SxProps, Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { ItemInteractionData } from '../context/InteractionProvider';
|
|
4
4
|
import { ChartSeriesDefaultized, ChartSeriesType } from '../models/seriesType/config';
|
|
5
5
|
import { ChartsTooltipClasses } from './chartsTooltipClasses';
|
|
6
|
-
export
|
|
6
|
+
export interface ChartsItemContentProps<T extends ChartSeriesType> {
|
|
7
7
|
/**
|
|
8
8
|
* The data used to identify the triggered item.
|
|
9
9
|
*/
|
|
@@ -23,15 +23,16 @@ export type ChartsItemContentProps<T extends ChartSeriesType = ChartSeriesType>
|
|
|
23
23
|
*/
|
|
24
24
|
getColor: (dataIndex: number) => string;
|
|
25
25
|
sx?: SxProps<Theme>;
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
27
|
+
export interface ChartsItemTooltipContentProps<T extends ChartSeriesType> {
|
|
28
28
|
itemData: ItemInteractionData<T>;
|
|
29
29
|
content?: React.ElementType<ChartsItemContentProps<T>>;
|
|
30
30
|
contentProps?: Partial<ChartsItemContentProps<T>>;
|
|
31
31
|
sx?: SxProps<Theme>;
|
|
32
32
|
classes: ChartsItemContentProps<T>['classes'];
|
|
33
|
-
}): React.JSX.Element;
|
|
34
|
-
declare namespace ChartsItemTooltipContent {
|
|
35
|
-
var propTypes: any;
|
|
36
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @ignore - internal component.
|
|
36
|
+
*/
|
|
37
|
+
declare function ChartsItemTooltipContent<T extends ChartSeriesType>(props: ChartsItemTooltipContentProps<T>): React.JSX.Element;
|
|
37
38
|
export { ChartsItemTooltipContent };
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ChartsItemTooltipContent = ChartsItemTooltipContent;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
10
|
var _utils = require("@mui/base/utils");
|
|
12
11
|
var _DefaultChartsItemTooltipContent = require("./DefaultChartsItemTooltipContent");
|
|
13
12
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
@@ -17,6 +16,9 @@ var _useSeries = require("../hooks/useSeries");
|
|
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
/**
|
|
20
|
+
* @ignore - internal component.
|
|
21
|
+
*/
|
|
20
22
|
function ChartsItemTooltipContent(props) {
|
|
21
23
|
const {
|
|
22
24
|
content,
|
|
@@ -55,29 +57,4 @@ function ChartsItemTooltipContent(props) {
|
|
|
55
57
|
ownerState: {}
|
|
56
58
|
});
|
|
57
59
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, (0, _extends2.default)({}, chartTooltipContentProps));
|
|
58
|
-
}
|
|
59
|
-
process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
|
|
60
|
-
// ----------------------------- Warning --------------------------------
|
|
61
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
62
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
63
|
-
// ----------------------------------------------------------------------
|
|
64
|
-
classes: _propTypes.default.object.isRequired,
|
|
65
|
-
content: _propTypes.default.elementType,
|
|
66
|
-
contentProps: _propTypes.default.shape({
|
|
67
|
-
classes: _propTypes.default.object,
|
|
68
|
-
getColor: _propTypes.default.func,
|
|
69
|
-
itemData: _propTypes.default.shape({
|
|
70
|
-
dataIndex: _propTypes.default.number,
|
|
71
|
-
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
72
|
-
type: _propTypes.default.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
|
|
73
|
-
}),
|
|
74
|
-
series: _propTypes.default.object,
|
|
75
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
76
|
-
}),
|
|
77
|
-
itemData: _propTypes.default.shape({
|
|
78
|
-
dataIndex: _propTypes.default.number,
|
|
79
|
-
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
80
|
-
type: _propTypes.default.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
|
|
81
|
-
}).isRequired,
|
|
82
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
83
|
-
} : void 0;
|
|
60
|
+
}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { PopperProps as BasePopperProps } from '@mui/base/Popper';
|
|
4
4
|
import { TriggerOptions } from './utils';
|
|
5
|
+
import { ChartSeriesType } from '../models/seriesType/config';
|
|
5
6
|
import { ChartsItemContentProps } from './ChartsItemTooltipContent';
|
|
6
7
|
import { ChartsAxisContentProps } from './ChartsAxisTooltipContent';
|
|
7
8
|
import { ChartsTooltipClasses } from './chartsTooltipClasses';
|
|
@@ -11,7 +12,7 @@ export type PopperProps = BasePopperProps & {
|
|
|
11
12
|
*/
|
|
12
13
|
sx?: SxProps<Theme>;
|
|
13
14
|
};
|
|
14
|
-
export interface ChartsTooltipSlots {
|
|
15
|
+
export interface ChartsTooltipSlots<T extends ChartSeriesType> {
|
|
15
16
|
/**
|
|
16
17
|
* Custom component for the tooltip popper.
|
|
17
18
|
* @default ChartsTooltipRoot
|
|
@@ -26,14 +27,14 @@ export interface ChartsTooltipSlots {
|
|
|
26
27
|
* Custom component for displaying tooltip content when triggered by item event.
|
|
27
28
|
* @default DefaultChartsItemTooltipContent
|
|
28
29
|
*/
|
|
29
|
-
itemContent?: React.ElementType<ChartsItemContentProps
|
|
30
|
+
itemContent?: React.ElementType<ChartsItemContentProps<T>>;
|
|
30
31
|
}
|
|
31
|
-
export interface ChartsTooltipSlotProps {
|
|
32
|
+
export interface ChartsTooltipSlotProps<T extends ChartSeriesType> {
|
|
32
33
|
popper?: Partial<PopperProps>;
|
|
33
34
|
axisContent?: Partial<ChartsAxisContentProps>;
|
|
34
|
-
itemContent?: Partial<ChartsItemContentProps
|
|
35
|
+
itemContent?: Partial<ChartsItemContentProps<T>>;
|
|
35
36
|
}
|
|
36
|
-
export
|
|
37
|
+
export interface ChartsTooltipProps<T extends ChartSeriesType> {
|
|
37
38
|
/**
|
|
38
39
|
* Select the kind of tooltip to display
|
|
39
40
|
* - 'item': Shows data about the item below the mouse.
|
|
@@ -60,13 +61,13 @@ export type ChartsTooltipProps = {
|
|
|
60
61
|
* Overridable component slots.
|
|
61
62
|
* @default {}
|
|
62
63
|
*/
|
|
63
|
-
slots?: ChartsTooltipSlots
|
|
64
|
+
slots?: ChartsTooltipSlots<T>;
|
|
64
65
|
/**
|
|
65
66
|
* The props used for each component slot.
|
|
66
67
|
* @default {}
|
|
67
68
|
*/
|
|
68
|
-
slotProps?: ChartsTooltipSlotProps
|
|
69
|
-
}
|
|
69
|
+
slotProps?: ChartsTooltipSlotProps<T>;
|
|
70
|
+
}
|
|
70
71
|
/**
|
|
71
72
|
* Demos:
|
|
72
73
|
*
|
|
@@ -76,7 +77,7 @@ export type ChartsTooltipProps = {
|
|
|
76
77
|
*
|
|
77
78
|
* - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
|
|
78
79
|
*/
|
|
79
|
-
declare function ChartsTooltip(props: ChartsTooltipProps): React.JSX.Element | null;
|
|
80
|
+
declare function ChartsTooltip<T extends ChartSeriesType>(props: ChartsTooltipProps<T>): React.JSX.Element | null;
|
|
80
81
|
declare namespace ChartsTooltip {
|
|
81
82
|
var propTypes: any;
|
|
82
83
|
}
|
|
@@ -86,8 +86,14 @@ function ChartsTooltip(props) {
|
|
|
86
86
|
externalSlotProps: slotProps?.popper,
|
|
87
87
|
additionalProps: {
|
|
88
88
|
open: popperOpen,
|
|
89
|
-
placement: 'right-start',
|
|
90
|
-
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition)
|
|
89
|
+
placement: mousePosition?.pointerType === 'mouse' ? 'right-start' : 'top',
|
|
90
|
+
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition),
|
|
91
|
+
modifiers: [{
|
|
92
|
+
name: 'offset',
|
|
93
|
+
options: {
|
|
94
|
+
offset: [0, mousePosition?.pointerType === 'touch' ? 40 - mousePosition.height : 0]
|
|
95
|
+
}
|
|
96
|
+
}]
|
|
91
97
|
},
|
|
92
98
|
ownerState: {}
|
|
93
99
|
});
|