@tap-payments/auth-jsconnect 1.0.36 → 1.0.40

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 (114) hide show
  1. package/build/@types/app.d.ts +4 -4
  2. package/build/components/AnimationFlow/BottomSheet.js +26 -2
  3. package/build/components/OTPTimer/OTPTimer.js +4 -2
  4. package/build/constants/app.js +2 -2
  5. package/build/constants/dummy.d.ts +2 -2
  6. package/build/constants/dummy.js +6 -6
  7. package/build/constants/validation.d.ts +1 -0
  8. package/build/constants/validation.js +1 -0
  9. package/build/features/app/business/businessStore.d.ts +4 -6
  10. package/build/features/app/business/businessStore.js +43 -30
  11. package/build/features/app/connect/connectStore.d.ts +1 -1
  12. package/build/features/app/connect/connectStore.js +23 -15
  13. package/build/features/business/screens/Activities/Activities.js +10 -5
  14. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  15. package/build/features/business/screens/Activities/OperationStartDate.js +1 -12
  16. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  17. package/build/features/business/screens/BusinessType/BusinessType.js +16 -23
  18. package/build/features/business/screens/BusinessType/CompanyLicense.js +23 -9
  19. package/build/features/business/screens/BusinessType/FreelanceLicense.js +23 -9
  20. package/build/features/business/screens/Confirm/Confirm.js +4 -3
  21. package/build/features/business/screens/Customers/Customers.js +1 -1
  22. package/build/features/business/screens/OTP/OTP.js +5 -2
  23. package/build/features/business/screens/OTP/OTPInput.js +1 -2
  24. package/build/features/business/screens/Verify/OTPInput.js +1 -2
  25. package/build/features/business/screens/Verify/Verify.js +7 -4
  26. package/build/features/connect/screens/Individual/Email.js +10 -1
  27. package/build/features/connect/screens/Individual/Individual.js +8 -10
  28. package/build/features/connect/screens/Individual/MobileNumber.js +3 -16
  29. package/build/features/connect/screens/Merchant/BrandName.js +6 -2
  30. package/build/features/connect/screens/Merchant/Merchant.js +11 -11
  31. package/build/features/connect/screens/Merchant/SocialMedia.js +2 -1
  32. package/build/features/connect/screens/Merchant/TAC.js +1 -1
  33. package/build/features/connect/screens/Merchant/validation.js +3 -2
  34. package/build/features/connect/screens/Mobile/BusinessCountry.js +1 -1
  35. package/build/features/connect/screens/Mobile/Mobile.js +1 -9
  36. package/build/features/connect/screens/Mobile/MobileNumber.js +3 -16
  37. package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
  38. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  39. package/build/features/connect/screens/NID/NID.js +1 -6
  40. package/build/features/connect/screens/OTP/OTP.js +2 -4
  41. package/build/features/connect/screens/Password/Password.js +1 -6
  42. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  43. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +1 -1
  44. package/build/features/shared/Button/Button.js +13 -3
  45. package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -5
  46. package/build/hooks/index.d.ts +1 -0
  47. package/build/hooks/index.js +1 -0
  48. package/build/hooks/useWindowSize.d.ts +6 -0
  49. package/build/hooks/useWindowSize.js +19 -0
  50. package/package.json +126 -126
  51. package/build/features/app/business/midStore.d.ts +0 -10
  52. package/build/features/app/business/midStore.js +0 -18
  53. package/build/features/app/connect/midStore.d.ts +0 -10
  54. package/build/features/app/connect/midStore.js +0 -18
  55. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +0 -5
  56. package/build/features/business/screens/VerifyNumber/OTPInput.js +0 -39
  57. package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +0 -13
  58. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +0 -76
  59. package/build/features/business/screens/VerifyNumber/index.d.ts +0 -3
  60. package/build/features/business/screens/VerifyNumber/index.js +0 -2
  61. package/build/features/business/screens/VerifyNumber/validation.d.ts +0 -8
  62. package/build/features/business/screens/VerifyNumber/validation.js +0 -4
  63. package/build/features/connect/screens/MID/BusinessCountry.d.ts +0 -11
  64. package/build/features/connect/screens/MID/BusinessCountry.js +0 -92
  65. package/build/features/connect/screens/MID/DOB.d.ts +0 -6
  66. package/build/features/connect/screens/MID/DOB.js +0 -38
  67. package/build/features/connect/screens/MID/IDNumber.d.ts +0 -7
  68. package/build/features/connect/screens/MID/IDNumber.js +0 -70
  69. package/build/features/connect/screens/MID/MID.d.ts +0 -5
  70. package/build/features/connect/screens/MID/MID.js +0 -87
  71. package/build/features/connect/screens/MID/MIDTitle.d.ts +0 -8
  72. package/build/features/connect/screens/MID/MIDTitle.js +0 -29
  73. package/build/features/connect/screens/MID/MobileNumber.d.ts +0 -12
  74. package/build/features/connect/screens/MID/MobileNumber.js +0 -148
  75. package/build/features/connect/screens/MID/index.d.ts +0 -3
  76. package/build/features/connect/screens/MID/index.js +0 -2
  77. package/build/features/connect/screens/MID/validation.d.ts +0 -18
  78. package/build/features/connect/screens/MID/validation.js +0 -15
  79. package/build/features/owner/Owner.d.ts +0 -6
  80. package/build/features/owner/Owner.js +0 -50
  81. package/build/features/owner/index.d.ts +0 -1
  82. package/build/features/owner/index.js +0 -1
  83. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +0 -8
  84. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +0 -77
  85. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +0 -10
  86. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +0 -80
  87. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +0 -6
  88. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +0 -40
  89. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +0 -6
  90. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +0 -45
  91. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +0 -6
  92. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +0 -35
  93. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +0 -6
  94. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +0 -45
  95. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +0 -9
  96. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +0 -85
  97. package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +0 -3
  98. package/build/features/owner/screens/AdditionalOwnerInfo/index.js +0 -2
  99. package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +0 -25
  100. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +0 -35
  101. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +0 -19
  102. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +0 -52
  103. package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +0 -3
  104. package/build/features/owner/screens/ShowOwnerInfo/index.js +0 -2
  105. package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +0 -7
  106. package/build/features/owner/screens/ShowOwnerInfo/info.js +0 -28
  107. package/build/features/owner/screens/Success/Success.d.ts +0 -5
  108. package/build/features/owner/screens/Success/Success.js +0 -14
  109. package/build/features/owner/screens/Success/index.d.ts +0 -3
  110. package/build/features/owner/screens/Success/index.js +0 -2
  111. package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +0 -7
  112. package/build/features/shared/ExpandIcon/ExpandIcon.js +0 -24
  113. package/build/features/shared/ExpandIcon/index.d.ts +0 -2
  114. package/build/features/shared/ExpandIcon/index.js +0 -2
