@tap-payments/auth-jsconnect 1.0.3 → 1.0.6

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 (335) hide show
  1. package/build/@types/app.d.ts +74 -0
  2. package/build/@types/app.js +11 -1
  3. package/build/@types/theme.d.ts +12 -3
  4. package/build/@types/theme.js +15 -1
  5. package/build/app/rootReducer.d.ts +1 -1
  6. package/build/app/rootReducer.js +1 -1
  7. package/build/app/settings.d.ts +7 -2
  8. package/build/app/settings.js +36 -6
  9. package/build/app/store.d.ts +2 -2
  10. package/build/assets/locales/ar.json +70 -3
  11. package/build/assets/locales/en.json +69 -2
  12. package/build/components/AnimationFlow/BottomSheet.d.ts +3 -2
  13. package/build/components/AnimationFlow/BottomSheet.js +30 -3
  14. package/build/components/AnimationFlow/Dialog.d.ts +3 -2
  15. package/build/components/AnimationFlow/Dialog.js +26 -18
  16. package/build/components/Button/Button.d.ts +7 -3
  17. package/build/components/Button/Button.js +20 -2
  18. package/build/components/Collapse/Collapse.d.ts +5 -0
  19. package/build/components/Collapse/Collapse.js +28 -0
  20. package/build/components/Collapse/index.d.ts +3 -0
  21. package/build/components/Collapse/index.js +2 -0
  22. package/build/components/DatePicker/DatePicker.js +3 -3
  23. package/build/components/Footer/Footer.js +1 -1
  24. package/build/components/Input/Input.d.ts +4 -1
  25. package/build/components/Input/Input.js +7 -5
  26. package/build/components/Loader/Loader.d.ts +10 -8
  27. package/build/components/Loader/Loader.js +21 -41
  28. package/build/components/OTPField/OTPField.js +3 -23
  29. package/build/components/OTPTimer/OTPTimer.d.ts +4 -2
  30. package/build/components/OTPTimer/OTPTimer.js +20 -8
  31. package/build/components/Providers/ThemeProvider.js +6 -9
  32. package/build/components/SimpleList/SimpleList.d.ts +11 -3
  33. package/build/components/SimpleList/SimpleList.js +51 -22
  34. package/build/components/Slide/Slide.d.ts +6 -0
  35. package/build/components/Slide/Slide.js +30 -0
  36. package/build/components/Slide/index.d.ts +3 -0
  37. package/build/components/Slide/index.js +2 -0
  38. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +14 -0
  39. package/build/components/SocialMediaGroup/SocialMediaGroup.js +86 -0
  40. package/build/components/SocialMediaGroup/index.d.ts +3 -0
  41. package/build/components/SocialMediaGroup/index.js +2 -0
  42. package/build/components/ToggleButton/ToggleButton.d.ts +5 -0
  43. package/build/components/ToggleButton/ToggleButton.js +44 -0
  44. package/build/components/ToggleButton/index.d.ts +3 -0
  45. package/build/components/ToggleButton/index.js +2 -0
  46. package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +5 -0
  47. package/build/components/ToggleButtonGroup/ToggleButtonGroup.js +37 -0
  48. package/build/components/ToggleButtonGroup/index.d.ts +3 -0
  49. package/build/components/ToggleButtonGroup/index.js +2 -0
  50. package/build/components/Tooltip/Tooltip.d.ts +10 -0
  51. package/build/components/Tooltip/Tooltip.js +44 -0
  52. package/build/components/Tooltip/index.d.ts +3 -0
  53. package/build/components/Tooltip/index.js +2 -0
  54. package/build/components/Warning/Warning.d.ts +2 -1
  55. package/build/components/Warning/Warning.js +4 -19
  56. package/build/constants/app.d.ts +14 -4
  57. package/build/constants/app.js +145 -4
  58. package/build/constants/assets.d.ts +11 -0
  59. package/build/constants/assets.js +12 -1
  60. package/build/constants/dummy.d.ts +103 -0
  61. package/build/constants/dummy.js +219 -0
  62. package/build/constants/index.d.ts +1 -0
  63. package/build/constants/index.js +1 -0
  64. package/build/constants/validation.d.ts +6 -0
  65. package/build/constants/validation.js +6 -0
  66. package/build/features/app/{midStore.d.ts → business/midStore.d.ts} +2 -2
  67. package/build/features/app/{midStore.js → business/midStore.js} +0 -0
  68. package/build/features/app/connect/midStore.d.ts +10 -0
  69. package/build/features/app/connect/midStore.js +18 -0
  70. package/build/features/bank/Bank.d.ts +6 -0
  71. package/build/features/bank/Bank.js +48 -0
  72. package/build/features/bank/index.d.ts +1 -0
  73. package/build/features/bank/index.js +1 -0
  74. package/build/features/bank/screens/BankDetails/BankDetails.d.ts +5 -0
  75. package/build/features/bank/screens/BankDetails/BankDetails.js +57 -0
  76. package/build/features/bank/screens/BankDetails/BankName.d.ts +3 -0
  77. package/build/features/bank/screens/BankDetails/BankName.js +27 -0
  78. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +5 -0
  79. package/build/features/bank/screens/BankDetails/Beneficiary.js +34 -0
  80. package/build/features/bank/screens/BankDetails/IBAN.d.ts +5 -0
  81. package/build/features/bank/screens/BankDetails/IBAN.js +35 -0
  82. package/build/features/bank/screens/BankDetails/index.d.ts +3 -0
  83. package/build/features/bank/screens/BankDetails/index.js +2 -0
  84. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -0
  85. package/build/features/bank/screens/BankDetails/validation.js +9 -0
  86. package/build/features/business/Business.d.ts +6 -0
  87. package/build/features/business/Business.js +61 -0
  88. package/build/features/business/index.d.ts +1 -0
  89. package/build/features/business/index.js +1 -0
  90. package/build/features/business/screens/Activities/Activities.d.ts +5 -0
  91. package/build/features/business/screens/Activities/Activities.js +83 -0
  92. package/build/features/business/screens/Activities/ActivitiesList.d.ts +70 -0
  93. package/build/features/business/screens/Activities/ActivitiesList.js +136 -0
  94. package/build/features/business/screens/Activities/SalesChannels.d.ts +5 -0
  95. package/build/features/business/screens/Activities/SalesChannels.js +107 -0
  96. package/build/features/business/screens/Activities/index.d.ts +3 -0
  97. package/build/features/business/screens/Activities/index.js +2 -0
  98. package/build/features/business/screens/Activities/validation.d.ts +119 -0
  99. package/build/features/business/screens/Activities/validation.js +17 -0
  100. package/build/features/business/screens/BusinessType/BusinessType.d.ts +12 -0
  101. package/build/features/business/screens/BusinessType/BusinessType.js +85 -0
  102. package/build/features/business/screens/BusinessType/CRNumber.d.ts +6 -0
  103. package/build/features/business/screens/BusinessType/CRNumber.js +40 -0
  104. package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +11 -0
  105. package/build/features/business/screens/BusinessType/CompanyLicense.js +109 -0
  106. package/build/features/business/screens/BusinessType/FLNumber.d.ts +6 -0
  107. package/build/features/business/screens/BusinessType/FLNumber.js +40 -0
  108. package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +11 -0
  109. package/build/features/business/screens/BusinessType/FreelanceLicense.js +112 -0
  110. package/build/features/business/screens/BusinessType/SelectType.d.ts +8 -0
  111. package/build/features/business/screens/BusinessType/SelectType.js +106 -0
  112. package/build/features/business/screens/BusinessType/Switch.d.ts +7 -0
  113. package/build/features/business/screens/BusinessType/Switch.js +35 -0
  114. package/build/features/business/screens/BusinessType/index.d.ts +3 -0
  115. package/build/features/business/screens/BusinessType/index.js +2 -0
  116. package/build/features/business/screens/BusinessType/validation.d.ts +15 -0
  117. package/build/features/business/screens/BusinessType/validation.js +14 -0
  118. package/build/features/business/screens/Confirm/Confirm.d.ts +5 -0
  119. package/build/features/business/screens/Confirm/Confirm.js +53 -0
  120. package/build/features/business/screens/Confirm/index.d.ts +3 -0
  121. package/build/features/business/screens/Confirm/index.js +2 -0
  122. package/build/features/business/screens/Customers/CustomerLocations.d.ts +92 -0
  123. package/build/features/business/screens/Customers/CustomerLocations.js +122 -0
  124. package/build/features/business/screens/Customers/Customers.d.ts +5 -0
  125. package/build/features/business/screens/Customers/Customers.js +92 -0
  126. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +7 -0
  127. package/build/features/business/screens/Customers/ExpectedCustomers.js +78 -0
  128. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +7 -0
  129. package/build/features/business/screens/Customers/ExpectedSalesRange.js +74 -0
  130. package/build/features/business/screens/Customers/RefundPolicy.d.ts +44 -0
  131. package/build/features/business/screens/Customers/RefundPolicy.js +86 -0
  132. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +3 -0
  133. package/build/features/business/screens/Customers/TransactionPolicy.js +37 -0
  134. package/build/features/business/screens/Customers/index.d.ts +3 -0
  135. package/build/features/business/screens/Customers/index.js +2 -0
  136. package/build/features/business/screens/Customers/validation.d.ts +20 -0
  137. package/build/features/business/screens/Customers/validation.js +8 -0
  138. package/build/features/business/screens/IDBOD/DOB.d.ts +5 -0
  139. package/build/features/business/screens/IDBOD/DOB.js +44 -0
  140. package/build/features/business/screens/IDBOD/ID.d.ts +5 -0
  141. package/build/features/business/screens/IDBOD/ID.js +69 -0
  142. package/build/features/business/screens/IDBOD/IDBOD.d.ts +5 -0
  143. package/build/features/business/screens/IDBOD/IDBOD.js +85 -0
  144. package/build/features/business/screens/IDBOD/index.d.ts +3 -0
  145. package/build/features/business/screens/IDBOD/index.js +2 -0
  146. package/build/features/business/screens/IDBOD/validation.d.ts +11 -0
  147. package/build/features/business/screens/IDBOD/validation.js +5 -0
  148. package/build/features/business/screens/OTP/OTP.d.ts +11 -0
  149. package/build/features/business/screens/OTP/OTP.js +112 -0
  150. package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
  151. package/build/features/business/screens/OTP/OTPInput.js +51 -0
  152. package/build/features/business/screens/OTP/OTPTimer.d.ts +5 -0
  153. package/build/features/business/screens/OTP/OTPTimer.js +20 -0
  154. package/build/features/business/screens/OTP/index.d.ts +3 -0
  155. package/build/features/business/screens/OTP/index.js +2 -0
  156. package/build/features/business/screens/OTP/validation.d.ts +8 -0
  157. package/build/features/business/screens/OTP/validation.js +4 -0
  158. package/build/features/business/screens/Success/Success.d.ts +5 -0
  159. package/build/features/business/screens/Success/Success.js +15 -0
  160. package/build/features/business/screens/Success/index.d.ts +3 -0
  161. package/build/features/business/screens/Success/index.js +2 -0
  162. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +6 -0
  163. package/build/features/business/screens/VerifyNumber/OTPInput.js +68 -0
  164. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +5 -0
  165. package/build/features/business/screens/VerifyNumber/OTPTimer.js +20 -0
  166. package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +13 -0
  167. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +119 -0
  168. package/build/features/business/screens/VerifyNumber/index.d.ts +3 -0
  169. package/build/features/business/screens/VerifyNumber/index.js +2 -0
  170. package/build/features/business/screens/VerifyNumber/validation.d.ts +8 -0
  171. package/build/features/business/screens/VerifyNumber/validation.js +4 -0
  172. package/build/features/connect/Connect.js +20 -22
  173. package/build/features/connect/screens/Individual/Email.d.ts +5 -0
  174. package/build/features/connect/screens/Individual/Email.js +31 -0
  175. package/build/features/connect/screens/Individual/Individual.d.ts +5 -0
  176. package/build/features/connect/screens/Individual/Individual.js +77 -0
  177. package/build/features/connect/screens/Individual/Name.d.ts +5 -0
  178. package/build/features/connect/screens/Individual/Name.js +31 -0
  179. package/build/features/connect/screens/Individual/index.d.ts +3 -0
  180. package/build/features/connect/screens/Individual/index.js +2 -0
  181. package/build/features/connect/screens/Individual/validation.d.ts +11 -0
  182. package/build/features/connect/screens/Individual/validation.js +5 -0
  183. package/build/features/connect/screens/MID/BusinessCountry.d.ts +2 -6
  184. package/build/features/connect/screens/MID/BusinessCountry.js +20 -79
  185. package/build/features/connect/screens/MID/IDNumber.d.ts +0 -4
  186. package/build/features/connect/screens/MID/IDNumber.js +24 -36
  187. package/build/features/connect/screens/MID/MID.js +41 -24
  188. package/build/features/connect/screens/MID/MIDTitle.js +2 -2
  189. package/build/features/connect/screens/MID/MobileNumber.d.ts +2 -7
  190. package/build/features/connect/screens/MID/MobileNumber.js +40 -84
  191. package/build/features/connect/screens/MID/validation.d.ts +18 -0
  192. package/build/features/connect/screens/MID/validation.js +8 -0
  193. package/build/features/connect/screens/Merchant/BrandName.d.ts +5 -0
  194. package/build/features/connect/screens/Merchant/BrandName.js +73 -0
  195. package/build/features/connect/screens/Merchant/Merchant.d.ts +5 -0
  196. package/build/features/connect/screens/Merchant/Merchant.js +50 -0
  197. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +5 -0
  198. package/build/features/connect/screens/Merchant/SocialMedia.js +79 -0
  199. package/build/features/connect/screens/Merchant/TAC.d.ts +5 -0
  200. package/build/features/connect/screens/Merchant/TAC.js +79 -0
  201. package/build/features/connect/screens/Merchant/index.d.ts +3 -0
  202. package/build/features/connect/screens/Merchant/index.js +2 -0
  203. package/build/features/connect/screens/Merchant/validation.d.ts +50 -0
  204. package/build/features/connect/screens/Merchant/validation.js +23 -0
  205. package/build/features/connect/screens/OTP/OTP.d.ts +6 -2
  206. package/build/features/connect/screens/OTP/OTP.js +41 -46
  207. package/build/features/connect/screens/OTP/OTPInput.d.ts +5 -0
  208. package/build/features/connect/screens/OTP/OTPInput.js +38 -0
  209. package/build/features/connect/screens/OTP/validation.d.ts +8 -0
  210. package/build/features/connect/screens/OTP/validation.js +4 -0
  211. package/build/features/connect/screens/Password/Password.d.ts +5 -0
  212. package/build/features/connect/screens/Password/Password.js +49 -0
  213. package/build/features/connect/screens/Password/PasswordInput.d.ts +5 -0
  214. package/build/features/connect/screens/Password/PasswordInput.js +38 -0
  215. package/build/features/connect/screens/Password/index.d.ts +3 -0
  216. package/build/features/connect/screens/Password/index.js +2 -0
  217. package/build/features/connect/screens/Password/validation.d.ts +8 -0
  218. package/build/features/connect/screens/Password/validation.js +4 -0
  219. package/build/features/connect/screens/ThankYou/ThankYou.d.ts +5 -0
  220. package/build/features/connect/screens/ThankYou/ThankYou.js +15 -0
  221. package/build/features/connect/screens/ThankYou/index.d.ts +3 -0
  222. package/build/features/connect/screens/ThankYou/index.js +2 -0
  223. package/build/features/featuresScreens.d.ts +7 -0
  224. package/build/features/featuresScreens.js +99 -0
  225. package/build/features/owner/Owner.d.ts +6 -0
  226. package/build/features/owner/Owner.js +50 -0
  227. package/build/features/owner/index.d.ts +1 -0
  228. package/build/features/owner/index.js +1 -0
  229. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +19 -0
  230. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +52 -0
  231. package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +3 -0
  232. package/build/features/owner/screens/ShowOwnerInfo/index.js +2 -0
  233. package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +7 -0
  234. package/build/features/owner/screens/ShowOwnerInfo/info.js +28 -0
  235. package/build/features/password/Password.d.ts +6 -0
  236. package/build/features/password/Password.js +50 -0
  237. package/build/features/password/index.d.ts +1 -0
  238. package/build/features/password/index.js +1 -0
  239. package/build/features/password/screens/CreatePassword/ConditionText.d.ts +7 -0
  240. package/build/features/password/screens/CreatePassword/ConditionText.js +23 -0
  241. package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +5 -0
  242. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +27 -0
  243. package/build/features/password/screens/CreatePassword/CreatePassword.d.ts +5 -0
  244. package/build/features/password/screens/CreatePassword/CreatePassword.js +51 -0
  245. package/build/features/password/screens/CreatePassword/Password.d.ts +5 -0
  246. package/build/features/password/screens/CreatePassword/Password.js +75 -0
  247. package/build/features/password/screens/CreatePassword/PasswordBar.d.ts +7 -0
  248. package/build/features/password/screens/CreatePassword/PasswordBar.js +29 -0
  249. package/build/features/password/screens/CreatePassword/index.d.ts +3 -0
  250. package/build/features/password/screens/CreatePassword/index.js +2 -0
  251. package/build/features/password/screens/CreatePassword/validation.d.ts +11 -0
  252. package/build/features/password/screens/CreatePassword/validation.js +8 -0
  253. package/build/features/shared/Button/Button.d.ts +8 -0
  254. package/build/features/shared/Button/Button.js +49 -0
  255. package/build/features/shared/Button/index.d.ts +2 -0
  256. package/build/features/shared/Button/index.js +2 -0
  257. package/build/features/shared/CheckIcon/CheckIcon.d.ts +2 -0
  258. package/build/features/shared/CheckIcon/CheckIcon.js +14 -0
  259. package/build/features/shared/CheckIcon/index.d.ts +2 -0
  260. package/build/features/shared/CheckIcon/index.js +2 -0
  261. package/build/features/shared/ClearIcon/ClearIcon.d.ts +6 -0
  262. package/build/features/shared/ClearIcon/ClearIcon.js +26 -0
  263. package/build/features/shared/ClearIcon/index.d.ts +2 -0
  264. package/build/features/shared/ClearIcon/index.js +2 -0
  265. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -0
  266. package/build/features/shared/Containers/FeatureContainer.js +33 -0
  267. package/build/features/shared/Containers/ScreenContainer.d.ts +4 -0
  268. package/build/features/shared/Containers/ScreenContainer.js +28 -0
  269. package/build/features/shared/Containers/index.d.ts +3 -0
  270. package/build/features/shared/Containers/index.js +3 -0
  271. package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +7 -0
  272. package/build/features/shared/ExpandIcon/ExpandIcon.js +24 -0
  273. package/build/features/shared/ExpandIcon/index.d.ts +2 -0
  274. package/build/features/shared/ExpandIcon/index.js +2 -0
  275. package/build/features/shared/Footer/Footer.d.ts +2 -0
  276. package/build/features/shared/Footer/Footer.js +16 -0
  277. package/build/features/shared/Footer/index.d.ts +2 -0
  278. package/build/features/shared/Footer/index.js +2 -0
  279. package/build/features/shared/Input/Input.d.ts +27 -0
  280. package/build/features/shared/Input/Input.js +59 -0
  281. package/build/features/shared/Input/index.d.ts +2 -0
  282. package/build/features/shared/Input/index.js +2 -0
  283. package/build/features/shared/OTP/OTP.d.ts +9 -0
  284. package/build/features/shared/OTP/OTP.js +85 -0
  285. package/build/features/shared/OTP/index.d.ts +2 -0
  286. package/build/features/shared/OTP/index.js +2 -0
  287. package/build/features/shared/PasswordIcon/PasswordIcon.d.ts +8 -0
  288. package/build/features/shared/PasswordIcon/PasswordIcon.js +37 -0
  289. package/build/features/shared/PasswordIcon/index.d.ts +2 -0
  290. package/build/features/shared/PasswordIcon/index.js +2 -0
  291. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +7 -0
  292. package/build/features/shared/SuccessScreen/SuccessScreen.js +54 -0
  293. package/build/features/shared/SuccessScreen/index.d.ts +2 -0
  294. package/build/features/shared/SuccessScreen/index.js +2 -0
  295. package/build/features/tax/Tax.d.ts +6 -0
  296. package/build/features/tax/Tax.js +50 -0
  297. package/build/features/tax/index.d.ts +1 -0
  298. package/build/features/tax/index.js +1 -0
  299. package/build/features/tax/screens/TaxDetails/TaxDetails.d.ts +5 -0
  300. package/build/features/tax/screens/TaxDetails/TaxDetails.js +45 -0
  301. package/build/features/tax/screens/TaxDetails/VATId.d.ts +3 -0
  302. package/build/features/tax/screens/TaxDetails/VATId.js +27 -0
  303. package/build/features/tax/screens/TaxDetails/index.d.ts +3 -0
  304. package/build/features/tax/screens/TaxDetails/index.js +2 -0
  305. package/build/features/tax/screens/TaxDetails/validation.d.ts +8 -0
  306. package/build/features/tax/screens/TaxDetails/validation.js +4 -0
  307. package/build/hooks/index.d.ts +5 -0
  308. package/build/hooks/index.js +5 -0
  309. package/build/hooks/useAppDispatch.d.ts +4 -0
  310. package/build/hooks/useAppDispatch.js +2 -0
  311. package/build/hooks/useAppSelector.d.ts +3 -0
  312. package/build/hooks/useAppSelector.js +2 -0
  313. package/build/hooks/useAppTheme.js +3 -2
  314. package/build/hooks/useContainerDimensions.d.ts +4 -0
  315. package/build/hooks/useContainerDimensions.js +21 -0
  316. package/build/hooks/useEventListener.d.ts +5 -0
  317. package/build/hooks/useEventListener.js +20 -0
  318. package/build/hooks/useLanguage.d.ts +4 -0
  319. package/build/hooks/useLanguage.js +8 -0
  320. package/build/index.css +6 -1
  321. package/build/index.d.ts +7 -2
  322. package/build/index.js +17 -2
  323. package/build/theme/palette.js +11 -4
  324. package/build/theme/theme.d.ts +1 -1
  325. package/build/theme/theme.js +0 -1
  326. package/build/theme/typography.js +2 -2
  327. package/build/utils/array.d.ts +3 -1
  328. package/build/utils/array.js +7 -3
  329. package/build/utils/string.d.ts +3 -1
  330. package/build/utils/string.js +11 -2
  331. package/build/utils/validation.d.ts +10 -0
  332. package/build/utils/validation.js +30 -0
  333. package/package.json +120 -112
  334. package/build/app/hooks.d.ts +0 -7
  335. package/build/app/hooks.js +0 -3
