@tap-payments/auth-jsconnect 2.10.18-development → 2.10.20-development
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/build/@types/form.d.ts +0 -1
- package/build/features/app/auth/authStore.js +6 -7
- package/build/features/app/connectExpress/connectExpressStore.js +7 -9
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +8 -14
- package/build/features/auth/screens/AuthenticationList/EntityList.js +0 -2
- package/build/features/auth/screens/AuthenticationList/validation.d.ts +0 -22
- package/build/features/auth/screens/AuthenticationList/validation.js +1 -77
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +9 -14
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -22
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +1 -77
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +2 -2
- package/package.json +1 -1
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.d.ts +0 -35
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.js +0 -80
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.d.ts +0 -35
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.js +0 -80
package/build/@types/form.d.ts
CHANGED
|
@@ -753,13 +753,13 @@ export var getMerchantList = createAsyncThunk('auth/getMerchantList', function (
|
|
|
753
753
|
});
|
|
754
754
|
});
|
|
755
755
|
export var createEntity = createAsyncThunk('auth/createEntity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
756
|
-
var settings, brandInfo, legalName, licenseNumber, licenseType,
|
|
756
|
+
var settings, brandInfo, legalName, licenseNumber, licenseType, body, data;
|
|
757
757
|
var _a;
|
|
758
758
|
return __generator(this, function (_b) {
|
|
759
759
|
switch (_b.label) {
|
|
760
760
|
case 0:
|
|
761
761
|
settings = thunkApi.getState().settings;
|
|
762
|
-
brandInfo = params.brandInfo, legalName = params.legalName, licenseNumber = params.licenseNumber, licenseType = params.licenseType
|
|
762
|
+
brandInfo = params.brandInfo, legalName = params.legalName, licenseNumber = params.licenseNumber, licenseType = params.licenseType;
|
|
763
763
|
body = {
|
|
764
764
|
business_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) || '',
|
|
765
765
|
entity: {
|
|
@@ -767,11 +767,10 @@ export var createEntity = createAsyncThunk('auth/createEntity', function (params
|
|
|
767
767
|
en: legalName || '',
|
|
768
768
|
ar: legalName || ''
|
|
769
769
|
},
|
|
770
|
-
license:
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
})),
|
|
770
|
+
license: {
|
|
771
|
+
number: licenseNumber || '',
|
|
772
|
+
type: licenseType || ''
|
|
773
|
+
},
|
|
775
774
|
country: (_a = settings.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
|
|
776
775
|
}
|
|
777
776
|
};
|
|
@@ -1015,13 +1015,13 @@ export var retrieveDetailsAfterCreateAccountAsync = createAsyncThunk('connectExp
|
|
|
1015
1015
|
});
|
|
1016
1016
|
}); });
|
|
1017
1017
|
export var createEntity = createAsyncThunk('connectExpress/createEntity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1018
|
-
var settings, brandInfo, legalName, licenseNumber, licenseType,
|
|
1018
|
+
var settings, brandInfo, legalName, licenseNumber, licenseType, body, data;
|
|
1019
1019
|
var _a;
|
|
1020
1020
|
return __generator(this, function (_b) {
|
|
1021
1021
|
switch (_b.label) {
|
|
1022
1022
|
case 0:
|
|
1023
1023
|
settings = thunkApi.getState().settings;
|
|
1024
|
-
brandInfo = params.brandInfo, legalName = params.legalName, licenseNumber = params.licenseNumber, licenseType = params.licenseType
|
|
1024
|
+
brandInfo = params.brandInfo, legalName = params.legalName, licenseNumber = params.licenseNumber, licenseType = params.licenseType;
|
|
1025
1025
|
body = {
|
|
1026
1026
|
business_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) || '',
|
|
1027
1027
|
entity: {
|
|
@@ -1029,11 +1029,10 @@ export var createEntity = createAsyncThunk('connectExpress/createEntity', functi
|
|
|
1029
1029
|
en: legalName || '',
|
|
1030
1030
|
ar: legalName || ''
|
|
1031
1031
|
},
|
|
1032
|
-
license:
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
})),
|
|
1032
|
+
license: {
|
|
1033
|
+
number: licenseNumber || '',
|
|
1034
|
+
type: licenseType || ''
|
|
1035
|
+
},
|
|
1037
1036
|
country: (_a = settings.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
|
|
1038
1037
|
}
|
|
1039
1038
|
};
|
|
@@ -1487,8 +1486,7 @@ var initialState = {
|
|
|
1487
1486
|
},
|
|
1488
1487
|
authenticationData: {
|
|
1489
1488
|
brandInfo: undefined,
|
|
1490
|
-
entityInfo: undefined
|
|
1491
|
-
unifiedNumber: ''
|
|
1489
|
+
entityInfo: undefined
|
|
1492
1490
|
},
|
|
1493
1491
|
authMerchantData: {
|
|
1494
1492
|
merchantInfo: undefined
|
|
@@ -17,19 +17,17 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { deepCopy,
|
|
21
|
-
import { LicenseType as LType } from '../../../../@types';
|
|
20
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
22
21
|
import Form from '../../../../components/Form';
|
|
23
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
23
|
import Button from '../../../shared/Button';
|
|
25
24
|
import { clearError, authSelector, createEntity, resetAuthenticationScreen, getMerchantList } from '../../../app/auth/authStore';
|
|
26
|
-
import { AuthenticationListValidationSchema
|
|
25
|
+
import { AuthenticationListValidationSchema } from './validation';
|
|
27
26
|
import BrandList from './BrandList';
|
|
28
27
|
import EntityList from './EntityList';
|
|
29
28
|
import EntityLegalName from './EntityLegalName';
|
|
30
29
|
import LicenseNumber from './LicenseNumber';
|
|
31
30
|
import LicenseType from './EntityLicenseType';
|
|
32
|
-
import UnifiedNumber from './UnifiedNumber';
|
|
33
31
|
var ListType;
|
|
34
32
|
(function (ListType) {
|
|
35
33
|
ListType["BrandList"] = "BrandList";
|
|
@@ -38,11 +36,10 @@ var ListType;
|
|
|
38
36
|
var AuthenticationList = function (_a) {
|
|
39
37
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
40
38
|
var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
41
|
-
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo
|
|
39
|
+
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo;
|
|
42
40
|
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
43
41
|
var brandList = (data.responseData || {}).brandList;
|
|
44
42
|
var _e = React.useState(false), isAddEntity = _e[0], setIsAddEntity = _e[1];
|
|
45
|
-
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
46
43
|
React.useEffect(function () {
|
|
47
44
|
sendCustomEventToGTM({
|
|
48
45
|
event: 'Send Event',
|
|
@@ -51,22 +48,20 @@ var AuthenticationList = function (_a) {
|
|
|
51
48
|
});
|
|
52
49
|
}, []);
|
|
53
50
|
var methods = useForm({
|
|
54
|
-
resolver: yupResolver(
|
|
51
|
+
resolver: yupResolver(AuthenticationListValidationSchema),
|
|
55
52
|
defaultValues: {
|
|
56
53
|
brandInfo: brandInfo,
|
|
57
|
-
entityInfo: entityInfo
|
|
58
|
-
unifiedNumber: unifiedNumber
|
|
54
|
+
entityInfo: entityInfo
|
|
59
55
|
},
|
|
60
56
|
mode: 'onChange'
|
|
61
57
|
});
|
|
62
58
|
var t = useTranslation().t;
|
|
63
59
|
var isAr = useLanguage().isAr;
|
|
64
60
|
var dispatch = useAppDispatch();
|
|
65
|
-
var isCR = methods.watch('licenseType') === LType.CR;
|
|
66
61
|
var onSubmit = function (formData) {
|
|
67
62
|
if (isAddEntity) {
|
|
68
|
-
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType
|
|
69
|
-
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType
|
|
63
|
+
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
|
|
64
|
+
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
|
|
70
65
|
dispatch(createEntity(deepCopy(data_1)));
|
|
71
66
|
return;
|
|
72
67
|
}
|
|
@@ -77,7 +72,6 @@ var AuthenticationList = function (_a) {
|
|
|
77
72
|
setIsAddEntity(false);
|
|
78
73
|
methods.setValue('licenseNumber', '');
|
|
79
74
|
methods.setValue('legalName', '');
|
|
80
|
-
methods.setValue('unifiedNumber', '');
|
|
81
75
|
methods.setValue('licenseType', '');
|
|
82
76
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
83
77
|
return;
|
|
@@ -97,6 +91,6 @@ var AuthenticationList = function (_a) {
|
|
|
97
91
|
};
|
|
98
92
|
var isBrandList = listActive === ListType.BrandList;
|
|
99
93
|
var isEntityList = listActive === ListType.EntityList;
|
|
100
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}),
|
|
94
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
101
95
|
};
|
|
102
96
|
export default React.memo(AuthenticationList);
|
|
@@ -82,7 +82,6 @@ var EntityList = function (_a) {
|
|
|
82
82
|
if (filteredEntityList.length) {
|
|
83
83
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
84
84
|
setValue('licenseNumber', '');
|
|
85
|
-
setValue('unifiedNumber', '');
|
|
86
85
|
setValue('licenseType', '');
|
|
87
86
|
setValue('legalName', '');
|
|
88
87
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -126,7 +125,6 @@ var EntityList = function (_a) {
|
|
|
126
125
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
127
126
|
else {
|
|
128
127
|
setValue('licenseNumber', '');
|
|
129
|
-
setValue('unifiedNumber', '');
|
|
130
128
|
setValue('legalName', '');
|
|
131
129
|
setValue('licenseType', '');
|
|
132
130
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const AuthenticationListSAValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
|
-
entityInfo: any;
|
|
5
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
11
|
-
entityInfo: any;
|
|
12
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
18
|
-
entityInfo: any;
|
|
19
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
20
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
22
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
|
-
}>>>;
|
|
24
2
|
export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
25
3
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
26
4
|
entityInfo: any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME
|
|
3
|
-
import { LicenseType } from '../../../../@types';
|
|
2
|
+
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME } from '../../../../constants';
|
|
4
3
|
var objectElements = {
|
|
5
4
|
id: yup.string().required(),
|
|
6
5
|
business_id: yup.string(),
|
|
@@ -12,81 +11,6 @@ var objectElements = {
|
|
|
12
11
|
number: yup.string()
|
|
13
12
|
})
|
|
14
13
|
};
|
|
15
|
-
export var AuthenticationListSAValidationSchema = yup.object().shape({
|
|
16
|
-
brandInfo: yup.object().required('auth_brand_required'),
|
|
17
|
-
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
18
|
-
licenseNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
19
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
20
|
-
if (!isAddEntity) {
|
|
21
|
-
return yup.string().optional();
|
|
22
|
-
}
|
|
23
|
-
return yup.string().test({
|
|
24
|
-
name: 'licenseNumber',
|
|
25
|
-
message: 'enter_license_number',
|
|
26
|
-
test: function (value) {
|
|
27
|
-
var type = this.parent.licenseType;
|
|
28
|
-
var isCR = type === LicenseType.CR;
|
|
29
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
30
|
-
if (!type)
|
|
31
|
-
return false;
|
|
32
|
-
if (isCR)
|
|
33
|
-
return true;
|
|
34
|
-
return length >= LICENSE_NUMBER_MIN_LENGTH;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}),
|
|
38
|
-
unifiedNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
39
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
40
|
-
if (!isAddEntity) {
|
|
41
|
-
return yup.string().optional();
|
|
42
|
-
}
|
|
43
|
-
return yup.string().test({
|
|
44
|
-
name: 'unifiedNumber',
|
|
45
|
-
message: 'unified_number_required',
|
|
46
|
-
test: function (value) {
|
|
47
|
-
var type = this.parent.licenseType;
|
|
48
|
-
var isFL = type === LicenseType.FL;
|
|
49
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
50
|
-
if (!type)
|
|
51
|
-
return false;
|
|
52
|
-
if (isFL)
|
|
53
|
-
return true;
|
|
54
|
-
return length >= UNIFIED_NUMBER_MIN_LENGTH;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}),
|
|
58
|
-
licenseType: yup
|
|
59
|
-
.string()
|
|
60
|
-
.when('entityInfo', function (entityInfo) {
|
|
61
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
62
|
-
if (!isAddEntity) {
|
|
63
|
-
return yup.string().optional();
|
|
64
|
-
}
|
|
65
|
-
return yup.string().required('choose_license_type');
|
|
66
|
-
})
|
|
67
|
-
.required(''),
|
|
68
|
-
legalName: yup
|
|
69
|
-
.string()
|
|
70
|
-
.when('entityInfo', function (entityInfo) {
|
|
71
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
72
|
-
if (!isAddEntity) {
|
|
73
|
-
return yup.string().optional();
|
|
74
|
-
}
|
|
75
|
-
return yup
|
|
76
|
-
.string()
|
|
77
|
-
.required('')
|
|
78
|
-
.test({
|
|
79
|
-
test: function (value) {
|
|
80
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
|
-
if (length === 0)
|
|
82
|
-
return true;
|
|
83
|
-
return (value === null || value === void 0 ? void 0 : value.match(REGEX_LEGAL_NAME)) && length >= 3 ? true : this.createError({ message: 'enter_valid_legal_name' });
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
.required('');
|
|
87
|
-
})
|
|
88
|
-
.required('')
|
|
89
|
-
});
|
|
90
14
|
export var AuthenticationListValidationSchema = yup.object().shape({
|
|
91
15
|
brandInfo: yup.object().required('auth_brand_required'),
|
|
92
16
|
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
@@ -17,20 +17,19 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { deepCopy, isKW,
|
|
21
|
-
import { AuthForType
|
|
20
|
+
import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
|
|
21
|
+
import { AuthForType } from '../../../../@types';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
24
|
import Button from '../../../shared/Button';
|
|
25
25
|
import { clearError, connectExpressSelector, createEntity, resetAuthenticationScreen, getMerchantListAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
26
26
|
import { useLanguage } from '../../../../hooks';
|
|
27
|
-
import {
|
|
27
|
+
import { AuthenticationListValidationSchema } from './validation';
|
|
28
28
|
import BrandList from './BrandList';
|
|
29
29
|
import EntityList from './EntityList';
|
|
30
30
|
import LicenseNumber from './LicenseNumber';
|
|
31
31
|
import EntityLegalName from './EntityLegalName';
|
|
32
32
|
import LicenseType from './EntityLicenseType';
|
|
33
|
-
import UnifiedNumber from './UnifiedNumber';
|
|
34
33
|
var ListType;
|
|
35
34
|
(function (ListType) {
|
|
36
35
|
ListType["BrandList"] = "BrandList";
|
|
@@ -40,13 +39,12 @@ var AuthenticationList = function (_a) {
|
|
|
40
39
|
var _b;
|
|
41
40
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
42
41
|
var _c = useAppSelector(connectExpressSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
43
|
-
var _d = data.authenticationData, brandInfo = _d.brandInfo, entityInfo = _d.entityInfo
|
|
42
|
+
var _d = data.authenticationData, brandInfo = _d.brandInfo, entityInfo = _d.entityInfo;
|
|
44
43
|
var _e = React.useState(), listActive = _e[0], setListActive = _e[1];
|
|
45
44
|
var brandList = (((_b = data.responseData) === null || _b === void 0 ? void 0 : _b.authenticationData) || {}).brandList;
|
|
46
45
|
var _f = React.useState(false), isAddEntity = _f[0], setIsAddEntity = _f[1];
|
|
47
46
|
var otpData = data.otpData;
|
|
48
47
|
var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
|
|
49
|
-
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
50
48
|
React.useEffect(function () {
|
|
51
49
|
sendCustomEventToGTM({
|
|
52
50
|
event: 'Send Event',
|
|
@@ -55,22 +53,20 @@ var AuthenticationList = function (_a) {
|
|
|
55
53
|
});
|
|
56
54
|
}, []);
|
|
57
55
|
var methods = useForm({
|
|
58
|
-
resolver: yupResolver(
|
|
56
|
+
resolver: yupResolver(AuthenticationListValidationSchema),
|
|
59
57
|
defaultValues: {
|
|
60
58
|
brandInfo: brandInfo,
|
|
61
|
-
entityInfo: entityInfo
|
|
62
|
-
unifiedNumber: unifiedNumber
|
|
59
|
+
entityInfo: entityInfo
|
|
63
60
|
},
|
|
64
61
|
mode: 'onChange'
|
|
65
62
|
});
|
|
66
63
|
var t = useTranslation().t;
|
|
67
64
|
var isAr = useLanguage().isAr;
|
|
68
65
|
var dispatch = useAppDispatch();
|
|
69
|
-
var isCR = methods.watch('licenseType') === LType.CR;
|
|
70
66
|
var onSubmit = function (formData) {
|
|
71
67
|
if (isAddEntity) {
|
|
72
|
-
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType
|
|
73
|
-
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType
|
|
68
|
+
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
|
|
69
|
+
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
|
|
74
70
|
dispatch(createEntity(deepCopy(data_1)));
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
@@ -81,7 +77,6 @@ var AuthenticationList = function (_a) {
|
|
|
81
77
|
if (isAddEntity) {
|
|
82
78
|
setIsAddEntity(false);
|
|
83
79
|
methods.setValue('licenseNumber', '');
|
|
84
|
-
methods.setValue('unifiedNumber', '');
|
|
85
80
|
methods.setValue('legalName', '');
|
|
86
81
|
methods.setValue('licenseType', '');
|
|
87
82
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
@@ -104,6 +99,6 @@ var AuthenticationList = function (_a) {
|
|
|
104
99
|
};
|
|
105
100
|
var isBrandList = listActive === ListType.BrandList;
|
|
106
101
|
var isEntityList = listActive === ListType.EntityList;
|
|
107
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}),
|
|
102
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
108
103
|
};
|
|
109
104
|
export default React.memo(AuthenticationList);
|
|
@@ -81,7 +81,6 @@ var EntityList = function (_a) {
|
|
|
81
81
|
if (filteredEntityList.length) {
|
|
82
82
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
83
83
|
setValue('licenseNumber', '');
|
|
84
|
-
setValue('unifiedNumber', '');
|
|
85
84
|
setValue('licenseType', '');
|
|
86
85
|
setValue('legalName', '');
|
|
87
86
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -125,7 +124,6 @@ var EntityList = function (_a) {
|
|
|
125
124
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
126
125
|
else {
|
|
127
126
|
setValue('licenseNumber', '');
|
|
128
|
-
setValue('unifiedNumber', '');
|
|
129
127
|
setValue('legalName', '');
|
|
130
128
|
setValue('licenseType', '');
|
|
131
129
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const AuthenticationListSAValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
|
-
entityInfo: any;
|
|
5
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
11
|
-
entityInfo: any;
|
|
12
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
-
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
18
|
-
entityInfo: any;
|
|
19
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
20
|
-
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
22
|
-
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
|
-
}>>>;
|
|
24
2
|
export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
25
3
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
26
4
|
entityInfo: any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME
|
|
3
|
-
import { LicenseType } from '../../../../@types';
|
|
2
|
+
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME } from '../../../../constants';
|
|
4
3
|
var objectElements = {
|
|
5
4
|
id: yup.string().required(),
|
|
6
5
|
business_id: yup.string(),
|
|
@@ -12,81 +11,6 @@ var objectElements = {
|
|
|
12
11
|
number: yup.string()
|
|
13
12
|
})
|
|
14
13
|
};
|
|
15
|
-
export var AuthenticationListSAValidationSchema = yup.object().shape({
|
|
16
|
-
brandInfo: yup.object().required('auth_brand_required'),
|
|
17
|
-
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
18
|
-
licenseNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
19
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
20
|
-
if (!isAddEntity) {
|
|
21
|
-
return yup.string().optional();
|
|
22
|
-
}
|
|
23
|
-
return yup.string().test({
|
|
24
|
-
name: 'licenseNumber',
|
|
25
|
-
message: 'enter_license_number',
|
|
26
|
-
test: function (value) {
|
|
27
|
-
var type = this.parent.licenseType;
|
|
28
|
-
var isCR = type === LicenseType.CR;
|
|
29
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
30
|
-
if (!type)
|
|
31
|
-
return false;
|
|
32
|
-
if (isCR)
|
|
33
|
-
return true;
|
|
34
|
-
return length >= LICENSE_NUMBER_MIN_LENGTH;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}),
|
|
38
|
-
unifiedNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
39
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
40
|
-
if (!isAddEntity) {
|
|
41
|
-
return yup.string().optional();
|
|
42
|
-
}
|
|
43
|
-
return yup.string().test({
|
|
44
|
-
name: 'unifiedNumber',
|
|
45
|
-
message: 'unified_number_required',
|
|
46
|
-
test: function (value) {
|
|
47
|
-
var type = this.parent.licenseType;
|
|
48
|
-
var isFL = type === LicenseType.FL;
|
|
49
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
50
|
-
if (!type)
|
|
51
|
-
return false;
|
|
52
|
-
if (isFL)
|
|
53
|
-
return true;
|
|
54
|
-
return length >= UNIFIED_NUMBER_MIN_LENGTH;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}),
|
|
58
|
-
licenseType: yup
|
|
59
|
-
.string()
|
|
60
|
-
.when('entityInfo', function (entityInfo) {
|
|
61
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
62
|
-
if (!isAddEntity) {
|
|
63
|
-
return yup.string().optional();
|
|
64
|
-
}
|
|
65
|
-
return yup.string().required('choose_license_type');
|
|
66
|
-
})
|
|
67
|
-
.required(''),
|
|
68
|
-
legalName: yup
|
|
69
|
-
.string()
|
|
70
|
-
.when('entityInfo', function (entityInfo) {
|
|
71
|
-
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
72
|
-
if (!isAddEntity) {
|
|
73
|
-
return yup.string().optional();
|
|
74
|
-
}
|
|
75
|
-
return yup
|
|
76
|
-
.string()
|
|
77
|
-
.required('')
|
|
78
|
-
.test({
|
|
79
|
-
test: function (value) {
|
|
80
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
|
-
if (length === 0)
|
|
82
|
-
return true;
|
|
83
|
-
return (value === null || value === void 0 ? void 0 : value.match(REGEX_LEGAL_NAME)) && length >= 3 ? true : this.createError({ message: 'enter_valid_legal_name' });
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
.required('');
|
|
87
|
-
})
|
|
88
|
-
.required('')
|
|
89
|
-
});
|
|
90
14
|
export var AuthenticationListValidationSchema = yup.object().shape({
|
|
91
15
|
brandInfo: yup.object().required('auth_brand_required'),
|
|
92
16
|
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
@@ -16,8 +16,8 @@ export var QRCodeImage = styled(Icon)(function (_a) {
|
|
|
16
16
|
var spacing = _a.theme.spacing;
|
|
17
17
|
return ({
|
|
18
18
|
margin: '0px auto',
|
|
19
|
-
width: spacing(
|
|
20
|
-
height: spacing(
|
|
19
|
+
width: spacing(31.25),
|
|
20
|
+
height: spacing(31.25),
|
|
21
21
|
marginTop: spacing(2.5),
|
|
22
22
|
marginBottom: spacing(2.5)
|
|
23
23
|
});
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
6
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
7
|
-
htmlColor?: string | undefined;
|
|
8
|
-
inheritViewBox?: boolean | undefined;
|
|
9
|
-
shapeRendering?: string | undefined;
|
|
10
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
11
|
-
titleAccess?: string | undefined;
|
|
12
|
-
viewBox?: string | undefined;
|
|
13
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
14
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
15
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
16
|
-
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
17
|
-
children?: React.ReactNode;
|
|
18
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
19
|
-
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
20
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
21
|
-
htmlColor?: string | undefined;
|
|
22
|
-
inheritViewBox?: boolean | undefined;
|
|
23
|
-
shapeRendering?: string | undefined;
|
|
24
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
|
-
titleAccess?: string | undefined;
|
|
26
|
-
viewBox?: string | undefined;
|
|
27
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
28
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
29
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
|
-
interface UnifiedNumberProps {
|
|
31
|
-
readOnly?: boolean;
|
|
32
|
-
isVerified?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: UnifiedNumberProps) => JSX.Element>;
|
|
35
|
-
export default _default;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
17
|
-
import InfoIcon from '@mui/icons-material/Info';
|
|
18
|
-
import Box from '@mui/material/Box';
|
|
19
|
-
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
22
|
-
import Tooltip from '../../../../components/Tooltip';
|
|
23
|
-
import Text from '../../../../components/Text';
|
|
24
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import Input from '../../../shared/Input';
|
|
26
|
-
import { clearError, authSelector } from '../../../app/auth/authStore';
|
|
27
|
-
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
28
|
-
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
29
|
-
var theme = _a.theme;
|
|
30
|
-
return ({
|
|
31
|
-
display: 'flex',
|
|
32
|
-
justifyContent: 'space-between',
|
|
33
|
-
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
37
|
-
var theme = _a.theme;
|
|
38
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
39
|
-
});
|
|
40
|
-
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
41
|
-
var theme = _a.theme;
|
|
42
|
-
return ({
|
|
43
|
-
width: theme.spacing(2.75),
|
|
44
|
-
height: theme.spacing(2.125),
|
|
45
|
-
cursor: 'pointer',
|
|
46
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
47
|
-
display: 'inline-flex'
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
51
|
-
var theme = _a.theme;
|
|
52
|
-
return ({
|
|
53
|
-
width: theme.spacing(2.75),
|
|
54
|
-
height: theme.spacing(2.125),
|
|
55
|
-
cursor: 'pointer',
|
|
56
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
57
|
-
display: 'inline-flex'
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
var UnifiedNumber = function (_a) {
|
|
61
|
-
var _b;
|
|
62
|
-
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
63
|
-
var t = useTranslation().t;
|
|
64
|
-
var bckError = useAppSelector(authSelector).error;
|
|
65
|
-
var control = useFormContext().control;
|
|
66
|
-
var dispatch = useAppDispatch();
|
|
67
|
-
var _c = React.useState(false), hovered = _c[0], setHovered = _c[1];
|
|
68
|
-
var handleChange = function (_a) {
|
|
69
|
-
var target = _a.target;
|
|
70
|
-
if (bckError)
|
|
71
|
-
dispatch(clearError());
|
|
72
|
-
var value = removeAllCharsFromNumber(target.value);
|
|
73
|
-
unifiedNumberControl.field.onChange(value);
|
|
74
|
-
};
|
|
75
|
-
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
76
|
-
var unifiedNumberValue = unifiedNumberControl.field.value;
|
|
77
|
-
var error = (_b = unifiedNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
78
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('v1_company_unified_number_label') }), _jsx(Tooltip, __assign({ title: t('v1_company_unified_number_description'), onMouseOver: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); }, onTouchStartCapture: function () { return setHovered(true); } }, { children: hovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('v1_company_unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) })] })));
|
|
79
|
-
};
|
|
80
|
-
export default React.memo(UnifiedNumber);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
6
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
7
|
-
htmlColor?: string | undefined;
|
|
8
|
-
inheritViewBox?: boolean | undefined;
|
|
9
|
-
shapeRendering?: string | undefined;
|
|
10
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
11
|
-
titleAccess?: string | undefined;
|
|
12
|
-
viewBox?: string | undefined;
|
|
13
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
14
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
15
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
16
|
-
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
17
|
-
children?: React.ReactNode;
|
|
18
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
19
|
-
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
20
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
21
|
-
htmlColor?: string | undefined;
|
|
22
|
-
inheritViewBox?: boolean | undefined;
|
|
23
|
-
shapeRendering?: string | undefined;
|
|
24
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
|
-
titleAccess?: string | undefined;
|
|
26
|
-
viewBox?: string | undefined;
|
|
27
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
28
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
29
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
|
-
interface UnifiedNumberProps {
|
|
31
|
-
readOnly?: boolean;
|
|
32
|
-
isVerified?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: UnifiedNumberProps) => JSX.Element>;
|
|
35
|
-
export default _default;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
17
|
-
import InfoIcon from '@mui/icons-material/Info';
|
|
18
|
-
import Box from '@mui/material/Box';
|
|
19
|
-
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
22
|
-
import Tooltip from '../../../../components/Tooltip';
|
|
23
|
-
import Text from '../../../../components/Text';
|
|
24
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import Input from '../../../shared/Input';
|
|
26
|
-
import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
|
|
27
|
-
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
28
|
-
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
29
|
-
var theme = _a.theme;
|
|
30
|
-
return ({
|
|
31
|
-
display: 'flex',
|
|
32
|
-
justifyContent: 'space-between',
|
|
33
|
-
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
37
|
-
var theme = _a.theme;
|
|
38
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
39
|
-
});
|
|
40
|
-
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
41
|
-
var theme = _a.theme;
|
|
42
|
-
return ({
|
|
43
|
-
width: theme.spacing(2.75),
|
|
44
|
-
height: theme.spacing(2.125),
|
|
45
|
-
cursor: 'pointer',
|
|
46
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
47
|
-
display: 'inline-flex'
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
51
|
-
var theme = _a.theme;
|
|
52
|
-
return ({
|
|
53
|
-
width: theme.spacing(2.75),
|
|
54
|
-
height: theme.spacing(2.125),
|
|
55
|
-
cursor: 'pointer',
|
|
56
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
57
|
-
display: 'inline-flex'
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
var UnifiedNumber = function (_a) {
|
|
61
|
-
var _b;
|
|
62
|
-
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
63
|
-
var t = useTranslation().t;
|
|
64
|
-
var bckError = useAppSelector(connectExpressSelector).error;
|
|
65
|
-
var control = useFormContext().control;
|
|
66
|
-
var dispatch = useAppDispatch();
|
|
67
|
-
var _c = React.useState(false), hovered = _c[0], setHovered = _c[1];
|
|
68
|
-
var handleChange = function (_a) {
|
|
69
|
-
var target = _a.target;
|
|
70
|
-
if (bckError)
|
|
71
|
-
dispatch(clearError());
|
|
72
|
-
var value = removeAllCharsFromNumber(target.value);
|
|
73
|
-
unifiedNumberControl.field.onChange(value);
|
|
74
|
-
};
|
|
75
|
-
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
76
|
-
var unifiedNumberValue = unifiedNumberControl.field.value;
|
|
77
|
-
var error = (_b = unifiedNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
78
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('v1_company_unified_number_label') }), _jsx(Tooltip, __assign({ title: t('v1_company_unified_number_description'), onMouseOver: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); }, onTouchStartCapture: function () { return setHovered(true); } }, { children: hovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('v1_company_unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) })] })));
|
|
79
|
-
};
|
|
80
|
-
export default React.memo(UnifiedNumber);
|