@@ -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;
@@ -1,80 +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, 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 '../../../shared/ExpandIcon';
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;
54
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
55
- var locationCountries = React.useState(countries)[0];
56
- var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[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
- 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 ? (_b = location === null || location === void 0 ? void 0 : location.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
77
- 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, {})] }));
78
- } }) }))] })) })));
79
- });
80
- export default React.memo(EmployerLocation);
@@ -1,6 +0,0 @@
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;
@@ -1,40 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import * as React from 'react';
14
- import { 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, _c;
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: (_c = employerNameControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message }) })) })));
39
- };
40
- export default React.memo(EmployerName);
@@ -1,6 +0,0 @@
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;
@@ -1,45 +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 { 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);
@@ -1,6 +0,0 @@
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;
@@ -1,35 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import * as React from 'react';
14
- import { 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
- 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: (_b = monthlyIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
34
- };
35
- export default React.memo(MonthlyIncome);
@@ -1,6 +0,0 @@
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;
@@ -1,45 +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 { 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);
@@ -1,9 +0,0 @@
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;
@@ -1,85 +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, 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 '../../../shared/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 list = _a.list, rest = __rest(_a, ["list"]);
62
- var sourceList = React.useState(list)[0];
63
- var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
64
- var t = useTranslation().t;
65
- var isAr = useLanguage().isAr;
66
- var control = useFormContext().control;
67
- var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
68
- var onOpenList = function (event) {
69
- setAnchorEl(event.currentTarget);
70
- };
71
- var onCloseList = function () {
72
- setAnchorEl(null);
73
- };
74
- var onSelectItem = function (country) {
75
- var _a;
76
- onCloseList();
77
- (_a = rest.onSelectSource) === null || _a === void 0 ? void 0 : _a.call(rest, country);
78
- sourceIncomeControl.field.onChange(country);
79
- };
80
- var source = sourceIncomeControl.field.value;
81
- 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) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
82
- 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, {})] }));
83
- } }) }))] })) })));
84
- };
85
- export default React.memo(SourceOfIncome);
@@ -1,3 +0,0 @@
1
- import AdditionalOwnerInfo, { AdditionalOwnerInfoProps } from './AdditionalOwnerInfo';
2
- export type { AdditionalOwnerInfoProps };
3
- export default AdditionalOwnerInfo;
@@ -1,2 +0,0 @@
1
- import AdditionalOwnerInfo from './AdditionalOwnerInfo';
2
- export default AdditionalOwnerInfo;
@@ -1,25 +0,0 @@
1
- import * as yup from 'yup';
2
- import { ObjectShape } from 'yup/lib/object';
3
- import { CountryCode } from '../../../../@types';
4
- export declare const OwnerInfoValidationSchema: 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
- }>>>;
@@ -1,35 +0,0 @@
1
- import * as yup from 'yup';
2
- export var OwnerInfoValidationSchema = yup.object().shape({
3
- sourceIncome: yup.object().required('Source of income is required'),
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 is required')
11
- .required('Employer name is required');
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('Employer location is required'),
24
- english: yup.string().required('Employer location is required')
25
- })
26
- })
27
- .required('Employer location is required');
28
- }
29
- else {
30
- return yup.string().optional();
31
- }
32
- }),
33
- isPEP: yup.boolean().required('please_choose_relative_pep'),
34
- isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
35
- });
@@ -1,19 +0,0 @@
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;