@@ -0,0 +1,119 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box/Box';
14
+ import { styled } from '@mui/material/styles';
15
+ import * as React from 'react';
16
+ import { useTranslation } from 'react-i18next';
17
+ import Text from '../../../../components/Text';
18
+ import OTPTimer from './OTPTimer';
19
+ import Icon from '../../../../components/Icon';
20
+ import Button from '../../../../components/Button';
21
+ import Loader from '../../../../components/Loader';
22
+ import { ICONS_NAMES } from '../../../../constants/assets';
23
+ import { useAppDispatch } from '../../../../hooks';
24
+ import { handleNextScreenStep } from '../../../../app/settings';
25
+ import { useLanguage } from '../../../../hooks';
26
+ import { useForm, FormProvider } from 'react-hook-form';
27
+ import { yupResolver } from '@hookform/resolvers/yup';
28
+ import Form from '../../../../components/Form';
29
+ import { maskPhone } from '../../../../utils';
30
+ import { OTPValidation } from './validation';
31
+ import OTPInput from './OTPInput';
32
+ var BoxStyled = styled(Box)(function (_a) {
33
+ var theme = _a.theme;
34
+ return ({
35
+ display: 'flex',
36
+ flexDirection: 'column',
37
+ overflow: 'hidden',
38
+ direction: theme.direction
39
+ });
40
+ });
41
+ var InputsContainerStyled = styled(Box)(function (_a) {
42
+ var theme = _a.theme;
43
+ return ({
44
+ paddingBottom: theme.spacing(3.75)
45
+ });
46
+ });
47
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
48
+ var _b;
49
+ var theme = _a.theme;
50
+ return (_b = {
51
+ background: theme.palette.common.white,
52
+ border: '1px solid',
53
+ borderColor: theme.palette.divider,
54
+ direction: theme.direction,
55
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25)
56
+ },
57
+ _b[theme.breakpoints.up('sm')] = {
58
+ marginBottom: theme.spacing(6)
59
+ },
60
+ _b);
61
+ });
62
+ var OTPTitleStyled = styled(Text)(function (_a) {
63
+ var theme = _a.theme;
64
+ return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
65
+ });
66
+ var LoaderStyled = styled(Loader)(function (_a) {
67
+ var theme = _a.theme;
68
+ return ({
69
+ marginInlineStart: theme.spacing(-6.25),
70
+ '& .loader-box-container': {
71
+ marginInlineStart: theme.spacing(2.5)
72
+ }
73
+ });
74
+ });
75
+ var FormStyled = styled(Form)(function () { return ({
76
+ display: 'flex',
77
+ flexDirection: 'column'
78
+ }); });
79
+ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
80
+ var theme = _a.theme, isAr = _a.isAr;
81
+ return ({
82
+ width: theme.spacing(3),
83
+ height: theme.spacing(3),
84
+ paddingInlineStart: theme.spacing(1.5),
85
+ paddingInlineEnd: theme.spacing(0.5),
86
+ transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
87
+ });
88
+ });
89
+ var ButtonContainer = styled(Box)(function (_a) {
90
+ var theme = _a.theme;
91
+ return ({
92
+ margin: theme.spacing(2.5)
93
+ });
94
+ });
95
+ var VerifyNumber = function (_a) {
96
+ var phone = _a.phone, code = _a.code;
97
+ var dispatch = useAppDispatch();
98
+ var methods = useForm({
99
+ resolver: yupResolver(OTPValidation),
100
+ defaultValues: {
101
+ otp: ''
102
+ },
103
+ mode: 'onChange'
104
+ });
105
+ var t = useTranslation().t;
106
+ var isAr = useLanguage().isAr;
107
+ var onSubmit = function (data) {
108
+ console.log('data', data);
109
+ if (data.otp === '123456')
110
+ return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
111
+ dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
112
+ };
113
+ return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('service_otp_send_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {})] }), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
114
+ };
115
+ VerifyNumber.defaultProps = {
116
+ phone: '8940298292',
117
+ code: '+91'
118
+ };
119
+ export default React.memo(VerifyNumber);
@@ -0,0 +1,3 @@
1
+ import OTP, { OTPProps } from './VerifyNumber';
2
+ export type { OTPProps };
3
+ export default OTP;
@@ -0,0 +1,2 @@
1
+ import OTP from './VerifyNumber';
2
+ export default OTP;
@@ -0,0 +1,8 @@
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
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var OTPValidation = yup.object().shape({
3
+ otp: yup.string().min(6).required('OTP is required')
4
+ });
@@ -10,34 +10,32 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo } from 'react';
14
- import { useTranslation } from 'react-i18next';
15
- import { styled } from '@mui/material/styles';
16
- import Box from '@mui/material/Box';
17
- import { useAppTheme } from '../../hooks';
13
+ import React, { memo, useEffect } from 'react';
14
+ import { FeatureContainer } from '../shared/Containers';
15
+ import { useAppTheme, useAppDispatch, useAppSelector } from '../../hooks';
16
+ import { handleActiveFlowScreens, settingsSelector } from '../../app/settings';
18
17
  import AnimationFlow from '../../components/AnimationFlow';
