@tap-payments/auth-jsconnect 2.1.75-test → 2.1.76-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.
- package/build/@types/app.d.ts +24 -0
- package/build/@types/app.js +13 -0
- package/build/@types/form.d.ts +15 -1
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/user.d.ts +141 -0
- package/build/@types/user.js +1 -0
- package/build/api/board.d.ts +16 -0
- package/build/api/board.js +10 -1
- package/build/api/country.d.ts +4 -0
- package/build/api/country.js +9 -1
- package/build/api/index.d.ts +8 -3
- package/build/api/individual.d.ts +43 -1
- package/build/api/individual.js +9 -1
- package/build/api/user.d.ts +6 -0
- package/build/api/user.js +9 -1
- package/build/assets/locales/ar.json +22 -2
- package/build/assets/locales/en.json +22 -1
- package/build/components/SimpleList/SimpleList.d.ts +2 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.d.ts +1 -0
- package/build/constants/app.js +20 -7
- package/build/constants/assets.d.ts +4 -0
- package/build/constants/assets.js +4 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +2 -1
- package/build/features/app/brand/brandStore.d.ts +2 -0
- package/build/features/app/brand/brandStore.js +3 -1
- package/build/features/app/business/businessStore.js +1 -1
- package/build/features/app/entity/entityStore.d.ts +2 -0
- package/build/features/app/entity/entityStore.js +3 -1
- package/build/features/app/individual/individualStore.d.ts +28 -3
- package/build/features/app/individual/individualStore.js +461 -118
- package/build/features/app/password/passwordStore.js +2 -2
- package/build/features/app/tax/taxStore.js +30 -29
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -2
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +3 -3
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +3 -3
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +3 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +13 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +43 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +3 -13
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -17
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -16
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +35 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +41 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +9 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +20 -17
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +18 -25
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +31 -0
- package/build/features/individual/screens/IndividualList/IndividualList.js +59 -0
- package/build/features/individual/screens/IndividualList/UserList.d.ts +5 -0
- package/build/features/individual/screens/IndividualList/UserList.js +138 -0
- package/build/features/individual/screens/IndividualList/index.d.ts +3 -0
- package/build/features/individual/screens/IndividualList/index.js +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +8 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +90 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +82 -0
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +7 -0
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +46 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +50 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +7 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +49 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +34 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +81 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +48 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +21 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +126 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +88 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +145 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +52 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +88 -0
- package/build/features/individual/screens/IndividualPersonalInfo/index.d.ts +3 -0
- package/build/features/individual/screens/IndividualPersonalInfo/index.js +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/validation.d.ts +38 -0
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +68 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/shared/Address/Address.d.ts +6 -1
- package/build/features/shared/Address/Address.js +40 -30
- package/build/features/shared/Address/CountryList.d.ts +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +1 -1
- package/build/features/shared/Address/InputText.d.ts +2 -1
- package/build/features/shared/Address/InputText.js +2 -2
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +2 -2
- package/build/features/shared/Button/ListButton.d.ts +17 -0
- package/build/features/shared/Button/ListButton.js +107 -0
- package/build/features/shared/Button/index.d.ts +2 -1
- package/build/features/shared/Button/index.js +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +6 -4
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +8 -3
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +10 -5
- package/build/utils/string.d.ts +3 -2
- package/build/utils/string.js +16 -3
- package/package.json +1 -1
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +0 -19
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +0 -52
- package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +0 -3
- package/build/features/individual/screens/ShowIndividualInfo/index.js +0 -2
- package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +0 -7
- package/build/features/individual/screens/ShowIndividualInfo/info.js +0 -28
|
@@ -34,7 +34,6 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
34
34
|
import Input from '../../../shared/Input';
|
|
35
35
|
import SimpleList from '../../../../components/SimpleList';
|
|
36
36
|
import { useLanguage } from '../../../../hooks';
|
|
37
|
-
import Search from '../../../shared/Search';
|
|
38
37
|
var CountryItemContainer = styled(Box)(function () { return ({
|
|
39
38
|
display: 'flex'
|
|
40
39
|
}); });
|
|
@@ -74,19 +73,10 @@ var EmployerLocation = React.forwardRef(function (_a, ref) {
|
|
|
74
73
|
onCloseCountrySelect();
|
|
75
74
|
employerLocationControl.field.onChange(country);
|
|
76
75
|
};
|
|
77
|
-
var handleSearch = function (value) {
|
|
78
|
-
var filteredCountries = countries.filter(function (country) {
|
|
79
|
-
return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
|
|
80
|
-
country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
81
|
-
country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
82
|
-
country.name.english.toLowerCase().startsWith(value.toLowerCase());
|
|
83
|
-
});
|
|
84
|
-
setCountries(filteredCountries);
|
|
85
|
-
};
|
|
86
76
|
var location = employerLocationControl.field.value;
|
|
87
77
|
var error = (_b = employerLocationControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
88
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_employer_address_city'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_employee_location'), value: (isAr ? (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.arabic : (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.english) || '', warningMessage: error && t(error) }),
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_employer_address_city'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_employee_location'), value: (isAr ? (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.arabic : (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['idd_prefix', 'capital', 'name.arabic', 'name.english'], list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
79
|
+
return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIconStyled, {})] }));
|
|
80
|
+
} }) }))] })) })));
|
|
91
81
|
});
|
|
92
82
|
export default React.memo(EmployerLocation);
|
|
@@ -15,6 +15,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useFormContext, useController } from 'react-hook-form';
|
|
16
16
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
17
|
import Collapse from '../../../../components/Collapse';
|
|
18
|
+
import { useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { FieldType } from '../../../../@types';
|
|
18
20
|
import { styled, alpha } from '@mui/material/styles';
|
|
19
21
|
import Mandatory from '../../../shared/Mandatory';
|
|
20
22
|
import Text from '../../../../components/Text';
|
|
@@ -23,6 +25,7 @@ import RadioLabel from '../../../../components/RadioLabel';
|
|
|
23
25
|
import { InfoIconStyled, InfoOutlinedIconStyled } from './PEPSwitch';
|
|
24
26
|
import Box from '@mui/material/Box';
|
|
25
27
|
import Tooltip from '../../../../components/Tooltip';
|
|
28
|
+
import { individualSelector } from '../../../app/individual/individualStore';
|
|
26
29
|
var LabelTextStyled = styled(Text)(function (_a) {
|
|
27
30
|
var theme = _a.theme;
|
|
28
31
|
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
@@ -34,16 +37,20 @@ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
|
|
|
34
37
|
});
|
|
35
38
|
});
|
|
36
39
|
var InfluencerSwitch = function (_a) {
|
|
40
|
+
var _b;
|
|
37
41
|
var show = _a.show;
|
|
38
|
-
var
|
|
42
|
+
var _c = React.useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
39
43
|
var control = useFormContext().control;
|
|
40
44
|
var t = useTranslation().t;
|
|
41
45
|
var influencerControl = useController({ name: 'isInfluencer', control: control });
|
|
46
|
+
var data = useAppSelector(individualSelector).data;
|
|
47
|
+
var user = (data.verify.responseBody || {}).user;
|
|
48
|
+
var disabled = ((_b = user === null || user === void 0 ? void 0 : user.data_status) === null || _b === void 0 ? void 0 : _b.is_influencer) === FieldType.NON_EDITABLE;
|
|
42
49
|
var handleOnChange = function (_a) {
|
|
43
50
|
var target = _a.target;
|
|
44
51
|
influencerControl.field.onChange(target.value === 'yes');
|
|
45
52
|
};
|
|
46
53
|
var influencerValue = influencerControl.field.value;
|
|
47
|
-
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: 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 ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
48
55
|
};
|
|
49
56
|
export default React.memo(InfluencerSwitch);
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
23
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import { useTranslation } from 'react-i18next';
|
|
26
26
|
import { useController, useFormContext } from 'react-hook-form';
|
|
@@ -31,11 +31,11 @@ import Input from '../../../shared/Input';
|
|
|
31
31
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
32
32
|
import Collapse from '../../../../components/Collapse';
|
|
33
33
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
34
|
+
import { FieldType } from '../../../../@types';
|
|
34
35
|
import { individualSelector } from '../../../app/individual/individualStore';
|
|
35
36
|
import Text from '../../../../components/Text';
|
|
36
37
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
38
|
import SimpleList from '../../../../components/SimpleList';
|
|
38
|
-
import Search from '../../../../features/shared/Search';
|
|
39
39
|
import { findCurrencyByIso2 } from '../../../../utils';
|
|
40
40
|
import { settingsSelector } from '../../../../app/settings';
|
|
41
41
|
var Container = styled(Box)(function () { return ({
|
|
@@ -54,10 +54,10 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
var MonthlyIncome = function (_a) {
|
|
57
|
-
var _b;
|
|
57
|
+
var _b, _c;
|
|
58
58
|
var rest = __rest(_a, []);
|
|
59
|
-
var
|
|
60
|
-
var
|
|
59
|
+
var _d = React.useState([]), incomeList = _d[0], setIncomeList = _d[1];
|
|
60
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
61
61
|
var t = useTranslation().t;
|
|
62
62
|
var isAr = useLanguage().isAr;
|
|
63
63
|
var data = useAppSelector(individualSelector).data;
|
|
@@ -66,6 +66,8 @@ var MonthlyIncome = function (_a) {
|
|
|
66
66
|
var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
|
|
67
67
|
var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
|
|
68
68
|
var countryCode = settingsData.businessCountry;
|
|
69
|
+
var user = (data.verify.responseBody || {}).user;
|
|
70
|
+
var disabled = ((_b = user === null || user === void 0 ? void 0 : user.data_status) === null || _b === void 0 ? void 0 : _b.monthly_income) === FieldType.NON_EDITABLE;
|
|
69
71
|
React.useEffect(function () {
|
|
70
72
|
if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
|
|
71
73
|
setIncomeList(monthlyIncomeList);
|
|
@@ -88,20 +90,12 @@ var MonthlyIncome = function (_a) {
|
|
|
88
90
|
onCloseList();
|
|
89
91
|
monthlyIncomeControl.field.onChange(source);
|
|
90
92
|
};
|
|
91
|
-
var handleSearch = function (value) {
|
|
92
|
-
var filteredList = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.filter(function (income) {
|
|
93
|
-
var _a, _b, _c, _d;
|
|
94
|
-
return ((_b = (_a = income === null || income === void 0 ? void 0 : income.range) === null || _a === void 0 ? void 0 : _a.en) === null || _b === void 0 ? void 0 : _b.replace(',', '').toLowerCase().includes(value.toLowerCase())) ||
|
|
95
|
-
((_d = (_c = income === null || income === void 0 ? void 0 : income.range) === null || _c === void 0 ? void 0 : _c.ar) === null || _d === void 0 ? void 0 : _d.replace(',', '').toLowerCase().includes(value.toLowerCase()));
|
|
96
|
-
});
|
|
97
|
-
setIncomeList(filteredList);
|
|
98
|
-
};
|
|
99
93
|
var income = monthlyIncomeControl.field.value;
|
|
100
|
-
var error = (
|
|
94
|
+
var error = (_c = monthlyIncomeControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
101
95
|
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(Input, { label: t('please_enter_actual_income', {
|
|
102
96
|
currency: t(findCurrencyByIso2(countryCode.iso2))
|
|
103
|
-
}), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _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) }),
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
}), 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) {
|
|
98
|
+
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, {})] }));
|
|
99
|
+
} }) }))] })) })));
|
|
106
100
|
};
|
|
107
101
|
export default React.memo(MonthlyIncome);
|
|
@@ -20,13 +20,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
23
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import Box from '@mui/material/Box';
|
|
26
26
|
import { styled } from '@mui/material/styles';
|
|
27
27
|
import { useTranslation } from 'react-i18next';
|
|
28
28
|
import { useController, useFormContext } from 'react-hook-form';
|
|
29
29
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
30
|
+
import { FieldType } from '../../../../@types';
|
|
30
31
|
import { individualSelector } from '../../../app/individual/individualStore';
|
|
31
32
|
import Text from '../../../../components/Text';
|
|
32
33
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -35,7 +36,6 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
35
36
|
import Input from '../../../shared/Input';
|
|
36
37
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
38
|
import SimpleList from '../../../../components/SimpleList';
|
|
38
|
-
import Search from '../../../../features/shared/Search';
|
|
39
39
|
var Container = styled(Box)(function () { return ({
|
|
40
40
|
display: 'flex'
|
|
41
41
|
}); });
|
|
@@ -52,16 +52,18 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
var Occupation = function (_a) {
|
|
55
|
-
var _b, _c;
|
|
55
|
+
var _b, _c, _d;
|
|
56
56
|
var rest = __rest(_a, []);
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var _e = React.useState([]), occupationList = _e[0], setOccupationList = _e[1];
|
|
58
|
+
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
59
59
|
var t = useTranslation().t;
|
|
60
60
|
var isAr = useLanguage().isAr;
|
|
61
61
|
var data = useAppSelector(individualSelector).data;
|
|
62
62
|
var control = useFormContext().control;
|
|
63
63
|
var occupationsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.occupationList) || [];
|
|
64
64
|
var occupationControl = useController({ control: control, name: 'occupation' });
|
|
65
|
+
var user = (data.verify.responseBody || {}).user;
|
|
66
|
+
var disabled = ((_c = user === null || user === void 0 ? void 0 : user.data_status) === null || _c === void 0 ? void 0 : _c.occupation) === FieldType.NON_EDITABLE;
|
|
65
67
|
React.useEffect(function () {
|
|
66
68
|
if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
|
|
67
69
|
setOccupationList(occupationsList);
|
|
@@ -81,17 +83,11 @@ var Occupation = function (_a) {
|
|
|
81
83
|
onCloseList();
|
|
82
84
|
occupationControl.field.onChange(occupation);
|
|
83
85
|
};
|
|
84
|
-
var handleSearch = function (value) {
|
|
85
|
-
var filteredList = occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.filter(function (occupation) {
|
|
86
|
-
return occupation.name.en.toLowerCase().includes(value.toLowerCase()) || occupation.name.ar.toLowerCase().includes(value.toLowerCase());
|
|
87
|
-
});
|
|
88
|
-
setOccupationList(filteredList);
|
|
89
|
-
};
|
|
90
86
|
var occupation = occupationControl.field.value;
|
|
91
|
-
var error = (
|
|
92
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('occupation_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _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) }),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
var error = (_d = occupationControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
88
|
+
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) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
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, {})] }));
|
|
91
|
+
} }) }))] })) })));
|
|
96
92
|
};
|
|
97
93
|
export default Occupation;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "disabled" | "error" | "
|
|
5
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
|
|
6
6
|
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
7
7
|
htmlColor?: string | undefined;
|
|
8
8
|
inheritViewBox?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
|
16
16
|
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
19
|
-
color?: "inherit" | "disabled" | "error" | "
|
|
19
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
|
|
20
20
|
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
21
21
|
htmlColor?: string | undefined;
|
|
22
22
|
inheritViewBox?: boolean | undefined;
|
|
@@ -18,12 +18,15 @@ 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';
|
|
22
|
+
import { FieldType } from '../../../../@types';
|
|
21
23
|
import RadioGroup from '../../../../components/RadioGroup';
|
|
22
24
|
import RadioLabel from '../../../../components/RadioLabel';
|
|
23
25
|
import Tooltip from '../../../../components/Tooltip';
|
|
24
26
|
import InfoIcon from '@mui/icons-material/Info';
|
|
25
27
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
26
28
|
import Box from '@mui/material/Box';
|
|
29
|
+
import { individualSelector } from '../../../app/individual/individualStore';
|
|
27
30
|
var LabelTextStyled = styled(Text)(function (_a) {
|
|
28
31
|
var theme = _a.theme;
|
|
29
32
|
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
@@ -53,16 +56,20 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
|
53
56
|
});
|
|
54
57
|
});
|
|
55
58
|
var PEPSwitch = function (_a) {
|
|
59
|
+
var _b;
|
|
56
60
|
var show = _a.show;
|
|
57
|
-
var
|
|
61
|
+
var _c = React.useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
58
62
|
var control = useFormContext().control;
|
|
59
63
|
var t = useTranslation().t;
|
|
60
64
|
var pepControl = useController({ name: 'isPEP', control: control });
|
|
65
|
+
var data = useAppSelector(individualSelector).data;
|
|
66
|
+
var user = (data.verify.responseBody || {}).user;
|
|
67
|
+
var disabled = ((_b = user === null || user === void 0 ? void 0 : user.data_status) === null || _b === void 0 ? void 0 : _b.is_influencer) === FieldType.NON_EDITABLE;
|
|
61
68
|
var handleOnChange = function (_a) {
|
|
62
69
|
var target = _a.target;
|
|
63
70
|
pepControl.field.onChange(target.value === 'yes');
|
|
64
71
|
};
|
|
65
72
|
var pepValue = pepControl.field.value;
|
|
66
|
-
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: 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 ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
67
74
|
};
|
|
68
75
|
export default React.memo(PEPSwitch);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Collapse from '@mui/material/Collapse';
|
|
17
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
18
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
19
|
+
import Input from '../../../shared/Input';
|
|
20
|
+
var ShareCount = function (_a) {
|
|
21
|
+
var _b;
|
|
22
|
+
var show = _a.show;
|
|
23
|
+
var t = useTranslation().t;
|
|
24
|
+
var control = useFormContext().control;
|
|
25
|
+
var handleChange = function (_a) {
|
|
26
|
+
var target = _a.target;
|
|
27
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
28
|
+
shareCountControl.field.onChange(value);
|
|
29
|
+
};
|
|
30
|
+
var shareCountControl = useController({ control: control, name: 'shareCount' });
|
|
31
|
+
var shareCountValue = shareCountControl.field.value;
|
|
32
|
+
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) }) })) })));
|
|
34
|
+
};
|
|
35
|
+
export default React.memo(ShareCount);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Collapse from '@mui/material/Collapse';
|
|
17
|
+
import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
+
import { useAppSelector } from '../../../../hooks';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import Input from '../../../shared/Input';
|
|
22
|
+
var ShareValue = function (_a) {
|
|
23
|
+
var _b;
|
|
24
|
+
var show = _a.show;
|
|
25
|
+
var t = useTranslation().t;
|
|
26
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
27
|
+
var control = useFormContext().control;
|
|
28
|
+
var countryCode = settingsData.businessCountry.iso2;
|
|
29
|
+
var handleChange = function (_a) {
|
|
30
|
+
var target = _a.target;
|
|
31
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
32
|
+
shareValueControl.field.onChange(value);
|
|
33
|
+
};
|
|
34
|
+
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
|
35
|
+
var shareValueValue = shareValueControl.field.value;
|
|
36
|
+
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('capital_share_value_label', {
|
|
38
|
+
currency: t(findCurrencyByIso2(countryCode))
|
|
39
|
+
}), onChange: handleChange, value: shareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
40
|
+
};
|
|
41
|
+
export default React.memo(ShareValue);
|
|
@@ -20,13 +20,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
23
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import Box from '@mui/material/Box';
|
|
26
26
|
import { styled } from '@mui/material/styles';
|
|
27
27
|
import { useTranslation } from 'react-i18next';
|
|
28
28
|
import { useController, useFormContext } from 'react-hook-form';
|
|
29
29
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
30
|
+
import { FieldType } from '../../../../@types';
|
|
30
31
|
import { individualSelector } from '../../../app/individual/individualStore';
|
|
31
32
|
import Text from '../../../../components/Text';
|
|
32
33
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -51,16 +52,18 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
51
52
|
});
|
|
52
53
|
});
|
|
53
54
|
var SourceOfIncome = function (_a) {
|
|
54
|
-
var _b, _c;
|
|
55
|
+
var _b, _c, _d;
|
|
55
56
|
var rest = __rest(_a, []);
|
|
56
|
-
var
|
|
57
|
-
var
|
|
57
|
+
var _e = React.useState([]), sourceList = _e[0], setSourceList = _e[1];
|
|
58
|
+
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
58
59
|
var t = useTranslation().t;
|
|
59
60
|
var isAr = useLanguage().isAr;
|
|
60
61
|
var data = useAppSelector(individualSelector).data;
|
|
61
62
|
var control = useFormContext().control;
|
|
62
63
|
var sourceIncomeList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.sourceIncomeList) || [];
|
|
63
64
|
var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
|
|
65
|
+
var user = (data.verify.responseBody || {}).user;
|
|
66
|
+
var disabled = ((_c = user === null || user === void 0 ? void 0 : user.data_status) === null || _c === void 0 ? void 0 : _c.source_of_income) === FieldType.NON_EDITABLE;
|
|
64
67
|
React.useEffect(function () {
|
|
65
68
|
if ((sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.length) > 0) {
|
|
66
69
|
setSourceList(sourceIncomeList);
|
|
@@ -81,8 +84,8 @@ var SourceOfIncome = function (_a) {
|
|
|
81
84
|
sourceIncomeControl.field.onChange(source);
|
|
82
85
|
};
|
|
83
86
|
var source = sourceIncomeControl.field.value;
|
|
84
|
-
var error = (
|
|
85
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _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) {
|
|
87
|
+
var error = (_d = sourceIncomeControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
88
|
+
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) {
|
|
86
89
|
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, {})] }));
|
|
87
90
|
} }) }))] })) })));
|
|
88
91
|
};
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { ObjectShape } from 'yup/lib/object';
|
|
3
|
-
import {
|
|
4
|
-
export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
|
|
5
|
-
occupation: import("yup/lib/object").
|
|
6
|
-
sourceIncome: import("yup/lib/object").
|
|
3
|
+
import { IndividualType } from '../../../../@types';
|
|
4
|
+
export declare const IndividualInfoValidationSchema: (isAuthorizedUser: boolean, type: IndividualType, dataStatus: any) => yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
|
|
5
|
+
occupation: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
6
|
+
sourceIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
7
7
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
8
|
-
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
9
8
|
civilID: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
10
9
|
signatureFileId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
11
|
-
isPEP:
|
|
12
|
-
isInfluencer:
|
|
10
|
+
isPEP: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
11
|
+
isInfluencer: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
12
|
+
shareCount: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
|
+
shareValue: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
14
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
14
|
-
occupation: import("yup/lib/object").
|
|
15
|
-
sourceIncome: import("yup/lib/object").
|
|
15
|
+
occupation: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
16
|
+
sourceIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
16
17
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
17
|
-
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
18
18
|
civilID: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
19
19
|
signatureFileId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
20
|
-
isPEP:
|
|
21
|
-
isInfluencer:
|
|
20
|
+
isPEP: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
21
|
+
isInfluencer: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
22
|
+
shareCount: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
|
+
shareValue: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
24
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
23
|
-
occupation: import("yup/lib/object").
|
|
24
|
-
sourceIncome: import("yup/lib/object").
|
|
25
|
+
occupation: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
26
|
+
sourceIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
25
27
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
26
|
-
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
27
28
|
civilID: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
28
29
|
signatureFileId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
29
|
-
isPEP:
|
|
30
|
-
isInfluencer:
|
|
30
|
+
isPEP: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
31
|
+
isInfluencer: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
32
|
+
shareCount: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
33
|
+
shareValue: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
31
34
|
}>>>;
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}),
|
|
22
|
-
civilID: yup.array().optional(),
|
|
23
|
-
signatureFileId: yup.array().optional(),
|
|
24
|
-
isPEP: yup.boolean().required('please_choose_relative_pep'),
|
|
25
|
-
isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
|
|
26
|
-
});
|
|
2
|
+
import { IndividualType, FieldType } from '../../../../@types';
|
|
3
|
+
export var IndividualInfoValidationSchema = function (isAuthorizedUser, type, dataStatus) {
|
|
4
|
+
var isOccupationOptional = (dataStatus === null || dataStatus === void 0 ? void 0 : dataStatus.occupation) === FieldType.NON_EDITABLE;
|
|
5
|
+
var isSourceIncomeOptional = (dataStatus === null || dataStatus === void 0 ? void 0 : dataStatus.source_of_income) === FieldType.NON_EDITABLE;
|
|
6
|
+
var isPEPOptional = (dataStatus === null || dataStatus === void 0 ? void 0 : dataStatus.is_relative_PEP) === FieldType.NON_EDITABLE;
|
|
7
|
+
var isInfluencerOptional = (dataStatus === null || dataStatus === void 0 ? void 0 : dataStatus.is_influencer) === FieldType.NON_EDITABLE;
|
|
8
|
+
return yup.object().shape({
|
|
9
|
+
occupation: type === IndividualType.USER && !isOccupationOptional ? yup.object().required('alert_choose_occupation') : yup.object().optional(),
|
|
10
|
+
sourceIncome: type === IndividualType.USER && !isSourceIncomeOptional ? yup.object().required('choose_any_source_of_income') : yup.object().optional(),
|
|
11
|
+
monthlyIncome: yup.object().optional(),
|
|
12
|
+
civilID: yup.array().optional(),
|
|
13
|
+
signatureFileId: yup.array().optional(),
|
|
14
|
+
isPEP: type === IndividualType.USER && !isPEPOptional ? yup.boolean().required('please_choose_relative_pep') : yup.boolean().optional(),
|
|
15
|
+
isInfluencer: type === IndividualType.USER && !isInfluencerOptional ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional(),
|
|
16
|
+
shareCount: yup.string().optional(),
|
|
17
|
+
shareValue: yup.string().optional()
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const TitleStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
|
+
gutterBottom?: boolean | undefined;
|
|
7
|
+
noWrap?: boolean | undefined;
|
|
8
|
+
paragraph?: boolean | undefined;
|
|
9
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
10
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
|
|
12
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
13
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
15
|
+
export declare const SubTitleStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
16
|
+
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
19
|
+
gutterBottom?: boolean | undefined;
|
|
20
|
+
noWrap?: boolean | undefined;
|
|
21
|
+
paragraph?: boolean | undefined;
|
|
22
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
23
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
|
|
24
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
|
|
25
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
26
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
27
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
28
|
+
export interface IndividualListProps {
|
|
29
|
+
}
|
|
30
|
+
declare const IndividualList: () => JSX.Element;
|
|
31
|
+
export default IndividualList;
|