@tap-payments/auth-jsconnect 1.0.14 → 1.0.16

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 (90) hide show
  1. package/build/assets/locales/ar.json +18 -8
  2. package/build/assets/locales/en.json +11 -1
  3. package/build/components/DatePicker/DatePicker.js +5 -16
  4. package/build/components/ExpandIcon/ExpandIcon.d.ts +7 -0
  5. package/build/components/ExpandIcon/ExpandIcon.js +24 -0
  6. package/build/components/ExpandIcon/index.d.ts +2 -0
  7. package/build/components/ExpandIcon/index.js +2 -0
  8. package/build/components/Footer/Footer.js +1 -1
  9. package/build/components/Warning/Warning.d.ts +1 -2
  10. package/build/components/Warning/Warning.js +1 -2
  11. package/build/constants/app.d.ts +1 -1
  12. package/build/constants/app.js +8 -8
  13. package/build/constants/dummy.js +3 -3
  14. package/build/features/bank/screens/BankDetails/Beneficiary.js +2 -2
  15. package/build/features/bank/screens/BankDetails/validation.js +4 -4
  16. package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -16
  17. package/build/features/business/screens/Activities/ActivitiesList.js +3 -17
  18. package/build/features/business/screens/BusinessType/CRNumber.js +2 -1
  19. package/build/features/business/screens/BusinessType/CompanyLicense.js +1 -1
  20. package/build/features/business/screens/BusinessType/FLNumber.js +2 -1
  21. package/build/features/business/screens/BusinessType/FreelanceLicense.js +1 -1
  22. package/build/features/business/screens/BusinessType/validation.js +2 -8
  23. package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -24
  24. package/build/features/business/screens/Customers/CustomerLocations.js +3 -17
  25. package/build/features/business/screens/Customers/ExpectedCustomers.js +4 -2
  26. package/build/features/business/screens/Customers/ExpectedSalesRange.js +4 -2
  27. package/build/features/business/screens/Customers/validation.js +1 -1
  28. package/build/features/business/screens/IDBOD/DOB.js +3 -11
  29. package/build/features/business/screens/IDBOD/validation.js +1 -0
  30. package/build/features/business/screens/OTP/OTPInput.js +1 -0
  31. package/build/features/business/screens/OTP/validation.js +1 -1
  32. package/build/features/business/screens/VerifyNumber/OTPInput.js +1 -0
  33. package/build/features/business/screens/VerifyNumber/validation.js +1 -1
  34. package/build/features/connect/screens/Individual/Name.js +2 -2
  35. package/build/features/connect/screens/MID/BusinessCountry.d.ts +1 -0
  36. package/build/features/connect/screens/MID/BusinessCountry.js +1 -1
  37. package/build/features/connect/screens/MID/DOB.d.ts +6 -0
  38. package/build/features/connect/screens/MID/DOB.js +38 -0
  39. package/build/features/connect/screens/MID/IDNumber.js +3 -14
  40. package/build/features/connect/screens/MID/MID.js +13 -7
  41. package/build/features/connect/screens/MID/MobileNumber.d.ts +1 -0
  42. package/build/features/connect/screens/MID/MobileNumber.js +28 -10
  43. package/build/features/connect/screens/MID/validation.d.ts +1 -1
  44. package/build/features/connect/screens/MID/validation.js +3 -2
  45. package/build/features/connect/screens/Merchant/SocialMedia.js +1 -1
  46. package/build/features/connect/screens/OTP/OTPInput.js +1 -0
  47. package/build/features/connect/screens/OTP/validation.js +1 -1
  48. package/build/features/connect/screens/Password/PasswordInput.js +1 -1
  49. package/build/features/connect/screens/Password/validation.js +1 -1
  50. package/build/features/featuresScreens.d.ts +1 -1
  51. package/build/features/featuresScreens.js +9 -9
  52. package/build/features/individual/Individual.d.ts +6 -0
  53. package/build/features/individual/Individual.js +50 -0
  54. package/build/features/individual/index.d.ts +1 -0
  55. package/build/features/individual/index.js +1 -0
  56. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +8 -0
  57. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +81 -0
  58. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +10 -0
  59. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +81 -0
  60. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +6 -0
  61. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +40 -0
  62. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +6 -0
  63. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +45 -0
  64. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +6 -0
  65. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +36 -0
  66. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -0
  67. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +45 -0
  68. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +9 -0
  69. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +87 -0
  70. package/build/features/individual/screens/AdditionalIndividualInfo/index.d.ts +3 -0
  71. package/build/features/individual/screens/AdditionalIndividualInfo/index.js +2 -0
  72. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -0
  73. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +35 -0
  74. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +19 -0
  75. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +52 -0
  76. package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +3 -0
  77. package/build/features/individual/screens/ShowIndividualInfo/index.js +2 -0
  78. package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +7 -0
  79. package/build/features/individual/screens/ShowIndividualInfo/info.js +28 -0
  80. package/build/features/individual/screens/Success/Success.d.ts +5 -0
  81. package/build/features/individual/screens/Success/Success.js +14 -0
  82. package/build/features/individual/screens/Success/index.d.ts +3 -0
  83. package/build/features/individual/screens/Success/index.js +2 -0
  84. package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +4 -1
  85. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +2 -8
  86. package/build/features/password/screens/CreatePassword/Password.js +1 -1
  87. package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -1
  88. package/build/index.d.ts +3 -3
  89. package/build/index.js +4 -4
  90. package/package.json +120 -120