19
18
  import { store } from '../../app/store';
20
19
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
20
+ import Collapse from '../../components/Collapse';
21
21
  import { reactElement } from '../../utils';
22
- import MID from './screens/MID';
23
- import Footer from '../../components/Footer';
24
- var Container = styled(Box)(function () { return ({
25
- width: '100%'
26
- }); });
27
- var FooterStyled = styled(Footer)(function (_a) {
28
- var theme = _a.theme;
29
- return ({
30
- position: 'relative',
31
- bottom: 0,
32
- marginBottom: theme.spacing(-3.75)
33
- });
34
- });
22
+ import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
23
+ import { connectFeatureScreens } from '../featuresScreens';
24
+ import CustomFooter from '../shared/Footer';
35
25
  var Connect = memo(function (props) {
36
- var theme = useAppTheme().theme;
37
- var t = useTranslation().t;
38
26
  var open = React.useState(true)[0];
39
- console.log('connect config', props);
40
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(FooterStyled, { onSwitchLanguage: function () { }, followUsTitle: t('follow_us'), language: t('language') }) }, { children: _jsx(Container, { children: _jsx(MID, {}) }) })) })));
27
+ var theme = useAppTheme().theme;
28
+ var dispatch = useAppDispatch();
29
+ var data = useAppSelector(settingsSelector).data;
30
+ var activeScreen = data.activeScreen;
31
+ useEffect(function () {
32
+ dispatch(handleActiveFlowScreens(CONNECT_SCREENS_NAVIGATION));
33
+ }, []);
34
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
35
+ var Element = _a.element, name = _a.name;
36
+ var isActive = activeScreen.name === name;
37
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 600, exit: 400, appear: 600 } }, { children: _jsx(Element, {}) }), index));
38
+ }) }) })) })));
41
39
  });
