@tap-payments/auth-jsconnect 2.0.42-test → 2.0.42
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 +50 -20
- package/build/@types/app.js +9 -3
- package/build/@types/form.d.ts +21 -12
- package/build/api/auth.d.ts +28 -5
- 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 +51 -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 +0 -1
- package/build/app/rootReducer.js +0 -2
- package/build/app/settings.d.ts +9 -2
- package/build/app/settings.js +22 -11
- package/build/app/store.d.ts +0 -2
- package/build/assets/locales/ar.json +258 -183
- package/build/assets/locales/en.json +190 -108
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -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 +4 -1
- package/build/components/AnimationFlow/Dialog.js +5 -3
- 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/DatePicker/customStyle.css +86 -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 +5 -5
- package/build/constants/app.js +62 -32
- 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 +10 -0
- package/build/constants/validation.js +11 -1
- package/build/features/app/auth/authStore.d.ts +30 -4
- package/build/features/app/auth/authStore.js +182 -20
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +88 -41
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +445 -296
- package/build/features/app/connect/connectStore.d.ts +34 -31
- package/build/features/app/connect/connectStore.js +427 -300
- package/build/features/app/entity/entityStore.d.ts +40 -8
- package/build/features/app/entity/entityStore.js +389 -149
- package/build/features/app/individual/individualStore.d.ts +18 -0
- package/build/features/app/individual/individualStore.js +178 -85
- package/build/features/app/password/passwordStore.d.ts +1 -7
- package/build/features/app/password/passwordStore.js +31 -20
- package/build/features/app/tax/taxStore.js +23 -16
- package/build/features/auth/Auth.d.ts +2 -1
- package/build/features/auth/Auth.js +37 -9
- 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.js +8 -4
- package/build/features/auth/screens/OTP/OTPInput.js +9 -2
- package/build/features/bank/Bank.js +4 -4
- 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/Success/Success.js +7 -3
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
- package/build/features/business/Business.js +4 -4
- 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 +26 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +52 -3
- 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/Success/Success.js +10 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
- 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 +1 -0
- package/build/features/connect/Connect.js +38 -10
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +102 -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 +44 -28
- 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 +33 -12
- package/build/features/connect/screens/NID/NID.js +5 -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.js +6 -6
- package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
- package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
- package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
- package/build/features/entity/screens/Customers/Customers.js +90 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
- package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
- package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
- package/build/features/entity/screens/Customers/index.d.ts +3 -0
- package/build/features/entity/screens/Customers/index.js +2 -0
- package/build/features/entity/screens/Customers/validation.d.ts +20 -0
- package/build/features/entity/screens/Customers/validation.js +13 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
- 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 +38 -10
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
- package/build/features/entity/screens/Success/Success.js +7 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
- package/build/features/entity/screens/Verify/Verify.js +18 -5
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +30 -7
- package/build/features/individual/Individual.js +4 -4
- 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/Success/Success.js +7 -3
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
- package/build/features/individual/screens/Verify/Verify.js +18 -5
- package/build/features/password/Password.js +4 -4
- 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/Success/Success.js +7 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
- package/build/features/password/screens/Verify/Verify.js +16 -3
- package/build/features/shared/Background/Background.d.ts +2 -5
- package/build/features/shared/Background/Background.js +7 -3
- 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 +3 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
- package/build/features/shared/UploadFile/UploadFile.js +24 -9
- package/build/features/signIn/SignIn.js +4 -4
- 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.js +6 -6
- package/build/features/tax/screens/Success/Success.js +9 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
- 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 +2 -2
- package/build/hooks/useAppDispatch.d.ts +0 -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.css +140 -0
- package/build/index.d.ts +2 -3
- package/build/index.js +1 -4
- package/build/utils/array.d.ts +49 -1
- package/build/utils/array.js +58 -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/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/string.d.ts +13 -0
- 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 +4 -3
- 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/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/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/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- 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
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
|
@@ -19,7 +19,7 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
19
19
|
import Collapse from '../../../../components/Collapse';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
21
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
22
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
23
23
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
25
25
|
import { clearError, createMobileAuth, signInSelector } from '../../../app/signIn/signInStore';
|
|
@@ -79,6 +79,10 @@ var Mobile = function (_a) {
|
|
|
79
79
|
defaultValues: { mobile: data.auth.mobile || '', countryCode: data.auth.countryCode },
|
|
80
80
|
mode: 'onChange'
|
|
81
81
|
});
|
|
82
|
+
useSetFromDefaultValues(methods, {
|
|
83
|
+
mobile: data.auth.mobile || '',
|
|
84
|
+
countryCode: data.auth.countryCode
|
|
85
|
+
});
|
|
82
86
|
var t = useTranslation().t;
|
|
83
87
|
var isAr = useLanguage().isAr;
|
|
84
88
|
var handleMenuListClick = function (flag) {
|
|
@@ -9,6 +9,17 @@ 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 Box from '@mui/material/Box/Box';
|
|
14
25
|
import { styled } from '@mui/material/styles';
|
|
@@ -18,7 +29,7 @@ import Text from '../../../../components/Text';
|
|
|
18
29
|
import { clearError, signInSelector, resetOTPScreen, verifyAuthOTP } from '../../../app/signIn/signInStore';
|
|
19
30
|
import Button from '../../../shared/Button';
|
|
20
31
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
32
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
22
33
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
34
|
import { useLanguage } from '../../../../hooks';
|
|
24
35
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -50,11 +61,13 @@ var OTP = function () {
|
|
|
50
61
|
var _a;
|
|
51
62
|
var dispatch = useAppDispatch();
|
|
52
63
|
var _b = useAppSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
64
|
+
var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
53
65
|
var methods = useForm({
|
|
54
66
|
resolver: yupResolver(OTPValidation),
|
|
55
67
|
defaultValues: data.otpData,
|
|
56
68
|
mode: 'onChange'
|
|
57
69
|
});
|
|
70
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
58
71
|
var t = useTranslation().t;
|
|
59
72
|
var isAr = useLanguage().isAr;
|
|
60
73
|
var isEmail = !!data.auth.email;
|
|
@@ -9,6 +9,17 @@ 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
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -17,7 +28,7 @@ import { useSelector } from 'react-redux';
|
|
|
17
28
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
29
|
import Box from '@mui/material/Box';
|
|
19
30
|
import { styled } from '@mui/material/styles';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
31
|
+
import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
|
|
21
32
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
33
|
import Form from '../../../../components/Form';
|
|
23
34
|
import { useLanguage } from '../../../../hooks';
|
|
@@ -38,11 +49,13 @@ var Password = function (_a) {
|
|
|
38
49
|
var dispatch = useAppDispatch();
|
|
39
50
|
var _b = useSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
40
51
|
var isEmail = !!data.auth.email;
|
|
52
|
+
var _c = data.passwordData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
41
53
|
var methods = useForm({
|
|
42
54
|
resolver: yupResolver(PasswordValidation),
|
|
43
|
-
defaultValues:
|
|
55
|
+
defaultValues: defaultValues,
|
|
44
56
|
mode: 'onChange'
|
|
45
57
|
});
|
|
58
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
46
59
|
var onSubmit = function (data) {
|
|
47
60
|
dispatch(verifyAuthPassword(data));
|
|
48
61
|
};
|
|
@@ -27,8 +27,8 @@ import Background from '../shared/Background';
|
|
|
27
27
|
var Tax = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
|
-
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error,
|
|
31
|
-
var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error;
|
|
30
|
+
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
+
var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error, loading = _b.loading;
|
|
32
32
|
useAppConfig(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(taxError || error);
|
|
34
34
|
useStepStartedListener();
|
|
@@ -43,10 +43,10 @@ var Tax = memo(function (props) {
|
|
|
43
43
|
dispatch(verifyLeadToken(token));
|
|
44
44
|
};
|
|
45
45
|
useEffect(function () {
|
|
46
|
-
if (!
|
|
46
|
+
if (!settingLoading && open)
|
|
47
47
|
verifyToken();
|
|
48
|
-
}, [
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading:
|
|
48
|
+
}, [settingLoading]);
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -66,6 +66,6 @@ export function unmountTaxLib(elementId, unmountTimeout) {
|
|
|
66
66
|
var _a;
|
|
67
67
|
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
68
68
|
dialogEl && dialogEl.remove();
|
|
69
|
-
reactElement(elementId).unmount();
|
|
69
|
+
elementId && reactElement(elementId).unmount();
|
|
70
70
|
}, unmountTimeout);
|
|
71
71
|
}
|
|
@@ -7,10 +7,16 @@ import SuccessScreen from '../../../shared/SuccessScreen';
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(taxSelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(taxSelector), error = _b.error, data = _b.data;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
var responseBody = data.verify.responseBody;
|
|
13
|
+
var updateBoardSuccessLoading = (responseBody || {}).updateBoardSuccessLoading;
|
|
14
|
+
React.useEffect(function () {
|
|
12
15
|
dispatch(updateLeadSuccess());
|
|
16
|
+
}, []);
|
|
17
|
+
var onSuccess = function () {
|
|
18
|
+
setClicked(true);
|
|
13
19
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading:
|
|
20
|
+
return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && updateBoardSuccessLoading, error: error || '' }));
|
|
15
21
|
};
|
|
16
22
|
export default React.memo(Success);
|
|
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
|
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
17
|
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
19
|
+
import { getResetFlowUrl, showLastFour, concatenateObjectValues } from '../../../../utils';
|
|
20
20
|
import { taxSelector } from '../../../app/tax/taxStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -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(taxSelector).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, merchant = _e.merchant, vatID = _e.vatID, user = _e.user;
|
|
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,10 @@ 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
|
|
64
|
+
var identification = user.identification;
|
|
65
|
+
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
66
|
var settings = useAppSelector(settingsSelector);
|
|
63
|
-
var
|
|
67
|
+
var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
|
|
64
68
|
var email = (contact || { email: '' }).email;
|
|
65
69
|
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
|
|
66
70
|
var reMapFlowData = function (flows) {
|
|
@@ -74,10 +78,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
74
78
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
75
79
|
individual_name: username.toLowerCase() + maskedId,
|
|
76
80
|
business_type: brandName,
|
|
77
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
81
|
+
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
78
82
|
bank_name: bankName,
|
|
79
|
-
iban: t('masking_symbols') + iban,
|
|
80
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
83
|
+
iban: iban ? t('masking_symbols') + iban : '',
|
|
84
|
+
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
81
85
|
});
|
|
82
86
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
83
87
|
var isIndividual = name === 'individual';
|
|
@@ -9,10 +9,21 @@ 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 { ScreenContainer } from '../../../shared/Containers';
|
|
14
25
|
import Button from '../../../shared/Button';
|
|
15
|
-
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
26
|
+
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
16
27
|
import { useTranslation } from 'react-i18next';
|
|
17
28
|
import { styled } from '@mui/material/styles';
|
|
18
29
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -32,11 +43,13 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
32
43
|
var TaxDetails = function () {
|
|
33
44
|
var dispatch = useAppDispatch();
|
|
34
45
|
var _a = useAppSelector(taxSelector), data = _a.data, loading = _a.loading, error = _a.error;
|
|
46
|
+
var _b = data.taxData, responseBody = _b.responseBody, defaultValues = __rest(_b, ["responseBody"]);
|
|
35
47
|
var methods = useForm({
|
|
36
48
|
resolver: yupResolver(Validation),
|
|
37
|
-
defaultValues:
|
|
49
|
+
defaultValues: defaultValues,
|
|
38
50
|
mode: 'onChange'
|
|
39
51
|
});
|
|
52
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
40
53
|
var t = useTranslation().t;
|
|
41
54
|
var isAr = useLanguage().isAr;
|
|
42
55
|
var onSubmit = function (data) {
|
|
@@ -45,6 +58,6 @@ var TaxDetails = function () {
|
|
|
45
58
|
var onBack = function () {
|
|
46
59
|
dispatch(handleCurrentActiveScreen('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
47
60
|
};
|
|
48
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
61
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
49
62
|
};
|
|
50
63
|
export default TaxDetails;
|
|
@@ -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 } from '../../../../hooks';
|
|
25
|
+
import { useAppDispatch, 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';
|
|
@@ -50,14 +61,16 @@ var VerifyNumber = function (_a) {
|
|
|
50
61
|
var _b, _c, _d;
|
|
51
62
|
var dispatch = useAppDispatch();
|
|
52
63
|
var _e = useAppSelector(taxSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
64
|
+
var _f = data.otpData, responseBody = _f.responseBody, defaultValues = __rest(_f, ["responseBody"]);
|
|
53
65
|
var methods = useForm({
|
|
54
66
|
resolver: yupResolver(OTPValidation),
|
|
55
|
-
defaultValues:
|
|
67
|
+
defaultValues: defaultValues,
|
|
56
68
|
mode: 'onChange'
|
|
57
69
|
});
|
|
70
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
58
71
|
var t = useTranslation().t;
|
|
59
72
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
73
|
+
var _g = React.useState(false), resendLoading = _g[0], setResendLoading = _g[1];
|
|
61
74
|
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
62
75
|
React.useEffect(function () {
|
|
63
76
|
if (error && methods.formState.isValid && phone)
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LibConfig, ScreenStepNavigation } from '../@types';
|
|
2
2
|
interface AppConfigProps extends LibConfig {
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
|
+
disableCountries?: boolean;
|
|
5
|
+
disableLocale?: boolean;
|
|
4
6
|
}
|
|
5
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, ...rest }: AppConfigProps) => void;
|
|
7
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, ...rest }: AppConfigProps) => void;
|
|
6
8
|
export {};
|
|
@@ -27,7 +27,7 @@ import { axiosInstance } from '../api';
|
|
|
27
27
|
import { isTapDomain, removeRequestHeaders } from '../utils';
|
|
28
28
|
import { ENDPOINT_PATHS } from '../constants';
|
|
29
29
|
export var useAppConfig = function (_a) {
|
|
30
|
-
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
|
|
30
|
+
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale"]);
|
|
31
31
|
var dispatch = useAppDispatch();
|
|
32
32
|
var setBaseUrl = function () {
|
|
33
33
|
var isProd = publicKey.includes('pk_live');
|
|
@@ -56,6 +56,6 @@ export var useAppConfig = function (_a) {
|
|
|
56
56
|
setBaseUrl();
|
|
57
57
|
setAppConfig();
|
|
58
58
|
dispatch(handleLanguage(rest.language));
|
|
59
|
-
dispatch(fetchAppSettingsSync());
|
|
59
|
+
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale, mdn: rest.merchantDomain }));
|
|
60
60
|
}, []);
|
|
61
61
|
};
|
|
@@ -8,6 +8,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
8
8
|
password: import("../features/app/password/passwordStore").PasswordState;
|
|
9
9
|
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
10
10
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
11
|
-
otp: import("../features/app/otp/otpStore").OtpState;
|
|
12
11
|
auth: import("../features/app/auth/authStore").AuthState;
|
|
13
12
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
|
@@ -9,10 +9,4 @@ export var useErrorListener = function (error) {
|
|
|
9
9
|
(_b = (_a = settings.data.appConfig) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
10
10
|
}
|
|
11
11
|
}, [error]);
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
if (!settings.error && !settings.loading) {
|
|
15
|
-
(_b = (_a = settings.data.appConfig).onReady) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
16
|
-
}
|
|
17
|
-
}, [settings.error, settings.loading]);
|
|
18
12
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useWindowSize } from '.';
|
|
3
|
+
import { useTheme } from '@mui/material/styles';
|
|
4
|
+
export var useScreen = function (breakpoint) {
|
|
5
|
+
if (breakpoint === void 0) { breakpoint = 'sm'; }
|
|
6
|
+
var _a = useState(false), small = _a[0], setSmall = _a[1];
|
|
7
|
+
var width = useWindowSize().width;
|
|
8
|
+
var theme = useTheme();
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
var target = theme.breakpoints.values[breakpoint || 'sm'];
|
|
11
|
+
setSmall(width < target);
|
|
12
|
+
}, [width]);
|
|
13
|
+
return { small: small };
|
|
14
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
var isValidValue = function (value) {
|
|
3
|
+
if (Array.isArray(value))
|
|
4
|
+
return value.length > 0;
|
|
5
|
+
if (typeof value === 'object')
|
|
6
|
+
return Object.keys(value).length > 0;
|
|
7
|
+
return value !== undefined && value !== null && value !== '';
|
|
8
|
+
};
|
|
9
|
+
export var useSetFromDefaultValues = function (method, defaultValues, shouldValidate) {
|
|
10
|
+
if (shouldValidate === void 0) { shouldValidate = false; }
|
|
11
|
+
var setFromDefaultValues = function () {
|
|
12
|
+
for (var key in defaultValues) {
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(defaultValues, key)) {
|
|
14
|
+
var value = defaultValues[key];
|
|
15
|
+
if (!isValidValue(method.getValues(key)) && isValidValue(value)) {
|
|
16
|
+
method.setValue(key, value, { shouldValidate: shouldValidate });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
setFromDefaultValues();
|
|
23
|
+
}, [defaultValues]);
|
|
24
|
+
};
|
package/build/index.css
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
|
|
2
|
+
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap');
|
|
3
|
+
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
|
|
4
|
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap');
|
|
5
|
+
@import url('https://fonts.googleapis.com/css?family=Tajawal&display=swap');
|
|
6
|
+
|
|
7
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
8
|
+
v2.0 | 20110126
|
|
9
|
+
License: none (public domain)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
html,
|
|
13
|
+
body,
|
|
14
|
+
div,
|
|
15
|
+
span,
|
|
16
|
+
applet,
|
|
17
|
+
object,
|
|
18
|
+
iframe,
|
|
19
|
+
h1,
|
|
20
|
+
h2,
|
|
21
|
+
h3,
|
|
22
|
+
h4,
|
|
23
|
+
h5,
|
|
24
|
+
h6,
|
|
25
|
+
p,
|
|
26
|
+
blockquote,
|
|
27
|
+
pre,
|
|
28
|
+
a,
|
|
29
|
+
abbr,
|
|
30
|
+
acronym,
|
|
31
|
+
address,
|
|
32
|
+
big,
|
|
33
|
+
cite,
|
|
34
|
+
code,
|
|
35
|
+
del,
|
|
36
|
+
dfn,
|
|
37
|
+
em,
|
|
38
|
+
img,
|
|
39
|
+
ins,
|
|
40
|
+
kbd,
|
|
41
|
+
q,
|
|
42
|
+
s,
|
|
43
|
+
samp,
|
|
44
|
+
small,
|
|
45
|
+
strike,
|
|
46
|
+
strong,
|
|
47
|
+
sub,
|
|
48
|
+
sup,
|
|
49
|
+
tt,
|
|
50
|
+
var,
|
|
51
|
+
b,
|
|
52
|
+
u,
|
|
53
|
+
i,
|
|
54
|
+
center,
|
|
55
|
+
dl,
|
|
56
|
+
dt,
|
|
57
|
+
dd,
|
|
58
|
+
ol,
|
|
59
|
+
ul,
|
|
60
|
+
li,
|
|
61
|
+
fieldset,
|
|
62
|
+
form,
|
|
63
|
+
label,
|
|
64
|
+
legend,
|
|
65
|
+
table,
|
|
66
|
+
caption,
|
|
67
|
+
tbody,
|
|
68
|
+
tfoot,
|
|
69
|
+
thead,
|
|
70
|
+
tr,
|
|
71
|
+
th,
|
|
72
|
+
td,
|
|
73
|
+
article,
|
|
74
|
+
aside,
|
|
75
|
+
canvas,
|
|
76
|
+
details,
|
|
77
|
+
embed,
|
|
78
|
+
figure,
|
|
79
|
+
figcaption,
|
|
80
|
+
footer,
|
|
81
|
+
header,
|
|
82
|
+
hgroup,
|
|
83
|
+
menu,
|
|
84
|
+
nav,
|
|
85
|
+
output,
|
|
86
|
+
ruby,
|
|
87
|
+
section,
|
|
88
|
+
summary,
|
|
89
|
+
time,
|
|
90
|
+
mark,
|
|
91
|
+
audio,
|
|
92
|
+
video {
|
|
93
|
+
margin: 0;
|
|
94
|
+
padding: 0;
|
|
95
|
+
border: 0;
|
|
96
|
+
font-size: 100%;
|
|
97
|
+
font: inherit;
|
|
98
|
+
vertical-align: baseline;
|
|
99
|
+
}
|
|
100
|
+
/* HTML5 display-role reset for older browsers */
|
|
101
|
+
article,
|
|
102
|
+
aside,
|
|
103
|
+
details,
|
|
104
|
+
figcaption,
|
|
105
|
+
figure,
|
|
106
|
+
footer,
|
|
107
|
+
header,
|
|
108
|
+
hgroup,
|
|
109
|
+
menu,
|
|
110
|
+
nav,
|
|
111
|
+
section {
|
|
112
|
+
display: block;
|
|
113
|
+
}
|
|
114
|
+
body {
|
|
115
|
+
line-height: 1;
|
|
116
|
+
overflow-y: hidden;
|
|
117
|
+
}
|
|
118
|
+
ol,
|
|
119
|
+
ul {
|
|
120
|
+
list-style: none;
|
|
121
|
+
}
|
|
122
|
+
blockquote,
|
|
123
|
+
q {
|
|
124
|
+
quotes: none;
|
|
125
|
+
}
|
|
126
|
+
blockquote:before,
|
|
127
|
+
blockquote:after,
|
|
128
|
+
q:before,
|
|
129
|
+
q:after {
|
|
130
|
+
content: '';
|
|
131
|
+
content: none;
|
|
132
|
+
}
|
|
133
|
+
table {
|
|
134
|
+
border-collapse: collapse;
|
|
135
|
+
border-spacing: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
* {
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
}
|
package/build/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { BankLib, renderBankLib, BankLibProps, unmountBankLib } from './features
|
|
|
8
8
|
import { TaxLib, renderTaxLib, TaxLibProps, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, SignInLibProps, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, OTPLibProps, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps,
|
|
14
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, AuthLibProps, SignInLibProps };
|
|
13
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
package/build/index.js
CHANGED
|
@@ -8,9 +8,8 @@ import { BankLib, renderBankLib, unmountBankLib } from './features/bank';
|
|
|
8
8
|
import { TaxLib, renderTaxLib, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
|
14
13
|
window['TapAuth'] = {
|
|
15
14
|
renderConnectLib: renderConnectLib,
|
|
16
15
|
unmountConnectLib: unmountConnectLib,
|
|
@@ -26,8 +25,6 @@ window['TapAuth'] = {
|
|
|
26
25
|
unmountTaxLib: unmountTaxLib,
|
|
27
26
|
renderEntityLib: renderEntityLib,
|
|
28
27
|
unmountEntityLib: unmountEntityLib,
|
|
29
|
-
renderOTPLib: renderOTPLib,
|
|
30
|
-
unmountOTPLib: unmountOTPLib,
|
|
31
28
|
renderSignInLib: renderSignInLib,
|
|
32
29
|
unmountSignInLib: unmountSignInLib,
|
|
33
30
|
renderAuthLib: renderAuthLib,
|
package/build/utils/array.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CountryCode } from '../@types';
|
|
1
|
+
import { CountryCode, SaleChannel } from '../@types';
|
|
2
2
|
export declare const isArray: (value: any) => value is any[];
|
|
3
3
|
export declare const joinArray: (items: Array<any>, joiner?: string) => string;
|
|
4
4
|
export declare const replaceStringArrayItems: (items: Array<string>, include: string, withThis: string) => string[];
|
|
@@ -11,3 +11,51 @@ export declare const isExist: (items: Array<any>, id: string) => any;
|
|
|
11
11
|
export declare const allAreTruthy: (items: Array<any>, condition: boolean | string, key: string, exclude?: string) => boolean;
|
|
12
12
|
export declare const sortCountries: (countries: Array<CountryCode>) => CountryCode[];
|
|
13
13
|
export declare const findCountryByIso2: (countries: Array<CountryCode>, iso2: string) => CountryCode | undefined;
|
|
14
|
+
export declare const findCountryByIddPrefix: (countries: Array<CountryCode>, iddPrefix: string) => CountryCode | undefined;
|
|
15
|
+
export declare const mapSalesChannel: (salesChannel: Array<SaleChannel>) => {
|
|
16
|
+
sub?: import("../@types").SubSaleChannel[] | undefined;
|
|
17
|
+
address: string;
|
|
18
|
+
id: string;
|
|
19
|
+
code: string;
|
|
20
|
+
name?: {
|
|
21
|
+
ar: string;
|
|
22
|
+
en: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
logo?: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
export declare const mapBrandSalesChannel: (salesChannel: Array<SaleChannel>, brandSalesChannel: Array<SaleChannel>) => ({
|
|
27
|
+
sub: ({
|
|
28
|
+
id: string;
|
|
29
|
+
code: string;
|
|
30
|
+
name?: {
|
|
31
|
+
ar: string;
|
|
32
|
+
en: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
address?: string | undefined;
|
|
35
|
+
logo?: string | undefined;
|
|
36
|
+
} | undefined)[] | undefined;
|
|
37
|
+
id: string;
|
|
38
|
+
code: string;
|
|
39
|
+
name?: {
|
|
40
|
+
ar: string;
|
|
41
|
+
en: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
address?: string | undefined;
|
|
44
|
+
logo?: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
sub?: import("../@types").SubSaleChannel[] | undefined;
|
|
47
|
+
id: string;
|
|
48
|
+
code: string;
|
|
49
|
+
name?: {
|
|
50
|
+
ar: string;
|
|
51
|
+
en: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
address?: string | undefined;
|
|
54
|
+
logo?: string | undefined;
|
|
55
|
+
} | undefined)[];
|
|
56
|
+
export declare const removeDuplicationById: (items: Array<any>) => any[];
|
|
57
|
+
export declare const fixBrandList: (items: Array<{
|
|
58
|
+
channel_services: Array<SaleChannel>;
|
|
59
|
+
}>, salesChannel: Array<SaleChannel>) => {
|
|
60
|
+
channel_services: any[];
|
|
61
|
+
}[];
|