@centreon/ui 25.11.8 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "25.11.8",
3
+ "version": "25.11.10",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -101,6 +101,10 @@ const BarChart = ({
101
101
  );
102
102
  }
103
103
 
104
+ if (!adjustedData) {
105
+ return <div />;
106
+ }
107
+
104
108
  return (
105
109
  <Provider>
106
110
  <Box ref={ref} sx={{ height: '100%', overflow: 'hidden', width: '100%' }}>
@@ -81,17 +81,17 @@ const MainLegend = ({
81
81
 
82
82
  const contextMenuClick =
83
83
  (metricId: number) =>
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
- };
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]'} legend`}
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-0'}`}
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) =>
@@ -102,6 +102,10 @@ const WrapperChart = ({
102
102
  );
103
103
  }
104
104
 
105
+ if (!adjustedData) {
106
+ return <div />;
107
+ }
108
+
105
109
  return (
106
110
  <div
107
111
  ref={ref}