pay-sdk-react 1.1.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 (367) hide show
  1. package/README.md +1059 -0
  2. package/README.zh-CN.md +1061 -0
  3. package/dist/css/index.css +1 -0
  4. package/dist/es/Airwallex/airwallex-button.d.ts +4 -0
  5. package/dist/es/Airwallex/airwallex-button.js +86 -0
  6. package/dist/es/Airwallex/airwallex-modal.d.ts +6 -0
  7. package/dist/es/Airwallex/airwallex-modal.js +63 -0
  8. package/dist/es/Airwallex/airwallex-popup.d.ts +6 -0
  9. package/dist/es/Airwallex/airwallex-popup.js +74 -0
  10. package/dist/es/Airwallex/airwallex.d.ts +6 -0
  11. package/dist/es/Airwallex/airwallex.js +77 -0
  12. package/dist/es/Airwallex/index.d.ts +12 -0
  13. package/dist/es/Airwallex/index.js +10 -0
  14. package/dist/es/Airwallex/interface.d.ts +75 -0
  15. package/dist/es/Airwallex/interface.js +1 -0
  16. package/dist/es/Airwallex/style/index.css +1 -0
  17. package/dist/es/Airwallex/style/index.d.ts +1 -0
  18. package/dist/es/Airwallex/style/index.js +1 -0
  19. package/dist/es/Alipay/alipay-button.d.ts +6 -0
  20. package/dist/es/Alipay/alipay-button.js +52 -0
  21. package/dist/es/Alipay/alipay-modal.d.ts +6 -0
  22. package/dist/es/Alipay/alipay-modal.js +45 -0
  23. package/dist/es/Alipay/alipay.d.ts +4 -0
  24. package/dist/es/Alipay/alipay.js +44 -0
  25. package/dist/es/Alipay/index.d.ts +10 -0
  26. package/dist/es/Alipay/index.js +8 -0
  27. package/dist/es/Alipay/interface.d.ts +53 -0
  28. package/dist/es/Alipay/interface.js +1 -0
  29. package/dist/es/Alipay/style/index.css +1 -0
  30. package/dist/es/Alipay/style/index.d.ts +3 -0
  31. package/dist/es/Alipay/style/index.js +3 -0
  32. package/dist/es/Button/button.d.ts +21 -0
  33. package/dist/es/Button/button.js +74 -0
  34. package/dist/es/Button/index.d.ts +3 -0
  35. package/dist/es/Button/index.js +3 -0
  36. package/dist/es/Button/interface.d.ts +21 -0
  37. package/dist/es/Button/interface.js +1 -0
  38. package/dist/es/Button/style/index.css +1 -0
  39. package/dist/es/Button/style/index.d.ts +1 -0
  40. package/dist/es/Button/style/index.js +1 -0
  41. package/dist/es/FullScreenLoading/index.d.ts +4 -0
  42. package/dist/es/FullScreenLoading/index.js +116 -0
  43. package/dist/es/FullScreenLoading/interface.d.ts +43 -0
  44. package/dist/es/FullScreenLoading/interface.js +1 -0
  45. package/dist/es/FullScreenLoading/style/index.css +1 -0
  46. package/dist/es/FullScreenLoading/style/index.d.ts +1 -0
  47. package/dist/es/FullScreenLoading/style/index.js +1 -0
  48. package/dist/es/MAlipay/index.d.ts +8 -0
  49. package/dist/es/MAlipay/index.js +6 -0
  50. package/dist/es/MAlipay/interface.d.ts +44 -0
  51. package/dist/es/MAlipay/interface.js +1 -0
  52. package/dist/es/MAlipay/m-alipay-auto-submit.d.ts +6 -0
  53. package/dist/es/MAlipay/m-alipay-auto-submit.js +37 -0
  54. package/dist/es/MAlipay/m-alipay-button.d.ts +6 -0
  55. package/dist/es/MAlipay/m-alipay-button.js +127 -0
  56. package/dist/es/MAlipay/style/index.css +1 -0
  57. package/dist/es/MAlipay/style/index.d.ts +1 -0
  58. package/dist/es/MAlipay/style/index.js +1 -0
  59. package/dist/es/MWeChat/index.d.ts +2 -0
  60. package/dist/es/MWeChat/index.js +2 -0
  61. package/dist/es/MWeChat/interface.d.ts +50 -0
  62. package/dist/es/MWeChat/interface.js +1 -0
  63. package/dist/es/MWeChat/m-wechat-button.d.ts +6 -0
  64. package/dist/es/MWeChat/m-wechat-button.js +117 -0
  65. package/dist/es/MWeChat/style/index.css +1 -0
  66. package/dist/es/MWeChat/style/index.d.ts +1 -0
  67. package/dist/es/MWeChat/style/index.js +1 -0
  68. package/dist/es/Mask/index.d.ts +3 -0
  69. package/dist/es/Mask/index.js +3 -0
  70. package/dist/es/Mask/interface.d.ts +81 -0
  71. package/dist/es/Mask/interface.js +1 -0
  72. package/dist/es/Mask/mask.d.ts +5 -0
  73. package/dist/es/Mask/mask.js +97 -0
  74. package/dist/es/Mask/style/index.css +1 -0
  75. package/dist/es/Mask/style/index.d.ts +1 -0
  76. package/dist/es/Mask/style/index.js +1 -0
  77. package/dist/es/PayButton/index.d.ts +5 -0
  78. package/dist/es/PayButton/index.js +57 -0
  79. package/dist/es/PayButton/interface.d.ts +130 -0
  80. package/dist/es/PayButton/interface.js +93 -0
  81. package/dist/es/PayMask/index.d.ts +3 -0
  82. package/dist/es/PayMask/index.js +3 -0
  83. package/dist/es/PayMask/interface.d.ts +56 -0
  84. package/dist/es/PayMask/interface.js +1 -0
  85. package/dist/es/PayMask/pay-mask.d.ts +5 -0
  86. package/dist/es/PayMask/pay-mask.js +92 -0
  87. package/dist/es/PayMask/style/index.css +1 -0
  88. package/dist/es/PayMask/style/index.d.ts +1 -0
  89. package/dist/es/PayMask/style/index.js +1 -0
  90. package/dist/es/Paypal/index.d.ts +2 -0
  91. package/dist/es/Paypal/index.js +2 -0
  92. package/dist/es/Paypal/interface.d.ts +42 -0
  93. package/dist/es/Paypal/interface.js +1 -0
  94. package/dist/es/Paypal/paypal-button.d.ts +6 -0
  95. package/dist/es/Paypal/paypal-button.js +75 -0
  96. package/dist/es/Paypal/style/index.css +1 -0
  97. package/dist/es/Paypal/style/index.d.ts +1 -0
  98. package/dist/es/Paypal/style/index.js +1 -0
  99. package/dist/es/Payssion/index.d.ts +2 -0
  100. package/dist/es/Payssion/index.js +2 -0
  101. package/dist/es/Payssion/interface.d.ts +38 -0
  102. package/dist/es/Payssion/interface.js +1 -0
  103. package/dist/es/Payssion/payssion-button.d.ts +6 -0
  104. package/dist/es/Payssion/payssion-button.js +75 -0
  105. package/dist/es/Payssion/style/index.css +1 -0
  106. package/dist/es/Payssion/style/index.d.ts +1 -0
  107. package/dist/es/Payssion/style/index.js +1 -0
  108. package/dist/es/Stripe/index.d.ts +12 -0
  109. package/dist/es/Stripe/index.js +10 -0
  110. package/dist/es/Stripe/interface.d.ts +91 -0
  111. package/dist/es/Stripe/interface.js +1 -0
  112. package/dist/es/Stripe/stripe-button.d.ts +6 -0
  113. package/dist/es/Stripe/stripe-button.js +65 -0
  114. package/dist/es/Stripe/stripe-modal.d.ts +6 -0
  115. package/dist/es/Stripe/stripe-modal.js +50 -0
  116. package/dist/es/Stripe/stripe-popup.d.ts +6 -0
  117. package/dist/es/Stripe/stripe-popup.js +61 -0
  118. package/dist/es/Stripe/stripe.d.ts +5 -0
  119. package/dist/es/Stripe/stripe.js +38 -0
  120. package/dist/es/Stripe/style/index.css +1 -0
  121. package/dist/es/Stripe/style/index.d.ts +1 -0
  122. package/dist/es/Stripe/style/index.js +1 -0
  123. package/dist/es/Wechat/index.d.ts +10 -0
  124. package/dist/es/Wechat/index.js +8 -0
  125. package/dist/es/Wechat/interface.d.ts +69 -0
  126. package/dist/es/Wechat/interface.js +1 -0
  127. package/dist/es/Wechat/style/index.css +1 -0
  128. package/dist/es/Wechat/style/index.d.ts +1 -0
  129. package/dist/es/Wechat/style/index.js +1 -0
  130. package/dist/es/Wechat/wechat-button.d.ts +6 -0
  131. package/dist/es/Wechat/wechat-button.js +50 -0
  132. package/dist/es/Wechat/wechat-modal.d.ts +6 -0
  133. package/dist/es/Wechat/wechat-modal.js +45 -0
  134. package/dist/es/Wechat/wechat.d.ts +4 -0
  135. package/dist/es/Wechat/wechat.js +40 -0
  136. package/dist/es/confirm-modal/index.d.ts +5 -0
  137. package/dist/es/confirm-modal/index.js +52 -0
  138. package/dist/es/confirm-modal/interface.d.ts +21 -0
  139. package/dist/es/confirm-modal/interface.js +1 -0
  140. package/dist/es/confirm-modal/style/index.css +1 -0
  141. package/dist/es/confirm-modal/style/index.d.ts +1 -0
  142. package/dist/es/confirm-modal/style/index.js +1 -0
  143. package/dist/es/dot-loading/dot-loading.d.ts +4 -0
  144. package/dist/es/dot-loading/dot-loading.js +60 -0
  145. package/dist/es/dot-loading/index.d.ts +3 -0
  146. package/dist/es/dot-loading/index.js +3 -0
  147. package/dist/es/dot-loading/interface.d.ts +4 -0
  148. package/dist/es/dot-loading/interface.js +1 -0
  149. package/dist/es/dot-loading/style/index.css +1 -0
  150. package/dist/es/dot-loading/style/index.d.ts +1 -0
  151. package/dist/es/dot-loading/style/index.js +1 -0
  152. package/dist/es/hooks/use-initialized.d.ts +1 -0
  153. package/dist/es/hooks/use-initialized.js +8 -0
  154. package/dist/es/hooks/use-inner-visible.d.ts +1 -0
  155. package/dist/es/hooks/use-inner-visible.js +9 -0
  156. package/dist/es/hooks/use-lock-scroll.d.ts +2 -0
  157. package/dist/es/hooks/use-lock-scroll.js +82 -0
  158. package/dist/es/hooks/use-touch.d.ts +17 -0
  159. package/dist/es/hooks/use-touch.js +60 -0
  160. package/dist/es/hooks/usePayWindowOpen.d.ts +21 -0
  161. package/dist/es/hooks/usePayWindowOpen.js +87 -0
  162. package/dist/es/icons/IconAlipay/index.d.ts +4 -0
  163. package/dist/es/icons/IconAlipay/index.js +21 -0
  164. package/dist/es/icons/IconClose/index.d.ts +4 -0
  165. package/dist/es/icons/IconClose/index.js +27 -0
  166. package/dist/es/icons/IconPaypalText/index.d.ts +4 -0
  167. package/dist/es/icons/IconPaypalText/index.js +27 -0
  168. package/dist/es/icons/IconPaypalWhite/index.d.ts +4 -0
  169. package/dist/es/icons/IconPaypalWhite/index.js +22 -0
  170. package/dist/es/icons/IconPayssionPay/index.d.ts +4 -0
  171. package/dist/es/icons/IconPayssionPay/index.js +50 -0
  172. package/dist/es/icons/IconStripe/index.d.ts +4 -0
  173. package/dist/es/icons/IconStripe/index.js +22 -0
  174. package/dist/es/icons/IconStripeText/index.d.ts +4 -0
  175. package/dist/es/icons/IconStripeText/index.js +22 -0
  176. package/dist/es/icons/IconWechatPay/index.d.ts +4 -0
  177. package/dist/es/icons/IconWechatPay/index.js +21 -0
  178. package/dist/es/icons/index.d.ts +9 -0
  179. package/dist/es/icons/index.js +9 -0
  180. package/dist/es/icons/interface.d.ts +5 -0
  181. package/dist/es/icons/interface.js +1 -0
  182. package/dist/es/icons/style/index.css +1 -0
  183. package/dist/es/icons/style/index.d.ts +1 -0
  184. package/dist/es/icons/style/index.js +1 -0
  185. package/dist/es/index.d.ts +19 -0
  186. package/dist/es/index.js +10 -0
  187. package/dist/es/pay-modal/index.d.ts +3 -0
  188. package/dist/es/pay-modal/index.js +3 -0
  189. package/dist/es/pay-modal/interface.d.ts +94 -0
  190. package/dist/es/pay-modal/interface.js +1 -0
  191. package/dist/es/pay-modal/pay-modal.d.ts +5 -0
  192. package/dist/es/pay-modal/pay-modal.js +93 -0
  193. package/dist/es/pay-modal/style/index.css +1 -0
  194. package/dist/es/pay-modal/style/index.d.ts +1 -0
  195. package/dist/es/pay-modal/style/index.js +1 -0
  196. package/dist/es/pay-popup/index.d.ts +5 -0
  197. package/dist/es/pay-popup/index.js +156 -0
  198. package/dist/es/pay-popup/interface.d.ts +148 -0
  199. package/dist/es/pay-popup/interface.js +1 -0
  200. package/dist/es/pay-popup/style/index.css +1 -0
  201. package/dist/es/pay-popup/style/index.d.ts +1 -0
  202. package/dist/es/pay-popup/style/index.js +1 -0
  203. package/dist/es/shared/enums/index.d.ts +57 -0
  204. package/dist/es/shared/enums/index.js +58 -0
  205. package/dist/es/shared/index.d.ts +1 -0
  206. package/dist/es/shared/index.js +1 -0
  207. package/dist/es/utils/can-use-dom.d.ts +1 -0
  208. package/dist/es/utils/can-use-dom.js +1 -0
  209. package/dist/es/utils/classNames.d.ts +5 -0
  210. package/dist/es/utils/classNames.js +27 -0
  211. package/dist/es/utils/dom.d.ts +8 -0
  212. package/dist/es/utils/dom.js +80 -0
  213. package/dist/es/utils/get-container.d.ts +2 -0
  214. package/dist/es/utils/get-container.js +5 -0
  215. package/dist/es/utils/get-scroll-parent.d.ts +3 -0
  216. package/dist/es/utils/get-scroll-parent.js +24 -0
  217. package/dist/es/utils/getPrefixCls.d.ts +1 -0
  218. package/dist/es/utils/getPrefixCls.js +3 -0
  219. package/dist/es/utils/is.d.ts +35 -0
  220. package/dist/es/utils/is.js +122 -0
  221. package/dist/es/utils/native-props.d.ts +8 -0
  222. package/dist/es/utils/native-props.js +26 -0
  223. package/dist/es/utils/omit.d.ts +1 -0
  224. package/dist/es/utils/omit.js +15 -0
  225. package/dist/es/utils/qrcode.d.ts +7 -0
  226. package/dist/es/utils/qrcode.js +17 -0
  227. package/dist/es/utils/render-to-container.d.ts +3 -0
  228. package/dist/es/utils/render-to-container.js +10 -0
  229. package/dist/es/utils/should-render.d.ts +10 -0
  230. package/dist/es/utils/should-render.js +12 -0
  231. package/dist/es/utils/supports-passive.d.ts +1 -0
  232. package/dist/es/utils/supports-passive.js +14 -0
  233. package/dist/es/utils/warning.d.ts +1 -0
  234. package/dist/es/utils/warning.js +13 -0
  235. package/dist/es/utils/with-default-props.d.ts +9 -0
  236. package/dist/es/utils/with-default-props.js +33 -0
  237. package/dist/es/utils/with-stop-propagation.d.ts +4 -0
  238. package/dist/es/utils/with-stop-propagation.js +22 -0
  239. package/dist/lib/Airwallex/airwallex-button.js +94 -0
  240. package/dist/lib/Airwallex/airwallex-modal.js +70 -0
  241. package/dist/lib/Airwallex/airwallex-popup.js +81 -0
  242. package/dist/lib/Airwallex/airwallex.js +83 -0
  243. package/dist/lib/Airwallex/index.js +29 -0
  244. package/dist/lib/Airwallex/interface.js +5 -0
  245. package/dist/lib/Airwallex/style/index.css +1 -0
  246. package/dist/lib/Airwallex/style/index.js +3 -0
  247. package/dist/lib/Alipay/alipay-button.js +60 -0
  248. package/dist/lib/Alipay/alipay-modal.js +53 -0
  249. package/dist/lib/Alipay/alipay.js +52 -0
  250. package/dist/lib/Alipay/index.js +27 -0
  251. package/dist/lib/Alipay/interface.js +5 -0
  252. package/dist/lib/Alipay/style/index.css +1 -0
  253. package/dist/lib/Alipay/style/index.js +5 -0
  254. package/dist/lib/Button/button.js +82 -0
  255. package/dist/lib/Button/index.js +22 -0
  256. package/dist/lib/Button/interface.js +5 -0
  257. package/dist/lib/Button/style/index.css +1 -0
  258. package/dist/lib/Button/style/index.js +3 -0
  259. package/dist/lib/FullScreenLoading/index.js +124 -0
  260. package/dist/lib/FullScreenLoading/interface.js +5 -0
  261. package/dist/lib/FullScreenLoading/style/index.css +1 -0
  262. package/dist/lib/FullScreenLoading/style/index.js +3 -0
  263. package/dist/lib/MAlipay/index.js +25 -0
  264. package/dist/lib/MAlipay/interface.js +5 -0
  265. package/dist/lib/MAlipay/m-alipay-auto-submit.js +43 -0
  266. package/dist/lib/MAlipay/m-alipay-button.js +135 -0
  267. package/dist/lib/MAlipay/style/index.css +1 -0
  268. package/dist/lib/MAlipay/style/index.js +3 -0
  269. package/dist/lib/MWeChat/index.js +28 -0
  270. package/dist/lib/MWeChat/interface.js +5 -0
  271. package/dist/lib/MWeChat/m-wechat-button.js +125 -0
  272. package/dist/lib/MWeChat/style/index.css +1 -0
  273. package/dist/lib/MWeChat/style/index.js +3 -0
  274. package/dist/lib/Mask/index.js +22 -0
  275. package/dist/lib/Mask/interface.js +5 -0
  276. package/dist/lib/Mask/mask.js +117 -0
  277. package/dist/lib/Mask/style/index.css +1 -0
  278. package/dist/lib/Mask/style/index.js +3 -0
  279. package/dist/lib/PayButton/index.js +76 -0
  280. package/dist/lib/PayButton/interface.js +3 -0
  281. package/dist/lib/PayMask/index.js +22 -0
  282. package/dist/lib/PayMask/interface.js +5 -0
  283. package/dist/lib/PayMask/pay-mask.js +112 -0
  284. package/dist/lib/PayMask/style/index.css +1 -0
  285. package/dist/lib/PayMask/style/index.js +3 -0
  286. package/dist/lib/Paypal/index.js +28 -0
  287. package/dist/lib/Paypal/interface.js +5 -0
  288. package/dist/lib/Paypal/paypal-button.js +83 -0
  289. package/dist/lib/Paypal/style/index.css +1 -0
  290. package/dist/lib/Paypal/style/index.js +3 -0
  291. package/dist/lib/Payssion/index.js +28 -0
  292. package/dist/lib/Payssion/interface.js +5 -0
  293. package/dist/lib/Payssion/payssion-button.js +83 -0
  294. package/dist/lib/Payssion/style/index.css +1 -0
  295. package/dist/lib/Payssion/style/index.js +3 -0
  296. package/dist/lib/Stripe/index.js +29 -0
  297. package/dist/lib/Stripe/interface.js +5 -0
  298. package/dist/lib/Stripe/stripe-button.js +73 -0
  299. package/dist/lib/Stripe/stripe-modal.js +57 -0
  300. package/dist/lib/Stripe/stripe-popup.js +68 -0
  301. package/dist/lib/Stripe/stripe.js +46 -0
  302. package/dist/lib/Stripe/style/index.css +1 -0
  303. package/dist/lib/Stripe/style/index.js +3 -0
  304. package/dist/lib/Wechat/index.js +27 -0
  305. package/dist/lib/Wechat/interface.js +5 -0
  306. package/dist/lib/Wechat/style/index.css +1 -0
  307. package/dist/lib/Wechat/style/index.js +3 -0
  308. package/dist/lib/Wechat/wechat-button.js +58 -0
  309. package/dist/lib/Wechat/wechat-modal.js +52 -0
  310. package/dist/lib/Wechat/wechat.js +48 -0
  311. package/dist/lib/confirm-modal/index.js +72 -0
  312. package/dist/lib/confirm-modal/interface.js +5 -0
  313. package/dist/lib/confirm-modal/style/index.css +1 -0
  314. package/dist/lib/confirm-modal/style/index.js +3 -0
  315. package/dist/lib/dot-loading/dot-loading.js +67 -0
  316. package/dist/lib/dot-loading/index.js +22 -0
  317. package/dist/lib/dot-loading/interface.js +5 -0
  318. package/dist/lib/dot-loading/style/index.css +1 -0
  319. package/dist/lib/dot-loading/style/index.js +3 -0
  320. package/dist/lib/hooks/use-initialized.js +14 -0
  321. package/dist/lib/hooks/use-inner-visible.js +15 -0
  322. package/dist/lib/hooks/use-lock-scroll.js +88 -0
  323. package/dist/lib/hooks/use-touch.js +66 -0
  324. package/dist/lib/hooks/usePayWindowOpen.js +92 -0
  325. package/dist/lib/icons/IconAlipay/index.js +28 -0
  326. package/dist/lib/icons/IconClose/index.js +34 -0
  327. package/dist/lib/icons/IconPaypalText/index.js +34 -0
  328. package/dist/lib/icons/IconPaypalWhite/index.js +29 -0
  329. package/dist/lib/icons/IconPayssionPay/index.js +57 -0
  330. package/dist/lib/icons/IconStripe/index.js +29 -0
  331. package/dist/lib/icons/IconStripeText/index.js +29 -0
  332. package/dist/lib/icons/IconWechatPay/index.js +28 -0
  333. package/dist/lib/icons/index.js +84 -0
  334. package/dist/lib/icons/interface.js +5 -0
  335. package/dist/lib/icons/style/index.css +1 -0
  336. package/dist/lib/icons/style/index.js +3 -0
  337. package/dist/lib/index.js +92 -0
  338. package/dist/lib/pay-modal/index.js +22 -0
  339. package/dist/lib/pay-modal/interface.js +5 -0
  340. package/dist/lib/pay-modal/pay-modal.js +113 -0
  341. package/dist/lib/pay-modal/style/index.css +1 -0
  342. package/dist/lib/pay-modal/style/index.js +3 -0
  343. package/dist/lib/pay-popup/index.js +176 -0
  344. package/dist/lib/pay-popup/interface.js +5 -0
  345. package/dist/lib/pay-popup/style/index.css +1 -0
  346. package/dist/lib/pay-popup/style/index.js +3 -0
  347. package/dist/lib/shared/enums/index.js +64 -0
  348. package/dist/lib/shared/index.js +16 -0
  349. package/dist/lib/utils/can-use-dom.js +7 -0
  350. package/dist/lib/utils/classNames.js +34 -0
  351. package/dist/lib/utils/dom.js +86 -0
  352. package/dist/lib/utils/get-container.js +11 -0
  353. package/dist/lib/utils/get-scroll-parent.js +30 -0
  354. package/dist/lib/utils/getPrefixCls.js +9 -0
  355. package/dist/lib/utils/is.js +160 -0
  356. package/dist/lib/utils/native-props.js +33 -0
  357. package/dist/lib/utils/omit.js +21 -0
  358. package/dist/lib/utils/qrcode.js +23 -0
  359. package/dist/lib/utils/render-to-container.js +16 -0
  360. package/dist/lib/utils/should-render.js +20 -0
  361. package/dist/lib/utils/supports-passive.js +20 -0
  362. package/dist/lib/utils/warning.js +19 -0
  363. package/dist/lib/utils/with-default-props.js +40 -0
  364. package/dist/lib/utils/with-stop-propagation.js +29 -0
  365. package/dist/umd/pay-sdk-react.umd.js +16360 -0
  366. package/dist/umd/pay-sdk-react.umd.js.map +1 -0
  367. package/package.json +181 -0
