@tap-payments/auth-jsconnect 1.0.35 → 1.0.38

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.
Files changed (102) hide show
  1. package/build/components/AnimationFlow/BottomSheet.js +26 -2
  2. package/build/components/OTPTimer/OTPTimer.js +4 -2
  3. package/build/constants/app.js +1 -1
  4. package/build/constants/validation.d.ts +1 -0
  5. package/build/constants/validation.js +1 -0
  6. package/build/features/app/business/businessStore.d.ts +1 -1
  7. package/build/features/app/business/businessStore.js +32 -23
  8. package/build/features/app/connect/connectStore.d.ts +1 -1
  9. package/build/features/app/connect/connectStore.js +17 -11
  10. package/build/features/business/screens/BusinessType/BusinessType.js +16 -23
  11. package/build/features/business/screens/BusinessType/CompanyLicense.js +23 -9
  12. package/build/features/business/screens/BusinessType/FreelanceLicense.js +23 -9
  13. package/build/features/business/screens/Confirm/Confirm.js +4 -3
  14. package/build/features/business/screens/OTP/OTPInput.js +1 -2
  15. package/build/features/business/screens/Verify/OTPInput.js +1 -2
  16. package/build/features/business/screens/Verify/Verify.js +3 -3
  17. package/build/features/connect/screens/Individual/Email.js +10 -1
  18. package/build/features/connect/screens/Individual/Individual.js +8 -10
  19. package/build/features/connect/screens/Individual/MobileNumber.js +3 -16
  20. package/build/features/connect/screens/Merchant/Merchant.js +11 -11
  21. package/build/features/connect/screens/Merchant/SocialMedia.js +2 -1
  22. package/build/features/connect/screens/Merchant/TAC.js +1 -1
  23. package/build/features/connect/screens/Merchant/validation.js +3 -2
  24. package/build/features/connect/screens/Mobile/BusinessCountry.js +1 -1
  25. package/build/features/connect/screens/Mobile/Mobile.js +1 -9
  26. package/build/features/connect/screens/Mobile/MobileNumber.js +3 -16
  27. package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
  28. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  29. package/build/features/connect/screens/NID/NID.js +1 -6
  30. package/build/features/connect/screens/OTP/OTP.js +2 -4
  31. package/build/features/connect/screens/Password/Password.js +1 -6
  32. package/build/features/shared/Button/Button.js +16 -11
  33. package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -5
  34. package/build/hooks/index.d.ts +1 -0
  35. package/build/hooks/index.js +1 -0
  36. package/build/hooks/useWindowSize.d.ts +6 -0
  37. package/build/hooks/useWindowSize.js +19 -0
  38. package/package.json +126 -126
  39. package/build/features/app/business/midStore.d.ts +0 -10
  40. package/build/features/app/business/midStore.js +0 -18
  41. package/build/features/app/connect/midStore.d.ts +0 -10
  42. package/build/features/app/connect/midStore.js +0 -18
  43. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +0 -5
  44. package/build/features/business/screens/VerifyNumber/OTPInput.js +0 -39
  45. package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +0 -13
  46. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +0 -76
  47. package/build/features/business/screens/VerifyNumber/index.d.ts +0 -3
  48. package/build/features/business/screens/VerifyNumber/index.js +0 -2
  49. package/build/features/business/screens/VerifyNumber/validation.d.ts +0 -8
  50. package/build/features/business/screens/VerifyNumber/validation.js +0 -4
  51. package/build/features/connect/screens/MID/BusinessCountry.d.ts +0 -11
  52. package/build/features/connect/screens/MID/BusinessCountry.js +0 -92
  53. package/build/features/connect/screens/MID/DOB.d.ts +0 -6
  54. package/build/features/connect/screens/MID/DOB.js +0 -38
  55. package/build/features/connect/screens/MID/IDNumber.d.ts +0 -7
  56. package/build/features/connect/screens/MID/IDNumber.js +0 -70
  57. package/build/features/connect/screens/MID/MID.d.ts +0 -5
  58. package/build/features/connect/screens/MID/MID.js +0 -87
  59. package/build/features/connect/screens/MID/MIDTitle.d.ts +0 -8
  60. package/build/features/connect/screens/MID/MIDTitle.js +0 -29
  61. package/build/features/connect/screens/MID/MobileNumber.d.ts +0 -12
  62. package/build/features/connect/screens/MID/MobileNumber.js +0 -148
  63. package/build/features/connect/screens/MID/index.d.ts +0 -3
  64. package/build/features/connect/screens/MID/index.js +0 -2
  65. package/build/features/connect/screens/MID/validation.d.ts +0 -18
  66. package/build/features/connect/screens/MID/validation.js +0 -15
  67. package/build/features/owner/Owner.d.ts +0 -6
  68. package/build/features/owner/Owner.js +0 -50
  69. package/build/features/owner/index.d.ts +0 -1
  70. package/build/features/owner/index.js +0 -1
  71. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +0 -8
  72. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +0 -77
  73. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +0 -10
  74. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +0 -80
  75. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +0 -6
  76. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +0 -40
  77. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +0 -6
  78. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +0 -45
  79. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +0 -6
  80. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +0 -35
  81. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +0 -6
  82. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +0 -45
  83. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +0 -9
  84. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +0 -85
  85. package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +0 -3
  86. package/build/features/owner/screens/AdditionalOwnerInfo/index.js +0 -2
  87. package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +0 -25
  88. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +0 -35
  89. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +0 -19
  90. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +0 -52
  91. package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +0 -3
  92. package/build/features/owner/screens/ShowOwnerInfo/index.js +0 -2
  93. package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +0 -7
  94. package/build/features/owner/screens/ShowOwnerInfo/info.js +0 -28
  95. package/build/features/owner/screens/Success/Success.d.ts +0 -5
  96. package/build/features/owner/screens/Success/Success.js +0 -14
  97. package/build/features/owner/screens/Success/index.d.ts +0 -3
  98. package/build/features/owner/screens/Success/index.js +0 -2
  99. package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +0 -7
  100. package/build/features/shared/ExpandIcon/ExpandIcon.js +0 -24
  101. package/build/features/shared/ExpandIcon/index.d.ts +0 -2
  102. package/build/features/shared/ExpandIcon/index.js +0 -2
