@tap-payments/auth-jsconnect 2.3.26-test → 2.3.27-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/brand/brandStore.d.ts +5 -2
- package/build/features/app/brand/brandStore.js +12 -3
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -4
- 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/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 +3 -1
- 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/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 +3 -0
- package/build/features/brand/screens/BrandInfo/validation.js +1 -0
- 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 +3 -1
- 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 +6 -3
- 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/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +5 -2
- 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/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 +4 -2
- 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/hooks/index.d.ts +2 -0
- package/build/hooks/index.js +2 -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/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +38 -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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
4
|
+
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
4
5
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
6
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
7
|
salesChannels: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -14,6 +15,7 @@ export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/l
|
|
|
14
15
|
}>>[] | undefined>;
|
|
15
16
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
17
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
|
+
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
19
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
18
20
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
19
21
|
salesChannels: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -27,6 +29,7 @@ export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/l
|
|
|
27
29
|
}>>[] | undefined>;
|
|
28
30
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
29
31
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
32
|
+
brandLogoId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
33
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
31
34
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
32
35
|
salesChannels: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined> | import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -87,6 +87,7 @@ export var BrandValidationSchema = function () {
|
|
|
87
87
|
}
|
|
88
88
|
})
|
|
89
89
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
90
|
+
brandLogoId: yup.string().optional(),
|
|
90
91
|
segment: yup.object().required('alert_choose_segment'),
|
|
91
92
|
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
92
93
|
salesChannels: isSalesChannelsOptional
|
|
@@ -85,6 +85,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
|
|
|
85
85
|
export interface ActivitiesListProps {
|
|
86
86
|
onListOpen?: () => void;
|
|
87
87
|
onListClose?: () => void;
|
|
88
|
+
readOnly?: boolean;
|
|
88
89
|
}
|
|
89
|
-
declare const ActivitiesList: (
|
|
90
|
+
declare const ActivitiesList: (props: ActivitiesListProps) => JSX.Element;
|
|
90
91
|
export default ActivitiesList;
|
|
@@ -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
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
13
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
14
|
if (ar || !(i in from)) {
|
|
@@ -101,22 +90,21 @@ export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { r
|
|
|
101
90
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
102
91
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
103
92
|
});
|
|
104
|
-
var ActivitiesList = function (
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
var _c = React.useState(
|
|
108
|
-
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
93
|
+
var ActivitiesList = function (props) {
|
|
94
|
+
var _a;
|
|
95
|
+
var _b = React.useState([]), activitiesMenuList = _b[0], setActivitiesMenuList = _b[1];
|
|
96
|
+
var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
109
97
|
var t = useTranslation().t;
|
|
110
98
|
var isAr = useLanguage().isAr;
|
|
111
99
|
var control = useFormContext().control;
|
|
112
100
|
var dispatch = useAppDispatch();
|
|
113
|
-
var
|
|
101
|
+
var _d = useAppSelector(entitySelector), data = _d.data, error = _d.error;
|
|
114
102
|
var activitiesControl = useController({ name: 'activities', control: control });
|
|
115
103
|
var controlValue = activitiesControl.field.value;
|
|
116
|
-
var
|
|
104
|
+
var _e = React.useState(false), isHovered = _e[0], setIsHovered = _e[1];
|
|
117
105
|
var verify = data.verify;
|
|
118
|
-
var
|
|
119
|
-
var licenseType = (
|
|
106
|
+
var _f = verify.responseBody || {}, activityList = _f.activityList, entity = _f.entity;
|
|
107
|
+
var licenseType = (_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.type;
|
|
120
108
|
var type = licenseType === 'freelance' ? BusinessType.FL : BusinessType.CR;
|
|
121
109
|
var isCR = type === BusinessType.CR;
|
|
122
110
|
var disabled = false;
|
|
@@ -130,18 +118,20 @@ var ActivitiesList = function (_a) {
|
|
|
130
118
|
}, [activityList]);
|
|
131
119
|
var onOpenList = function (event) {
|
|
132
120
|
var _a, _b;
|
|
121
|
+
if (props.readOnly)
|
|
122
|
+
return;
|
|
133
123
|
if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > ((_a = entity === null || entity === void 0 ? void 0 : entity.activities) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
134
124
|
var list = __spreadArray([], activitiesMenuList, true);
|
|
135
125
|
var mapSelectedListFirst = __spreadArray(__spreadArray([], list.filter(function (a) { return (controlValue || []).some(function (c) { return a.id === c.id; }); }), true), list.filter(function (a) { return !(controlValue || []).some(function (c) { return a.id === c.id; }); }), true);
|
|
136
126
|
setActivitiesMenuList(mapSelectedListFirst);
|
|
137
127
|
}
|
|
138
128
|
setAnchorEl(event.currentTarget);
|
|
139
|
-
(_b =
|
|
129
|
+
(_b = props.onListOpen) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
140
130
|
};
|
|
141
131
|
var onCloseList = function () {
|
|
142
132
|
var _a;
|
|
143
133
|
setAnchorEl(null);
|
|
144
|
-
(_a =
|
|
134
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
145
135
|
};
|
|
146
136
|
var onSelectItem = function (item) {
|
|
147
137
|
var _a;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalPaidProps {
|
|
3
|
+
readOnly?: boolean;
|
|
3
4
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: CapitalPaidProps) => JSX.Element>;
|
|
5
|
+
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalPaidProps) => JSX.Element>;
|
|
5
6
|
export default _default;
|
|
@@ -22,6 +22,7 @@ import Input from '../../../shared/Input';
|
|
|
22
22
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
23
23
|
var CapitalPaid = function (_a) {
|
|
24
24
|
var _b, _c;
|
|
25
|
+
var readOnly = _a.readOnly;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
27
|
var data = useAppSelector(entitySelector).data;
|
|
27
28
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
@@ -42,7 +43,7 @@ var CapitalPaid = function (_a) {
|
|
|
42
43
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
43
44
|
var error = (_c = capitalPaidControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
44
45
|
var hide = !paid && disabled;
|
|
45
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('capital_paid_label', {
|
|
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', {
|
|
46
47
|
currency: t(findCurrencyByIso2(countryCode))
|
|
47
48
|
}), onChange: handleChange, disabled: disabled, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
48
49
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalShareCountProps {
|
|
3
|
+
readOnly?: boolean;
|
|
3
4
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: CapitalShareCountProps) => JSX.Element>;
|
|
5
|
+
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareCountProps) => JSX.Element>;
|
|
5
6
|
export default _default;
|
|
@@ -21,6 +21,7 @@ import Input from '../../../shared/Input';
|
|
|
21
21
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
22
22
|
var CapitalShareCount = function (_a) {
|
|
23
23
|
var _b, _c, _d;
|
|
24
|
+
var readOnly = _a.readOnly;
|
|
24
25
|
var t = useTranslation().t;
|
|
25
26
|
var data = useAppSelector(entitySelector).data;
|
|
26
27
|
var control = useFormContext().control;
|
|
@@ -39,6 +40,6 @@ var CapitalShareCount = function (_a) {
|
|
|
39
40
|
var capitalShareCountControl = useController({ control: control, name: 'capitalShareCount' });
|
|
40
41
|
var capitalShareCountValue = capitalShareCountControl.field.value;
|
|
41
42
|
var error = (_d = capitalShareCountControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
42
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('capital_share_count_label'), onChange: handleChange, disabled: disabled, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, disabled: disabled, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
43
44
|
};
|
|
44
45
|
export default React.memo(CapitalShareCount);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface CapitalShareValueProps {
|
|
3
|
+
readOnly?: boolean;
|
|
3
4
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: CapitalShareValueProps) => JSX.Element>;
|
|
5
|
+
declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareValueProps) => JSX.Element>;
|
|
5
6
|
export default _default;
|
|
@@ -22,6 +22,7 @@ import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils'
|
|
|
22
22
|
import { settingsSelector } from '../../../../app/settings';
|
|
23
23
|
var CapitalShareValue = function (_a) {
|
|
24
24
|
var _b, _c, _d;
|
|
25
|
+
var readOnly = _a.readOnly;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
27
|
var data = useAppSelector(entitySelector).data;
|
|
27
28
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
@@ -42,7 +43,7 @@ var CapitalShareValue = function (_a) {
|
|
|
42
43
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
43
44
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
44
45
|
var error = (_d = capitalShareValueControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
45
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('capital_share_value_label', {
|
|
46
|
+
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
|
|
46
47
|
currency: t(findCurrencyByIso2(countryCode))
|
|
47
48
|
}), onChange: handleChange, disabled: disabled, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
48
49
|
};
|
|
@@ -27,6 +27,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
27
27
|
import { styled } from '@mui/material/styles';
|
|
28
28
|
import Collapse from '@mui/material/Collapse';
|
|
29
29
|
import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues } from '../../../../hooks';
|
|
30
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
30
31
|
import { clearError, entitySelector, updateEntityCapital } from '../../../app/entity/entityStore';
|
|
31
32
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
32
33
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
@@ -44,6 +45,7 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
44
45
|
}); });
|
|
45
46
|
var EntityCapital = function (_a) {
|
|
46
47
|
var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
48
|
+
var settingData = useAppSelector(settingsSelector).data;
|
|
47
49
|
var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error, uploading = _c.uploading;
|
|
48
50
|
var isAr = useLanguage().isAr;
|
|
49
51
|
var t = useTranslation().t;
|
|
@@ -70,6 +72,6 @@ var EntityCapital = function (_a) {
|
|
|
70
72
|
setAnchorEl(flag);
|
|
71
73
|
};
|
|
72
74
|
var disabled = !methods.formState.isValid || !!error || uploading;
|
|
73
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, {}), _jsx(CapitalShareCount, {}), _jsx(CapitalShareValue, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
75
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: !settingData.boardMaturity && defaultValues.activities.length > 0, onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: !settingData.boardMaturity && !!defaultValues.capitalPaid }), _jsx(CapitalShareCount, { readOnly: !settingData.boardMaturity && !!defaultValues.capitalShareCount }), _jsx(CapitalShareValue, { readOnly: !settingData.boardMaturity && !!defaultValues.capitalShareValue }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
74
76
|
};
|
|
75
77
|
export default EntityCapital;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { FileDetails } from '../../../../@types';
|
|
2
3
|
declare type ArticleProps = {
|
|
3
4
|
show: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
defaultFile?: FileDetails;
|
|
4
7
|
};
|
|
5
|
-
declare const Article: ({ show }: ArticleProps) => JSX.Element;
|
|
8
|
+
declare const Article: ({ show, readOnly, defaultFile }: ArticleProps) => JSX.Element;
|
|
6
9
|
export default Article;
|
|
@@ -28,14 +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;
|
|
31
|
+
var show = _a.show, readOnly = _a.readOnly, defaultFile = _a.defaultFile;
|
|
32
32
|
var t = useTranslation().t;
|
|
33
33
|
var control = useFormContext().control;
|
|
34
34
|
var articleIdControl = useController({ name: 'articleId', control: control });
|
|
35
35
|
var loading = useAppSelector(entitySelector).loading;
|
|
36
36
|
var dispatch = useAppDispatch();
|
|
37
37
|
var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
|
|
38
|
-
var
|
|
38
|
+
var AOA_file = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).AOA_file;
|
|
39
39
|
var handleArticleChange = function (id) {
|
|
40
40
|
if (error)
|
|
41
41
|
dispatch(clearError());
|
|
@@ -48,7 +48,6 @@ var Article = function (_a) {
|
|
|
48
48
|
dispatch(clearAOAFile());
|
|
49
49
|
articleIdControl.field.onChange(undefined);
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { 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, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
|
|
53
52
|
};
|
|
54
53
|
export default Article;
|
|
@@ -17,8 +17,8 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues } from '../../../../hooks';
|
|
19
19
|
import { settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { isKW, isSA } from '../../../../utils';
|
|
21
|
-
import { BusinessType } from '../../../../@types';
|
|
20
|
+
import { getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
|
|
21
|
+
import { BusinessType, DocumentPurpose } from '../../../../@types';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Collapse from '../../../../components/Collapse';
|
|
24
24
|
import { clearError, entitySelector, updateEntityName } from '../../../app/entity/entityStore';
|
|
@@ -68,6 +68,8 @@ var EntityName = function (_a) {
|
|
|
68
68
|
mode: 'onChange'
|
|
69
69
|
});
|
|
70
70
|
useSetFromDefaultValues(methods, data.entityNameData, true);
|
|
71
|
+
var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(entity === null || entity === void 0 ? void 0 : entity.documents, DocumentPurpose.CR); }, [entity === null || entity === void 0 ? void 0 : entity.documents]);
|
|
72
|
+
var defaultArticleFile = React.useMemo(function () { return (entity === null || entity === void 0 ? void 0 : entity.AOA_file) && __assign(__assign({}, entity === null || entity === void 0 ? void 0 : entity.AOA_file), { docId: entity.id }); }, [entity === null || entity === void 0 ? void 0 : entity.AOA_file]);
|
|
71
73
|
var onSubmit = function (data) {
|
|
72
74
|
dispatch(updateEntityName(data));
|
|
73
75
|
};
|
|
@@ -87,6 +89,7 @@ var EntityName = function (_a) {
|
|
|
87
89
|
var disabled = !methods.formState.isValid || !!error || uploading || uploadingArticle;
|
|
88
90
|
var showLicenseNumber = !isSACountry ? isCR : true;
|
|
89
91
|
var showUnifiedNumber = isSACountry ? isCR : false;
|
|
90
|
-
|
|
92
|
+
console.log('!settingsData.boardMaturity && !!certificateId?.length}', !settingsData.boardMaturity, !!(certificateId === null || certificateId === void 0 ? void 0 : certificateId.length), certificateId);
|
|
93
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: !settingsData.boardMaturity && !!legalName }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: !settingsData.boardMaturity && entityType.length > 0, onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); } }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseNumber, { show: showLicenseNumber, readOnly: !settingsData.boardMaturity && !!licenseNumber }), _jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: !settingsData.boardMaturity && !!unifiedNumber })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: !settingsData.boardMaturity && !!issuingDate }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: !settingsData.boardMaturity && !!expiryDate }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: !(isKWCountry && !isCR), readOnly: !settingsData.boardMaturity && !!(defaultCertificateFiles === null || defaultCertificateFiles === void 0 ? void 0 : defaultCertificateFiles.length) }), _jsx(Article, { defaultFile: defaultArticleFile, show: true, readOnly: !settingsData.boardMaturity && !!defaultArticleFile })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
91
94
|
};
|
|
92
95
|
export default EntityName;
|
|
@@ -85,6 +85,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
|
|
|
85
85
|
export interface EntityTypeListProps {
|
|
86
86
|
onListOpen?: () => void;
|
|
87
87
|
onListClose?: () => void;
|
|
88
|
+
readOnly?: boolean;
|
|
88
89
|
}
|
|
89
|
-
declare const EntityTypeList: (
|
|
90
|
+
declare const EntityTypeList: (props: EntityTypeListProps) => JSX.Element;
|
|
90
91
|
export default EntityTypeList;
|
|
@@ -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 { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import { useTranslation } from 'react-i18next';
|
|
@@ -92,18 +81,17 @@ export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { r
|
|
|
92
81
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
93
82
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
94
83
|
});
|
|
95
|
-
var EntityTypeList = function (
|
|
96
|
-
var rest = __rest(_a, []);
|
|
84
|
+
var EntityTypeList = function (props) {
|
|
97
85
|
var theme = useTheme();
|
|
98
|
-
var
|
|
99
|
-
var
|
|
86
|
+
var _a = React.useState([]), entityTypesMenuList = _a[0], setEntityTypesMenuList = _a[1];
|
|
87
|
+
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
100
88
|
var t = useTranslation().t;
|
|
101
89
|
var control = useFormContext().control;
|
|
102
|
-
var
|
|
90
|
+
var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
|
|
103
91
|
var entityTypesControl = useController({ name: 'entityType', control: control });
|
|
104
92
|
var controlValue = entityTypesControl.field.value || '';
|
|
105
93
|
var dispatch = useAppDispatch();
|
|
106
|
-
var
|
|
94
|
+
var _d = data.verify.responseBody || {}, entityTypes = _d.entityTypes, entity = _d.entity;
|
|
107
95
|
var type = entity === null || entity === void 0 ? void 0 : entity.type;
|
|
108
96
|
var disabled = false;
|
|
109
97
|
var isListAvailable = (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes.length) > 0;
|
|
@@ -117,13 +105,15 @@ var EntityTypeList = function (_a) {
|
|
|
117
105
|
}, [entityTypes]);
|
|
118
106
|
var onOpenList = function (event) {
|
|
119
107
|
var _a;
|
|
108
|
+
if (props.readOnly)
|
|
109
|
+
return;
|
|
120
110
|
setAnchorEl(event.currentTarget);
|
|
121
|
-
(_a =
|
|
111
|
+
(_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
122
112
|
};
|
|
123
113
|
var onCloseList = function () {
|
|
124
114
|
var _a;
|
|
125
115
|
setAnchorEl(null);
|
|
126
|
-
(_a =
|
|
116
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
127
117
|
};
|
|
128
118
|
var onSelectItem = function (item) {
|
|
129
119
|
if (error)
|
|
@@ -14,6 +14,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
|
|
|
14
14
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
15
15
|
export interface ExpiryDateProps {
|
|
16
16
|
onDateClicked?: (flag: boolean) => void;
|
|
17
|
+
readOnly?: boolean;
|
|
17
18
|
}
|
|
18
|
-
declare const ExpiryDate: ({ onDateClicked }: ExpiryDateProps) => JSX.Element;
|
|
19
|
+
declare const ExpiryDate: ({ onDateClicked, readOnly }: ExpiryDateProps) => JSX.Element;
|
|
19
20
|
export default ExpiryDate;
|
|
@@ -25,7 +25,7 @@ export var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
25
25
|
});
|
|
26
26
|
var ExpiryDate = function (_a) {
|
|
27
27
|
var _b, _c;
|
|
28
|
-
var onDateClicked = _a.onDateClicked;
|
|
28
|
+
var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly;
|
|
29
29
|
var t = useTranslation().t;
|
|
30
30
|
var dispatch = useAppDispatch();
|
|
31
31
|
var control = useFormContext().control;
|
|
@@ -41,6 +41,6 @@ var ExpiryDate = function (_a) {
|
|
|
41
41
|
dispatch(clearError());
|
|
42
42
|
oDateControl.field.onChange(data);
|
|
43
43
|
};
|
|
44
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('business_expiry_date') }), _jsx(DatePicker, { readOnly: true, disabled: disabled, maxDate: getFutureDate(), 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: handleExpiryDateChange })] })) })));
|
|
44
|
+
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('business_expiry_date') }), _jsx(DatePicker, { readOnly: true, disabled: disabled || readOnly, maxDate: getFutureDate(), 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: handleExpiryDateChange })] })) })));
|
|
45
45
|
};
|
|
46
46
|
export default ExpiryDate;
|
|
@@ -14,6 +14,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
|
|
|
14
14
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
15
15
|
export interface IssuingDateProps {
|
|
16
16
|
onDateClicked?: (flag: boolean) => void;
|
|
17
|
+
readOnly?: boolean;
|
|
17
18
|
}
|
|
18
|
-
declare const IssuingDate: ({ onDateClicked }: IssuingDateProps) => JSX.Element;
|
|
19
|
+
declare const IssuingDate: ({ onDateClicked, readOnly }: IssuingDateProps) => JSX.Element;
|
|
19
20
|
export default IssuingDate;
|
|
@@ -24,7 +24,7 @@ export var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
24
24
|
});
|
|
25
25
|
var IssuingDate = function (_a) {
|
|
26
26
|
var _b, _c;
|
|
27
|
-
var onDateClicked = _a.onDateClicked;
|
|
27
|
+
var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly;
|
|
28
28
|
var t = useTranslation().t;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var control = useFormContext().control;
|
|
@@ -40,6 +40,6 @@ var IssuingDate = function (_a) {
|
|
|
40
40
|
dispatch(clearError());
|
|
41
41
|
oDateControl.field.onChange(data);
|
|
42
42
|
};
|
|
43
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('issue_date') }), _jsx(DatePicker, { readOnly: true, disabled: disabled, 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: handleIssuingDateChange })] })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('issue_date') }), _jsx(DatePicker, { readOnly: true, disabled: 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: handleIssuingDateChange })] })) })));
|
|
44
44
|
};
|
|
45
45
|
export default IssuingDate;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface LegalNameProps {
|
|
3
|
+
readOnly?: boolean;
|
|
3
4
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: LegalNameProps) => JSX.Element>;
|
|
5
|
+
declare const _default: React.MemoExoticComponent<({ readOnly }: LegalNameProps) => JSX.Element>;
|
|
5
6
|
export default _default;
|
|
@@ -20,6 +20,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
20
20
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
var LegalName = function (_a) {
|
|
23
|
+
var readOnly = _a.readOnly;
|
|
23
24
|
var t = useTranslation().t;
|
|
24
25
|
var isAr = useLanguage();
|
|
25
26
|
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
@@ -44,6 +45,6 @@ var LegalName = function (_a) {
|
|
|
44
45
|
var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
|
|
45
46
|
legalNameControl.field.onChange(value);
|
|
46
47
|
};
|
|
47
|
-
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { disabled: disabled, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }) })));
|
|
48
|
+
return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, disabled: disabled, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }) })));
|
|
48
49
|
};
|
|
49
50
|
export default React.memo(LegalName);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { FileDetails } from '../../../../@types';
|
|
2
3
|
interface LicenseCertificateProps {
|
|
3
4
|
show: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
defaultFiles?: Array<FileDetails>;
|
|
4
7
|
}
|
|
5
|
-
declare const LicenseCertificate: ({ show }: LicenseCertificateProps) => JSX.Element;
|
|
8
|
+
declare const LicenseCertificate: ({ show, readOnly, defaultFiles }: LicenseCertificateProps) => JSX.Element;
|
|
6
9
|
export default LicenseCertificate;
|
|
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import React from 'react';
|
|
14
13
|
import { useTranslation } from 'react-i18next';
|
|
15
14
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
15
|
import { styled } from '@mui/material/styles';
|
|
@@ -18,7 +17,6 @@ import Collapse from '../../../../components/Collapse';
|
|
|
18
17
|
import { DocumentPurpose } from '../../../../@types';
|
|
19
18
|
import { FileType } from '../../../../constants';
|
|
20
19
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { getFileDetailsFromDocument } from '../../../../utils';
|
|
22
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
21
|
import { clearError, entitySelector, uploadingStatus } from '../../../app/entity/entityStore';
|
|
24
22
|
import UploadMultipleFile from '../../../shared/UploadMultipleFile';
|
|
@@ -29,14 +27,12 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
29
27
|
});
|
|
30
28
|
});
|
|
31
29
|
var LicenseCertificate = 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 dispatch = useAppDispatch();
|
|
37
34
|
var certificateIdControl = useController({ name: 'certificateId', control: control });
|
|
38
|
-
var
|
|
39
|
-
var documents = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).documents;
|
|
35
|
+
var _b = useAppSelector(entitySelector), loading = _b.loading, error = _b.error;
|
|
40
36
|
var handleLicenseCertificateChange = function (ids) {
|
|
41
37
|
if (error)
|
|
42
38
|
dispatch(clearError());
|
|
@@ -47,7 +43,6 @@ var LicenseCertificate = function (_a) {
|
|
|
47
43
|
dispatch(clearError());
|
|
48
44
|
certificateIdControl.field.onChange(ids);
|
|
49
45
|
};
|
|
50
|
-
|
|
51
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { id: 'certificateId', control: control, label: t('title_license_certificate'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleLicenseCertificateChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CR, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
|
|
46
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'certificateId', control: control, label: t('title_license_certificate'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleLicenseCertificateChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CR, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
|
|
52
47
|
};
|
|
53
48
|
export default LicenseCertificate;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface LicenseNumberProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: LicenseNumberProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: LicenseNumberProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -24,7 +24,7 @@ import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
25
|
var LicenseNumber = function (_a) {
|
|
26
26
|
var _b, _c;
|
|
27
|
-
var show = _a.show;
|
|
27
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
28
28
|
var t = useTranslation().t;
|
|
29
29
|
var _d = useAppSelector(entitySelector), data = _d.data, bckError = _d.error;
|
|
30
30
|
var dispatch = useAppDispatch();
|
|
@@ -49,6 +49,6 @@ var LicenseNumber = function (_a) {
|
|
|
49
49
|
var isCR = type === BusinessType.CR;
|
|
50
50
|
var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_LENGTH : FL_NUMBER_ENTITY_LENGTH;
|
|
51
51
|
var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH : length;
|
|
52
|
-
return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
|
|
52
|
+
return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
|
|
53
53
|
};
|
|
54
54
|
export default React.memo(LicenseNumber);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface UnifiedNumberProps {
|
|
3
3
|
show: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ show }: UnifiedNumberProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ show, readOnly }: UnifiedNumberProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -21,7 +21,7 @@ import Input from '../../../shared/Input';
|
|
|
21
21
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
22
22
|
var UnifiedNumber = function (_a) {
|
|
23
23
|
var _b, _c, _d;
|
|
24
|
-
var show = _a.show;
|
|
24
|
+
var show = _a.show, readOnly = _a.readOnly;
|
|
25
25
|
var t = useTranslation().t;
|
|
26
26
|
var _e = useAppSelector(entitySelector), data = _e.data, bckError = _e.error;
|
|
27
27
|
var control = useFormContext().control;
|
|
@@ -40,6 +40,6 @@ var UnifiedNumber = function (_a) {
|
|
|
40
40
|
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
41
41
|
var unifiedNumberValue = unifiedNumberControl.field.value;
|
|
42
42
|
var error = (_d = unifiedNumberControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
43
|
-
return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('unified_number_label'), onChange: handleChange, disabled: disabled, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('unified_number_label'), onChange: handleChange, disabled: disabled, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
|
|
44
44
|
};
|
|
45
45
|
export default React.memo(UnifiedNumber);
|