@tap-payments/auth-jsconnect 2.1.37-test → 2.1.39-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 +4 -7
- package/build/api/auth.d.ts +4 -3
- package/build/api/auth.js +8 -4
- package/build/api/entity.d.ts +0 -8
- package/build/api/entity.js +0 -15
- package/build/api/file.d.ts +13 -0
- package/build/api/file.js +24 -0
- package/build/api/index.d.ts +11 -6
- package/build/api/index.js +3 -1
- package/build/assets/locales/ar.json +5 -1
- package/build/assets/locales/en.json +5 -1
- package/build/components/FileInput/DragAndDrop.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +3 -1
- package/build/components/ProgressBar/CircularProgressBar.js +2 -2
- package/build/components/SimpleList/SimpleList.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.js +3 -3
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.js +1 -1
- package/build/features/app/bank/bankStore.js +1 -1
- package/build/features/app/business/businessStore.d.ts +7 -9
- package/build/features/app/business/businessStore.js +29 -67
- package/build/features/app/connect/connectStore.js +21 -33
- package/build/features/app/connectExpress/connectExpressStore.d.ts +18 -5
- package/build/features/app/connectExpress/connectExpressStore.js +197 -6
- package/build/features/app/individual/individualStore.d.ts +4 -16
- package/build/features/app/individual/individualStore.js +11 -89
- package/build/features/app/signIn/signInStore.js +13 -41
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +1 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +6 -6
- package/build/features/brand/screens/BrandInfo/Segments.js +1 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +1 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/BusinessType/Article.js +10 -13
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -4
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +12 -50
- package/build/features/business/screens/BusinessType/validation.d.ts +3 -6
- package/build/features/business/screens/BusinessType/validation.js +1 -11
- package/build/features/connect/screens/Merchant/SalesChannels.js +4 -3
- package/build/features/connectExpress/ConnectExpress.d.ts +3 -2
- package/build/features/connectExpress/ConnectExpress.js +7 -14
- package/build/features/connectExpress/screens/CivilID/CivilID.js +13 -31
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +0 -4
- package/build/features/connectExpress/screens/Mobile/Mobile.js +25 -49
- package/build/features/connectExpress/screens/NID/DOB.js +2 -2
- package/build/features/connectExpress/screens/NID/IDNumber.js +1 -5
- package/build/features/connectExpress/screens/NID/NID.js +11 -16
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -23
- package/build/features/entity/screens/EntityCapital/ActivityList.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +11 -62
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +11 -59
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +6 -12
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -23
- package/build/features/shared/Address/CountryList.js +1 -1
- package/build/features/shared/Address/InputSelect.js +1 -1
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -2
- package/build/features/shared/SalesChannels/SalesChannel.js +25 -11
- package/build/features/shared/UploadFile/UploadFile.js +1 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +38 -0
- package/build/features/shared/UploadMultipleFile/UploadFile.js +184 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +27 -0
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +147 -1
- package/build/features/shared/UploadMultipleFile/index.d.ts +2 -0
- package/build/features/shared/UploadMultipleFile/index.js +2 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useCountry.d.ts +4 -0
- package/build/hooks/useCountry.js +7 -0
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -3
- package/build/theme/typography.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1,147 @@
|
|
|
1
|
-
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import { useTranslation } from 'react-i18next';
|
|
24
|
+
import { alpha, styled, useTheme } from '@mui/material/styles';
|
|
25
|
+
import Box from '@mui/material/Box';
|
|
26
|
+
import { DragAndDrop } from '../../../components/FileInput';
|
|
27
|
+
import Collapse from '../../../components/Collapse';
|
|
28
|
+
import { InputLabelStyled } from '../../shared/Input/Input';
|
|
29
|
+
import { ScreenContainer } from '../../shared/Containers';
|
|
30
|
+
import Mandatory from '../../shared/Mandatory';
|
|
31
|
+
import UploadFile, { FileStatus } from './UploadFile';
|
|
32
|
+
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
marginBlockStart: theme.spacing(0)
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return ({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
justifyContent: 'space-between',
|
|
43
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5),
|
|
44
|
+
alignItems: 'center'
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
export var InputContainerStyled = styled(Box)(function () { return ({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
width: '100%',
|
|
50
|
+
justifyContent: 'center'
|
|
51
|
+
}); });
|
|
52
|
+
var UploadCountBox = styled(Box)(function (_a) {
|
|
53
|
+
var theme = _a.theme;
|
|
54
|
+
return ({
|
|
55
|
+
fontSize: theme.typography.overline.fontSize,
|
|
56
|
+
padding: theme.spacing(0.375, 0.75, 0.375, 0.75),
|
|
57
|
+
borderRadius: theme.spacing(5.625),
|
|
58
|
+
backgroundColor: alpha(theme.palette.secondary.main, 0.4)
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var UploadMultipleFile = function (_a) {
|
|
62
|
+
var label = _a.label, required = _a.required, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, maxLimit = _a.maxLimit, purpose = _a.purpose, fileTitle = _a.fileTitle;
|
|
63
|
+
var t = useTranslation().t;
|
|
64
|
+
var theme = useTheme();
|
|
65
|
+
var _b = React.useState(''), error = _b[0], setError = _b[1];
|
|
66
|
+
var _c = React.useState([]), fileArray = _c[0], setFileArray = _c[1];
|
|
67
|
+
var _d = React.useState([]), fileInfoArray = _d[0], setFileInfoArray = _d[1];
|
|
68
|
+
var uploadedFileCount = React.useMemo(function () { return (fileInfoArray || []).filter(function (file) { return file.fileId; }).length; }, [fileInfoArray]);
|
|
69
|
+
var handleFileChange = function (files) {
|
|
70
|
+
if (!isSubmitting) {
|
|
71
|
+
if ((files === null || files === void 0 ? void 0 : files.length) > 0) {
|
|
72
|
+
setError('');
|
|
73
|
+
if (maxLimit) {
|
|
74
|
+
if (files.length > maxLimit) {
|
|
75
|
+
setError(t('file_exceed_max_limit', { length: maxLimit }));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
else if ((fileInfoArray || []).filter(function (f) { return f === null || f === void 0 ? void 0 : f.fileId; }).length + files.length > maxLimit) {
|
|
79
|
+
setError(t('file_exceed_max_limit', { length: maxLimit }));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
files.forEach(function (file) {
|
|
84
|
+
fileArray.push(file);
|
|
85
|
+
var isFileAlreadyUploaded = (fileInfoArray || []).find(function (f) { return f.name === file.name && f.status === FileStatus.SUCCESS; });
|
|
86
|
+
if (isFileAlreadyUploaded) {
|
|
87
|
+
fileInfoArray.push({
|
|
88
|
+
fileId: '',
|
|
89
|
+
status: FileStatus.ALREADY_UPLOADED,
|
|
90
|
+
progress: 0,
|
|
91
|
+
error: '',
|
|
92
|
+
name: file.name
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
fileInfoArray.push({ fileId: '', status: FileStatus.INIT, progress: 0, error: '', name: file.name });
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
setFileArray(__spreadArray([], fileArray, true));
|
|
100
|
+
setFileInfoArray(__spreadArray([], fileInfoArray, true));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var handleDelete = function (index) {
|
|
105
|
+
if (!isSubmitting) {
|
|
106
|
+
if (fileInfoArray.length > 0) {
|
|
107
|
+
setError('');
|
|
108
|
+
fileArray.splice(index, 1);
|
|
109
|
+
setFileArray(__spreadArray([], fileArray, true));
|
|
110
|
+
fileInfoArray.splice(index, 1);
|
|
111
|
+
setFileInfoArray(__spreadArray([], fileInfoArray, true));
|
|
112
|
+
var fileIds = fileInfoArray.filter(function (f) { return f.fileId; }).map(function (f) { return f.fileId; });
|
|
113
|
+
onDeleteFile(fileIds);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var handleSuccess = function (index, file) {
|
|
118
|
+
if (fileInfoArray.length > 0) {
|
|
119
|
+
fileInfoArray[index] = file;
|
|
120
|
+
setFileInfoArray(__spreadArray([], fileInfoArray, true));
|
|
121
|
+
var fileIds = fileInfoArray.filter(function (f) { return f.fileId; }).map(function (f) { return f.fileId; });
|
|
122
|
+
onFileUploaded(fileIds);
|
|
123
|
+
fileUploadingStatus === null || fileUploadingStatus === void 0 ? void 0 : fileUploadingStatus(false);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var handleFailure = function (index, file) {
|
|
127
|
+
if (fileInfoArray.length > 0) {
|
|
128
|
+
fileInfoArray[index] = file;
|
|
129
|
+
setFileInfoArray(__spreadArray([], fileInfoArray, true));
|
|
130
|
+
fileUploadingStatus === null || fileUploadingStatus === void 0 ? void 0 : fileUploadingStatus(false);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var handleProgress = function (index, file) {
|
|
134
|
+
if (fileInfoArray.length > 0) {
|
|
135
|
+
fileInfoArray[index] = file;
|
|
136
|
+
setFileInfoArray(__spreadArray([], fileInfoArray, true));
|
|
137
|
+
fileUploadingStatus === null || fileUploadingStatus === void 0 ? void 0 : fileUploadingStatus(true);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
var fileExists = fileInfoArray.length > 0;
|
|
141
|
+
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {}), _jsx(Collapse, __assign({ in: !!uploadedFileCount, timeout: 100, unmountOnExit: true }, { children: _jsx(UploadCountBox, { children: "".concat(uploadedFileCount, " ").concat(t('uploaded_file')) }) }))] }), _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, onSuccess: handleFileChange, multiple: true, error: error }) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: (fileArray || []).map(function (file, index) {
|
|
142
|
+
return (_jsx(UploadFile, { purpose: purpose, title: fileTitle, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
|
|
143
|
+
borderBottom: index === fileArray.length - 1 ? "1px solid ".concat(alpha(theme.palette.divider, 0.8)) : ''
|
|
144
|
+
}, onSuccess: handleSuccess, onDelete: handleDelete, onFailure: handleFailure, onProgress: handleProgress }, index));
|
|
145
|
+
}) }))] }));
|
|
146
|
+
};
|
|
147
|
+
export default UploadMultipleFile;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import UploadMultipleFile from './UploadMultipleFile';
|
|
2
|
+
export default UploadMultipleFile;
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { isKW } from '../utils';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
export var useCountry = function (code) {
|
|
4
|
+
var isKuwait = useMemo(function () { return isKW(code); }, [code]);
|
|
5
|
+
var isSaudi = useMemo(function () { return isKW(code); }, [code]);
|
|
6
|
+
return { isKuwait: isKuwait, isSaudi: isSaudi };
|
|
7
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import './i18n';
|
|
3
3
|
import { ConnectLib, renderConnectLib, ConnectLibProps, unmountConnectLib } from './features/connect';
|
|
4
|
-
import { ConnectExpressLib, renderConnectExpressLib, ConnectExpressLibProps
|
|
4
|
+
import { ConnectExpressLib, renderConnectExpressLib, ConnectExpressLibProps } from './features/connectExpress';
|
|
5
5
|
import { BusinessLib, renderBusinessLib, BusinessLibProps, unmountBusinessLib } from './features/business';
|
|
6
6
|
import { PasswordLib, renderPasswordLib, PasswordLibProps, unmountPasswordLib } from './features/password';
|
|
7
7
|
import { IndividualLib, renderIndividualLib, IndividualLibProps, unmountIndividualLib } from './features/individual';
|
|
@@ -12,4 +12,4 @@ import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './
|
|
|
12
12
|
import { BrandLib, BrandLibProps, renderBrandLib, unmountBrandLib } from './features/brand';
|
|
13
13
|
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
14
14
|
export type { ConnectLibProps, ConnectExpressLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, BrandLibProps, AuthLibProps, SignInLibProps };
|
|
15
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, ConnectExpressLib, renderConnectExpressLib,
|
|
15
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, ConnectExpressLib, renderConnectExpressLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, BrandLib, unmountBrandLib, renderBrandLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import './i18n';
|
|
3
3
|
import { ConnectLib, renderConnectLib, unmountConnectLib } from './features/connect';
|
|
4
|
-
import { ConnectExpressLib, renderConnectExpressLib
|
|
4
|
+
import { ConnectExpressLib, renderConnectExpressLib } from './features/connectExpress';
|
|
5
5
|
import { BusinessLib, renderBusinessLib, unmountBusinessLib } from './features/business';
|
|
6
6
|
import { PasswordLib, renderPasswordLib, unmountPasswordLib } from './features/password';
|
|
7
7
|
import { IndividualLib, renderIndividualLib, unmountIndividualLib } from './features/individual';
|
|
@@ -11,12 +11,11 @@ import { SignInLib, renderSignInLib, unmountSignInLib } from './features/signIn'
|
|
|
11
11
|
import { EntityLib, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
12
12
|
import { BrandLib, renderBrandLib, unmountBrandLib } from './features/brand';
|
|
13
13
|
import { AuthLib, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
14
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, ConnectExpressLib, renderConnectExpressLib,
|
|
14
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, ConnectExpressLib, renderConnectExpressLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, BrandLib, unmountBrandLib, renderBrandLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
|
15
15
|
window['TapAuth'] = {
|
|
16
16
|
renderConnectLib: renderConnectLib,
|
|
17
17
|
unmountConnectLib: unmountConnectLib,
|
|
18
18
|
renderConnectExpressLib: renderConnectExpressLib,
|
|
19
|
-
unmountConnectExpressLib: unmountConnectExpressLib,
|
|
20
19
|
renderBusinessLib: renderBusinessLib,
|
|
21
20
|
unmountBusinessLib: unmountBusinessLib,
|
|
22
21
|
renderPasswordLib: renderPasswordLib,
|