pay-sdk-react 1.1.13 → 1.2.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 +465 -84
- package/README.zh-CN.md +466 -85
- package/dist/css/index.css +86 -6
- package/dist/css/index.min.css +1 -1
- package/dist/es/Airwallex/airwallex-button.js +48 -16
- package/dist/es/Airwallex/airwallex-checkout-button.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-checkout-button.js +73 -0
- package/dist/es/Airwallex/airwallex-managed.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-managed.js +87 -0
- package/dist/es/Airwallex/airwallex-modal.js +7 -3
- package/dist/es/Airwallex/airwallex-popup.js +7 -3
- package/dist/es/Airwallex/airwallex.d.ts +1 -3
- package/dist/es/Airwallex/airwallex.js +10 -1
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.d.ts +7 -0
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.js +155 -0
- package/dist/es/Airwallex/index.d.ts +4 -0
- package/dist/es/Airwallex/index.js +5 -1
- package/dist/es/Airwallex/interface.d.ts +146 -0
- package/dist/es/Airwallex/style/index.css +2 -2
- package/dist/es/Airwallex/style/index.min.css +1 -1
- package/dist/es/Alipay/alipay-button.js +26 -7
- package/dist/es/Alipay/alipay.js +39 -12
- package/dist/es/Alipay/interface.d.ts +26 -1
- package/dist/es/Alipay/style/index.css +2 -2
- package/dist/es/Alipay/style/index.min.css +1 -1
- package/dist/es/MAlipay/style/index.css +2 -2
- package/dist/es/MAlipay/style/index.min.css +1 -1
- package/dist/es/MPix/index.d.ts +2 -0
- package/dist/es/MPix/index.js +2 -0
- package/dist/es/MPix/interface.d.ts +44 -0
- package/dist/es/MPix/interface.js +1 -0
- package/dist/es/MPix/m-pix-button.d.ts +6 -0
- package/dist/es/MPix/m-pix-button.js +159 -0
- package/dist/es/MPix/style/index.css +256 -0
- package/dist/es/MPix/style/index.d.ts +1 -0
- package/dist/es/MPix/style/index.js +1 -0
- package/dist/es/MPix/style/index.min.css +1 -0
- package/dist/es/MWeChat/style/index.css +2 -2
- package/dist/es/MWeChat/style/index.min.css +1 -1
- package/dist/es/PayButton/index.js +12 -0
- package/dist/es/PayButton/interface.d.ts +28 -2
- package/dist/es/Paypal/index.d.ts +2 -0
- package/dist/es/Paypal/index.js +3 -1
- package/dist/es/Paypal/interface.d.ts +40 -0
- package/dist/es/Paypal/paypal-button.js +24 -3
- package/dist/es/Paypal/paypal-smart-button.d.ts +4 -0
- package/dist/es/Paypal/paypal-smart-button.js +48 -0
- package/dist/es/Payssion/interface.d.ts +7 -0
- package/dist/es/Payssion/payssion-button.js +25 -4
- package/dist/es/Pix/index.d.ts +11 -0
- package/dist/es/Pix/index.js +10 -0
- package/dist/es/Pix/interface.d.ts +147 -0
- package/dist/es/Pix/interface.js +1 -0
- package/dist/es/Pix/pix-button.d.ts +6 -0
- package/dist/es/Pix/pix-button.js +99 -0
- package/dist/es/Pix/pix-enhanced.d.ts +4 -0
- package/dist/es/Pix/pix-enhanced.js +182 -0
- package/dist/es/Pix/pix-modal.d.ts +6 -0
- package/dist/es/Pix/pix-modal.js +57 -0
- package/dist/es/Pix/pix.d.ts +4 -0
- package/dist/es/Pix/pix.js +125 -0
- package/dist/es/Pix/style/index.css +80 -0
- package/dist/es/Pix/style/index.d.ts +1 -0
- package/dist/es/Pix/style/index.js +1 -0
- package/dist/es/Pix/style/index.min.css +1 -0
- package/dist/es/Stripe/hooks/useStripeCheckout.d.ts +7 -0
- package/dist/es/Stripe/hooks/useStripeCheckout.js +86 -0
- package/dist/es/Stripe/index.d.ts +4 -0
- package/dist/es/Stripe/index.js +5 -1
- package/dist/es/Stripe/interface.d.ts +120 -0
- package/dist/es/Stripe/stripe-button.js +32 -10
- package/dist/es/Stripe/stripe-checkout-button.d.ts +4 -0
- package/dist/es/Stripe/stripe-checkout-button.js +70 -0
- package/dist/es/Stripe/stripe-modal.js +19 -2
- package/dist/es/Stripe/stripe-popup.js +13 -2
- package/dist/es/Stripe/stripe.js +38 -4
- package/dist/es/Stripe/style/index.css +2 -2
- package/dist/es/Stripe/style/index.min.css +1 -1
- package/dist/es/Wechat/interface.d.ts +13 -0
- package/dist/es/Wechat/style/index.css +2 -2
- package/dist/es/Wechat/style/index.min.css +1 -1
- package/dist/es/Wechat/wechat-button.js +26 -7
- package/dist/es/Wechat/wechat-content.d.ts +4 -0
- package/dist/es/Wechat/wechat-content.js +61 -0
- package/dist/es/Wechat/wechat.d.ts +1 -1
- package/dist/es/Wechat/wechat.js +5 -1
- package/dist/es/confirm-modal/style/index.css +2 -2
- package/dist/es/confirm-modal/style/index.min.css +1 -1
- package/dist/es/hooks/useLatestCallback.d.ts +1 -0
- package/dist/es/hooks/useLatestCallback.js +8 -0
- package/dist/es/hooks/useManagedOrder.d.ts +8 -0
- package/dist/es/hooks/useManagedOrder.js +67 -0
- package/dist/es/hooks/usePaymentExecution.d.ts +13 -0
- package/dist/es/hooks/usePaymentExecution.js +176 -0
- package/dist/es/hooks/usePaymentQr.d.ts +6 -0
- package/dist/es/hooks/usePaymentQr.js +52 -0
- package/dist/es/hooks/usePaymentRedirect.d.ts +5 -0
- package/dist/es/hooks/usePaymentRedirect.js +83 -0
- package/dist/es/icons/IconCheck/index.d.ts +4 -0
- package/dist/es/icons/IconCheck/index.js +22 -0
- package/dist/es/icons/IconCopy/index.d.ts +4 -0
- package/dist/es/icons/IconCopy/index.js +27 -0
- package/dist/es/icons/IconPix/index.d.ts +4 -0
- package/dist/es/icons/IconPix/index.js +33 -0
- package/dist/es/icons/index.d.ts +3 -0
- package/dist/es/icons/index.js +4 -1
- package/dist/es/index.d.ts +50 -6
- package/dist/es/index.js +28 -1
- package/dist/es/pay-modal/interface.d.ts +22 -2
- package/dist/es/pay-modal/pay-modal.js +36 -16
- package/dist/es/pay-modal/style/index.css +2 -2
- package/dist/es/pay-modal/style/index.min.css +1 -1
- package/dist/es/shared/entitys/payment.d.ts +227 -0
- package/dist/es/shared/entitys/payment.js +75 -0
- package/dist/es/shared/enums/index.d.ts +1 -78
- package/dist/es/shared/enums/index.js +1 -81
- package/dist/es/shared/enums/payment.d.ts +162 -0
- package/dist/es/shared/enums/payment.js +168 -0
- package/dist/es/shared/index.d.ts +2 -0
- package/dist/es/shared/index.js +2 -1
- package/dist/lib/Airwallex/airwallex-button.js +31 -10
- package/dist/lib/Airwallex/airwallex-checkout-button.js +52 -0
- package/dist/lib/Airwallex/airwallex-managed.js +86 -0
- package/dist/lib/Airwallex/airwallex-modal.js +4 -2
- package/dist/lib/Airwallex/airwallex-popup.js +4 -2
- package/dist/lib/Airwallex/airwallex.js +9 -1
- package/dist/lib/Airwallex/hooks/useAirwallexCheckout.js +83 -0
- package/dist/lib/Airwallex/index.js +18 -1
- package/dist/lib/Airwallex/style/index.css +2 -2
- package/dist/lib/Airwallex/style/index.min.css +1 -1
- package/dist/lib/Alipay/alipay-button.js +21 -6
- package/dist/lib/Alipay/alipay.js +36 -9
- package/dist/lib/Alipay/style/index.css +2 -2
- package/dist/lib/Alipay/style/index.min.css +1 -1
- package/dist/lib/MAlipay/style/index.css +2 -2
- package/dist/lib/MAlipay/style/index.min.css +1 -1
- package/dist/lib/MPix/index.js +28 -0
- package/dist/lib/MPix/interface.js +5 -0
- package/dist/lib/MPix/m-pix-button.js +127 -0
- package/dist/lib/MPix/style/index.css +256 -0
- package/dist/lib/MPix/style/index.js +3 -0
- package/dist/lib/MPix/style/index.min.css +1 -0
- package/dist/lib/MWeChat/style/index.css +2 -2
- package/dist/lib/MWeChat/style/index.min.css +1 -1
- package/dist/lib/PayButton/index.js +12 -0
- package/dist/lib/Paypal/index.js +17 -1
- package/dist/lib/Paypal/paypal-button.js +19 -2
- package/dist/lib/Paypal/paypal-smart-button.js +45 -0
- package/dist/lib/Payssion/payssion-button.js +20 -3
- package/dist/lib/Pix/index.js +43 -0
- package/dist/lib/Pix/interface.js +5 -0
- package/dist/lib/Pix/pix-button.js +83 -0
- package/dist/lib/Pix/pix-enhanced.js +143 -0
- package/dist/lib/Pix/pix-modal.js +50 -0
- package/dist/lib/Pix/pix.js +97 -0
- package/dist/lib/Pix/style/index.css +80 -0
- package/dist/lib/Pix/style/index.js +3 -0
- package/dist/lib/Pix/style/index.min.css +1 -0
- package/dist/lib/Stripe/hooks/useStripeCheckout.js +41 -0
- package/dist/lib/Stripe/index.js +18 -1
- package/dist/lib/Stripe/stripe-button.js +28 -10
- package/dist/lib/Stripe/stripe-checkout-button.js +50 -0
- package/dist/lib/Stripe/stripe-modal.js +12 -1
- package/dist/lib/Stripe/stripe-popup.js +12 -1
- package/dist/lib/Stripe/stripe.js +30 -1
- package/dist/lib/Stripe/style/index.css +2 -2
- package/dist/lib/Stripe/style/index.min.css +1 -1
- package/dist/lib/Wechat/style/index.css +2 -2
- package/dist/lib/Wechat/style/index.min.css +1 -1
- package/dist/lib/Wechat/wechat-button.js +21 -6
- package/dist/lib/Wechat/wechat-content.js +65 -0
- package/dist/lib/Wechat/wechat.js +3 -1
- package/dist/lib/confirm-modal/style/index.css +2 -2
- package/dist/lib/confirm-modal/style/index.min.css +1 -1
- package/dist/lib/hooks/useLatestCallback.js +13 -0
- package/dist/lib/hooks/useManagedOrder.js +29 -0
- package/dist/lib/hooks/usePaymentExecution.js +113 -0
- package/dist/lib/hooks/usePaymentQr.js +51 -0
- package/dist/lib/hooks/usePaymentRedirect.js +87 -0
- package/dist/lib/icons/IconCheck/index.js +27 -0
- package/dist/lib/icons/IconCopy/index.js +32 -0
- package/dist/lib/icons/IconPix/index.js +38 -0
- package/dist/lib/icons/index.js +25 -1
- package/dist/lib/index.js +86 -1
- package/dist/lib/pay-modal/pay-modal.js +33 -16
- package/dist/lib/pay-modal/style/index.css +2 -2
- package/dist/lib/pay-modal/style/index.min.css +1 -1
- package/dist/lib/shared/entitys/payment.js +61 -0
- package/dist/lib/shared/enums/index.js +11 -81
- package/dist/lib/shared/enums/payment.js +172 -0
- package/dist/lib/shared/index.js +12 -1
- package/dist/umd/pay-sdk-react.umd.js +10455 -11463
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +44 -25
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _useManagedOrder = require("../hooks/useManagedOrder");
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
10
|
var _wechatModal = _interopRequireDefault(require("./wechat-modal"));
|
|
@@ -19,6 +20,7 @@ const WechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
19
20
|
children = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.IconWechatPay, null), "\u5FAE\u4FE1\u652F\u4ED8"),
|
|
20
21
|
onClick,
|
|
21
22
|
createOrder,
|
|
23
|
+
executionOptions,
|
|
22
24
|
modalProps,
|
|
23
25
|
...others
|
|
24
26
|
} = props;
|
|
@@ -35,32 +37,45 @@ const WechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
35
37
|
},
|
|
36
38
|
closeModal: () => {
|
|
37
39
|
var _wechatModalRef$curre2;
|
|
40
|
+
if (executionOptions) managed.cancel();
|
|
38
41
|
(_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.close();
|
|
39
42
|
},
|
|
40
43
|
current: wechatButtonRef.current
|
|
41
44
|
}));
|
|
45
|
+
const managed = (0, _useManagedOrder.useManagedOrder)(createOrder, target => {
|
|
46
|
+
var _wechatModalRef$curre3;
|
|
47
|
+
(_wechatModalRef$curre3 = wechatModalRef.current) === null || _wechatModalRef$curre3 === void 0 || _wechatModalRef$curre3.open(target);
|
|
48
|
+
}, executionOptions, target => typeof target.wechatUrl === 'string' && Boolean(target.wechatUrl.trim()));
|
|
49
|
+
const managedRun = managed.run;
|
|
42
50
|
const handlePayCreateOrder = (0, _react.useCallback)(async () => {
|
|
43
51
|
if (createOrder) {
|
|
44
|
-
var _wechatModalRef$
|
|
52
|
+
var _wechatModalRef$curre4;
|
|
45
53
|
const options = await createOrder();
|
|
46
|
-
(_wechatModalRef$
|
|
54
|
+
(_wechatModalRef$curre4 = wechatModalRef.current) === null || _wechatModalRef$curre4 === void 0 || _wechatModalRef$curre4.open(options);
|
|
47
55
|
}
|
|
48
56
|
}, [createOrder]);
|
|
49
57
|
const handleClick = (0, _react.useCallback)(e => {
|
|
50
58
|
var _modalProps$wechatPro;
|
|
51
59
|
if (createOrder) {
|
|
60
|
+
if (executionOptions) {
|
|
61
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
62
|
+
if (e.defaultPrevented) return;
|
|
63
|
+
return managedRun().then(() => undefined);
|
|
64
|
+
}
|
|
52
65
|
handlePayCreateOrder();
|
|
53
66
|
} else if (modalProps !== null && modalProps !== void 0 && (_modalProps$wechatPro = modalProps.wechatProps) !== null && _modalProps$wechatPro !== void 0 && _modalProps$wechatPro.wechatUrl) {
|
|
54
|
-
var _wechatModalRef$
|
|
55
|
-
wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$
|
|
67
|
+
var _wechatModalRef$curre5;
|
|
68
|
+
wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre5 = wechatModalRef.current) === null || _wechatModalRef$curre5 === void 0 || _wechatModalRef$curre5.open();
|
|
56
69
|
}
|
|
57
70
|
onClick === null || onClick === void 0 || onClick(e);
|
|
58
|
-
}, [onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
71
|
+
}, [executionOptions, managedRun, onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
59
72
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
60
73
|
ref: wechatButtonRef,
|
|
61
74
|
className: (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('wechat-btn'), className),
|
|
62
75
|
onClick: handleClick
|
|
63
|
-
}, others
|
|
76
|
+
}, others, {
|
|
77
|
+
loading: executionOptions ? managed.loading || others.loading : others.loading
|
|
78
|
+
}), children), /*#__PURE__*/_react.default.createElement(_wechatModal.default, _extends({
|
|
64
79
|
ref: wechatModalRef
|
|
65
80
|
}, modalProps)));
|
|
66
81
|
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _usePaymentQr = require("../hooks/usePaymentQr");
|
|
9
|
+
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
10
|
+
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const WechatContent = ({
|
|
13
|
+
wechatUrl,
|
|
14
|
+
wechatType = 'qrcode',
|
|
15
|
+
tipText = '请使用微信APP扫码支付',
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
qrProps = {}
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
imageUrl,
|
|
22
|
+
loading,
|
|
23
|
+
failed
|
|
24
|
+
} = (0, _usePaymentQr.usePaymentQr)(wechatUrl, wechatType === 'image', qrProps);
|
|
25
|
+
if (loading) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, qrProps.loadingContent ?? null);
|
|
26
|
+
if (failed) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, qrProps.errorContent ?? null);
|
|
27
|
+
const prefix = (0, _getPrefixCls.getPrefixCls)('wechat-qrcode');
|
|
28
|
+
const {
|
|
29
|
+
classNames: names = {},
|
|
30
|
+
styles = {}
|
|
31
|
+
} = qrProps;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: (0, _classNames.default)(prefix, className, names.root),
|
|
34
|
+
style: {
|
|
35
|
+
...style,
|
|
36
|
+
...styles.root
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: (0, _classNames.default)(`${prefix}__container`, names.container),
|
|
40
|
+
style: {
|
|
41
|
+
position: 'relative',
|
|
42
|
+
width: qrProps.size,
|
|
43
|
+
height: qrProps.size,
|
|
44
|
+
...styles.container
|
|
45
|
+
}
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
47
|
+
className: (0, _classNames.default)(`${prefix}__image`, names.image),
|
|
48
|
+
style: styles.image,
|
|
49
|
+
src: imageUrl,
|
|
50
|
+
alt: "\u5FAE\u4FE1\u652F\u4ED8\u4E8C\u7EF4\u7801"
|
|
51
|
+
}), qrProps.overlay !== undefined ? /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
+
className: names.overlay,
|
|
53
|
+
style: {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
left: '50%',
|
|
56
|
+
top: '50%',
|
|
57
|
+
transform: 'translate(-50%, -50%)',
|
|
58
|
+
...styles.overlay
|
|
59
|
+
}
|
|
60
|
+
}, qrProps.overlay) : null), tipText ? /*#__PURE__*/_react.default.createElement("span", {
|
|
61
|
+
className: (0, _classNames.default)(`${prefix}__tip`, names.tip),
|
|
62
|
+
style: styles.tip
|
|
63
|
+
}, tipText) : null);
|
|
64
|
+
};
|
|
65
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(WechatContent);
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classNames = _interopRequireDefault(require("../utils/classNames"));
|
|
9
|
+
var _wechatContent = _interopRequireDefault(require("./wechat-content"));
|
|
9
10
|
var _qrcode = _interopRequireDefault(require("../utils/qrcode"));
|
|
10
11
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -44,4 +45,5 @@ const WechatQrCode = ({
|
|
|
44
45
|
className: `${classPrefix}__tip`
|
|
45
46
|
}, tipText));
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
const WechatEntry = props => props.qrProps ? /*#__PURE__*/_react.default.createElement(_wechatContent.default, props) : /*#__PURE__*/_react.default.createElement(WechatQrCode, props);
|
|
49
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(WechatEntry);
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
max-width: 80vw;
|
|
29
29
|
box-shadow: 0 4px 24px #0001;
|
|
30
30
|
text-align: center;
|
|
31
|
-
max-height:
|
|
31
|
+
max-height: 80vh;
|
|
32
32
|
display: flex;
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
z-index: 1;
|
|
69
69
|
text-align: center;
|
|
70
70
|
overflow-y: auto;
|
|
71
|
-
flex: 1;
|
|
71
|
+
flex: 0 1 auto;
|
|
72
72
|
min-height: 0;
|
|
73
73
|
}
|
|
74
74
|
.pay-modal__actions {
|
|
@@ -1 +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:
|
|
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:80vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:32px;font-weight:500;line-height:32px;cursor:pointer;text-align:left}.pay-modal__icon{display:flex;justify-content:center;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:0 1 auto;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useLatestCallback = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const useLatestCallback = callback => {
|
|
9
|
+
const latest = (0, _react.useRef)(callback);
|
|
10
|
+
latest.current = callback;
|
|
11
|
+
return (0, _react.useCallback)((...args) => latest.current(...args), []);
|
|
12
|
+
};
|
|
13
|
+
exports.useLatestCallback = useLatestCallback;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useManagedOrder = void 0;
|
|
7
|
+
var _usePaymentExecution = require("./usePaymentExecution");
|
|
8
|
+
var _useLatestCallback = require("./useLatestCallback");
|
|
9
|
+
var _enums = require("../shared/enums");
|
|
10
|
+
var _payment = require("../shared/entitys/payment");
|
|
11
|
+
const useManagedOrder = (factory, receive, options, validate) => {
|
|
12
|
+
const execution = (0, _usePaymentExecution.usePaymentExecution)(options);
|
|
13
|
+
const run = (0, _useLatestCallback.useLatestCallback)(() => execution.run(async context => {
|
|
14
|
+
if (!factory) throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.InvalidParameters, 'createOrder is required for managed order execution.');
|
|
15
|
+
const target = await factory();
|
|
16
|
+
if (!context.isCurrent()) return;
|
|
17
|
+
if (target == null) {
|
|
18
|
+
execution.cancel();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (validate && !validate(target)) throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.InvalidParameters, 'Invalid payment parameters returned by createOrder.');
|
|
22
|
+
receive(target);
|
|
23
|
+
}));
|
|
24
|
+
return {
|
|
25
|
+
...execution,
|
|
26
|
+
run
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.useManagedOrder = useManagedOrder;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.usePaymentExecution = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _enums = require("../shared/enums");
|
|
10
|
+
var _payment = require("../shared/entitys/payment");
|
|
11
|
+
var _useLatestCallback = require("./useLatestCallback");
|
|
12
|
+
const usePaymentExecution = (options = {}) => {
|
|
13
|
+
const latest = (0, _react.useRef)(options);
|
|
14
|
+
latest.current = options;
|
|
15
|
+
const mounted = (0, _react.useRef)(false);
|
|
16
|
+
const sequence = (0, _react.useRef)(0);
|
|
17
|
+
const pending = (0, _react.useRef)(false);
|
|
18
|
+
const controller = (0, _react.useRef)();
|
|
19
|
+
const [status, setStatus] = (0, _react.useState)(_enums.PaymentExecutionStatus.Idle);
|
|
20
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
21
|
+
const cancel = (0, _useLatestCallback.useLatestCallback)(() => {
|
|
22
|
+
var _controller$current;
|
|
23
|
+
const wasPending = pending.current;
|
|
24
|
+
sequence.current += 1;
|
|
25
|
+
(_controller$current = controller.current) === null || _controller$current === void 0 || _controller$current.abort();
|
|
26
|
+
pending.current = false;
|
|
27
|
+
if (mounted.current && wasPending) {
|
|
28
|
+
var _latest$current$onLoa, _latest$current, _latest$current$onCan, _latest$current2;
|
|
29
|
+
setStatus(_enums.PaymentExecutionStatus.Cancelled);
|
|
30
|
+
(_latest$current$onLoa = (_latest$current = latest.current).onLoadingChange) === null || _latest$current$onLoa === void 0 || _latest$current$onLoa.call(_latest$current, false);
|
|
31
|
+
(_latest$current$onCan = (_latest$current2 = latest.current).onCancel) === null || _latest$current$onCan === void 0 || _latest$current$onCan.call(_latest$current2);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
(0, _react.useEffect)(() => {
|
|
35
|
+
mounted.current = true;
|
|
36
|
+
return () => {
|
|
37
|
+
var _controller$current2;
|
|
38
|
+
mounted.current = false;
|
|
39
|
+
sequence.current += 1;
|
|
40
|
+
(_controller$current2 = controller.current) === null || _controller$current2 === void 0 || _controller$current2.abort();
|
|
41
|
+
pending.current = false;
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
const run = (0, _useLatestCallback.useLatestCallback)(async task => {
|
|
45
|
+
if (!mounted.current) return {
|
|
46
|
+
status: _enums.PaymentExecutionStatus.Cancelled
|
|
47
|
+
};
|
|
48
|
+
if (pending.current) return {
|
|
49
|
+
status: _enums.PaymentExecutionStatus.Pending
|
|
50
|
+
};
|
|
51
|
+
const id = ++sequence.current;
|
|
52
|
+
const request = new AbortController();
|
|
53
|
+
controller.current = request;
|
|
54
|
+
pending.current = true;
|
|
55
|
+
setError(null);
|
|
56
|
+
setStatus(_enums.PaymentExecutionStatus.Pending);
|
|
57
|
+
const isCurrent = () => mounted.current && sequence.current === id && !request.signal.aborted;
|
|
58
|
+
let result;
|
|
59
|
+
try {
|
|
60
|
+
var _latest$current$onLoa2, _latest$current3, _latest$current$befor, _latest$current4;
|
|
61
|
+
(_latest$current$onLoa2 = (_latest$current3 = latest.current).onLoadingChange) === null || _latest$current$onLoa2 === void 0 || _latest$current$onLoa2.call(_latest$current3, true);
|
|
62
|
+
const permitted = await ((_latest$current$befor = (_latest$current4 = latest.current).beforePay) === null || _latest$current$befor === void 0 ? void 0 : _latest$current$befor.call(_latest$current4));
|
|
63
|
+
if (!isCurrent()) return {
|
|
64
|
+
status: _enums.PaymentExecutionStatus.Cancelled
|
|
65
|
+
};
|
|
66
|
+
if (permitted === false) {
|
|
67
|
+
result = {
|
|
68
|
+
status: _enums.PaymentExecutionStatus.Cancelled
|
|
69
|
+
};
|
|
70
|
+
} else {
|
|
71
|
+
const value = await task({
|
|
72
|
+
signal: request.signal,
|
|
73
|
+
isCurrent
|
|
74
|
+
});
|
|
75
|
+
if (!isCurrent()) return {
|
|
76
|
+
status: _enums.PaymentExecutionStatus.Cancelled
|
|
77
|
+
};
|
|
78
|
+
result = {
|
|
79
|
+
status: _enums.PaymentExecutionStatus.Completed,
|
|
80
|
+
value
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
} catch (cause) {
|
|
84
|
+
if (!isCurrent()) return {
|
|
85
|
+
status: _enums.PaymentExecutionStatus.Cancelled
|
|
86
|
+
};
|
|
87
|
+
const failure = cause instanceof _payment.PaymentExecutionError ? cause : new _payment.PaymentExecutionError(_enums.PaymentErrorCode.ExecutionFailed, 'Payment execution failed.');
|
|
88
|
+
result = {
|
|
89
|
+
status: _enums.PaymentExecutionStatus.Failed,
|
|
90
|
+
error: failure
|
|
91
|
+
};
|
|
92
|
+
setError(failure);
|
|
93
|
+
} finally {
|
|
94
|
+
if (isCurrent()) pending.current = false;
|
|
95
|
+
}
|
|
96
|
+
if (isCurrent()) {
|
|
97
|
+
var _latest$current$onLoa3, _latest$current5, _latest$current$onPay, _latest$current6, _latest$current$onCan2, _latest$current7;
|
|
98
|
+
setStatus(result.status);
|
|
99
|
+
(_latest$current$onLoa3 = (_latest$current5 = latest.current).onLoadingChange) === null || _latest$current$onLoa3 === void 0 || _latest$current$onLoa3.call(_latest$current5, false);
|
|
100
|
+
if (result.error) (_latest$current$onPay = (_latest$current6 = latest.current).onPaymentError) === null || _latest$current$onPay === void 0 || _latest$current$onPay.call(_latest$current6, result.error);
|
|
101
|
+
if (result.status === _enums.PaymentExecutionStatus.Cancelled) (_latest$current$onCan2 = (_latest$current7 = latest.current).onCancel) === null || _latest$current$onCan2 === void 0 || _latest$current$onCan2.call(_latest$current7);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
run,
|
|
107
|
+
cancel,
|
|
108
|
+
status,
|
|
109
|
+
error,
|
|
110
|
+
loading: status === _enums.PaymentExecutionStatus.Pending
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
exports.usePaymentExecution = usePaymentExecution;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePaymentQr = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _qrcode = _interopRequireDefault(require("../utils/qrcode"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const usePaymentQr = (value, image, options) => {
|
|
11
|
+
const callbacks = (0, _react.useRef)(options);
|
|
12
|
+
callbacks.current = options;
|
|
13
|
+
const [state, setState] = (0, _react.useState)({
|
|
14
|
+
imageUrl: '',
|
|
15
|
+
loading: true,
|
|
16
|
+
failed: false
|
|
17
|
+
});
|
|
18
|
+
(0, _react.useEffect)(() => {
|
|
19
|
+
let active = true;
|
|
20
|
+
setState({
|
|
21
|
+
imageUrl: '',
|
|
22
|
+
loading: true,
|
|
23
|
+
failed: false
|
|
24
|
+
});
|
|
25
|
+
const task = image ? Promise.resolve(value) : (0, _qrcode.default)(value);
|
|
26
|
+
task.then(imageUrl => {
|
|
27
|
+
var _callbacks$current$on, _callbacks$current;
|
|
28
|
+
if (!active) return;
|
|
29
|
+
setState({
|
|
30
|
+
imageUrl,
|
|
31
|
+
loading: false,
|
|
32
|
+
failed: false
|
|
33
|
+
});
|
|
34
|
+
(_callbacks$current$on = (_callbacks$current = callbacks.current).onQrReady) === null || _callbacks$current$on === void 0 || _callbacks$current$on.call(_callbacks$current, imageUrl);
|
|
35
|
+
}).catch(() => {
|
|
36
|
+
var _callbacks$current$on2, _callbacks$current2;
|
|
37
|
+
if (!active) return;
|
|
38
|
+
setState({
|
|
39
|
+
imageUrl: '',
|
|
40
|
+
loading: false,
|
|
41
|
+
failed: true
|
|
42
|
+
});
|
|
43
|
+
(_callbacks$current$on2 = (_callbacks$current2 = callbacks.current).onQrError) === null || _callbacks$current$on2 === void 0 || _callbacks$current$on2.call(_callbacks$current2);
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
active = false;
|
|
47
|
+
};
|
|
48
|
+
}, [value, image]);
|
|
49
|
+
return state;
|
|
50
|
+
};
|
|
51
|
+
exports.usePaymentQr = usePaymentQr;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.usePaymentRedirect = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _enums = require("../shared/enums");
|
|
10
|
+
var _payment = require("../shared/entitys/payment");
|
|
11
|
+
var _useLatestCallback = require("./useLatestCallback");
|
|
12
|
+
let nextWindowId = 0;
|
|
13
|
+
const usePaymentRedirect = (options = {}) => {
|
|
14
|
+
const latest = (0, _react.useRef)(options);
|
|
15
|
+
latest.current = options;
|
|
16
|
+
const owned = (0, _react.useRef)(null);
|
|
17
|
+
const monitor = (0, _react.useRef)();
|
|
18
|
+
const name = (0, _react.useRef)();
|
|
19
|
+
const clearMonitor = () => {
|
|
20
|
+
if (monitor.current !== undefined) clearInterval(monitor.current);
|
|
21
|
+
monitor.current = undefined;
|
|
22
|
+
};
|
|
23
|
+
const close = (0, _useLatestCallback.useLatestCallback)(() => {
|
|
24
|
+
var _owned$current;
|
|
25
|
+
clearMonitor();
|
|
26
|
+
(_owned$current = owned.current) === null || _owned$current === void 0 || _owned$current.close();
|
|
27
|
+
owned.current = null;
|
|
28
|
+
});
|
|
29
|
+
const open = (0, _useLatestCallback.useLatestCallback)(rawUrl => {
|
|
30
|
+
var _latest$current$onOpe, _latest$current2;
|
|
31
|
+
if (typeof window === 'undefined') throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.BrowserUnavailable, 'A browser is required.');
|
|
32
|
+
let url;
|
|
33
|
+
try {
|
|
34
|
+
url = new URL(rawUrl, window.location.href);
|
|
35
|
+
} catch {
|
|
36
|
+
throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.InvalidParameters, 'Invalid payment URL.');
|
|
37
|
+
}
|
|
38
|
+
if (!(rawUrl !== null && rawUrl !== void 0 && rawUrl.trim()) || !['https:', 'http:'].includes(url.protocol)) {
|
|
39
|
+
throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.InvalidParameters, 'Payment URL must use HTTP or HTTPS.');
|
|
40
|
+
}
|
|
41
|
+
const mode = latest.current.openMode ?? _enums.OpenPayUrlMode.Href;
|
|
42
|
+
if (mode === _enums.OpenPayUrlMode.Window) {
|
|
43
|
+
close();
|
|
44
|
+
if (!name.current) name.current = `pay_sdk_${++nextWindowId}`;
|
|
45
|
+
const child = window.open(url.href, latest.current.windowName ?? name.current, latest.current.windowFeatures);
|
|
46
|
+
if (!child) throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.WindowBlocked, 'The payment window was blocked.');
|
|
47
|
+
owned.current = child;
|
|
48
|
+
monitor.current = setInterval(() => {
|
|
49
|
+
var _owned$current2;
|
|
50
|
+
if ((_owned$current2 = owned.current) !== null && _owned$current2 !== void 0 && _owned$current2.closed) {
|
|
51
|
+
var _latest$current$onWin, _latest$current;
|
|
52
|
+
clearMonitor();
|
|
53
|
+
owned.current = null;
|
|
54
|
+
(_latest$current$onWin = (_latest$current = latest.current).onWindowClose) === null || _latest$current$onWin === void 0 || _latest$current$onWin.call(_latest$current);
|
|
55
|
+
}
|
|
56
|
+
}, 500);
|
|
57
|
+
} else if (mode === _enums.OpenPayUrlMode.Replace) {
|
|
58
|
+
window.location.replace(url.href);
|
|
59
|
+
} else if (mode === _enums.OpenPayUrlMode.Href) {
|
|
60
|
+
window.location.assign(url.href);
|
|
61
|
+
} else {
|
|
62
|
+
throw new _payment.PaymentExecutionError(_enums.PaymentErrorCode.InvalidParameters, 'Unsupported opening mode.');
|
|
63
|
+
}
|
|
64
|
+
(_latest$current$onOpe = (_latest$current2 = latest.current).onOpen) === null || _latest$current$onOpe === void 0 || _latest$current$onOpe.call(_latest$current2, url.href);
|
|
65
|
+
});
|
|
66
|
+
(0, _react.useEffect)(() => {
|
|
67
|
+
const onMessage = event => {
|
|
68
|
+
var _config$allowedMessag, _config$onMessage;
|
|
69
|
+
const config = latest.current;
|
|
70
|
+
if (!owned.current || event.source !== owned.current || !((_config$allowedMessag = config.allowedMessageOrigins) !== null && _config$allowedMessag !== void 0 && _config$allowedMessag.includes(event.origin)) || !config.messageValidator) return;
|
|
71
|
+
if (config.messageValidator(event)) (_config$onMessage = config.onMessage) === null || _config$onMessage === void 0 || _config$onMessage.call(config, event);
|
|
72
|
+
};
|
|
73
|
+
window.addEventListener('message', onMessage);
|
|
74
|
+
return () => {
|
|
75
|
+
var _owned$current3;
|
|
76
|
+
window.removeEventListener('message', onMessage);
|
|
77
|
+
clearMonitor();
|
|
78
|
+
if (latest.current.closeWindowOnUnmount !== false) (_owned$current3 = owned.current) === null || _owned$current3 === void 0 || _owned$current3.close();
|
|
79
|
+
owned.current = null;
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
82
|
+
return {
|
|
83
|
+
open,
|
|
84
|
+
close
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
exports.usePaymentRedirect = usePaymentRedirect;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
|
+
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
|
+
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
+
const IconCheck = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", _extends({
|
|
14
|
+
ref: ref,
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round",
|
|
22
|
+
className: `${classPrefix} ${classPrefix}-check`
|
|
23
|
+
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("path", {
|
|
24
|
+
d: "M5 13l4 4L19 7"
|
|
25
|
+
})));
|
|
26
|
+
IconCheck.displayName = 'IconCheck';
|
|
27
|
+
var _default = exports.default = IconCheck;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
|
+
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
|
+
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
+
const IconCopy = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", _extends({
|
|
14
|
+
ref: ref,
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
className: `${classPrefix} ${classPrefix}-copy`
|
|
21
|
+
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("rect", {
|
|
22
|
+
x: "9",
|
|
23
|
+
y: "9",
|
|
24
|
+
width: "13",
|
|
25
|
+
height: "13",
|
|
26
|
+
rx: "2"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",
|
|
29
|
+
strokeLinecap: "round"
|
|
30
|
+
})));
|
|
31
|
+
IconCopy.displayName = 'IconCopy';
|
|
32
|
+
var _default = exports.default = IconCopy;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _omit = _interopRequireDefault(require("../../utils/omit"));
|
|
9
|
+
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
|
+
const classPrefix = (0, _getPrefixCls.getPrefixCls)('icon');
|
|
13
|
+
const IconPix = /*#__PURE__*/_react.default.forwardRef((props, ref) => /*#__PURE__*/_react.default.createElement("svg", _extends({
|
|
14
|
+
ref: ref,
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
width: "1em",
|
|
17
|
+
height: "1em",
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
className: `${classPrefix} ${classPrefix}-pix`
|
|
21
|
+
}, (0, _omit.default)(props, ['className'])), /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M18.5 4.87a8.5 8.5 0 0 1 0 14.26L13.23 23a1.5 1.5 0 0 1-2.46 0L5.5 19.13A8.5 8.5 0 0 1 5.5 4.87L10.77 1a1.5 1.5 0 0 1 2.46 0l5.27 3.87z",
|
|
23
|
+
fill: "#32BCAD"
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
25
|
+
d: "M13.23 1a1.5 1.5 0 0 0-2.46 0L5.5 4.87a8.5 8.5 0 0 0 0 14.26l5.27 3.87a1.5 1.5 0 0 0 2.46 0l5.27-3.87a8.5 8.5 0 0 0 0-14.26L13.23 1z",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "#32BCAD",
|
|
28
|
+
strokeWidth: "0.5"
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
30
|
+
d: "M9.5 7.5h5l-5 9h5",
|
|
31
|
+
fill: "none",
|
|
32
|
+
stroke: "#fff",
|
|
33
|
+
strokeWidth: "1.8",
|
|
34
|
+
strokeLinecap: "round",
|
|
35
|
+
strokeLinejoin: "round"
|
|
36
|
+
})));
|
|
37
|
+
IconPix.displayName = 'IconPix';
|
|
38
|
+
var _default = exports.default = IconPix;
|
package/dist/lib/icons/index.js
CHANGED
|
@@ -11,7 +11,10 @@ var _exportNames = {
|
|
|
11
11
|
IconStripeText: true,
|
|
12
12
|
IconAlipay: true,
|
|
13
13
|
IconWechatPay: true,
|
|
14
|
-
IconPayssionPay: true
|
|
14
|
+
IconPayssionPay: true,
|
|
15
|
+
IconPix: true,
|
|
16
|
+
IconCopy: true,
|
|
17
|
+
IconCheck: true
|
|
15
18
|
};
|
|
16
19
|
Object.defineProperty(exports, "IconAlipay", {
|
|
17
20
|
enumerable: true,
|
|
@@ -19,12 +22,24 @@ Object.defineProperty(exports, "IconAlipay", {
|
|
|
19
22
|
return _IconAlipay.default;
|
|
20
23
|
}
|
|
21
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "IconCheck", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _IconCheck.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
22
31
|
Object.defineProperty(exports, "IconClose", {
|
|
23
32
|
enumerable: true,
|
|
24
33
|
get: function () {
|
|
25
34
|
return _IconClose.default;
|
|
26
35
|
}
|
|
27
36
|
});
|
|
37
|
+
Object.defineProperty(exports, "IconCopy", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _IconCopy.default;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
28
43
|
Object.defineProperty(exports, "IconPaypalText", {
|
|
29
44
|
enumerable: true,
|
|
30
45
|
get: function () {
|
|
@@ -43,6 +58,12 @@ Object.defineProperty(exports, "IconPayssionPay", {
|
|
|
43
58
|
return _IconPayssionPay.default;
|
|
44
59
|
}
|
|
45
60
|
});
|
|
61
|
+
Object.defineProperty(exports, "IconPix", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () {
|
|
64
|
+
return _IconPix.default;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
46
67
|
Object.defineProperty(exports, "IconStripe", {
|
|
47
68
|
enumerable: true,
|
|
48
69
|
get: function () {
|
|
@@ -81,4 +102,7 @@ var _IconStripeText = _interopRequireDefault(require("./IconStripeText"));
|
|
|
81
102
|
var _IconAlipay = _interopRequireDefault(require("./IconAlipay"));
|
|
82
103
|
var _IconWechatPay = _interopRequireDefault(require("./IconWechatPay"));
|
|
83
104
|
var _IconPayssionPay = _interopRequireDefault(require("./IconPayssionPay"));
|
|
105
|
+
var _IconPix = _interopRequireDefault(require("./IconPix"));
|
|
106
|
+
var _IconCopy = _interopRequireDefault(require("./IconCopy"));
|
|
107
|
+
var _IconCheck = _interopRequireDefault(require("./IconCheck"));
|
|
84
108
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|