42
40
  export function ConnectLib(props) {
43
41
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Connect, __assign({}, props)) })));
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface EmailProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: EmailProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,31 @@
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 { useTranslation } from 'react-i18next';
15
+ import { ScreenContainer } from '../../../shared/Containers';
16
+ import Input from '../../../shared/Input';
17
+ import { keepEmailCharacters } from '../../../../utils';
18
+ import { useController, useFormContext } from 'react-hook-form';
19
+ var Email = function (_a) {
20
+ var _b;
21
+ var t = useTranslation().t;
22
+ var control = useFormContext().control;
23
+ var emailControl = useController({ name: 'email', control: control });
24
+ var handleEmailChange = function (event) {
25
+ var value = keepEmailCharacters(event.target.value);
26
+ emailControl.field.onChange(value);
27
+ };
28
+ var emailValue = emailControl.field.value;
29
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_enter_email'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signin_email_placeholder'), warningType: 'alert', warningMessage: (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
30
+ };
31
+ export default React.memo(Email);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface IndividualProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: IndividualProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,77 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box/Box';
14
+ import { styled } from '@mui/material/styles';
15
+ import Email from './Email';
16
+ import Name from './Name';
17
+ import * as React from 'react';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { useForm, FormProvider } from 'react-hook-form';
20
+ import { yupResolver } from '@hookform/resolvers/yup';
21
+ import Icon from '../../../../components/Icon';
22
+ import { useAppDispatch } from '../../../../hooks';
23
+ import { handleNextScreenStep } from '../../../../app/settings';
24
+ import { IndividualValidation } from './validation';
25
+ import Form from '../../../../components/Form';
26
+ import Button from '../../../shared/Button';
27
+ import { ScreenContainer } from '../../../shared/Containers';
28
+ import Loader from '../../../../components/Loader';
29
+ import { useLanguage } from '../../../../hooks';
30
+ var FormStyled = styled(Form)(function () { return ({
31
+ display: 'flex',
32
+ flexDirection: 'column'
33
+ }); });
34
+ var ButtonContainer = styled(Box)(function (_a) {
35
+ var theme = _a.theme;
36
+ return ({
37
+ margin: theme.spacing(5, 2.5, 0, 2.5)
38
+ });
39
+ });
40
+ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
41
+ var theme = _a.theme, isAr = _a.isAr;
42
+ return ({
43
+ width: theme.spacing(3),
44
+ height: theme.spacing(3),
45
+ paddingInlineStart: theme.spacing(1.5),
46
+ paddingInlineEnd: theme.spacing(0.5),
47
+ transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
48
+ });
49
+ });
50
+ var LoaderStyled = styled(Loader)(function (_a) {
51
+ var theme = _a.theme;
52
+ return ({
53
+ marginInlineStart: theme.spacing(-6.25),
54
+ '& .loader-box-container': {
55
+ marginInlineStart: theme.spacing(2.5)
56
+ }
57
+ });
58
+ });
59
+ var Individual = function (_a) {
60
+ var dispatch = useAppDispatch();
61
+ var methods = useForm({
62
+ resolver: yupResolver(IndividualValidation),
63
+ defaultValues: {
64
+ name: '',
65
+ email: ''
66
+ },
67
+ mode: 'onChange'
68
+ });
69
+ var onSubmit = function (data) {
70
+ console.log('data', data);
71
+ dispatch(handleNextScreenStep());
72
+ };
73
+ var t = useTranslation().t;
74
+ var isAr = useLanguage().isAr;
75
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, {}), _jsx(Email, {}), _jsx(Button, __assign({ isAr: isAr, loading: false, disabled: !methods.formState.isValid }, { children: t('next') }))] })) })) }));
76
+ };
77
+ export default React.memo(Individual);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface NameProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: NameProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,31 @@
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 { useTranslation } from 'react-i18next';
15
+ import { ScreenContainer } from '../../../shared/Containers';
16
+ import Input from '../../../shared/Input';
17
+ import { removeAllNumberFromChars } from '../../../../utils';
18
+ import { useController, useFormContext } from 'react-hook-form';
19
+ var Name = function (_a) {
20
+ var _b;
21
+ var t = useTranslation().t;
22
+ var control = useFormContext().control;
23
+ var nameControl = useController({ name: 'name', control: control });
24
+ var handleNameChange = function (event) {
25
+ var value = removeAllNumberFromChars(event.target.value);
26
+ nameControl.field.onChange(value);
27
+ };
28
+ var nameValue = nameControl.field.value;
29
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
30
+ };
31
+ export default React.memo(Name);
@@ -0,0 +1,3 @@
1
+ import Individual, { IndividualProps } from './Individual';
2
+ export type { IndividualProps };
3
+ export default Individual;
@@ -0,0 +1,2 @@
1
+ import Individual from './Individual';
2
+ export default Individual;
@@ -0,0 +1,11 @@
1
+ import * as yup from 'yup';
2
+ export declare const IndividualValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
+ email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
+ }>>>;
@@ -0,0 +1,5 @@
1
+ import * as yup from 'yup';
2
+ export var IndividualValidation = yup.object().shape({
3
+ name: yup.string().min(3).required('Name is required'),
4
+ email: yup.string().email().required('Email is required')
5
+ });
@@ -1,14 +1,10 @@
1
1
  import * as React from 'react';
