@tap-payments/auth-jsconnect 2.8.58-development → 2.8.59-beta
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/app.d.ts +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +87 -76
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +52 -110
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +26 -4
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +35 -8
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +18 -5
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +7 -2
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +3 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +26 -4
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +36 -9
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +18 -5
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -13
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +2 -3
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +8 -11
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +1 -2
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +26 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NID/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +35 -8
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +26 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +2 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +26 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Address/CountryList.d.ts +23 -7
- package/build/features/shared/Address/InputSelect.d.ts +23 -7
- package/build/features/shared/Button/FlowsButtons.js +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -2
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -9
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -3,7 +3,7 @@ import { getParameterByName } from '../utils';
|
|
|
3
3
|
import { useAppDispatch } from './useAppDispatch';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
export var useVerifyToken = function (_a) {
|
|
6
|
-
var verify = _a.verify, internalToken = _a.internalToken, navigation = _a.navigation, open = _a.open, settingLoading = _a.settingLoading, loadingScreenName = _a.loadingScreenName
|
|
6
|
+
var verify = _a.verify, internalToken = _a.internalToken, navigation = _a.navigation, open = _a.open, settingLoading = _a.settingLoading, loadingScreenName = _a.loadingScreenName;
|
|
7
7
|
var dispatch = useAppDispatch();
|
|
8
8
|
var verifyTokenFun = function () {
|
|
9
9
|
var token = internalToken ? internalToken : getParameterByName('token');
|
|
@@ -15,16 +15,11 @@ export var useVerifyToken = function (_a) {
|
|
|
15
15
|
dispatch(verify({ token: token, isInternally: !!internalToken }));
|
|
16
16
|
};
|
|
17
17
|
useEffect(function () {
|
|
18
|
-
if (settingLoading
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dispatch(handleCurrentActiveScreen(operatorErrorScreenName));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
verifyTokenFun();
|
|
25
|
-
}, [settingLoading, open, isValidOperator]);
|
|
18
|
+
if (!settingLoading && open)
|
|
19
|
+
verifyTokenFun();
|
|
20
|
+
}, [settingLoading, open]);
|
|
26
21
|
useEffect(function () {
|
|
27
|
-
if (internalToken && open
|
|
22
|
+
if (internalToken && open)
|
|
28
23
|
dispatch(handleCurrentActiveScreen(loadingScreenName));
|
|
29
24
|
}, [navigation]);
|
|
30
25
|
};
|
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
|
|
3
3
|
export var sleep = function (milliseconds) {
|
|
4
4
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
5
5
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -13,10 +13,10 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
13
13
|
export var setBaseUrl = function (publicKey) {
|
|
14
14
|
var isProd = publicKey.includes('pk_live');
|
|
15
15
|
if (isProd) {
|
|
16
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
16
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
19
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
20
20
|
};
|
|
21
21
|
export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
22
22
|
var country = countryIso2.toLowerCase();
|
|
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
35
35
|
window.history.replaceState({}, '', newUrl);
|
|
36
36
|
};
|
|
37
37
|
export var openConnect = function (pk, countryCode) {
|
|
38
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
38
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
|
|
39
39
|
if (countryCode) {
|
|
40
40
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
41
41
|
}
|
package/build/utils/locale.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { initReactI18next } from 'react-i18next';
|
|
2
2
|
import i18n from '../i18n';
|
|
3
3
|
export var updateLocale = function (locale, country) {
|
|
4
|
-
var
|
|
5
|
-
var data = (_a = locale[country.toUpperCase()]) !== null && _a !== void 0 ? _a : (locale['SA'] || locale['default']);
|
|
4
|
+
var data = locale['SA'] || locale[country.toUpperCase()] || locale['default'];
|
|
6
5
|
if (i18n.isInitialized) {
|
|
7
6
|
i18n.removeResourceBundle('*', 'translation');
|
|
8
7
|
i18n.addResourceBundle('en', 'translation', data.en.translation);
|
package/build/utils/string.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const convertNumbers2English: (str: string) => string;
|
|
|
15
15
|
export declare const getParameterByName: (name: string) => string | null;
|
|
16
16
|
export declare const getClientEmailUrl: () => string;
|
|
17
17
|
export declare const getFlowUrl: (path: string, lang: string) => string;
|
|
18
|
-
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string
|
|
18
|
+
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string) => string;
|
|
19
19
|
export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
|
|
20
20
|
export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
21
21
|
al: any;
|
|
@@ -41,13 +41,11 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
|
41
41
|
l: any;
|
|
42
42
|
};
|
|
43
43
|
export declare const removeRequestHeaders: () => void;
|
|
44
|
-
export declare const
|
|
45
|
-
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "PASSWORD_CREATE_PASSWORD_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
44
|
+
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
46
45
|
export declare const getEighteenYearsAgo: () => string;
|
|
47
46
|
export declare const isKW: (flag: string) => boolean;
|
|
48
47
|
export declare const isSA: (flag: string) => boolean;
|
|
49
48
|
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
50
|
-
export declare const isKWOrSA: (flag: string) => boolean;
|
|
51
49
|
export declare const isLinkedIn: (flag: string) => boolean;
|
|
52
50
|
export declare const isTwitter: (flag: string) => boolean;
|
|
53
51
|
export declare const isWebsite: (flag: string) => boolean;
|
|
@@ -74,4 +72,3 @@ export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/p
|
|
|
74
72
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
75
73
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
76
74
|
export declare const formatNumberAsCurrency: (number: string) => string;
|
|
77
|
-
export declare const getCurrencyByCountryIso2: (countryCode: string) => string;
|
package/build/utils/string.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlowsTypes } from '../@types';
|
|
2
2
|
import { concatenateObjectValues, encryptString } from '.';
|
|
3
3
|
import { removeAxiosGlobalHeaders } from '../api';
|
|
4
|
-
import {
|
|
4
|
+
import { ICONS_FULL_PATH } from '../constants';
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
export var maskPhone = function (str) {
|
|
7
7
|
if (str === void 0) { str = ''; }
|
|
@@ -94,12 +94,9 @@ export var getFlowUrl = function (path, lang) {
|
|
|
94
94
|
var origin = window.location.origin;
|
|
95
95
|
return origin + path + "?lang=".concat(lang, "&token=");
|
|
96
96
|
};
|
|
97
|
-
export var getResetFlowUrl = function (path, lang, operationType, id, infoId
|
|
97
|
+
export var getResetFlowUrl = function (path, lang, operationType, id, infoId) {
|
|
98
98
|
var origin = window.location.origin;
|
|
99
|
-
|
|
100
|
-
if (userId && userType)
|
|
101
|
-
baseUrl = baseUrl + "&user_id=".concat(userId, "&user_type=").concat(userType);
|
|
102
|
-
return baseUrl + "&token=";
|
|
99
|
+
return origin + path + "?lang=".concat(lang, "&operation_type=").concat(operationType, "&board_id=").concat(id, "&board_info_id=").concat(infoId, "&token=");
|
|
103
100
|
};
|
|
104
101
|
export var capitalizeTheFirstLetterOfEachWord = function (words) {
|
|
105
102
|
var separateWord = words.toLowerCase().split(' ');
|
|
@@ -162,20 +159,7 @@ export var removeRequestHeaders = function () {
|
|
|
162
159
|
'authorization'
|
|
163
160
|
]);
|
|
164
161
|
};
|
|
165
|
-
export var
|
|
166
|
-
var origin = window.location.origin;
|
|
167
|
-
if (origin.includes('localhost')) {
|
|
168
|
-
return ENDPOINT_PATHS.DEV_BASE_URL;
|
|
169
|
-
}
|
|
170
|
-
if (origin.includes('dev')) {
|
|
171
|
-
return ENDPOINT_PATHS.DEV_BASE_URL;
|
|
172
|
-
}
|
|
173
|
-
if (origin.includes('sandbox')) {
|
|
174
|
-
return ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
175
|
-
}
|
|
176
|
-
return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
177
|
-
};
|
|
178
|
-
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherThanSAOrKWCountry) {
|
|
162
|
+
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser) {
|
|
179
163
|
if (flow === FlowsTypes.BANK) {
|
|
180
164
|
return 'BANK_BANK_DETAILS_STEP';
|
|
181
165
|
}
|
|
@@ -183,7 +167,7 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
183
167
|
return 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
184
168
|
}
|
|
185
169
|
if (flow === FlowsTypes.INDIVIDUAL) {
|
|
186
|
-
return isAuthorizedUser
|
|
170
|
+
return isAuthorizedUser ? 'INDIVIDUAL_LIST_STEP' : 'INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP';
|
|
187
171
|
}
|
|
188
172
|
if (flow === FlowsTypes.CONNECT) {
|
|
189
173
|
return 'CONNECT_NID_STEP';
|
|
@@ -197,9 +181,6 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
197
181
|
if (flow === FlowsTypes.ENTITY) {
|
|
198
182
|
return 'ENTITY_NAME_STEP';
|
|
199
183
|
}
|
|
200
|
-
if (flow === FlowsTypes.PASSWORD) {
|
|
201
|
-
return 'PASSWORD_CREATE_PASSWORD_STEP';
|
|
202
|
-
}
|
|
203
184
|
return '';
|
|
204
185
|
};
|
|
205
186
|
export var getEighteenYearsAgo = function () {
|
|
@@ -215,9 +196,6 @@ export var isSA = function (flag) {
|
|
|
215
196
|
export var isOtherThanKWOrSA = function (flag) {
|
|
216
197
|
return !isKW(flag) && !isSA(flag);
|
|
217
198
|
};
|
|
218
|
-
export var isKWOrSA = function (flag) {
|
|
219
|
-
return isKW(flag) || isSA(flag);
|
|
220
|
-
};
|
|
221
199
|
export var isLinkedIn = function (flag) {
|
|
222
200
|
return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
223
201
|
};
|
|
@@ -325,10 +303,3 @@ export var formatNumberAsCurrency = function (number) {
|
|
|
325
303
|
return '';
|
|
326
304
|
return parseInt(number).toLocaleString();
|
|
327
305
|
};
|
|
328
|
-
export var getCurrencyByCountryIso2 = function (countryCode) {
|
|
329
|
-
var _a;
|
|
330
|
-
if (!countryCode)
|
|
331
|
-
return '';
|
|
332
|
-
var currencyCode = (_a = COUNTRY_TO_CURRENCY[countryCode]) !== null && _a !== void 0 ? _a : '';
|
|
333
|
-
return currencyCode;
|
|
334
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.59-beta",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
22
|
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
23
|
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public --tag
|
|
24
|
+
"push": "npm publish --access public --tag beta"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
4
|
-
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
7
|
-
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
declare const Type: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default Type;
|
|
@@ -1,90 +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 { styled, alpha } from '@mui/material/styles';
|
|
15
|
-
import InfoIcon from '@mui/icons-material/Info';
|
|
16
|
-
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
19
|
-
import Text from '../../../../components/Text';
|
|
20
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
-
import Mandatory from '../../../shared/Mandatory';
|
|
22
|
-
import RadioLabel from '../../../../components/RadioLabel';
|
|
23
|
-
import { LicenseType } from '../../../../@types';
|
|
24
|
-
import RadioGroup from '../../../../components/RadioGroup';
|
|
25
|
-
import Tooltip from '../../../../components/Tooltip';
|
|
26
|
-
import Radio from '../../../../components/Radio';
|
|
27
|
-
import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
|
|
28
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
29
|
-
var LabelTextStyled = styled(Text)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
32
|
-
});
|
|
33
|
-
var RadioGroupStyled = styled(RadioGroup)(function (_a) {
|
|
34
|
-
var theme = _a.theme;
|
|
35
|
-
return ({
|
|
36
|
-
marginInlineStart: theme.spacing(0.25)
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var RadioStyled = styled(Radio)(function (_a) {
|
|
40
|
-
var theme = _a.theme;
|
|
41
|
-
return ({
|
|
42
|
-
'& .MuiSvgIcon-root': {
|
|
43
|
-
fontSize: theme.spacing(2.25),
|
|
44
|
-
width: theme.spacing(2.25),
|
|
45
|
-
height: theme.spacing(2.25)
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
var LabelStyled = styled('span')(function () { return ({
|
|
50
|
-
display: 'inline-flex',
|
|
51
|
-
alignItems: 'center'
|
|
52
|
-
}); });
|
|
53
|
-
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return ({
|
|
56
|
-
width: theme.spacing(2.75),
|
|
57
|
-
height: theme.spacing(2.125),
|
|
58
|
-
cursor: 'pointer',
|
|
59
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
60
|
-
display: 'inline-flex'
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
64
|
-
var theme = _a.theme;
|
|
65
|
-
return ({
|
|
66
|
-
width: theme.spacing(2.75),
|
|
67
|
-
height: theme.spacing(2.125),
|
|
68
|
-
cursor: 'pointer',
|
|
69
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
70
|
-
display: 'inline-flex'
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
var Type = function () {
|
|
74
|
-
var t = useTranslation().t;
|
|
75
|
-
var control = useFormContext().control;
|
|
76
|
-
var error = useAppSelector(connectExpressSelector).error;
|
|
77
|
-
var _a = React.useState(false), isCRHovered = _a[0], setIsCRHovered = _a[1];
|
|
78
|
-
var _b = React.useState(false), isFLHovered = _b[0], setIsFLHovered = _b[1];
|
|
79
|
-
var typeControl = useController({ control: control, name: 'licenseType' });
|
|
80
|
-
var dispatch = useAppDispatch();
|
|
81
|
-
var handleOnChange = function (_a) {
|
|
82
|
-
var target = _a.target;
|
|
83
|
-
if (error)
|
|
84
|
-
dispatch(clearError());
|
|
85
|
-
typeControl.field.onChange(target.value);
|
|
86
|
-
};
|
|
87
|
-
var typeValue = typeControl.field.value;
|
|
88
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
|
|
89
|
-
};
|
|
90
|
-
export default Type;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,34 +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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { isNetworkError } from '../../../../utils';
|
|
16
|
-
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
17
|
-
import DataLoading from '../../../shared/DataLoading';
|
|
18
|
-
import Button from '../../../shared/Button';
|
|
19
|
-
import { connectExpressSelector, retrieveDetailsAfterCreateAccountAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
20
|
-
var PrepareDataLoading = function (_a) {
|
|
21
|
-
var dispatch = useAppDispatch();
|
|
22
|
-
var isAr = useLanguage().isAr;
|
|
23
|
-
var t = useTranslation().t;
|
|
24
|
-
var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading;
|
|
25
|
-
React.useEffect(function () {
|
|
26
|
-
dispatch(retrieveDetailsAfterCreateAccountAsync());
|
|
27
|
-
}, []);
|
|
28
|
-
var onReTry = function () {
|
|
29
|
-
dispatch(retrieveDetailsAfterCreateAccountAsync());
|
|
30
|
-
};
|
|
31
|
-
var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
|
|
32
|
-
return (_jsx(DataLoading, __assign({ error: error }, { children: isNE && (_jsx(Button, __assign({ onClick: onReTry, disableBack: true, isAr: isAr, loading: loading }, { children: t('try_again') }))) })));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(PrepareDataLoading);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
4
|
-
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
7
|
-
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
export interface IsAuthorizedSwitchProps {
|
|
9
|
-
show: boolean;
|
|
10
|
-
readOnly?: boolean;
|
|
11
|
-
isVerified?: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: IsAuthorizedSwitchProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
-
export default _default;
|
|
@@ -1,76 +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 { useFormContext, useController } from 'react-hook-form';
|
|
16
|
-
import { styled, alpha } 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 { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
-
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
22
|
-
import Collapse from '../../../../components/Collapse';
|
|
23
|
-
import RadioGroup from '../../../../components/RadioGroup';
|
|
24
|
-
import RadioLabel from '../../../../components/RadioLabel';
|
|
25
|
-
import Text from '../../../../components/Text';
|
|
26
|
-
import Mandatory from '../../../shared/Mandatory';
|
|
27
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
28
|
-
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
29
|
-
var LabelTextStyled = styled(Text)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
32
|
-
});
|
|
33
|
-
var RadioGroupStyled = styled(RadioGroup)(function (_a) {
|
|
34
|
-
var theme = _a.theme;
|
|
35
|
-
return ({
|
|
36
|
-
marginInlineStart: theme.spacing(0.25)
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
40
|
-
var theme = _a.theme;
|
|
41
|
-
return ({
|
|
42
|
-
width: theme.spacing(2.75),
|
|
43
|
-
height: theme.spacing(2.125),
|
|
44
|
-
cursor: 'pointer',
|
|
45
|
-
color: alpha(theme.palette.text.primary, 0.4)
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
49
|
-
var theme = _a.theme;
|
|
50
|
-
return ({
|
|
51
|
-
width: theme.spacing(2.75),
|
|
52
|
-
height: theme.spacing(2.125),
|
|
53
|
-
cursor: 'pointer',
|
|
54
|
-
color: alpha(theme.palette.text.primary, 0.4)
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
var RadioLabelStyled = styled('span')(function () { return ({
|
|
58
|
-
display: 'flex'
|
|
59
|
-
}); });
|
|
60
|
-
var IsAuthorizedSwitch = function (_a) {
|
|
61
|
-
var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
62
|
-
var control = useFormContext().control;
|
|
63
|
-
var t = useTranslation().t;
|
|
64
|
-
var authorizedControl = useController({ name: 'isAuthorized', control: control });
|
|
65
|
-
var error = useAppSelector(individualSelector).error;
|
|
66
|
-
var dispatch = useAppDispatch();
|
|
67
|
-
var handleOnChange = function (_a) {
|
|
68
|
-
var target = _a.target;
|
|
69
|
-
if (error)
|
|
70
|
-
dispatch(clearError());
|
|
71
|
-
authorizedControl.field.onChange(target.value === 'yes');
|
|
72
|
-
};
|
|
73
|
-
var authorizedValue = authorizedControl.field.value;
|
|
74
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsx(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: _jsxs(LabelTextStyled, { children: [t('is_authorized_user_label'), _jsx(Mandatory, {})] }) })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: authorizedValue ? 'yes' : 'no', onChange: readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: _jsxs(RadioLabelStyled, { children: [t('yes'), authorizedValue && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) }), _jsx(RadioLabel, { value: 'no', label: _jsxs(RadioLabelStyled, { children: [t('no'), authorizedValue === false && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) })] }))] })) })));
|
|
75
|
-
};
|
|
76
|
-
export default React.memo(IsAuthorizedSwitch);
|