@centreon/ui 26.3.18 → 26.3.19

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": "26.3.18",
3
+ "version": "26.3.19",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -327,7 +327,8 @@ export const basicFormInputs: Array<InputProps> = [
327
327
  {
328
328
  connectedAutocomplete: {
329
329
  additionalConditionParameters: [],
330
- endpoint: 'endpoint'
330
+ endpoint: 'endpoint',
331
+ helperText: 'Hello I am testing'
331
332
  },
332
333
  fieldName: 'group',
333
334
  label: 'Group (Single connected autocomplete)',
@@ -18,7 +18,8 @@ import {
18
18
  type ForwardedRef,
19
19
  forwardRef,
20
20
  type HTMLAttributes,
21
- type ReactElement
21
+ type ReactElement,
22
+ ReactNode
22
23
  } from 'react';
23
24
  import { useTranslation } from 'react-i18next';
24
25
 
@@ -32,6 +33,7 @@ import { useAutoCompleteStyles } from './autoComplete.styles';
32
33
  export type Props = {
33
34
  autoFocus?: boolean;
34
35
  autoSize?: boolean;
36
+ helperText?: ReactNode;
35
37
  autoSizeCustomPadding?: number;
36
38
  autoSizeDefaultWidth?: number;
37
39
  dataTestId?: string;
@@ -95,6 +97,7 @@ const AutocompleteField = forwardRef(
95
97
  displayPopupIcon = true,
96
98
  autoFocus = false,
97
99
  hideInput = false,
100
+ helperText,
98
101
  dataTestId,
99
102
  autoSize = false,
100
103
  autoSizeDefaultWidth = 0,
@@ -151,6 +154,7 @@ const AutocompleteField = forwardRef(
151
154
  }}
152
155
  error={error}
153
156
  externalValueForAutoSize={autocompleteProps?.value?.name}
157
+ helperText={helperText}
154
158
  label={label}
155
159
  onChange={onTextChange}
156
160
  placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
@@ -123,6 +123,7 @@ const TextField = forwardRef(
123
123
  type,
124
124
  textFieldSlotsAndSlotProps,
125
125
  forceUncontrolled,
126
+ helperText,
126
127
  ...rest
127
128
  }: TextProps,
128
129
  ref: React.ForwardedRef<HTMLDivElement>
@@ -160,7 +161,9 @@ const TextField = forwardRef(
160
161
  <MuiTextField
161
162
  data-testid={dataTestId}
162
163
  error={!isNil(error)}
163
- helperText={displayErrorInTooltip ? undefined : error}
164
+ helperText={
165
+ (displayErrorInTooltip ? undefined : error) || helperText
166
+ }
164
167
  id={getNormalizedId(dataTestId || '')}
165
168
  label={label}
166
169
  onChange={changeInputValue}
@@ -18,11 +18,14 @@ export const useViewportIntersection = (
18
18
  const [element, setElement] = useState<HTMLElement | null>(null);
19
19
 
20
20
  const observer = useRef<IntersectionObserver | null>(null);
21
-
21
+
22
22
  const sanitizedOptions = {
23
23
  ...options,
24
- root: options?.root instanceof HTMLElement ? `${options.root.tagName}_${options.root.className}` : null
25
- }
24
+ root:
25
+ options?.root instanceof HTMLElement
26
+ ? `${options.root.tagName}_${options.root.className}`
27
+ : null
28
+ };
26
29
 
27
30
  useEffect(() => {
28
31
  if (observer.current) {