@tap-payments/auth-jsconnect 2.10.12-development → 2.10.13-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 +3 -0
- package/build/api/entity.d.ts +3 -0
- package/build/api/lead.d.ts +2 -1
- package/build/assets/locales/en.json +3 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.js +7 -6
- package/build/features/app/business/businessStore.js +6 -4
- package/build/features/app/connectExpress/connectExpressStore.js +15 -9
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +14 -8
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/auth/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/auth/screens/AuthenticationList/validation.js +77 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +12 -2
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -7
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +14 -9
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +77 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +10 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +21 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +44 -13
- package/build/features/entity/screens/EntityName/EntityName.js +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +14 -3
- package/package.json +1 -1
package/build/@types/form.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare type BrandActivitiesFormValues = {
|
|
|
61
61
|
};
|
|
62
62
|
export declare type BusinessTypeFormValues = {
|
|
63
63
|
licenseNumber: string;
|
|
64
|
+
unifiedNumber: string;
|
|
64
65
|
entityLegalName?: string;
|
|
65
66
|
selectedEntityLicense?: EntityLicense;
|
|
66
67
|
selectedLicense?: License;
|
|
@@ -150,6 +151,7 @@ export declare type EntityCapitalFormValues = {
|
|
|
150
151
|
export declare type BusinessDataFormValues = {
|
|
151
152
|
brandName: string;
|
|
152
153
|
licenseNumber: string;
|
|
154
|
+
unifiedNumber: string;
|
|
153
155
|
selectedLicense?: License;
|
|
154
156
|
termAndConditionChecked?: boolean;
|
|
155
157
|
};
|
|
@@ -157,6 +159,7 @@ export declare type AuthenticationListFormValues = {
|
|
|
157
159
|
brandInfo?: BrandInfo;
|
|
158
160
|
entityInfo?: EntityLicenseAuth;
|
|
159
161
|
licenseNumber?: string;
|
|
162
|
+
unifiedNumber?: string;
|
|
160
163
|
legalName?: string;
|
|
161
164
|
licenseType?: string;
|
|
162
165
|
};
|
package/build/api/entity.d.ts
CHANGED
package/build/api/lead.d.ts
CHANGED
|
@@ -699,6 +699,9 @@
|
|
|
699
699
|
"year": "Year",
|
|
700
700
|
"yes": "Yes",
|
|
701
701
|
"your_brand_details": "Your brand details",
|
|
702
|
+
"v1_company_unified_number_label": "Company unified number",
|
|
703
|
+
"v1_company_unified_number_hint": "700xxxxxxx",
|
|
704
|
+
"v1_company_unified_number_description": "You can find your Company Unified Number in the top-left corner of your Company Registration Certificate.",
|
|
702
705
|
"passcode_title": "Please enter your passcode",
|
|
703
706
|
"sign_in_with_otp": "Sign in with OTP",
|
|
704
707
|
"passcode_required": "Please enter the required Passcode",
|
|
@@ -10,6 +10,7 @@ export declare const LICENSE_NUMBER_MIN_LENGTH = 5;
|
|
|
10
10
|
export declare const FL_NUMBER_ENTITY_LENGTH = 50;
|
|
11
11
|
export declare const FL_MIN_LICENSE_LENGTH = 5;
|
|
12
12
|
export declare const CR_MIN_LICENSE_LENGTH = 5;
|
|
13
|
+
export declare const UNIFIED_NUMBER_MIN_LENGTH = 2;
|
|
13
14
|
export declare const MAX_EMAIL_LENGTH = 50;
|
|
14
15
|
export declare const BRAND_NAME_MAX_LENGTH = 99;
|
|
15
16
|
export declare const KW_MIN_LICENSE_LENGTH = 3;
|
|
@@ -10,6 +10,7 @@ export var LICENSE_NUMBER_MIN_LENGTH = 5;
|
|
|
10
10
|
export var FL_NUMBER_ENTITY_LENGTH = 50;
|
|
11
11
|
export var FL_MIN_LICENSE_LENGTH = 5;
|
|
12
12
|
export var CR_MIN_LICENSE_LENGTH = 5;
|
|
13
|
+
export var UNIFIED_NUMBER_MIN_LENGTH = 2;
|
|
13
14
|
export var MAX_EMAIL_LENGTH = 50;
|
|
14
15
|
export var BRAND_NAME_MAX_LENGTH = 99;
|
|
15
16
|
export var KW_MIN_LICENSE_LENGTH = 3;
|
|
@@ -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, body, data;
|
|
756
|
+
var settings, brandInfo, legalName, licenseNumber, licenseType, unifiedNumber, 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, unifiedNumber = params.unifiedNumber;
|
|
763
763
|
body = {
|
|
764
764
|
business_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) || '',
|
|
765
765
|
entity: {
|
|
@@ -767,10 +767,11 @@ export var createEntity = createAsyncThunk('auth/createEntity', function (params
|
|
|
767
767
|
en: legalName || '',
|
|
768
768
|
ar: legalName || ''
|
|
769
769
|
},
|
|
770
|
-
license: {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
770
|
+
license: __assign({ number: licenseNumber || '', type: licenseType || '' }, (unifiedNumber && {
|
|
771
|
+
additional_info: {
|
|
772
|
+
unified_number: unifiedNumber
|
|
773
|
+
}
|
|
774
|
+
})),
|
|
774
775
|
country: (_a = settings.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
|
|
775
776
|
}
|
|
776
777
|
};
|
|
@@ -651,26 +651,27 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
|
|
|
651
651
|
});
|
|
652
652
|
}); });
|
|
653
653
|
export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
654
|
-
var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
|
|
654
|
+
var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, unifiedNumber, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
|
|
655
655
|
var _d, _e, _f;
|
|
656
656
|
return __generator(this, function (_g) {
|
|
657
657
|
switch (_g.label) {
|
|
658
658
|
case 0:
|
|
659
659
|
_a = thunkApi.getState(), settings = _a.settings, business = _a.business;
|
|
660
660
|
isKWCountry = isKW(settings.data.businessCountry.iso2);
|
|
661
|
-
selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense;
|
|
661
|
+
selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense, unifiedNumber = params.unifiedNumber;
|
|
662
662
|
isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
663
663
|
_b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, brand = _b.brand;
|
|
664
664
|
stepName = 'BUSINESS_ACTIVITIES_STEP';
|
|
665
665
|
payload = __assign(__assign(__assign(__assign({ id: lead_id || '', entity: {
|
|
666
|
-
id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isKWCountry ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : ''
|
|
666
|
+
id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isKWCountry ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : '',
|
|
667
|
+
unified_number: unifiedNumber
|
|
667
668
|
} }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
|
|
668
669
|
license_number: isKWCountry && isFL ? '' : licenseNumber,
|
|
669
670
|
license_type: isFL ? LicenseType.FL : LicenseType.CR,
|
|
670
671
|
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
|
|
671
672
|
})), { step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO }), (isKWCountry && {
|
|
672
673
|
business_name: isFL ? undefined : { ar: entityLegalName, en: entityLegalName }
|
|
673
|
-
})), { encryption_contract: ['license_number', 'business_type', 'license_type'] });
|
|
674
|
+
})), { encryption_contract: ['license_number', 'business_type', 'license_type', 'entity.unified_number'] });
|
|
674
675
|
return [4, API.leadService.updateLead(payload)];
|
|
675
676
|
case 1:
|
|
676
677
|
data = _g.sent();
|
|
@@ -988,6 +989,7 @@ var initialState = {
|
|
|
988
989
|
businessTypeData: {
|
|
989
990
|
licenseNumber: '',
|
|
990
991
|
entityLegalName: '',
|
|
992
|
+
unifiedNumber: '',
|
|
991
993
|
isPrevDob: false
|
|
992
994
|
},
|
|
993
995
|
activitiesData: {
|
|
@@ -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, body, data;
|
|
1018
|
+
var settings, brandInfo, legalName, licenseNumber, licenseType, unifiedNumber, 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, unifiedNumber = params.unifiedNumber;
|
|
1025
1025
|
body = {
|
|
1026
1026
|
business_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) || '',
|
|
1027
1027
|
entity: {
|
|
@@ -1029,10 +1029,11 @@ export var createEntity = createAsyncThunk('connectExpress/createEntity', functi
|
|
|
1029
1029
|
en: legalName || '',
|
|
1030
1030
|
ar: legalName || ''
|
|
1031
1031
|
},
|
|
1032
|
-
license: {
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1032
|
+
license: __assign({ number: licenseNumber || '', type: licenseType || '' }, (unifiedNumber && {
|
|
1033
|
+
additional_info: {
|
|
1034
|
+
unified_number: unifiedNumber
|
|
1035
|
+
}
|
|
1036
|
+
})),
|
|
1036
1037
|
country: (_a = settings.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
|
|
1037
1038
|
}
|
|
1038
1039
|
};
|
|
@@ -1129,13 +1130,13 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
|
|
|
1129
1130
|
export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDataAsync ', function (_a, thunkApi) {
|
|
1130
1131
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
1131
1132
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1132
|
-
var _b, settings, connectExpress, selectedLicense, brandName, licenseNumber, termAndConditionChecked, isKWCountry, isFL, _c, responseData, isLeadIdPassed, id, brandNameBody, payload, data;
|
|
1133
|
+
var _b, settings, connectExpress, selectedLicense, brandName, licenseNumber, termAndConditionChecked, unifiedNumber, isKWCountry, isFL, _c, responseData, isLeadIdPassed, id, brandNameBody, payload, data;
|
|
1133
1134
|
var _d, _e;
|
|
1134
1135
|
return __generator(this, function (_f) {
|
|
1135
1136
|
switch (_f.label) {
|
|
1136
1137
|
case 0:
|
|
1137
1138
|
_b = thunkApi.getState(), settings = _b.settings, connectExpress = _b.connectExpress;
|
|
1138
|
-
selectedLicense = formData.selectedLicense, brandName = formData.brandName, licenseNumber = formData.licenseNumber, termAndConditionChecked = formData.termAndConditionChecked;
|
|
1139
|
+
selectedLicense = formData.selectedLicense, brandName = formData.brandName, licenseNumber = formData.licenseNumber, termAndConditionChecked = formData.termAndConditionChecked, unifiedNumber = formData.unifiedNumber;
|
|
1139
1140
|
isKWCountry = isKW(settings.data.businessCountry.iso2);
|
|
1140
1141
|
isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
1141
1142
|
_c = connectExpress.data, responseData = _c.responseData, isLeadIdPassed = _c.isLeadIdPassed;
|
|
@@ -1153,6 +1154,9 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
|
|
|
1153
1154
|
license_type: (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) ? (isFL ? LicenseType.FL : LicenseType.CR) : undefined,
|
|
1154
1155
|
business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type,
|
|
1155
1156
|
is_acknowledged: true,
|
|
1157
|
+
entity: {
|
|
1158
|
+
unified_number: unifiedNumber
|
|
1159
|
+
},
|
|
1156
1160
|
terms_conditions_accepted: !isLeadIdPassed ? termAndConditionChecked : undefined,
|
|
1157
1161
|
step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_BRAND_BUSINESS,
|
|
1158
1162
|
encryption_contract: []
|
|
@@ -1480,11 +1484,13 @@ var initialState = {
|
|
|
1480
1484
|
businessData: {
|
|
1481
1485
|
brandName: '',
|
|
1482
1486
|
licenseNumber: '',
|
|
1487
|
+
unifiedNumber: '',
|
|
1483
1488
|
termAndConditionChecked: false
|
|
1484
1489
|
},
|
|
1485
1490
|
authenticationData: {
|
|
1486
1491
|
brandInfo: undefined,
|
|
1487
|
-
entityInfo: undefined
|
|
1492
|
+
entityInfo: undefined,
|
|
1493
|
+
unifiedNumber: ''
|
|
1488
1494
|
},
|
|
1489
1495
|
authMerchantData: {
|
|
1490
1496
|
merchantInfo: undefined
|
|
@@ -17,17 +17,19 @@ 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, sendCustomEventToGTM } from '../../../../utils';
|
|
20
|
+
import { deepCopy, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
|
+
import { LicenseType as LType } from '../../../../@types';
|
|
21
22
|
import Form from '../../../../components/Form';
|
|
22
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
24
|
import Button from '../../../shared/Button';
|
|
24
25
|
import { clearError, authSelector, createEntity, resetAuthenticationScreen, getMerchantList } from '../../../app/auth/authStore';
|
|
25
|
-
import { AuthenticationListValidationSchema } from './validation';
|
|
26
|
+
import { AuthenticationListValidationSchema, AuthenticationListSAValidationSchema } from './validation';
|
|
26
27
|
import BrandList from './BrandList';
|
|
27
28
|
import EntityList from './EntityList';
|
|
28
29
|
import EntityLegalName from './EntityLegalName';
|
|
29
30
|
import LicenseNumber from './LicenseNumber';
|
|
30
31
|
import LicenseType from './EntityLicenseType';
|
|
32
|
+
import UnifiedNumber from './UnifiedNumber';
|
|
31
33
|
var ListType;
|
|
32
34
|
(function (ListType) {
|
|
33
35
|
ListType["BrandList"] = "BrandList";
|
|
@@ -36,10 +38,11 @@ var ListType;
|
|
|
36
38
|
var AuthenticationList = function (_a) {
|
|
37
39
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
38
40
|
var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
39
|
-
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo;
|
|
41
|
+
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo, unifiedNumber = _c.unifiedNumber;
|
|
40
42
|
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
41
43
|
var brandList = (data.responseData || {}).brandList;
|
|
42
44
|
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]);
|
|
43
46
|
React.useEffect(function () {
|
|
44
47
|
sendCustomEventToGTM({
|
|
45
48
|
event: 'Send Event',
|
|
@@ -48,20 +51,22 @@ var AuthenticationList = function (_a) {
|
|
|
48
51
|
});
|
|
49
52
|
}, []);
|
|
50
53
|
var methods = useForm({
|
|
51
|
-
resolver: yupResolver(AuthenticationListValidationSchema),
|
|
54
|
+
resolver: yupResolver(isSACountry ? AuthenticationListSAValidationSchema : AuthenticationListValidationSchema),
|
|
52
55
|
defaultValues: {
|
|
53
56
|
brandInfo: brandInfo,
|
|
54
|
-
entityInfo: entityInfo
|
|
57
|
+
entityInfo: entityInfo,
|
|
58
|
+
unifiedNumber: unifiedNumber
|
|
55
59
|
},
|
|
56
60
|
mode: 'onChange'
|
|
57
61
|
});
|
|
58
62
|
var t = useTranslation().t;
|
|
59
63
|
var isAr = useLanguage().isAr;
|
|
60
64
|
var dispatch = useAppDispatch();
|
|
65
|
+
var isCR = methods.watch('licenseType') === LType.CR;
|
|
61
66
|
var onSubmit = function (formData) {
|
|
62
67
|
if (isAddEntity) {
|
|
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 };
|
|
68
|
+
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType, unifiedNumber_1 = formData.unifiedNumber;
|
|
69
|
+
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType, unifiedNumber: unifiedNumber_1 };
|
|
65
70
|
dispatch(createEntity(deepCopy(data_1)));
|
|
66
71
|
return;
|
|
67
72
|
}
|
|
@@ -72,6 +77,7 @@ var AuthenticationList = function (_a) {
|
|
|
72
77
|
setIsAddEntity(false);
|
|
73
78
|
methods.setValue('licenseNumber', '');
|
|
74
79
|
methods.setValue('legalName', '');
|
|
80
|
+
methods.setValue('unifiedNumber', '');
|
|
75
81
|
methods.setValue('licenseType', '');
|
|
76
82
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
77
83
|
return;
|
|
@@ -91,6 +97,6 @@ var AuthenticationList = function (_a) {
|
|
|
91
97
|
};
|
|
92
98
|
var isBrandList = listActive === ListType.BrandList;
|
|
93
99
|
var isEntityList = listActive === ListType.EntityList;
|
|
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') })) }))] })) })) }));
|
|
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, {}), isCR && isSACountry ? _jsx(UnifiedNumber, {}) : _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') })) }))] })) })) }));
|
|
95
101
|
};
|
|
96
102
|
export default React.memo(AuthenticationList);
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,80 @@
|
|
|
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,4 +1,26 @@
|
|
|
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
|
+
}>>>;
|
|
2
24
|
export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
25
|
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
26
|
entityInfo: any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME } from '../../../../constants';
|
|
2
|
+
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
3
|
+
import { LicenseType } from '../../../../@types';
|
|
3
4
|
var objectElements = {
|
|
4
5
|
id: yup.string().required(),
|
|
5
6
|
business_id: yup.string(),
|
|
@@ -11,6 +12,81 @@ var objectElements = {
|
|
|
11
12
|
number: yup.string()
|
|
12
13
|
})
|
|
13
14
|
};
|
|
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
|
+
});
|
|
14
90
|
export var AuthenticationListValidationSchema = yup.object().shape({
|
|
15
91
|
brandInfo: yup.object().required('auth_brand_required'),
|
|
16
92
|
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|