@dartech/arsenal-ui 1.4.71 → 1.4.73
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +13 -25
- package/package.json +1 -1
- package/src/lib/Forms/ControlPhoneInput.d.ts +2 -1
package/index.js
CHANGED
@@ -903,20 +903,12 @@ const ControlAutocomplete = _a => {
|
|
903
903
|
helperText: !hideErrorMessage && (error === null || error === void 0 ? void 0 : error.message),
|
904
904
|
FormHelperTextProps: {
|
905
905
|
variant: 'standard'
|
906
|
-
}
|
907
|
-
}, startAdornment ? {
|
908
|
-
InputProps: Object.assign(Object.assign({}, params.InputProps), {
|
909
|
-
startAdornment: jsxs(Fragment, {
|
910
|
-
children: [startAdornment, params.InputProps.startAdornment]
|
911
|
-
})
|
912
|
-
})
|
913
|
-
} : {}, endAdornment ? {
|
906
|
+
},
|
914
907
|
InputProps: Object.assign(Object.assign({}, params.InputProps), {
|
915
|
-
|
916
|
-
|
917
|
-
})
|
908
|
+
startAdornment: startAdornment ? startAdornment : params.InputProps.startAdornment,
|
909
|
+
endAdornment: endAdornment ? endAdornment : params.InputProps.endAdornment
|
918
910
|
})
|
919
|
-
}
|
911
|
+
}, textFieldProps));
|
920
912
|
}
|
921
913
|
}, autocompleteProps));
|
922
914
|
};
|
@@ -1120,20 +1112,15 @@ function ControlQueryAutocomplete(_a) {
|
|
1120
1112
|
FormHelperTextProps: {
|
1121
1113
|
variant: 'standard'
|
1122
1114
|
},
|
1123
|
-
InputProps: Object.assign(Object.assign(
|
1124
|
-
endAdornment: endAdornment ? jsxs(React.Fragment, {
|
1115
|
+
InputProps: Object.assign(Object.assign({}, params.InputProps), {
|
1116
|
+
endAdornment: endAdornment ? endAdornment : jsxs(React.Fragment, {
|
1125
1117
|
children: [isFetching ? jsx(CircularProgress, {
|
1126
1118
|
color: "inherit",
|
1127
1119
|
size: 20
|
1128
1120
|
}) : null, params.InputProps.endAdornment]
|
1129
|
-
})
|
1130
|
-
|
1131
|
-
|
1132
|
-
}), startAdornment ? {
|
1133
|
-
startAdornment: jsxs(Fragment, {
|
1134
|
-
children: [startAdornment, params.InputProps.startAdornment]
|
1135
|
-
})
|
1136
|
-
} : {})
|
1121
|
+
}),
|
1122
|
+
startAdornment: startAdornment ? startAdornment : params.InputProps.startAdornment
|
1123
|
+
})
|
1137
1124
|
}, textFieldProps))
|
1138
1125
|
}, autocompleteProps));
|
1139
1126
|
}
|
@@ -3294,9 +3281,10 @@ const ControlPhoneInput = _a => {
|
|
3294
3281
|
mask = '+7 (799) 999 99 99',
|
3295
3282
|
requiredErrorText = '',
|
3296
3283
|
inputMaskProps,
|
3297
|
-
disabled
|
3284
|
+
disabled,
|
3285
|
+
invalidErrorText
|
3298
3286
|
} = _a,
|
3299
|
-
textFieldProps = __rest(_a, ["control", "name", "label", "required", "mask", "requiredErrorText", "inputMaskProps", "disabled"]);
|
3287
|
+
textFieldProps = __rest(_a, ["control", "name", "label", "required", "mask", "requiredErrorText", "inputMaskProps", "disabled", "invalidErrorText"]);
|
3300
3288
|
return jsx(Controller, {
|
3301
3289
|
control: control,
|
3302
3290
|
name: name,
|
@@ -3307,7 +3295,7 @@ const ControlPhoneInput = _a => {
|
|
3307
3295
|
return true;
|
3308
3296
|
}
|
3309
3297
|
if (!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(val)) {
|
3310
|
-
return 'Incorrect phone number format';
|
3298
|
+
return invalidErrorText || 'Incorrect phone number format';
|
3311
3299
|
}
|
3312
3300
|
return true;
|
3313
3301
|
}
|
package/package.json
CHANGED
@@ -9,8 +9,9 @@ type Props = TextFieldProps & {
|
|
9
9
|
mask?: string;
|
10
10
|
label?: ReactNode;
|
11
11
|
requiredErrorText?: string;
|
12
|
+
invalidErrorText?: string;
|
12
13
|
disabled?: boolean;
|
13
14
|
inputMaskProps?: InputMaskProps;
|
14
15
|
};
|
15
|
-
export declare const ControlPhoneInput: ({ control, name, label, required, mask, requiredErrorText, inputMaskProps, disabled, ...textFieldProps }: Props) => JSX.Element;
|
16
|
+
export declare const ControlPhoneInput: ({ control, name, label, required, mask, requiredErrorText, inputMaskProps, disabled, invalidErrorText, ...textFieldProps }: Props) => JSX.Element;
|
16
17
|
export default ControlPhoneInput;
|