@tap-payments/auth-jsconnect 2.0.52-test → 2.0.54-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 +4 -15
- package/build/@types/app.js +0 -9
- package/build/@types/form.d.ts +0 -11
- package/build/api/auth.d.ts +1 -14
- package/build/api/auth.js +1 -24
- package/build/api/axios.js +2 -2
- package/build/api/data.d.ts +1 -4
- package/build/api/data.js +2 -6
- package/build/api/entity.d.ts +0 -2
- package/build/api/index.d.ts +1 -5
- package/build/app/rootReducer.d.ts +0 -3
- package/build/app/rootReducer.js +1 -7
- package/build/app/settings.js +2 -8
- package/build/app/store.d.ts +1 -7
- package/build/assets/locales/ar.json +4 -14
- package/build/assets/locales/en.json +4 -14
- package/build/components/AnimationFlow/AnimationFlow.d.ts +1 -4
- package/build/components/AnimationFlow/AnimationFlow.js +7 -5
- package/build/components/AnimationFlow/BottomSheet.js +1 -2
- package/build/components/AnimationFlow/Dialog.d.ts +1 -4
- package/build/components/AnimationFlow/Dialog.js +4 -9
- package/build/components/FileInput/DragAndDrop.d.ts +1 -9
- package/build/components/FileInput/DragAndDrop.js +8 -113
- package/build/components/ProgressBar/index.d.ts +0 -2
- package/build/components/ProgressBar/index.js +0 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +34 -27
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +2 -5
- package/build/constants/app.d.ts +0 -15
- package/build/constants/app.js +3 -75
- package/build/constants/assets.d.ts +1 -17
- package/build/constants/assets.js +6 -22
- package/build/constants/validation.d.ts +0 -1
- package/build/constants/validation.js +0 -1
- package/build/features/app/bank/bankStore.d.ts +0 -4
- package/build/features/app/bank/bankStore.js +22 -42
- package/build/features/app/business/businessStore.js +12 -16
- package/build/features/app/connect/connectStore.d.ts +1 -13
- package/build/features/app/connect/connectStore.js +4 -164
- package/build/features/app/signIn/signInStore.js +2 -2
- package/build/features/bank/Bank.js +4 -10
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +8 -33
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +5 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/connect/Connect.d.ts +1 -2
- package/build/features/connect/Connect.js +10 -40
- package/build/features/connect/screens/Individual/Individual.js +2 -6
- package/build/features/connect/screens/Merchant/Merchant.js +11 -35
- package/build/features/connect/screens/Merchant/SocialMedia.js +11 -56
- package/build/features/connect/screens/Merchant/validation.d.ts +0 -87
- package/build/features/connect/screens/Merchant/validation.js +2 -68
- package/build/features/connect/screens/Mobile/Mobile.js +4 -7
- package/build/features/featuresScreens.d.ts +0 -3
- package/build/features/featuresScreens.js +0 -48
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +5 -12
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +5 -12
- package/build/features/shared/Background/Background.d.ts +5 -7
- package/build/features/shared/Background/Background.js +5 -16
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +3 -8
- package/build/features/shared/UploadFile/UploadFile.js +8 -23
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +4 -12
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +4 -12
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useAppConfig.js +0 -2
- package/build/hooks/useAppDispatch.d.ts +0 -3
- package/build/hooks/useErrorListener.js +2 -3
- package/build/index.d.ts +2 -5
- package/build/index.js +2 -11
- package/build/utils/device.d.ts +0 -1
- package/build/utils/device.js +0 -13
- package/build/utils/html.d.ts +0 -1
- package/build/utils/html.js +0 -6
- package/build/utils/locale.js +1 -1
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +20 -22
- package/build/utils/string.js +0 -9
- package/package.json +129 -129
- package/build/components/Lottie/Lottie.d.ts +0 -878
- package/build/components/Lottie/Lottie.js +0 -58
- package/build/components/Lottie/files/pulsating_circle_waves.json +0 -236
- package/build/components/Lottie/files/success.json +0 -425
- package/build/components/Lottie/index.d.ts +0 -3
- package/build/components/Lottie/index.js +0 -3
- package/build/components/ProgressBar/CircularProgressBar.d.ts +0 -14
- package/build/components/ProgressBar/CircularProgressBar.js +0 -48
- package/build/features/app/auth/authStore.d.ts +0 -35
- package/build/features/app/auth/authStore.js +0 -148
- package/build/features/app/entity/entityStore.d.ts +0 -53
- package/build/features/app/entity/entityStore.js +0 -461
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/auth/Auth.d.ts +0 -10
- package/build/features/auth/Auth.js +0 -87
- package/build/features/auth/index.d.ts +0 -1
- package/build/features/auth/index.js +0 -1
- package/build/features/auth/screens/OTP/OTP.d.ts +0 -5
- package/build/features/auth/screens/OTP/OTP.js +0 -72
- package/build/features/auth/screens/OTP/OTPInput.d.ts +0 -5
- package/build/features/auth/screens/OTP/OTPInput.js +0 -44
- package/build/features/auth/screens/OTP/index.d.ts +0 -3
- package/build/features/auth/screens/OTP/index.js +0 -2
- package/build/features/auth/screens/OTP/validation.d.ts +0 -8
- package/build/features/auth/screens/OTP/validation.js +0 -4
- package/build/features/connect/screens/CivilID/CivilID.d.ts +0 -5
- package/build/features/connect/screens/CivilID/CivilID.js +0 -85
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +0 -7
- package/build/features/connect/screens/CivilID/IDNumber.js +0 -59
- package/build/features/connect/screens/CivilID/index.d.ts +0 -3
- package/build/features/connect/screens/CivilID/index.js +0 -2
- package/build/features/connect/screens/CivilID/validation.d.ts +0 -8
- package/build/features/connect/screens/CivilID/validation.js +0 -4
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +0 -5
- package/build/features/connect/screens/Merchant/SalesChannels.js +0 -114
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +0 -169
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +0 -22
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +0 -8
- package/build/features/connect/screens/VerifyPACI/index.d.ts +0 -3
- package/build/features/connect/screens/VerifyPACI/index.js +0 -2
- package/build/features/entity/Entity.d.ts +0 -7
- package/build/features/entity/Entity.js +0 -70
- package/build/features/entity/index.d.ts +0 -1
- package/build/features/entity/index.js +0 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +0 -54
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +0 -139
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +0 -56
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +0 -17
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +0 -28
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +0 -6
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +0 -38
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
- package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/index.js +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +0 -107
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +0 -17
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +0 -5
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +0 -9
- package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +0 -3
- package/build/features/entity/screens/ResetPasswordSuccess/index.js +0 -2
- package/build/features/entity/screens/Success/Success.d.ts +0 -5
- package/build/features/entity/screens/Success/Success.js +0 -16
- package/build/features/entity/screens/Success/index.d.ts +0 -3
- package/build/features/entity/screens/Success/index.js +0 -2
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +0 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +0 -109
- package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +0 -2
- package/build/features/entity/screens/SuccessWithFlowButtons/index.js +0 -2
- package/build/features/entity/screens/Verify/OTPInput.d.ts +0 -7
- package/build/features/entity/screens/Verify/OTPInput.js +0 -47
- package/build/features/entity/screens/Verify/Verify.d.ts +0 -5
- package/build/features/entity/screens/Verify/Verify.js +0 -78
- package/build/features/entity/screens/Verify/index.d.ts +0 -2
- package/build/features/entity/screens/Verify/index.js +0 -2
- package/build/features/entity/screens/Verify/validation.d.ts +0 -8
- package/build/features/entity/screens/Verify/validation.js +0 -4
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
- package/build/features/shared/Dialog/CloseDialog.d.ts +0 -11
- package/build/features/shared/Dialog/CloseDialog.js +0 -62
- package/build/features/shared/Dialog/DialogContainer.d.ts +0 -8
- package/build/features/shared/Dialog/DialogContainer.js +0 -56
- package/build/features/shared/Dialog/index.d.ts +0 -4
- package/build/features/shared/Dialog/index.js +0 -4
- package/build/hooks/useScreen.d.ts +0 -3
- package/build/hooks/useScreen.js +0 -14
|
@@ -1,109 +0,0 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useEffect, useState } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
|
-
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
|
-
import { entitySelector } from '../../../app/entity/entityStore';
|
|
21
|
-
import Box from '@mui/material/Box';
|
|
22
|
-
import Text from '../../../../components/Text';
|
|
23
|
-
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
|
-
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
-
import { settingsSelector } from '../../../../app/settings';
|
|
26
|
-
var TitleStyled = styled(Text)(function (_a) {
|
|
27
|
-
var _b;
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return (__assign(__assign({}, theme.typography.body1), (_b = { fontWeight: theme.typography.fontWeightBold, color: theme.palette.text.primary, lineHeight: 1.75, paddingBottom: theme.spacing(3) }, _b[theme.breakpoints.down('sm')] = {}, _b)));
|
|
30
|
-
});
|
|
31
|
-
var ContainerStyled = styled(Container)(function (_a) {
|
|
32
|
-
var theme = _a.theme;
|
|
33
|
-
return ({
|
|
34
|
-
justifyContent: 'space-between',
|
|
35
|
-
minHeight: theme.spacing(30),
|
|
36
|
-
alignItems: 'center'
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
40
|
-
var theme = _a.theme;
|
|
41
|
-
return ({
|
|
42
|
-
width: '100%',
|
|
43
|
-
paddingTop: theme.spacing(3)
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
var SuccessWithFlowButtons = function () {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
var t = useTranslation().t;
|
|
49
|
-
var isAr = useLanguage().isAr;
|
|
50
|
-
var data = useAppSelector(entitySelector).data;
|
|
51
|
-
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank, merchant = _d.merchant, identification_id = _d.identification_id, vatID = _d.vatID;
|
|
52
|
-
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
53
|
-
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
54
|
-
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
55
|
-
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
56
|
-
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
57
|
-
var taxID = vatID || '';
|
|
58
|
-
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) || '';
|
|
59
|
-
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
-
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
-
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
62
|
-
var settings = useAppSelector(settingsSelector);
|
|
63
|
-
var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
|
|
64
|
-
var email = (contact || { email: '' }).email;
|
|
65
|
-
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
|
|
66
|
-
var reMapFlowData = function (flows) {
|
|
67
|
-
if (flows === void 0) { flows = []; }
|
|
68
|
-
var images = ICONS_NAMES;
|
|
69
|
-
var mappedFlows = flows
|
|
70
|
-
.filter(function (item) { return item.name; })
|
|
71
|
-
.map(function (_a) {
|
|
72
|
-
var name = _a.name, url = _a.url, status = _a.status;
|
|
73
|
-
var type = status === 'initiated' || status === 'in_progress' ? 'pending' : 'completed';
|
|
74
|
-
var title = t("".concat(name, "_flow_").concat(type), {
|
|
75
|
-
individual_name: username.toLowerCase() + maskedId,
|
|
76
|
-
business_type: brandName,
|
|
77
|
-
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
78
|
-
bank_name: bankName,
|
|
79
|
-
iban: t('masking_symbols') + iban,
|
|
80
|
-
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
81
|
-
});
|
|
82
|
-
var isCompleted = status === 'completed' && name !== 'password';
|
|
83
|
-
var isIndividual = name === 'individual';
|
|
84
|
-
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
85
|
-
var hoverSrc = "".concat(name, "_white_icon");
|
|
86
|
-
return {
|
|
87
|
-
name: name,
|
|
88
|
-
status: status,
|
|
89
|
-
title: title,
|
|
90
|
-
href: url,
|
|
91
|
-
src: images[src],
|
|
92
|
-
hoverSrc: images[hoverSrc],
|
|
93
|
-
isCompleted: isCompleted,
|
|
94
|
-
sx: isIndividual ? { textTransform: 'capitalize' } : {}
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
setButtons(mappedFlows);
|
|
98
|
-
};
|
|
99
|
-
useEffect(function () {
|
|
100
|
-
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
101
|
-
reMapFlowData(flows);
|
|
102
|
-
}, [flows, isAr]);
|
|
103
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
104
|
-
flowName: data.flowName,
|
|
105
|
-
email: email,
|
|
106
|
-
emailUrl: url
|
|
107
|
-
} }) })] }));
|
|
108
|
-
};
|
|
109
|
-
export default memo(SuccessWithFlowButtons);
|
|
@@ -1,47 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import OTPField from '../../../shared/OTP';
|
|
17
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
-
import { useTranslation } from 'react-i18next';
|
|
19
|
-
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import { resendOTP } from '../../../app/entity/entityStore';
|
|
22
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
23
|
-
var theme = _a.theme;
|
|
24
|
-
return ({
|
|
25
|
-
display: 'flex',
|
|
26
|
-
flexDirection: 'column',
|
|
27
|
-
fontFamily: theme.typography.fontFamily
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
var OTPInput = function (_a) {
|
|
31
|
-
var loading = _a.loading, setLoading = _a.setLoading;
|
|
32
|
-
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
33
|
-
var t = useTranslation().t;
|
|
34
|
-
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
-
var dispatch = useAppDispatch();
|
|
36
|
-
var handleOnOTPChange = function (otp) {
|
|
37
|
-
otpControl.field.onChange(otp);
|
|
38
|
-
};
|
|
39
|
-
var handleOnResendOTP = function () {
|
|
40
|
-
if (otpControl.field.value)
|
|
41
|
-
setValue('otp', '', { shouldValidate: true });
|
|
42
|
-
dispatch(resendOTP());
|
|
43
|
-
};
|
|
44
|
-
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
|
-
};
|
|
47
|
-
export default React.memo(OTPInput);
|
|
@@ -1,78 +0,0 @@
|
|
|
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 { useAppDispatch } from '../../../../hooks';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
-
import Box from '@mui/material/Box/Box';
|
|
19
|
-
import { styled } from '@mui/material/styles';
|
|
20
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
-
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
22
|
-
import { maskPhone } from '../../../../utils';
|
|
23
|
-
import Form from '../../../../components/Form';
|
|
24
|
-
import Text from '../../../../components/Text';
|
|
25
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
26
|
-
import { entitySelector, clearError, resetOTPScreen, verifyEntityLeadOTP } from '../../../app/entity/entityStore';
|
|
27
|
-
import Button from '../../../shared/Button';
|
|
28
|
-
import { OTPValidation } from './validation';
|
|
29
|
-
import OTPInput from './OTPInput';
|
|
30
|
-
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
31
|
-
var theme = _a.theme;
|
|
32
|
-
return ({
|
|
33
|
-
background: theme.palette.common.white,
|
|
34
|
-
border: '1px solid',
|
|
35
|
-
borderColor: theme.palette.divider,
|
|
36
|
-
direction: theme.direction,
|
|
37
|
-
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
38
|
-
marginBottom: theme.spacing(5.75)
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
|
|
44
|
-
});
|
|
45
|
-
var FormStyled = styled(Form)(function () { return ({
|
|
46
|
-
display: 'flex',
|
|
47
|
-
flexDirection: 'column'
|
|
48
|
-
}); });
|
|
49
|
-
var VerifyNumber = function (_a) {
|
|
50
|
-
var _b, _c, _d;
|
|
51
|
-
var dispatch = useAppDispatch();
|
|
52
|
-
var _e = useAppSelector(entitySelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
53
|
-
var methods = useForm({
|
|
54
|
-
resolver: yupResolver(OTPValidation),
|
|
55
|
-
defaultValues: data.otpData,
|
|
56
|
-
mode: 'onChange'
|
|
57
|
-
});
|
|
58
|
-
var t = useTranslation().t;
|
|
59
|
-
var isAr = useLanguage().isAr;
|
|
60
|
-
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
61
|
-
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
62
|
-
React.useEffect(function () {
|
|
63
|
-
if (error && methods.formState.isValid && phone)
|
|
64
|
-
dispatch(clearError());
|
|
65
|
-
return function () {
|
|
66
|
-
dispatch(resetOTPScreen());
|
|
67
|
-
};
|
|
68
|
-
}, [methods.formState.isValid]);
|
|
69
|
-
var onSubmit = function (formData) {
|
|
70
|
-
dispatch(verifyEntityLeadOTP(formData));
|
|
71
|
-
};
|
|
72
|
-
var onBack = function () {
|
|
73
|
-
dispatch(handlePrevScreenStep());
|
|
74
|
-
};
|
|
75
|
-
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
|
-
};
|
|
78
|
-
export default React.memo(VerifyNumber);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
}>>>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LibConfig } from '../../@types';
|
|
3
|
-
export interface OTPLibProps extends LibConfig {
|
|
4
|
-
}
|
|
5
|
-
export declare function OTPLib(props: OTPLibProps): JSX.Element;
|
|
6
|
-
export declare function renderOTPLib(config: OTPLibProps, elementId: string): void;
|
|
7
|
-
export declare function unmountOTPLib(elementId: string): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import { styled } from '@mui/material/styles';
|
|
15
|
-
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
16
|
-
import { settingsSelector } from '../../app/settings';
|
|
17
|
-
import { store } from '../../app/store';
|
|
18
|
-
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
|
-
import Collapse from '../../components/Collapse';
|
|
20
|
-
import { reactElement } from '../../utils';
|
|
21
|
-
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { OTP_SCREENS_NAVIGATION } from '../../constants';
|
|
23
|
-
import { otpSelector } from '../app/otp/otpStore';
|
|
24
|
-
import { otpFeatureScreens } from '../featuresScreens';
|
|
25
|
-
var Container = styled(FeatureContainer)(function (_a) {
|
|
26
|
-
var theme = _a.theme;
|
|
27
|
-
return ({
|
|
28
|
-
borderRadius: theme.spacing(1.5),
|
|
29
|
-
backgroundColor: 'inherit',
|
|
30
|
-
color: theme.palette.text.primary,
|
|
31
|
-
maxHeight: "calc(100% - ".concat(theme.spacing(10), ") !important"),
|
|
32
|
-
width: theme.spacing(46.875),
|
|
33
|
-
maxWidth: theme.spacing(46.875)
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
var OTP = memo(function (props) {
|
|
37
|
-
var theme = useAppTheme().theme;
|
|
38
|
-
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error;
|
|
39
|
-
var otpError = useAppSelector(otpSelector).error;
|
|
40
|
-
useAppConfig(__assign({ navigation: OTP_SCREENS_NAVIGATION }, props));
|
|
41
|
-
useErrorListener(otpError || error);
|
|
42
|
-
useStepStartedListener();
|
|
43
|
-
var activeScreen = data.activeScreen;
|
|
44
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Container, { children: otpFeatureScreens.map(function (_a, index) {
|
|
45
|
-
var Element = _a.element, name = _a.name;
|
|
46
|
-
var isActive = activeScreen.name === name;
|
|
47
|
-
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
48
|
-
}) }) })));
|
|
49
|
-
});
|
|
50
|
-
export function OTPLib(props) {
|
|
51
|
-
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(OTP, __assign({}, props)) })));
|
|
52
|
-
}
|
|
53
|
-
export function renderOTPLib(config, elementId) {
|
|
54
|
-
reactElement(elementId).render(_jsx(OTPLib, __assign({}, config)));
|
|
55
|
-
}
|
|
56
|
-
export function unmountOTPLib(elementId) {
|
|
57
|
-
reactElement(elementId).unmount();
|
|
58
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,47 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import OTPField from '../../../shared/OTP';
|
|
17
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
-
import { useTranslation } from 'react-i18next';
|
|
19
|
-
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import { resendOTP } from '../../../app/otp/otpStore';
|
|
22
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
23
|
-
var theme = _a.theme;
|
|
24
|
-
return ({
|
|
25
|
-
display: 'flex',
|
|
26
|
-
flexDirection: 'column',
|
|
27
|
-
fontFamily: theme.typography.fontFamily
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
var OTPInput = function (_a) {
|
|
31
|
-
var loading = _a.loading;
|
|
32
|
-
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
33
|
-
var t = useTranslation().t;
|
|
34
|
-
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
-
var dispatch = useAppDispatch();
|
|
36
|
-
var handleOnOTPChange = function (otp) {
|
|
37
|
-
otpControl.field.onChange(otp);
|
|
38
|
-
};
|
|
39
|
-
var handleOnResendOTP = function () {
|
|
40
|
-
if (otpControl.field.value)
|
|
41
|
-
setValue('otp', '', { shouldValidate: true });
|
|
42
|
-
dispatch(resendOTP());
|
|
43
|
-
};
|
|
44
|
-
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
|
-
};
|
|
47
|
-
export default React.memo(OTPInput);
|
|
@@ -1,49 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
-
import { styled } from '@mui/material/styles';
|
|
19
|
-
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
20
|
-
import Form from '../../../../components/Form';
|
|
21
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
|
-
import { otpSelector, clearError, resetOTPScreen } from '../../../app/otp/otpStore';
|
|
23
|
-
import { OTPValidation } from './validation';
|
|
24
|
-
import OTPInput from './OTPInput';
|
|
25
|
-
var FormStyled = styled(Form)(function () { return ({
|
|
26
|
-
display: 'flex',
|
|
27
|
-
flexDirection: 'column'
|
|
28
|
-
}); });
|
|
29
|
-
var Verify = function (_a) {
|
|
30
|
-
var dispatch = useAppDispatch();
|
|
31
|
-
var _b = useAppSelector(otpSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
32
|
-
var methods = useForm({
|
|
33
|
-
resolver: yupResolver(OTPValidation),
|
|
34
|
-
defaultValues: data.otpData,
|
|
35
|
-
mode: 'onChange'
|
|
36
|
-
});
|
|
37
|
-
var t = useTranslation().t;
|
|
38
|
-
var isAr = useLanguage().isAr;
|
|
39
|
-
React.useEffect(function () {
|
|
40
|
-
if (methods.formState.isValid)
|
|
41
|
-
dispatch(clearError());
|
|
42
|
-
return function () {
|
|
43
|
-
dispatch(resetOTPScreen());
|
|
44
|
-
};
|
|
45
|
-
}, [methods.formState.isValid]);
|
|
46
|
-
var disabled = !methods.formState.isValid || !!error;
|
|
47
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsx(FormStyled, { children: _jsx(OTPInput, { loading: false }) }) })) }));
|
|
48
|
-
};
|
|
49
|
-
export default React.memo(Verify);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
-
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
}>>>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface CloseDialogStyledProps {
|
|
3
|
-
message?: string;
|
|
4
|
-
confirmTitle: string;
|
|
5
|
-
closeTitle: string;
|
|
6
|
-
open: boolean;
|
|
7
|
-
onConfirm?: () => void;
|
|
8
|
-
onCancel?: () => void;
|
|
9
|
-
}
|
|
10
|
-
export default function CloseDialog({ message, confirmTitle, closeTitle, open, onConfirm, onCancel }: CloseDialogStyledProps): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
14
|
-
import Collapse from '../../../components/Collapse';
|
|
15
|
-
import Text from '../../../components/Text';
|
|
16
|
-
import Box from '@mui/material/Box';
|
|
17
|
-
var ConfirmCloseBox = styled(Box)(function (_a) {
|
|
18
|
-
var theme = _a.theme;
|
|
19
|
-
return ({
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
backgroundColor: theme.palette.common.white,
|
|
22
|
-
borderRadius: theme.spacing(1),
|
|
23
|
-
height: theme.spacing(5.5),
|
|
24
|
-
display: 'flex',
|
|
25
|
-
justifyContent: 'space-evenly',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
zIndex: 20,
|
|
28
|
-
width: '100%',
|
|
29
|
-
bottom: theme.spacing(2.625)
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
var DisableBoxStyled = styled(Box)(function (_a) {
|
|
33
|
-
var theme = _a.theme;
|
|
34
|
-
return ({
|
|
35
|
-
backgroundColor: alpha(theme.palette.common.black, 0.5),
|
|
36
|
-
zIndex: 10,
|
|
37
|
-
position: 'absolute',
|
|
38
|
-
top: 0,
|
|
39
|
-
left: 0,
|
|
40
|
-
width: '100%',
|
|
41
|
-
height: '100%',
|
|
42
|
-
borderRadius: theme.spacing(1.5)
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
var YesTextStyled = styled(Text)(function (_a) {
|
|
46
|
-
var theme = _a.theme;
|
|
47
|
-
return ({
|
|
48
|
-
color: theme.palette.primary.main,
|
|
49
|
-
cursor: 'pointer'
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
var NoTextStyled = styled(Text)(function (_a) {
|
|
53
|
-
var theme = _a.theme;
|
|
54
|
-
return ({
|
|
55
|
-
color: theme.palette.primary.dark,
|
|
56
|
-
cursor: 'pointer'
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
export default function CloseDialog(_a) {
|
|
60
|
-
var message = _a.message, confirmTitle = _a.confirmTitle, closeTitle = _a.closeTitle, open = _a.open, onConfirm = _a.onConfirm, onCancel = _a.onCancel;
|
|
61
|
-
return (_jsxs(Collapse, __assign({ in: open }, { children: [_jsx(Box, { children: _jsxs(ConfirmCloseBox, { children: [_jsxs(Text, { children: [" ", message] }), _jsx(YesTextStyled, __assign({ onClick: onConfirm }, { children: confirmTitle })), _jsx(NoTextStyled, __assign({ onClick: onCancel }, { children: closeTitle }))] }) }), _jsx(DisableBoxStyled, { id: 'disable-container' })] })));
|
|
62
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface DialogProps {
|
|
3
|
-
onClose?: () => void;
|
|
4
|
-
onConfirm?: () => void;
|
|
5
|
-
children: React.ReactElement;
|
|
6
|
-
isTapOrigin?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default function Dialog({ isTapOrigin, onClose, children, onConfirm }: DialogProps): JSX.Element;
|