@centreon/ui 25.2.0 → 25.2.2

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.2.0",
3
+ "version": "25.2.2",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -707,7 +707,7 @@ const Listing = <
707
707
  ) : (
708
708
  <EmptyResult
709
709
  label={
710
- labelNoResultFound || t(defaultLabelNoResultFound)
710
+ labelNoResultFound ? t(labelNoResultFound) : t(defaultLabelNoResultFound)
711
711
  }
712
712
  />
713
713
  ))}
@@ -2,7 +2,7 @@ import { useCallback, useState } from 'react';
2
2
 
3
3
  import { Point } from '@visx/point';
4
4
  import { ProvidedZoom, Translate } from '@visx/zoom/lib/types';
5
- import { equals, gt, isNil, pick } from 'ramda';
5
+ import { equals, gt, pick } from 'ramda';
6
6
 
7
7
  import { ZoomState } from './models';
8
8
 
@@ -62,8 +62,8 @@ export const useMinimap = ({
62
62
  );
63
63
 
64
64
  const transformTo = useCallback(
65
- (e): void => {
66
- if (!isNil(e.nativeEvent.which) && !equals(e.nativeEvent.which, 1)) {
65
+ (e: MouseEvent): void => {
66
+ if (!equals(e.buttons, 1)) {
67
67
  return;
68
68
  }
69
69
  const { x, y } = getMatrixPoint(e);
@@ -76,11 +76,8 @@ export const useMinimap = ({
76
76
  [zoom.transformMatrix, scale]
77
77
  );
78
78
 
79
- const dragStart = (e): void => {
80
- if (
81
- (!isNil(e.nativeEvent.which) && !equals(e.nativeEvent.which, 1)) ||
82
- isDraggingFromContainer
83
- ) {
79
+ const dragStart = (e: MouseEvent): void => {
80
+ if (!equals(e.buttons, 1) || isDraggingFromContainer) {
84
81
  return;
85
82
  }
86
83
  setStartPoint(getMatrixPoint(e));
@@ -1,13 +1,13 @@
1
1
  import { useCallback, useState } from 'react';
2
2
 
3
3
  import { Point, ProvidedZoom, Translate } from '@visx/zoom/lib/types';
4
- import { equals, isNil } from 'ramda';
4
+ import { equals } from 'ramda';
5
5
 
6
6
  import { localPoint } from './localPoint';
7
7
  import { ZoomState } from './models';
8
8
 
9
- const isLeftMouseButtonClicked = (e): boolean =>
10
- !isNil(e.nativeEvent.which) && equals(e.nativeEvent.which, 1);
9
+ const isLeftMouseButtonClicked = (e: MouseEvent): boolean =>
10
+ equals(e.buttons, 1);
11
11
 
12
12
  interface UseZoomState {
13
13
  dragEnd: () => void;