@tap-payments/auth-jsconnect 2.0.38-test → 2.0.38
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 +50 -20
- package/build/@types/app.js +9 -3
- package/build/@types/form.d.ts +20 -12
- package/build/api/auth.d.ts +28 -5
- package/build/api/auth.js +36 -1
- package/build/api/axios.js +2 -2
- package/build/api/brand.d.ts +2 -1
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +3 -1
- package/build/api/country.js +3 -1
- package/build/api/data.d.ts +38 -7
- package/build/api/data.js +57 -17
- package/build/api/entity.d.ts +51 -5
- package/build/api/entity.js +39 -9
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +44 -14
- package/build/api/individual.d.ts +76 -19
- package/build/api/individual.js +29 -2
- package/build/api/lead.d.ts +9 -6
- package/build/api/lead.js +8 -1
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +0 -2
- package/build/app/settings.d.ts +8 -2
- package/build/app/settings.js +29 -12
- package/build/app/store.d.ts +1 -3
- package/build/assets/locales/ar.json +258 -183
- package/build/assets/locales/en.json +190 -108
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
- package/build/components/AnimationFlow/AnimationFlow.js +6 -8
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +4 -3
- package/build/components/AnimationFlow/Dialog.d.ts +4 -1
- package/build/components/AnimationFlow/Dialog.js +7 -5
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
- package/build/components/ArabicDatePicker/index.d.ts +2 -0
- package/build/components/ArabicDatePicker/index.js +2 -0
- package/build/components/ArabicDatePicker/style.css +24 -0
- package/build/components/FileInput/DragAndDrop.d.ts +10 -1
- package/build/components/FileInput/DragAndDrop.js +108 -8
- package/build/components/Lottie/Lottie.d.ts +878 -0
- package/build/components/Lottie/Lottie.js +58 -0
- package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
- package/build/components/Lottie/files/success.json +425 -0
- package/build/components/Lottie/index.d.ts +3 -0
- package/build/components/Lottie/index.js +3 -0
- package/build/components/OTPField/OTPField.d.ts +2 -1
- package/build/components/OTPField/OTPField.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
- package/build/components/ProgressBar/CircularProgressBar.js +48 -0
- package/build/components/ProgressBar/index.d.ts +2 -0
- package/build/components/ProgressBar/index.js +2 -0
- package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
- package/build/components/RadioLabel/RadioLabel.js +2 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
- package/build/constants/api.d.ts +6 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +6 -5
- package/build/constants/app.js +53 -28
- package/build/constants/assets.d.ts +14 -0
- package/build/constants/assets.js +16 -2
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +2 -2
- package/build/constants/validation.d.ts +10 -0
- package/build/constants/validation.js +11 -1
- package/build/features/app/auth/authStore.d.ts +30 -4
- package/build/features/app/auth/authStore.js +182 -20
- package/build/features/app/bank/bankStore.d.ts +16 -0
- package/build/features/app/bank/bankStore.js +86 -39
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +444 -295
- package/build/features/app/connect/connectStore.d.ts +34 -31
- package/build/features/app/connect/connectStore.js +427 -300
- package/build/features/app/entity/entityStore.d.ts +27 -7
- package/build/features/app/entity/entityStore.js +230 -146
- package/build/features/app/individual/individualStore.d.ts +18 -0
- package/build/features/app/individual/individualStore.js +176 -83
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/tax/taxStore.js +21 -14
- package/build/features/auth/Auth.d.ts +3 -1
- package/build/features/auth/Auth.js +47 -12
- package/build/features/auth/screens/NID/DOB.d.ts +7 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
- package/build/features/auth/screens/NID/IDNumber.js +64 -0
- package/build/features/auth/screens/NID/NID.d.ts +5 -0
- package/build/features/auth/screens/NID/NID.js +68 -0
- package/build/features/auth/screens/NID/TAC.d.ts +3 -0
- package/build/features/auth/screens/NID/TAC.js +87 -0
- package/build/features/auth/screens/NID/index.d.ts +3 -0
- package/build/features/auth/screens/NID/index.js +2 -0
- package/build/features/auth/screens/NID/validation.d.ts +27 -0
- package/build/features/auth/screens/NID/validation.js +19 -0
- package/build/features/auth/screens/OTP/OTP.js +8 -4
- package/build/features/auth/screens/OTP/OTPInput.js +9 -2
- package/build/features/bank/Bank.js +12 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/BankDetails/BankName.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
- package/build/features/bank/screens/BankDetails/validation.js +2 -2
- package/build/features/bank/screens/Success/Success.js +7 -3
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +14 -7
- package/build/features/business/screens/Activities/Activities.js +16 -17
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
- package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
- package/build/features/business/screens/Activities/validation.d.ts +0 -51
- package/build/features/business/screens/Activities/validation.js +0 -9
- package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
- package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
- package/build/features/business/screens/BusinessType/EntityName.js +56 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +52 -3
- package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/business/screens/CivilID/CivilID.js +67 -0
- package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/business/screens/CivilID/IDNumber.js +59 -0
- package/build/features/business/screens/CivilID/index.d.ts +3 -0
- package/build/features/business/screens/CivilID/index.js +2 -0
- package/build/features/business/screens/CivilID/validation.d.ts +8 -0
- package/build/features/business/screens/CivilID/validation.js +4 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
- package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
- package/build/features/business/screens/Customers/Customers.js +15 -9
- package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
- package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
- package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
- package/build/features/business/screens/OTP/OTP.js +15 -2
- package/build/features/business/screens/Success/Success.js +10 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
- package/build/features/business/screens/Verify/Verify.js +4 -4
- package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/business/screens/VerifyPACI/index.js +2 -0
- package/build/features/connect/Connect.d.ts +2 -1
- package/build/features/connect/Connect.js +47 -12
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +102 -0
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connect/screens/CivilID/index.d.ts +3 -0
- package/build/features/connect/screens/CivilID/index.js +2 -0
- package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connect/screens/CivilID/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +11 -3
- package/build/features/connect/screens/Individual/Individual.js +44 -28
- package/build/features/connect/screens/Merchant/BrandList.js +15 -7
- package/build/features/connect/screens/Merchant/BrandName.js +7 -4
- package/build/features/connect/screens/Merchant/Merchant.js +41 -64
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
- package/build/features/connect/screens/Merchant/TAC.js +8 -2
- package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
- package/build/features/connect/screens/Merchant/validation.js +108 -173
- package/build/features/connect/screens/Mobile/Mobile.js +33 -12
- package/build/features/connect/screens/NID/NID.js +5 -1
- package/build/features/connect/screens/OTP/OTP.js +20 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -2
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.d.ts +1 -1
- package/build/features/entity/Entity.js +16 -9
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
- package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
- package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +26 -7
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +25 -4
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +12 -51
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -10
- package/build/features/entity/screens/Success/Success.js +7 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
- package/build/features/entity/screens/Verify/Verify.js +18 -5
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +25 -7
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +14 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
- package/build/features/individual/screens/Success/Success.js +7 -3
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
- package/build/features/individual/screens/Verify/Verify.js +18 -5
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +14 -7
- package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
- package/build/features/password/screens/OTP/OTP.js +15 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
- package/build/features/password/screens/Verify/Verify.js +16 -3
- package/build/features/shared/Background/Background.d.ts +4 -5
- package/build/features/shared/Background/Background.js +16 -5
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
- package/build/features/shared/Button/MobileButton.d.ts +2 -1
- package/build/features/shared/Button/MobileButton.js +2 -2
- package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
- package/build/features/shared/Dialog/CloseDialog.js +71 -0
- package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
- package/build/features/shared/Dialog/DialogContainer.js +56 -0
- package/build/features/shared/Dialog/index.d.ts +4 -0
- package/build/features/shared/Dialog/index.js +4 -0
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
- package/build/features/shared/UploadFile/UploadFile.js +24 -9
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +14 -6
- package/build/features/signIn/screens/Email/Email.js +4 -2
- package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
- package/build/features/signIn/screens/OTP/OTP.js +14 -1
- package/build/features/signIn/screens/Password/Password.js +15 -2
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +16 -8
- package/build/features/tax/screens/Success/Success.js +9 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
- package/build/features/tax/screens/Verify/Verify.js +16 -3
- package/build/hooks/index.d.ts +2 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/useAppConfig.d.ts +3 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/hooks/useErrorListener.js +0 -6
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -0
- package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
- package/build/hooks/useSetFromDefaultValues.js +24 -0
- package/build/index.d.ts +2 -3
- package/build/index.js +1 -4
- package/build/utils/array.d.ts +49 -1
- package/build/utils/array.js +58 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +3 -0
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/locale.js +1 -1
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +12 -0
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +33 -20
- package/build/utils/string.js +71 -1
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +5 -4
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
- package/build/features/business/screens/Activities/SalesChannels.js +0 -112
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LibConfig, ScreenStepNavigation } from '../@types';
|
|
2
2
|
interface AppConfigProps extends LibConfig {
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
|
+
disableCountries?: boolean;
|
|
5
|
+
disableLocale?: boolean;
|
|
4
6
|
}
|
|
5
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, ...rest }: AppConfigProps) => void;
|
|
7
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, ...rest }: AppConfigProps) => void;
|
|
6
8
|
export {};
|
|
@@ -27,7 +27,7 @@ import { axiosInstance } from '../api';
|
|
|
27
27
|
import { isTapDomain, removeRequestHeaders } from '../utils';
|
|
28
28
|
import { ENDPOINT_PATHS } from '../constants';
|
|
29
29
|
export var useAppConfig = function (_a) {
|
|
30
|
-
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
|
|
30
|
+
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale"]);
|
|
31
31
|
var dispatch = useAppDispatch();
|
|
32
32
|
var setBaseUrl = function () {
|
|
33
33
|
var isProd = publicKey.includes('pk_live');
|
|
@@ -49,11 +49,13 @@ export var useAppConfig = function (_a) {
|
|
|
49
49
|
dispatch(handleOpen(rest.open));
|
|
50
50
|
}, [rest.open]);
|
|
51
51
|
useEffect(function () {
|
|
52
|
+
if (rest.open === false)
|
|
53
|
+
return;
|
|
52
54
|
removeRequestHeaders();
|
|
53
55
|
checkDomain();
|
|
54
56
|
setBaseUrl();
|
|
55
57
|
setAppConfig();
|
|
56
58
|
dispatch(handleLanguage(rest.language));
|
|
57
|
-
dispatch(fetchAppSettingsSync());
|
|
59
|
+
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale }));
|
|
58
60
|
}, []);
|
|
59
61
|
};
|
|
@@ -8,6 +8,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
8
8
|
password: import("../features/app/password/passwordStore").PasswordState;
|
|
9
9
|
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
10
10
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
11
|
-
otp: import("../features/app/otp/otpStore").OtpState;
|
|
12
11
|
auth: import("../features/app/auth/authStore").AuthState;
|
|
13
12
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
|
@@ -9,10 +9,4 @@ export var useErrorListener = function (error) {
|
|
|
9
9
|
(_b = (_a = settings.data.appConfig) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
10
10
|
}
|
|
11
11
|
}, [error]);
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
if (!settings.error && !settings.loading) {
|
|
15
|
-
(_b = (_a = settings.data.appConfig).onReady) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
16
|
-
}
|
|
17
|
-
}, [settings.error, settings.loading]);
|
|
18
12
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useWindowSize } from '.';
|
|
3
|
+
import { useTheme } from '@mui/material/styles';
|
|
4
|
+
export var useScreen = function (breakpoint) {
|
|
5
|
+
if (breakpoint === void 0) { breakpoint = 'sm'; }
|
|
6
|
+
var _a = useState(false), small = _a[0], setSmall = _a[1];
|
|
7
|
+
var width = useWindowSize().width;
|
|
8
|
+
var theme = useTheme();
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
var target = theme.breakpoints.values[breakpoint || 'sm'];
|
|
11
|
+
setSmall(width < target);
|
|
12
|
+
}, [width]);
|
|
13
|
+
return { small: small };
|
|
14
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
var isValidValue = function (value) {
|
|
3
|
+
if (Array.isArray(value))
|
|
4
|
+
return value.length > 0;
|
|
5
|
+
if (typeof value === 'object')
|
|
6
|
+
return Object.keys(value).length > 0;
|
|
7
|
+
return value !== undefined && value !== null && value !== '';
|
|
8
|
+
};
|
|
9
|
+
export var useSetFromDefaultValues = function (method, defaultValues, shouldValidate) {
|
|
10
|
+
if (shouldValidate === void 0) { shouldValidate = false; }
|
|
11
|
+
var setFromDefaultValues = function () {
|
|
12
|
+
for (var key in defaultValues) {
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(defaultValues, key)) {
|
|
14
|
+
var value = defaultValues[key];
|
|
15
|
+
if (!isValidValue(method.getValues(key)) && isValidValue(value)) {
|
|
16
|
+
method.setValue(key, value, { shouldValidate: shouldValidate });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
setFromDefaultValues();
|
|
23
|
+
}, [defaultValues]);
|
|
24
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { BankLib, renderBankLib, BankLibProps, unmountBankLib } from './features
|
|
|
8
8
|
import { TaxLib, renderTaxLib, TaxLibProps, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, SignInLibProps, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, OTPLibProps, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps,
|
|
14
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, AuthLibProps, SignInLibProps };
|
|
13
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
package/build/index.js
CHANGED
|
@@ -8,9 +8,8 @@ import { BankLib, renderBankLib, unmountBankLib } from './features/bank';
|
|
|
8
8
|
import { TaxLib, renderTaxLib, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
|
14
13
|
window['TapAuth'] = {
|
|
15
14
|
renderConnectLib: renderConnectLib,
|
|
16
15
|
unmountConnectLib: unmountConnectLib,
|
|
@@ -26,8 +25,6 @@ window['TapAuth'] = {
|
|
|
26
25
|
unmountTaxLib: unmountTaxLib,
|
|
27
26
|
renderEntityLib: renderEntityLib,
|
|
28
27
|
unmountEntityLib: unmountEntityLib,
|
|
29
|
-
renderOTPLib: renderOTPLib,
|
|
30
|
-
unmountOTPLib: unmountOTPLib,
|
|
31
28
|
renderSignInLib: renderSignInLib,
|
|
32
29
|
unmountSignInLib: unmountSignInLib,
|
|
33
30
|
renderAuthLib: renderAuthLib,
|
package/build/utils/array.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CountryCode } from '../@types';
|
|
1
|
+
import { CountryCode, SaleChannel } from '../@types';
|
|
2
2
|
export declare const isArray: (value: any) => value is any[];
|
|
3
3
|
export declare const joinArray: (items: Array<any>, joiner?: string) => string;
|
|
4
4
|
export declare const replaceStringArrayItems: (items: Array<string>, include: string, withThis: string) => string[];
|
|
@@ -11,3 +11,51 @@ export declare const isExist: (items: Array<any>, id: string) => any;
|
|
|
11
11
|
export declare const allAreTruthy: (items: Array<any>, condition: boolean | string, key: string, exclude?: string) => boolean;
|
|
12
12
|
export declare const sortCountries: (countries: Array<CountryCode>) => CountryCode[];
|
|
13
13
|
export declare const findCountryByIso2: (countries: Array<CountryCode>, iso2: string) => CountryCode | undefined;
|
|
14
|
+
export declare const findCountryByIddPrefix: (countries: Array<CountryCode>, iddPrefix: string) => CountryCode | undefined;
|
|
15
|
+
export declare const mapSalesChannel: (salesChannel: Array<SaleChannel>) => {
|
|
16
|
+
sub?: import("../@types").SubSaleChannel[] | undefined;
|
|
17
|
+
address: string;
|
|
18
|
+
id: string;
|
|
19
|
+
code: string;
|
|
20
|
+
name?: {
|
|
21
|
+
ar: string;
|
|
22
|
+
en: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
logo?: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
export declare const mapBrandSalesChannel: (salesChannel: Array<SaleChannel>, brandSalesChannel: Array<SaleChannel>) => ({
|
|
27
|
+
sub: ({
|
|
28
|
+
id: string;
|
|
29
|
+
code: string;
|
|
30
|
+
name?: {
|
|
31
|
+
ar: string;
|
|
32
|
+
en: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
address?: string | undefined;
|
|
35
|
+
logo?: string | undefined;
|
|
36
|
+
} | undefined)[] | undefined;
|
|
37
|
+
id: string;
|
|
38
|
+
code: string;
|
|
39
|
+
name?: {
|
|
40
|
+
ar: string;
|
|
41
|
+
en: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
address?: string | undefined;
|
|
44
|
+
logo?: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
sub?: import("../@types").SubSaleChannel[] | undefined;
|
|
47
|
+
id: string;
|
|
48
|
+
code: string;
|
|
49
|
+
name?: {
|
|
50
|
+
ar: string;
|
|
51
|
+
en: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
address?: string | undefined;
|
|
54
|
+
logo?: string | undefined;
|
|
55
|
+
} | undefined)[];
|
|
56
|
+
export declare const removeDuplicationById: (items: Array<any>) => any[];
|
|
57
|
+
export declare const fixBrandList: (items: Array<{
|
|
58
|
+
channel_services: Array<SaleChannel>;
|
|
59
|
+
}>, salesChannel: Array<SaleChannel>) => {
|
|
60
|
+
channel_services: any[];
|
|
61
|
+
}[];
|
package/build/utils/array.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
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
|
+
};
|
|
1
12
|
export var isArray = function (value) { return Array.isArray(value); };
|
|
2
13
|
export var joinArray = function (items, joiner) {
|
|
3
14
|
if (joiner === void 0) { joiner = '__'; }
|
|
@@ -63,3 +74,50 @@ export var findCountryByIso2 = function (countries, iso2) {
|
|
|
63
74
|
throw new Error('iso2 is required');
|
|
64
75
|
return countries.find(function (country) { return country.iso2.toLowerCase() === iso2.toLowerCase(); });
|
|
65
76
|
};
|
|
77
|
+
export var findCountryByIddPrefix = function (countries, iddPrefix) {
|
|
78
|
+
if (!iddPrefix)
|
|
79
|
+
throw new Error('idd_prefix is required');
|
|
80
|
+
return countries.find(function (country) { return country.idd_prefix.toString() === iddPrefix; });
|
|
81
|
+
};
|
|
82
|
+
export var mapSalesChannel = function (salesChannel) {
|
|
83
|
+
return salesChannel.map(function (item) {
|
|
84
|
+
var hasSub = item.sub && item.sub.length > 0;
|
|
85
|
+
return __assign(__assign(__assign({}, item), { address: (item.address || '').replaceAll('https://', '').replaceAll('@', '') }), (hasSub && {
|
|
86
|
+
sub: item.sub.map(function (subItem) {
|
|
87
|
+
return __assign(__assign({}, subItem), { address: (subItem.address || '').replaceAll('https://', '').replaceAll('@', '') });
|
|
88
|
+
})
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
export var mapBrandSalesChannel = function (salesChannel, brandSalesChannel) {
|
|
93
|
+
var findSalesChannel = function (id) { return salesChannel.find(function (item) { return item.id === id; }); };
|
|
94
|
+
var mapped = brandSalesChannel
|
|
95
|
+
.map(function (item) {
|
|
96
|
+
var _a;
|
|
97
|
+
var originalSalasChannel = findSalesChannel(item.id);
|
|
98
|
+
if (!originalSalasChannel)
|
|
99
|
+
return undefined;
|
|
100
|
+
var hasSub = item.sub && item.sub.length > 0;
|
|
101
|
+
if (hasSub)
|
|
102
|
+
return __assign(__assign({}, item), { sub: (_a = originalSalasChannel.sub) === null || _a === void 0 ? void 0 : _a.map(function (subItem) {
|
|
103
|
+
var _a;
|
|
104
|
+
var brandSubItem = (_a = item.sub) === null || _a === void 0 ? void 0 : _a.find(function (brandSub) { return brandSub.id === subItem.id; });
|
|
105
|
+
if (!brandSubItem)
|
|
106
|
+
return undefined;
|
|
107
|
+
return __assign(__assign({}, subItem), brandSubItem);
|
|
108
|
+
}).filter(Boolean) });
|
|
109
|
+
return __assign({}, item);
|
|
110
|
+
})
|
|
111
|
+
.filter(Boolean);
|
|
112
|
+
return mapped;
|
|
113
|
+
};
|
|
114
|
+
export var removeDuplicationById = function (items) {
|
|
115
|
+
return items.filter(function (item, index) {
|
|
116
|
+
return items.findIndex(function (i) { return i.id === item.id; }) === index;
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export var fixBrandList = function (items, salesChannel) {
|
|
120
|
+
return items.map(function (item) {
|
|
121
|
+
return __assign(__assign({}, item), { channel_services: removeDuplicationById(mapBrandSalesChannel(salesChannel, item.channel_services || [])) });
|
|
122
|
+
});
|
|
123
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (milliseconds: number) => Promise<unknown>;
|
package/build/utils/device.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { DeviceDetectorResult } from 'device-detector-js';
|
|
|
2
2
|
import { GetResult } from '@fingerprintjs/fingerprintjs';
|
|
3
3
|
export declare const getBrowserInfo: () => DeviceDetectorResult;
|
|
4
4
|
export declare const getFingerPrint: () => Promise<GetResult>;
|
|
5
|
+
export declare const mobileOS: () => 'Windows Phone' | 'Android' | 'iOS' | 'unknown';
|
package/build/utils/device.js
CHANGED
|
@@ -11,3 +11,16 @@ export var getFingerPrint = function () {
|
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
+
export var mobileOS = function () {
|
|
15
|
+
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
16
|
+
if (/windows phone/i.test(userAgent)) {
|
|
17
|
+
return 'Windows Phone';
|
|
18
|
+
}
|
|
19
|
+
if (/android/i.test(userAgent)) {
|
|
20
|
+
return 'Android';
|
|
21
|
+
}
|
|
22
|
+
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
|
|
23
|
+
return 'iOS';
|
|
24
|
+
}
|
|
25
|
+
return 'unknown';
|
|
26
|
+
};
|
package/build/utils/html.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const createElementAndInject: (id: string) => HTMLDivElement;
|
|
|
2
2
|
export declare const reactElement: (elementId: string) => import("react-dom/client").Root;
|
|
3
3
|
export declare const scrollUp: (elementId: string, top?: number) => void;
|
|
4
4
|
export declare const scrollDown: (elementId: string) => void;
|
|
5
|
+
export declare const removeElement: (elementId: string) => void;
|
package/build/utils/html.js
CHANGED
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
package/build/utils/locale.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { initReactI18next } from 'react-i18next';
|
|
2
2
|
import i18n from '../i18n';
|
|
3
3
|
export var updateLocale = function (locale, country) {
|
|
4
|
-
var data = locale[country.toUpperCase()] || locale['default'];
|
|
4
|
+
var data = locale['SA'] || locale[country.toUpperCase()] || locale['default'];
|
|
5
5
|
if (i18n.isInitialized) {
|
|
6
6
|
i18n.removeResourceBundle('*', 'translation');
|
|
7
7
|
i18n.addResourceBundle('en', 'translation', data.en.translation);
|
package/build/utils/object.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const compareTwoObjects: (obj1: any, obj2: any) => boolean;
|
|
|
2
2
|
export declare const encodeObjectBase64: (obj: any) => string;
|
|
3
3
|
export declare const decodeObjectBase64: (str: string) => any;
|
|
4
4
|
export declare const hasKey: (obj: any, key: string) => boolean;
|
|
5
|
+
export declare const concatenateObjectValues: (data: Record<string, any>, keys: Array<string>) => string;
|
package/build/utils/object.js
CHANGED
|
@@ -21,3 +21,15 @@ export var hasKey = function (obj, key) {
|
|
|
21
21
|
return false;
|
|
22
22
|
return Object.keys(obj).includes(key);
|
|
23
23
|
};
|
|
24
|
+
export var concatenateObjectValues = function (data, keys) {
|
|
25
|
+
if (!data)
|
|
26
|
+
return '';
|
|
27
|
+
var result = '';
|
|
28
|
+
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
29
|
+
var key = keys_1[_i];
|
|
30
|
+
if (data[key]) {
|
|
31
|
+
result += data[key].trim() + ' ';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result.trim();
|
|
35
|
+
};
|
package/build/utils/rsa.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const encryptObject: (data: unknown) =>
|
|
2
|
-
export declare const encryptString: (string: string) =>
|
|
1
|
+
export declare const encryptObject: (data: unknown) => any;
|
|
2
|
+
export declare const encryptString: (string: string) => any;
|
package/build/utils/rsa.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JSEncrypt } from 'jsencrypt';
|
|
2
1
|
import { RSA_FRONTEND_MW_PUBLIC_KEY } from '../constants';
|
|
2
|
+
var JSEncrypt = require('jsencrypt').JSEncrypt;
|
|
3
3
|
var rsa = new JSEncrypt();
|
|
4
4
|
rsa.setPublicKey(RSA_FRONTEND_MW_PUBLIC_KEY);
|
|
5
5
|
export var encryptObject = function (data) {
|
package/build/utils/string.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const maskPhone: (str?: string) => string;
|
|
|
3
3
|
export declare const maskID: (str: string) => string;
|
|
4
4
|
export declare const maskEmail: (str: string) => string;
|
|
5
5
|
export declare const showLastFour: (str: string) => string;
|
|
6
|
+
export declare const maskFileName: (str: string) => string;
|
|
6
7
|
export declare const getIndividualName: (name: string) => {
|
|
7
8
|
first: string;
|
|
8
9
|
middle: string;
|
|
@@ -15,29 +16,41 @@ export declare const getFlowUrl: (path: string, lang: string) => string;
|
|
|
15
16
|
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string) => string;
|
|
16
17
|
export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
|
|
17
18
|
export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
18
|
-
al:
|
|
19
|
-
at:
|
|
20
|
-
aid:
|
|
21
|
-
an:
|
|
22
|
-
av:
|
|
23
|
-
acv:
|
|
24
|
-
asv:
|
|
25
|
-
rn:
|
|
26
|
-
rt:
|
|
27
|
-
rb:
|
|
28
|
-
rm:
|
|
29
|
-
ro:
|
|
30
|
-
rov:
|
|
31
|
-
bn:
|
|
32
|
-
bb:
|
|
33
|
-
bv:
|
|
34
|
-
bua:
|
|
19
|
+
al: any;
|
|
20
|
+
at: any;
|
|
21
|
+
aid: any;
|
|
22
|
+
an: any;
|
|
23
|
+
av: any;
|
|
24
|
+
acv: any;
|
|
25
|
+
asv: any;
|
|
26
|
+
rn: any;
|
|
27
|
+
rt: any;
|
|
28
|
+
rb: any;
|
|
29
|
+
rm: any;
|
|
30
|
+
ro: any;
|
|
31
|
+
rov: any;
|
|
32
|
+
bn: any;
|
|
33
|
+
bb: any;
|
|
34
|
+
bv: any;
|
|
35
|
+
bua: any;
|
|
35
36
|
bi: string;
|
|
36
|
-
ci:
|
|
37
|
-
cm:
|
|
38
|
-
l:
|
|
37
|
+
ci: any;
|
|
38
|
+
cm: any;
|
|
39
|
+
l: any;
|
|
39
40
|
};
|
|
40
41
|
export declare const removeRequestHeaders: () => void;
|
|
41
42
|
export declare const getBaseUrl: () => string;
|
|
42
43
|
export declare const getScreenNameBasedOnFlow: (flow: string) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP";
|
|
43
44
|
export declare const getEighteenYearsAgo: () => string;
|
|
45
|
+
export declare const isKW: (flag: string) => boolean;
|
|
46
|
+
export declare const isSA: (flag: string) => boolean;
|
|
47
|
+
export declare const isLinkedIn: (flag: string) => boolean;
|
|
48
|
+
export declare const isTwitter: (flag: string) => boolean;
|
|
49
|
+
export declare const isWebsite: (flag: string) => boolean;
|
|
50
|
+
export declare const isIos: (flag: string) => boolean;
|
|
51
|
+
export declare const isAndroid: (flag: string) => boolean;
|
|
52
|
+
export declare const isFacebook: (flag: string) => boolean;
|
|
53
|
+
export declare const isInstagram: (flag: string) => boolean;
|
|
54
|
+
export declare const isPhysicalStore: (flag: string) => boolean;
|
|
55
|
+
export declare const isCallCenter: (flag: string) => boolean;
|
|
56
|
+
export declare const getChannelIcon: (channel: string) => string;
|
package/build/utils/string.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlowsTypes } from '../@types';
|
|
2
2
|
import { encryptString } from '.';
|
|
3
3
|
import { removeAxiosGlobalHeaders } from '../api';
|
|
4
|
-
import { ENDPOINT_PATHS } from '../constants';
|
|
4
|
+
import { ENDPOINT_PATHS, ICONS_FULL_PATH } from '../constants';
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
export var maskPhone = function (str) {
|
|
7
7
|
if (str === void 0) { str = ''; }
|
|
@@ -23,6 +23,12 @@ export var showLastFour = function (str) {
|
|
|
23
23
|
}
|
|
24
24
|
return str;
|
|
25
25
|
};
|
|
26
|
+
export var maskFileName = function (str) {
|
|
27
|
+
if (str.length < 28)
|
|
28
|
+
return str;
|
|
29
|
+
var first = str.substring(0, 28);
|
|
30
|
+
return first + '....';
|
|
31
|
+
};
|
|
26
32
|
export var getIndividualName = function (name) {
|
|
27
33
|
var _a;
|
|
28
34
|
var nameArray = (name === null || name === void 0 ? void 0 : name.split(' ')) || [];
|
|
@@ -167,3 +173,67 @@ export var getEighteenYearsAgo = function () {
|
|
|
167
173
|
var eighteenYearsAgo = new Date();
|
|
168
174
|
return moment(eighteenYearsAgo.setFullYear(eighteenYearsAgo.getFullYear() - 18)).format('YYYY-MM-DD');
|
|
169
175
|
};
|
|
176
|
+
export var isKW = function (flag) {
|
|
177
|
+
return ['kw', 'kwd'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
178
|
+
};
|
|
179
|
+
export var isSA = function (flag) {
|
|
180
|
+
return ['sa', 'sau'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
181
|
+
};
|
|
182
|
+
export var isLinkedIn = function (flag) {
|
|
183
|
+
return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
184
|
+
};
|
|
185
|
+
export var isTwitter = function (flag) {
|
|
186
|
+
return 'twitter' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
187
|
+
};
|
|
188
|
+
export var isWebsite = function (flag) {
|
|
189
|
+
return 'website' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
190
|
+
};
|
|
191
|
+
export var isIos = function (flag) {
|
|
192
|
+
return 'ios' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
193
|
+
};
|
|
194
|
+
export var isAndroid = function (flag) {
|
|
195
|
+
return 'android' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
196
|
+
};
|
|
197
|
+
export var isFacebook = function (flag) {
|
|
198
|
+
return 'facebook' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
199
|
+
};
|
|
200
|
+
export var isInstagram = function (flag) {
|
|
201
|
+
return 'instagram' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
202
|
+
};
|
|
203
|
+
export var isPhysicalStore = function (flag) {
|
|
204
|
+
return 'physical_store' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
205
|
+
};
|
|
206
|
+
export var isCallCenter = function (flag) {
|
|
207
|
+
return 'call_center' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
208
|
+
};
|
|
209
|
+
export var getChannelIcon = function (channel) {
|
|
210
|
+
var key = channel === null || channel === void 0 ? void 0 : channel.toLowerCase();
|
|
211
|
+
if (isWebsite(key)) {
|
|
212
|
+
return ICONS_FULL_PATH + '/website.svg';
|
|
213
|
+
}
|
|
214
|
+
if (isLinkedIn(key)) {
|
|
215
|
+
return ICONS_FULL_PATH + '/LinkedIn-white.png';
|
|
216
|
+
}
|
|
217
|
+
if (isFacebook(key)) {
|
|
218
|
+
return ICONS_FULL_PATH + '/facebook.svg';
|
|
219
|
+
}
|
|
220
|
+
if (isInstagram(key)) {
|
|
221
|
+
return ICONS_FULL_PATH + '/insta.svg';
|
|
222
|
+
}
|
|
223
|
+
if (isTwitter(key)) {
|
|
224
|
+
return ICONS_FULL_PATH + '/twitter-icon.svg';
|
|
225
|
+
}
|
|
226
|
+
if (isPhysicalStore(key)) {
|
|
227
|
+
return ICONS_FULL_PATH + '/physical-store.svg';
|
|
228
|
+
}
|
|
229
|
+
if (isIos(key)) {
|
|
230
|
+
return ICONS_FULL_PATH + '/apple.svg';
|
|
231
|
+
}
|
|
232
|
+
if (isAndroid(key)) {
|
|
233
|
+
return ICONS_FULL_PATH + '/play-store.svgg';
|
|
234
|
+
}
|
|
235
|
+
if (isCallCenter(key)) {
|
|
236
|
+
return ICONS_FULL_PATH + '/call-center.svg';
|
|
237
|
+
}
|
|
238
|
+
return '';
|
|
239
|
+
};
|
|
@@ -13,3 +13,5 @@ export declare function isPasswordHasLowerLetter(password: string): boolean;
|
|
|
13
13
|
export declare function isPasswordHasSpecialLetter(password: string): boolean;
|
|
14
14
|
export declare const keepLettersAndSpace: (str: string) => string;
|
|
15
15
|
export declare const isTapDomain: (domain: string) => boolean;
|
|
16
|
+
export declare const removeArabicWords: (str: string) => string;
|
|
17
|
+
export declare const removeAllOtherThanArabicWords: (str: string) => string;
|
|
@@ -43,3 +43,9 @@ export var keepLettersAndSpace = function (str) {
|
|
|
43
43
|
export var isTapDomain = function (domain) {
|
|
44
44
|
return domain.includes('tap.company');
|
|
45
45
|
};
|
|
46
|
+
export var removeArabicWords = function (str) {
|
|
47
|
+
return str.replace(/[\u0600-\u06FF]/g, '').trim();
|
|
48
|
+
};
|
|
49
|
+
export var removeAllOtherThanArabicWords = function (str) {
|
|
50
|
+
return str.replace(/[^ء-ي]/g, '');
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.0.38
|
|
3
|
+
"version": "2.0.38",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"@babel/preset-react": "^7.18.6",
|
|
36
36
|
"@babel/preset-typescript": "^7.18.6",
|
|
37
37
|
"@types/lodash-es": "^4.17.6",
|
|
38
|
-
"@types/moment-hijri": "^2.1.0",
|
|
39
38
|
"@types/react": "^18.0.15",
|
|
40
39
|
"@types/react-calendar": "~3.5.1",
|
|
41
40
|
"@types/react-dom": "^18.0.6",
|
|
@@ -87,9 +86,10 @@
|
|
|
87
86
|
"i18next": "^21.8.14",
|
|
88
87
|
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
88
|
"i18next-http-backend": "^1.4.1",
|
|
90
|
-
"jsencrypt": "^3.
|
|
89
|
+
"jsencrypt": "^2.3.1",
|
|
91
90
|
"lodash-es": "^4.17.21",
|
|
92
|
-
"
|
|
91
|
+
"lottie-web": "^5.9.6",
|
|
92
|
+
"moment": "^2.29.4",
|
|
93
93
|
"react": "^18.2.0",
|
|
94
94
|
"react-calendar": "~3.7.0",
|
|
95
95
|
"react-device-detect": "^2.2.2",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"react-dropzone": "^14.2.2",
|
|
98
98
|
"react-hook-form": "^7.33.1",
|
|
99
99
|
"react-i18next": "^11.18.1",
|
|
100
|
+
"react-multi-date-picker": "^3.3.4",
|
|
100
101
|
"react-otp-input": "^2.4.0",
|
|
101
102
|
"react-redux": "^8.0.2",
|
|
102
103
|
"react-spring-bottom-sheet": "^3.4.1",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../app/store';
|
|
2
|
-
import { FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
|
-
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
|
-
data: any;
|
|
5
|
-
}, void, {}>;
|
|
6
|
-
export declare const verifyOtpLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
7
|
-
formData: OTPFormValues;
|
|
8
|
-
}, OTPFormValues, {}>;
|
|
9
|
-
declare type VerifyData = {
|
|
10
|
-
token: string;
|
|
11
|
-
};
|
|
12
|
-
export interface OtpData {
|
|
13
|
-
verify: ResponseData & VerifyData;
|
|
14
|
-
otpData: OTPFormValues & ResponseData;
|
|
15
|
-
flowName: FlowsTypes;
|
|
16
|
-
}
|
|
17
|
-
export interface OtpState extends SharedState<OtpData> {
|
|
18
|
-
customLoading?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const otpSlice: import("@reduxjs/toolkit").Slice<OtpState, {
|
|
21
|
-
clearError: (state: OtpState) => void;
|
|
22
|
-
stopLoader: (state: OtpState) => void;
|
|
23
|
-
resetOTPScreen: (state: OtpState) => void;
|
|
24
|
-
}, "otp/store">;
|
|
25
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
26
|
-
declare const _default: import("redux").Reducer<OtpState, import("redux").AnyAction>;
|
|
27
|
-
export default _default;
|
|
28
|
-
export declare const otpSelector: (state: RootState) => OtpState;
|