@alfalab/core-components-international-phone-input 1.0.0

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 (389) hide show
  1. package/Component-4cd3936b.d.ts +19 -0
  2. package/Component-63dec22f.d.ts +184 -0
  3. package/Component-8b2c2707.d.ts +71 -0
  4. package/Component-9211a437.d.ts +38 -0
  5. package/Component-bdb4c6b9.d.ts +12 -0
  6. package/Component-c76d6398.d.ts +5 -0
  7. package/Component-d078a845.d.ts +7 -0
  8. package/Component-dd8ca091.d.ts +72 -0
  9. package/Component-ebda875c.d.ts +12 -0
  10. package/Component.desktop-2e2b2125.d.ts +6 -0
  11. package/Component.desktop-785df74d.d.ts +6 -0
  12. package/Component.desktop-d078a845.d.ts +73 -0
  13. package/Component.desktop-d873d97d.d.ts +6 -0
  14. package/Component.desktop.d.ts +5 -0
  15. package/Component.desktop.js +47 -0
  16. package/Component.mobile-4cd3936b.d.ts +98 -0
  17. package/Component.mobile-755fbaa3.d.ts +6 -0
  18. package/Component.mobile-ade26e99.d.ts +41 -0
  19. package/Component.mobile-d7e9f69d.d.ts +6 -0
  20. package/Component.mobile-ebda875c.d.ts +6 -0
  21. package/Component.mobile-f1f15074.d.ts +34 -0
  22. package/Component.mobile.d.ts +5 -0
  23. package/Component.mobile.js +82 -0
  24. package/Component.modal.mobile-4cd3936b.d.ts +91 -0
  25. package/Component.modal.mobile-dd8ca091.d.ts +60 -0
  26. package/Component.responsive-785df74d.d.ts +26 -0
  27. package/Component.responsive.d.ts +46 -0
  28. package/Component.responsive.js +43 -0
  29. package/Context-bdb4c6b9.d.ts +4 -0
  30. package/ResponsiveContext-baf4875b.d.ts +5 -0
  31. package/components/base-international-phone-input/Component.d.ts +26 -0
  32. package/components/base-international-phone-input/Component.js +98 -0
  33. package/components/base-international-phone-input/index.css +5 -0
  34. package/components/base-international-phone-input/index.d.ts +1 -0
  35. package/components/base-international-phone-input/index.js +26 -0
  36. package/components/country-select/Component.d.ts +21 -0
  37. package/components/country-select/Component.js +60 -0
  38. package/components/country-select/index.css +47 -0
  39. package/components/country-select/index.d.ts +1 -0
  40. package/components/country-select/index.js +20 -0
  41. package/components/flag-icon/component.d.ts +16 -0
  42. package/components/flag-icon/component.js +27 -0
  43. package/components/flag-icon/flagSprite.d.ts +2 -0
  44. package/components/flag-icon/flagSprite.js +233 -0
  45. package/components/flag-icon/index.css +30 -0
  46. package/components/flag-icon/index.d.ts +1 -0
  47. package/components/flag-icon/index.js +12 -0
  48. package/components/select-field/component.d.ts +8 -0
  49. package/components/select-field/component.js +43 -0
  50. package/components/select-field/index.css +53 -0
  51. package/components/select-field/index.d.ts +1 -0
  52. package/components/select-field/index.js +18 -0
  53. package/consts-f777ba1a.d.ts +2 -0
  54. package/consts.d.ts +2 -0
  55. package/consts.js +7 -0
  56. package/cssm/Component-4cd3936b.d.ts +7 -0
  57. package/cssm/Component-8b2c2707.d.ts +71 -0
  58. package/cssm/Component-9211a437.d.ts +38 -0
  59. package/cssm/Component-96988a65.d.ts +9 -0
  60. package/cssm/Component-aed0af6e.d.ts +11 -0
  61. package/cssm/Component-bdb4c6b9.d.ts +12 -0
  62. package/cssm/Component-c76d6398.d.ts +5 -0
  63. package/cssm/Component-dd8ca091.d.ts +5 -0
  64. package/cssm/Component-ebda875c.d.ts +101 -0
  65. package/cssm/Component-f12ee135.d.ts +72 -0
  66. package/cssm/Component.desktop-2e2b2125.d.ts +6 -0
  67. package/cssm/Component.desktop-4cd3936b.d.ts +73 -0
  68. package/cssm/Component.desktop-785df74d.d.ts +6 -0
  69. package/cssm/Component.desktop-d873d97d.d.ts +6 -0
  70. package/cssm/Component.desktop-ebda875c.d.ts +18 -0
  71. package/cssm/Component.desktop.d.ts +5 -0
  72. package/cssm/Component.desktop.js +51 -0
  73. package/cssm/Component.mobile-755fbaa3.d.ts +6 -0
  74. package/cssm/Component.mobile-ade26e99.d.ts +41 -0
  75. package/cssm/Component.mobile-d7e9f69d.d.ts +6 -0
  76. package/cssm/Component.mobile-f1f15074.d.ts +34 -0
  77. package/cssm/Component.mobile.d.ts +5 -0
  78. package/cssm/Component.mobile.js +86 -0
  79. package/cssm/Component.responsive-d7e9f69d.d.ts +26 -0
  80. package/cssm/Component.responsive.d.ts +46 -0
  81. package/cssm/Component.responsive.js +47 -0
  82. package/cssm/Context-bdb4c6b9.d.ts +4 -0
  83. package/cssm/ResponsiveContext-baf4875b.d.ts +5 -0
  84. package/cssm/components/base-international-phone-input/Component.d.ts +26 -0
  85. package/cssm/components/base-international-phone-input/Component.js +100 -0
  86. package/cssm/components/base-international-phone-input/index.d.ts +1 -0
  87. package/cssm/components/base-international-phone-input/index.js +30 -0
  88. package/cssm/components/base-international-phone-input/index.module.css +4 -0
  89. package/cssm/components/country-select/Component.d.ts +21 -0
  90. package/cssm/components/country-select/Component.js +61 -0
  91. package/cssm/components/country-select/index.d.ts +1 -0
  92. package/cssm/components/country-select/index.js +23 -0
  93. package/cssm/components/country-select/index.module.css +47 -0
  94. package/cssm/components/flag-icon/component.d.ts +16 -0
  95. package/cssm/components/flag-icon/component.js +26 -0
  96. package/cssm/components/flag-icon/flagSprite.d.ts +2 -0
  97. package/cssm/components/flag-icon/flagSprite.js +233 -0
  98. package/cssm/components/flag-icon/index.d.ts +1 -0
  99. package/cssm/components/flag-icon/index.js +13 -0
  100. package/cssm/components/flag-icon/index.module.css +29 -0
  101. package/cssm/components/select-field/component.d.ts +8 -0
  102. package/cssm/components/select-field/component.js +43 -0
  103. package/cssm/components/select-field/index.d.ts +1 -0
  104. package/cssm/components/select-field/index.js +20 -0
  105. package/cssm/components/select-field/index.module.css +52 -0
  106. package/cssm/consts-f777ba1a.d.ts +2 -0
  107. package/cssm/consts.d.ts +2 -0
  108. package/cssm/consts.js +7 -0
  109. package/cssm/data/country-data.d.ts +3 -0
  110. package/cssm/data/country-data.js +587 -0
  111. package/cssm/desktop-232828f7.d.ts +2 -0
  112. package/cssm/desktop-2e2b2125.d.ts +2 -0
  113. package/cssm/desktop-63dec22f.d.ts +2 -0
  114. package/cssm/desktop-785df74d.d.ts +2 -0
  115. package/cssm/desktop.d.ts +2 -0
  116. package/cssm/desktop.js +34 -0
  117. package/cssm/hook-8abfea97.d.ts +90 -0
  118. package/cssm/hook-ebda875c.d.ts +48 -0
  119. package/cssm/index-136acbb1.d.ts +28 -0
  120. package/cssm/index-72dda473.d.ts +12 -0
  121. package/cssm/index-8b2c2707.d.ts +6 -0
  122. package/cssm/index-bdb4c6b9.d.ts +180 -0
  123. package/cssm/index-c76d6398.d.ts +319 -0
  124. package/cssm/index-ebda875c.d.ts +3 -0
  125. package/cssm/index-f12ee135.d.ts +52 -0
  126. package/cssm/index.d.ts +2 -0
  127. package/cssm/index.js +40 -0
  128. package/cssm/mobile-45dc17c6.d.ts +47 -0
  129. package/cssm/mobile-4c19bc40.d.ts +121 -0
  130. package/cssm/mobile-96988a65.d.ts +3 -0
  131. package/cssm/mobile.d.ts +2 -0
  132. package/cssm/mobile.js +34 -0
  133. package/cssm/shared-4cd3936b.d.ts +7 -0
  134. package/cssm/types-1b036d4b.d.ts +13 -0
  135. package/cssm/types-72dda473.d.ts +276 -0
  136. package/cssm/types.d.ts +100 -0
  137. package/cssm/types.js +2 -0
  138. package/cssm/typings-9211a437.d.ts +95 -0
  139. package/cssm/typings-bdb4c6b9.d.ts +52 -0
  140. package/cssm/typings-dd8ca091.d.ts +572 -0
  141. package/cssm/useSkeleton-1b036d4b.d.ts +12 -0
  142. package/cssm/utils/index.d.ts +18 -0
  143. package/cssm/utils/index.js +201 -0
  144. package/cssm/utils-dd8ca091.d.ts +41 -0
  145. package/data/country-data.d.ts +3 -0
  146. package/data/country-data.js +587 -0
  147. package/desktop-232828f7.d.ts +2 -0
  148. package/desktop-2e2b2125.d.ts +2 -0
  149. package/desktop-63dec22f.d.ts +2 -0
  150. package/desktop.d.ts +2 -0
  151. package/desktop.js +30 -0
  152. package/esm/Component-4cd3936b.d.ts +19 -0
  153. package/esm/Component-63dec22f.d.ts +184 -0
  154. package/esm/Component-8b2c2707.d.ts +71 -0
  155. package/esm/Component-9211a437.d.ts +38 -0
  156. package/esm/Component-bdb4c6b9.d.ts +12 -0
  157. package/esm/Component-c76d6398.d.ts +5 -0
  158. package/esm/Component-d078a845.d.ts +7 -0
  159. package/esm/Component-dd8ca091.d.ts +72 -0
  160. package/esm/Component-ebda875c.d.ts +12 -0
  161. package/esm/Component.desktop-2e2b2125.d.ts +6 -0
  162. package/esm/Component.desktop-785df74d.d.ts +6 -0
  163. package/esm/Component.desktop-d078a845.d.ts +73 -0
  164. package/esm/Component.desktop-d873d97d.d.ts +6 -0
  165. package/esm/Component.desktop.d.ts +5 -0
  166. package/esm/Component.desktop.js +39 -0
  167. package/esm/Component.mobile-4cd3936b.d.ts +98 -0
  168. package/esm/Component.mobile-755fbaa3.d.ts +6 -0
  169. package/esm/Component.mobile-ade26e99.d.ts +41 -0
  170. package/esm/Component.mobile-d7e9f69d.d.ts +6 -0
  171. package/esm/Component.mobile-ebda875c.d.ts +6 -0
  172. package/esm/Component.mobile-f1f15074.d.ts +34 -0
  173. package/esm/Component.mobile.d.ts +5 -0
  174. package/esm/Component.mobile.js +74 -0
  175. package/esm/Component.modal.mobile-4cd3936b.d.ts +91 -0
  176. package/esm/Component.modal.mobile-dd8ca091.d.ts +60 -0
  177. package/esm/Component.responsive-785df74d.d.ts +26 -0
  178. package/esm/Component.responsive.d.ts +46 -0
  179. package/esm/Component.responsive.js +35 -0
  180. package/esm/Context-bdb4c6b9.d.ts +4 -0
  181. package/esm/ResponsiveContext-baf4875b.d.ts +5 -0
  182. package/esm/components/base-international-phone-input/Component.d.ts +26 -0
  183. package/esm/components/base-international-phone-input/Component.js +89 -0
  184. package/esm/components/base-international-phone-input/index.css +5 -0
  185. package/esm/components/base-international-phone-input/index.d.ts +1 -0
  186. package/esm/components/base-international-phone-input/index.js +18 -0
  187. package/esm/components/country-select/Component.d.ts +21 -0
  188. package/esm/components/country-select/Component.js +52 -0
  189. package/esm/components/country-select/index.css +47 -0
  190. package/esm/components/country-select/index.d.ts +1 -0
  191. package/esm/components/country-select/index.js +12 -0
  192. package/esm/components/flag-icon/component.d.ts +16 -0
  193. package/esm/components/flag-icon/component.js +18 -0
  194. package/esm/components/flag-icon/flagSprite.d.ts +2 -0
  195. package/esm/components/flag-icon/flagSprite.js +229 -0
  196. package/esm/components/flag-icon/index.css +30 -0
  197. package/esm/components/flag-icon/index.d.ts +1 -0
  198. package/esm/components/flag-icon/index.js +4 -0
  199. package/esm/components/select-field/component.d.ts +8 -0
  200. package/esm/components/select-field/component.js +32 -0
  201. package/esm/components/select-field/index.css +53 -0
  202. package/esm/components/select-field/index.d.ts +1 -0
  203. package/esm/components/select-field/index.js +9 -0
  204. package/esm/consts-f777ba1a.d.ts +2 -0
  205. package/esm/consts.d.ts +2 -0
  206. package/esm/consts.js +3 -0
  207. package/esm/data/country-data.d.ts +3 -0
  208. package/esm/data/country-data.js +583 -0
  209. package/esm/desktop-232828f7.d.ts +2 -0
  210. package/esm/desktop-2e2b2125.d.ts +2 -0
  211. package/esm/desktop-63dec22f.d.ts +2 -0
  212. package/esm/desktop.d.ts +2 -0
  213. package/esm/desktop.js +22 -0
  214. package/esm/hook-8abfea97.d.ts +90 -0
  215. package/esm/index-136acbb1.d.ts +28 -0
  216. package/esm/index-72dda473.d.ts +12 -0
  217. package/esm/index-8b2c2707.d.ts +6 -0
  218. package/esm/index-bdb4c6b9.d.ts +2 -0
  219. package/esm/index-c76d6398.d.ts +141 -0
  220. package/esm/index-ebda875c.d.ts +3 -0
  221. package/esm/index-f12ee135.d.ts +52 -0
  222. package/esm/index.d.ts +2 -0
  223. package/esm/index.js +28 -0
  224. package/esm/mobile-4c19bc40.d.ts +3 -0
  225. package/esm/mobile-755fbaa3.d.ts +2 -0
  226. package/esm/mobile-96988a65.d.ts +2 -0
  227. package/esm/mobile-ade26e99.d.ts +5 -0
  228. package/esm/mobile-d7e9f69d.d.ts +2 -0
  229. package/esm/mobile.d.ts +2 -0
  230. package/esm/mobile.js +22 -0
  231. package/esm/shared-4cd3936b.d.ts +65 -0
  232. package/esm/types-1b036d4b.d.ts +13 -0
  233. package/esm/types-72dda473.d.ts +276 -0
  234. package/esm/types.d.ts +100 -0
  235. package/esm/types.js +1 -0
  236. package/esm/typings-9211a437.d.ts +95 -0
  237. package/esm/typings-bdb4c6b9.d.ts +52 -0
  238. package/esm/typings-dd8ca091.d.ts +572 -0
  239. package/esm/useSkeleton-ebda875c.d.ts +12 -0
  240. package/esm/utils/index.d.ts +18 -0
  241. package/esm/utils/index.js +189 -0
  242. package/esm/utils-1574ad8b.d.ts +29 -0
  243. package/esm/utils-dd8ca091.d.ts +41 -0
  244. package/hook-8abfea97.d.ts +90 -0
  245. package/index-136acbb1.d.ts +28 -0
  246. package/index-72dda473.d.ts +12 -0
  247. package/index-8b2c2707.d.ts +6 -0
  248. package/index-bdb4c6b9.d.ts +2 -0
  249. package/index-c76d6398.d.ts +141 -0
  250. package/index-ebda875c.d.ts +3 -0
  251. package/index-f12ee135.d.ts +52 -0
  252. package/index.d.ts +2 -0
  253. package/index.js +36 -0
  254. package/mobile-4c19bc40.d.ts +3 -0
  255. package/mobile-755fbaa3.d.ts +2 -0
  256. package/mobile-96988a65.d.ts +2 -0
  257. package/mobile-ade26e99.d.ts +5 -0
  258. package/mobile-d7e9f69d.d.ts +2 -0
  259. package/mobile.d.ts +2 -0
  260. package/mobile.js +30 -0
  261. package/modern/Component-4cd3936b.d.ts +19 -0
  262. package/modern/Component-63dec22f.d.ts +184 -0
  263. package/modern/Component-8b2c2707.d.ts +71 -0
  264. package/modern/Component-9211a437.d.ts +38 -0
  265. package/modern/Component-bdb4c6b9.d.ts +12 -0
  266. package/modern/Component-c76d6398.d.ts +5 -0
  267. package/modern/Component-d078a845.d.ts +7 -0
  268. package/modern/Component-dd8ca091.d.ts +72 -0
  269. package/modern/Component-ebda875c.d.ts +12 -0
  270. package/modern/Component.desktop-2e2b2125.d.ts +6 -0
  271. package/modern/Component.desktop-785df74d.d.ts +6 -0
  272. package/modern/Component.desktop-d078a845.d.ts +73 -0
  273. package/modern/Component.desktop-d873d97d.d.ts +6 -0
  274. package/modern/Component.desktop.d.ts +5 -0
  275. package/modern/Component.desktop.js +35 -0
  276. package/modern/Component.mobile-4cd3936b.d.ts +98 -0
  277. package/modern/Component.mobile-755fbaa3.d.ts +6 -0
  278. package/modern/Component.mobile-ade26e99.d.ts +41 -0
  279. package/modern/Component.mobile-d7e9f69d.d.ts +6 -0
  280. package/modern/Component.mobile-ebda875c.d.ts +6 -0
  281. package/modern/Component.mobile-f1f15074.d.ts +34 -0
  282. package/modern/Component.mobile.d.ts +5 -0
  283. package/modern/Component.mobile.js +77 -0
  284. package/modern/Component.modal.mobile-4cd3936b.d.ts +91 -0
  285. package/modern/Component.modal.mobile-dd8ca091.d.ts +60 -0
  286. package/modern/Component.responsive-785df74d.d.ts +26 -0
  287. package/modern/Component.responsive.d.ts +46 -0
  288. package/modern/Component.responsive.js +33 -0
  289. package/modern/Context-bdb4c6b9.d.ts +4 -0
  290. package/modern/ResponsiveContext-baf4875b.d.ts +5 -0
  291. package/modern/components/base-international-phone-input/Component.d.ts +26 -0
  292. package/modern/components/base-international-phone-input/Component.js +91 -0
  293. package/modern/components/base-international-phone-input/index.css +5 -0
  294. package/modern/components/base-international-phone-input/index.d.ts +1 -0
  295. package/modern/components/base-international-phone-input/index.js +17 -0
  296. package/modern/components/country-select/Component.d.ts +21 -0
  297. package/modern/components/country-select/Component.js +47 -0
  298. package/modern/components/country-select/index.css +47 -0
  299. package/modern/components/country-select/index.d.ts +1 -0
  300. package/modern/components/country-select/index.js +11 -0
  301. package/modern/components/flag-icon/component.d.ts +16 -0
  302. package/modern/components/flag-icon/component.js +15 -0
  303. package/modern/components/flag-icon/flagSprite.d.ts +2 -0
  304. package/modern/components/flag-icon/flagSprite.js +229 -0
  305. package/modern/components/flag-icon/index.css +30 -0
  306. package/modern/components/flag-icon/index.d.ts +1 -0
  307. package/modern/components/flag-icon/index.js +4 -0
  308. package/modern/components/select-field/component.d.ts +8 -0
  309. package/modern/components/select-field/component.js +29 -0
  310. package/modern/components/select-field/index.css +53 -0
  311. package/modern/components/select-field/index.d.ts +1 -0
  312. package/modern/components/select-field/index.js +8 -0
  313. package/modern/consts-f777ba1a.d.ts +2 -0
  314. package/modern/consts.d.ts +2 -0
  315. package/modern/consts.js +3 -0
  316. package/modern/data/country-data.d.ts +3 -0
  317. package/modern/data/country-data.js +583 -0
  318. package/modern/desktop-232828f7.d.ts +2 -0
  319. package/modern/desktop-2e2b2125.d.ts +2 -0
  320. package/modern/desktop-63dec22f.d.ts +2 -0
  321. package/modern/desktop.d.ts +2 -0
  322. package/modern/desktop.js +21 -0
  323. package/modern/hook-8abfea97.d.ts +90 -0
  324. package/modern/index-136acbb1.d.ts +28 -0
  325. package/modern/index-72dda473.d.ts +12 -0
  326. package/modern/index-8b2c2707.d.ts +6 -0
  327. package/modern/index-bdb4c6b9.d.ts +2 -0
  328. package/modern/index-c76d6398.d.ts +141 -0
  329. package/modern/index-ebda875c.d.ts +3 -0
  330. package/modern/index-f12ee135.d.ts +52 -0
  331. package/modern/index.d.ts +2 -0
  332. package/modern/index.js +27 -0
  333. package/modern/mobile-4c19bc40.d.ts +3 -0
  334. package/modern/mobile-755fbaa3.d.ts +2 -0
  335. package/modern/mobile-96988a65.d.ts +2 -0
  336. package/modern/mobile-ade26e99.d.ts +5 -0
  337. package/modern/mobile-d7e9f69d.d.ts +2 -0
  338. package/modern/mobile.d.ts +2 -0
  339. package/modern/mobile.js +21 -0
  340. package/modern/shared-4cd3936b.d.ts +65 -0
  341. package/modern/types-1b036d4b.d.ts +13 -0
  342. package/modern/types-72dda473.d.ts +276 -0
  343. package/modern/types.d.ts +100 -0
  344. package/modern/types.js +1 -0
  345. package/modern/typings-9211a437.d.ts +95 -0
  346. package/modern/typings-bdb4c6b9.d.ts +52 -0
  347. package/modern/typings-dd8ca091.d.ts +572 -0
  348. package/modern/useSkeleton-ebda875c.d.ts +12 -0
  349. package/modern/utils/index.d.ts +18 -0
  350. package/modern/utils/index.js +183 -0
  351. package/modern/utils-1574ad8b.d.ts +29 -0
  352. package/modern/utils-dd8ca091.d.ts +41 -0
  353. package/package.json +30 -0
  354. package/shared-4cd3936b.d.ts +65 -0
  355. package/src/Component.desktop.tsx +68 -0
  356. package/src/Component.mobile.tsx +132 -0
  357. package/src/Component.responsive.tsx +20 -0
  358. package/src/components/base-international-phone-input/Component.tsx +174 -0
  359. package/src/components/base-international-phone-input/index.module.css +5 -0
  360. package/src/components/base-international-phone-input/index.ts +1 -0
  361. package/src/components/country-select/Component.tsx +120 -0
  362. package/src/components/country-select/index.module.css +40 -0
  363. package/src/components/country-select/index.ts +1 -0
  364. package/src/components/flag-icon/component.tsx +33 -0
  365. package/src/components/flag-icon/flagSprite.ts +228 -0
  366. package/src/components/flag-icon/index.module.css +15 -0
  367. package/src/components/flag-icon/index.ts +1 -0
  368. package/src/components/select-field/component.tsx +51 -0
  369. package/src/components/select-field/index.module.css +43 -0
  370. package/src/components/select-field/index.ts +1 -0
  371. package/src/consts.ts +1 -0
  372. package/src/data/country-data.ts +584 -0
  373. package/src/desktop.ts +2 -0
  374. package/src/index.ts +2 -0
  375. package/src/mobile.ts +2 -0
  376. package/src/types.ts +132 -0
  377. package/src/utils/index.ts +246 -0
  378. package/types-1b036d4b.d.ts +13 -0
  379. package/types-72dda473.d.ts +276 -0
  380. package/types.d.ts +100 -0
  381. package/types.js +2 -0
  382. package/typings-9211a437.d.ts +95 -0
  383. package/typings-bdb4c6b9.d.ts +52 -0
  384. package/typings-dd8ca091.d.ts +572 -0
  385. package/useSkeleton-ebda875c.d.ts +12 -0
  386. package/utils/index.d.ts +18 -0
  387. package/utils/index.js +201 -0
  388. package/utils-1574ad8b.d.ts +29 -0
  389. package/utils-dd8ca091.d.ts +41 -0
