@tap-payments/auth-jsconnect 2.10.13-beta → 2.10.14-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +4 -0
- package/build/assets/locales/ar.json +5 -0
- package/build/assets/locales/en.json +5 -0
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/utils/string.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
24
|
+
var SARSymbol = function (_a) {
|
|
25
|
+
var _b = _a.height, height = _b === void 0 ? 10 : _b, svgProps = __rest(_a, ["height"]);
|
|
26
|
+
return (_jsx("span", __assign({ style: { padding: '0 2px' } }, { children: _jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', height: height, fill: 'currentColor', viewBox: '0 0 1124.14 1256.39' }, svgProps, { children: _jsx("path", { d: 'M699.62 1113.02a460.24 460.24 0 0 0-38.4 143.37l424.51-90.24a460.44 460.44 0 0 0 38.4-143.37l-424.51 90.24zM1085.73 895.8a460.16 460.16 0 0 0 38.4-143.37l-330.68 70.33v-135.2l292.27-62.11a460.16 460.16 0 0 0 38.4-143.37l-330.68 70.27V66.13a466.56 466.56 0 0 0-132.25 110.99v403.35l-132.25 28.11V0A466.4 466.4 0 0 0 396.7 110.99v525.69l-295.92 62.88a460.46 460.46 0 0 0-38.42 143.37l334.33-71.05v170.26l-358.3 76.14a460.16 460.16 0 0 0-38.4 143.37l375.03-79.7a119.13 119.13 0 0 0 73.83-49.24l68.78-101.97v-.02a65.72 65.72 0 0 0 11.3-36.97V743.77l132.25-28.11v270.4l424.53-90.28z' }) })) })));
|
|
27
|
+
};
|
|
28
|
+
export default SARSymbol;
|
|
@@ -136,12 +136,14 @@
|
|
|
136
136
|
"cancel": "إلغاء",
|
|
137
137
|
"capital_paid_hint": "00000",
|
|
138
138
|
"capital_paid_label": "رأس المال المدفوع ({{currency}})",
|
|
139
|
+
"capital_paid_input_label": "رأس المال المدفوع",
|
|
139
140
|
"capital_paid_required": "Please Enter paid amount",
|
|
140
141
|
"capital_share_count_hint": "00000",
|
|
141
142
|
"capital_share_count_label": "عدد اسهم رأس المال",
|
|
142
143
|
"capital_share_count_required": "Please Enter share count",
|
|
143
144
|
"capital_share_value_hint": "00000",
|
|
144
145
|
"capital_share_value_label": "قيمة السهم ({{currency}})",
|
|
146
|
+
"capital_share_value_input_label": "قيمة السهم",
|
|
145
147
|
"capital_share_value_required": "Please Enter share value",
|
|
146
148
|
"category": "الفئة",
|
|
147
149
|
"category_name": "اسم الفئة",
|
|
@@ -280,6 +282,7 @@
|
|
|
280
282
|
"entity_type_required": "Please select at least one entity type",
|
|
281
283
|
"expected_customers_to_serve": "عدد العملاء شهريا",
|
|
282
284
|
"expected_sales_monthly": "البيع المتوقع في الشهر؟ ({{currency}})",
|
|
285
|
+
"expected_sale_per_month": "البيع المتوقع في الشهر؟",
|
|
283
286
|
"expected_sales_yearly": "ما هي المبيعات المتوقعة لعملك شهريًا؟",
|
|
284
287
|
"expected_served_monthly": "عدد العملاء شهريا",
|
|
285
288
|
"expiry_date": "تاريخ الإنتهاء",
|
|
@@ -483,6 +486,7 @@
|
|
|
483
486
|
"please_choose_is_authorized": "الرجاء التأكيد إذا كنت أنت المستخدم المصرح له",
|
|
484
487
|
"please_choose_relative_pep": "هل أنت أو أحد أقاربك شخص مكشوف علنًا (PEP)",
|
|
485
488
|
"please_enter_actual_income": "ما هو دخلك الشهري ({{currency}}) ؟ ",
|
|
489
|
+
"monthly_income": "ما هو دخلك الشهري؟ ",
|
|
486
490
|
"please_enter_employer_name": "يرجى إدخال اسم منشأه العمل الخاص بك",
|
|
487
491
|
"please_try_again_after_few_minutes": "يمكنك محاولة تسجيل الدخول مرة أخرى بعد {{minutes}} دقيقة",
|
|
488
492
|
"powered_by": "بواسطة",
|
|
@@ -523,6 +527,7 @@
|
|
|
523
527
|
"share_count_label": "عدد الأسهم",
|
|
524
528
|
"share_value_hint": "0000",
|
|
525
529
|
"share_value_label": "قيمة السهم ({{currency}})",
|
|
530
|
+
"share_value_input_label": "قيمة السهم",
|
|
526
531
|
"sign_up": "Sign up",
|
|
527
532
|
"signed_up": "تسجيل الدخول",
|
|
528
533
|
"signin_email_label": "البريد الألكتروني",
|
|
@@ -135,12 +135,14 @@
|
|
|
135
135
|
"cancel": "Cancel",
|
|
136
136
|
"capital_paid_hint": "00000",
|
|
137
137
|
"capital_paid_label": "Capital Paid ({{currency}})",
|
|
138
|
+
"capital_paid_input_label": "Capital Paid",
|
|
138
139
|
"capital_paid_required": "Please Enter paid amount",
|
|
139
140
|
"capital_share_count_hint": "00000",
|
|
140
141
|
"capital_share_count_label": "Capital Share Count",
|
|
141
142
|
"capital_share_count_required": "Please Enter share count",
|
|
142
143
|
"capital_share_value_hint": "00000",
|
|
143
144
|
"capital_share_value_label": "Capital Share Value ({{currency}})",
|
|
145
|
+
"capital_share_value_input_label": "Capital Share Value",
|
|
144
146
|
"capital_share_value_required": "Please Enter share value",
|
|
145
147
|
"category": "Category",
|
|
146
148
|
"category_name": "Category name",
|
|
@@ -288,6 +290,7 @@
|
|
|
288
290
|
"entity_type_required": "Please select at least one entity type",
|
|
289
291
|
"expected_customers_to_serve": "Customers server per month",
|
|
290
292
|
"expected_sales_monthly": "Expected sale per month? ({{currency}})",
|
|
293
|
+
"expected_sale_per_month": "Expected sale per month?",
|
|
291
294
|
"expected_sales_yearly": "What is the expected sales for your business per month?",
|
|
292
295
|
"expected_served_monthly": "Customers server per month",
|
|
293
296
|
"expiry_date": "Date of expiry",
|
|
@@ -499,6 +502,7 @@
|
|
|
499
502
|
"please_choose_is_authorized": "Please tell us if you are the authorized user",
|
|
500
503
|
"please_choose_relative_pep": "Are you or one of your relatives a Publicly Exposed Person (PEP)",
|
|
501
504
|
"please_enter_actual_income": "Monthly income ({{currency}})",
|
|
505
|
+
"monthly_income": "Monthly income",
|
|
502
506
|
"please_enter_employer_name": "Please enter the name of your employer",
|
|
503
507
|
"please_try_again_after_few_minutes": "You can try to login again after {{minutes}} mins",
|
|
504
508
|
"powered_by": "Powered by",
|
|
@@ -545,6 +549,7 @@
|
|
|
545
549
|
"share_count_label": "Share Count",
|
|
546
550
|
"share_value_hint": "0000",
|
|
547
551
|
"share_value_label": "Share Value ({{currency}})",
|
|
552
|
+
"share_value_input_label": "Share Value",
|
|
548
553
|
"sign_up": "Sign up",
|
|
549
554
|
"signed_up": "Signed up",
|
|
550
555
|
"signin_email_label": "Email address",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getCurrencyByCountryIso2 } from '../../utils';
|
|
3
|
+
import { CURRENCY_ICON } from '../../assets/currencies/utils';
|
|
4
|
+
var TextWithCurrency = function (_a) {
|
|
5
|
+
var text = _a.text, countryCode = _a.countryCode;
|
|
6
|
+
if (!countryCode)
|
|
7
|
+
return _jsx(_Fragment, { children: text });
|
|
8
|
+
var currencyCode = getCurrencyByCountryIso2(countryCode);
|
|
9
|
+
var CurrencyIcon = CURRENCY_ICON[countryCode];
|
|
10
|
+
if (CurrencyIcon)
|
|
11
|
+
return (_jsxs("span", { children: [text, " (", _jsx(CurrencyIcon, {}), ")"] }));
|
|
12
|
+
return (_jsxs("span", { children: [text, currencyCode ? " (".concat(currencyCode, ")") : ''] }));
|
|
13
|
+
};
|
|
14
|
+
export default TextWithCurrency;
|
|
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import {
|
|
18
|
+
import { isExist } from '../../../../utils';
|
|
19
19
|
import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
20
20
|
import { settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
@@ -29,6 +29,7 @@ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
|
29
29
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
30
30
|
import { InputLabelStyled, NameContainer } from './CustomerBase';
|
|
31
31
|
import { MandatoryStyled } from './ActivitiesList';
|
|
32
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
32
33
|
var InputStyled = styled(InputSelect)(function (_a) {
|
|
33
34
|
var theme = _a.theme;
|
|
34
35
|
return ({
|
|
@@ -71,7 +72,6 @@ var ExpectedSalesRange = function (_a) {
|
|
|
71
72
|
var brandActivities = data.brandActivities;
|
|
72
73
|
var expectedSales = (brandActivities.responseBody || {}).expectedSales;
|
|
73
74
|
var expectedSalesRangeValue = expectedSaleControl.field.value;
|
|
74
|
-
var countryCode = settingsData.businessCountry;
|
|
75
75
|
var handleOpenMainMenu = function (event) {
|
|
76
76
|
if (readOnly)
|
|
77
77
|
return;
|
|
@@ -95,9 +95,6 @@ var ExpectedSalesRange = function (_a) {
|
|
|
95
95
|
var handleCloseSubMenu = function () {
|
|
96
96
|
setSubIndex('');
|
|
97
97
|
};
|
|
98
|
-
var getCurrency = React.useMemo(function () {
|
|
99
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
100
|
-
}, [countryCode.iso2]);
|
|
101
98
|
React.useEffect(function () {
|
|
102
99
|
if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
|
|
103
100
|
setExpectedSalesRangeList(expectedSales);
|
|
@@ -126,9 +123,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
126
123
|
if (item)
|
|
127
124
|
setSubIndex(item.id);
|
|
128
125
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
129
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('
|
|
130
|
-
currency: getCurrency
|
|
131
|
-
}), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
126
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [_jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
132
127
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
133
128
|
if (isOnlyOneItem)
|
|
134
129
|
onSelectItem(item);
|
|
@@ -22,12 +22,13 @@ import Collapse from '../../../../components/Collapse';
|
|
|
22
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
23
23
|
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
24
24
|
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
25
|
-
import {
|
|
25
|
+
import { isExist } from '../../../../utils';
|
|
26
26
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
27
27
|
import Search from '../../../shared/Search';
|
|
28
28
|
import InputSelect from '../../../shared/InputSelect';
|
|
29
29
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
30
30
|
import { InputLabelStyled, NameContainer } from './CustomerLocations';
|
|
31
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
31
32
|
var InputStyled = styled(InputSelect)(function (_a) {
|
|
32
33
|
var theme = _a.theme;
|
|
33
34
|
return ({
|
|
@@ -69,7 +70,6 @@ var ExpectedSalesRange = function (_a) {
|
|
|
69
70
|
var activitiesData = data.activitiesData;
|
|
70
71
|
var expectedSales = (activitiesData.responseBody || {}).expectedSales;
|
|
71
72
|
var expectedSalesRangeValue = expectedSaleControl.field.value;
|
|
72
|
-
var countryCode = settingsData.businessCountry;
|
|
73
73
|
var handleOpenMainMenu = function (event) {
|
|
74
74
|
if (readOnly)
|
|
75
75
|
return;
|
|
@@ -121,12 +121,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
121
121
|
if (item)
|
|
122
122
|
setSubIndex(item.id);
|
|
123
123
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
124
|
-
|
|
125
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
126
|
-
}, [countryCode.iso2]);
|
|
127
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
128
|
-
currency: getCurrency
|
|
129
|
-
}) }), _jsx(InputStyled, { readOnly: readOnly, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
124
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: _jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }) }), _jsx(InputStyled, { readOnly: readOnly, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
130
125
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
131
126
|
if (isOnlyOneItem)
|
|
132
127
|
onSelectItem(item);
|
|
@@ -15,11 +15,12 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
17
|
import { settingsSelector } from '../../../../app/settings';
|
|
18
|
-
import { formatNumberAsCurrency,
|
|
18
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError } from '../../../app/entity/entityStore';
|
|
22
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
23
24
|
var CapitalPaid = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
@@ -34,14 +35,9 @@ var CapitalPaid = function (_a) {
|
|
|
34
35
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
35
36
|
capitalPaidControl.field.onChange(value);
|
|
36
37
|
};
|
|
37
|
-
var getCurrency = React.useMemo(function () {
|
|
38
|
-
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
-
}, [settingsData.businessCountry.iso2]);
|
|
40
38
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
41
39
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
42
40
|
var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
|
-
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
44
|
-
currency: getCurrency
|
|
45
|
-
}), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_paid_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
|
|
46
42
|
};
|
|
47
43
|
export default React.memo(CapitalPaid);
|
|
@@ -13,13 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { formatNumberAsCurrency,
|
|
16
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
17
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError } from '../../../app/entity/entityStore';
|
|
22
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
23
24
|
var CapitalShareValue = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
@@ -34,14 +35,9 @@ var CapitalShareValue = function (_a) {
|
|
|
34
35
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
35
36
|
capitalShareValueControl.field.onChange(value);
|
|
36
37
|
};
|
|
37
|
-
var getCurrency = React.useMemo(function () {
|
|
38
|
-
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
-
}, [settingsData.businessCountry.iso2]);
|
|
40
38
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
41
39
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
42
40
|
var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
|
-
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
44
|
-
currency: getCurrency
|
|
45
|
-
}), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
46
42
|
};
|
|
47
43
|
export default React.memo(CapitalShareValue);
|
|
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
-
import {
|
|
19
|
+
import { 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';
|
|
@@ -26,6 +26,7 @@ import InputSelect from '../../../shared/InputSelect';
|
|
|
26
26
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
27
27
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
28
28
|
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
29
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
29
30
|
var Container = styled(Box)(function () { return ({
|
|
30
31
|
display: 'flex'
|
|
31
32
|
}); });
|
|
@@ -45,16 +46,12 @@ var MonthlyIncome = function (props) {
|
|
|
45
46
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
46
47
|
var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
|
|
47
48
|
var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
|
|
48
|
-
var countryCode = settingsData.businessCountry;
|
|
49
49
|
var user = (data.verify.responseBody || {}).user;
|
|
50
50
|
var isMonthlyIncomeVerified = function (item) {
|
|
51
51
|
if (!(item === null || item === void 0 ? void 0 : item.id))
|
|
52
52
|
return false;
|
|
53
53
|
return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
|
|
54
54
|
};
|
|
55
|
-
var getCurrency = React.useMemo(function () {
|
|
56
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
57
|
-
}, [countryCode.iso2]);
|
|
58
55
|
React.useEffect(function () {
|
|
59
56
|
if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
|
|
60
57
|
setIncomeList(monthlyIncomeList);
|
|
@@ -83,9 +80,7 @@ var MonthlyIncome = function (props) {
|
|
|
83
80
|
};
|
|
84
81
|
var income = monthlyIncomeControl.field.value;
|
|
85
82
|
var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('
|
|
87
|
-
currency: getCurrency
|
|
88
|
-
}), required: true, 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) {
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: _jsx(TextWithCurrency, { text: t('monthly_income'), countryCode: settingsData.businessCountry.iso2 }), required: true, 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) {
|
|
89
84
|
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) })] }));
|
|
90
85
|
} }) }))] })) })));
|
|
91
86
|
};
|
|
@@ -14,13 +14,14 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
|
-
import { formatNumberAsCurrency,
|
|
17
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
23
23
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
24
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
24
25
|
var ShareValue = function (_a) {
|
|
25
26
|
var _b;
|
|
26
27
|
var show = _a.show, readOnly = _a.readOnly;
|
|
@@ -29,7 +30,6 @@ var ShareValue = function (_a) {
|
|
|
29
30
|
var control = useFormContext().control;
|
|
30
31
|
var bckError = useAppSelector(individualSelector).error;
|
|
31
32
|
var dispatch = useAppDispatch();
|
|
32
|
-
var countryCode = settingsData.businessCountry;
|
|
33
33
|
var handleChange = function (_a) {
|
|
34
34
|
var target = _a.target;
|
|
35
35
|
if (bckError)
|
|
@@ -37,14 +37,9 @@ var ShareValue = function (_a) {
|
|
|
37
37
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
38
38
|
shareValueControl.field.onChange(value);
|
|
39
39
|
};
|
|
40
|
-
var getCurrency = React.useMemo(function () {
|
|
41
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
42
|
-
}, [countryCode.iso2]);
|
|
43
40
|
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
|
44
41
|
var shareValue = shareValueControl.field.value;
|
|
45
42
|
var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
46
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
47
|
-
currency: getCurrency
|
|
48
|
-
}), 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 }) }) })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), 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 }) }) })) })));
|
|
49
44
|
};
|
|
50
45
|
export default React.memo(ShareValue);
|
|
@@ -20,7 +20,7 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
|
|
|
20
20
|
warningType?: "alert" | "error" | "hint" | undefined;
|
|
21
21
|
} & {} & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
22
22
|
export interface CustomInputProps extends InputProps {
|
|
23
|
-
label?: string;
|
|
23
|
+
label?: string | JSX.Element;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
labelSx?: SxProps<Theme>;
|
|
26
26
|
}
|
package/build/utils/string.d.ts
CHANGED
|
@@ -75,6 +75,6 @@ export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/p
|
|
|
75
75
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
76
76
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
77
77
|
export declare const formatNumberAsCurrency: (number: string) => string;
|
|
78
|
-
export declare const getCurrencyByCountryIso2: (countryCode
|
|
78
|
+
export declare const getCurrencyByCountryIso2: (countryCode?: string) => string;
|
|
79
79
|
export declare const getMobileNumberLen: (initialLen: number, number: string) => number;
|
|
80
80
|
export declare const getWebsiteLink: (isAr: boolean, countryCode: string, path: string) => string;
|