@tap-payments/auth-jsconnect 2.3.26-test → 2.3.27-test

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.
Files changed (155) hide show
  1. package/build/@types/app.d.ts +12 -1
  2. package/build/@types/app.js +1 -0
  3. package/build/@types/form.d.ts +2 -1
  4. package/build/app/settings.d.ts +3 -1
  5. package/build/app/settings.js +5 -1
  6. package/build/assets/locales/ar.json +3 -1
  7. package/build/assets/locales/en.json +3 -1
  8. package/build/constants/app.d.ts +2 -1
  9. package/build/constants/app.js +1 -0
  10. package/build/constants/validation.d.ts +1 -0
  11. package/build/constants/validation.js +1 -0
  12. package/build/features/app/brand/brandStore.d.ts +5 -2
  13. package/build/features/app/brand/brandStore.js +12 -3
  14. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -4
  15. package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
  16. package/build/features/bank/screens/BankDetails/BankName.js +8 -7
  17. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
  18. package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
  19. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
  20. package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
  21. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  22. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -3
  23. package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
  24. package/build/features/bank/screens/BankDetails/IBAN.js +2 -2
  25. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -1
  26. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +11 -6
  27. package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -1
  28. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -1
  29. package/build/features/brand/screens/BrandActivities/CustomerBase.js +12 -9
  30. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
  31. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +10 -7
  32. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
  33. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +9 -6
  34. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -1
  35. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +7 -4
  36. package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -1
  37. package/build/features/brand/screens/BrandActivities/TAC.js +3 -1
  38. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  39. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +7 -4
  40. package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -9
  41. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  42. package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
  43. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
  44. package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
  45. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  46. package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
  47. package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
  48. package/build/features/brand/screens/BrandInfo/Segments.js +3 -1
  49. package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
  50. package/build/features/brand/screens/BrandInfo/TeamSize.js +3 -1
  51. package/build/features/brand/screens/BrandInfo/validation.d.ts +3 -0
  52. package/build/features/brand/screens/BrandInfo/validation.js +1 -0
  53. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -1
  54. package/build/features/entity/screens/EntityCapital/ActivityList.js +12 -22
  55. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  56. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -1
  57. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  58. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +2 -1
  59. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  60. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -1
  61. package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -1
  62. package/build/features/entity/screens/EntityName/Article.d.ts +4 -1
  63. package/build/features/entity/screens/EntityName/Article.js +3 -4
  64. package/build/features/entity/screens/EntityName/EntityName.js +6 -3
  65. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -1
  66. package/build/features/entity/screens/EntityName/EntityTypeList.js +9 -19
  67. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
  68. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
  69. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
  70. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
  71. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  72. package/build/features/entity/screens/EntityName/LegalName.js +2 -1
  73. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  74. package/build/features/entity/screens/EntityName/LicenseCertificate.js +3 -8
  75. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  76. package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
  77. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  78. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  79. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +5 -2
  80. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +6 -3
  81. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +3 -8
  82. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
  83. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +3 -4
  84. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  85. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -22
  86. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
  87. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -23
  88. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
  89. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +3 -4
  90. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  91. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +2 -2
  92. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  93. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
  94. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  95. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +3 -8
  96. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  97. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +12 -23
  98. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  99. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
  100. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +3 -1
  101. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
  102. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +3 -1
  103. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
  104. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
  105. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
  106. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  107. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
  108. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +3 -4
  109. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
  110. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -1
  111. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
  112. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
  113. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -3
  114. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
  115. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +4 -6
  116. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
  117. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +2 -4
  118. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
  119. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
  120. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
  121. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +4 -6
  122. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  123. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  124. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  125. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
  126. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +3 -3
  127. package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
  128. package/build/features/shared/SalesChannels/SalesChannel.js +3 -3
  129. package/build/features/shared/UploadFile/FileUpload.d.ts +3 -1
  130. package/build/features/shared/UploadFile/FileUpload.js +14 -10
  131. package/build/features/shared/UploadFile/UploadWrapper.d.ts +3 -1
  132. package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
  133. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
  134. package/build/features/shared/UploadMultipleFile/UploadFile.js +9 -5
  135. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
  136. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
  137. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  138. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -3
  139. package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -2
  140. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  141. package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
  142. package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
  143. package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
  144. package/build/hooks/index.d.ts +2 -0
  145. package/build/hooks/index.js +2 -0
  146. package/build/hooks/useAppConfig.d.ts +1 -1
  147. package/build/hooks/useAppConfig.js +4 -2
  148. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  149. package/build/hooks/useDataNoneEditable.js +19 -0
  150. package/build/hooks/useFormReadOnly.d.ts +6 -0
  151. package/build/hooks/useFormReadOnly.js +38 -0
  152. package/build/utils/string.js +7 -8
  153. package/package.json +1 -1
  154. package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
  155. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
