@tap-payments/auth-jsconnect 2.0.44 → 2.0.45
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/README.md +34 -34
- package/build/@types/app.d.ts +70 -7
- package/build/@types/app.js +13 -0
- package/build/@types/form.d.ts +63 -34
- package/build/@types/theme.d.ts +1 -1
- package/build/api/account.d.ts +6 -1
- package/build/api/account.js +9 -1
- package/build/api/auth.d.ts +24 -18
- package/build/api/auth.js +25 -5
- package/build/api/availabilityServices.d.ts +3 -3
- package/build/api/axios.js +3 -3
- package/build/api/board.d.ts +4 -3
- package/build/api/board.js +8 -1
- package/build/api/brand.d.ts +1 -0
- package/build/api/brand.js +9 -1
- package/build/api/data.d.ts +16 -8
- package/build/api/data.js +16 -0
- package/build/api/entity.d.ts +46 -16
- package/build/api/entity.js +26 -16
- package/build/api/file.d.ts +13 -0
- package/build/api/file.js +24 -0
- package/build/api/index.d.ts +30 -8
- package/build/api/index.js +5 -3
- package/build/api/individual.d.ts +10 -4
- package/build/api/lead.d.ts +16 -10
- package/build/api/lead.js +17 -1
- package/build/api/location.d.ts +5 -0
- package/build/api/location.js +19 -0
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +1 -1
- package/build/api/user.d.ts +1 -1
- package/build/app/rootReducer.d.ts +2 -1
- package/build/app/rootReducer.js +4 -2
- package/build/app/settings.d.ts +17 -6
- package/build/app/settings.js +23 -19
- package/build/app/store.d.ts +8 -6
- package/build/assets/locales/ar.json +40 -1
- package/build/assets/locales/en.json +42 -1
- package/build/components/Button/Button.js +1 -5
- package/build/components/FileInput/DragAndDrop.d.ts +3 -2
- package/build/components/FileInput/DragAndDrop.js +5 -7
- package/build/components/Lottie/Lottie.d.ts +3536 -210
- package/build/components/Lottie/Lottie.js +11 -3
- package/build/components/Lottie/files/account_creating.json +732 -0
- package/build/components/Lottie/files/error.json +692 -0
- package/build/components/Lottie/files/start_loading.json +1140 -0
- package/build/components/Lottie/files/still_loading.json +1140 -0
- package/build/components/ProgressBar/CircularProgressBar.d.ts +3 -1
- package/build/components/ProgressBar/CircularProgressBar.js +2 -2
- package/build/components/Radio/Radio.js +1 -1
- package/build/components/RadioLabel/RadioLabel.d.ts +4 -2
- package/build/components/RadioLabel/RadioLabel.js +2 -2
- package/build/components/SimpleList/SimpleList.d.ts +2 -1
- package/build/components/SimpleList/SimpleList.js +22 -10
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/components/Tooltip/Tooltip.d.ts +1 -1
- package/build/components/Tooltip/Tooltip.js +12 -3
- package/build/constants/api.d.ts +8 -0
- package/build/constants/api.js +17 -1
- package/build/constants/app.d.ts +24 -2
- package/build/constants/app.js +182 -16
- package/build/constants/assets.d.ts +3 -0
- package/build/constants/assets.js +3 -0
- package/build/constants/validation.d.ts +3 -0
- package/build/constants/validation.js +3 -0
- package/build/features/app/bank/bankStore.d.ts +79 -23
- package/build/features/app/bank/bankStore.js +85 -111
- package/build/features/app/brand/brandStore.d.ts +191 -0
- package/build/features/app/brand/brandStore.js +654 -0
- package/build/features/app/business/businessStore.d.ts +185 -24
- package/build/features/app/business/businessStore.js +219 -217
- package/build/features/app/connect/connectStore.d.ts +124 -19
- package/build/features/app/connect/connectStore.js +228 -264
- package/build/features/app/connectExpress/connectExpressStore.d.ts +282 -0
- package/build/features/app/connectExpress/connectExpressStore.js +1013 -0
- package/build/features/app/entity/entityStore.d.ts +101 -24
- package/build/features/app/entity/entityStore.js +345 -341
- package/build/features/app/individual/individualStore.d.ts +83 -20
- package/build/features/app/individual/individualStore.js +166 -135
- package/build/features/app/password/passwordStore.d.ts +106 -17
- package/build/features/app/password/passwordStore.js +34 -29
- package/build/features/app/signIn/signInStore.d.ts +61 -7
- package/build/features/app/signIn/signInStore.js +24 -47
- package/build/features/app/tax/taxStore.d.ts +69 -9
- package/build/features/app/tax/taxStore.js +105 -94
- package/build/features/bank/Bank.d.ts +5 -3
- package/build/features/bank/Bank.js +39 -36
- package/build/features/bank/screens/BankDetails/BankDetails.js +26 -22
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +11 -44
- package/build/features/bank/screens/BankDetails/IBAN.js +5 -2
- package/build/features/bank/screens/BankDetails/validation.d.ts +22 -6
- package/build/features/bank/screens/BankDetails/validation.js +11 -24
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/bank/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/bank/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -97
- package/build/features/brand/Brand.d.ts +9 -0
- package/build/features/brand/Brand.js +72 -0
- package/build/features/brand/index.d.ts +1 -0
- package/build/features/brand/index.js +1 -0
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +91 -0
- package/build/features/{entity/screens/EntityInfoConfirm → brand/screens/BrandActivities}/ActivitiesList.js +54 -41
- package/build/features/brand/screens/BrandActivities/BrandActivities.d.ts +5 -0
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +72 -0
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +82 -0
- package/build/features/{entity/screens/Customers/CustomerLocations.js → brand/screens/BrandActivities/CustomerBase.js} +9 -37
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/ExpectedCustomers.d.ts +0 -0
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/ExpectedCustomers.js +7 -8
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/ExpectedSalesRange.d.ts +0 -0
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/ExpectedSalesRange.js +14 -11
- package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +20 -0
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +45 -0
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +36 -0
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/RefundPolicy.js +1 -3
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +6 -0
- package/build/features/{auth/screens/NID → brand/screens/BrandActivities}/TAC.js +8 -11
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/TransactionPolicy.d.ts +0 -0
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/TransactionPolicy.js +1 -3
- package/build/features/brand/screens/BrandActivities/index.d.ts +2 -0
- package/build/features/brand/screens/BrandActivities/index.js +2 -0
- package/build/features/brand/screens/BrandActivities/validation.d.ts +71 -0
- package/build/features/{entity/screens/Customers → brand/screens/BrandActivities}/validation.js +9 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.d.ts +5 -0
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +72 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +8 -0
- package/build/features/brand/screens/BrandInfo/BrandName.js +142 -0
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +5 -0
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +30 -0
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +8 -0
- package/build/features/brand/screens/BrandInfo/Segments.js +74 -0
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +8 -0
- package/build/features/brand/screens/BrandInfo/TeamSize.js +74 -0
- package/build/features/brand/screens/BrandInfo/index.d.ts +2 -0
- package/build/features/brand/screens/BrandInfo/index.js +2 -0
- package/build/features/brand/screens/BrandInfo/validation.d.ts +41 -0
- package/build/features/brand/screens/BrandInfo/validation.js +106 -0
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/brand/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/brand/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +16 -0
- package/build/features/brand/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/brand/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/brand/screens/Success/Success.d.ts +5 -0
- package/build/features/brand/screens/Success/Success.js +20 -0
- package/build/features/brand/screens/Success/index.d.ts +3 -0
- package/build/features/brand/screens/Success/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +22 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/brand/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/brand/screens/Verify/OTPInput.js +47 -0
- package/build/features/{auth/screens/OTP/OTPInput.d.ts → brand/screens/Verify/Verify.d.ts} +0 -0
- package/build/features/brand/screens/Verify/Verify.js +91 -0
- package/build/features/brand/screens/Verify/index.d.ts +2 -0
- package/build/features/brand/screens/Verify/index.js +2 -0
- package/build/features/{auth/screens/OTP → brand/screens/Verify}/validation.d.ts +0 -0
- package/build/features/{auth/screens/OTP → brand/screens/Verify}/validation.js +0 -0
- package/build/features/business/Business.d.ts +4 -3
- package/build/features/business/Business.js +9 -14
- package/build/features/business/screens/Activities/Activities.js +6 -14
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +13 -13
- package/build/features/business/screens/Activities/ActivitiesList.js +11 -17
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/Activities/validation.js +4 -1
- package/build/features/business/screens/BusinessType/Article.d.ts +6 -0
- package/build/features/business/screens/BusinessType/Article.js +87 -0
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -12
- package/build/features/business/screens/BusinessType/EntityName.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +12 -46
- package/build/features/business/screens/BusinessType/LicenseList.js +3 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +30 -2
- package/build/features/business/screens/BusinessType/LicenseType.js +31 -6
- package/build/features/business/screens/BusinessType/validation.d.ts +9 -6
- package/build/features/business/screens/BusinessType/validation.js +21 -13
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +11 -11
- package/build/features/business/screens/Customers/CustomerLocations.js +2 -3
- package/build/features/business/screens/Customers/ExpectedCustomers.js +2 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +8 -5
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
- package/build/features/business/screens/Customers/RefundPolicy.js +1 -3
- package/build/features/business/screens/Customers/TransactionPolicy.js +1 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -96
- package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +1 -1
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +9 -134
- package/build/features/connect/Connect.d.ts +4 -4
- package/build/features/connect/Connect.js +14 -31
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -1
- package/build/features/connect/screens/Individual/Individual.js +5 -8
- package/build/features/connect/screens/Individual/validation.js +2 -8
- package/build/features/connect/screens/Merchant/BrandList.js +15 -2
- package/build/features/connect/screens/Merchant/BrandName.js +1 -1
- package/build/features/connect/screens/Merchant/Merchant.js +32 -36
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +1 -3
- package/build/features/connect/screens/Merchant/SalesChannels.js +28 -103
- package/build/features/connect/screens/Merchant/Segments.d.ts +8 -0
- package/build/features/connect/screens/Merchant/Segments.js +74 -0
- package/build/features/connect/screens/Merchant/TAC.js +1 -3
- package/build/features/connect/screens/Merchant/TeamSize.d.ts +8 -0
- package/build/features/connect/screens/Merchant/TeamSize.js +74 -0
- package/build/features/connect/screens/Merchant/validation.d.ts +6 -0
- package/build/features/connect/screens/Merchant/validation.js +12 -10
- package/build/features/connect/screens/ThankYou/ThankYou.js +9 -2
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +1 -1
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +9 -73
- package/build/features/connectExpress/ConnectExpress.d.ts +11 -0
- package/build/features/connectExpress/ConnectExpress.js +84 -0
- package/build/features/connectExpress/index.d.ts +1 -0
- package/build/features/connectExpress/index.js +1 -0
- package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.d.ts +5 -0
- package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.js +15 -0
- package/build/features/connectExpress/screens/AccountAlreadyCreated/index.d.ts +3 -0
- package/build/features/connectExpress/screens/AccountAlreadyCreated/index.js +2 -0
- package/build/features/connectExpress/screens/Brand/Brand.d.ts +5 -0
- package/build/features/connectExpress/screens/Brand/Brand.js +71 -0
- package/build/features/connectExpress/screens/Brand/index.d.ts +2 -0
- package/build/features/connectExpress/screens/Brand/index.js +2 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.js +84 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +55 -0
- package/build/features/connectExpress/screens/CivilID/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CivilID/index.js +2 -0
- package/build/features/connectExpress/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/CivilID/validation.js +4 -0
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.d.ts +5 -0
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +53 -0
- package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.d.ts +7 -0
- package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +55 -0
- package/build/features/connectExpress/screens/CivilIDMissed/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CivilIDMissed/index.js +2 -0
- package/build/features/connectExpress/screens/CivilIDMissed/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/CivilIDMissed/validation.js +4 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +8 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +142 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.d.ts +5 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +80 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +8 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +144 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +7 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +52 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +34 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +94 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +6 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +83 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/index.js +2 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +27 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +155 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.d.ts +5 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +89 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +8 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +113 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +10 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +149 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +6 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +45 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/index.js +2 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.d.ts +14 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +31 -0
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.d.ts +5 -0
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -0
- package/build/features/connectExpress/screens/CreateAccountLoader/index.d.ts +2 -0
- package/build/features/connectExpress/screens/CreateAccountLoader/index.js +2 -0
- package/build/features/{auth/screens/OTP → connectExpress/screens/IdentityOTP}/OTP.d.ts +0 -0
- package/build/features/{auth/screens/OTP → connectExpress/screens/IdentityOTP}/OTP.js +23 -12
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
- package/build/features/{auth/screens/OTP → connectExpress/screens/IdentityOTP}/OTPInput.js +9 -8
- package/build/features/{auth/screens/OTP → connectExpress/screens/IdentityOTP}/index.d.ts +0 -0
- package/build/features/{auth/screens/OTP → connectExpress/screens/IdentityOTP}/index.js +0 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/IdentityVerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityVerifyPACI/VerifyPACI.js +34 -0
- package/build/features/connectExpress/screens/IdentityVerifyPACI/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityVerifyPACI/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.d.ts +5 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +110 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +12 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +151 -0
- package/build/features/connectExpress/screens/Mobile/TAC.d.ts +6 -0
- package/build/features/connectExpress/screens/Mobile/TAC.js +83 -0
- package/build/features/connectExpress/screens/Mobile/Title.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/Title.js +29 -0
- package/build/features/connectExpress/screens/Mobile/index.d.ts +3 -0
- package/build/features/connectExpress/screens/Mobile/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/validation.js +60 -0
- package/build/features/{auth → connectExpress}/screens/NID/DOB.d.ts +1 -2
- package/build/features/{auth → connectExpress}/screens/NID/DOB.js +9 -9
- package/build/features/{auth → connectExpress}/screens/NID/IDNumber.d.ts +4 -1
- package/build/features/{auth → connectExpress}/screens/NID/IDNumber.js +14 -17
- package/build/features/{auth → connectExpress}/screens/NID/NID.d.ts +0 -0
- package/build/features/connectExpress/screens/NID/NID.js +92 -0
- package/build/features/connectExpress/screens/NID/TAC.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/TAC.js +83 -0
- package/build/features/{auth → connectExpress}/screens/NID/index.d.ts +0 -0
- package/build/features/{auth → connectExpress}/screens/NID/index.js +0 -0
- package/build/features/connectExpress/screens/NID/validation.d.ts +11 -0
- package/build/features/connectExpress/screens/NID/validation.js +22 -0
- package/build/features/connectExpress/screens/NIDMissed/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NIDMissed/DOB.js +47 -0
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.d.ts +6 -0
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +56 -0
- package/build/features/connectExpress/screens/NIDMissed/NID.d.ts +5 -0
- package/build/features/{auth/screens/NID → connectExpress/screens/NIDMissed}/NID.js +14 -23
- package/build/features/connectExpress/screens/NIDMissed/index.d.ts +3 -0
- package/build/features/connectExpress/screens/NIDMissed/index.js +2 -0
- package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +11 -0
- package/build/features/connectExpress/screens/NIDMissed/validation.js +9 -0
- package/build/features/{auth/screens/NID/TAC.d.ts → connectExpress/screens/OTP/OTP.d.ts} +2 -0
- package/build/features/connectExpress/screens/OTP/OTP.js +88 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.js +55 -0
- package/build/features/connectExpress/screens/OTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OTP/index.js +2 -0
- package/build/features/connectExpress/screens/OTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTP/validation.js +4 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +32 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.js +34 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.d.ts +5 -3
- package/build/features/entity/Entity.js +39 -37
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +90 -0
- package/build/features/entity/screens/EntityCapital/ActivityList.js +175 -0
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +5 -0
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +47 -0
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +5 -0
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +42 -0
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +5 -0
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +47 -0
- package/build/features/entity/screens/EntityCapital/EntityCapital.d.ts +5 -0
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +75 -0
- package/build/features/entity/screens/EntityCapital/index.d.ts +2 -0
- package/build/features/entity/screens/EntityCapital/index.js +2 -0
- package/build/features/entity/screens/EntityCapital/validation.d.ts +62 -0
- package/build/features/entity/screens/EntityCapital/validation.js +21 -0
- package/build/features/entity/screens/EntityName/Article.d.ts +6 -0
- package/build/features/entity/screens/EntityName/Article.js +87 -0
- package/build/features/entity/screens/EntityName/EntityName.d.ts +5 -0
- package/build/features/entity/screens/EntityName/EntityName.js +93 -0
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +90 -0
- package/build/features/entity/screens/EntityName/EntityTypeList.js +151 -0
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +19 -0
- package/build/features/entity/screens/EntityName/ExpiryDate.js +46 -0
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +19 -0
- package/build/features/entity/screens/EntityName/IssuingDate.js +46 -0
- package/build/features/entity/screens/EntityName/LegalName.d.ts +5 -0
- package/build/features/entity/screens/EntityName/LegalName.js +48 -0
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +6 -0
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +42 -0
- package/build/features/entity/screens/{EntityInfoConfirm → EntityName}/LicenseNumber.d.ts +0 -0
- package/build/features/entity/screens/{EntityInfoConfirm → EntityName}/LicenseNumber.js +12 -18
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +6 -0
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +43 -0
- package/build/features/entity/screens/EntityName/index.d.ts +2 -0
- package/build/features/entity/screens/EntityName/index.js +2 -0
- package/build/features/entity/screens/EntityName/validation.d.ts +60 -0
- package/build/features/entity/screens/EntityName/validation.js +116 -0
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/entity/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/entity/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -94
- package/build/features/featuresScreens.d.ts +2 -1
- package/build/features/featuresScreens.js +128 -14
- package/build/features/individual/Individual.d.ts +5 -3
- package/build/features/individual/Individual.js +39 -37
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +20 -18
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +30 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +5 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +28 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +24 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +42 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -0
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/individual/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/individual/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -97
- package/build/features/password/Password.d.ts +5 -3
- package/build/features/password/Password.js +9 -14
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -97
- package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
- package/build/features/shared/Address/Address.d.ts +11 -0
- package/build/features/shared/Address/Address.js +63 -0
- package/build/features/shared/Address/CountryList.d.ts +72 -0
- package/build/features/shared/Address/CountryList.js +89 -0
- package/build/features/shared/Address/InputSelect.d.ts +71 -0
- package/build/features/shared/Address/InputSelect.js +172 -0
- package/build/features/shared/Address/InputText.d.ts +11 -0
- package/build/features/shared/Address/InputText.js +12 -0
- package/build/features/shared/Address/index.d.ts +2 -0
- package/build/features/shared/Address/index.js +2 -0
- package/build/features/shared/Background/Background.js +1 -5
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +3 -1
- package/build/features/shared/Button/FlowsButtons.js +39 -7
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -1
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/CreateAccountLoading/CreateAccountLoading.d.ts +6 -0
- package/build/features/shared/CreateAccountLoading/CreateAccountLoading.js +58 -0
- package/build/features/shared/CreateAccountLoading/index.d.ts +2 -0
- package/build/features/shared/CreateAccountLoading/index.js +2 -0
- package/build/features/shared/DataLoading/DataLoading.d.ts +6 -0
- package/build/features/shared/DataLoading/DataLoading.js +58 -0
- package/build/features/shared/DataLoading/index.d.ts +2 -0
- package/build/features/shared/DataLoading/index.js +2 -0
- package/build/features/shared/Footer/Footer.js +1 -1
- package/build/features/shared/GenericError/GenericError.d.ts +7 -0
- package/build/features/shared/GenericError/GenericError.js +55 -0
- package/build/features/shared/GenericError/index.d.ts +2 -0
- package/build/features/shared/GenericError/index.js +2 -0
- package/build/features/shared/Input/Input.d.ts +9 -7
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/PaciVerification/PaciVerification.d.ts +12 -0
- package/build/features/shared/PaciVerification/PaciVerification.js +91 -0
- package/build/features/{connect/screens/VerifyPACI → shared/PaciVerification}/VerifyPACILoading.d.ts +1 -0
- package/build/features/shared/PaciVerification/VerifyPACILoading.js +27 -0
- package/build/features/{business/screens/VerifyPACI → shared/PaciVerification}/VerifyPACISuccess.d.ts +0 -0
- package/build/features/{business/screens/VerifyPACI → shared/PaciVerification}/VerifyPACISuccess.js +1 -1
- package/build/features/shared/PaciVerification/index.d.ts +2 -0
- package/build/features/shared/PaciVerification/index.js +2 -0
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +11 -0
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +100 -0
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +11 -0
- package/build/features/shared/SalesChannels/SalesChannel.js +149 -0
- package/build/features/shared/SalesChannels/index.d.ts +2 -0
- package/build/features/shared/SalesChannels/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +16 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +113 -0
- package/build/features/shared/SuccessFlowButtons/index.d.ts +2 -0
- package/build/features/shared/SuccessFlowButtons/index.js +2 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +5 -4
- package/build/features/shared/UploadFile/UploadFile.js +13 -13
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +38 -0
- package/build/features/shared/UploadMultipleFile/UploadFile.js +184 -0
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +27 -0
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +149 -0
- package/build/features/shared/UploadMultipleFile/index.d.ts +2 -0
- package/build/features/shared/UploadMultipleFile/index.js +2 -0
- package/build/features/signIn/SignIn.d.ts +4 -3
- package/build/features/signIn/SignIn.js +9 -15
- package/build/features/tax/Tax.d.ts +5 -3
- package/build/features/tax/Tax.js +39 -38
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/tax/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/tax/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -2
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -97
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +21 -23
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +6 -0
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +42 -0
- package/build/features/tax/screens/TaxDetails/VATId.js +7 -2
- package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/validation.js +2 -1
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +3 -1
- package/build/hooks/useAppConfig.js +6 -4
- package/build/hooks/useAppDispatch.d.ts +2 -1
- package/build/hooks/useCountUp.d.ts +9 -0
- package/build/hooks/useCountUp.js +17 -0
- package/build/hooks/useCountry.d.ts +4 -0
- package/build/hooks/useCountry.js +7 -0
- package/build/hooks/useSetFromDefaultValues.js +4 -2
- package/build/hooks/useVerifyToken.d.ts +15 -0
- package/build/hooks/useVerifyToken.js +25 -0
- package/build/index.d.ts +12 -11
- package/build/index.js +13 -21
- package/build/theme/typography.js +1 -1
- package/build/utils/array.d.ts +4 -1
- package/build/utils/array.js +24 -3
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +1 -0
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +5 -0
- package/build/utils/html.d.ts +0 -1
- package/build/utils/html.js +2 -10
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/string.d.ts +2 -0
- package/build/utils/string.js +23 -2
- package/package.json +1 -1
- package/build/api/ip.d.ts +0 -4
- package/build/api/ip.js +0 -12
- package/build/features/app/auth/authStore.d.ts +0 -46
- package/build/features/app/auth/authStore.js +0 -261
- package/build/features/auth/Auth.d.ts +0 -10
- package/build/features/auth/Auth.js +0 -87
- package/build/features/auth/index.d.ts +0 -1
- package/build/features/auth/index.js +0 -1
- package/build/features/auth/screens/NID/validation.d.ts +0 -27
- package/build/features/auth/screens/NID/validation.js +0 -19
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +0 -6
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +0 -23
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +0 -6
- package/build/features/connect/screens/Merchant/SocialMedia.js +0 -182
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +0 -23
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +0 -8
- package/build/features/entity/screens/Customers/CustomerLocations.d.ts +0 -118
- package/build/features/entity/screens/Customers/Customers.d.ts +0 -5
- package/build/features/entity/screens/Customers/Customers.js +0 -90
- package/build/features/entity/screens/Customers/RefundPolicy.d.ts +0 -36
- package/build/features/entity/screens/Customers/index.d.ts +0 -3
- package/build/features/entity/screens/Customers/index.js +0 -2
- package/build/features/entity/screens/Customers/validation.d.ts +0 -20
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +0 -55
- package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +0 -3
- package/build/features/entity/screens/EntityInfoConfirm/Article.js +0 -73
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +0 -84
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +0 -32
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +0 -6
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +0 -33
- package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/index.js +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +0 -141
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +0 -83
|
@@ -10,64 +10,67 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import TeamSize from '../../../connect/screens/Merchant/TeamSize';
|
|
13
14
|
import * as React from 'react';
|
|
14
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
16
|
import { useTranslation } from 'react-i18next';
|
|
16
17
|
import Collapse from '@mui/material/Collapse';
|
|
17
18
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
19
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
-
import { handlePrevScreenStep
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
21
|
import Form from '../../../../components/Form';
|
|
21
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
23
|
import Button from '../../../shared/Button';
|
|
23
24
|
import { clearError, connectSelector, updateLeadBrand } from '../../../app/connect/connectStore';
|
|
24
25
|
import { useLanguage } from '../../../../hooks';
|
|
25
|
-
import { AuthForType } from '../../../../@types';
|
|
26
|
-
import { isKW, mapSalesChannel } from '../../../../utils';
|
|
27
26
|
import { MerchantValidationSchema } from './validation';
|
|
28
27
|
import BrandName from './BrandName';
|
|
29
|
-
import SocialMedia from './SocialMedia';
|
|
30
28
|
import TAC from './TAC';
|
|
31
29
|
import BrandList from './BrandList';
|
|
32
30
|
import SalesChannels from './SalesChannels';
|
|
31
|
+
import Segments from './Segments';
|
|
32
|
+
var ListType;
|
|
33
|
+
(function (ListType) {
|
|
34
|
+
ListType["SegmentsList"] = "SegmentsList";
|
|
35
|
+
ListType["TeamSizeList"] = "TeamSizeList";
|
|
36
|
+
ListType["BrandList"] = "BrandList";
|
|
37
|
+
})(ListType || (ListType = {}));
|
|
33
38
|
var Merchant = function (_a) {
|
|
34
39
|
var _b, _c;
|
|
35
40
|
var _d = React.useState(false), brandNameChecking = _d[0], setBrandNameChecking = _d[1];
|
|
36
|
-
var _e = React.useState(false),
|
|
37
|
-
var _f =
|
|
38
|
-
var _g =
|
|
39
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
40
|
-
var isNewIndividual = (_b = data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.is_new_individual;
|
|
41
|
-
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
42
|
-
var _h = data.brandData, brandName = _h.brandName, selectedBrandItem = _h.selectedBrandItem, termAndConditionChecked = _h.termAndConditionChecked, responseBody = _h.responseBody, salesChannels = _h.salesChannels;
|
|
41
|
+
var _e = React.useState(false), isRequiredNewBrand = _e[0], setIsRequiredNewBrand = _e[1];
|
|
42
|
+
var _f = useAppSelector(connectSelector), data = _f.data, loading = _f.loading, error = _f.error;
|
|
43
|
+
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels, segment = _g.segment, teamSize = _g.teamSize;
|
|
43
44
|
var brandList = (responseBody || {}).brand_list;
|
|
45
|
+
var _h = React.useState(), listActive = _h[0], setListActive = _h[1];
|
|
44
46
|
var methods = useForm({
|
|
45
47
|
resolver: yupResolver(MerchantValidationSchema(isRequiredNewBrand)),
|
|
46
48
|
defaultValues: {
|
|
47
|
-
brandName: brandName,
|
|
49
|
+
brandName: brandName || ((_b = selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.name) === null || _b === void 0 ? void 0 : _b.en),
|
|
48
50
|
selectedBrandItem: selectedBrandItem,
|
|
49
51
|
termAndConditionChecked: termAndConditionChecked,
|
|
50
|
-
salesChannels: salesChannels
|
|
52
|
+
salesChannels: salesChannels,
|
|
53
|
+
segment: segment,
|
|
54
|
+
teamSize: teamSize
|
|
51
55
|
},
|
|
52
56
|
mode: 'onChange'
|
|
53
57
|
});
|
|
54
58
|
var t = useTranslation().t;
|
|
55
59
|
var isAr = useLanguage().isAr;
|
|
56
60
|
var dispatch = useAppDispatch();
|
|
57
|
-
var brandListItem = methods.
|
|
61
|
+
var brandListItem = methods.getValues('selectedBrandItem');
|
|
58
62
|
var onSubmit = function (formData) {
|
|
59
63
|
dispatch(updateLeadBrand(__assign(__assign({}, formData), { isNewBrand: isRequiredNewBrand })));
|
|
60
64
|
};
|
|
61
65
|
var onBack = function () {
|
|
62
|
-
|
|
63
|
-
if (isNewIndividual) {
|
|
64
|
-
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
68
|
-
var screen = startWithNID ? (isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : 'CONNECT_NID_STEP') : 'CONNECT_MOBILE_STEP';
|
|
69
|
-
dispatch(handlePrevScreenStep(screen));
|
|
66
|
+
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
70
67
|
};
|
|
68
|
+
React.useEffect(function () {
|
|
69
|
+
methods.setValue('segment', segment);
|
|
70
|
+
methods.setValue('teamSize', teamSize);
|
|
71
|
+
if (brandName)
|
|
72
|
+
methods.trigger('brandName');
|
|
73
|
+
}, [segment, teamSize, brandName]);
|
|
71
74
|
React.useEffect(function () {
|
|
72
75
|
if (error)
|
|
73
76
|
dispatch(clearError());
|
|
@@ -76,19 +79,6 @@ var Merchant = function (_a) {
|
|
|
76
79
|
if ((responseBody === null || responseBody === void 0 ? void 0 : responseBody.response_code) === '5')
|
|
77
80
|
methods.setError('brandName', { message: 'brand_name_already_exist' });
|
|
78
81
|
}, [responseBody]);
|
|
79
|
-
React.useEffect(function () {
|
|
80
|
-
if (selectedBrandItem.id) {
|
|
81
|
-
methods.setValue('selectedBrandItem', selectedBrandItem);
|
|
82
|
-
var sales = mapSalesChannel(selectedBrandItem.channel_services || []);
|
|
83
|
-
methods.setValue('salesChannels', sales, { shouldValidate: true });
|
|
84
|
-
}
|
|
85
|
-
}, [selectedBrandItem]);
|
|
86
|
-
React.useEffect(function () {
|
|
87
|
-
if (salesChannels.length > 0) {
|
|
88
|
-
var sales = mapSalesChannel(salesChannels);
|
|
89
|
-
methods.setValue('salesChannels', sales, { shouldValidate: true });
|
|
90
|
-
}
|
|
91
|
-
}, [salesChannels]);
|
|
92
82
|
React.useEffect(function () {
|
|
93
83
|
if (termAndConditionChecked === true)
|
|
94
84
|
methods.setValue('termAndConditionChecked', termAndConditionChecked);
|
|
@@ -101,6 +91,12 @@ var Merchant = function (_a) {
|
|
|
101
91
|
React.useEffect(function () {
|
|
102
92
|
setIsRequiredNewBrand(isOtherBrand || isNewBrand);
|
|
103
93
|
}, [isOtherBrand, isNewBrand]);
|
|
104
|
-
|
|
94
|
+
var handleMenuClick = function (flag) {
|
|
95
|
+
setListActive(flag);
|
|
96
|
+
};
|
|
97
|
+
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
98
|
+
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
99
|
+
var isBrandListActive = listActive === ListType.BrandList;
|
|
100
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: !(isOtherBrand || isNewBrand) && !isTeamSizeListActive && !isSegmentsListActive, list: brandList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Segments, { show: !isTeamSizeListActive && !isBrandListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentsListActive && !isBrandListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !listActive }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
105
101
|
};
|
|
106
102
|
export default React.memo(Merchant);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
-
export declare const CollapseStyled: import("@emotion/styled").StyledComponent<import("../../../../components/Collapse").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
1
|
+
/// <reference types="react" />
|
|
4
2
|
interface SalesChannelsProps {
|
|
5
3
|
}
|
|
6
4
|
declare const SalesChannels: ({}: SalesChannelsProps) => JSX.Element;
|
|
@@ -1,113 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import Box from '@mui/material/Box';
|
|
23
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
24
|
-
import { useTranslation } from 'react-i18next';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
25
3
|
import { useController, useFormContext } from 'react-hook-form';
|
|
26
|
-
import {
|
|
27
|
-
import Text from '../../../../components/Text';
|
|
4
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
28
5
|
import { connectSelector, clearError } from '../../../app/connect/connectStore';
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import Collapse from '../../../../components/Collapse';
|
|
32
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
33
|
-
var theme = _a.theme;
|
|
34
|
-
return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
35
|
-
});
|
|
36
|
-
var ContainerStyled = styled(Box)(function (_a) {
|
|
37
|
-
var theme = _a.theme;
|
|
38
|
-
return ({
|
|
39
|
-
display: 'flex',
|
|
40
|
-
flexDirection: 'row',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
padding: theme.spacing(0, 0.5, 0, 0.5),
|
|
43
|
-
height: theme.spacing(3.625),
|
|
44
|
-
marginBlockEnd: theme.spacing(0.2)
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
var TextStyled = styled(Text)(function (_a) {
|
|
48
|
-
var theme = _a.theme;
|
|
49
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
|
|
50
|
-
});
|
|
51
|
-
var CheckBoxStyled = styled(CheckBox)(function (_a) {
|
|
52
|
-
var theme = _a.theme;
|
|
53
|
-
return ({
|
|
54
|
-
paddingInline: '15px',
|
|
55
|
-
marginInlineEnd: theme.spacing(-1),
|
|
56
|
-
'& .MuiSvgIcon-root': {
|
|
57
|
-
fontSize: 30
|
|
58
|
-
},
|
|
59
|
-
'&.Mui-checked': {
|
|
60
|
-
color: theme.palette.text.primary,
|
|
61
|
-
borderRadius: theme.spacing(2.5)
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
export var MandatoryStyled = styled('span')(function (_a) {
|
|
66
|
-
var theme = _a.theme;
|
|
67
|
-
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
68
|
-
});
|
|
69
|
-
export var CollapseStyled = styled(Collapse)(function (_a) {
|
|
70
|
-
var theme = _a.theme;
|
|
71
|
-
return ({
|
|
72
|
-
marginBlockStart: theme.spacing(2)
|
|
73
|
-
});
|
|
74
|
-
});
|
|
6
|
+
import { mapSalesChannel } from '../../../../utils';
|
|
7
|
+
import SalesChannel from '../../../shared/SalesChannels';
|
|
75
8
|
var SalesChannels = function (_a) {
|
|
76
9
|
var _b;
|
|
77
|
-
var
|
|
78
|
-
var isAr = useLanguage().isAr;
|
|
79
|
-
var _c = useFormContext(), control = _c.control, getValues = _c.getValues;
|
|
10
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue, getValues = _c.getValues;
|
|
80
11
|
var dispatch = useAppDispatch();
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (isChecked(channel.id)) {
|
|
92
|
-
var filterChannels = channelsControl.field.value.filter(function (item) { return item.id !== channel.id; });
|
|
93
|
-
channelsControl.field.onChange(filterChannels);
|
|
12
|
+
var _d = useController({ control: control, name: 'salesChannels' }), fieldState = _d.fieldState, field = _d.field;
|
|
13
|
+
var _e = useAppSelector(connectSelector), data = _e.data, error = _e.error;
|
|
14
|
+
var _f = data.brandData, selectedBrandItem = _f.selectedBrandItem, responseBody = _f.responseBody, defaultSalesChannels = _f.salesChannels;
|
|
15
|
+
var channelList = (responseBody || {}).channel_list;
|
|
16
|
+
var selectedBrandControl = getValues('selectedBrandItem');
|
|
17
|
+
React.useEffect(function () {
|
|
18
|
+
if (selectedBrandItem.id) {
|
|
19
|
+
setValue('selectedBrandItem', selectedBrandItem);
|
|
20
|
+
var sales = mapSalesChannel(selectedBrandItem.channel_services || []);
|
|
21
|
+
field.onChange(sales);
|
|
94
22
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var address = (brandValue[brandValue.length - 1] === '-' ? brandValue.slice(0, -1) : brandValue) + '.com';
|
|
101
|
-
newChannel.address = 'www.' + address;
|
|
102
|
-
}
|
|
103
|
-
channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsControl.field.value, true), [newChannel], false));
|
|
23
|
+
}, [selectedBrandItem]);
|
|
24
|
+
React.useEffect(function () {
|
|
25
|
+
if (defaultSalesChannels.length > 0) {
|
|
26
|
+
var sales = mapSalesChannel(defaultSalesChannels);
|
|
27
|
+
field.onChange(sales);
|
|
104
28
|
}
|
|
29
|
+
}, [defaultSalesChannels]);
|
|
30
|
+
var selectedSalesChannels = React.useMemo(function () { return mapSalesChannel(field.value); }, [(field.value || []).length]);
|
|
31
|
+
var onChange = function (channels) {
|
|
32
|
+
if (error)
|
|
33
|
+
dispatch(clearError());
|
|
34
|
+
field.onChange(channels);
|
|
105
35
|
};
|
|
106
|
-
|
|
107
|
-
var isSalesChannelError = warningMessage === 'choose_atleast_one_channel';
|
|
108
|
-
return (_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), (channelList || []).map(function (channel, index) {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onChange(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, channel.id));
|
|
111
|
-
}), _jsx(CollapseStyled, __assign({ in: isSalesChannelError }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] })));
|
|
36
|
+
return (_jsx(SalesChannel, { error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, list: channelList, selectFirstIconListener: selectedBrandControl === null || selectedBrandControl === void 0 ? void 0 : selectedBrandControl.id, onChange: onChange, defaultValue: selectedSalesChannels }));
|
|
112
37
|
};
|
|
113
38
|
export default SalesChannels;
|
|
@@ -0,0 +1,74 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { connectSelector } from '../../../app/connect/connectStore';
|
|
14
|
+
import Collapse from '../../../../components/Collapse';
|
|
15
|
+
import { ScreenContainer } from '../../../../features/shared/Containers';
|
|
16
|
+
import Input from '../../../../features/shared/Input';
|
|
17
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { useTranslation } from 'react-i18next';
|
|
20
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
21
|
+
import SimpleList from '../../../../components/SimpleList';
|
|
22
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
24
|
+
import { styled } from '@mui/material/styles';
|
|
25
|
+
import Text from '../../../../components/Text';
|
|
26
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
27
|
+
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
|
+
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
30
|
+
});
|
|
31
|
+
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return ({
|
|
34
|
+
color: theme.palette.success.main,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'flex-end'
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var Segments = function (_a) {
|
|
40
|
+
var _b, _c, _d, _e;
|
|
41
|
+
var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose;
|
|
42
|
+
var _f = React.useState([]), segmentList = _f[0], setSegmentList = _f[1];
|
|
43
|
+
var _g = React.useState(null), anchorEl = _g[0], setAnchorEl = _g[1];
|
|
44
|
+
var t = useTranslation().t;
|
|
45
|
+
var isAr = useLanguage().isAr;
|
|
46
|
+
var data = useAppSelector(connectSelector).data;
|
|
47
|
+
var control = useFormContext().control;
|
|
48
|
+
var segmentsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.segments_list) || [];
|
|
49
|
+
var segmentControl = useController({ control: control, name: 'segment' });
|
|
50
|
+
var segment = segmentControl.field.value;
|
|
51
|
+
var error = (_c = segmentControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
52
|
+
React.useEffect(function () {
|
|
53
|
+
if ((segmentsList === null || segmentsList === void 0 ? void 0 : segmentsList.length) > 0) {
|
|
54
|
+
setSegmentList(segmentsList);
|
|
55
|
+
}
|
|
56
|
+
}, [segmentsList]);
|
|
57
|
+
var onOpenList = function (event) {
|
|
58
|
+
setAnchorEl(event.currentTarget);
|
|
59
|
+
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
60
|
+
};
|
|
61
|
+
var onCloseList = function () {
|
|
62
|
+
setAnchorEl(null);
|
|
63
|
+
onListClose === null || onListClose === void 0 ? void 0 : onListClose();
|
|
64
|
+
};
|
|
65
|
+
var onSelectItem = function (segment) {
|
|
66
|
+
onCloseList();
|
|
67
|
+
segmentControl.field.onChange(segment);
|
|
68
|
+
};
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('segment_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
73
|
+
};
|
|
74
|
+
export default Segments;
|
|
@@ -79,8 +79,6 @@ var TAC = function (_a) {
|
|
|
79
79
|
var handleTACCheckedChange = function (event, checked) {
|
|
80
80
|
tacControl.field.onChange(checked);
|
|
81
81
|
};
|
|
82
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr
|
|
83
|
-
? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR
|
|
84
|
-
: TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
82
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
85
83
|
};
|
|
86
84
|
export default React.memo(TAC);
|
|
@@ -0,0 +1,74 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { connectSelector } from '../../../app/connect/connectStore';
|
|
14
|
+
import Box from '@mui/material/Box';
|
|
15
|
+
import Collapse from '../../../../components/Collapse';
|
|
16
|
+
import { ScreenContainer } from '../../../../features/shared/Containers';
|
|
17
|
+
import Input from '../../../../features/shared/Input';
|
|
18
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import { useTranslation } from 'react-i18next';
|
|
21
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
22
|
+
import SimpleList from '../../../../components/SimpleList';
|
|
23
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
24
|
+
import { styled } from '@mui/material/styles';
|
|
25
|
+
import Text from '../../../../components/Text';
|
|
26
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
27
|
+
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
|
+
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
30
|
+
});
|
|
31
|
+
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return ({
|
|
34
|
+
color: theme.palette.success.main,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'flex-end'
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var TeamSize = function (_a) {
|
|
40
|
+
var _b, _c, _d, _e;
|
|
41
|
+
var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose;
|
|
42
|
+
var _f = React.useState([]), teamSizeList = _f[0], setTeamSizeList = _f[1];
|
|
43
|
+
var _g = React.useState(null), anchorEl = _g[0], setAnchorEl = _g[1];
|
|
44
|
+
var t = useTranslation().t;
|
|
45
|
+
var isAr = useLanguage().isAr;
|
|
46
|
+
var data = useAppSelector(connectSelector).data;
|
|
47
|
+
var control = useFormContext().control;
|
|
48
|
+
var teamSizesList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.team_size_list) || [];
|
|
49
|
+
var teamSizeControl = useController({ control: control, name: 'teamSize' });
|
|
50
|
+
var teamSize = teamSizeControl.field.value;
|
|
51
|
+
var error = (_c = teamSizeControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
52
|
+
React.useEffect(function () {
|
|
53
|
+
if ((teamSizesList === null || teamSizesList === void 0 ? void 0 : teamSizesList.length) > 0) {
|
|
54
|
+
setTeamSizeList(teamSizesList);
|
|
55
|
+
}
|
|
56
|
+
}, [teamSizesList]);
|
|
57
|
+
var onOpenList = function (event) {
|
|
58
|
+
setAnchorEl(event.currentTarget);
|
|
59
|
+
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
60
|
+
};
|
|
61
|
+
var onCloseList = function () {
|
|
62
|
+
setAnchorEl(null);
|
|
63
|
+
onListClose === null || onListClose === void 0 ? void 0 : onListClose();
|
|
64
|
+
};
|
|
65
|
+
var onSelectItem = function (teamSize) {
|
|
66
|
+
onCloseList();
|
|
67
|
+
teamSizeControl.field.onChange(teamSize);
|
|
68
|
+
};
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('team_size_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
73
|
+
};
|
|
74
|
+
export default TeamSize;
|
|
@@ -9,6 +9,8 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
9
9
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
10
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
11
|
}>>[] | undefined>;
|
|
12
|
+
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
13
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
12
14
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
15
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
14
16
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -19,6 +21,8 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
19
21
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
20
22
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
21
23
|
}>>[] | undefined>;
|
|
24
|
+
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
25
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
22
26
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
23
27
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
28
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -29,4 +33,6 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
29
33
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
30
34
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
35
|
}>>[] | undefined>;
|
|
36
|
+
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
37
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
32
38
|
}>>>;
|
|
@@ -7,7 +7,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7
7
|
}
|
|
8
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
9
|
};
|
|
10
|
-
import { REGEX_WEBSITE, REGEX_BRAND_NAME, LINKEDIN_URL, SOCIAL_USERNAME, DIGITS_ONLY,
|
|
10
|
+
import { REGEX_WEBSITE, REGEX_BRAND_NAME, LINKEDIN_URL, SOCIAL_USERNAME, DIGITS_ONLY, REGEX_ALPHANUMERIC } from '../../../../constants';
|
|
11
11
|
import * as yup from 'yup';
|
|
12
12
|
var validationSalesChannels = function (channels) {
|
|
13
13
|
if (channels === void 0) { channels = []; }
|
|
@@ -37,8 +37,6 @@ var validationSalesChannels = function (channels) {
|
|
|
37
37
|
if (atLestOne)
|
|
38
38
|
return "enter_at_least_one_".concat(key);
|
|
39
39
|
}
|
|
40
|
-
console.log('dic', dic);
|
|
41
|
-
console.log('typeDic', typeDic);
|
|
42
40
|
for (var key in typeDic) {
|
|
43
41
|
var value = typeDic[key];
|
|
44
42
|
if (key === 'website' && value && !value.match(REGEX_WEBSITE)) {
|
|
@@ -59,10 +57,10 @@ var validationSalesChannels = function (channels) {
|
|
|
59
57
|
if (key === 'physical_store' && value && value.length < 3) {
|
|
60
58
|
return 'invalid_physical_store_location';
|
|
61
59
|
}
|
|
62
|
-
if (key === 'ios' && value && !value.match(
|
|
60
|
+
if (key === 'ios' && value && !value.match(REGEX_ALPHANUMERIC)) {
|
|
63
61
|
return 'invalid_ios_app';
|
|
64
62
|
}
|
|
65
|
-
if (key === 'android' && value && !value.match(
|
|
63
|
+
if (key === 'android' && value && !value.match(REGEX_ALPHANUMERIC)) {
|
|
66
64
|
return 'invalid_android_app';
|
|
67
65
|
}
|
|
68
66
|
if (key === 'call_center' && value && !value.match(DIGITS_ONLY)) {
|
|
@@ -79,15 +77,17 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
79
77
|
.string()
|
|
80
78
|
.test({
|
|
81
79
|
test: function (value) {
|
|
82
|
-
if (length === 0)
|
|
80
|
+
if ((value === null || value === void 0 ? void 0 : value.length) === 0)
|
|
83
81
|
return true;
|
|
84
|
-
if (length
|
|
85
|
-
return
|
|
86
|
-
return
|
|
82
|
+
if (value && value.length >= 3 && (value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
|
|
83
|
+
return true;
|
|
84
|
+
return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
|
|
87
85
|
}
|
|
88
86
|
})
|
|
89
87
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
90
88
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
89
|
+
segment: yup.object().required('alert_choose_segment'),
|
|
90
|
+
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
91
91
|
salesChannels: yup
|
|
92
92
|
.array()
|
|
93
93
|
.min(1, 'choose_atleast_one_channel')
|
|
@@ -127,6 +127,8 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
127
127
|
return this.createError({ message: result });
|
|
128
128
|
}
|
|
129
129
|
})
|
|
130
|
-
.required('choose_atleast_one_channel')
|
|
130
|
+
.required('choose_atleast_one_channel'),
|
|
131
|
+
segment: yup.object().required('alert_choose_segment'),
|
|
132
|
+
teamSize: yup.object().required('alert_choose_teamSize')
|
|
131
133
|
});
|
|
132
134
|
};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
4
4
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
import { connectSelector } from '../../../../features/app/connect/connectStore';
|
|
6
|
+
import { useAppSelector } from '../../../../hooks';
|
|
7
|
+
import { maskEmail } from '../../../../utils';
|
|
5
8
|
var ThankYou = function (_a) {
|
|
9
|
+
var _b, _c, _d;
|
|
6
10
|
var t = useTranslation().t;
|
|
7
|
-
|
|
11
|
+
var data = useAppSelector(connectSelector).data;
|
|
12
|
+
var userEmail = ((_c = (_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.email) || ((_d = data.individualData) === null || _d === void 0 ? void 0 : _d.email);
|
|
13
|
+
var email = maskEmail(userEmail);
|
|
14
|
+
return (_jsx(SuccessScreen, { title: t("connect_completed_title"), description: _jsx(Trans, { i18nKey: 'connect_completed_description_dev', values: { email: email } }), showEmailProviders: true }));
|
|
8
15
|
};
|
|
9
16
|
export default React.memo(ThankYou);
|