@centreon/ui 25.11.9 → 25.11.10
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
|
@@ -81,17 +81,17 @@ const MainLegend = ({
|
|
|
81
81
|
|
|
82
82
|
const contextMenuClick =
|
|
83
83
|
(metricId: number) =>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
(event: MouseEvent): void => {
|
|
85
|
+
if (!secondaryClick) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
secondaryClick({
|
|
90
|
+
element: event.target,
|
|
91
|
+
metricId,
|
|
92
|
+
position: [event.pageX, event.pageY]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
95
|
|
|
96
96
|
const selectMetric = ({
|
|
97
97
|
event,
|
|
@@ -120,16 +120,17 @@ const MainLegend = ({
|
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
122
|
<div
|
|
123
|
-
className={`overflow-x-hidden overflow-y-auto ${!equals(placement, 'bottom') ? 'h-full mt-[15px]' : 'ml-[50px] mr-[40px]'}
|
|
123
|
+
className={`overflow-x-hidden overflow-y-auto ${!equals(placement, 'bottom') ? 'h-full mt-[15px]' : 'ml-[50px] mr-[40px]'}`}
|
|
124
124
|
data-display-side={!equals(placement, 'bottom')}
|
|
125
125
|
>
|
|
126
126
|
<ul
|
|
127
|
-
className={`list-none flex gap-3 w-full ${!isListMode && equals(placement, 'bottom') && 'flex-wrap'} ${isListMode || !equals(placement, 'bottom') ? 'flex-col h-full w-fit' : ''} ${equals(placement, 'bottom') ? 'max-h-17' : 'max-h-
|
|
127
|
+
className={`list-none flex gap-3 w-full overflow-y-auto ${!isListMode && equals(placement, 'bottom') && 'flex-wrap'} ${isListMode || !equals(placement, 'bottom') ? 'flex-col h-full w-fit' : ''} ${equals(placement, 'bottom') ? 'max-h-17' : 'max-h-fit'} ${!equals(placement, 'bottom') ? 'overflow-x-hidden' : ''}`}
|
|
128
128
|
style={{
|
|
129
129
|
height: equals(placement, 'bottom') ? 'auto' : `${graphHeight}px`
|
|
130
130
|
}}
|
|
131
131
|
data-as-list={isListMode || !equals(placement, 'bottom')}
|
|
132
132
|
data-mode={itemMode}
|
|
133
|
+
data-legend
|
|
133
134
|
>
|
|
134
135
|
{displayedLines.map((line) => {
|
|
135
136
|
const { color, display, metric_id, unit } = line;
|
|
@@ -155,7 +156,7 @@ const MainLegend = ({
|
|
|
155
156
|
|
|
156
157
|
return (
|
|
157
158
|
<li
|
|
158
|
-
className={`${!display ? 'text-text-disabled' : 'text-text-primary'} flex gap-1 ${toggable && 'cursor-pointer'}`}
|
|
159
|
+
className={`${!display ? 'text-text-disabled' : 'text-text-primary'} flex gap-1 ${toggable && 'cursor-pointer'} ${!equals(placement, 'bottom') ? 'w-fit' : ''}`}
|
|
159
160
|
key={metric_id}
|
|
160
161
|
onClick={(event): void => selectMetric({ event, metric_id })}
|
|
161
162
|
onKeyUp={(event) =>
|