@@ -18,7 +18,7 @@ import { handleCurrentActiveScreen, settingsSelector } from '../../../../app/set
18
18
  import Box from '@mui/material/Box';
19
19
  import { alpha, styled } from '@mui/material/styles';
20
20
  import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage } from '../../../../hooks';
21
- import { IndividualType } from '../../../../@types';
21
+ import { DocumentPurpose, IndividualType } from '../../../../@types';
22
22
  import { isSA } from '../../../../utils';
23
23
  import Form from '../../../../components/Form';
24
24
  import Collapse from '../../../../components/Collapse';
@@ -36,6 +36,7 @@ import CivilIDFile from './CivilIDFile';
36
36
  import SignatureFile from './SignatureFile';
37
37
  import ShareCount from './ShareCount';
38
38
  import ShareValue from './ShareValue';
39
+ import { getFileDetailsFromDocument } from '../../../../utils';
39
40
  var TextBoxStyled = styled(Box)(function (_a) {
40
41
  var theme = _a.theme;
41
42
  return (__assign(__assign({ display: 'flex', justifyContent: 'center', flexDirection: 'row', padding: theme.spacing(1.8, 2.5, 1.8, 2.5) }, theme.typography.body1), { lineHeight: theme.spacing(2.5), color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium }));
@@ -54,6 +55,7 @@ var AdditionalIndividualInfo = function (_a) {
54
55
  var t = useTranslation().t;
55
56
  var isAr = useLanguage().isAr;
56
57
  var dispatch = useAppDispatch();
58
+ var settingData = useAppSelector(settingsSelector).data;
57
59
  var _b = useAppSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
58
60
  var settingsData = useAppSelector(settingsSelector).data;
59
61
  var verify = data.verify;
@@ -106,6 +108,7 @@ var AdditionalIndividualInfo = function (_a) {
106
108
  return t('type_board_member');
107
109
  return t('type_user');
108
110
  };
111
+ var defaultUserFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [user === null || user === void 0 ? void 0 : user.documents]);
109
112
  var showSignatureFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
110
113
  var showOccupationFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
111
114
  var showSourceOfIncome = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
@@ -116,7 +119,7 @@ var AdditionalIndividualInfo = function (_a) {
116
119
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
117
120
  var isOccupationListActive = listActive === ListType.OccupationList;
118
121
  var disabled = !methods.formState.isValid || civilIDUploading || signatureFileUploading;
119
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares }), _jsx(ShareValue, { show: !listActive && showShares }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: !isSACountry }), _jsx(SignatureFile, { show: (user === null || user === void 0 ? void 0 : user.is_authorized) && showSignatureFile })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive }), _jsx(InfluencerSwitch, { show: showIsInfluencer && !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
122
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { readOnly: !settingData.boardMaturity && !!(occupation === null || occupation === void 0 ? void 0 : occupation.id), onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: !settingData.boardMaturity && !!(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id), onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: !settingData.boardMaturity && !!(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id), show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: !settingData.boardMaturity && !!shareCount }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: !settingData.boardMaturity && !!shareValue }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: !isSACountry, readOnly: !settingData.boardMaturity && !!defaultUserFiles.length, defaultFiles: defaultUserFiles }), _jsx(SignatureFile, { show: (user === null || user === void 0 ? void 0 : user.is_authorized) && showSignatureFile, readOnly: !settingData.boardMaturity && !!defaultUserFiles.length, defaultFiles: defaultUserFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: !settingData.boardMaturity && typeof isPEP === 'boolean' }), _jsx(InfluencerSwitch, { show: showIsInfluencer && !listActive, readOnly: !settingData.boardMaturity && typeof isInfluencer === 'boolean' })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
120
123
  };
