@centreon/ui 24.4.46 → 24.4.47

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.46",
3
+ "version": "24.4.47",
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 { DialogContentText, Typography } from '@mui/material';
1
+ import { ButtonProps, DialogContentText, Typography } from '@mui/material';
2
2
 
3
3
  import Dialog, { Props as DialogProps } from '..';
4
4
 
@@ -6,15 +6,23 @@ type Props = DialogProps & {
6
6
  children?: JSX.Element;
7
7
  labelMessage?: string | null;
8
8
  labelSecondMessage?: string | null;
9
+ restCancelButtonProps?: ButtonProps;
10
+ restConfirmButtonProps?: ButtonProps;
9
11
  };
10
12
 
11
13
  const Confirm = ({
12
14
  labelMessage,
13
15
  labelSecondMessage,
14
16
  children,
17
+ restCancelButtonProps,
18
+ restConfirmButtonProps,
15
19
  ...rest
16
20
  }: Props): JSX.Element => (
17
- <Dialog {...rest}>
21
+ <Dialog
22
+ restCancelButtonProps={restCancelButtonProps}
23
+ restConfirmButtonProps={restConfirmButtonProps}
24
+ {...rest}
25
+ >
18
26
  <DialogContentText>
19
27
  {labelMessage && <Typography>{labelMessage}</Typography>}
20
28
  {labelSecondMessage && <Typography>{labelSecondMessage}</Typography>}
@@ -9,7 +9,8 @@ import {
9
9
  DialogContent,
10
10
  DialogActions,
11
11
  DialogProps,
12
- CircularProgress
12
+ CircularProgress,
13
+ ButtonProps
13
14
  } from '@mui/material';
14
15
 
15
16
  import { DataTestAttributes } from '../@types/data-attributes';
@@ -48,6 +49,8 @@ export type Props = {
48
49
  onClose?: () => void;
49
50
  onConfirm: (event, value?) => void;
50
51
  open: boolean;
52
+ restCancelButtonProps?: ButtonProps;
53
+ restConfirmButtonProps?: ButtonProps;
51
54
  submitting?: boolean;
52
55
  } & DialogProps &
53
56
  DataTestAttributes;
@@ -70,6 +73,8 @@ const Dialog = ({
70
73
  dialogContentClassName,
71
74
  dialogActionsClassName,
72
75
  dialogConfirmButtonClassName,
76
+ restCancelButtonProps,
77
+ restConfirmButtonProps,
73
78
  ...rest
74
79
  }: Props): JSX.Element => {
75
80
  const { classes, cx } = useStyles({ contentWidth });
@@ -101,6 +106,7 @@ const Dialog = ({
101
106
  data-testid="Cancel"
102
107
  disabled={cancelDisabled}
103
108
  onClick={onCancel}
109
+ {...restCancelButtonProps}
104
110
  >
105
111
  {labelCancel}
106
112
  </Button>
@@ -113,6 +119,7 @@ const Dialog = ({
113
119
  disabled={confirmDisabled}
114
120
  endIcon={submitting && <CircularProgress size={15} />}
115
121
  onClick={onConfirm}
122
+ {...restConfirmButtonProps}
116
123
  >
117
124
  {labelConfirm}
118
125
  </Button>