@mui/x-charts 8.0.0-alpha.6 → 8.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.js +1 -0
- package/BarChart/BarChart.js +17 -7
- package/BarChart/BarLabel/BarLabel.d.ts +1 -479
- package/BarChart/BarLabel/barLabelClasses.d.ts +1 -1
- package/BarChart/legend.js +1 -0
- package/BarChart/useBarChartProps.d.ts +4 -2
- package/BarChart/useBarChartProps.js +16 -3
- package/CHANGELOG.md +127 -1
- package/ChartsLabel/ChartsLabel.d.ts +2 -3
- package/ChartsLabel/ChartsLabel.js +3 -18
- package/ChartsLabel/ChartsLabelGradient.d.ts +9 -8
- package/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/ChartsLabel/ChartsLabelMark.d.ts +2 -3
- package/ChartsLabel/ChartsLabelMark.js +5 -2
- package/ChartsLabel/index.d.ts +7 -0
- package/ChartsLabel/index.js +6 -0
- package/ChartsLabel/labelClasses.d.ts +0 -1
- package/ChartsLabel/labelGradientClasses.d.ts +5 -4
- package/ChartsLabel/labelGradientClasses.js +3 -2
- package/ChartsLabel/labelMarkClasses.d.ts +3 -2
- package/ChartsLabel/labelMarkClasses.js +3 -2
- package/ChartsLabel/package.json +6 -0
- package/ChartsLegend/ChartsLegend.d.ts +18 -22
- package/ChartsLegend/ChartsLegend.js +100 -109
- package/ChartsLegend/ContinuousColorLegend.d.ts +29 -38
- package/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/ChartsLegend/PiecewiseColorLegend.d.ts +27 -19
- package/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/ChartsLegend/chartsLegend.types.d.ts +17 -60
- package/ChartsLegend/chartsLegendClasses.d.ts +7 -8
- package/ChartsLegend/chartsLegendClasses.js +16 -2
- package/ChartsLegend/colorLegend.types.d.ts +13 -0
- package/ChartsLegend/colorLegend.types.js +1 -0
- package/ChartsLegend/continuousColorLegendClasses.d.ts +26 -0
- package/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/ChartsLegend/direction.d.ts +1 -0
- package/ChartsLegend/direction.js +1 -0
- package/ChartsLegend/index.d.ts +13 -3
- package/ChartsLegend/index.js +9 -3
- package/ChartsLegend/legend.types.d.ts +10 -54
- package/ChartsLegend/legendContext.types.d.ts +55 -0
- package/ChartsLegend/legendContext.types.js +1 -0
- package/ChartsLegend/onClickContextBuilder.d.ts +2 -0
- package/ChartsLegend/onClickContextBuilder.js +7 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.d.ts +2 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/ChartsLegend/piecewiseColorLegend.types.d.ts +26 -0
- package/ChartsLegend/piecewiseColorLegend.types.js +1 -0
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +28 -0
- package/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/ChartsLegend/useAxis.d.ts +1 -1
- package/ChartsLegend/useAxis.js +0 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.js +0 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/LineChart/AnimatedArea.js +1 -0
- package/LineChart/AnimatedLine.js +1 -0
- package/LineChart/AppearingMask.js +1 -0
- package/LineChart/CircleMarkElement.js +1 -0
- package/LineChart/LineChart.js +20 -10
- package/LineChart/MarkElement.js +3 -1
- package/LineChart/legend.js +1 -0
- package/LineChart/useLineChartProps.d.ts +4 -2
- package/LineChart/useLineChartProps.js +15 -2
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PieArcLabel.js +13 -9
- package/PieChart/PieArcLabelPlot.js +1 -0
- package/PieChart/PieArcPlot.js +1 -0
- package/PieChart/PieChart.js +42 -41
- package/PieChart/legend.js +1 -0
- package/ScatterChart/ScatterChart.js +21 -11
- package/ScatterChart/legend.js +1 -0
- package/ScatterChart/useScatterChartProps.d.ts +4 -2
- package/ScatterChart/useScatterChartProps.js +15 -2
- package/SparkLineChart/SparkLineChart.js +1 -4
- package/constants/index.d.ts +1 -0
- package/constants/index.js +2 -1
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -9
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +18 -18
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -9
- package/context/ChartProvider/ChartProvider.types.d.ts +1 -1
- package/context/InteractionSelectors.d.ts +11 -11
- package/context/PluginProvider/SeriesFormatter.types.d.ts +1 -1
- package/context/PluginProvider/mergePlugins.d.ts +8 -8
- package/context/SizeProvider/Size.types.d.ts +1 -1
- package/context/SizeProvider/useChartContainerDimensions.d.ts +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useLegend.d.ts +13 -0
- package/{modern/ChartsLegend/utils.js → hooks/useLegend.js} +20 -1
- package/hooks/useSvgRef.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/internals/calculateMargins.d.ts +7 -0
- package/internals/calculateMargins.js +25 -0
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +60 -16
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +13 -0
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.d.ts +17 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/internals/components/ChartsWrapper/index.d.ts +1 -0
- package/internals/components/ChartsWrapper/index.js +1 -0
- package/internals/consumeSlots.d.ts +48 -0
- package/internals/consumeSlots.js +101 -0
- package/internals/consumeThemeProps.d.ts +3 -7
- package/internals/consumeThemeProps.js +18 -27
- package/internals/defaultizeColor.d.ts +6 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +11 -11
- package/internals/plugins/models/plugin.d.ts +1 -1
- package/internals/store/useCharts.d.ts +2 -2
- package/internals/store/useCharts.types.d.ts +1 -1
- package/models/seriesType/common.d.ts +9 -0
- package/models/seriesType/pie.d.ts +9 -0
- package/modern/BarChart/AnimatedBarElement.js +1 -0
- package/modern/BarChart/BarChart.js +17 -7
- package/modern/BarChart/legend.js +1 -0
- package/modern/BarChart/useBarChartProps.js +16 -3
- package/modern/ChartsLabel/ChartsLabel.js +3 -18
- package/modern/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/modern/ChartsLabel/ChartsLabelMark.js +5 -2
- package/modern/ChartsLabel/index.js +6 -0
- package/modern/ChartsLabel/labelGradientClasses.js +3 -2
- package/modern/ChartsLabel/labelMarkClasses.js +3 -2
- package/modern/ChartsLegend/ChartsLegend.js +100 -109
- package/modern/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/modern/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/modern/ChartsLegend/chartsLegendClasses.js +16 -2
- package/modern/ChartsLegend/colorLegend.types.js +1 -0
- package/modern/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/direction.js +1 -0
- package/modern/ChartsLegend/index.js +9 -3
- package/modern/ChartsLegend/legendContext.types.js +1 -0
- package/modern/ChartsLegend/onClickContextBuilder.js +7 -0
- package/modern/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/modern/ChartsLegend/piecewiseColorLegend.types.js +1 -0
- package/modern/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/useAxis.js +0 -1
- package/modern/ChartsSurface/ChartsSurface.js +0 -1
- package/modern/LineChart/AnimatedArea.js +1 -0
- package/modern/LineChart/AnimatedLine.js +1 -0
- package/modern/LineChart/AppearingMask.js +1 -0
- package/modern/LineChart/CircleMarkElement.js +1 -0
- package/modern/LineChart/LineChart.js +20 -10
- package/modern/LineChart/MarkElement.js +3 -1
- package/modern/LineChart/legend.js +1 -0
- package/modern/LineChart/useLineChartProps.js +15 -2
- package/modern/PieChart/PieArc.js +3 -1
- package/modern/PieChart/PieArcLabel.js +13 -9
- package/modern/PieChart/PieArcLabelPlot.js +1 -0
- package/modern/PieChart/PieArcPlot.js +1 -0
- package/modern/PieChart/PieChart.js +42 -41
- package/modern/PieChart/legend.js +1 -0
- package/modern/ScatterChart/ScatterChart.js +21 -11
- package/modern/ScatterChart/legend.js +1 -0
- package/modern/ScatterChart/useScatterChartProps.js +15 -2
- package/modern/SparkLineChart/SparkLineChart.js +1 -4
- package/modern/constants/index.js +2 -1
- package/modern/hooks/index.js +2 -1
- package/{ChartsLegend/utils.js → modern/hooks/useLegend.js} +20 -1
- package/modern/index.js +2 -1
- package/modern/internals/calculateMargins.js +25 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +60 -16
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/modern/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/modern/internals/components/ChartsWrapper/index.js +1 -0
- package/modern/internals/consumeSlots.js +101 -0
- package/modern/internals/consumeThemeProps.js +18 -27
- package/modern/internals/index.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +1 -0
- package/node/BarChart/BarChart.js +17 -7
- package/node/BarChart/legend.js +1 -0
- package/node/BarChart/useBarChartProps.js +15 -3
- package/node/ChartsLabel/ChartsLabel.js +3 -18
- package/node/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/node/ChartsLabel/ChartsLabelMark.js +5 -2
- package/node/ChartsLabel/index.js +26 -0
- package/node/ChartsLabel/labelGradientClasses.js +3 -2
- package/node/ChartsLabel/labelMarkClasses.js +3 -2
- package/node/ChartsLegend/ChartsLegend.js +99 -108
- package/node/ChartsLegend/ContinuousColorLegend.js +199 -322
- package/node/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/node/ChartsLegend/chartsLegendClasses.js +17 -3
- package/node/ChartsLegend/colorLegend.types.js +5 -0
- package/node/ChartsLegend/continuousColorLegendClasses.js +31 -0
- package/node/ChartsLegend/direction.js +5 -0
- package/node/ChartsLegend/index.js +80 -16
- package/node/ChartsLegend/legendContext.types.js +5 -0
- package/node/ChartsLegend/onClickContextBuilder.js +14 -0
- package/node/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +15 -0
- package/node/ChartsLegend/piecewiseColorLegend.types.js +5 -0
- package/node/ChartsLegend/piecewiseColorLegendClasses.js +31 -0
- package/node/ChartsSurface/ChartsSurface.js +0 -1
- package/node/LineChart/AnimatedArea.js +1 -0
- package/node/LineChart/AnimatedLine.js +1 -0
- package/node/LineChart/AppearingMask.js +1 -0
- package/node/LineChart/CircleMarkElement.js +1 -0
- package/node/LineChart/LineChart.js +20 -10
- package/node/LineChart/MarkElement.js +3 -1
- package/node/LineChart/legend.js +1 -0
- package/node/LineChart/useLineChartProps.js +14 -2
- package/node/PieChart/PieArc.js +3 -1
- package/node/PieChart/PieArcLabel.js +13 -9
- package/node/PieChart/PieArcLabelPlot.js +1 -0
- package/node/PieChart/PieArcPlot.js +1 -0
- package/node/PieChart/PieChart.js +42 -41
- package/node/PieChart/legend.js +1 -0
- package/node/ScatterChart/ScatterChart.js +21 -11
- package/node/ScatterChart/legend.js +1 -0
- package/node/ScatterChart/useScatterChartProps.js +14 -2
- package/node/SparkLineChart/SparkLineChart.js +1 -4
- package/node/constants/index.js +3 -2
- package/node/hooks/index.js +13 -1
- package/node/{ChartsLegend/utils.js → hooks/useLegend.js} +19 -1
- package/node/index.js +12 -1
- package/node/internals/calculateMargins.js +33 -0
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +61 -16
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +69 -0
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/node/internals/components/ChartsWrapper/ChartsWrapper.js +72 -0
- package/node/internals/components/ChartsWrapper/index.js +16 -0
- package/node/internals/consumeSlots.js +109 -0
- package/node/internals/consumeThemeProps.js +18 -27
- package/node/internals/index.js +12 -0
- package/package.json +4 -4
- package/ChartsLegend/ChartsLegendItem.d.ts +0 -26
- package/ChartsLegend/ChartsLegendItem.js +0 -65
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -25
- package/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/ChartsLegend/LegendPerItem.d.ts +0 -65
- package/ChartsLegend/LegendPerItem.js +0 -129
- package/ChartsLegend/legendItemsPlacement.d.ts +0 -3
- package/ChartsLegend/legendItemsPlacement.js +0 -72
- package/ChartsLegend/utils.d.ts +0 -2
- package/modern/ChartsLegend/ChartsLegendItem.js +0 -65
- package/modern/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/modern/ChartsLegend/LegendPerItem.js +0 -129
- package/modern/ChartsLegend/legendItemsPlacement.js +0 -72
- package/node/ChartsLegend/ChartsLegendItem.js +0 -72
- package/node/ChartsLegend/DefaultChartsLegend.js +0 -118
- package/node/ChartsLegend/LegendPerItem.js +0 -137
- package/node/ChartsLegend/legendItemsPlacement.js +0 -79
|
@@ -5,6 +5,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAxisClick", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
|
|
6
6
|
import useId from '@mui/utils/useId';
|
|
7
7
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
|
|
8
|
+
import { calculateMargins } from "../internals/calculateMargins.js";
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* A helper function that extracts BarChartProps from the input props
|
|
10
12
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -41,7 +43,8 @@ export const useBarChartProps = props => {
|
|
|
41
43
|
onHighlightChange,
|
|
42
44
|
borderRadius,
|
|
43
45
|
barLabel,
|
|
44
|
-
className
|
|
46
|
+
className,
|
|
47
|
+
hideLegend
|
|
45
48
|
} = props,
|
|
46
49
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
50
|
const id = useId();
|
|
@@ -61,7 +64,12 @@ export const useBarChartProps = props => {
|
|
|
61
64
|
})),
|
|
62
65
|
width,
|
|
63
66
|
height,
|
|
64
|
-
margin
|
|
67
|
+
margin: calculateMargins({
|
|
68
|
+
margin,
|
|
69
|
+
hideLegend,
|
|
70
|
+
slotProps,
|
|
71
|
+
series
|
|
72
|
+
}),
|
|
65
73
|
colors,
|
|
66
74
|
dataset,
|
|
67
75
|
xAxis: xAxis ?? (hasHorizontalSeries ? undefined : [_extends({
|
|
@@ -70,7 +78,6 @@ export const useBarChartProps = props => {
|
|
|
70
78
|
yAxis: yAxis ?? (hasHorizontalSeries ? [_extends({
|
|
71
79
|
id: DEFAULT_Y_AXIS_KEY
|
|
72
80
|
}, defaultAxisConfig)] : undefined),
|
|
73
|
-
sx,
|
|
74
81
|
highlightedItem,
|
|
75
82
|
onHighlightChange,
|
|
76
83
|
disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
@@ -119,7 +126,13 @@ export const useBarChartProps = props => {
|
|
|
119
126
|
slots,
|
|
120
127
|
slotProps
|
|
121
128
|
};
|
|
129
|
+
const chartsWrapperProps = {
|
|
130
|
+
sx,
|
|
131
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
132
|
+
legendDirection: props.slotProps?.legend?.direction
|
|
133
|
+
};
|
|
122
134
|
return {
|
|
135
|
+
chartsWrapperProps,
|
|
123
136
|
chartContainerProps,
|
|
124
137
|
barPlotProps,
|
|
125
138
|
axisClickHandlerProps,
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,132 @@
|
|
|
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.0.0-alpha.7
|
|
9
|
+
|
|
10
|
+
_Jan 9, 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
|
+
- 📊 Charts legend is now an HTML element which can be styled more easily
|
|
15
|
+
- 💫 Support [aggregation with server-side data](/x/react-data-grid/server-side-data/aggregation/)
|
|
16
|
+
- 🏎️ Improve Data Grid aggregation performance
|
|
17
|
+
- 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
|
|
18
|
+
- 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
|
|
19
|
+
- 🐞 Bugfixes
|
|
20
|
+
|
|
21
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
22
|
+
@derek-0000, @josteinjhauge, @k-rajat19, @nusr, @tomashauser.
|
|
23
|
+
Following are all team members who have contributed to this release:
|
|
24
|
+
@cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @oliviertassinari.
|
|
25
|
+
|
|
26
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
27
|
+
|
|
28
|
+
### Data Grid
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid@8.0.0-alpha.7`
|
|
31
|
+
|
|
32
|
+
- [DataGrid] Improve React 19 support (#15769) @LukasTy
|
|
33
|
+
- [DataGrid] Add `name` attribute to the checkbox selection column (#15178) @derek-0000
|
|
34
|
+
- [DataGrid] Fix number filter field formatting values while typing (#16062) @arminmeh
|
|
35
|
+
- [DataGrid] Fix select all checkbox state reset with server side data (#16034) @MBilalShafi
|
|
36
|
+
- [DataGrid] Refactor: create base button props (#15930) @romgrk
|
|
37
|
+
- [DataGrid] Refactor: create tooltip props (#16086) @romgrk
|
|
38
|
+
- [DataGrid] Fix TS error (#16046) @cherniavskii
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.7`.
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.7` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.7`, plus:
|
|
47
|
+
|
|
48
|
+
- [DataGridPremium] Improve aggregation performance for multiple columns (#16097) @cherniavskii
|
|
49
|
+
- [DataGridPremium] Make Aggregation keyboard accessible in the column menu (#15934) @k-rajat19
|
|
50
|
+
- [DataGridPremium] Server-side aggregation with data source (#15741) @MBilalShafi
|
|
51
|
+
|
|
52
|
+
### Date and Time Pickers
|
|
53
|
+
|
|
54
|
+
#### Breaking changes
|
|
55
|
+
|
|
56
|
+
- The `date-fns` and `date-fns-jalali` date library adapters have been renamed to better align with the current stable major versions — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#✅-rename-date-fns-adapter-imports)
|
|
57
|
+
- Update default `closeOnSelect` and Action Bar `actions` values - [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#update-default-closeonselect-and-action-bar-actions-values)
|
|
58
|
+
- The component passed to the `layout` slot no longer receives the `value`, `onChange` and `onSelectShortcut` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
59
|
+
- The component passed to the `toolbar` slot no longer receives the `value`, `onChange` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
60
|
+
- The component passed to the `shortcuts` slot no longer receives the `onChange`, `isValid` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-shortcuts).
|
|
61
|
+
- The `PickerShortcutChangeImportance` type has been renamed `PickerChangeImportance` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables-and-types).
|
|
62
|
+
- The component passed to the `layout` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
63
|
+
- The component passed to the `toolbar` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
64
|
+
- The component passed to the `tabs` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-tabs).
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.7`
|
|
67
|
+
|
|
68
|
+
- [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (#15985) @LukasTy
|
|
69
|
+
- [pickers] Always use `setValue` internally to update the picker value (#16056) @flaviendelangle
|
|
70
|
+
- [pickers] Create a new context to pass the range position props to the layout components and to the views (#15846) @flaviendelangle
|
|
71
|
+
- [pickers] Introduce a new concept of `manager` (#15339) @flaviendelangle
|
|
72
|
+
- [pickers] Improve React 19 support (#15769) @LukasTy
|
|
73
|
+
- [pickers] Memoize `<PickersActionBar />` (#16071) @LukasTy
|
|
74
|
+
- [pickers] Remove `NonEmptyDateRange` type (#16035) @flaviendelangle
|
|
75
|
+
- [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (#16082) @LukasTy
|
|
76
|
+
- [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (#16044) @flaviendelangle
|
|
77
|
+
- [pickers] Support `date-fns-jalali` v4 (#16011) @LukasTy
|
|
78
|
+
- [pickers] Update `closeOnSelect` and `actionBar.actions` default values (#15944) @LukasTy
|
|
79
|
+
- [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (#15948) @flaviendelangle
|
|
80
|
+
- [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16033) @nusr
|
|
81
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#16089) @josteinjhauge
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
84
|
+
|
|
85
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.7`.
|
|
86
|
+
|
|
87
|
+
### Charts
|
|
88
|
+
|
|
89
|
+
#### Breaking changes
|
|
90
|
+
|
|
91
|
+
- Removed `DefaultChartsLegend` component, since it is now easier to create custom legends — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
|
|
92
|
+
- The default legend is now an HTML element and can be styled more easily.
|
|
93
|
+
- The `width` and `height` properties of the charts now only apply to the `svg` element, and not their wrappers, this might cause some layout shifts.
|
|
94
|
+
- `slotProps.legend.direction` now accepts `'horizontal' | 'vertical'` instead of `'row' | 'column'` — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#legend-direction-value-change-✅).
|
|
95
|
+
- The `getSeriesToDisplay` function was removed in favor of the `useLegend` hook. — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#the-getseriestodisplay-function-was-removed).
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-charts@8.0.0-alpha.7`
|
|
98
|
+
|
|
99
|
+
- [charts] New HTML legend & styles (#15733) @JCQuintas
|
|
100
|
+
- [charts] Improve React 19 support (#15769) @LukasTy
|
|
101
|
+
- [charts] Fix 301 redirection in the API documentation @oliviertassinari
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
104
|
+
|
|
105
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.7`.
|
|
106
|
+
|
|
107
|
+
### Tree View
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-tree-view@8.0.0-alpha.7`
|
|
110
|
+
|
|
111
|
+
- [TreeView] Improve React 19 support (#15769) @LukasTy
|
|
112
|
+
|
|
113
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
114
|
+
|
|
115
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.7`.
|
|
116
|
+
|
|
117
|
+
### Docs
|
|
118
|
+
|
|
119
|
+
- [docs] Fix `EditingWithDatePickers` demo (#15967) @k-rajat19
|
|
120
|
+
- [docs] Fix inconsistent multi input range field separators (#16043) @flaviendelangle
|
|
121
|
+
- [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16084) @tomashauser
|
|
122
|
+
- [docs] Refactor Data Grid with Date Pickers example (#15992) @LukasTy
|
|
123
|
+
- [docs] Unify the wording of the pickers slots breaking changes (#16036) @flaviendelangle
|
|
124
|
+
|
|
125
|
+
### Core
|
|
126
|
+
|
|
127
|
+
- [core] Clarify the release strategy (#16014) @MBilalShafi
|
|
128
|
+
- [core] Small fixes on docs @oliviertassinari
|
|
129
|
+
- [core] Sync with other repos @oliviertassinari
|
|
130
|
+
- [core] Update the `release:version` docs (#16038) @cherniavskii
|
|
131
|
+
- [code-infra] Add `testSkipIf` and `describeSkipIf` (#16049) @JCQuintas
|
|
132
|
+
- [test] Stabilize flaky Data Grid tests (#16053) @LukasTy
|
|
133
|
+
|
|
8
134
|
## 8.0.0-alpha.6
|
|
9
135
|
|
|
10
136
|
_Dec 26, 2024_
|
|
@@ -104,7 +230,7 @@ Following are all team members who have contributed to this release:
|
|
|
104
230
|
|
|
105
231
|
#### Breaking changes
|
|
106
232
|
|
|
107
|
-
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps
|
|
233
|
+
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
|
|
108
234
|
|
|
109
235
|
- For `.root` element, use `slotProps.root`.
|
|
110
236
|
- For `.main` element (the one with `role="grid"`), use `slotProps.main`.
|
|
@@ -11,9 +11,8 @@ export interface ChartsLabelProps {
|
|
|
11
11
|
sx?: SxProps<Theme>;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* @ignore - internal component.
|
|
15
|
-
*
|
|
16
14
|
* Generates the label mark for the tooltip and legend.
|
|
15
|
+
* @ignore - internal component.
|
|
17
16
|
*/
|
|
18
|
-
declare const ChartsLabel: React.ForwardRefExoticComponent<ChartsLabelProps & React.RefAttributes<
|
|
17
|
+
declare const ChartsLabel: React.ForwardRefExoticComponent<ChartsLabelProps & React.RefAttributes<{}>>;
|
|
19
18
|
export { ChartsLabel };
|
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["children", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { styled } from '@mui/material/styles';
|
|
9
8
|
import clsx from 'clsx';
|
|
10
9
|
import { useUtilityClasses } from "./labelClasses.js";
|
|
11
10
|
import { consumeThemeProps } from "../internals/consumeThemeProps.js";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
const Root = styled('span', {
|
|
14
|
-
name: 'MuiChartsLabel',
|
|
15
|
-
slot: 'Root',
|
|
16
|
-
overridesResolver: (props, styles) => styles.root
|
|
17
|
-
})(({
|
|
18
|
-
theme
|
|
19
|
-
}) => _extends({}, theme.typography.caption, {
|
|
20
|
-
color: (theme.vars || theme).palette.text.primary,
|
|
21
|
-
lineHeight: undefined,
|
|
22
|
-
display: 'flex'
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
12
|
/**
|
|
26
|
-
* @ignore - internal component.
|
|
27
|
-
*
|
|
28
13
|
* Generates the label mark for the tooltip and legend.
|
|
14
|
+
* @ignore - internal component.
|
|
29
15
|
*/
|
|
30
16
|
const ChartsLabel = consumeThemeProps('MuiChartsLabel', {
|
|
31
17
|
classesResolver: useUtilityClasses
|
|
@@ -36,9 +22,8 @@ const ChartsLabel = consumeThemeProps('MuiChartsLabel', {
|
|
|
36
22
|
classes
|
|
37
23
|
} = props,
|
|
38
24
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
25
|
+
return /*#__PURE__*/_jsx("span", _extends({
|
|
40
26
|
className: clsx(classes?.root, className),
|
|
41
|
-
ownerState: props,
|
|
42
27
|
ref: ref
|
|
43
28
|
}, other, {
|
|
44
29
|
children: children
|
|
@@ -4,26 +4,28 @@ import { ChartsLabelGradientClasses } from './labelGradientClasses';
|
|
|
4
4
|
export interface ChartsLabelGradientProps {
|
|
5
5
|
/**
|
|
6
6
|
* A unique identifier for the gradient.
|
|
7
|
-
*
|
|
8
7
|
* The `gradientId` will be used as `fill="url(#gradientId)"`.
|
|
9
8
|
*/
|
|
10
9
|
gradientId: string;
|
|
11
10
|
/**
|
|
12
11
|
* The direction of the gradient.
|
|
13
|
-
*
|
|
14
|
-
* @default 'row'
|
|
12
|
+
* @default 'horizontal'
|
|
15
13
|
*/
|
|
16
|
-
direction?: '
|
|
14
|
+
direction?: 'vertical' | 'horizontal';
|
|
17
15
|
/**
|
|
18
16
|
* If `true`, the gradient will be reversed.
|
|
19
17
|
*/
|
|
20
18
|
reverse?: boolean;
|
|
21
19
|
/**
|
|
22
20
|
* If provided, the gradient will be rotated by 90deg.
|
|
23
|
-
*
|
|
24
21
|
* Useful for linear gradients that are not in the correct orientation.
|
|
25
22
|
*/
|
|
26
23
|
rotate?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The thickness of the gradient
|
|
26
|
+
* @default 12
|
|
27
|
+
*/
|
|
28
|
+
thickness?: number;
|
|
27
29
|
/**
|
|
28
30
|
* Override or extend the styles applied to the component.
|
|
29
31
|
*/
|
|
@@ -32,9 +34,8 @@ export interface ChartsLabelGradientProps {
|
|
|
32
34
|
sx?: SxProps<Theme>;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
|
-
* @ignore - internal component.
|
|
36
|
-
*
|
|
37
37
|
* Generates the label Gradient for the tooltip and legend.
|
|
38
|
+
* @ignore - internal component.
|
|
38
39
|
*/
|
|
39
|
-
declare const ChartsLabelGradient: React.ForwardRefExoticComponent<ChartsLabelGradientProps & React.RefAttributes<
|
|
40
|
+
declare const ChartsLabelGradient: React.ForwardRefExoticComponent<ChartsLabelGradientProps & React.RefAttributes<{}>>;
|
|
40
41
|
export { ChartsLabelGradient };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["gradientId", "direction", "classes", "className"];
|
|
5
|
+
const _excluded = ["gradientId", "direction", "classes", "className", "rotate", "reverse", "thickness"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
@@ -12,15 +12,15 @@ import { consumeThemeProps } from "../internals/consumeThemeProps.js";
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const getRotation = (direction, reverse, rotate) => {
|
|
14
14
|
if (!rotate && reverse) {
|
|
15
|
-
return direction === '
|
|
15
|
+
return direction === 'vertical' ? 90 : 180;
|
|
16
16
|
}
|
|
17
17
|
if (rotate && !reverse) {
|
|
18
|
-
return direction === '
|
|
18
|
+
return direction === 'vertical' ? 0 : 90;
|
|
19
19
|
}
|
|
20
20
|
if (rotate && reverse) {
|
|
21
|
-
return direction === '
|
|
21
|
+
return direction === 'vertical' ? 180 : -90;
|
|
22
22
|
}
|
|
23
|
-
return direction === '
|
|
23
|
+
return direction === 'vertical' ? -90 : 0;
|
|
24
24
|
};
|
|
25
25
|
const Root = styled('div', {
|
|
26
26
|
name: 'MuiChartsLabelGradient',
|
|
@@ -38,17 +38,17 @@ const Root = styled('div', {
|
|
|
38
38
|
borderRadius: 2,
|
|
39
39
|
overflow: 'hidden'
|
|
40
40
|
},
|
|
41
|
-
[`&.${labelGradientClasses.
|
|
41
|
+
[`&.${labelGradientClasses.horizontal}`]: {
|
|
42
42
|
width: '100%',
|
|
43
43
|
[`.${labelGradientClasses.mask}`]: {
|
|
44
|
-
height:
|
|
44
|
+
height: ownerState.thickness,
|
|
45
45
|
width: '100%'
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
[`&.${labelGradientClasses.
|
|
48
|
+
[`&.${labelGradientClasses.vertical}`]: {
|
|
49
49
|
height: '100%',
|
|
50
50
|
[`.${labelGradientClasses.mask}`]: {
|
|
51
|
-
width:
|
|
51
|
+
width: ownerState.thickness,
|
|
52
52
|
height: '100%',
|
|
53
53
|
'> svg': {
|
|
54
54
|
height: '100%'
|
|
@@ -63,13 +63,13 @@ const Root = styled('div', {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* @ignore - internal component.
|
|
67
|
-
*
|
|
68
66
|
* Generates the label Gradient for the tooltip and legend.
|
|
67
|
+
* @ignore - internal component.
|
|
69
68
|
*/
|
|
70
69
|
const ChartsLabelGradient = consumeThemeProps('MuiChartsLabelGradient', {
|
|
71
70
|
defaultProps: {
|
|
72
|
-
direction: '
|
|
71
|
+
direction: 'horizontal',
|
|
72
|
+
thickness: 12
|
|
73
73
|
},
|
|
74
74
|
classesResolver: useUtilityClasses
|
|
75
75
|
}, function ChartsLabelGradient(props, ref) {
|
|
@@ -90,6 +90,7 @@ const ChartsLabelGradient = consumeThemeProps('MuiChartsLabelGradient', {
|
|
|
90
90
|
children: /*#__PURE__*/_jsx("svg", {
|
|
91
91
|
viewBox: "0 0 24 24",
|
|
92
92
|
children: /*#__PURE__*/_jsx("rect", {
|
|
93
|
+
className: classes?.fill,
|
|
93
94
|
width: "24",
|
|
94
95
|
height: "24",
|
|
95
96
|
fill: `url(#${gradientId})`
|
|
@@ -109,13 +110,11 @@ process.env.NODE_ENV !== "production" ? ChartsLabelGradient.propTypes = {
|
|
|
109
110
|
classes: PropTypes.object,
|
|
110
111
|
/**
|
|
111
112
|
* The direction of the gradient.
|
|
112
|
-
*
|
|
113
|
-
* @default 'row'
|
|
113
|
+
* @default 'horizontal'
|
|
114
114
|
*/
|
|
115
|
-
direction: PropTypes.oneOf(['
|
|
115
|
+
direction: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
116
116
|
/**
|
|
117
117
|
* A unique identifier for the gradient.
|
|
118
|
-
*
|
|
119
118
|
* The `gradientId` will be used as `fill="url(#gradientId)"`.
|
|
120
119
|
*/
|
|
121
120
|
gradientId: PropTypes.string.isRequired,
|
|
@@ -125,9 +124,13 @@ process.env.NODE_ENV !== "production" ? ChartsLabelGradient.propTypes = {
|
|
|
125
124
|
reverse: PropTypes.bool,
|
|
126
125
|
/**
|
|
127
126
|
* If provided, the gradient will be rotated by 90deg.
|
|
128
|
-
*
|
|
129
127
|
* Useful for linear gradients that are not in the correct orientation.
|
|
130
128
|
*/
|
|
131
|
-
rotate: PropTypes.bool
|
|
129
|
+
rotate: PropTypes.bool,
|
|
130
|
+
/**
|
|
131
|
+
* The thickness of the gradient
|
|
132
|
+
* @default 12
|
|
133
|
+
*/
|
|
134
|
+
thickness: PropTypes.number
|
|
132
135
|
} : void 0;
|
|
133
136
|
export { ChartsLabelGradient };
|
|
@@ -19,9 +19,8 @@ export interface ChartsLabelMarkProps {
|
|
|
19
19
|
sx?: SxProps<Theme>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* @ignore - internal component.
|
|
23
|
-
*
|
|
24
22
|
* Generates the label mark for the tooltip and legend.
|
|
23
|
+
* @ignore - internal component.
|
|
25
24
|
*/
|
|
26
|
-
declare const ChartsLabelMark: React.ForwardRefExoticComponent<ChartsLabelMarkProps & React.RefAttributes<
|
|
25
|
+
declare const ChartsLabelMark: React.ForwardRefExoticComponent<ChartsLabelMarkProps & React.RefAttributes<{}>>;
|
|
27
26
|
export { ChartsLabelMark };
|
|
@@ -52,11 +52,13 @@ const Root = styled('div', {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* @ignore - internal component.
|
|
56
|
-
*
|
|
57
55
|
* Generates the label mark for the tooltip and legend.
|
|
56
|
+
* @ignore - internal component.
|
|
58
57
|
*/
|
|
59
58
|
const ChartsLabelMark = consumeThemeProps('MuiChartsLabelMark', {
|
|
59
|
+
defaultProps: {
|
|
60
|
+
type: 'square'
|
|
61
|
+
},
|
|
60
62
|
classesResolver: useUtilityClasses
|
|
61
63
|
}, function ChartsLabelMark(props, ref) {
|
|
62
64
|
const {
|
|
@@ -78,6 +80,7 @@ const ChartsLabelMark = consumeThemeProps('MuiChartsLabelMark', {
|
|
|
78
80
|
viewBox: "0 0 24 24",
|
|
79
81
|
preserveAspectRatio: type === 'line' ? 'none' : undefined,
|
|
80
82
|
children: /*#__PURE__*/_jsx("rect", {
|
|
83
|
+
className: classes?.fill,
|
|
81
84
|
width: "24",
|
|
82
85
|
height: "24",
|
|
83
86
|
fill: color
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ChartsLabelMarkProps } from './ChartsLabelMark';
|
|
2
|
+
export { labelClasses } from './labelClasses';
|
|
3
|
+
export type { ChartsLabelClasses } from './labelClasses';
|
|
4
|
+
export { labelMarkClasses } from './labelMarkClasses';
|
|
5
|
+
export type { ChartsLabelMarkClasses } from './labelMarkClasses';
|
|
6
|
+
export { labelGradientClasses } from './labelGradientClasses';
|
|
7
|
+
export type { ChartsLabelGradientClasses } from './labelGradientClasses';
|
|
@@ -3,7 +3,6 @@ export interface ChartsLabelClasses {
|
|
|
3
3
|
/** Styles applied to the root element. */
|
|
4
4
|
root: string;
|
|
5
5
|
}
|
|
6
|
-
export type ChartsLabelClassKey = keyof ChartsLabelClasses;
|
|
7
6
|
export declare function getLabelUtilityClass(slot: string): string;
|
|
8
7
|
export declare const labelClasses: ChartsLabelClasses;
|
|
9
8
|
export declare const useUtilityClasses: (props: ChartsLabelProps) => Record<"root", string>;
|
|
@@ -5,11 +5,12 @@ export interface ChartsLabelGradientClasses {
|
|
|
5
5
|
/** Styles applied to the "mask" that gives shape to the gradient. */
|
|
6
6
|
mask: string;
|
|
7
7
|
/** Styles applied when direction is "column". */
|
|
8
|
-
|
|
8
|
+
vertical: string;
|
|
9
9
|
/** Styles applied when direction is "row". */
|
|
10
|
-
|
|
10
|
+
horizontal: string;
|
|
11
|
+
/** Styles applied to the element filled by the gradient */
|
|
12
|
+
fill: string;
|
|
11
13
|
}
|
|
12
|
-
export type ChartsLabelGradientClassKey = keyof ChartsLabelGradientClasses;
|
|
13
14
|
export declare function getLabelGradientUtilityClass(slot: string): string;
|
|
14
15
|
export declare const labelGradientClasses: ChartsLabelGradientClasses;
|
|
15
|
-
export declare const useUtilityClasses: (props: ChartsLabelGradientProps) => Record<"mask" | "
|
|
16
|
+
export declare const useUtilityClasses: (props: ChartsLabelGradientProps) => Record<"root" | "mask" | "fill", string>;
|
|
@@ -4,14 +4,15 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
4
4
|
export function getLabelGradientUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiChartsLabelGradient', slot);
|
|
6
6
|
}
|
|
7
|
-
export const labelGradientClasses = generateUtilityClasses('MuiChartsLabelGradient', ['root', '
|
|
7
|
+
export const labelGradientClasses = generateUtilityClasses('MuiChartsLabelGradient', ['root', 'vertical', 'horizontal', 'mask', 'fill']);
|
|
8
8
|
export const useUtilityClasses = props => {
|
|
9
9
|
const {
|
|
10
10
|
direction
|
|
11
11
|
} = props;
|
|
12
12
|
const slots = {
|
|
13
13
|
root: ['root', direction],
|
|
14
|
-
mask: ['mask']
|
|
14
|
+
mask: ['mask'],
|
|
15
|
+
fill: ['fill']
|
|
15
16
|
};
|
|
16
17
|
return composeClasses(slots, getLabelGradientUtilityClass, props.classes);
|
|
17
18
|
};
|
|
@@ -10,8 +10,9 @@ export interface ChartsLabelMarkClasses {
|
|
|
10
10
|
square: string;
|
|
11
11
|
/** Styles applied to the mark type "circle". */
|
|
12
12
|
circle: string;
|
|
13
|
+
/** Styles applied to the element with fill={color} attribute. */
|
|
14
|
+
fill: string;
|
|
13
15
|
}
|
|
14
|
-
export type ChartsLabelMarkClassKey = keyof ChartsLabelMarkClasses;
|
|
15
16
|
export declare function getLabelMarkUtilityClass(slot: string): string;
|
|
16
17
|
export declare const labelMarkClasses: ChartsLabelMarkClasses;
|
|
17
|
-
export declare const useUtilityClasses: (props: ChartsLabelMarkProps) => Record<"mask" | "
|
|
18
|
+
export declare const useUtilityClasses: (props: ChartsLabelMarkProps) => Record<"root" | "mask" | "fill", string>;
|
|
@@ -4,14 +4,15 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
4
4
|
export function getLabelMarkUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiChartsLabelMark', slot);
|
|
6
6
|
}
|
|
7
|
-
export const labelMarkClasses = generateUtilityClasses('MuiChartsLabelMark', ['root', 'line', 'square', 'circle', 'mask']);
|
|
7
|
+
export const labelMarkClasses = generateUtilityClasses('MuiChartsLabelMark', ['root', 'line', 'square', 'circle', 'mask', 'fill']);
|
|
8
8
|
export const useUtilityClasses = props => {
|
|
9
9
|
const {
|
|
10
10
|
type
|
|
11
11
|
} = props;
|
|
12
12
|
const slots = {
|
|
13
13
|
root: ['root', type],
|
|
14
|
-
mask: ['mask']
|
|
14
|
+
mask: ['mask'],
|
|
15
|
+
fill: ['fill']
|
|
15
16
|
};
|
|
16
17
|
return composeClasses(slots, getLabelMarkUtilityClass, props.classes);
|
|
17
18
|
};
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import type { Direction } from './direction';
|
|
4
|
+
import { SeriesLegendItemContext } from './legendContext.types';
|
|
5
|
+
import { type ChartsLegendClasses } from './chartsLegendClasses';
|
|
6
|
+
export interface ChartsLegendProps {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
8
|
+
* Callback fired when a legend item is clicked.
|
|
9
|
+
* @param {React.MouseEvent<HTMLButtonElement, MouseEvent>} event The click event.
|
|
10
|
+
* @param {SeriesLegendItemContext} legendItem The legend item data.
|
|
11
|
+
* @param {number} index The index of the clicked legend item.
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export interface ChartsLegendSlotProps {
|
|
13
|
-
legend?: Partial<LegendRendererProps>;
|
|
14
|
-
}
|
|
15
|
-
export interface ChartsLegendProps extends ChartsLegendPropsBase {
|
|
13
|
+
onItemClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, legendItem: SeriesLegendItemContext, index: number) => void;
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* The direction of the legend layout.
|
|
16
|
+
* The default depends on the chart.
|
|
19
17
|
*/
|
|
20
|
-
|
|
18
|
+
direction?: Direction;
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @default {}
|
|
20
|
+
* Override or extend the styles applied to the component.
|
|
24
21
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
declare namespace ChartsLegend {
|
|
29
|
-
var propTypes: any;
|
|
22
|
+
classes?: Partial<ChartsLegendClasses>;
|
|
23
|
+
className?: string;
|
|
24
|
+
sx?: SxProps<Theme>;
|
|
30
25
|
}
|
|
26
|
+
declare const ChartsLegend: React.ForwardRefExoticComponent<ChartsLegendProps & import("./chartsLegend.types").ChartsLegendSlotExtension & React.RefAttributes<{}>>;
|
|
31
27
|
export { ChartsLegend };
|