@tap-payments/auth-jsconnect 2.6.98-test → 2.6.100-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/form.d.ts +0 -1
- package/build/app/settings.d.ts +2 -1
- package/build/app/settings.js +5 -1
- package/build/constants/app.js +13 -1
- package/build/features/app/auth/authStore.d.ts +14 -9
- package/build/features/app/auth/authStore.js +99 -25
- package/build/features/app/connectExpress/connectExpressStore.d.ts +1 -1
- package/build/features/auth/screens/AccountCreatedLoader/AccountCreatedLoader.d.ts +5 -0
- package/build/features/auth/screens/AccountCreatedLoader/AccountCreatedLoader.js +36 -0
- package/build/features/auth/screens/AccountCreatedLoader/index.d.ts +2 -0
- package/build/features/auth/screens/AccountCreatedLoader/index.js +2 -0
- package/build/features/auth/screens/AuthMerchant/AuthMerchant.d.ts +5 -0
- package/build/features/auth/screens/AuthMerchant/AuthMerchant.js +73 -0
- package/build/features/auth/screens/{AuthenticationList → AuthMerchant}/MerchantList.d.ts +2 -1
- package/build/features/auth/screens/AuthMerchant/MerchantList.js +64 -0
- package/build/features/auth/screens/AuthMerchant/index.d.ts +2 -0
- package/build/features/auth/screens/AuthMerchant/index.js +2 -0
- package/build/features/auth/screens/AuthMerchant/validation.d.ts +8 -0
- package/build/features/auth/screens/AuthMerchant/validation.js +4 -0
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +28 -17
- package/build/features/auth/screens/AuthenticationList/EntityLegalName.d.ts +3 -0
- package/build/features/auth/screens/AuthenticationList/EntityLegalName.js +48 -0
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +31 -0
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +90 -0
- package/build/features/auth/screens/AuthenticationList/EntityList.d.ts +3 -3
- package/build/features/auth/screens/AuthenticationList/EntityList.js +51 -9
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.d.ts +3 -0
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +36 -0
- package/build/features/auth/screens/AuthenticationList/validation.d.ts +13 -7
- package/build/features/auth/screens/AuthenticationList/validation.js +66 -6
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -0
- package/build/features/featuresScreens.js +10 -0
- package/build/utils/locale.js +2 -1
- package/package.json +1 -1
- package/build/features/auth/screens/AuthenticationList/MerchantList.js +0 -110
|
@@ -36,6 +36,8 @@ import AuthOTPScreen from './auth/screens/OTP';
|
|
|
36
36
|
import PreparingDataScreen from './auth/screens/PreparingData';
|
|
37
37
|
import AccountNotFoundScreen from './auth/screens/AccountNotFound';
|
|
38
38
|
import AuthAuthenticationListScreen from './auth/screens/AuthenticationList';
|
|
39
|
+
import AuthMerchantScreen from './auth/screens/AuthMerchant';
|
|
40
|
+
import AuthAccountCreatedLoaderScreen from './auth/screens/AccountCreatedLoader';
|
|
39
41
|
import CustomersPage from './business/screens/Customers';
|
|
40
42
|
import IDBODPage from './business/screens/IDBOD';
|
|
41
43
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
@@ -253,6 +255,14 @@ export var authFeatureScreens = [
|
|
|
253
255
|
{
|
|
254
256
|
name: 'AUTH_AUTHENTICATION_LIST_STEP',
|
|
255
257
|
element: AuthAuthenticationListScreen
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'AUTH_MERCHANT_LIST_STEP',
|
|
261
|
+
element: AuthMerchantScreen
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'AUTH_ACCOUNT_CREATED_STEP',
|
|
265
|
+
element: AuthAccountCreatedLoaderScreen
|
|
256
266
|
}
|
|
257
267
|
];
|
|
258
268
|
export var businessFeatureScreens = [
|
package/build/utils/locale.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { initReactI18next } from 'react-i18next';
|
|
2
2
|
import i18n from '../i18n';
|
|
3
3
|
export var updateLocale = function (locale, country) {
|
|
4
|
-
var
|
|
4
|
+
var _a;
|
|
5
|
+
var data = (_a = locale[country.toUpperCase()]) !== null && _a !== void 0 ? _a : (locale['SA'] || locale['default']);
|
|
5
6
|
if (i18n.isInitialized) {
|
|
6
7
|
i18n.removeResourceBundle('*', 'translation');
|
|
7
8
|
i18n.addResourceBundle('en', 'translation', data.en.translation);
|
package/package.json
CHANGED
|
@@ -1,110 +0,0 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import * as React from 'react';
|
|
23
|
-
import { useTranslation } from 'react-i18next';
|
|
24
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
25
|
-
import { styled } from '@mui/material/styles';
|
|
26
|
-
import Box from '@mui/material/Box';
|
|
27
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
28
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
29
|
-
import Collapse from '../../../../components/Collapse';
|
|
30
|
-
import Text from '../../../../components/Text';
|
|
31
|
-
import SimpleList from '../../../../components/SimpleList';
|
|
32
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
33
|
-
import InputSelect from '../../../shared/InputSelect';
|
|
34
|
-
import { getMerchantList, authSelector } from '../../../app/auth/authStore';
|
|
35
|
-
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
36
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
37
|
-
var MerchantContainer = styled(Box)(function () { return ({
|
|
38
|
-
display: 'flex'
|
|
39
|
-
}); });
|
|
40
|
-
var MerchantNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
41
|
-
var theme = _a.theme, isSelected = _a.isSelected;
|
|
42
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
43
|
-
});
|
|
44
|
-
var MerchantList = React.forwardRef(function (_a, ref) {
|
|
45
|
-
var _b;
|
|
46
|
-
var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
47
|
-
var _c = React.useState([]), list = _c[0], setList = _c[1];
|
|
48
|
-
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
49
|
-
var t = useTranslation().t;
|
|
50
|
-
var dispatch = useAppDispatch();
|
|
51
|
-
var _e = useFormContext(), control = _e.control, watch = _e.watch, setValue = _e.setValue;
|
|
52
|
-
var _f = useAppSelector(authSelector), data = _f.data, merchantLoading = _f.merchantLoading;
|
|
53
|
-
var merchantList = (data.responseData || {}).merchantList;
|
|
54
|
-
var merchantInfoControl = useController({ control: control, name: 'merchantInfo' });
|
|
55
|
-
var entityInfo = watch('entityInfo');
|
|
56
|
-
var brandInfo = watch('brandInfo');
|
|
57
|
-
var merchantValue = merchantInfoControl.field.value;
|
|
58
|
-
var error = (_b = merchantInfoControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
59
|
-
React.useEffect(function () {
|
|
60
|
-
if ((merchantList === null || merchantList === void 0 ? void 0 : merchantList.length) > 0) {
|
|
61
|
-
var list_1 = __spreadArray([], merchantList, true);
|
|
62
|
-
setList(list_1);
|
|
63
|
-
}
|
|
64
|
-
}, [merchantList]);
|
|
65
|
-
React.useEffect(function () {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
if (!entityInfo)
|
|
68
|
-
return;
|
|
69
|
-
if (merchantLoading)
|
|
70
|
-
return;
|
|
71
|
-
var brandInfoId = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id;
|
|
72
|
-
var entityId = (merchantList === null || merchantList === void 0 ? void 0 : merchantList.length) > 0 ? (_a = merchantList[0]) === null || _a === void 0 ? void 0 : _a.business_entity_id : '';
|
|
73
|
-
var brandId = (merchantList === null || merchantList === void 0 ? void 0 : merchantList.length) > 0 ? (_b = merchantList[0]) === null || _b === void 0 ? void 0 : _b.brand_id : '';
|
|
74
|
-
var id = (entityInfo || {}).id;
|
|
75
|
-
if (!id)
|
|
76
|
-
return;
|
|
77
|
-
if ((entityId && id && entityId !== id) || (brandId && brandInfoId && brandId !== brandInfoId)) {
|
|
78
|
-
setValue('merchantInfo', undefined);
|
|
79
|
-
dispatch(getMerchantList({ entityId: id, brandId: brandInfoId }));
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (!(merchantList === null || merchantList === void 0 ? void 0 : merchantList.length)) {
|
|
83
|
-
dispatch(getMerchantList({ entityId: id, brandId: brandInfoId }));
|
|
84
|
-
}
|
|
85
|
-
}, [entityInfo, merchantList, brandInfo]);
|
|
86
|
-
var onOpenMerchantSelect = function (event) {
|
|
87
|
-
if (readOnly)
|
|
88
|
-
return;
|
|
89
|
-
setAnchorEl(event.currentTarget);
|
|
90
|
-
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
91
|
-
};
|
|
92
|
-
var onCloseMerchantSelect = function () {
|
|
93
|
-
setAnchorEl(null);
|
|
94
|
-
onListClose === null || onListClose === void 0 ? void 0 : onListClose();
|
|
95
|
-
setList(merchantList);
|
|
96
|
-
};
|
|
97
|
-
var onSelectItem = function (merchant) {
|
|
98
|
-
onCloseMerchantSelect();
|
|
99
|
-
merchantInfoControl.field.onChange(merchant);
|
|
100
|
-
};
|
|
101
|
-
var getName = function (merchant) {
|
|
102
|
-
if (!merchant)
|
|
103
|
-
return '';
|
|
104
|
-
return merchant.display_name;
|
|
105
|
-
};
|
|
106
|
-
return (_jsx(Collapse, __assign({ in: show && (merchantList === null || merchantList === void 0 ? void 0 : merchantList.length) > 1 }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mt: 2.5 } }, { children: [_jsx(InputSelect, { label: t('select_merchant_label'), readOnly: readOnly, placeholder: t('select_merchant_placeholder'), value: getName(merchantValue) || '', warningMessage: error && t(error), onClick: merchantLoading ? undefined : !!anchorEl ? function () { return onCloseMerchantSelect(); } : onOpenMerchantSelect, endAdornment: merchantLoading ? (_jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } })) : (_jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified })) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { list: list || [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsx(MerchantContainer, { children: _jsx(MerchantNameText, __assign({ isSelected: item.id === (merchantValue === null || merchantValue === void 0 ? void 0 : merchantValue.id) }, { children: getName(item) })) }), item.id === (merchantValue === null || merchantValue === void 0 ? void 0 : merchantValue.id) && _jsx(CheckIcon, { isVerified: isVerified })] }));
|
|
108
|
-
} }) }))] })) })));
|
|
109
|
-
});
|
|
110
|
-
export default React.memo(MerchantList);
|