@tap-payments/auth-jsconnect 1.0.4 → 1.0.7
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 +74 -0
- package/build/@types/app.js +11 -1
- package/build/@types/theme.d.ts +12 -3
- package/build/@types/theme.js +15 -1
- package/build/app/rootReducer.d.ts +1 -1
- package/build/app/rootReducer.js +1 -1
- package/build/app/settings.d.ts +7 -2
- package/build/app/settings.js +36 -6
- package/build/app/store.d.ts +2 -2
- package/build/assets/locales/ar.json +70 -3
- package/build/assets/locales/en.json +69 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +3 -2
- package/build/components/AnimationFlow/BottomSheet.js +30 -3
- package/build/components/AnimationFlow/Dialog.d.ts +3 -2
- package/build/components/AnimationFlow/Dialog.js +26 -18
- package/build/components/Button/Button.d.ts +7 -3
- package/build/components/Button/Button.js +20 -2
- package/build/components/Collapse/Collapse.d.ts +5 -0
- package/build/components/Collapse/Collapse.js +28 -0
- package/build/components/Collapse/index.d.ts +3 -0
- package/build/components/Collapse/index.js +2 -0
- package/build/components/DatePicker/DatePicker.js +3 -3
- package/build/components/Footer/Footer.js +1 -1
- package/build/components/Input/Input.d.ts +4 -1
- package/build/components/Input/Input.js +7 -5
- package/build/components/Loader/Loader.d.ts +10 -8
- package/build/components/Loader/Loader.js +21 -41
- package/build/components/OTPField/OTPField.js +3 -23
- package/build/components/OTPTimer/OTPTimer.d.ts +4 -2
- package/build/components/OTPTimer/OTPTimer.js +20 -8
- package/build/components/Providers/ThemeProvider.js +6 -9
- package/build/components/SimpleList/SimpleList.d.ts +11 -3
- package/build/components/SimpleList/SimpleList.js +51 -22
- package/build/components/Slide/Slide.d.ts +6 -0
- package/build/components/Slide/Slide.js +30 -0
- package/build/components/Slide/index.d.ts +3 -0
- package/build/components/Slide/index.js +2 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +14 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +86 -0
- package/build/components/SocialMediaGroup/index.d.ts +3 -0
- package/build/components/SocialMediaGroup/index.js +2 -0
- package/build/components/ToggleButton/ToggleButton.d.ts +5 -0
- package/build/components/ToggleButton/ToggleButton.js +44 -0
- package/build/components/ToggleButton/index.d.ts +3 -0
- package/build/components/ToggleButton/index.js +2 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +5 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.js +37 -0
- package/build/components/ToggleButtonGroup/index.d.ts +3 -0
- package/build/components/ToggleButtonGroup/index.js +2 -0
- package/build/components/Tooltip/Tooltip.d.ts +10 -0
- package/build/components/Tooltip/Tooltip.js +44 -0
- package/build/components/Tooltip/index.d.ts +3 -0
- package/build/components/Tooltip/index.js +2 -0
- package/build/components/Warning/Warning.d.ts +2 -1
- package/build/components/Warning/Warning.js +4 -19
- package/build/constants/app.d.ts +14 -4
- package/build/constants/app.js +145 -4
- package/build/constants/assets.d.ts +11 -0
- package/build/constants/assets.js +12 -1
- package/build/constants/dummy.d.ts +103 -0
- package/build/constants/dummy.js +219 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/validation.d.ts +6 -0
- package/build/constants/validation.js +6 -0
- package/build/features/app/{midStore.d.ts → business/midStore.d.ts} +2 -2
- package/build/features/app/{midStore.js → business/midStore.js} +0 -0
- package/build/features/app/connect/midStore.d.ts +10 -0
- package/build/features/app/connect/midStore.js +18 -0
- package/build/features/bank/Bank.d.ts +6 -0
- package/build/features/bank/Bank.js +48 -0
- package/build/features/bank/index.d.ts +1 -0
- package/build/features/bank/index.js +1 -0
- package/build/features/bank/screens/BankDetails/BankDetails.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/BankDetails.js +57 -0
- package/build/features/bank/screens/BankDetails/BankName.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/BankName.js +27 -0
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/Beneficiary.js +34 -0
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/IBAN.js +35 -0
- package/build/features/bank/screens/BankDetails/index.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/index.js +2 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -0
- package/build/features/bank/screens/BankDetails/validation.js +9 -0
- package/build/features/business/Business.d.ts +6 -0
- package/build/features/business/Business.js +61 -0
- package/build/features/business/index.d.ts +1 -0
- package/build/features/business/index.js +1 -0
- package/build/features/business/screens/Activities/Activities.d.ts +5 -0
- package/build/features/business/screens/Activities/Activities.js +83 -0
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +70 -0
- package/build/features/business/screens/Activities/ActivitiesList.js +136 -0
- package/build/features/business/screens/Activities/SalesChannels.d.ts +5 -0
- package/build/features/business/screens/Activities/SalesChannels.js +107 -0
- package/build/features/business/screens/Activities/index.d.ts +3 -0
- package/build/features/business/screens/Activities/index.js +2 -0
- package/build/features/business/screens/Activities/validation.d.ts +119 -0
- package/build/features/business/screens/Activities/validation.js +17 -0
- package/build/features/business/screens/BusinessType/BusinessType.d.ts +12 -0
- package/build/features/business/screens/BusinessType/BusinessType.js +85 -0
- package/build/features/business/screens/BusinessType/CRNumber.d.ts +6 -0
- package/build/features/business/screens/BusinessType/CRNumber.js +40 -0
- package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +11 -0
- package/build/features/business/screens/BusinessType/CompanyLicense.js +109 -0
- package/build/features/business/screens/BusinessType/FLNumber.d.ts +6 -0
- package/build/features/business/screens/BusinessType/FLNumber.js +40 -0
- package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +11 -0
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +112 -0
- package/build/features/business/screens/BusinessType/SelectType.d.ts +8 -0
- package/build/features/business/screens/BusinessType/SelectType.js +106 -0
- package/build/features/business/screens/BusinessType/Switch.d.ts +7 -0
- package/build/features/business/screens/BusinessType/Switch.js +35 -0
- package/build/features/business/screens/BusinessType/index.d.ts +3 -0
- package/build/features/business/screens/BusinessType/index.js +2 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +15 -0
- package/build/features/business/screens/BusinessType/validation.js +14 -0
- package/build/features/business/screens/Confirm/Confirm.d.ts +5 -0
- package/build/features/business/screens/Confirm/Confirm.js +53 -0
- package/build/features/business/screens/Confirm/index.d.ts +3 -0
- package/build/features/business/screens/Confirm/index.js +2 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +92 -0
- package/build/features/business/screens/Customers/CustomerLocations.js +122 -0
- package/build/features/business/screens/Customers/Customers.d.ts +5 -0
- package/build/features/business/screens/Customers/Customers.js +92 -0
- package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +7 -0
- package/build/features/business/screens/Customers/ExpectedCustomers.js +78 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +7 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +74 -0
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +44 -0
- package/build/features/business/screens/Customers/RefundPolicy.js +86 -0
- package/build/features/business/screens/Customers/TransactionPolicy.d.ts +3 -0
- package/build/features/business/screens/Customers/TransactionPolicy.js +37 -0
- package/build/features/business/screens/Customers/index.d.ts +3 -0
- package/build/features/business/screens/Customers/index.js +2 -0
- package/build/features/business/screens/Customers/validation.d.ts +20 -0
- package/build/features/business/screens/Customers/validation.js +8 -0
- package/build/features/business/screens/IDBOD/DOB.d.ts +5 -0
- package/build/features/business/screens/IDBOD/DOB.js +44 -0
- package/build/features/business/screens/IDBOD/ID.d.ts +5 -0
- package/build/features/business/screens/IDBOD/ID.js +69 -0
- package/build/features/business/screens/IDBOD/IDBOD.d.ts +5 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +85 -0
- package/build/features/business/screens/IDBOD/index.d.ts +3 -0
- package/build/features/business/screens/IDBOD/index.js +2 -0
- package/build/features/business/screens/IDBOD/validation.d.ts +11 -0
- package/build/features/business/screens/IDBOD/validation.js +5 -0
- package/build/features/business/screens/OTP/OTP.d.ts +11 -0
- package/build/features/business/screens/OTP/OTP.js +112 -0
- package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPInput.js +51 -0
- package/build/features/business/screens/OTP/OTPTimer.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPTimer.js +20 -0
- package/build/features/business/screens/OTP/index.d.ts +3 -0
- package/build/features/business/screens/OTP/index.js +2 -0
- package/build/features/business/screens/OTP/validation.d.ts +8 -0
- package/build/features/business/screens/OTP/validation.js +4 -0
- package/build/features/business/screens/Success/Success.d.ts +5 -0
- package/build/features/business/screens/Success/Success.js +15 -0
- package/build/features/business/screens/Success/index.d.ts +3 -0
- package/build/features/business/screens/Success/index.js +2 -0
- package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +6 -0
- package/build/features/business/screens/VerifyNumber/OTPInput.js +68 -0
- package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +5 -0
- package/build/features/business/screens/VerifyNumber/OTPTimer.js +20 -0
- package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +13 -0
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +119 -0
- package/build/features/business/screens/VerifyNumber/index.d.ts +3 -0
- package/build/features/business/screens/VerifyNumber/index.js +2 -0
- package/build/features/business/screens/VerifyNumber/validation.d.ts +8 -0
- package/build/features/business/screens/VerifyNumber/validation.js +4 -0
- package/build/features/connect/Connect.js +20 -22
- package/build/features/connect/screens/Individual/Email.d.ts +5 -0
- package/build/features/connect/screens/Individual/Email.js +31 -0
- package/build/features/connect/screens/Individual/Individual.d.ts +5 -0
- package/build/features/connect/screens/Individual/Individual.js +77 -0
- package/build/features/connect/screens/Individual/Name.d.ts +5 -0
- package/build/features/connect/screens/Individual/Name.js +31 -0
- package/build/features/connect/screens/Individual/index.d.ts +3 -0
- package/build/features/connect/screens/Individual/index.js +2 -0
- package/build/features/connect/screens/Individual/validation.d.ts +11 -0
- package/build/features/connect/screens/Individual/validation.js +5 -0
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +2 -6
- package/build/features/connect/screens/MID/BusinessCountry.js +20 -79
- package/build/features/connect/screens/MID/IDNumber.d.ts +0 -4
- package/build/features/connect/screens/MID/IDNumber.js +24 -36
- package/build/features/connect/screens/MID/MID.js +41 -24
- package/build/features/connect/screens/MID/MIDTitle.js +2 -2
- package/build/features/connect/screens/MID/MobileNumber.d.ts +2 -7
- package/build/features/connect/screens/MID/MobileNumber.js +40 -84
- package/build/features/connect/screens/MID/validation.d.ts +18 -0
- package/build/features/connect/screens/MID/validation.js +8 -0
- package/build/features/connect/screens/Merchant/BrandName.d.ts +5 -0
- package/build/features/connect/screens/Merchant/BrandName.js +73 -0
- package/build/features/connect/screens/Merchant/Merchant.d.ts +5 -0
- package/build/features/connect/screens/Merchant/Merchant.js +50 -0
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +5 -0
- package/build/features/connect/screens/Merchant/SocialMedia.js +79 -0
- package/build/features/connect/screens/Merchant/TAC.d.ts +5 -0
- package/build/features/connect/screens/Merchant/TAC.js +79 -0
- package/build/features/connect/screens/Merchant/index.d.ts +3 -0
- package/build/features/connect/screens/Merchant/index.js +2 -0
- package/build/features/connect/screens/Merchant/validation.d.ts +50 -0
- package/build/features/connect/screens/Merchant/validation.js +23 -0
- package/build/features/connect/screens/OTP/OTP.d.ts +6 -2
- package/build/features/connect/screens/OTP/OTP.js +41 -46
- package/build/features/connect/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTP/OTPInput.js +38 -0
- package/build/features/connect/screens/OTP/validation.d.ts +8 -0
- package/build/features/connect/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Password/Password.d.ts +5 -0
- package/build/features/connect/screens/Password/Password.js +49 -0
- package/build/features/connect/screens/Password/PasswordInput.d.ts +5 -0
- package/build/features/connect/screens/Password/PasswordInput.js +38 -0
- package/build/features/connect/screens/Password/index.d.ts +3 -0
- package/build/features/connect/screens/Password/index.js +2 -0
- package/build/features/connect/screens/Password/validation.d.ts +8 -0
- package/build/features/connect/screens/Password/validation.js +4 -0
- package/build/features/connect/screens/ThankYou/ThankYou.d.ts +5 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +15 -0
- package/build/features/connect/screens/ThankYou/index.d.ts +3 -0
- package/build/features/connect/screens/ThankYou/index.js +2 -0
- package/build/features/featuresScreens.d.ts +7 -0
- package/build/features/featuresScreens.js +99 -0
- package/build/features/owner/Owner.d.ts +6 -0
- package/build/features/owner/Owner.js +50 -0
- package/build/features/owner/index.d.ts +1 -0
- package/build/features/owner/index.js +1 -0
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +19 -0
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +52 -0
- package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +3 -0
- package/build/features/owner/screens/ShowOwnerInfo/index.js +2 -0
- package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +7 -0
- package/build/features/owner/screens/ShowOwnerInfo/info.js +28 -0
- package/build/features/password/Password.d.ts +6 -0
- package/build/features/password/Password.js +50 -0
- package/build/features/password/index.d.ts +1 -0
- package/build/features/password/index.js +1 -0
- package/build/features/password/screens/CreatePassword/ConditionText.d.ts +7 -0
- package/build/features/password/screens/CreatePassword/ConditionText.js +23 -0
- package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +27 -0
- package/build/features/password/screens/CreatePassword/CreatePassword.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/CreatePassword.js +51 -0
- package/build/features/password/screens/CreatePassword/Password.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/Password.js +75 -0
- package/build/features/password/screens/CreatePassword/PasswordBar.d.ts +7 -0
- package/build/features/password/screens/CreatePassword/PasswordBar.js +29 -0
- package/build/features/password/screens/CreatePassword/index.d.ts +3 -0
- package/build/features/password/screens/CreatePassword/index.js +2 -0
- package/build/features/password/screens/CreatePassword/validation.d.ts +11 -0
- package/build/features/password/screens/CreatePassword/validation.js +8 -0
- package/build/features/shared/Button/Button.d.ts +8 -0
- package/build/features/shared/Button/Button.js +49 -0
- package/build/features/shared/Button/index.d.ts +2 -0
- package/build/features/shared/Button/index.js +2 -0
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +2 -0
- package/build/features/shared/CheckIcon/CheckIcon.js +14 -0
- package/build/features/shared/CheckIcon/index.d.ts +2 -0
- package/build/features/shared/CheckIcon/index.js +2 -0
- package/build/features/shared/ClearIcon/ClearIcon.d.ts +6 -0
- package/build/features/shared/ClearIcon/ClearIcon.js +26 -0
- package/build/features/shared/ClearIcon/index.d.ts +2 -0
- package/build/features/shared/ClearIcon/index.js +2 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -0
- package/build/features/shared/Containers/FeatureContainer.js +33 -0
- package/build/features/shared/Containers/ScreenContainer.d.ts +4 -0
- package/build/features/shared/Containers/ScreenContainer.js +28 -0
- package/build/features/shared/Containers/index.d.ts +3 -0
- package/build/features/shared/Containers/index.js +3 -0
- package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +7 -0
- package/build/features/shared/ExpandIcon/ExpandIcon.js +24 -0
- package/build/features/shared/ExpandIcon/index.d.ts +2 -0
- package/build/features/shared/ExpandIcon/index.js +2 -0
- package/build/features/shared/Footer/Footer.d.ts +2 -0
- package/build/features/shared/Footer/Footer.js +16 -0
- package/build/features/shared/Footer/index.d.ts +2 -0
- package/build/features/shared/Footer/index.js +2 -0
- package/build/features/shared/Input/Input.d.ts +27 -0
- package/build/features/shared/Input/Input.js +59 -0
- package/build/features/shared/Input/index.d.ts +2 -0
- package/build/features/shared/Input/index.js +2 -0
- package/build/features/shared/OTP/OTP.d.ts +9 -0
- package/build/features/shared/OTP/OTP.js +85 -0
- package/build/features/shared/OTP/index.d.ts +2 -0
- package/build/features/shared/OTP/index.js +2 -0
- package/build/features/shared/PasswordIcon/PasswordIcon.d.ts +8 -0
- package/build/features/shared/PasswordIcon/PasswordIcon.js +37 -0
- package/build/features/shared/PasswordIcon/index.d.ts +2 -0
- package/build/features/shared/PasswordIcon/index.js +2 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +7 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.js +54 -0
- package/build/features/shared/SuccessScreen/index.d.ts +2 -0
- package/build/features/shared/SuccessScreen/index.js +2 -0
- package/build/features/tax/Tax.d.ts +6 -0
- package/build/features/tax/Tax.js +50 -0
- package/build/features/tax/index.d.ts +1 -0
- package/build/features/tax/index.js +1 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.d.ts +5 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +45 -0
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/VATId.js +27 -0
- package/build/features/tax/screens/TaxDetails/index.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/index.js +2 -0
- package/build/features/tax/screens/TaxDetails/validation.d.ts +8 -0
- package/build/features/tax/screens/TaxDetails/validation.js +4 -0
- package/build/hooks/index.d.ts +5 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/useAppDispatch.d.ts +4 -0
- package/build/hooks/useAppDispatch.js +2 -0
- package/build/hooks/useAppSelector.d.ts +3 -0
- package/build/hooks/useAppSelector.js +2 -0
- package/build/hooks/useAppTheme.js +3 -2
- package/build/hooks/useContainerDimensions.d.ts +4 -0
- package/build/hooks/useContainerDimensions.js +21 -0
- package/build/hooks/useEventListener.d.ts +5 -0
- package/build/hooks/useEventListener.js +20 -0
- package/build/hooks/useLanguage.d.ts +4 -0
- package/build/hooks/useLanguage.js +8 -0
- package/build/index.css +6 -1
- package/build/index.d.ts +7 -2
- package/build/index.js +17 -2
- package/build/theme/palette.js +11 -4
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +0 -1
- package/build/theme/typography.js +2 -2
- package/build/utils/array.d.ts +3 -1
- package/build/utils/array.js +7 -3
- package/build/utils/string.d.ts +3 -1
- package/build/utils/string.js +11 -2
- package/build/utils/validation.d.ts +10 -0
- package/build/utils/validation.js +30 -0
- package/package.json +120 -116
- package/build/app/hooks.d.ts +0 -7
- package/build/app/hooks.js +0 -3
|
@@ -0,0 +1,119 @@
|
|
|
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 Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import Text from '../../../../components/Text';
|
|
18
|
+
import OTPTimer from './OTPTimer';
|
|
19
|
+
import Icon from '../../../../components/Icon';
|
|
20
|
+
import Button from '../../../../components/Button';
|
|
21
|
+
import Loader from '../../../../components/Loader';
|
|
22
|
+
import { ICONS_NAMES } from '../../../../constants/assets';
|
|
23
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
24
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
26
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
27
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
28
|
+
import Form from '../../../../components/Form';
|
|
29
|
+
import { maskPhone } from '../../../../utils';
|
|
30
|
+
import { OTPValidation } from './validation';
|
|
31
|
+
import OTPInput from './OTPInput';
|
|
32
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
direction: theme.direction
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
42
|
+
var theme = _a.theme;
|
|
43
|
+
return ({
|
|
44
|
+
paddingBottom: theme.spacing(3.75)
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
48
|
+
var _b;
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return (_b = {
|
|
51
|
+
background: theme.palette.common.white,
|
|
52
|
+
border: '1px solid',
|
|
53
|
+
borderColor: theme.palette.divider,
|
|
54
|
+
direction: theme.direction,
|
|
55
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25)
|
|
56
|
+
},
|
|
57
|
+
_b[theme.breakpoints.up('sm')] = {
|
|
58
|
+
marginBottom: theme.spacing(6)
|
|
59
|
+
},
|
|
60
|
+
_b);
|
|
61
|
+
});
|
|
62
|
+
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
63
|
+
var theme = _a.theme;
|
|
64
|
+
return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
|
|
65
|
+
});
|
|
66
|
+
var LoaderStyled = styled(Loader)(function (_a) {
|
|
67
|
+
var theme = _a.theme;
|
|
68
|
+
return ({
|
|
69
|
+
marginInlineStart: theme.spacing(-6.25),
|
|
70
|
+
'& .loader-box-container': {
|
|
71
|
+
marginInlineStart: theme.spacing(2.5)
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
76
|
+
display: 'flex',
|
|
77
|
+
flexDirection: 'column'
|
|
78
|
+
}); });
|
|
79
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
80
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
81
|
+
return ({
|
|
82
|
+
width: theme.spacing(3),
|
|
83
|
+
height: theme.spacing(3),
|
|
84
|
+
paddingInlineStart: theme.spacing(1.5),
|
|
85
|
+
paddingInlineEnd: theme.spacing(0.5),
|
|
86
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
var ButtonContainer = styled(Box)(function (_a) {
|
|
90
|
+
var theme = _a.theme;
|
|
91
|
+
return ({
|
|
92
|
+
margin: theme.spacing(2.5)
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
var VerifyNumber = function (_a) {
|
|
96
|
+
var phone = _a.phone, code = _a.code;
|
|
97
|
+
var dispatch = useAppDispatch();
|
|
98
|
+
var methods = useForm({
|
|
99
|
+
resolver: yupResolver(OTPValidation),
|
|
100
|
+
defaultValues: {
|
|
101
|
+
otp: ''
|
|
102
|
+
},
|
|
103
|
+
mode: 'onChange'
|
|
104
|
+
});
|
|
105
|
+
var t = useTranslation().t;
|
|
106
|
+
var isAr = useLanguage().isAr;
|
|
107
|
+
var onSubmit = function (data) {
|
|
108
|
+
console.log('data', data);
|
|
109
|
+
if (data.otp === '123456')
|
|
110
|
+
return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
111
|
+
dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
112
|
+
};
|
|
113
|
+
return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('service_otp_send_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {})] }), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
|
|
114
|
+
};
|
|
115
|
+
VerifyNumber.defaultProps = {
|
|
116
|
+
phone: '8940298292',
|
|
117
|
+
code: '+91'
|
|
118
|
+
};
|
|
119
|
+
export default React.memo(VerifyNumber);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
otp: 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
|
+
otp: 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
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>>;
|
|
@@ -10,34 +10,32 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import React, { memo } from 'react';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import { useAppTheme } from '../../hooks';
|
|
13
|
+
import React, { memo, useEffect } from 'react';
|
|
14
|
+
import { FeatureContainer } from '../shared/Containers';
|
|
15
|
+
import { useAppTheme, useAppDispatch, useAppSelector } from '../../hooks';
|
|
16
|
+
import { handleActiveFlowScreens, settingsSelector } from '../../app/settings';
|
|
18
17
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
19
18
|
import { store } from '../../app/store';
|
|
20
19
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
20
|
+
import Collapse from '../../components/Collapse';
|
|
21
21
|
import { reactElement } from '../../utils';
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
width: '100%'
|
|
26
|
-
}); });
|
|
27
|
-
var FooterStyled = styled(Footer)(function (_a) {
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return ({
|
|
30
|
-
position: 'relative',
|
|
31
|
-
bottom: 0,
|
|
32
|
-
marginBottom: theme.spacing(-3.75)
|
|
33
|
-
});
|
|
34
|
-
});
|
|
22
|
+
import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
|
|
23
|
+
import { connectFeatureScreens } from '../featuresScreens';
|
|
24
|
+
import CustomFooter from '../shared/Footer';
|
|
35
25
|
var Connect = memo(function (props) {
|
|
36
|
-
var theme = useAppTheme().theme;
|
|
37
|
-
var t = useTranslation().t;
|
|
38
26
|
var open = React.useState(true)[0];
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
var theme = useAppTheme().theme;
|
|
28
|
+
var dispatch = useAppDispatch();
|
|
29
|
+
var data = useAppSelector(settingsSelector).data;
|
|
30
|
+
var activeScreen = data.activeScreen;
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
dispatch(handleActiveFlowScreens(CONNECT_SCREENS_NAVIGATION));
|
|
33
|
+
}, []);
|
|
34
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
35
|
+
var Element = _a.element, name = _a.name;
|
|
36
|
+
var isActive = activeScreen.name === name;
|
|
37
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 600, exit: 400, appear: 600 } }, { children: _jsx(Element, {}) }), index));
|
|
38
|
+
}) }) })) })));
|
|
41
39
|
});
|
|
42
40
|
export function ConnectLib(props) {
|
|
43
41
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Connect, __assign({}, props)) })));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import Input from '../../../shared/Input';
|
|
17
|
+
import { keepEmailCharacters } from '../../../../utils';
|
|
18
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
19
|
+
var Email = function (_a) {
|
|
20
|
+
var _b;
|
|
21
|
+
var t = useTranslation().t;
|
|
22
|
+
var control = useFormContext().control;
|
|
23
|
+
var emailControl = useController({ name: 'email', control: control });
|
|
24
|
+
var handleEmailChange = function (event) {
|
|
25
|
+
var value = keepEmailCharacters(event.target.value);
|
|
26
|
+
emailControl.field.onChange(value);
|
|
27
|
+
};
|
|
28
|
+
var emailValue = emailControl.field.value;
|
|
29
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_enter_email'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signin_email_placeholder'), warningType: 'alert', warningMessage: (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
|
|
30
|
+
};
|
|
31
|
+
export default React.memo(Email);
|
|
@@ -0,0 +1,77 @@
|
|
|
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 Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import Email from './Email';
|
|
16
|
+
import Name from './Name';
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
19
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
20
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
|
+
import Icon from '../../../../components/Icon';
|
|
22
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
23
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
24
|
+
import { IndividualValidation } from './validation';
|
|
25
|
+
import Form from '../../../../components/Form';
|
|
26
|
+
import Button from '../../../shared/Button';
|
|
27
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
28
|
+
import Loader from '../../../../components/Loader';
|
|
29
|
+
import { useLanguage } from '../../../../hooks';
|
|
30
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column'
|
|
33
|
+
}); });
|
|
34
|
+
var ButtonContainer = styled(Box)(function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return ({
|
|
37
|
+
margin: theme.spacing(5, 2.5, 0, 2.5)
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
41
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
42
|
+
return ({
|
|
43
|
+
width: theme.spacing(3),
|
|
44
|
+
height: theme.spacing(3),
|
|
45
|
+
paddingInlineStart: theme.spacing(1.5),
|
|
46
|
+
paddingInlineEnd: theme.spacing(0.5),
|
|
47
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var LoaderStyled = styled(Loader)(function (_a) {
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return ({
|
|
53
|
+
marginInlineStart: theme.spacing(-6.25),
|
|
54
|
+
'& .loader-box-container': {
|
|
55
|
+
marginInlineStart: theme.spacing(2.5)
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var Individual = function (_a) {
|
|
60
|
+
var dispatch = useAppDispatch();
|
|
61
|
+
var methods = useForm({
|
|
62
|
+
resolver: yupResolver(IndividualValidation),
|
|
63
|
+
defaultValues: {
|
|
64
|
+
name: '',
|
|
65
|
+
email: ''
|
|
66
|
+
},
|
|
67
|
+
mode: 'onChange'
|
|
68
|
+
});
|
|
69
|
+
var onSubmit = function (data) {
|
|
70
|
+
console.log('data', data);
|
|
71
|
+
dispatch(handleNextScreenStep());
|
|
72
|
+
};
|
|
73
|
+
var t = useTranslation().t;
|
|
74
|
+
var isAr = useLanguage().isAr;
|
|
75
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, {}), _jsx(Email, {}), _jsx(Button, __assign({ isAr: isAr, loading: false, disabled: !methods.formState.isValid }, { children: t('next') }))] })) })) }));
|
|
76
|
+
};
|
|
77
|
+
export default React.memo(Individual);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import Input from '../../../shared/Input';
|
|
17
|
+
import { removeAllNumberFromChars } from '../../../../utils';
|
|
18
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
19
|
+
var Name = function (_a) {
|
|
20
|
+
var _b;
|
|
21
|
+
var t = useTranslation().t;
|
|
22
|
+
var control = useFormContext().control;
|
|
23
|
+
var nameControl = useController({ name: 'name', control: control });
|
|
24
|
+
var handleNameChange = function (event) {
|
|
25
|
+
var value = removeAllNumberFromChars(event.target.value);
|
|
26
|
+
nameControl.field.onChange(value);
|
|
27
|
+
};
|
|
28
|
+
var nameValue = nameControl.field.value;
|
|
29
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
|
|
30
|
+
};
|
|
31
|
+
export default React.memo(Name);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const IndividualValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Control } from 'react-hook-form';
|
|
3
2
|
import { CountryCode } from '../../../../@types';
|
|
4
3
|
interface BusinessCountryProps {
|
|
5
4
|
countries: Array<CountryCode>;
|
|
6
5
|
show: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onOpenBusinessCountryList?: () => void;
|
|
10
|
-
onCloseBusinessCountryList?: () => void;
|
|
11
|
-
control?: Control<any, any>;
|
|
6
|
+
onListOpen?: () => void;
|
|
7
|
+
onListClose?: () => void;
|
|
12
8
|
}
|
|
13
9
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BusinessCountryProps & React.RefAttributes<unknown>>>;
|
|
14
10
|
export default _default;
|
|
@@ -23,45 +23,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import Box from '@mui/material/Box';
|
|
26
|
-
import {
|
|
26
|
+
import { styled } from '@mui/material/styles';
|
|
27
27
|
import { useTranslation } from 'react-i18next';
|
|
28
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
28
29
|
import Text from '../../../../components/Text';
|
|
29
|
-
import Collapse from '
|
|
30
|
+
import Collapse from '../../../../components/Collapse';
|
|
30
31
|
import CheckIcon from '@mui/icons-material/Check';
|
|
31
|
-
import
|
|
32
|
+
import ScreenContainer from '../../../../features/shared/Containers/ScreenContainer';
|
|
32
33
|
import Icon from '../../../../components/Icon';
|
|
33
|
-
import Input from '../../../../
|
|
34
|
+
import Input from '../../../../features/shared/Input';
|
|
35
|
+
import ExpandIcon from '../../../../features/shared/ExpandIcon';
|
|
34
36
|
import SimpleList from '../../../../components/SimpleList';
|
|
35
|
-
import {
|
|
36
|
-
var InputStyled = styled(Input)(function (_a) {
|
|
37
|
-
var theme = _a.theme;
|
|
38
|
-
return ({
|
|
39
|
-
padding: theme.spacing(0, 2.5, 0, 2.5),
|
|
40
|
-
'& .MuiInputBase-input': {
|
|
41
|
-
cursor: 'pointer'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
46
|
-
var theme = _a.theme;
|
|
47
|
-
return ({
|
|
48
|
-
display: 'flex',
|
|
49
|
-
flexDirection: 'column',
|
|
50
|
-
padding: theme.spacing(0, 0, 2.5, 0)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return ({
|
|
56
|
-
display: 'flex',
|
|
57
|
-
justifyContent: 'space-between',
|
|
58
|
-
padding: theme.spacing(0, 2, 1, 2.5)
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
62
|
-
var theme = _a.theme;
|
|
63
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { paddingBottom: theme.spacing(0.6) }));
|
|
64
|
-
});
|
|
37
|
+
import { useLanguage } from '../../../../hooks';
|
|
65
38
|
var CountryItemContainer = styled(Box)(function () { return ({
|
|
66
39
|
display: 'flex'
|
|
67
40
|
}); });
|
|
@@ -88,64 +61,32 @@ var CountryIconStyled = styled(Icon)(function (_a) {
|
|
|
88
61
|
verticalAlign: 'middle'
|
|
89
62
|
});
|
|
90
63
|
});
|
|
91
|
-
var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
|
|
92
|
-
var _b;
|
|
93
|
-
var theme = _a.theme, anchorEl = _a.anchorEl;
|
|
94
|
-
return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', transform: !!anchorEl ? 'rotate(180deg)' : '' }, _b[theme.transitions.create(['transform'])] = {
|
|
95
|
-
duration: theme.transitions.duration.standard
|
|
96
|
-
}, _b)));
|
|
97
|
-
});
|
|
98
64
|
var BusinessCountry = React.forwardRef(function (_a, ref) {
|
|
99
65
|
var _b, _c;
|
|
100
|
-
var countries = _a.countries,
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
setBusinessCountries(countries);
|
|
108
|
-
}, []);
|
|
109
|
-
React.useEffect(function () {
|
|
110
|
-
if (defaultCountry)
|
|
111
|
-
setSelected(defaultCountry);
|
|
112
|
-
}, [defaultCountry]);
|
|
113
|
-
var onCountrySearch = function (e) {
|
|
114
|
-
if (e === null || e === void 0 ? void 0 : e.code) {
|
|
115
|
-
var searchList = getCountrySearch(businessCountries, e.code);
|
|
116
|
-
if (searchList.length === 0 || e.code === 'Backspace')
|
|
117
|
-
setBusinessCountries(businessCountries);
|
|
118
|
-
else
|
|
119
|
-
setBusinessCountries(searchList);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
var getCountrySearch = function (originalList, searchKey) {
|
|
123
|
-
var _a;
|
|
124
|
-
return (_a = (originalList || [])) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
125
|
-
return item.name.english.charAt(0).toLowerCase() === searchKey.charAt(searchKey.length - 1).toLowerCase();
|
|
126
|
-
});
|
|
127
|
-
};
|
|
66
|
+
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
67
|
+
var businessCountries = React.useState(countries)[0];
|
|
68
|
+
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
69
|
+
var t = useTranslation().t;
|
|
70
|
+
var isAr = useLanguage().isAr;
|
|
71
|
+
var control = useFormContext().control;
|
|
72
|
+
var businessCountryControl = useController({ control: control, name: 'businessCountry' });
|
|
128
73
|
var onOpenCountrySelect = function (event) {
|
|
129
74
|
var _a;
|
|
130
75
|
setAnchorEl(event.currentTarget);
|
|
131
|
-
|
|
132
|
-
setBusinessCountries(countries);
|
|
133
|
-
(_a = rest.onOpenBusinessCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
76
|
+
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
134
77
|
};
|
|
135
78
|
var onCloseCountrySelect = function () {
|
|
136
79
|
var _a;
|
|
137
80
|
setAnchorEl(null);
|
|
138
|
-
|
|
139
|
-
setBusinessCountries(countries);
|
|
140
|
-
(_a = rest.onCloseBusinessCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
81
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
141
82
|
};
|
|
142
83
|
var onSelectItem = function (country) {
|
|
143
|
-
setSelected(country);
|
|
144
|
-
onSelect && onSelect(country);
|
|
145
84
|
onCloseCountrySelect();
|
|
85
|
+
businessCountryControl.field.onChange(country);
|
|
146
86
|
};
|
|
147
|
-
|
|
148
|
-
|
|
87
|
+
var businessCountry = businessCountryControl.field.value;
|
|
88
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: [_jsx(Input, { label: t('business_country_label'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('business_country_placeholder'), value: (isAr ? (_b = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
89
|
+
return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsx(CountryIconStyled, { src: item.logo, alt: item.iso3 }), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) && _jsx(CheckIconStyled, {})] }));
|
|
149
90
|
} }) }))] })) })));
|
|
150
91
|
});
|
|
151
92
|
export default React.memo(BusinessCountry);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Control } from 'react-hook-form';
|
|
3
2
|
interface IDNumberProps {
|
|
4
3
|
show: boolean;
|
|
5
4
|
onSwitchToMobileNumber?: () => void;
|
|
6
|
-
onIdChange?: (id: string) => void;
|
|
7
|
-
onBirthDateChange?: (data: string) => void;
|
|
8
|
-
control?: Control<any, any>;
|
|
9
5
|
}
|
|
10
6
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IDNumberProps & React.RefAttributes<unknown>>>;
|
|
11
7
|
export default _default;
|