pay-sdk-react 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/css/index.css +3 -1
  2. package/dist/css/index.min.css +1 -1
  3. package/dist/es/Airwallex/airwallex-button.d.ts +2 -2
  4. package/dist/es/Airwallex/airwallex-button.js +40 -11
  5. package/dist/es/Airwallex/interface.d.ts +32 -1
  6. package/dist/es/Airwallex/style/index.css +3 -1
  7. package/dist/es/Airwallex/style/index.min.css +1 -1
  8. package/dist/es/Alipay/alipay-button.d.ts +2 -2
  9. package/dist/es/Alipay/alipay-button.js +20 -8
  10. package/dist/es/Alipay/interface.d.ts +13 -2
  11. package/dist/es/MAlipay/style/index.css +3 -1
  12. package/dist/es/MAlipay/style/index.min.css +1 -1
  13. package/dist/es/MWeChat/style/index.css +3 -1
  14. package/dist/es/MWeChat/style/index.min.css +1 -1
  15. package/dist/es/PayButton/index.d.ts +2 -2
  16. package/dist/es/PayButton/index.js +10 -8
  17. package/dist/es/PayButton/interface.d.ts +5 -19
  18. package/dist/es/PayButton/interface.js +1 -93
  19. package/dist/es/PayMask/interface.d.ts +6 -0
  20. package/dist/es/PayMask/pay-mask.js +5 -2
  21. package/dist/es/Paypal/interface.d.ts +23 -1
  22. package/dist/es/Paypal/paypal-button.d.ts +2 -2
  23. package/dist/es/Paypal/paypal-button.js +31 -7
  24. package/dist/es/Payssion/interface.d.ts +12 -1
  25. package/dist/es/Payssion/payssion-button.d.ts +2 -2
  26. package/dist/es/Payssion/payssion-button.js +17 -4
  27. package/dist/es/Stripe/interface.d.ts +22 -1
  28. package/dist/es/Stripe/stripe-button.d.ts +2 -2
  29. package/dist/es/Stripe/stripe-button.js +31 -11
  30. package/dist/es/Stripe/style/index.css +3 -1
  31. package/dist/es/Stripe/style/index.min.css +1 -1
  32. package/dist/es/Wechat/interface.d.ts +13 -2
  33. package/dist/es/Wechat/wechat-button.d.ts +2 -2
  34. package/dist/es/Wechat/wechat-button.js +20 -8
  35. package/dist/es/Wechat/wechat.js +1 -1
  36. package/dist/es/confirm-modal/style/index.css +3 -1
  37. package/dist/es/confirm-modal/style/index.min.css +1 -1
  38. package/dist/es/hooks/usePayWindowOpen.d.ts +6 -0
  39. package/dist/es/hooks/usePayWindowOpen.js +9 -4
  40. package/dist/es/index.d.ts +1 -1
  41. package/dist/es/pay-modal/style/index.css +3 -1
  42. package/dist/es/pay-modal/style/index.min.css +1 -1
  43. package/dist/lib/Airwallex/airwallex-button.js +41 -12
  44. package/dist/lib/Airwallex/style/index.css +3 -1
  45. package/dist/lib/Airwallex/style/index.min.css +1 -1
  46. package/dist/lib/Alipay/alipay-button.js +20 -8
  47. package/dist/lib/MAlipay/style/index.css +3 -1
  48. package/dist/lib/MAlipay/style/index.min.css +1 -1
  49. package/dist/lib/MWeChat/style/index.css +3 -1
  50. package/dist/lib/MWeChat/style/index.min.css +1 -1
  51. package/dist/lib/PayButton/index.js +10 -8
  52. package/dist/lib/PayButton/interface.js +3 -1
  53. package/dist/lib/PayMask/pay-mask.js +2 -0
  54. package/dist/lib/Paypal/paypal-button.js +28 -5
  55. package/dist/lib/Payssion/payssion-button.js +17 -4
  56. package/dist/lib/Stripe/stripe-button.js +32 -12
  57. package/dist/lib/Stripe/style/index.css +3 -1
  58. package/dist/lib/Stripe/style/index.min.css +1 -1
  59. package/dist/lib/Wechat/wechat-button.js +20 -8
  60. package/dist/lib/Wechat/wechat.js +1 -1
  61. package/dist/lib/confirm-modal/style/index.css +3 -1
  62. package/dist/lib/confirm-modal/style/index.min.css +1 -1
  63. package/dist/lib/hooks/usePayWindowOpen.js +8 -4
  64. package/dist/lib/pay-modal/style/index.css +3 -1
  65. package/dist/lib/pay-modal/style/index.min.css +1 -1
  66. package/dist/umd/pay-sdk-react.umd.js +131 -28
  67. package/dist/umd/pay-sdk-react.umd.js.map +1 -1
  68. package/package.json +1 -1
