@ssa-ui-kit/widgets 3.9.0 → 3.10.5
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/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -22584,10 +22584,17 @@ const BalancePieChart = (0,react_namespaceObject.withTheme)(({
|
|
|
22584
22584
|
}
|
|
22585
22585
|
return isSaved;
|
|
22586
22586
|
});
|
|
22587
|
+
const isAllValuesZero = data.length > 0 && chartData.length === 0;
|
|
22587
22588
|
const chartColors = (chartColorPalette || pieChartColors).filter((item, index) => !filteredIndexes.includes(index));
|
|
22588
|
-
|
|
22589
|
-
|
|
22590
|
-
|
|
22589
|
+
const chartDataWithZeroFallback = isAllValuesZero ? [{
|
|
22590
|
+
id: '__zero__',
|
|
22591
|
+
value: 1,
|
|
22592
|
+
label: '__zero__'
|
|
22593
|
+
}] : chartData;
|
|
22594
|
+
const chartColorsWithZeroFallback = isAllValuesZero ? [theme.palette.secondary.dark] : chartColors;
|
|
22595
|
+
if (chartColorsWithZeroFallback.length < chartDataWithZeroFallback.length) {
|
|
22596
|
+
for (let i = 0; i < chartDataWithZeroFallback.length - chartColorsWithZeroFallback.length; i++) {
|
|
22597
|
+
chartColorsWithZeroFallback.push(core_namespaceObject.mainTheme.colors.purpleLighter);
|
|
22591
22598
|
}
|
|
22592
22599
|
}
|
|
22593
22600
|
if (Object.keys(pieChartProps.cardProps || {}).length) {
|
|
@@ -22602,9 +22609,9 @@ const BalancePieChart = (0,react_namespaceObject.withTheme)(({
|
|
|
22602
22609
|
onFullscreenModeChange?.(pieChartFullscreenMode);
|
|
22603
22610
|
};
|
|
22604
22611
|
return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.PieChart, {
|
|
22605
|
-
data:
|
|
22612
|
+
data: chartDataWithZeroFallback,
|
|
22606
22613
|
features: Array.from(featuresList),
|
|
22607
|
-
colors:
|
|
22614
|
+
colors: chartColorsWithZeroFallback,
|
|
22608
22615
|
onFullscreenModeChange: handleFullscreenModeChange,
|
|
22609
22616
|
animate: false,
|
|
22610
22617
|
title: (0,jsx_runtime_namespaceObject.jsx)(BalancePieChartTitle, {}),
|