@tap-payments/auth-jsconnect 2.0.43-test → 2.0.44
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 +21 -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 +9 -2
- package/build/app/settings.js +22 -11
- package/build/app/store.d.ts +0 -2
- 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 +5 -3
- 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 +5 -5
- package/build/constants/app.js +62 -32
- 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 +88 -41
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +445 -296
- 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 +40 -8
- package/build/features/app/entity/entityStore.js +389 -149
- package/build/features/app/individual/individualStore.d.ts +18 -0
- package/build/features/app/individual/individualStore.js +178 -85
- package/build/features/app/password/passwordStore.d.ts +1 -7
- package/build/features/app/password/passwordStore.js +31 -20
- package/build/features/app/tax/taxStore.js +23 -16
- package/build/features/auth/Auth.d.ts +2 -1
- package/build/features/auth/Auth.js +37 -9
- 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 +4 -4
- 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.js +4 -4
- 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 +26 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +78 -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 +1 -0
- package/build/features/connect/Connect.js +38 -10
- 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 +48 -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.js +6 -6
- package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
- package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
- package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
- package/build/features/entity/screens/Customers/Customers.js +90 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
- package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
- package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
- package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
- package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
- package/build/features/entity/screens/Customers/index.d.ts +3 -0
- package/build/features/entity/screens/Customers/index.js +2 -0
- package/build/features/entity/screens/Customers/validation.d.ts +20 -0
- package/build/features/entity/screens/Customers/validation.js +13 -0
- 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 +38 -10
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -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 +30 -7
- package/build/features/individual/Individual.js +4 -4
- 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.js +4 -4
- 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/Success/Success.js +7 -3
- 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 +2 -5
- package/build/features/shared/Background/Background.js +7 -3
- 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.js +4 -4
- 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.js +6 -6
- 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 +2 -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/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/string.d.ts +13 -0
- 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 +4 -3
- 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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import React, { memo } from 'react';
|
|
25
|
+
import { Calendar, toDateObject } from 'react-multi-date-picker';
|
|
26
|
+
import arabic from 'react-date-object/calendars/arabic';
|
|
27
|
+
import arabic_ar from 'react-date-object/locales/arabic_ar';
|
|
28
|
+
import Box from '@mui/material/Box';
|
|
29
|
+
import { styled } from '@mui/material/styles';
|
|
30
|
+
import Divider from '@mui/material/Divider';
|
|
31
|
+
import Collapse from '../Collapse';
|
|
32
|
+
import ExpandIcon from '../ExpandIcon';
|
|
33
|
+
import CalendarTodayOutlined from '@mui/icons-material/CalendarTodayOutlined';
|
|
34
|
+
import Input from '../Input';
|
|
35
|
+
import Text from '../Text';
|
|
36
|
+
import './style.css';
|
|
37
|
+
var ContainerIcon = styled(CalendarTodayOutlined)(function (_a) {
|
|
38
|
+
var theme = _a.theme;
|
|
39
|
+
return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: 'pointer', width: theme.spacing(2.5), height: theme.spacing(2.5) }));
|
|
40
|
+
});
|
|
41
|
+
var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
42
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
43
|
+
return ({
|
|
44
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
45
|
+
fontFamily: theme.typography.fontFamily
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var InputFieldStyled = styled(Input)(function (_a) {
|
|
49
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
50
|
+
return ({
|
|
51
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
52
|
+
'&::placeholder': __assign(__assign({ opacity: 1, color: theme.palette.text.primary, lineHeight: theme.spacing(2.125) }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight }),
|
|
53
|
+
'& .MuiInputBase-input': {
|
|
54
|
+
WebkitTextFillColor: 'inherit'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
59
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
60
|
+
return ({
|
|
61
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
62
|
+
marginInlineEnd: theme.spacing(2.5)
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
var DatePicker = function (_a) {
|
|
66
|
+
var disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, rest = __rest(_a, ["disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value"]);
|
|
67
|
+
var _b = React.useState(null), anchor = _b[0], setAnchor = _b[1];
|
|
68
|
+
var calenderIcon = _jsx(ContainerIcon, {});
|
|
69
|
+
var defaultMax = new Date();
|
|
70
|
+
var defaultMin = new Date('1900-01-01');
|
|
71
|
+
var DATE_FORMAT = 'YYYY-MM-DD';
|
|
72
|
+
var toggleCalender = function (event) {
|
|
73
|
+
if (disabled)
|
|
74
|
+
return;
|
|
75
|
+
if (anchor) {
|
|
76
|
+
onDatePicked && onDatePicked();
|
|
77
|
+
setAnchor(null);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
setAnchor(event.currentTarget);
|
|
81
|
+
onClick && onClick(event);
|
|
82
|
+
};
|
|
83
|
+
var handleOnDateChange = function (date) {
|
|
84
|
+
onDateChange && onDateChange(date.toDate().toLocaleDateString('en-CA'));
|
|
85
|
+
setAnchor(null);
|
|
86
|
+
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
87
|
+
};
|
|
88
|
+
var formateDate = function (date) {
|
|
89
|
+
var dateObject = toDateObject(date);
|
|
90
|
+
return dateObject.convert(arabic).format(DATE_FORMAT);
|
|
91
|
+
};
|
|
92
|
+
return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: disabled ? '' : _jsx(ExpandIcon, { anchorEl: !!anchor }) })), value: value ? formateDate(value) : '', placeholder: DATE_FORMAT, onClick: toggleCalender, startAdornment: calenderIcon, disabled: !disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: !!anchor }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: arabic_ar, maxDate: defaultMax, minDate: defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: value, className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
|
|
93
|
+
};
|
|
94
|
+
export default memo(DatePicker);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.rmdp-wrapper {
|
|
2
|
+
box-shadow: none !important;
|
|
3
|
+
width: 100% !important;
|
|
4
|
+
z-index: 0 !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.rmdp-day-picker > div {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rmdp-calendar {
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
/* .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
|
|
15
|
+
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
16
|
+
color: black !important;
|
|
17
|
+
background-color: unset !important;
|
|
18
|
+
} */
|
|
19
|
+
|
|
20
|
+
.rmdp-day.rmdp-selected span:not(.highlight) {
|
|
21
|
+
/* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
|
|
22
|
+
color: #ffffff !important;
|
|
23
|
+
background-color: black !important;
|
|
24
|
+
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface DragAndDropProps {
|
|
3
3
|
title: string;
|
|
4
|
+
subTitle: string;
|
|
5
|
+
description: string;
|
|
6
|
+
uploadingTitle: string;
|
|
7
|
+
successTitle: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
progress?: number;
|
|
10
|
+
uploading?: boolean;
|
|
11
|
+
uploadSuccess?: boolean;
|
|
12
|
+
fileExists: boolean;
|
|
4
13
|
onSuccess?: (files: File) => void;
|
|
5
14
|
}
|
|
6
|
-
declare const DragAndDrop: ({ title, onSuccess }: DragAndDropProps) => JSX.Element;
|
|
15
|
+
declare const DragAndDrop: ({ title, subTitle, description, error, uploadingTitle, successTitle, progress, uploading, fileExists, uploadSuccess, onSuccess }: DragAndDropProps) => JSX.Element;
|
|
7
16
|
export default DragAndDrop;
|
|
@@ -9,30 +9,130 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
13
14
|
import Box from '@mui/material/Box';
|
|
14
15
|
import { alpha, styled } from '@mui/material/styles';
|
|
15
16
|
import Input from '../Input';
|
|
16
17
|
import Text from '../Text';
|
|
17
18
|
import { useDropzone } from 'react-dropzone';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
import Icon from '../../components/Icon';
|
|
20
|
+
import { ICONS_NAMES } from '../../constants';
|
|
21
|
+
import { CircularProgress } from '../../components/ProgressBar';
|
|
22
|
+
import Collapse from '../../components/Collapse';
|
|
23
|
+
import Fade from '@mui/material/Fade';
|
|
24
|
+
var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'active'; } })(function (_a) {
|
|
25
|
+
var theme = _a.theme, active = _a.active;
|
|
26
|
+
return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightRegular, background: theme.palette.background.paper, paddingInline: theme.spacing(2.5), border: "2px dashed ".concat(active ? theme.palette.primary.main : alpha(theme.palette.divider, 0.8)), width: '350px', height: '158px', cursor: 'default', display: 'flex', justifyContent: 'center', alignItems: 'center', borderRadius: theme.spacing(2.5) }));
|
|
21
27
|
});
|
|
22
28
|
var UploadInputStyled = styled(Input)(function () { return ({
|
|
23
29
|
display: 'none'
|
|
24
30
|
}); });
|
|
31
|
+
var CenterBoxStyled = styled(Box)(function () { return ({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center'
|
|
35
|
+
}); });
|
|
36
|
+
var IconStyled = styled(Icon)(function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return ({
|
|
39
|
+
width: theme.spacing(11.25),
|
|
40
|
+
height: theme.spacing(10),
|
|
41
|
+
cursor: 'pointer'
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
var DoneIconStyled = styled(Icon)(function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return ({
|
|
47
|
+
width: theme.spacing(6.75),
|
|
48
|
+
height: theme.spacing(6.75),
|
|
49
|
+
cursor: 'pointer'
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
var VerticalCenterBox = styled(Box)(function (_a) {
|
|
53
|
+
var theme = _a.theme;
|
|
54
|
+
return ({
|
|
55
|
+
display: 'flex',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
alignItems: 'center'
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var DescTextStyled = styled(Text)(function (_a) {
|
|
62
|
+
var theme = _a.theme;
|
|
63
|
+
return ({
|
|
64
|
+
fontSize: theme.spacing(1.5),
|
|
65
|
+
width: theme.spacing(27.5),
|
|
66
|
+
wordBreak: 'break-all',
|
|
67
|
+
textAlign: 'center',
|
|
68
|
+
marginBlockStart: theme.spacing(1),
|
|
69
|
+
marginBlockEnd: theme.spacing(0)
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var SubTitleStyled = styled(Text)(function (_a) {
|
|
73
|
+
var theme = _a.theme;
|
|
74
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.primary.main, marginInlineStart: theme.spacing(0.5) }));
|
|
75
|
+
});
|
|
76
|
+
var WarningIconStyled = styled(Icon)(function (_a) {
|
|
77
|
+
var theme = _a.theme;
|
|
78
|
+
return ({
|
|
79
|
+
width: theme.spacing(1.625),
|
|
80
|
+
height: theme.spacing(1.625),
|
|
81
|
+
marginInline: theme.spacing(0.5)
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
var DropFileIcon = styled(Icon)(function (_a) {
|
|
85
|
+
var theme = _a.theme;
|
|
86
|
+
return ({
|
|
87
|
+
width: theme.spacing(9.375),
|
|
88
|
+
height: theme.spacing(9.375),
|
|
89
|
+
zIndex: 2,
|
|
90
|
+
position: 'absolute',
|
|
91
|
+
right: 0,
|
|
92
|
+
marginInline: theme.spacing(-1.25)
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
var TextDoneStyled = styled(Text)(function (_a) {
|
|
96
|
+
var theme = _a.theme;
|
|
97
|
+
return ({
|
|
98
|
+
marginBlockStart: theme.spacing(1),
|
|
99
|
+
color: theme.palette.text.primary
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
var WarningContainer = styled(Box)(function (_a) {
|
|
103
|
+
var theme = _a.theme;
|
|
104
|
+
return (__assign({ background: theme.palette.warning.dark, paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), border: '0.5px solid', display: 'flex', justifyContent: 'space-around', borderColor: theme.palette.warning.main, color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: theme.spacing(12.5) }, theme.typography.caption));
|
|
105
|
+
});
|
|
25
106
|
var DragAndDrop = function (_a) {
|
|
26
|
-
var title = _a.title, onSuccess = _a.onSuccess;
|
|
27
|
-
var _b =
|
|
107
|
+
var title = _a.title, subTitle = _a.subTitle, description = _a.description, error = _a.error, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, progress = _a.progress, uploading = _a.uploading, fileExists = _a.fileExists, uploadSuccess = _a.uploadSuccess, onSuccess = _a.onSuccess;
|
|
108
|
+
var _b = React.useState(false), dragActive = _b[0], setDragActive = _b[1];
|
|
109
|
+
var _c = React.useState(false), showDone = _c[0], setShowDone = _c[1];
|
|
110
|
+
var _d = useDropzone({
|
|
28
111
|
maxFiles: 1,
|
|
29
112
|
noKeyboard: true,
|
|
30
113
|
noClick: false,
|
|
31
114
|
multiple: false,
|
|
115
|
+
onDragOver: function () {
|
|
116
|
+
if (!dragActive)
|
|
117
|
+
setDragActive(true);
|
|
118
|
+
},
|
|
119
|
+
onDragLeave: function () {
|
|
120
|
+
setDragActive(false);
|
|
121
|
+
},
|
|
32
122
|
onDrop: function (files) {
|
|
33
123
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(files === null || files === void 0 ? void 0 : files[0]);
|
|
124
|
+
setDragActive(false);
|
|
125
|
+
}
|
|
126
|
+
}), getRootProps = _d.getRootProps, getInputProps = _d.getInputProps;
|
|
127
|
+
React.useEffect(function () {
|
|
128
|
+
setDragActive(false);
|
|
129
|
+
if (uploadSuccess) {
|
|
130
|
+
setShowDone(true);
|
|
131
|
+
setTimeout(function () {
|
|
132
|
+
setShowDone(false);
|
|
133
|
+
}, 400);
|
|
34
134
|
}
|
|
35
|
-
}
|
|
36
|
-
return (_jsxs(BoxStyled, __assign({}, getRootProps({ className: 'dropzone' }), { children: [_jsx(Text, __assign({ sx: { fontSize: '
|
|
135
|
+
}, [uploading]);
|
|
136
|
+
return (_jsx(Box, __assign({ id: 'upload-container' }, { children: _jsxs(BoxStyled, __assign({ active: dragActive }, getRootProps({ className: 'dropzone' }), { children: [_jsx(Fade, __assign({ in: (!uploading && !uploadSuccess) || !fileExists, unmountOnExit: true, timeout: 100 }, { children: _jsxs(Box, { children: [_jsx(CenterBoxStyled, { children: _jsx(IconStyled, { src: dragActive ? ICONS_NAMES.ACTIVE_UPLOAD_ICON : ICONS_NAMES.UPLOAD_ICON }) }), _jsxs(VerticalCenterBox, __assign({ sx: { marginBlockEnd: '20px' } }, { children: [_jsxs(CenterBoxStyled, { children: [_jsx(Text, __assign({ sx: { fontSize: '16px' } }, { children: title })), _jsx(SubTitleStyled, { children: subTitle })] }), _jsx(DescTextStyled, { children: description }), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: error })] }) }))] })), _jsx(UploadInputStyled, { inputProps: __assign({}, getInputProps()) })] }) })), _jsx(CenterBoxStyled, { children: showDone ? (_jsxs(VerticalCenterBox, { children: [_jsx(DoneIconStyled, { src: ICONS_NAMES.DONE_ICON }), _jsx(TextDoneStyled, { children: successTitle })] })) : uploading ? (_jsxs(VerticalCenterBox, { children: [_jsx(CircularProgress, { value: progress, size: 54 }), _jsx(Text, { children: uploadingTitle })] })) : (_jsx(_Fragment, {})) })] })) })));
|
|
37
137
|
};
|
|
38
138
|
export default DragAndDrop;
|