@tap-payments/auth-jsconnect 2.3.96-test → 2.3.99-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.
@@ -63,7 +63,7 @@ import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../..
63
63
  import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  import { ENTITY_STEP_NAMES } from '../../../constants';
65
65
  import moment from 'moment';
66
- import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep } from '../../../utils';
66
+ import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency } from '../../../utils';
67
67
  export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
68
68
  var token = _a.token, isInternally = _a.isInternally;
69
69
  return __awaiter(void 0, void 0, void 0, function () {
@@ -523,11 +523,11 @@ export var entitySlice = createSlice({
523
523
  if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
524
524
  state.data.entityCapitalData.activities = activities;
525
525
  if (paid)
526
- state.data.entityCapitalData.capitalPaid = paid;
526
+ state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
527
527
  if (shares === null || shares === void 0 ? void 0 : shares.count)
528
528
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
529
529
  if (shares === null || shares === void 0 ? void 0 : shares.value)
530
- state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
530
+ state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
531
531
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id });
532
532
  }
533
533
  })
@@ -604,11 +604,11 @@ export var entitySlice = createSlice({
604
604
  if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
605
605
  state.data.entityCapitalData.activities = activities;
606
606
  if (paid)
607
- state.data.entityCapitalData.capitalPaid = paid;
607
+ state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
608
608
  if (shares === null || shares === void 0 ? void 0 : shares.count)
609
609
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
610
610
  if (shares === null || shares === void 0 ? void 0 : shares.value)
611
- state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
611
+ state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
612
612
  state.data.entityNameData = __assign(__assign({}, state.data.entityNameData), { responseBody: __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id }) });
613
613
  })
614
614
  .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
@@ -71,7 +71,7 @@ import API from '../../../api';
71
71
  import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
72
72
  import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
@@ -595,7 +595,8 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
595
595
  }
596
596
  })), (!isDOBNonEditable && {
597
597
  date_of_birth: dob
598
- })), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
598
+ })), (hasBirth &&
599
+ !(isBirthCityNonEditable && isBirthCountryNonEditable) && {
599
600
  birth: {
600
601
  city: isBirthCityNonEditable ? undefined : placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id,
601
602
  country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
@@ -1018,7 +1019,7 @@ export var individualSlice = createSlice({
1018
1019
  state.data.individualData.shareCount = shareCount;
1019
1020
  }
1020
1021
  if (shareValue) {
1021
- state.data.individualData.shareValue = shareValue;
1022
+ state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
1022
1023
  }
1023
1024
  var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
1024
1025
  if (!!selectedSourceIncome)
@@ -28,7 +28,7 @@ var TitleStyled = styled(Text)(function (_a) {
28
28
  });
29
29
  var ChipStyled = styled(Chip, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
30
30
  var theme = _a.theme, isAr = _a.isAr;
31
- return (__assign(__assign({ background: alpha(theme.palette.success.main, 0.1), color: theme.palette.success.main, height: theme.spacing(3.125) }, theme.typography.subtitle2), { '& .MuiChip-icon': {
31
+ return (__assign(__assign({ background: alpha(theme.palette.success.main, 0.1), color: theme.palette.success.main, height: theme.spacing(3.125), boxShadow: theme.shadows[0] }, theme.typography.subtitle2), { '& .MuiChip-icon': {
32
32
  marginLeft: isAr ? '-6px' : '5px',
33
33
  marginRight: isAr ? '5px' : '-6px'
34
34
  } }));
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
19
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import Input from '../../../shared/Input';
22
22
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
@@ -36,7 +36,7 @@ var CapitalPaid = function (_a) {
36
36
  var target = _a.target;
37
37
  if (error)
38
38
  dispatch(clearError());
39
- var value = removeAllCharsFromNumber(target.value);
39
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
40
40
  capitalPaidControl.field.onChange(value);
41
41
  };
42
42
  var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
@@ -18,7 +18,7 @@ import { ScreenContainer } from '../../../shared/Containers';
18
18
  import Input from '../../../shared/Input';
19
19
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
20
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
21
- import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
21
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
22
22
  import { settingsSelector } from '../../../../app/settings';
23
23
  var CapitalShareValue = function (_a) {
24
24
  var _b, _c, _d;
@@ -37,7 +37,7 @@ var CapitalShareValue = function (_a) {
37
37
  var target = _a.target;
38
38
  if (error)
39
39
  dispatch(clearError());
40
- var value = removeAllCharsFromNumber(target.value);
40
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
41
41
  capitalShareValueControl.field.onChange(value);
42
42
  };
43
43
  var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
@@ -14,7 +14,7 @@ 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 { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
19
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
@@ -33,7 +33,7 @@ var ShareValue = function (_a) {
33
33
  var target = _a.target;
34
34
  if (bckError)
35
35
  dispatch(clearError());
36
- var value = removeAllCharsFromNumber(target.value);
36
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
37
37
  shareValueControl.field.onChange(value);
38
38
  };
39
39
  var shareValueControl = useController({ control: control, name: 'shareValue' });
@@ -14,7 +14,7 @@ import { styled } from '@mui/material/styles';
14
14
  import Chip from '@mui/material/Chip';
15
15
  var ChipStyled = styled(Chip)(function (_a) {
16
16
  var theme = _a.theme;
17
- return (__assign(__assign({ borderRadius: theme.spacing(12.625), padding: theme.spacing(0.25, 0.5, 0.25, 0.5), background: theme.palette.common.white }, theme.typography.caption), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightRegular }));
17
+ return (__assign(__assign({ borderRadius: theme.spacing(12.625), padding: theme.spacing(0.25, 0.5, 0.25, 0.5), background: theme.palette.common.white }, theme.typography.caption), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightRegular, boxShadow: theme.shadows[2] }));
18
18
  });
19
19
  export default function CustomChip(props) {
20
20
  return _jsx(ChipStyled, __assign({}, props));
@@ -1,7 +1,7 @@
1
1
  export var shadows = [
2
2
  'none',
3
3
  '0 0 0 1px rgb(63 63 68 / 5%), 0 1px 2px 0 rgb(63 63 68 / 15%)',
4
- '0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12)',
4
+ '0px 0px 2px rgba(0, 0, 0, 0.08)',
5
5
  '0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12)',
6
6
  '0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)',
7
7
  '0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)',
@@ -71,3 +71,4 @@ export declare const getUserNameObject: (name: string) => {
71
71
  export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/png" | "image/jpg" | "application/pdf";
72
72
  export declare const isStringHasOneAsterisk: (value: string) => boolean;
73
73
  export declare const isOtherLicense: (item?: License) => boolean;
74
+ export declare const formatNumberAsCurrency: (number: string) => string;
@@ -308,3 +308,8 @@ export var isOtherLicense = function (item) {
308
308
  var number = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number;
309
309
  return number === 'other_fl' || number === 'other_cr' || number === 'other_entity';
310
310
  };
311
+ export var formatNumberAsCurrency = function (number) {
312
+ if (!number)
313
+ return '';
314
+ return parseInt(number).toLocaleString();
315
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.96-test",
3
+ "version": "2.3.99-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",