pay-sdk-react 1.1.1 → 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 +38 -20
- package/README.zh-CN.md +38 -20
- 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 +38 -32
- 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/interface.d.ts +7 -9
- 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/interface.d.ts +4 -0
- 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 +86 -55
- 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 +86 -54
- 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.d.ts +3 -3
- package/dist/es/confirm-modal/index.js +53 -35
- 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/index.d.ts +1 -1
- package/dist/es/pay-modal/index.d.ts +2 -2
- package/dist/es/pay-modal/index.js +2 -2
- package/dist/es/pay-modal/interface.d.ts +8 -18
- package/dist/es/pay-modal/pay-modal.js +53 -42
- 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 +10 -13
- 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 +42 -41
- 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 +43 -41
- 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 +22 -12
- 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 +29 -21
- 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 +106 -86
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +5 -2
|
@@ -1,28 +1,28 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
8
10
|
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
11
|
var _getPrefixCls = require("../../utils/getPrefixCls");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
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); }
|
|
12
12
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
-
const IconStripe = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg",
|
|
13
|
+
const IconStripe = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
|
|
14
14
|
ref: ref,
|
|
15
15
|
d: "1749699330712",
|
|
16
16
|
viewBox: "0 0 1024 1024",
|
|
17
17
|
version: "1.1",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
"p-id": "12279",
|
|
19
|
+
"data-p-id": "12279",
|
|
20
20
|
stroke: "currentColor",
|
|
21
21
|
strokeWidth: "4",
|
|
22
|
-
className:
|
|
22
|
+
className: `${classPrefix} ${classPrefix}-stripe`
|
|
23
23
|
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("path", {
|
|
24
24
|
d: "M128 0a128 128 0 0 0-128 128v768a128 128 0 0 0 128 128h768a128 128 0 0 0 128-128V128a128 128 0 0 0-128-128z m398.464 344.64c-37.376 0-59.968 10.496-59.968 37.952 0 29.952 38.848 43.136 87.04 59.52 78.592 26.56 182.016 61.632 182.464 191.552C736 759.552 635.136 832 488.32 832a490.784 490.784 0 0 1-195.744-41.312l3.168 1.248v-167.424c59.264 32.384 134.08 56.32 192.64 56.32 39.488 0 67.712-10.56 67.712-42.944 0-33.152-42.112-48.32-92.992-66.624C385.664 543.36 288 508.16 288 391.04 288 266.56 383.232 192 526.464 192l4.192-0.032c61.472 0 120.192 11.872 173.952 33.44l-3.136-1.12v165.312c-53.632-28.8-121.344-44.992-174.976-44.992z",
|
|
25
|
-
"p-id": "12280",
|
|
25
|
+
"data-p-id": "12280",
|
|
26
26
|
fill: "#5f59d7"
|
|
27
27
|
})));
|
|
28
28
|
IconStripe.displayName = 'IconStripe';
|
|
@@ -1,29 +1,29 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
8
10
|
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
11
|
var _getPrefixCls = require("../../utils/getPrefixCls");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
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); }
|
|
12
12
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
-
const IconStripeText = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg",
|
|
13
|
+
const IconStripeText = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
|
|
14
14
|
ref: ref,
|
|
15
15
|
d: "1749718686078",
|
|
16
16
|
viewBox: "0 0 2469 1024",
|
|
17
17
|
version: "1.1",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
"p-id": "7307",
|
|
19
|
+
"data-p-id": "7307",
|
|
20
20
|
stroke: "currentColor",
|
|
21
21
|
strokeWidth: "4",
|
|
22
|
-
className:
|
|
22
|
+
className: `${classPrefix} ${classPrefix}-stripe-text`
|
|
23
23
|
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("path", {
|
|
24
24
|
d: "M2165.028571 477.696c5.12-80.896 26.624-118.784 68.096-118.784s61.952 38.912 65.024 118.784H2165.028571z m303.616 48.128a340.918857 340.918857 0 0 0-58.514285-212.114286 207.945143 207.945143 0 0 0-173.056-76.8c-153.6 0-249.344 113.664-249.344 295.424a305.078857 305.078857 0 0 0 75.776 227.328 269.677714 269.677714 0 0 0 194.048 65.828572 365.714286 365.714286 0 0 0 194.048-48.128l-19.602286-124.050286a319.780571 319.780571 0 0 1-154.624 37.376 109.714286 109.714286 0 0 1-76.288-22.528 110.445714 110.445714 0 0 1-33.28-79.36h299.52c-0.512-9.216 1.024-50.176 1.024-62.976z m-723.236571 122.368a71.241143 71.241143 0 0 1-63.122286 41.984 107.812571 107.812571 0 0 1-48.64-10.752V409.6a96.694857 96.694857 0 0 1 68.096-35.328c46.08 0 68.096 49.664 68.096 146.285714a255.561143 255.561143 0 0 1-24.064 127.488z m150.016-349.696a158.72 158.72 0 0 0-133.12-61.952 189.366857 189.366857 0 0 0-141.312 67.584l-9.216-56.832h-159.232V1024l180.736-30.208V811.885714a278.601143 278.601143 0 0 0 81.408 13.312 213.138286 213.138286 0 0 0 161.792-67.072 354.377143 354.377143 0 0 0 73.728-244.224 350.500571 350.500571 0 0 0-54.784-215.552z m-695.296-51.2h181.248v566.784h-181.248z m91.136-55.808a95.085714 95.085714 0 0 0 95.085714-95.744 95.085714 95.085714 0 1 0-190.171428 0 95.085714 95.085714 0 0 0 95.085714 95.744z m-169.472 48.64a107.373714 107.373714 0 0 0-107.52 74.752l-10.752-67.072h-157.696v566.272h180.736V446.171429a117.028571 117.028571 0 0 1 98.304-37.888 190.610286 190.610286 0 0 1 32.256 2.048V244.224a152.868571 152.868571 0 0 0-35.328-4.096zM775.314286 381.44l21.942857-133.632H681.984V84.48l-155.355429 25.6-22.308571 137.216-54.784 8.704-19.968 124.928H504.685714V643.657143a175.542857 175.542857 0 0 0 53.248 144.896 206.701714 206.701714 0 0 0 133.12 35.328 335.213714 335.213714 0 0 0 95.085715-13.312v-141.897143a266.532571 266.532571 0 0 1-52.224 8.192c-35.328 0-50.688-17.92-50.688-59.392V381.44zM258.048 461.312C204.8 441.344 175.542857 425.984 175.542857 402.285714c0-19.968 16.896-32.256 46.592-32.256a373.028571 373.028571 0 0 1 149.065143 39.570286l21.942857-135.168a414.72 414.72 0 0 0-179.638857-38.912 227.766857 227.766857 0 0 0-148.48 46.08A163.254857 163.254857 0 0 0 7.314286 413.184C7.314286 512 67.584 554.496 166.4 590.336c63.488 22.528 84.48 38.912 84.48 63.488s-19.968 37.888-57.344 37.888A397.604571 397.604571 0 0 1 22.528 640L0 776.704a442.953143 442.953143 0 0 0 202.752 48.64 249.490286 249.490286 0 0 0 155.136-43.885714 168.667429 168.667429 0 0 0 61.952-140.434286c0-102.4-61.952-144.384-161.792-179.712z",
|
|
25
25
|
fill: "#6772E5",
|
|
26
|
-
"p-id": "7308"
|
|
26
|
+
"data-p-id": "7308"
|
|
27
27
|
})));
|
|
28
28
|
IconStripeText.displayName = 'IconStripeText';
|
|
29
29
|
var _default = exports.default = IconStripeText;
|
|
@@ -1,28 +1,28 @@
|
|
|
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 = _interopRequireDefault(require("react"));
|
|
8
10
|
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
11
|
var _getPrefixCls = require("../../utils/getPrefixCls");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
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); }
|
|
12
12
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
-
const IconWechatPay = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg",
|
|
13
|
+
const IconWechatPay = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
|
|
14
14
|
ref: ref,
|
|
15
15
|
d: "1750765734858",
|
|
16
16
|
viewBox: "0 0 1024 1024",
|
|
17
17
|
version: "1.1",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
"p-id": "6038",
|
|
19
|
+
"data-p-id": "6038",
|
|
20
20
|
stroke: "currentColor",
|
|
21
|
-
className:
|
|
21
|
+
className: `${classPrefix} ${classPrefix}-wechat-pay`
|
|
22
22
|
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("path", {
|
|
23
23
|
d: "M964.16 294.4c-3.328-5.568-5.888-5.76-11.168-2.528-17.44 10.56-35.168 20.64-52.864 30.752-45.024 25.76-90.144 51.424-135.2 77.184-53.344 30.464-106.688 60.896-159.936 91.488-75.328 43.264-150.56 86.656-225.856 129.984-21.056 12.096-41.184 5.6-51.232-16.48-8.448-18.432-16.992-36.832-25.44-55.264-21.92-48.032-43.84-96.064-65.696-144.128-4.032-8.864-2.528-15.264 4.16-20.8 6.304-5.28 13.824-5.248 21.568 0.256 35.136 24.864 70.08 49.92 105.376 74.56 15.84 11.072 33.12 12.64 51.008 4.8 45.824-20.16 91.648-40.224 137.376-60.48 64.928-28.8 129.728-57.76 194.624-86.528a30516.544 30516.544 0 0 1 165.056-72.8c7.136-3.104 7.616-5.44 2.56-11.104-40.96-45.664-89.376-81.248-144.32-108.864a568.64 568.64 0 0 0-159.488-52.064c-33.728-5.856-67.84-9.536-99.712-7.68-45.92-1.28-88.576 3.968-130.976 13.088a560.096 560.096 0 0 0-98.976 30.784c-85.76 35.904-157.696 89.216-211.008 165.76C30.816 336.32 8.352 405.12 7.776 480.48a340.96 340.96 0 0 0 15.264 102.656c20.16 66.24 56.832 122.016 106.176 170.24 16.832 16.416 35.136 31.072 53.792 45.28 11.584 8.8 15.552 20.704 12.224 34.048-6.752 27.136-14.72 54.016-22.144 80.992l-3.648 13.696a15.776 15.776 0 0 0 6.304 17.792c6.496 4.544 13.76 3.424 20.576-0.48 36.352-20.8 72.704-41.6 109.12-62.272 10.624-6.048 21.888-10.528 34.432-8.032 9.312 1.824 18.496 4.416 27.68 6.912 39.36 10.656 79.616 15.808 120.288 17.216 41.248 1.408 82.304-0.64 123.2-7.424 34.112-5.632 67.584-13.504 99.872-25.216 58.976-21.344 113.568-50.72 161.6-91.424 66.944-56.64 113.856-125.6 134.88-211.104a349.12 349.12 0 0 0 5.184-139.2c-7.36-46.304-24.224-89.44-48.416-129.792",
|
|
24
24
|
fill: "#0DC803",
|
|
25
|
-
"p-id": "6039"
|
|
25
|
+
"data-p-id": "6039"
|
|
26
26
|
})));
|
|
27
27
|
IconWechatPay.displayName = 'IconWechatPay';
|
|
28
28
|
var _default = exports.default = IconWechatPay;
|
package/dist/lib/icons/index.js
CHANGED
|
@@ -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
|
});
|
|
@@ -80,5 +81,4 @@ var _IconStripe = _interopRequireDefault(require("./IconStripe"));
|
|
|
80
81
|
var _IconStripeText = _interopRequireDefault(require("./IconStripeText"));
|
|
81
82
|
var _IconAlipay = _interopRequireDefault(require("./IconAlipay"));
|
|
82
83
|
var _IconWechatPay = _interopRequireDefault(require("./IconWechatPay"));
|
|
83
|
-
var _IconPayssionPay = _interopRequireDefault(require("./IconPayssionPay"));
|
|
84
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
84
|
+
var _IconPayssionPay = _interopRequireDefault(require("./IconPayssionPay"));
|
|
@@ -1 +1,45 @@
|
|
|
1
|
-
.pay-icon{
|
|
1
|
+
.pay-icon {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
color: inherit;
|
|
4
|
+
width: 16px;
|
|
5
|
+
vertical-align: -2px;
|
|
6
|
+
stroke: currentColor;
|
|
7
|
+
}
|
|
8
|
+
.pay-icon[fill='currentColor'] {
|
|
9
|
+
fill: currentColor;
|
|
10
|
+
stroke: none;
|
|
11
|
+
}
|
|
12
|
+
.pay-icon[stroke='currentColor'] {
|
|
13
|
+
stroke: currentColor;
|
|
14
|
+
fill: none;
|
|
15
|
+
}
|
|
16
|
+
.pay-icon[fill='currentColor'][stroke='currentColor'] {
|
|
17
|
+
fill: currentColor;
|
|
18
|
+
stroke: currentColor;
|
|
19
|
+
}
|
|
20
|
+
.pay-icon-paypal-text {
|
|
21
|
+
width: 64px;
|
|
22
|
+
height: 26px;
|
|
23
|
+
max-width: 72px;
|
|
24
|
+
max-height: 32px;
|
|
25
|
+
}
|
|
26
|
+
.pay-icon-close {
|
|
27
|
+
width: 18px;
|
|
28
|
+
height: 18px;
|
|
29
|
+
}
|
|
30
|
+
.pay-icon-stripe-text {
|
|
31
|
+
width: 24px;
|
|
32
|
+
height: 24px;
|
|
33
|
+
}
|
|
34
|
+
.pay-icon-alipay {
|
|
35
|
+
width: 20px;
|
|
36
|
+
height: 20px;
|
|
37
|
+
}
|
|
38
|
+
.pay-icon-wechat-pay {
|
|
39
|
+
width: 20px;
|
|
40
|
+
height: 20px;
|
|
41
|
+
}
|
|
42
|
+
.pay-icon-payssion-pay {
|
|
43
|
+
width: 36px;
|
|
44
|
+
height: 20px;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.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}
|
package/dist/lib/index.js
CHANGED
|
@@ -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
|
});
|
|
@@ -88,5 +89,4 @@ Object.keys(_shared).forEach(function (key) {
|
|
|
88
89
|
return _shared[key];
|
|
89
90
|
}
|
|
90
91
|
});
|
|
91
|
-
});
|
|
92
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
92
|
+
});
|
|
@@ -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
|
});
|
|
@@ -18,5 +19,4 @@ Object.keys(_interface).forEach(function (key) {
|
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
});
|
|
21
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
var _default = exports.default = _payModal.default;
|
|
@@ -1,10 +1,12 @@
|
|
|
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
|
var _exportNames = {};
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
12
|
var _is = require("../utils/is");
|
|
@@ -12,6 +14,7 @@ var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
|
12
14
|
var _useLockScroll = require("../hooks/use-lock-scroll");
|
|
13
15
|
var _dom = require("../utils/dom");
|
|
14
16
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
17
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
15
18
|
var _interface = require("./interface");
|
|
16
19
|
Object.keys(_interface).forEach(function (key) {
|
|
17
20
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -24,7 +27,6 @@ Object.keys(_interface).forEach(function (key) {
|
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
});
|
|
27
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
28
30
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
29
31
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('modal');
|
|
30
32
|
const PayModal = props => {
|
|
@@ -32,13 +34,11 @@ const PayModal = props => {
|
|
|
32
34
|
visible,
|
|
33
35
|
title,
|
|
34
36
|
desc,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
retryButtonProps,
|
|
38
|
+
finishButtonProps,
|
|
37
39
|
icon,
|
|
38
40
|
showClose = true,
|
|
39
41
|
maskClosable = false,
|
|
40
|
-
onRetry,
|
|
41
|
-
onFinish,
|
|
42
42
|
onClose,
|
|
43
43
|
children,
|
|
44
44
|
footer,
|
|
@@ -48,6 +48,16 @@ const PayModal = props => {
|
|
|
48
48
|
contentStyle,
|
|
49
49
|
container
|
|
50
50
|
} = props;
|
|
51
|
+
const {
|
|
52
|
+
className: retryButtonClassName,
|
|
53
|
+
children: retryButtonChildren = '重新支付',
|
|
54
|
+
...retryButtonPropsRest
|
|
55
|
+
} = retryButtonProps || {};
|
|
56
|
+
const {
|
|
57
|
+
className: finishButtonClassName,
|
|
58
|
+
children: finishButtonChildren = '支付完成',
|
|
59
|
+
...finishButtonPropsRest
|
|
60
|
+
} = finishButtonProps || {};
|
|
51
61
|
const el = (0, _react.useRef)(_dom.clientDocument === null || _dom.clientDocument === void 0 ? void 0 : _dom.clientDocument.createElement('div'));
|
|
52
62
|
const ref = (0, _react.useRef)(null);
|
|
53
63
|
(0, _useLockScroll.useLockScroll)(ref, !!visible);
|
|
@@ -66,23 +76,21 @@ const PayModal = props => {
|
|
|
66
76
|
}
|
|
67
77
|
}, [visible, container]);
|
|
68
78
|
const classNames = (0, _classNames.default)(classPrefix, className);
|
|
69
|
-
const contentClassNames = (0, _classNames.default)(
|
|
79
|
+
const contentClassNames = (0, _classNames.default)(`${classPrefix}__content`, contentClassName);
|
|
70
80
|
const handleMaskClose = (0, _react.useCallback)(() => {
|
|
71
81
|
if (maskClosable) onClose === null || onClose === void 0 || onClose();
|
|
72
82
|
}, [maskClosable, onClose]);
|
|
73
83
|
const renderFooter = () => {
|
|
74
84
|
if (footer === null) return;
|
|
75
|
-
const retryButtonNode = /*#__PURE__*/_react.default.createElement(
|
|
76
|
-
className:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
onClick: onFinish
|
|
82
|
-
}, finishText);
|
|
85
|
+
const retryButtonNode = /*#__PURE__*/_react.default.createElement(_Button.default, (0, _extends2.default)({
|
|
86
|
+
className: (0, _classNames.default)(`${classPrefix}__btn`, `${classPrefix}__btn--retry`, retryButtonClassName)
|
|
87
|
+
}, retryButtonPropsRest), retryButtonChildren);
|
|
88
|
+
const finishButtonNode = /*#__PURE__*/_react.default.createElement(_Button.default, (0, _extends2.default)({
|
|
89
|
+
className: (0, _classNames.default)(`${classPrefix}__btn`, `${classPrefix}__btn--finish`, finishButtonClassName)
|
|
90
|
+
}, finishButtonPropsRest), finishButtonChildren);
|
|
83
91
|
const footerContent = (0, _is.isFunction)(footer) ? footer(retryButtonNode, finishButtonNode) : footer || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, retryButtonNode, finishButtonNode);
|
|
84
92
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
-
className:
|
|
93
|
+
className: `${classPrefix}__actions`
|
|
86
94
|
}, footerContent);
|
|
87
95
|
};
|
|
88
96
|
if (!visible || !el.current) return null;
|
|
@@ -90,23 +98,23 @@ const PayModal = props => {
|
|
|
90
98
|
className: classNames,
|
|
91
99
|
style: style
|
|
92
100
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
-
className:
|
|
101
|
+
className: `${classPrefix}__mask`,
|
|
94
102
|
onClick: handleMaskClose
|
|
95
103
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
96
104
|
className: contentClassNames,
|
|
97
105
|
style: contentStyle
|
|
98
106
|
}, showClose && /*#__PURE__*/_react.default.createElement("button", {
|
|
99
|
-
className:
|
|
107
|
+
className: `${classPrefix}__close`,
|
|
100
108
|
onClick: onClose,
|
|
101
109
|
"aria-label": "\u5173\u95ED"
|
|
102
110
|
}, "\xD7"), icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
-
className:
|
|
111
|
+
className: `${classPrefix}__icon`
|
|
104
112
|
}, icon), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
-
className:
|
|
113
|
+
className: `${classPrefix}__title`
|
|
106
114
|
}, title), desc && /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
-
className:
|
|
115
|
+
className: `${classPrefix}__desc`
|
|
108
116
|
}, desc), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
-
className:
|
|
117
|
+
className: `${classPrefix}__content-wrapper`
|
|
110
118
|
}, children), renderFooter()));
|
|
111
119
|
return /*#__PURE__*/_reactDom.default.createPortal(modalContent, el.current);
|
|
112
120
|
};
|
|
@@ -1 +1,95 @@
|
|
|
1
|
-
.pay-modal
|
|
1
|
+
.pay-modal {
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 9999;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
}
|
|
12
|
+
.pay-modal__mask {
|
|
13
|
+
position: absolute;
|
|
14
|
+
left: 0;
|
|
15
|
+
top: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
background: rgba(0, 0, 0, 0.55);
|
|
19
|
+
z-index: 0;
|
|
20
|
+
}
|
|
21
|
+
.pay-modal__content {
|
|
22
|
+
position: relative;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
background: #fff;
|
|
25
|
+
border-radius: 16px;
|
|
26
|
+
padding: 42px 20px 20px 20px;
|
|
27
|
+
min-width: 280px;
|
|
28
|
+
max-width: 80vw;
|
|
29
|
+
box-shadow: 0 4px 24px #0001;
|
|
30
|
+
text-align: center;
|
|
31
|
+
max-height: 60vh;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
}
|
|
35
|
+
.pay-modal__close {
|
|
36
|
+
position: absolute;
|
|
37
|
+
right: 12px;
|
|
38
|
+
top: 12px;
|
|
39
|
+
background: none;
|
|
40
|
+
border: none;
|
|
41
|
+
font-size: 28px;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
text-align: left;
|
|
44
|
+
}
|
|
45
|
+
.pay-modal__icon {
|
|
46
|
+
margin-bottom: 8px;
|
|
47
|
+
font-size: 40px;
|
|
48
|
+
}
|
|
49
|
+
.pay-modal__title {
|
|
50
|
+
font-size: 20px;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
color: #222;
|
|
53
|
+
margin-bottom: 12px;
|
|
54
|
+
}
|
|
55
|
+
.pay-modal__desc {
|
|
56
|
+
color: #222;
|
|
57
|
+
font-size: 15px;
|
|
58
|
+
margin-bottom: 24px;
|
|
59
|
+
line-height: 1.7;
|
|
60
|
+
text-align: left;
|
|
61
|
+
}
|
|
62
|
+
.pay-modal__content-wrapper {
|
|
63
|
+
position: relative;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
text-align: center;
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
flex: 1;
|
|
68
|
+
min-height: 0;
|
|
69
|
+
}
|
|
70
|
+
.pay-modal__actions {
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
gap: 16px;
|
|
74
|
+
margin-top: 16px;
|
|
75
|
+
}
|
|
76
|
+
.pay-modal__btn {
|
|
77
|
+
min-width: 96px;
|
|
78
|
+
padding: 8px 0;
|
|
79
|
+
border-radius: 24px;
|
|
80
|
+
border: none;
|
|
81
|
+
font-size: 15px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
transition: background 0.2s;
|
|
85
|
+
}
|
|
86
|
+
.pay-modal__btn--retry {
|
|
87
|
+
background: #fff;
|
|
88
|
+
color: #f25a5a;
|
|
89
|
+
border: 1.5px solid #f25a5a;
|
|
90
|
+
}
|
|
91
|
+
.pay-modal__btn--finish {
|
|
92
|
+
background: #f25a5a;
|
|
93
|
+
color: #fff;
|
|
94
|
+
border: none;
|
|
95
|
+
}
|
|
@@ -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;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
|
|
@@ -1,10 +1,12 @@
|
|
|
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
|
var _exportNames = {};
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
8
10
|
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
12
|
var _ahooks = require("ahooks");
|
|
@@ -33,13 +35,6 @@ Object.keys(_interface).forEach(function (key) {
|
|
|
33
35
|
});
|
|
34
36
|
});
|
|
35
37
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
36
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
38
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
41
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
42
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
43
38
|
const classPrefix = (0, _getPrefixCls.getPrefixCls)('popup');
|
|
44
39
|
const defaultPopupBaseProps = {
|
|
45
40
|
closeOnMaskClick: true,
|
|
@@ -53,16 +48,17 @@ const defaultPopupBaseProps = {
|
|
|
53
48
|
stopPropagation: ['click'],
|
|
54
49
|
visible: false
|
|
55
50
|
};
|
|
56
|
-
const defaultProps =
|
|
51
|
+
const defaultProps = {
|
|
52
|
+
...defaultPopupBaseProps,
|
|
57
53
|
closeOnSwipe: false,
|
|
58
54
|
position: 'bottom',
|
|
59
55
|
round: false
|
|
60
|
-
}
|
|
56
|
+
};
|
|
61
57
|
const PayPopup = p => {
|
|
62
58
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
63
|
-
const bodyCls = (0, _classNames.default)(
|
|
64
|
-
[
|
|
65
|
-
[
|
|
59
|
+
const bodyCls = (0, _classNames.default)(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`, {
|
|
60
|
+
[`${classPrefix}-body-with-close`]: props.showCloseButton,
|
|
61
|
+
[`${classPrefix}-body-round`]: props.round
|
|
66
62
|
});
|
|
67
63
|
const [active, setActive] = (0, _react.useState)(props.visible);
|
|
68
64
|
const ref = (0, _react.useRef)(null);
|
|
@@ -95,10 +91,9 @@ const PayPopup = p => {
|
|
|
95
91
|
}
|
|
96
92
|
}
|
|
97
93
|
});
|
|
98
|
-
const bind = (0, _react2.useDrag)(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
} = _ref;
|
|
94
|
+
const bind = (0, _react2.useDrag)(({
|
|
95
|
+
swipe: [, swipeY]
|
|
96
|
+
}) => {
|
|
102
97
|
if (!props.closeOnSwipe) return;
|
|
103
98
|
if (swipeY === 1 && props.position === 'bottom' || swipeY === -1 && props.position === 'top') {
|
|
104
99
|
var _props$onClose;
|
|
@@ -109,7 +104,7 @@ const PayPopup = p => {
|
|
|
109
104
|
enabled: ['top', 'bottom'].includes(props.position)
|
|
110
105
|
});
|
|
111
106
|
const maskVisible = (0, _useInnerVisible.useInnerVisible)(active && props.visible);
|
|
112
|
-
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, /*#__PURE__*/_react.default.createElement("div",
|
|
107
|
+
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
113
108
|
className: classPrefix,
|
|
114
109
|
onClick: props.onClick,
|
|
115
110
|
style: {
|
|
@@ -133,31 +128,32 @@ const PayPopup = p => {
|
|
|
133
128
|
disableBodyScroll: false,
|
|
134
129
|
stopPropagation: props.stopPropagation
|
|
135
130
|
}), /*#__PURE__*/_react.default.createElement(_web.animated.div, {
|
|
136
|
-
className: (0, _classNames.default)(
|
|
137
|
-
[
|
|
138
|
-
[
|
|
131
|
+
className: (0, _classNames.default)(`${classPrefix}-body`, `${classPrefix}-body-position-${props.position}`, {
|
|
132
|
+
[`${classPrefix}-body-with-close`]: props.showCloseButton,
|
|
133
|
+
[`${classPrefix}-body-round`]: props.round
|
|
139
134
|
}, bodyCls),
|
|
140
|
-
style:
|
|
135
|
+
style: {
|
|
136
|
+
...props.bodyStyle,
|
|
141
137
|
pointerEvents: percent.to(v => v === 0 ? 'unset' : 'none'),
|
|
142
138
|
transform: percent.to(v => {
|
|
143
139
|
if (props.position === 'bottom') {
|
|
144
|
-
return
|
|
140
|
+
return `translate(0, ${v}%)`;
|
|
145
141
|
}
|
|
146
142
|
if (props.position === 'top') {
|
|
147
|
-
return
|
|
143
|
+
return `translate(0, -${v}%)`;
|
|
148
144
|
}
|
|
149
145
|
if (props.position === 'left') {
|
|
150
|
-
return
|
|
146
|
+
return `translate(-${v}%, 0)`;
|
|
151
147
|
}
|
|
152
148
|
if (props.position === 'right') {
|
|
153
|
-
return
|
|
149
|
+
return `translate(${v}%, 0)`;
|
|
154
150
|
}
|
|
155
151
|
return 'none';
|
|
156
152
|
})
|
|
157
|
-
}
|
|
153
|
+
},
|
|
158
154
|
ref: ref
|
|
159
155
|
}, props.showCloseButton && /*#__PURE__*/_react.default.createElement("a", {
|
|
160
|
-
className: (0, _classNames.default)(
|
|
156
|
+
className: (0, _classNames.default)(`${classPrefix}-close-icon`, `${classPrefix}-close-button`),
|
|
161
157
|
onClick: () => {
|
|
162
158
|
var _props$onClose3;
|
|
163
159
|
(_props$onClose3 = props.onClose) === null || _props$onClose3 === void 0 || _props$onClose3.call(props);
|
|
@@ -165,7 +161,7 @@ const PayPopup = p => {
|
|
|
165
161
|
role: "button",
|
|
166
162
|
"aria-label": 'close'
|
|
167
163
|
}, props.closeIcon), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
-
className:
|
|
164
|
+
className: `${classPrefix}-content`
|
|
169
165
|
}, props.children)))));
|
|
170
166
|
return /*#__PURE__*/_react.default.createElement(_shouldRender.ShouldRender, {
|
|
171
167
|
active: active,
|