@tap-payments/auth-jsconnect 2.10.13-beta → 2.10.13-development
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/README.md +2 -2
- package/build/@types/app.d.ts +4 -2
- package/build/@types/app.js +2 -0
- package/build/@types/form.d.ts +6 -0
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/terminal.d.ts +116 -0
- package/build/@types/terminal.js +1 -0
- package/build/api/auth.d.ts +10 -1
- package/build/api/entity.d.ts +3 -0
- package/build/api/index.d.ts +7 -1
- package/build/api/index.js +3 -1
- package/build/api/lead.d.ts +2 -1
- package/build/api/terminal.d.ts +28 -0
- package/build/api/terminal.js +45 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/store.d.ts +2 -0
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +6 -0
- package/build/assets/locales/ar.json +43 -6
- package/build/assets/locales/en.json +49 -9
- package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
- package/build/components/DeviceCard/DeviceCard.js +103 -0
- package/build/components/DeviceCard/index.d.ts +3 -0
- package/build/components/DeviceCard/index.js +2 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +13 -3
- package/build/constants/app.js +127 -6
- package/build/constants/assets.d.ts +11 -6
- package/build/constants/assets.js +118 -107
- package/build/constants/dummy.js +27 -20
- package/build/constants/flows.d.ts +15 -0
- package/build/constants/flows.js +15 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +143 -77
- package/build/features/app/business/businessStore.js +6 -4
- package/build/features/app/connectExpress/connectExpressStore.js +16 -10
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/app/terminal/terminalStore.d.ts +110 -0
- package/build/features/app/terminal/terminalStore.js +676 -0
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +14 -8
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/auth/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/auth/screens/AuthenticationList/validation.js +77 -1
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/BusinessType/BusinessType.js +12 -2
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -7
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +14 -9
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +77 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +10 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +21 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +44 -13
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/entity/screens/EntityName/EntityName.js +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +14 -3
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +72 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
- package/build/features/shared/PushNotification/PushNotification.js +34 -0
- package/build/features/shared/PushNotification/index.d.ts +2 -0
- package/build/features/shared/PushNotification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/terminal/Terminal.d.ts +14 -0
- package/build/features/terminal/Terminal.js +95 -0
- package/build/features/terminal/index.d.ts +1 -0
- package/build/features/terminal/index.js +1 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
- package/build/features/terminal/screens/Loading/Loading.js +10 -0
- package/build/features/terminal/screens/Loading/index.d.ts +2 -0
- package/build/features/terminal/screens/Loading/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
- package/build/features/terminal/screens/OperatorError/index.js +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +47 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
- package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
- package/build/features/terminal/screens/Verify/Verify.js +85 -0
- package/build/features/terminal/screens/Verify/index.d.ts +2 -0
- package/build/features/terminal/screens/Verify/index.js +2 -0
- package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
- package/build/features/terminal/screens/Verify/validation.js +4 -0
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +5 -0
- package/build/features/terminal/screens/shared/index.js +5 -0
- package/build/features/terminal/screens/shared/styles.d.ts +196 -0
- package/build/features/terminal/screens/shared/styles.js +155 -0
- package/build/features/terminal/screens/shared/utils.d.ts +7 -0
- package/build/features/terminal/screens/shared/utils.js +24 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/palette.js +12 -0
- package/build/theme/typography.js +4 -0
- package/build/utils/common.js +4 -4
- package/build/utils/string.d.ts +3 -2
- package/build/utils/string.js +10 -1
- package/package.json +2 -2
|
@@ -17,17 +17,19 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
20
|
+
import { deepCopy, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
|
+
import { LicenseType as LType } from '../../../../@types';
|
|
21
22
|
import Form from '../../../../components/Form';
|
|
22
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
24
|
import Button from '../../../shared/Button';
|
|
24
25
|
import { clearError, authSelector, createEntity, resetAuthenticationScreen, getMerchantList } from '../../../app/auth/authStore';
|
|
25
|
-
import { AuthenticationListValidationSchema } from './validation';
|
|
26
|
+
import { AuthenticationListValidationSchema, AuthenticationListSAValidationSchema } from './validation';
|
|
26
27
|
import BrandList from './BrandList';
|
|
27
28
|
import EntityList from './EntityList';
|
|
28
29
|
import EntityLegalName from './EntityLegalName';
|
|
29
30
|
import LicenseNumber from './LicenseNumber';
|
|
30
31
|
import LicenseType from './EntityLicenseType';
|
|
32
|
+
import UnifiedNumber from './UnifiedNumber';
|
|
31
33
|
var ListType;
|
|
32
34
|
(function (ListType) {
|
|
33
35
|
ListType["BrandList"] = "BrandList";
|
|
@@ -36,10 +38,11 @@ var ListType;
|
|
|
36
38
|
var AuthenticationList = function (_a) {
|
|
37
39
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
38
40
|
var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
39
|
-
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo;
|
|
41
|
+
var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo, unifiedNumber = _c.unifiedNumber;
|
|
40
42
|
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
41
43
|
var brandList = (data.responseData || {}).brandList;
|
|
42
44
|
var _e = React.useState(false), isAddEntity = _e[0], setIsAddEntity = _e[1];
|
|
45
|
+
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
43
46
|
React.useEffect(function () {
|
|
44
47
|
sendCustomEventToGTM({
|
|
45
48
|
event: 'Send Event',
|
|
@@ -48,20 +51,22 @@ var AuthenticationList = function (_a) {
|
|
|
48
51
|
});
|
|
49
52
|
}, []);
|
|
50
53
|
var methods = useForm({
|
|
51
|
-
resolver: yupResolver(AuthenticationListValidationSchema),
|
|
54
|
+
resolver: yupResolver(isSACountry ? AuthenticationListSAValidationSchema : AuthenticationListValidationSchema),
|
|
52
55
|
defaultValues: {
|
|
53
56
|
brandInfo: brandInfo,
|
|
54
|
-
entityInfo: entityInfo
|
|
57
|
+
entityInfo: entityInfo,
|
|
58
|
+
unifiedNumber: unifiedNumber
|
|
55
59
|
},
|
|
56
60
|
mode: 'onChange'
|
|
57
61
|
});
|
|
58
62
|
var t = useTranslation().t;
|
|
59
63
|
var isAr = useLanguage().isAr;
|
|
60
64
|
var dispatch = useAppDispatch();
|
|
65
|
+
var isCR = methods.watch('licenseType') === LType.CR;
|
|
61
66
|
var onSubmit = function (formData) {
|
|
62
67
|
if (isAddEntity) {
|
|
63
|
-
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
|
|
64
|
-
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
|
|
68
|
+
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType, unifiedNumber_1 = formData.unifiedNumber;
|
|
69
|
+
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType, unifiedNumber: unifiedNumber_1 };
|
|
65
70
|
dispatch(createEntity(deepCopy(data_1)));
|
|
66
71
|
return;
|
|
67
72
|
}
|
|
@@ -72,6 +77,7 @@ var AuthenticationList = function (_a) {
|
|
|
72
77
|
setIsAddEntity(false);
|
|
73
78
|
methods.setValue('licenseNumber', '');
|
|
74
79
|
methods.setValue('legalName', '');
|
|
80
|
+
methods.setValue('unifiedNumber', '');
|
|
75
81
|
methods.setValue('licenseType', '');
|
|
76
82
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
77
83
|
return;
|
|
@@ -91,6 +97,6 @@ var AuthenticationList = function (_a) {
|
|
|
91
97
|
};
|
|
92
98
|
var isBrandList = listActive === ListType.BrandList;
|
|
93
99
|
var isEntityList = listActive === ListType.EntityList;
|
|
94
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
100
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), isCR && isSACountry ? _jsx(UnifiedNumber, {}) : _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
95
101
|
};
|
|
96
102
|
export default React.memo(AuthenticationList);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
5
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
6
|
+
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
7
|
+
htmlColor?: string | undefined;
|
|
8
|
+
inheritViewBox?: boolean | undefined;
|
|
9
|
+
shapeRendering?: string | undefined;
|
|
10
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
11
|
+
titleAccess?: string | undefined;
|
|
12
|
+
viewBox?: string | undefined;
|
|
13
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
14
|
+
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
15
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
16
|
+
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
19
|
+
color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
|
|
20
|
+
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
21
|
+
htmlColor?: string | undefined;
|
|
22
|
+
inheritViewBox?: boolean | undefined;
|
|
23
|
+
shapeRendering?: string | undefined;
|
|
24
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
|
+
titleAccess?: string | undefined;
|
|
26
|
+
viewBox?: string | undefined;
|
|
27
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
28
|
+
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
29
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
|
+
interface UnifiedNumberProps {
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
isVerified?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: UnifiedNumberProps) => JSX.Element>;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
17
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
18
|
+
import Box from '@mui/material/Box';
|
|
19
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
22
|
+
import Tooltip from '../../../../components/Tooltip';
|
|
23
|
+
import Text from '../../../../components/Text';
|
|
24
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
+
import Input from '../../../shared/Input';
|
|
26
|
+
import { clearError, authSelector } from '../../../app/auth/authStore';
|
|
27
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
28
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
29
|
+
var theme = _a.theme;
|
|
30
|
+
return ({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
justifyContent: 'space-between',
|
|
33
|
+
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
39
|
+
});
|
|
40
|
+
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return ({
|
|
43
|
+
width: theme.spacing(2.75),
|
|
44
|
+
height: theme.spacing(2.125),
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
color: alpha(theme.palette.text.primary, 0.4),
|
|
47
|
+
display: 'inline-flex'
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return ({
|
|
53
|
+
width: theme.spacing(2.75),
|
|
54
|
+
height: theme.spacing(2.125),
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
color: alpha(theme.palette.text.primary, 0.4),
|
|
57
|
+
display: 'inline-flex'
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
var UnifiedNumber = function (_a) {
|
|
61
|
+
var _b;
|
|
62
|
+
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
63
|
+
var t = useTranslation().t;
|
|
64
|
+
var bckError = useAppSelector(authSelector).error;
|
|
65
|
+
var control = useFormContext().control;
|
|
66
|
+
var dispatch = useAppDispatch();
|
|
67
|
+
var _c = React.useState(false), hovered = _c[0], setHovered = _c[1];
|
|
68
|
+
var handleChange = function (_a) {
|
|
69
|
+
var target = _a.target;
|
|
70
|
+
if (bckError)
|
|
71
|
+
dispatch(clearError());
|
|
72
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
73
|
+
unifiedNumberControl.field.onChange(value);
|
|
74
|
+
};
|
|
75
|
+
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
76
|
+
var unifiedNumberValue = unifiedNumberControl.field.value;
|
|
77
|
+
var error = (_b = unifiedNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
78
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('v1_company_unified_number_label') }), _jsx(Tooltip, __assign({ title: t('v1_company_unified_number_description'), onMouseOver: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); }, onTouchStartCapture: function () { return setHovered(true); } }, { children: hovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('v1_company_unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) })] })));
|
|
79
|
+
};
|
|
80
|
+
export default React.memo(UnifiedNumber);
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
+
export declare const AuthenticationListSAValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
|
+
entityInfo: any;
|
|
5
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
|
+
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
+
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
+
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
11
|
+
entityInfo: any;
|
|
12
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
|
+
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
+
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
|
+
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
+
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
18
|
+
entityInfo: any;
|
|
19
|
+
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
20
|
+
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
+
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
22
|
+
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
|
+
}>>>;
|
|
2
24
|
export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
25
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
26
|
entityInfo: any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME } from '../../../../constants';
|
|
2
|
+
import { ADD_ENTITY, LICENSE_NUMBER_MIN_LENGTH, REGEX_LEGAL_NAME, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
3
|
+
import { LicenseType } from '../../../../@types';
|
|
3
4
|
var objectElements = {
|
|
4
5
|
id: yup.string().required(),
|
|
5
6
|
business_id: yup.string(),
|
|
@@ -11,6 +12,81 @@ var objectElements = {
|
|
|
11
12
|
number: yup.string()
|
|
12
13
|
})
|
|
13
14
|
};
|
|
15
|
+
export var AuthenticationListSAValidationSchema = yup.object().shape({
|
|
16
|
+
brandInfo: yup.object().required('auth_brand_required'),
|
|
17
|
+
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
18
|
+
licenseNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
19
|
+
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
20
|
+
if (!isAddEntity) {
|
|
21
|
+
return yup.string().optional();
|
|
22
|
+
}
|
|
23
|
+
return yup.string().test({
|
|
24
|
+
name: 'licenseNumber',
|
|
25
|
+
message: 'enter_license_number',
|
|
26
|
+
test: function (value) {
|
|
27
|
+
var type = this.parent.licenseType;
|
|
28
|
+
var isCR = type === LicenseType.CR;
|
|
29
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
30
|
+
if (!type)
|
|
31
|
+
return false;
|
|
32
|
+
if (isCR)
|
|
33
|
+
return true;
|
|
34
|
+
return length >= LICENSE_NUMBER_MIN_LENGTH;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}),
|
|
38
|
+
unifiedNumber: yup.string().when('entityInfo', function (entityInfo) {
|
|
39
|
+
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
40
|
+
if (!isAddEntity) {
|
|
41
|
+
return yup.string().optional();
|
|
42
|
+
}
|
|
43
|
+
return yup.string().test({
|
|
44
|
+
name: 'unifiedNumber',
|
|
45
|
+
message: 'unified_number_required',
|
|
46
|
+
test: function (value) {
|
|
47
|
+
var type = this.parent.licenseType;
|
|
48
|
+
var isFL = type === LicenseType.FL;
|
|
49
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
50
|
+
if (!type)
|
|
51
|
+
return false;
|
|
52
|
+
if (isFL)
|
|
53
|
+
return true;
|
|
54
|
+
return length >= UNIFIED_NUMBER_MIN_LENGTH;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}),
|
|
58
|
+
licenseType: yup
|
|
59
|
+
.string()
|
|
60
|
+
.when('entityInfo', function (entityInfo) {
|
|
61
|
+
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
62
|
+
if (!isAddEntity) {
|
|
63
|
+
return yup.string().optional();
|
|
64
|
+
}
|
|
65
|
+
return yup.string().required('choose_license_type');
|
|
66
|
+
})
|
|
67
|
+
.required(''),
|
|
68
|
+
legalName: yup
|
|
69
|
+
.string()
|
|
70
|
+
.when('entityInfo', function (entityInfo) {
|
|
71
|
+
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
72
|
+
if (!isAddEntity) {
|
|
73
|
+
return yup.string().optional();
|
|
74
|
+
}
|
|
75
|
+
return yup
|
|
76
|
+
.string()
|
|
77
|
+
.required('')
|
|
78
|
+
.test({
|
|
79
|
+
test: function (value) {
|
|
80
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
|
+
if (length === 0)
|
|
82
|
+
return true;
|
|
83
|
+
return (value === null || value === void 0 ? void 0 : value.match(REGEX_LEGAL_NAME)) && length >= 3 ? true : this.createError({ message: 'enter_valid_legal_name' });
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
.required('');
|
|
87
|
+
})
|
|
88
|
+
.required('')
|
|
89
|
+
});
|
|
14
90
|
export var AuthenticationListValidationSchema = yup.object().shape({
|
|
15
91
|
brandInfo: yup.object().required('auth_brand_required'),
|
|
16
92
|
entityInfo: yup.object().shape(objectElements).required('auth_entity_required'),
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export declare const PasscodeLoginStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
|
+
gutterBottom?: boolean | undefined;
|
|
7
|
+
noWrap?: boolean | undefined;
|
|
8
|
+
paragraph?: boolean | undefined;
|
|
9
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
10
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
|
|
12
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
13
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
4
15
|
declare const _default: React.MemoExoticComponent<() => JSX.Element>;
|
|
5
16
|
export default _default;
|
|
@@ -14,9 +14,9 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
16
|
import Box from '@mui/material/Box/Box';
|
|
17
|
-
import { styled } from '@mui/material/styles';
|
|
17
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
18
18
|
import Text from '../../../../components/Text';
|
|
19
|
-
import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
|
|
19
|
+
import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
|
|
20
20
|
import Button from '../../../shared/Button';
|
|
21
21
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
22
|
import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
|
|
@@ -46,8 +46,13 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
display: 'flex',
|
|
47
47
|
flexDirection: 'column'
|
|
48
48
|
}); });
|
|
49
|
+
export var PasscodeLoginStyled = styled(Text)(function (_a) {
|
|
50
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
51
|
+
return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(5), cursor: 'pointer' }));
|
|
52
|
+
});
|
|
49
53
|
var OTP = function () {
|
|
50
54
|
var _a;
|
|
55
|
+
var spacing = useTheme().spacing;
|
|
51
56
|
var dispatch = useAppDispatch();
|
|
52
57
|
var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
53
58
|
var t = useTranslation().t;
|
|
@@ -112,7 +117,14 @@ var OTP = function () {
|
|
|
112
117
|
screen = 'AUTH_EMAIL_STEP';
|
|
113
118
|
dispatch(handlePrevScreenStep(screen));
|
|
114
119
|
};
|
|
120
|
+
var onOTPLoginClick = function () {
|
|
121
|
+
if (isEmailAuth)
|
|
122
|
+
dispatch(createEmailAuth({ email: data.emailData.email }));
|
|
123
|
+
else
|
|
124
|
+
dispatch(createMobileAuth({ mobile: data.mobileData.mobile, countryCode: data.mobileData.countryCode }));
|
|
125
|
+
};
|
|
115
126
|
var disabled = !methods.formState.isValid;
|
|
116
|
-
|
|
127
|
+
var showLoginWithPasscode = data.passcodeData.allowOTPToPasscodeRedirection;
|
|
128
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), showLoginWithPasscode && _jsx(PasscodeLoginStyled, __assign({ onClick: onOTPLoginClick }, { children: st('login_with_passcode') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, (showLoginWithPasscode && { sx: { marginTop: spacing(2.25) } }), { children: t('next') }))] })) })) }));
|
|
117
129
|
};
|
|
118
130
|
export default React.memo(OTP);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OTPSignInStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
|
+
gutterBottom?: boolean | undefined;
|
|
7
|
+
noWrap?: boolean | undefined;
|
|
8
|
+
paragraph?: boolean | undefined;
|
|
9
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
10
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
|
|
12
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
13
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<() => JSX.Element>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
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/Box';
|
|
15
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
16
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
18
|
+
import Form from '../../../../components/Form';
|
|
19
|
+
import Text from '../../../../components/Text';
|
|
20
|
+
import { deepCopy } from '../../../../utils';
|
|
21
|
+
import Button from '../../../shared/Button';
|
|
22
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
|
+
import { AuthForType } from '../../../../@types';
|
|
25
|
+
import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
|
|
26
|
+
import { clearError, authSelector, verifyPasscode, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
|
|
27
|
+
import { validation } from './validation';
|
|
28
|
+
import PasscodeInput from './PasscodeInput';
|
|
29
|
+
var TitleContainerStyled = styled(Box)(function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return ({
|
|
32
|
+
background: theme.palette.common.white,
|
|
33
|
+
border: '1px solid',
|
|
34
|
+
borderColor: theme.palette.divider,
|
|
35
|
+
direction: theme.direction,
|
|
36
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
37
|
+
marginBottom: theme.spacing(5.75)
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
var TitleStyled = styled(Text)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
43
|
+
});
|
|
44
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column'
|
|
47
|
+
}); });
|
|
48
|
+
export var OTPSignInStyled = styled(Text)(function (_a) {
|
|
49
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
50
|
+
return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(11.625), cursor: 'pointer' }));
|
|
51
|
+
});
|
|
52
|
+
var Passcode = function () {
|
|
53
|
+
var spacing = useTheme().spacing;
|
|
54
|
+
var isAr = useLanguage().isAr;
|
|
55
|
+
var dispatch = useAppDispatch();
|
|
56
|
+
var st = useSanitizedTranslation();
|
|
57
|
+
var _a = useAppSelector(authSelector), _b = _a.data, passcodeData = _b.passcodeData, otpData = _b.otpData, emailData = _b.emailData, mobileData = _b.mobileData, loading = _a.loading, error = _a.error;
|
|
58
|
+
var methods = useForm({
|
|
59
|
+
resolver: yupResolver(validation),
|
|
60
|
+
defaultValues: passcodeData,
|
|
61
|
+
mode: 'onChange'
|
|
62
|
+
});
|
|
63
|
+
React.useEffect(function () {
|
|
64
|
+
if (error)
|
|
65
|
+
dispatch(clearError());
|
|
66
|
+
}, [methods.formState.isValid]);
|
|
67
|
+
var startWithEmail = otpData.authFor === AuthForType.EMAIL;
|
|
68
|
+
var onSubmit = function (formData) {
|
|
69
|
+
dispatch(verifyPasscode(deepCopy(formData)));
|
|
70
|
+
};
|
|
71
|
+
var onBack = function () {
|
|
72
|
+
dispatch(handlePrevScreenStep(startWithEmail ? 'AUTH_EMAIL_STEP' : 'AUTH_MOBILE_STEP'));
|
|
73
|
+
};
|
|
74
|
+
var onOTPLoginClick = function () {
|
|
75
|
+
if (startWithEmail)
|
|
76
|
+
dispatch(createEmailAuth({ email: emailData.email, skipPasscode: true }));
|
|
77
|
+
else
|
|
78
|
+
dispatch(createMobileAuth({ mobile: mobileData.mobile, countryCode: mobileData.countryCode, skipPasscode: true }));
|
|
79
|
+
};
|
|
80
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: loading ? st('ide_otp_waiting_title') : st('passcode_title') }) }), _jsx(PasscodeInput, { disableResend: true }), _jsx(OTPSignInStyled, __assign({ onClick: onOTPLoginClick }, { children: st('sign_in_with_otp') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: !methods.formState.isValid, isAr: isAr, loading: loading, error: st(error || ''), sx: { marginTop: spacing(2.5) } }, { children: st('next') }))] })) })) }));
|
|
81
|
+
};
|
|
82
|
+
export default React.memo(Passcode);
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { useController, useFormContext } from 'react-hook-form';
|
|
17
|
+
import OTPField from '../../../shared/OTP';
|
|
18
|
+
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
19
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
|
+
import { authSelector, clearError } from '../../../app/auth/authStore';
|
|
21
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return ({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
fontFamily: theme.typography.fontFamily
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
var PasscodeInput = function (_a) {
|
|
30
|
+
var disableResend = _a.disableResend;
|
|
31
|
+
var dispatch = useAppDispatch();
|
|
32
|
+
var control = useFormContext().control;
|
|
33
|
+
var error = useAppSelector(authSelector).error;
|
|
34
|
+
var _b = useController({ name: 'passcode', control: control }).field, value = _b.value, onChange = _b.onChange;
|
|
35
|
+
var handleOnPasscodeChange = function (passcode) {
|
|
36
|
+
if (error)
|
|
37
|
+
dispatch(clearError());
|
|
38
|
+
onChange(passcode);
|
|
39
|
+
};
|
|
40
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, __assign({}, (!disableResend && { timerInSeconds: DEFAULT_TIMER_VALUE }), { value: value, onChange: function (number) { return handleOnPasscodeChange(number.toString()); } })) })));
|
|
41
|
+
};
|
|
42
|
+
export default React.memo(PasscodeInput);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
passcode: 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
|
+
passcode: 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
|
+
passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>>;
|