@@ -0,0 +1,50 @@
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 { INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
23
+ import { individualFeatureScreens } from '../featuresScreens';
24
+ import CustomFooter from '../shared/Footer';
25
+ import { FeatureContainer } from '../shared/Containers';
26
+ var Individual = 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(INDIVIDUAL_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: individualFeatureScreens.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 IndividualLib(props) {
43
+ return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Individual, __assign({}, props)) })));
44
+ }
45
+ export function renderIndividualLib(config, elementId) {
46
+ reactElement(elementId).render(_jsx(IndividualLib, __assign({}, config)));
47
+ }
48
+ export function unmountIndividualLib(elementId) {
49
+ reactElement(elementId).unmount();
50
+ }
@@ -0,0 +1 @@
1
+ export * from './Individual';
@@ -0,0 +1 @@
1
+ export * from './Individual';
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface AdditionalIndividualInfoProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<{
5
+ ({}: AdditionalIndividualInfoProps): JSX.Element;
6
+ defaultProps: {};
7
+ }>;
8
+ export default _default;
@@ -0,0 +1,81 @@
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 { IndividualInfoValidationSchema } 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
+ overflowY: 'scroll',
40
+ maxHeight: 'calc(100vh - 250px)',
41
+ '&::-webkit-scrollbar': {
42
+ display: 'none'
43
+ }
44
+ },
45
+ _b[theme.transitions.create(['padding-bottom'])] = {
46
+ duration: theme.transitions.duration.standard
47
+ },
48
+ _b);
49
+ });
50
+ var AdditionalIndividualInfo = function (_a) {
51
+ var methods = useForm({
52
+ resolver: yupResolver(IndividualInfoValidationSchema),
53
+ defaultValues: {
54
+ monthlyIncome: '',
55
+ employerName: '',
56
+ isPEP: null,
57
+ isInfluencer: null
58
+ },
59
+ mode: 'onChange'
60
+ });
61
+ var t = useTranslation().t;
62
+ var isAr = useLanguage().isAr;
63
+ var dispatch = useAppDispatch();
64
+ var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
65
+ var _c = React.useState(false), employerFieldsActive = _c[0], setEmployerFieldsActive = _c[1];
66
+ var onSubmit = function (data) {
67
+ console.log('data', data);
68
+ dispatch(handleNextScreenStep());
69
+ };
70
+ var handleSelectSource = function (country) {
71
+ var _a;
72
+ if (((_a = country.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary')
73
+ setEmployerFieldsActive(true);
74
+ else {
75
+ setEmployerFieldsActive(false);
76
+ }
77
+ };
78
+ 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') })) }))] })) })) }));
79
+ };
80
+ export default React.memo(AdditionalIndividualInfo);
81
+ AdditionalIndividualInfo.defaultProps = {};
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,81 @@
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from 'react';
25
+ import Box from '@mui/material/Box';
26
+ import { styled } from '@mui/material/styles';
27
+ import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
29
+ import Text from '../../../../components/Text';
30
+ import Collapse from '../../../../components/Collapse';
31
+ import ExpandIcon from '../../../../components/ExpandIcon';
32
+ import CheckIcon from '@mui/icons-material/Check';
33
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
34
+ import Input from '../../../shared/Input';
35
+ import SimpleList from '../../../../components/SimpleList';
36
+ import { useLanguage } from '../../../../hooks';
37
+ var CountryItemContainer = styled(Box)(function () { return ({
38
+ display: 'flex'
39
+ }); });
40
+ var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
41
+ var theme = _a.theme, isSelected = _a.isSelected;
42
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
43
+ });
44
+ var CheckIconStyled = styled(CheckIcon)(function (_a) {
45
+ var theme = _a.theme;
46
+ return ({
47
+ color: theme.palette.success.main,
48
+ display: 'flex',
49
+ alignItems: 'flex-end'
50
+ });
51
+ });
52
+ var EmployerLocation = React.forwardRef(function (_a, ref) {
53
+ var _b, _c, _d;
54
+ var countries = _a.countries, rest = __rest(_a, ["countries"]);
55
+ var locationCountries = React.useState(countries)[0];
56
+ var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
57
+ var t = useTranslation().t;
58
+ var isAr = useLanguage().isAr;
59
+ var control = useFormContext().control;
60
+ var employerLocationControl = useController({ control: control, name: 'employerLocation' });
61
+ var onOpenCountrySelect = function (event) {
62
+ var _a;
63
+ setAnchorEl(event.currentTarget);
64
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
65
+ };
66
+ var onCloseCountrySelect = function () {
67
+ var _a;
68
+ setAnchorEl(null);
69
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
70
+ };
71
+ var onSelectItem = function (country) {
72
+ onCloseCountrySelect();
73
+ employerLocationControl.field.onChange(country);
74
+ };
75
+ var location = employerLocationControl.field.value;
76
+ var error = (_b = employerLocationControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
77
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_employer_address_city'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_employee_location'), value: (isAr ? (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.arabic : (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
78
+ return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIconStyled, {})] }));
79
+ } }) }))] })) })));
80
+ });
81
+ export default React.memo(EmployerLocation);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface EmployerNameProps {
3
+ show: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ show }: EmployerNameProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,40 @@
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 { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { removeOnlyNumbers } from '../../../../utils';
17
+ import { ScreenContainer } from '../../../shared/Containers';
18
+ import Input from '../../../shared/Input';
19
+ import CheckIcon from '../../../shared/CheckIcon';
20
+ import Collapse from '../../../../components/Collapse';
21
+ import ClearIcon from '../../../shared/ClearIcon';
22
+ var EmployerName = function (_a) {
23
+ var _b;
24
+ var show = _a.show;
25
+ var t = useTranslation().t;
26
+ var control = useFormContext().control;
27
+ var employerNameControl = useController({ control: control, name: 'employerName' });
28
+ var handleEmployerNameChange = function (_a) {
29
+ var target = _a.target;
30
+ var value = removeOnlyNumbers(target.value);
31
+ employerNameControl.field.onChange(value);
32
+ };
33
+ var employerNameValue = employerNameControl.field.value;
34
+ var error = (_b = employerNameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
35
+ var clearValue = function () {
36
+ employerNameControl.field.onChange('');
37
+ };
38
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { pt: 2.5 } }, { children: _jsx(Input, { required: true, label: t('tap_js_employer_name'), onChange: handleEmployerNameChange, value: employerNameValue, endAdornment: !error && employerNameValue ? _jsx(CheckIcon, {}) : employerNameValue && _jsx(ClearIcon, { onClick: clearValue }), placeholder: t('tap_js_enter_employer_name'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
39
+ };
40
+ export default React.memo(EmployerName);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface InfluencerSwitchProps {
3
+ show: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ show }: InfluencerSwitchProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,45 @@
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 { useFormContext, useController } from 'react-hook-form';
16
+ import { ScreenContainer } from '../../../shared/Containers';
17
+ import Collapse from '../../../../components/Collapse';
18
+ import { styled, alpha } from '@mui/material/styles';
19
+ import Mandatory from '../../../shared/Mandatory';
20
+ import Text from '../../../../components/Text';
21
+ import RadioGroup from '../../../../components/RadioGroup';
22
+ import RadioLabel from '../../../../components/RadioLabel';
23
+ var LabelTextStyled = styled(Text)(function (_a) {
24
+ var theme = _a.theme;
25
+ return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
26
+ });
27
+ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
28
+ var theme = _a.theme;
29
+ return ({
30
+ marginInlineStart: theme.spacing(0.25)
31
+ });
32
+ });
33
+ var InfluencerSwitch = function (_a) {
34
+ var show = _a.show;
35
+ var control = useFormContext().control;
36
+ var t = useTranslation().t;
37
+ var influencerControl = useController({ name: 'isInfluencer', control: control });
38
+ var handleOnChange = function (_a) {
39
+ var target = _a.target;
40
+ influencerControl.field.onChange(target.value === 'yes');
41
+ };
42
+ var influencerValue = influencerControl.field.value;
43
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
44
+ };
45
+ export default React.memo(InfluencerSwitch);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface MonthlyIncomeProps {
3
+ show: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ show }: MonthlyIncomeProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,36 @@
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 { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { removeAllCharsFromNumber } from '../../../../utils';
17
+ import { ScreenContainer } from '../../../shared/Containers';
18
+ import Input from '../../../shared/Input';
19
+ import CheckIcon from '../../../shared/CheckIcon';
20
+ import Collapse from '../../../../components/Collapse';
21
+ var MonthlyIncome = function (_a) {
22
+ var _b;
23
+ var show = _a.show;
24
+ var t = useTranslation().t;
25
+ var control = useFormContext().control;
26
+ var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
27
+ var handleMonthlyIncomeChange = function (_a) {
28
+ var target = _a.target;
29
+ var value = removeAllCharsFromNumber(target.value);
30
+ monthlyIncomeControl.field.onChange(value);
31
+ };
32
+ var monthlyIncomeValue = monthlyIncomeControl.field.value;
33
+ var error = (_b = monthlyIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
34
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('please_enter_actual_income'), onChange: handleMonthlyIncomeChange, value: monthlyIncomeValue, endAdornment: monthlyIncomeValue && _jsx(CheckIcon, {}), placeholder: '0', warningType: 'alert', warningMessage: error && t(error) }) }) })));
35
+ };
36
+ export default React.memo(MonthlyIncome);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface PEPSwitchProps {
3
+ show: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ show }: PEPSwitchProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,45 @@
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 { useFormContext, useController } from 'react-hook-form';
16
+ import { styled, alpha } from '@mui/material/styles';
17
+ import { ScreenContainer } from '../../../shared/Containers';
18
+ import Collapse from '../../../../components/Collapse';
19
+ import Mandatory from '../../../shared/Mandatory';
20
+ import Text from '../../../../components/Text';
21
+ import RadioGroup from '../../../../components/RadioGroup';
22
+ import RadioLabel from '../../../../components/RadioLabel';
23
+ var LabelTextStyled = styled(Text)(function (_a) {
24
+ var theme = _a.theme;
25
+ return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
26
+ });
27
+ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
28
+ var theme = _a.theme;
29
+ return ({
30
+ marginInlineStart: theme.spacing(0.25)
31
+ });
32
+ });
33
+ var PEPSwitch = function (_a) {
34
+ var show = _a.show;
35
+ var control = useFormContext().control;
36
+ var t = useTranslation().t;
37
+ var pepControl = useController({ name: 'isPEP', control: control });
38
+ var handleOnChange = function (_a) {
39
+ var target = _a.target;
40
+ pepControl.field.onChange(target.value === 'yes');
41
+ };
42
+ var pepValue = pepControl.field.value;
43
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
44
+ };
45
+ export default React.memo(PEPSwitch);
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { SourceOfIncome as SourceOfIncomeType } from '../../../../@types';
3
+ interface SourceOfIncomeProps {
4
+ list: Array<SourceOfIncomeType>;
5
+ show: boolean;
6
+ onSelectSource?: (country: SourceOfIncomeType) => void;
7
+ }
8
+ declare const _default: React.MemoExoticComponent<({ list, ...rest }: SourceOfIncomeProps) => JSX.Element>;
9
+ export default _default;
@@ -0,0 +1,87 @@
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from 'react';
25
+ import Box from '@mui/material/Box';
26
+ import { styled } from '@mui/material/styles';
27
+ import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
29
+ import Text from '../../../../components/Text';
30
+ import Collapse from '../../../../components/Collapse';
31
+ import CheckIcon from '@mui/icons-material/Check';
32
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
33
+ import Input from '../../../shared/Input';
34
+ import ExpandIcon from '../../../../components/ExpandIcon';
35
+ import SimpleList from '../../../../components/SimpleList';
36
+ import { useLanguage } from '../../../../hooks';
37
+ var Container = styled(Box)(function () { return ({
38
+ display: 'flex'
39
+ }); });
40
+ var SimpleListStyled = styled((SimpleList))(function (_a) {
41
+ var theme = _a.theme;
42
+ return ({
43
+ height: 'fit-content',
44
+ backgroundColor: theme.palette.common.white,
45
+ borderBottom: "".concat(theme.spacing(0.125), " solid ").concat(theme.palette.divider)
46
+ });
47
+ });
48
+ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
49
+ var theme = _a.theme, isSelected = _a.isSelected;
50
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
51
+ });
52
+ var CheckIconStyled = styled(CheckIcon)(function (_a) {
53
+ var theme = _a.theme;
54
+ return ({
55
+ color: theme.palette.success.main,
56
+ display: 'flex',
57
+ alignItems: 'flex-end'
58
+ });
59
+ });
60
+ var SourceOfIncome = function (_a) {
61
+ var _b;
62
+ var list = _a.list, rest = __rest(_a, ["list"]);
63
+ var sourceList = React.useState(list)[0];
64
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
65
+ var t = useTranslation().t;
66
+ var isAr = useLanguage().isAr;
67
+ var control = useFormContext().control;
68
+ var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
69
+ var onOpenList = function (event) {
70
+ setAnchorEl(event.currentTarget);
71
+ };
72
+ var onCloseList = function () {
73
+ setAnchorEl(null);
74
+ };
75
+ var onSelectItem = function (country) {
76
+ var _a;
77
+ onCloseList();
78
+ (_a = rest.onSelectSource) === null || _a === void 0 ? void 0 : _a.call(rest, country);
79
+ sourceIncomeControl.field.onChange(country);
80
+ };
81
+ var source = sourceIncomeControl.field.value;
82
+ var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
83
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name : source === null || source === void 0 ? void 0 : source.nameEn) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
84
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name : item === null || item === void 0 ? void 0 : item.nameEn })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
85
+ } }) }))] })) })));
86
+ };
87
+ export default React.memo(SourceOfIncome);
@@ -0,0 +1,3 @@
1
+ import AdditionalIndividualInfo, { AdditionalIndividualInfoProps } from './AdditionalIndividualInfo';
2
+ export type { AdditionalIndividualInfoProps };
3
+ export default AdditionalIndividualInfo;
@@ -0,0 +1,2 @@
1
+ import AdditionalIndividualInfo from './AdditionalIndividualInfo';
2
+ export default AdditionalIndividualInfo;
@@ -0,0 +1,25 @@
1
+ import * as yup from 'yup';
2
+ import { ObjectShape } from 'yup/lib/object';
3
+ import { CountryCode } from '../../../../@types';
4
+ export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
5
+ sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
6
+ monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
+ employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
+ employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
9
+ isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
10
+ isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
11
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
12
+ sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
13
+ monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
+ employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
+ employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
16
+ isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
17
+ isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
18
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
19
+ sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
20
+ monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
+ employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
22
+ employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
23
+ isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
24
+ isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
25
+ }>>>;
@@ -0,0 +1,35 @@
1
+ import * as yup from 'yup';
2
+ export var IndividualInfoValidationSchema = yup.object().shape({
3
+ sourceIncome: yup.object().required('choose_any_source_of_income'),
4
+ monthlyIncome: yup.string().optional(),
5
+ employerName: yup.string().when('sourceIncome', function (sourceIncomeValue) {
6
+ var _a;
7
+ if (((_a = sourceIncomeValue === null || sourceIncomeValue === void 0 ? void 0 : sourceIncomeValue.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary') {
8
+ return yup
9
+ .string()
10
+ .matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g, 'employer_name_invalid')
11
+ .required('please_enter_employer_name');
12
+ }
13
+ else {
14
+ return yup.string().optional();
15
+ }
16
+ }),
17
+ employerLocation: yup.object().when('sourceIncome', function (sourceIncome) {
18
+ var _a;
19
+ if (((_a = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary') {
20
+ return yup
21
+ .object({
22
+ name: yup.object().shape({
23
+ arabic: yup.string().required('please_choose_employer_location'),
24
+ english: yup.string().required('please_choose_employer_location')
25
+ })
26
+ })
27
+ .required('please_choose_employer_location');
28
+ }
29
+ else {
30
+ return yup.object().optional();
31
+ }
32
+ }),
33
+ isPEP: yup.boolean().required('please_choose_relative_pep'),
34
+ isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
35
+ });
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ export interface ShowOwnerInfoProps {
3
+ citizenship: string;
4
+ nationalAddr: string;
5
+ birthDate: string;
6
+ placeOfBirth: string;
7
+ maritalStatus: string;
8
+ }
9
+ declare const _default: React.MemoExoticComponent<{
10
+ ({ citizenship, nationalAddr, birthDate, placeOfBirth, maritalStatus }: ShowOwnerInfoProps): JSX.Element;
11
+ defaultProps: {
12
+ citizenship: string;
13
+ nationalAddr: string;
14
+ birthDate: string;
15
+ placeOfBirth: string;
16
+ maritalStatus: string;
17
+ };
18
+ }>;
19
+ export default _default;