@dartech/arsenal-ui 1.4.71 → 1.4.72
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -3
- package/package.json +1 -1
- package/src/lib/Forms/ControlPhoneInput.d.ts +2 -1
package/index.js
CHANGED
@@ -3294,9 +3294,10 @@ const ControlPhoneInput = _a => {
|
|
3294
3294
|
mask = '+7 (799) 999 99 99',
|
3295
3295
|
requiredErrorText = '',
|
3296
3296
|
inputMaskProps,
|
3297
|
-
disabled
|
3297
|
+
disabled,
|
3298
|
+
invalidErrorText
|
3298
3299
|
} = _a,
|
3299
|
-
textFieldProps = __rest(_a, ["control", "name", "label", "required", "mask", "requiredErrorText", "inputMaskProps", "disabled"]);
|
3300
|
+
textFieldProps = __rest(_a, ["control", "name", "label", "required", "mask", "requiredErrorText", "inputMaskProps", "disabled", "invalidErrorText"]);
|
3300
3301
|
return jsx(Controller, {
|
3301
3302
|
control: control,
|
3302
3303
|
name: name,
|
@@ -3307,7 +3308,7 @@ const ControlPhoneInput = _a => {
|
|
3307
3308
|
return true;
|
3308
3309
|
}
|
3309
3310
|
if (!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(val)) {
|
3310
|
-
return 'Incorrect phone number format';
|
3311
|
+
return invalidErrorText || 'Incorrect phone number format';
|
3311
3312
|
}
|
3312
3313
|
return true;
|
3313
3314
|
}
|
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;
|