2
- import { Control } from 'react-hook-form';
3
2
  import { CountryCode } from '../../../../@types';
4
3
  interface BusinessCountryProps {
5
4
  countries: Array<CountryCode>;
6
5
  show: boolean;
7
- onSelect?: (country: CountryCode) => void;
8
- defaultCountry?: CountryCode;
9
- onOpenBusinessCountryList?: () => void;
10
- onCloseBusinessCountryList?: () => void;
11
- control?: Control<any, any>;
6
+ onListOpen?: () => void;
7
+ onListClose?: () => void;
12
8
  }
13
9
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BusinessCountryProps & React.RefAttributes<unknown>>>;
14
10
  export default _default;
@@ -23,45 +23,18 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import * as React from 'react';
25
25
  import Box from '@mui/material/Box';
26
- import { alpha, styled } from '@mui/material/styles';
26
+ import { styled } from '@mui/material/styles';
27
27
  import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
28
29
  import Text from '../../../../components/Text';
29
- import Collapse from '@mui/material/Collapse';
30
+ import Collapse from '../../../../components/Collapse';
30
31
  import CheckIcon from '@mui/icons-material/Check';
31
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
32
+ import ScreenContainer from '../../../../features/shared/Containers/ScreenContainer';
32
33
  import Icon from '../../../../components/Icon';