@@ -568,7 +568,9 @@
568
568
  top: 12px;
569
569
  background: none;
570
570
  border: none;
571
- font-size: 28px;
571
+ font-size: 32px;
572
+ font-weight: 500;
573
+ line-height: 32px;
572
574
  cursor: pointer;
573
575
  text-align: left;
574
576
  }
@@ -1 +1 @@
1
- .pay-dot-loading{display:inline-block}.pay-fullscreen-loading{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center;pointer-events:auto;user-select:none}.pay-fullscreen-loading__center{display:flex;flex-direction:column;align-items:center;justify-content:center}.pay-fullscreen-loading__spinner-box{display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(17,17,17,.8);border-radius:16px;transition:width .2s,height .2s;box-sizing:border-box;padding:8px}.pay-fullscreen-loading__spinner-box--no-text{padding:4px}.pay-fullscreen-loading__spinner{margin-bottom:8px}.pay-fullscreen-loading__spinner-box--no-text .pay-fullscreen-loading__spinner{margin-bottom:0}.pay-fullscreen-loading__circle{border:3px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:1.2s linear infinite spin}.pay-fullscreen-loading__text{color:#fff;font-weight:600;letter-spacing:.25px;text-align:center;width:100%;word-break:break-all;line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pay-fullscreen-loading__dots{display:flex;align-items:center;gap:10px}.pay-fullscreen-loading__dot{background:#fff;border-radius:50%;animation:.5s ease-in-out infinite bounce}.pay-fullscreen-loading__dot:nth-child(2){animation-delay:.1s}.pay-fullscreen-loading__dot:nth-child(3){animation-delay:.2s}.pay-fullscreen-loading__spin-dots{position:relative;animation:1.2s steps(12) infinite spin}.pay-fullscreen-loading__spin-dot{position:absolute;top:0;left:50%;background:#fff;border-radius:50%}.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box{width:88px;height:88px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box--no-text{width:48px;height:48px}.pay-fullscreen-loading--small .pay-fullscreen-loading__circle{width:24px;height:24px;border-width:3px}.pay-fullscreen-loading--small .pay-fullscreen-loading__text{font-size:14px}.pay-fullscreen-loading--small .pay-fullscreen-loading__dot{width:6px;height:6px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dots{width:28px;height:28px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dot{width:3.5px;height:3.5px;margin-left:-1.75px;transform-origin:50% 14px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box{width:112px;height:112px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box--no-text{width:62px;height:62px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__circle{width:36px;height:36px;border-width:4px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__text{font-size:16px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__dot{width:10px;height:10px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dots{width:40px;height:40px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dot{width:4.5px;height:4.5px;margin-left:-2.25px;transform-origin:50% 20px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box{width:144px;height:144px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box--no-text{width:80px;height:80px}.pay-fullscreen-loading--large .pay-fullscreen-loading__circle{width:42px;height:42px;border-width:5px}.pay-fullscreen-loading--large .pay-fullscreen-loading__text{font-size:18px}.pay-fullscreen-loading--large .pay-fullscreen-loading__dot{width:12px;height:12px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dots{width:48px;height:48px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dot{width:5.5px;height:5.5px;margin-left:-2.75px;transform-origin:50% 24px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box{width:100px;height:100px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box--no-text{width:56px;height:56px}.pay-fullscreen-loading--default .pay-fullscreen-loading__circle{width:32px;height:32px;border-width:4px}.pay-fullscreen-loading--default .pay-fullscreen-loading__text{font-size:16px}.pay-fullscreen-loading--default .pay-fullscreen-loading__dot{width:9px;height:9px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dots{width:32px;height:32px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dot{width:4px;height:4px;margin-left:-2px;transform-origin:50% 16px}.pay-fullscreen-loading__container{position:relative;display:block}.pay-fullscreen-loading__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:hsla(0,0%,100%,.8);z-index:10;display:flex;align-items:center;justify-content:center}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.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}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.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;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}.pay-paypal-btn.pay-button>span{display:flex;align-items:center;gap:.5rem}@media (min-width:576px){.pay-stripe-modal.pay-modal .pay-modal__content{width:72%}}@media (min-width:768px){.pay-stripe-modal.pay-modal .pay-modal__content{width:50%}}@media (min-width:992px){.pay-stripe-modal.pay-modal .pay-modal__content{width:40%}}@media (min-width:1200px){.pay-stripe-modal.pay-modal .pay-modal__content{width:27%}}@media (min-width:1600px){.pay-stripe-modal.pay-modal .pay-modal__content{width:26%}}@media (min-width:2000px){.pay-stripe-modal.pay-modal .pay-modal__content{width:20%}}.pay-alipay-qr-iframe{display:flex;flex-direction:column;align-items:center}.pay-alipay-qr-iframe__iframe{border:none;width:210px;height:210px;margin-top:10px;margin-bottom:8px}.pay-alipay-qr-iframe__tip{text-align:center;color:#333;font-size:14px;line-height:20px}.pay-wechat-qrcode{display:flex;flex-direction:column;align-items:center}.pay-wechat-qrcode__container{background-color:#fff;border-radius:8px;display:flex;justify-content:center;align-items:center;width:210px;height:210px}.pay-wechat-qrcode__image{width:100%;height:100%;object-fit:cover}.pay-wechat-qrcode__tip{text-align:center;color:#333;font-size:14px;line-height:20px}
1
+ .pay-dot-loading{display:inline-block}.pay-fullscreen-loading{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center;pointer-events:auto;user-select:none}.pay-fullscreen-loading__center{display:flex;flex-direction:column;align-items:center;justify-content:center}.pay-fullscreen-loading__spinner-box{display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(17,17,17,.8);border-radius:16px;transition:width .2s,height .2s;box-sizing:border-box;padding:8px}.pay-fullscreen-loading__spinner-box--no-text{padding:4px}.pay-fullscreen-loading__spinner{margin-bottom:8px}.pay-fullscreen-loading__spinner-box--no-text .pay-fullscreen-loading__spinner{margin-bottom:0}.pay-fullscreen-loading__circle{border:3px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:1.2s linear infinite spin}.pay-fullscreen-loading__text{color:#fff;font-weight:600;letter-spacing:.25px;text-align:center;width:100%;word-break:break-all;line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pay-fullscreen-loading__dots{display:flex;align-items:center;gap:10px}.pay-fullscreen-loading__dot{background:#fff;border-radius:50%;animation:.5s ease-in-out infinite bounce}.pay-fullscreen-loading__dot:nth-child(2){animation-delay:.1s}.pay-fullscreen-loading__dot:nth-child(3){animation-delay:.2s}.pay-fullscreen-loading__spin-dots{position:relative;animation:1.2s steps(12) infinite spin}.pay-fullscreen-loading__spin-dot{position:absolute;top:0;left:50%;background:#fff;border-radius:50%}.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box{width:88px;height:88px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box--no-text{width:48px;height:48px}.pay-fullscreen-loading--small .pay-fullscreen-loading__circle{width:24px;height:24px;border-width:3px}.pay-fullscreen-loading--small .pay-fullscreen-loading__text{font-size:14px}.pay-fullscreen-loading--small .pay-fullscreen-loading__dot{width:6px;height:6px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dots{width:28px;height:28px}.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dot{width:3.5px;height:3.5px;margin-left:-1.75px;transform-origin:50% 14px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box{width:112px;height:112px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box--no-text{width:62px;height:62px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__circle{width:36px;height:36px;border-width:4px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__text{font-size:16px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__dot{width:10px;height:10px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dots{width:40px;height:40px}.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dot{width:4.5px;height:4.5px;margin-left:-2.25px;transform-origin:50% 20px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box{width:144px;height:144px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box--no-text{width:80px;height:80px}.pay-fullscreen-loading--large .pay-fullscreen-loading__circle{width:42px;height:42px;border-width:5px}.pay-fullscreen-loading--large .pay-fullscreen-loading__text{font-size:18px}.pay-fullscreen-loading--large .pay-fullscreen-loading__dot{width:12px;height:12px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dots{width:48px;height:48px}.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dot{width:5.5px;height:5.5px;margin-left:-2.75px;transform-origin:50% 24px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box{width:100px;height:100px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box--no-text{width:56px;height:56px}.pay-fullscreen-loading--default .pay-fullscreen-loading__circle{width:32px;height:32px;border-width:4px}.pay-fullscreen-loading--default .pay-fullscreen-loading__text{font-size:16px}.pay-fullscreen-loading--default .pay-fullscreen-loading__dot{width:9px;height:9px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dots{width:32px;height:32px}.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dot{width:4px;height:4px;margin-left:-2px;transform-origin:50% 16px}.pay-fullscreen-loading__container{position:relative;display:block}.pay-fullscreen-loading__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:hsla(0,0%,100%,.8);z-index:10;display:flex;align-items:center;justify-content:center}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.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}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.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;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:32px;font-weight:500;line-height:32px;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}.pay-paypal-btn.pay-button>span{display:flex;align-items:center;gap:.5rem}@media (min-width:576px){.pay-stripe-modal.pay-modal .pay-modal__content{width:72%}}@media (min-width:768px){.pay-stripe-modal.pay-modal .pay-modal__content{width:50%}}@media (min-width:992px){.pay-stripe-modal.pay-modal .pay-modal__content{width:40%}}@media (min-width:1200px){.pay-stripe-modal.pay-modal .pay-modal__content{width:27%}}@media (min-width:1600px){.pay-stripe-modal.pay-modal .pay-modal__content{width:26%}}@media (min-width:2000px){.pay-stripe-modal.pay-modal .pay-modal__content{width:20%}}.pay-alipay-qr-iframe{display:flex;flex-direction:column;align-items:center}.pay-alipay-qr-iframe__iframe{border:none;width:210px;height:210px;margin-top:10px;margin-bottom:8px}.pay-alipay-qr-iframe__tip{text-align:center;color:#333;font-size:14px;line-height:20px}.pay-wechat-qrcode{display:flex;flex-direction:column;align-items:center}.pay-wechat-qrcode__container{background-color:#fff;border-radius:8px;display:flex;justify-content:center;align-items:center;width:210px;height:210px}.pay-wechat-qrcode__image{width:100%;height:100%;object-fit:cover}.pay-wechat-qrcode__tip{text-align:center;color:#333;font-size:14px;line-height:20px}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { AirwallexButtonProps } from './interface';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<AirwallexButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>>;
2
+ import { AirwallexButtonProps, AirwallexButtonRef } from './interface';
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<AirwallexButtonProps> & React.RefAttributes<AirwallexButtonRef>>>;
4
4
  export default _default;
@@ -24,9 +24,7 @@ var AirwallexButton = /*#__PURE__*/forwardRef(function (props, ref) {
24
24
  onClick = props.onClick,
25
25
  createOrder = props.createOrder,
26
26
  others = _objectWithoutProperties(props, _excluded);
27
- var airwallexButtonRef = useRef({
28
- nativeElement: null
29
- });
27
+ var airwallexButtonRef = useRef(null);
30
28
  var airwallexPopupRef = useRef(null);
31
29
  var airwallexModalRef = useRef(null);
32
30
  var _useState = useState(false),
@@ -38,10 +36,41 @@ var AirwallexButton = /*#__PURE__*/forwardRef(function (props, ref) {
38
36
  airwallexUrl = _useState4[0],
39
37
  setAirwallexUrl = _useState4[1];
40
38
  useImperativeHandle(ref, function () {
41
- return airwallexButtonRef.current;
39
+ return {
40
+ get nativeElement() {
41
+ var _airwallexButtonRef$c;
42
+ return ((_airwallexButtonRef$c = airwallexButtonRef.current) === null || _airwallexButtonRef$c === void 0 ? void 0 : _airwallexButtonRef$c.nativeElement) || null;
43
+ },
44
+ openModal: function openModal(options) {
45
+ var _airwallexModalRef$cu;
46
+ (_airwallexModalRef$cu = airwallexModalRef.current) === null || _airwallexModalRef$cu === void 0 || _airwallexModalRef$cu.open(options);
47
+ },
48
+ closeModal: function closeModal() {
49
+ var _airwallexModalRef$cu2;
50
+ (_airwallexModalRef$cu2 = airwallexModalRef.current) === null || _airwallexModalRef$cu2 === void 0 || _airwallexModalRef$cu2.close();
51
+ },
52
+ openPopup: function openPopup(options) {
53
+ var _airwallexPopupRef$cu;
54
+ (_airwallexPopupRef$cu = airwallexPopupRef.current) === null || _airwallexPopupRef$cu === void 0 || _airwallexPopupRef$cu.open(options);
55
+ },
56
+ closePopup: function closePopup() {
57
+ var _airwallexPopupRef$cu2;
58
+ (_airwallexPopupRef$cu2 = airwallexPopupRef.current) === null || _airwallexPopupRef$cu2 === void 0 || _airwallexPopupRef$cu2.close();
59
+ },
60
+ openPayment: function openPayment(options) {
61
+ if (options) {
62
+ setAirwallexUrl(options.airwallexUrl);
63
+ }
64
+ setShowMask(true);
65
+ },
66
+ closePayment: function closePayment() {
67
+ setShowMask(false);
68
+ },
69
+ current: airwallexButtonRef.current
70
+ };
42
71
  });
43
72
  var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
44
- var options, _airwallexModalRef$cu, _airwallexPopupRef$cu;
73
+ var options, _airwallexModalRef$cu3, _airwallexPopupRef$cu3;
45
74
  return _regenerator().w(function (_context) {
46
75
  while (1) switch (_context.n) {
47
76
  case 0:
@@ -56,9 +85,9 @@ var AirwallexButton = /*#__PURE__*/forwardRef(function (props, ref) {
56
85
  if (options) {
57
86
  if ((props === null || props === void 0 ? void 0 : props.payMode) === 'embedded') {
58
87
  if ((props === null || props === void 0 ? void 0 : props.displayType) === 'modal') {
59
- airwallexModalRef === null || airwallexModalRef === void 0 || (_airwallexModalRef$cu = airwallexModalRef.current) === null || _airwallexModalRef$cu === void 0 || _airwallexModalRef$cu.open(options);
88
+ airwallexModalRef === null || airwallexModalRef === void 0 || (_airwallexModalRef$cu3 = airwallexModalRef.current) === null || _airwallexModalRef$cu3 === void 0 || _airwallexModalRef$cu3.open(options);
60
89
  } else {
61
- (_airwallexPopupRef$cu = airwallexPopupRef.current) === null || _airwallexPopupRef$cu === void 0 || _airwallexPopupRef$cu.open(options);
90
+ (_airwallexPopupRef$cu3 = airwallexPopupRef.current) === null || _airwallexPopupRef$cu3 === void 0 || _airwallexPopupRef$cu3.open(options);
62
91
  }
63
92
  } else {
64
93
  setShowMask(true);
@@ -78,11 +107,11 @@ var AirwallexButton = /*#__PURE__*/forwardRef(function (props, ref) {
78
107
  }
79
108
  if ((props === null || props === void 0 ? void 0 : props.payMode) === 'embedded') {
80
109
  if ((props === null || props === void 0 ? void 0 : props.displayType) === 'modal') {
81
- var _airwallexModalRef$cu2;
82
- airwallexModalRef === null || airwallexModalRef === void 0 || (_airwallexModalRef$cu2 = airwallexModalRef.current) === null || _airwallexModalRef$cu2 === void 0 || _airwallexModalRef$cu2.open();
110
+ var _airwallexModalRef$cu4;
111
+ airwallexModalRef === null || airwallexModalRef === void 0 || (_airwallexModalRef$cu4 = airwallexModalRef.current) === null || _airwallexModalRef$cu4 === void 0 || _airwallexModalRef$cu4.open();
83
112
  } else {
84
- var _airwallexPopupRef$cu2;
85
- airwallexPopupRef === null || airwallexPopupRef === void 0 || (_airwallexPopupRef$cu2 = airwallexPopupRef.current) === null || _airwallexPopupRef$cu2 === void 0 || _airwallexPopupRef$cu2.open();
113
+ var _airwallexPopupRef$cu4;
114
+ airwallexPopupRef === null || airwallexPopupRef === void 0 || (_airwallexPopupRef$cu4 = airwallexPopupRef.current) === null || _airwallexPopupRef$cu4 === void 0 || _airwallexPopupRef$cu4.open();
86
115
  }
87
116
  return;
88
117
  }
@@ -113,7 +113,38 @@ export interface AirwallexButtonEmbeddedPopupProps extends AirwallexButtonEmbedd
113
113
  popupProps?: AirwallexPopupProps;
114
114
  }
115
115
  export type AirwallexButtonProps = AirwallexButtonRedirectProps | AirwallexButtonEmbeddedModalProps | AirwallexButtonEmbeddedPopupProps;
116
- export type AirwallexButtonRef = ButtonRef;
116
+ export interface AirwallexButtonRef extends ButtonRef {
117
+ /**
118
+ * @zh 打开弹窗
119
+ * @en Open the popup
120
+ */
121
+ openModal: (options?: AirwallexProps) => void;
122
+ /**
123
+ * @zh 关闭弹窗
124
+ * @en Close the popup
125
+ */
126
+ closeModal: () => void;
127
+ /**
128
+ * @zh 打开弹窗
129
+ * @en Open the popup
130
+ */
131
+ openPopup: (options?: AirwallexProps) => void;
132
+ /**
133
+ * @zh 关闭弹窗
134
+ * @en Close the popup
135
+ */
136
+ closePopup: () => void;
137
+ /**
138
+ * @zh 打开支付页面
139
+ * @en Open payment page
140
+ */
141
+ openPayment: (options?: AirwallexRedirectProps) => void;
142
+ /**
143
+ * @zh 关闭支付页面
144
+ * @en Close payment page
145
+ */
146
+ closePayment: () => void;
147
+ }
117
148
  export interface AirwallexModalProps extends PayModalProps {
118
149
  /**
119
150
  * @zh Airwallex 属性
@@ -133,7 +133,9 @@
133
133
  top: 12px;
134
134
  background: none;
135
135
  border: none;
136
- font-size: 28px;
136
+ font-size: 32px;
137
+ font-weight: 500;
138
+ line-height: 32px;
137
139
  cursor: pointer;
138
140
  text-align: left;
139
141
  }
@@ -1 +1 @@
1
- .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.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;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}.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}
1
+ .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.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;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:32px;font-weight:500;line-height:32px;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}.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}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AlipayButtonProps } from './interface';
2
+ import { AlipayButtonProps, AlipayButtonRef } from './interface';
3
3
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<AlipayButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>>;
5
+ } & React.RefAttributes<AlipayButtonRef>>>;
6
6
  export default _default;
@@ -20,15 +20,27 @@ var AlipayButton = /*#__PURE__*/forwardRef(function (props, ref) {
20
20
  createOrder = props.createOrder,
21
21
  modalProps = props.modalProps,
22
22
  others = _objectWithoutProperties(props, _excluded);
23
- var alipayButtonRef = useRef({
24
- nativeElement: null
25
- });
23
+ var alipayButtonRef = useRef(null);
26
24
  var alipayModalRef = useRef(null);
27
25
  useImperativeHandle(ref, function () {
28
- return alipayButtonRef.current;
26
+ return {
27
+ get nativeElement() {
28
+ var _alipayButtonRef$curr;
29
+ return ((_alipayButtonRef$curr = alipayButtonRef.current) === null || _alipayButtonRef$curr === void 0 ? void 0 : _alipayButtonRef$curr.nativeElement) || null;
30
+ },
31
+ openModal: function openModal(options) {
32
+ var _alipayModalRef$curre;
33
+ (_alipayModalRef$curre = alipayModalRef.current) === null || _alipayModalRef$curre === void 0 || _alipayModalRef$curre.open(options);
34
+ },
35
+ closeModal: function closeModal() {
36
+ var _alipayModalRef$curre2;
37
+ (_alipayModalRef$curre2 = alipayModalRef.current) === null || _alipayModalRef$curre2 === void 0 || _alipayModalRef$curre2.close();
38
+ },
39
+ current: alipayButtonRef.current
40
+ };
29
41
  });
30
42
  var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
31
- var options, _alipayModalRef$curre;
43
+ var options, _alipayModalRef$curre3;
32
44
  return _regenerator().w(function (_context) {
33
45
  while (1) switch (_context.n) {
34
46
  case 0:
@@ -41,7 +53,7 @@ var AlipayButton = /*#__PURE__*/forwardRef(function (props, ref) {
41
53
  case 1:
42
54
  options = _context.v;
43
55
  if (options) {
44
- alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre = alipayModalRef.current) === null || _alipayModalRef$curre === void 0 || _alipayModalRef$curre.open(options);
56
+ alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre3 = alipayModalRef.current) === null || _alipayModalRef$curre3 === void 0 || _alipayModalRef$curre3.open(options);
45
57
  }
46
58
  case 2:
47
59
  return _context.a(2);
@@ -52,8 +64,8 @@ var AlipayButton = /*#__PURE__*/forwardRef(function (props, ref) {
52
64
  if (createOrder) {
53
65
  handlePayCreateOrder();
54
66
  } else {
55
- var _alipayModalRef$curre2;
56
- alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre2 = alipayModalRef.current) === null || _alipayModalRef$curre2 === void 0 || _alipayModalRef$curre2.open();
67
+ var _alipayModalRef$curre4;
68
+ alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre4 = alipayModalRef.current) === null || _alipayModalRef$curre4 === void 0 || _alipayModalRef$curre4.open();
57
69
  }
58
70
  onClick === null || onClick === void 0 || onClick(e);
59
71
  }, [onClick, createOrder, handlePayCreateOrder]);
@@ -50,9 +50,20 @@ export interface AlipayButtonProps extends ButtonProps {
50
50
  * @zh 弹窗属性
51
51
  * @en Modal props
52
52
  */
53
- modalProps?: Omit<AlipayModalProps, 'visible'>;
53
+ modalProps?: AlipayModalProps;
54
+ }
55
+ export interface AlipayButtonRef extends ButtonRef {
56
+ /**
57
+ * @zh 打开弹窗
58
+ * @en Open the popup
59
+ */
60
+ openModal: (options?: AlipayProps) => void;
61
+ /**
62
+ * @zh 关闭弹窗
63
+ * @en Close the popup
64
+ */
65
+ closeModal: () => void;
54
66
  }
55
- export type AlipayButtonRef = ButtonRef;
56
67
  /**
57
68
  * @zh 创建订单函数,返回 Paypal 所需参数
58
69
  * @en Function to create order, returns Paypal required params
@@ -195,7 +195,9 @@
195
195
  top: 12px;
196
196
  background: none;
197
197
  border: none;
198
- font-size: 28px;
198
+ font-size: 32px;
199
+ font-weight: 500;
200
+ line-height: 32px;
199
201
  cursor: pointer;
200
202
  text-align: left;
201
203
  }
@@ -1 +1 @@
1
- .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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;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}
1
+ .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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;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:32px;font-weight:500;line-height:32px;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}
@@ -195,7 +195,9 @@
195
195
  top: 12px;
196
196
  background: none;
197
197
  border: none;
198
- font-size: 28px;
198
+ font-size: 32px;
199
+ font-weight: 500;
200
+ line-height: 32px;
199
201
  cursor: pointer;
200
202
  text-align: left;
201
203
  }
@@ -1 +1 @@
1
- .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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;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}
1
+ .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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;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:32px;font-weight:500;line-height:32px;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}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PayButtonProps } from './interface';
2
+ import { PayButtonProps, GenericPayButtonRef } from './interface';
3
3
  export * from './interface';
4
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>>;
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<GenericPayButtonRef>>>;
5
5
  export default _default;
@@ -10,44 +10,46 @@ import Alipay from '../Alipay';
10
10
  import Wechat from '../Wechat';
11
11
  import MAlipay from '../MAlipay';
12
12
  var PayButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
+ // 使用类型断言来确保 ref 类型正确
14
+ var typedRef = ref;
13
15
  if (props.payMethod === PaymentMethod.PaypalH5 || props.payMethod === PaymentMethod.PaypalPc) {
14
16
  return /*#__PURE__*/React.createElement(PaypalButton, _extends({
15
- ref: ref
17
+ ref: typedRef
16
18
  }, props));
17
19
  }
18
20
  if (props.payMethod === PaymentMethod.StripeH5 || props.payMethod === PaymentMethod.StripePc) {
19
21
  return /*#__PURE__*/React.createElement(Stripe.Button, _extends({
20
- ref: ref
22
+ ref: typedRef
21
23
  }, props));
22
24
  }
23
25
  if (props.payMethod === PaymentMethod.Airwallex) {
24
26
  return /*#__PURE__*/React.createElement(Airwallex.Button, _extends({
25
- ref: ref
27
+ ref: typedRef
26
28
  }, props));
27
29
  }
28
30
  if (props.payMethod === PaymentMethod.Payssion) {
29
31
  return /*#__PURE__*/React.createElement(PayssionButton, _extends({
30
- ref: ref
32
+ ref: typedRef
31
33
  }, props));
32
34
  }
33
35
  if (props.payMethod === PaymentMethod.WechatH5) {
34
36
  return /*#__PURE__*/React.createElement(MWechatButton, _extends({
35
- ref: ref
37
+ ref: typedRef
36
38
  }, props));
37
39
  }
38
40
  if (props.payMethod === PaymentMethod.AlipayH5) {
39
41
  return /*#__PURE__*/React.createElement(MAlipay.Button, _extends({
40
- ref: ref
42
+ ref: typedRef
41
43
  }, props));
42
44
  }
43
45
  if (props.payMethod === PaymentMethod.AlipayPc) {
44
46
  return /*#__PURE__*/React.createElement(Alipay.Button, _extends({
45
- ref: ref
47
+ ref: typedRef
46
48
  }, props));
47
49
  }
48
50
  if (props.payMethod === PaymentMethod.WechatPc) {
49
51
  return /*#__PURE__*/React.createElement(Wechat.Button, _extends({
50
- ref: ref
52
+ ref: typedRef
51
53
  }, props));
52
54
  }
53
55
  return null;
@@ -108,23 +108,9 @@ type RealWechatButtonProps = BaseWechatButtonProps & WechatButtonProps;
108
108
  * @en Union type for pay button props, auto-dispatch by payMethod
109
109
  */
110
110
  export type PayButtonProps = RealPaypalButtonProps | RealStripeButtonProps | RealAirwallexButtonProps | RealPayssionButtonProps | RealMWeChatButtonProps | RealMAlipayButtonProps | RealAlipayButtonProps | RealWechatButtonProps;
111
- type PayButtonRefMap = {
112
- [PaymentMethod.PaypalH5]: PaypalButtonRef;
113
- [PaymentMethod.PaypalPc]: PaypalButtonRef;
114
- [PaymentMethod.StripeH5]: StripeButtonRef;
115
- [PaymentMethod.StripePc]: StripeButtonRef;
116
- [PaymentMethod.Airwallex]: AirwallexButtonRef;
117
- [PaymentMethod.Payssion]: PayssionButtonRef;
118
- [PaymentMethod.WechatH5]: MWeChatButtonRef;
119
- [PaymentMethod.AlipayH5]: MAlipayButtonRef;
120
- [PaymentMethod.AlipayPc]: AlipayButtonRef;
121
- [PaymentMethod.WechatPc]: WechatButtonRef;
122
- };
123
- /**
124
- * @zh 根据 payMethod 自动分发 ref 类型
125
- * @en Auto-dispatch ref type by payMethod
126
- */
127
- export type PayButtonRef<T extends PayButtonProps = PayButtonProps> = T extends {
128
- payMethod: infer M;
129
- } ? M extends keyof PayButtonRefMap ? PayButtonRefMap[M] : never : never;
111
+ /**
112
+ * @zh 通用的支付按钮 ref 类型,支持所有支付方式
113
+ * @en Generic pay button ref type that supports all payment methods
114
+ */
115
+ export type GenericPayButtonRef = PaypalButtonRef | StripeButtonRef | AirwallexButtonRef | PayssionButtonRef | MWeChatButtonRef | MAlipayButtonRef | AlipayButtonRef | WechatButtonRef;
130
116
  export {};
@@ -1,93 +1 @@
1
- import { PaymentMethod } from '../shared';
2
-
3
- /**
4
- * @zh PayPal 按钮基础属性
5
- * @en Base props for PayPal button
6
- */
7
-
8
- /**
9
- * @zh Stripe 按钮基础属性
10
- * @en Base props for Stripe button
11
- */
12
-
13
- /**
14
- * @zh Airwallex 按钮基础属性
15
- * @en Base props for Airwallex button
16
- */
17
-
18
- /**
19
- * @zh Payssion 按钮基础属性
20
- * @en Base props for Payssion button
21
- */
22
-
23
- /**
24
- * @zh MWeChat 按钮基础属性
25
- * @en Base props for MWeChat button
26
- */
27
-
28
- /**
29
- * @zh MAlipay 按钮基础属性
30
- * @en Base props for MAlipay button
31
- */
32
-
33
- /**
34
- * @zh Alipay 按钮基础属性
35
- * @en Base props for Alipay button
36
- */
37
-
38
- /**
39
- * @zh Wechat 按钮基础属性
40
- * @en Base props for Wechat button
41
- */
42
-
43
- /**
44
- * @zh PayPal 按钮完整属性
45
- * @en Full props for PayPal button
46
- */
47
-
48
- /**
49
- * @zh Stripe 按钮完整属性
50
- * @en Full props for Stripe button
51
- */
52
-
53
- /**
54
- * @zh Airwallex 按钮完整属性
55
- * @en Full props for Airwallex button
56
- */
57
-
58
- /**
59
- * @zh Payssion 按钮完整属性
60
- * @en Full props for Payssion button
61
- */
62
-
63
- /**
64
- * @zh MWeChat 按钮完整属性
65
- * @en Full props for MWeChat button
66
- */
67
-
68
- /**
69
- * @zh MAlipay 按钮完整属性
70
- * @en Full props for MAlipay button
71
- */
72
-
73
- /**
74
- * @zh MAlipay 按钮完整属性
75
- * @en Full props for MAlipay button
76
- */
77
-
78
- /**
79
- * @zh Wechat 按钮完整属性
80
- * @en Full props for Wechat button
81
- */
82
-
83
- /**
84
- * @zh 支付按钮属性联合类型,根据 payMethod 自动分发
85
- * @en Union type for pay button props, auto-dispatch by payMethod
86
- */
87
-
88
- // payMethod 到 ref 的映射
89
-
90
- /**
91
- * @zh 根据 payMethod 自动分发 ref 类型
92
- * @en Auto-dispatch ref type by payMethod
93
- */
1
+ export {};
@@ -59,4 +59,10 @@ export interface PayMaskProps extends MaskProps {
59
59
  * @default false
60
60
  */
61
61
  forceNewWindow?: boolean;
62
+ /**
63
+ * @zh 组件卸载时是否关闭第三方支付页面,只在 “openMode” 为 “window” 时生效
64
+ * @en Whether to close the third-party payment page when component unmounts, only effective when "openMode" is "window"
65
+ * @default true
66
+ */
67
+ closeWindowOnUnmount?: boolean;
62
68
  }
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["visible", "payUrl", "onClose", "onMaskClick", "onContinue", "openMode", "autoOpenWindow", "forceNewWindow", "className", "destroyOnClose"];
2
+ var _excluded = ["visible", "payUrl", "onClose", "onMaskClick", "onContinue", "openMode", "autoOpenWindow", "forceNewWindow", "className", "destroyOnClose", "closeWindowOnUnmount"];
3
3
  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); }
4
4
  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; }
5
5
  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; }
@@ -42,6 +42,8 @@ var PayMask = function PayMask(p) {
42
42
  className = props.className,
43
43
  _props$destroyOnClose = props.destroyOnClose,
44
44
  destroyOnClose = _props$destroyOnClose === void 0 ? true : _props$destroyOnClose,
45
+ _props$closeWindowOnU = props.closeWindowOnUnmount,
46
+ closeWindowOnUnmount = _props$closeWindowOnU === void 0 ? true : _props$closeWindowOnU,
45
47
  rest = _objectWithoutProperties(props, _excluded);
46
48
  var _useState = useState(false),
47
49
  _useState2 = _slicedToArray(_useState, 2),
@@ -54,7 +56,8 @@ var PayMask = function PayMask(p) {
54
56
  setIsWindowMonitoring(false);
55
57
  },
56
58
  autoOpen: autoOpenWindow,
57
- openMode: openMode
59
+ openMode: openMode,
60
+ closeWindowOnUnmount: closeWindowOnUnmount
58
61
  }, openMode === OpenPayUrlMode.Window && {
59
62
  forceNewWindow: forceNewWindow
60
63
  })),