@tap-payments/auth-jsconnect 2.3.5-test → 2.3.6
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 +303 -1
- package/build/@types/app.js +17 -0
- package/build/@types/form.d.ts +10 -7
- package/build/@types/redux.d.ts +4 -0
- package/build/@types/user.d.ts +39 -3
- package/build/api/brand.d.ts +7 -0
- package/build/api/brand.js +10 -1
- package/build/api/data.d.ts +8 -0
- package/build/api/data.js +34 -2
- package/build/api/entity.d.ts +20 -5
- package/build/api/entity.js +26 -1
- package/build/api/index.d.ts +29 -5
- package/build/api/index.js +3 -1
- package/build/api/individual.d.ts +24 -6
- package/build/api/individual.js +9 -1
- package/build/api/init.d.ts +17 -0
- package/build/api/init.js +13 -0
- package/build/api/lead.d.ts +8 -1
- package/build/api/lead.js +9 -1
- package/build/app/settings.d.ts +12 -9
- package/build/app/settings.js +77 -34
- package/build/assets/locales/ar.json +28 -1
- package/build/assets/locales/en.json +28 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
- package/build/components/AnimationFlow/AnimationFlow.js +4 -4
- package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
- package/build/components/AnimationFlow/BottomSheet.js +43 -19
- package/build/components/AnimationFlow/Dialog.d.ts +4 -2
- package/build/components/AnimationFlow/Dialog.js +30 -7
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +45 -23
- package/build/components/ArabicDatePicker/arabicAr.d.ts +8 -0
- package/build/components/ArabicDatePicker/arabicAr.js +32 -0
- package/build/components/ArabicDatePicker/arabicEn.d.ts +8 -0
- package/build/components/ArabicDatePicker/arabicEn.js +32 -0
- package/build/components/ArabicDatePicker/style.css +45 -5
- package/build/components/DatePicker/DatePicker.d.ts +4 -1
- package/build/components/DatePicker/DatePicker.js +27 -17
- package/build/components/LogoBadge/LogoBadge.js +3 -0
- package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
- package/build/components/RadioGroup/RadioGroup.js +5 -9
- package/build/components/RadioGroup/index.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.d.ts +5 -2
- package/build/components/SimpleList/SimpleList.js +31 -11
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/api.d.ts +7 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +45 -0
- package/build/constants/app.js +101 -52
- package/build/constants/assets.d.ts +9 -0
- package/build/constants/assets.js +9 -0
- package/build/constants/validation.d.ts +3 -2
- package/build/constants/validation.js +3 -2
- package/build/features/app/bank/bankStore.d.ts +7 -3
- package/build/features/app/bank/bankStore.js +155 -115
- package/build/features/app/brand/brandStore.d.ts +32 -12
- package/build/features/app/brand/brandStore.js +384 -203
- package/build/features/app/business/businessStore.d.ts +16 -13
- package/build/features/app/business/businessStore.js +364 -295
- package/build/features/app/connect/connectStore.d.ts +15 -1
- package/build/features/app/connect/connectStore.js +292 -95
- package/build/features/app/connectExpress/connectExpressStore.d.ts +17 -3
- package/build/features/app/connectExpress/connectExpressStore.js +232 -100
- package/build/features/app/entity/entityStore.d.ts +15 -17
- package/build/features/app/entity/entityStore.js +279 -248
- package/build/features/app/individual/individualStore.d.ts +22 -10
- package/build/features/app/individual/individualStore.js +531 -418
- package/build/features/app/password/passwordStore.d.ts +4 -0
- package/build/features/app/password/passwordStore.js +99 -43
- package/build/features/app/tax/taxStore.d.ts +6 -2
- package/build/features/app/tax/taxStore.js +143 -101
- package/build/features/bank/Bank.js +10 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +43 -17
- package/build/features/bank/screens/BankDetails/BankName.d.ts +5 -1
- package/build/features/bank/screens/BankDetails/BankName.js +9 -9
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +5 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +7 -10
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +3 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +6 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +3 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -5
- package/build/features/bank/screens/BankDetails/validation.d.ts +8 -8
- package/build/features/bank/screens/BankDetails/validation.js +6 -17
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/bank/screens/Verify/Verify.js +1 -5
- package/build/features/brand/Brand.js +10 -6
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +10 -27
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +45 -28
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +11 -38
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +22 -31
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +24 -20
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +31 -19
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +13 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -2
- package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
- package/build/features/brand/screens/BrandActivities/validation.d.ts +43 -43
- package/build/features/brand/screens/BrandActivities/validation.js +11 -25
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +40 -33
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +41 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +3 -2
- package/build/features/brand/screens/BrandInfo/BrandName.js +4 -7
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +19 -25
- package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
- package/build/features/brand/screens/BrandInfo/validation.js +43 -53
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.js +69 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.d.ts +10 -0
- package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.js +69 -0
- package/build/features/{connect/screens/Merchant → brand/screens/BrandSegmentInfo}/TeamSize.d.ts +3 -1
- package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +20 -25
- package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/Verify/Verify.js +7 -20
- package/build/features/business/Business.js +7 -5
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +15 -68
- package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +3 -3
- package/build/features/business/screens/Activities/validation.d.ts +165 -30
- package/build/features/business/screens/Activities/validation.js +5 -2
- package/build/features/business/screens/BrandDetails/BrandDetails.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandDetails.js +39 -0
- package/build/features/business/screens/BrandDetails/BrandName.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/BrandName.js +36 -0
- package/build/features/business/screens/BrandDetails/Header.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/Header.js +49 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.d.ts +5 -0
- package/build/features/business/screens/BrandDetails/LicenseInfo.js +38 -0
- package/build/features/{brand/screens/BrandActivities/OperationStartDate.d.ts → business/screens/BrandDetails/SalesChannel.d.ts} +5 -7
- package/build/features/business/screens/BrandDetails/SalesChannel.js +48 -0
- package/build/features/business/screens/BrandDetails/index.d.ts +3 -0
- package/build/features/business/screens/BrandDetails/index.js +2 -0
- package/build/features/business/screens/BusinessType/Article.d.ts +3 -1
- package/build/features/business/screens/BusinessType/Article.js +19 -54
- package/build/features/business/screens/BusinessType/BusinessType.js +35 -11
- package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +129 -0
- package/build/features/business/screens/BusinessType/EntityName.js +6 -7
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
- package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +7 -22
- package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +7 -5
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/BusinessType/validation.js +2 -2
- package/build/features/business/screens/CivilID/IDNumber.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +44 -37
- package/build/features/business/screens/Customers/CustomerLocations.js +35 -19
- package/build/features/business/screens/Customers/Customers.js +27 -16
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +14 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
- package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
- package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
- package/build/features/business/screens/IDBOD/DOB.js +3 -3
- package/build/features/business/screens/IDBOD/ID.js +2 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/Connect.d.ts +2 -0
- package/build/features/connect/Connect.js +86 -11
- package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
- package/build/features/connect/screens/BrandSegment/SegmentLocations.d.ts +8 -0
- package/build/features/connect/screens/{Merchant/Segments.js → BrandSegment/SegmentLocations.js} +17 -25
- package/build/features/connect/screens/BrandSegment/SegmentProfits.d.ts +8 -0
- package/build/features/{brand/screens/BrandInfo/Segments.js → connect/screens/BrandSegment/SegmentProfits.js} +18 -26
- package/build/features/connect/screens/BrandSegment/SegmentTechs.d.ts +8 -0
- package/build/features/connect/screens/BrandSegment/SegmentTechs.js +66 -0
- package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +12 -20
- package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
- package/build/features/connect/screens/BrandSegment/index.js +2 -0
- package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
- package/build/features/connect/screens/BrandSegment/validation.js +9 -0
- package/build/features/connect/screens/CivilID/CivilID.js +5 -13
- package/build/features/connect/screens/CivilID/IDNumber.js +5 -6
- package/build/features/connect/screens/Individual/Email.js +17 -27
- package/build/features/connect/screens/Individual/Individual.js +8 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +16 -15
- package/build/features/connect/screens/Individual/Name.js +11 -15
- package/build/features/connect/screens/Merchant/BrandList.js +4 -22
- package/build/features/connect/screens/Merchant/BrandName.js +4 -7
- package/build/features/connect/screens/Merchant/Merchant.js +13 -15
- package/build/features/connect/screens/Merchant/SalesChannels.js +6 -6
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
- package/build/features/connect/screens/Merchant/validation.js +14 -17
- package/build/features/connect/screens/Mobile/Mobile.js +13 -16
- package/build/features/connect/screens/Mobile/MobileNumber.js +14 -10
- package/build/features/connect/screens/NID/DOB.js +3 -3
- package/build/features/connect/screens/NID/IDNumber.js +6 -7
- package/build/features/connect/screens/NID/NID.js +6 -0
- package/build/features/connect/screens/OTP/OTP.js +13 -15
- package/build/features/connect/screens/OTP/OTPInput.js +10 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +17 -2
- package/build/features/connectExpress/ConnectExpress.d.ts +1 -0
- package/build/features/connectExpress/ConnectExpress.js +72 -12
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +6 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +7 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +9 -14
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +4 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +4 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +4 -4
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +11 -6
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +6 -14
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +3 -4
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +2 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
- package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
- package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
- package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
- package/build/features/connectExpress/screens/NID/DOB.js +3 -3
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +3 -4
- package/build/features/connectExpress/screens/NID/NID.js +4 -2
- package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
- package/build/features/connectExpress/screens/NID/TAC.js +9 -10
- package/build/features/connectExpress/screens/NIDMissed/DOB.js +2 -2
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
- package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -1
- package/build/features/entity/Entity.js +10 -6
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +16 -68
- package/build/features/entity/screens/EntityCapital/ActivityList.js +221 -106
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -15
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -11
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -16
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +31 -20
- package/build/features/entity/screens/EntityCapital/validation.d.ts +175 -40
- package/build/features/entity/screens/EntityCapital/validation.js +9 -12
- package/build/features/entity/screens/EntityName/Article.d.ts +5 -1
- package/build/features/entity/screens/EntityName/Article.js +20 -54
- package/build/features/entity/screens/EntityName/EntityName.js +60 -16
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +11 -27
- package/build/features/entity/screens/EntityName/EntityTypeList.js +32 -43
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +5 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.js +5 -5
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +5 -3
- package/build/features/entity/screens/EntityName/IssuingDate.js +4 -5
- package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LegalName.js +9 -6
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +13 -7
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +13 -11
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +3 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +9 -7
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/entity/screens/Verify/Verify.js +7 -20
- package/build/features/featuresScreens.js +13 -1
- package/build/features/individual/Individual.js +10 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +29 -10
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +3 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +17 -12
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -41
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -55
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +17 -12
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +13 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +14 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +32 -42
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +8 -12
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualList/UserList.js +10 -6
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +14 -20
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +8 -14
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +4 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -7
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +5 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +5 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +79 -36
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +10 -21
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +14 -16
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +10 -21
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +6 -3
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/individual/screens/Verify/Verify.js +1 -5
- package/build/features/password/Password.js +7 -5
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/Address/CountryList.d.ts +7 -7
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +7 -7
- package/build/features/shared/Address/InputSelect.js +1 -1
- package/build/features/shared/Button/Button.d.ts +3 -1
- package/build/features/shared/Button/Button.js +2 -2
- package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
- package/build/features/shared/Button/FlowsButtons.js +22 -20
- package/build/features/shared/Button/IndividualActionButtons.d.ts +3 -1
- package/build/features/shared/Button/IndividualActionButtons.js +28 -4
- package/build/features/shared/Calender/Calender.d.ts +13 -0
- package/build/features/shared/Calender/Calender.js +56 -0
- package/build/features/shared/Calender/index.d.ts +2 -0
- package/build/features/shared/Calender/index.js +2 -0
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
- package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
- package/build/features/shared/Chip/Chip.d.ts +3 -0
- package/build/features/shared/Chip/Chip.js +21 -0
- package/build/features/shared/Chip/index.d.ts +2 -0
- package/build/features/shared/Chip/index.js +2 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -4
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dot/Dot.d.ts +8 -0
- package/build/features/shared/Dot/Dot.js +29 -0
- package/build/features/shared/Dot/index.d.ts +2 -0
- package/build/features/shared/Dot/index.js +2 -0
- package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
- package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
- package/build/features/shared/EndAdornment/index.d.ts +3 -0
- package/build/features/shared/EndAdornment/index.js +3 -0
- package/build/features/shared/Footer/Footer.js +8 -0
- package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
- package/build/features/shared/Footer/PoweredByFooter.js +36 -0
- package/build/features/shared/Footer/index.d.ts +3 -2
- package/build/features/shared/Footer/index.js +3 -2
- package/build/features/shared/GenericError/GenericError.js +1 -1
- package/build/features/shared/Input/Input.d.ts +5 -6
- package/build/features/shared/Input/Input.js +2 -3
- package/build/features/shared/Input/index.d.ts +2 -1
- package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
- package/build/features/shared/InputSelect/InputSelect.js +33 -0
- package/build/features/shared/InputSelect/index.d.ts +2 -0
- package/build/features/shared/InputSelect/index.js +2 -0
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +3 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
- package/build/features/shared/Search/Search.d.ts +2 -1
- package/build/features/shared/Search/Search.js +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +19 -8
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
- package/build/features/shared/UploadFile/FileUpload.js +267 -0
- package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.js +7 -7
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +36 -0
- package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -1
- package/build/features/shared/UploadFile/index.js +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +8 -27
- package/build/features/shared/UploadMultipleFile/UploadFile.js +70 -56
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -3
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +11 -17
- package/build/features/signIn/SignIn.js +3 -4
- package/build/features/tax/Tax.js +10 -6
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +23 -10
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +6 -10
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/features/tax/screens/Verify/OTPInput.js +5 -3
- package/build/features/tax/screens/Verify/Verify.js +6 -22
- package/build/hooks/index.d.ts +5 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/useAppConfig.d.ts +4 -2
- package/build/hooks/useAppConfig.js +18 -16
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useDataVerified.d.ts +6 -0
- package/build/hooks/useDataVerified.js +19 -0
- package/build/hooks/useErrorListener.d.ts +2 -1
- package/build/hooks/useErrorListener.js +16 -1
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +40 -0
- package/build/hooks/useVerifyToken.js +1 -1
- package/build/theme/shadows.js +1 -1
- package/build/utils/array.d.ts +14 -2
- package/build/utils/array.js +196 -4
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +10 -0
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +6 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/gtm.d.ts +6 -0
- package/build/utils/gtm.js +29 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/object.d.ts +4 -0
- package/build/utils/object.js +17 -0
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +28 -7
- package/package.json +4 -2
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
- package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
- /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -11,18 +11,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
17
16
|
import { styled, alpha } from '@mui/material/styles';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
19
|
+
import { ID_NUMBER_LENGTH } from '../../../../constants';
|
|
18
20
|
import Text from '../../../../components/Text';
|
|
19
|
-
import Input from '../../../shared/Input';
|
|
20
|
-
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
22
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
|
+
import Input from '../../../shared/Input';
|
|
23
23
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
24
|
-
import {
|
|
25
|
-
import { ID_NUMBER_LENGTH } from '../../../../constants';
|
|
24
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
26
25
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
27
26
|
var theme = _a.theme;
|
|
28
27
|
return ({
|
|
@@ -55,6 +54,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
55
54
|
};
|
|
56
55
|
var nidValue = nidControl.field.value;
|
|
57
56
|
var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
58
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment:
|
|
57
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: _jsx(EndAdornment, { value: nidValue, error: error, onClear: clearIdNumber }), placeholder: t('national_id_placeholder'), warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
|
|
59
58
|
});
|
|
60
59
|
export default React.memo(IDNumber);
|
|
@@ -22,6 +22,7 @@ import { clearError, connectSelector, createNIDAuth, resetMobileScreen, resetSto
|
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
+
import { sendCustomEventToGTM } from '../../../../utils';
|
|
25
26
|
import Collapse from '../../../../components/Collapse';
|
|
26
27
|
import Box from '@mui/material/Box';
|
|
27
28
|
import Divider from '@mui/material/Divider';
|
|
@@ -83,6 +84,11 @@ var NID = function (_a) {
|
|
|
83
84
|
dispatch(clearError());
|
|
84
85
|
};
|
|
85
86
|
var onBack = function () {
|
|
87
|
+
sendCustomEventToGTM({
|
|
88
|
+
event: 'Send Event',
|
|
89
|
+
event_category: 'User Registration Flow',
|
|
90
|
+
event_action: 'Switch to mobile number Login Clicked'
|
|
91
|
+
});
|
|
86
92
|
dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
|
|
87
93
|
};
|
|
88
94
|
React.useEffect(function () {
|
|
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import Box from '@mui/material/Box/Box';
|
|
25
14
|
import { styled } from '@mui/material/styles';
|
|
@@ -36,7 +25,7 @@ import { AuthForType } from '../../../../@types';
|
|
|
36
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
37
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
38
27
|
import Form from '../../../../components/Form';
|
|
39
|
-
import { maskPhone, maskID } from '../../../../utils';
|
|
28
|
+
import { maskPhone, maskID, sendCustomEventToGTM } from '../../../../utils';
|
|
40
29
|
import { OTPValidation } from './validation';
|
|
41
30
|
import OTPInput from './OTPInput';
|
|
42
31
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -62,16 +51,25 @@ var OTP = function () {
|
|
|
62
51
|
var _a;
|
|
63
52
|
var dispatch = useAppDispatch();
|
|
64
53
|
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
65
|
-
var
|
|
54
|
+
var otp = data.otpData.otp;
|
|
66
55
|
var methods = useForm({
|
|
67
56
|
resolver: yupResolver(OTPValidation),
|
|
68
|
-
defaultValues:
|
|
57
|
+
defaultValues: {
|
|
58
|
+
otp: otp
|
|
59
|
+
},
|
|
69
60
|
mode: 'onChange'
|
|
70
61
|
});
|
|
71
|
-
useSetFromDefaultValues(methods,
|
|
62
|
+
useSetFromDefaultValues(methods, data.otpData);
|
|
72
63
|
var t = useTranslation().t;
|
|
73
64
|
var isAr = useLanguage().isAr;
|
|
74
65
|
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
66
|
+
React.useEffect(function () {
|
|
67
|
+
sendCustomEventToGTM({
|
|
68
|
+
event: 'Send Event',
|
|
69
|
+
event_category: 'User Registration Flow',
|
|
70
|
+
event_action: 'First OTP Page Viewed'
|
|
71
|
+
});
|
|
72
|
+
}, []);
|
|
75
73
|
React.useEffect(function () {
|
|
76
74
|
if (error)
|
|
77
75
|
dispatch(clearError());
|
|
@@ -20,6 +20,7 @@ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
|
20
20
|
import { AuthForType } from '../../../../@types';
|
|
21
21
|
import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
|
|
22
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
|
+
import { sendCustomEventToGTM } from '../../../../utils';
|
|
23
24
|
var BoxStyled = styled(Box)(function (_a) {
|
|
24
25
|
var theme = _a.theme;
|
|
25
26
|
return ({
|
|
@@ -38,14 +39,23 @@ var OTPInput = function (_a) {
|
|
|
38
39
|
var handleOnOTPChange = function (otp) {
|
|
39
40
|
otpControl.field.onChange(otp);
|
|
40
41
|
};
|
|
42
|
+
var sendEventAskAnotherOTP = function () {
|
|
43
|
+
sendCustomEventToGTM({
|
|
44
|
+
event: 'Send Event',
|
|
45
|
+
event_category: 'User Registration Flow',
|
|
46
|
+
event_action: 'Another OTP asked'
|
|
47
|
+
});
|
|
48
|
+
};
|
|
41
49
|
var handleOnResendOTP = function () {
|
|
42
50
|
if (otpControl.field.value)
|
|
43
51
|
setValue('otp', '', { shouldValidate: true });
|
|
52
|
+
sendEventAskAnotherOTP();
|
|
44
53
|
dispatch(resendOTPMobile());
|
|
45
54
|
};
|
|
46
55
|
var handleOnResendAbsherOTP = function () {
|
|
47
56
|
if (otpControl.field.value)
|
|
48
57
|
setValue('otp', '', { shouldValidate: true });
|
|
58
|
+
sendEventAskAnotherOTP();
|
|
49
59
|
dispatch(resendOTPNID());
|
|
50
60
|
};
|
|
51
61
|
var otpValue = otpControl.field.value;
|
|
@@ -2,15 +2,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation, Trans } from 'react-i18next';
|
|
4
4
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { connectSelector } from '
|
|
5
|
+
import { connectSelector } from '../../../app/connect/connectStore';
|
|
6
6
|
import { useAppSelector } from '../../../../hooks';
|
|
7
|
-
import { maskEmail } from '../../../../utils';
|
|
7
|
+
import { maskEmail, sendCustomDimension, sendCustomEventToGTM } from '../../../../utils';
|
|
8
8
|
var ThankYou = function (_a) {
|
|
9
9
|
var _b, _c, _d;
|
|
10
10
|
var t = useTranslation().t;
|
|
11
11
|
var data = useAppSelector(connectSelector).data;
|
|
12
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
13
|
var email = maskEmail(userEmail);
|
|
14
|
+
React.useEffect(function () {
|
|
15
|
+
var _a;
|
|
16
|
+
var id = (_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.id;
|
|
17
|
+
sendCustomEventToGTM({
|
|
18
|
+
event: 'Send Event',
|
|
19
|
+
event_category: 'User Registration Flow',
|
|
20
|
+
event_action: 'Registration Completed',
|
|
21
|
+
event_label: 'Product Type',
|
|
22
|
+
event_value: id
|
|
23
|
+
});
|
|
24
|
+
sendCustomDimension({
|
|
25
|
+
event: 'PageView',
|
|
26
|
+
lead_ID: id
|
|
27
|
+
});
|
|
28
|
+
}, []);
|
|
14
29
|
return (_jsx(SuccessScreen, { title: t("connect_completed_title"), description: _jsx(Trans, { i18nKey: 'connect_completed_description_dev', values: { email: email } }), showEmailProviders: true }));
|
|
15
30
|
};
|
|
16
31
|
export default React.memo(ThankYou);
|
|
@@ -4,6 +4,7 @@ export interface ConnectExpressLibProps extends LibConfig {
|
|
|
4
4
|
leadId?: string;
|
|
5
5
|
postURL: string;
|
|
6
6
|
showBoard?: boolean;
|
|
7
|
+
configToken?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare function ConnectExpressElement(props: ConnectExpressLibProps): JSX.Element;
|
|
9
10
|
export declare function renderConnectExpressLib(config: ConnectExpressLibProps, elementId: string): {
|
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
49
|
var t = {};
|
|
14
50
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -31,33 +67,57 @@ import { store } from '../../app/store';
|
|
|
31
67
|
import { connectExpressSelector, setIsLeadIdPassed, setPostUrl, setLeadId, retrieveLeadIdentityByIdAsync, setShowBoard } from '../app/connectExpress/connectExpressStore';
|
|
32
68
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
33
69
|
import Collapse from '../../components/Collapse';
|
|
34
|
-
import { isKW, findOrCreateElementAndInject } from '../../utils';
|
|
70
|
+
import { isKW, findOrCreateElementAndInject, sendPageView } from '../../utils';
|
|
35
71
|
import { CONNECT_EXPRESS_SCREENS_NAVIGATION } from '../../constants';
|
|
36
72
|
import { connectExpressFeatureScreens } from '../featuresScreens';
|
|
37
|
-
import CustomFooter from '../shared/Footer';
|
|
38
73
|
import Background from '../shared/Background';
|
|
39
74
|
var ConnectExpress = memo(function (_a) {
|
|
40
|
-
var leadId = _a.leadId, postURL = _a.postURL, showBoard = _a.showBoard, props = __rest(_a, ["leadId", "postURL", "showBoard"]);
|
|
75
|
+
var leadId = _a.leadId, postURL = _a.postURL, showBoard = _a.showBoard, configToken = _a.configToken, props = __rest(_a, ["leadId", "postURL", "showBoard", "configToken"]);
|
|
41
76
|
var theme = useAppTheme().theme;
|
|
42
77
|
var dispatch = useAppDispatch();
|
|
43
78
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
44
|
-
var _c = useAppSelector(connectExpressSelector), connectExpressError = _c.error, loading = _c.loading, customLoading = _c.customLoading;
|
|
45
|
-
|
|
79
|
+
var _c = useAppSelector(connectExpressSelector), connectExpressError = _c.error, loading = _c.loading, customLoading = _c.customLoading, connectData = _c.data;
|
|
80
|
+
var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
+
var _a, post, lead_id, board;
|
|
82
|
+
return __generator(this, function (_b) {
|
|
83
|
+
_a = data || {}, post = _a.post, lead_id = _a.lead_id, board = _a.board;
|
|
84
|
+
if (post === null || post === void 0 ? void 0 : post.url)
|
|
85
|
+
dispatch(setPostUrl(post.url));
|
|
86
|
+
if (lead_id) {
|
|
87
|
+
dispatch(setIsLeadIdPassed(true));
|
|
88
|
+
dispatch(setLeadId(lead_id));
|
|
89
|
+
}
|
|
90
|
+
if (typeof board === 'boolean')
|
|
91
|
+
dispatch(setShowBoard(board));
|
|
92
|
+
return [2];
|
|
93
|
+
});
|
|
94
|
+
}); };
|
|
95
|
+
useAppConfig(__assign(__assign(__assign({ navigation: CONNECT_EXPRESS_SCREENS_NAVIGATION, maturity: 'express' }, props), { configToken: configToken }), (configToken && { onVerifyConfigTokenSuccess: onVerifyConfigTokenSuccess })));
|
|
46
96
|
useErrorListener(connectExpressError || error);
|
|
47
97
|
useStepStartedListener();
|
|
48
|
-
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
98
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant;
|
|
49
99
|
React.useEffect(function () {
|
|
50
100
|
if (!postURL)
|
|
51
101
|
throw new Error('postURL is required and you ave to pass it in the lib configuration!');
|
|
52
102
|
dispatch(setPostUrl(postURL));
|
|
53
103
|
if (typeof showBoard === 'boolean')
|
|
54
104
|
dispatch(setShowBoard(showBoard));
|
|
105
|
+
sendPageView({
|
|
106
|
+
title: 'Connect Express'
|
|
107
|
+
});
|
|
55
108
|
}, []);
|
|
56
109
|
React.useEffect(function () {
|
|
57
|
-
if (data.isValidOperator && props.open && !settingLoading
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
110
|
+
if (data.isValidOperator && props.open && !settingLoading) {
|
|
111
|
+
if (configToken) {
|
|
112
|
+
if (connectData.leadId)
|
|
113
|
+
dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (leadId) {
|
|
117
|
+
dispatch(setIsLeadIdPassed(true));
|
|
118
|
+
dispatch(setLeadId(leadId));
|
|
119
|
+
dispatch(retrieveLeadIdentityByIdAsync(leadId));
|
|
120
|
+
}
|
|
61
121
|
}
|
|
62
122
|
}, [data.isValidOperator, settingLoading]);
|
|
63
123
|
React.useEffect(function () {
|
|
@@ -66,11 +126,11 @@ var ConnectExpress = memo(function (_a) {
|
|
|
66
126
|
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
67
127
|
}
|
|
68
128
|
}, [settingLoading]);
|
|
69
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open,
|
|
129
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: true }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true }, { children: connectExpressFeatureScreens.map(function (_a, index) {
|
|
70
130
|
var Element = _a.element, name = _a.name;
|
|
71
131
|
var isActive = activeScreen.name === name;
|
|
72
132
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
73
|
-
}) }) })) })) })));
|
|
133
|
+
}) })) })) })) })));
|
|
74
134
|
});
|
|
75
135
|
export function ConnectExpressElement(props) {
|
|
76
136
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(ConnectExpress, __assign({}, props)) })));
|
|
@@ -64,7 +64,7 @@ var Brand = function (_a) {
|
|
|
64
64
|
var onSelectItem = function (brand) {
|
|
65
65
|
selectedBrandControl.field.onChange(brand);
|
|
66
66
|
};
|
|
67
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'),
|
|
67
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
68
68
|
return (_jsxs(_Fragment, { children: [_jsx(BrandContainer, { children: _jsx(BrandNameText, __assign({ isSelected: getBrandId(item) === getBrandId(selectedBrand) }, { children: isOtherBrand(item) ? t(getBrandName(item)) : getBrandName(item) })) }), getBrandId(item) === getBrandId(selectedBrand) && _jsx(CheckIcon, {})] }));
|
|
69
69
|
} }) }))] }));
|
|
70
70
|
};
|
|
@@ -11,17 +11,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled, alpha } from '@mui/material/styles';
|
|
18
18
|
import Text from '../../../../components/Text';
|
|
19
|
-
import Input from '../../../shared/Input';
|
|
20
|
-
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
22
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
19
|
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
24
20
|
import { CIVIL_ID_NUMBER_LENGTH } from '../../../../constants';
|
|
21
|
+
import Input from '../../../shared/Input';
|
|
22
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
25
24
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
26
25
|
var theme = _a.theme;
|
|
27
26
|
return ({
|
|
@@ -38,7 +37,7 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
38
37
|
var _b;
|
|
39
38
|
var sx = _a.sx;
|
|
40
39
|
var t = useTranslation().t;
|
|
41
|
-
var
|
|
40
|
+
var control = useFormContext().control;
|
|
42
41
|
var civilIdControl = useController({ control: control, name: 'civilId' });
|
|
43
42
|
var handleIdChange = function (_a) {
|
|
44
43
|
var target = _a.target;
|
|
@@ -50,6 +49,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
50
49
|
};
|
|
51
50
|
var idValue = civilIdControl.field.value;
|
|
52
51
|
var error = (_b = civilIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
53
|
-
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment:
|
|
52
|
+
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment: _jsx(EndAdornment, { value: idValue, error: error, onClear: clearIdNumber }), placeholder: t('civil_id_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
|
|
54
53
|
});
|
|
55
54
|
export default React.memo(IDNumber);
|
|
@@ -11,17 +11,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled, alpha } from '@mui/material/styles';
|
|
18
18
|
import Text from '../../../../components/Text';
|
|
19
|
-
import Input from '../../../shared/Input';
|
|
20
|
-
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
22
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
19
|
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
24
20
|
import { CIVIL_ID_NUMBER_LENGTH } from '../../../../constants';
|
|
21
|
+
import Input from '../../../shared/Input';
|
|
22
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
25
24
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
26
25
|
var theme = _a.theme;
|
|
27
26
|
return ({
|
|
@@ -38,7 +37,7 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
38
37
|
var _b;
|
|
39
38
|
var sx = _a.sx;
|
|
40
39
|
var t = useTranslation().t;
|
|
41
|
-
var
|
|
40
|
+
var control = useFormContext().control;
|
|
42
41
|
var civilIdControl = useController({ control: control, name: 'civilId' });
|
|
43
42
|
var handleIdChange = function (_a) {
|
|
44
43
|
var target = _a.target;
|
|
@@ -50,6 +49,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
50
49
|
};
|
|
51
50
|
var idValue = civilIdControl.field.value;
|
|
52
51
|
var error = (_b = civilIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
53
|
-
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment:
|
|
52
|
+
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment: _jsx(EndAdornment, { value: idValue, error: error, onClear: clearIdNumber }), placeholder: t('civil_id_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
|
|
54
53
|
});
|
|
55
54
|
export default React.memo(IDNumber);
|
|
@@ -3,6 +3,7 @@ interface BrandNameProps {
|
|
|
3
3
|
show: boolean;
|
|
4
4
|
fetchingBrandName: (flag: boolean) => void;
|
|
5
5
|
brandNameChecking: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const _default: React.MemoExoticComponent<({ show, brandNameChecking, fetchingBrandName }: BrandNameProps) => JSX.Element>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ show, brandNameChecking, fetchingBrandName, readOnly }: BrandNameProps) => JSX.Element>;
|
|
8
9
|
export default _default;
|
|
@@ -54,16 +54,14 @@ import axios from 'axios';
|
|
|
54
54
|
import Box from '@mui/material/Box';
|
|
55
55
|
import { styled, alpha } from '@mui/material/styles';
|
|
56
56
|
import InfoIcon from '@mui/icons-material/Info';
|
|
57
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
58
57
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
59
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
60
58
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
61
59
|
import Text from '../../../../components/Text';
|
|
62
60
|
import Tooltip from '../../../../components/Tooltip';
|
|
63
61
|
import Collapse from '../../../../components/Collapse';
|
|
64
62
|
import Input from '../../../shared/Input';
|
|
65
|
-
import
|
|
66
|
-
import
|
|
63
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
64
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
67
65
|
import { checkBrandNameAvailabilityAsync, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
|
|
68
66
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
69
67
|
var theme = _a.theme;
|
|
@@ -98,7 +96,7 @@ var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
|
98
96
|
var cancelToken = null;
|
|
99
97
|
var BrandName = function (_a) {
|
|
100
98
|
var _b;
|
|
101
|
-
var show = _a.show, brandNameChecking = _a.brandNameChecking, fetchingBrandName = _a.fetchingBrandName;
|
|
99
|
+
var show = _a.show, brandNameChecking = _a.brandNameChecking, fetchingBrandName = _a.fetchingBrandName, readOnly = _a.readOnly;
|
|
102
100
|
var dispatch = useAppDispatch();
|
|
103
101
|
var _c = React.useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
104
102
|
var t = useTranslation().t;
|
|
@@ -127,7 +125,7 @@ var BrandName = function (_a) {
|
|
|
127
125
|
var _a, _b, _c, _d;
|
|
128
126
|
var isValid = brandNameValue && !error && brandNameValue.length > 2;
|
|
129
127
|
var brand = (_d = (_c = (_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.leadData) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.en;
|
|
130
|
-
if (isValid &&
|
|
128
|
+
if (isValid && brandNameValue != brand) {
|
|
131
129
|
fetchingBrandName(true);
|
|
132
130
|
checkBrand(brandNameValue);
|
|
133
131
|
}
|
|
@@ -135,6 +133,6 @@ var BrandName = function (_a) {
|
|
|
135
133
|
var clearBrandName = function () {
|
|
136
134
|
brandControl.field.onChange('');
|
|
137
135
|
};
|
|
138
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, value: brandNameValue || '', placeholder: t('signup_brand_name_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment:
|
|
136
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, readOnly: readOnly, value: brandNameValue || '', placeholder: t('signup_brand_name_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: brandNameValue, loading: brandNameChecking, error: error, onClear: clearBrandName }) })] })) })));
|
|
139
137
|
};
|
|
140
138
|
export default React.memo(BrandName);
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage } from '../../../../hooks';
|
|
17
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
18
18
|
import { isSA } from '../../../../utils';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
@@ -49,6 +49,9 @@ var CollectBusinessInfo = function (_a) {
|
|
|
49
49
|
mode: 'onChange'
|
|
50
50
|
});
|
|
51
51
|
useSetFromDefaultValues(methods, data.businessData);
|
|
52
|
+
var originalReadOnly = useFormReadOnly(methods);
|
|
53
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
54
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
52
55
|
React.useEffect(function () {
|
|
53
56
|
if (error)
|
|
54
57
|
dispatch(clearError());
|
|
@@ -64,17 +67,17 @@ var CollectBusinessInfo = function (_a) {
|
|
|
64
67
|
licenseNumber: data.licenseNumber,
|
|
65
68
|
termAndConditionChecked: data.termAndConditionChecked
|
|
66
69
|
};
|
|
67
|
-
dispatch(updateLeadBusinessDataAsync(dataValues));
|
|
70
|
+
dispatch(updateLeadBusinessDataAsync(getFelids(dataValues)));
|
|
68
71
|
};
|
|
69
72
|
var onBack = function () {
|
|
70
73
|
dispatch(handlePrevScreenStep());
|
|
71
74
|
};
|
|
72
75
|
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
73
76
|
var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
|
|
74
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { onListOpen: function () {
|
|
77
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'], show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { readOnly: readOnly['selectedLicense'], onListOpen: function () {
|
|
75
78
|
setListActive(true);
|
|
76
79
|
}, onListClose: function () {
|
|
77
80
|
setListActive(false);
|
|
78
|
-
} }), _jsx(TAC, { show: !isLeadIdPassed }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
81
|
+
} }), _jsx(TAC, { show: !isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
79
82
|
};
|
|
80
83
|
export default React.memo(CollectBusinessInfo);
|
|
@@ -3,6 +3,7 @@ interface LicenseListProps {
|
|
|
3
3
|
onSelectLicense?: (number: string) => void;
|
|
4
4
|
onListOpen?: () => void;
|
|
5
5
|
onListClose?: () => void;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const _default: React.MemoExoticComponent<({ ...rest }: LicenseListProps) => JSX.Element>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, ...rest }: LicenseListProps) => JSX.Element>;
|
|
8
9
|
export default _default;
|
|
@@ -28,7 +28,7 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import { styled } from '@mui/material/styles';
|
|
29
29
|
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
30
30
|
import { BusinessType } from '../../../../@types';
|
|
31
|
-
import { isSA } from '../../../../utils';
|
|
31
|
+
import { isOtherLicense, isSA } from '../../../../utils';
|
|
32
32
|
import { settingsSelector } from '../../../../app/settings';
|
|
33
33
|
import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
|
|
34
34
|
import SimpleList from '../../../../components/SimpleList';
|
|
@@ -36,18 +36,15 @@ import Text from '../../../../components/Text';
|
|
|
36
36
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
37
|
import Collapse from '../../../../components/Collapse';
|
|
38
38
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
39
|
-
import
|
|
39
|
+
import InputSelect from '../../../shared/InputSelect';
|
|
40
40
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
41
41
|
import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
|
|
42
42
|
import LicenseNumber from './LicenseNumber';
|
|
43
43
|
import LicenseType from './LicenseType';
|
|
44
|
-
var InputStyled = styled(
|
|
44
|
+
var InputStyled = styled(InputSelect)(function (_a) {
|
|
45
45
|
var theme = _a.theme;
|
|
46
46
|
return ({
|
|
47
|
-
marginBottom: theme.spacing(2.5)
|
|
48
|
-
'& .MuiInputBase-input': {
|
|
49
|
-
cursor: 'pointer'
|
|
50
|
-
}
|
|
47
|
+
marginBottom: theme.spacing(2.5)
|
|
51
48
|
});
|
|
52
49
|
});
|
|
53
50
|
var LicenseContainer = styled(Box)(function () { return ({
|
|
@@ -58,7 +55,7 @@ var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return
|
|
|
58
55
|
return (__assign(__assign({ display: 'flex', color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
59
56
|
});
|
|
60
57
|
var LicenseList = function (_a) {
|
|
61
|
-
var rest = __rest(_a, []);
|
|
58
|
+
var readOnly = _a.readOnly, rest = __rest(_a, ["readOnly"]);
|
|
62
59
|
var _b = useAppSelector(connectExpressSelector), data = _b.data, error = _b.error;
|
|
63
60
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
64
61
|
var businessData = data.businessData, responseData = data.responseData;
|
|
@@ -73,6 +70,8 @@ var LicenseList = function (_a) {
|
|
|
73
70
|
var country_code = settingsData.businessCountry.iso2;
|
|
74
71
|
var onOpenLicenseList = function (event) {
|
|
75
72
|
var _a;
|
|
73
|
+
if (readOnly)
|
|
74
|
+
return;
|
|
76
75
|
setAnchorEl(event.currentTarget);
|
|
77
76
|
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
78
77
|
};
|
|
@@ -113,10 +112,6 @@ var LicenseList = function (_a) {
|
|
|
113
112
|
return t('future_work');
|
|
114
113
|
return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
|
|
115
114
|
};
|
|
116
|
-
var isOtherLicense = function (item) {
|
|
117
|
-
var _a, _b;
|
|
118
|
-
return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) === 'other_fl' || ((_b = item === null || item === void 0 ? void 0 : item.license) === null || _b === void 0 ? void 0 : _b.number) === 'other_cr';
|
|
119
|
-
};
|
|
120
115
|
var onSelectItem = function (license) {
|
|
121
116
|
if (error)
|
|
122
117
|
dispatch(clearError());
|
|
@@ -137,8 +132,8 @@ var LicenseList = function (_a) {
|
|
|
137
132
|
var licenseReadonly = !isOtherLicense(selected);
|
|
138
133
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
|
|
139
134
|
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
|
|
140
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly:
|
|
135
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
141
136
|
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
|
|
142
|
-
} }) }))] })), _jsx(LicenseType, { show: show && !isSACountry }), _jsx(LicenseNumber, { show: !isSACountry ? isCR : show, readOnly: licenseReadonly })] }));
|
|
137
|
+
} }) }))] })), _jsx(LicenseType, { show: show && !isSACountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: !isSACountry ? isCR : show, readOnly: licenseReadonly })] }));
|
|
143
138
|
};
|
|
144
139
|
export default React.memo(LicenseList);
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import {
|
|
16
|
+
import { CR_MIN_LICENSE_LENGTH, CR_NUMBER_MAX_LENGTH, FL_MIN_LICENSE_LENGTH, FL_NUMBER_MAX_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
|
|
17
17
|
import { removeAllOtherThanCharsAndNumber, isSA } from '../../../../utils';
|
|
18
18
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
19
19
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
@@ -43,10 +43,10 @@ var LicenseNumber = function (_a) {
|
|
|
43
43
|
};
|
|
44
44
|
var licenseNumberValue = licenseNumberControl.field.value;
|
|
45
45
|
var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
46
|
-
var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ?
|
|
47
|
-
var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH :
|
|
46
|
+
var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_MAX_LENGTH : FL_NUMBER_MAX_LENGTH;
|
|
47
|
+
var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH : isCR ? CR_MIN_LICENSE_LENGTH : FL_MIN_LICENSE_LENGTH;
|
|
48
48
|
var label = isCR ? 'cr_number' : 'fl_number';
|
|
49
49
|
var showCheckIcon = !isSACountry ? (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) >= minLength : (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length;
|
|
50
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: !isSACountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
|
|
50
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: !isSACountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
|
|
51
51
|
};
|
|
52
52
|
export default React.memo(LicenseNumber);
|