@tap-payments/auth-jsconnect 2.0.34-test → 2.0.34

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 (295) hide show
  1. package/build/@types/app.d.ts +57 -20
  2. package/build/@types/app.js +14 -1
  3. package/build/@types/form.d.ts +17 -10
  4. package/build/api/auth.d.ts +24 -2
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +28 -5
  14. package/build/api/entity.js +23 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +41 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +8 -6
  21. package/build/app/rootReducer.d.ts +1 -1
  22. package/build/app/rootReducer.js +2 -2
  23. package/build/app/settings.d.ts +8 -2
  24. package/build/app/settings.js +29 -12
  25. package/build/app/store.d.ts +3 -3
  26. package/build/assets/locales/ar.json +256 -179
  27. package/build/assets/locales/en.json +188 -104
  28. package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
  29. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  30. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  31. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  32. package/build/components/AnimationFlow/Dialog.d.ts +5 -1
  33. package/build/components/AnimationFlow/Dialog.js +11 -5
  34. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  36. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  37. package/build/components/ArabicDatePicker/index.js +2 -0
  38. package/build/components/ArabicDatePicker/style.css +24 -0
  39. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  40. package/build/components/FileInput/DragAndDrop.js +107 -8
  41. package/build/components/Lottie/Lottie.d.ts +878 -0
  42. package/build/components/Lottie/Lottie.js +58 -0
  43. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  44. package/build/components/Lottie/files/success.json +425 -0
  45. package/build/components/Lottie/index.d.ts +3 -0
  46. package/build/components/Lottie/index.js +3 -0
  47. package/build/components/OTPField/OTPField.d.ts +2 -1
  48. package/build/components/OTPField/OTPField.js +2 -2
  49. package/build/components/OTPTimer/OTPTimer.js +1 -1
  50. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  51. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  52. package/build/components/ProgressBar/index.d.ts +2 -0
  53. package/build/components/ProgressBar/index.js +2 -0
  54. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  55. package/build/components/RadioLabel/RadioLabel.js +2 -2
  56. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -4
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
  58. package/build/constants/api.d.ts +6 -0
  59. package/build/constants/api.js +14 -1
  60. package/build/constants/app.d.ts +7 -5
  61. package/build/constants/app.js +55 -22
  62. package/build/constants/assets.d.ts +20 -1
  63. package/build/constants/assets.js +27 -8
  64. package/build/constants/dummy.d.ts +1 -1
  65. package/build/constants/dummy.js +2 -2
  66. package/build/constants/validation.d.ts +8 -0
  67. package/build/constants/validation.js +9 -1
  68. package/build/features/app/auth/authStore.d.ts +47 -0
  69. package/build/features/app/auth/authStore.js +265 -0
  70. package/build/features/app/bank/bankStore.d.ts +16 -0
  71. package/build/features/app/bank/bankStore.js +81 -37
  72. package/build/features/app/business/businessStore.d.ts +22 -3
  73. package/build/features/app/business/businessStore.js +428 -290
  74. package/build/features/app/connect/connectStore.d.ts +33 -30
  75. package/build/features/app/connect/connectStore.js +398 -258
  76. package/build/features/app/entity/entityStore.d.ts +5 -0
  77. package/build/features/app/entity/entityStore.js +153 -14
  78. package/build/features/app/individual/individualStore.d.ts +17 -0
  79. package/build/features/app/individual/individualStore.js +167 -83
  80. package/build/features/app/password/passwordStore.js +1 -1
  81. package/build/features/app/tax/taxStore.js +3 -2
  82. package/build/features/auth/Auth.d.ts +10 -0
  83. package/build/features/auth/Auth.js +87 -0
  84. package/build/features/auth/index.d.ts +1 -0
  85. package/build/features/auth/index.js +1 -0
  86. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  87. package/build/features/auth/screens/NID/DOB.js +47 -0
  88. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  89. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  90. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  91. package/build/features/auth/screens/NID/NID.js +68 -0
  92. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  93. package/build/features/auth/screens/NID/TAC.js +87 -0
  94. package/build/features/auth/screens/NID/index.d.ts +3 -0
  95. package/build/features/auth/screens/NID/index.js +2 -0
  96. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  97. package/build/features/auth/screens/NID/validation.js +19 -0
  98. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  99. package/build/features/auth/screens/OTP/OTP.js +76 -0
  100. package/build/features/{otp/screens/OTPVerify/Verify.d.ts → auth/screens/OTP/OTPInput.d.ts} +0 -0
  101. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/OTPInput.js +11 -7
  102. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  103. package/build/features/auth/screens/OTP/index.js +2 -0
  104. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.d.ts +0 -0
  105. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.js +0 -0
  106. package/build/features/bank/Bank.js +12 -6
  107. package/build/features/bank/screens/BankDetails/BankDetails.js +17 -4
  108. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  109. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  110. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  111. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  112. package/build/features/business/Business.d.ts +1 -1
  113. package/build/features/business/Business.js +14 -7
  114. package/build/features/business/screens/Activities/Activities.js +16 -17
  115. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  116. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  117. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  118. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  119. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  120. package/build/features/business/screens/Activities/validation.js +0 -9
  121. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  122. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  123. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  124. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  126. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  127. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  128. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  129. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  130. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  131. package/build/features/business/screens/BusinessType/validation.js +50 -1
  132. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  133. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  134. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  135. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  136. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  137. package/build/features/business/screens/CivilID/index.js +2 -0
  138. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  139. package/build/features/business/screens/CivilID/validation.js +4 -0
  140. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  141. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  142. package/build/features/business/screens/Customers/Customers.js +15 -9
  143. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  144. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  145. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  146. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  147. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  148. package/build/features/business/screens/OTP/OTP.js +15 -2
  149. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -7
  150. package/build/features/business/screens/Verify/Verify.js +4 -4
  151. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  154. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  155. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  156. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  157. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  158. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  159. package/build/features/connect/Connect.d.ts +2 -1
  160. package/build/features/connect/Connect.js +47 -12
  161. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  162. package/build/features/connect/screens/CivilID/CivilID.js +99 -0
  163. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  164. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  165. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  166. package/build/features/connect/screens/CivilID/index.js +2 -0
  167. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  168. package/build/features/connect/screens/CivilID/validation.js +4 -0
  169. package/build/features/connect/screens/Individual/Email.js +11 -3
  170. package/build/features/connect/screens/Individual/Individual.js +41 -27
  171. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  172. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  173. package/build/features/connect/screens/Merchant/Merchant.js +47 -50
  174. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
  175. package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
  176. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  177. package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
  178. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  179. package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
  180. package/build/features/connect/screens/Merchant/validation.js +117 -116
  181. package/build/features/connect/screens/Mobile/Mobile.js +29 -12
  182. package/build/features/connect/screens/NID/NID.js +2 -1
  183. package/build/features/connect/screens/OTP/OTP.js +20 -6
  184. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  188. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  189. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  190. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  191. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  192. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  193. package/build/features/entity/Entity.d.ts +1 -1
  194. package/build/features/entity/Entity.js +16 -9
  195. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  196. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
  197. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +65 -2
  198. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  199. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  200. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  201. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  202. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  203. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  204. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
  205. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -5
  206. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  207. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  208. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
  209. package/build/features/entity/screens/Verify/Verify.js +16 -3
  210. package/build/features/featuresScreens.d.ts +1 -1
  211. package/build/features/featuresScreens.js +31 -6
  212. package/build/features/individual/Individual.d.ts +1 -1
  213. package/build/features/individual/Individual.js +14 -7
  214. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +17 -24
  215. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  216. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  217. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  218. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  219. package/build/features/individual/screens/Verify/Verify.js +18 -5
  220. package/build/features/password/Password.d.ts +1 -1
  221. package/build/features/password/Password.js +14 -7
  222. package/build/features/password/screens/CreatePassword/CreatePassword.js +15 -2
  223. package/build/features/password/screens/OTP/OTP.js +15 -2
  224. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
  225. package/build/features/password/screens/Verify/Verify.js +16 -3
  226. package/build/features/shared/Background/Background.d.ts +6 -5
  227. package/build/features/shared/Background/Background.js +16 -5
  228. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  229. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  230. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  231. package/build/features/shared/Button/MobileButton.js +2 -2
  232. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  233. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  234. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  235. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  236. package/build/features/shared/Dialog/index.d.ts +4 -0
  237. package/build/features/shared/Dialog/index.js +4 -0
  238. package/build/features/shared/Input/Input.d.ts +1 -1
  239. package/build/features/shared/Input/Input.js +2 -2
  240. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  241. package/build/features/shared/UploadFile/UploadFile.d.ts +9 -3
  242. package/build/features/shared/UploadFile/UploadFile.js +23 -8
  243. package/build/features/signIn/SignIn.d.ts +1 -1
  244. package/build/features/signIn/SignIn.js +14 -6
  245. package/build/features/signIn/screens/Email/Email.js +4 -2
  246. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  247. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  248. package/build/features/signIn/screens/Password/Password.js +15 -2
  249. package/build/features/tax/Tax.d.ts +1 -1
  250. package/build/features/tax/Tax.js +16 -8
  251. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -7
  252. package/build/features/tax/screens/TaxDetails/TaxDetails.js +15 -2
  253. package/build/features/tax/screens/Verify/Verify.js +16 -3
  254. package/build/hooks/index.d.ts +2 -0
  255. package/build/hooks/index.js +2 -0
  256. package/build/hooks/useAppConfig.d.ts +3 -1
  257. package/build/hooks/useAppConfig.js +4 -2
  258. package/build/hooks/useAppDispatch.d.ts +1 -1
  259. package/build/hooks/useErrorListener.js +0 -6
  260. package/build/hooks/useScreen.d.ts +3 -0
  261. package/build/hooks/useScreen.js +14 -0
  262. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  263. package/build/hooks/useSetFromDefaultValues.js +24 -0
  264. package/build/index.d.ts +3 -3
  265. package/build/index.js +5 -5
  266. package/build/utils/array.d.ts +13 -1
  267. package/build/utils/array.js +26 -0
  268. package/build/utils/common.d.ts +1 -0
  269. package/build/utils/common.js +3 -0
  270. package/build/utils/device.d.ts +1 -0
  271. package/build/utils/device.js +13 -0
  272. package/build/utils/html.d.ts +1 -0
  273. package/build/utils/html.js +6 -0
  274. package/build/utils/index.d.ts +1 -0
  275. package/build/utils/index.js +1 -0
  276. package/build/utils/locale.js +1 -1
  277. package/build/utils/object.d.ts +1 -0
  278. package/build/utils/object.js +12 -0
  279. package/build/utils/rsa.d.ts +2 -2
  280. package/build/utils/rsa.js +1 -1
  281. package/build/utils/string.d.ts +33 -20
  282. package/build/utils/string.js +71 -1
  283. package/build/utils/validation.d.ts +2 -0
  284. package/build/utils/validation.js +6 -0
  285. package/package.json +129 -128
  286. package/build/features/app/otp/otpStore.d.ts +0 -28
  287. package/build/features/app/otp/otpStore.js +0 -153
  288. package/build/features/otp/OTP.d.ts +0 -7
  289. package/build/features/otp/OTP.js +0 -58
  290. package/build/features/otp/index.d.ts +0 -0
  291. package/build/features/otp/index.js +0 -1
  292. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  293. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  294. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  295. package/build/features/otp/screens/OTPVerify/index.js +0 -2
