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

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 (310) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +21 -12
  4. package/build/api/auth.d.ts +28 -5
  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 +51 -5
  14. package/build/api/entity.js +39 -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 +44 -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 +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +9 -2
  25. package/build/app/settings.js +22 -11
  26. package/build/app/store.d.ts +0 -2
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/DatePicker/customStyle.css +86 -0
  41. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  42. package/build/components/FileInput/DragAndDrop.js +108 -8
  43. package/build/components/Lottie/Lottie.d.ts +878 -0
  44. package/build/components/Lottie/Lottie.js +58 -0
  45. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  46. package/build/components/Lottie/files/success.json +425 -0
  47. package/build/components/Lottie/index.d.ts +3 -0
  48. package/build/components/Lottie/index.js +3 -0
  49. package/build/components/OTPField/OTPField.d.ts +2 -1
  50. package/build/components/OTPField/OTPField.js +2 -2
  51. package/build/components/OTPTimer/OTPTimer.js +1 -1
  52. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  53. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  54. package/build/components/ProgressBar/index.d.ts +2 -0
  55. package/build/components/ProgressBar/index.js +2 -0
  56. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  57. package/build/components/RadioLabel/RadioLabel.js +2 -2
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  59. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  60. package/build/constants/api.d.ts +6 -0
  61. package/build/constants/api.js +14 -1
  62. package/build/constants/app.d.ts +5 -5
  63. package/build/constants/app.js +62 -32
  64. package/build/constants/assets.d.ts +14 -0
  65. package/build/constants/assets.js +16 -2
  66. package/build/constants/dummy.d.ts +1 -1
  67. package/build/constants/dummy.js +2 -2
  68. package/build/constants/validation.d.ts +10 -0
  69. package/build/constants/validation.js +11 -1
  70. package/build/features/app/auth/authStore.d.ts +30 -4
  71. package/build/features/app/auth/authStore.js +182 -20
  72. package/build/features/app/bank/bankStore.d.ts +16 -0
  73. package/build/features/app/bank/bankStore.js +88 -41
  74. package/build/features/app/business/businessStore.d.ts +22 -3
  75. package/build/features/app/business/businessStore.js +445 -296
  76. package/build/features/app/connect/connectStore.d.ts +34 -31
  77. package/build/features/app/connect/connectStore.js +427 -300
  78. package/build/features/app/entity/entityStore.d.ts +40 -8
  79. package/build/features/app/entity/entityStore.js +389 -149
  80. package/build/features/app/individual/individualStore.d.ts +18 -0
  81. package/build/features/app/individual/individualStore.js +178 -85
  82. package/build/features/app/password/passwordStore.d.ts +1 -7
  83. package/build/features/app/password/passwordStore.js +31 -20
  84. package/build/features/app/tax/taxStore.js +23 -16
  85. package/build/features/auth/Auth.d.ts +2 -1
  86. package/build/features/auth/Auth.js +37 -9
  87. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  88. package/build/features/auth/screens/NID/DOB.js +47 -0
  89. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  90. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  91. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  92. package/build/features/auth/screens/NID/NID.js +68 -0
  93. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  94. package/build/features/auth/screens/NID/TAC.js +87 -0
  95. package/build/features/auth/screens/NID/index.d.ts +3 -0
  96. package/build/features/auth/screens/NID/index.js +2 -0
  97. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  98. package/build/features/auth/screens/NID/validation.js +19 -0
  99. package/build/features/auth/screens/OTP/OTP.js +8 -4
  100. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  101. package/build/features/bank/Bank.js +4 -4
  102. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  103. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  104. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  105. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  106. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  107. package/build/features/bank/screens/Success/Success.js +7 -3
  108. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  109. package/build/features/business/Business.js +4 -4
  110. package/build/features/business/screens/Activities/Activities.js +16 -17
  111. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  112. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  113. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  114. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  115. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  116. package/build/features/business/screens/Activities/validation.js +0 -9
  117. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  118. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  121. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  122. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  123. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  124. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  126. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  127. package/build/features/business/screens/BusinessType/validation.js +52 -3
  128. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  129. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  130. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  131. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  132. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  133. package/build/features/business/screens/CivilID/index.js +2 -0
  134. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  135. package/build/features/business/screens/CivilID/validation.js +4 -0
  136. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  137. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  138. package/build/features/business/screens/Customers/Customers.js +15 -9
  139. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  140. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  141. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  142. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  143. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  144. package/build/features/business/screens/OTP/OTP.js +15 -2
  145. package/build/features/business/screens/Success/Success.js +10 -3
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +1 -0
  157. package/build/features/connect/Connect.js +38 -10
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +44 -28
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  177. package/build/features/connect/screens/Merchant/validation.js +108 -173
  178. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  179. package/build/features/connect/screens/NID/NID.js +5 -1
  180. package/build/features/connect/screens/OTP/OTP.js +20 -6
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  188. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  189. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  190. package/build/features/entity/Entity.js +6 -6
  191. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  192. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  193. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  194. package/build/features/entity/screens/Customers/Customers.js +90 -0
  195. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  196. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  197. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  198. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  199. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  200. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  201. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  202. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  203. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  204. package/build/features/entity/screens/Customers/index.js +2 -0
  205. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  206. package/build/features/entity/screens/Customers/validation.js +13 -0
  207. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  208. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  209. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  210. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  211. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  212. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  213. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  214. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  215. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  216. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  217. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  218. package/build/features/entity/screens/Success/Success.js +7 -3
  219. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
  220. package/build/features/entity/screens/Verify/Verify.js +18 -5
  221. package/build/features/featuresScreens.d.ts +0 -1
  222. package/build/features/featuresScreens.js +30 -7
  223. package/build/features/individual/Individual.js +4 -4
  224. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  225. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  226. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  227. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  228. package/build/features/individual/screens/Success/Success.js +7 -3
  229. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  230. package/build/features/individual/screens/Verify/Verify.js +18 -5
  231. package/build/features/password/Password.js +4 -4
  232. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  233. package/build/features/password/screens/OTP/OTP.js +15 -2
  234. package/build/features/password/screens/Success/Success.js +7 -3
  235. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
  236. package/build/features/password/screens/Verify/Verify.js +16 -3
  237. package/build/features/shared/Background/Background.d.ts +2 -5
  238. package/build/features/shared/Background/Background.js +7 -3
  239. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  240. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  241. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  242. package/build/features/shared/Button/MobileButton.js +2 -2
  243. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  244. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  245. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  246. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  247. package/build/features/shared/Dialog/index.d.ts +4 -0
  248. package/build/features/shared/Dialog/index.js +4 -0
  249. package/build/features/shared/Input/Input.d.ts +1 -1
  250. package/build/features/shared/Input/Input.js +2 -2
  251. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  252. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  253. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  254. package/build/features/signIn/SignIn.js +4 -4
  255. package/build/features/signIn/screens/Email/Email.js +4 -2
  256. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  257. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  258. package/build/features/signIn/screens/Password/Password.js +15 -2
  259. package/build/features/tax/Tax.js +6 -6
  260. package/build/features/tax/screens/Success/Success.js +9 -3
  261. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
  262. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  263. package/build/features/tax/screens/Verify/Verify.js +16 -3
  264. package/build/hooks/index.d.ts +2 -0
  265. package/build/hooks/index.js +2 -0
  266. package/build/hooks/useAppConfig.d.ts +3 -1
  267. package/build/hooks/useAppConfig.js +2 -2
  268. package/build/hooks/useAppDispatch.d.ts +0 -1
  269. package/build/hooks/useErrorListener.js +0 -6
  270. package/build/hooks/useScreen.d.ts +3 -0
  271. package/build/hooks/useScreen.js +14 -0
  272. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  273. package/build/hooks/useSetFromDefaultValues.js +24 -0
  274. package/build/index.css +140 -0
  275. package/build/index.d.ts +2 -3
  276. package/build/index.js +1 -4
  277. package/build/utils/array.d.ts +49 -1
  278. package/build/utils/array.js +58 -0
  279. package/build/utils/common.d.ts +1 -0
  280. package/build/utils/common.js +3 -0
  281. package/build/utils/device.d.ts +1 -0
  282. package/build/utils/device.js +13 -0
  283. package/build/utils/index.d.ts +1 -0
  284. package/build/utils/index.js +1 -0
  285. package/build/utils/locale.js +1 -1
  286. package/build/utils/object.d.ts +1 -0
  287. package/build/utils/object.js +12 -0
  288. package/build/utils/string.d.ts +13 -0
  289. package/build/utils/string.js +71 -1
  290. package/build/utils/validation.d.ts +2 -0
  291. package/build/utils/validation.js +6 -0
  292. package/package.json +4 -3
  293. package/build/features/app/otp/otpStore.d.ts +0 -28
  294. package/build/features/app/otp/otpStore.js +0 -153
  295. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  296. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  297. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  298. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  299. package/build/features/otp/OTP.d.ts +0 -7
  300. package/build/features/otp/OTP.js +0 -58
  301. package/build/features/otp/index.d.ts +0 -0
  302. package/build/features/otp/index.js +0 -1
  303. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  304. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  305. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  306. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  307. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  308. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  309. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  310. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -1,112 +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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
