@tap-payments/auth-jsconnect 2.0.35-test → 2.0.35
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 +52 -21
- package/build/@types/app.js +10 -3
- package/build/@types/form.d.ts +18 -10
- package/build/api/auth.d.ts +24 -2
- package/build/api/auth.js +36 -1
- package/build/api/axios.js +2 -2
- package/build/api/brand.d.ts +2 -1
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +3 -1
- package/build/api/country.js +3 -1
- package/build/api/data.d.ts +38 -7
- package/build/api/data.js +57 -17
- package/build/api/entity.d.ts +53 -5
- package/build/api/entity.js +39 -9
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +44 -14
- package/build/api/individual.d.ts +76 -19
- package/build/api/individual.js +29 -2
- package/build/api/lead.d.ts +9 -6
- package/build/api/lead.js +8 -1
- package/build/app/rootReducer.d.ts +1 -1
- package/build/app/rootReducer.js +2 -2
- package/build/app/settings.d.ts +8 -2
- package/build/app/settings.js +29 -12
- package/build/app/store.d.ts +3 -3
- package/build/assets/locales/ar.json +258 -183
- package/build/assets/locales/en.json +190 -108
- package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
- package/build/components/AnimationFlow/AnimationFlow.js +6 -8
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +4 -3
- package/build/components/AnimationFlow/Dialog.d.ts +5 -1
- package/build/components/AnimationFlow/Dialog.js +11 -5
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
- package/build/components/ArabicDatePicker/index.d.ts +2 -0
- package/build/components/ArabicDatePicker/index.js +2 -0
- package/build/components/ArabicDatePicker/style.css +24 -0
- package/build/components/FileInput/DragAndDrop.d.ts +10 -1
- package/build/components/FileInput/DragAndDrop.js +108 -8
- package/build/components/Lottie/Lottie.d.ts +878 -0
- package/build/components/Lottie/Lottie.js +58 -0
- package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
- package/build/components/Lottie/files/success.json +425 -0
- package/build/components/Lottie/index.d.ts +3 -0
- package/build/components/Lottie/index.js +3 -0
- package/build/components/OTPField/OTPField.d.ts +2 -1
- package/build/components/OTPField/OTPField.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
- package/build/components/ProgressBar/CircularProgressBar.js +48 -0
- package/build/components/ProgressBar/index.d.ts +2 -0
- package/build/components/ProgressBar/index.js +2 -0
- package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
- package/build/components/RadioLabel/RadioLabel.js +2 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
- package/build/constants/api.d.ts +6 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +7 -5
- package/build/constants/app.js +56 -23
- package/build/constants/assets.d.ts +14 -0
- package/build/constants/assets.js +16 -2
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +2 -2
- package/build/constants/validation.d.ts +8 -0
- package/build/constants/validation.js +9 -1
- package/build/features/app/auth/authStore.d.ts +47 -0
- package/build/features/app/auth/authStore.js +260 -0
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +86 -39
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +432 -291
- package/build/features/app/connect/connectStore.d.ts +33 -31
- package/build/features/app/connect/connectStore.js +394 -308
- package/build/features/app/entity/entityStore.d.ts +30 -5
- package/build/features/app/entity/entityStore.js +258 -47
- package/build/features/app/individual/individualStore.d.ts +17 -0
- package/build/features/app/individual/individualStore.js +170 -84
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/tax/taxStore.js +18 -14
- package/build/features/auth/Auth.d.ts +10 -0
- package/build/features/auth/Auth.js +87 -0
- package/build/features/auth/index.d.ts +1 -0
- package/build/features/auth/index.js +1 -0
- package/build/features/auth/screens/NID/DOB.d.ts +7 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
- package/build/features/auth/screens/NID/IDNumber.js +64 -0
- package/build/features/auth/screens/NID/NID.d.ts +5 -0
- package/build/features/auth/screens/NID/NID.js +68 -0
- package/build/features/auth/screens/NID/TAC.d.ts +3 -0
- package/build/features/auth/screens/NID/TAC.js +87 -0
- package/build/features/auth/screens/NID/index.d.ts +3 -0
- package/build/features/auth/screens/NID/index.js +2 -0
- package/build/features/auth/screens/NID/validation.d.ts +27 -0
- package/build/features/auth/screens/NID/validation.js +19 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTP.js +76 -0
- package/build/features/{otp/screens/OTPVerify/Verify.d.ts → auth/screens/OTP/OTPInput.d.ts} +0 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/OTPInput.js +11 -7
- package/build/features/auth/screens/OTP/index.d.ts +3 -0
- package/build/features/auth/screens/OTP/index.js +2 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.d.ts +0 -0
- package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.js +0 -0
- package/build/features/bank/Bank.js +12 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/BankDetails/BankName.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
- package/build/features/bank/screens/BankDetails/validation.js +2 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +14 -7
- package/build/features/business/screens/Activities/Activities.js +16 -17
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
- package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
- package/build/features/business/screens/Activities/validation.d.ts +0 -51
- package/build/features/business/screens/Activities/validation.js +0 -9
- package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
- package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
- package/build/features/business/screens/BusinessType/EntityName.js +56 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +50 -1
- package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/business/screens/CivilID/CivilID.js +67 -0
- package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/business/screens/CivilID/IDNumber.js +59 -0
- package/build/features/business/screens/CivilID/index.d.ts +3 -0
- package/build/features/business/screens/CivilID/index.js +2 -0
- package/build/features/business/screens/CivilID/validation.d.ts +8 -0
- package/build/features/business/screens/CivilID/validation.js +4 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
- package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
- package/build/features/business/screens/Customers/Customers.js +15 -9
- package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
- package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
- package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
- package/build/features/business/screens/OTP/OTP.js +15 -2
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -7
- package/build/features/business/screens/Verify/Verify.js +4 -4
- package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/business/screens/VerifyPACI/index.js +2 -0
- package/build/features/connect/Connect.d.ts +2 -1
- package/build/features/connect/Connect.js +47 -12
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +99 -0
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connect/screens/CivilID/index.d.ts +3 -0
- package/build/features/connect/screens/CivilID/index.js +2 -0
- package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connect/screens/CivilID/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +11 -3
- package/build/features/connect/screens/Individual/Individual.js +41 -27
- package/build/features/connect/screens/Merchant/BrandList.js +15 -7
- package/build/features/connect/screens/Merchant/BrandName.js +7 -4
- package/build/features/connect/screens/Merchant/Merchant.js +41 -64
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
- package/build/features/connect/screens/Merchant/TAC.js +8 -2
- package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
- package/build/features/connect/screens/Merchant/validation.js +108 -173
- package/build/features/connect/screens/Mobile/Mobile.js +30 -12
- package/build/features/connect/screens/NID/NID.js +2 -1
- package/build/features/connect/screens/OTP/OTP.js +20 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -2
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.d.ts +1 -1
- package/build/features/entity/Entity.js +16 -9
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +55 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +149 -0
- package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
- package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +71 -2
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +32 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +49 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +33 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +68 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +24 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
- package/build/features/entity/screens/Verify/Verify.js +18 -5
- package/build/features/featuresScreens.d.ts +1 -1
- package/build/features/featuresScreens.js +31 -6
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +14 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
- package/build/features/individual/screens/Verify/Verify.js +18 -5
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +14 -7
- package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
- package/build/features/password/screens/OTP/OTP.js +15 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
- package/build/features/password/screens/Verify/Verify.js +16 -3
- package/build/features/shared/Background/Background.d.ts +6 -5
- package/build/features/shared/Background/Background.js +16 -5
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
- package/build/features/shared/Button/MobileButton.d.ts +2 -1
- package/build/features/shared/Button/MobileButton.js +2 -2
- package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
- package/build/features/shared/Dialog/CloseDialog.js +71 -0
- package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
- package/build/features/shared/Dialog/DialogContainer.js +56 -0
- package/build/features/shared/Dialog/index.d.ts +4 -0
- package/build/features/shared/Dialog/index.js +4 -0
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
- package/build/features/shared/UploadFile/UploadFile.js +24 -9
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +14 -6
- package/build/features/signIn/screens/Email/Email.js +4 -2
- package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
- package/build/features/signIn/screens/OTP/OTP.js +14 -1
- package/build/features/signIn/screens/Password/Password.js +15 -2
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +16 -8
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -7
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
- package/build/features/tax/screens/Verify/Verify.js +16 -3
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/useAppConfig.d.ts +3 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useAppDispatch.d.ts +1 -1
- package/build/hooks/useErrorListener.js +0 -6
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -0
- package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
- package/build/hooks/useSetFromDefaultValues.js +24 -0
- package/build/index.d.ts +3 -3
- package/build/index.js +5 -5
- package/build/utils/array.d.ts +13 -1
- package/build/utils/array.js +26 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +3 -0
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/locale.js +1 -1
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +12 -0
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +33 -20
- package/build/utils/string.js +71 -1
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +5 -4
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
- package/build/features/business/screens/Activities/SalesChannels.js +0 -112
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
|
@@ -9,9 +9,20 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
24
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
25
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
15
26
|
import { useTranslation } from 'react-i18next';
|
|
16
27
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
28
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
@@ -49,11 +60,13 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
49
60
|
var OTP = function (_a) {
|
|
50
61
|
var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
51
62
|
var dispatch = useAppDispatch();
|
|
63
|
+
var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
52
64
|
var methods = useForm({
|
|
53
65
|
resolver: yupResolver(OTPValidation),
|
|
54
|
-
defaultValues:
|
|
66
|
+
defaultValues: defaultValues,
|
|
55
67
|
mode: 'onChange'
|
|
56
68
|
});
|
|
69
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
57
70
|
var t = useTranslation().t;
|
|
58
71
|
var isAr = useLanguage().isAr;
|
|
59
72
|
React.useEffect(function () {
|
|
@@ -17,7 +17,7 @@ import { FlowsButtons } from '../../../shared/Button';
|
|
|
17
17
|
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
20
|
-
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
|
+
import { concatenateObjectValues, getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
@@ -44,13 +44,16 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
var SuccessWithFlowButtons = function () {
|
|
47
|
-
var _a, _b, _c;
|
|
47
|
+
var _a, _b, _c, _d;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var isAr = useLanguage().isAr;
|
|
50
50
|
var data = useAppSelector(businessSelector).data;
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
51
|
+
var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank_account, merchant = _e.merchant, identification = _e.identification;
|
|
52
|
+
var _f = useState([]), buttons = _f[0], setButtons = _f[1];
|
|
53
|
+
var _g = nameObj || {}, en = _g.en, ar = _g.ar;
|
|
54
|
+
var username = isAr
|
|
55
|
+
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
+
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
57
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
55
58
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
56
59
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -58,9 +61,9 @@ var SuccessWithFlowButtons = function () {
|
|
|
58
61
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
62
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
63
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
-
var maskedId = !!
|
|
64
|
+
var maskedId = !!(identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
62
65
|
var settings = useAppSelector(settingsSelector);
|
|
63
|
-
var
|
|
66
|
+
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
64
67
|
var email = (contact || { email: '' }).email;
|
|
65
68
|
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
|
|
66
69
|
var reMapFlowData = function (flows) {
|
|
@@ -47,9 +47,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
47
47
|
flexDirection: 'column'
|
|
48
48
|
}); });
|
|
49
49
|
var VerifyNumber = function (_a) {
|
|
50
|
-
var _b, _c
|
|
50
|
+
var _b, _c;
|
|
51
51
|
var dispatch = useAppDispatch();
|
|
52
|
-
var
|
|
52
|
+
var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
53
53
|
var methods = useForm({
|
|
54
54
|
resolver: yupResolver(OTPValidation),
|
|
55
55
|
defaultValues: data.otpData,
|
|
@@ -57,8 +57,8 @@ var VerifyNumber = function (_a) {
|
|
|
57
57
|
});
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
61
|
-
var phone = (
|
|
60
|
+
var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
|
|
61
|
+
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
|
|
62
62
|
React.useEffect(function () {
|
|
63
63
|
if (error && methods.formState.isValid && phone)
|
|
64
64
|
dispatch(clearError());
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import * as React from 'react';
|
|
50
|
+
import Box from '@mui/material/Box/Box';
|
|
51
|
+
import { styled } from '@mui/material/styles';
|
|
52
|
+
import { useTranslation } from 'react-i18next';
|
|
53
|
+
import Text from '../../../../components/Text';
|
|
54
|
+
import { businessSelector, verifyPACI as verifyPACIFun } from '../../../app/business/businessStore';
|
|
55
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
56
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
57
|
+
import { MobileButton } from '../../../shared/Button';
|
|
58
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
59
|
+
import Collapse from '../../../../components/Collapse';
|
|
60
|
+
import Warning from '../../../../components/Warning';
|
|
61
|
+
import { mobileOS, sleep } from '../../../../utils';
|
|
62
|
+
import VerifyPACILoading from './VerifyPACILoading';
|
|
63
|
+
import VerifyPACISuccess from './VerifyPACISuccess';
|
|
64
|
+
var VerifyPACITitleContainerStyled = styled(Box)(function (_a) {
|
|
65
|
+
var theme = _a.theme;
|
|
66
|
+
return ({
|
|
67
|
+
direction: theme.direction,
|
|
68
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
marginBottom: theme.spacing(2.5)
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var VerifyPACITitleStyled = styled(Text)(function (_a) {
|
|
76
|
+
var theme = _a.theme;
|
|
77
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
78
|
+
});
|
|
79
|
+
var VerifyPACISubTitleStyled = styled(Text)(function (_a) {
|
|
80
|
+
var theme = _a.theme;
|
|
81
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line', textAlign: 'center' }));
|
|
82
|
+
});
|
|
83
|
+
var Container = styled(Box)(function (_a) {
|
|
84
|
+
var theme = _a.theme;
|
|
85
|
+
return ({
|
|
86
|
+
position: 'relative',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
justifyContent: 'center',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
maxHeight: '300px'
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
var BackButton = styled('button')(function (_a) {
|
|
94
|
+
var theme = _a.theme;
|
|
95
|
+
return ({
|
|
96
|
+
cursor: 'pointer',
|
|
97
|
+
height: 44,
|
|
98
|
+
appearance: 'none',
|
|
99
|
+
background: 'none',
|
|
100
|
+
pointerEvents: 'auto',
|
|
101
|
+
border: 'none',
|
|
102
|
+
color: theme.palette.primary.main,
|
|
103
|
+
fontSize: theme.typography.body1.fontSize,
|
|
104
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
105
|
+
textTransform: 'capitalize',
|
|
106
|
+
'&:hover': {
|
|
107
|
+
backgroundColor: 'transparent'
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
var VerifyPACI = function () {
|
|
112
|
+
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
113
|
+
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
114
|
+
var dispatch = useAppDispatch();
|
|
115
|
+
var _c = useAppSelector(businessSelector), data = _c.data, error = _c.error;
|
|
116
|
+
var responseBody = data.civilIdData.responseBody;
|
|
117
|
+
var t = useTranslation().t;
|
|
118
|
+
var onSuccess = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0:
|
|
122
|
+
setSuccess(true);
|
|
123
|
+
return [4, sleep(2000)];
|
|
124
|
+
case 1:
|
|
125
|
+
_a.sent();
|
|
126
|
+
return [2];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}); };
|
|
130
|
+
React.useEffect(function () {
|
|
131
|
+
if (responseBody) {
|
|
132
|
+
setIsReady(true);
|
|
133
|
+
}
|
|
134
|
+
}, [responseBody]);
|
|
135
|
+
React.useEffect(function () {
|
|
136
|
+
if (!isReady)
|
|
137
|
+
return;
|
|
138
|
+
var promise = dispatch(verifyPACIFun({ onSuccess: onSuccess }));
|
|
139
|
+
return function () {
|
|
140
|
+
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
141
|
+
};
|
|
142
|
+
}, [isReady]);
|
|
143
|
+
var onRedirect = React.useCallback(function () {
|
|
144
|
+
if (os === 'Android') {
|
|
145
|
+
window.open(responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_android, '_blank');
|
|
146
|
+
}
|
|
147
|
+
if (os === 'iOS') {
|
|
148
|
+
window.open(responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios, '_blank');
|
|
149
|
+
}
|
|
150
|
+
}, [responseBody]);
|
|
151
|
+
var onBack = React.useCallback(function () {
|
|
152
|
+
dispatch(handlePrevScreenStep());
|
|
153
|
+
}, []);
|
|
154
|
+
var os = React.useMemo(function () { return mobileOS(); }, []);
|
|
155
|
+
var isAndroid = React.useMemo(function () { return os === 'Android' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
156
|
+
var isIOS = React.useMemo(function () { return os === 'iOS' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
157
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, { loop: !error }) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), _jsx(Collapse, __assign({ in: !!error, sx: { width: '100%' } }, { children: _jsx(Warning, { children: t(error) }) })), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
|
|
158
|
+
};
|
|
159
|
+
export default React.memo(VerifyPACI);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import LottieFile, { LottieAnimationFiles } from '../../../../components/Lottie';
|
|
5
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
6
|
+
import Icon from '../../../../components/Icon';
|
|
7
|
+
var IconStyled = styled(Icon)(function (_a) {
|
|
8
|
+
var theme = _a.theme;
|
|
9
|
+
return ({
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
top: '50%',
|
|
12
|
+
left: '50%',
|
|
13
|
+
transform: 'translate(-50%, -50%)',
|
|
14
|
+
width: 64,
|
|
15
|
+
height: 64
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
var VerifyPACILoading = function (_a) {
|
|
19
|
+
var _b = _a.loop, loop = _b === void 0 ? true : _b;
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.PACI_VERIFY_ICON })] }));
|
|
21
|
+
};
|
|
22
|
+
VerifyPACILoading.defaultProps = {};
|
|
23
|
+
export default memo(VerifyPACILoading);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import LottieFile, { LottieAnimationFiles } from '../../../../components/Lottie';
|
|
4
|
+
var VerifyPACISuccess = function () {
|
|
5
|
+
return (_jsx(_Fragment, { children: _jsx(LottieFile, { loop: false, file: LottieAnimationFiles.success, width: '90%' }) }));
|
|
6
|
+
};
|
|
7
|
+
VerifyPACISuccess.defaultProps = {};
|
|
8
|
+
export default memo(VerifyPACISuccess);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
3
|
export interface ConnectLibProps extends LibConfig {
|
|
4
|
+
onClose?: () => void;
|
|
4
5
|
}
|
|
5
6
|
export declare function ConnectLib(props: ConnectLibProps): JSX.Element;
|
|
6
7
|
export declare function renderConnectLib(config: ConnectLibProps, elementId: string): void;
|
|
7
|
-
export declare function unmountConnectLib(elementId: string): void;
|
|
8
|
+
export declare function unmountConnectLib(elementId: string, unmountTimeout?: number): void;
|
|
@@ -9,30 +9,58 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
24
|
+
import React, { memo } from 'react';
|
|
14
25
|
import { FeatureContainer } from '../shared/Containers';
|
|
15
|
-
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
16
|
-
import { settingsSelector } from '../../app/settings';
|
|
26
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useAppDispatch } from '../../hooks';
|
|
27
|
+
import { handleCurrentActiveScreen, settingsSelector, handleOpen } from '../../app/settings';
|
|
17
28
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
18
29
|
import { store } from '../../app/store';
|
|
19
|
-
import { connectSelector } from '../app/connect/connectStore';
|
|
30
|
+
import { connectSelector, setDefaultCountryCode } from '../app/connect/connectStore';
|
|
20
31
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
21
32
|
import Collapse from '../../components/Collapse';
|
|
22
|
-
import { reactElement } from '../../utils';
|
|
23
|
-
import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
|
|
33
|
+
import { reactElement, removeElement, isKW } from '../../utils';
|
|
34
|
+
import { CONNECT_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
24
35
|
import { connectFeatureScreens } from '../featuresScreens';
|
|
25
36
|
import CustomFooter from '../shared/Footer';
|
|
26
37
|
import Background from '../shared/Background';
|
|
27
|
-
var Connect = memo(function (
|
|
38
|
+
var Connect = memo(function (_a) {
|
|
39
|
+
var onClose = _a.onClose, props = __rest(_a, ["onClose"]);
|
|
28
40
|
var theme = useAppTheme().theme;
|
|
29
|
-
var
|
|
30
|
-
var
|
|
41
|
+
var dispatch = useAppDispatch();
|
|
42
|
+
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
43
|
+
var _c = useAppSelector(connectSelector), connectError = _c.error, loading = _c.loading;
|
|
31
44
|
useAppConfig(__assign({ navigation: CONNECT_SCREENS_NAVIGATION }, props));
|
|
32
45
|
useErrorListener(connectError || error);
|
|
33
46
|
useStepStartedListener();
|
|
34
47
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
|
-
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
var _a;
|
|
50
|
+
if (!settingLoading) {
|
|
51
|
+
if (isKW((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2))
|
|
52
|
+
dispatch(handleCurrentActiveScreen('CONNECT_MOBILE_STEP'));
|
|
53
|
+
}
|
|
54
|
+
}, [settingLoading]);
|
|
55
|
+
React.useEffect(function () {
|
|
56
|
+
var _a;
|
|
57
|
+
if (!!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2))
|
|
58
|
+
dispatch(setDefaultCountryCode(data.businessCountry));
|
|
59
|
+
}, [data.businessCountry]);
|
|
60
|
+
var handleDialogClose = function () {
|
|
61
|
+
dispatch(handleOpen(false));
|
|
62
|
+
};
|
|
63
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onClose: onClose, onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
36
64
|
var Element = _a.element, name = _a.name;
|
|
37
65
|
var isActive = activeScreen.name === name;
|
|
38
66
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -44,6 +72,13 @@ export function ConnectLib(props) {
|
|
|
44
72
|
export function renderConnectLib(config, elementId) {
|
|
45
73
|
reactElement(elementId).render(_jsx(ConnectLib, __assign({}, config)));
|
|
46
74
|
}
|
|
47
|
-
export function unmountConnectLib(elementId) {
|
|
48
|
-
|
|
75
|
+
export function unmountConnectLib(elementId, unmountTimeout) {
|
|
76
|
+
if (unmountTimeout === void 0) { unmountTimeout = 1000; }
|
|
77
|
+
var element = document.getElementById(elementId);
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
var _a;
|
|
80
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
81
|
+
removeElement(DIALOG_ID);
|
|
82
|
+
elementId && reactElement(elementId).unmount();
|
|
83
|
+
}, unmountTimeout);
|
|
49
84
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { useTranslation } from 'react-i18next';
|
|
26
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
27
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
28
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
29
|
+
import { civilIDValidationSchema } from './validation';
|
|
30
|
+
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
31
|
+
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
32
|
+
import { clearError, connectSelector, createCivilIdAuth, resetMobileScreen } from '../../../app/connect/connectStore';
|
|
33
|
+
import Form from '../../../../components/Form';
|
|
34
|
+
import Button, { MobileButton } from '../../../shared/Button';
|
|
35
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
|
+
import Collapse from '../../../../components/Collapse';
|
|
37
|
+
import Box from '@mui/material/Box';
|
|
38
|
+
import Divider from '@mui/material/Divider';
|
|
39
|
+
import Text from '../../../../components/Text';
|
|
40
|
+
import IDNumber from './IDNumber';
|
|
41
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'column'
|
|
44
|
+
}); });
|
|
45
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
46
|
+
var theme = _a.theme;
|
|
47
|
+
return ({
|
|
48
|
+
color: alpha(theme.palette.primary.dark, 0.4)
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var DividerStyled = styled(Divider)(function (_a) {
|
|
52
|
+
var theme = _a.theme;
|
|
53
|
+
return ({
|
|
54
|
+
width: '45%',
|
|
55
|
+
borderColor: alpha(theme.palette.primary.dark, 0.4),
|
|
56
|
+
marginBlockEnd: theme.spacing(0.62)
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var OrBoxStyled = styled(Box)(function (_a) {
|
|
60
|
+
var theme = _a.theme;
|
|
61
|
+
return ({
|
|
62
|
+
display: 'flex',
|
|
63
|
+
justifyContent: 'space-between',
|
|
64
|
+
marginBlockEnd: theme.spacing(1.62),
|
|
65
|
+
marginBlockStart: theme.spacing(-1.25),
|
|
66
|
+
marginInline: theme.spacing(2.5)
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
var CivilID = function (_a) {
|
|
70
|
+
var isAr = useLanguage().isAr;
|
|
71
|
+
var dispatch = useAppDispatch();
|
|
72
|
+
var t = useTranslation().t;
|
|
73
|
+
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
74
|
+
var settingsStore = useAppSelector(settingsSelector);
|
|
75
|
+
var _c = data.civilIdData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
76
|
+
var methods = useForm({
|
|
77
|
+
resolver: yupResolver(civilIDValidationSchema),
|
|
78
|
+
defaultValues: defaultValues,
|
|
79
|
+
mode: 'onChange'
|
|
80
|
+
});
|
|
81
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
82
|
+
React.useEffect(function () {
|
|
83
|
+
handleClearError();
|
|
84
|
+
}, [methods.formState.isValid]);
|
|
85
|
+
var onSubmit = function (data) {
|
|
86
|
+
dispatch(createCivilIdAuth(data));
|
|
87
|
+
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
88
|
+
};
|
|
89
|
+
var handleClearError = function () {
|
|
90
|
+
if (error)
|
|
91
|
+
dispatch(clearError());
|
|
92
|
+
};
|
|
93
|
+
var onBack = function () {
|
|
94
|
+
dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
|
|
95
|
+
};
|
|
96
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
97
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
|
|
98
|
+
};
|
|
99
|
+
export default React.memo(CivilID);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
interface IDNumberProps {
|
|
4
|
+
sx: SxProps<Theme> | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IDNumberProps & React.RefAttributes<unknown>>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 Box from '@mui/material/Box';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
import Input from '../../../shared/Input';
|
|
20
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
22
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
|
+
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
24
|
+
import { CIVIL_ID_NUMBER_LENGTH } from '../../../../constants';
|
|
25
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
36
|
+
});
|
|
37
|
+
var IDNumber = React.forwardRef(function (_a, ref) {
|
|
38
|
+
var _b;
|
|
39
|
+
var sx = _a.sx;
|
|
40
|
+
var t = useTranslation().t;
|
|
41
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
42
|
+
var civilIdControl = useController({ control: control, name: 'civilId' });
|
|
43
|
+
React.useEffect(function () {
|
|
44
|
+
if (civilIdControl.field.value)
|
|
45
|
+
setValue('civilId', civilIdControl.field.value, { shouldValidate: true });
|
|
46
|
+
}, []);
|
|
47
|
+
var handleIdChange = function (_a) {
|
|
48
|
+
var target = _a.target;
|
|
49
|
+
var value = removeAllOtherThanCharsAndNumber(target.value);
|
|
50
|
+
civilIdControl.field.onChange(value);
|
|
51
|
+
};
|
|
52
|
+
var clearIdNumber = function () {
|
|
53
|
+
civilIdControl.field.onChange('');
|
|
54
|
+
};
|
|
55
|
+
var idValue = civilIdControl.field.value;
|
|
56
|
+
var error = (_b = civilIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
57
|
+
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment: !error && idValue ? _jsx(CheckIcon, {}) : idValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: t('civil_id_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
|
|
58
|
+
});
|
|
59
|
+
export default React.memo(IDNumber);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const civilIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
civilId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
+
civilId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
+
civilId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>>;
|