@tap-payments/auth-jsconnect 2.1.14-test → 2.1.16-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/components/Lottie/files/start_loading.json +9 -9
- package/build/constants/app.js +2 -2
- package/build/features/app/business/businessStore.js +13 -9
- package/build/features/app/connect/connectStore.d.ts +1 -5
- package/build/features/app/connect/connectStore.js +172 -247
- package/build/features/business/screens/Activities/Activities.js +6 -14
- package/build/features/business/screens/BusinessType/BusinessType.js +11 -14
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Individual.js +5 -8
- package/build/features/connect/screens/Merchant/Merchant.js +9 -21
- package/build/features/connect/screens/Merchant/SalesChannels.js +8 -12
- package/build/features/connect/screens/Merchant/validation.js +3 -3
- package/build/features/shared/PaciVerification/VerifyPACILoading.js +3 -3
- package/build/features/shared/SalesChannels/SalesChannel.js +6 -4
- package/build/hooks/useSetFromDefaultValues.js +2 -0
- package/package.json +129 -129
|
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import { styled } from '@mui/material/styles';
|
|
@@ -48,13 +37,16 @@ var Activities = function () {
|
|
|
48
37
|
var isAr = useLanguage().isAr;
|
|
49
38
|
var t = useTranslation().t;
|
|
50
39
|
var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
51
|
-
var _d = data.activitiesData,
|
|
40
|
+
var _d = data.activitiesData, activities = _d.activities, operationStartDate = _d.operationStartDate;
|
|
52
41
|
var methods = useForm({
|
|
53
42
|
resolver: yupResolver(ActivitiesValidationSchema),
|
|
54
|
-
defaultValues:
|
|
43
|
+
defaultValues: {
|
|
44
|
+
activities: activities,
|
|
45
|
+
operationStartDate: operationStartDate
|
|
46
|
+
},
|
|
55
47
|
mode: 'onChange'
|
|
56
48
|
});
|
|
57
|
-
useSetFromDefaultValues(methods,
|
|
49
|
+
useSetFromDefaultValues(methods, data.activitiesData, true);
|
|
58
50
|
var onSubmit = function (data) {
|
|
59
51
|
dispatch(updateActivitiesInfo(__assign({}, data)));
|
|
60
52
|
};
|
|
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -39,7 +28,7 @@ import LicenseList from './LicenseList';
|
|
|
39
28
|
var BusinessType = function (_a) {
|
|
40
29
|
var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error, uploading = _b.uploading;
|
|
41
30
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
42
|
-
var _c = data.businessTypeData,
|
|
31
|
+
var _c = data.businessTypeData, selectedLicense = _c.selectedLicense, licenseNumber = _c.licenseNumber, entityLegalName = _c.entityLegalName, certificateId = _c.certificateId, certificateFile = _c.certificateFile, articleId = _c.articleId, articleFile = _c.articleFile;
|
|
43
32
|
var t = useTranslation().t;
|
|
44
33
|
var isAr = useLanguage().isAr;
|
|
45
34
|
var dispatch = useAppDispatch();
|
|
@@ -47,10 +36,18 @@ var BusinessType = function (_a) {
|
|
|
47
36
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
48
37
|
var methods = useForm({
|
|
49
38
|
resolver: yupResolver(!isSACountry ? KWLicenseValidationSchema : LicenseValidationSchema),
|
|
50
|
-
defaultValues:
|
|
39
|
+
defaultValues: {
|
|
40
|
+
selectedLicense: selectedLicense,
|
|
41
|
+
licenseNumber: licenseNumber,
|
|
42
|
+
entityLegalName: entityLegalName,
|
|
43
|
+
certificateId: certificateId,
|
|
44
|
+
certificateFile: certificateFile,
|
|
45
|
+
articleId: articleId,
|
|
46
|
+
articleFile: articleFile
|
|
47
|
+
},
|
|
51
48
|
mode: 'onChange'
|
|
52
49
|
});
|
|
53
|
-
useSetFromDefaultValues(methods,
|
|
50
|
+
useSetFromDefaultValues(methods, data.businessTypeData);
|
|
54
51
|
React.useEffect(function () {
|
|
55
52
|
if (error)
|
|
56
53
|
dispatch(clearError());
|
|
@@ -78,7 +78,7 @@ var CivilID = function (_a) {
|
|
|
78
78
|
defaultValues: defaultValues,
|
|
79
79
|
mode: 'onChange'
|
|
80
80
|
});
|
|
81
|
-
useSetFromDefaultValues(methods,
|
|
81
|
+
useSetFromDefaultValues(methods, data.civilIdData);
|
|
82
82
|
React.useEffect(function () {
|
|
83
83
|
handleClearError();
|
|
84
84
|
}, [methods.formState.isValid]);
|
|
@@ -58,15 +58,15 @@ var Individual = function (_a) {
|
|
|
58
58
|
var individualData = data.individualData, otpData = data.otpData, mobileData = data.mobileData;
|
|
59
59
|
var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
|
|
60
60
|
var isMobile = mobileData.mobile;
|
|
61
|
-
var
|
|
61
|
+
var contact = (otpData.responseBody || {}).contact;
|
|
62
62
|
var responseBody = individualData.responseBody, defaultValues = __rest(individualData, ["responseBody"]);
|
|
63
63
|
var is_available = (responseBody || {}).is_available;
|
|
64
64
|
var methods = useForm({
|
|
65
65
|
resolver: yupResolver(isMobile ? IndividualValidation : IndividualMobileValidation),
|
|
66
|
-
defaultValues:
|
|
66
|
+
defaultValues: individualData,
|
|
67
67
|
mode: 'onChange'
|
|
68
68
|
});
|
|
69
|
-
useSetFromDefaultValues(methods,
|
|
69
|
+
useSetFromDefaultValues(methods, individualData, true);
|
|
70
70
|
React.useEffect(function () {
|
|
71
71
|
if (defaultValues.countryCode.iso2 !== methods.getValues('countryCode.iso2'))
|
|
72
72
|
methods.setValue('countryCode', defaultValues.countryCode);
|
|
@@ -86,7 +86,7 @@ var Individual = function (_a) {
|
|
|
86
86
|
dispatch(clearError());
|
|
87
87
|
}, [methods.formState.isValid]);
|
|
88
88
|
var handleMenuListClick = function () {
|
|
89
|
-
|
|
89
|
+
setListActive(!listActive);
|
|
90
90
|
};
|
|
91
91
|
React.useEffect(function () {
|
|
92
92
|
if (is_available === false)
|
|
@@ -96,9 +96,6 @@ var Individual = function (_a) {
|
|
|
96
96
|
var isEmailValid = typeof is_available === 'undefined' ? isLeadEmailAvailable : is_available;
|
|
97
97
|
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
|
|
98
98
|
var disabled = emailErrChecks || emailChecking || !isEmailValid;
|
|
99
|
-
|
|
100
|
-
var isEmailRequired = (userInfoMissed && !(contact === null || contact === void 0 ? void 0 : contact.email)) || is_new_individual;
|
|
101
|
-
var isMobileRequired = (userInfoMissed && !(contact === null || contact === void 0 ? void 0 : contact.phone)) || is_new_individual;
|
|
102
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { show: !listActive && isNameRequired }), _jsx(MobileNumber, { show: !isMobile && isMobileRequired, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: countriesCode }), _jsx(Email, { show: !listActive && isEmailRequired, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
99
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { show: !listActive }), _jsx(MobileNumber, { show: !isMobile, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: countriesCode }), _jsx(Email, { show: !listActive, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
103
100
|
};
|
|
104
101
|
export default React.memo(Individual);
|
|
@@ -16,29 +16,24 @@ import { useTranslation } from 'react-i18next';
|
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
-
import { handlePrevScreenStep
|
|
19
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
21
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
23
|
import { clearError, connectSelector, updateLeadBrand } from '../../../app/connect/connectStore';
|
|
24
24
|
import { useLanguage } from '../../../../hooks';
|
|
25
|
-
import { AuthForType } from '../../../../@types';
|
|
26
|
-
import { isKW } from '../../../../utils';
|
|
27
25
|
import { MerchantValidationSchema } from './validation';
|
|
28
26
|
import BrandName from './BrandName';
|
|
29
27
|
import TAC from './TAC';
|
|
30
28
|
import BrandList from './BrandList';
|
|
31
29
|
import SalesChannels from './SalesChannels';
|
|
32
30
|
var Merchant = function (_a) {
|
|
33
|
-
var _b
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var isNewIndividual = (_b = data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.is_new_individual;
|
|
40
|
-
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
41
|
-
var _h = data.brandData, brandName = _h.brandName, selectedBrandItem = _h.selectedBrandItem, termAndConditionChecked = _h.termAndConditionChecked, responseBody = _h.responseBody, salesChannels = _h.salesChannels;
|
|
31
|
+
var _b;
|
|
32
|
+
var _c = React.useState(false), brandNameChecking = _c[0], setBrandNameChecking = _c[1];
|
|
33
|
+
var _d = React.useState(false), isBrandListOpen = _d[0], setIsBrandListOpen = _d[1];
|
|
34
|
+
var _e = React.useState(false), isRequiredNewBrand = _e[0], setIsRequiredNewBrand = _e[1];
|
|
35
|
+
var _f = useAppSelector(connectSelector), data = _f.data, loading = _f.loading, error = _f.error;
|
|
36
|
+
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels;
|
|
42
37
|
var brandList = (responseBody || {}).brand_list;
|
|
43
38
|
var methods = useForm({
|
|
44
39
|
resolver: yupResolver(MerchantValidationSchema(isRequiredNewBrand)),
|
|
@@ -58,14 +53,7 @@ var Merchant = function (_a) {
|
|
|
58
53
|
dispatch(updateLeadBrand(__assign(__assign({}, formData), { isNewBrand: isRequiredNewBrand })));
|
|
59
54
|
};
|
|
60
55
|
var onBack = function () {
|
|
61
|
-
|
|
62
|
-
if (isNewIndividual) {
|
|
63
|
-
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
67
|
-
var screen = startWithNID ? (isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : 'CONNECT_NID_STEP') : 'CONNECT_MOBILE_STEP';
|
|
68
|
-
dispatch(handlePrevScreenStep(screen));
|
|
56
|
+
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
69
57
|
};
|
|
70
58
|
React.useEffect(function () {
|
|
71
59
|
if (error)
|
|
@@ -80,7 +68,7 @@ var Merchant = function (_a) {
|
|
|
80
68
|
methods.setValue('termAndConditionChecked', termAndConditionChecked);
|
|
81
69
|
}, [termAndConditionChecked]);
|
|
82
70
|
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
83
|
-
var disabled = brandErrChecks || brandNameChecking || ((
|
|
71
|
+
var disabled = brandErrChecks || brandNameChecking || ((_b = data.brandData.responseBody) === null || _b === void 0 ? void 0 : _b.response_code) === '5';
|
|
84
72
|
var hasBrandList = (brandList === null || brandList === void 0 ? void 0 : brandList.length) > 0;
|
|
85
73
|
var isOtherBrand = (brandListItem === null || brandListItem === void 0 ? void 0 : brandListItem.id) === 'other' && hasBrandList;
|
|
86
74
|
var isNewBrand = (brandList === null || brandList === void 0 ? void 0 : brandList.length) === 0 || BrandList === undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { useController, useFormContext } from 'react-hook-form';
|
|
5
4
|
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
6
5
|
import { connectSelector, clearError } from '../../../app/connect/connectStore';
|
|
@@ -8,34 +7,31 @@ import { mapSalesChannel } from '../../../../utils';
|
|
|
8
7
|
import SalesChannel from '../../../shared/SalesChannels';
|
|
9
8
|
var SalesChannels = function (_a) {
|
|
10
9
|
var _b;
|
|
11
|
-
var _c =
|
|
12
|
-
var t = useTranslation().t;
|
|
13
|
-
var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
|
|
10
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
14
11
|
var dispatch = useAppDispatch();
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
12
|
+
var _d = useController({ control: control, name: 'salesChannels' }), fieldState = _d.fieldState, field = _d.field;
|
|
13
|
+
var _e = useAppSelector(connectSelector), data = _e.data, error = _e.error;
|
|
14
|
+
var _f = data.brandData, selectedBrandItem = _f.selectedBrandItem, responseBody = _f.responseBody, defaultSalesChannels = _f.salesChannels;
|
|
18
15
|
var channelList = (responseBody || {}).channel_list;
|
|
19
16
|
React.useEffect(function () {
|
|
20
17
|
if (selectedBrandItem.id) {
|
|
21
18
|
setValue('selectedBrandItem', selectedBrandItem);
|
|
22
19
|
var sales = mapSalesChannel(selectedBrandItem.channel_services || []);
|
|
23
|
-
|
|
24
|
-
setValue('salesChannels', sales, { shouldValidate: true });
|
|
20
|
+
field.onChange(sales);
|
|
25
21
|
}
|
|
26
22
|
}, [selectedBrandItem]);
|
|
27
23
|
React.useEffect(function () {
|
|
28
24
|
if (defaultSalesChannels.length > 0) {
|
|
29
25
|
var sales = mapSalesChannel(defaultSalesChannels);
|
|
30
|
-
|
|
31
|
-
setValue('salesChannels', sales, { shouldValidate: true });
|
|
26
|
+
field.onChange(sales);
|
|
32
27
|
}
|
|
33
28
|
}, [defaultSalesChannels]);
|
|
29
|
+
var selectedSalesChannels = React.useMemo(function () { return mapSalesChannel(field.value); }, [field.value]);
|
|
34
30
|
var onChange = function (channels) {
|
|
35
31
|
if (error)
|
|
36
32
|
dispatch(clearError());
|
|
37
33
|
field.onChange(channels);
|
|
38
34
|
};
|
|
39
|
-
return (_jsx(_Fragment, { children: _jsx(SalesChannel, { error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, list: channelList, onChange: onChange, defaultValues:
|
|
35
|
+
return (_jsx(_Fragment, { children: _jsx(SalesChannel, { error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, list: channelList, onChange: onChange, defaultValues: selectedSalesChannels }) }));
|
|
40
36
|
};
|
|
41
37
|
export default SalesChannels;
|
|
@@ -79,9 +79,9 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
79
79
|
test: function (value) {
|
|
80
80
|
if (length === 0)
|
|
81
81
|
return true;
|
|
82
|
-
if (length
|
|
83
|
-
return
|
|
84
|
-
return
|
|
82
|
+
if (length >= 3 || (value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
|
|
83
|
+
return true;
|
|
84
|
+
return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
|
|
85
85
|
}
|
|
86
86
|
})
|
|
87
87
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
@@ -4,10 +4,10 @@ import LottieFile, { LottieAnimationFiles } from '../../../components/Lottie';
|
|
|
4
4
|
var VerifyPACILoading = function (_a) {
|
|
5
5
|
var _b = _a.loop, loop = _b === void 0 ? true : _b, type = _a.type;
|
|
6
6
|
if (type === 1)
|
|
7
|
-
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.start_loading, loop: loop, width: '
|
|
7
|
+
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.start_loading, loop: loop, width: '60%' }) }));
|
|
8
8
|
if (type === 2)
|
|
9
|
-
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.still_loading, loop: loop, width: '
|
|
10
|
-
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.error, loop: false, width: '
|
|
9
|
+
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.still_loading, loop: loop, width: '60%' }) }));
|
|
10
|
+
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.error, loop: false, width: '60%' }) }));
|
|
11
11
|
};
|
|
12
12
|
VerifyPACILoading.defaultProps = {};
|
|
13
13
|
export default memo(VerifyPACILoading);
|
|
@@ -74,9 +74,9 @@ var CollapseStyled = styled(Collapse)(function (_a) {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
var SalesChannel = function (_a) {
|
|
77
|
-
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error,
|
|
78
|
-
var
|
|
79
|
-
var
|
|
77
|
+
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, _c = _a.defaultValues, defaultValues = _c === void 0 ? [] : _c;
|
|
78
|
+
var _d = React.useState([]), selectedSalas = _d[0], setSelectedSales = _d[1];
|
|
79
|
+
var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
|
|
80
80
|
var t = useTranslation().t;
|
|
81
81
|
var isAr = useLanguage().isAr;
|
|
82
82
|
var isChecked = function (id) {
|
|
@@ -97,6 +97,7 @@ var SalesChannel = function (_a) {
|
|
|
97
97
|
}
|
|
98
98
|
onChangeActiveSaleIcon(findFirstId([channel]));
|
|
99
99
|
setSelectedSales(__spreadArray(__spreadArray([], selectedSalas, true), [channel], false));
|
|
100
|
+
onChange(__spreadArray(__spreadArray([], selectedSalas, true), [channel], false));
|
|
100
101
|
};
|
|
101
102
|
var onValueChange = function (value, id) {
|
|
102
103
|
var newSelectedSales = selectedSalas.map(function (item) {
|
|
@@ -119,7 +120,8 @@ var SalesChannel = function (_a) {
|
|
|
119
120
|
onChange(newSelectedSales);
|
|
120
121
|
};
|
|
121
122
|
React.useEffect(function () {
|
|
122
|
-
if (defaultValues
|
|
123
|
+
if (defaultValues.length >= 0) {
|
|
124
|
+
console.log('defaultValues', defaultValues);
|
|
123
125
|
setSelectedSales(defaultValues);
|
|
124
126
|
onChangeActiveSaleIcon(findFirstId(defaultValues));
|
|
125
127
|
}
|
|
@@ -11,6 +11,8 @@ export var useSetFromDefaultValues = function (method, defaultValues, shouldVali
|
|
|
11
11
|
var setFromDefaultValues = function () {
|
|
12
12
|
for (var key in defaultValues) {
|
|
13
13
|
if (Object.prototype.hasOwnProperty.call(defaultValues, key)) {
|
|
14
|
+
if (key === 'responseBody')
|
|
15
|
+
continue;
|
|
14
16
|
var value = defaultValues[key];
|
|
15
17
|
if (!isValidValue(method.getValues(key)) && isValidValue(value)) {
|
|
16
18
|
method.setValue(key, value, { shouldValidate: shouldValidate });
|
package/package.json
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "connect library, auth",
|
|
5
|
-
"private": false,
|
|
6
|
-
"main": "build/index.js",
|
|
7
|
-
"module": "build/index.js",
|
|
8
|
-
"types": "build/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"build",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"husky:setup": "npx husky install",
|
|
15
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
-
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
-
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
-
"build": "rm -rf build && cross-env NODE_ENV=production webpack",
|
|
21
|
-
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
-
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [],
|
|
27
|
-
"author": {
|
|
28
|
-
"name": "Ahmed Elsharkawy",
|
|
29
|
-
"email": "a.elsharkawy@tap.company"
|
|
30
|
-
},
|
|
31
|
-
"license": "ISC",
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.18.6",
|
|
34
|
-
"@babel/preset-env": "^7.18.6",
|
|
35
|
-
"@babel/preset-react": "^7.18.6",
|
|
36
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
-
"@types/lodash-es": "^4.17.6",
|
|
38
|
-
"@types/react": "^18.0.15",
|
|
39
|
-
"@types/react-calendar": "~3.5.1",
|
|
40
|
-
"@types/react-dom": "^18.0.6",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
42
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
43
|
-
"babel-loader": "^8.2.5",
|
|
44
|
-
"copyfiles": "^2.4.1",
|
|
45
|
-
"cross-env": "^7.0.3",
|
|
46
|
-
"css-loader": "^6.7.1",
|
|
47
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
48
|
-
"eslint": "^8.19.0",
|
|
49
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
50
|
-
"eslint-config-prettier": "^8.5.0",
|
|
51
|
-
"eslint-plugin-import": "^2.26.0",
|
|
52
|
-
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
53
|
-
"eslint-plugin-node": "^11.1.0",
|
|
54
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
55
|
-
"eslint-plugin-react": "^7.30.1",
|
|
56
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
57
|
-
"file-loader": "^6.2.0",
|
|
58
|
-
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
59
|
-
"html-loader": "^3.1.2",
|
|
60
|
-
"html-webpack-plugin": "^5.5.0",
|
|
61
|
-
"husky": "^8.0.1",
|
|
62
|
-
"lint-staged": "^13.0.3",
|
|
63
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
64
|
-
"prettier": "^2.7.1",
|
|
65
|
-
"sass": "^1.53.0",
|
|
66
|
-
"sass-loader": "^13.0.2",
|
|
67
|
-
"style-loader": "^3.3.1",
|
|
68
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
69
|
-
"tsc-alias": "^1.6.11",
|
|
70
|
-
"typescript": "^4.7.4",
|
|
71
|
-
"webpack": "^5.73.0",
|
|
72
|
-
"webpack-cli": "^4.10.0",
|
|
73
|
-
"webpack-dev-server": "^4.9.3",
|
|
74
|
-
"webpack-merge": "^5.8.0"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
77
|
-
"@emotion/react": "^11.9.3",
|
|
78
|
-
"@emotion/styled": "^11.9.3",
|
|
79
|
-
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
80
|
-
"@hookform/resolvers": "^2.9.6",
|
|
81
|
-
"@mui/icons-material": "^5.8.4",
|
|
82
|
-
"@mui/material": "^5.8.7",
|
|
83
|
-
"@reduxjs/toolkit": "^1.8.3",
|
|
84
|
-
"axios": "^0.27.2",
|
|
85
|
-
"device-detector-js": "^3.0.3",
|
|
86
|
-
"i18next": "^21.8.14",
|
|
87
|
-
"i18next-browser-languagedetector": "^6.1.4",
|
|
88
|
-
"i18next-http-backend": "^1.4.1",
|
|
89
|
-
"jsencrypt": "^2.3.1",
|
|
90
|
-
"lodash-es": "^4.17.21",
|
|
91
|
-
"lottie-web": "^5.9.6",
|
|
92
|
-
"moment": "^2.29.4",
|
|
93
|
-
"react": "^18.2.0",
|
|
94
|
-
"react-calendar": "~3.7.0",
|
|
95
|
-
"react-device-detect": "^2.2.2",
|
|
96
|
-
"react-dom": "^18.2.0",
|
|
97
|
-
"react-dropzone": "^14.2.2",
|
|
98
|
-
"react-hook-form": "^7.33.1",
|
|
99
|
-
"react-i18next": "^11.18.1",
|
|
100
|
-
"react-multi-date-picker": "^3.3.4",
|
|
101
|
-
"react-otp-input": "^2.4.0",
|
|
102
|
-
"react-redux": "^8.0.2",
|
|
103
|
-
"react-spring-bottom-sheet": "^3.4.1",
|
|
104
|
-
"yup": "^0.32.11"
|
|
105
|
-
},
|
|
106
|
-
"peerDependencies": {
|
|
107
|
-
"react": "^18.2.0",
|
|
108
|
-
"react-dom": "^18.2.0"
|
|
109
|
-
},
|
|
110
|
-
"lint-staged": {
|
|
111
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
112
|
-
"yarn run prettier:fix",
|
|
113
|
-
"yarn run lint",
|
|
114
|
-
"git add ."
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
"browserslist": {
|
|
118
|
-
"production": [
|
|
119
|
-
">0.2%",
|
|
120
|
-
"not dead",
|
|
121
|
-
"not op_mini all"
|
|
122
|
-
],
|
|
123
|
-
"development": [
|
|
124
|
-
"last 1 chrome version",
|
|
125
|
-
"last 1 firefox version",
|
|
126
|
-
"last 1 safari version"
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
+
"version": "2.1.16-test",
|
|
4
|
+
"description": "connect library, auth",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"types": "build/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"build",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"husky:setup": "npx husky install",
|
|
15
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
+
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
+
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
+
"build": "rm -rf build && cross-env NODE_ENV=production webpack",
|
|
21
|
+
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
+
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [],
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Ahmed Elsharkawy",
|
|
29
|
+
"email": "a.elsharkawy@tap.company"
|
|
30
|
+
},
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/core": "^7.18.6",
|
|
34
|
+
"@babel/preset-env": "^7.18.6",
|
|
35
|
+
"@babel/preset-react": "^7.18.6",
|
|
36
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
+
"@types/lodash-es": "^4.17.6",
|
|
38
|
+
"@types/react": "^18.0.15",
|
|
39
|
+
"@types/react-calendar": "~3.5.1",
|
|
40
|
+
"@types/react-dom": "^18.0.6",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
42
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
43
|
+
"babel-loader": "^8.2.5",
|
|
44
|
+
"copyfiles": "^2.4.1",
|
|
45
|
+
"cross-env": "^7.0.3",
|
|
46
|
+
"css-loader": "^6.7.1",
|
|
47
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
48
|
+
"eslint": "^8.19.0",
|
|
49
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
50
|
+
"eslint-config-prettier": "^8.5.0",
|
|
51
|
+
"eslint-plugin-import": "^2.26.0",
|
|
52
|
+
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
53
|
+
"eslint-plugin-node": "^11.1.0",
|
|
54
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
55
|
+
"eslint-plugin-react": "^7.30.1",
|
|
56
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
57
|
+
"file-loader": "^6.2.0",
|
|
58
|
+
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
59
|
+
"html-loader": "^3.1.2",
|
|
60
|
+
"html-webpack-plugin": "^5.5.0",
|
|
61
|
+
"husky": "^8.0.1",
|
|
62
|
+
"lint-staged": "^13.0.3",
|
|
63
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
64
|
+
"prettier": "^2.7.1",
|
|
65
|
+
"sass": "^1.53.0",
|
|
66
|
+
"sass-loader": "^13.0.2",
|
|
67
|
+
"style-loader": "^3.3.1",
|
|
68
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
69
|
+
"tsc-alias": "^1.6.11",
|
|
70
|
+
"typescript": "^4.7.4",
|
|
71
|
+
"webpack": "^5.73.0",
|
|
72
|
+
"webpack-cli": "^4.10.0",
|
|
73
|
+
"webpack-dev-server": "^4.9.3",
|
|
74
|
+
"webpack-merge": "^5.8.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@emotion/react": "^11.9.3",
|
|
78
|
+
"@emotion/styled": "^11.9.3",
|
|
79
|
+
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
80
|
+
"@hookform/resolvers": "^2.9.6",
|
|
81
|
+
"@mui/icons-material": "^5.8.4",
|
|
82
|
+
"@mui/material": "^5.8.7",
|
|
83
|
+
"@reduxjs/toolkit": "^1.8.3",
|
|
84
|
+
"axios": "^0.27.2",
|
|
85
|
+
"device-detector-js": "^3.0.3",
|
|
86
|
+
"i18next": "^21.8.14",
|
|
87
|
+
"i18next-browser-languagedetector": "^6.1.4",
|
|
88
|
+
"i18next-http-backend": "^1.4.1",
|
|
89
|
+
"jsencrypt": "^2.3.1",
|
|
90
|
+
"lodash-es": "^4.17.21",
|
|
91
|
+
"lottie-web": "^5.9.6",
|
|
92
|
+
"moment": "^2.29.4",
|
|
93
|
+
"react": "^18.2.0",
|
|
94
|
+
"react-calendar": "~3.7.0",
|
|
95
|
+
"react-device-detect": "^2.2.2",
|
|
96
|
+
"react-dom": "^18.2.0",
|
|
97
|
+
"react-dropzone": "^14.2.2",
|
|
98
|
+
"react-hook-form": "^7.33.1",
|
|
99
|
+
"react-i18next": "^11.18.1",
|
|
100
|
+
"react-multi-date-picker": "^3.3.4",
|
|
101
|
+
"react-otp-input": "^2.4.0",
|
|
102
|
+
"react-redux": "^8.0.2",
|
|
103
|
+
"react-spring-bottom-sheet": "^3.4.1",
|
|
104
|
+
"yup": "^0.32.11"
|
|
105
|
+
},
|
|
106
|
+
"peerDependencies": {
|
|
107
|
+
"react": "^18.2.0",
|
|
108
|
+
"react-dom": "^18.2.0"
|
|
109
|
+
},
|
|
110
|
+
"lint-staged": {
|
|
111
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
112
|
+
"yarn run prettier:fix",
|
|
113
|
+
"yarn run lint",
|
|
114
|
+
"git add ."
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"browserslist": {
|
|
118
|
+
"production": [
|
|
119
|
+
">0.2%",
|
|
120
|
+
"not dead",
|
|
121
|
+
"not op_mini all"
|
|
122
|
+
],
|
|
123
|
+
"development": [
|
|
124
|
+
"last 1 chrome version",
|
|
125
|
+
"last 1 firefox version",
|
|
126
|
+
"last 1 safari version"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|