@@ -0,0 +1,156 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import cs from '../utils/classNames';
8
+ import React, { useState, useRef } from 'react';
9
+ import { useIsomorphicLayoutEffect, useUnmountedRef } from 'ahooks';
10
+ import { withNativeProps } from '../utils/native-props';
11
+ import { useLockScroll } from '../hooks/use-lock-scroll';
12
+ import { useSpring, animated } from '@react-spring/web';
13
+ import { useDrag } from '@use-gesture/react';
14
+ import { ShouldRender } from '../utils/should-render';
15
+ import { withStopPropagation } from '../utils/with-stop-propagation';
16
+ import { useInnerVisible } from '../hooks/use-inner-visible';
17
+ import { mergeProps } from '../utils/with-default-props';
18
+ import { renderToContainer } from '../utils/render-to-container';
19
+ import Mask from '../Mask';
20
+ import { IconClose } from '../icons';
21
+ import { getPrefixCls } from '../utils/getPrefixCls';
22
+ const classPrefix = getPrefixCls('popup');
23
+ const defaultPopupBaseProps = {
24
+ closeOnMaskClick: true,
25
+ closeIcon: /*#__PURE__*/React.createElement(IconClose, null),
26
+ destroyOnClose: false,
27
+ disableBodyScroll: true,
28
+ forceRender: false,
29
+ getContainer: () => document.body,
30
+ mask: true,
31
+ showCloseButton: false,
32
+ stopPropagation: ['click'],
33
+ visible: false
34
+ };
35
+ const defaultProps = _objectSpread(_objectSpread({}, defaultPopupBaseProps), {}, {
36
+ closeOnSwipe: false,
37
+ position: 'bottom',
38
+ round: false
39
+ });
40
+ const PayPopup = p => {
41
+ const props = mergeProps(defaultProps, p);
42
+ const bodyCls = cs("".concat(classPrefix, "-body"), props.bodyClassName, "".concat(classPrefix, "-body-position-").concat(props.position), {
43
+ ["".concat(classPrefix, "-body-with-close")]: props.showCloseButton,
44
+ ["".concat(classPrefix, "-body-round")]: props.round
45
+ });
46
+ const [active, setActive] = useState(props.visible);
47
+ const ref = useRef(null);
48
+ useLockScroll(ref, props.disableBodyScroll && active ? 'strict' : false);
49
+ useIsomorphicLayoutEffect(() => {
50
+ if (props.visible) {
51
+ setActive(true);
52
+ }
53
+ }, [props.visible]);
54
+ const unmountedRef = useUnmountedRef();
55
+ const {
56
+ percent
57
+ } = useSpring({
58
+ percent: props.visible ? 0 : 100,
59
+ config: {
60
+ precision: 0.1,
61
+ mass: 0.4,
62
+ tension: 300,
63
+ friction: 30
64
+ },
65
+ onRest: () => {
66
+ if (unmountedRef.current) return;
67
+ setActive(props.visible);
68
+ if (props.visible) {
69
+ var _props$afterShow;
70
+ (_props$afterShow = props.afterShow) === null || _props$afterShow === void 0 || _props$afterShow.call(props);
71
+ } else {
72
+ var _props$afterClose;
73
+ (_props$afterClose = props.afterClose) === null || _props$afterClose === void 0 || _props$afterClose.call(props);
74
+ }
75
+ }
76
+ });
77
+ const bind = useDrag(_ref => {
78
+ let {
79
+ swipe: [, swipeY]
80
+ } = _ref;
81
+ if (!props.closeOnSwipe) return;
82
+ if (swipeY === 1 && props.position === 'bottom' || swipeY === -1 && props.position === 'top') {
83
+ var _props$onClose;
84
+ (_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
85
+ }
86
+ }, {
87
+ axis: 'y',
88
+ enabled: ['top', 'bottom'].includes(props.position)
89
+ });
90
+ const maskVisible = useInnerVisible(active && props.visible);
91
+ const node = withStopPropagation(props.stopPropagation, withNativeProps(props, /*#__PURE__*/React.createElement("div", _extends({
92
+ className: classPrefix,
93
+ onClick: props.onClick,
94
+ style: {
95
+ display: active ? undefined : 'none',
96
+ touchAction: ['top', 'bottom'].includes(props.position) ? 'none' : 'auto'
97
+ }
98
+ }, bind()), props.mask && /*#__PURE__*/React.createElement(Mask, {
99
+ visible: maskVisible,
100
+ forceRender: props.forceRender,
101
+ destroyOnClose: props.destroyOnClose,
102
+ onMaskClick: e => {
103
+ var _props$onMaskClick;
104
+ (_props$onMaskClick = props.onMaskClick) === null || _props$onMaskClick === void 0 || _props$onMaskClick.call(props, e);
105
+ if (props.closeOnMaskClick) {
106
+ var _props$onClose2;
107
+ (_props$onClose2 = props.onClose) === null || _props$onClose2 === void 0 || _props$onClose2.call(props);
108
+ }
109
+ },
110
+ className: props.maskClassName,
111
+ style: props.maskStyle,
112
+ disableBodyScroll: false,
113
+ stopPropagation: props.stopPropagation
114
+ }), /*#__PURE__*/React.createElement(animated.div, {
115
+ className: cs("".concat(classPrefix, "-body"), "".concat(classPrefix, "-body-position-").concat(props.position), {
116
+ ["".concat(classPrefix, "-body-with-close")]: props.showCloseButton,
117
+ ["".concat(classPrefix, "-body-round")]: props.round
118
+ }, bodyCls),
119
+ style: _objectSpread(_objectSpread({}, props.bodyStyle), {}, {
120
+ pointerEvents: percent.to(v => v === 0 ? 'unset' : 'none'),
121
+ transform: percent.to(v => {
122
+ if (props.position === 'bottom') {
123
+ return "translate(0, ".concat(v, "%)");
124
+ }
125
+ if (props.position === 'top') {
126
+ return "translate(0, -".concat(v, "%)");
127
+ }
128
+ if (props.position === 'left') {
129
+ return "translate(-".concat(v, "%, 0)");
130
+ }
131
+ if (props.position === 'right') {
132
+ return "translate(".concat(v, "%, 0)");
133
+ }
134
+ return 'none';
135
+ })
136
+ }),
137
+ ref: ref
138
+ }, props.showCloseButton && /*#__PURE__*/React.createElement("a", {
139
+ className: cs("".concat(classPrefix, "-close-icon"), "".concat(classPrefix, "-close-button")),
140
+ onClick: () => {
141
+ var _props$onClose3;
142
+ (_props$onClose3 = props.onClose) === null || _props$onClose3 === void 0 || _props$onClose3.call(props);
143
+ },
144
+ role: "button",
145
+ "aria-label": 'close'
146
+ }, props.closeIcon), /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(classPrefix, "-content")
148
+ }, props.children)))));
149
+ return /*#__PURE__*/React.createElement(ShouldRender, {
150
+ active: active,
151
+ forceRender: props.forceRender,
152
+ destroyOnClose: props.destroyOnClose
153
+ }, renderToContainer(props.getContainer, node));
154
+ };
155
+ export * from './interface';
156
+ export default PayPopup;
@@ -0,0 +1,148 @@
1
+ import { NativeProps } from "../utils/native-props";
2
+ import React, { PropsWithChildren } from "react";
3
+ import { GetContainer } from "../utils/render-to-container";
4
+ import { PropagationEvent } from "../utils/with-stop-propagation";
5
+ export type PopupPosition = "bottom" | "top" | "left" | "right";
6
+ export interface PayPopupBaseProps extends NativeProps<"--z-index"> {
7
+ /**
8
+ * @zh 是否可见
9
+ * @eb Whether to show the popup
10
+ * @default false
11
+ */
12
+ visible?: boolean;
13
+ /**
14
+ * @zh 是否显示遮罩层
15
+ * @en Whether to show the mask
16
+ * @default true
17
+ */
18
+ mask?: boolean;
19
+ /**
20
+ * @zh 关闭时触发
21
+ * @en Triggered when the popup is closed
22
+ */
23
+ onClose?: () => void;
24
+ /**
25
+ * @zh 点击遮罩层时触发
26
+ * @en Triggered when the mask is clicked
27
+ */
28
+ onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
29
+ /**
30
+ * @zh 不可见时是否销毁 DOM 结构
31
+ * @en Whether to destroy the DOM structure when the popup is hidden
32
+ * @default false
33
+ */
34
+ destroyOnClose?: boolean;
35
+ /**
36
+ * @zh 强制渲染内容
37
+ * @en Force render content
38
+ * @default false
39
+ */
40
+ forceRender?: boolean;
41
+ /**
42
+ * @zh 弹出时是否禁止滚动
43
+ * @en Whether to disable scrolling when the popup is displayed
44
+ * @default true
45
+ */
46
+ disableBodyScroll?: boolean;
47
+ /**
48
+ * @zh 指定父级 `DOM`,`false` 则不挂载 `DOM`
49
+ * @en Specify the parent `DOM`, `false` will not mount the `DOM`
50
+ * @default document.body
51
+ */
52
+ getContainer?: GetContainer;
53
+ /**
54
+ * @zh 完全显示后触发
55
+ * @en Triggered after the popup is fully displayed
56
+ */
57
+ afterShow?: () => void;
58
+ /**
59
+ * @zh 完全关闭后触发
60
+ * @en Triggered after the popup is fully closed
61
+ */
62
+ afterClose?: () => void;
63
+ /**
64
+ * @zh 设置阻止冒泡的事件
65
+ * @en Set the event to stop propagation
66
+ * @default ['click']
67
+ */
68
+ stopPropagation?: PropagationEvent[];
69
+ /**
70
+ * @zh 点击内容时触发
71
+ * @en Triggered when the content is clicked
72
+ */
73
+ onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
74
+ /**
75
+ * @zh 弹出位置
76
+ * @en Popup position
77
+ * @default 'bottom'
78
+ */
79
+ position?: PopupPosition;
80
+ /**
81
+ * @zh `popup` 内容区的类名
82
+ * @en The class name of the `popup` content area
83
+ */
84
+ bodyClassName?: string;
85
+ /**
86
+ * @zh `popup` 内容区的样式
87
+ * @en The style of the `popup` content area
88
+ */
89
+ bodyStyle?: React.CSSProperties;
90
+ /**
91
+ * @zh `mask` 遮罩层的类名
92
+ * @en The class name of the `mask`
93
+ */
94
+ maskClassName?: string;
95
+ /**
96
+ * @zh `mask` 遮罩层的样式
97
+ * @en The style of the `mask`
98
+ */
99
+ maskStyle?: React.CSSProperties;
100
+ /**
101
+ * @zh 是否显示关闭按钮
102
+ * @en Whether to show the close button
103
+ * @default false
104
+ */
105
+ showCloseButton?: boolean;
106
+ /**
107
+ * @zh 自定义关闭图标
108
+ * @en Custom close icon
109
+ */
110
+ closeIcon?: React.ReactNode;
111
+ /**
112
+ * @zh 点击遮罩层是否关闭
113
+ * @en Whether to close when the mask is clicked
114
+ * @default true
115
+ */
116
+ closeOnMaskClick?: boolean;
117
+ /**
118
+ * @zh 是否支持手势关闭
119
+ * @en Whether to support gesture to close
120
+ * @default false
121
+ */
122
+ closeOnSwipe?: boolean;
123
+ /**
124
+ * @zh 是否圆角
125
+ * @en Whether to have rounded corners
126
+ * @default false
127
+ */
128
+ round?: boolean;
129
+ /**
130
+ * @zh 自定义 `popup` 内容
131
+ * @en Custom `popup` content
132
+ */
133
+ children?: React.ReactNode;
134
+ }
135
+ export type PayPopupProps = PayPopupBaseProps & PropsWithChildren<{
136
+ /**
137
+ * @zh 弹出位置
138
+ * @en Popup position
139
+ * @default 'bottom'
140
+ */
141
+ position?: PopupPosition;
142
+ /**
143
+ * @zh 是否支持手势关闭
144
+ * @en Whether to support gesture to close
145
+ * @default false
146
+ */
147
+ closeOnSwipe?: boolean;
148
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ .pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-icon{display:inline-block;color:inherit;width:16px;vertical-align:-2px;stroke:currentColor}.pay-icon[fill=currentColor]{fill:currentColor;stroke:none}.pay-icon[stroke=currentColor]{stroke:currentColor;fill:none}.pay-icon[fill=currentColor][stroke=currentColor]{fill:currentColor;stroke:currentColor}.pay-icon-paypal-text{width:64px;height:26px;max-width:72px;max-height:32px}.pay-icon-close{width:18px;height:18px}.pay-icon-stripe-text{width:24px;height:24px}.pay-icon-alipay{width:20px;height:20px}.pay-icon-wechat-pay{width:20px;height:20px}.pay-icon-payssion-pay{width:36px;height:20px}.pay-popup{position:fixed;z-index:1001}.pay-popup-body{position:fixed;display:flex;flex-direction:column;background-color:#fff;z-index:1010;box-sizing:border-box}.pay-popup-body.pay-popup-body-position-bottom{width:100%;left:0;bottom:0}.pay-popup-body.pay-popup-body-position-top{width:100%;left:0;top:0}.pay-popup-body.pay-popup-body-position-left{height:100%;width:80vw;left:0;top:0}.pay-popup-body.pay-popup-body-position-right{height:100%;width:80vw;right:0;top:0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-bottom{border-radius:16px 16px 0 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-top{border-radius:0 0 16px 16px}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-left{border-radius:0 16px 16px 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-right{border-radius:16px 0 0 16px}.pay-popup-close-icon{position:absolute;z-index:1;cursor:pointer;padding:4px;font-size:18px;line-height:1;color:#999}.pay-popup-body.pay-popup-body-position-bottom .pay-popup-close-icon,.pay-popup-body.pay-popup-body-position-left .pay-popup-close-icon{top:8px;right:8px}.pay-popup-body.pay-popup-body-position-top .pay-popup-close-icon{bottom:8px;right:8px}.pay-popup-body.pay-popup-body-position-right .pay-popup-close-icon{top:8px;left:8px}.pay-popup-content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-bottom .pay-popup-content,.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-left .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-right .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-top .pay-popup-content{padding-bottom:40px}
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1,57 @@
1
+ export declare enum PaymentMethod {
2
+ /**
3
+ * @zh 微信(pc)
4
+ * @en Wechat(pc)
5
+ */
6
+ WechatPc = "wechat-pc",
7
+ /**
8
+ * @zh 支付宝(pc)
9
+ * @en Alipay(pc)
10
+ */
11
+ AlipayPc = "alipay-pc",
12
+ /**
13
+ * @zh paypal(pc)
14
+ * @en Paypal(pc)
15
+ */
16
+ PaypalPc = "paypal-pc",
17
+ /**
18
+ * @zh stripe(pc)
19
+ * @en Stripe(pc)
20
+ */
21
+ StripePc = "stripe-pc",
22
+ /**
23
+ * @zh 微信(H5)
24
+ * @en Wechat(H5)
25
+ */
26
+ WechatH5 = "wechat-h5",
27
+ /**
28
+ * @zh 支付宝(H5)
29
+ * @en Alipay(H5)
30
+ */
31
+ AlipayH5 = "alipay-h5",
32
+ /**
33
+ * @zh paypal(H5)
34
+ * @en Paypal(H5)
35
+ */
36
+ PaypalH5 = "paypal-h5",
37
+ /**
38
+ * @zh 微信内部(H5)
39
+ * @en Wechat inside(H5)
40
+ */
41
+ WechatInsideH5 = "wechat-inside-h5",
42
+ /**
43
+ * @zh stripe(H5)
44
+ * @en Stripe(H5)
45
+ */
46
+ StripeH5 = "stripe-h5",
47
+ /**
48
+ * @zh payssion支付
49
+ * @en Payssion
50
+ */
51
+ Payssion = "payssion",
52
+ /**
53
+ * @zh 空中云汇
54
+ * @en Airwallex
55
+ */
56
+ Airwallex = "airwallex"
57
+ }
@@ -0,0 +1,58 @@
1
+ export let PaymentMethod = /*#__PURE__*/function (PaymentMethod) {
2
+ /**
3
+ * @zh 微信(pc)
4
+ * @en Wechat(pc)
5
+ */
6
+ PaymentMethod["WechatPc"] = "wechat-pc";
7
+ /**
8
+ * @zh 支付宝(pc)
9
+ * @en Alipay(pc)
10
+ */
11
+ PaymentMethod["AlipayPc"] = "alipay-pc";
12
+ /**
13
+ * @zh paypal(pc)
14
+ * @en Paypal(pc)
15
+ */
16
+ PaymentMethod["PaypalPc"] = "paypal-pc";
17
+ /**
18
+ * @zh stripe(pc)
19
+ * @en Stripe(pc)
20
+ */
21
+ PaymentMethod["StripePc"] = "stripe-pc";
22
+ /**
23
+ * @zh 微信(H5)
24
+ * @en Wechat(H5)
25
+ */
26
+ PaymentMethod["WechatH5"] = "wechat-h5";
27
+ /**
28
+ * @zh 支付宝(H5)
29
+ * @en Alipay(H5)
30
+ */
31
+ PaymentMethod["AlipayH5"] = "alipay-h5";
32
+ /**
33
+ * @zh paypal(H5)
34
+ * @en Paypal(H5)
35
+ */
36
+ PaymentMethod["PaypalH5"] = "paypal-h5";
37
+ /**
38
+ * @zh 微信内部(H5)
39
+ * @en Wechat inside(H5)
40
+ */
41
+ PaymentMethod["WechatInsideH5"] = "wechat-inside-h5";
42
+ /**
43
+ * @zh stripe(H5)
44
+ * @en Stripe(H5)
45
+ */
46
+ PaymentMethod["StripeH5"] = "stripe-h5";
47
+ /**
48
+ * @zh payssion支付
49
+ * @en Payssion
50
+ */
51
+ PaymentMethod["Payssion"] = "payssion";
52
+ /**
53
+ * @zh 空中云汇
54
+ * @en Airwallex
55
+ */
56
+ PaymentMethod["Airwallex"] = "airwallex";
57
+ return PaymentMethod;
58
+ }({});
@@ -0,0 +1 @@
1
+ export * from "./enums";
@@ -0,0 +1 @@
1
+ export * from "./enums";
@@ -0,0 +1 @@
1
+ export declare const canUseDom: boolean;
@@ -0,0 +1 @@
1
+ export const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
@@ -0,0 +1,5 @@
1
+ type ClassNamesArg = string | string[] | {
2
+ [key: string]: any;
3
+ } | undefined | null | boolean;
4
+ export default function (...args: ClassNamesArg[]): string;
5
+ export {};
@@ -0,0 +1,27 @@
1
+ import { isArray, isObject, isString } from "./is";
2
+ import warning from "./warning";
3
+ // eslint-disable-next-line import/no-anonymous-default-export
4
+ export default function () {
5
+ const length = arguments.length;
6
+ let classNames = [];
7
+ for (let i = 0; i < length; i++) {
8
+ const v = i < 0 || arguments.length <= i ? undefined : arguments[i];
9
+ if (!v) {
10
+ continue;
11
+ }
12
+ if (isString(v)) {
13
+ classNames.push(v);
14
+ } else if (isArray(v)) {
15
+ classNames = classNames.concat(v);
16
+ } else if (isObject(v)) {
17
+ Object.keys(v).forEach(k => {
18
+ if (v[k]) {
19
+ classNames.push(k);
20
+ }
21
+ });
22
+ } else {
23
+ warning(true, "arguments must be one of string/array/object.");
24
+ }
25
+ }
26
+ return [...new Set(classNames)].join(" ");
27
+ }
@@ -0,0 +1,8 @@
1
+ export declare const isServerRendering: boolean;
2
+ export declare const clientWindow: (Window & typeof globalThis) | undefined;
3
+ export declare const clientDocument: Document | undefined;
4
+ export declare const localStorage: Storage | (() => void);
5
+ export declare const location: (() => void) | ((action: keyof Location, value?: any) => string | undefined);
6
+ export declare const open: (url: string, target?: string) => void;
7
+ export declare const on: (element: EventTarget | null, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void;
8
+ export declare const off: (element: EventTarget | null, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void;
@@ -0,0 +1,80 @@
1
+ const NOOP = () => {};
2
+ export const isServerRendering = function () {
3
+ try {
4
+ return !(typeof window !== "undefined" && document !== undefined);
5
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
+ } catch (e) {
7
+ return true;
8
+ }
9
+ }();
10
+ export const clientWindow = function () {
11
+ if (isServerRendering) {
12
+ return undefined;
13
+ }
14
+ return window;
15
+ }();
16
+ export const clientDocument = function () {
17
+ if (isServerRendering) {
18
+ return undefined;
19
+ }
20
+ return document;
21
+ }();
22
+ export const localStorage = function () {
23
+ if (isServerRendering) {
24
+ return NOOP;
25
+ }
26
+ return window.localStorage;
27
+ }();
28
+ export const location = function () {
29
+ if (isServerRendering) {
30
+ return NOOP;
31
+ }
32
+ return function (action, value) {
33
+ if (action === "replace") {
34
+ window.location.replace(value);
35
+ }
36
+ if (action === "href") {
37
+ window.location.href = value;
38
+ }
39
+ if (action === "reload") {
40
+ window.location.reload();
41
+ }
42
+ if (action === "protocol") {
43
+ return window.location.protocol;
44
+ }
45
+ if (action === "host") {
46
+ return window.location.host;
47
+ }
48
+ if (action === "search") {
49
+ var _window$location$sear;
50
+ return (_window$location$sear = window.location.search) !== null && _window$location$sear !== void 0 ? _window$location$sear : "";
51
+ }
52
+ };
53
+ }();
54
+ export const open = function () {
55
+ if (isServerRendering) {
56
+ return NOOP;
57
+ }
58
+ return function (url) {
59
+ let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_blank";
60
+ window.open(url, target);
61
+ };
62
+ }();
63
+ export const on = function () {
64
+ if (isServerRendering) {
65
+ return NOOP;
66
+ }
67
+ return function (element, event, handler, options) {
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
69
+ element && element.addEventListener(event, handler, options || false);
70
+ };
71
+ }();
72
+ export const off = function () {
73
+ if (isServerRendering) {
74
+ return NOOP;
75
+ }
76
+ return function (element, event, handler, options) {
77
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
78
+ element && element.removeEventListener(event, handler, options || false);
79
+ };
80
+ }();
@@ -0,0 +1,2 @@
1
+ export type GetContainer = () => HTMLElement;
2
+ export declare function resolveContainer(getContainer: HTMLElement | GetContainer | undefined | null): HTMLElement;
@@ -0,0 +1,5 @@
1
+ import { isFunction } from "./is";
2
+ export function resolveContainer(getContainer) {
3
+ const container = isFunction(getContainer) ? getContainer() : getContainer;
4
+ return container || document.body;
5
+ }
@@ -0,0 +1,3 @@
1
+ type ScrollElement = HTMLElement | Window;
2
+ export declare function getScrollParent(el: Element, root?: ScrollElement | null | undefined): Window | Element | null | undefined;
3
+ export {};
@@ -0,0 +1,24 @@
1
+ import { canUseDom } from "./can-use-dom";
2
+ const defaultRoot = canUseDom ? window : undefined;
3
+ const overflowStylePatterns = ["scroll", "auto", "overlay"];
4
+ function isElement(node) {
5
+ const ELEMENT_NODE_TYPE = 1;
6
+ return node.nodeType === ELEMENT_NODE_TYPE;
7
+ }
8
+ export function getScrollParent(el) {
9
+ let root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
10
+ let node = el;
11
+ while (node && node !== root && isElement(node)) {
12
+ if (node === document.body) {
13
+ return root;
14
+ }
15
+ const {
16
+ overflowY
17
+ } = window.getComputedStyle(node);
18
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
19
+ return node;
20
+ }
21
+ node = node.parentNode;
22
+ }
23
+ return root;
24
+ }
@@ -0,0 +1 @@
1
+ export declare function getPrefixCls(componentName: string, customPrefix?: string): string;
@@ -0,0 +1,3 @@
1
+ export function getPrefixCls(componentName, customPrefix) {
2
+ return "".concat(customPrefix || 'pay', "-").concat(componentName);
3
+ }
@@ -0,0 +1,35 @@
1
+ export declare function isArray(obj: any): obj is any[];
2
+ export declare function isObject(obj: any): obj is {
3
+ [key: string]: any;
4
+ };
5
+ export declare function isString(obj: any): obj is string;
6
+ export declare function isNumber(obj: any): obj is number;
7
+ export declare function isRegExp(obj: any): boolean;
8
+ export declare function isFile(obj: any): obj is File;
9
+ export declare function isBlob(obj: any): obj is Blob;
10
+ export declare function isColor(color: string): boolean;
11
+ export declare function isUndefined(obj: any): obj is undefined;
12
+ export declare function isNull(obj: any): obj is null;
13
+ export declare function isNullOrUndefined(obj: any): boolean;
14
+ export declare function isFunction(obj: any): obj is (...args: any[]) => any;
15
+ export declare function isEmptyObject(obj: any): boolean;
16
+ export declare function isEmptyReactNode(content: any, trim?: boolean): boolean;
17
+ export declare function isExist(obj: any): boolean;
18
+ export declare function isWindow(el: any): el is Window;
19
+ export declare function isBoolean(value: any): value is boolean;
20
+ export declare const isReactComponent: (element: any) => boolean;
21
+ export declare const isClassComponent: (element: any) => boolean;
22
+ export declare const isDOMElement: (element: any) => boolean;
23
+ export declare const isLink: (text?: React.ReactNode) => boolean;
24
+ export declare function isImageLinkAvailable(url: string): Promise<boolean>;
25
+ export declare function isMobile(): boolean | undefined;
26
+ export declare function isEmail(email: string): boolean;
27
+ export declare function isSmsCode(code: string): boolean;
28
+ export declare function isUsPhoneNumber(phone: string): boolean;
29
+ export declare function isPromise(obj: unknown): obj is Promise<unknown>;
30
+ /**
31
+ * 判断是否为Android设备
32
+ * @returns 是否为Android设备
33
+ */
34
+ export declare function isAndroid(): boolean;
35
+ export declare function isIOS(): boolean;