121
124
  export default React.memo(AdditionalIndividualInfo);
122
125
  AdditionalIndividualInfo.defaultProps = {};
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
- interface CivilIDFileProps {
2
+ import { FileDetails } from '../../../../@types';
3
+ declare type CivilIDFileProps = {
4
+ defaultFiles?: Array<FileDetails>;
5
+ readOnly?: boolean;
3
6
  show: boolean;
4
- }
5
- declare const CivilIDFile: ({ show }: CivilIDFileProps) => JSX.Element;
7
+ };
8
+ declare const CivilIDFile: ({ defaultFiles, readOnly, show }: CivilIDFileProps) => JSX.Element;
6
9
  export default CivilIDFile;
@@ -10,7 +10,6 @@ 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 { ScreenContainer } from '../../../../features/shared/Containers';
15
14
  import { styled } from '@mui/material/styles';
16
15
  import { useTranslation } from 'react-i18next';
@@ -19,7 +18,6 @@ import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
18
  import { DocumentPurpose } from '../../../../@types';
20
19
  import { FileType } from '../../../../constants';
21
20
  import Collapse from '../../../../components/Collapse';
22
- import { getFileDetailsFromDocument } from '../../../../utils';
23
21
  import { civilIDUploadingStatus, clearError, individualSelector } from '../../../app/individual/individualStore';
24
22
  import UploadMultipleFile from '../../../shared/UploadMultipleFile';
25
23
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
@@ -29,14 +27,12 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
29
27
  });
30
28
  });
31
29
  var CivilIDFile = function (_a) {
32
- var _b;
33
- var show = _a.show;
30
+ var defaultFiles = _a.defaultFiles, readOnly = _a.readOnly, show = _a.show;
34
31
  var t = useTranslation().t;
35
32
  var dispatch = useAppDispatch();
36
33
  var control = useFormContext().control;
37
34
  var civilIDFileIdControl = useController({ name: 'civilID', control: control });
38
- var _c = useAppSelector(individualSelector), loading = _c.loading, data = _c.data, error = _c.error;
39
- var documents = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).documents;
35
+ var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
40
36
  var handleCivilIDChange = function (ids) {
41
37
  if (error)
42
38
  dispatch(clearError());
@@ -47,7 +43,6 @@ var CivilIDFile = function (_a) {
47
43
  dispatch(clearError());
48
44
  civilIDFileIdControl.field.onChange(ids);
49
45
  };
50
- var defaultFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [documents]);
51
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
46
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
52
47
  };
53
48
  export default CivilIDFile;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface InfluencerSwitchProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: InfluencerSwitchProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: InfluencerSwitchProps) => JSX.Element>;
6
7
  export default _default;
@@ -36,14 +36,13 @@ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
36
36
  });
37
37
  });
38
38
  var InfluencerSwitch = function (_a) {
39
- var show = _a.show;
39
+ var show = _a.show, readOnly = _a.readOnly;
40
40
  var _b = React.useState(false), isHovered = _b[0], setIsHovered = _b[1];
41
41
  var control = useFormContext().control;
42
42
  var t = useTranslation().t;
43
43
  var dispatch = useAppDispatch();
44
44
  var influencerControl = useController({ name: 'isInfluencer', control: control });
45
- var _c = useAppSelector(individualSelector), data = _c.data, error = _c.error;
46
- var user = (data.verify.responseBody || {}).user;
45
+ var error = useAppSelector(individualSelector).error;
47
46
  var disabled = false;
48
47
  var handleOnChange = function (_a) {
49
48
  var target = _a.target;
@@ -52,6 +51,6 @@ var InfluencerSwitch = function (_a) {
52
51
  influencerControl.field.onChange(target.value === 'yes');
53
52
  };
54
53
  var influencerValue = influencerControl.field.value;
55
- 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_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_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: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: disabled ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
54
+ 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_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_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: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: disabled || readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
56
55
  };
57
56
  export default React.memo(InfluencerSwitch);
@@ -5,6 +5,7 @@ interface MonthlyIncomeProps {
5
5
  onSelectSource?: (country: MonthlyIncomeType) => void;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
- declare const _default: React.MemoExoticComponent<({ ...rest }: MonthlyIncomeProps) => JSX.Element>;
10
+ declare const _default: React.MemoExoticComponent<(props: MonthlyIncomeProps) => JSX.Element>;
10
11
  export default _default;
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import * as React from 'react';
25
14
  import { useTranslation } from 'react-i18next';
@@ -52,21 +41,19 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
52
41
  alignItems: 'flex-end'
53
42
  });
