@centreon/ui 25.10.24 → 25.10.26
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/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
|
|
1
3
|
import Typography from '@mui/material/Typography';
|
|
2
4
|
|
|
3
5
|
import { useMemoComponent } from '@centreon/ui';
|
|
@@ -10,7 +12,7 @@ interface Props {
|
|
|
10
12
|
title: string;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
const Header = ({ title, header }: Props):
|
|
15
|
+
const Header = ({ title, header }: Props): ReactElement => {
|
|
14
16
|
const { classes } = ussHeaderChartStyles();
|
|
15
17
|
|
|
16
18
|
const displayTitle = header?.displayTitle ?? true;
|
package/src/Graph/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as BarChart } from './BarChart/BarChart';
|
|
|
6
6
|
export { Gauge } from './Gauge';
|
|
7
7
|
export { SingleBar } from './SingleBar';
|
|
8
8
|
export { Text as GraphText } from './Text';
|
|
9
|
+
export { default as Header } from './common/BaseChart/Header';
|
|
9
10
|
|
|
10
11
|
export { HeatMap } from './HeatMap';
|
|
11
12
|
export { BarStack } from './BarStack';
|
|
@@ -95,10 +95,9 @@ const PickersStartEndDate = ({
|
|
|
95
95
|
changeDate,
|
|
96
96
|
rangeStartDate,
|
|
97
97
|
rangeEndDate,
|
|
98
|
-
direction = PickersStartEndDateDirection.column
|
|
98
|
+
direction = PickersStartEndDateDirection.column,
|
|
99
|
+
className
|
|
99
100
|
}: PickersStartEndDateProps): JSX.Element => {
|
|
100
|
-
const { classes } = useStyles();
|
|
101
|
-
|
|
102
101
|
const locale = useLocale();
|
|
103
102
|
const error = useAtomValue(errorTimePeriodAtom);
|
|
104
103
|
const isError = error || isInvalidDate({ endDate, startDate });
|
|
@@ -108,16 +107,14 @@ const PickersStartEndDate = ({
|
|
|
108
107
|
const maxEnd = rangeEndDate?.max;
|
|
109
108
|
const minEnd = rangeEndDate?.min || startDate;
|
|
110
109
|
|
|
111
|
-
const
|
|
112
|
-
? classes.verticalDirection
|
|
113
|
-
: classes.horizontalDirection;
|
|
110
|
+
const isColumn = equals(direction, PickersStartEndDateDirection.column)
|
|
114
111
|
|
|
115
112
|
return (
|
|
116
113
|
<LocalizationProvider
|
|
117
114
|
adapterLocale={locale.substring(0, 2)}
|
|
118
115
|
dateAdapter={AdapterDayjs}
|
|
119
116
|
>
|
|
120
|
-
<div className={
|
|
117
|
+
<div className={`flex ${isColumn ? 'flex-col justify-center' : 'flex-row items-center py-2 px-4'} gap-2 ${className}`}>
|
|
121
118
|
<PickerDateWithLabel
|
|
122
119
|
changeDate={changeDate}
|
|
123
120
|
date={startDate}
|
|
@@ -143,7 +140,7 @@ const PickersStartEndDate = ({
|
|
|
143
140
|
{isError && (
|
|
144
141
|
<ErrorText
|
|
145
142
|
message="The end date must be greater than the start date"
|
|
146
|
-
style=
|
|
143
|
+
style="text-center"
|
|
147
144
|
/>
|
|
148
145
|
)}
|
|
149
146
|
</LocalizationProvider>
|