@tap-payments/auth-jsconnect 2.4.16-test → 2.4.17-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,12 +20,12 @@ import { findCurrencyByIso2, hasVerifiedValue } from '../../../../utils';
20
20
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import Text from '../../../../components/Text';
23
- import ExpandIcon from '../../../../components/ExpandIcon';
24
23
  import SimpleList from '../../../../components/SimpleList';
25
24
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
26
25
  import Input from '../../../shared/Input';
27
26
  import CheckIcon from '../../../shared/CheckIcon';
28
27
  import { ScreenContainer } from '../../../shared/Containers';
28
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
29
29
  var Container = styled(Box)(function () { return ({
30
30
  display: 'flex'
31
31
  }); });
@@ -56,6 +56,8 @@ var MonthlyIncome = function (props) {
56
56
  var countryCode = settingsData.businessCountry;
57
57
  var user = (data.verify.responseBody || {}).user;
58
58
  var isMonthlyIncomeVerified = function (item) {
59
+ if (!(item === null || item === void 0 ? void 0 : item.id))
60
+ return false;
59
61
  return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
60
62
  };
61
63
  React.useEffect(function () {
@@ -88,7 +90,7 @@ var MonthlyIncome = function (props) {
88
90
  var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
89
91
  return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputStyled, { label: t('please_enter_actual_income', {
90
92
  currency: t(findCurrencyByIso2(countryCode.iso2))
91
- }), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
93
+ }), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
92
94
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
93
95
  } }) }))] })) })));
94
96
  };
@@ -19,6 +19,7 @@ import { useAppSelector, useAppDispatch } from '../../../../hooks';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import Input from '../../../shared/Input';
21
21
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
22
+ import { EndAdornment } from '../../../shared/EndAdornment';
22
23
  var ShareCount = function (_a) {
23
24
  var _b;
24
25
  var show = _a.show, readOnly = _a.readOnly;
@@ -36,6 +37,6 @@ var ShareCount = function (_a) {
36
37
  var shareCountControl = useController({ control: control, name: 'shareCount' });
37
38
  var shareCountValue = shareCountControl.field.value;
38
39
  var error = (_b = shareCountControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
39
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_count_label'), onChange: handleChange, value: shareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
40
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_count_label'), onChange: handleChange, value: shareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareCountValue, error: error }) }) })) })));
40
41
  };
41
42
  export default React.memo(ShareCount);
@@ -20,6 +20,7 @@ import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import Input from '../../../shared/Input';
22
22
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
23
+ import { EndAdornment } from '../../../shared/EndAdornment';
23
24
  var ShareValue = function (_a) {
24
25
  var _b;
25
26
  var show = _a.show, readOnly = _a.readOnly;
@@ -37,10 +38,10 @@ var ShareValue = function (_a) {
37
38
  shareValueControl.field.onChange(value);
38
39
  };
39
40
  var shareValueControl = useController({ control: control, name: 'shareValue' });
40
- var shareValueValue = shareValueControl.field.value;
41
+ var shareValue = shareValueControl.field.value;
41
42
  var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
42
43
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
43
44
  currency: t(findCurrencyByIso2(countryCode))
44
- }), onChange: handleChange, value: shareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
45
+ }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
45
46
  };
46
47
  export default React.memo(ShareValue);
@@ -19,11 +19,11 @@ import { useAppSelector, useLanguage, useAppDispatch } from '../../../../hooks';
19
19
  import { hasVerifiedValue } from '../../../../utils';
20
20
  import Text from '../../../../components/Text';
21
21
  import Collapse from '../../../../components/Collapse';
22
- import ExpandIcon from '../../../../components/ExpandIcon';
23
22
  import SimpleList from '../../../../components/SimpleList';
24
23
  import CheckIcon from '../../../shared/CheckIcon';
25
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
26
25
  import Input from '../../../shared/Input';
26
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
27
27
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
28
28
  var InputStyled = styled(Input)(function (_a) {
29
29
  var readOnly = _a.readOnly;
@@ -53,6 +53,8 @@ var SourceOfIncome = function (props) {
53
53
  var sourceIncomeList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.sourceIncomeList) || [];
54
54
  var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
55
55
  var isSourceIncomeVerified = function (item) {
56
+ if (!(item === null || item === void 0 ? void 0 : item.id))
57
+ return false;
56
58
  return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "source_of_income.".concat(item.id));
57
59
  };
58
60
  React.useEffect(function () {
@@ -80,7 +82,7 @@ var SourceOfIncome = function (props) {
80
82
  };
81
83
  var source = sourceIncomeControl.field.value;
82
84
  var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
83
- return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, label: t('tap_js_source_of_income'), readOnly: props.readOnly, 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.ar : source === null || source === void 0 ? void 0 : source.name.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
85
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, label: t('tap_js_source_of_income'), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name.ar : source === null || source === void 0 ? void 0 : source.name.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isSourceIncomeVerified(source), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
84
86
  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.ar : item === null || item === void 0 ? void 0 : item.name.en })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIcon, { isVerified: isSourceIncomeVerified(item) })] }));
85
87
  } }) }))] })) })));
86
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.4.16-test",
3
+ "version": "2.4.17-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",