54
43
  });
55
- var MonthlyIncome = function (_a) {
56
- var _b;
57
- var rest = __rest(_a, []);
58
- var _c = React.useState([]), incomeList = _c[0], setIncomeList = _c[1];
59
- var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
44
+ var MonthlyIncome = function (props) {
45
+ var _a;
46
+ var _b = React.useState([]), incomeList = _b[0], setIncomeList = _b[1];
47
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
60
48
  var t = useTranslation().t;
61
49
  var isAr = useLanguage().isAr;
62
50
  var dispatch = useAppDispatch();
63
- var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
51
+ var _d = useAppSelector(individualSelector), data = _d.data, bckError = _d.error;
64
52
  var control = useFormContext().control;
65
53
  var settingsData = useAppSelector(settingsSelector).data;
66
54
  var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
67
55
  var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
68
56
  var countryCode = settingsData.businessCountry;
69
- var user = (data.verify.responseBody || {}).user;
70
57
  var disabled = false;
71
58
  React.useEffect(function () {
72
59
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
@@ -75,13 +62,15 @@ var MonthlyIncome = function (_a) {
75
62
  }, [monthlyIncomeList]);
76
63
  var onOpenList = function (event) {
77
64
  var _a;
65
+ if (props.readOnly)
66
+ return;
78
67
  setAnchorEl(event.currentTarget);
79
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
68
+ (_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
80
69
  };
81
70
  var onCloseList = function () {
82
71
  var _a;
83
72
  setAnchorEl(null);
84
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
73
+ (_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
85
74
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
86
75
  setIncomeList(monthlyIncomeList);
87
76
  }
@@ -93,8 +82,8 @@ var MonthlyIncome = function (_a) {
93
82
  monthlyIncomeControl.field.onChange(source);
94
83
  };
95
84
  var income = monthlyIncomeControl.field.value;
96
- var error = (_b = monthlyIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
97
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(Input, { label: t('please_enter_actual_income', {
85
+ var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(Input, { label: t('please_enter_actual_income', {
98
87
  currency: t(findCurrencyByIso2(countryCode.iso2))
99
88
  }), disabled: disabled, readOnly: true, 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 ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
100
89
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIconStyled, {})] }));
@@ -5,6 +5,7 @@ interface OccupationProps {
5
5
  onSelectOccupation?: (occupation: OccupationType) => void;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
- declare const Occupation: ({ ...rest }: OccupationProps) => JSX.Element;
10
+ declare const Occupation: (props: OccupationProps) => JSX.Element;
10
11
  export default Occupation;
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { 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';
@@ -50,19 +39,17 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
50
39
  alignItems: 'flex-end'
51
40
  });
52
41
  });
53
- var Occupation = function (_a) {
54
- var _b, _c;
55
- var rest = __rest(_a, []);
56
- var _d = React.useState([]), occupationList = _d[0], setOccupationList = _d[1];
57
- var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
42
+ var Occupation = function (props) {
43
+ var _a, _b;
44
+ var _c = React.useState([]), occupationList = _c[0], setOccupationList = _c[1];
45
+ var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
58
46
  var t = useTranslation().t;
59
47
  var isAr = useLanguage().isAr;
60
48
  var dispatch = useAppDispatch();
61
- var _f = useAppSelector(individualSelector), data = _f.data, bckError = _f.error;
49
+ var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
62
50
  var control = useFormContext().control;
63
- var occupationsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.occupationList) || [];
51
+ var occupationsList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.occupationList) || [];
64
52
  var occupationControl = useController({ control: control, name: 'occupation' });
65
- var user = (data.verify.responseBody || {}).user;
66
53
  var disabled = false;
67
54
  React.useEffect(function () {
68
55
  if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
@@ -71,13 +58,15 @@ var Occupation = function (_a) {
71
58
  }, [occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.occupation]);
72
59
  var onOpenList = function (event) {
73
60
  var _a;
61
+ if (props.readOnly)
62
+ return;
74
63
  setAnchorEl(event.currentTarget);
75
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
64
+ (_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
76
65
  };
77
66
  var onCloseList = function () {
78
67
  var _a;
79
68
  setAnchorEl(null);
80
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
69
+ (_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
81
70
  };
82
71
  var onSelectItem = function (occupation) {
83
72
  if (bckError)
@@ -86,8 +75,8 @@ var Occupation = function (_a) {
86
75
  occupationControl.field.onChange(occupation);
87
76
  };
88
77
  var occupation = occupationControl.field.value;
89
- var error = (_c = occupationControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
90
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, disabled: disabled, label: t('occupation_title'), readOnly: true, 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) {
78
+ var error = (_b = occupationControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
79
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, disabled: disabled, label: t('occupation_title'), readOnly: true, 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) {
91
80
  var _a, _b;
92
81
  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, {})] }));
93
82
  } }) }))] })) })));
