@centreon/ui 24.4.1-MON-develop-BOOSTER.1 → 24.4.1-MON-24235-Filter-App-token.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": "24.4.1-MON-develop-BOOSTER.1",
3
+ "version": "24.4.1-MON-24235-Filter-App-token.15",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -1,4 +1,4 @@
1
- import { includes, map, prop, reject } from 'ramda';
1
+ import { includes, map, prop, reject, sortBy, toLower, compose } from 'ramda';
2
2
  import { makeStyles } from 'tss-react/mui';
3
3
 
4
4
  import { Chip, ChipProps, Tooltip } from '@mui/material';
@@ -85,9 +85,11 @@ const MultiAutocompleteField = ({
85
85
  return includes(id, valueIds);
86
86
  };
87
87
 
88
+ const sortByName = sortBy(compose(toLower, prop('name')));
89
+
88
90
  const autocompleteOptions = disableSortedOptions
89
91
  ? options
90
- : [...values, ...reject(isOptionSelected, options)];
92
+ : sortByName([...values, ...reject(isOptionSelected, options)]);
91
93
 
92
94
  return (
93
95
  <Autocomplete
@@ -216,7 +216,8 @@ const AutocompleteField = React.forwardRef(
216
216
  ...params.inputProps,
217
217
  'aria-label': label,
218
218
  'data-testid': dataTestId || label,
219
- id: getNormalizedId(label || '')
219
+ id: getNormalizedId(label || ''),
220
+ ...autocompleteProps?.inputProps
220
221
  }}
221
222
  label={label}
222
223
  placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
@@ -1,10 +1,10 @@
1
1
  import { ForwardedRef, forwardRef, ReactElement, ReactNode } from 'react';
2
2
 
3
- import { ListItem as MuiListItem } from '@mui/material';
3
+ import { ListItemProps, ListItem as MuiListItem } from '@mui/material';
4
4
 
5
5
  import { useStyles } from './ListItem.styles';
6
6
 
7
- type ListItemProps = {
7
+ type Props = {
8
8
  action?: ReactElement;
9
9
  children: ReactNode | Array<ReactNode>;
10
10
  className?: string;
@@ -12,7 +12,7 @@ type ListItemProps = {
12
12
 
13
13
  export const ListItem = forwardRef(
14
14
  (
15
- { action, children, className, ...attr }: ListItemProps,
15
+ { action, children, className, ...attr }: Props & ListItemProps,
16
16
  ref?: ForwardedRef<HTMLLIElement>
17
17
  ) => {
18
18
  const { classes, cx } = useStyles();