@tap-payments/auth-jsconnect 2.6.10-test → 2.6.13-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/@types/app.d.ts +2 -1
- package/build/@types/app.js +1 -0
- package/build/api/country.d.ts +1 -0
- package/build/api/country.js +8 -1
- package/build/api/index.d.ts +1 -0
- package/build/app/settings.js +2 -5
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.js +11 -5
- package/build/constants/dummy.d.ts +45 -0
- package/build/constants/dummy.js +330 -0
- package/build/features/app/brand/brandStore.d.ts +2 -0
- package/build/features/app/brand/brandStore.js +19 -12
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +107 -72
- package/build/features/app/connectExpress/connectExpressStore.js +27 -13
- package/build/features/app/entity/entityStore.d.ts +2 -0
- package/build/features/app/entity/entityStore.js +23 -16
- package/build/features/app/individual/individualStore.d.ts +2 -0
- package/build/features/app/individual/individualStore.js +19 -12
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -5
- package/build/features/business/screens/BusinessType/EntityName.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +9 -8
- package/build/features/business/screens/BusinessType/validation.d.ts +10 -0
- package/build/features/business/screens/BusinessType/validation.js +16 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -3
- package/build/features/connect/Connect.js +3 -3
- package/build/features/connect/screens/Mobile/Mobile.js +7 -6
- package/build/features/connect/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/connectExpress/ConnectExpress.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +12 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +8 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +13 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +67 -0
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +4 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +1 -1
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -6
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -6
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -6
- package/build/features/entity/screens/EntityName/EntityName.js +11 -4
- package/build/features/entity/screens/EntityName/LicenseNumber.js +5 -4
- package/build/features/entity/screens/EntityName/validation.d.ts +28 -0
- package/build/features/entity/screens/EntityName/validation.js +38 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
- package/build/hooks/useCountry.d.ts +1 -0
- package/build/hooks/useCountry.js +4 -3
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +3 -0
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -81,7 +81,7 @@ var MonthlyIncome = function (props) {
|
|
|
81
81
|
var income = monthlyIncomeControl.field.value;
|
|
82
82
|
var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
83
83
|
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('please_enter_actual_income', {
|
|
84
|
-
currency: t(
|
|
84
|
+
currency: t(data.currency)
|
|
85
85
|
}), 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) {
|
|
86
86
|
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) })] }));
|
|
87
87
|
} }) }))] })) })));
|
|
@@ -14,8 +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 {
|
|
18
|
-
import { settingsSelector } from '../../../../app/settings';
|
|
17
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
19
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
20
|
import Input from '../../../shared/Input';
|
|
@@ -25,11 +24,10 @@ var ShareValue = function (_a) {
|
|
|
25
24
|
var _b;
|
|
26
25
|
var show = _a.show, readOnly = _a.readOnly;
|
|
27
26
|
var t = useTranslation().t;
|
|
28
|
-
var
|
|
27
|
+
var data = useAppSelector(individualSelector).data;
|
|
29
28
|
var control = useFormContext().control;
|
|
30
29
|
var bckError = useAppSelector(individualSelector).error;
|
|
31
30
|
var dispatch = useAppDispatch();
|
|
32
|
-
var countryCode = settingsData.businessCountry.iso2;
|
|
33
31
|
var handleChange = function (_a) {
|
|
34
32
|
var target = _a.target;
|
|
35
33
|
if (bckError)
|
|
@@ -41,7 +39,7 @@ var ShareValue = function (_a) {
|
|
|
41
39
|
var shareValue = shareValueControl.field.value;
|
|
42
40
|
var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
41
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
|
|
44
|
-
currency: t(
|
|
42
|
+
currency: t(data.currency)
|
|
45
43
|
}), 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 }) }) })) })));
|
|
46
44
|
};
|
|
47
45
|
export default React.memo(ShareValue);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { IndividualType } from '../../../../@types';
|
|
3
|
-
export declare const IndividualInfoValidationSchema: (objects: Array<IndividualType>,
|
|
3
|
+
export declare const IndividualInfoValidationSchema: (objects: Array<IndividualType>, isKWCountry: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
4
|
occupation: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
5
|
sourceIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
6
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { getIndividualType } from '../../../../utils';
|
|
3
|
-
export var IndividualInfoValidationSchema = function (objects,
|
|
3
|
+
export var IndividualInfoValidationSchema = function (objects, isKWCountry) {
|
|
4
4
|
var isUserType = getIndividualType(objects).isUser;
|
|
5
5
|
return yup.object().shape({
|
|
6
6
|
occupation: isUserType ? yup.object().required('alert_choose_occupation') : yup.object().optional(),
|
|
@@ -9,7 +9,7 @@ export var IndividualInfoValidationSchema = function (objects, isSACountry) {
|
|
|
9
9
|
civilID: yup.array().optional(),
|
|
10
10
|
signatureFileId: yup.array().optional(),
|
|
11
11
|
isPEP: isUserType ? yup.boolean().required('please_choose_relative_pep') : yup.boolean().optional().nullable(),
|
|
12
|
-
isInfluencer: isUserType &&
|
|
12
|
+
isInfluencer: isUserType && isKWCountry ? yup.boolean().required('please_choose_are_you_influncer') : yup.boolean().optional().nullable(),
|
|
13
13
|
shareCount: yup.string().optional(),
|
|
14
14
|
shareValue: yup.string().optional()
|
|
15
15
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { isKW } from '../utils';
|
|
1
|
+
import { isKW, isSA } from '../utils';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
export var useCountry = function (code) {
|
|
4
4
|
var isKuwait = useMemo(function () { return isKW(code); }, [code]);
|
|
5
|
-
var isSaudi = useMemo(function () { return
|
|
6
|
-
|
|
5
|
+
var isSaudi = useMemo(function () { return isSA(code); }, [code]);
|
|
6
|
+
var isOther = useMemo(function () { return !isKW(code) && !isSA(code); }, [code]);
|
|
7
|
+
return { isKuwait: isKuwait, isSaudi: isSaudi, isOther: isOther };
|
|
7
8
|
};
|
package/build/utils/string.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?:
|
|
|
46
46
|
export declare const getEighteenYearsAgo: () => string;
|
|
47
47
|
export declare const isKW: (flag: string) => boolean;
|
|
48
48
|
export declare const isSA: (flag: string) => boolean;
|
|
49
|
+
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
49
50
|
export declare const isLinkedIn: (flag: string) => boolean;
|
|
50
51
|
export declare const isTwitter: (flag: string) => boolean;
|
|
51
52
|
export declare const isWebsite: (flag: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -206,6 +206,9 @@ export var isKW = function (flag) {
|
|
|
206
206
|
export var isSA = function (flag) {
|
|
207
207
|
return ['sa', 'sau'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
208
208
|
};
|
|
209
|
+
export var isOtherThanKWOrSA = function (flag) {
|
|
210
|
+
return !isKW(flag) && !isSA(flag);
|
|
211
|
+
};
|
|
209
212
|
export var isLinkedIn = function (flag) {
|
|
210
213
|
return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
211
214
|
};
|