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,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAndroid = isAndroid;
|
|
7
|
+
exports.isArray = isArray;
|
|
8
|
+
exports.isBlob = isBlob;
|
|
9
|
+
exports.isBoolean = isBoolean;
|
|
10
|
+
exports.isClassComponent = void 0;
|
|
11
|
+
exports.isColor = isColor;
|
|
12
|
+
exports.isDOMElement = void 0;
|
|
13
|
+
exports.isEmail = isEmail;
|
|
14
|
+
exports.isEmptyObject = isEmptyObject;
|
|
15
|
+
exports.isEmptyReactNode = isEmptyReactNode;
|
|
16
|
+
exports.isExist = isExist;
|
|
17
|
+
exports.isFile = isFile;
|
|
18
|
+
exports.isFunction = isFunction;
|
|
19
|
+
exports.isIOS = isIOS;
|
|
20
|
+
exports.isImageLinkAvailable = isImageLinkAvailable;
|
|
21
|
+
exports.isLink = void 0;
|
|
22
|
+
exports.isMobile = isMobile;
|
|
23
|
+
exports.isNull = isNull;
|
|
24
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
25
|
+
exports.isNumber = isNumber;
|
|
26
|
+
exports.isObject = isObject;
|
|
27
|
+
exports.isPromise = isPromise;
|
|
28
|
+
exports.isReactComponent = void 0;
|
|
29
|
+
exports.isRegExp = isRegExp;
|
|
30
|
+
exports.isSmsCode = isSmsCode;
|
|
31
|
+
exports.isString = isString;
|
|
32
|
+
exports.isUndefined = isUndefined;
|
|
33
|
+
exports.isUsPhoneNumber = isUsPhoneNumber;
|
|
34
|
+
exports.isWindow = isWindow;
|
|
35
|
+
var _react = require("react");
|
|
36
|
+
var _canUseDom = require("./can-use-dom");
|
|
37
|
+
var _dom = require("./dom");
|
|
38
|
+
const opt = Object.prototype.toString;
|
|
39
|
+
function isArray(obj) {
|
|
40
|
+
return opt.call(obj) === "[object Array]";
|
|
41
|
+
}
|
|
42
|
+
function isObject(obj) {
|
|
43
|
+
return opt.call(obj) === "[object Object]";
|
|
44
|
+
}
|
|
45
|
+
function isString(obj) {
|
|
46
|
+
return opt.call(obj) === "[object String]";
|
|
47
|
+
}
|
|
48
|
+
function isNumber(obj) {
|
|
49
|
+
return opt.call(obj) === "[object Number]" && obj === obj;
|
|
50
|
+
}
|
|
51
|
+
function isRegExp(obj) {
|
|
52
|
+
return opt.call(obj) === "[object RegExp]";
|
|
53
|
+
}
|
|
54
|
+
function isFile(obj) {
|
|
55
|
+
return opt.call(obj) === "[object File]";
|
|
56
|
+
}
|
|
57
|
+
function isBlob(obj) {
|
|
58
|
+
return opt.call(obj) === "[object Blob]";
|
|
59
|
+
}
|
|
60
|
+
function isHex(color) {
|
|
61
|
+
return /^#[a-fA-F0-9]{3}$|#[a-fA-F0-9]{6}$/.test(color);
|
|
62
|
+
}
|
|
63
|
+
function isRgb(color) {
|
|
64
|
+
return /^rgb\((\s*\d+\s*,?){3}\)$/.test(color);
|
|
65
|
+
}
|
|
66
|
+
function isRgba(color) {
|
|
67
|
+
return /^rgba\((\s*\d+\s*,\s*){3}\s*\d(\.\d+)?\s*\)$/.test(color);
|
|
68
|
+
}
|
|
69
|
+
function isColor(color) {
|
|
70
|
+
return isHex(color) || isRgb(color) || isRgba(color);
|
|
71
|
+
}
|
|
72
|
+
function isUndefined(obj) {
|
|
73
|
+
return obj === undefined;
|
|
74
|
+
}
|
|
75
|
+
function isNull(obj) {
|
|
76
|
+
return obj === null;
|
|
77
|
+
}
|
|
78
|
+
function isNullOrUndefined(obj) {
|
|
79
|
+
return obj === null || obj === undefined;
|
|
80
|
+
}
|
|
81
|
+
function isFunction(obj) {
|
|
82
|
+
return typeof obj === "function";
|
|
83
|
+
}
|
|
84
|
+
function isEmptyObject(obj) {
|
|
85
|
+
return isObject(obj) && Object.keys(obj).length === 0;
|
|
86
|
+
}
|
|
87
|
+
function isEmptyReactNode(content, trim) {
|
|
88
|
+
if (content === null || content === undefined || content === false) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
if (typeof content === "string" && (trim ? content.trim() === "" : content === "")) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
function isExist(obj) {
|
|
97
|
+
return obj || obj === 0;
|
|
98
|
+
}
|
|
99
|
+
function isWindow(el) {
|
|
100
|
+
return el === window;
|
|
101
|
+
}
|
|
102
|
+
function isBoolean(value) {
|
|
103
|
+
return typeof value === "boolean";
|
|
104
|
+
}
|
|
105
|
+
const isReactComponent = element => {
|
|
106
|
+
return element && /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type === "function";
|
|
107
|
+
};
|
|
108
|
+
exports.isReactComponent = isReactComponent;
|
|
109
|
+
const isClassComponent = element => {
|
|
110
|
+
var _element$type$prototy;
|
|
111
|
+
return isReactComponent(element) && !!((_element$type$prototy = element.type.prototype) !== null && _element$type$prototy !== void 0 && _element$type$prototy.isReactComponent);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// element 是合成的 dom 元素或者字符串,数字等
|
|
115
|
+
exports.isClassComponent = isClassComponent;
|
|
116
|
+
const isDOMElement = element => {
|
|
117
|
+
return /*#__PURE__*/(0, _react.isValidElement)(element) && typeof element.type === "string";
|
|
118
|
+
};
|
|
119
|
+
exports.isDOMElement = isDOMElement;
|
|
120
|
+
const isLink = text => {
|
|
121
|
+
return isString(text) && (text.startsWith("http") || text.startsWith("https"));
|
|
122
|
+
};
|
|
123
|
+
exports.isLink = isLink;
|
|
124
|
+
async function isImageLinkAvailable(url) {
|
|
125
|
+
return new Promise(resolve => {
|
|
126
|
+
const img = new Image();
|
|
127
|
+
img.onload = () => resolve(true);
|
|
128
|
+
img.onerror = () => resolve(false);
|
|
129
|
+
img.src = url;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function isMobile() {
|
|
133
|
+
return _dom.clientWindow && /Android|iPhone|iPad|iPod|Windows Phone|BlackBerry|Mobile/i.test(_dom.clientWindow === null || _dom.clientWindow === void 0 ? void 0 : _dom.clientWindow.navigator.userAgent);
|
|
134
|
+
}
|
|
135
|
+
function isEmail(email) {
|
|
136
|
+
const emailReg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
|
137
|
+
return emailReg.test(email);
|
|
138
|
+
}
|
|
139
|
+
function isSmsCode(code) {
|
|
140
|
+
const codeReg = /\d{6}/;
|
|
141
|
+
return codeReg.test(code);
|
|
142
|
+
}
|
|
143
|
+
function isUsPhoneNumber(phone) {
|
|
144
|
+
const phoneRegex = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
145
|
+
return phoneRegex.test(phone);
|
|
146
|
+
}
|
|
147
|
+
function isPromise(obj) {
|
|
148
|
+
return !!obj && typeof obj === "object" && typeof obj.then === "function";
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 判断是否为Android设备
|
|
153
|
+
* @returns 是否为Android设备
|
|
154
|
+
*/
|
|
155
|
+
function isAndroid() {
|
|
156
|
+
return _canUseDom.canUseDom ? /android/.test(navigator.userAgent.toLowerCase()) : false;
|
|
157
|
+
}
|
|
158
|
+
function isIOS() {
|
|
159
|
+
return _canUseDom.canUseDom ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
|
160
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withNativeProps = withNativeProps;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classNames = _interopRequireDefault(require("./classNames"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function withNativeProps(props, element) {
|
|
16
|
+
const p = _objectSpread({}, element.props);
|
|
17
|
+
if (props.className) {
|
|
18
|
+
p.className = (0, _classNames.default)(element.props.className, props.className);
|
|
19
|
+
}
|
|
20
|
+
if (props.style) {
|
|
21
|
+
p.style = _objectSpread(_objectSpread({}, p.style), props.style);
|
|
22
|
+
}
|
|
23
|
+
if (props.tabIndex !== undefined) {
|
|
24
|
+
p.tabIndex = props.tabIndex;
|
|
25
|
+
}
|
|
26
|
+
for (const key in props) {
|
|
27
|
+
if (!props.hasOwnProperty(key)) continue;
|
|
28
|
+
if (key.startsWith("data-") || key.startsWith("aria-")) {
|
|
29
|
+
p[key] = props[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/_react.default.cloneElement(element, p);
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = omit;
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
// delete keys from object
|
|
13
|
+
function omit(obj, keys) {
|
|
14
|
+
const clone = _objectSpread({}, obj);
|
|
15
|
+
keys.forEach(key => {
|
|
16
|
+
if (key in clone) {
|
|
17
|
+
delete clone[key];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return clone;
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _qrcode = _interopRequireDefault(require("qrcode"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* 根据入参生成一个二维码
|
|
11
|
+
* @param url 要生成二维码的url
|
|
12
|
+
* @returns Promise
|
|
13
|
+
*/
|
|
14
|
+
const makeQrcode = url => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
_qrcode.default.toDataURL(url).then(qrcodeUrl => {
|
|
17
|
+
resolve(qrcodeUrl);
|
|
18
|
+
}).catch(err => {
|
|
19
|
+
reject(err);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = makeQrcode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderToContainer = renderToContainer;
|
|
7
|
+
var _reactDom = require("react-dom");
|
|
8
|
+
var _getContainer = require("./get-container");
|
|
9
|
+
var _canUseDom = require("./can-use-dom");
|
|
10
|
+
function renderToContainer(getContainer, node) {
|
|
11
|
+
if (_canUseDom.canUseDom && getContainer) {
|
|
12
|
+
const container = (0, _getContainer.resolveContainer)(getContainer);
|
|
13
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)(node, container);
|
|
14
|
+
}
|
|
15
|
+
return node;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ShouldRender = void 0;
|
|
7
|
+
exports.useShouldRender = useShouldRender;
|
|
8
|
+
var _useInitialized = require("../hooks/use-initialized");
|
|
9
|
+
const ShouldRender = props => {
|
|
10
|
+
const shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
|
|
11
|
+
return shouldRender ? props.children : null;
|
|
12
|
+
};
|
|
13
|
+
exports.ShouldRender = ShouldRender;
|
|
14
|
+
function useShouldRender(active, forceRender, destroyOnClose) {
|
|
15
|
+
const initialized = (0, _useInitialized.useInitialized)(active);
|
|
16
|
+
if (forceRender) return true;
|
|
17
|
+
if (active) return true;
|
|
18
|
+
if (!initialized) return false;
|
|
19
|
+
return !destroyOnClose;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.supportsPassive = void 0;
|
|
7
|
+
var _canUseDom = require("./can-use-dom");
|
|
8
|
+
let supportsPassive = exports.supportsPassive = false;
|
|
9
|
+
if (_canUseDom.canUseDom) {
|
|
10
|
+
try {
|
|
11
|
+
const opts = {};
|
|
12
|
+
Object.defineProperty(opts, "passive", {
|
|
13
|
+
get() {
|
|
14
|
+
exports.supportsPassive = supportsPassive = true;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
window.addEventListener("test-passive", null, opts);
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
} catch (e) {}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = warning;
|
|
7
|
+
function warning(condition, message) {
|
|
8
|
+
if (process.env.NODE_ENV !== 'production' && console) {
|
|
9
|
+
if (condition) {
|
|
10
|
+
for (var _len = arguments.length, extra = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
11
|
+
extra[_key - 2] = arguments[_key];
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line no-console
|
|
14
|
+
return console.error("[pay-sdk-react]: ".concat(message), extra ? {
|
|
15
|
+
detail: extra
|
|
16
|
+
} : undefined);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mergeProp = mergeProp;
|
|
7
|
+
exports.mergeProps = mergeProps;
|
|
8
|
+
function mergeProps() {
|
|
9
|
+
const ret = {};
|
|
10
|
+
for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
|
+
items[_key] = arguments[_key];
|
|
12
|
+
}
|
|
13
|
+
items.forEach(item => {
|
|
14
|
+
if (item) {
|
|
15
|
+
Object.keys(item).forEach(key => {
|
|
16
|
+
if (item[key] !== undefined) {
|
|
17
|
+
ret[key] = item[key];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return ret;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Merge props and return the first non-undefined value.
|
|
27
|
+
* The later has higher priority. e.g. (10, 1, 5) => 5 wins.
|
|
28
|
+
* This is useful with legacy props that have been deprecated.
|
|
29
|
+
*/
|
|
30
|
+
function mergeProp(defaultProp) {
|
|
31
|
+
for (var _len2 = arguments.length, propList = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
32
|
+
propList[_key2 - 1] = arguments[_key2];
|
|
33
|
+
}
|
|
34
|
+
for (let i = propList.length - 1; i >= 0; i -= 1) {
|
|
35
|
+
if (propList[i] !== undefined) {
|
|
36
|
+
return propList[i];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return defaultProp;
|
|
40
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withStopPropagation = withStopPropagation;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
const eventToPropRecord = {
|
|
15
|
+
click: "onClick",
|
|
16
|
+
touchstart: "onTouchStart"
|
|
17
|
+
};
|
|
18
|
+
function withStopPropagation(events, element) {
|
|
19
|
+
const props = _objectSpread({}, element.props);
|
|
20
|
+
for (const key of events) {
|
|
21
|
+
const prop = eventToPropRecord[key];
|
|
22
|
+
props[prop] = function (e) {
|
|
23
|
+
var _element$props$prop, _element$props;
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
(_element$props$prop = (_element$props = element.props)[prop]) === null || _element$props$prop === void 0 || _element$props$prop.call(_element$props, e);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/_react.default.cloneElement(element, props);
|
|
29
|
+
}
|