@tap-payments/auth-jsconnect 2.4.30-test → 2.4.32-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.
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +31 -19
- package/build/features/app/brand/brandStore.d.ts +2 -0
- package/build/features/app/brand/brandStore.js +67 -47
- package/build/features/app/entity/entityStore.d.ts +4 -0
- package/build/features/app/entity/entityStore.js +88 -54
- package/build/features/app/individual/individualStore.js +10 -9
- package/build/features/app/password/passwordStore.d.ts +2 -0
- package/build/features/app/password/passwordStore.js +70 -34
- package/build/features/app/tax/taxStore.d.ts +1 -0
- package/build/features/app/tax/taxStore.js +30 -19
- package/build/features/entity/screens/EntityCapital/ActivityList.js +0 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +6 -10
- package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +5 -9
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +6 -10
- package/build/utils/array.d.ts +1 -0
- package/build/utils/array.js +66 -0
- package/package.json +1 -1
|
@@ -13,24 +13,20 @@ 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 Collapse from '@mui/material/Collapse';
|
|
17
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
17
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
18
|
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
20
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
20
|
import Input from '../../../shared/Input';
|
|
22
|
-
import { clearError
|
|
21
|
+
import { clearError } from '../../../app/entity/entityStore';
|
|
23
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
24
23
|
var CapitalPaid = function (_a) {
|
|
25
|
-
var _b
|
|
24
|
+
var _b;
|
|
26
25
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
27
26
|
var t = useTranslation().t;
|
|
28
|
-
var data = useAppSelector(entitySelector).data;
|
|
29
27
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
30
28
|
var control = useFormContext().control;
|
|
31
29
|
var dispatch = useAppDispatch();
|
|
32
|
-
var entity = (data.verify.responseBody || {}).entity;
|
|
33
|
-
var paid = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.paid;
|
|
34
30
|
var countryCode = settingsData.businessCountry.iso2;
|
|
35
31
|
var handleChange = function (_a) {
|
|
36
32
|
var target = _a.target;
|
|
@@ -41,9 +37,9 @@ var CapitalPaid = function (_a) {
|
|
|
41
37
|
};
|
|
42
38
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
43
39
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
44
|
-
var error = (
|
|
45
|
-
return (_jsx(
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
|
|
42
|
+
currency: t(findCurrencyByIso2(countryCode))
|
|
43
|
+
}), 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 }) }) })));
|
|
48
44
|
};
|
|
49
45
|
export default React.memo(CapitalPaid);
|
|
@@ -13,22 +13,18 @@ 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
|
|
17
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
18
17
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
19
18
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
19
|
import Input from '../../../shared/Input';
|
|
21
|
-
import { clearError
|
|
20
|
+
import { clearError } from '../../../app/entity/entityStore';
|
|
22
21
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
22
|
var CapitalShareCount = function (_a) {
|
|
24
|
-
var _b
|
|
23
|
+
var _b;
|
|
25
24
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
26
25
|
var t = useTranslation().t;
|
|
27
|
-
var data = useAppSelector(entitySelector).data;
|
|
28
26
|
var control = useFormContext().control;
|
|
29
27
|
var dispatch = useAppDispatch();
|
|
30
|
-
var entity = (data.verify.responseBody || {}).entity;
|
|
31
|
-
var shareCount = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.count;
|
|
32
28
|
var handleChange = function (_a) {
|
|
33
29
|
var target = _a.target;
|
|
34
30
|
if (error)
|
|
@@ -38,7 +34,7 @@ var CapitalShareCount = function (_a) {
|
|
|
38
34
|
};
|
|
39
35
|
var capitalShareCountControl = useController({ control: control, name: 'capitalShareCount' });
|
|
40
36
|
var capitalShareCountValue = capitalShareCountControl.field.value;
|
|
41
|
-
var error = (
|
|
42
|
-
return (_jsx(
|
|
37
|
+
var error = (_b = capitalShareCountControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
38
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareCountValue, isVerified: isVerified }) }) })));
|
|
43
39
|
};
|
|
44
40
|
export default React.memo(CapitalShareCount);
|
|
@@ -16,21 +16,17 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
17
|
import { settingsSelector } from '../../../../app/settings';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
-
import Collapse from '@mui/material/Collapse';
|
|
20
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
20
|
import Input from '../../../shared/Input';
|
|
22
|
-
import { clearError
|
|
21
|
+
import { clearError } from '../../../app/entity/entityStore';
|
|
23
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
24
23
|
var CapitalShareValue = function (_a) {
|
|
25
|
-
var _b
|
|
24
|
+
var _b;
|
|
26
25
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
27
26
|
var t = useTranslation().t;
|
|
28
|
-
var data = useAppSelector(entitySelector).data;
|
|
29
27
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
30
28
|
var control = useFormContext().control;
|
|
31
29
|
var dispatch = useAppDispatch();
|
|
32
|
-
var entity = (data.verify.responseBody || {}).entity;
|
|
33
|
-
var shareValue = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.value;
|
|
34
30
|
var countryCode = settingsData.businessCountry.iso2;
|
|
35
31
|
var handleChange = function (_a) {
|
|
36
32
|
var target = _a.target;
|
|
@@ -41,9 +37,9 @@ var CapitalShareValue = function (_a) {
|
|
|
41
37
|
};
|
|
42
38
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
43
39
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
44
|
-
var error = (
|
|
45
|
-
return (_jsx(
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
|
|
42
|
+
currency: t(findCurrencyByIso2(countryCode))
|
|
43
|
+
}), 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 }) }) })));
|
|
48
44
|
};
|
|
49
45
|
export default React.memo(CapitalShareValue);
|
package/build/utils/array.d.ts
CHANGED
package/build/utils/array.js
CHANGED
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
49
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
50
|
if (ar || !(i in from)) {
|
|
@@ -298,3 +334,33 @@ export var getIndividualType = function (objects) {
|
|
|
298
334
|
});
|
|
299
335
|
return { isUser: isUser, isShareholder: isShareholder, isBoardMember: isBoardMember, isBuyer: isBuyer, isCustomer: isCustomer };
|
|
300
336
|
};
|
|
337
|
+
export function retrieveIndividualData(type, boardData, serviceCallback) {
|
|
338
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
339
|
+
var _a, isShareholder, isBoardMember, isBuyer, isCustomer, data, individualRes, _b, data_state, is_authorized, boardRes, individuals;
|
|
340
|
+
return __generator(this, function (_c) {
|
|
341
|
+
switch (_c.label) {
|
|
342
|
+
case 0:
|
|
343
|
+
_a = getIndividualType([type]), isShareholder = _a.isShareholder, isBoardMember = _a.isBoardMember, isBuyer = _a.isBuyer, isCustomer = _a.isCustomer;
|
|
344
|
+
return [4, serviceCallback()];
|
|
345
|
+
case 1:
|
|
346
|
+
data = _c.sent();
|
|
347
|
+
individualRes = data === null || data === void 0 ? void 0 : data.user;
|
|
348
|
+
if (isShareholder)
|
|
349
|
+
individualRes = data === null || data === void 0 ? void 0 : data.shareholder;
|
|
350
|
+
else if (isBoardMember)
|
|
351
|
+
individualRes = data === null || data === void 0 ? void 0 : data.board_member;
|
|
352
|
+
else if (isBuyer)
|
|
353
|
+
individualRes = data === null || data === void 0 ? void 0 : data.buyer;
|
|
354
|
+
else if (isCustomer)
|
|
355
|
+
individualRes = data === null || data === void 0 ? void 0 : data.customer;
|
|
356
|
+
_b = individualRes || {}, data_state = _b.data_state, is_authorized = _b.is_authorized;
|
|
357
|
+
boardRes = boardData || {};
|
|
358
|
+
if (!is_authorized) {
|
|
359
|
+
individuals = (boardRes || {}).individuals;
|
|
360
|
+
boardRes = __assign(__assign(__assign({}, boardRes), (!is_authorized && { user: individualRes })), { individuals: __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })) });
|
|
361
|
+
}
|
|
362
|
+
return [2, { boardRes: boardRes, individualRes: individualRes }];
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
}
|