@tap-payments/auth-jsconnect 2.3.26-test → 2.3.28-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 +12 -1
- package/build/@types/app.js +1 -0
- package/build/@types/form.d.ts +2 -1
- package/build/api/entity.d.ts +5 -5
- package/build/app/settings.d.ts +3 -1
- package/build/app/settings.js +5 -1
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/constants/app.d.ts +2 -1
- package/build/constants/app.js +1 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.js +26 -30
- package/build/features/app/brand/brandStore.d.ts +5 -2
- package/build/features/app/brand/brandStore.js +49 -39
- package/build/features/app/entity/entityStore.js +58 -68
- package/build/features/app/individual/individualStore.js +59 -65
- package/build/features/app/tax/taxStore.js +23 -22
- package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
- package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankName.js +8 -7
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -3
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +2 -2
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +16 -21
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +11 -6
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +4 -3
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +12 -9
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +10 -7
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +9 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +7 -4
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +3 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +7 -4
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -9
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.js +3 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +3 -1
- package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
- package/build/features/brand/screens/BrandInfo/validation.js +31 -37
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/ActivityList.js +12 -22
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -1
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +4 -2
- package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
- package/build/features/entity/screens/EntityCapital/validation.js +4 -10
- package/build/features/entity/screens/EntityName/Article.d.ts +4 -1
- package/build/features/entity/screens/EntityName/Article.js +3 -4
- package/build/features/entity/screens/EntityName/EntityName.js +7 -4
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -1
- package/build/features/entity/screens/EntityName/EntityTypeList.js +9 -19
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
- package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LegalName.js +2 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +3 -8
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +6 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +6 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -22
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +12 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +3 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +4 -6
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +4 -6
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +3 -3
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +3 -3
- package/build/features/shared/UploadFile/FileUpload.d.ts +3 -1
- package/build/features/shared/UploadFile/FileUpload.js +14 -10
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +3 -1
- package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.js +9 -5
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -3
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -3
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +40 -0
- package/build/utils/string.js +7 -8
- package/package.json +1 -1
- package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
|
@@ -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 (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var _d = React.useState(
|
|
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
|
|
49
|
+
var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
|
|
62
50
|
var control = useFormContext().control;
|
|
63
|
-
var occupationsList = ((
|
|
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 =
|
|
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 =
|
|
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 = (
|
|
90
|
-
return (_jsx(Collapse, __assign({ in:
|
|
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
|
|
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
|
|
33
|
-
var show = _a.show;
|
|
30
|
+
var show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
|
|
34
31
|
var t = useTranslation().t;
|
|
35
32
|
var control = useFormContext().control;
|
|
36
33
|
var signatureFileIdControl = useController({ name: 'signatureFileId', control: control });
|
|
37
|
-
var
|
|
38
|
-
var documents = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).documents;
|
|
34
|
+
var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
|
|
39
35
|
var dispatch = useAppDispatch();
|
|
40
36
|
var handleSignatureChange = function (ids) {
|
|
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
|
-
|
|
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<(
|
|
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 (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var _d = React.useState(
|
|
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
|
|
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 = ((
|
|
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 =
|
|
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 =
|
|
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 = (
|
|
90
|
-
return (_jsx(Collapse, __assign({ in:
|
|
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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import {
|
|
3
|
-
export declare const IndividualInfoValidationSchema: (
|
|
2
|
+
import { IndividualType } from '../../../../@types';
|
|
3
|
+
export declare const IndividualInfoValidationSchema: (type: IndividualType) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
4
|
occupation: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
5
|
sourceIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
6
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { IndividualType
|
|
3
|
-
export var IndividualInfoValidationSchema = function (
|
|
4
|
-
var _a = user || {}, type = _a.type, data_status = _a.data_status, occupation = _a.occupation, source_income = _a.source_income, is_relative_PEP = _a.is_relative_PEP, is_influencer = _a.is_influencer;
|
|
5
|
-
var isOccupationOptional = !occupation && (data_status === null || data_status === void 0 ? void 0 : data_status.occupation) === FieldType.NON_EDITABLE;
|
|
6
|
-
var isSourceIncomeOptional = !source_income && (data_status === null || data_status === void 0 ? void 0 : data_status.source_of_income) === FieldType.NON_EDITABLE;
|
|
7
|
-
var isPEPOptional = is_relative_PEP === undefined && (data_status === null || data_status === void 0 ? void 0 : data_status.is_relative_PEP) === FieldType.NON_EDITABLE;
|
|
8
|
-
var isInfluencerOptional = is_influencer === undefined && (data_status === null || data_status === void 0 ? void 0 : data_status.is_influencer) === FieldType.NON_EDITABLE;
|
|
2
|
+
import { IndividualType } from '../../../../@types';
|
|
3
|
+
export var IndividualInfoValidationSchema = function (type) {
|
|
9
4
|
return yup.object().shape({
|
|
10
|
-
occupation: type === IndividualType.USER
|
|
11
|
-
sourceIncome: type === IndividualType.USER
|
|
5
|
+
occupation: type === IndividualType.USER ? yup.object().required('alert_choose_occupation') : yup.object().optional(),
|
|
6
|
+
sourceIncome: type === IndividualType.USER ? yup.object().required('choose_any_source_of_income') : yup.object().optional(),
|
|
12
7
|
monthlyIncome: yup.object().optional(),
|
|
13
8
|
civilID: yup.array().optional(),
|
|
14
9
|
signatureFileId: yup.array().optional(),
|
|
15
|
-
isPEP: type === IndividualType.USER
|
|
16
|
-
isInfluencer: type === IndividualType.USER
|
|
10
|
+
isPEP: type === IndividualType.USER ? yup.boolean().required('please_choose_relative_pep') : yup.boolean().optional(),
|
|
11
|
+
isInfluencer: type === IndividualType.USER ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional(),
|
|
17
12
|
shareCount: yup.string().optional(),
|
|
18
13
|
shareValue: yup.string().optional()
|
|
19
14
|
});
|
|
@@ -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;
|
|
@@ -51,7 +51,7 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
|
51
51
|
});
|
|
52
52
|
var BirthCountry = React.forwardRef(function (_a, ref) {
|
|
53
53
|
var _b, _c, _d;
|
|
54
|
-
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
54
|
+
var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
|
|
55
55
|
var _e = React.useState(countries), locationCountries = _e[0], setCountries = _e[1];
|
|
56
56
|
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
57
57
|
var t = useTranslation().t;
|
|
@@ -60,6 +60,8 @@ var BirthCountry = React.forwardRef(function (_a, ref) {
|
|
|
60
60
|
var placeOfBirthCountryControl = useController({ control: control, name: 'placeOfBirthCountry' });
|
|
61
61
|
var onOpenCountrySelect = function (event) {
|
|
62
62
|
var _a;
|
|
63
|
+
if (readOnly)
|
|
64
|
+
return;
|
|
63
65
|
setAnchorEl(event.currentTarget);
|
|
64
66
|
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
65
67
|
};
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
interface BODProps {
|
|
3
3
|
show: boolean;
|
|
4
4
|
onDateClicked?: (flag: boolean) => void;
|
|
5
|
+
readOnly?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const _default: React.MemoExoticComponent<({ onDateClicked, show }: BODProps) => JSX.Element>;
|
|
7
|
+
declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly }: BODProps) => JSX.Element>;
|
|
7
8
|
export default _default;
|
|
@@ -26,7 +26,7 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
26
26
|
});
|
|
27
27
|
var BOD = function (_a) {
|
|
28
28
|
var _b;
|
|
29
|
-
var onDateClicked = _a.onDateClicked, show = _a.show;
|
|
29
|
+
var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly;
|
|
30
30
|
var t = useTranslation().t;
|
|
31
31
|
var control = useFormContext().control;
|
|
32
32
|
var dispatch = useAppDispatch();
|
|
@@ -41,6 +41,6 @@ var BOD = function (_a) {
|
|
|
41
41
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
42
42
|
var spacing = _a.spacing;
|
|
43
43
|
return spacing(2.5, 2.5, 2.5, 2.5);
|
|
44
|
-
} } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) :
|
|
44
|
+
} } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, disabled: readOnly, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
|
|
45
45
|
};
|
|
46
46
|
export default React.memo(BOD);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface EmailProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: EmailProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: EmailProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -28,15 +28,13 @@ var InputStyled = styled(Input)(function () { return ({
|
|
|
28
28
|
}); });
|
|
29
29
|
var Email = function (_a) {
|
|
30
30
|
var _b;
|
|
31
|
-
var show = _a.show;
|
|
31
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
32
32
|
var t = useTranslation().t;
|
|
33
33
|
var control = useFormContext().control;
|
|
34
34
|
var emailControl = useController({ name: 'email', control: control });
|
|
35
35
|
var data = useAppSelector(individualSelector).data;
|
|
36
36
|
var emailValue = emailControl.field.value;
|
|
37
37
|
var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
38
|
-
var verify = data.verify;
|
|
39
|
-
var user = (verify.responseBody || {}).user;
|
|
40
38
|
var handleEmailChange = function (event) {
|
|
41
39
|
emailControl.field.onChange(event.target.value);
|
|
42
40
|
};
|
|
@@ -44,6 +42,6 @@ var Email = function (_a) {
|
|
|
44
42
|
emailControl.field.onChange('');
|
|
45
43
|
};
|
|
46
44
|
var disabled = false;
|
|
47
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(InputStyled, { label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', disabled: disabled, placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) }) })));
|
|
45
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(InputStyled, { readOnly: readOnly, label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', disabled: disabled, placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) }) })));
|
|
48
46
|
};
|
|
49
47
|
export default React.memo(Email);
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
interface ExpiryDateProps {
|
|
3
3
|
show: boolean;
|
|
4
4
|
onDateClicked?: (flag: boolean) => void;
|
|
5
|
+
readOnly?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const _default: React.MemoExoticComponent<({ onDateClicked, show }: ExpiryDateProps) => JSX.Element>;
|
|
7
|
+
declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly }: ExpiryDateProps) => JSX.Element>;
|
|
7
8
|
export default _default;
|
|
@@ -27,13 +27,12 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
27
27
|
});
|
|
28
28
|
var ExpiryDate = function (_a) {
|
|
29
29
|
var _b;
|
|
30
|
-
var onDateClicked = _a.onDateClicked, show = _a.show;
|
|
30
|
+
var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly;
|
|
31
31
|
var t = useTranslation().t;
|
|
32
32
|
var control = useFormContext().control;
|
|
33
33
|
var dispatch = useAppDispatch();
|
|
34
34
|
var dobControl = useController({ control: control, name: 'expiryDate' });
|
|
35
|
-
var
|
|
36
|
-
var user = (data.verify.responseBody || {}).user;
|
|
35
|
+
var error = useAppSelector(individualSelector).error;
|
|
37
36
|
var handleBirthDateChange = function (data) {
|
|
38
37
|
if (error)
|
|
39
38
|
dispatch(clearError());
|
|
@@ -44,6 +43,6 @@ var ExpiryDate = function (_a) {
|
|
|
44
43
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
45
44
|
var spacing = _a.spacing;
|
|
46
45
|
return spacing(2.5, 2.5, 2.5, 2.5);
|
|
47
|
-
} } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', maxDate: getFutureDate(), onClick: disabled ? undefined : function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
|
|
46
|
+
} } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled || readOnly, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', maxDate: getFutureDate(), onClick: disabled ? undefined : function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
|
|
48
47
|
};
|
|
49
48
|
export default React.memo(ExpiryDate);
|
|
@@ -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
|
declare type GenderProps = {
|
|
31
31
|
show: boolean;
|
|
32
|
+
readOnly?: boolean;
|
|
32
33
|
};
|
|
33
|
-
declare const Gender: ({ show }: GenderProps) => JSX.Element;
|
|
34
|
+
declare const Gender: ({ show, readOnly }: GenderProps) => JSX.Element;
|
|
34
35
|
export default Gender;
|
|
@@ -67,12 +67,14 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
var Gender = function (_a) {
|
|
70
|
-
var show = _a.show;
|
|
70
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
71
71
|
var t = useTranslation().t;
|
|
72
72
|
var control = useFormContext().control;
|
|
73
73
|
var genderControl = useController({ control: control, name: 'gender' });
|
|
74
74
|
var handleOnChange = function (_a) {
|
|
75
75
|
var target = _a.target;
|
|
76
|
+
if (readOnly)
|
|
77
|
+
return;
|
|
76
78
|
genderControl.field.onChange(target.value);
|
|
77
79
|
};
|
|
78
80
|
var genderValue = genderControl.field.value;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface IDNumberProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: IDNumberProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: IDNumberProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -14,22 +14,17 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
17
|
-
import { useAppSelector } from '../../../../hooks';
|
|
18
17
|
import { ID_NUMBER_LENGTH } from '../../../../constants';
|
|
19
18
|
import Collapse from '../../../../components/Collapse';
|
|
20
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
20
|
import Input from '../../../shared/Input';
|
|
22
21
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
23
22
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
24
|
-
import { individualSelector } from '../../../app/individual/individualStore';
|
|
25
23
|
var IDNumber = function (_a) {
|
|
26
24
|
var _b;
|
|
27
|
-
var show = _a.show;
|
|
25
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
28
26
|
var t = useTranslation().t;
|
|
29
27
|
var control = useFormContext().control;
|
|
30
|
-
var data = useAppSelector(individualSelector).data;
|
|
31
|
-
var verify = data.verify;
|
|
32
|
-
var user = (verify.responseBody || {}).user;
|
|
33
28
|
var nidControl = useController({ control: control, name: 'nid' });
|
|
34
29
|
var handleIdChange = function (_a) {
|
|
35
30
|
var target = _a.target;
|
|
@@ -42,6 +37,6 @@ var IDNumber = function (_a) {
|
|
|
42
37
|
var nidValue = nidControl.field.value;
|
|
43
38
|
var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
44
39
|
var disabled = false;
|
|
45
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_national_id'), disabled: disabled, inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }) })));
|
|
40
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t('enter_national_id'), disabled: disabled, inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }) })));
|
|
46
41
|
};
|
|
47
42
|
export default React.memo(IDNumber);
|