@tap-payments/auth-jsconnect 2.0.51 → 2.0.52
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 +90 -7
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +21 -20
- package/build/@types/theme.d.ts +1 -1
- 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/country.d.ts +1 -1
- package/build/api/data.d.ts +10 -10
- package/build/api/document.d.ts +2 -2
- package/build/api/entity.d.ts +12 -12
- package/build/api/file.d.ts +1 -1
- package/build/api/individual.d.ts +5 -5
- package/build/api/lead.d.ts +10 -10
- 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 +4 -11
- package/build/app/settings.js +13 -5
- package/build/app/store.d.ts +4 -4
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/components/DatePicker/DatePicker.js +1 -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/Slide/Slide.d.ts +1 -1
- package/build/constants/app.d.ts +3 -2
- package/build/constants/app.js +1 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.d.ts +9 -73
- package/build/features/app/bank/bankStore.js +68 -91
- package/build/features/app/brand/brandStore.d.ts +16 -103
- package/build/features/app/brand/brandStore.js +62 -49
- package/build/features/app/business/businessStore.d.ts +18 -162
- package/build/features/app/business/businessStore.js +4 -3
- package/build/features/app/connect/connectStore.d.ts +13 -121
- package/build/features/app/connect/connectStore.js +5 -4
- package/build/features/app/connectExpress/connectExpressStore.d.ts +22 -211
- package/build/features/app/connectExpress/connectExpressStore.js +9 -10
- package/build/features/app/entity/entityStore.d.ts +9 -74
- package/build/features/app/entity/entityStore.js +129 -152
- package/build/features/app/individual/individualStore.d.ts +21 -167
- package/build/features/app/individual/individualStore.js +176 -202
- package/build/features/app/password/passwordStore.d.ts +12 -102
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/signIn/signInStore.d.ts +7 -61
- package/build/features/app/signIn/signInStore.js +1 -1
- package/build/features/app/tax/taxStore.d.ts +8 -62
- package/build/features/app/tax/taxStore.js +48 -62
- package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
- package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankName.js +8 -7
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +5 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -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 +2 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +16 -21
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +15 -18
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +14 -9
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +14 -5
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +12 -16
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +16 -13
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +22 -9
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +20 -7
- 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 -1
- 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 +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +20 -12
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandName.js +3 -3
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.js +12 -2
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +12 -2
- package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
- package/build/features/brand/screens/BrandInfo/validation.js +36 -42
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +12 -17
- package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BusinessType/Article.d.ts +1 -1
- package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +5 -5
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -15
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
- package/build/features/business/screens/IDBOD/DOB.js +1 -1
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/screens/Individual/Email.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -1
- package/build/features/connect/screens/Merchant/BrandName.js +1 -1
- package/build/features/connect/screens/Merchant/Segments.js +6 -1
- package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
- package/build/features/connect/screens/Merchant/validation.js +5 -5
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +7 -5
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +7 -6
- 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/CollectIndividualInfo/CollectIndividualInfo.js +9 -5
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -3
- 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 +2 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -2
- 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 +2 -2
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- 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/entity/screens/EntityCapital/ActivityList.d.ts +14 -18
- package/build/features/entity/screens/EntityCapital/ActivityList.js +20 -27
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +7 -3
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +7 -3
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -3
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +19 -17
- package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
- package/build/features/entity/screens/EntityCapital/validation.js +4 -10
- package/build/features/entity/screens/EntityName/Article.d.ts +5 -2
- package/build/features/entity/screens/EntityName/Article.js +9 -6
- package/build/features/entity/screens/EntityName/EntityName.js +20 -5
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +14 -18
- package/build/features/entity/screens/EntityName/EntityTypeList.js +24 -27
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +4 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +4 -3
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
- package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LegalName.js +8 -4
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -9
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +8 -5
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +8 -5
- 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/Verify/OTPInput.js +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +25 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +21 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +8 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +8 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +8 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +8 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +25 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
- package/build/features/individual/screens/IndividualList/Email.js +1 -1
- 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/IndividualPersonalInfo/BirthCity.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +12 -2
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +12 -2
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +4 -5
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +7 -6
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +4 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +13 -7
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +11 -10
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +13 -7
- 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 +4 -2
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/shared/Address/CountryList.d.ts +9 -9
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +9 -9
- package/build/features/shared/Address/InputSelect.js +2 -2
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
- package/build/features/shared/Button/FlowsButtons.js +15 -20
- package/build/features/shared/Button/IndividualActionButtons.d.ts +1 -1
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -1
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/GenericError/GenericError.js +1 -1
- package/build/features/shared/Input/Input.d.ts +3 -3
- package/build/features/shared/Input/Input.js +2 -3
- 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 +2 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +5 -4
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +5 -4
- package/build/features/shared/UploadFile/FileUpload.d.ts +6 -4
- package/build/features/shared/UploadFile/FileUpload.js +19 -15
- 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 +5 -3
- package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +5 -4
- package/build/features/shared/UploadMultipleFile/UploadFile.js +14 -10
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +4 -3
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
- 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 +9 -4
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
- 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/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -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/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/object.d.ts +4 -0
- package/build/utils/object.js +17 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +13 -7
- package/package.json +2 -2
- package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
|
@@ -9,25 +9,14 @@ 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 { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import Box from '@mui/material/Box';
|
|
26
15
|
import { styled } from '@mui/material/styles';
|
|
27
16
|
import { useTranslation } from 'react-i18next';
|
|
28
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
29
|
-
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
30
|
-
import { individualSelector } from '../../../app/individual/individualStore';
|
|
18
|
+
import { useAppSelector, useLanguage, useAppDispatch } from '../../../../hooks';
|
|
19
|
+
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
31
20
|
import Text from '../../../../components/Text';
|
|
32
21
|
import Collapse from '../../../../components/Collapse';
|
|
33
22
|
import CheckIcon from '@mui/icons-material/Check';
|
|
@@ -38,6 +27,14 @@ import SimpleList from '../../../../components/SimpleList';
|
|
|
38
27
|
var Container = styled(Box)(function () { return ({
|
|
39
28
|
display: 'flex'
|
|
40
29
|
}); });
|
|
30
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
31
|
+
var readOnly = _a.readOnly;
|
|
32
|
+
return ({
|
|
33
|
+
'& .MuiInputBase-input': {
|
|
34
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
41
38
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
42
39
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
43
40
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
@@ -50,18 +47,17 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
50
47
|
alignItems: 'flex-end'
|
|
51
48
|
});
|
|
52
49
|
});
|
|
53
|
-
var Occupation = function (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var _d = React.useState(
|
|
57
|
-
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
50
|
+
var Occupation = function (props) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
var _c = React.useState([]), occupationList = _c[0], setOccupationList = _c[1];
|
|
53
|
+
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
58
54
|
var t = useTranslation().t;
|
|
59
55
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
56
|
+
var dispatch = useAppDispatch();
|
|
57
|
+
var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
|
|
61
58
|
var control = useFormContext().control;
|
|
62
|
-
var occupationsList = ((
|
|
59
|
+
var occupationsList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.occupationList) || [];
|
|
63
60
|
var occupationControl = useController({ control: control, name: 'occupation' });
|
|
64
|
-
var user = (data.verify.responseBody || {}).user;
|
|
65
61
|
var disabled = false;
|
|
66
62
|
React.useEffect(function () {
|
|
67
63
|
if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
|
|
@@ -70,21 +66,25 @@ var Occupation = function (_a) {
|
|
|
70
66
|
}, [occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.occupation]);
|
|
71
67
|
var onOpenList = function (event) {
|
|
72
68
|
var _a;
|
|
69
|
+
if (props.readOnly)
|
|
70
|
+
return;
|
|
73
71
|
setAnchorEl(event.currentTarget);
|
|
74
|
-
(_a =
|
|
72
|
+
(_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
75
73
|
};
|
|
76
74
|
var onCloseList = function () {
|
|
77
75
|
var _a;
|
|
78
76
|
setAnchorEl(null);
|
|
79
|
-
(_a =
|
|
77
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
80
78
|
};
|
|
81
79
|
var onSelectItem = function (occupation) {
|
|
80
|
+
if (bckError)
|
|
81
|
+
dispatch(clearError());
|
|
82
82
|
onCloseList();
|
|
83
83
|
occupationControl.field.onChange(occupation);
|
|
84
84
|
};
|
|
85
85
|
var occupation = occupationControl.field.value;
|
|
86
|
-
var error = (
|
|
87
|
-
return (_jsx(Collapse, __assign({ in:
|
|
86
|
+
var error = (_b = occupationControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
87
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, disabled: disabled, label: t('occupation_title'), readOnly: props.readOnly, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_occupation'), value: (isAr ? occupation === null || occupation === void 0 ? void 0 : occupation.name.ar : occupation === null || occupation === void 0 ? void 0 : occupation.name.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
88
88
|
var _a, _b;
|
|
89
89
|
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIconStyled, {})] }));
|
|
90
90
|
} }) }))] })) })));
|
|
@@ -10,9 +10,9 @@ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
|
10
10
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
11
11
|
titleAccess?: string | undefined;
|
|
12
12
|
viewBox?: string | undefined;
|
|
13
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "
|
|
13
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
14
14
|
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
15
|
-
}, "color" | "fontSize" | "shapeRendering" | "children" | "sx" |
|
|
15
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
16
16
|
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
@@ -24,11 +24,12 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
|
|
|
24
24
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
25
|
titleAccess?: string | undefined;
|
|
26
26
|
viewBox?: string | undefined;
|
|
27
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "
|
|
27
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
28
28
|
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
29
|
-
}, "color" | "fontSize" | "shapeRendering" | "children" | "sx" |
|
|
29
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
30
|
export interface PEPSwitchProps {
|
|
31
31
|
show: boolean;
|
|
32
|
+
readOnly?: boolean;
|
|
32
33
|
}
|
|
33
|
-
declare const _default: React.MemoExoticComponent<({ show }: PEPSwitchProps) => JSX.Element>;
|
|
34
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: PEPSwitchProps) => JSX.Element>;
|
|
34
35
|
export default _default;
|
|
@@ -18,14 +18,14 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
18
18
|
import Collapse from '../../../../components/Collapse';
|
|
19
19
|
import Mandatory from '../../../shared/Mandatory';
|
|
20
20
|
import Text from '../../../../components/Text';
|
|
21
|
-
import { useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
22
22
|
import RadioGroup from '../../../../components/RadioGroup';
|
|
23
23
|
import RadioLabel from '../../../../components/RadioLabel';
|
|
24
24
|
import Tooltip from '../../../../components/Tooltip';
|
|
25
25
|
import InfoIcon from '@mui/icons-material/Info';
|
|
26
26
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
27
27
|
import Box from '@mui/material/Box';
|
|
28
|
-
import { individualSelector } from '../../../app/individual/individualStore';
|
|
28
|
+
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
29
29
|
var LabelTextStyled = styled(Text)(function (_a) {
|
|
30
30
|
var theme = _a.theme;
|
|
31
31
|
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
@@ -55,19 +55,21 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
var PEPSwitch = function (_a) {
|
|
58
|
-
var show = _a.show;
|
|
58
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
59
59
|
var _b = React.useState(false), isHovered = _b[0], setIsHovered = _b[1];
|
|
60
60
|
var control = useFormContext().control;
|
|
61
61
|
var t = useTranslation().t;
|
|
62
62
|
var pepControl = useController({ name: 'isPEP', control: control });
|
|
63
|
-
var
|
|
64
|
-
var
|
|
63
|
+
var error = useAppSelector(individualSelector).error;
|
|
64
|
+
var dispatch = useAppDispatch();
|
|
65
65
|
var disabled = false;
|
|
66
66
|
var handleOnChange = function (_a) {
|
|
67
67
|
var target = _a.target;
|
|
68
|
+
if (error)
|
|
69
|
+
dispatch(clearError());
|
|
68
70
|
pepControl.field.onChange(target.value === 'yes');
|
|
69
71
|
};
|
|
70
72
|
var pepValue = pepControl.field.value;
|
|
71
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('pep_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: disabled ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
73
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('pep_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: disabled || readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
72
74
|
};
|
|
73
75
|
export default React.memo(PEPSwitch);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ShareCountProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: ShareCountProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: ShareCountProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -15,21 +15,27 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
17
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
18
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
18
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
19
20
|
import Input from '../../../shared/Input';
|
|
21
|
+
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
20
22
|
var ShareCount = function (_a) {
|
|
21
23
|
var _b;
|
|
22
|
-
var show = _a.show;
|
|
24
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
23
25
|
var t = useTranslation().t;
|
|
24
26
|
var control = useFormContext().control;
|
|
27
|
+
var dispatch = useAppDispatch();
|
|
28
|
+
var bckError = useAppSelector(individualSelector).error;
|
|
25
29
|
var handleChange = function (_a) {
|
|
26
30
|
var target = _a.target;
|
|
31
|
+
if (bckError)
|
|
32
|
+
dispatch(clearError());
|
|
27
33
|
var value = removeAllCharsFromNumber(target.value);
|
|
28
34
|
shareCountControl.field.onChange(value);
|
|
29
35
|
};
|
|
30
36
|
var shareCountControl = useController({ control: control, name: 'shareCount' });
|
|
31
37
|
var shareCountValue = shareCountControl.field.value;
|
|
32
38
|
var error = (_b = shareCountControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
33
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('share_count_label'), onChange: handleChange, value: shareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
39
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_count_label'), onChange: handleChange, value: shareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
34
40
|
};
|
|
35
41
|
export default React.memo(ShareCount);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ShareValueProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: ShareValueProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: ShareValueProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -16,25 +16,30 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
17
|
import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
-
import { useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
|
+
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
22
23
|
var ShareValue = function (_a) {
|
|
23
24
|
var _b;
|
|
24
|
-
var show = _a.show;
|
|
25
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
27
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
27
28
|
var control = useFormContext().control;
|
|
29
|
+
var bckError = useAppSelector(individualSelector).error;
|
|
30
|
+
var dispatch = useAppDispatch();
|
|
28
31
|
var countryCode = settingsData.businessCountry.iso2;
|
|
29
32
|
var handleChange = function (_a) {
|
|
30
33
|
var target = _a.target;
|
|
34
|
+
if (bckError)
|
|
35
|
+
dispatch(clearError());
|
|
31
36
|
var value = removeAllCharsFromNumber(target.value);
|
|
32
37
|
shareValueControl.field.onChange(value);
|
|
33
38
|
};
|
|
34
39
|
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
|
35
40
|
var shareValueValue = shareValueControl.field.value;
|
|
36
41
|
var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
37
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('share_value_label', {
|
|
42
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
|
|
38
43
|
currency: t(findCurrencyByIso2(countryCode))
|
|
39
44
|
}), onChange: handleChange, value: shareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
40
45
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { FileDetails } from '../../../../@types';
|
|
2
3
|
interface SignatureFileProps {
|
|
3
4
|
show: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
defaultFiles?: Array<FileDetails>;
|
|
4
7
|
}
|
|
5
|
-
declare const SignatureFile: ({ show }: SignatureFileProps) => JSX.Element;
|
|
8
|
+
declare const SignatureFile: ({ show, readOnly, defaultFiles }: SignatureFileProps) => JSX.Element;
|
|
6
9
|
export default SignatureFile;
|
|
@@ -10,17 +10,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import React from 'react';
|
|
14
13
|
import { useTranslation } from 'react-i18next';
|
|
15
14
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
15
|
import { styled } from '@mui/material/styles';
|
|
17
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
17
|
import { DocumentPurpose } from '../../../../@types';
|
|
19
18
|
import { FileType } from '../../../../constants';
|
|
20
|
-
import { getFileDetailsFromDocument } from '../../../../utils';
|
|
21
19
|
import UploadMultipleFile from '../../../shared/UploadMultipleFile';
|
|
22
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
|
-
import { individualSelector, signatureFileUploadingStatus } from '../../../app/individual/individualStore';
|
|
21
|
+
import { individualSelector, signatureFileUploadingStatus, clearError } from '../../../app/individual/individualStore';
|
|
24
22
|
import Collapse from '../../../../components/Collapse';
|
|
25
23
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
26
24
|
var theme = _a.theme;
|
|
@@ -29,21 +27,22 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
29
27
|
});
|
|
30
28
|
});
|
|
31
29
|
var SignatureFile = function (_a) {
|
|
32
|
-
var
|
|
33
|
-
var show = _a.show;
|
|
30
|
+
var show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
|
|
34
31
|
var t = useTranslation().t;
|
|
35
32
|
var control = useFormContext().control;
|
|
36
33
|
var signatureFileIdControl = useController({ name: 'signatureFileId', control: control });
|
|
37
|
-
var
|
|
38
|
-
var documents = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).documents;
|
|
34
|
+
var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
|
|
39
35
|
var dispatch = useAppDispatch();
|
|
40
36
|
var handleSignatureChange = function (ids) {
|
|
37
|
+
if (error)
|
|
38
|
+
dispatch(clearError());
|
|
41
39
|
signatureFileIdControl.field.onChange(ids);
|
|
42
40
|
};
|
|
43
41
|
var handleReset = function (ids) {
|
|
42
|
+
if (error)
|
|
43
|
+
dispatch(clearError());
|
|
44
44
|
signatureFileIdControl.field.onChange(ids);
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { id: 'signatureFileId', control: control, label: t('title_signature_file'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_signature'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_signature_file'), onFileUploaded: handleSignatureChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CUSTOMER_SIGNATURE, fileUploadingStatus: function (uploading) { return dispatch(signatureFileUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
|
|
46
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'signatureFileId', control: control, label: t('title_signature_file'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_signature'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_signature_file'), onFileUploaded: handleSignatureChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CUSTOMER_SIGNATURE, fileUploadingStatus: function (uploading) { return dispatch(signatureFileUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
|
|
48
47
|
};
|
|
49
48
|
export default SignatureFile;
|
|
@@ -5,6 +5,7 @@ interface SourceOfIncomeProps {
|
|
|
5
5
|
onSelectSource?: (source: SourceOfIncomeType) => void;
|
|
6
6
|
onListOpen?: () => void;
|
|
7
7
|
onListClose?: () => void;
|
|
8
|
+
readOnly?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const _default: React.MemoExoticComponent<(
|
|
10
|
+
declare const _default: React.MemoExoticComponent<(props: SourceOfIncomeProps) => JSX.Element>;
|
|
10
11
|
export default _default;
|
|
@@ -9,25 +9,14 @@ 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 { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import Box from '@mui/material/Box';
|
|
26
15
|
import { styled } from '@mui/material/styles';
|
|
27
16
|
import { useTranslation } from 'react-i18next';
|
|
28
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
29
|
-
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
30
|
-
import { individualSelector } from '../../../app/individual/individualStore';
|
|
18
|
+
import { useAppSelector, useLanguage, useAppDispatch } from '../../../../hooks';
|
|
19
|
+
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
31
20
|
import Text from '../../../../components/Text';
|
|
32
21
|
import Collapse from '../../../../components/Collapse';
|
|
33
22
|
import CheckIcon from '@mui/icons-material/Check';
|
|
@@ -35,6 +24,14 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
35
24
|
import Input from '../../../shared/Input';
|
|
36
25
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
26
|
import SimpleList from '../../../../components/SimpleList';
|
|
27
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
28
|
+
var readOnly = _a.readOnly;
|
|
29
|
+
return ({
|
|
30
|
+
'& .MuiInputBase-input': {
|
|
31
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
38
35
|
var Container = styled(Box)(function () { return ({
|
|
39
36
|
display: 'flex'
|
|
40
37
|
}); });
|
|
@@ -50,18 +47,17 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
50
47
|
alignItems: 'flex-end'
|
|
51
48
|
});
|
|
52
49
|
});
|
|
53
|
-
var SourceOfIncome = function (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var _d = React.useState(
|
|
57
|
-
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
50
|
+
var SourceOfIncome = function (props) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
var _c = React.useState([]), sourceList = _c[0], setSourceList = _c[1];
|
|
53
|
+
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
58
54
|
var t = useTranslation().t;
|
|
59
55
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
56
|
+
var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
|
|
57
|
+
var dispatch = useAppDispatch();
|
|
61
58
|
var control = useFormContext().control;
|
|
62
|
-
var sourceIncomeList = ((
|
|
59
|
+
var sourceIncomeList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.sourceIncomeList) || [];
|
|
63
60
|
var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
|
|
64
|
-
var user = (data.verify.responseBody || {}).user;
|
|
65
61
|
var disabled = false;
|
|
66
62
|
React.useEffect(function () {
|
|
67
63
|
if ((sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.length) > 0) {
|
|
@@ -70,21 +66,25 @@ var SourceOfIncome = function (_a) {
|
|
|
70
66
|
}, [sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.sourceIncome]);
|
|
71
67
|
var onOpenList = function (event) {
|
|
72
68
|
var _a;
|
|
69
|
+
if (props.readOnly)
|
|
70
|
+
return;
|
|
73
71
|
setAnchorEl(event.currentTarget);
|
|
74
|
-
(_a =
|
|
72
|
+
(_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
75
73
|
};
|
|
76
74
|
var onCloseList = function () {
|
|
77
75
|
var _a;
|
|
78
76
|
setAnchorEl(null);
|
|
79
|
-
(_a =
|
|
77
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
80
78
|
};
|
|
81
79
|
var onSelectItem = function (source) {
|
|
80
|
+
if (bckError)
|
|
81
|
+
dispatch(clearError());
|
|
82
82
|
onCloseList();
|
|
83
83
|
sourceIncomeControl.field.onChange(source);
|
|
84
84
|
};
|
|
85
85
|
var source = sourceIncomeControl.field.value;
|
|
86
|
-
var error = (
|
|
87
|
-
return (_jsx(Collapse, __assign({ in:
|
|
86
|
+
var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
87
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, disabled: disabled, label: t('tap_js_source_of_income'), readOnly: props.readOnly, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name.ar : source === null || source === void 0 ? void 0 : source.name.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
88
88
|
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name.ar : item === null || item === void 0 ? void 0 : item.name.en })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
|
|
89
89
|
} }) }))] })) })));
|
|
90
90
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import {
|
|
3
|
-
export declare const IndividualInfoValidationSchema: (
|
|
2
|
+
import { IndividualType } from '../../../../@types';
|
|
3
|
+
export declare const IndividualInfoValidationSchema: (type: IndividualType) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
4
|
occupation: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
5
|
sourceIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
6
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { IndividualType
|
|
3
|
-
export var IndividualInfoValidationSchema = function (
|
|
4
|
-
var _a = user || {}, type = _a.type, data_status = _a.data_status, occupation = _a.occupation, source_income = _a.source_income, is_relative_PEP = _a.is_relative_PEP, is_influencer = _a.is_influencer;
|
|
5
|
-
var isOccupationOptional = !occupation && (data_status === null || data_status === void 0 ? void 0 : data_status.occupation) === FieldType.NON_EDITABLE;
|
|
6
|
-
var isSourceIncomeOptional = !source_income && (data_status === null || data_status === void 0 ? void 0 : data_status.source_of_income) === FieldType.NON_EDITABLE;
|
|
7
|
-
var isPEPOptional = is_relative_PEP === undefined && (data_status === null || data_status === void 0 ? void 0 : data_status.is_relative_PEP) === FieldType.NON_EDITABLE;
|
|
8
|
-
var isInfluencerOptional = is_influencer === undefined && (data_status === null || data_status === void 0 ? void 0 : data_status.is_influencer) === FieldType.NON_EDITABLE;
|
|
2
|
+
import { IndividualType } from '../../../../@types';
|
|
3
|
+
export var IndividualInfoValidationSchema = function (type) {
|
|
9
4
|
return yup.object().shape({
|
|
10
|
-
occupation: type === IndividualType.USER
|
|
11
|
-
sourceIncome: type === IndividualType.USER
|
|
5
|
+
occupation: type === IndividualType.USER ? yup.object().required('alert_choose_occupation') : yup.object().optional(),
|
|
6
|
+
sourceIncome: type === IndividualType.USER ? yup.object().required('choose_any_source_of_income') : yup.object().optional(),
|
|
12
7
|
monthlyIncome: yup.object().optional(),
|
|
13
8
|
civilID: yup.array().optional(),
|
|
14
9
|
signatureFileId: yup.array().optional(),
|
|
15
|
-
isPEP: type === IndividualType.USER
|
|
16
|
-
isInfluencer: type === IndividualType.USER
|
|
10
|
+
isPEP: type === IndividualType.USER ? yup.boolean().required('please_choose_relative_pep') : yup.boolean().optional(),
|
|
11
|
+
isInfluencer: type === IndividualType.USER ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional(),
|
|
17
12
|
shareCount: yup.string().optional(),
|
|
18
13
|
shareValue: yup.string().optional()
|
|
19
14
|
});
|
|
@@ -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 (
|
|
27
|
+
while (_) 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]) {
|