pay-sdk-react 1.1.2 → 1.1.3
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 +37 -19
- package/README.zh-CN.md +37 -19
- package/dist/css/index.css +703 -1
- package/dist/css/index.min.css +1 -0
- package/dist/es/Airwallex/airwallex-button.js +56 -36
- package/dist/es/Airwallex/airwallex-modal.js +41 -34
- package/dist/es/Airwallex/airwallex-popup.js +43 -38
- package/dist/es/Airwallex/airwallex.js +26 -28
- package/dist/es/Airwallex/index.js +1 -1
- package/dist/es/Airwallex/style/index.css +335 -1
- package/dist/es/Airwallex/style/index.min.css +1 -0
- package/dist/es/Alipay/alipay-button.js +39 -24
- package/dist/es/Alipay/alipay-modal.js +37 -31
- package/dist/es/Alipay/alipay.js +22 -15
- package/dist/es/Alipay/index.d.ts +4 -4
- package/dist/es/Alipay/index.js +5 -5
- package/dist/es/Alipay/style/index.css +18 -1
- package/dist/es/Alipay/style/index.min.css +1 -0
- package/dist/es/Button/button.js +62 -37
- package/dist/es/Button/index.d.ts +2 -2
- package/dist/es/Button/index.js +2 -2
- package/dist/es/Button/style/index.css +95 -1
- package/dist/es/Button/style/index.min.css +1 -0
- package/dist/es/FullScreenLoading/index.js +40 -40
- package/dist/es/FullScreenLoading/interface.d.ts +2 -2
- package/dist/es/FullScreenLoading/style/index.css +239 -1
- package/dist/es/FullScreenLoading/style/index.min.css +1 -0
- package/dist/es/MAlipay/index.js +1 -1
- package/dist/es/MAlipay/m-alipay-auto-submit.js +9 -11
- package/dist/es/MAlipay/m-alipay-button.js +71 -51
- package/dist/es/MAlipay/style/index.css +252 -1
- package/dist/es/MAlipay/style/index.min.css +1 -0
- package/dist/es/MWeChat/index.d.ts +2 -2
- package/dist/es/MWeChat/index.js +2 -2
- package/dist/es/MWeChat/m-wechat-button.js +70 -50
- package/dist/es/MWeChat/style/index.css +252 -1
- package/dist/es/MWeChat/style/index.min.css +1 -0
- package/dist/es/Mask/index.d.ts +2 -2
- package/dist/es/Mask/index.js +2 -2
- package/dist/es/Mask/mask.js +48 -45
- package/dist/es/Mask/style/index.css +11 -1
- package/dist/es/Mask/style/index.min.css +1 -0
- package/dist/es/PayButton/index.js +2 -2
- package/dist/es/PayButton/interface.d.ts +9 -9
- package/dist/es/PayButton/interface.js +1 -1
- package/dist/es/PayMask/index.d.ts +2 -2
- package/dist/es/PayMask/index.js +2 -2
- package/dist/es/PayMask/interface.d.ts +2 -2
- package/dist/es/PayMask/pay-mask.js +41 -40
- package/dist/es/PayMask/style/index.css +62 -1
- package/dist/es/PayMask/style/index.min.css +1 -0
- package/dist/es/Paypal/index.d.ts +2 -2
- package/dist/es/Paypal/index.js +2 -2
- package/dist/es/Paypal/paypal-button.js +55 -36
- package/dist/es/Paypal/style/index.css +207 -1
- package/dist/es/Paypal/style/index.min.css +1 -0
- package/dist/es/Payssion/index.d.ts +2 -2
- package/dist/es/Payssion/index.js +2 -2
- package/dist/es/Payssion/payssion-button.js +56 -37
- package/dist/es/Payssion/style/index.css +157 -1
- package/dist/es/Payssion/style/index.min.css +1 -0
- package/dist/es/Stripe/index.d.ts +5 -5
- package/dist/es/Stripe/index.js +6 -6
- package/dist/es/Stripe/stripe-button.js +47 -33
- package/dist/es/Stripe/stripe-modal.js +38 -32
- package/dist/es/Stripe/stripe-popup.js +42 -37
- package/dist/es/Stripe/stripe.js +15 -15
- package/dist/es/Stripe/style/index.css +365 -1
- package/dist/es/Stripe/style/index.min.css +1 -0
- package/dist/es/Wechat/index.d.ts +4 -4
- package/dist/es/Wechat/index.js +5 -5
- package/dist/es/Wechat/style/index.css +25 -1
- package/dist/es/Wechat/style/index.min.css +1 -0
- package/dist/es/Wechat/wechat-button.js +38 -23
- package/dist/es/Wechat/wechat-modal.js +37 -31
- package/dist/es/Wechat/wechat.js +16 -12
- package/dist/es/confirm-modal/index.js +38 -39
- package/dist/es/confirm-modal/interface.d.ts +2 -2
- package/dist/es/confirm-modal/style/index.css +95 -1
- package/dist/es/confirm-modal/style/index.min.css +1 -0
- package/dist/es/dot-loading/dot-loading.js +25 -23
- package/dist/es/dot-loading/index.d.ts +2 -2
- package/dist/es/dot-loading/index.js +2 -2
- package/dist/es/dot-loading/style/index.css +3 -1
- package/dist/es/dot-loading/style/index.min.css +1 -0
- package/dist/es/hooks/use-initialized.js +2 -2
- package/dist/es/hooks/use-inner-visible.js +8 -4
- package/dist/es/hooks/use-lock-scroll.d.ts +2 -2
- package/dist/es/hooks/use-lock-scroll.js +30 -34
- package/dist/es/hooks/use-touch.d.ts +1 -1
- package/dist/es/hooks/use-touch.js +35 -31
- package/dist/es/hooks/usePayWindowOpen.d.ts +1 -1
- package/dist/es/hooks/usePayWindowOpen.js +31 -27
- package/dist/es/icons/IconAlipay/index.js +18 -16
- package/dist/es/icons/IconClose/index.js +24 -22
- package/dist/es/icons/IconPaypalText/index.js +24 -22
- package/dist/es/icons/IconPaypalWhite/index.js +19 -17
- package/dist/es/icons/IconPayssionPay/index.js +47 -45
- package/dist/es/icons/IconStripe/index.js +19 -17
- package/dist/es/icons/IconStripeText/index.js +19 -17
- package/dist/es/icons/IconWechatPay/index.js +18 -16
- package/dist/es/icons/interface.d.ts +1 -1
- package/dist/es/icons/style/index.css +45 -1
- package/dist/es/icons/style/index.min.css +1 -0
- package/dist/es/pay-modal/index.d.ts +2 -2
- package/dist/es/pay-modal/index.js +2 -2
- package/dist/es/pay-modal/pay-modal.js +45 -48
- package/dist/es/pay-modal/style/index.css +95 -1
- package/dist/es/pay-modal/style/index.min.css +1 -0
- package/dist/es/pay-popup/index.js +51 -53
- package/dist/es/pay-popup/interface.d.ts +6 -6
- package/dist/es/pay-popup/style/index.css +145 -1
- package/dist/es/pay-popup/style/index.min.css +1 -0
- package/dist/es/shared/enums/index.js +1 -1
- package/dist/es/shared/index.d.ts +1 -1
- package/dist/es/shared/index.js +1 -1
- package/dist/es/utils/can-use-dom.js +1 -1
- package/dist/es/utils/classNames.js +15 -11
- package/dist/es/utils/dom.js +18 -18
- package/dist/es/utils/get-container.js +2 -2
- package/dist/es/utils/get-scroll-parent.js +8 -9
- package/dist/es/utils/is.js +54 -32
- package/dist/es/utils/native-props.d.ts +2 -2
- package/dist/es/utils/native-props.js +7 -9
- package/dist/es/utils/omit.js +3 -5
- package/dist/es/utils/qrcode.js +5 -5
- package/dist/es/utils/render-to-container.d.ts +1 -1
- package/dist/es/utils/render-to-container.js +4 -4
- package/dist/es/utils/should-render.d.ts +1 -1
- package/dist/es/utils/should-render.js +4 -4
- package/dist/es/utils/supports-passive.js +8 -7
- package/dist/es/utils/warning.js +0 -1
- package/dist/es/utils/with-default-props.js +6 -4
- package/dist/es/utils/with-stop-propagation.d.ts +3 -3
- package/dist/es/utils/with-stop-propagation.js +27 -14
- package/dist/lib/Airwallex/airwallex-button.js +12 -15
- package/dist/lib/Airwallex/airwallex-modal.js +11 -14
- package/dist/lib/Airwallex/airwallex-popup.js +16 -23
- package/dist/lib/Airwallex/airwallex.js +20 -25
- package/dist/lib/Airwallex/index.js +1 -1
- package/dist/lib/Airwallex/style/index.css +335 -1
- package/dist/lib/Airwallex/style/index.min.css +1 -0
- package/dist/lib/Alipay/alipay-button.js +12 -15
- package/dist/lib/Alipay/alipay-modal.js +9 -12
- package/dist/lib/Alipay/alipay.js +19 -23
- package/dist/lib/Alipay/index.js +1 -1
- package/dist/lib/Alipay/style/index.css +18 -1
- package/dist/lib/Alipay/style/index.min.css +1 -0
- package/dist/lib/Button/button.js +13 -13
- package/dist/lib/Button/index.js +1 -1
- package/dist/lib/Button/style/index.css +95 -1
- package/dist/lib/Button/style/index.min.css +1 -0
- package/dist/lib/FullScreenLoading/index.js +28 -29
- package/dist/lib/FullScreenLoading/style/index.css +239 -1
- package/dist/lib/FullScreenLoading/style/index.min.css +1 -0
- package/dist/lib/MAlipay/index.js +1 -1
- package/dist/lib/MAlipay/m-alipay-auto-submit.js +3 -4
- package/dist/lib/MAlipay/m-alipay-button.js +34 -44
- package/dist/lib/MAlipay/style/index.css +252 -1
- package/dist/lib/MAlipay/style/index.min.css +1 -0
- package/dist/lib/MWeChat/index.js +2 -2
- package/dist/lib/MWeChat/m-wechat-button.js +34 -44
- package/dist/lib/MWeChat/style/index.css +252 -1
- package/dist/lib/MWeChat/style/index.min.css +1 -0
- package/dist/lib/Mask/index.js +1 -1
- package/dist/lib/Mask/mask.js +6 -11
- package/dist/lib/Mask/style/index.css +11 -1
- package/dist/lib/Mask/style/index.min.css +1 -0
- package/dist/lib/PayButton/index.js +10 -10
- package/dist/lib/PayMask/index.js +1 -1
- package/dist/lib/PayMask/pay-mask.js +20 -23
- package/dist/lib/PayMask/style/index.css +62 -1
- package/dist/lib/PayMask/style/index.min.css +1 -0
- package/dist/lib/Paypal/index.js +2 -2
- package/dist/lib/Paypal/paypal-button.js +17 -22
- package/dist/lib/Paypal/style/index.css +207 -1
- package/dist/lib/Paypal/style/index.min.css +1 -0
- package/dist/lib/Payssion/index.js +2 -2
- package/dist/lib/Payssion/payssion-button.js +17 -22
- package/dist/lib/Payssion/style/index.css +157 -1
- package/dist/lib/Payssion/style/index.min.css +1 -0
- package/dist/lib/Stripe/index.js +1 -1
- package/dist/lib/Stripe/stripe-button.js +14 -17
- package/dist/lib/Stripe/stripe-modal.js +10 -13
- package/dist/lib/Stripe/stripe-popup.js +16 -23
- package/dist/lib/Stripe/stripe.js +8 -11
- package/dist/lib/Stripe/style/index.css +365 -1
- package/dist/lib/Stripe/style/index.min.css +1 -0
- package/dist/lib/Wechat/index.js +1 -1
- package/dist/lib/Wechat/style/index.css +25 -1
- package/dist/lib/Wechat/style/index.min.css +1 -0
- package/dist/lib/Wechat/wechat-button.js +12 -15
- package/dist/lib/Wechat/wechat-modal.js +9 -12
- package/dist/lib/Wechat/wechat.js +11 -12
- package/dist/lib/confirm-modal/index.js +17 -26
- package/dist/lib/confirm-modal/style/index.css +95 -1
- package/dist/lib/confirm-modal/style/index.min.css +1 -0
- package/dist/lib/dot-loading/dot-loading.js +3 -4
- package/dist/lib/dot-loading/index.js +1 -1
- package/dist/lib/dot-loading/style/index.css +3 -1
- package/dist/lib/dot-loading/style/index.min.css +1 -0
- package/dist/lib/hooks/use-lock-scroll.js +11 -12
- package/dist/lib/hooks/use-touch.js +10 -10
- package/dist/lib/hooks/usePayWindowOpen.js +14 -15
- package/dist/lib/icons/IconAlipay/index.js +6 -6
- package/dist/lib/icons/IconClose/index.js +8 -8
- package/dist/lib/icons/IconPaypalText/index.js +7 -7
- package/dist/lib/icons/IconPaypalWhite/index.js +6 -6
- package/dist/lib/icons/IconPayssionPay/index.js +13 -13
- package/dist/lib/icons/IconStripe/index.js +6 -6
- package/dist/lib/icons/IconStripeText/index.js +6 -6
- package/dist/lib/icons/IconWechatPay/index.js +6 -6
- package/dist/lib/icons/index.js +2 -2
- package/dist/lib/icons/style/index.css +45 -1
- package/dist/lib/icons/style/index.min.css +1 -0
- package/dist/lib/index.js +2 -2
- package/dist/lib/pay-modal/index.js +1 -1
- package/dist/lib/pay-modal/pay-modal.js +24 -30
- package/dist/lib/pay-modal/style/index.css +95 -1
- package/dist/lib/pay-modal/style/index.min.css +1 -0
- package/dist/lib/pay-popup/index.js +24 -28
- package/dist/lib/pay-popup/style/index.css +145 -1
- package/dist/lib/pay-popup/style/index.min.css +1 -0
- package/dist/lib/utils/can-use-dom.js +1 -1
- package/dist/lib/utils/classNames.js +6 -7
- package/dist/lib/utils/dom.js +9 -11
- package/dist/lib/utils/get-scroll-parent.js +2 -3
- package/dist/lib/utils/getPrefixCls.js +1 -1
- package/dist/lib/utils/is.js +16 -14
- package/dist/lib/utils/native-props.js +10 -10
- package/dist/lib/utils/omit.js +3 -6
- package/dist/lib/utils/qrcode.js +1 -1
- package/dist/lib/utils/supports-passive.js +4 -3
- package/dist/lib/utils/warning.js +2 -6
- package/dist/lib/utils/with-default-props.js +4 -8
- package/dist/lib/utils/with-stop-propagation.js +6 -9
- package/dist/umd/pay-sdk-react.umd.js +61 -63
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +5 -2
|
@@ -1 +1,95 @@
|
|
|
1
|
-
.pay-dot-loading
|
|
1
|
+
.pay-dot-loading {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
.pay-button {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
padding: 7px 12px;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
border: 1px solid #eee;
|
|
10
|
+
background: #fff;
|
|
11
|
+
color: #333;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: all 0.2s;
|
|
14
|
+
user-select: none;
|
|
15
|
+
position: relative;
|
|
16
|
+
text-align: center;
|
|
17
|
+
}
|
|
18
|
+
.pay-button-content {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
gap: 6px;
|
|
23
|
+
}
|
|
24
|
+
.pay-button-block {
|
|
25
|
+
display: block;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
.pay-button-disabled {
|
|
29
|
+
opacity: 0.4;
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
}
|
|
32
|
+
.pay-button-loading {
|
|
33
|
+
cursor: wait;
|
|
34
|
+
}
|
|
35
|
+
.pay-button-loading-wrapper {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
gap: 6px;
|
|
40
|
+
}
|
|
41
|
+
.pay-button-primary {
|
|
42
|
+
background: #1677ff;
|
|
43
|
+
border-color: #1677ff;
|
|
44
|
+
color: #fff;
|
|
45
|
+
}
|
|
46
|
+
.pay-button-primary:hover {
|
|
47
|
+
background: #409eff;
|
|
48
|
+
}
|
|
49
|
+
.pay-button-success {
|
|
50
|
+
background: #00b578;
|
|
51
|
+
border-color: #00b578;
|
|
52
|
+
color: #fff;
|
|
53
|
+
}
|
|
54
|
+
.pay-button-danger {
|
|
55
|
+
background: #ff3141;
|
|
56
|
+
border-color: #ff3141;
|
|
57
|
+
color: #fff;
|
|
58
|
+
}
|
|
59
|
+
.pay-button-warning {
|
|
60
|
+
background: #ff8f1f;
|
|
61
|
+
border-color: #ff8f1f;
|
|
62
|
+
color: #fff;
|
|
63
|
+
}
|
|
64
|
+
.pay-button-default {
|
|
65
|
+
background: #fff;
|
|
66
|
+
border-color: #eee;
|
|
67
|
+
color: #333;
|
|
68
|
+
}
|
|
69
|
+
.pay-button-fill-outline {
|
|
70
|
+
background: transparent;
|
|
71
|
+
color: inherit;
|
|
72
|
+
}
|
|
73
|
+
.pay-button-fill-none {
|
|
74
|
+
background: transparent;
|
|
75
|
+
border: none;
|
|
76
|
+
color: inherit;
|
|
77
|
+
}
|
|
78
|
+
.pay-button-mini {
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
padding: 2px 8px;
|
|
81
|
+
}
|
|
82
|
+
.pay-button-small {
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
padding: 4px 10px;
|
|
85
|
+
}
|
|
86
|
+
.pay-button-large {
|
|
87
|
+
font-size: 18px;
|
|
88
|
+
padding: 10px 18px;
|
|
89
|
+
}
|
|
90
|
+
.pay-button-shape-rounded {
|
|
91
|
+
border-radius: 1000px;
|
|
92
|
+
}
|
|
93
|
+
.pay-button-shape-rectangular {
|
|
94
|
+
border-radius: 0;
|
|
95
|
+
}
|
|
@@ -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:.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}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -8,25 +9,23 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
9
|
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
10
|
var _useLockScroll = require("../hooks/use-lock-scroll");
|
|
10
11
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
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
13
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('fullscreen-loading');
|
|
14
|
-
const FullScreenLoading =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
14
|
+
const FullScreenLoading = ({
|
|
15
|
+
loading = false,
|
|
16
|
+
text = 'Loading...',
|
|
17
|
+
children,
|
|
18
|
+
fullscreen = true,
|
|
19
|
+
className = '',
|
|
20
|
+
size = 'default',
|
|
21
|
+
type = 'circle'
|
|
22
|
+
}) => {
|
|
24
23
|
const containerRef = (0, _react.useRef)(null);
|
|
25
|
-
const sizeClass = size ?
|
|
26
|
-
const typeClass = type ?
|
|
24
|
+
const sizeClass = size ? `${classPrefix}--${size}` : '';
|
|
25
|
+
const typeClass = type ? `${classPrefix}--${type}` : '';
|
|
27
26
|
const classNames = (0, _classNames.default)({
|
|
28
27
|
[classPrefix]: fullscreen,
|
|
29
|
-
[
|
|
28
|
+
[`${classPrefix}__container`]: !fullscreen,
|
|
30
29
|
[sizeClass]: size,
|
|
31
30
|
[typeClass]: type
|
|
32
31
|
}, className);
|
|
@@ -63,47 +62,47 @@ const FullScreenLoading = _ref => {
|
|
|
63
62
|
switch (type) {
|
|
64
63
|
case 'circle':
|
|
65
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
-
className:
|
|
65
|
+
className: `${classPrefix}__circle`
|
|
67
66
|
});
|
|
68
67
|
case 'dots':
|
|
69
68
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className:
|
|
69
|
+
className: `${classPrefix}__dots`
|
|
71
70
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
-
className:
|
|
71
|
+
className: `${classPrefix}__dot`
|
|
73
72
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
className:
|
|
73
|
+
className: `${classPrefix}__dot`
|
|
75
74
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
-
className:
|
|
75
|
+
className: `${classPrefix}__dot`
|
|
77
76
|
}));
|
|
78
77
|
case 'spin-dots':
|
|
79
78
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
-
className:
|
|
79
|
+
className: `${classPrefix}__spin-dots`
|
|
81
80
|
}, Array.from({
|
|
82
81
|
length: 12
|
|
83
82
|
}).map((_, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
84
83
|
key: index,
|
|
85
|
-
className:
|
|
84
|
+
className: `${classPrefix}__spin-dot`,
|
|
86
85
|
style: {
|
|
87
|
-
transform:
|
|
86
|
+
transform: `rotate(${index * 30}deg)`,
|
|
88
87
|
opacity: 1 - index * 0.08
|
|
89
88
|
}
|
|
90
89
|
})));
|
|
91
90
|
default:
|
|
92
91
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
-
className:
|
|
92
|
+
className: `${classPrefix}__circle`
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
};
|
|
97
96
|
const loadingContent = /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
-
className:
|
|
97
|
+
className: `${classPrefix}__center`
|
|
99
98
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
-
className: (0, _classNames.default)(
|
|
101
|
-
[
|
|
99
|
+
className: (0, _classNames.default)(`${classPrefix}__spinner-box`, {
|
|
100
|
+
[`${classPrefix}__spinner-box--no-text`]: text === null
|
|
102
101
|
})
|
|
103
102
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
-
className:
|
|
103
|
+
className: `${classPrefix}__spinner`
|
|
105
104
|
}, renderLoadingIcon()), text !== null && /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
-
className:
|
|
105
|
+
className: `${classPrefix}__text`
|
|
107
106
|
}, text)));
|
|
108
107
|
|
|
109
108
|
// 局部 loading 包裹 children
|
|
@@ -112,7 +111,7 @@ const FullScreenLoading = _ref => {
|
|
|
112
111
|
className: classNames,
|
|
113
112
|
ref: containerRef
|
|
114
113
|
}, children, loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
-
className:
|
|
114
|
+
className: `${classPrefix}__mask`
|
|
116
115
|
}, loadingContent));
|
|
117
116
|
}
|
|
118
117
|
|
|
@@ -1 +1,239 @@
|
|
|
1
|
-
.pay-fullscreen-loading
|
|
1
|
+
.pay-fullscreen-loading {
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 9999;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
background: hsla(0, 0%, 100%, 0.8);
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
pointer-events: auto;
|
|
13
|
+
user-select: none;
|
|
14
|
+
}
|
|
15
|
+
.pay-fullscreen-loading__center {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
}
|
|
21
|
+
.pay-fullscreen-loading__spinner-box {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
background-color: rgba(17, 17, 17, 0.8);
|
|
27
|
+
border-radius: 16px;
|
|
28
|
+
transition: width 0.2s, height 0.2s;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
padding: 8px;
|
|
31
|
+
}
|
|
32
|
+
.pay-fullscreen-loading__spinner-box--no-text {
|
|
33
|
+
padding: 4px;
|
|
34
|
+
}
|
|
35
|
+
.pay-fullscreen-loading__spinner {
|
|
36
|
+
margin-bottom: 8px;
|
|
37
|
+
}
|
|
38
|
+
.pay-fullscreen-loading__spinner-box--no-text .pay-fullscreen-loading__spinner {
|
|
39
|
+
margin-bottom: 0;
|
|
40
|
+
}
|
|
41
|
+
.pay-fullscreen-loading__circle {
|
|
42
|
+
border: 3px solid rgba(255, 255, 255, 0.3);
|
|
43
|
+
border-top-color: #fff;
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
animation: spin 1.2s linear infinite;
|
|
46
|
+
}
|
|
47
|
+
.pay-fullscreen-loading__text {
|
|
48
|
+
color: #fff;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
letter-spacing: 0.25px;
|
|
51
|
+
text-align: center;
|
|
52
|
+
width: 100%;
|
|
53
|
+
word-break: break-all;
|
|
54
|
+
line-height: 1.2;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
display: -webkit-box;
|
|
57
|
+
-webkit-box-orient: vertical;
|
|
58
|
+
-webkit-line-clamp: 2;
|
|
59
|
+
}
|
|
60
|
+
.pay-fullscreen-loading__dots {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 10px;
|
|
64
|
+
}
|
|
65
|
+
.pay-fullscreen-loading__dot {
|
|
66
|
+
background: #fff;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
animation: bounce 0.5s ease-in-out infinite;
|
|
69
|
+
}
|
|
70
|
+
.pay-fullscreen-loading__dot:nth-child(2) {
|
|
71
|
+
animation-delay: 0.1s;
|
|
72
|
+
}
|
|
73
|
+
.pay-fullscreen-loading__dot:nth-child(3) {
|
|
74
|
+
animation-delay: 0.2s;
|
|
75
|
+
}
|
|
76
|
+
.pay-fullscreen-loading__spin-dots {
|
|
77
|
+
position: relative;
|
|
78
|
+
animation: spin 1.2s steps(12) infinite;
|
|
79
|
+
}
|
|
80
|
+
.pay-fullscreen-loading__spin-dot {
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 50%;
|
|
84
|
+
background: #fff;
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
}
|
|
87
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box {
|
|
88
|
+
width: 88px;
|
|
89
|
+
height: 88px;
|
|
90
|
+
}
|
|
91
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__spinner-box--no-text {
|
|
92
|
+
width: 48px;
|
|
93
|
+
height: 48px;
|
|
94
|
+
}
|
|
95
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__circle {
|
|
96
|
+
width: 24px;
|
|
97
|
+
height: 24px;
|
|
98
|
+
border-width: 3px;
|
|
99
|
+
}
|
|
100
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__text {
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
}
|
|
103
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__dot {
|
|
104
|
+
width: 6px;
|
|
105
|
+
height: 6px;
|
|
106
|
+
}
|
|
107
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dots {
|
|
108
|
+
width: 28px;
|
|
109
|
+
height: 28px;
|
|
110
|
+
}
|
|
111
|
+
.pay-fullscreen-loading--small .pay-fullscreen-loading__spin-dot {
|
|
112
|
+
width: 3.5px;
|
|
113
|
+
height: 3.5px;
|
|
114
|
+
margin-left: -1.75px;
|
|
115
|
+
transform-origin: 50% 14px;
|
|
116
|
+
}
|
|
117
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box {
|
|
118
|
+
width: 112px;
|
|
119
|
+
height: 112px;
|
|
120
|
+
}
|
|
121
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__spinner-box--no-text {
|
|
122
|
+
width: 62px;
|
|
123
|
+
height: 62px;
|
|
124
|
+
}
|
|
125
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__circle {
|
|
126
|
+
width: 36px;
|
|
127
|
+
height: 36px;
|
|
128
|
+
border-width: 4px;
|
|
129
|
+
}
|
|
130
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__text {
|
|
131
|
+
font-size: 16px;
|
|
132
|
+
}
|
|
133
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__dot {
|
|
134
|
+
width: 10px;
|
|
135
|
+
height: 10px;
|
|
136
|
+
}
|
|
137
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dots {
|
|
138
|
+
width: 40px;
|
|
139
|
+
height: 40px;
|
|
140
|
+
}
|
|
141
|
+
.pay-fullscreen-loading--medium .pay-fullscreen-loading__spin-dot {
|
|
142
|
+
width: 4.5px;
|
|
143
|
+
height: 4.5px;
|
|
144
|
+
margin-left: -2.25px;
|
|
145
|
+
transform-origin: 50% 20px;
|
|
146
|
+
}
|
|
147
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box {
|
|
148
|
+
width: 144px;
|
|
149
|
+
height: 144px;
|
|
150
|
+
}
|
|
151
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__spinner-box--no-text {
|
|
152
|
+
width: 80px;
|
|
153
|
+
height: 80px;
|
|
154
|
+
}
|
|
155
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__circle {
|
|
156
|
+
width: 42px;
|
|
157
|
+
height: 42px;
|
|
158
|
+
border-width: 5px;
|
|
159
|
+
}
|
|
160
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__text {
|
|
161
|
+
font-size: 18px;
|
|
162
|
+
}
|
|
163
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__dot {
|
|
164
|
+
width: 12px;
|
|
165
|
+
height: 12px;
|
|
166
|
+
}
|
|
167
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dots {
|
|
168
|
+
width: 48px;
|
|
169
|
+
height: 48px;
|
|
170
|
+
}
|
|
171
|
+
.pay-fullscreen-loading--large .pay-fullscreen-loading__spin-dot {
|
|
172
|
+
width: 5.5px;
|
|
173
|
+
height: 5.5px;
|
|
174
|
+
margin-left: -2.75px;
|
|
175
|
+
transform-origin: 50% 24px;
|
|
176
|
+
}
|
|
177
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box {
|
|
178
|
+
width: 100px;
|
|
179
|
+
height: 100px;
|
|
180
|
+
}
|
|
181
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__spinner-box--no-text {
|
|
182
|
+
width: 56px;
|
|
183
|
+
height: 56px;
|
|
184
|
+
}
|
|
185
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__circle {
|
|
186
|
+
width: 32px;
|
|
187
|
+
height: 32px;
|
|
188
|
+
border-width: 4px;
|
|
189
|
+
}
|
|
190
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__text {
|
|
191
|
+
font-size: 16px;
|
|
192
|
+
}
|
|
193
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__dot {
|
|
194
|
+
width: 9px;
|
|
195
|
+
height: 9px;
|
|
196
|
+
}
|
|
197
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dots {
|
|
198
|
+
width: 32px;
|
|
199
|
+
height: 32px;
|
|
200
|
+
}
|
|
201
|
+
.pay-fullscreen-loading--default .pay-fullscreen-loading__spin-dot {
|
|
202
|
+
width: 4px;
|
|
203
|
+
height: 4px;
|
|
204
|
+
margin-left: -2px;
|
|
205
|
+
transform-origin: 50% 16px;
|
|
206
|
+
}
|
|
207
|
+
.pay-fullscreen-loading__container {
|
|
208
|
+
position: relative;
|
|
209
|
+
display: block;
|
|
210
|
+
}
|
|
211
|
+
.pay-fullscreen-loading__mask {
|
|
212
|
+
position: absolute;
|
|
213
|
+
left: 0;
|
|
214
|
+
top: 0;
|
|
215
|
+
right: 0;
|
|
216
|
+
bottom: 0;
|
|
217
|
+
background: hsla(0, 0%, 100%, 0.8);
|
|
218
|
+
z-index: 10;
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
}
|
|
223
|
+
@keyframes spin {
|
|
224
|
+
0% {
|
|
225
|
+
transform: rotate(0deg);
|
|
226
|
+
}
|
|
227
|
+
100% {
|
|
228
|
+
transform: rotate(360deg);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@keyframes bounce {
|
|
232
|
+
0%,
|
|
233
|
+
100% {
|
|
234
|
+
transform: translateY(0);
|
|
235
|
+
}
|
|
236
|
+
50% {
|
|
237
|
+
transform: translateY(-12px);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.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)}}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -19,7 +20,6 @@ Object.keys(_interface).forEach(function (key) {
|
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
23
|
const MAlipayComponent = _mAlipayAutoSubmit.default;
|
|
24
24
|
MAlipayComponent.Button = _mAlipayButton.default;
|
|
25
25
|
var _default = exports.default = MAlipayComponent;
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
const MAlipayAutoSubmit =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
8
|
+
const MAlipayAutoSubmit = ({
|
|
9
|
+
formHtml
|
|
10
|
+
}) => {
|
|
12
11
|
(0, _react.useEffect)(() => {
|
|
13
12
|
// 1. 移除之前的表单
|
|
14
13
|
const oldForm = document.getElementById('alipaysubmit');
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
7
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
10
|
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
11
|
var _mAlipayAutoSubmit = _interopRequireDefault(require("./m-alipay-auto-submit"));
|
|
@@ -13,43 +15,29 @@ var _PayMask = _interopRequireDefault(require("../PayMask"));
|
|
|
13
15
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
14
16
|
var _icons = require("../icons");
|
|
15
17
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
16
|
-
const _excluded = ["className", "children", "onClick", "formHtml", "createOrder", "displayType", "modalProps", "maskProps"],
|
|
17
|
-
_excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
|
|
18
|
-
_excluded3 = ["onClose"];
|
|
19
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
18
|
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); }
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
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; }
|
|
24
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
|
-
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); }
|
|
26
|
-
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); }
|
|
27
|
-
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; }
|
|
28
|
-
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; }
|
|
29
19
|
const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
30
20
|
const {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} = _ref2,
|
|
52
|
-
restMaskProps = _objectWithoutProperties(_ref2, _excluded3);
|
|
21
|
+
className,
|
|
22
|
+
children = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.IconAlipay, null), "\u652F\u4ED8\u5B9D\u652F\u4ED8"),
|
|
23
|
+
onClick,
|
|
24
|
+
formHtml: propsFormHtml,
|
|
25
|
+
createOrder,
|
|
26
|
+
displayType = 'modal',
|
|
27
|
+
modalProps,
|
|
28
|
+
maskProps,
|
|
29
|
+
...others
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
retryButtonProps,
|
|
33
|
+
finishButtonProps,
|
|
34
|
+
onClose,
|
|
35
|
+
...modalPropsOthers
|
|
36
|
+
} = modalProps || {};
|
|
37
|
+
const {
|
|
38
|
+
onClose: onMaskClose,
|
|
39
|
+
...restMaskProps
|
|
40
|
+
} = maskProps || {};
|
|
53
41
|
const mAlipayButtonRef = (0, _react.useRef)({
|
|
54
42
|
nativeElement: null
|
|
55
43
|
});
|
|
@@ -88,7 +76,7 @@ const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
88
76
|
if (createOrder) {
|
|
89
77
|
const {
|
|
90
78
|
formHtml
|
|
91
|
-
} = await
|
|
79
|
+
} = await createOrder();
|
|
92
80
|
if (formHtml) {
|
|
93
81
|
handleDisplay();
|
|
94
82
|
setFormHtmlString(formHtml);
|
|
@@ -115,23 +103,25 @@ const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
115
103
|
}
|
|
116
104
|
return showMask;
|
|
117
105
|
}, [displayType, showModal, showMask]);
|
|
118
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default,
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, (0, _extends2.default)({
|
|
119
107
|
ref: mAlipayButtonRef,
|
|
120
108
|
className: (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('m-alipay-btn'), className),
|
|
121
109
|
onClick: handleClick
|
|
122
110
|
}, (0, _omit.default)(others, ['displayType', 'displayProps'])), children), isShowAutoSubmit && formHtmlString && /*#__PURE__*/_react.default.createElement(_mAlipayAutoSubmit.default, {
|
|
123
111
|
formHtml: formHtmlString
|
|
124
|
-
}), displayType === 'modal' && formHtmlString && /*#__PURE__*/_react.default.createElement(_confirmModal.default,
|
|
112
|
+
}), displayType === 'modal' && formHtmlString && /*#__PURE__*/_react.default.createElement(_confirmModal.default, (0, _extends2.default)({
|
|
125
113
|
visible: showModal,
|
|
126
|
-
retryButtonProps:
|
|
127
|
-
onClick: handleRetry
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
retryButtonProps: {
|
|
115
|
+
onClick: handleRetry,
|
|
116
|
+
...(0, _omit.default)(retryButtonProps || {}, ['onClick'])
|
|
117
|
+
},
|
|
118
|
+
finishButtonProps: {
|
|
119
|
+
onClick: handleFinish,
|
|
120
|
+
...(0, _omit.default)(finishButtonProps || {}, ['onClick'])
|
|
121
|
+
},
|
|
132
122
|
onClose: handleOnCloseModal,
|
|
133
123
|
autoOpenWindow: false
|
|
134
|
-
}, modalPropsOthers)), showMask && formHtmlString && /*#__PURE__*/_react.default.createElement(_PayMask.default,
|
|
124
|
+
}, modalPropsOthers)), showMask && formHtmlString && /*#__PURE__*/_react.default.createElement(_PayMask.default, (0, _extends2.default)({
|
|
135
125
|
visible: showMask,
|
|
136
126
|
onClose: () => {
|
|
137
127
|
setShowMask(false);
|