@tap-payments/auth-jsconnect 2.1.77-test → 2.1.79-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.
Files changed (34) hide show
  1. package/build/@types/app.d.ts +6 -2
  2. package/build/api/entity.d.ts +3 -3
  3. package/build/api/individual.d.ts +7 -3
  4. package/build/assets/locales/ar.json +6 -1
  5. package/build/assets/locales/en.json +6 -1
  6. package/build/features/app/bank/bankStore.js +17 -12
  7. package/build/features/app/brand/brandStore.js +9 -9
  8. package/build/features/app/connect/connectStore.js +6 -6
  9. package/build/features/app/individual/individualStore.d.ts +1 -0
  10. package/build/features/app/individual/individualStore.js +102 -86
  11. package/build/features/bank/screens/BankDetails/BankDetails.js +8 -7
  12. package/build/features/bank/screens/BankDetails/BankName.js +13 -10
  13. package/build/features/bank/screens/BankDetails/Beneficiary.js +12 -13
  14. package/build/features/bank/screens/BankDetails/IBAN.js +14 -10
  15. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
  16. package/build/features/bank/screens/BankDetails/validation.js +34 -15
  17. package/build/features/connect/screens/Merchant/BrandList.js +4 -4
  18. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  19. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +2 -3
  20. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +1 -1
  21. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
  22. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +1 -1
  23. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
  24. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -5
  25. package/build/features/individual/screens/IndividualList/IndividualList.js +2 -3
  26. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +23 -5
  27. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +1 -1
  28. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +9 -3
  29. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +1 -1
  30. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +1 -1
  31. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +1 -1
  32. package/build/features/individual/screens/Verify/Verify.js +10 -17
  33. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +1 -1
  34. package/package.json +1 -1
@@ -138,7 +138,7 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
138
138
  setValue('mobile', '');
139
139
  countryCodeControl.field.onChange(country);
140
140
  };
141
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: disabled || !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: disabled ? undefined : function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: disabled ? (_jsx(_Fragment, {})) : !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['idd_prefix', 'capital', 'name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
141
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: disabled || !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: disabled ? undefined : function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: disabled ? (_jsx(_Fragment, {})) : !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
142
142
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
143
143
  } }) }))] })) })));
144
144
  });
@@ -81,7 +81,7 @@ var Nationality = React.forwardRef(function (_a, ref) {
81
81
  };
82
82
  var location = nationalityControl.field.value;
83
83
  var error = (_c = nationalityControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
84
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { label: t('nationality_label'), readOnly: true, disabled: disabled, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_nationality'), value: (isAr ? (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.arabic : (_e = location === null || location === void 0 ? void 0 : location.name) === null || _e === void 0 ? void 0 : _e.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['idd_prefix', 'capital', 'name.arabic', 'name.english'], list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
84
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { label: t('nationality_label'), readOnly: true, disabled: disabled, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_nationality'), value: (isAr ? (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.arabic : (_e = location === null || location === void 0 ? void 0 : location.name) === null || _e === void 0 ? void 0 : _e.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
85
85
  return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIconStyled, {})] }));
86
86
  } }) }))] })) })));
87
87
  });
@@ -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 { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
@@ -60,17 +49,19 @@ var FormStyled = styled(Form)(function () { return ({
60
49
  var VerifyNumber = function (_a) {
61
50
  var _b, _c;
62
51
  var dispatch = useAppDispatch();
63
- var _d = useAppSelector(individualSelector), data = _d.data, loading = _d.loading, error = _d.error;
64
- var _e = data.otpData, responseBody = _e.responseBody, defaultValues = __rest(_e, ["responseBody"]);
52
+ var _d = useAppSelector(individualSelector), data = _d.data, loading = _d.loading, error = _d.error, cityLoading = _d.cityLoading;
53
+ var otp = data.otpData.otp;
65
54
  var methods = useForm({
66
55
  resolver: yupResolver(OTPValidation),
67
- defaultValues: defaultValues,
56
+ defaultValues: {
57
+ otp: otp
58
+ },
68
59
  mode: 'onChange'
69
60
  });
70
- useSetFromDefaultValues(methods, defaultValues);
61
+ useSetFromDefaultValues(methods, data.otpData);
71
62
  var t = useTranslation().t;
72
63
  var isAr = useLanguage().isAr;
73
- var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
64
+ var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
74
65
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
75
66
  React.useEffect(function () {
76
67
  if (error && methods.formState.isValid && phone)
@@ -86,6 +77,8 @@ var VerifyNumber = function (_a) {
86
77
  dispatch(handlePrevScreenStep());
87
78
  };
88
79
  var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
89
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
80
+ var dataLoading = loading || cityLoading;
81
+ var showMobileNumber = !loading && !cityLoading && phone;
82
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [dataLoading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), showMobileNumber && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
90
83
  };
91
84
  export default React.memo(VerifyNumber);
@@ -58,7 +58,7 @@ var SuccessFlowButtons = function (_a) {
58
58
  var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.name, 20) || t('bank');
59
59
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
60
60
  var taxID = vat_id || '';
61
- var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
61
+ var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || t('brand');
62
62
  var entityLegalName = shortenString(isAr ? legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar : legal_name === null || legal_name === void 0 ? void 0 : legal_name.en, 20) || '';
63
63
  var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
64
64
  var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.1.77-test",
3
+ "version": "2.1.79-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",