@tap-payments/auth-jsconnect 2.4.13-test → 2.4.15-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 +28 -1
- package/build/components/DatePicker/DatePicker.d.ts +2 -1
- package/build/components/DatePicker/DatePicker.js +12 -11
- package/build/features/app/individual/individualStore.js +8 -5
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -14
- package/build/features/entity/screens/EntityCapital/ActivityList.js +9 -14
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -5
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +3 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +13 -5
- package/build/features/entity/screens/EntityName/Article.d.ts +2 -1
- package/build/features/entity/screens/EntityName/Article.js +3 -2
- package/build/features/entity/screens/EntityName/EntityName.js +34 -12
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +1 -14
- package/build/features/entity/screens/EntityName/EntityTypeList.js +7 -16
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -4
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -4
- package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LegalName.js +3 -4
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -2
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +4 -5
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +28 -21
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +10 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +13 -10
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +14 -19
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +1 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +9 -18
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +12 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +9 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +14 -18
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +5 -13
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +5 -13
- 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 +3 -8
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +2 -3
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +3 -5
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +58 -20
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +6 -15
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +5 -8
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +6 -15
- package/build/features/shared/EndAdornment/EndAdornment.d.ts +1 -1
- package/build/features/shared/EndAdornment/EndAdornment.js +1 -1
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +6 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -404,7 +404,8 @@ export declare type EntityDataStatus = {
|
|
|
404
404
|
};
|
|
405
405
|
export declare type IndividualDataStatus = {
|
|
406
406
|
status: FieldType;
|
|
407
|
-
name: FieldType;
|
|
407
|
+
'name.en': FieldType;
|
|
408
|
+
'name.ar': FieldType;
|
|
408
409
|
'contact.email': FieldType;
|
|
409
410
|
'contact.phone.number': FieldType;
|
|
410
411
|
'contact.phone.country_code': FieldType;
|
|
@@ -425,6 +426,7 @@ export declare type IndividualDataStatus = {
|
|
|
425
426
|
monthly_income: FieldType;
|
|
426
427
|
is_relative_PEP: FieldType;
|
|
427
428
|
is_influencer: FieldType;
|
|
429
|
+
gender: FieldType;
|
|
428
430
|
};
|
|
429
431
|
export declare type BrandDataStatus = {
|
|
430
432
|
status: FieldType;
|
|
@@ -550,4 +552,29 @@ export declare type EntityDataVerification = {
|
|
|
550
552
|
taxable: string;
|
|
551
553
|
type: string;
|
|
552
554
|
};
|
|
555
|
+
export declare type IndividualDataVerification = {
|
|
556
|
+
'birth.city': string;
|
|
557
|
+
'birth.country': string;
|
|
558
|
+
'birth.date': string;
|
|
559
|
+
'contact.email': string;
|
|
560
|
+
'contact.phone.country_code': string;
|
|
561
|
+
'contact.phone.number': string;
|
|
562
|
+
employer_city: string;
|
|
563
|
+
employer_country: string;
|
|
564
|
+
employer_name: string;
|
|
565
|
+
gender: string;
|
|
566
|
+
'identification.expiry': string;
|
|
567
|
+
'identification.id': string;
|
|
568
|
+
'identification.issuer_country': string;
|
|
569
|
+
'identification.type': string;
|
|
570
|
+
is_authorized: string;
|
|
571
|
+
is_influencer: string;
|
|
572
|
+
is_relative_PEP: string;
|
|
573
|
+
'name.en': string;
|
|
574
|
+
'name.ar': string;
|
|
575
|
+
nationality: string;
|
|
576
|
+
occupation: string;
|
|
577
|
+
relation: string;
|
|
578
|
+
status: string;
|
|
579
|
+
};
|
|
553
580
|
export {};
|
|
@@ -10,6 +10,7 @@ export interface DatePickerProps extends CalendarProps {
|
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
dir?: string;
|
|
12
12
|
isDob?: boolean;
|
|
13
|
+
isVerified?: boolean;
|
|
13
14
|
}
|
|
14
|
-
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, ...rest }: DatePickerProps) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
|
|
15
16
|
export default _default;
|
|
@@ -28,9 +28,9 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import { styled } from '@mui/material/styles';
|
|
29
29
|
import Divider from '@mui/material/Divider';
|
|
30
30
|
import Collapse from '../Collapse';
|
|
31
|
-
import ExpandIcon from '../ExpandIcon';
|
|
32
31
|
import CalendarTodayOutlined from '@mui/icons-material/CalendarTodayOutlined';
|
|
33
|
-
import {
|
|
32
|
+
import { convertToEnglishDateFormat, getEighteenYearsAgo, scrollDown, scrollUp } from '../../utils';
|
|
33
|
+
import { EndAdornmentExpanded } from '../../features/shared/EndAdornment';
|
|
34
34
|
import Input from '../Input';
|
|
35
35
|
import Text from '../Text';
|
|
36
36
|
import './customStyle.css';
|
|
@@ -61,11 +61,12 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
|
|
|
61
61
|
var theme = _a.theme, disabled = _a.disabled;
|
|
62
62
|
return ({
|
|
63
63
|
cursor: disabled ? 'auto' : 'pointer',
|
|
64
|
-
marginInlineEnd: theme.spacing(2.5)
|
|
64
|
+
marginInlineEnd: theme.spacing(2.5),
|
|
65
|
+
display: 'flex'
|
|
65
66
|
});
|
|
66
67
|
});
|
|
67
68
|
var DatePicker = function (_a) {
|
|
68
|
-
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob"]);
|
|
69
|
+
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified"]);
|
|
69
70
|
var _b = useState(), date = _b[0], setDate = _b[1];
|
|
70
71
|
var _c = React.useState(null), anchor = _c[0], setAnchor = _c[1];
|
|
71
72
|
useEffect(function () {
|
|
@@ -86,18 +87,18 @@ var DatePicker = function (_a) {
|
|
|
86
87
|
setTimeout(function () { return scrollUp(elementId); }, 550);
|
|
87
88
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
88
89
|
};
|
|
89
|
-
var formattedDate = function (d) {
|
|
90
|
-
var date = new Date(d);
|
|
91
|
-
var formattedDate = dateFormat(date, 'YYYY-MM-DD');
|
|
92
|
-
return convertNumbers2English(formattedDate);
|
|
93
|
-
};
|
|
94
90
|
var handleOnDateChange = function (date) {
|
|
95
91
|
setDate(date);
|
|
96
|
-
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(
|
|
92
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(convertToEnglishDateFormat(date));
|
|
97
93
|
setAnchor(null);
|
|
98
94
|
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
99
95
|
};
|
|
100
|
-
|
|
96
|
+
var getEndAdornment = function () {
|
|
97
|
+
if (disabled && !isVerified)
|
|
98
|
+
return '';
|
|
99
|
+
return _jsx(EndAdornmentExpanded, { isVerified: isVerified, anchorEl: anchor });
|
|
100
|
+
};
|
|
101
|
+
return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? convertToEnglishDateFormat(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
|
|
101
102
|
if (!disabled)
|
|
102
103
|
toggleCalender(e);
|
|
103
104
|
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: !!anchor }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: rest.maxDate || defaultMax, minDate: rest.minDate || defaultMin })), _jsx(Divider, {})] }))] })));
|
|
@@ -544,7 +544,7 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
|
|
|
544
544
|
export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
|
|
545
545
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
546
546
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
547
|
-
var _b, settings, individual, _c, notification, user, entity, _d, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type,
|
|
547
|
+
var _b, settings, individual, _c, notification, user, entity, _d, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data;
|
|
548
548
|
var _e, _f, _g, _h, _j;
|
|
549
549
|
return __generator(this, function (_k) {
|
|
550
550
|
switch (_k.label) {
|
|
@@ -557,7 +557,9 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
557
557
|
data_status = (user || {}).data_status;
|
|
558
558
|
userName = getUserNameObject(name);
|
|
559
559
|
identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
|
|
560
|
-
|
|
560
|
+
isGenderNonEditable = hasNoneEditableValue(data_status, 'gender');
|
|
561
|
+
isNameENNonEditable = hasNoneEditableValue(data_status, 'name.en');
|
|
562
|
+
isNameARNonEditable = hasNoneEditableValue(data_status, 'name.ar');
|
|
561
563
|
isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
|
|
562
564
|
isMobileNumberNonEditable = hasNoneEditableValue((_e = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _e === void 0 ? void 0 : _e.phone, 'number');
|
|
563
565
|
isMobileCountryNonEditable = hasNoneEditableValue((_f = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _f === void 0 ? void 0 : _f.phone, 'country_code');
|
|
@@ -573,6 +575,7 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
573
575
|
hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
|
|
574
576
|
hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
|
|
575
577
|
hasBirth = placeOfBirthCity || placeOfBirthCountry;
|
|
578
|
+
nameIsEditable = userName.first && !(isNameENNonEditable && isNameARNonEditable);
|
|
576
579
|
contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
|
|
577
580
|
? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
|
|
578
581
|
phone: {
|
|
@@ -580,10 +583,10 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
|
|
|
580
583
|
number: isMobileNumberNonEditable || !mobile ? undefined : mobile
|
|
581
584
|
}
|
|
582
585
|
})) : undefined;
|
|
583
|
-
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender:
|
|
586
|
+
requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender: isGenderNonEditable || !gender ? undefined : gender }, (nameIsEditable && {
|
|
584
587
|
names: {
|
|
585
|
-
en: userName,
|
|
586
|
-
ar: userName
|
|
588
|
+
en: isNameENNonEditable ? undefined : userName,
|
|
589
|
+
ar: isNameARNonEditable ? undefined : userName
|
|
587
590
|
}
|
|
588
591
|
})), { contact: contact }), (hasIdentification &&
|
|
589
592
|
!(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
|
|
@@ -28,20 +28,6 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
|
|
|
28
28
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
29
29
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
30
30
|
}, 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>, {}, {}>;
|
|
31
|
-
export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
34
|
-
color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
|
|
35
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
36
|
-
htmlColor?: string | undefined;
|
|
37
|
-
inheritViewBox?: boolean | undefined;
|
|
38
|
-
shapeRendering?: string | undefined;
|
|
39
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
40
|
-
titleAccess?: string | undefined;
|
|
41
|
-
viewBox?: string | undefined;
|
|
42
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
43
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
44
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
45
31
|
interface ActivityListProps {
|
|
46
32
|
onListOpen?: () => void;
|
|
47
33
|
onListClose?: () => void;
|
|
@@ -29,13 +29,13 @@ import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
|
29
29
|
import SimpleList from '../../../../components/SimpleList';
|
|
30
30
|
import Collapse from '../../../../components/Collapse';
|
|
31
31
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
32
|
-
import CheckIcon from '@mui/icons-material/Check';
|
|
33
32
|
import Text from '../../../../components/Text';
|
|
34
|
-
import { findCurrencyByIso2, isExist, groupSectionWithSelectedActivitiesAtBeginning } from '../../../../utils';
|
|
33
|
+
import { findCurrencyByIso2, isExist, groupSectionWithSelectedActivitiesAtBeginning, hasVerifiedValue } from '../../../../utils';
|
|
35
34
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
35
|
import Search from '../../../shared/Search';
|
|
37
36
|
import Input from '../../../shared/Input';
|
|
38
37
|
import { entitySelector } from '../../../app/entity/entityStore';
|
|
38
|
+
import CheckIcon from '../../../../features/shared/CheckIcon';
|
|
39
39
|
var InputStyled = styled(Input)(function (_a) {
|
|
40
40
|
var theme = _a.theme, readOnly = _a.readOnly;
|
|
41
41
|
return ({
|
|
@@ -53,14 +53,6 @@ export var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
53
53
|
var theme = _a.theme;
|
|
54
54
|
return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
55
55
|
});
|
|
56
|
-
export var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
57
|
-
var theme = _a.theme;
|
|
58
|
-
return ({
|
|
59
|
-
color: theme.palette.success.main,
|
|
60
|
-
display: 'flex',
|
|
61
|
-
alignItems: 'flex-end'
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
56
|
var ListItem = styled(Box)(function (_a) {
|
|
65
57
|
var theme = _a.theme;
|
|
66
58
|
return ({
|
|
@@ -99,7 +91,7 @@ var ActivityList = function (_a) {
|
|
|
99
91
|
var activitiesControl = useController({ name: 'activities', control: control });
|
|
100
92
|
var data = useAppSelector(entitySelector).data;
|
|
101
93
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
102
|
-
var
|
|
94
|
+
var _f = data.verify.responseBody || {}, activityList = _f.activityList, entity = _f.entity;
|
|
103
95
|
var controlValue = activitiesControl.field.value;
|
|
104
96
|
var countryCode = settingsData.businessCountry;
|
|
105
97
|
var handleOpenMainMenu = function (event) {
|
|
@@ -121,6 +113,9 @@ var ActivityList = function (_a) {
|
|
|
121
113
|
setActivities(activityList);
|
|
122
114
|
}
|
|
123
115
|
};
|
|
116
|
+
var isActivityVerified = function (item) {
|
|
117
|
+
return hasVerifiedValue(entity === null || entity === void 0 ? void 0 : entity.data_verification, "activities.".concat(item.id));
|
|
118
|
+
};
|
|
124
119
|
var handleOpenSubMenu = function (index) {
|
|
125
120
|
if (subIndex === index)
|
|
126
121
|
setSubIndex('');
|
|
@@ -249,7 +244,7 @@ var ActivityList = function (_a) {
|
|
|
249
244
|
var _a;
|
|
250
245
|
var isDivisionNotAvailable = !section.divisions || ((_a = section.divisions) === null || _a === void 0 ? void 0 : _a.length) === 0;
|
|
251
246
|
var showCheck = section.id === getSelectedActivitySectionFlag(section) && isDivisionNotAvailable;
|
|
252
|
-
return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 20%)', borderBottom: '1px solid rgba(227, 232, 238, 1)' }, (isDivisionNotAvailable && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: section.id === getSelectedActivitySectionFlag(section), sx: __assign({}, (isDivisionNotAvailable && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(section) })), showCheck ? _jsx(
|
|
247
|
+
return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 20%)', borderBottom: '1px solid rgba(227, 232, 238, 1)' }, (isDivisionNotAvailable && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: section.id === getSelectedActivitySectionFlag(section), sx: __assign({}, (isDivisionNotAvailable && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(section) })), showCheck ? (_jsx(CheckIcon, { isVerified: isActivityVerified(section) })) : (!isDivisionNotAvailable && _jsx(ExpandIcon, { anchorEl: subIndex === section.id }))] })), _jsx(Collapse, __assign({ in: section.id === subIndex && !isDivisionNotAvailable }, { children: _jsx(DivisionListStyled, { sx: { pt: 0, pb: 0 }, list: (!isDivisionNotAvailable && section.divisions) || [], onSelectItem: function (division, e) {
|
|
253
248
|
e.stopPropagation();
|
|
254
249
|
var isOnlyOneItem = !division.activities || division.activities.length <= 1;
|
|
255
250
|
if (isOnlyOneItem)
|
|
@@ -260,11 +255,11 @@ var ActivityList = function (_a) {
|
|
|
260
255
|
var _a;
|
|
261
256
|
var isOnlyOneItem = !division.activities || ((_a = division.activities) === null || _a === void 0 ? void 0 : _a.length) <= 1;
|
|
262
257
|
var showCheck = division.id === getSelectedActivityDivisionFlag(division) && isOnlyOneItem;
|
|
263
|
-
return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 6%)', borderBottom: '1px solid rgba(227, 232, 238, 0.6)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: division.id === getSelectedActivityDivisionFlag(division), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(division) })), showCheck ? _jsx(
|
|
258
|
+
return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 6%)', borderBottom: '1px solid rgba(227, 232, 238, 0.6)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: division.id === getSelectedActivityDivisionFlag(division), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(division) })), showCheck ? (_jsx(CheckIcon, { isVerified: isActivityVerified(division) })) : (!isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subItemIndex === division.id }))] })), _jsx(Collapse, __assign({ in: division.id === subItemIndex && !isOnlyOneItem }, { children: _jsx(ActivityListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && division.activities) || [], onSelectItem: function (activity, e) {
|
|
264
259
|
e.stopPropagation();
|
|
265
260
|
onSelectItem(activity);
|
|
266
261
|
}, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (activity, idx) {
|
|
267
|
-
return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: activity.id === getSelectedActivityFlag(activity) }, { children: getSelectedActivityName(activity) })), activity.id === getSelectedActivityFlag(activity) && _jsx(
|
|
262
|
+
return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: activity.id === getSelectedActivityFlag(activity) }, { children: getSelectedActivityName(activity) })), activity.id === getSelectedActivityFlag(activity) && _jsx(CheckIcon, { isVerified: isActivityVerified(activity) })] })));
|
|
268
263
|
} }) }))] }, idx));
|
|
269
264
|
} }) }))] }));
|
|
270
265
|
} })] }))] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalPaidProps {
|
|
3
3
|
readOnly?: boolean;
|
|
4
|
+
isVerified?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalPaidProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalPaidProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -20,9 +20,10 @@ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber }
|
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
23
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
24
|
var CapitalPaid = function (_a) {
|
|
24
25
|
var _b, _c;
|
|
25
|
-
var readOnly = _a.readOnly;
|
|
26
|
+
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
26
27
|
var t = useTranslation().t;
|
|
27
28
|
var data = useAppSelector(entitySelector).data;
|
|
28
29
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
@@ -31,7 +32,6 @@ var CapitalPaid = function (_a) {
|
|
|
31
32
|
var entity = (data.verify.responseBody || {}).entity;
|
|
32
33
|
var paid = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.paid;
|
|
33
34
|
var countryCode = settingsData.businessCountry.iso2;
|
|
34
|
-
var disabled = false;
|
|
35
35
|
var handleChange = function (_a) {
|
|
36
36
|
var target = _a.target;
|
|
37
37
|
if (error)
|
|
@@ -42,9 +42,8 @@ var CapitalPaid = function (_a) {
|
|
|
42
42
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
43
43
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
44
44
|
var error = (_c = capitalPaidControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
45
|
-
|
|
46
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
|
|
45
|
+
return (_jsx(Collapse, __assign({ in: !!paid }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
|
|
47
46
|
currency: t(findCurrencyByIso2(countryCode))
|
|
48
|
-
}), onChange: handleChange,
|
|
47
|
+
}), onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })) })));
|
|
49
48
|
};
|
|
50
49
|
export default React.memo(CapitalPaid);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalShareCountProps {
|
|
3
3
|
readOnly?: boolean;
|
|
4
|
+
isVerified?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareCountProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalShareCountProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -19,17 +19,16 @@ import { removeAllCharsFromNumber } from '../../../../utils';
|
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
22
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
22
23
|
var CapitalShareCount = function (_a) {
|
|
23
24
|
var _b, _c, _d;
|
|
24
|
-
var readOnly = _a.readOnly;
|
|
25
|
+
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
27
|
var data = useAppSelector(entitySelector).data;
|
|
27
28
|
var control = useFormContext().control;
|
|
28
29
|
var dispatch = useAppDispatch();
|
|
29
30
|
var entity = (data.verify.responseBody || {}).entity;
|
|
30
31
|
var shareCount = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.count;
|
|
31
|
-
var disabled = false;
|
|
32
|
-
var hide = !shareCount && disabled;
|
|
33
32
|
var handleChange = function (_a) {
|
|
34
33
|
var target = _a.target;
|
|
35
34
|
if (error)
|
|
@@ -40,6 +39,6 @@ var CapitalShareCount = function (_a) {
|
|
|
40
39
|
var capitalShareCountControl = useController({ control: control, name: 'capitalShareCount' });
|
|
41
40
|
var capitalShareCountValue = capitalShareCountControl.field.value;
|
|
42
41
|
var error = (_d = capitalShareCountControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
43
|
-
return (_jsx(Collapse, __assign({ in:
|
|
42
|
+
return (_jsx(Collapse, __assign({ in: !!shareCount }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareCountValue, isVerified: isVerified }) }) })) })));
|
|
44
43
|
};
|
|
45
44
|
export default React.memo(CapitalShareCount);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalShareValueProps {
|
|
3
3
|
readOnly?: boolean;
|
|
4
|
+
isVerified?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareValueProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalShareValueProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -13,16 +13,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
18
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
19
|
import Collapse from '@mui/material/Collapse';
|
|
17
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
18
21
|
import Input from '../../../shared/Input';
|
|
19
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
22
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
21
|
-
import {
|
|
22
|
-
import { settingsSelector } from '../../../../app/settings';
|
|
23
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
24
|
var CapitalShareValue = function (_a) {
|
|
24
25
|
var _b, _c, _d;
|
|
25
|
-
var readOnly = _a.readOnly;
|
|
26
|
+
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
26
27
|
var t = useTranslation().t;
|
|
27
28
|
var data = useAppSelector(entitySelector).data;
|
|
28
29
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
@@ -31,8 +32,6 @@ var CapitalShareValue = function (_a) {
|
|
|
31
32
|
var entity = (data.verify.responseBody || {}).entity;
|
|
32
33
|
var shareValue = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.value;
|
|
33
34
|
var countryCode = settingsData.businessCountry.iso2;
|
|
34
|
-
var disabled = false;
|
|
35
|
-
var hide = !shareValue && disabled;
|
|
36
35
|
var handleChange = function (_a) {
|
|
37
36
|
var target = _a.target;
|
|
38
37
|
if (error)
|
|
@@ -43,8 +42,8 @@ var CapitalShareValue = function (_a) {
|
|
|
43
42
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
44
43
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
45
44
|
var error = (_d = capitalShareValueControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
46
|
-
return (_jsx(Collapse, __assign({ in:
|
|
45
|
+
return (_jsx(Collapse, __assign({ in: !!shareValue }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
|
|
47
46
|
currency: t(findCurrencyByIso2(countryCode))
|
|
48
|
-
}), onChange: handleChange,
|
|
47
|
+
}), onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })) })));
|
|
49
48
|
};
|
|
50
49
|
export default React.memo(CapitalShareValue);
|
|
@@ -15,7 +15,8 @@ import { FormProvider, useForm } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import Collapse from '@mui/material/Collapse';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
19
20
|
import { clearError, entitySelector, updateEntityCapital } from '../../../app/entity/entityStore';
|
|
20
21
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
22
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
@@ -32,13 +33,15 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
32
33
|
flexDirection: 'column'
|
|
33
34
|
}); });
|
|
34
35
|
var EntityCapital = function (_a) {
|
|
35
|
-
var _b
|
|
36
|
-
var
|
|
36
|
+
var _b, _c, _d, _e, _f;
|
|
37
|
+
var _g = React.useState(false), anchorEl = _g[0], setAnchorEl = _g[1];
|
|
38
|
+
var _h = useAppSelector(entitySelector), data = _h.data, loading = _h.loading, error = _h.error, uploading = _h.uploading;
|
|
37
39
|
var isAr = useLanguage().isAr;
|
|
38
40
|
var t = useTranslation().t;
|
|
39
41
|
var dispatch = useAppDispatch();
|
|
40
|
-
var
|
|
42
|
+
var _j = data.entityCapitalData, responseBody = _j.responseBody, capitalPaid = _j.capitalPaid, capitalShareCount = _j.capitalShareCount, capitalShareValue = _j.capitalShareValue, activities = _j.activities;
|
|
41
43
|
var entity = (data.verify.responseBody || {}).entity;
|
|
44
|
+
var _k = entity || {}, data_verification = _k.data_verification, capital = _k.capital;
|
|
42
45
|
var methods = useForm({
|
|
43
46
|
resolver: yupResolver(EntityCapitalValidationSchema()),
|
|
44
47
|
defaultValues: {
|
|
@@ -50,6 +53,7 @@ var EntityCapital = function (_a) {
|
|
|
50
53
|
mode: 'onChange'
|
|
51
54
|
});
|
|
52
55
|
useSetFromDefaultValues(methods, data.entityCapitalData, true);
|
|
56
|
+
var watch = methods.watch;
|
|
53
57
|
var originalReadOnly = useFormReadOnly(methods);
|
|
54
58
|
var noneEditable = useDataNoneEditable(entity === null || entity === void 0 ? void 0 : entity.data_status, [
|
|
55
59
|
'activities',
|
|
@@ -59,6 +63,10 @@ var EntityCapital = function (_a) {
|
|
|
59
63
|
]);
|
|
60
64
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
61
65
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
66
|
+
var dataVerified = useDataVerified(data_verification, ['capital.paid', 'capital.shares.count', 'capital.shares.value']);
|
|
67
|
+
var isCapitalPaidVerified = dataVerified['capital.paid'] && ((_b = capital === null || capital === void 0 ? void 0 : capital.paid) === null || _b === void 0 ? void 0 : _b.toString()) === removeAllCharsFromNumber(watch('capitalPaid'));
|
|
68
|
+
var isCapitalShareCountVerified = dataVerified['capital.shares.count'] && ((_d = (_c = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _c === void 0 ? void 0 : _c.count) === null || _d === void 0 ? void 0 : _d.toString()) === watch('capitalShareCount');
|
|
69
|
+
var isCapitalShareValueVerified = dataVerified['capital.shares.value'] && ((_f = (_e = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.toString()) === removeAllCharsFromNumber(watch('capitalShareValue'));
|
|
62
70
|
var onSubmit = function (data) {
|
|
63
71
|
dispatch(updateEntityCapital(getFelids(data)));
|
|
64
72
|
};
|
|
@@ -73,6 +81,6 @@ var EntityCapital = function (_a) {
|
|
|
73
81
|
setAnchorEl(flag);
|
|
74
82
|
};
|
|
75
83
|
var disabled = !methods.formState.isValid || !!error || uploading;
|
|
76
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'] }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'] }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
84
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'], isVerified: isCapitalPaidVerified }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'], isVerified: isCapitalShareCountVerified }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'], isVerified: isCapitalShareValueVerified }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
77
85
|
};
|
|
78
86
|
export default EntityCapital;
|
|
@@ -4,6 +4,7 @@ declare type ArticleProps = {
|
|
|
4
4
|
show: boolean;
|
|
5
5
|
readOnly?: boolean;
|
|
6
6
|
defaultFile?: FileDetails;
|
|
7
|
+
isVerified?: boolean;
|
|
7
8
|
};
|
|
8
|
-
declare const Article: ({ show, readOnly, defaultFile }: ArticleProps) => JSX.Element;
|
|
9
|
+
declare const Article: ({ show, readOnly, defaultFile, isVerified }: ArticleProps) => JSX.Element;
|
|
9
10
|
export default Article;
|
|
@@ -28,13 +28,14 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
28
28
|
});
|
|
29
29
|
var Article = function (_a) {
|
|
30
30
|
var _b;
|
|
31
|
-
var show = _a.show, readOnly = _a.readOnly, defaultFile = _a.defaultFile;
|
|
31
|
+
var show = _a.show, readOnly = _a.readOnly, defaultFile = _a.defaultFile, isVerified = _a.isVerified;
|
|
32
32
|
var t = useTranslation().t;
|
|
33
33
|
var control = useFormContext().control;
|
|
34
34
|
var articleIdControl = useController({ name: 'articleId', control: control });
|
|
35
35
|
var dispatch = useAppDispatch();
|
|
36
36
|
var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error, loading = _c.loading;
|
|
37
37
|
var AOA_file = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).AOA_file;
|
|
38
|
+
var id = articleIdControl.field.value;
|
|
38
39
|
var handleArticleChange = function (id) {
|
|
39
40
|
if (error)
|
|
40
41
|
dispatch(clearError());
|
|
@@ -47,6 +48,6 @@ var Article = function (_a) {
|
|
|
47
48
|
dispatch(clearAOAFile());
|
|
48
49
|
articleIdControl.field.onChange(undefined);
|
|
49
50
|
};
|
|
50
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { readOnly: readOnly, id: 'articleId', fileRemoveType: FileRemoveType.AOA_FILE_ID, control: control, label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.ARTICLE_ASSOCIATION, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
|
|
51
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { readOnly: readOnly, id: 'articleId', fileRemoveType: FileRemoveType.AOA_FILE_ID, control: control, label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.ARTICLE_ASSOCIATION, isVerified: isVerified && !id, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
|
|
51
52
|
};
|
|
52
53
|
export default Article;
|