@centreon/ui 25.1.10 → 25.1.12

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.1.10",
3
+ "version": "25.1.12",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -1,4 +1,9 @@
1
- import { ButtonProps, DialogContentText, DialogContentTextProps, Typography } from '@mui/material';
1
+ import {
2
+ ButtonProps,
3
+ DialogContentText,
4
+ DialogContentTextProps,
5
+ Typography
6
+ } from '@mui/material';
2
7
 
3
8
  import Dialog, { Props as DialogProps } from '..';
4
9
 
@@ -8,7 +13,7 @@ type Props = DialogProps & {
8
13
  labelSecondMessage?: string | null;
9
14
  restCancelButtonProps?: ButtonProps;
10
15
  restConfirmButtonProps?: ButtonProps;
11
- dialogContentTextProps?:DialogContentTextProps
16
+ dialogContentTextProps?: DialogContentTextProps;
12
17
  };
13
18
 
14
19
  const Confirm = ({
@@ -38,7 +38,7 @@ export type Props = {
38
38
  className?: string;
39
39
  confirmDisabled?: boolean;
40
40
  contentWidth?: number;
41
- dialogTitleProps?:DialogTitleProps
41
+ dialogTitleProps?: DialogTitleProps;
42
42
  dialogActionsClassName?: string;
43
43
  dialogConfirmButtonClassName?: string;
44
44
  dialogContentClassName?: string;
@@ -93,7 +93,9 @@ const Dialog = ({
93
93
  {...rest}
94
94
  >
95
95
  {labelTitle && (
96
- <DialogTitle className={dialogTitleClassName} {...dialogTitleProps}>{labelTitle}</DialogTitle>
96
+ <DialogTitle className={dialogTitleClassName} {...dialogTitleProps}>
97
+ {labelTitle}
98
+ </DialogTitle>
97
99
  )}
98
100
  {children && (
99
101
  <DialogContent
@@ -183,10 +183,10 @@ const DraggableAutocomplete = (
183
183
  helperText={error}
184
184
  textFieldSlotsAndSlotProps={{
185
185
  slotProps: {
186
- input:{
186
+ input: {
187
187
  ...renderProps?.InputProps
188
188
  },
189
- inputLabel:{
189
+ inputLabel: {
190
190
  ...renderProps?.inputLabel
191
191
  },
192
192
  htmlInput: {
@@ -60,8 +60,10 @@ export const useOptimisticMutation = <T, TMeta>({
60
60
  }: GetOptimisticMutationListingProps<T, TMeta>): object => {
61
61
  const listingQueryKey = getListingQueryKey();
62
62
 
63
- const updatedPayload = payload && 'id' in payload ? payload :{...payload, id: optimisticListing?.total}
64
-
63
+ const updatedPayload =
64
+ payload && 'id' in payload
65
+ ? payload
66
+ : { ...payload, id: (optimisticListing?.total ?? 0) + 1 };
65
67
 
66
68
  const hasOnlyOnePage =
67
69
  (optimisticListing?.total || 0) <= (optimisticListing?.limit || 0);
@@ -7,7 +7,9 @@ import {
7
7
  Accordion,
8
8
  AccordionDetails,
9
9
  AccordionSummary,
10
- Typography
10
+ AccordionSummaryProps,
11
+ Typography,
12
+ TypographyProps
11
13
  } from '@mui/material';
12
14
 
13
15
  import { useCollapsibleItemStyles } from './useCollapsibleItemStyles';
@@ -18,6 +20,7 @@ export interface Props {
18
20
  dataTestId?: string;
19
21
  defaultExpanded?: boolean;
20
22
  title: string | JSX.Element;
23
+ titleProps?: TypographyProps;
21
24
  }
22
25
 
23
26
  export const CollapsibleItem = ({
@@ -25,8 +28,10 @@ export const CollapsibleItem = ({
25
28
  children,
26
29
  defaultExpanded,
27
30
  compact = false,
28
- dataTestId = ''
29
- }: Props): JSX.Element => {
31
+ dataTestId = '',
32
+ titleProps,
33
+ ...rest
34
+ }: Props & AccordionSummaryProps): JSX.Element => {
30
35
  const { classes, cx } = useCollapsibleItemStyles();
31
36
 
32
37
  const isStringTitle = equals(type(title), 'String');
@@ -56,9 +61,10 @@ export const CollapsibleItem = ({
56
61
  }}
57
62
  data-testid={`${dataTestId}-summary`}
58
63
  expandIcon={<ExpandMoreIcon color="primary" />}
64
+ {...rest}
59
65
  >
60
66
  {isStringTitle && (
61
- <Typography color="primary" variant="h6">
67
+ <Typography color="primary" variant="h6" {...titleProps}>
62
68
  {title}
63
69
  </Typography>
64
70
  )}