@pagamio/frontend-commons-lib 0.8.231 → 0.8.232
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.
|
@@ -53,11 +53,11 @@ const ChartRenderer = ({ config, loading }) => {
|
|
|
53
53
|
// Flat array: { name, value }[] - convert to series format
|
|
54
54
|
const categories = data.map((d) => d.name);
|
|
55
55
|
const series = [{ name: 'Value', data: data.map((d) => d.value) }];
|
|
56
|
-
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(BarChartV2, { series: series, categories: categories, height: chartHeight, colors: chartColors, horizontal: config.barOptions?.horizontal, stacked: config.barOptions?.stacked, distributed: config.barOptions?.distributed, className: config.chartClassName }) }));
|
|
56
|
+
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(BarChartV2, { series: series, categories: categories, height: chartHeight, colors: chartColors, horizontal: config.barOptions?.horizontal, stacked: config.barOptions?.stacked, distributed: config.barOptions?.distributed, options: config.options, className: config.chartClassName }) }));
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
// Series format
|
|
60
|
-
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(BarChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, horizontal: config.barOptions?.horizontal, stacked: config.barOptions?.stacked, distributed: config.barOptions?.distributed, className: config.chartClassName }) }));
|
|
60
|
+
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(BarChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, horizontal: config.barOptions?.horizontal, stacked: config.barOptions?.stacked, distributed: config.barOptions?.distributed, options: config.options, className: config.chartClassName }) }));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
case 'donut': {
|
|
@@ -65,17 +65,17 @@ const ChartRenderer = ({ config, loading }) => {
|
|
|
65
65
|
const data = config.data;
|
|
66
66
|
const series = data.map((d) => d.value);
|
|
67
67
|
const labels = data.map((d) => d.name);
|
|
68
|
-
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(DonutChartV2, { series: series, labels: labels, height: chartHeight, colors: chartColors || data.map((d) => d.color).filter(Boolean), showLegend: config.donutOptions?.showLegend, legendPosition: config.donutOptions?.legendPosition, showLabels: config.donutOptions?.showLabels, className: config.chartClassName }) }));
|
|
68
|
+
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(DonutChartV2, { series: series, labels: labels, height: chartHeight, colors: chartColors || data.map((d) => d.color).filter(Boolean), showLegend: config.donutOptions?.showLegend, legendPosition: config.donutOptions?.legendPosition, showLabels: config.donutOptions?.showLabels, options: config.options, className: config.chartClassName }) }));
|
|
69
69
|
}
|
|
70
70
|
case 'line': {
|
|
71
71
|
// Line chart expects series: { name, data }[] and categories: string[]
|
|
72
72
|
const data = config.data;
|
|
73
|
-
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(LineChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, className: config.chartClassName }) }));
|
|
73
|
+
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(LineChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, options: config.options, className: config.chartClassName }) }));
|
|
74
74
|
}
|
|
75
75
|
case 'area': {
|
|
76
76
|
// Area chart expects series: { name, data }[] and categories: string[]
|
|
77
77
|
const data = config.data;
|
|
78
|
-
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(AreaChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, stacked: config.areaOptions?.stacked, className: config.chartClassName }) }));
|
|
78
|
+
return (_jsx(DashboardCard, { title: config.title, subtitle: config.subtitle, actions: config.action, footer: config.footer, className: config.cardClassName, children: _jsx(AreaChartV2, { series: data.series, categories: data.categories, height: chartHeight, colors: chartColors, stacked: config.areaOptions?.stacked, options: config.options, className: config.chartClassName }) }));
|
|
79
79
|
}
|
|
80
80
|
case 'heatmap': {
|
|
81
81
|
// Heatmap expects series: { name, data: { x, y }[] }[]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.232",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|