@tap-payments/auth-jsconnect 2.3.3-test → 2.3.3
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 +309 -7
- package/build/@types/app.js +17 -0
- package/build/@types/form.d.ts +29 -26
- package/build/@types/redux.d.ts +4 -0
- package/build/@types/theme.d.ts +1 -1
- package/build/@types/user.d.ts +39 -3
- package/build/api/account.d.ts +2 -2
- package/build/api/auth.d.ts +11 -11
- package/build/api/availabilityServices.d.ts +3 -3
- package/build/api/axios.js +1 -1
- package/build/api/board.d.ts +3 -3
- package/build/api/brand.d.ts +7 -0
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +1 -1
- package/build/api/data.d.ts +18 -10
- package/build/api/data.js +34 -2
- package/build/api/document.d.ts +2 -2
- package/build/api/entity.d.ts +26 -11
- package/build/api/entity.js +26 -1
- package/build/api/file.d.ts +2 -2
- package/build/api/file.js +1 -0
- package/build/api/index.d.ts +30 -6
- package/build/api/index.js +3 -1
- package/build/api/individual.d.ts +29 -11
- 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 +18 -11
- package/build/api/lead.js +9 -1
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +1 -1
- package/build/api/user.d.ts +2 -2
- package/build/app/settings.d.ts +21 -9
- package/build/app/settings.js +74 -35
- package/build/app/store.d.ts +4 -4
- 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 +88 -12
- package/build/features/app/bank/bankStore.js +157 -103
- package/build/features/app/brand/brandStore.d.ts +158 -21
- package/build/features/app/brand/brandStore.js +408 -214
- package/build/features/app/business/businessStore.d.ts +176 -29
- package/build/features/app/business/businessStore.js +365 -296
- package/build/features/app/connect/connectStore.d.ts +163 -14
- package/build/features/app/connect/connectStore.js +293 -96
- package/build/features/app/connectExpress/connectExpressStore.d.ts +223 -20
- package/build/features/app/connectExpress/connectExpressStore.js +233 -101
- package/build/features/app/entity/entityStore.d.ts +93 -23
- package/build/features/app/entity/entityStore.js +280 -249
- package/build/features/app/individual/individualStore.d.ts +192 -27
- package/build/features/app/individual/individualStore.js +533 -399
- package/build/features/app/password/passwordStore.d.ts +106 -12
- package/build/features/app/password/passwordStore.js +100 -44
- package/build/features/app/signIn/signInStore.d.ts +61 -7
- package/build/features/app/signIn/signInStore.js +1 -1
- package/build/features/app/tax/taxStore.d.ts +76 -9
- package/build/features/app/tax/taxStore.js +144 -102
- 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 +6 -2
- 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 +4 -6
- 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 +13 -30
- 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 +14 -41
- 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 +15 -8
- 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 +5 -8
- 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 +17 -70
- package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +3 -3
- 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} +6 -8
- 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 +4 -2
- 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 +3 -3
- 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 +47 -40
- 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 +7 -7
- 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 +18 -28
- 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 +5 -8
- 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 +6 -8
- 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 +5 -4
- 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 +7 -15
- 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/entity/Entity.js +10 -6
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +18 -70
- 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 +6 -2
- 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 +14 -30
- package/build/features/entity/screens/EntityName/EntityTypeList.js +32 -43
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +6 -4
- package/build/features/entity/screens/EntityName/ExpiryDate.js +5 -5
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +6 -4
- 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 +3 -3
- 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/CollectPhoneEmail.js +1 -1
- package/build/features/individual/screens/IndividualList/Email.js +1 -1
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +6 -6
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualList/UserList.js +15 -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 +6 -4
- 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 +3 -3
- 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 +10 -10
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +10 -10
- package/build/features/shared/Address/InputSelect.js +2 -2
- 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.d.ts +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.js +23 -21
- package/build/features/shared/Button/IndividualActionButtons.d.ts +21 -0
- package/build/features/shared/Button/IndividualActionButtons.js +156 -0
- package/build/features/shared/Button/index.d.ts +1 -1
- package/build/features/shared/Button/index.js +1 -1
- 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 +6 -7
- 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 +18 -7
- 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 +2 -2
- 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 +10 -29
- package/build/features/shared/UploadMultipleFile/UploadFile.js +76 -60
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +8 -4
- 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 +17 -5
- 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/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/shared/Button/ListButton.d.ts +0 -18
- package/build/features/shared/Button/ListButton.js +0 -125
- /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
15
15
|
import { ScreenContainer } from '../../shared/Containers';
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { InputLabelStyled } from '../../shared/Input/Input';
|
|
@@ -38,13 +38,13 @@ var LabelContainerStyled = styled(Box)(function (_a) {
|
|
|
38
38
|
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
|
|
41
|
+
var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
42
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
43
|
+
return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
|
|
44
44
|
});
|
|
45
|
-
var UploadBoxStyled = styled(Box)(function (_a) {
|
|
46
|
-
var theme = _a.theme;
|
|
47
|
-
return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
|
|
45
|
+
var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
46
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
47
|
+
return (__assign(__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), (readOnly && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
|
|
48
48
|
});
|
|
49
49
|
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
50
50
|
var theme = _a.theme;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Control, FieldValues } from 'react-hook-form';
|
|
3
|
+
import { FileDetails } from '../../../@types';
|
|
4
|
+
import { FileRemoveType } from '../../../constants';
|
|
5
|
+
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
component?: React.ElementType<any> | undefined;
|
|
8
|
+
ref?: React.Ref<unknown> | undefined;
|
|
9
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
10
|
+
} & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
11
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
+
}, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
13
|
+
interface UploadWrapperProps {
|
|
14
|
+
id: string;
|
|
15
|
+
control: Control<FieldValues, any>;
|
|
16
|
+
label: string;
|
|
17
|
+
purpose: string;
|
|
18
|
+
fileRemoveType: FileRemoveType;
|
|
19
|
+
fileTitle?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
title: string;
|
|
22
|
+
subTitle: string;
|
|
23
|
+
dragDescription: string;
|
|
24
|
+
uploadingTitle: string;
|
|
25
|
+
successTitle: string;
|
|
26
|
+
isSubmitting?: boolean;
|
|
27
|
+
onFileUploaded: (fileId: string) => void;
|
|
28
|
+
fileUploadingStatus?: (uploading: boolean) => void;
|
|
29
|
+
onDeleteFile: () => void;
|
|
30
|
+
defaultFile?: FileDetails;
|
|
31
|
+
validFileFormats?: Array<string>;
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
isVerified?: boolean;
|
|
34
|
+
}
|
|
35
|
+
declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly, isVerified }: UploadWrapperProps) => JSX.Element>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,115 @@
|
|
|
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 React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController } from 'react-hook-form';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import { DragAndDrop } from '../../../components/FileInput';
|
|
19
|
+
import Collapse from '../../../components/Collapse';
|
|
20
|
+
import { getFileType } from '../../../utils';
|
|
21
|
+
import { DeleteFileStatus, FileStatus } from '../../../constants';
|
|
22
|
+
import { InputLabelStyled } from '../../shared/Input/Input';
|
|
23
|
+
import { ScreenContainer } from '../../shared/Containers';
|
|
24
|
+
import Mandatory from '../../shared/Mandatory';
|
|
25
|
+
import FileUpload from './FileUpload';
|
|
26
|
+
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return ({
|
|
29
|
+
marginBlockStart: theme.spacing(0)
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5),
|
|
38
|
+
alignItems: 'center'
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export var InputContainerStyled = styled(Box)(function () { return ({
|
|
42
|
+
display: 'flex',
|
|
43
|
+
width: '100%',
|
|
44
|
+
justifyContent: 'center'
|
|
45
|
+
}); });
|
|
46
|
+
var UploadWrapper = function (_a) {
|
|
47
|
+
var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileRemoveType = _a.fileRemoveType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFile = _a.defaultFile, validFileFormats = _a.validFileFormats, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
48
|
+
var t = useTranslation().t;
|
|
49
|
+
var _b = React.useState(''), error = _b[0], setError = _b[1];
|
|
50
|
+
var fileControl = useController({ name: "".concat(id, "File"), control: control });
|
|
51
|
+
var fileInfoControl = useController({ name: "".concat(id, "FileInfo"), control: control });
|
|
52
|
+
var fileData = fileControl.field.value;
|
|
53
|
+
var fileInfo = fileInfoControl.field.value;
|
|
54
|
+
React.useEffect(function () {
|
|
55
|
+
if (!fileData && !fileInfo && defaultFile) {
|
|
56
|
+
var title_1 = defaultFile.title, size = defaultFile.size, type = defaultFile.type, id_1 = defaultFile.id, docId = defaultFile.docId;
|
|
57
|
+
var fileData_1 = { name: title_1, size: size, type: getFileType(type) };
|
|
58
|
+
var fileInfoData = {
|
|
59
|
+
fileId: id_1,
|
|
60
|
+
docId: docId,
|
|
61
|
+
status: FileStatus.SUCCESS,
|
|
62
|
+
progress: 100,
|
|
63
|
+
error: '',
|
|
64
|
+
name: title_1 || ''
|
|
65
|
+
};
|
|
66
|
+
fileControl.field.onChange(fileData_1);
|
|
67
|
+
fileInfoControl.field.onChange(fileInfoData);
|
|
68
|
+
}
|
|
69
|
+
}, [defaultFile]);
|
|
70
|
+
var handleFileChange = function (files) {
|
|
71
|
+
if (!isSubmitting) {
|
|
72
|
+
if ((files === null || files === void 0 ? void 0 : files.length) > 0) {
|
|
73
|
+
setError('');
|
|
74
|
+
var fileData_2 = files[0];
|
|
75
|
+
fileControl.field.onChange(fileData_2);
|
|
76
|
+
fileInfoControl.field.onChange({
|
|
77
|
+
fileId: '',
|
|
78
|
+
docId: '',
|
|
79
|
+
status: FileStatus.INIT,
|
|
80
|
+
progress: 0,
|
|
81
|
+
error: '',
|
|
82
|
+
name: fileData_2.name
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var handleDelete = function () {
|
|
88
|
+
if (!isSubmitting) {
|
|
89
|
+
setError('');
|
|
90
|
+
if (required)
|
|
91
|
+
setError(t('should_upload_file'));
|
|
92
|
+
fileControl.field.onChange(null);
|
|
93
|
+
fileInfoControl.field.onChange(null);
|
|
94
|
+
onDeleteFile();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var handleSuccess = function (fileInfo) {
|
|
98
|
+
if (fileInfo) {
|
|
99
|
+
fileInfoControl.field.onChange(__assign({}, fileInfo));
|
|
100
|
+
onFileUploaded(fileInfo.fileId);
|
|
101
|
+
fileUploadingStatus === null || fileUploadingStatus === void 0 ? void 0 : fileUploadingStatus(false);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var handleUpdate = function (fileInfo, loadingStatus) {
|
|
105
|
+
if (fileInfo) {
|
|
106
|
+
fileInfoControl.field.onChange(__assign({}, fileInfo));
|
|
107
|
+
fileUploadingStatus === null || fileUploadingStatus === void 0 ? void 0 : fileUploadingStatus(loadingStatus);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var fileExists = !!fileInfo;
|
|
111
|
+
var showUploadedInputField = (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.DOWNLOADING || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.deleteStatus) === DeleteFileStatus.DELETING;
|
|
112
|
+
var showDragAndDrop = !showUploadedInputField && !readOnly;
|
|
113
|
+
return (_jsxs(FeatureStyled, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }) }), _jsx(Collapse, __assign({ in: showDragAndDrop }, { children: _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.progress, uploading: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.UPLOADING, uploadSuccess: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS, onSuccess: handleFileChange, error: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.error) || error, multiple: false }) })) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: _jsx(FileUpload, { validFileFormats: validFileFormats, readOnly: readOnly, show: showUploadedInputField, fileRemoveType: fileRemoveType, purpose: purpose, title: fileTitle || '', isSubmitting: isSubmitting, uploadedFile: fileInfo, file: fileData, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate, initialFileId: defaultFile === null || defaultFile === void 0 ? void 0 : defaultFile.id, isVerified: isVerified }) }))] }));
|
|
114
|
+
};
|
|
115
|
+
export default React.memo(UploadWrapper);
|
|
@@ -1,48 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { FileInfo, FileType } from '../../../constants';
|
|
3
4
|
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<Theme> & {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
component?: React.ElementType<any> | undefined;
|
|
6
7
|
ref?: React.Ref<unknown> | undefined;
|
|
7
8
|
sx?: SxProps<Theme> | undefined;
|
|
8
|
-
} &
|
|
9
|
+
} & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
9
10
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
10
|
-
},
|
|
11
|
-
export
|
|
12
|
-
INIT = "init",
|
|
13
|
-
UPLOADING = "uploading",
|
|
14
|
-
DOWNLOADING = "downloading",
|
|
15
|
-
SUCCESS = "success",
|
|
16
|
-
ERROR = "error",
|
|
17
|
-
ALREADY_UPLOADED = "already_uploaded"
|
|
18
|
-
}
|
|
19
|
-
export declare enum DeleteFileStatus {
|
|
20
|
-
NONE = "none",
|
|
21
|
-
DELETING = "deleting",
|
|
22
|
-
ERROR = "error",
|
|
23
|
-
SUCCESS = "success"
|
|
24
|
-
}
|
|
25
|
-
export declare type FileInfo = {
|
|
26
|
-
fileId: string;
|
|
27
|
-
docId: string;
|
|
28
|
-
name: string;
|
|
29
|
-
status: FileStatus;
|
|
30
|
-
progress: number;
|
|
31
|
-
error: string;
|
|
32
|
-
deleteStatus: DeleteFileStatus;
|
|
33
|
-
};
|
|
34
|
-
export declare type UploadFileProps = {
|
|
11
|
+
}, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
12
|
+
export type UploadFileProps = {
|
|
35
13
|
index: number;
|
|
36
14
|
purpose: string;
|
|
37
15
|
file: File;
|
|
16
|
+
fileType: FileType;
|
|
38
17
|
required?: boolean;
|
|
39
18
|
title?: string;
|
|
40
19
|
uploadedFiles: Array<FileInfo>;
|
|
41
20
|
onSuccess: (index: number, file: FileInfo) => void;
|
|
42
|
-
onFailure: (index: number, file: FileInfo) => void;
|
|
43
21
|
onDelete: (index: number) => void;
|
|
44
|
-
|
|
22
|
+
onUpdate: (index: number, file: FileInfo, loadingStatus: boolean) => void;
|
|
45
23
|
sx?: SxProps<Theme> | undefined;
|
|
24
|
+
isSubmitting?: boolean;
|
|
25
|
+
readOnly?: boolean;
|
|
26
|
+
isVerified?: boolean;
|
|
46
27
|
};
|
|
47
|
-
declare const UploadFile: ({ index, title, file, uploadedFiles, onSuccess,
|
|
28
|
+
declare const UploadFile: ({ index, title, file, fileType, uploadedFiles, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, readOnly, isVerified }: UploadFileProps) => JSX.Element;
|
|
48
29
|
export default UploadFile;
|
|
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
24
24
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
25
|
function step(op) {
|
|
26
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
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
29
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
30
|
switch (op[0]) {
|
|
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import { jsx as _jsx,
|
|
48
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
49
|
import React from 'react';
|
|
50
50
|
import { useTranslation } from 'react-i18next';
|
|
51
51
|
import { alpha, styled, useTheme } from '@mui/material/styles';
|
|
@@ -57,17 +57,16 @@ import { CircularProgress } from '../../../components/ProgressBar';
|
|
|
57
57
|
import Text from '../../../components/Text';
|
|
58
58
|
import Icon from '../../../components/Icon';
|
|
59
59
|
import { maskFileName } from '../../../utils';
|
|
60
|
-
import { DocumentPurpose } from '../../../@types';
|
|
61
60
|
import API from '../../../api';
|
|
62
|
-
import { ICONS_NAMES, MAX_FILE_SIZE_FOUR_MB, VALID_FILE_FORMATS } from '../../../constants';
|
|
61
|
+
import { DeleteFileStatus, FileStatus, ICONS_NAMES, MAX_FILE_SIZE_FOUR_MB, VALID_FILE_FORMATS } from '../../../constants';
|
|
63
62
|
import CheckIcon from '../../shared/CheckIcon';
|
|
64
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
65
|
-
var theme = _a.theme;
|
|
66
|
-
return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
|
|
63
|
+
var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
64
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
65
|
+
return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
|
|
67
66
|
});
|
|
68
|
-
var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return
|
|
69
|
-
var theme = _a.theme, uploading = _a.uploading;
|
|
70
|
-
return (__assign(__assign({}, theme.typography.caption), { background: uploading ? alpha(theme.palette.primary.main, 0.5) : theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
|
|
67
|
+
var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['uploading', 'readOnly'].includes(prop.toString()); } })(function (_a) {
|
|
68
|
+
var theme = _a.theme, uploading = _a.uploading, readOnly = _a.readOnly;
|
|
69
|
+
return (__assign(__assign(__assign({}, theme.typography.caption), { background: uploading ? alpha(theme.palette.primary.main, 0.5) : theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), ((readOnly || uploading) && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
|
|
71
70
|
});
|
|
72
71
|
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
73
72
|
var theme = _a.theme;
|
|
@@ -108,29 +107,16 @@ var WarningContainer = styled(Box)(function (_a) {
|
|
|
108
107
|
var theme = _a.theme;
|
|
109
108
|
return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
|
|
110
109
|
});
|
|
111
|
-
export var FileStatus;
|
|
112
|
-
(function (FileStatus) {
|
|
113
|
-
FileStatus["INIT"] = "init";
|
|
114
|
-
FileStatus["UPLOADING"] = "uploading";
|
|
115
|
-
FileStatus["DOWNLOADING"] = "downloading";
|
|
116
|
-
FileStatus["SUCCESS"] = "success";
|
|
117
|
-
FileStatus["ERROR"] = "error";
|
|
118
|
-
FileStatus["ALREADY_UPLOADED"] = "already_uploaded";
|
|
119
|
-
})(FileStatus || (FileStatus = {}));
|
|
120
|
-
export var DeleteFileStatus;
|
|
121
|
-
(function (DeleteFileStatus) {
|
|
122
|
-
DeleteFileStatus["NONE"] = "none";
|
|
123
|
-
DeleteFileStatus["DELETING"] = "deleting";
|
|
124
|
-
DeleteFileStatus["ERROR"] = "error";
|
|
125
|
-
DeleteFileStatus["SUCCESS"] = "success";
|
|
126
|
-
})(DeleteFileStatus || (DeleteFileStatus = {}));
|
|
127
110
|
var UploadFile = function (_a) {
|
|
128
|
-
var index = _a.index, title = _a.title, file = _a.file,
|
|
111
|
+
var index = _a.index, title = _a.title, file = _a.file, fileType = _a.fileType, uploadedFiles = _a.uploadedFiles, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
129
112
|
var theme = useTheme();
|
|
130
113
|
var t = useTranslation().t;
|
|
131
114
|
var _b = file || {}, name = _b.name, size = _b.size, type = _b.type;
|
|
132
115
|
var uploadedFile = (uploadedFiles === null || uploadedFiles === void 0 ? void 0 : uploadedFiles[index]) || {};
|
|
133
116
|
var status = uploadedFile.status, progress = uploadedFile.progress, error = uploadedFile.error, deleteStatus = uploadedFile.deleteStatus;
|
|
117
|
+
var isAnyFileDoingDeleteUploadDownload = React.useMemo(function () {
|
|
118
|
+
return (uploadedFiles || []).find(function (f) { return f.deleteStatus === DeleteFileStatus.DELETING || f.status === FileStatus.UPLOADING || f.status === FileStatus.DOWNLOADING; });
|
|
119
|
+
}, [uploadedFiles]);
|
|
134
120
|
var uploadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
121
|
var uploadPayload, onUploadProgress, data, fileId;
|
|
136
122
|
return __generator(this, function (_a) {
|
|
@@ -144,114 +130,144 @@ var UploadFile = function (_a) {
|
|
|
144
130
|
};
|
|
145
131
|
onUploadProgress = function (progressEvent) {
|
|
146
132
|
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
147
|
-
uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.UPLOADING });
|
|
148
|
-
|
|
133
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.UPLOADING, error: '' });
|
|
134
|
+
onUpdate(index, uploadedFile, true);
|
|
149
135
|
};
|
|
150
136
|
return [4, API.fileService.uploadFile(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
151
137
|
case 1:
|
|
152
138
|
data = (_a.sent()).data;
|
|
153
139
|
fileId = (data || {}).id;
|
|
154
140
|
if (fileId) {
|
|
155
|
-
uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS, fileId: fileId });
|
|
141
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS, fileId: fileId, error: '' });
|
|
156
142
|
onSuccess(index, uploadedFile);
|
|
157
143
|
}
|
|
158
144
|
else {
|
|
159
145
|
uploadedFile = __assign(__assign({}, uploadedFile), { progress: 0, status: FileStatus.ERROR, error: 'file_upload_error' });
|
|
160
|
-
|
|
146
|
+
onUpdate(index, uploadedFile, false);
|
|
161
147
|
}
|
|
162
148
|
return [2];
|
|
163
149
|
}
|
|
164
150
|
});
|
|
165
151
|
}); };
|
|
166
|
-
var deleteFile = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
152
|
+
var deleteFile = function (index) { return __awaiter(void 0, void 0, void 0, function () {
|
|
153
|
+
var payload, data, docId, _a;
|
|
154
|
+
var _b;
|
|
155
|
+
return __generator(this, function (_c) {
|
|
156
|
+
switch (_c.label) {
|
|
170
157
|
case 0:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
payload =
|
|
158
|
+
_c.trys.push([0, 2, , 3]);
|
|
159
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.DELETING, error: '' });
|
|
160
|
+
onUpdate(index, uploadedFile, true);
|
|
161
|
+
payload = (_b = {
|
|
162
|
+
id: uploadedFile.docId
|
|
163
|
+
},
|
|
164
|
+
_b[fileType] = [uploadedFile.fileId],
|
|
165
|
+
_b);
|
|
175
166
|
return [4, API.documentService.removeFilesFromDocument(payload)];
|
|
176
167
|
case 1:
|
|
177
|
-
data = (
|
|
168
|
+
data = (_c.sent()).data;
|
|
178
169
|
docId = (data || {}).id;
|
|
179
170
|
if (docId) {
|
|
180
|
-
uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.SUCCESS, fileId: '' });
|
|
181
|
-
|
|
171
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.SUCCESS, fileId: '', error: '', docId: '' });
|
|
172
|
+
onUpdate(index, uploadedFile, false);
|
|
182
173
|
onDelete(index);
|
|
183
174
|
}
|
|
184
175
|
else {
|
|
185
176
|
uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.ERROR, error: 'file_delete_error' });
|
|
186
|
-
|
|
177
|
+
onUpdate(index, uploadedFile, false);
|
|
187
178
|
}
|
|
188
|
-
return [
|
|
179
|
+
return [3, 3];
|
|
180
|
+
case 2:
|
|
181
|
+
_a = _c.sent();
|
|
182
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.ERROR, error: 'file_delete_error' });
|
|
183
|
+
onUpdate(index, uploadedFile, false);
|
|
184
|
+
return [3, 3];
|
|
185
|
+
case 3: return [2];
|
|
189
186
|
}
|
|
190
187
|
});
|
|
191
188
|
}); };
|
|
192
189
|
var downloadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var onDownloadProgress, _a;
|
|
190
|
+
var onDownloadProgress, data, _a;
|
|
194
191
|
return __generator(this, function (_b) {
|
|
195
192
|
switch (_b.label) {
|
|
196
193
|
case 0:
|
|
197
194
|
onDownloadProgress = function (progressEvent) {
|
|
198
195
|
var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
|
|
199
|
-
uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.DOWNLOADING });
|
|
200
|
-
|
|
196
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.DOWNLOADING, error: '' });
|
|
197
|
+
onUpdate(index, uploadedFile, true);
|
|
201
198
|
};
|
|
202
199
|
_b.label = 1;
|
|
203
200
|
case 1:
|
|
204
201
|
_b.trys.push([1, 3, , 4]);
|
|
202
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { progress: 0, status: FileStatus.DOWNLOADING, error: '' });
|
|
203
|
+
onUpdate(index, uploadedFile, true);
|
|
205
204
|
return [4, API.fileService.downloadFile(uploadedFile.fileId, uploadedFile.name, { onDownloadProgress: onDownloadProgress })];
|
|
206
205
|
case 2:
|
|
207
|
-
_b.sent();
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
data = (_b.sent()).data;
|
|
207
|
+
if (data) {
|
|
208
|
+
uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS, error: '' });
|
|
209
|
+
onSuccess(index, uploadedFile);
|
|
210
|
+
}
|
|
210
211
|
return [3, 4];
|
|
211
212
|
case 3:
|
|
212
213
|
_a = _b.sent();
|
|
213
214
|
uploadedFile = __assign(__assign({}, uploadedFile), { error: 'file_download_error', status: FileStatus.SUCCESS });
|
|
214
|
-
|
|
215
|
+
onUpdate(index, uploadedFile, false);
|
|
215
216
|
return [3, 4];
|
|
216
217
|
case 4: return [2];
|
|
217
218
|
}
|
|
218
219
|
});
|
|
219
220
|
}); };
|
|
220
221
|
var handleDeleteFile = function (index) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
deleteFile();
|
|
222
|
+
if (uploadedFile.docId) {
|
|
223
|
+
deleteFile(index);
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
226
|
onDelete(index);
|
|
227
227
|
};
|
|
228
|
+
var getProgressComponent = function () {
|
|
229
|
+
if (status === FileStatus.ERROR)
|
|
230
|
+
return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
|
|
231
|
+
if (status === FileStatus.SUCCESS)
|
|
232
|
+
return _jsx(CheckIcon, { isVerified: isVerified });
|
|
233
|
+
if (status === FileStatus.DOWNLOADING && !progress)
|
|
234
|
+
return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
|
|
235
|
+
if (progress)
|
|
236
|
+
return (_jsx(CircularProgress, { sx: { backgroundColor: alpha(theme.palette.primary.main, 0.05), borderRadius: '32px' }, textSx: { fontSize: theme.spacing(1.125) }, value: progress, size: 35 }));
|
|
237
|
+
return _jsx(_Fragment, {});
|
|
238
|
+
};
|
|
228
239
|
React.useEffect(function () {
|
|
229
240
|
if (!file)
|
|
230
241
|
return;
|
|
231
242
|
else if (!VALID_FILE_FORMATS.includes(type)) {
|
|
232
243
|
uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.ERROR, error: 'file_not_supported_alert' });
|
|
233
|
-
|
|
244
|
+
onUpdate(index, uploadedFile, false);
|
|
234
245
|
}
|
|
235
246
|
else if (size > MAX_FILE_SIZE_FOUR_MB) {
|
|
236
247
|
uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.ERROR, error: 'file_size_alert' });
|
|
237
|
-
|
|
248
|
+
onUpdate(index, uploadedFile, false);
|
|
238
249
|
}
|
|
239
250
|
else if (status === FileStatus.ALREADY_UPLOADED) {
|
|
240
251
|
uploadedFile = __assign(__assign({}, uploadedFile), { error: 'file_already_exist', progress: 0 });
|
|
241
|
-
|
|
252
|
+
onUpdate(index, uploadedFile, false);
|
|
242
253
|
}
|
|
243
254
|
else {
|
|
244
|
-
if (uploadedFile.status
|
|
255
|
+
if (uploadedFile.status === FileStatus.INIT || uploadedFile.status === FileStatus.ERROR) {
|
|
245
256
|
uploadFile();
|
|
246
257
|
}
|
|
247
258
|
}
|
|
248
259
|
}, []);
|
|
249
260
|
var canDownloadFile = uploadedFile.fileId && status !== FileStatus.DOWNLOADING;
|
|
250
|
-
|
|
261
|
+
var canDeleteFile = !isAnyFileDoingDeleteUploadDownload;
|
|
262
|
+
return (_jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, __assign({ readOnly: readOnly }, { children: [_jsxs(Box, __assign({ sx: {
|
|
251
263
|
display: 'flex',
|
|
252
264
|
flexDirection: 'column',
|
|
253
265
|
padding: theme.spacing(1.5, 0, 1.5),
|
|
254
266
|
width: '100%'
|
|
255
|
-
} }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children:
|
|
267
|
+
} }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name ? maskFileName(name) : uploadedFile.fileId })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] })), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || (!!isAnyFileDoingDeleteUploadDownload && deleteStatus !== DeleteFileStatus.DELETING), onClick: function () {
|
|
268
|
+
if (readOnly)
|
|
269
|
+
return;
|
|
270
|
+
canDeleteFile && handleDeleteFile(index);
|
|
271
|
+
} }, { children: deleteStatus === DeleteFileStatus.DELETING ? (_jsx(MUICircularProgress, { size: 25, thickness: 5, sx: { color: theme.palette.common.white } })) : (_jsx(ClearIconStyled, {})) }))] })) }), index));
|
|
256
272
|
};
|
|
257
273
|
export default UploadFile;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FileDetails } from '../../../@types';
|
|
3
2
|
import { Control, FieldValues } from 'react-hook-form';
|
|
3
|
+
import { FileDetails } from '../../../@types';
|
|
4
|
+
import { FileType } from '../../../constants';
|
|
4
5
|
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
component?: React.ElementType<any> | undefined;
|
|
7
8
|
ref?: React.Ref<unknown> | undefined;
|
|
8
9
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
9
|
-
} &
|
|
10
|
+
} & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
10
11
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
-
},
|
|
12
|
+
}, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
12
13
|
interface UploadMultipleFileProps {
|
|
13
14
|
id: string;
|
|
14
15
|
control: Control<FieldValues, any>;
|
|
15
16
|
label: string;
|
|
16
17
|
purpose: string;
|
|
18
|
+
fileType: FileType;
|
|
17
19
|
fileTitle?: string;
|
|
18
20
|
required?: boolean;
|
|
19
21
|
title: string;
|
|
@@ -27,6 +29,8 @@ interface UploadMultipleFileProps {
|
|
|
27
29
|
onDeleteFile: (fileIds: Array<string>) => void;
|
|
28
30
|
maxLimit?: number;
|
|
29
31
|
defaultFiles?: Array<FileDetails>;
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
isVerified?: boolean;
|
|
30
34
|
}
|
|
31
|
-
declare const UploadMultipleFile: ({ id, label, control, required, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles }: UploadMultipleFileProps) => JSX.Element;
|
|
35
|
+
declare const UploadMultipleFile: ({ id, label, control, required, fileType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles, readOnly, isVerified }: UploadMultipleFileProps) => JSX.Element;
|
|
32
36
|
export default UploadMultipleFile;
|