@vendure/dashboard 3.6.2 → 3.6.3-master-202604150307
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/vite/constants.js +1 -0
- package/lingui.config.js +2 -1
- package/package.json +3 -3
- package/src/app/routes/_authenticated/_orders/components/order-modification-preview-dialog.tsx +14 -9
- package/src/i18n/locales/ro.po +5603 -0
- package/src/lib/framework/dashboard-widget/metrics-widget/chart.tsx +14 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Area, AreaChart, CartesianGrid, Tooltip, XAxis, YAxis } from 'recharts';
|
|
2
1
|
import { useWidgetDimensions } from '@/vdb/hooks/use-widget-dimensions.js';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Area, AreaChart, CartesianGrid, Tooltip, XAxis, YAxis } from 'recharts';
|
|
3
4
|
|
|
4
5
|
export function MetricsChart({
|
|
5
6
|
chartData,
|
|
@@ -12,6 +13,12 @@ export function MetricsChart({
|
|
|
12
13
|
}) {
|
|
13
14
|
const { width, height } = useWidgetDimensions();
|
|
14
15
|
|
|
16
|
+
const yAxisWidth = useMemo(() => {
|
|
17
|
+
const maxValue = Math.max(0, ...chartData.map(d => d.sales));
|
|
18
|
+
const formatted = String(formatValue(maxValue));
|
|
19
|
+
return Math.max(60, formatted.length * 7);
|
|
20
|
+
}, [chartData, formatValue]);
|
|
21
|
+
|
|
15
22
|
return (
|
|
16
23
|
<AreaChart width={width} height={height} data={chartData}>
|
|
17
24
|
<defs>
|
|
@@ -22,7 +29,12 @@ export function MetricsChart({
|
|
|
22
29
|
</defs>
|
|
23
30
|
<CartesianGrid strokeDasharray="4 4" stroke="var(--color-border)" />
|
|
24
31
|
<XAxis className="text-xs" color="var(--color-foreground)" dataKey="name" interval={2} />
|
|
25
|
-
<YAxis
|
|
32
|
+
<YAxis
|
|
33
|
+
className="text-xs"
|
|
34
|
+
color="var(--color-foreground)"
|
|
35
|
+
width={yAxisWidth}
|
|
36
|
+
tickFormatter={formatValue}
|
|
37
|
+
/>
|
|
26
38
|
<Tooltip
|
|
27
39
|
formatter={formatValue}
|
|
28
40
|
contentStyle={{
|