@@ -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,128 +1,129 @@
1
- {
2
- "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.34-test",
4
- "description": "connect library, auth",
5
- "private": false,
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "files": [
10
- "build",
11
- "README.md"
12
- ],
13
- "scripts": {
14
- "husky:setup": "npx husky install",
15
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
- "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
- "start": "cross-env NODE_ENV=development webpack serve",
20
- "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
- "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
- "tsc:alias": "tsc-alias -p tsconfig.json",
23
- "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public"
25
- },
26
- "keywords": [],
27
- "author": {
28
- "name": "Ahmed Elsharkawy",
29
- "email": "a.elsharkawy@tap.company"
30
- },
31
- "license": "ISC",
32
- "devDependencies": {
33
- "@babel/core": "^7.18.6",
34
- "@babel/preset-env": "^7.18.6",
35
- "@babel/preset-react": "^7.18.6",
36
- "@babel/preset-typescript": "^7.18.6",
37
- "@types/lodash-es": "^4.17.6",
38
- "@types/moment-hijri": "^2.1.0",
39
- "@types/react": "^18.0.15",
40
- "@types/react-calendar": "~3.5.1",
41
- "@types/react-dom": "^18.0.6",
42
- "@typescript-eslint/eslint-plugin": "^5.30.5",
43
- "@typescript-eslint/parser": "^5.30.5",
44
- "babel-loader": "^8.2.5",
45
- "copyfiles": "^2.4.1",
46
- "cross-env": "^7.0.3",
47
- "css-loader": "^6.7.1",
48
- "css-minimizer-webpack-plugin": "^4.0.0",
49
- "eslint": "^8.19.0",
50
- "eslint-config-airbnb": "^19.0.4",
51
- "eslint-config-prettier": "^8.5.0",
52
- "eslint-plugin-import": "^2.26.0",
53
- "eslint-plugin-jsx-a11y": "^6.6.0",
54
- "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-prettier": "^4.2.1",
56
- "eslint-plugin-react": "^7.30.1",
57
- "eslint-plugin-react-hooks": "^4.6.0",
58
- "file-loader": "^6.2.0",
59
- "fork-ts-checker-webpack-plugin": "^7.2.12",
60
- "html-loader": "^3.1.2",
61
- "html-webpack-plugin": "^5.5.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "mini-css-extract-plugin": "^2.6.1",
65
- "prettier": "^2.7.1",
66
- "sass": "^1.53.0",
67
- "sass-loader": "^13.0.2",
68
- "style-loader": "^3.3.1",
69
- "terser-webpack-plugin": "^5.3.3",
70
- "tsc-alias": "^1.6.11",
71
- "typescript": "^4.7.4",
72
- "webpack": "^5.73.0",
73
- "webpack-cli": "^4.10.0",
74
- "webpack-dev-server": "^4.9.3",
75
- "webpack-merge": "^5.8.0"
76
- },
77
- "dependencies": {
78
- "@emotion/react": "^11.9.3",
79
- "@emotion/styled": "^11.9.3",
80
- "@fingerprintjs/fingerprintjs": "~3.3.4",
81
- "@hookform/resolvers": "^2.9.6",
82
- "@mui/icons-material": "^5.8.4",
83
- "@mui/material": "^5.8.7",
84
- "@reduxjs/toolkit": "^1.8.3",
85
- "axios": "^0.27.2",
86
- "device-detector-js": "^3.0.3",
87
- "i18next": "^21.8.14",
88
- "i18next-browser-languagedetector": "^6.1.4",
89
- "i18next-http-backend": "^1.4.1",
90
- "jsencrypt": "^3.2.1",
91
- "lodash-es": "^4.17.21",
92
- "moment-hijri": "~2.1.2",
93
- "react": "^18.2.0",
94
- "react-calendar": "~3.7.0",
95
- "react-device-detect": "^2.2.2",
96
- "react-dom": "^18.2.0",
97
- "react-dropzone": "^14.2.2",
98
- "react-hook-form": "^7.33.1",
99
- "react-i18next": "^11.18.1",
100
- "react-otp-input": "^2.4.0",
101
- "react-redux": "^8.0.2",
102
- "react-spring-bottom-sheet": "^3.4.1",
103
- "yup": "^0.32.11"
104
- },
105
- "peerDependencies": {
106
- "react": "^18.2.0",
107
- "react-dom": "^18.2.0"
108
- },
109
- "lint-staged": {
110
- "src/**/*.{ts,tsx,json,js,jsx}": [
111
- "yarn run prettier:fix",
112
- "yarn run lint",
113
- "git add ."
114
- ]
115
- },
116
- "browserslist": {
117
- "production": [
118
- ">0.2%",
119
- "not dead",
120
- "not op_mini all"
121
- ],
122
- "development": [
123
- "last 1 chrome version",
124
- "last 1 firefox version",
125
- "last 1 safari version"
126
- ]
127
- }
128
- }
1
+ {
2
+ "name": "@tap-payments/auth-jsconnect",
3
+ "version": "2.0.34",
4
+ "description": "connect library, auth",
5
+ "private": false,
6
+ "main": "build/index.js",
7
+ "module": "build/index.js",
8
+ "types": "build/index.d.ts",
9
+ "files": [
10
+ "build",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "husky:setup": "npx husky install",
15
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
+ "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
+ "start": "cross-env NODE_ENV=development webpack serve",
20
+ "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
+ "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
+ "tsc:alias": "tsc-alias -p tsconfig.json",
23
+ "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
+ "push": "npm publish --access public"
25
+ },
26
+ "keywords": [],
27
+ "author": {
28
+ "name": "Ahmed Elsharkawy",
29
+ "email": "a.elsharkawy@tap.company"
30
+ },
31
+ "license": "ISC",
32
+ "devDependencies": {
33
+ "@babel/core": "^7.18.6",
34
+ "@babel/preset-env": "^7.18.6",
35
+ "@babel/preset-react": "^7.18.6",
36
+ "@babel/preset-typescript": "^7.18.6",
37
+ "@types/lodash-es": "^4.17.6",
38
+ "@types/react": "^18.0.15",
39
+ "@types/react-calendar": "~3.5.1",
40
+ "@types/react-dom": "^18.0.6",
41
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
42
+ "@typescript-eslint/parser": "^5.30.5",
43
+ "babel-loader": "^8.2.5",
44
+ "copyfiles": "^2.4.1",
45
+ "cross-env": "^7.0.3",
46
+ "css-loader": "^6.7.1",
47
+ "css-minimizer-webpack-plugin": "^4.0.0",
48
+ "eslint": "^8.19.0",
49
+ "eslint-config-airbnb": "^19.0.4",
50
+ "eslint-config-prettier": "^8.5.0",
51
+ "eslint-plugin-import": "^2.26.0",
52
+ "eslint-plugin-jsx-a11y": "^6.6.0",
53
+ "eslint-plugin-node": "^11.1.0",
54
+ "eslint-plugin-prettier": "^4.2.1",
55
+ "eslint-plugin-react": "^7.30.1",
56
+ "eslint-plugin-react-hooks": "^4.6.0",
57
+ "file-loader": "^6.2.0",
58
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
59
+ "html-loader": "^3.1.2",
60
+ "html-webpack-plugin": "^5.5.0",
61
+ "husky": "^8.0.1",
62
+ "lint-staged": "^13.0.3",
63
+ "mini-css-extract-plugin": "^2.6.1",
64
+ "prettier": "^2.7.1",
65
+ "sass": "^1.53.0",
66
+ "sass-loader": "^13.0.2",
67
+ "style-loader": "^3.3.1",
68
+ "terser-webpack-plugin": "^5.3.3",
69
+ "tsc-alias": "^1.6.11",
70
+ "typescript": "^4.7.4",
71
+ "webpack": "^5.73.0",
72
+ "webpack-cli": "^4.10.0",
73
+ "webpack-dev-server": "^4.9.3",
74
+ "webpack-merge": "^5.8.0"
75
+ },
76
+ "dependencies": {
77
+ "@emotion/react": "^11.9.3",
78
+ "@emotion/styled": "^11.9.3",
79
+ "@fingerprintjs/fingerprintjs": "~3.3.4",
80
+ "@hookform/resolvers": "^2.9.6",
81
+ "@mui/icons-material": "^5.8.4",
82
+ "@mui/material": "^5.8.7",
83
+ "@reduxjs/toolkit": "^1.8.3",
84
+ "axios": "^0.27.2",
85
+ "device-detector-js": "^3.0.3",
86
+ "i18next": "^21.8.14",
87
+ "i18next-browser-languagedetector": "^6.1.4",
88
+ "i18next-http-backend": "^1.4.1",
89
+ "jsencrypt": "^2.3.1",
90
+ "lodash-es": "^4.17.21",
91
+ "lottie-web": "^5.9.6",
92
+ "moment": "^2.29.4",
93
+ "react": "^18.2.0",
94
+ "react-calendar": "~3.7.0",
95
+ "react-device-detect": "^2.2.2",
96
+ "react-dom": "^18.2.0",
97
+ "react-dropzone": "^14.2.2",
98
+ "react-hook-form": "^7.33.1",
99
+ "react-i18next": "^11.18.1",
100
+ "react-multi-date-picker": "^3.3.4",
101
+ "react-otp-input": "^2.4.0",
102
+ "react-redux": "^8.0.2",
103
+ "react-spring-bottom-sheet": "^3.4.1",
104
+ "yup": "^0.32.11"
105
+ },
106
+ "peerDependencies": {
107
+ "react": "^18.2.0",
108
+ "react-dom": "^18.2.0"
109
+ },
110
+ "lint-staged": {
111
+ "src/**/*.{ts,tsx,json,js,jsx}": [
112
+ "yarn run prettier:fix",
113
+ "yarn run lint",
114
+ "git add ."
115
+ ]
116
+ },
117
+ "browserslist": {
118
+ "production": [
119
+ ">0.2%",
120
+ "not dead",
121
+ "not op_mini all"
122
+ ],
123
+ "development": [
124
+ "last 1 chrome version",
125
+ "last 1 firefox version",
126
+ "last 1 safari version"
127
+ ]
128
+ }
129
+ }
@@ -1,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;
@@ -1,153 +0,0 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var _a;
49
- import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import API from '../../../api';
51
- import { FlowsTypes } from '../../../@types';
52
- import { handleNextScreenStep } from '../../../app/settings';
53
- import { OTP_STEP_NAMES } from '../../../constants';
54
- export var resendOTP = createAsyncThunk('otpResendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var otp, payload, data;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0:
59
- otp = thunkApi.getState().otp;
60
- payload = {
61
- service_name: 'tap_email',
62
- verify_token: otp.data.verify.token
63
- };
64
- return [4, API.leadService.verifyLeadToken(payload)];
65
- case 1:
66
- data = (_a.sent()).data;
67
- return [2, { data: data }];
68
- }
69
- });
70
- }); });
71
- export var verifyOtpLeadOTP = createAsyncThunk('verifyOtpLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
72
- var otp, responseBody, payload;
73
- var _a;
74
- return __generator(this, function (_b) {
75
- otp = thunkApi.getState().otp;
76
- responseBody = otp.data.verify.responseBody;
77
- payload = {
78
- data: params.otp,
79
- service_name: (_a = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _a === void 0 ? void 0 : _a.service_name,
80
- verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
81
- step_name: OTP_STEP_NAMES.PHONE_AUTH,
82
- encryption_contract: ['data']
83
- };
84
- thunkApi.dispatch(handleNextScreenStep());
85
- return [2, { formData: params }];
86
- });
87
- }); });
88
- var initialState = {
89
- error: null,
90
- loading: false,
91
- customLoading: false,
92
- data: {
93
- flowName: FlowsTypes.OTP,
94
- verify: {
95
- token: ''
96
- },
97
- otpData: {
98
- otp: ''
99
- }
100
- }
101
- };
102
- export var otpSlice = createSlice({
103
- name: 'otp/store',
104
- initialState: initialState,
105
- reducers: {
106
- clearError: function (state) {
107
- state.error = null;
108
- },
109
- stopLoader: function (state) {
110
- state.loading = false;
111
- },
112
- resetOTPScreen: function (state) {
113
- state.data.otpData.otp = '';
114
- }
115
- },
116
- extraReducers: function (builder) {
117
- builder
118
- .addCase(resendOTP.pending, function (state) {
119
- state.error = null;
120
- })
121
- .addCase(resendOTP.fulfilled, function (state, action) {
122
- var _a;
123
- state.error = null;
124
- var data = action.payload.data;
125
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
126
- if (description) {
127
- state.error = description;
128
- return;
129
- }
130
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
131
- })
132
- .addCase(resendOTP.rejected, function (state, action) {
133
- state.error = action.error.message;
134
- })
135
- .addCase(verifyOtpLeadOTP.pending, function (state) {
136
- state.loading = true;
137
- state.error = null;
138
- })
139
- .addCase(verifyOtpLeadOTP.fulfilled, function (state, action) {
140
- state.loading = false;
141
- state.error = null;
142
- var formData = action.payload.formData;
143
- state.data.otpData = formData;
144
- })
145
- .addCase(verifyOtpLeadOTP.rejected, function (state, action) {
146
- state.loading = false;
147
- state.error = action.error.message;
148
- });
149
- }
150
- });
151
- export var clearError = (_a = otpSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
152
- export default otpSlice.reducer;
153
- export var otpSelector = function (state) { return state.otp; };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { LibConfig } from '../../@types';
3
- export interface OTPLibProps extends LibConfig {
4
- }
5
- export declare function OTPLib(props: OTPLibProps): JSX.Element;
6
- export declare function renderOTPLib(config: OTPLibProps, elementId: string): void;
7
- export declare function unmountOTPLib(elementId: string): void;
@@ -1,58 +0,0 @@
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
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { memo } from 'react';
14
- import { styled } from '@mui/material/styles';
15
- import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
16
- import { settingsSelector } from '../../app/settings';
17
- import { store } from '../../app/store';
18
- import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
- import Collapse from '../../components/Collapse';
20
- import { reactElement } from '../../utils';
21
- import { FeatureContainer } from '../shared/Containers';
22
- import { OTP_SCREENS_NAVIGATION } from '../../constants';
23
- import { otpSelector } from '../app/otp/otpStore';
24
- import { otpFeatureScreens } from '../featuresScreens';
25
- var Container = styled(FeatureContainer)(function (_a) {
26
- var theme = _a.theme;
27
- return ({
28
- borderRadius: theme.spacing(1.5),
29
- backgroundColor: 'inherit',
30
- color: theme.palette.text.primary,
31
- maxHeight: "calc(100% - ".concat(theme.spacing(10), ") !important"),
32
- width: theme.spacing(46.875),
33
- maxWidth: theme.spacing(46.875)
34
- });
35
- });
36
- var OTP = memo(function (props) {
37
- var theme = useAppTheme().theme;
38
- var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error;
39
- var otpError = useAppSelector(otpSelector).error;
40
- useAppConfig(__assign({ navigation: OTP_SCREENS_NAVIGATION }, props));
41
- useErrorListener(otpError || error);
42
- useStepStartedListener();
43
- var activeScreen = data.activeScreen;
44
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Container, { children: otpFeatureScreens.map(function (_a, index) {
45
- var Element = _a.element, name = _a.name;
46
- var isActive = activeScreen.name === name;
47
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
48
- }) }) })));
49
- });
50
- export function OTPLib(props) {
51
- return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(OTP, __assign({}, props)) })));
52
- }
53
- export function renderOTPLib(config, elementId) {
54
- reactElement(elementId).render(_jsx(OTPLib, __assign({}, config)));
55
- }
56
- export function unmountOTPLib(elementId) {
57
- reactElement(elementId).unmount();
58
- }
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- export interface OTPProps {
3
- loading: boolean;
4
- }
5
- declare const _default: React.MemoExoticComponent<({ loading }: OTPProps) => JSX.Element>;
6
- export default _default;