@@ -29,6 +29,7 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
29
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;
@@ -55,14 +55,13 @@ 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 _c = useAppSelector(individualSelector), data = _c.data, error = _c.error;
63
+ var error = useAppSelector(individualSelector).error;
64
64
  var dispatch = useAppDispatch();
65
- var user = (data.verify.responseBody || {}).user;
66
65
  var disabled = false;
67
66
  var handleOnChange = function (_a) {
68
67
  var target = _a.target;
@@ -71,6 +70,6 @@ var PEPSwitch = function (_a) {
71
70
  pepControl.field.onChange(target.value === 'yes');
72
71
  };
73
72
  var pepValue = pepControl.field.value;
74
- 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({ 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') })] }))] })) })));
75
74
  };
76
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;
@@ -21,7 +21,7 @@ import Input from '../../../shared/Input';
21
21
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
22
22
  var ShareCount = function (_a) {
23
23
  var _b;
24
- var show = _a.show;
24
+ var show = _a.show, readOnly = _a.readOnly;
25
25
  var t = useTranslation().t;
26
26
  var control = useFormContext().control;
27
27
  var dispatch = useAppDispatch();
@@ -36,6 +36,6 @@ var ShareCount = function (_a) {
36
36
  var shareCountControl = useController({ control: control, name: 'shareCount' });
37
37
  var shareCountValue = shareCountControl.field.value;
38
38
  var error = (_b = shareCountControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
39
- 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) }) })) })));
40
40
  };
41
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;
@@ -22,7 +22,7 @@ import Input from '../../../shared/Input';
22
22
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
23
23
  var ShareValue = function (_a) {
24
24
  var _b;
25
- var show = _a.show;
25
+ var show = _a.show, readOnly = _a.readOnly;
26
26
  var t = useTranslation().t;
27
27
  var settingsData = useAppSelector(settingsSelector).data;
28
28
  var control = useFormContext().control;
@@ -39,7 +39,7 @@ var ShareValue = function (_a) {
39
39
  var shareValueControl = useController({ control: control, name: 'shareValue' });
40
40
  var shareValueValue = shareValueControl.field.value;
41
41
  var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
42
- 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', {
43
43
  currency: t(findCurrencyByIso2(countryCode))
44
44
  }), onChange: handleChange, value: shareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
45
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,14 +10,12 @@ 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
21
  import { individualSelector, signatureFileUploadingStatus, clearError } from '../../../app/individual/individualStore';
@@ -29,13 +27,11 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
29
27
  });
30
28
  });
31
29
  var SignatureFile = function (_a) {
32
- var _b;
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 _c = useAppSelector(individualSelector), loading = _c.loading, data = _c.data, error = _c.error;
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) {
41
37
  if (error)
@@ -47,7 +43,6 @@ var SignatureFile = function (_a) {
47
43
  dispatch(clearError());
48
44
  signatureFileIdControl.field.onChange(ids);
49
45
  };
50
- var defaultFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.CUSTOMER_SIGNATURE); }, [documents]);
51
- 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 }) }) })));
52
47
  };
