@tap-payments/auth-jsconnect 1.0.4 → 1.0.7

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 -116
  334. package/build/app/hooks.d.ts +0 -7
  335. package/build/app/hooks.js +0 -3
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface ActivitiesProps {
3
+ }
4
+ declare const Activities: () => JSX.Element;
5
+ export default Activities;
@@ -0,0 +1,83 @@
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';
14
+ import { styled } from '@mui/material/styles';
15
+ import ActivitiesList from './ActivitiesList';
16
+ import { useForm, FormProvider } from 'react-hook-form';
17
+ import { useAppDispatch, useLanguage } from '../../../../hooks';
18
+ import Form from '../../../../components/Form';
19
+ import { yupResolver } from '@hookform/resolvers/yup';
20
+ import { useTranslation } from 'react-i18next';
21
+ import { ActivitiesValidationSchema } from './validation';
22
+ import { handleNextScreenStep } from '../../../../app/settings';
23
+ import { ACTIVITIES, ICONS_NAMES, SALES_CHANNELS } from '../../../../constants';
24
+ import Button from '../../../../components/Button';
25
+ import Loader from '../../../../components/Loader';
26
+ import Icon from '../../../../components/Icon';
27
+ import SalesChannels from './SalesChannels';
28
+ var BoxStyled = styled(Box)(function (_a) {
29
+ var theme = _a.theme;
30
+ return ({
31
+ display: 'flex',
32
+ flexDirection: 'column',
33
+ direction: theme.direction
34
+ });
35
+ });
36
+ var FormStyled = styled(Form)(function () { return ({
37
+ display: 'flex',
38
+ flexDirection: 'column'
39
+ }); });
40
+ var ButtonContainer = styled(Box)(function (_a) {
41
+ var theme = _a.theme;
42
+ return ({
43
+ margin: theme.spacing(5, 2.5, 2.5, 2.5)
44
+ });
45
+ });
46
+ var LoaderStyled = styled(Loader)(function (_a) {
47
+ var theme = _a.theme;
48
+ return ({
49
+ marginInlineStart: theme.spacing(-6.25),
50
+ '& .loader-box-container': {
51
+ marginInlineStart: theme.spacing(2.5)
52
+ }
53
+ });
54
+ });
55
+ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
56
+ var theme = _a.theme, isAr = _a.isAr;
57
+ return ({
58
+ width: theme.spacing(3),
59
+ height: theme.spacing(3),
60
+ paddingInlineStart: theme.spacing(1.5),
61
+ paddingInlineEnd: theme.spacing(0.5),
62
+ transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
63
+ });
64
+ });
65
+ var Activities = function () {
66
+ var dispatch = useAppDispatch();
67
+ var isAr = useLanguage().isAr;
68
+ var t = useTranslation().t;
69
+ var methods = useForm({
70
+ resolver: yupResolver(ActivitiesValidationSchema),
71
+ defaultValues: {
72
+ activities: [ACTIVITIES[0]],
73
+ salesChannels: [SALES_CHANNELS[0]]
74
+ },
75
+ mode: 'onChange'
76
+ });
77
+ var onSubmit = function (data) {
78
+ console.log('data', data);
79
+ dispatch(handleNextScreenStep());
80
+ };
81
+ return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [!!ACTIVITIES && _jsx(ActivitiesList, {}), _jsx(SalesChannels, {}), _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') })) })] })) })) }));
82
+ };
83
+ export default Activities;
@@ -0,0 +1,70 @@
1
+ import * as React from 'react';
2
+ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
4
+ children?: React.ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
11
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
15
+ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick<import("../../../../components/Input").InputProps, "type" | "className" | "style" | "classes" | "color" | "margin" | "translate" | "slot" | "title" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "size" | "disabled" | "error" | "name" | "components" | "componentsProps" | "value" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
16
+ placeholder?: string | undefined;
17
+ hide?: boolean | undefined;
18
+ warningType?: "alert" | "error" | undefined;
19
+ } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
20
+ export declare const ExpandIcon: import("@emotion/styled").StyledComponent<{
21
+ children?: React.ReactNode;
22
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
23
+ color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
24
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
25
+ htmlColor?: string | undefined;
26
+ inheritViewBox?: boolean | undefined;
27
+ shapeRendering?: string | undefined;
28
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
29
+ titleAccess?: string | undefined;
30
+ viewBox?: string | undefined;
31
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "name" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
32
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
33
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
34
+ anchorEl: HTMLElement | null;
35
+ }, {}, {}>;
36
+ export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
37
+ children?: React.ReactNode;
38
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
39
+ color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
40
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
41
+ htmlColor?: string | undefined;
42
+ inheritViewBox?: boolean | undefined;
43
+ shapeRendering?: string | undefined;
44
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
45
+ titleAccess?: string | undefined;
46
+ viewBox?: string | undefined;
47
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "name" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
48
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
49
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
50
+ export declare const NameContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
51
+ align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
52
+ children?: React.ReactNode;
53
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
54
+ gutterBottom?: boolean | undefined;
55
+ noWrap?: boolean | undefined;
56
+ paragraph?: boolean | undefined;
57
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
58
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
59
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
60
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
61
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
62
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
63
+ isSelected: boolean;
64
+ }, {}, {}>;
65
+ export interface ActivitiesListProps {
66
+ onListOpen?: () => void;
67
+ onListClose?: () => void;
68
+ }
69
+ declare const ActivitiesList: ({ ...rest }: ActivitiesListProps) => JSX.Element;
70
+ export default ActivitiesList;
@@ -0,0 +1,136 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
+ if (ar || !(i in from)) {
26
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
+ ar[i] = from[i];
28
+ }
29
+ }
30
+ return to.concat(ar || Array.prototype.slice.call(from));
31
+ };
32
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
33
+ import * as React from 'react';
34
+ import Box from '@mui/material/Box';
35
+ import { alpha, styled } from '@mui/material/styles';
36
+ import Text from '../../../../components/Text';
37
+ import Input from '../../../../components/Input';
38
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
39
+ import { useTranslation } from 'react-i18next';
40
+ import { useController, useFormContext } from 'react-hook-form';
41
+ import { useLanguage } from '../../../../hooks';
42
+ import { ACTIVITIES } from '../../../../constants';
43
+ import { BusinessType } from '../../../../@types';
44
+ import Collapse from '../../../../components/Collapse';
45
+ import SimpleList from '../../../../components/SimpleList';
46
+ import CheckIcon from '@mui/icons-material/Check';
47
+ import { MandatoryStyled } from './SalesChannels';
48
+ var BoxStyled = styled(Box)(function (_a) {
49
+ var theme = _a.theme;
50
+ return ({
51
+ display: 'flex',
52
+ flexDirection: 'column',
53
+ direction: theme.direction
54
+ });
55
+ });
56
+ export var InputLabelStyled = styled(Text)(function (_a) {
57
+ var theme = _a.theme;
58
+ return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
59
+ });
60
+ export var InputStyled = styled(Input)(function (_a) {
61
+ var theme = _a.theme;
62
+ return ({
63
+ paddingInlineEnd: theme.spacing(2.5),
64
+ '& .MuiInputBase-input': {
65
+ cursor: 'pointer'
66
+ }
67
+ });
68
+ });
69
+ export var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
70
+ var _b;
71
+ var theme = _a.theme, anchorEl = _a.anchorEl;
72
+ return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', cursor: 'pointer', transform: !!anchorEl ? 'rotate(180deg)' : '', paddingInlineStart: !!anchorEl ? theme.spacing(0) : theme.spacing(1), paddingInlineEnd: !!anchorEl ? theme.spacing(1) : theme.spacing(0) }, _b[theme.transitions.create(['transform'])] = {
73
+ duration: theme.transitions.duration.standard
74
+ }, _b)));
75
+ });
76
+ var SimpleListStyled = styled((SimpleList))(function () { return ({
77
+ height: 'fit-content'
78
+ }); });
79
+ export var CheckIconStyled = styled(CheckIcon)(function (_a) {
80
+ var theme = _a.theme;
81
+ return ({
82
+ color: theme.palette.primary.main,
83
+ display: 'flex',
84
+ alignItems: 'flex-end'
85
+ });
86
+ });
87
+ export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
88
+ var theme = _a.theme, isSelected = _a.isSelected;
89
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
90
+ });
91
+ var ActivitiesList = function (_a) {
92
+ var rest = __rest(_a, []);
93
+ var activitiesMenuList = React.useState(ACTIVITIES)[0];
94
+ var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
95
+ var t = useTranslation().t;
96
+ var isAr = useLanguage().isAr;
97
+ var control = useFormContext().control;
98
+ var activitiesControl = useController({ name: 'activities', control: control });
99
+ var controlValue = activitiesControl.field.value;
100
+ var businessType = BusinessType.CR;
101
+ var isCR = businessType === BusinessType.CR;
102
+ var onOpenList = function (event) {
103
+ var _a;
104
+ setAnchorEl(event.currentTarget);
105
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
106
+ };
107
+ var onCloseList = function () {
108
+ var _a;
109
+ setAnchorEl(null);
110
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
111
+ };
112
+ var onSelectItem = function (item) {
113
+ var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
114
+ if (isActivityExists) {
115
+ var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.id !== (item === null || item === void 0 ? void 0 : item.id); });
116
+ if (updatedIdList.length >= 1)
117
+ activitiesControl.field.onChange(updatedIdList);
118
+ return;
119
+ }
120
+ activitiesControl.field.onChange(__spreadArray(__spreadArray([], controlValue, true), [item], false));
121
+ };
122
+ var getSelectedActivities = function () {
123
+ var _a, _b;
124
+ if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > 1) {
125
+ return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
126
+ }
127
+ return isAr ? (_a = controlValue[0]) === null || _a === void 0 ? void 0 : _a.name : (_b = controlValue[0]) === null || _b === void 0 ? void 0 : _b.nameEn;
128
+ };
129
+ var getSelectedActivityFlag = function (item) {
130
+ return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
131
+ };
132
+ return (_jsxs(BoxStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, value: getSelectedActivities(), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
133
+ return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === getSelectedActivityFlag(item) }, { children: isAr ? item === null || item === void 0 ? void 0 : item.name : item === null || item === void 0 ? void 0 : item.nameEn })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
134
+ } }) }))] })] }));
135
+ };
136
+ export default ActivitiesList;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
+ export declare const CollapseStyled: import("@emotion/styled").StyledComponent<import("../../../../components/Collapse").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
+ declare const SalesChannels: () => JSX.Element;
5
+ export default SalesChannels;
@@ -0,0 +1,107 @@
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 } from '../../../../hooks';
28
+ import Text from '../../../../components/Text';
29
+ import { SALES_CHANNELS } from '../../../../constants';
30
+ import CheckBox from '../../../../components/CheckBox';
31
+ import Warning from '../../../../components/Warning';
32
+ import Collapse from '../../../../components/Collapse';
33
+ var BoxStyled = styled(Box)(function (_a) {
34
+ var theme = _a.theme;
35
+ return ({
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ direction: theme.direction
39
+ });
40
+ });
41
+ var InputLabelStyled = styled(Text)(function (_a) {
42
+ var theme = _a.theme;
43
+ return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
44
+ });
45
+ var ContainerStyled = styled(Box)(function (_a) {
46
+ var theme = _a.theme;
47
+ return ({
48
+ display: 'flex',
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ padding: theme.spacing(0, 0.5, 0, 0.5),
52
+ height: theme.spacing(3.625)
53
+ });
54
+ });
55
+ var TextStyled = styled(Text)(function (_a) {
56
+ var theme = _a.theme;
57
+ 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) }));
58
+ });
59
+ var CheckBoxStyled = styled(CheckBox)(function (_a) {
60
+ var theme = _a.theme;
61
+ return ({
62
+ marginInlineEnd: theme.spacing(-1),
63
+ '& .MuiSvgIcon-root': {
64
+ fontSize: 30
65
+ },
66
+ '&.Mui-checked': {
67
+ color: theme.palette.text.primary,
68
+ borderRadius: theme.spacing(2.5)
69
+ }
70
+ });
71
+ });
72
+ export var MandatoryStyled = styled('span')(function (_a) {
73
+ var theme = _a.theme;
74
+ return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
75
+ });
76
+ export var CollapseStyled = styled(Collapse)(function (_a) {
77
+ var theme = _a.theme;
78
+ return ({
79
+ marginBlockStart: theme.spacing(1)
80
+ });
81
+ });
82
+ var SalesChannels = function () {
83
+ var _a;
84
+ var channelsMenuList = React.useState(SALES_CHANNELS)[0];
85
+ var t = useTranslation().t;
86
+ var isAr = useLanguage().isAr;
87
+ var control = useFormContext().control;
88
+ var channelsControl = useController({ name: 'salesChannels', control: control });
89
+ var channelsChecked = channelsControl.field.value;
90
+ var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
91
+ var handleSalesChannelChange = function (event, checked) {
92
+ var selected = channelsMenuList.find(function (channel) { return channel.id.toString() === event.target.id; });
93
+ 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); });
94
+ if (isExists) {
95
+ 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); });
96
+ channelsControl.field.onChange(updatedIdList);
97
+ return;
98
+ }
99
+ channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsChecked, true), [selected], false));
100
+ };
101
+ var getSelectedChannelsFlag = function (item) {
102
+ if (channelsChecked)
103
+ return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
104
+ };
105
+ return (_jsxs(BoxStyled, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id.toString(), disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name : channel.nameEn, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
106
+ };
107
+ export default SalesChannels;
@@ -0,0 +1,3 @@
1
+ import Activities, { ActivitiesProps } from './Activities';
2
+ export type { ActivitiesProps };
3
+ export default Activities;
@@ -0,0 +1,2 @@
1
+ import Activities from './Activities';
2
+ export default Activities;