@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
|
@@ -13,49 +13,29 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
17
|
import { styled, alpha } from '@mui/material/styles';
|
|
17
18
|
import Text from '../../../../components/Text';
|
|
18
19
|
import Tooltip from '@mui/material/Tooltip';
|
|
19
20
|
import Icon from '../../../../components/Icon';
|
|
20
|
-
import Input from '../../../../
|
|
21
|
-
import ClearIcon from '
|
|
22
|
-
import Collapse from '
|
|
21
|
+
import Input from '../../../../features/shared/Input';
|
|
22
|
+
import ClearIcon from '../../../../features/shared/ClearIcon';
|
|
23
|
+
import Collapse from '../../../../components/Collapse';
|
|
23
24
|
import DatePicker from '../../../../components/DatePicker';
|
|
25
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
24
26
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
25
27
|
import { ICONS_NAMES, ID_NUMBER_LENGTH } from '../../../../constants';
|
|
26
|
-
var BoxStyled = styled(Box)(function () { return ({
|
|
27
|
-
display: 'flex',
|
|
28
|
-
flexDirection: 'column'
|
|
29
|
-
}); });
|
|
30
28
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
31
29
|
var theme = _a.theme;
|
|
32
30
|
return ({
|
|
33
31
|
display: 'flex',
|
|
34
32
|
justifyContent: 'space-between',
|
|
35
|
-
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
33
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
36
34
|
});
|
|
37
35
|
});
|
|
38
36
|
var InputLabelStyled = styled(Text)(function (_a) {
|
|
39
37
|
var theme = _a.theme;
|
|
40
|
-
return ({
|
|
41
|
-
color: alpha(theme.palette.text.primary, 0.4),
|
|
42
|
-
fontSize: theme.spacing(1.5)
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
var InputStyled = styled(Input)(function (_a) {
|
|
46
|
-
var theme = _a.theme;
|
|
47
|
-
return ({
|
|
48
|
-
padding: theme.spacing(0, 2, 0, 0)
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
52
|
-
var theme = _a.theme;
|
|
53
|
-
return ({
|
|
54
|
-
width: theme.spacing(2),
|
|
55
|
-
height: theme.spacing(2),
|
|
56
|
-
cursor: 'pointer',
|
|
57
|
-
color: alpha(theme.palette.text.primary, 0.4)
|
|
58
|
-
});
|
|
38
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
59
39
|
});
|
|
60
40
|
var IconStyled = styled(Icon)(function (_a) {
|
|
61
41
|
var theme = _a.theme;
|
|
@@ -66,23 +46,31 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
66
46
|
});
|
|
67
47
|
});
|
|
68
48
|
var IDNumber = React.forwardRef(function (_a, ref) {
|
|
69
|
-
var
|
|
70
|
-
var
|
|
49
|
+
var _b;
|
|
50
|
+
var onSwitchToMobileNumber = _a.onSwitchToMobileNumber, show = _a.show;
|
|
71
51
|
var t = useTranslation().t;
|
|
52
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
53
|
+
var nidControl = useController({ control: control, name: 'nid' });
|
|
54
|
+
var dobControl = useController({ control: control, name: 'dob' });
|
|
55
|
+
React.useEffect(function () {
|
|
56
|
+
if (nidControl.field.value)
|
|
57
|
+
setValue('nid', nidControl.field.value, { shouldValidate: true });
|
|
58
|
+
if (dobControl.field.value)
|
|
59
|
+
setValue('dob', dobControl.field.value, { shouldValidate: true });
|
|
60
|
+
}, [show]);
|
|
72
61
|
var handleIdChange = function (_a) {
|
|
73
62
|
var target = _a.target;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
onIdChange === null || onIdChange === void 0 ? void 0 : onIdChange(target.value);
|
|
63
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
64
|
+
nidControl.field.onChange(value);
|
|
77
65
|
};
|
|
78
66
|
var clearIdNumber = function () {
|
|
79
|
-
|
|
80
|
-
onIdChange === null || onIdChange === void 0 ? void 0 : onIdChange('');
|
|
67
|
+
nidControl.field.onChange('');
|
|
81
68
|
};
|
|
82
69
|
var handleBirthDateChange = function (data) {
|
|
83
|
-
|
|
70
|
+
dobControl.field.onChange(data);
|
|
84
71
|
};
|
|
85
|
-
|
|
72
|
+
var nidValue = nidControl.field.value;
|
|
73
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('id_number_label') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }), _jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
86
74
|
var spacing = _a.spacing;
|
|
87
75
|
return spacing(2.5, 2.5, 1.5, 2.5);
|
|
88
76
|
} } }, { children: t('date_of_birth') })), _jsx(DatePicker, { defaultValue: new Date('2000-01-01'), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange })] })) })));
|
|
@@ -12,22 +12,37 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
|
-
import { useForm } from 'react-hook-form';
|
|
15
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
16
17
|
import { useTranslation } from 'react-i18next';
|
|
17
18
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import
|
|
19
|
+
import Collapse from '../../../../components/Collapse';
|
|
19
20
|
import Form from '../../../../components/Form';
|
|
21
|
+
import Button from '../../../../features/shared/Button';
|
|
22
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
23
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
24
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
20
26
|
import MIDTitle from './MIDTitle';
|
|
21
27
|
import MobileNumber from './MobileNumber';
|
|
22
28
|
import IDNumber from './IDNumber';
|
|
23
29
|
import BusinessCountry from './BusinessCountry';
|
|
30
|
+
import { NIDValidationSchema, PhoneValidationSchema } from './validation';
|
|
24
31
|
import { countriesCode, defaultCountry, businessCountries } from '../../../../constants/dummy';
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column'
|
|
35
|
+
}); });
|
|
36
|
+
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
37
|
+
var _b;
|
|
38
|
+
var theme = _a.theme, listActive = _a.listActive;
|
|
39
|
+
return (_b = {
|
|
40
|
+
paddingBottom: theme.spacing(listActive ? 0 : 5)
|
|
41
|
+
},
|
|
42
|
+
_b[theme.transitions.create(['padding-bottom'])] = {
|
|
43
|
+
duration: theme.transitions.duration.standard
|
|
44
|
+
},
|
|
45
|
+
_b);
|
|
31
46
|
});
|
|
32
47
|
var ListType;
|
|
33
48
|
(function (ListType) {
|
|
@@ -37,28 +52,30 @@ var ListType;
|
|
|
37
52
|
var MID = function (_a) {
|
|
38
53
|
var _b = React.useState(false), isNID = _b[0], setIsNID = _b[1];
|
|
39
54
|
var _c = React.useState(), listType = _c[0], setListType = _c[1];
|
|
40
|
-
var
|
|
55
|
+
var dispatch = useAppDispatch();
|
|
56
|
+
var methods = useForm({
|
|
57
|
+
resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema),
|
|
58
|
+
defaultValues: {
|
|
59
|
+
countryCode: defaultCountry,
|
|
60
|
+
businessCountry: defaultCountry,
|
|
61
|
+
nid: '',
|
|
62
|
+
dob: '',
|
|
63
|
+
mobile: ''
|
|
64
|
+
},
|
|
65
|
+
mode: 'onChange'
|
|
66
|
+
});
|
|
41
67
|
var t = useTranslation().t;
|
|
68
|
+
var isAr = useLanguage().isAr;
|
|
42
69
|
var handleMenuListClick = function (flag) {
|
|
43
70
|
setListType(flag);
|
|
44
71
|
};
|
|
45
|
-
var
|
|
46
|
-
console.log(
|
|
47
|
-
|
|
48
|
-
var onMobileChange = function (mobile) {
|
|
49
|
-
console.log(mobile);
|
|
50
|
-
};
|
|
51
|
-
var onBirthDateChange = function (data) {
|
|
52
|
-
console.log(data);
|
|
53
|
-
};
|
|
54
|
-
var onSelectCountryCode = function (country) {
|
|
55
|
-
console.log(country);
|
|
56
|
-
};
|
|
57
|
-
var onSelectBusinessCountry = function (country) {
|
|
58
|
-
console.log(country);
|
|
72
|
+
var onSubmit = function (data) {
|
|
73
|
+
console.log('data', data);
|
|
74
|
+
dispatch(handleNextScreenStep());
|
|
59
75
|
};
|
|
60
76
|
var isBusinessListActive = listType === ListType.BusinessList;
|
|
61
77
|
var isCountryListActive = listType === ListType.CountryCodeList;
|
|
62
|
-
|
|
78
|
+
var listActive = isBusinessListActive || isCountryListActive;
|
|
79
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('Welcome to Tap Payments'), description: t('Help us to get your information to start collecting online payments') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(BusinessCountry, { show: !isCountryListActive, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: isNID }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) }))] })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
|
|
63
80
|
};
|
|
64
81
|
export default React.memo(MID);
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { styled, alpha } from '@mui/material/styles';
|
|
15
|
-
import Collapse from '
|
|
15
|
+
import Collapse from '../../../../components/Collapse';
|
|
16
16
|
import Text from '../../../../components/Text';
|
|
17
17
|
var TitleStyled = styled(Text)(function (_a) {
|
|
18
18
|
var theme = _a.theme;
|
|
@@ -24,6 +24,6 @@ var DescriptionStyled = styled(Text)(function (_a) {
|
|
|
24
24
|
});
|
|
25
25
|
var MIDTitle = function (_a) {
|
|
26
26
|
var description = _a.description, show = _a.show, title = _a.title;
|
|
27
|
-
return (_jsxs(Collapse, __assign({ in: show
|
|
27
|
+
return (_jsxs(Collapse, __assign({ in: show }, { children: [_jsx(TitleStyled, { children: title }), _jsx(DescriptionStyled, { children: description })] })));
|
|
28
28
|
};
|
|
29
29
|
export default React.memo(MIDTitle);
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Control } from 'react-hook-form';
|
|
3
2
|
import { CountryCode } from '../../../../@types';
|
|
4
3
|
interface MobileNumberProps {
|
|
5
4
|
countries: Array<CountryCode>;
|
|
6
5
|
show: boolean;
|
|
7
|
-
onSelect?: (country: CountryCode) => void;
|
|
8
|
-
defaultCountry?: CountryCode;
|
|
9
6
|
onSwitchToIdNumber?: () => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
onCloseCountryList?: () => void;
|
|
13
|
-
control?: Control<any, any>;
|
|
7
|
+
onListOpen?: () => void;
|
|
8
|
+
onListClose?: () => void;
|
|
14
9
|
}
|
|
15
10
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MobileNumberProps & React.RefAttributes<unknown>>>;
|
|
16
11
|
export default _default;
|
|
@@ -24,18 +24,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import Box from '@mui/material/Box';
|
|
26
26
|
import { useTranslation } from 'react-i18next';
|
|
27
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
27
28
|
import { styled, alpha } from '@mui/material/styles';
|
|
28
29
|
import Text from '../../../../components/Text';
|
|
29
|
-
import Collapse from '
|
|
30
|
+
import Collapse from '../../../../components/Collapse';
|
|
30
31
|
import Tooltip from '@mui/material/Tooltip';
|
|
31
32
|
import CheckIcon from '@mui/icons-material/Check';
|
|
32
|
-
import
|
|
33
|
-
import
|
|
33
|
+
import ExpandIcon from '../../../../features/shared/ExpandIcon';
|
|
34
|
+
import ClearIcon from '../../../../features/shared/ClearIcon';
|
|
35
|
+
import ScreenContainer from '../../../../features/shared/Containers/ScreenContainer';
|
|
34
36
|
import Icon from '../../../../components/Icon';
|
|
35
|
-
import Input from '../../../../
|
|
37
|
+
import Input from '../../../../features/shared/Input';
|
|
36
38
|
import SimpleList from '../../../../components/SimpleList';
|
|
37
|
-
import { ICONS_NAMES
|
|
39
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
38
40
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
41
|
+
import { useLanguage } from '../../../../hooks';
|
|
39
42
|
var IconStyled = styled(Icon)(function (_a) {
|
|
40
43
|
var theme = _a.theme;
|
|
41
44
|
return ({
|
|
@@ -44,41 +47,20 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
44
47
|
cursor: 'pointer'
|
|
45
48
|
});
|
|
46
49
|
});
|
|
47
|
-
var InputStyled = styled(Input)(function (_a) {
|
|
48
|
-
var theme = _a.theme;
|
|
49
|
-
return ({
|
|
50
|
-
padding: theme.spacing(0, 2.5, 0, 2.5)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
var BoxStyled = styled(Box)(function () { return ({
|
|
54
|
-
display: 'flex',
|
|
55
|
-
flexDirection: 'column'
|
|
56
|
-
}); });
|
|
57
50
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
58
51
|
var theme = _a.theme;
|
|
59
52
|
return ({
|
|
60
53
|
display: 'flex',
|
|
61
54
|
justifyContent: 'space-between',
|
|
62
|
-
padding: theme.spacing(0, 2, 1, 2.5)
|
|
55
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
63
56
|
});
|
|
64
57
|
});
|
|
65
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
66
|
-
var theme = _a.theme;
|
|
67
|
-
return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
68
|
-
});
|
|
69
58
|
var CountryItemContainer = styled(Box)(function () { return ({
|
|
70
59
|
display: 'flex'
|
|
71
60
|
}); });
|
|
72
61
|
var CountryCodeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
73
62
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
74
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
75
|
-
});
|
|
76
|
-
var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
|
|
77
|
-
var _b;
|
|
78
|
-
var theme = _a.theme, anchorEl = _a.anchorEl;
|
|
79
|
-
return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', transform: !!anchorEl ? 'rotate(180deg)' : '', paddingInlineStart: !!anchorEl ? theme.spacing(0) : theme.spacing(1), paddingInlineEnd: !!anchorEl ? theme.spacing(1) : theme.spacing(0) }, _b[theme.transitions.create(['transform'])] = {
|
|
80
|
-
duration: theme.transitions.duration.standard
|
|
81
|
-
}, _b)));
|
|
63
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
82
64
|
});
|
|
83
65
|
var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
84
66
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
@@ -92,85 +74,59 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
92
74
|
alignItems: 'flex-end'
|
|
93
75
|
});
|
|
94
76
|
});
|
|
95
|
-
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
96
|
-
var theme = _a.theme;
|
|
97
|
-
return ({
|
|
98
|
-
width: theme.spacing(2),
|
|
99
|
-
height: theme.spacing(2),
|
|
100
|
-
cursor: 'pointer',
|
|
101
|
-
color: alpha(theme.palette.text.primary, 0.4)
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
77
|
var CountryCodeStyled = styled(Text)(function (_a) {
|
|
105
78
|
var theme = _a.theme;
|
|
106
79
|
return (__assign(__assign({ cursor: 'pointer' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightRegular, display: 'flex', alignItems: 'center', minWidth: theme.spacing(8.75) }));
|
|
107
80
|
});
|
|
81
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
82
|
+
var theme = _a.theme;
|
|
83
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
84
|
+
});
|
|
108
85
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
86
|
+
var _b;
|
|
87
|
+
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
88
|
+
var countriesCode = React.useState(countries)[0];
|
|
89
|
+
var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
90
|
+
var t = useTranslation().t;
|
|
91
|
+
var isAr = useLanguage().isAr;
|
|
92
|
+
var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
|
|
93
|
+
var phoneControl = useController({ name: 'mobile', control: control });
|
|
94
|
+
var countryCodeControl = useController({ name: 'countryCode', control: control });
|
|
116
95
|
React.useEffect(function () {
|
|
117
|
-
|
|
96
|
+
if (phoneControl.field.value) {
|
|
97
|
+
setValue('mobile', phoneControl.field.value, { shouldValidate: true });
|
|
98
|
+
}
|
|
99
|
+
if (countryCodeControl.field.value) {
|
|
100
|
+
setValue('countryCode', countryCodeControl.field.value, { shouldValidate: true });
|
|
101
|
+
}
|
|
118
102
|
}, []);
|
|
119
|
-
React.useEffect(function () {
|
|
120
|
-
if (defaultCountry)
|
|
121
|
-
setSelected(defaultCountry);
|
|
122
|
-
}, [defaultCountry]);
|
|
123
103
|
var onPhoneNumberChange = function (_a) {
|
|
124
|
-
var _b;
|
|
125
104
|
var target = _a.target;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
setMobileValue(target.value);
|
|
105
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
106
|
+
phoneControl.field.onChange(value);
|
|
129
107
|
};
|
|
130
108
|
var clearMobileNumber = function () {
|
|
131
|
-
|
|
132
|
-
setMobileValue('');
|
|
133
|
-
(_a = rest.onMobileChange) === null || _a === void 0 ? void 0 : _a.call(rest, '');
|
|
134
|
-
};
|
|
135
|
-
var onCountryCodeSearch = function (e) {
|
|
136
|
-
if (e === null || e === void 0 ? void 0 : e.code) {
|
|
137
|
-
var searchList = getCountryCodeSearch(countriesCode, e.code);
|
|
138
|
-
if (searchList.length === 0 || e.code === 'Backspace')
|
|
139
|
-
setCountriesCode(countriesCode);
|
|
140
|
-
else
|
|
141
|
-
setCountriesCode(searchList);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
var getCountryCodeSearch = function (originalList, searchKey) {
|
|
145
|
-
var _a;
|
|
146
|
-
return (_a = (originalList || [])) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
147
|
-
return item.name.english.charAt(0).toLowerCase() === searchKey.charAt(searchKey.length - 1).toLowerCase();
|
|
148
|
-
});
|
|
109
|
+
phoneControl.field.onChange('');
|
|
149
110
|
};
|
|
150
111
|
var onOpenCountryList = function (event) {
|
|
151
112
|
var _a;
|
|
152
113
|
setAnchorEl(event.currentTarget);
|
|
153
|
-
|
|
154
|
-
setCountriesCode(countries);
|
|
155
|
-
(_a = rest.onOpenCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
114
|
+
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
156
115
|
};
|
|
157
116
|
var onCloseCountryList = function () {
|
|
158
117
|
var _a;
|
|
159
118
|
setAnchorEl(null);
|
|
160
|
-
|
|
161
|
-
setCountriesCode(countries);
|
|
162
|
-
(_a = rest.onCloseCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
119
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
163
120
|
};
|
|
164
121
|
var onSelectItem = function (country) {
|
|
165
|
-
setSelected(country);
|
|
166
|
-
onSelect && onSelect(country);
|
|
167
122
|
onCloseCountryList();
|
|
123
|
+
countryCodeControl.field.onChange(country);
|
|
168
124
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
125
|
+
var mobileValue = phoneControl.field.value;
|
|
126
|
+
var countryCodeValue = countryCodeControl.field.value;
|
|
127
|
+
var error = (_b = phoneControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
128
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('mobile_number_label') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), _jsx(ExpandIcon, { anchorEl: !!anchorEl })] })), endAdornment: mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber }), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: (!anchorEl && error) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
129
|
+
return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIconStyled, {})] }));
|
|
174
130
|
} }) }))] })) })));
|
|
175
131
|
});
|
|
176
132
|
export default React.memo(MobileNumber);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
nid: 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
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
nid: 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
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
12
|
+
export declare const PhoneValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
+
}>>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var NIDValidationSchema = yup.object().shape({
|
|
3
|
+
dob: yup.string().min(5).required('DOB is required'),
|
|
4
|
+
nid: yup.string().min(8).max(10).required('NID is required')
|
|
5
|
+
});
|
|
6
|
+
export var PhoneValidationSchema = yup.object().shape({
|
|
7
|
+
mobile: yup.string().min(5).required('Phone number is required')
|
|
8
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
19
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import Text from '../../../../components/Text';
|
|
22
|
+
import Input from '../../../shared/Input';
|
|
23
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
24
|
+
import Tooltip from '../../../../components/Tooltip';
|
|
25
|
+
import { removeAllOtherThanAlphabet } from '../../../../utils';
|
|
26
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return ({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
37
|
+
});
|
|
38
|
+
var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return ({
|
|
41
|
+
width: theme.spacing(2.75),
|
|
42
|
+
height: theme.spacing(2.125),
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
48
|
+
var theme = _a.theme;
|
|
49
|
+
return ({
|
|
50
|
+
width: theme.spacing(2.75),
|
|
51
|
+
height: theme.spacing(2.125),
|
|
52
|
+
cursor: 'pointer',
|
|
53
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
var BrandName = function (_a) {
|
|
57
|
+
var _b;
|
|
58
|
+
var _c = React.useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
59
|
+
var t = useTranslation().t;
|
|
60
|
+
var control = useFormContext().control;
|
|
61
|
+
var brandControl = useController({ control: control, name: 'brandName' });
|
|
62
|
+
var handleBrandNameChange = function (_a) {
|
|
63
|
+
var target = _a.target;
|
|
64
|
+
var value = removeAllOtherThanAlphabet(target.value);
|
|
65
|
+
brandControl.field.onChange(value);
|
|
66
|
+
};
|
|
67
|
+
var clearBrandName = function () {
|
|
68
|
+
brandControl.field.onChange('');
|
|
69
|
+
};
|
|
70
|
+
var brandNameValue = brandControl.field.value;
|
|
71
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 3 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_description'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, value: brandNameValue, endAdornment: brandNameValue && _jsx(ClearIcon, { onClick: clearBrandName }), placeholder: t('brand_name_placeholder'), warningType: 'alert', warningMessage: (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message })] })));
|
|
72
|
+
};
|
|
73
|
+
export default React.memo(BrandName);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
18
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
19
|
+
import Form from '../../../../components/Form';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import Button from '../../../shared/Button';
|
|
22
|
+
import { useLanguage } from '../../../../hooks';
|
|
23
|
+
import { MerchantValidationSchema } from './validation';
|
|
24
|
+
import BrandName from './BrandName';
|
|
25
|
+
import SocialMedia from './SocialMedia';
|
|
26
|
+
import TAC from './TAC';
|
|
27
|
+
var Merchant = function (_a) {
|
|
28
|
+
var methods = useForm({
|
|
29
|
+
resolver: yupResolver(MerchantValidationSchema),
|
|
30
|
+
defaultValues: {
|
|
31
|
+
brandName: '',
|
|
32
|
+
termAndConditionChecked: false,
|
|
33
|
+
links: {
|
|
34
|
+
website: '',
|
|
35
|
+
twitter: '',
|
|
36
|
+
instagram: ''
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
mode: 'onChange'
|
|
40
|
+
});
|
|
41
|
+
var t = useTranslation().t;
|
|
42
|
+
var isAr = useLanguage().isAr;
|
|
43
|
+
var dispatch = useAppDispatch();
|
|
44
|
+
var onSubmit = function (data) {
|
|
45
|
+
console.log('data', data);
|
|
46
|
+
dispatch(handleNextScreenStep());
|
|
47
|
+
};
|
|
48
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, {}), _jsx(SocialMedia, {}), _jsx(TAC, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, isAr: isAr }, { children: t('next') }))] })) })) }));
|
|
49
|
+
};
|
|
50
|
+
export default React.memo(Merchant);
|