53
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<({ ...rest }: SourceOfIncomeProps) => JSX.Element>;
10
+ declare const _default: React.MemoExoticComponent<(props: SourceOfIncomeProps) => JSX.Element>;
10
11
  export default _default;
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { 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';
@@ -50,19 +39,17 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
50
39
  alignItems: 'flex-end'
51
40
  });
52
41
  });
53
- var SourceOfIncome = function (_a) {
54
- var _b, _c;
55
- var rest = __rest(_a, []);
56
- var _d = React.useState([]), sourceList = _d[0], setSourceList = _d[1];
57
- var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
42
+ var SourceOfIncome = function (props) {
43
+ var _a, _b;
44
+ var _c = React.useState([]), sourceList = _c[0], setSourceList = _c[1];
45
+ var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
58
46
  var t = useTranslation().t;
59
47
  var isAr = useLanguage().isAr;
60
- var _f = useAppSelector(individualSelector), data = _f.data, bckError = _f.error;
48
+ var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
61
49
  var dispatch = useAppDispatch();
62
50
  var control = useFormContext().control;
63
- var sourceIncomeList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.sourceIncomeList) || [];
51
+ var sourceIncomeList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.sourceIncomeList) || [];
64
52
  var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
65
- var user = (data.verify.responseBody || {}).user;
66
53
  var disabled = false;
67
54
  React.useEffect(function () {
68
55
  if ((sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.length) > 0) {
@@ -71,13 +58,15 @@ var SourceOfIncome = function (_a) {
71
58
  }, [sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.sourceIncome]);
72
59
  var onOpenList = function (event) {
73
60
  var _a;
61
+ if (props.readOnly)
62
+ return;
74
63
  setAnchorEl(event.currentTarget);
75
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
64
+ (_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
76
65
  };
77
66
  var onCloseList = function () {
78
67
  var _a;
79
68
  setAnchorEl(null);
80
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
69
+ (_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
81
70
  };
82
71
  var onSelectItem = function (source) {
83
72
  if (bckError)
@@ -86,8 +75,8 @@ var SourceOfIncome = function (_a) {
86
75
  sourceIncomeControl.field.onChange(source);
87
76
  };
88
77
  var source = sourceIncomeControl.field.value;
89
- var error = (_c = sourceIncomeControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
90
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, disabled: disabled, label: t('tap_js_source_of_income'), readOnly: true, 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) {
78
+ var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
79
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, disabled: disabled, label: t('tap_js_source_of_income'), readOnly: true, 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) {
91
80
  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, {})] }));
92
81
  } }) }))] })) })));
93
82
  };
@@ -98,7 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var isStartsWith5 = mobileValue.startsWith('5');
99
99
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
100
100
  var verify = data.verify;
101
- var user = (verify.responseBody || {}).user;
102
101
  React.useEffect(function () {
103
102
  if (mobileValue)
104
103
  setValue('mobile', mobileValue, { shouldValidate: true });
@@ -3,6 +3,7 @@ interface BirthCityProps {
3
3
  show: boolean;
4
4
  onListOpen?: () => void;
5
5
  onListClose?: () => void;
6
+ readOnly?: boolean;
6
7
  }
7
8
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BirthCityProps & React.RefAttributes<unknown>>>;
8
9
  export default _default;
@@ -51,7 +51,7 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
51
51
  });
52
52
  var BirthCity = React.forwardRef(function (_a, ref) {
53
53
  var _b;
54
- var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose;
54
+ var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly;
55
55
  var _c = React.useState([]), locationCities = _c[0], setCities = _c[1];
56
56
  var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
57
57
  var t = useTranslation().t;
@@ -86,6 +86,8 @@ var BirthCity = React.forwardRef(function (_a, ref) {
86
86
  }
87
87
  }, [birthCountry]);
88
88
  var onOpenCitySelect = function (event) {
89
+ if (readOnly)
90
+ return;
89
91
  setAnchorEl(event.currentTarget);
90
92
  onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
91
93
  };
@@ -5,6 +5,7 @@ interface BirthCountryProps {
5
5
  show: boolean;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
10
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BirthCountryProps & React.RefAttributes<unknown>>>;
10
11
  export default _default;