33
- import Input from '../../../../components/Input';
34
+ import Input from '../../../../features/shared/Input';
35
+ import ExpandIcon from '../../../../features/shared/ExpandIcon';
34
36
  import SimpleList from '../../../../components/SimpleList';
35
- import { LANGUAGE_MODE } from '../../../../constants';
36
- var InputStyled = styled(Input)(function (_a) {
37
- var theme = _a.theme;
38
- return ({
39
- padding: theme.spacing(0, 2.5, 0, 2.5),
40
- '& .MuiInputBase-input': {
41
- cursor: 'pointer'
42
- }
43
- });
44
- });
45
- var BoxStyled = styled(Box)(function (_a) {
46
- var theme = _a.theme;
47
- return ({
48
- display: 'flex',
49
- flexDirection: 'column',
50
- padding: theme.spacing(0, 0, 2.5, 0)
51
- });
52
- });
53
- var LabelContainerStyled = styled(Box)(function (_a) {
54
- var theme = _a.theme;
55
- return ({
56
- display: 'flex',
57
- justifyContent: 'space-between',
58
- padding: theme.spacing(0, 2, 1, 2.5)
59
- });
60
- });
61
- var InputLabelStyled = styled(Text)(function (_a) {
62
- var theme = _a.theme;
63
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { paddingBottom: theme.spacing(0.6) }));
64
- });
37
+ import { useLanguage } from '../../../../hooks';
65
38
  var CountryItemContainer = styled(Box)(function () { return ({
66
39
  display: 'flex'
67
40
  }); });
