@centreon/ui 25.10.13 → 25.10.15

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.10.13",
3
+ "version": "25.10.15",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -340,11 +340,11 @@ const ConnectedAutocompleteField = (
340
340
  );
341
341
 
342
342
  useEffect(() => {
343
- if (!autocompleteChangedValue && !props?.value) {
343
+ if (!autocompleteChangedValue) {
344
344
  return;
345
345
  }
346
346
  setSearchParameter(undefined);
347
- }, [autocompleteChangedValue, props?.value]);
347
+ }, [autocompleteChangedValue]);
348
348
 
349
349
  useEffect(() => {
350
350
  if (!optionsOpen) {
@@ -38,7 +38,8 @@ const ListboxComponent = ({
38
38
  options,
39
39
  isOptionSelected,
40
40
  onChange,
41
- total
41
+ total,
42
+ value = []
42
43
  }) => {
43
44
  if (disableSelectAll) {
44
45
  return;
@@ -54,12 +55,19 @@ const ListboxComponent = ({
54
55
  const syntheticEvent = {} as React.SyntheticEvent;
55
56
 
56
57
  if (allSelected) {
57
- onChange?.(syntheticEvent, [], 'selectOption');
58
+ const remaining = value.filter(
59
+ (v) => !options.some((opt) => opt.id === v.id)
60
+ );
61
+ onChange?.(syntheticEvent, remaining, 'selectOption');
58
62
 
59
63
  return;
60
64
  }
61
65
 
62
- onChange?.(syntheticEvent, options, 'selectOption');
66
+ const merged = [
67
+ ...value,
68
+ ...options.filter((opt) => !isOptionSelected(opt))
69
+ ];
70
+ onChange?.(syntheticEvent, merged, 'selectOption');
63
71
  };
64
72
 
65
73
  return (
@@ -113,7 +113,8 @@ const MultiAutocompleteField = ({
113
113
  onChange,
114
114
  isOptionSelected,
115
115
  disableSelectAll,
116
- options
116
+ options,
117
+ value: values
117
118
  })}
118
119
  onChange={onChange}
119
120
  {...props}
@@ -98,6 +98,7 @@
98
98
  --color-primary-main: #2e68aa;
99
99
  --color-primary-light: #cde7fc;
100
100
  --color-primary-dark: #255891;
101
+ --color-primary-contrastText: #fff;
101
102
  --color-secondary-main: #c772d6;
102
103
  --color-secondary-light: #e5a5f0;
103
104
  --color-secondary-dark: #ac28c1;
@@ -185,6 +186,7 @@
185
186
  --color-primary-main: #6eaff8;
186
187
  --color-primary-light: #8bbff9;
187
188
  --color-primary-dark: #4974a5;
189
+ --color-primary-contrastText: #000;
188
190
  --color-secondary-main: #7c1fa2;
189
191
  --color-status-background-error: #d60101;
190
192
  --color-status-background-none: --alpha(#2e68aa / 10%);