@tap-payments/auth-jsconnect 2.1.35-test → 2.1.37-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 +1 -0
- package/build/@types/app.js +1 -0
- package/build/api/brand.d.ts +1 -0
- package/build/api/brand.js +9 -1
- package/build/api/index.d.ts +2 -0
- package/build/api/lead.d.ts +1 -0
- package/build/api/lead.js +7 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +7 -5
- package/build/app/settings.js +15 -6
- package/build/app/store.d.ts +2 -0
- package/build/components/Button/Button.js +1 -5
- package/build/components/Radio/Radio.js +1 -1
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/app.d.ts +14 -0
- package/build/constants/app.js +45 -0
- package/build/features/app/auth/authStore.js +2 -10
- package/build/features/app/bank/bankStore.d.ts +1 -5
- package/build/features/app/bank/bankStore.js +3 -3
- package/build/features/app/brand/brandStore.js +3 -3
- package/build/features/app/business/businessStore.js +6 -16
- package/build/features/app/connect/connectStore.js +1 -8
- package/build/features/app/connectExpress/connectExpressStore.d.ts +39 -0
- package/build/features/app/connectExpress/connectExpressStore.js +171 -0
- package/build/features/app/entity/entityStore.js +3 -3
- package/build/features/app/individual/individualStore.d.ts +2 -10
- package/build/features/app/individual/individualStore.js +6 -8
- package/build/features/app/password/passwordStore.d.ts +2 -10
- package/build/features/app/password/passwordStore.js +5 -5
- package/build/features/app/tax/taxStore.js +3 -3
- package/build/features/auth/screens/NID/TAC.js +1 -3
- package/build/features/bank/screens/BankDetails/validation.js +6 -26
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +9 -15
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -2
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +1 -2
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +1 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -3
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -3
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -3
- package/build/features/brand/screens/BrandInfo/Segments.js +6 -15
- package/build/features/brand/screens/BrandInfo/TeamSize.js +6 -15
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseType.js +1 -5
- package/build/features/business/screens/BusinessType/validation.js +2 -6
- package/build/features/business/screens/Customers/CustomerLocations.js +1 -2
- package/build/features/business/screens/Customers/ExpectedCustomers.js +1 -2
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +1 -3
- package/build/features/business/screens/Customers/RefundPolicy.js +1 -3
- package/build/features/business/screens/Customers/TransactionPolicy.js +1 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/connect/screens/Individual/validation.js +2 -8
- package/build/features/connect/screens/Merchant/TAC.js +1 -3
- package/build/features/connectExpress/ConnectExpress.d.ts +10 -0
- package/build/features/connectExpress/ConnectExpress.js +134 -0
- package/build/features/connectExpress/index.d.ts +1 -0
- package/build/features/connectExpress/index.js +1 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.js +102 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connectExpress/screens/CivilID/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CivilID/index.js +2 -0
- package/build/features/connectExpress/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/CivilID/validation.js +4 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.d.ts +5 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +133 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +12 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +154 -0
- package/build/features/connectExpress/screens/Mobile/Title.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/Title.js +29 -0
- package/build/features/connectExpress/screens/Mobile/index.d.ts +3 -0
- package/build/features/connectExpress/screens/Mobile/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/validation.js +28 -0
- package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/DOB.js +47 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +60 -0
- package/build/features/connectExpress/screens/NID/NID.d.ts +5 -0
- package/build/features/connectExpress/screens/NID/NID.js +94 -0
- package/build/features/connectExpress/screens/NID/index.d.ts +3 -0
- package/build/features/connectExpress/screens/NID/index.js +2 -0
- package/build/features/connectExpress/screens/NID/validation.d.ts +11 -0
- package/build/features/connectExpress/screens/NID/validation.js +9 -0
- package/build/features/connectExpress/screens/OTP/OTP.d.ts +5 -0
- package/build/features/connectExpress/screens/OTP/OTP.js +94 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.js +54 -0
- package/build/features/connectExpress/screens/OTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OTP/index.js +2 -0
- package/build/features/connectExpress/screens/OTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.js +95 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/screens/EntityCapital/ActivityList.js +1 -1
- package/build/features/entity/screens/EntityCapital/validation.js +2 -6
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +27 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +1 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -6
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/shared/Background/Background.js +1 -5
- package/build/features/shared/Button/Button.js +1 -3
- package/build/features/shared/Footer/Footer.js +1 -1
- package/build/features/shared/UploadMultipleFile/index.d.ts +0 -0
- package/build/features/shared/UploadMultipleFile/index.js +1 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/hooks/useAppConfig.d.ts +2 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useSetFromDefaultValues.js +2 -2
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -1
- package/build/utils/array.js +1 -3
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +1 -0
- package/package.json +1 -1
|
@@ -18,16 +18,15 @@ import React from 'react';
|
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { useController, useFormContext } from 'react-hook-form';
|
|
20
20
|
import { brandSelector } from '../../../../features/app/brand/brandStore';
|
|
21
|
-
import Search from '../../../../features/shared/Search';
|
|
22
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
23
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
24
|
-
import
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
25
24
|
import { styled } from '@mui/material/styles';
|
|
26
25
|
import Text from '../../../../components/Text';
|
|
27
26
|
import CheckIcon from '@mui/icons-material/Check';
|
|
28
27
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
29
28
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
30
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
29
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
31
30
|
});
|
|
32
31
|
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
33
32
|
var theme = _a.theme;
|
|
@@ -67,17 +66,9 @@ var Segments = function (_a) {
|
|
|
67
66
|
onCloseList();
|
|
68
67
|
segmentControl.field.onChange(segment);
|
|
69
68
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
((_b = segment === null || segment === void 0 ? void 0 : segment.name) === null || _b === void 0 ? void 0 : _b.ar.toLowerCase().includes(value.toLowerCase()));
|
|
75
|
-
});
|
|
76
|
-
setSegmentList(filteredList);
|
|
77
|
-
};
|
|
78
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('segment_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.en', list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
79
|
-
var _a, _b;
|
|
80
|
-
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
81
|
-
} })] }))] })) })));
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('segment_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.ar' : 'name.en', list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
82
73
|
};
|
|
83
74
|
export default Segments;
|
|
@@ -18,16 +18,15 @@ import React from 'react';
|
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { useController, useFormContext } from 'react-hook-form';
|
|
20
20
|
import { brandSelector } from '../../../../features/app/brand/brandStore';
|
|
21
|
-
import Search from '../../../../features/shared/Search';
|
|
22
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
23
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
24
|
-
import
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
25
24
|
import { styled } from '@mui/material/styles';
|
|
26
25
|
import Text from '../../../../components/Text';
|
|
27
26
|
import CheckIcon from '@mui/icons-material/Check';
|
|
28
27
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
29
28
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
30
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
29
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
31
30
|
});
|
|
32
31
|
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
33
32
|
var theme = _a.theme;
|
|
@@ -67,17 +66,9 @@ var TeamSize = function (_a) {
|
|
|
67
66
|
onCloseList();
|
|
68
67
|
teamSizeControl.field.onChange(teamSize);
|
|
69
68
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
((_b = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _b === void 0 ? void 0 : _b.ar.toLowerCase().includes(value.toLowerCase()));
|
|
75
|
-
});
|
|
76
|
-
setTeamSizeList(filteredList);
|
|
77
|
-
};
|
|
78
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('team_size_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.en', list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
79
|
-
var _a, _b;
|
|
80
|
-
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
81
|
-
} })] }))] })) })));
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('team_size_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.ar' : 'name.en', list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
82
73
|
};
|
|
83
74
|
export default TeamSize;
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, nameObj = _g.name, entity = _g.entity, brand = _g.brand, bank = _g.bank_account, merchant = _g.merchant, user = _g.user, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -156,7 +156,7 @@ var ActivitiesList = function (_a) {
|
|
|
156
156
|
var getSelectedActivityFlag = function (item) {
|
|
157
157
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
158
158
|
};
|
|
159
|
-
return (_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, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.
|
|
159
|
+
return (_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, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.ar' : 'name.en', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
160
160
|
var _a, _b, _c;
|
|
161
161
|
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, {})] }));
|
|
162
162
|
} }) }))] })] }));
|
|
@@ -98,10 +98,6 @@ var LicenseType = function (_a) {
|
|
|
98
98
|
};
|
|
99
99
|
var selectedLicenseValue = selectedLicenseControl.field.value;
|
|
100
100
|
var isFL = (selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL;
|
|
101
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: isFL ? 9.5 : 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: selectedLicenseValue != null
|
|
102
|
-
? (selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL
|
|
103
|
-
? BusinessType.FL
|
|
104
|
-
: BusinessType.CR
|
|
105
|
-
: false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: BusinessType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: BusinessType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
|
|
101
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: isFL ? 9.5 : 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: selectedLicenseValue != null ? ((selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL ? BusinessType.FL : BusinessType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: BusinessType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: BusinessType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
|
|
106
102
|
};
|
|
107
103
|
export default LicenseType;
|
|
@@ -80,9 +80,7 @@ export var KWLicenseValidationSchema = yup.object().shape({
|
|
|
80
80
|
.test({
|
|
81
81
|
test: function (value) {
|
|
82
82
|
if (!!value)
|
|
83
|
-
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE
|
|
84
|
-
? true
|
|
85
|
-
: this.createError({ message: 'alert_file_upload' });
|
|
83
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
86
84
|
return true;
|
|
87
85
|
}
|
|
88
86
|
})
|
|
@@ -93,9 +91,7 @@ export var KWLicenseValidationSchema = yup.object().shape({
|
|
|
93
91
|
.test({
|
|
94
92
|
test: function (value) {
|
|
95
93
|
if (!!value)
|
|
96
|
-
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE
|
|
97
|
-
? true
|
|
98
|
-
: this.createError({ message: 'alert_file_upload' });
|
|
94
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
99
95
|
return true;
|
|
100
96
|
}
|
|
101
97
|
})
|
|
@@ -130,8 +130,7 @@ var customerLocations = function (_a) {
|
|
|
130
130
|
var handleSearch = function (value) {
|
|
131
131
|
var _a;
|
|
132
132
|
var filteredList = (_a = response === null || response === void 0 ? void 0 : response.customerBases) === null || _a === void 0 ? void 0 : _a.filter(function (location) {
|
|
133
|
-
return location.name.en.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
134
|
-
location.name.ar.toLowerCase().startsWith(value.toLowerCase());
|
|
133
|
+
return location.name.en.toLowerCase().startsWith(value.toLowerCase()) || location.name.ar.toLowerCase().startsWith(value.toLowerCase());
|
|
135
134
|
});
|
|
136
135
|
setCustomerLocationsList(filteredList);
|
|
137
136
|
};
|
|
@@ -84,8 +84,7 @@ var ExpectedCustomers = function (_a) {
|
|
|
84
84
|
var handleSearch = function (value) {
|
|
85
85
|
var _a;
|
|
86
86
|
var filteredList = (_a = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _a === void 0 ? void 0 : _a.filter(function (customer) {
|
|
87
|
-
return customer.name.en.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
88
|
-
customer.name.ar.toLowerCase().startsWith(value.toLowerCase());
|
|
87
|
+
return customer.name.en.toLowerCase().startsWith(value.toLowerCase()) || customer.name.ar.toLowerCase().startsWith(value.toLowerCase());
|
|
89
88
|
});
|
|
90
89
|
setExpectedCustomersList(filteredList);
|
|
91
90
|
};
|
|
@@ -100,9 +100,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
100
100
|
salesRange.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase()) ||
|
|
101
101
|
salesRange.name.ar.toLowerCase().includes(value.toLowerCase()) ||
|
|
102
102
|
((_a = salesRange.sub) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.name.en.toLowerCase().includes(value.toLowerCase()); })) ||
|
|
103
|
-
((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) {
|
|
104
|
-
return obj.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase());
|
|
105
|
-
})) ||
|
|
103
|
+
((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) { return obj.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase()); })) ||
|
|
106
104
|
((_c = salesRange.sub) === null || _c === void 0 ? void 0 : _c.find(function (obj) { return obj.name.ar.toLowerCase().includes(value.toLowerCase()); }));
|
|
107
105
|
});
|
|
108
106
|
setExpectedSalesRangeList(filteredList);
|
|
@@ -77,8 +77,6 @@ var RefundPolicy = function () {
|
|
|
77
77
|
var handleRefundCheckedChange = function (event, checked) {
|
|
78
78
|
refundControl.field.onChange(checked);
|
|
79
79
|
};
|
|
80
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr
|
|
81
|
-
? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR
|
|
82
|
-
: TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
|
|
80
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
|
|
83
81
|
};
|
|
84
82
|
export default RefundPolicy;
|
|
@@ -37,8 +37,6 @@ var TransactionPolicy = function () {
|
|
|
37
37
|
var handleTransactionCheckedChange = function (event, checked) {
|
|
38
38
|
transactionControl.field.onChange(checked);
|
|
39
39
|
};
|
|
40
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr
|
|
41
|
-
? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR
|
|
42
|
-
: TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
40
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
43
41
|
};
|
|
44
42
|
export default TransactionPolicy;
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, nameObj = _g.name, entity = _g.entity, brand = _g.brand, bank = _g.bank_account, merchant = _g.merchant, identification = _g.identification, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { REGEX_FULL_NAME } from '../../../../constants';
|
|
2
2
|
import * as yup from 'yup';
|
|
3
3
|
export var IndividualValidation = yup.object().shape({
|
|
4
|
-
name: yup
|
|
5
|
-
.string()
|
|
6
|
-
.matches(REGEX_FULL_NAME, 'please write your first and last name')
|
|
7
|
-
.required('please write your first and last name'),
|
|
4
|
+
name: yup.string().matches(REGEX_FULL_NAME, 'please write your first and last name').required('please write your first and last name'),
|
|
8
5
|
email: yup.string().email('email_not_valid').required('email_not_valid')
|
|
9
6
|
});
|
|
10
7
|
export var IndividualMobileValidation = yup.object().shape({
|
|
11
|
-
name: yup
|
|
12
|
-
.string()
|
|
13
|
-
.matches(REGEX_FULL_NAME, 'please write your first and last name')
|
|
14
|
-
.required('please write your first and last name'),
|
|
8
|
+
name: yup.string().matches(REGEX_FULL_NAME, 'please write your first and last name').required('please write your first and last name'),
|
|
15
9
|
email: yup.string().email('email_not_valid').required('email_not_valid'),
|
|
16
10
|
mobile: yup
|
|
17
11
|
.string()
|
|
@@ -79,8 +79,6 @@ var TAC = function (_a) {
|
|
|
79
79
|
var handleTACCheckedChange = function (event, checked) {
|
|
80
80
|
tacControl.field.onChange(checked);
|
|
81
81
|
};
|
|
82
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr
|
|
83
|
-
? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR
|
|
84
|
-
: TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
82
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
85
83
|
};
|
|
86
84
|
export default React.memo(TAC);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LibConfig } from '../../@types';
|
|
3
|
+
export interface ConnectExpressLibProps extends LibConfig {
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
leadId?: string;
|
|
6
|
+
postURL: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConnectExpressLib(props: ConnectExpressLibProps): JSX.Element;
|
|
9
|
+
export declare function renderConnectExpressLib(config: ConnectExpressLibProps, elementId: string): void;
|
|
10
|
+
export declare function unmountConnectExpressLib(elementId: string, unmountTimeout?: number): void;
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
+
t[p] = s[p];
|
|
52
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
+
t[p[i]] = s[p[i]];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
59
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
60
|
+
import React, { memo } from 'react';
|
|
61
|
+
import { FeatureContainer } from '../shared/Containers';
|
|
62
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useAppDispatch } from '../../hooks';
|
|
63
|
+
import { handleCurrentActiveScreen, settingsSelector, handleOpen } from '../../app/settings';
|
|
64
|
+
import AnimationFlow from '../../components/AnimationFlow';
|
|
65
|
+
import { store } from '../../app/store';
|
|
66
|
+
import { connectExpressSelector, setIsLeadIdPassed, setResponseData, setPostUrl } from '../app/connectExpress/connectExpressStore';
|
|
67
|
+
import API from '../../api';
|
|
68
|
+
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
69
|
+
import Collapse from '../../components/Collapse';
|
|
70
|
+
import { reactElement, removeElement, isKW } from '../../utils';
|
|
71
|
+
import { CONNECT_EXPRESS_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
72
|
+
import { connectExpressFeatureScreens } from '../featuresScreens';
|
|
73
|
+
import CustomFooter from '../shared/Footer';
|
|
74
|
+
import Background from '../shared/Background';
|
|
75
|
+
var ConnectExpress = memo(function (_a) {
|
|
76
|
+
var leadId = _a.leadId, postURL = _a.postURL, onClose = _a.onClose, props = __rest(_a, ["leadId", "postURL", "onClose"]);
|
|
77
|
+
var theme = useAppTheme().theme;
|
|
78
|
+
var dispatch = useAppDispatch();
|
|
79
|
+
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
80
|
+
var _c = useAppSelector(connectExpressSelector), connectExpressError = _c.error, loading = _c.loading;
|
|
81
|
+
var prepare = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
|
+
var leadData;
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (_a.label) {
|
|
85
|
+
case 0:
|
|
86
|
+
if (!postURL)
|
|
87
|
+
throw new Error('postURL is required and you ave to pass it in the lib configuration!');
|
|
88
|
+
dispatch(setPostUrl(postURL));
|
|
89
|
+
if (!leadId)
|
|
90
|
+
return [2];
|
|
91
|
+
dispatch(setIsLeadIdPassed(true));
|
|
92
|
+
return [4, API.leadService.getLeadById(leadId)];
|
|
93
|
+
case 1:
|
|
94
|
+
leadData = _a.sent();
|
|
95
|
+
dispatch(setResponseData({ leadData: leadData }));
|
|
96
|
+
return [2];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}); };
|
|
100
|
+
useAppConfig(__assign(__assign({ navigation: CONNECT_EXPRESS_SCREENS_NAVIGATION }, props), { prepare: prepare }));
|
|
101
|
+
useErrorListener(connectExpressError || error);
|
|
102
|
+
useStepStartedListener();
|
|
103
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
104
|
+
React.useEffect(function () {
|
|
105
|
+
var _a;
|
|
106
|
+
if (!settingLoading && isKW((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
|
|
107
|
+
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
108
|
+
}
|
|
109
|
+
}, [settingLoading]);
|
|
110
|
+
var handleDialogClose = function () {
|
|
111
|
+
dispatch(handleOpen(false));
|
|
112
|
+
};
|
|
113
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onClose: onClose, onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectExpressFeatureScreens.map(function (_a, index) {
|
|
114
|
+
var Element = _a.element, name = _a.name;
|
|
115
|
+
var isActive = activeScreen.name === name;
|
|
116
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
117
|
+
}) }) })) })) })));
|
|
118
|
+
});
|
|
119
|
+
export function ConnectExpressLib(props) {
|
|
120
|
+
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(ConnectExpress, __assign({}, props)) })));
|
|
121
|
+
}
|
|
122
|
+
export function renderConnectExpressLib(config, elementId) {
|
|
123
|
+
reactElement(elementId).render(_jsx(ConnectExpress, __assign({}, config)));
|
|
124
|
+
}
|
|
125
|
+
export function unmountConnectExpressLib(elementId, unmountTimeout) {
|
|
126
|
+
if (unmountTimeout === void 0) { unmountTimeout = 1000; }
|
|
127
|
+
var element = document.getElementById(elementId);
|
|
128
|
+
setTimeout(function () {
|
|
129
|
+
var _a;
|
|
130
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
131
|
+
removeElement(DIALOG_ID);
|
|
132
|
+
elementId && reactElement(elementId).unmount();
|
|
133
|
+
}, unmountTimeout);
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConnectExpress';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConnectExpress';
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { useTranslation } from 'react-i18next';
|
|
26
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
27
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
28
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
29
|
+
import { civilIDValidationSchema } from './validation';
|
|
30
|
+
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
31
|
+
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
32
|
+
import { clearError, connectSelector, createCivilIdAuth, resetMobileScreen, resetStore } from '../../../app/connect/connectStore';
|
|
33
|
+
import Form from '../../../../components/Form';
|
|
34
|
+
import Button, { MobileButton } from '../../../shared/Button';
|
|
35
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
|
+
import Collapse from '../../../../components/Collapse';
|
|
37
|
+
import Box from '@mui/material/Box';
|
|
38
|
+
import Divider from '@mui/material/Divider';
|
|
39
|
+
import Text from '../../../../components/Text';
|
|
40
|
+
import IDNumber from './IDNumber';
|
|
41
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'column'
|
|
44
|
+
}); });
|
|
45
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
46
|
+
var theme = _a.theme;
|
|
47
|
+
return ({
|
|
48
|
+
color: alpha(theme.palette.primary.dark, 0.4)
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var DividerStyled = styled(Divider)(function (_a) {
|
|
52
|
+
var theme = _a.theme;
|
|
53
|
+
return ({
|
|
54
|
+
width: '45%',
|
|
55
|
+
borderColor: alpha(theme.palette.primary.dark, 0.4),
|
|
56
|
+
marginBlockEnd: theme.spacing(0.62)
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var OrBoxStyled = styled(Box)(function (_a) {
|
|
60
|
+
var theme = _a.theme;
|
|
61
|
+
return ({
|
|
62
|
+
display: 'flex',
|
|
63
|
+
justifyContent: 'space-between',
|
|
64
|
+
marginBlockEnd: theme.spacing(1.62),
|
|
65
|
+
marginBlockStart: theme.spacing(-1.25),
|
|
66
|
+
marginInline: theme.spacing(2.5)
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
var CivilID = function (_a) {
|
|
70
|
+
var isAr = useLanguage().isAr;
|
|
71
|
+
var dispatch = useAppDispatch();
|
|
72
|
+
var t = useTranslation().t;
|
|
73
|
+
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
74
|
+
var settingsStore = useAppSelector(settingsSelector);
|
|
75
|
+
var _c = data.civilIdData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
76
|
+
var methods = useForm({
|
|
77
|
+
resolver: yupResolver(civilIDValidationSchema),
|
|
78
|
+
defaultValues: defaultValues,
|
|
79
|
+
mode: 'onChange'
|
|
80
|
+
});
|
|
81
|
+
useSetFromDefaultValues(methods, data.civilIdData);
|
|
82
|
+
React.useEffect(function () {
|
|
83
|
+
handleClearError();
|
|
84
|
+
}, [methods.formState.isValid]);
|
|
85
|
+
var onSubmit = function (data) {
|
|
86
|
+
dispatch(createCivilIdAuth(data));
|
|
87
|
+
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
88
|
+
};
|
|
89
|
+
var handleClearError = function () {
|
|
90
|
+
if (error)
|
|
91
|
+
dispatch(clearError());
|
|
92
|
+
};
|
|
93
|
+
var onBack = function () {
|
|
94
|
+
dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
|
|
95
|
+
};
|
|
96
|
+
React.useEffect(function () {
|
|
97
|
+
dispatch(resetStore());
|
|
98
|
+
}, []);
|
|
99
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
100
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
|
|
101
|
+
};
|
|
102
|
+
export default React.memo(CivilID);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
interface IDNumberProps {
|
|
4
|
+
sx: SxProps<Theme> | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IDNumberProps & React.RefAttributes<unknown>>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 * as React from 'react';
|
|
14
|
+
import Box from '@mui/material/Box';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
import Input from '../../../shared/Input';
|
|
20
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
22
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
|
+
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
24
|
+
import { CIVIL_ID_NUMBER_LENGTH } from '../../../../constants';
|
|
25
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
36
|
+
});
|
|
37
|
+
var IDNumber = React.forwardRef(function (_a, ref) {
|
|
38
|
+
var _b;
|
|
39
|
+
var sx = _a.sx;
|
|
40
|
+
var t = useTranslation().t;
|
|
41
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
42
|
+
var civilIdControl = useController({ control: control, name: 'civilId' });
|
|
43
|
+
React.useEffect(function () {
|
|
44
|
+
if (civilIdControl.field.value)
|
|
45
|
+
setValue('civilId', civilIdControl.field.value, { shouldValidate: true });
|
|
46
|
+
}, []);
|
|
47
|
+
var handleIdChange = function (_a) {
|
|
48
|
+
var target = _a.target;
|
|
49
|
+
var value = removeAllOtherThanCharsAndNumber(target.value);
|
|
50
|
+
civilIdControl.field.onChange(value);
|
|
51
|
+
};
|
|
52
|
+
var clearIdNumber = function () {
|
|
53
|
+
civilIdControl.field.onChange('');
|
|
54
|
+
};
|
|
55
|
+
var idValue = civilIdControl.field.value;
|
|
56
|
+
var error = (_b = civilIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
57
|
+
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_civil_id') }) }), _jsx(Input, { dir: 'ltr', type: 'text', inputProps: { maxLength: CIVIL_ID_NUMBER_LENGTH }, onChange: handleIdChange, value: idValue, endAdornment: !error && idValue ? _jsx(CheckIcon, {}) : idValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: t('civil_id_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
|
|
58
|
+
});
|
|
59
|
+
export default React.memo(IDNumber);
|