@tsiky/components-r19 1.0.0 → 1.2.0
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/index.ts +35 -33
- package/package.json +1 -1
- package/src/components/AnnouncementPanel/FlexRowContainer.css +17 -17
- package/src/components/AnnouncementPanel/FlexRowContainer.stories.tsx +329 -329
- package/src/components/AnnouncementPanel/FlexRowContainer.tsx +24 -24
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.css +56 -56
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.stories.tsx +292 -292
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.tsx +106 -106
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.css +57 -57
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.stories.tsx +189 -189
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.tsx +138 -138
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.css +61 -61
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.stories.tsx +257 -257
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.tsx +90 -90
- package/src/components/AnnouncementPanel/ListBox/index.ts +3 -3
- package/src/components/AnnouncementPanel/ListContentContainer.css +23 -23
- package/src/components/AnnouncementPanel/ListContentContainer.stories.tsx +212 -212
- package/src/components/AnnouncementPanel/ListContentContainer.tsx +33 -33
- package/src/components/AnnouncementPanel/index.ts +3 -3
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +129 -89
- package/src/components/Charts/bar-chart/BarChart.tsx +171 -132
- package/src/components/Charts/boxplot-chart/BoxPlotChart.tsx +114 -114
- package/src/components/Charts/mixed-chart/MixedChart.tsx +65 -9
- package/src/components/Charts/sankey-adaptation/sankey.tsx +70 -70
- package/src/components/Charts/sankey-chart/SankeyChart.tsx +183 -155
- package/src/components/Confirmationpopup/ConfirmationPopup.module.css +88 -0
- package/src/components/Confirmationpopup/ConfirmationPopup.stories.tsx +94 -0
- package/src/components/Confirmationpopup/ConfirmationPopup.tsx +47 -0
- package/src/components/Confirmationpopup/index.ts +6 -0
- package/src/components/Confirmationpopup/useConfirmationPopup.ts +48 -0
- package/src/components/DayStatCard/DayStatCard.tsx +96 -69
- package/src/components/DraggableSwitcher/DraggableSwitcherButton.tsx +58 -58
- package/src/components/DraggableSwitcher/context/useDraggableSwitcher.tsx +45 -45
- package/src/components/DraggableSwitcher/index.ts +2 -2
- package/src/components/DynamicInput/input/SelectInput.tsx +75 -75
- package/src/components/DynamicInput/input/assets/SelectInput.module.css +95 -95
- package/src/components/DynamicTable/TableCell.tsx +38 -30
- package/src/components/DynamicTable/TableHeader.tsx +39 -34
- package/src/components/DynamicTable/TableauDynamique.module.css +1333 -1287
- package/src/components/DynamicTable/TableauDynamique.tsx +154 -154
- package/src/components/DynamicTable/tools/tableTypes.ts +63 -63
- package/src/components/Grid/Grid.tsx +5 -0
- package/src/components/Grid/grid.css +285 -285
- package/src/components/Header/Header.tsx +4 -2
- package/src/components/Header/header.css +61 -31
- package/src/components/MetricsPanel/MetricsPanel.module.css +688 -636
- package/src/components/MetricsPanel/MetricsPanel.tsx +220 -282
- package/src/components/MetricsPanel/renderers/CompactRenderer.tsx +148 -125
- package/src/components/NavBar/NavBar.tsx +1 -1
- package/src/components/NavItem/NavItem.tsx +58 -58
- package/src/components/PeriodRange/PeriodRange.module.css +158 -158
- package/src/components/PeriodRange/PeriodRange.tsx +130 -130
- package/src/components/SearchBar/SearchBar.css +40 -40
- package/src/components/SelectFilter/SelectFilter.module.css +249 -0
- package/src/components/SelectFilter/SelectFilter.stories.tsx +321 -0
- package/src/components/SelectFilter/SelectFilter.tsx +219 -0
- package/src/components/SelectFilter/index.ts +2 -0
- package/src/components/SelectFilter/types.ts +19 -0
- package/src/components/TranslationKey/TranslationKey.css +272 -272
- package/src/components/TranslationKey/TranslationKey.tsx +266 -245
- package/src/components/TrendList/TrendList.tsx +72 -45
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './ListContentContainer.css';
|
|
3
|
-
|
|
4
|
-
export type ListContentContainerProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
children?: React.ReactNode; // normally SimpleListBox/CounterListBox/TrendListBox
|
|
8
|
-
gap?: string;
|
|
9
|
-
background?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const ListContentContainer: React.FC<ListContentContainerProps> = ({
|
|
13
|
-
className = '',
|
|
14
|
-
style = {},
|
|
15
|
-
children,
|
|
16
|
-
gap = '1rem',
|
|
17
|
-
background = '#D9EEF5',
|
|
18
|
-
}) => {
|
|
19
|
-
return (
|
|
20
|
-
<div
|
|
21
|
-
className={`lcc-root ${className}`}
|
|
22
|
-
style={{
|
|
23
|
-
background,
|
|
24
|
-
...style,
|
|
25
|
-
['--lcc-gap' as any]: gap,
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
{React.Children.map(children, (child) => (
|
|
29
|
-
<div className='lcc-cell'>{child}</div>
|
|
30
|
-
))}
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ListContentContainer.css';
|
|
3
|
+
|
|
4
|
+
export type ListContentContainerProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
children?: React.ReactNode; // normally SimpleListBox/CounterListBox/TrendListBox
|
|
8
|
+
gap?: string;
|
|
9
|
+
background?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ListContentContainer: React.FC<ListContentContainerProps> = ({
|
|
13
|
+
className = '',
|
|
14
|
+
style = {},
|
|
15
|
+
children,
|
|
16
|
+
gap = '1rem',
|
|
17
|
+
background = '#D9EEF5',
|
|
18
|
+
}) => {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className={`lcc-root ${className}`}
|
|
22
|
+
style={{
|
|
23
|
+
background,
|
|
24
|
+
...style,
|
|
25
|
+
['--lcc-gap' as any]: gap,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
{React.Children.map(children, (child) => (
|
|
29
|
+
<div className='lcc-cell'>{child}</div>
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './ListBox';
|
|
2
|
-
export * from './FlexRowContainer';
|
|
3
|
-
export * from './ListContentContainer';
|
|
1
|
+
export * from './ListBox';
|
|
2
|
+
export * from './FlexRowContainer';
|
|
3
|
+
export * from './ListContentContainer';
|
|
@@ -1,89 +1,129 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Chart from 'react-apexcharts';
|
|
3
|
-
import type { ApexOptions } from 'apexcharts';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Chart from 'react-apexcharts';
|
|
3
|
+
import type { ApexOptions } from 'apexcharts';
|
|
4
|
+
import { Move } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
export type SeriesItem = { name: string; data: number[] };
|
|
7
|
+
|
|
8
|
+
interface ChartProps {
|
|
9
|
+
categories: string[];
|
|
10
|
+
series: SeriesItem[];
|
|
11
|
+
height?: number;
|
|
12
|
+
title?: string;
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const defaultColors = ['#e24b33', '#e2b23a', '#6feff0', '#2f5be8'];
|
|
17
|
+
|
|
18
|
+
const Area: React.FC<ChartProps> = ({
|
|
19
|
+
categories,
|
|
20
|
+
series,
|
|
21
|
+
height = 350,
|
|
22
|
+
title = 'Admissions',
|
|
23
|
+
draggable = false,
|
|
24
|
+
}) => {
|
|
25
|
+
const maxStack = Math.max(
|
|
26
|
+
...categories.map((_, i) => series.reduce((s, ser) => s + (ser.data[i] ?? 0), 0))
|
|
27
|
+
);
|
|
28
|
+
const yMax = Math.max(100, Math.ceil(maxStack / 50) * 50);
|
|
29
|
+
|
|
30
|
+
const apexOptions: ApexOptions = {
|
|
31
|
+
chart: {
|
|
32
|
+
foreColor: 'var(--color-text)',
|
|
33
|
+
type: 'area',
|
|
34
|
+
stacked: true,
|
|
35
|
+
stackType: 'normal',
|
|
36
|
+
toolbar: { show: false },
|
|
37
|
+
zoom: { enabled: false },
|
|
38
|
+
animations: { enabled: true },
|
|
39
|
+
fontFamily: "Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial",
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
text: title,
|
|
43
|
+
align: 'center',
|
|
44
|
+
style: { fontSize: '36px', fontWeight: 700, color: '#555' },
|
|
45
|
+
},
|
|
46
|
+
colors: defaultColors,
|
|
47
|
+
dataLabels: { enabled: false },
|
|
48
|
+
stroke: { curve: 'smooth', width: 1.5 },
|
|
49
|
+
fill: { type: 'solid', opacity: 0.95 },
|
|
50
|
+
markers: { size: 0 },
|
|
51
|
+
legend: {
|
|
52
|
+
show: true,
|
|
53
|
+
position: 'top',
|
|
54
|
+
horizontalAlign: 'center',
|
|
55
|
+
itemMargin: { horizontal: 8, vertical: 0 },
|
|
56
|
+
},
|
|
57
|
+
xaxis: {
|
|
58
|
+
categories,
|
|
59
|
+
labels: { rotate: -45, rotateAlways: true, style: { fontSize: '12px' } },
|
|
60
|
+
tickPlacement: 'on',
|
|
61
|
+
},
|
|
62
|
+
yaxis: {
|
|
63
|
+
min: 0,
|
|
64
|
+
max: yMax,
|
|
65
|
+
tickAmount: 7,
|
|
66
|
+
labels: { formatter: (val) => String(Math.round(Number(val))) },
|
|
67
|
+
},
|
|
68
|
+
grid: { borderColor: '#e9e9e9', strokeDashArray: 0 },
|
|
69
|
+
tooltip: {
|
|
70
|
+
shared: true,
|
|
71
|
+
intersect: false,
|
|
72
|
+
y: { formatter: (val: number) => String(val) },
|
|
73
|
+
},
|
|
74
|
+
responsive: [
|
|
75
|
+
{
|
|
76
|
+
breakpoint: 768,
|
|
77
|
+
options: {
|
|
78
|
+
chart: { height: Math.max(240, Math.round(height * 0.7)) },
|
|
79
|
+
legend: { position: 'top' },
|
|
80
|
+
xaxis: { labels: { rotate: -45 } },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const apexSeries = series.map((s) => ({
|
|
87
|
+
name: s.name,
|
|
88
|
+
type: 'area' as const,
|
|
89
|
+
data: s.data,
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
style={{
|
|
95
|
+
position: 'relative',
|
|
96
|
+
height,
|
|
97
|
+
width: '100%',
|
|
98
|
+
overflow: 'hidden',
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
{/* Chart visible ou masqué */}
|
|
102
|
+
<div style={{ opacity: draggable ? 0 : 1, transition: 'opacity 0.2s ease-in-out' }}>
|
|
103
|
+
<Chart options={apexOptions} series={apexSeries} type='area' height={height} width='100%' />
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
{/* Overlay Move */}
|
|
107
|
+
{draggable && (
|
|
108
|
+
<div
|
|
109
|
+
style={{
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
inset: 0,
|
|
112
|
+
display: 'flex',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'center',
|
|
115
|
+
background: 'rgba(255, 255, 255, 0.6)',
|
|
116
|
+
borderRadius: 12,
|
|
117
|
+
backdropFilter: 'blur(3px)',
|
|
118
|
+
pointerEvents: 'none',
|
|
119
|
+
transition: 'opacity 0.2s ease-in-out',
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
<Move size={38} strokeWidth={1.5} style={{ opacity: 0.85 }} />
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default Area;
|
|
@@ -1,132 +1,171 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Chart from 'react-apexcharts';
|
|
3
|
-
import type { ApexOptions } from 'apexcharts';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Chart from 'react-apexcharts';
|
|
3
|
+
import type { ApexOptions } from 'apexcharts';
|
|
4
|
+
import { Move } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
export interface HorizontalBarData {
|
|
7
|
+
labels: string[];
|
|
8
|
+
values: number[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface HorizontalBarConfig {
|
|
12
|
+
color?: string;
|
|
13
|
+
sort?: 'desc' | 'asc' | null;
|
|
14
|
+
height?: number;
|
|
15
|
+
showGrid?: boolean;
|
|
16
|
+
showLegend?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
data: HorizontalBarData;
|
|
21
|
+
config?: HorizontalBarConfig;
|
|
22
|
+
draggable?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Default (local) config */
|
|
26
|
+
const defaultConfig: HorizontalBarConfig = {
|
|
27
|
+
color: '#4f9db5',
|
|
28
|
+
sort: 'desc',
|
|
29
|
+
height: 520,
|
|
30
|
+
showGrid: true,
|
|
31
|
+
showLegend: false,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Série locale (évite d'importer ApexAxisChartSeries) */
|
|
35
|
+
type HBarSeries = ReadonlyArray<{
|
|
36
|
+
name: string;
|
|
37
|
+
data: ReadonlyArray<number>;
|
|
38
|
+
}>;
|
|
39
|
+
|
|
40
|
+
const HorizontalBarChart: React.FC<Props> = ({
|
|
41
|
+
data,
|
|
42
|
+
config = defaultConfig,
|
|
43
|
+
draggable = false,
|
|
44
|
+
}) => {
|
|
45
|
+
const cfg: HorizontalBarConfig = { ...defaultConfig, ...config };
|
|
46
|
+
|
|
47
|
+
const labels = data.labels ?? [];
|
|
48
|
+
const values = data.values ?? [];
|
|
49
|
+
|
|
50
|
+
// normalize lengths
|
|
51
|
+
const len = Math.min(labels.length, values.length);
|
|
52
|
+
const pairs: { label: string; value: number }[] = [];
|
|
53
|
+
for (let i = 0; i < len; i++) pairs.push({ label: labels[i], value: values[i] });
|
|
54
|
+
|
|
55
|
+
// optional sorting
|
|
56
|
+
if (cfg.sort === 'desc') pairs.sort((a, b) => b.value - a.value);
|
|
57
|
+
else if (cfg.sort === 'asc') pairs.sort((a, b) => a.value - b.value);
|
|
58
|
+
|
|
59
|
+
const labelsSorted = pairs.map((p) => p.label);
|
|
60
|
+
const valuesSorted = pairs.map((p) => p.value);
|
|
61
|
+
|
|
62
|
+
const series: HBarSeries = [
|
|
63
|
+
{
|
|
64
|
+
name: 'Valeur',
|
|
65
|
+
data: valuesSorted,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const options: ApexOptions = {
|
|
70
|
+
chart: {
|
|
71
|
+
foreColor: 'var(--color-text)',
|
|
72
|
+
type: 'bar',
|
|
73
|
+
toolbar: { show: false },
|
|
74
|
+
height: cfg.height,
|
|
75
|
+
},
|
|
76
|
+
plotOptions: {
|
|
77
|
+
bar: {
|
|
78
|
+
horizontal: true,
|
|
79
|
+
barHeight: '60%',
|
|
80
|
+
distributed: false,
|
|
81
|
+
borderRadius: 6,
|
|
82
|
+
borderRadiusApplication: 'end',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
dataLabels: {
|
|
86
|
+
enabled: false,
|
|
87
|
+
formatter: (val: number) => String(val),
|
|
88
|
+
style: { fontSize: '12px' },
|
|
89
|
+
offsetX: 0,
|
|
90
|
+
},
|
|
91
|
+
yaxis: {
|
|
92
|
+
labels: { style: { fontSize: '12px' } },
|
|
93
|
+
},
|
|
94
|
+
grid: {
|
|
95
|
+
show: !!cfg.showGrid,
|
|
96
|
+
borderColor: '#e6e6e6',
|
|
97
|
+
},
|
|
98
|
+
tooltip: {
|
|
99
|
+
shared: false,
|
|
100
|
+
y: { formatter: (val: number) => String(val) },
|
|
101
|
+
},
|
|
102
|
+
legend: { show: !!cfg.showLegend },
|
|
103
|
+
colors: [cfg.color],
|
|
104
|
+
xaxis: {
|
|
105
|
+
min: 0,
|
|
106
|
+
tickAmount: 5,
|
|
107
|
+
categories: labelsSorted,
|
|
108
|
+
labels: { formatter: (v: string | number) => String(v) },
|
|
109
|
+
},
|
|
110
|
+
responsive: [
|
|
111
|
+
// {
|
|
112
|
+
// breakpoint: 1024,
|
|
113
|
+
// options: {
|
|
114
|
+
// plotOptions: { bar: { barHeight: '52%' } },
|
|
115
|
+
// chart: { height: Math.max(300, Math.round((cfg.height ?? 520) * 0.75)), width: 520 },
|
|
116
|
+
// },
|
|
117
|
+
// },
|
|
118
|
+
// {
|
|
119
|
+
// breakpoint: 768,
|
|
120
|
+
// options: {
|
|
121
|
+
// plotOptions: { bar: { barHeight: '48%' } },
|
|
122
|
+
// chart: { height: Math.max(260, Math.round((cfg.height ?? 520) * 0.6)), width: 360 },
|
|
123
|
+
// },
|
|
124
|
+
// },
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<div
|
|
130
|
+
style={{
|
|
131
|
+
position: 'relative',
|
|
132
|
+
height: cfg.height,
|
|
133
|
+
width: '100%',
|
|
134
|
+
overflow: 'hidden',
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
{/* Chart affiché normalement */}
|
|
138
|
+
<div style={{ opacity: draggable ? 0 : 1, transition: 'opacity 0.15s ease-in-out' }}>
|
|
139
|
+
<Chart
|
|
140
|
+
options={options}
|
|
141
|
+
series={series as unknown as ApexOptions['series']}
|
|
142
|
+
type='bar'
|
|
143
|
+
height={cfg.height}
|
|
144
|
+
width='100%'
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
{/* Overlay Move */}
|
|
149
|
+
{draggable && (
|
|
150
|
+
<div
|
|
151
|
+
style={{
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
inset: 0,
|
|
154
|
+
display: 'flex',
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
justifyContent: 'center',
|
|
157
|
+
background: 'rgba(255,255,255,0.5)',
|
|
158
|
+
borderRadius: 12,
|
|
159
|
+
backdropFilter: 'blur(3px)',
|
|
160
|
+
pointerEvents: 'none',
|
|
161
|
+
transition: 'opacity 0.15s ease-in-out',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<Move size={36} strokeWidth={1.5} style={{ opacity: 0.85 }} />
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export default HorizontalBarChart;
|