@centreon/ui 23.10.34 → 23.10.36
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
package/src/Dialog/index.tsx
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
CircularProgress
|
|
13
13
|
} from '@mui/material';
|
|
14
14
|
|
|
15
|
+
import { DataTestAttributes } from '../@types/data-attributes';
|
|
16
|
+
|
|
15
17
|
interface StylesProps {
|
|
16
18
|
contentWidth?: number;
|
|
17
19
|
}
|
|
@@ -47,7 +49,8 @@ export type Props = {
|
|
|
47
49
|
onConfirm: (event, value?) => void;
|
|
48
50
|
open: boolean;
|
|
49
51
|
submitting?: boolean;
|
|
50
|
-
} & DialogProps
|
|
52
|
+
} & DialogProps &
|
|
53
|
+
DataTestAttributes;
|
|
51
54
|
|
|
52
55
|
const Dialog = ({
|
|
53
56
|
open,
|
|
@@ -95,7 +98,7 @@ const Dialog = ({
|
|
|
95
98
|
{onCancel && (
|
|
96
99
|
<Button
|
|
97
100
|
color="primary"
|
|
98
|
-
data-testid="
|
|
101
|
+
data-testid="Cancel"
|
|
99
102
|
disabled={cancelDisabled}
|
|
100
103
|
onClick={onCancel}
|
|
101
104
|
>
|
|
@@ -106,7 +109,7 @@ const Dialog = ({
|
|
|
106
109
|
aria-label={labelConfirm || ''}
|
|
107
110
|
className={dialogConfirmButtonClassName}
|
|
108
111
|
color="primary"
|
|
109
|
-
data-testid="
|
|
112
|
+
data-testid="Confirm"
|
|
110
113
|
disabled={confirmDisabled}
|
|
111
114
|
endIcon={submitting && <CircularProgress size={15} />}
|
|
112
115
|
onClick={onConfirm}
|
package/src/Form/Inputs/Text.tsx
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
type as variableType
|
|
13
13
|
} from 'ramda';
|
|
14
14
|
|
|
15
|
+
import { InputAdornment } from '@mui/material';
|
|
16
|
+
|
|
15
17
|
import { TextField, useMemoComponent } from '../..';
|
|
16
18
|
|
|
17
19
|
import PasswordEndAdornment from './PasswordEndAdornment';
|
|
@@ -64,16 +66,24 @@ const Text = ({
|
|
|
64
66
|
? path(fieldNamePath, errors)
|
|
65
67
|
: undefined;
|
|
66
68
|
|
|
67
|
-
const
|
|
68
|
-
(
|
|
69
|
-
|
|
69
|
+
const EndAdornment = useCallback((): JSX.Element | null => {
|
|
70
|
+
if (equals(type, InputType.Password)) {
|
|
71
|
+
return (
|
|
70
72
|
<PasswordEndAdornment
|
|
71
73
|
changeVisibility={changeVisibility}
|
|
72
74
|
isVisible={isVisible}
|
|
73
75
|
/>
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (text?.endAdornment) {
|
|
80
|
+
return (
|
|
81
|
+
<InputAdornment position="end">{text?.endAdornment}</InputAdornment>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return null;
|
|
86
|
+
}, [isVisible]);
|
|
77
87
|
|
|
78
88
|
const getInputType = (): string => {
|
|
79
89
|
if (text?.type) {
|
|
@@ -97,13 +107,14 @@ const Text = ({
|
|
|
97
107
|
Component: (
|
|
98
108
|
<TextField
|
|
99
109
|
fullWidth
|
|
100
|
-
EndAdornment={
|
|
110
|
+
EndAdornment={EndAdornment}
|
|
101
111
|
ariaLabel={t(label) || ''}
|
|
102
112
|
dataTestId={dataTestId || ''}
|
|
103
113
|
disabled={disabled}
|
|
104
114
|
error={error as string | undefined}
|
|
105
115
|
label={t(label)}
|
|
106
116
|
multiline={isMultiline}
|
|
117
|
+
placeholder={text?.placeholder}
|
|
107
118
|
required={isRequired}
|
|
108
119
|
rows={rows}
|
|
109
120
|
type={getInputType()}
|
|
@@ -35,7 +35,6 @@ export const getInput = R.cond<
|
|
|
35
35
|
R.equals(InputType.Radio) as (b: InputType) => boolean,
|
|
36
36
|
R.always(RadioInput)
|
|
37
37
|
],
|
|
38
|
-
[R.equals(InputType.Text) as (b: InputType) => boolean, R.always(TextInput)],
|
|
39
38
|
[
|
|
40
39
|
R.equals(InputType.SingleAutocomplete) as (b: InputType) => boolean,
|
|
41
40
|
R.always(Autocomplete)
|
|
@@ -44,10 +43,6 @@ export const getInput = R.cond<
|
|
|
44
43
|
R.equals(InputType.MultiAutocomplete) as (b: InputType) => boolean,
|
|
45
44
|
R.always(Autocomplete)
|
|
46
45
|
],
|
|
47
|
-
[
|
|
48
|
-
R.equals(InputType.Password) as (b: InputType) => boolean,
|
|
49
|
-
R.always(TextInput)
|
|
50
|
-
],
|
|
51
46
|
[
|
|
52
47
|
R.equals(InputType.MultiConnectedAutocomplete) as (b: InputType) => boolean,
|
|
53
48
|
R.always(ConnectedAutocomplete)
|
|
@@ -71,7 +66,8 @@ export const getInput = R.cond<
|
|
|
71
66
|
[
|
|
72
67
|
R.equals(InputType.CheckboxGroup) as (b: InputType) => boolean,
|
|
73
68
|
R.always(CheckboxGroup)
|
|
74
|
-
]
|
|
69
|
+
],
|
|
70
|
+
[R.T, R.always(TextInput)]
|
|
75
71
|
]);
|
|
76
72
|
|
|
77
73
|
interface StylesProps {
|
package/src/Form/storiesData.tsx
CHANGED