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.
- package/README.md +1059 -0
- package/README.zh-CN.md +1061 -0
- package/dist/css/index.css +1 -0
- package/dist/es/Airwallex/airwallex-button.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-button.js +86 -0
- package/dist/es/Airwallex/airwallex-modal.d.ts +6 -0
- package/dist/es/Airwallex/airwallex-modal.js +63 -0
- package/dist/es/Airwallex/airwallex-popup.d.ts +6 -0
- package/dist/es/Airwallex/airwallex-popup.js +74 -0
- package/dist/es/Airwallex/airwallex.d.ts +6 -0
- package/dist/es/Airwallex/airwallex.js +77 -0
- package/dist/es/Airwallex/index.d.ts +12 -0
- package/dist/es/Airwallex/index.js +10 -0
- package/dist/es/Airwallex/interface.d.ts +75 -0
- package/dist/es/Airwallex/interface.js +1 -0
- package/dist/es/Airwallex/style/index.css +1 -0
- package/dist/es/Airwallex/style/index.d.ts +1 -0
- package/dist/es/Airwallex/style/index.js +1 -0
- package/dist/es/Alipay/alipay-button.d.ts +6 -0
- package/dist/es/Alipay/alipay-button.js +52 -0
- package/dist/es/Alipay/alipay-modal.d.ts +6 -0
- package/dist/es/Alipay/alipay-modal.js +45 -0
- package/dist/es/Alipay/alipay.d.ts +4 -0
- package/dist/es/Alipay/alipay.js +44 -0
- package/dist/es/Alipay/index.d.ts +10 -0
- package/dist/es/Alipay/index.js +8 -0
- package/dist/es/Alipay/interface.d.ts +53 -0
- package/dist/es/Alipay/interface.js +1 -0
- package/dist/es/Alipay/style/index.css +1 -0
- package/dist/es/Alipay/style/index.d.ts +3 -0
- package/dist/es/Alipay/style/index.js +3 -0
- package/dist/es/Button/button.d.ts +21 -0
- package/dist/es/Button/button.js +74 -0
- package/dist/es/Button/index.d.ts +3 -0
- package/dist/es/Button/index.js +3 -0
- package/dist/es/Button/interface.d.ts +21 -0
- package/dist/es/Button/interface.js +1 -0
- package/dist/es/Button/style/index.css +1 -0
- package/dist/es/Button/style/index.d.ts +1 -0
- package/dist/es/Button/style/index.js +1 -0
- package/dist/es/FullScreenLoading/index.d.ts +4 -0
- package/dist/es/FullScreenLoading/index.js +116 -0
- package/dist/es/FullScreenLoading/interface.d.ts +43 -0
- package/dist/es/FullScreenLoading/interface.js +1 -0
- package/dist/es/FullScreenLoading/style/index.css +1 -0
- package/dist/es/FullScreenLoading/style/index.d.ts +1 -0
- package/dist/es/FullScreenLoading/style/index.js +1 -0
- package/dist/es/MAlipay/index.d.ts +8 -0
- package/dist/es/MAlipay/index.js +6 -0
- package/dist/es/MAlipay/interface.d.ts +44 -0
- package/dist/es/MAlipay/interface.js +1 -0
- package/dist/es/MAlipay/m-alipay-auto-submit.d.ts +6 -0
- package/dist/es/MAlipay/m-alipay-auto-submit.js +37 -0
- package/dist/es/MAlipay/m-alipay-button.d.ts +6 -0
- package/dist/es/MAlipay/m-alipay-button.js +127 -0
- package/dist/es/MAlipay/style/index.css +1 -0
- package/dist/es/MAlipay/style/index.d.ts +1 -0
- package/dist/es/MAlipay/style/index.js +1 -0
- package/dist/es/MWeChat/index.d.ts +2 -0
- package/dist/es/MWeChat/index.js +2 -0
- package/dist/es/MWeChat/interface.d.ts +50 -0
- package/dist/es/MWeChat/interface.js +1 -0
- package/dist/es/MWeChat/m-wechat-button.d.ts +6 -0
- package/dist/es/MWeChat/m-wechat-button.js +117 -0
- package/dist/es/MWeChat/style/index.css +1 -0
- package/dist/es/MWeChat/style/index.d.ts +1 -0
- package/dist/es/MWeChat/style/index.js +1 -0
- package/dist/es/Mask/index.d.ts +3 -0
- package/dist/es/Mask/index.js +3 -0
- package/dist/es/Mask/interface.d.ts +81 -0
- package/dist/es/Mask/interface.js +1 -0
- package/dist/es/Mask/mask.d.ts +5 -0
- package/dist/es/Mask/mask.js +97 -0
- package/dist/es/Mask/style/index.css +1 -0
- package/dist/es/Mask/style/index.d.ts +1 -0
- package/dist/es/Mask/style/index.js +1 -0
- package/dist/es/PayButton/index.d.ts +5 -0
- package/dist/es/PayButton/index.js +57 -0
- package/dist/es/PayButton/interface.d.ts +130 -0
- package/dist/es/PayButton/interface.js +93 -0
- package/dist/es/PayMask/index.d.ts +3 -0
- package/dist/es/PayMask/index.js +3 -0
- package/dist/es/PayMask/interface.d.ts +56 -0
- package/dist/es/PayMask/interface.js +1 -0
- package/dist/es/PayMask/pay-mask.d.ts +5 -0
- package/dist/es/PayMask/pay-mask.js +92 -0
- package/dist/es/PayMask/style/index.css +1 -0
- package/dist/es/PayMask/style/index.d.ts +1 -0
- package/dist/es/PayMask/style/index.js +1 -0
- package/dist/es/Paypal/index.d.ts +2 -0
- package/dist/es/Paypal/index.js +2 -0
- package/dist/es/Paypal/interface.d.ts +42 -0
- package/dist/es/Paypal/interface.js +1 -0
- package/dist/es/Paypal/paypal-button.d.ts +6 -0
- package/dist/es/Paypal/paypal-button.js +75 -0
- package/dist/es/Paypal/style/index.css +1 -0
- package/dist/es/Paypal/style/index.d.ts +1 -0
- package/dist/es/Paypal/style/index.js +1 -0
- package/dist/es/Payssion/index.d.ts +2 -0
- package/dist/es/Payssion/index.js +2 -0
- package/dist/es/Payssion/interface.d.ts +38 -0
- package/dist/es/Payssion/interface.js +1 -0
- package/dist/es/Payssion/payssion-button.d.ts +6 -0
- package/dist/es/Payssion/payssion-button.js +75 -0
- package/dist/es/Payssion/style/index.css +1 -0
- package/dist/es/Payssion/style/index.d.ts +1 -0
- package/dist/es/Payssion/style/index.js +1 -0
- package/dist/es/Stripe/index.d.ts +12 -0
- package/dist/es/Stripe/index.js +10 -0
- package/dist/es/Stripe/interface.d.ts +91 -0
- package/dist/es/Stripe/interface.js +1 -0
- package/dist/es/Stripe/stripe-button.d.ts +6 -0
- package/dist/es/Stripe/stripe-button.js +65 -0
- package/dist/es/Stripe/stripe-modal.d.ts +6 -0
- package/dist/es/Stripe/stripe-modal.js +50 -0
- package/dist/es/Stripe/stripe-popup.d.ts +6 -0
- package/dist/es/Stripe/stripe-popup.js +61 -0
- package/dist/es/Stripe/stripe.d.ts +5 -0
- package/dist/es/Stripe/stripe.js +38 -0
- package/dist/es/Stripe/style/index.css +1 -0
- package/dist/es/Stripe/style/index.d.ts +1 -0
- package/dist/es/Stripe/style/index.js +1 -0
- package/dist/es/Wechat/index.d.ts +10 -0
- package/dist/es/Wechat/index.js +8 -0
- package/dist/es/Wechat/interface.d.ts +69 -0
- package/dist/es/Wechat/interface.js +1 -0
- package/dist/es/Wechat/style/index.css +1 -0
- package/dist/es/Wechat/style/index.d.ts +1 -0
- package/dist/es/Wechat/style/index.js +1 -0
- package/dist/es/Wechat/wechat-button.d.ts +6 -0
- package/dist/es/Wechat/wechat-button.js +50 -0
- package/dist/es/Wechat/wechat-modal.d.ts +6 -0
- package/dist/es/Wechat/wechat-modal.js +45 -0
- package/dist/es/Wechat/wechat.d.ts +4 -0
- package/dist/es/Wechat/wechat.js +40 -0
- package/dist/es/confirm-modal/index.d.ts +5 -0
- package/dist/es/confirm-modal/index.js +52 -0
- package/dist/es/confirm-modal/interface.d.ts +21 -0
- package/dist/es/confirm-modal/interface.js +1 -0
- package/dist/es/confirm-modal/style/index.css +1 -0
- package/dist/es/confirm-modal/style/index.d.ts +1 -0
- package/dist/es/confirm-modal/style/index.js +1 -0
- package/dist/es/dot-loading/dot-loading.d.ts +4 -0
- package/dist/es/dot-loading/dot-loading.js +60 -0
- package/dist/es/dot-loading/index.d.ts +3 -0
- package/dist/es/dot-loading/index.js +3 -0
- package/dist/es/dot-loading/interface.d.ts +4 -0
- package/dist/es/dot-loading/interface.js +1 -0
- package/dist/es/dot-loading/style/index.css +1 -0
- package/dist/es/dot-loading/style/index.d.ts +1 -0
- package/dist/es/dot-loading/style/index.js +1 -0
- package/dist/es/hooks/use-initialized.d.ts +1 -0
- package/dist/es/hooks/use-initialized.js +8 -0
- package/dist/es/hooks/use-inner-visible.d.ts +1 -0
- package/dist/es/hooks/use-inner-visible.js +9 -0
- package/dist/es/hooks/use-lock-scroll.d.ts +2 -0
- package/dist/es/hooks/use-lock-scroll.js +82 -0
- package/dist/es/hooks/use-touch.d.ts +17 -0
- package/dist/es/hooks/use-touch.js +60 -0
- package/dist/es/hooks/usePayWindowOpen.d.ts +21 -0
- package/dist/es/hooks/usePayWindowOpen.js +87 -0
- package/dist/es/icons/IconAlipay/index.d.ts +4 -0
- package/dist/es/icons/IconAlipay/index.js +21 -0
- package/dist/es/icons/IconClose/index.d.ts +4 -0
- package/dist/es/icons/IconClose/index.js +27 -0
- package/dist/es/icons/IconPaypalText/index.d.ts +4 -0
- package/dist/es/icons/IconPaypalText/index.js +27 -0
- package/dist/es/icons/IconPaypalWhite/index.d.ts +4 -0
- package/dist/es/icons/IconPaypalWhite/index.js +22 -0
- package/dist/es/icons/IconPayssionPay/index.d.ts +4 -0
- package/dist/es/icons/IconPayssionPay/index.js +50 -0
- package/dist/es/icons/IconStripe/index.d.ts +4 -0
- package/dist/es/icons/IconStripe/index.js +22 -0
- package/dist/es/icons/IconStripeText/index.d.ts +4 -0
- package/dist/es/icons/IconStripeText/index.js +22 -0
- package/dist/es/icons/IconWechatPay/index.d.ts +4 -0
- package/dist/es/icons/IconWechatPay/index.js +21 -0
- package/dist/es/icons/index.d.ts +9 -0
- package/dist/es/icons/index.js +9 -0
- package/dist/es/icons/interface.d.ts +5 -0
- package/dist/es/icons/interface.js +1 -0
- package/dist/es/icons/style/index.css +1 -0
- package/dist/es/icons/style/index.d.ts +1 -0
- package/dist/es/icons/style/index.js +1 -0
- package/dist/es/index.d.ts +19 -0
- package/dist/es/index.js +10 -0
- package/dist/es/pay-modal/index.d.ts +3 -0
- package/dist/es/pay-modal/index.js +3 -0
- package/dist/es/pay-modal/interface.d.ts +94 -0
- package/dist/es/pay-modal/interface.js +1 -0
- package/dist/es/pay-modal/pay-modal.d.ts +5 -0
- package/dist/es/pay-modal/pay-modal.js +93 -0
- package/dist/es/pay-modal/style/index.css +1 -0
- package/dist/es/pay-modal/style/index.d.ts +1 -0
- package/dist/es/pay-modal/style/index.js +1 -0
- package/dist/es/pay-popup/index.d.ts +5 -0
- package/dist/es/pay-popup/index.js +156 -0
- package/dist/es/pay-popup/interface.d.ts +148 -0
- package/dist/es/pay-popup/interface.js +1 -0
- package/dist/es/pay-popup/style/index.css +1 -0
- package/dist/es/pay-popup/style/index.d.ts +1 -0
- package/dist/es/pay-popup/style/index.js +1 -0
- package/dist/es/shared/enums/index.d.ts +57 -0
- package/dist/es/shared/enums/index.js +58 -0
- package/dist/es/shared/index.d.ts +1 -0
- package/dist/es/shared/index.js +1 -0
- package/dist/es/utils/can-use-dom.d.ts +1 -0
- package/dist/es/utils/can-use-dom.js +1 -0
- package/dist/es/utils/classNames.d.ts +5 -0
- package/dist/es/utils/classNames.js +27 -0
- package/dist/es/utils/dom.d.ts +8 -0
- package/dist/es/utils/dom.js +80 -0
- package/dist/es/utils/get-container.d.ts +2 -0
- package/dist/es/utils/get-container.js +5 -0
- package/dist/es/utils/get-scroll-parent.d.ts +3 -0
- package/dist/es/utils/get-scroll-parent.js +24 -0
- package/dist/es/utils/getPrefixCls.d.ts +1 -0
- package/dist/es/utils/getPrefixCls.js +3 -0
- package/dist/es/utils/is.d.ts +35 -0
- package/dist/es/utils/is.js +122 -0
- package/dist/es/utils/native-props.d.ts +8 -0
- package/dist/es/utils/native-props.js +26 -0
- package/dist/es/utils/omit.d.ts +1 -0
- package/dist/es/utils/omit.js +15 -0
- package/dist/es/utils/qrcode.d.ts +7 -0
- package/dist/es/utils/qrcode.js +17 -0
- package/dist/es/utils/render-to-container.d.ts +3 -0
- package/dist/es/utils/render-to-container.js +10 -0
- package/dist/es/utils/should-render.d.ts +10 -0
- package/dist/es/utils/should-render.js +12 -0
- package/dist/es/utils/supports-passive.d.ts +1 -0
- package/dist/es/utils/supports-passive.js +14 -0
- package/dist/es/utils/warning.d.ts +1 -0
- package/dist/es/utils/warning.js +13 -0
- package/dist/es/utils/with-default-props.d.ts +9 -0
- package/dist/es/utils/with-default-props.js +33 -0
- package/dist/es/utils/with-stop-propagation.d.ts +4 -0
- package/dist/es/utils/with-stop-propagation.js +22 -0
- package/dist/lib/Airwallex/airwallex-button.js +94 -0
- package/dist/lib/Airwallex/airwallex-modal.js +70 -0
- package/dist/lib/Airwallex/airwallex-popup.js +81 -0
- package/dist/lib/Airwallex/airwallex.js +83 -0
- package/dist/lib/Airwallex/index.js +29 -0
- package/dist/lib/Airwallex/interface.js +5 -0
- package/dist/lib/Airwallex/style/index.css +1 -0
- package/dist/lib/Airwallex/style/index.js +3 -0
- package/dist/lib/Alipay/alipay-button.js +60 -0
- package/dist/lib/Alipay/alipay-modal.js +53 -0
- package/dist/lib/Alipay/alipay.js +52 -0
- package/dist/lib/Alipay/index.js +27 -0
- package/dist/lib/Alipay/interface.js +5 -0
- package/dist/lib/Alipay/style/index.css +1 -0
- package/dist/lib/Alipay/style/index.js +5 -0
- package/dist/lib/Button/button.js +82 -0
- package/dist/lib/Button/index.js +22 -0
- package/dist/lib/Button/interface.js +5 -0
- package/dist/lib/Button/style/index.css +1 -0
- package/dist/lib/Button/style/index.js +3 -0
- package/dist/lib/FullScreenLoading/index.js +124 -0
- package/dist/lib/FullScreenLoading/interface.js +5 -0
- package/dist/lib/FullScreenLoading/style/index.css +1 -0
- package/dist/lib/FullScreenLoading/style/index.js +3 -0
- package/dist/lib/MAlipay/index.js +25 -0
- package/dist/lib/MAlipay/interface.js +5 -0
- package/dist/lib/MAlipay/m-alipay-auto-submit.js +43 -0
- package/dist/lib/MAlipay/m-alipay-button.js +135 -0
- package/dist/lib/MAlipay/style/index.css +1 -0
- package/dist/lib/MAlipay/style/index.js +3 -0
- package/dist/lib/MWeChat/index.js +28 -0
- package/dist/lib/MWeChat/interface.js +5 -0
- package/dist/lib/MWeChat/m-wechat-button.js +125 -0
- package/dist/lib/MWeChat/style/index.css +1 -0
- package/dist/lib/MWeChat/style/index.js +3 -0
- package/dist/lib/Mask/index.js +22 -0
- package/dist/lib/Mask/interface.js +5 -0
- package/dist/lib/Mask/mask.js +117 -0
- package/dist/lib/Mask/style/index.css +1 -0
- package/dist/lib/Mask/style/index.js +3 -0
- package/dist/lib/PayButton/index.js +76 -0
- package/dist/lib/PayButton/interface.js +3 -0
- package/dist/lib/PayMask/index.js +22 -0
- package/dist/lib/PayMask/interface.js +5 -0
- package/dist/lib/PayMask/pay-mask.js +112 -0
- package/dist/lib/PayMask/style/index.css +1 -0
- package/dist/lib/PayMask/style/index.js +3 -0
- package/dist/lib/Paypal/index.js +28 -0
- package/dist/lib/Paypal/interface.js +5 -0
- package/dist/lib/Paypal/paypal-button.js +83 -0
- package/dist/lib/Paypal/style/index.css +1 -0
- package/dist/lib/Paypal/style/index.js +3 -0
- package/dist/lib/Payssion/index.js +28 -0
- package/dist/lib/Payssion/interface.js +5 -0
- package/dist/lib/Payssion/payssion-button.js +83 -0
- package/dist/lib/Payssion/style/index.css +1 -0
- package/dist/lib/Payssion/style/index.js +3 -0
- package/dist/lib/Stripe/index.js +29 -0
- package/dist/lib/Stripe/interface.js +5 -0
- package/dist/lib/Stripe/stripe-button.js +73 -0
- package/dist/lib/Stripe/stripe-modal.js +57 -0
- package/dist/lib/Stripe/stripe-popup.js +68 -0
- package/dist/lib/Stripe/stripe.js +46 -0
- package/dist/lib/Stripe/style/index.css +1 -0
- package/dist/lib/Stripe/style/index.js +3 -0
- package/dist/lib/Wechat/index.js +27 -0
- package/dist/lib/Wechat/interface.js +5 -0
- package/dist/lib/Wechat/style/index.css +1 -0
- package/dist/lib/Wechat/style/index.js +3 -0
- package/dist/lib/Wechat/wechat-button.js +58 -0
- package/dist/lib/Wechat/wechat-modal.js +52 -0
- package/dist/lib/Wechat/wechat.js +48 -0
- package/dist/lib/confirm-modal/index.js +72 -0
- package/dist/lib/confirm-modal/interface.js +5 -0
- package/dist/lib/confirm-modal/style/index.css +1 -0
- package/dist/lib/confirm-modal/style/index.js +3 -0
- package/dist/lib/dot-loading/dot-loading.js +67 -0
- package/dist/lib/dot-loading/index.js +22 -0
- package/dist/lib/dot-loading/interface.js +5 -0
- package/dist/lib/dot-loading/style/index.css +1 -0
- package/dist/lib/dot-loading/style/index.js +3 -0
- package/dist/lib/hooks/use-initialized.js +14 -0
- package/dist/lib/hooks/use-inner-visible.js +15 -0
- package/dist/lib/hooks/use-lock-scroll.js +88 -0
- package/dist/lib/hooks/use-touch.js +66 -0
- package/dist/lib/hooks/usePayWindowOpen.js +92 -0
- package/dist/lib/icons/IconAlipay/index.js +28 -0
- package/dist/lib/icons/IconClose/index.js +34 -0
- package/dist/lib/icons/IconPaypalText/index.js +34 -0
- package/dist/lib/icons/IconPaypalWhite/index.js +29 -0
- package/dist/lib/icons/IconPayssionPay/index.js +57 -0
- package/dist/lib/icons/IconStripe/index.js +29 -0
- package/dist/lib/icons/IconStripeText/index.js +29 -0
- package/dist/lib/icons/IconWechatPay/index.js +28 -0
- package/dist/lib/icons/index.js +84 -0
- package/dist/lib/icons/interface.js +5 -0
- package/dist/lib/icons/style/index.css +1 -0
- package/dist/lib/icons/style/index.js +3 -0
- package/dist/lib/index.js +92 -0
- package/dist/lib/pay-modal/index.js +22 -0
- package/dist/lib/pay-modal/interface.js +5 -0
- package/dist/lib/pay-modal/pay-modal.js +113 -0
- package/dist/lib/pay-modal/style/index.css +1 -0
- package/dist/lib/pay-modal/style/index.js +3 -0
- package/dist/lib/pay-popup/index.js +176 -0
- package/dist/lib/pay-popup/interface.js +5 -0
- package/dist/lib/pay-popup/style/index.css +1 -0
- package/dist/lib/pay-popup/style/index.js +3 -0
- package/dist/lib/shared/enums/index.js +64 -0
- package/dist/lib/shared/index.js +16 -0
- package/dist/lib/utils/can-use-dom.js +7 -0
- package/dist/lib/utils/classNames.js +34 -0
- package/dist/lib/utils/dom.js +86 -0
- package/dist/lib/utils/get-container.js +11 -0
- package/dist/lib/utils/get-scroll-parent.js +30 -0
- package/dist/lib/utils/getPrefixCls.js +9 -0
- package/dist/lib/utils/is.js +160 -0
- package/dist/lib/utils/native-props.js +33 -0
- package/dist/lib/utils/omit.js +21 -0
- package/dist/lib/utils/qrcode.js +23 -0
- package/dist/lib/utils/render-to-container.js +16 -0
- package/dist/lib/utils/should-render.js +20 -0
- package/dist/lib/utils/supports-passive.js +20 -0
- package/dist/lib/utils/warning.js +19 -0
- package/dist/lib/utils/with-default-props.js +40 -0
- package/dist/lib/utils/with-stop-propagation.js +29 -0
- package/dist/umd/pay-sdk-react.umd.js +16360 -0
- package/dist/umd/pay-sdk-react.umd.js.map +1 -0
- package/package.json +181 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactStripeJs = require("@stripe/react-stripe-js");
|
|
9
|
+
var _stripeJs = require("@stripe/stripe-js");
|
|
10
|
+
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
11
|
+
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
12
|
+
const _excluded = ["stripeKey", "clientSecret", "className"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
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); }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
+
const Stripe = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
19
|
+
const {
|
|
20
|
+
stripeKey,
|
|
21
|
+
clientSecret,
|
|
22
|
+
className = ''
|
|
23
|
+
} = props,
|
|
24
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
const stripeRef = (0, _react.useRef)(null);
|
|
26
|
+
(0, _react.useImperativeHandle)(ref, () => stripeRef.current);
|
|
27
|
+
const stripePromise = (0, _react.useMemo)(() => {
|
|
28
|
+
if (!stripeKey) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return _stripeJs.loadStripe === null || _stripeJs.loadStripe === void 0 ? void 0 : (0, _stripeJs.loadStripe)(stripeKey);
|
|
32
|
+
}, [stripeKey]);
|
|
33
|
+
const classNames = (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('pay-stripe'), className);
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
35
|
+
ref: stripeRef
|
|
36
|
+
}, others, {
|
|
37
|
+
className: classNames
|
|
38
|
+
}), clientSecret && stripePromise && /*#__PURE__*/_react.default.createElement(_reactStripeJs.EmbeddedCheckoutProvider, {
|
|
39
|
+
stripe: stripePromise,
|
|
40
|
+
options: {
|
|
41
|
+
clientSecret
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_reactStripeJs.EmbeddedCheckout, null)));
|
|
44
|
+
});
|
|
45
|
+
Stripe.displayName = 'Stripe';
|
|
46
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(Stripe);
|
|
@@ -0,0 +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:all .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 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}@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%}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _wechat = _interopRequireDefault(require("./wechat"));
|
|
9
|
+
var _wechatButton = _interopRequireDefault(require("./wechat-button"));
|
|
10
|
+
var _wechatModal = _interopRequireDefault(require("./wechat-modal"));
|
|
11
|
+
var _interface = require("./interface");
|
|
12
|
+
Object.keys(_interface).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _interface[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _interface[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
const WechatComponent = _wechat.default;
|
|
25
|
+
WechatComponent.Button = _wechatButton.default;
|
|
26
|
+
WechatComponent.Modal = _wechatModal.default;
|
|
27
|
+
var _default = exports.default = WechatComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.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}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
|
+
var _wechatModal = _interopRequireDefault(require("./wechat-modal"));
|
|
10
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
11
|
+
var _icons = require("../icons");
|
|
12
|
+
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
13
|
+
const _excluded = ["className", "children", "onClick", "createOrder", "modalProps"];
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
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); }
|
|
16
|
+
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); }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
+
const WechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
20
|
+
const {
|
|
21
|
+
className,
|
|
22
|
+
children = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.IconWechatPay, null), "\u5FAE\u4FE1\u652F\u4ED8"),
|
|
23
|
+
onClick,
|
|
24
|
+
createOrder,
|
|
25
|
+
modalProps
|
|
26
|
+
} = props,
|
|
27
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
28
|
+
const wechatButtonRef = (0, _react.useRef)({
|
|
29
|
+
nativeElement: null
|
|
30
|
+
});
|
|
31
|
+
const wechatModalRef = (0, _react.useRef)(null);
|
|
32
|
+
(0, _react.useImperativeHandle)(ref, () => wechatButtonRef.current);
|
|
33
|
+
const handlePayCreateOrder = (0, _react.useCallback)(async () => {
|
|
34
|
+
if (createOrder) {
|
|
35
|
+
var _wechatModalRef$curre;
|
|
36
|
+
const options = await (createOrder === null || createOrder === void 0 ? void 0 : createOrder());
|
|
37
|
+
(_wechatModalRef$curre = wechatModalRef.current) === null || _wechatModalRef$curre === void 0 || _wechatModalRef$curre.open(options);
|
|
38
|
+
}
|
|
39
|
+
}, [createOrder]);
|
|
40
|
+
const handleClick = (0, _react.useCallback)(e => {
|
|
41
|
+
if (createOrder) {
|
|
42
|
+
handlePayCreateOrder();
|
|
43
|
+
} else {
|
|
44
|
+
var _wechatModalRef$curre2;
|
|
45
|
+
wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.open();
|
|
46
|
+
}
|
|
47
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
48
|
+
}, [onClick, createOrder, handlePayCreateOrder]);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
50
|
+
ref: wechatButtonRef,
|
|
51
|
+
className: (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('wechat-btn'), className),
|
|
52
|
+
onClick: handleClick
|
|
53
|
+
}, others), children), /*#__PURE__*/_react.default.createElement(_wechatModal.default, _extends({
|
|
54
|
+
ref: wechatModalRef
|
|
55
|
+
}, modalProps)));
|
|
56
|
+
});
|
|
57
|
+
WechatButton.displayName = 'WechatButton';
|
|
58
|
+
var _default = exports.default = WechatButton;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _payModal = _interopRequireDefault(require("../pay-modal"));
|
|
9
|
+
var _wechat = _interopRequireDefault(require("./wechat"));
|
|
10
|
+
const _excluded = ["wechatProps", "visible", "onClose"];
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
15
|
+
const WechatModal = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
wechatProps: propsWechatProps,
|
|
18
|
+
visible,
|
|
19
|
+
onClose
|
|
20
|
+
} = props,
|
|
21
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
22
|
+
const wechatRef = (0, _react.useRef)(null);
|
|
23
|
+
const [uncontrolledVisible, setUncontrolledVisible] = (0, _react.useState)(false);
|
|
24
|
+
const [wechatProps, setWechatProps] = (0, _react.useState)();
|
|
25
|
+
const isControlled = visible !== undefined;
|
|
26
|
+
const _visible = isControlled ? visible : uncontrolledVisible;
|
|
27
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
28
|
+
open: value => {
|
|
29
|
+
if (value) {
|
|
30
|
+
setWechatProps(value);
|
|
31
|
+
}
|
|
32
|
+
setUncontrolledVisible(true);
|
|
33
|
+
},
|
|
34
|
+
close: () => {
|
|
35
|
+
setUncontrolledVisible(false);
|
|
36
|
+
onClose === null || onClose === void 0 || onClose();
|
|
37
|
+
},
|
|
38
|
+
current: wechatRef.current
|
|
39
|
+
}));
|
|
40
|
+
const _wechatProps = propsWechatProps !== null && propsWechatProps !== void 0 ? propsWechatProps : wechatProps;
|
|
41
|
+
return /*#__PURE__*/React.createElement(_payModal.default, _extends({
|
|
42
|
+
visible: _visible,
|
|
43
|
+
onClose: () => {
|
|
44
|
+
if (!isControlled) {
|
|
45
|
+
setUncontrolledVisible(false);
|
|
46
|
+
}
|
|
47
|
+
onClose === null || onClose === void 0 || onClose();
|
|
48
|
+
}
|
|
49
|
+
}, others), (_wechatProps === null || _wechatProps === void 0 ? void 0 : _wechatProps.wechatUrl) && /*#__PURE__*/React.createElement(_wechat.default, _wechatProps));
|
|
50
|
+
});
|
|
51
|
+
WechatModal.displayName = "WechatModal";
|
|
52
|
+
var _default = exports.default = WechatModal;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
|
+
var _qrcode = _interopRequireDefault(require("../utils/qrcode"));
|
|
10
|
+
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
const classPrefix = (0, _getPrefixCls.getPrefixCls)('wechat');
|
|
14
|
+
const WechatQrCode = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
wechatType = 'qrcode',
|
|
17
|
+
wechatUrl,
|
|
18
|
+
tipText = '请使用微信APP扫码支付',
|
|
19
|
+
className,
|
|
20
|
+
style
|
|
21
|
+
} = _ref;
|
|
22
|
+
const [imageUrl, setImageUrl] = (0, _react.useState)('');
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
if (wechatType === 'qrcode') {
|
|
25
|
+
(0, _qrcode.default)(wechatUrl).then(url => {
|
|
26
|
+
setImageUrl(url);
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
setImageUrl(wechatUrl);
|
|
30
|
+
}
|
|
31
|
+
}, [wechatUrl, wechatType]);
|
|
32
|
+
if (!imageUrl) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
className: (0, _classNames.default)(classPrefix, className),
|
|
37
|
+
style: style
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: "".concat(classPrefix, "__container")
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
41
|
+
className: "".concat(classPrefix, "__image"),
|
|
42
|
+
src: imageUrl,
|
|
43
|
+
alt: '微信支付二维码'
|
|
44
|
+
})), tipText && /*#__PURE__*/_react.default.createElement("span", {
|
|
45
|
+
className: "".concat(classPrefix, "__tip")
|
|
46
|
+
}, tipText));
|
|
47
|
+
};
|
|
48
|
+
var _default = exports.default = WechatQrCode;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _usePayWindowOpen = require("../hooks/usePayWindowOpen");
|
|
10
|
+
var _payModal = _interopRequireDefault(require("../pay-modal"));
|
|
11
|
+
var _interface = require("./interface");
|
|
12
|
+
Object.keys(_interface).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _interface[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _interface[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
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); }
|
|
25
|
+
const ConfirmModal = props => {
|
|
26
|
+
const {
|
|
27
|
+
visible,
|
|
28
|
+
onRetry,
|
|
29
|
+
onFinish,
|
|
30
|
+
title = "支付确认",
|
|
31
|
+
desc = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, "1. \u5982\u679C\u60A8\u5DF2\u5B8C\u6210\u652F\u4ED8\uFF0C\u8BF7\u70B9\u51FB[\u652F\u4ED8\u5B8C\u6210]"), /*#__PURE__*/_react.default.createElement("div", null, "2. \u5982\u679C\u672A\u652F\u4ED8\u6210\u529F\uFF0C\u53EF\u70B9\u51FB[\u91CD\u65B0\u652F\u4ED8]")),
|
|
32
|
+
retryText = "重新支付",
|
|
33
|
+
finishText = "支付完成",
|
|
34
|
+
icon = /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
role: "img",
|
|
36
|
+
"aria-label": "success"
|
|
37
|
+
}, "\u2714\uFE0F"),
|
|
38
|
+
showClose = true,
|
|
39
|
+
maskClosable = false,
|
|
40
|
+
onClose,
|
|
41
|
+
payUrl,
|
|
42
|
+
autoOpenWindow = false,
|
|
43
|
+
openMode = "window"
|
|
44
|
+
} = props;
|
|
45
|
+
const {
|
|
46
|
+
closeWindow
|
|
47
|
+
} = (0, _usePayWindowOpen.usePayWindowOpen)({
|
|
48
|
+
payUrl: payUrl || "",
|
|
49
|
+
onClose,
|
|
50
|
+
autoOpen: autoOpenWindow,
|
|
51
|
+
openMode: openMode
|
|
52
|
+
});
|
|
53
|
+
const handleClose = (0, _react.useCallback)(() => {
|
|
54
|
+
onClose === null || onClose === void 0 || onClose();
|
|
55
|
+
if (autoOpenWindow) closeWindow();
|
|
56
|
+
}, [onClose, autoOpenWindow, closeWindow]);
|
|
57
|
+
if (!visible) return null;
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_payModal.default, {
|
|
59
|
+
visible: visible,
|
|
60
|
+
icon: icon,
|
|
61
|
+
title: title,
|
|
62
|
+
desc: desc,
|
|
63
|
+
showClose: showClose,
|
|
64
|
+
maskClosable: maskClosable,
|
|
65
|
+
onClose: handleClose,
|
|
66
|
+
onRetry: onRetry,
|
|
67
|
+
onFinish: onFinish,
|
|
68
|
+
retryText: retryText,
|
|
69
|
+
finishText: finishText
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
var _default = exports.default = ConfirmModal;
|
|
@@ -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,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
|
+
var _withDefaultProps = require("../utils/with-default-props");
|
|
10
|
+
var _nativeProps = require("../utils/native-props");
|
|
11
|
+
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const classPrefix = (0, _getPrefixCls.getPrefixCls)('dot-loading');
|
|
14
|
+
const colorRecord = {
|
|
15
|
+
default: 'var(--adm-color-weak)',
|
|
16
|
+
primary: 'var(--adm-color-primary)',
|
|
17
|
+
white: 'var(--adm-color-white)'
|
|
18
|
+
};
|
|
19
|
+
const defaultProps = {
|
|
20
|
+
color: 'default'
|
|
21
|
+
};
|
|
22
|
+
const DotLoading = /*#__PURE__*/_react.default.memo(p => {
|
|
23
|
+
var _colorRecord$props$co;
|
|
24
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
25
|
+
return (0, _nativeProps.withNativeProps)(props, /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
style: {
|
|
27
|
+
color: (_colorRecord$props$co = colorRecord[props.color]) !== null && _colorRecord$props$co !== void 0 ? _colorRecord$props$co : props.color
|
|
28
|
+
},
|
|
29
|
+
className: (0, _classNames.default)('adm-loading', classPrefix)
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
31
|
+
height: "1em",
|
|
32
|
+
viewBox: "0 0 100 40",
|
|
33
|
+
style: {
|
|
34
|
+
verticalAlign: '-0.125em'
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
37
|
+
stroke: "none",
|
|
38
|
+
strokeWidth: "1",
|
|
39
|
+
fill: "none",
|
|
40
|
+
fillRule: "evenodd"
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
42
|
+
transform: "translate(-100.000000, -71.000000)"
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
44
|
+
transform: "translate(95.000000, 71.000000)"
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
46
|
+
transform: "translate(5.000000, 0.000000)"
|
|
47
|
+
}, [0, 1, 2].map(i => /*#__PURE__*/_react.default.createElement("rect", {
|
|
48
|
+
key: i,
|
|
49
|
+
fill: "currentColor",
|
|
50
|
+
x: 20 + i * 26,
|
|
51
|
+
y: "16",
|
|
52
|
+
width: "8",
|
|
53
|
+
height: "8",
|
|
54
|
+
rx: "2"
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement("animate", {
|
|
56
|
+
attributeName: "y",
|
|
57
|
+
from: "16",
|
|
58
|
+
to: "16",
|
|
59
|
+
dur: "2s",
|
|
60
|
+
begin: "".concat(i * 0.2, "s"),
|
|
61
|
+
repeatCount: "indefinite",
|
|
62
|
+
values: "16; 6; 26; 16; 16",
|
|
63
|
+
keyTimes: "0; 0.1; 0.3; 0.4; 1"
|
|
64
|
+
}))))))))));
|
|
65
|
+
});
|
|
66
|
+
DotLoading.displayName = 'DotLoading';
|
|
67
|
+
var _default = exports.default = DotLoading;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _dotLoading = _interopRequireDefault(require("./dot-loading"));
|
|
9
|
+
var _interface = require("./interface");
|
|
10
|
+
Object.keys(_interface).forEach(function (key) {
|
|
11
|
+
if (key === "default" || key === "__esModule") return;
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
13
|
+
if (key in exports && exports[key] === _interface[key]) return;
|
|
14
|
+
Object.defineProperty(exports, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return _interface[key];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
var _default = exports.default = _dotLoading.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pay-dot-loading{display:inline-block}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInitialized = useInitialized;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useInitialized(check) {
|
|
9
|
+
const initializedRef = (0, _react.useRef)(check);
|
|
10
|
+
if (check) {
|
|
11
|
+
initializedRef.current = true;
|
|
12
|
+
}
|
|
13
|
+
return !!initializedRef.current;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInnerVisible = useInnerVisible;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
function useInnerVisible(outerVisible) {
|
|
10
|
+
const [innerVisible, setInnerVisible] = (0, _react.useState)(outerVisible);
|
|
11
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
12
|
+
setInnerVisible(outerVisible);
|
|
13
|
+
}, [outerVisible]);
|
|
14
|
+
return innerVisible;
|
|
15
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useLockScroll = useLockScroll;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _getScrollParent = require("../utils/get-scroll-parent");
|
|
9
|
+
var _supportsPassive = require("../utils/supports-passive");
|
|
10
|
+
var _useTouch = require("./use-touch");
|
|
11
|
+
let totalLockCount = 0;
|
|
12
|
+
const BODY_LOCK_CLASS = "yfm-overflow-hidden";
|
|
13
|
+
function getScrollableElement(el) {
|
|
14
|
+
let current = el === null || el === void 0 ? void 0 : el.parentElement;
|
|
15
|
+
while (current) {
|
|
16
|
+
if (current.clientHeight < current.scrollHeight) {
|
|
17
|
+
return current;
|
|
18
|
+
}
|
|
19
|
+
current = current.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function useLockScroll(rootRef, shouldLock) {
|
|
24
|
+
const touch = (0, _useTouch.useTouch)();
|
|
25
|
+
const onTouchMove = event => {
|
|
26
|
+
touch.move(event);
|
|
27
|
+
const direction = touch.deltaY.current > 0 ? "10" : "01";
|
|
28
|
+
const el = (0, _getScrollParent.getScrollParent)(event.target, rootRef.current);
|
|
29
|
+
if (!el) return;
|
|
30
|
+
|
|
31
|
+
// This has perf cost but we have to compatible with iOS 12
|
|
32
|
+
if (shouldLock === "strict") {
|
|
33
|
+
const scrollableParent = getScrollableElement(event.target);
|
|
34
|
+
if (scrollableParent === document.body || scrollableParent === document.documentElement) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const {
|
|
40
|
+
scrollHeight,
|
|
41
|
+
offsetHeight,
|
|
42
|
+
scrollTop
|
|
43
|
+
} = el;
|
|
44
|
+
const {
|
|
45
|
+
height
|
|
46
|
+
} = el.getBoundingClientRect();
|
|
47
|
+
let status = "11";
|
|
48
|
+
if (scrollTop === 0) {
|
|
49
|
+
status = offsetHeight >= scrollHeight ? "00" : "01";
|
|
50
|
+
} else if (scrollHeight <= Math.round(height + scrollTop)) {
|
|
51
|
+
status = "10";
|
|
52
|
+
}
|
|
53
|
+
if (status !== "11" && touch.isVertical() && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
54
|
+
if (event.cancelable && _supportsPassive.supportsPassive) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const lock = () => {
|
|
60
|
+
document.addEventListener("touchstart", touch.start);
|
|
61
|
+
document.addEventListener("touchmove", onTouchMove, _supportsPassive.supportsPassive ? {
|
|
62
|
+
passive: false
|
|
63
|
+
} : false);
|
|
64
|
+
if (!totalLockCount) {
|
|
65
|
+
document.body.classList.add(BODY_LOCK_CLASS);
|
|
66
|
+
}
|
|
67
|
+
totalLockCount++;
|
|
68
|
+
};
|
|
69
|
+
const unlock = () => {
|
|
70
|
+
if (totalLockCount) {
|
|
71
|
+
document.removeEventListener("touchstart", touch.start);
|
|
72
|
+
document.removeEventListener("touchmove", onTouchMove);
|
|
73
|
+
totalLockCount--;
|
|
74
|
+
if (!totalLockCount) {
|
|
75
|
+
document.body.classList.remove(BODY_LOCK_CLASS);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
(0, _react.useEffect)(() => {
|
|
80
|
+
if (shouldLock) {
|
|
81
|
+
lock();
|
|
82
|
+
return () => {
|
|
83
|
+
unlock();
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
}, [shouldLock]);
|
|
88
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTouch = useTouch;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const MIN_DISTANCE = 10;
|
|
9
|
+
function getDirection(x, y) {
|
|
10
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
11
|
+
return "horizontal";
|
|
12
|
+
}
|
|
13
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
14
|
+
return "vertical";
|
|
15
|
+
}
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
function useTouch() {
|
|
19
|
+
const startX = (0, _react.useRef)(0);
|
|
20
|
+
const startY = (0, _react.useRef)(0);
|
|
21
|
+
const deltaX = (0, _react.useRef)(0);
|
|
22
|
+
const deltaY = (0, _react.useRef)(0);
|
|
23
|
+
const offsetX = (0, _react.useRef)(0);
|
|
24
|
+
const offsetY = (0, _react.useRef)(0);
|
|
25
|
+
const direction = (0, _react.useRef)("");
|
|
26
|
+
const isVertical = () => direction.current === "vertical";
|
|
27
|
+
const isHorizontal = () => direction.current === "horizontal";
|
|
28
|
+
const reset = () => {
|
|
29
|
+
deltaX.current = 0;
|
|
30
|
+
deltaY.current = 0;
|
|
31
|
+
offsetX.current = 0;
|
|
32
|
+
offsetY.current = 0;
|
|
33
|
+
direction.current = "";
|
|
34
|
+
};
|
|
35
|
+
const start = event => {
|
|
36
|
+
var _event$touches$0$clie, _event$touches$, _event$touches$0$clie2, _event$touches$2;
|
|
37
|
+
reset();
|
|
38
|
+
startX.current = (_event$touches$0$clie = (_event$touches$ = event.touches[0]) === null || _event$touches$ === void 0 ? void 0 : _event$touches$.clientX) !== null && _event$touches$0$clie !== void 0 ? _event$touches$0$clie : 0;
|
|
39
|
+
startY.current = (_event$touches$0$clie2 = (_event$touches$2 = event.touches[0]) === null || _event$touches$2 === void 0 ? void 0 : _event$touches$2.clientY) !== null && _event$touches$0$clie2 !== void 0 ? _event$touches$0$clie2 : 0;
|
|
40
|
+
};
|
|
41
|
+
const move = event => {
|
|
42
|
+
const touch = event.touches[0];
|
|
43
|
+
if (!touch) return;
|
|
44
|
+
deltaX.current = touch.clientX - startX.current;
|
|
45
|
+
deltaY.current = (touch === null || touch === void 0 ? void 0 : touch.clientY) - startY.current;
|
|
46
|
+
offsetX.current = Math.abs(deltaX.current);
|
|
47
|
+
offsetY.current = Math.abs(deltaY.current);
|
|
48
|
+
if (!direction.current) {
|
|
49
|
+
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
move,
|
|
54
|
+
start,
|
|
55
|
+
reset,
|
|
56
|
+
startX,
|
|
57
|
+
startY,
|
|
58
|
+
deltaX,
|
|
59
|
+
deltaY,
|
|
60
|
+
offsetX,
|
|
61
|
+
offsetY,
|
|
62
|
+
direction,
|
|
63
|
+
isVertical,
|
|
64
|
+
isHorizontal
|
|
65
|
+
};
|
|
66
|
+
}
|