@@ -0,0 +1,41 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ReactNode } from "react";
4
+ import { BottomSheetProps } from "./index-f12ee135";
5
+ import { UseSelectWithApplyProps } from "./hook-8abfea97";
6
+ import { BaseSelectProps } from "./typings-dd8ca091";
7
+ type AdditionalMobileProps = {
8
+ /**
9
+ * Футер
10
+ * @deprecated Используйте bottomSheetProps.actionButton
11
+ */
12
+ footer?: ReactNode;
13
+ /**
14
+ * Будет ли свайпаться шторка
15
+ * @deprecated Используйте bottomSheetProps.swipeable
16
+ */
17
+ swipeable?: boolean;
18
+ /**
19
+ * Дополнительные пропсы шторки
20
+ */
21
+ bottomSheetProps?: Partial<BottomSheetProps>;
22
+ /**
23
+ * Показывать кнопку очистки
24
+ */
25
+ showClear?: UseSelectWithApplyProps['showClear'];
26
+ /**
27
+ * Показывать пункт "Выбрать все"
28
+ */
29
+ showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
30
+ /**
31
+ * Показывать пункт "Выбрать все" в заголовке списка
32
+ */
33
+ showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
34
+ /**
35
+ * Использовать ли хук useSelectWithApply
36
+ */
37
+ useWithApplyHook?: boolean;
38
+ };
39
+ type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & AdditionalMobileProps;
40
+ declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
41
+ export { AdditionalMobileProps, SelectMobileProps, SelectMobile };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { BaseFormControlProps } from "./index-ebda875c";
4
+ type FormControlMobileProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
5
+ declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
6
+ export { FormControlMobileProps, FormControlMobile };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { BaseInputProps } from "./index-ebda875c";
4
+ type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
5
+ declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
6
+ export { InputMobileProps, InputMobile };
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import React from "react";
3
+ import { FC, ReactNode } from "react";
4
+ import { ContentProps, ModalMobileProps } from "./typings-bdb4c6b9";
5
+ declare const Content: FC<ContentProps>;
6
+ type FooterProps = {
7
+ /**
8
+ * Контент футера
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * Дополнительный класс
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Фиксирует футер
17
+ */
18
+ sticky?: boolean;
19
+ /**
20
+ * Выравнивание элементов футера
21
+ */
22
+ layout?: "start" | "center" | "space-between" | "column";
23
+ /**
24
+ * Отступы между элементами футера
25
+ */
26
+ gap?: 16 | 24 | 32;
27
+ };
28
+ declare const Footer: FC<FooterProps>;
29
+ declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
30
+ Content: React.FC<import("./typings-bdb4c6b9").ContentProps>;
31
+ Header: React.FC<import("./Component-c76d6398").HeaderProps>;
32
+ Footer: React.FC<FooterProps>;
33
+ };
34
+ export { Content, FooterProps, Footer, ModalMobile };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { InternationalPhoneInputMobileProps } from "./types";
4
+ declare const InternationalPhoneInputMobile: React.ForwardRefExoticComponent<InternationalPhoneInputMobileProps & React.RefAttributes<HTMLInputElement>>;
5
+ export { InternationalPhoneInputMobile };
@@ -0,0 +1,74 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React, { forwardRef, useMemo, useState } from 'react';
3
+ import { InputMobile } from '@alfalab/core-components-input/esm/mobile';
4
+ import { InputAutocompleteMobile } from '@alfalab/core-components-input-autocomplete/esm/mobile';
5
+ import { SelectMobile } from '@alfalab/core-components-select/esm/mobile';
6
+ import { BaseInternationalPhoneInput } from './components/base-international-phone-input/Component.js';
7
+ import { CountrySelect } from './components/country-select/Component.js';
8
+ import { initCountries, findCountry, filterPhones, getClear, getPhoneData } from './utils/index.js';
9
+ import 'react-merge-refs';
10
+ import '@maskito/core';
11
+ import '@maskito/react';
12
+ import '@alfalab/core-components-select/esm/shared';
13
+ import '@alfalab/core-components-shared/esm';
14
+ import '@alfalab/icons-glyph/WorldMagnifierMIcon';
15
+ import './components/flag-icon/component.js';
16
+ import 'classnames';
17
+ import './components/flag-icon/flagSprite.js';
18
+ import './components/select-field/component.js';
19
+ import '@alfalab/hooks';
20
+ import './consts.js';
21
+ import './data/country-data.js';
22
+
23
+ var InternationalPhoneInputMobile = forwardRef(function (_a, ref) {
24
+ var options = _a.options, countryProp = _a.country, onCountryChange = _a.onCountryChange, value = _a.value, filterFn = _a.filterFn, countries = _a.countries, defaultIso2 = _a.defaultIso2, clearProp = _a.clear, _b = _a.clearableCountryCode, clearableCountryCode = _b === void 0 ? true : _b, restProps = __rest(_a, ["options", "country", "onCountryChange", "value", "filterFn", "countries", "defaultIso2", "clear", "clearableCountryCode"]);
25
+ var typedRestProps = restProps;
26
+ var countriesData = useMemo(function () { return initCountries(countries); }, [countries]);
27
+ var _c = useState(''), filter = _c[0], setFilter = _c[1];
28
+ var _d = useState(), filterCountry = _d[0], setFilterCountry = _d[1];
29
+ var _e = useState(function () {
30
+ return findCountry(countriesData, value, defaultIso2, countryProp);
31
+ }), selectedCountry = _e[0], setSelectedCountry = _e[1];
32
+ var filteredOptions = filterPhones(filter, options, filterFn);
33
+ var country = countryProp !== null && countryProp !== void 0 ? countryProp : selectedCountry;
34
+ var countryCode = country === null || country === void 0 ? void 0 : country.countryCode;
35
+ var handleCountryChange = function (nextCountry) {
36
+ if (countryProp === undefined)
37
+ setSelectedCountry(nextCountry);
38
+ onCountryChange === null || onCountryChange === void 0 ? void 0 : onCountryChange(nextCountry);
39
+ };
40
+ var handleFilter = function (event) {
41
+ var _a = getPhoneData(event.target.value, countriesData, defaultIso2), nextPhone = _a.nextPhone, nextCountry = _a.nextCountry;
42
+ setFilter(nextPhone);
43
+ setFilterCountry(nextCountry);
44
+ };
45
+ var handleFilterClear = function () {
46
+ var withCountryCode = !clearableCountryCode && (filterCountry === null || filterCountry === void 0 ? void 0 : filterCountry.countryCode);
47
+ setFilter(withCountryCode ? "+".concat(filterCountry.countryCode) : '');
48
+ };
49
+ var handleEnter = function (node, isAppearing) {
50
+ var _a, _b, _c;
51
+ (_c = (_b = (_a = typedRestProps.bottomSheetProps) === null || _a === void 0 ? void 0 : _a.transitionProps) === null || _b === void 0 ? void 0 : _b.onEnter) === null || _c === void 0 ? void 0 : _c.call(_b, node, isAppearing);
52
+ setFilterCountry(country);
53
+ setFilter(countryCode ? "+".concat(country.countryCode) : '');
54
+ };
55
+ var isAutocomplete = Array.isArray(options);
56
+ var props = isAutocomplete
57
+ ? (function () {
58
+ var _a;
59
+ var clear = getClear(clearProp, clearableCountryCode, filter, countryCode);
60
+ return {
61
+ filter: filter,
62
+ onFilter: handleFilter,
63
+ onClearFilter: clear ? handleFilterClear : undefined,
64
+ bottomSheetHeaderAddonsProps: __assign(__assign({}, typedRestProps.bottomSheetHeaderAddonsProps), { leftAddons: (React.createElement(CountrySelect, { SelectComponent: SelectMobile, view: 'mobile', country: filterCountry })) }),
65
+ bottomSheetProps: __assign(__assign({}, typedRestProps.bottomSheetProps), { transitionProps: __assign(__assign({}, (_a = typedRestProps.bottomSheetProps) === null || _a === void 0 ? void 0 : _a.transitionProps), { onEnter: handleEnter }) }),
66
+ };
67
+ })()
68
+ : {
69
+ clear: getClear(clearProp, clearableCountryCode, value, countryCode),
70
+ };
71
+ return (React.createElement(BaseInternationalPhoneInput, __assign({ selected: value }, restProps, props, { clearableCountryCode: clearableCountryCode, onCountryChange: handleCountryChange, country: country, defaultIso2: defaultIso2, countriesData: countriesData, value: value, options: filteredOptions, view: 'mobile', ref: ref, SelectComponent: SelectMobile, Input: InputMobile, InputAutocomplete: InputAutocompleteMobile })));
72
+ });
73
+
74
+ export { InternationalPhoneInputMobile };
@@ -0,0 +1,91 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ChangeEvent, ElementType } from "react";
4
+ import { ButtonMobileProps } from "./mobile-755fbaa3";
5
+ import { SelectModalMobileProps } from "./mobile-ade26e99";
6
+ import { BaseSelectChangePayload } from "./shared-4cd3936b";
7
+ type InputAutocompleteModalMobileProps = Omit<SelectModalMobileProps, 'OptionsList' | 'Checkmark' | 'onScroll' | 'nativeSelect' | 'autocomplete' | 'valueRenderer'> & {
8
+ /**
9
+ * Обработчик выбора
10
+ */
11
+ onChange: (payload: string | BaseSelectChangePayload) => void;
12
+ /**
13
+ * Обработчик ввода фильтра.
14
+ */
15
+ onFilter: (event: ChangeEvent<HTMLInputElement>) => void;
16
+ /**
17
+ * Значение поля ввода
18
+ */
19
+ value?: string;
20
+ /**
21
+ * Значение фильтра.
22
+ */
23
+ filter?: string;
24
+ /**
25
+ * Обработчик нажатия на кнопку "Отмена".
26
+ */
27
+ onCancel?: () => void;
28
+ /**
29
+ * Обработчик нажатия на крестик в инпуте фильтра.
30
+ */
31
+ onClearFilter?: () => void;
32
+ /**
33
+ * Дополнительные пропсы на слот под заголовком
34
+ */
35
+ bottomAddonProps?: Record<string, unknown>;
36
+ /**
37
+ * Дополнительные пропсы на кнопку "продолжить"
38
+ */
39
+ continueButtonProps?: ButtonMobileProps;
40
+ /**
41
+ * Дополнительные пропсы на кнопку "отмена"
42
+ */
43
+ cancelButtonProps?: ButtonMobileProps;
44
+ /**
45
+ * Кастомный инпут
46
+ */
47
+ Input?: ElementType;
48
+ };
49
+ declare const InputAutocompleteModalMobile: React.ForwardRefExoticComponent<Omit<SelectModalMobileProps, "onScroll" | "valueRenderer" | "autocomplete" | "nativeSelect" | "OptionsList" | "Checkmark"> & {
50
+ /**
51
+ * Обработчик выбора
52
+ */
53
+ onChange: (payload: string | BaseSelectChangePayload) => void;
54
+ /**
55
+ * Обработчик ввода фильтра.
56
+ */
57
+ onFilter: (event: ChangeEvent<HTMLInputElement>) => void;
58
+ /**
59
+ * Значение поля ввода
60
+ */
61
+ value?: string | undefined;
62
+ /**
63
+ * Значение фильтра.
64
+ */
65
+ filter?: string | undefined;
66
+ /**
67
+ * Обработчик нажатия на кнопку "Отмена".
68
+ */
69
+ onCancel?: (() => void) | undefined;
70
+ /**
71
+ * Обработчик нажатия на крестик в инпуте фильтра.
72
+ */
73
+ onClearFilter?: (() => void) | undefined;
74
+ /**
75
+ * Дополнительные пропсы на слот под заголовком
76
+ */
77
+ bottomAddonProps?: Record<string, unknown> | undefined;
78
+ /**
79
+ * Дополнительные пропсы на кнопку "продолжить"
80
+ */
81
+ continueButtonProps?: ButtonMobileProps | undefined;
82
+ /**
83
+ * Дополнительные пропсы на кнопку "отмена"
84
+ */
85
+ cancelButtonProps?: ButtonMobileProps | undefined;
86
+ /**
87
+ * Кастомный инпут
88
+ */
89
+ Input?: React.ElementType<any> | undefined;
90
+ } & React.RefAttributes<HTMLDivElement>>;
91
+ export { InputAutocompleteModalMobileProps, InputAutocompleteModalMobile };
@@ -0,0 +1,60 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ModalMobile } from "./Component.mobile-f1f15074";
4
+ import { UseSelectWithApplyProps } from "./hook-8abfea97";
5
+ import { BaseSelectProps } from "./typings-dd8ca091";
6
+ type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
7
+ /**
8
+ * Показывать кнопку очистки
9
+ */
10
+ showClear?: UseSelectWithApplyProps['showClear'];
11
+ /**
12
+ * Показывать пункт "Выбрать все"
13
+ */
14
+ showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
15
+ /**
16
+ * Дополнительные пропсы шапки модалки
17
+ */
18
+ modalHeaderProps?: Partial<React.ComponentProps<typeof ModalMobile.Header>>;
19
+ /**
20
+ * Дополнительные пропсы модалки
21
+ */
22
+ modalProps?: Partial<React.ComponentProps<typeof ModalMobile>>;
23
+ /**
24
+ * Дополнительные пропсы футера модалки
25
+ */
26
+ modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
27
+ showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
28
+ /**
29
+ * Использовать ли хук useSelectWithApply
30
+ */
31
+ useWithApplyHook?: boolean;
32
+ };
33
+ declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
34
+ /**
35
+ * Показывать кнопку очистки
36
+ */
37
+ showClear?: UseSelectWithApplyProps['showClear'];
38
+ /**
39
+ * Показывать пункт "Выбрать все"
40
+ */
41
+ showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
42
+ /**
43
+ * Дополнительные пропсы шапки модалки
44
+ */
45
+ modalHeaderProps?: Partial<import("./Component-c76d6398").HeaderProps> | undefined;
46
+ /**
47
+ * Дополнительные пропсы модалки
48
+ */
49
+ modalProps?: Partial<import("./typings-bdb4c6b9").ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
50
+ /**
51
+ * Дополнительные пропсы футера модалки
52
+ */
53
+ modalFooterProps?: Partial<import("./Component.mobile-f1f15074").FooterProps> | undefined;
54
+ showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
55
+ /**
56
+ * Использовать ли хук useSelectWithApply
57
+ */
58
+ useWithApplyHook?: boolean | undefined;
59
+ } & React.RefAttributes<unknown>>;
60
+ export { SelectModalMobileProps, SelectModalMobile };
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { BaseFormControlProps } from "./index-ebda875c";
4
+ type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
5
+ /**
6
+ * Контрольная точка, с нее начинается desktop версия
7
+ * @default 1024
8
+ */
9
+ breakpoint?: number;
10
+ /**
11
+ * Значение по-умолчанию для хука useMatchMedia
12
+ */
13
+ defaultMatchMediaValue?: boolean | (() => boolean);
14
+ };
15
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
16
+ /**
17
+ * Контрольная точка, с нее начинается desktop версия
18
+ * @default 1024
19
+ */
20
+ breakpoint?: number | undefined;
21
+ /**
22
+ * Значение по-умолчанию для хука useMatchMedia
23
+ */
24
+ defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
25
+ } & React.RefAttributes<HTMLDivElement>>;
26
+ export { FormControlProps, FormControl };
@@ -0,0 +1,46 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ declare const InternationalPhoneInput: React.ForwardRefExoticComponent<(({
4
+ country?: import("./types").Country | undefined;
5
+ countries?: string[] | undefined;
6
+ defaultIso2?: string | undefined;
7
+ clearableCountryCode?: boolean | undefined;
8
+ countrySelectProps?: import("./components/country-select/index").SharedCountrySelectProps | undefined;
9
+ clear?: boolean | undefined;
10
+ filterFn?: ((value: string | undefined, option: import("./typings-dd8ca091").OptionShape) => boolean) | undefined;
11
+ onCountryChange?: ((country?: import("./types").Country | undefined) => void) | undefined;
12
+ onChange?: ((e: React.ChangeEvent<HTMLInputElement> | null, { value }: {
13
+ value: string;
14
+ }) => void) | undefined;
15
+ onBlur?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
16
+ onFocus?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
17
+ } & {
18
+ options?: undefined;
19
+ } & Omit<import("./Component.desktop-d873d97d").InputDesktopProps, "onFocus" | "onBlur" | "onChange" | "clear" | "onClear"> & {
20
+ options?: undefined;
21
+ } & Omit<import("./Component.mobile-ebda875c").InputMobileProps, "onFocus" | "onBlur" | "onChange" | "clear" | "onClear"> & {
22
+ breakpoint?: number | undefined;
23
+ defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
24
+ }) | ({
25
+ country?: import("./types").Country | undefined;
26
+ countries?: string[] | undefined;
27
+ defaultIso2?: string | undefined;
28
+ clearableCountryCode?: boolean | undefined;
29
+ countrySelectProps?: import("./components/country-select/index").SharedCountrySelectProps | undefined;
30
+ clear?: boolean | undefined;
31
+ filterFn?: ((value: string | undefined, option: import("./typings-dd8ca091").OptionShape) => boolean) | undefined;
32
+ onCountryChange?: ((country?: import("./types").Country | undefined) => void) | undefined;
33
+ onChange?: ((e: React.ChangeEvent<HTMLInputElement> | null, { value }: {
34
+ value: string;
35
+ }) => void) | undefined;
36
+ onBlur?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
37
+ onFocus?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
38
+ } & {
39
+ options: (import("./typings-dd8ca091").OptionShape | import("./typings-dd8ca091").GroupShape)[];
40
+ } & Omit<import("./Component.desktop-d078a845").InputAutocompleteDesktopProps, "onChange"> & {
41
+ options: (import("./typings-dd8ca091").OptionShape | import("./typings-dd8ca091").GroupShape)[];
42
+ } & Omit<import("./Component.mobile-4cd3936b").InputAutocompleteMobileProps, "onChange" | "filter" | "onFilter" | "onClearFilter"> & {
43
+ breakpoint?: number | undefined;
44
+ defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
45
+ })) & React.RefAttributes<HTMLInputElement>>;
46
+ export { InternationalPhoneInput };
@@ -0,0 +1,35 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { useMatchMedia } from '@alfalab/core-components-mq/esm';
4
+ import { InternationalPhoneInputDesktop } from './Component.desktop.js';
5
+ import { InternationalPhoneInputMobile } from './Component.mobile.js';
6
+ import '@alfalab/core-components-input/esm/Component.desktop';
7
+ import '@alfalab/core-components-input-autocomplete/esm/desktop';
8
+ import '@alfalab/core-components-select/esm/desktop';
9
+ import './components/base-international-phone-input/Component.js';
10
+ import 'react-merge-refs';
11
+ import '@maskito/core';
12
+ import '@maskito/react';
13
+ import '@alfalab/core-components-select/esm/shared';
14
+ import './utils/index.js';
15
+ import '@alfalab/core-components-shared/esm';
16
+ import './consts.js';
17
+ import './data/country-data.js';
18
+ import './components/country-select/Component.js';
19
+ import '@alfalab/icons-glyph/WorldMagnifierMIcon';
20
+ import './components/flag-icon/component.js';
21
+ import 'classnames';
22
+ import './components/flag-icon/flagSprite.js';
23
+ import './components/select-field/component.js';
24
+ import '@alfalab/hooks';
25
+ import '@alfalab/core-components-input/esm/mobile';
26
+ import '@alfalab/core-components-input-autocomplete/esm/mobile';
27
+ import '@alfalab/core-components-select/esm/mobile';
28
+
29
+ var InternationalPhoneInput = React.forwardRef(function (_a, ref) {
30
+ var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, defaultMatchMediaValue = _a.defaultMatchMediaValue, restProps = __rest(_a, ["breakpoint", "defaultMatchMediaValue"]);
31
+ var isDesktop = useMatchMedia("(min-width: ".concat(breakpoint, "px)"), defaultMatchMediaValue)[0];
32
+ return isDesktop ? (React.createElement(InternationalPhoneInputDesktop, __assign({}, restProps, { ref: ref }))) : (React.createElement(InternationalPhoneInputMobile, __assign({}, restProps, { ref: ref })));
33
+ });
34
+
35
+ export { InternationalPhoneInput };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { BaseModalContext } from "./index-bdb4c6b9";
3
+ declare const ModalContext: import("react").Context<BaseModalContext>;
4
+ export { ModalContext };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { TResponsiveModalContext } from "./typings-bdb4c6b9";
4
+ declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
5
+ export { ResponsiveContext };
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { InputAutocompleteProps } from "@alfalab/core-components-input-autocomplete";
4
+ import { Country } from "../../types";
5
+ declare const BaseInternationalPhoneInput: React.ForwardRefExoticComponent<{
6
+ country?: Country | undefined;
7
+ countries?: string[] | undefined;
8
+ defaultIso2?: string | undefined;
9
+ clearableCountryCode?: boolean | undefined;
10
+ countrySelectProps?: import("../country-select/index").SharedCountrySelectProps | undefined;
11
+ clear?: boolean | undefined;
12
+ filterFn?: ((value: string | undefined, option: import("../../typings-dd8ca091").OptionShape) => boolean) | undefined;
13
+ onCountryChange?: ((country?: Country | undefined) => void) | undefined;
14
+ onChange?: ((e: React.ChangeEvent<HTMLInputElement> | null, { value }: {
15
+ value: string;
16
+ }) => void) | undefined;
17
+ onBlur?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
18
+ onFocus?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
19
+ } & {
20
+ Input: React.FC<import("packages/input/src").InputProps>;
21
+ InputAutocomplete: React.FC<InputAutocompleteProps>;
22
+ SelectComponent: React.ElementType<any>;
23
+ view: "mobile" | "desktop";
24
+ countriesData: Country[][];
25
+ } & Omit<import("packages/input/src").InputProps, "onFocus" | "onBlur" | "onScroll"> & Partial<Omit<InputAutocompleteProps, "leftAddons" | "onChange" | "onScroll">> & React.RefAttributes<HTMLInputElement>>;
26
+ export { BaseInternationalPhoneInput };
@@ -0,0 +1,89 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React, { forwardRef, useRef, useMemo, useEffect } from 'react';
3
+ import mergeRefs from 'react-merge-refs';
4
+ import { maskitoTransform } from '@maskito/core';
5
+ import { useMaskito } from '@maskito/react';
6
+ import { BaseOption } from '@alfalab/core-components-select/esm/shared';
7
+ import { createMaskOptions, getPhoneData } from '../../utils/index.js';
8
+ import { CountrySelect } from '../country-select/Component.js';
9
+ import '@alfalab/core-components-shared/esm';
10
+ import '../../consts.js';
11
+ import '../../data/country-data.js';
12
+ import '@alfalab/icons-glyph/WorldMagnifierMIcon';
13
+ import '../flag-icon/component.js';
14
+ import 'classnames';
15
+ import '../flag-icon/flagSprite.js';
16
+ import '../select-field/component.js';
17
+ import '@alfalab/hooks';
18
+
19
+ var styles = {"component":"international-phone-input__component_18u8d","addons":"international-phone-input__addons_18u8d"};
20
+ require('./index.css')
21
+
22
+ var BaseInternationalPhoneInput = forwardRef(function (_a, ref) {
23
+ var clearableCountryCode = _a.clearableCountryCode, value = _a.value, country = _a.country, onChange = _a.onChange, onCountryChange = _a.onCountryChange, countrySelectProps = _a.countrySelectProps; _a.countries; var defaultIso2 = _a.defaultIso2, disabled = _a.disabled, options = _a.options, _b = _a.size, size = _b === void 0 ? 'm' : _b, Input = _a.Input, InputAutocomplete = _a.InputAutocomplete, SelectComponent = _a.SelectComponent, view = _a.view, bottomSheetHeaderAddonsProps = _a.bottomSheetHeaderAddonsProps, countriesData = _a.countriesData, clear = _a.clear, restProps = __rest(_a, ["clearableCountryCode", "value", "country", "onChange", "onCountryChange", "countrySelectProps", "countries", "defaultIso2", "disabled", "options", "size", "Input", "InputAutocomplete", "SelectComponent", "view", "bottomSheetHeaderAddonsProps", "countriesData", "clear"]);
24
+ var inputRef = useRef(null);
25
+ var inputWrapperRef = useRef(null);
26
+ var maskOptions = useMemo(function () { return createMaskOptions(country, clearableCountryCode); }, [country, clearableCountryCode]);
27
+ var maskRef = useMaskito({ options: maskOptions });
28
+ var changeNumber = function (e, phone) {
29
+ onChange === null || onChange === void 0 ? void 0 : onChange(e, { value: phone });
30
+ };
31
+ var updatePhoneData = function (phone, e) {
32
+ var _a = getPhoneData(phone, countriesData, defaultIso2), nextCountry = _a.nextCountry, nextPhone = _a.nextPhone;
33
+ if (nextCountry !== country) {
34
+ onCountryChange === null || onCountryChange === void 0 ? void 0 : onCountryChange(nextCountry);
35
+ }
36
+ changeNumber(e, nextPhone);
37
+ };
38
+ var handleSelectCountry = function (_a) {
39
+ var selected = _a.selected;
40
+ var nextCountry = selected === null || selected === void 0 ? void 0 : selected.value;
41
+ onCountryChange === null || onCountryChange === void 0 ? void 0 : onCountryChange(nextCountry);
42
+ if (nextCountry) {
43
+ changeNumber(null, "+".concat(nextCountry.dialCode));
44
+ }
45
+ requestAnimationFrame(function () { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
46
+ };
47
+ var handleOptionSelect = function (payload) {
48
+ var _a;
49
+ updatePhoneData(maskitoTransform(typeof payload === 'string' ? payload : ((_a = payload.selected) === null || _a === void 0 ? void 0 : _a.key) || '', maskOptions), null);
50
+ };
51
+ var handleInput = function (e) {
52
+ updatePhoneData(e.target.value, e);
53
+ };
54
+ var handleClear = function () {
55
+ if (clearableCountryCode) {
56
+ changeNumber(null, '');
57
+ }
58
+ else {
59
+ changeNumber(null, "+".concat(country === null || country === void 0 ? void 0 : country.countryCode) || '');
60
+ }
61
+ };
62
+ useEffect(function () {
63
+ if (value) {
64
+ var newValue = maskitoTransform(value, maskOptions);
65
+ if (value !== newValue) {
66
+ updatePhoneData(newValue, null);
67
+ }
68
+ }
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
+ }, [value, maskOptions]);
71
+ var inputProps = {
72
+ className: styles.component,
73
+ ref: mergeRefs([maskRef, ref, inputRef]),
74
+ wrapperRef: inputWrapperRef,
75
+ addonsClassName: styles.addons,
76
+ type: 'tel',
77
+ };
78
+ var renderCountrySelect = function () {
79
+ var _a;
80
+ return (React.createElement(CountrySelect, __assign({}, countrySelectProps, { view: view, SelectComponent: SelectComponent, disabled: disabled || (countrySelectProps === null || countrySelectProps === void 0 ? void 0 : countrySelectProps.disabled), onChange: handleSelectCountry, country: country, countries: countriesData, fieldWidth: (_a = inputWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width })));
81
+ };
82
+ return Array.isArray(options) ? (React.createElement(InputAutocomplete, __assign({ closeOnSelect: true, Option: BaseOption, size: size }, restProps, { disabled: disabled, options: options, value: value, onChange: handleOptionSelect, bottomSheetHeaderAddonsProps: __assign(__assign({}, bottomSheetHeaderAddonsProps), inputProps), inputProps: __assign(__assign({}, inputProps), { clear: clear, onClear: handleClear, leftAddons: renderCountrySelect(), onInput: handleInput }), fieldProps: {
83
+ className: inputProps.className,
84
+ addonsClassName: inputProps.addonsClassName,
85
+ leftAddons: renderCountrySelect(),
86
+ } }))) : (React.createElement(Input, __assign({}, restProps, inputProps, { onClear: clear ? handleClear : undefined, clear: clear, leftAddons: renderCountrySelect(), size: size, onInput: handleInput, value: value, disabled: disabled })));
87
+ });
88
+
89
+ export { BaseInternationalPhoneInput };
@@ -0,0 +1,5 @@
1
+ /* hash: oxfst */
2
+
3
+ .international-phone-input__component_18u8d .international-phone-input__addons_18u8d {
4
+ padding-left: 0;
5
+ }
@@ -0,0 +1 @@
1
+ export { BaseInternationalPhoneInput } from "./Component";
@@ -0,0 +1,18 @@
1
+ export { BaseInternationalPhoneInput } from './Component.js';
2
+ import 'tslib';
3
+ import 'react';
4
+ import 'react-merge-refs';
5
+ import '@maskito/core';
6
+ import '@maskito/react';
7
+ import '@alfalab/core-components-select/esm/shared';
8
+ import '../../utils/index.js';
9
+ import '@alfalab/core-components-shared/esm';
10
+ import '../../consts.js';
11
+ import '../../data/country-data.js';
12
+ import '../country-select/Component.js';
13
+ import '@alfalab/icons-glyph/WorldMagnifierMIcon';
14
+ import '../flag-icon/component.js';
15
+ import 'classnames';
16
+ import '../flag-icon/flagSprite.js';
17
+ import '../select-field/component.js';
18
+ import '@alfalab/hooks';
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ElementType } from "react";
4
+ import { BaseSelectProps } from "../../shared-4cd3936b";
5
+ import { Country } from "../../types";
6
+ type SharedCountrySelectProps = Omit<BaseSelectProps, 'fieldProps' | 'options' | 'Field' | 'OptionsList' | 'selected'> & {
7
+ /**
8
+ * Пропсы, которые будут прокинуты в компонент поля
9
+ */
10
+ fieldProps?: Record<string, unknown>;
11
+ hideCountrySelect?: boolean;
12
+ };
13
+ type CountrySelectProps = SharedCountrySelectProps & {
14
+ countries?: Country[][];
15
+ country?: Country;
16
+ fieldWidth?: number;
17
+ view: 'desktop' | 'mobile';
18
+ SelectComponent: ElementType;
19
+ };
20
+ declare const CountrySelect: React.FC<CountrySelectProps>;
21
+ export { SharedCountrySelectProps, CountrySelect };