@@ -1,70 +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 Box from '@mui/material/Box';
15
- import { useTranslation } from 'react-i18next';
16
- import { useController, useFormContext } from 'react-hook-form';
17
- import { styled, alpha } from '@mui/material/styles';
18
- import Text from '../../../../components/Text';
19
- import Tooltip from '@mui/material/Tooltip';
20
- import Icon from '../../../../components/Icon';
21
- import Input from '../../../shared/Input';
22
- import ClearIcon from '../../../shared/ClearIcon';
23
- import CheckIcon from '../../../shared/CheckIcon';
24
- import Collapse from '../../../../components/Collapse';
25
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
26
- import { removeAllCharsFromNumber } from '../../../../utils';
27
- import { ICONS_NAMES, ID_NUMBER_LENGTH } from '../../../../constants';
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.25, 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
- var IconStyled = styled(Icon)(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
- });
47
- });
48
- var IDNumber = React.forwardRef(function (_a, ref) {
49
- var _b;
50
- var onSwitchToMobileNumber = _a.onSwitchToMobileNumber, show = _a.show;
51
- var t = useTranslation().t;
52
- var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
53
- var nidControl = useController({ control: control, name: 'nid' });
54
- React.useEffect(function () {
55
- if (nidControl.field.value)
56
- setValue('nid', nidControl.field.value, { shouldValidate: true });
57
- }, [show]);
58
- var handleIdChange = function (_a) {
59
- var target = _a.target;
60
- var value = removeAllCharsFromNumber(target.value);
61
- nidControl.field.onChange(value);
62
- };
63
- var clearIdNumber = function () {
64
- nidControl.field.onChange('');
65
- };
66
- var nidValue = nidControl.field.value;
67
- var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
68
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('enter_national_id') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
69
- });
70
- export default React.memo(IDNumber);
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface MIDProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<({}: MIDProps) => JSX.Element>;
5
- export default _default;
@@ -1,87 +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 Box from '@mui/material/Box';
15
- import { useForm, FormProvider } from 'react-hook-form';
16
- import { yupResolver } from '@hookform/resolvers/yup';
17
- import { useTranslation } from 'react-i18next';
18
- import { styled } from '@mui/material/styles';
19
- import Collapse from '../../../../components/Collapse';
20
- import Form from '../../../../components/Form';
21
- import Button from '../../../shared/Button';
22
- import { useAppDispatch } from '../../../../hooks';
23
- import { handleNextScreenStep } from '../../../../app/settings';
24
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
- import { useLanguage } from '../../../../hooks';
26
- import MIDTitle from './MIDTitle';
27
- import MobileNumber from './MobileNumber';
28
- import IDNumber from './IDNumber';
29
- import BusinessCountry from './BusinessCountry';
30
- import { NIDValidationSchema, PhoneValidationSchema } from './validation';
31
- import { countriesCode, defaultCountry, businessCountries } from '../../../../constants/dummy';
32
- import DOB from './DOB';
33
- var FormStyled = styled(Form)(function () { return ({
34
- display: 'flex',
35
- flexDirection: 'column'
36
- }); });
37
- var InputsContainerStyled = styled(Box)(function (_a) {
38
- var _b;
39
- var theme = _a.theme, listActive = _a.listActive;
40
- return (_b = {
41
- paddingBottom: theme.spacing(listActive ? 0 : 5)
42
- },
43
- _b[theme.transitions.create(['padding-bottom'])] = {
44
- duration: theme.transitions.duration.standard
45
- },
46
- _b);
47
- });
48
- var ListType;
49
- (function (ListType) {
50
- ListType["BusinessList"] = "BusinessList";
51
- ListType["CountryCodeList"] = "CountryCodeList";
52
- })(ListType || (ListType = {}));
53
- var MID = function (_a) {
54
- var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
55
- var _c = React.useState(false), isNID = _c[0], setIsNID = _c[1];
56
- var _d = React.useState(10), mobileLength = _d[0], setMobileLength = _d[1];
57
- var _e = React.useState(), listType = _e[0], setListType = _e[1];
58
- var dispatch = useAppDispatch();
59
- var methods = useForm({
60
- resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(mobileLength)),
61
- defaultValues: {
62
- countryCode: defaultCountry,
63
- businessCountry: defaultCountry,
64
- nid: '',
65
- dob: '1998-08-22',
66
- mobile: null
67
- },
68
- mode: 'onChange'
69
- });
70
- var t = useTranslation().t;
71
- var isAr = useLanguage().isAr;
72
- var handleMenuListClick = function (flag) {
73
- setListType(flag);
74
- };
75
- var onSubmit = function (data) {
76
- console.log('data', data);
77
- dispatch(handleNextScreenStep());
78
- };
79
- var handleCollapseOpenClose = function (flag) {
80
- setCollapse(flag);
81
- };
82
- var isBusinessListActive = listType === ListType.BusinessList;
83
- var isCountryListActive = listType === ListType.CountryCodeList;
84
- var listActive = isBusinessListActive || isCountryListActive;
85
- return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('join_our_community'), description: t('ide_terms_and_conditions_description') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(BusinessCountry, { show: !isCountryListActive, setMobileLength: setMobileLength, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, setMobileLength: setMobileLength, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsxs(Collapse, __assign({ in: isNID }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(DOB, { onDateClicked: handleCollapseOpenClose }) }))] }))] })), _jsx(Collapse, __assign({ in: !listActive && !collapse }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
86
- };
87
- export default React.memo(MID);
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- interface MIDTitleProps {
3
- show: boolean;
4
- title: string;
5
- description: string;
6
- }
7
- declare const _default: React.MemoExoticComponent<({ description, show, title }: MIDTitleProps) => JSX.Element>;
8
- export default _default;
@@ -1,29 +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 { styled, alpha } from '@mui/material/styles';
15
- import Collapse from '../../../../components/Collapse';
16
- import Text from '../../../../components/Text';
17
- var TitleStyled = styled(Text)(function (_a) {
18
- var theme = _a.theme;
19
- return (__assign(__assign({ color: theme.palette.text.primary, textAlign: 'center' }, theme.typography.body1), { fontWeight: theme.typography.fontWeightMedium, lineHeight: 1.21, padding: theme.spacing(0, 3, 0, 3) }));
20
- });
21
- var DescriptionStyled = styled(Text)(function (_a) {
22
- var theme = _a.theme;
23
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { fontWeight: theme.typography.fontWeightRegular, lineHeight: 1.6, padding: theme.spacing(2, 3, 3, 3) }));
24
- });
25
- var MIDTitle = function (_a) {
26
- var description = _a.description, show = _a.show, title = _a.title;
27
- return (_jsxs(Collapse, __assign({ in: show }, { children: [_jsx(TitleStyled, { children: title }), _jsx(DescriptionStyled, { children: description })] })));
28
- };
29
- export default React.memo(MIDTitle);
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { CountryCode } from '../../../../@types';
3
- interface MobileNumberProps {
4
- countries: Array<CountryCode>;
5
- show: boolean;
6
- setMobileLength?: (length: number) => void;
7
- onSwitchToIdNumber?: () => void;
8
- onListOpen?: () => void;
9
- onListClose?: () => void;
10
- }
11
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MobileNumberProps & React.RefAttributes<unknown>>>;
12
- export default _default;
@@ -1,148 +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
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
- import * as React from 'react';
25
- import Box from '@mui/material/Box';
26
- import { useTranslation } from 'react-i18next';
27
- import { useController, useFormContext } from 'react-hook-form';
28
- import { styled, alpha } from '@mui/material/styles';
29
- import Text from '../../../../components/Text';
30
- import Collapse from '../../../../components/Collapse';
31
- import Tooltip from '@mui/material/Tooltip';
32
- import ClearIcon from '../../../shared/ClearIcon';
33
- import CheckIcon from '../../../shared/CheckIcon';
34
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
35
- import Icon from '../../../../components/Icon';
36
- import ExpandIcon from '../../../../components/ExpandIcon';
37
- import Input from '../../../shared/Input';
38
- import SimpleList from '../../../../components/SimpleList';
39
- import { ICONS_NAMES } from '../../../../constants';
40
- import { removeAllCharsFromNumber } from '../../../../utils';
41
- import { useLanguage } from '../../../../hooks';
42
- var IconStyled = styled(Icon)(function (_a) {
43
- var theme = _a.theme;
44
- return ({
45
- width: theme.spacing(2.75),
46
- height: theme.spacing(2.125),
47
- cursor: 'pointer'
48
- });
49
- });
50
- var LabelContainerStyled = styled(Box)(function (_a) {
51
- var theme = _a.theme;
52
- return ({
53
- display: 'flex',
54
- justifyContent: 'space-between',
55
- padding: theme.spacing(0, 2.5, 1.25, 2.5)
56
- });
57
- });
58
- var CountryItemContainer = styled(Box)(function () { return ({
59
- display: 'flex'
60
- }); });
61
- var CountryCodeText = styled(Text, {
62
- shouldForwardProp: function (prop) { return prop !== 'isSelected'; }
63
- })(function (_a) {
64
- var theme = _a.theme, isSelected = _a.isSelected;
65
- return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), textAlign: 'start', fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
66
- });
67
- var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
68
- var theme = _a.theme, isSelected = _a.isSelected;
69
- return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
70
- });
71
- var CountryCodeStyled = styled(Text)(function (_a) {
72
- var theme = _a.theme;
73
- return (__assign(__assign({ cursor: 'pointer' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightRegular, display: 'flex', alignItems: 'center', minWidth: theme.spacing(8.75) }));
74
- });
75
- var InputLabelStyled = styled(Text)(function (_a) {
76
- var theme = _a.theme;
77
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
78
- });
79
- var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
80
- var theme = _a.theme;
81
- return ({
82
- marginInlineStart: theme.spacing(1)
83
- });
84
- });
85
- var MobileNumber = React.forwardRef(function (_a, ref) {
86
- var _b, _c, _d;
87
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
88
- var countriesCode = React.useState(countries)[0];
89
- var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
90
- var t = useTranslation().t;
91
- var isAr = useLanguage().isAr;
92
- var _f = useFormContext(), control = _f.control, setValue = _f.setValue, getValues = _f.getValues;
93
- var phoneControl = useController({ name: 'mobile', control: control });
94
- var countryCodeControl = useController({ name: 'countryCode', control: control });
95
- var businessCountry = getValues('businessCountry');
96
- React.useEffect(function () {
97
- var _a;
98
- if (phoneControl.field.value) {
99
- setValue('mobile', phoneControl.field.value, { shouldValidate: true });
100
- }
101
- if (countryCodeControl.field.value) {
102
- var country = countryCodeControl.field.value;
103
- setValue('countryCode', country, { shouldValidate: true });
104
- (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
105
- }
106
- }, []);
107
- React.useEffect(function () {
108
- var _a;
109
- var mobile = phoneControl.field.value;
110
- if (mobile == null) {
111
- setValue('countryCode', businessCountry);
112
- (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.digits) || 10);
113
- }
114
- }, [businessCountry]);
115
- var onPhoneNumberChange = function (_a) {
116
- var target = _a.target;
117
- var value = removeAllCharsFromNumber(target.value);
118
- phoneControl.field.onChange(value);
119
- };
120
- var clearMobileNumber = function () {
121
- phoneControl.field.onChange('');
122
- };
123
- var onOpenCountryList = function (event) {
124
- var _a;
125
- setAnchorEl(event.currentTarget);
126
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
127
- };
128
- var onCloseCountryList = function () {
129
- var _a;
130
- setAnchorEl(null);
131
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
132
- };
133
- var onSelectItem = function (country) {
134
- var _a;
135
- onCloseCountryList();
136
- setValue('mobile', '');
137
- (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
138
- countryCodeControl.field.onChange(country);
139
- };
140
- var countryCodeValue = countryCodeControl.field.value;
141
- var mobileValue = phoneControl.field.value || '';
142
- var countryName = (isAr ? (_b = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _c === void 0 ? void 0 : _c.english) || '';
143
- var error = (_d = phoneControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
144
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_enter_mobile') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
145
- return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
146
- } }) }))] })) })));
147
- });
148
- export default React.memo(MobileNumber);
@@ -1,3 +0,0 @@
1
- import MID, { MIDProps } from './MID';
2
- export type { MIDProps };
3
- export default MID;
@@ -1,2 +0,0 @@
1
- import MID from './MID';
2
- export default MID;
@@ -1,18 +0,0 @@
1
- import * as yup from 'yup';
2
- export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
- nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
- nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
- nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
- }>>>;
12
- export declare const PhoneValidationSchema: (length: number) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
- mobile: 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
- mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
- }>>>;
@@ -1,15 +0,0 @@
1
- import * as yup from 'yup';
2
- export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('enter_valid_birth_date'),
4
- nid: yup
5
- .string()
6
- .matches(/^(1)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
7
- .min(8, 'signup_invalid_national_id_format')
8
- .max(10, 'signup_invalid_national_id_format')
9
- .required('signup_invalid_national_id')
10
- });
11
- export var PhoneValidationSchema = function (length) {
12
- return yup.object().shape({
13
- mobile: yup.string().length(length, 'enter_valid_mobile_number').required('mobile_number_error')
14
- });
15
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export interface OwnerLibProps {
3
- }
4
- export declare function OwnerLib(props: OwnerLibProps): JSX.Element;
5
- export declare function renderOwnerLib(config: OwnerLibProps, elementId: string): void;
6
- export declare function unmountOwnerLib(elementId: string): void;
@@ -1,50 +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 React, { memo, useEffect } from 'react';
14
- import { useTranslation } from 'react-i18next';
15
- import { useAppTheme, useAppDispatch, useAppSelector } from '../../hooks';
16
- import { handleActiveFlowScreens, settingsSelector } from '../../app/settings';
17
- import AnimationFlow from '../../components/AnimationFlow';
18
- import { store } from '../../app/store';
19
- import { ReduxProvider, ThemeProvider } from '../../components/Providers';
20
- import Collapse from '../../components/Collapse';
21
- import { reactElement } from '../../utils';
22
- import { OWNER_SCREENS_NAVIGATION } from '../../constants';
23
- import { ownerFeatureScreens } from '../featuresScreens';
24
- import CustomFooter from '../shared/Footer';
25
- import { FeatureContainer } from '../shared/Containers';
26
- var Owner = memo(function (props) {
27
- var open = React.useState(true)[0];
28
- var t = useTranslation().t;
29
- var theme = useAppTheme().theme;
30
- var dispatch = useAppDispatch();
31
- var data = useAppSelector(settingsSelector).data;
32
- var activeScreen = data.activeScreen;
33
- useEffect(function () {
34
- dispatch(handleActiveFlowScreens(OWNER_SCREENS_NAVIGATION));
35
- }, []);
36
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: ownerFeatureScreens.map(function (_a, index) {
37
- var Element = _a.element, name = _a.name;
38
- var isActive = activeScreen.name === name;
39
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
40
- }) }) })) })));
41
- });
42
- export function OwnerLib(props) {
43
- return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Owner, __assign({}, props)) })));
44
- }
45
- export function renderOwnerLib(config, elementId) {
46
- reactElement(elementId).render(_jsx(OwnerLib, __assign({}, config)));
47
- }
48
- export function unmountOwnerLib(elementId) {
49
- reactElement(elementId).unmount();
50
- }
@@ -1 +0,0 @@
1
- export * from './Owner';
@@ -1 +0,0 @@
1
- export * from './Owner';
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- export interface AdditionalOwnerInfoProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<{
5
- ({}: AdditionalOwnerInfoProps): JSX.Element;
6
- defaultProps: {};
7
- }>;
8
- export default _default;
@@ -1,77 +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 { yupResolver } from '@hookform/resolvers/yup';
15
- import { useForm, FormProvider } from 'react-hook-form';
16
- import Box from '@mui/material/Box';
17
- import { useTranslation } from 'react-i18next';
18
- import { useAppDispatch } from '../../../../hooks';
19
- import { handleNextScreenStep } from '../../../../app/settings';
20
- import { styled } from '@mui/material/styles';
21
- import Form from '../../../../components/Form';
22
- import Collapse from '../../../../components/Collapse';
23
- import Button from '../../../shared/Button';
24
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
- import { useLanguage } from '../../../../hooks';
26
- import PEPSwitch from './PEPSwitch';
27
- import { OwnerInfoValidationSchema } from './validation';
28
- import InfluencerSwitch from './InfluencerSwitch';
29
- import MonthlyIncome from './MonthlyIncome';
30
- import EmployerName from './EmployerName';
31
- import EmployerLocation from './EmployerLocation';
32
- import SourceOfIncome from './SourceOfIncome';
33
- import { countriesCode, SOURCE_OF_INCOME } from '../../../../constants';
34
- var InputsContainerStyled = styled(Box)(function (_a) {
35
- var _b;
36
- var theme = _a.theme, listActive = _a.listActive;
37
- return (_b = {
38
- paddingBottom: theme.spacing(listActive ? 0 : 5),
39
- overflow: 'hidden',
40
- maxHeight: 'calc(100vh - 250px)'
41
- },
42
- _b[theme.transitions.create(['padding-bottom'])] = {
43
- duration: theme.transitions.duration.standard
44
- },
45
- _b);
46
- });
47
- var AdditionalOwnerInfo = function (_a) {
48
- var methods = useForm({
49
- resolver: yupResolver(OwnerInfoValidationSchema),
50
- defaultValues: {
51
- monthlyIncome: '',
52
- employerName: '',
53
- isPEP: null,
54
- isInfluencer: null
55
- },
56
- mode: 'onChange'
57
- });
58
- var t = useTranslation().t;
59
- var isAr = useLanguage().isAr;
60
- var dispatch = useAppDispatch();
61
- var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
62
- var _c = React.useState(false), employerFieldsActive = _c[0], setEmployerFieldsActive = _c[1];
63
- var onSubmit = function (data) {
64
- console.log('data', data);
65
- dispatch(handleNextScreenStep());
66
- };
67
- var handleSelectSource = function (country) {
68
- var _a;
69
- if (((_a = country.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary')
70
- setEmployerFieldsActive(true);
71
- else
72
- setEmployerFieldsActive(false);
73
- };
74
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SourceOfIncome, { show: !listActive, list: SOURCE_OF_INCOME, onSelectSource: handleSelectSource }), _jsx(MonthlyIncome, { show: !listActive }), _jsx(EmployerName, { show: !listActive && employerFieldsActive }), _jsx(EmployerLocation, { show: employerFieldsActive, countries: countriesCode, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) })) }));
75
- };
76
- export default React.memo(AdditionalOwnerInfo);
77
- AdditionalOwnerInfo.defaultProps = {};
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { CountryCode } from '../../../../@types';
3
- interface EmployerLocationProps {
4
- countries: Array<CountryCode>;
5
- show: boolean;
6
- onListOpen?: () => void;
7
- onListClose?: () => void;
8
- }
9
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<EmployerLocationProps & React.RefAttributes<unknown>>>;
10
- export default _default;