datastake-daf 0.6.310 → 0.6.312
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/dist/components/index.js +8 -4
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/ColumnChart.stories.jsx +1 -0
- package/src/@daf/core/components/Charts/ColumnChart/index.jsx +5 -1
- package/src/@daf/core/components/Charts/PieChart/PieChart.stories.js +2 -2
- package/src/@daf/core/components/Charts/PieChart/chart.jsx +1 -1
package/dist/components/index.js
CHANGED
|
@@ -45822,7 +45822,7 @@ const Chart = _ref => {
|
|
|
45822
45822
|
if (typeof legend === 'object') {
|
|
45823
45823
|
return legend;
|
|
45824
45824
|
}
|
|
45825
|
-
if (legend === true ||
|
|
45825
|
+
if (legend === true || isPdf) {
|
|
45826
45826
|
return {};
|
|
45827
45827
|
}
|
|
45828
45828
|
return null;
|
|
@@ -49691,7 +49691,7 @@ function LineChart(_ref) {
|
|
|
49691
49691
|
});
|
|
49692
49692
|
}
|
|
49693
49693
|
|
|
49694
|
-
const _excluded$5 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "seriesField", "isPercentage", "showBackground", "formattedYAxis", "formattedXAxis", "color", "height", "groupField", "t", "isPdf", "extraLegendConfig"];
|
|
49694
|
+
const _excluded$5 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "seriesField", "isPercentage", "showBackground", "formattedYAxis", "formattedXAxis", "color", "height", "groupField", "t", "isPdf", "extraLegendConfig", "shouldSeperateLegendName"];
|
|
49695
49695
|
const {
|
|
49696
49696
|
useToken: useToken$c
|
|
49697
49697
|
} = antd.theme;
|
|
@@ -49778,7 +49778,8 @@ function ColumnChart(_ref) {
|
|
|
49778
49778
|
groupField,
|
|
49779
49779
|
t = s => s,
|
|
49780
49780
|
isPdf = false,
|
|
49781
|
-
extraLegendConfig = {}
|
|
49781
|
+
extraLegendConfig = {},
|
|
49782
|
+
shouldSeperateLegendName = false
|
|
49782
49783
|
} = _ref;
|
|
49783
49784
|
_objectWithoutProperties(_ref, _excluded$5);
|
|
49784
49785
|
const containerRef = React__default["default"].useRef(null);
|
|
@@ -49823,7 +49824,10 @@ function ColumnChart(_ref) {
|
|
|
49823
49824
|
}),
|
|
49824
49825
|
legend: isPdf ? _objectSpread2({
|
|
49825
49826
|
itemName: {
|
|
49826
|
-
formatter: text =>
|
|
49827
|
+
formatter: text => {
|
|
49828
|
+
const textToTranslate = shouldSeperateLegendName ? text.split("-")[1].toLowerCase() : text;
|
|
49829
|
+
return t(textToTranslate);
|
|
49830
|
+
}
|
|
49827
49831
|
},
|
|
49828
49832
|
position: 'bottom'
|
|
49829
49833
|
}, extraLegendConfig) : hasLegendConfig || false
|
package/package.json
CHANGED
|
@@ -89,6 +89,7 @@ export default function ColumnChart({
|
|
|
89
89
|
t = (s) => s,
|
|
90
90
|
isPdf = false,
|
|
91
91
|
extraLegendConfig = {},
|
|
92
|
+
shouldSeperateLegendName = false,
|
|
92
93
|
...rest
|
|
93
94
|
}) {
|
|
94
95
|
const containerRef = React.useRef(null);
|
|
@@ -145,7 +146,10 @@ export default function ColumnChart({
|
|
|
145
146
|
legend: isPdf
|
|
146
147
|
? {
|
|
147
148
|
itemName: {
|
|
148
|
-
formatter: (text) =>
|
|
149
|
+
formatter: (text) => {
|
|
150
|
+
const textToTranslate = shouldSeperateLegendName ? text.split("-")[1].toLowerCase() : text
|
|
151
|
+
return t(textToTranslate)
|
|
152
|
+
},
|
|
149
153
|
},
|
|
150
154
|
position: 'bottom',
|
|
151
155
|
...extraLegendConfig,
|