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,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {};
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactDom = _interopRequireDefault(require("react-dom"));
10
+ var _is = require("../utils/is");
11
+ var _classNames = _interopRequireDefault(require("../utils/classNames"));
12
+ var _useLockScroll = require("../hooks/use-lock-scroll");
13
+ var _dom = require("../utils/dom");
14
+ var _getPrefixCls = require("../utils/getPrefixCls");
15
+ var _interface = require("./interface");
16
+ Object.keys(_interface).forEach(function (key) {
17
+ if (key === "default" || key === "__esModule") return;
18
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
+ if (key in exports && exports[key] === _interface[key]) return;
20
+ Object.defineProperty(exports, key, {
21
+ enumerable: true,
22
+ get: function () {
23
+ return _interface[key];
24
+ }
25
+ });
26
+ });
27
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
28
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
29
+ const classPrefix = (0, _getPrefixCls.getPrefixCls)('modal');
30
+ const PayModal = props => {
31
+ const {
32
+ visible,
33
+ title,
34
+ desc,
35
+ retryText = '重新支付',
36
+ finishText = '支付完成',
37
+ icon,
38
+ showClose = true,
39
+ maskClosable = false,
40
+ onRetry,
41
+ onFinish,
42
+ onClose,
43
+ children,
44
+ footer,
45
+ className,
46
+ style,
47
+ contentClassName,
48
+ contentStyle,
49
+ container
50
+ } = props;
51
+ const el = (0, _react.useRef)(_dom.clientDocument === null || _dom.clientDocument === void 0 ? void 0 : _dom.clientDocument.createElement('div'));
52
+ const ref = (0, _react.useRef)(null);
53
+ (0, _useLockScroll.useLockScroll)(ref, !!visible);
54
+ (0, _react.useEffect)(() => {
55
+ if (visible) {
56
+ const mountNode = container || document.body;
57
+ const currentEl = el.current;
58
+ if (currentEl) {
59
+ mountNode.appendChild(currentEl);
60
+ }
61
+ return () => {
62
+ if (currentEl && mountNode.contains(currentEl)) {
63
+ mountNode.removeChild(currentEl);
64
+ }
65
+ };
66
+ }
67
+ }, [visible, container]);
68
+ const classNames = (0, _classNames.default)(classPrefix, className);
69
+ const contentClassNames = (0, _classNames.default)("".concat(classPrefix, "__content"), contentClassName);
70
+ const handleMaskClose = (0, _react.useCallback)(() => {
71
+ if (maskClosable) onClose === null || onClose === void 0 || onClose();
72
+ }, [maskClosable, onClose]);
73
+ const renderFooter = () => {
74
+ if (footer === null) return;
75
+ const retryButtonNode = /*#__PURE__*/_react.default.createElement("button", {
76
+ className: "".concat(classPrefix, "__btn ").concat(classPrefix, "__btn--retry"),
77
+ onClick: onRetry
78
+ }, retryText);
79
+ const finishButtonNode = /*#__PURE__*/_react.default.createElement("button", {
80
+ className: "".concat(classPrefix, "__btn ").concat(classPrefix, "__btn--finish"),
81
+ onClick: onFinish
82
+ }, finishText);
83
+ const footerContent = (0, _is.isFunction)(footer) ? footer(retryButtonNode, finishButtonNode) : footer || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, retryButtonNode, finishButtonNode);
84
+ return /*#__PURE__*/_react.default.createElement("div", {
85
+ className: "".concat(classPrefix, "__actions")
86
+ }, footerContent);
87
+ };
88
+ if (!visible || !el.current) return null;
89
+ const modalContent = /*#__PURE__*/_react.default.createElement("div", {
90
+ className: classNames,
91
+ style: style
92
+ }, /*#__PURE__*/_react.default.createElement("div", {
93
+ className: "".concat(classPrefix, "__mask"),
94
+ onClick: handleMaskClose
95
+ }), /*#__PURE__*/_react.default.createElement("div", {
96
+ className: contentClassNames,
97
+ style: contentStyle
98
+ }, showClose && /*#__PURE__*/_react.default.createElement("button", {
99
+ className: "".concat(classPrefix, "__close"),
100
+ onClick: onClose,
101
+ "aria-label": "\u5173\u95ED"
102
+ }, "\xD7"), icon && /*#__PURE__*/_react.default.createElement("div", {
103
+ className: "".concat(classPrefix, "__icon")
104
+ }, icon), title && /*#__PURE__*/_react.default.createElement("div", {
105
+ className: "".concat(classPrefix, "__title")
106
+ }, title), desc && /*#__PURE__*/_react.default.createElement("div", {
107
+ className: "".concat(classPrefix, "__desc")
108
+ }, desc), children && /*#__PURE__*/_react.default.createElement("div", {
109
+ className: "".concat(classPrefix, "__content-wrapper")
110
+ }, children), renderFooter()));
111
+ return /*#__PURE__*/_reactDom.default.createPortal(modalContent, el.current);
112
+ };
113
+ var _default = exports.default = PayModal;
@@ -0,0 +1 @@
1
+ .pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("./index.css");
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {};
7
+ exports.default = void 0;
8
+ var _classNames = _interopRequireDefault(require("../utils/classNames"));
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _ahooks = require("ahooks");
11
+ var _nativeProps = require("../utils/native-props");
12
+ var _useLockScroll = require("../hooks/use-lock-scroll");
13
+ var _web = require("@react-spring/web");
14
+ var _react2 = require("@use-gesture/react");
15
+ var _shouldRender = require("../utils/should-render");
16
+ var _withStopPropagation = require("../utils/with-stop-propagation");
17
+ var _useInnerVisible = require("../hooks/use-inner-visible");
18
+ var _withDefaultProps = require("../utils/with-default-props");
19
+ var _renderToContainer = require("../utils/render-to-container");
20
+ var _Mask = _interopRequireDefault(require("../Mask"));
21
+ var _icons = require("../icons");
22
+ var _getPrefixCls = require("../utils/getPrefixCls");
23
+ var _interface = require("./interface");
24
+ Object.keys(_interface).forEach(function (key) {
25
+ if (key === "default" || key === "__esModule") return;
26
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
27
+ if (key in exports && exports[key] === _interface[key]) return;
28
+ Object.defineProperty(exports, key, {
29
+ enumerable: true,
30
+ get: function () {
31
+ return _interface[key];
32
+ }
33
+ });
34
+ });
35
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
36
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
37
+ 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); }
38
+ 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; }
39
+ 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; }
40
+ 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; }
41
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
42
+ 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); }
43
+ const classPrefix = (0, _getPrefixCls.getPrefixCls)('popup');
44
+ const defaultPopupBaseProps = {
45
+ closeOnMaskClick: true,
46
+ closeIcon: /*#__PURE__*/_react.default.createElement(_icons.IconClose, null),
47
+ destroyOnClose: false,
48
+ disableBodyScroll: true,
49
+ forceRender: false,
50
+ getContainer: () => document.body,
51
+ mask: true,
52
+ showCloseButton: false,
53
+ stopPropagation: ['click'],
54
+ visible: false
55
+ };
56
+ const defaultProps = _objectSpread(_objectSpread({}, defaultPopupBaseProps), {}, {
57
+ closeOnSwipe: false,
58
+ position: 'bottom',
59
+ round: false
60
+ });
61
+ const PayPopup = p => {
62
+ const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
63
+ const bodyCls = (0, _classNames.default)("".concat(classPrefix, "-body"), props.bodyClassName, "".concat(classPrefix, "-body-position-").concat(props.position), {
64
+ ["".concat(classPrefix, "-body-with-close")]: props.showCloseButton,
65
+ ["".concat(classPrefix, "-body-round")]: props.round
66
+ });
67
+ const [active, setActive] = (0, _react.useState)(props.visible);
68
+ const ref = (0, _react.useRef)(null);
69
+ (0, _useLockScroll.useLockScroll)(ref, props.disableBodyScroll && active ? 'strict' : false);
70
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
71
+ if (props.visible) {
72
+ setActive(true);
73
+ }
74
+ }, [props.visible]);
75
+ const unmountedRef = (0, _ahooks.useUnmountedRef)();
76
+ const {
77
+ percent
78
+ } = (0, _web.useSpring)({
79
+ percent: props.visible ? 0 : 100,
80
+ config: {
81
+ precision: 0.1,
82
+ mass: 0.4,
83
+ tension: 300,
84
+ friction: 30
85
+ },
86
+ onRest: () => {
87
+ if (unmountedRef.current) return;
88
+ setActive(props.visible);
89
+ if (props.visible) {
90
+ var _props$afterShow;
91
+ (_props$afterShow = props.afterShow) === null || _props$afterShow === void 0 || _props$afterShow.call(props);
92
+ } else {
93
+ var _props$afterClose;
94
+ (_props$afterClose = props.afterClose) === null || _props$afterClose === void 0 || _props$afterClose.call(props);
95
+ }
96
+ }
97
+ });
98
+ const bind = (0, _react2.useDrag)(_ref => {
99
+ let {
100
+ swipe: [, swipeY]
101
+ } = _ref;
102
+ if (!props.closeOnSwipe) return;
103
+ if (swipeY === 1 && props.position === 'bottom' || swipeY === -1 && props.position === 'top') {
104
+ var _props$onClose;
105
+ (_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
106
+ }
107
+ }, {
108
+ axis: 'y',
109
+ enabled: ['top', 'bottom'].includes(props.position)
110
+ });
111
+ const maskVisible = (0, _useInnerVisible.useInnerVisible)(active && props.visible);
112
+ const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, /*#__PURE__*/_react.default.createElement("div", _extends({
113
+ className: classPrefix,
114
+ onClick: props.onClick,
115
+ style: {
116
+ display: active ? undefined : 'none',
117
+ touchAction: ['top', 'bottom'].includes(props.position) ? 'none' : 'auto'
118
+ }
119
+ }, bind()), props.mask && /*#__PURE__*/_react.default.createElement(_Mask.default, {
120
+ visible: maskVisible,
121
+ forceRender: props.forceRender,
122
+ destroyOnClose: props.destroyOnClose,
123
+ onMaskClick: e => {
124
+ var _props$onMaskClick;
125
+ (_props$onMaskClick = props.onMaskClick) === null || _props$onMaskClick === void 0 || _props$onMaskClick.call(props, e);
126
+ if (props.closeOnMaskClick) {
127
+ var _props$onClose2;
128
+ (_props$onClose2 = props.onClose) === null || _props$onClose2 === void 0 || _props$onClose2.call(props);
129
+ }
130
+ },
131
+ className: props.maskClassName,
132
+ style: props.maskStyle,
133
+ disableBodyScroll: false,
134
+ stopPropagation: props.stopPropagation
135
+ }), /*#__PURE__*/_react.default.createElement(_web.animated.div, {
136
+ className: (0, _classNames.default)("".concat(classPrefix, "-body"), "".concat(classPrefix, "-body-position-").concat(props.position), {
137
+ ["".concat(classPrefix, "-body-with-close")]: props.showCloseButton,
138
+ ["".concat(classPrefix, "-body-round")]: props.round
139
+ }, bodyCls),
140
+ style: _objectSpread(_objectSpread({}, props.bodyStyle), {}, {
141
+ pointerEvents: percent.to(v => v === 0 ? 'unset' : 'none'),
142
+ transform: percent.to(v => {
143
+ if (props.position === 'bottom') {
144
+ return "translate(0, ".concat(v, "%)");
145
+ }
146
+ if (props.position === 'top') {
147
+ return "translate(0, -".concat(v, "%)");
148
+ }
149
+ if (props.position === 'left') {
150
+ return "translate(-".concat(v, "%, 0)");
151
+ }
152
+ if (props.position === 'right') {
153
+ return "translate(".concat(v, "%, 0)");
154
+ }
155
+ return 'none';
156
+ })
157
+ }),
158
+ ref: ref
159
+ }, props.showCloseButton && /*#__PURE__*/_react.default.createElement("a", {
160
+ className: (0, _classNames.default)("".concat(classPrefix, "-close-icon"), "".concat(classPrefix, "-close-button")),
161
+ onClick: () => {
162
+ var _props$onClose3;
163
+ (_props$onClose3 = props.onClose) === null || _props$onClose3 === void 0 || _props$onClose3.call(props);
164
+ },
165
+ role: "button",
166
+ "aria-label": 'close'
167
+ }, props.closeIcon), /*#__PURE__*/_react.default.createElement("div", {
168
+ className: "".concat(classPrefix, "-content")
169
+ }, props.children)))));
170
+ return /*#__PURE__*/_react.default.createElement(_shouldRender.ShouldRender, {
171
+ active: active,
172
+ forceRender: props.forceRender,
173
+ destroyOnClose: props.destroyOnClose
174
+ }, (0, _renderToContainer.renderToContainer)(props.getContainer, node));
175
+ };
176
+ var _default = exports.default = PayPopup;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -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,3 @@
1
+ "use strict";
2
+
3
+ require("./index.css");
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PaymentMethod = void 0;
7
+ let PaymentMethod = exports.PaymentMethod = /*#__PURE__*/function (PaymentMethod) {
8
+ /**
9
+ * @zh 微信(pc)
10
+ * @en Wechat(pc)
11
+ */
12
+ PaymentMethod["WechatPc"] = "wechat-pc";
13
+ /**
14
+ * @zh 支付宝(pc)
15
+ * @en Alipay(pc)
16
+ */
17
+ PaymentMethod["AlipayPc"] = "alipay-pc";
18
+ /**
19
+ * @zh paypal(pc)
20
+ * @en Paypal(pc)
21
+ */
22
+ PaymentMethod["PaypalPc"] = "paypal-pc";
23
+ /**
24
+ * @zh stripe(pc)
25
+ * @en Stripe(pc)
26
+ */
27
+ PaymentMethod["StripePc"] = "stripe-pc";
28
+ /**
29
+ * @zh 微信(H5)
30
+ * @en Wechat(H5)
31
+ */
32
+ PaymentMethod["WechatH5"] = "wechat-h5";
33
+ /**
34
+ * @zh 支付宝(H5)
35
+ * @en Alipay(H5)
36
+ */
37
+ PaymentMethod["AlipayH5"] = "alipay-h5";
38
+ /**
39
+ * @zh paypal(H5)
40
+ * @en Paypal(H5)
41
+ */
42
+ PaymentMethod["PaypalH5"] = "paypal-h5";
43
+ /**
44
+ * @zh 微信内部(H5)
45
+ * @en Wechat inside(H5)
46
+ */
47
+ PaymentMethod["WechatInsideH5"] = "wechat-inside-h5";
48
+ /**
49
+ * @zh stripe(H5)
50
+ * @en Stripe(H5)
51
+ */
52
+ PaymentMethod["StripeH5"] = "stripe-h5";
53
+ /**
54
+ * @zh payssion支付
55
+ * @en Payssion
56
+ */
57
+ PaymentMethod["Payssion"] = "payssion";
58
+ /**
59
+ * @zh 空中云汇
60
+ * @en Airwallex
61
+ */
62
+ PaymentMethod["Airwallex"] = "airwallex";
63
+ return PaymentMethod;
64
+ }({});
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _enums = require("./enums");
7
+ Object.keys(_enums).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _enums[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _enums[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.canUseDom = void 0;
7
+ const canUseDom = exports.canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = _default;
7
+ var _is = require("./is");
8
+ var _warning = _interopRequireDefault(require("./warning"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ // eslint-disable-next-line import/no-anonymous-default-export
11
+ function _default() {
12
+ const length = arguments.length;
13
+ let classNames = [];
14
+ for (let i = 0; i < length; i++) {
15
+ const v = i < 0 || arguments.length <= i ? undefined : arguments[i];
16
+ if (!v) {
17
+ continue;
18
+ }
19
+ if ((0, _is.isString)(v)) {
20
+ classNames.push(v);
21
+ } else if ((0, _is.isArray)(v)) {
22
+ classNames = classNames.concat(v);
23
+ } else if ((0, _is.isObject)(v)) {
24
+ Object.keys(v).forEach(k => {
25
+ if (v[k]) {
26
+ classNames.push(k);
27
+ }
28
+ });
29
+ } else {
30
+ (0, _warning.default)(true, "arguments must be one of string/array/object.");
31
+ }
32
+ }
33
+ return [...new Set(classNames)].join(" ");
34
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.open = exports.on = exports.off = exports.location = exports.localStorage = exports.isServerRendering = exports.clientWindow = exports.clientDocument = void 0;
7
+ const NOOP = () => {};
8
+ const isServerRendering = exports.isServerRendering = function () {
9
+ try {
10
+ return !(typeof window !== "undefined" && document !== undefined);
11
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+ } catch (e) {
13
+ return true;
14
+ }
15
+ }();
16
+ const clientWindow = exports.clientWindow = function () {
17
+ if (isServerRendering) {
18
+ return undefined;
19
+ }
20
+ return window;
21
+ }();
22
+ const clientDocument = exports.clientDocument = function () {
23
+ if (isServerRendering) {
24
+ return undefined;
25
+ }
26
+ return document;
27
+ }();
28
+ const localStorage = exports.localStorage = function () {
29
+ if (isServerRendering) {
30
+ return NOOP;
31
+ }
32
+ return window.localStorage;
33
+ }();
34
+ const location = exports.location = function () {
35
+ if (isServerRendering) {
36
+ return NOOP;
37
+ }
38
+ return function (action, value) {
39
+ if (action === "replace") {
40
+ window.location.replace(value);
41
+ }
42
+ if (action === "href") {
43
+ window.location.href = value;
44
+ }
45
+ if (action === "reload") {
46
+ window.location.reload();
47
+ }
48
+ if (action === "protocol") {
49
+ return window.location.protocol;
50
+ }
51
+ if (action === "host") {
52
+ return window.location.host;
53
+ }
54
+ if (action === "search") {
55
+ var _window$location$sear;
56
+ return (_window$location$sear = window.location.search) !== null && _window$location$sear !== void 0 ? _window$location$sear : "";
57
+ }
58
+ };
59
+ }();
60
+ const open = exports.open = function () {
61
+ if (isServerRendering) {
62
+ return NOOP;
63
+ }
64
+ return function (url) {
65
+ let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_blank";
66
+ window.open(url, target);
67
+ };
68
+ }();
69
+ const on = exports.on = function () {
70
+ if (isServerRendering) {
71
+ return NOOP;
72
+ }
73
+ return function (element, event, handler, options) {
74
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
75
+ element && element.addEventListener(event, handler, options || false);
76
+ };
77
+ }();
78
+ const off = exports.off = function () {
79
+ if (isServerRendering) {
80
+ return NOOP;
81
+ }
82
+ return function (element, event, handler, options) {
83
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
84
+ element && element.removeEventListener(event, handler, options || false);
85
+ };
86
+ }();
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolveContainer = resolveContainer;
7
+ var _is = require("./is");
8
+ function resolveContainer(getContainer) {
9
+ const container = (0, _is.isFunction)(getContainer) ? getContainer() : getContainer;
10
+ return container || document.body;
11
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getScrollParent = getScrollParent;
7
+ var _canUseDom = require("./can-use-dom");
8
+ const defaultRoot = _canUseDom.canUseDom ? window : undefined;
9
+ const overflowStylePatterns = ["scroll", "auto", "overlay"];
10
+ function isElement(node) {
11
+ const ELEMENT_NODE_TYPE = 1;
12
+ return node.nodeType === ELEMENT_NODE_TYPE;
13
+ }
14
+ function getScrollParent(el) {
15
+ let root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
16
+ let node = el;
17
+ while (node && node !== root && isElement(node)) {
18
+ if (node === document.body) {
19
+ return root;
20
+ }
21
+ const {
22
+ overflowY
23
+ } = window.getComputedStyle(node);
24
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
25
+ return node;
26
+ }
27
+ node = node.parentNode;
28
+ }
29
+ return root;
30
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPrefixCls = getPrefixCls;
7
+ function getPrefixCls(componentName, customPrefix) {
8
+ return "".concat(customPrefix || 'pay', "-").concat(componentName);
9
+ }