- if (ar || !(i in from)) {
15
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
- ar[i] = from[i];
17
- }
18
- }
19
- return to.concat(ar || Array.prototype.slice.call(from));
20
- };
21
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
- import * as React from 'react';
23
- import Box from '@mui/material/Box';
24
- import { alpha, styled } from '@mui/material/styles';
25
- import { useTranslation } from 'react-i18next';
26
- import { useController, useFormContext } from 'react-hook-form';
27
- import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
28
- import Text from '../../../../components/Text';
29
- import { entitySelector, clearError } from '../../../app/entity/entityStore';
30
- import CheckBox from '../../../../components/CheckBox';
31
- import Warning from '../../../../components/Warning';
32
- import Collapse from '../../../../components/Collapse';
33
- import { ScreenContainer } from '../../../shared/Containers';
34
- var InputLabelStyled = styled(Text)(function (_a) {
35
- var theme = _a.theme;
36
- return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
37
- });
38
- var ContainerStyled = styled(Box)(function (_a) {
39
- var theme = _a.theme;
40
- return ({
41
- display: 'flex',
42
- flexDirection: 'row',
43
- alignItems: 'center',
44
- padding: theme.spacing(0, 0.5, 0, 0.5),
45
- height: theme.spacing(3.625),
46
- marginBlockEnd: theme.spacing(0.2)
47
- });
48
- });
49
- var TextStyled = styled(Text)(function (_a) {
50
- var theme = _a.theme;
51
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
52
- });
53
- var CheckBoxStyled = styled(CheckBox)(function (_a) {
54
- var theme = _a.theme;
55
- return ({
56
- marginInlineEnd: theme.spacing(-1),
57
- '& .MuiSvgIcon-root': {
58
- fontSize: 30
59
- },
60
- '&.Mui-checked': {
61
- color: theme.palette.text.primary,
62
- borderRadius: theme.spacing(2.5)
63
- }
64
- });
65
- });
66
- export var MandatoryStyled = styled('span')(function (_a) {
67
- var theme = _a.theme;
68
- return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
69
- });
70
- export var CollapseStyled = styled(Collapse)(function (_a) {
71
- var theme = _a.theme;
72
- return ({
73
- marginBlockStart: theme.spacing(2)
74
- });
75
- });
76
- var SalesChannels = function () {
77
- var _a;
78
- var _b = React.useState([]), channelsMenuList = _b[0], setChannelsMenuList = _b[1];
79
- var t = useTranslation().t;
80
- var isAr = useLanguage().isAr;
81
- var control = useFormContext().control;
82
- var dispatch = useAppDispatch();
83
- var channelsControl = useController({ name: 'salesChannels', control: control });
84
- var channelsChecked = channelsControl.field.value;
85
- var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
- var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
87
- var channelList = (data.verify.responseBody || {}).channelList;
88
- var salesChannels = (data.entityData || {}).salesChannels;
89
- React.useEffect(function () {
90
- if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
91
- setChannelsMenuList(channelList);
92
- }
93
- }, [channelList]);
94
- var handleSalesChannelChange = function (event, checked) {
95
- var selected = channelsMenuList.find(function (channel) { return channel.id === event.target.id; });
96
- var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
97
- if (isExists) {
98
- var updatedIdList = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.filter(function (channel) { return channel.id !== (selected === null || selected === void 0 ? void 0 : selected.id); });
99
- channelsControl.field.onChange(updatedIdList);
100
- return;
101
- }
102
- channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsChecked, true), [selected], false));
103
- if (error)
104
- dispatch(clearError());
105
- };
106
- var getSelectedChannelsFlag = function (item) {
107
- if (channelsChecked)
108
- return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
109
- };
110
- return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('channel_of_service') }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name_ar : channel.name_en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
111
- };
112
- export default SalesChannels;
@@ -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;
@@ -1,47 +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 * as React from 'react';
14
- import Box from '@mui/material/Box/Box';
15
- import { styled } from '@mui/material/styles';
16
- import OTPField from '../../../shared/OTP';
17
- import { useController, useFormContext } from 'react-hook-form';
18
- import { useTranslation } from 'react-i18next';
19
- import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { useAppDispatch } from '../../../../hooks';
21
- import { resendOTP } from '../../../app/otp/otpStore';
22
- var BoxStyled = styled(Box)(function (_a) {
23
- var theme = _a.theme;
24
- return ({
25
- display: 'flex',
26
- flexDirection: 'column',
27
- fontFamily: theme.typography.fontFamily
28
- });
29
- });
30
- var OTPInput = function (_a) {
31
- var loading = _a.loading;
32
- var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
33
- var t = useTranslation().t;
34
- var otpControl = useController({ name: 'otp', control: control });
35
- var dispatch = useAppDispatch();
36
- var handleOnOTPChange = function (otp) {
37
- otpControl.field.onChange(otp);
38
- };
39
- var handleOnResendOTP = function () {
40
- if (otpControl.field.value)
41
- setValue('otp', '', { shouldValidate: true });
42
- dispatch(resendOTP());
43
- };
44
- var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
- };
47
- export default React.memo(OTPInput);
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface OTPProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
- export default _default;
@@ -1,49 +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 * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
15
- import { useTranslation } from 'react-i18next';
16
- import { useForm, FormProvider } from 'react-hook-form';
17
- import { yupResolver } from '@hookform/resolvers/yup';
18
- import { styled } from '@mui/material/styles';
19
- import { useLanguage, useAppSelector } from '../../../../hooks';
20
- import Form from '../../../../components/Form';
21
- import { ScreenContainer } from '../../../shared/Containers';
22
- import { otpSelector, clearError, resetOTPScreen } from '../../../app/otp/otpStore';
23
- import { OTPValidation } from './validation';
24
- import OTPInput from './OTPInput';
25
- var FormStyled = styled(Form)(function () { return ({
26
- display: 'flex',
27
- flexDirection: 'column'
28
- }); });
29
- var Verify = function (_a) {
30
- var dispatch = useAppDispatch();
31
- var _b = useAppSelector(otpSelector), data = _b.data, loading = _b.loading, error = _b.error;
32
- var methods = useForm({
33
- resolver: yupResolver(OTPValidation),
34
- defaultValues: data.otpData,
35
- mode: 'onChange'
36
- });
37
- var t = useTranslation().t;
38
- var isAr = useLanguage().isAr;
39
- React.useEffect(function () {
40
- if (methods.formState.isValid)
41
- dispatch(clearError());
42
- return function () {
43
- dispatch(resetOTPScreen());
44
- };
45
- }, [methods.formState.isValid]);
46
- var disabled = !methods.formState.isValid || !!error;
47
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsx(FormStyled, { children: _jsx(OTPInput, { loading: false }) }) })) }));
48
- };
49
- export default React.memo(Verify);
@@ -1,2 +0,0 @@
1
- import OTP from './Verify';
2
- export default OTP;
@@ -1,2 +0,0 @@
1
- import OTP from './Verify';
2
- export default OTP;
@@ -1,8 +0,0 @@
1
- import * as yup from 'yup';
2
- export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
- }>>>;
@@ -1,4 +0,0 @@
1
- import * as yup from 'yup';
2
- export var OTPValidation = yup.object().shape({
3
- otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
- });