@tap-payments/auth-jsconnect 2.0.45 → 2.0.46
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 +47 -2
- package/build/@types/app.js +22 -0
- package/build/@types/form.d.ts +19 -1
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/user.d.ts +141 -0
- package/build/@types/user.js +1 -0
- package/build/api/board.d.ts +16 -0
- package/build/api/board.js +10 -1
- package/build/api/country.d.ts +4 -0
- package/build/api/country.js +9 -1
- package/build/api/entity.d.ts +3 -3
- package/build/api/index.d.ts +8 -3
- package/build/api/individual.d.ts +54 -4
- package/build/api/individual.js +9 -1
- package/build/api/user.d.ts +6 -0
- package/build/api/user.js +9 -1
- package/build/app/settings.js +11 -8
- package/build/assets/locales/ar.json +28 -2
- package/build/assets/locales/en.json +28 -1
- package/build/components/SimpleList/SimpleList.d.ts +2 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.d.ts +1 -0
- package/build/constants/app.js +20 -7
- package/build/constants/assets.d.ts +4 -0
- package/build/constants/assets.js +4 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +19 -13
- package/build/features/app/brand/brandStore.d.ts +2 -0
- package/build/features/app/brand/brandStore.js +69 -49
- package/build/features/app/business/businessStore.js +3 -3
- package/build/features/app/connect/connectStore.js +6 -6
- package/build/features/app/connectExpress/connectExpressStore.js +15 -9
- package/build/features/app/entity/entityStore.d.ts +2 -0
- package/build/features/app/entity/entityStore.js +5 -3
- package/build/features/app/individual/individualStore.d.ts +93 -4
- package/build/features/app/individual/individualStore.js +613 -129
- package/build/features/app/password/passwordStore.js +2 -2
- package/build/features/app/tax/taxStore.js +30 -29
- package/build/features/bank/Bank.js +2 -2
- package/build/features/bank/screens/BankDetails/BankDetails.js +8 -7
- package/build/features/bank/screens/BankDetails/BankName.js +13 -10
- package/build/features/bank/screens/BankDetails/BankStatement.js +8 -2
- package/build/features/bank/screens/BankDetails/Beneficiary.js +12 -13
- package/build/features/bank/screens/BankDetails/IBAN.js +14 -10
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
- package/build/features/bank/screens/BankDetails/validation.js +34 -15
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/Brand.js +2 -2
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +8 -6
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -2
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +9 -6
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +10 -7
- package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/validation.js +26 -15
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +11 -4
- package/build/features/brand/screens/BrandInfo/BrandName.js +13 -12
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +21 -9
- package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -7
- package/build/features/brand/screens/BrandInfo/validation.js +46 -36
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/Business.js +2 -2
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +3 -3
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/connect/Connect.js +2 -2
- package/build/features/connect/screens/Merchant/BrandList.js +4 -4
- package/build/features/connect/screens/Merchant/BrandName.js +6 -5
- package/build/features/connect/screens/Merchant/validation.js +2 -2
- package/build/features/connectExpress/ConnectExpress.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +1 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +5 -5
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +23 -3
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
- package/build/features/entity/Entity.js +2 -2
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +3 -3
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +3 -3
- package/build/features/entity/screens/EntityName/LicenseCertificate.js +9 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/Individual.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +13 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +48 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +6 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -17
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -16
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +9 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +35 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +41 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +8 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +9 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -23
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +19 -25
- package/build/features/individual/screens/IndividualList/CollectPhoneEmail.d.ts +10 -0
- package/build/features/individual/screens/IndividualList/CollectPhoneEmail.js +31 -0
- package/build/features/individual/screens/IndividualList/Email.d.ts +6 -0
- package/build/features/individual/screens/IndividualList/Email.js +48 -0
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +31 -0
- package/build/features/individual/screens/IndividualList/IndividualList.js +58 -0
- package/build/features/individual/screens/IndividualList/MobileNumber.d.ts +12 -0
- package/build/features/individual/screens/IndividualList/MobileNumber.js +143 -0
- package/build/features/individual/screens/IndividualList/UserList.d.ts +5 -0
- package/build/features/individual/screens/IndividualList/UserList.js +186 -0
- package/build/features/individual/screens/IndividualList/index.d.ts +3 -0
- package/build/features/individual/screens/IndividualList/index.js +2 -0
- package/build/features/individual/screens/IndividualList/validation.d.ts +12 -0
- package/build/features/individual/screens/IndividualList/validation.js +39 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +8 -0
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +109 -0
- package/build/features/individual/screens/{AdditionalIndividualInfo/EmployerLocation.d.ts → IndividualPersonalInfo/BirthCountry.d.ts} +2 -2
- package/build/features/individual/screens/{AdditionalIndividualInfo/EmployerLocation.js → IndividualPersonalInfo/BirthCountry.js} +14 -24
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +7 -0
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +46 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +50 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +7 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +50 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +34 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +81 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/ID.js +48 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +21 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +139 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +88 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +145 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +6 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Name.js +52 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +10 -0
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +88 -0
- package/build/features/individual/screens/IndividualPersonalInfo/index.d.ts +3 -0
- package/build/features/individual/screens/IndividualPersonalInfo/index.js +2 -0
- package/build/features/individual/screens/IndividualPersonalInfo/validation.d.ts +38 -0
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +68 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +10 -17
- package/build/features/password/Password.js +2 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/shared/Address/Address.d.ts +6 -1
- package/build/features/shared/Address/Address.js +40 -30
- package/build/features/shared/Address/CountryList.d.ts +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +1 -1
- package/build/features/shared/Address/InputText.d.ts +2 -1
- package/build/features/shared/Address/InputText.js +2 -2
- package/build/features/shared/Button/Button.js +11 -0
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +5 -5
- package/build/features/shared/Button/ListButton.d.ts +18 -0
- package/build/features/shared/Button/ListButton.js +125 -0
- package/build/features/shared/Button/index.d.ts +2 -1
- package/build/features/shared/Button/index.js +2 -1
- package/build/features/shared/CreateAccountLoading/CreateAccountLoading.d.ts +2 -1
- package/build/features/shared/CreateAccountLoading/CreateAccountLoading.js +2 -2
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +8 -6
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +6 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +33 -11
- package/build/features/signIn/SignIn.js +2 -2
- package/build/features/tax/Tax.js +2 -2
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -1
- package/build/features/tax/screens/TaxDetails/TaxDocument.js +8 -2
- package/build/features/tax/screens/TaxDetails/VATId.js +8 -3
- package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
- package/build/features/tax/screens/TaxDetails/validation.js +10 -5
- package/build/utils/array.d.ts +1 -0
- package/build/utils/array.js +10 -2
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +6 -0
- package/build/utils/date.d.ts +1 -0
- package/build/utils/date.js +7 -1
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/html.d.ts +1 -1
- package/build/utils/html.js +4 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/string.d.ts +15 -2
- package/build/utils/string.js +37 -3
- package/build/utils/validation.d.ts +1 -0
- package/build/utils/validation.js +3 -0
- package/package.json +129 -129
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +0 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +0 -46
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +0 -19
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +0 -52
- package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +0 -3
- package/build/features/individual/screens/ShowIndividualInfo/index.js +0 -2
- package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +0 -7
- package/build/features/individual/screens/ShowIndividualInfo/info.js +0 -28
|
@@ -9,55 +9,65 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import React, { useMemo } from 'react';
|
|
14
|
-
import
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useForm, Controller } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { useLanguage } from '../../../hooks';
|
|
18
|
+
import Collapse from '../../../components/Collapse';
|
|
16
19
|
import CountryListComponent from './CountryList';
|
|
17
20
|
import InputSelect from './InputSelect';
|
|
18
21
|
import InputText from './InputText';
|
|
22
|
+
import { Button } from '../Button';
|
|
19
23
|
export default function Address(_a) {
|
|
20
|
-
var format = _a.format, countryList = _a.countryList, onAddressChange = _a.onAddressChange, defaultValues = _a.defaultValues, disableCountry = _a.disableCountry;
|
|
24
|
+
var format = _a.format, countryList = _a.countryList, onAddressChange = _a.onAddressChange, defaultValues = _a.defaultValues, disableCountry = _a.disableCountry, loading = _a.loading, error = _a.error, onBack = _a.onBack, showSubmitButton = _a.showSubmitButton, isEditable = _a.isEditable;
|
|
21
25
|
var _b = useForm({ defaultValues: defaultValues, mode: 'onChange' }), watch = _b.watch, control = _b.control, formState = _b.formState, getValues = _b.getValues;
|
|
22
26
|
var values = getValues();
|
|
27
|
+
var t = useTranslation().t;
|
|
28
|
+
var isAr = useLanguage().isAr;
|
|
23
29
|
React.useEffect(function () {
|
|
24
|
-
|
|
30
|
+
if (!showSubmitButton)
|
|
31
|
+
onAddressChange(values, formState.isValid);
|
|
25
32
|
}, [values, formState.isValid]);
|
|
26
33
|
var countryIso2 = useMemo(function () {
|
|
27
34
|
var _a;
|
|
28
35
|
var index = countryList.findIndex(function (item) { return item.countryId === watch('country'); });
|
|
29
36
|
return (_a = countryList[index]) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
30
37
|
}, [watch('country')]);
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
return (_jsxs(Box, __assign({ component: 'form' }, { children: [format.map(function (item) {
|
|
39
|
+
var isCountry = item.code === 'country';
|
|
40
|
+
var isSelect = item.type === 'select';
|
|
41
|
+
if (isCountry) {
|
|
42
|
+
return (_jsx(Controller, { render: function (_a) {
|
|
43
|
+
var _b;
|
|
44
|
+
var field = _a.field, fieldState = _a.fieldState;
|
|
45
|
+
return (_jsx(CountryListComponent, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), list: countryList, onSelect: function (value) {
|
|
46
|
+
console.log('value', value);
|
|
47
|
+
field.onChange(value);
|
|
48
|
+
}, value: field.value, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, disabled: isEditable ? !!disableCountry : false, isRequired: item.required }));
|
|
49
|
+
}, rules: {
|
|
50
|
+
required: item.required && "address_".concat(item.code, "_required")
|
|
51
|
+
}, control: control, name: item.code }, item.code));
|
|
52
|
+
}
|
|
53
|
+
if (isSelect) {
|
|
54
|
+
return (_jsx(Controller, { render: function (_a) {
|
|
55
|
+
var _b;
|
|
56
|
+
var field = _a.field, fieldState = _a.fieldState;
|
|
57
|
+
return (_jsx(InputSelect, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), countryIso2: countryIso2, fetchURL: item.retrieve_uri, onSelect: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, value: field.value || '', disabled: isEditable ? !countryIso2 : false }));
|
|
58
|
+
}, rules: {
|
|
59
|
+
required: item.required && "address_".concat(item.code, "_required")
|
|
60
|
+
}, control: control, name: item.code }, item.code));
|
|
61
|
+
}
|
|
47
62
|
return (_jsx(Controller, { render: function (_a) {
|
|
48
63
|
var _b;
|
|
49
64
|
var field = _a.field, fieldState = _a.fieldState;
|
|
50
|
-
return (_jsx(
|
|
65
|
+
return (_jsx(InputText, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), onChange: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, disabled: !isEditable, value: field.value || '' }));
|
|
51
66
|
}, rules: {
|
|
52
67
|
required: item.required && "address_".concat(item.code, "_required")
|
|
53
68
|
}, control: control, name: item.code }, item.code));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return (_jsx(InputText, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), onChange: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, value: field.value || '' }));
|
|
59
|
-
}, rules: {
|
|
60
|
-
required: item.required && "address_".concat(item.code, "_required")
|
|
61
|
-
}, control: control, name: item.code }, item.code));
|
|
62
|
-
}) })));
|
|
69
|
+
}), _jsx(Collapse, __assign({ in: showSubmitButton }, { children: _jsx(Button, __assign({ onClick: function (e) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
onAddressChange(values, formState.isValid);
|
|
72
|
+
}, onBackClicked: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, isAr: isAr, disabled: !formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })));
|
|
63
73
|
}
|
|
@@ -30,7 +30,7 @@ export declare const LabelContainerStyled: import("@emotion/styled").StyledCompo
|
|
|
30
30
|
export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
|
|
31
31
|
children?: React.ReactNode;
|
|
32
32
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
33
|
-
color?: "inherit" | "disabled" | "error" | "
|
|
33
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
|
|
34
34
|
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
35
35
|
htmlColor?: string | undefined;
|
|
36
36
|
inheritViewBox?: boolean | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const LabelContainerStyled: import("@emotion/styled").StyledCompo
|
|
|
29
29
|
export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
|
|
30
30
|
children?: React.ReactNode;
|
|
31
31
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
32
|
-
color?: "inherit" | "disabled" | "error" | "
|
|
32
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
|
|
33
33
|
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
34
34
|
htmlColor?: string | undefined;
|
|
35
35
|
inheritViewBox?: boolean | undefined;
|
|
@@ -6,6 +6,7 @@ interface Props {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
isRequired?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare const _default: React.MemoExoticComponent<({ label, onChange, isRequired, placeholder, value, error }: Props) => JSX.Element>;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ label, onChange, isRequired, placeholder, value, error, disabled }: Props) => JSX.Element>;
|
|
11
12
|
export default _default;
|
|
@@ -5,8 +5,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import CheckIcon from '../CheckIcon';
|
|
6
6
|
import ClearIcon from '../ClearIcon';
|
|
7
7
|
var InputText = function (_a) {
|
|
8
|
-
var label = _a.label, onChange = _a.onChange, isRequired = _a.isRequired, placeholder = _a.placeholder, value = _a.value, error = _a.error;
|
|
8
|
+
var label = _a.label, onChange = _a.onChange, isRequired = _a.isRequired, placeholder = _a.placeholder, value = _a.value, error = _a.error, disabled = _a.disabled;
|
|
9
9
|
var t = useTranslation().t;
|
|
10
|
-
return (_jsx(_Fragment, { children: _jsx(Input, { labelSx: { paddingTop: '20px' }, label: t(label), value: value, required: isRequired, onChange: function (e) { return onChange(e.target.value); }, placeholder: t(placeholder), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && value ? _jsx(CheckIcon, {}) : value && _jsx(ClearIcon, { onClick: function () { return onChange(''); } }) }) }));
|
|
10
|
+
return (_jsx(_Fragment, { children: _jsx(Input, { labelSx: { paddingTop: '20px' }, label: t(label), value: value, disabled: disabled, required: isRequired, onChange: function (e) { return onChange(e.target.value); }, placeholder: t(placeholder), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && value ? _jsx(CheckIcon, {}) : value && _jsx(ClearIcon, { onClick: function () { return onChange(''); } }) }) }));
|
|
11
11
|
};
|
|
12
12
|
export default memo(InputText);
|
|
@@ -93,8 +93,19 @@ export default function CustomButton(_a) {
|
|
|
93
93
|
if (error)
|
|
94
94
|
setBtnLoading(false);
|
|
95
95
|
}, [loading, error]);
|
|
96
|
+
React.useEffect(function () {
|
|
97
|
+
if (!loading)
|
|
98
|
+
setTimeout(function () {
|
|
99
|
+
setBtnLoading(false);
|
|
100
|
+
}, 1500);
|
|
101
|
+
}, [loading]);
|
|
96
102
|
React.useEffect(function () {
|
|
97
103
|
setBtnLoading(false);
|
|
104
|
+
return function () {
|
|
105
|
+
setTimeout(function () {
|
|
106
|
+
setBtnLoading(false);
|
|
107
|
+
}, 500);
|
|
108
|
+
};
|
|
98
109
|
}, []);
|
|
99
110
|
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }, isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: btnLoading === false ? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) : undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!btnLoading })) }))] })] }));
|
|
100
111
|
}
|
|
@@ -55,7 +55,7 @@ import { ICONS_NAMES } from '../../../constants';
|
|
|
55
55
|
import CheckIcon from '@mui/icons-material/Check';
|
|
56
56
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../hooks';
|
|
57
57
|
import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../app/settings';
|
|
58
|
-
import { getScreenNameBasedOnFlow } from '../../../utils';
|
|
58
|
+
import { dangerousMessage, getScreenNameBasedOnFlow } from '../../../utils';
|
|
59
59
|
import API from '../../../api';
|
|
60
60
|
import Text from '../../../components/Text';
|
|
61
61
|
var Image = styled('img')(function (_a) {
|
|
@@ -149,14 +149,14 @@ export default function FlowsButtons(_a) {
|
|
|
149
149
|
var buttons = _a.buttons, data = _a.data;
|
|
150
150
|
var dispatch = useAppDispatch();
|
|
151
151
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
152
|
-
var flowName = data.flowName, email = data.email, emailUrl = data.emailUrl, brandName = data.brandName;
|
|
152
|
+
var flowName = data.flowName, email = data.email, emailUrl = data.emailUrl, brandName = data.brandName, isAuthorizedUser = data.isAuthorizedUser;
|
|
153
153
|
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
154
154
|
var isAr = useLanguage().isAr;
|
|
155
155
|
var onRedirect = function (item) {
|
|
156
156
|
if (item.isCompleted)
|
|
157
157
|
return;
|
|
158
158
|
if (flowName === item.name && item.name !== 'password') {
|
|
159
|
-
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name)));
|
|
159
|
+
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser)));
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
|
@@ -199,12 +199,12 @@ export default function FlowsButtons(_a) {
|
|
|
199
199
|
var data = response.data;
|
|
200
200
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
201
201
|
if (description) {
|
|
202
|
-
|
|
202
|
+
dangerousMessage(description, settingsData.appConfig.onError);
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
})
|
|
206
206
|
.catch(function (error) {
|
|
207
|
-
|
|
207
|
+
dangerousMessage(error.message || error, settingsData.appConfig.onError);
|
|
208
208
|
})
|
|
209
209
|
.finally(function () { })];
|
|
210
210
|
case 1:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '../../../components/Button';
|
|
3
|
+
type buttonProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
};
|
|
10
|
+
interface ListButtonProps extends ButtonProps {
|
|
11
|
+
isAr: boolean;
|
|
12
|
+
requestEmail: buttonProps & {
|
|
13
|
+
isRequested: boolean;
|
|
14
|
+
};
|
|
15
|
+
addDetails: buttonProps;
|
|
16
|
+
}
|
|
17
|
+
export default function ListButton({ isAr, requestEmail, addDetails }: ListButtonProps): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import { ICONS_NAMES } from '../../../constants';
|
|
17
|
+
import Loader from '../../../components/Loader';
|
|
18
|
+
import Button from '../../../components/Button';
|
|
19
|
+
import Icon from '../../../components/Icon';
|
|
20
|
+
import CheckIcon from '../CheckIcon';
|
|
21
|
+
import Collapse from '../../../components/Collapse';
|
|
22
|
+
var ArrowIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
23
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
24
|
+
return ({
|
|
25
|
+
width: theme.spacing(2),
|
|
26
|
+
height: theme.spacing(2),
|
|
27
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)',
|
|
28
|
+
marginInlineEnd: theme.spacing(-0.375),
|
|
29
|
+
verticalAlign: 'middle'
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
width: theme.spacing(2),
|
|
36
|
+
height: theme.spacing(2),
|
|
37
|
+
verticalAlign: 'middle'
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return ({
|
|
43
|
+
margin: theme.spacing(0, 2.5, 2.5, 2.5),
|
|
44
|
+
display: 'flex',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
flexDirection: 'column'
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var ButtonStyled = styled(Button, {
|
|
51
|
+
shouldForwardProp: function (prop) { return prop !== 'isLoading'; }
|
|
52
|
+
})(function (_a) {
|
|
53
|
+
var theme = _a.theme, isLoading = _a.isLoading;
|
|
54
|
+
return (__assign({ paddingLeft: isLoading ? 0 : 'auto', paddingRight: isLoading ? 0 : 'auto', textTransform: 'none', transition: theme.transitions.create(['width', 'padding'], {
|
|
55
|
+
easing: theme.transitions.easing.easeInOut,
|
|
56
|
+
duration: theme.transitions.duration.complex * 2
|
|
57
|
+
}) }, (isLoading && {
|
|
58
|
+
minWidth: 0,
|
|
59
|
+
width: theme.spacing(6),
|
|
60
|
+
borderRadius: 30
|
|
61
|
+
})));
|
|
62
|
+
});
|
|
63
|
+
var Image = styled('img')(function (_a) {
|
|
64
|
+
var theme = _a.theme;
|
|
65
|
+
return ({
|
|
66
|
+
width: theme.spacing(3),
|
|
67
|
+
height: theme.spacing(3),
|
|
68
|
+
fontSize: theme.spacing(3),
|
|
69
|
+
marginInlineStart: theme.spacing(1),
|
|
70
|
+
verticalAlign: 'middle'
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
var TextStyled = styled('span')(function () { return ({
|
|
74
|
+
whiteSpace: 'pre',
|
|
75
|
+
overflow: 'auto'
|
|
76
|
+
}); });
|
|
77
|
+
export default function ListButton(_a) {
|
|
78
|
+
var isAr = _a.isAr, requestEmail = _a.requestEmail, addDetails = _a.addDetails;
|
|
79
|
+
var t = useTranslation().t;
|
|
80
|
+
var theme = useTheme();
|
|
81
|
+
var requestEmailLoaderColor = requestEmail.isRequested && !requestEmail.loading ? theme.palette.success.main : theme.palette.primary.main;
|
|
82
|
+
return (_jsxs(ButtonBoxStyled, { children: [addDetails.children, _jsxs(ButtonStyled, __assign({ isLoading: addDetails.loading, sx: { mb: 1.5 }, type: 'button', variant: 'outlined', onClick: addDetails.onClick, startIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(Image, { src: ICONS_NAMES.ADD_DETAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: addDetails.loading }, { children: _jsx(Loader, { style: {
|
|
83
|
+
width: theme.spacing(3.75),
|
|
84
|
+
height: theme.spacing(3.75)
|
|
85
|
+
}, innerColor: theme.palette.primary.main, outerColor: theme.palette.primary.main, size: 15, toggleAnimation: addDetails.loading }) })), _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(TextStyled, { children: t(addDetails.title) }) }))] })), requestEmail.children, _jsxs(ButtonStyled, __assign({ isLoading: requestEmail.loading, variant: 'outlined', type: 'button', sx: requestEmail.isRequested && !requestEmail.loading
|
|
86
|
+
? {
|
|
87
|
+
'&.MuiButton-outlined': {
|
|
88
|
+
backgroundColor: theme.palette.common.white,
|
|
89
|
+
border: "1px solid ".concat(theme.palette.success.main),
|
|
90
|
+
color: theme.palette.success.main,
|
|
91
|
+
'&:hover': {
|
|
92
|
+
cursor: 'pointer',
|
|
93
|
+
backgroundColor: theme.palette.success.main,
|
|
94
|
+
color: theme.palette.common.white,
|
|
95
|
+
img: {
|
|
96
|
+
filter: 'brightness(0) invert(1)'
|
|
97
|
+
},
|
|
98
|
+
svg: {
|
|
99
|
+
filter: 'brightness(0) invert(1)'
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
: {
|
|
105
|
+
opacity: requestEmail.disabled ? 0.5 : 1,
|
|
106
|
+
'&.MuiButton-outlined': requestEmail.disabled
|
|
107
|
+
? {
|
|
108
|
+
'&:hover': {
|
|
109
|
+
cursor: 'default',
|
|
110
|
+
backgroundColor: theme.palette.common.white,
|
|
111
|
+
color: theme.palette.primary.main,
|
|
112
|
+
img: {
|
|
113
|
+
filter: 'none'
|
|
114
|
+
},
|
|
115
|
+
svg: {
|
|
116
|
+
filter: 'none'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
: {}
|
|
121
|
+
}, onClick: requestEmail.onClick, startIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(Image, { src: requestEmail.isRequested && !requestEmail.loading ? ICONS_NAMES.REQUEST_EMAIL_GREEN : ICONS_NAMES.REQUEST_EMAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: requestEmail.isRequested && !requestEmail.loading ? _jsx(CheckIconStyled, {}) : _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: requestEmail.loading }, { children: _jsx(Loader, { style: {
|
|
122
|
+
width: theme.spacing(3.75),
|
|
123
|
+
height: theme.spacing(3.75)
|
|
124
|
+
}, innerColor: requestEmailLoaderColor, outerColor: requestEmailLoaderColor, size: 15, toggleAnimation: requestEmail.loading }) })), _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(TextStyled, { children: t(requestEmail.title) }) }))] }))] }));
|
|
125
|
+
}
|
|
@@ -4,5 +4,6 @@ import MobileButton from './MobileButton';
|
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
|
-
|
|
7
|
+
import ListButton from './ListButton';
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
8
9
|
export default Button;
|
|
@@ -4,5 +4,6 @@ import MobileButton from './MobileButton';
|
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
|
-
|
|
7
|
+
import ListButton from './ListButton';
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
8
9
|
export default Button;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface CreateAccountLoadingProps {
|
|
3
3
|
error?: string | null;
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ error }: CreateAccountLoadingProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ error, children }: CreateAccountLoadingProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|
|
@@ -51,8 +51,8 @@ var SubTitleStyled = styled(Text)(function (_a) {
|
|
|
51
51
|
return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center' }));
|
|
52
52
|
});
|
|
53
53
|
var CreateAccountLoading = function (_a) {
|
|
54
|
-
var error = _a.error;
|
|
54
|
+
var error = _a.error, children = _a.children;
|
|
55
55
|
var t = useTranslation().t;
|
|
56
|
-
return (
|
|
56
|
+
return (_jsxs(ScreenContainer, __assign({ sx: __assign({}, (!children && { mb: 2.5 })) }, { children: [_jsxs(TitleContainerStyled, __assign({ sx: __assign({}, (children && { mb: 0 })) }, { children: [_jsx(Collapse, __assign({ in: !!error }, { children: _jsx(GenericError, { error: error || '', errorTitle: 'oops' }) })), _jsxs(Collapse, __assign({ in: !error }, { children: [_jsx(Container, { children: _jsx(LottieFile, { file: LottieAnimationFiles.account_creation, loop: true, height: '375px' }) }), _jsxs(_Fragment, { children: [_jsx(TitleStyled, { children: t('creating_account_title') }), _jsx(SubTitleStyled, { children: t('creating_account_description') })] })] }))] })), children] })));
|
|
57
57
|
};
|
|
58
58
|
export default React.memo(CreateAccountLoading);
|
|
@@ -6,6 +6,7 @@ interface SalesChannelProps {
|
|
|
6
6
|
onChange: (channel: SaleChannel[]) => void;
|
|
7
7
|
defaultValue?: SaleChannel[];
|
|
8
8
|
selectFirstIconListener?: string | number | boolean;
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare const _default: React.MemoExoticComponent<({ list, onChange, error, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
|
|
11
12
|
export default _default;
|
|
@@ -74,7 +74,7 @@ var CollapseStyled = styled(Collapse)(function (_a) {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
var SalesChannel = function (_a) {
|
|
77
|
-
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
|
|
77
|
+
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
|
|
78
78
|
var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
|
|
79
79
|
var _f = React.useState([]), selectedSalas = _f[0], setSelectedSales = _f[1];
|
|
80
80
|
var t = useTranslation().t;
|
|
@@ -143,7 +143,7 @@ var SalesChannel = function (_a) {
|
|
|
143
143
|
}, [selectFirstIconListener]);
|
|
144
144
|
return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
|
|
145
145
|
var _a, _b;
|
|
146
|
-
return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
|
|
146
|
+
return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
|
|
147
147
|
}), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
|
|
148
148
|
};
|
|
149
149
|
export default React.memo(SalesChannel);
|
|
@@ -7,10 +7,11 @@ interface SuccessFlowButtonsProps {
|
|
|
7
7
|
merchant: any;
|
|
8
8
|
bank: any;
|
|
9
9
|
user: any;
|
|
10
|
+
individuals: any;
|
|
10
11
|
flows: any[];
|
|
11
12
|
boardInfoId: string;
|
|
12
13
|
boardId: string;
|
|
13
14
|
flowName: FlowsTypes;
|
|
14
15
|
}
|
|
15
|
-
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName }: SuccessFlowButtonsProps) => JSX.Element>;
|
|
16
|
+
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName, individuals }: SuccessFlowButtonsProps) => JSX.Element>;
|
|
16
17
|
export default _default;
|
|
@@ -44,21 +44,22 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
|
44
44
|
});
|
|
45
45
|
var SuccessFlowButtons = function (_a) {
|
|
46
46
|
var _b, _c, _d;
|
|
47
|
-
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName;
|
|
47
|
+
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName, individuals = _a.individuals;
|
|
48
48
|
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
49
49
|
var t = useTranslation().t;
|
|
50
50
|
var isAr = useLanguage().isAr;
|
|
51
51
|
var settings = useAppSelector(settingsSelector);
|
|
52
|
-
var _f = user || {}, names = _f.names, identification = _f.identification;
|
|
52
|
+
var _f = user || {}, names = _f.names, identification = _f.identification, is_authorized = _f.is_authorized;
|
|
53
53
|
var primary_contact = (business || {}).primary_contact;
|
|
54
54
|
var _g = entity || {}, license = _g.license, vat_id = _g.vat_id, legal_name = _g.legal_name;
|
|
55
|
+
var count = (individuals || {}).count;
|
|
55
56
|
var username = isAr ? concatenateObjectValues((names === null || names === void 0 ? void 0 : names.ar) || (names === null || names === void 0 ? void 0 : names.en), ['first', 'last']) : concatenateObjectValues(names === null || names === void 0 ? void 0 : names.en, ['first', 'last']);
|
|
56
57
|
var licenseNumber = (license === null || license === void 0 ? void 0 : license.number) || '';
|
|
57
58
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.name, 20) || t('bank');
|
|
58
59
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
60
|
var taxID = vat_id || '';
|
|
60
|
-
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
61
|
-
var entityLegalName = shortenString(isAr ? legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar : legal_name === null || legal_name === void 0 ? void 0 : legal_name.en, 20) || '';
|
|
61
|
+
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || t('brand');
|
|
62
|
+
var entityLegalName = shortenString(isAr ? legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar : legal_name === null || legal_name === void 0 ? void 0 : legal_name.en, 20) || t('entity');
|
|
62
63
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
63
64
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
64
65
|
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
@@ -73,7 +74,7 @@ var SuccessFlowButtons = function (_a) {
|
|
|
73
74
|
var name = _a.name, url = _a.url, status = _a.status, token = _a.token;
|
|
74
75
|
var type = status === 'completed' ? 'completed' : 'pending';
|
|
75
76
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
76
|
-
individual_name: username.toLowerCase() + maskedId,
|
|
77
|
+
individual_name: is_authorized && count > 1 ? t('company_individuals_details', { count: count }) : username.toLowerCase() + maskedId,
|
|
77
78
|
brand: brandName,
|
|
78
79
|
business_type: entityLegalName,
|
|
79
80
|
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
@@ -107,7 +108,8 @@ var SuccessFlowButtons = function (_a) {
|
|
|
107
108
|
flowName: flowName,
|
|
108
109
|
email: email || '',
|
|
109
110
|
emailUrl: url,
|
|
110
|
-
brandName: shortenBrand(brandName)
|
|
111
|
+
brandName: shortenBrand(brandName),
|
|
112
|
+
isAuthorizedUser: is_authorized
|
|
111
113
|
} }) })] }));
|
|
112
114
|
};
|
|
113
115
|
export default memo(SuccessFlowButtons);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FileDetails } from '../../../@types';
|
|
3
|
+
import { Control, FieldValues } from 'react-hook-form';
|
|
2
4
|
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
5
|
children?: React.ReactNode;
|
|
4
6
|
component?: React.ElementType<any> | undefined;
|
|
@@ -8,6 +10,8 @@ export declare const InputContainerStyled: import("@emotion/styled").StyledCompo
|
|
|
8
10
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
11
|
}, ("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") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
12
|
interface UploadMultipleFileProps {
|
|
13
|
+
id: string;
|
|
14
|
+
control: Control<FieldValues, any>;
|
|
11
15
|
label: string;
|
|
12
16
|
purpose: string;
|
|
13
17
|
fileTitle?: string;
|
|
@@ -22,6 +26,7 @@ interface UploadMultipleFileProps {
|
|
|
22
26
|
fileUploadingStatus?: (uploading: boolean) => void;
|
|
23
27
|
onDeleteFile: (fileIds: Array<string>) => void;
|
|
24
28
|
maxLimit?: number;
|
|
29
|
+
defaultFiles?: Array<FileDetails>;
|
|
25
30
|
}
|
|
26
|
-
declare const UploadMultipleFile: ({ label, required, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle }: UploadMultipleFileProps) => JSX.Element;
|
|
31
|
+
declare const UploadMultipleFile: ({ id, label, control, required, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles }: UploadMultipleFileProps) => JSX.Element;
|
|
27
32
|
export default UploadMultipleFile;
|