@tap-payments/auth-jsconnect 2.3.26-test → 2.3.28-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +12 -1
- package/build/@types/app.js +1 -0
- package/build/@types/form.d.ts +2 -1
- package/build/api/entity.d.ts +5 -5
- package/build/app/settings.d.ts +3 -1
- package/build/app/settings.js +5 -1
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/constants/app.d.ts +2 -1
- package/build/constants/app.js +1 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.js +26 -30
- package/build/features/app/brand/brandStore.d.ts +5 -2
- package/build/features/app/brand/brandStore.js +49 -39
- package/build/features/app/entity/entityStore.js +58 -68
- package/build/features/app/individual/individualStore.js +59 -65
- package/build/features/app/tax/taxStore.js +23 -22
- package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
- package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankName.js +8 -7
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -3
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +2 -2
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +16 -21
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -1
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +11 -6
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +4 -3
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +12 -9
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +10 -7
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +9 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +7 -4
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +3 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +7 -4
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +10 -19
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -9
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
- package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.js +3 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +3 -1
- package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
- package/build/features/brand/screens/BrandInfo/validation.js +31 -37
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/ActivityList.js +12 -22
- package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -1
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +4 -2
- package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
- package/build/features/entity/screens/EntityCapital/validation.js +4 -10
- package/build/features/entity/screens/EntityName/Article.d.ts +4 -1
- package/build/features/entity/screens/EntityName/Article.js +3 -4
- package/build/features/entity/screens/EntityName/EntityName.js +7 -4
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -1
- package/build/features/entity/screens/EntityName/EntityTypeList.js +9 -19
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
- package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LegalName.js +2 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +3 -8
- package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
- package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
- package/build/features/entity/screens/EntityName/validation.js +68 -93
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +6 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +6 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -22
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +12 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
- package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +3 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +4 -6
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +4 -6
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +3 -3
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +3 -3
- package/build/features/shared/UploadFile/FileUpload.d.ts +3 -1
- package/build/features/shared/UploadFile/FileUpload.js +14 -10
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +3 -1
- package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.js +9 -5
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -3
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -3
- package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
- package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +2 -5
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useDataNoneEditable.d.ts +2 -0
- package/build/hooks/useDataNoneEditable.js +19 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
- package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
- package/build/hooks/useFormReadOnly.d.ts +6 -0
- package/build/hooks/useFormReadOnly.js +40 -0
- package/build/utils/string.js +7 -8
- package/package.json +1 -1
- package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
- package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { styled } from '@mui/material/styles';
|
|
4
3
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
5
4
|
import { useTranslation } from 'react-i18next';
|
|
6
5
|
import { useController, useFormContext } from 'react-hook-form';
|
|
7
6
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
8
7
|
import { DocumentPurpose } from '../../../../@types';
|
|
9
|
-
import { getFileDetailsFromDocument } from '../../../../utils';
|
|
10
8
|
import { FileType } from '../../../../constants';
|
|
11
9
|
import { bankSelector, bankStatementUploadingStatus } from '../../../app/bank/bankStore';
|
|
12
10
|
import UploadMultipleFile from '../../../shared/UploadMultipleFile';
|
|
@@ -17,21 +15,18 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
17
|
var BankStatement = function (_a) {
|
|
20
|
-
var
|
|
21
|
-
var required = _a.required;
|
|
18
|
+
var required = _a.required, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
|
|
22
19
|
var t = useTranslation().t;
|
|
23
20
|
var control = useFormContext().control;
|
|
24
21
|
var bankStatementIdControl = useController({ name: 'bankStatementId', control: control });
|
|
25
|
-
var
|
|
22
|
+
var loading = useAppSelector(bankSelector).loading;
|
|
26
23
|
var dispatch = useAppDispatch();
|
|
27
|
-
var document = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.bank_account) || {}).document;
|
|
28
24
|
var handleBankStatementChange = function (ids) {
|
|
29
25
|
bankStatementIdControl.field.onChange(ids);
|
|
30
26
|
};
|
|
31
27
|
var handleReset = function (ids) {
|
|
32
28
|
bankStatementIdControl.field.onChange(ids);
|
|
33
29
|
};
|
|
34
|
-
|
|
35
|
-
return (_jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { id: 'bankStatementId', control: control, label: t('title_bank_statement'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleBankStatementChange, isSubmitting: loading, required: required, onDeleteFile: handleReset, purpose: DocumentPurpose.BANK_STATEMENT, defaultFiles: defaultFiles, maxLimit: 4, fileUploadingStatus: function (uploading) { return dispatch(bankStatementUploadingStatus(uploading)); }, fileType: FileType.FILES }) }));
|
|
30
|
+
return (_jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'bankStatementId', control: control, label: t('title_bank_statement'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleBankStatementChange, isSubmitting: loading, required: required, onDeleteFile: handleReset, purpose: DocumentPurpose.BANK_STATEMENT, defaultFiles: defaultFiles, maxLimit: 4, fileUploadingStatus: function (uploading) { return dispatch(bankStatementUploadingStatus(uploading)); }, fileType: FileType.FILES }) }));
|
|
36
31
|
};
|
|
37
32
|
export default BankStatement;
|
|
@@ -21,17 +21,18 @@ var InputStyled = styled(Input)(function () { return ({
|
|
|
21
21
|
textTransform: 'capitalize'
|
|
22
22
|
}
|
|
23
23
|
}); });
|
|
24
|
-
var Beneficiary = function () {
|
|
25
|
-
var
|
|
24
|
+
var Beneficiary = function (_a) {
|
|
25
|
+
var _b, _c, _d;
|
|
26
|
+
var readOnly = _a.readOnly;
|
|
26
27
|
var t = useTranslation().t;
|
|
27
|
-
var
|
|
28
|
+
var _e = useFormContext(), setValue = _e.setValue, control = _e.control;
|
|
28
29
|
var data = useAppSelector(bankSelector).data;
|
|
29
30
|
var beneficiaryControl = useController({ name: 'beneficiaryName', control: control });
|
|
30
31
|
var beneficiaryValue = beneficiaryControl.field.value;
|
|
31
|
-
var hasError = (
|
|
32
|
-
var error = (
|
|
32
|
+
var hasError = (_b = beneficiaryControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
33
|
+
var error = (_c = beneficiaryControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
33
34
|
var bank_account = (data.verify.responseBody || {}).bank_account;
|
|
34
|
-
var isNonEditable = ((
|
|
35
|
+
var isNonEditable = ((_d = bank_account === null || bank_account === void 0 ? void 0 : bank_account.data_status) === null || _d === void 0 ? void 0 : _d.beneficiary_name) === FieldType.NON_EDITABLE;
|
|
35
36
|
React.useEffect(function () {
|
|
36
37
|
var beneficiary_name = (bank_account || {}).beneficiary_name;
|
|
37
38
|
if (beneficiary_name)
|
|
@@ -44,6 +45,6 @@ var Beneficiary = function () {
|
|
|
44
45
|
var clearValue = function () {
|
|
45
46
|
beneficiaryControl.field.onChange('');
|
|
46
47
|
};
|
|
47
|
-
return (_jsx(FeatureStyled, { children: _jsx(InputStyled, { label: t('beneficiary_name'), onChange: handleBeneficiaryChange, disabled: isNonEditable, value: beneficiaryValue, placeholder: t('beneficiary_name'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: !hasError && beneficiaryValue ? _jsx(CheckIcon, {}) : beneficiaryValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
|
|
48
|
+
return (_jsx(FeatureStyled, { children: _jsx(InputStyled, { readOnly: readOnly, label: t('beneficiary_name'), onChange: handleBeneficiaryChange, disabled: isNonEditable, value: beneficiaryValue, placeholder: t('beneficiary_name'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: !hasError && beneficiaryValue ? _jsx(CheckIcon, {}) : beneficiaryValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
|
|
48
49
|
};
|
|
49
50
|
export default Beneficiary;
|
|
@@ -52,14 +52,17 @@ var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
|
52
52
|
var CollapseStyled = styled(Collapse)(function () { return ({
|
|
53
53
|
width: '100%'
|
|
54
54
|
}); });
|
|
55
|
-
var ConfirmPolicy = function () {
|
|
56
|
-
var
|
|
55
|
+
var ConfirmPolicy = function (_a) {
|
|
56
|
+
var _b;
|
|
57
|
+
var readOnly = _a.readOnly;
|
|
57
58
|
var t = useTranslation().t;
|
|
58
59
|
var control = useFormContext().control;
|
|
59
60
|
var confirmControl = useController({ control: control, name: 'confirmPolicy' });
|
|
60
61
|
var confirmChecked = confirmControl.field.value;
|
|
61
|
-
var warningMessage = (
|
|
62
|
+
var warningMessage = (_b = confirmControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
62
63
|
var handleConfirmCheckedChange = function (event, checked) {
|
|
64
|
+
if (readOnly)
|
|
65
|
+
return;
|
|
63
66
|
confirmControl.field.onChange(checked);
|
|
64
67
|
};
|
|
65
68
|
return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('bank_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface IBANProps {
|
|
3
3
|
fetchingIban: (flag: boolean) => void;
|
|
4
4
|
ibanChecking: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const IBAN: ({ fetchingIban, ibanChecking }: IBANProps) => JSX.Element;
|
|
7
|
+
declare const IBAN: ({ fetchingIban, ibanChecking, readOnly }: IBANProps) => JSX.Element;
|
|
7
8
|
export default IBAN;
|
|
@@ -61,7 +61,7 @@ var InputStyled = styled(Input)(function () { return ({
|
|
|
61
61
|
var cancelToken = null;
|
|
62
62
|
var IBAN = function (_a) {
|
|
63
63
|
var _b, _c;
|
|
64
|
-
var fetchingIban = _a.fetchingIban, ibanChecking = _a.ibanChecking;
|
|
64
|
+
var fetchingIban = _a.fetchingIban, ibanChecking = _a.ibanChecking, readOnly = _a.readOnly;
|
|
65
65
|
var dispatch = useAppDispatch();
|
|
66
66
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
67
67
|
var data = useAppSelector(bankSelector).data;
|
|
@@ -99,6 +99,6 @@ var IBAN = function (_a) {
|
|
|
99
99
|
var clearValue = function () {
|
|
100
100
|
ibanControl.field.onChange('');
|
|
101
101
|
};
|
|
102
|
-
return (_jsx(ScreenContainer, { children: _jsx(InputStyled, { label: t('enter_iban'), inputProps: { maxLength: MAX_IBAN_VALUE }, onChange: handleIbanChange, value: ibanValue, placeholder: t('iban_input_placeholder', { countrycode: settingsData.businessCountry.iso2.toUpperCase() }), warningType: 'alert', warningMessage: error && t(error), required: true, disabled: isNonEditable, endAdornment: ibanChecking ? (_jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } })) : !error && ibanValue ? (_jsx(CheckIcon, {})) : (ibanValue && _jsx(ClearIcon, { onClick: clearValue })) }) }));
|
|
102
|
+
return (_jsx(ScreenContainer, { children: _jsx(InputStyled, { readOnly: readOnly, label: t('enter_iban'), inputProps: { maxLength: MAX_IBAN_VALUE }, onChange: handleIbanChange, value: ibanValue, placeholder: t('iban_input_placeholder', { countrycode: settingsData.businessCountry.iso2.toUpperCase() }), warningType: 'alert', warningMessage: error && t(error), required: true, disabled: isNonEditable, endAdornment: ibanChecking ? (_jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } })) : !error && ibanValue ? (_jsx(CheckIcon, {})) : (ibanValue && _jsx(ClearIcon, { onClick: clearValue })) }) }));
|
|
103
103
|
};
|
|
104
104
|
export default IBAN;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const BankValidation: (
|
|
3
|
-
iban: yup.
|
|
2
|
+
export declare const BankValidation: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
|
-
beneficiaryName: yup.
|
|
5
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
6
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
7
7
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
8
8
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
-
iban: yup.
|
|
9
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
10
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
|
-
beneficiaryName: yup.
|
|
11
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
12
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
13
13
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
14
14
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
|
-
iban: yup.
|
|
15
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
16
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
|
-
beneficiaryName: yup.
|
|
17
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
18
|
bankStatementId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
19
19
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
20
20
|
}>>>;
|
|
21
|
-
export declare const BankKWFLValidation: (
|
|
22
|
-
iban: yup.
|
|
21
|
+
export declare const BankKWFLValidation: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
23
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
24
|
-
beneficiaryName: yup.
|
|
24
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
25
25
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
26
26
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
27
27
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
|
-
iban: yup.
|
|
28
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
29
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
-
beneficiaryName: yup.
|
|
30
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
31
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
32
32
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
33
33
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
34
|
-
iban: yup.
|
|
34
|
+
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
35
35
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
36
|
-
beneficiaryName: yup.
|
|
36
|
+
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
37
|
bankStatementId: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
|
|
38
38
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
39
39
|
}>>>;
|
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { FieldType } from '../../../../@types';
|
|
3
2
|
import { REGEX_ALPHANUMERIC, REGEX_IBAN } from '../../../../constants';
|
|
4
|
-
export var BankValidation = function (
|
|
5
|
-
var _a = bankAccount || {}, iban = _a.iban, beneficiary_name = _a.beneficiary_name, data_status = _a.data_status;
|
|
6
|
-
var isIBANOptional = !iban && (data_status === null || data_status === void 0 ? void 0 : data_status.iban) === FieldType.NON_EDITABLE;
|
|
7
|
-
var isBeneficiaryNameOptional = !beneficiary_name && (data_status === null || data_status === void 0 ? void 0 : data_status.beneficiary_name) === FieldType.NON_EDITABLE;
|
|
3
|
+
export var BankValidation = function () {
|
|
8
4
|
return yup.object().shape({
|
|
9
|
-
iban:
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
iban: yup
|
|
6
|
+
.string()
|
|
7
|
+
.matches(REGEX_IBAN, 'invalid_iban_format')
|
|
8
|
+
.min(15, 'invalid_iban_format')
|
|
9
|
+
.max(34, 'invalid_iban_format')
|
|
10
|
+
.required('alert_iban'),
|
|
12
11
|
bankName: yup.string().optional(),
|
|
13
|
-
beneficiaryName:
|
|
14
|
-
? yup.string().optional()
|
|
15
|
-
: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
12
|
+
beneficiaryName: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
16
13
|
bankStatementId: yup.array().optional(),
|
|
17
14
|
confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
|
|
18
15
|
});
|
|
19
16
|
};
|
|
20
|
-
export var BankKWFLValidation = function (
|
|
21
|
-
var _a = bankAccount || {}, iban = _a.iban, beneficiary_name = _a.beneficiary_name, data_status = _a.data_status;
|
|
22
|
-
var isIBANOptional = !iban && (data_status === null || data_status === void 0 ? void 0 : data_status.iban) === FieldType.NON_EDITABLE;
|
|
23
|
-
var isBeneficiaryNameOptional = !beneficiary_name && (data_status === null || data_status === void 0 ? void 0 : data_status.beneficiary_name) === FieldType.NON_EDITABLE;
|
|
17
|
+
export var BankKWFLValidation = function () {
|
|
24
18
|
return yup.object().shape({
|
|
25
|
-
iban:
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
iban: yup
|
|
20
|
+
.string()
|
|
21
|
+
.matches(REGEX_IBAN, 'invalid_iban_format')
|
|
22
|
+
.min(15, 'invalid_iban_format')
|
|
23
|
+
.max(34, 'invalid_iban_format')
|
|
24
|
+
.required('alert_iban'),
|
|
28
25
|
bankName: yup.string().optional(),
|
|
29
|
-
beneficiaryName:
|
|
30
|
-
? yup.string().optional()
|
|
31
|
-
: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
26
|
+
beneficiaryName: yup.string().matches(REGEX_ALPHANUMERIC, 'beneficiary_name_invalid').required('beneficiary_name_required'),
|
|
32
27
|
bankStatementId: yup.array().min(1, 'bank_statement_required').required('bank_statement_required'),
|
|
33
28
|
confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
|
|
34
29
|
});
|
|
@@ -12,6 +12,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
|
|
|
12
12
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
13
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
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/styles").Theme>, {}, {}>;
|
|
15
|
+
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
15
16
|
export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick<import("../../../../components/Input").InputProps, "name" | "type" | "className" | "style" | "classes" | "color" | "margin" | "translate" | "slot" | "title" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "sx" | "size" | "disabled" | "error" | "value" | "components" | "componentsProps" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
|
|
16
17
|
placeholder?: string | undefined;
|
|
17
18
|
hide?: boolean | undefined;
|
|
@@ -86,6 +87,7 @@ export interface ActivitiesListProps {
|
|
|
86
87
|
show: boolean;
|
|
87
88
|
onListOpen?: () => void;
|
|
88
89
|
onListClose?: () => void;
|
|
90
|
+
readOnly?: boolean;
|
|
89
91
|
}
|
|
90
|
-
declare const ActivitiesList: ({ show, ...rest }: ActivitiesListProps) => JSX.Element;
|
|
92
|
+
declare const ActivitiesList: ({ show, readOnly, ...rest }: ActivitiesListProps) => JSX.Element;
|
|
91
93
|
export default ActivitiesList;
|
|
@@ -48,11 +48,14 @@ import { sortActivitiesByName } from '../../../../utils';
|
|
|
48
48
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
49
49
|
import { brandSelector } from '../../../app/brand/brandStore';
|
|
50
50
|
import CheckIcon from '@mui/icons-material/Check';
|
|
51
|
-
import { MandatoryStyled } from './OperationStartDate';
|
|
52
51
|
export var InputLabelStyled = styled(Text)(function (_a) {
|
|
53
52
|
var theme = _a.theme;
|
|
54
53
|
return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
55
54
|
});
|
|
55
|
+
export var MandatoryStyled = styled('span')(function (_a) {
|
|
56
|
+
var theme = _a.theme;
|
|
57
|
+
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
58
|
+
});
|
|
56
59
|
export var InputStyled = styled(Input)(function (_a) {
|
|
57
60
|
var theme = _a.theme;
|
|
58
61
|
return ({
|
|
@@ -103,7 +106,7 @@ export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { r
|
|
|
103
106
|
});
|
|
104
107
|
var ActivitiesList = function (_a) {
|
|
105
108
|
var _b, _c, _d;
|
|
106
|
-
var show = _a.show, rest = __rest(_a, ["show"]);
|
|
109
|
+
var show = _a.show, readOnly = _a.readOnly, rest = __rest(_a, ["show", "readOnly"]);
|
|
107
110
|
var _e = React.useState([]), activitiesMenuList = _e[0], setActivitiesMenuList = _e[1];
|
|
108
111
|
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
109
112
|
var t = useTranslation().t;
|
|
@@ -114,7 +117,7 @@ var ActivitiesList = function (_a) {
|
|
|
114
117
|
var controlValue = activitiesControl.field.value;
|
|
115
118
|
var _g = React.useState(false), isHovered = _g[0], setIsHovered = _g[1];
|
|
116
119
|
var verify = data.verify;
|
|
117
|
-
var
|
|
120
|
+
var activities = (verify.responseBody || {}).activities;
|
|
118
121
|
var isCR = ((_d = (_c = (_b = verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.license) === null || _d === void 0 ? void 0 : _d.type) === 'commercial_registration';
|
|
119
122
|
var disabled = false;
|
|
120
123
|
React.useEffect(function () {
|
|
@@ -126,6 +129,8 @@ var ActivitiesList = function (_a) {
|
|
|
126
129
|
}, [activities]);
|
|
127
130
|
var onOpenList = function (event) {
|
|
128
131
|
var _a;
|
|
132
|
+
if (readOnly)
|
|
133
|
+
return;
|
|
129
134
|
setAnchorEl(event.currentTarget);
|
|
130
135
|
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
131
136
|
};
|
|
@@ -145,17 +150,17 @@ var ActivitiesList = function (_a) {
|
|
|
145
150
|
activitiesControl.field.onChange(__spreadArray(__spreadArray([], controlValue, true), [item], false));
|
|
146
151
|
};
|
|
147
152
|
var getSelectedActivities = function () {
|
|
148
|
-
var _a, _b;
|
|
153
|
+
var _a, _b, _c, _d;
|
|
149
154
|
if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > 1) {
|
|
150
155
|
return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
|
|
151
156
|
}
|
|
152
157
|
var item = controlValue[0];
|
|
153
|
-
return isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (
|
|
158
|
+
return isAr ? (_b = (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar) !== null && _b !== void 0 ? _b : '' : (_d = (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en) !== null && _d !== void 0 ? _d : '';
|
|
154
159
|
};
|
|
155
160
|
var getSelectedActivityFlag = function (item) {
|
|
156
161
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
157
162
|
};
|
|
158
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, disabled: disabled, value: getSelectedActivities(), placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: disabled ? undefined : !!anchorEl ?
|
|
163
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, disabled: disabled, value: getSelectedActivities(), placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: disabled ? undefined : !!anchorEl ? onCloseList : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
159
164
|
var _a, _b, _c;
|
|
160
165
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: isAr ? (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
161
166
|
} }) }))] })] }) })));
|
|
@@ -19,6 +19,7 @@ import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues }
|
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { BrandActivitiesValidationSchema } from './validation';
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
22
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
22
23
|
import { brandSelector, updateBrandActivities } from '../../../app/brand/brandStore';
|
|
23
24
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
24
25
|
import { useTranslation } from 'react-i18next';
|
|
@@ -37,8 +38,8 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
37
38
|
var BrandActivities = function (_a) {
|
|
38
39
|
var _b = React.useState(), listActive = _b[0], setListActive = _b[1];
|
|
39
40
|
var dispatch = useAppDispatch();
|
|
41
|
+
var settingData = useAppSelector(settingsSelector).data;
|
|
40
42
|
var _c = useAppSelector(brandSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
41
|
-
var brand = (data.verify.responseBody || {}).brand;
|
|
42
43
|
var _d = data.brandActivities, activities = _d.activities, customerLocations = _d.customerLocations, expectedCustomer = _d.expectedCustomer, expectedSale = _d.expectedSale, termAndConditionChecked = _d.termAndConditionChecked, refundPolicy = _d.refundPolicy, transactionPolicy = _d.transactionPolicy;
|
|
43
44
|
var ListType;
|
|
44
45
|
(function (ListType) {
|
|
@@ -48,7 +49,7 @@ var BrandActivities = function (_a) {
|
|
|
48
49
|
ListType["ExpectedSalesList"] = "ExpectedSalesList";
|
|
49
50
|
})(ListType || (ListType = {}));
|
|
50
51
|
var methods = useForm({
|
|
51
|
-
resolver: yupResolver(BrandActivitiesValidationSchema(
|
|
52
|
+
resolver: yupResolver(BrandActivitiesValidationSchema()),
|
|
52
53
|
defaultValues: {
|
|
53
54
|
activities: activities,
|
|
54
55
|
customerLocations: customerLocations,
|
|
@@ -77,6 +78,6 @@ var BrandActivities = function (_a) {
|
|
|
77
78
|
var isCustomerBaseListActive = listActive === ListType.CustomerBaseList;
|
|
78
79
|
var isExpectedCustomerListActive = listActive === ListType.ExpectedCustomerList;
|
|
79
80
|
var isExpectedSalesListActive = listActive === ListType.ExpectedSalesList;
|
|
80
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedCustomers, { show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomerList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedSalesRange, { show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedCustomerListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(TAC, { show: true }), _jsx(RefundPolicy, {}), _jsx(TransactionPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
81
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { readOnly: !settingData.boardMaturity && (activities === null || activities === void 0 ? void 0 : activities.length) > 0, show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { readOnly: !settingData.boardMaturity && (customerLocations === null || customerLocations === void 0 ? void 0 : customerLocations.length) > 0, show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedCustomers, { readOnly: !settingData.boardMaturity && !!(expectedCustomer === null || expectedCustomer === void 0 ? void 0 : expectedCustomer.id), show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomerList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedSalesRange, { readOnly: !settingData.boardMaturity && !!(expectedSale === null || expectedSale === void 0 ? void 0 : expectedSale.id), show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedCustomerListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(TAC, { show: true, readOnly: !settingData.boardMaturity && termAndConditionChecked === true }), _jsx(RefundPolicy, { readOnly: !settingData.boardMaturity && refundPolicy === true }), _jsx(TransactionPolicy, { readOnly: !settingData.boardMaturity && transactionPolicy === true }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
81
82
|
};
|
|
82
83
|
export default BrandActivities;
|
|
@@ -77,6 +77,7 @@ interface CustomerBaseProps {
|
|
|
77
77
|
show: boolean;
|
|
78
78
|
onListOpen?: () => void;
|
|
79
79
|
onListClose?: () => void;
|
|
80
|
+
readOnly?: boolean;
|
|
80
81
|
}
|
|
81
|
-
declare const _default: React.MemoExoticComponent<({ ...
|
|
82
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, ...props }: CustomerBaseProps) => JSX.Element>;
|
|
82
83
|
export default _default;
|
|
@@ -79,28 +79,31 @@ var SimpleListStyled = styled((SimpleList))(function () { return ({
|
|
|
79
79
|
height: 'fit-content'
|
|
80
80
|
}); });
|
|
81
81
|
var CustomerBase = function (_a) {
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
82
|
+
var _b, _c;
|
|
83
|
+
var readOnly = _a.readOnly, props = __rest(_a, ["readOnly"]);
|
|
84
|
+
var _d = React.useState([]), customerLocationsList = _d[0], setCustomerLocationsList = _d[1];
|
|
85
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
85
86
|
var t = useTranslation().t;
|
|
86
87
|
var isAr = useLanguage().isAr;
|
|
87
88
|
var control = useFormContext().control;
|
|
88
89
|
var dispatch = useAppDispatch();
|
|
89
90
|
var customerLocationsControl = useController({ name: 'customerLocations', control: control });
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var brandActivities = data.brandActivities
|
|
91
|
+
var _f = useAppSelector(brandSelector), data = _f.data, error = _f.error;
|
|
92
|
+
var _g = React.useState(false), isHovered = _g[0], setIsHovered = _g[1];
|
|
93
|
+
var brandActivities = data.brandActivities;
|
|
93
94
|
var response = brandActivities.responseBody;
|
|
94
95
|
var disabled = false;
|
|
95
96
|
var onOpenList = function (event) {
|
|
96
97
|
var _a;
|
|
98
|
+
if (readOnly)
|
|
99
|
+
return;
|
|
97
100
|
setAnchorEl(event.currentTarget);
|
|
98
|
-
(_a =
|
|
101
|
+
(_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
99
102
|
};
|
|
100
103
|
var onCloseList = function () {
|
|
101
104
|
var _a, _b;
|
|
102
105
|
setAnchorEl(null);
|
|
103
|
-
(_a =
|
|
106
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
104
107
|
if (((_b = response === null || response === void 0 ? void 0 : response.customerBases) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
105
108
|
setCustomerLocationsList(response === null || response === void 0 ? void 0 : response.customerBases);
|
|
106
109
|
}
|
|
@@ -137,7 +140,7 @@ var CustomerBase = function (_a) {
|
|
|
137
140
|
};
|
|
138
141
|
var customerLocationsValue = customerLocationsControl.field.value;
|
|
139
142
|
var customerLocationSelected = customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue[0];
|
|
140
|
-
return (_jsx(Collapse, __assign({ in:
|
|
143
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(BaseLabelStyled, { children: t('select_customer_base') }), _jsx(Tooltip, __assign({ title: t('customer_base_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(InputStyled, { readOnly: true, disabled: disabled, placeholder: t('choose_expected_sales'), value: isAr ? (_b = customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en) !== null && _c !== void 0 ? _c : '', onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
|
|
141
144
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.name.ar : item.name.en })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
|
|
142
145
|
} })] }))] }) })));
|
|
143
146
|
};
|
|
@@ -3,6 +3,7 @@ interface ExpectedCustomersProps {
|
|
|
3
3
|
show: boolean;
|
|
4
4
|
onListOpen?: () => void;
|
|
5
5
|
onListClose?: () => void;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const ExpectedCustomers: ({ ...
|
|
8
|
+
declare const ExpectedCustomers: ({ readOnly, ...props }: ExpectedCustomersProps) => JSX.Element;
|
|
8
9
|
export default ExpectedCustomers;
|
|
@@ -45,26 +45,29 @@ var SimpleListStyled = styled((SimpleList))(function () { return ({
|
|
|
45
45
|
height: 'fit-content'
|
|
46
46
|
}); });
|
|
47
47
|
var ExpectedCustomers = function (_a) {
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
48
|
+
var _b, _c;
|
|
49
|
+
var readOnly = _a.readOnly, props = __rest(_a, ["readOnly"]);
|
|
50
|
+
var _d = React.useState([]), expectedCustomersList = _d[0], setExpectedCustomersList = _d[1];
|
|
51
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
51
52
|
var t = useTranslation().t;
|
|
52
53
|
var isAr = useLanguage().isAr;
|
|
53
54
|
var dispatch = useAppDispatch();
|
|
54
55
|
var control = useFormContext().control;
|
|
55
56
|
var expectedCustomerControl = useController({ name: 'expectedCustomer', control: control });
|
|
56
|
-
var
|
|
57
|
+
var _f = useAppSelector(brandSelector), data = _f.data, error = _f.error;
|
|
57
58
|
var brandActivities = data.brandActivities;
|
|
58
59
|
var response = brandActivities.responseBody;
|
|
59
60
|
var onOpenList = function (event) {
|
|
60
61
|
var _a;
|
|
62
|
+
if (readOnly)
|
|
63
|
+
return;
|
|
61
64
|
setAnchorEl(event.currentTarget);
|
|
62
|
-
(_a =
|
|
65
|
+
(_a = props.onListOpen) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
63
66
|
};
|
|
64
67
|
var onCloseList = function () {
|
|
65
68
|
var _a, _b;
|
|
66
69
|
setAnchorEl(null);
|
|
67
|
-
(_a =
|
|
70
|
+
(_a = props.onListClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
68
71
|
if (((_b = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
69
72
|
setExpectedCustomersList(response === null || response === void 0 ? void 0 : response.expectedCustomerSales);
|
|
70
73
|
}
|
|
@@ -90,7 +93,7 @@ var ExpectedCustomers = function (_a) {
|
|
|
90
93
|
};
|
|
91
94
|
var expectedCustomersValue = expectedCustomerControl.field.value;
|
|
92
95
|
var expectedCustomersSelected = expectedCustomersValue;
|
|
93
|
-
return (_jsx(Collapse, __assign({ in:
|
|
96
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, placeholder: t('choose_expected_sales'), value: isAr ? (_b = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
94
97
|
return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.name.ar : item.name.en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
|
|
95
98
|
} })] }))] }) })));
|
|
96
99
|
};
|
|
@@ -3,6 +3,7 @@ interface ExpectedSalesRangeProps {
|
|
|
3
3
|
show: boolean;
|
|
4
4
|
onListOpen?: () => void;
|
|
5
5
|
onListClose?: () => void;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const ExpectedSalesRange: ({ show, onListClose, onListOpen }: ExpectedSalesRangeProps) => JSX.Element;
|
|
8
|
+
declare const ExpectedSalesRange: ({ show, onListClose, onListOpen, readOnly }: ExpectedSalesRangeProps) => JSX.Element;
|
|
8
9
|
export default ExpectedSalesRange;
|
|
@@ -46,16 +46,17 @@ var SimpleListStyled = styled((SimpleList))(function () { return ({
|
|
|
46
46
|
height: 'fit-content'
|
|
47
47
|
}); });
|
|
48
48
|
var ExpectedSalesRange = function (_a) {
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
49
|
+
var _b, _c;
|
|
50
|
+
var show = _a.show, onListClose = _a.onListClose, onListOpen = _a.onListOpen, readOnly = _a.readOnly;
|
|
51
|
+
var _d = React.useState([]), expectedSalesRangeList = _d[0], setExpectedSalesRangeList = _d[1];
|
|
52
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
53
|
+
var _f = React.useState(''), subIndex = _f[0], setSubIndex = _f[1];
|
|
53
54
|
var t = useTranslation().t;
|
|
54
55
|
var isAr = useLanguage().isAr;
|
|
55
56
|
var control = useFormContext().control;
|
|
56
57
|
var dispatch = useAppDispatch();
|
|
57
58
|
var expectedSaleControl = useController({ name: 'expectedSale', control: control });
|
|
58
|
-
var
|
|
59
|
+
var _g = useAppSelector(brandSelector), data = _g.data, error = _g.error;
|
|
59
60
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
60
61
|
var brandActivities = data.brandActivities, verify = data.verify;
|
|
61
62
|
var expectedSales = (brandActivities.responseBody || {}).expectedSales;
|
|
@@ -63,6 +64,8 @@ var ExpectedSalesRange = function (_a) {
|
|
|
63
64
|
var countryCode = settingsData.businessCountry;
|
|
64
65
|
var disabled = false;
|
|
65
66
|
var handleOpenMainMenu = function (event) {
|
|
67
|
+
if (disabled || readOnly)
|
|
68
|
+
return;
|
|
66
69
|
setAnchorEl(event.currentTarget);
|
|
67
70
|
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
68
71
|
};
|
|
@@ -113,7 +116,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
113
116
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
114
117
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
115
118
|
currency: t(findCurrencyByIso2(countryCode.iso2))
|
|
116
|
-
}) }), _jsx(InputStyled, { readOnly: true, disabled: disabled, value:
|
|
119
|
+
}) }), _jsx(InputStyled, { readOnly: true, disabled: disabled, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: disabled ? undefined : !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
117
120
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
118
121
|
if (isOnlyOneItem)
|
|
119
122
|
onSelectItem(item);
|