@@ -88,64 +61,32 @@ var CountryIconStyled = styled(Icon)(function (_a) {
88
61
  verticalAlign: 'middle'
89
62
  });
90
63
  });
91
- var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
92
- var _b;
93
- var theme = _a.theme, anchorEl = _a.anchorEl;
94
- return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', transform: !!anchorEl ? 'rotate(180deg)' : '' }, _b[theme.transitions.create(['transform'])] = {
95
- duration: theme.transitions.duration.standard
96
- }, _b)));
97
- });
98
64
  var BusinessCountry = React.forwardRef(function (_a, ref) {
99
65
  var _b, _c;
100
- var countries = _a.countries, onSelect = _a.onSelect, defaultCountry = _a.defaultCountry, rest = __rest(_a, ["countries", "onSelect", "defaultCountry"]);
101
- var _d = React.useState([]), businessCountries = _d[0], setBusinessCountries = _d[1];
102
- var _e = React.useState(), selected = _e[0], setSelected = _e[1];
103
- var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
104
- var _g = useTranslation(), t = _g.t, i18n = _g.i18n;
105
- var isAR = i18n.language === LANGUAGE_MODE.AR;
106
- React.useEffect(function () {
107
- setBusinessCountries(countries);
108
- }, []);
109
- React.useEffect(function () {
110
- if (defaultCountry)
111
- setSelected(defaultCountry);
112
- }, [defaultCountry]);
113
- var onCountrySearch = function (e) {
114
- if (e === null || e === void 0 ? void 0 : e.code) {
115
- var searchList = getCountrySearch(businessCountries, e.code);
116
- if (searchList.length === 0 || e.code === 'Backspace')
117
- setBusinessCountries(businessCountries);
118
- else
119
- setBusinessCountries(searchList);
120
- }
121
- };
122
- var getCountrySearch = function (originalList, searchKey) {
123
- var _a;
124
- return (_a = (originalList || [])) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
125
- return item.name.english.charAt(0).toLowerCase() === searchKey.charAt(searchKey.length - 1).toLowerCase();
126
- });
127
- };
66
+ var countries = _a.countries, rest = __rest(_a, ["countries"]);
67
+ var businessCountries = React.useState(countries)[0];
68
+ var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
69
+ var t = useTranslation().t;
70
+ var isAr = useLanguage().isAr;
71
+ var control = useFormContext().control;
72
+ var businessCountryControl = useController({ control: control, name: 'businessCountry' });
128
73
  var onOpenCountrySelect = function (event) {
129
74
  var _a;
130
75
  setAnchorEl(event.currentTarget);
131
- document.addEventListener('keydown', onCountrySearch, true);
132
- setBusinessCountries(countries);
133
- (_a = rest.onOpenBusinessCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
76
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
134
77
  };
135
78
  var onCloseCountrySelect = function () {
136
79
  var _a;
137
80
  setAnchorEl(null);
138
- document.removeEventListener('keydown', onCountrySearch, true);
139
- setBusinessCountries(countries);
140
- (_a = rest.onCloseBusinessCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
81
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
141
82
  };
142
83
  var onSelectItem = function (country) {
143
- setSelected(country);
144
- onSelect && onSelect(country);
145
84
  onCloseCountrySelect();
85
+ businessCountryControl.field.onChange(country);
146
86
  };
147
- return (_jsx(Collapse, __assign({ in: rest.show, unmountOnExit: true, timeout: 500 }, { children: _jsxs(BoxStyled, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('business_country_label') }) }), _jsx(InputStyled, { readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (selected === null || selected === void 0 ? void 0 : selected.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: anchorEl }), placeholder: 'business_country_placeholder', value: (isAR ? (_b = selected === null || selected === void 0 ? void 0 : selected.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = selected === null || selected === void 0 ? void 0 : selected.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl, unmountOnExit: true, timeout: 300 }, { children: _jsx(SimpleList, { list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
148
- return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsx(CountryIconStyled, { src: item.logo, alt: item.iso3 }), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (selected === null || selected === void 0 ? void 0 : selected.idd_prefix) }, { children: isAR ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (selected === null || selected === void 0 ? void 0 : selected.idd_prefix) && _jsx(CheckIconStyled, {})] }));
87
+ var businessCountry = businessCountryControl.field.value;
88
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: [_jsx(Input, { label: t('business_country_label'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('business_country_placeholder'), value: (isAr ? (_b = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
89
+ return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsx(CountryIconStyled, { src: item.logo, alt: item.iso3 }), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) && _jsx(CheckIconStyled, {})] }));
149
90
  } }) }))] })) })));
150
91
  });
151
92
  export default React.memo(BusinessCountry);
@@ -1,11 +1,7 @@
1
1
  import * as React from 'react';
2
- import { Control } from 'react-hook-form';
3
2
  interface IDNumberProps {
4
3
  show: boolean;
5
4
  onSwitchToMobileNumber?: () => void;
6
- onIdChange?: (id: string) => void;
7
- onBirthDateChange?: (data: string) => void;
8
- control?: Control<any, any>;
9
5
  }
10
6
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IDNumberProps & React.RefAttributes<unknown>>>;
11
7
  export default _default;