pay-sdk-react 1.1.0 → 1.1.2

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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/dist/es/Airwallex/airwallex-modal.d.ts +4 -4
  4. package/dist/es/Airwallex/airwallex-modal.js +6 -6
  5. package/dist/es/Airwallex/airwallex-popup.d.ts +5 -5
  6. package/dist/es/Airwallex/airwallex-popup.js +13 -13
  7. package/dist/es/Airwallex/airwallex.d.ts +5 -5
  8. package/dist/es/Airwallex/airwallex.js +18 -24
  9. package/dist/es/Airwallex/interface.d.ts +59 -10
  10. package/dist/es/Alipay/alipay-button.d.ts +3 -3
  11. package/dist/es/Alipay/alipay-button.js +2 -2
  12. package/dist/es/Alipay/alipay-modal.d.ts +5 -5
  13. package/dist/es/Alipay/alipay-modal.js +6 -6
  14. package/dist/es/Alipay/alipay.d.ts +2 -2
  15. package/dist/es/Alipay/alipay.js +11 -9
  16. package/dist/es/Alipay/interface.d.ts +33 -14
  17. package/dist/es/Button/button.d.ts +1 -1
  18. package/dist/es/Button/interface.d.ts +65 -10
  19. package/dist/es/MAlipay/interface.d.ts +1 -6
  20. package/dist/es/MAlipay/m-alipay-auto-submit.d.ts +2 -2
  21. package/dist/es/MAlipay/m-alipay-auto-submit.js +2 -2
  22. package/dist/es/MAlipay/m-alipay-button.d.ts +3 -3
  23. package/dist/es/MAlipay/m-alipay-button.js +24 -13
  24. package/dist/es/MWeChat/interface.d.ts +1 -1
  25. package/dist/es/MWeChat/m-wechat-button.d.ts +3 -3
  26. package/dist/es/MWeChat/m-wechat-button.js +25 -13
  27. package/dist/es/Mask/interface.d.ts +6 -6
  28. package/dist/es/PayButton/index.d.ts +2 -2
  29. package/dist/es/PayButton/index.js +2 -2
  30. package/dist/es/Paypal/interface.d.ts +1 -1
  31. package/dist/es/Paypal/paypal-button.d.ts +3 -3
  32. package/dist/es/Paypal/paypal-button.js +2 -2
  33. package/dist/es/Payssion/interface.d.ts +1 -1
  34. package/dist/es/Payssion/payssion-button.d.ts +3 -3
  35. package/dist/es/Payssion/payssion-button.js +2 -2
  36. package/dist/es/Stripe/interface.d.ts +3 -3
  37. package/dist/es/Stripe/stripe-modal.d.ts +5 -5
  38. package/dist/es/Stripe/stripe-modal.js +3 -3
  39. package/dist/es/Stripe/stripe-popup.d.ts +4 -4
  40. package/dist/es/Stripe/stripe-popup.js +2 -2
  41. package/dist/es/Wechat/wechat-button.d.ts +3 -3
  42. package/dist/es/Wechat/wechat-button.js +2 -2
  43. package/dist/es/Wechat/wechat-modal.d.ts +6 -6
  44. package/dist/es/Wechat/wechat-modal.js +6 -6
  45. package/dist/es/Wechat/wechat.d.ts +2 -2
  46. package/dist/es/Wechat/wechat.js +2 -2
  47. package/dist/es/confirm-modal/index.d.ts +3 -3
  48. package/dist/es/confirm-modal/index.js +34 -15
  49. package/dist/es/dot-loading/interface.d.ts +6 -2
  50. package/dist/es/index.d.ts +2 -2
  51. package/dist/es/pay-modal/interface.d.ts +8 -18
  52. package/dist/es/pay-modal/pay-modal.js +26 -12
  53. package/dist/lib/Airwallex/airwallex-modal.js +9 -8
  54. package/dist/lib/Airwallex/airwallex-popup.js +13 -12
  55. package/dist/lib/Airwallex/airwallex.js +18 -23
  56. package/dist/lib/Alipay/alipay-button.js +1 -1
  57. package/dist/lib/Alipay/alipay-modal.js +3 -3
  58. package/dist/lib/Alipay/alipay.js +10 -8
  59. package/dist/lib/MAlipay/m-alipay-auto-submit.js +1 -1
  60. package/dist/lib/MAlipay/m-alipay-button.js +23 -12
  61. package/dist/lib/MWeChat/m-wechat-button.js +24 -12
  62. package/dist/lib/PayButton/index.js +3 -2
  63. package/dist/lib/Paypal/paypal-button.js +1 -1
  64. package/dist/lib/Payssion/payssion-button.js +1 -1
  65. package/dist/lib/Stripe/stripe-modal.js +6 -5
  66. package/dist/lib/Stripe/stripe-popup.js +5 -4
  67. package/dist/lib/Wechat/wechat-button.js +1 -1
  68. package/dist/lib/Wechat/wechat-modal.js +7 -6
  69. package/dist/lib/Wechat/wechat.js +1 -1
  70. package/dist/lib/confirm-modal/index.js +30 -11
  71. package/dist/lib/pay-modal/pay-modal.js +26 -12
  72. package/dist/umd/pay-sdk-react.umd.js +108 -79
  73. package/dist/umd/pay-sdk-react.umd.js.map +1 -1
  74. package/package.json +1 -1
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface MAlipayAutoSubmitProps {
3
3
  formHtml: string;
4
4
  }
5
- declare const MAlipayAutoSubmit: React.FC<MAlipayAutoSubmitProps>;
6
- export default MAlipayAutoSubmit;
5
+ declare const _default: React.NamedExoticComponent<MAlipayAutoSubmitProps>;
6
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { memo, useEffect } from 'react';
2
2
  const MAlipayAutoSubmit = _ref => {
3
3
  let {
4
4
  formHtml
@@ -34,4 +34,4 @@ const MAlipayAutoSubmit = _ref => {
34
34
  }, [formHtml]);
35
35
  return null; // 这个组件不渲染任何内容
36
36
  };
37
- export default MAlipayAutoSubmit;
37
+ export default /*#__PURE__*/memo(MAlipayAutoSubmit);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MAlipayButtonProps } from './interface';
3
- declare const MAlipayButton: React.ForwardRefExoticComponent<MAlipayButtonProps & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MAlipayButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>;
6
- export default MAlipayButton;
5
+ } & React.RefAttributes<import("../Button").ButtonRef>>>;
6
+ export default _default;
@@ -1,10 +1,15 @@
1
1
  const _excluded = ["className", "children", "onClick", "formHtml", "createOrder", "displayType", "modalProps", "maskProps"],
2
- _excluded2 = ["onFinish", "onRetry", "onClose"],
2
+ _excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
3
3
  _excluded3 = ["onClose"];
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
8
+ 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); }
4
9
  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); }
5
10
  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; }
6
11
  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; }
7
- import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
12
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
8
13
  import cs from '../utils/classNames';
9
14
  import MAlipayAutoSubmit from './m-alipay-auto-submit';
10
15
  import ConfirmModal from '../confirm-modal';
@@ -27,8 +32,8 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
27
32
  others = _objectWithoutProperties(props, _excluded);
28
33
  const _ref = modalProps || {},
29
34
  {
30
- onFinish,
31
- onRetry,
35
+ retryButtonProps,
36
+ finishButtonProps,
32
37
  onClose
33
38
  } = _ref,
34
39
  modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
@@ -44,18 +49,20 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
44
49
  const [showMask, setShowMask] = useState(false);
45
50
  const [showModal, setShowModal] = useState(false);
46
51
  useImperativeHandle(ref, () => mAlipayButtonRef.current);
47
- const handleRetry = useCallback(() => {
52
+ const handleRetry = useCallback(event => {
48
53
  if (displayType === 'modal') {
49
- onRetry === null || onRetry === void 0 || onRetry();
54
+ var _retryButtonProps$onC;
55
+ retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
50
56
  setShowModal(false);
51
57
  }
52
- }, [onRetry, displayType]);
53
- const handleFinish = useCallback(() => {
58
+ }, [retryButtonProps, displayType]);
59
+ const handleFinish = useCallback(event => {
54
60
  if (displayType === 'modal') {
55
- onFinish === null || onFinish === void 0 || onFinish();
61
+ var _finishButtonProps$on;
62
+ finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
56
63
  setShowModal(false);
57
64
  }
58
- }, [onFinish, displayType]);
65
+ }, [finishButtonProps, displayType]);
59
66
  const handleDisplay = useCallback(() => {
60
67
  if (displayType === 'modal') {
61
68
  setShowModal(true);
@@ -108,8 +115,12 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
108
115
  formHtml: formHtmlString
109
116
  }), displayType === 'modal' && formHtmlString && /*#__PURE__*/React.createElement(ConfirmModal, _extends({
110
117
  visible: showModal,
111
- onRetry: handleRetry,
112
- onFinish: handleFinish,
118
+ retryButtonProps: _objectSpread({
119
+ onClick: handleRetry
120
+ }, omit(retryButtonProps || {}, ['onClick'])),
121
+ finishButtonProps: _objectSpread({
122
+ onClick: handleFinish
123
+ }, omit(finishButtonProps || {}, ['onClick'])),
113
124
  onClose: handleOnCloseModal,
114
125
  autoOpenWindow: false
115
126
  }, modalPropsOthers)), showMask && formHtmlString && /*#__PURE__*/React.createElement(PayMask, _extends({
@@ -124,4 +135,4 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
124
135
  }, restMaskProps)));
125
136
  });
126
137
  MAlipayButton.displayName = 'MAlipayButton';
127
- export default MAlipayButton;
138
+ export default /*#__PURE__*/memo(MAlipayButton);
@@ -2,7 +2,7 @@ import { ButtonProps, ButtonRef } from '../Button';
2
2
  import { PayMaskProps } from '../PayMask';
3
3
  import { ConfirmModalProps } from '../confirm-modal';
4
4
  /**
5
- * @version 1.0.0
5
+ * @version 1.1.0
6
6
  * @description
7
7
  * @zh Paypal 组件属性定义
8
8
  * @en Props for Paypal component
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MWeChatButtonProps } from './interface';
3
- declare const MWechatButton: React.ForwardRefExoticComponent<MWeChatButtonProps & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MWeChatButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>;
6
- export default MWechatButton;
5
+ } & React.RefAttributes<import("../Button").ButtonRef>>>;
6
+ export default _default;
@@ -1,16 +1,22 @@
1
1
  const _excluded = ["className", "children", "onClick", "wechatUrl", "createOrder", "displayType", "modalProps", "maskProps"],
2
- _excluded2 = ["onFinish", "onRetry", "onClose"],
2
+ _excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
3
3
  _excluded3 = ["onClose"];
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
8
+ 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); }
4
9
  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); }
5
10
  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; }
6
11
  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; }
7
- import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
12
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
8
13
  import cs from '../utils/classNames';
9
14
  import PayMask from '../PayMask';
10
15
  import ConfirmModal from '../confirm-modal';
11
16
  import Button from '../Button';
12
17
  import { IconWechatPay } from '../icons';
13
18
  import { getPrefixCls } from '../utils/getPrefixCls';
19
+ import omit from '../utils/omit';
14
20
  const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
15
21
  const {
16
22
  className,
@@ -25,8 +31,8 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
25
31
  others = _objectWithoutProperties(props, _excluded);
26
32
  const _ref = modalProps || {},
27
33
  {
28
- onFinish,
29
- onRetry,
34
+ retryButtonProps,
35
+ finishButtonProps,
30
36
  onClose
31
37
  } = _ref,
32
38
  modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
@@ -42,18 +48,20 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
42
48
  const [showModal, setShowModal] = useState(false);
43
49
  const [wechatUrl, setWechatUrl] = useState();
44
50
  useImperativeHandle(ref, () => mWeChatButtonRef.current);
45
- const handleRetry = useCallback(() => {
51
+ const handleRetry = useCallback(event => {
46
52
  if (displayType === 'modal') {
47
- onRetry === null || onRetry === void 0 || onRetry();
53
+ var _retryButtonProps$onC;
54
+ retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
48
55
  setShowModal(false);
49
56
  }
50
- }, [onRetry, displayType]);
51
- const handleFinish = useCallback(() => {
57
+ }, [retryButtonProps, displayType]);
58
+ const handleFinish = useCallback(event => {
52
59
  if (displayType === 'modal') {
53
- onFinish === null || onFinish === void 0 || onFinish();
60
+ var _finishButtonProps$on;
61
+ finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
54
62
  setShowModal(false);
55
63
  }
56
- }, [onFinish, displayType]);
64
+ }, [finishButtonProps, displayType]);
57
65
  const handleDisplay = useCallback(() => {
58
66
  if (displayType === 'modal') {
59
67
  setShowModal(true);
@@ -107,11 +115,15 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
107
115
  }, restMaskProps)), displayType === 'modal' && showModal && wechatUrl && /*#__PURE__*/React.createElement(ConfirmModal, _extends({
108
116
  visible: showModal,
109
117
  onClose: handleOnCloseModal,
110
- onRetry: handleRetry,
111
- onFinish: handleFinish,
118
+ retryButtonProps: _objectSpread({
119
+ onClick: handleRetry
120
+ }, omit(retryButtonProps || {}, ['onClick'])),
121
+ finishButtonProps: _objectSpread({
122
+ onClick: handleFinish
123
+ }, omit(finishButtonProps || {}, ['onClick'])),
112
124
  payUrl: wechatUrl,
113
125
  autoOpenWindow: true
114
126
  }, modalPropsOthers)));
115
127
  });
116
128
  MWechatButton.displayName = 'MWechatButton';
117
- export default MWechatButton;
129
+ export default /*#__PURE__*/memo(MWechatButton);
@@ -1,8 +1,8 @@
1
- import React from "react";
2
- import { PropagationEvent } from "../utils/with-stop-propagation";
3
- import { GetContainer } from "../utils/render-to-container";
1
+ import React from 'react';
2
+ import { PropagationEvent } from '../utils/with-stop-propagation';
3
+ import { GetContainer } from '../utils/render-to-container';
4
4
  /**
5
- * @version 1.0.0
5
+ * @version 1.1.0
6
6
  * @description
7
7
  * @zh 蒙层组件属性定义
8
8
  * @en Props for Mask component
@@ -52,12 +52,12 @@ export interface MaskProps {
52
52
  * @zh 蒙层颜色
53
53
  * @en Mask color
54
54
  */
55
- color?: "white" | "black" | (string & {});
55
+ color?: 'white' | 'black' | (string & {});
56
56
  /**
57
57
  * @zh 蒙层透明度
58
58
  * @en Mask opacity
59
59
  */
60
- opacity?: "default" | "thin" | "thick" | number;
60
+ opacity?: 'default' | 'thin' | 'thick' | number;
61
61
  /**
62
62
  * @zh 挂载容器
63
63
  * @en Mount container
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PayButtonProps } from './interface';
3
- declare const PayButton: React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>;
4
3
  export * from './interface';
5
- export default PayButton;
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>>;
5
+ export default _default;
@@ -1,5 +1,5 @@
1
1
  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); }
2
- import React from 'react';
2
+ import React, { memo } from 'react';
3
3
  import { PaymentMethod } from '../shared';
4
4
  import { PaypalButton } from '../Paypal';
5
5
  import Stripe from '../Stripe';
@@ -54,4 +54,4 @@ const PayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
54
54
  });
55
55
  PayButton.displayName = 'PayButton';
56
56
  export * from './interface';
57
- export default PayButton;
57
+ export default /*#__PURE__*/memo(PayButton);
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps, ButtonRef } from '../Button';
2
2
  import { PayMaskProps } from '../PayMask';
3
3
  /**
4
- * @version 1.0.0
4
+ * @version 1.1.0
5
5
  * @description
6
6
  * @zh Paypal 组件属性定义
7
7
  * @en Props for Paypal component
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PaypalButtonProps } from './interface';
3
- declare const PaypalButton: React.ForwardRefExoticComponent<PaypalButtonProps & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PaypalButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>;
6
- export default PaypalButton;
5
+ } & React.RefAttributes<import("../Button").ButtonRef>>>;
6
+ export default _default;
@@ -3,7 +3,7 @@ const _excluded = ["className", "children", "onClick", "paypalUrl", "createOrder
3
3
  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); }
4
4
  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; }
5
5
  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; }
6
- import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
6
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
7
7
  import { IconPaypalText, IconPaypalWhite } from '../icons';
8
8
  import cs from '../utils/classNames';
9
9
  import PayMask from '../PayMask';
@@ -72,4 +72,4 @@ const PaypalButton = /*#__PURE__*/forwardRef((props, ref) => {
72
72
  }, restMaskProps)));
73
73
  });
74
74
  PaypalButton.displayName = 'PaypalButton';
75
- export default PaypalButton;
75
+ export default /*#__PURE__*/memo(PaypalButton);
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps, ButtonRef } from '../Button';
2
2
  import { PayMaskProps } from '../PayMask';
3
3
  /**
4
- * @version 1.0.0
4
+ * @version 1.1.0
5
5
  * @description
6
6
  * @zh Paypal 组件属性定义
7
7
  * @en Props for Paypal component
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PayssionButtonProps } from './interface';
3
- declare const PayssionButton: React.ForwardRefExoticComponent<PayssionButtonProps & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PayssionButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>;
6
- export default PayssionButton;
5
+ } & React.RefAttributes<import("../Button").ButtonRef>>>;
6
+ export default _default;
@@ -3,7 +3,7 @@ const _excluded = ["className", "children", "onClick", "payssionUrl", "createOrd
3
3
  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); }
4
4
  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; }
5
5
  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; }
6
- import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
6
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
7
7
  import cs from '../utils/classNames';
8
8
  import PayMask from '../PayMask';
9
9
  import Button from '../Button';
@@ -72,4 +72,4 @@ const PayssionButton = /*#__PURE__*/forwardRef((props, ref) => {
72
72
  }, restMaskProps)));
73
73
  });
74
74
  PayssionButton.displayName = 'PayssionButton';
75
- export default PayssionButton;
75
+ export default /*#__PURE__*/memo(PayssionButton);
@@ -15,14 +15,14 @@ export interface BasesStripeProps {
15
15
  stripeKey: string;
16
16
  }
17
17
  /**
18
- * @version 1.0.0
18
+ * @version 1.1.0
19
19
  * @description
20
20
  * @zh Stripe 组件属性定义,包含基础属性和原生 div 属性
21
21
  * @en Props for Stripe component, including base props and native div attributes
22
22
  */
23
23
  export type StripeProps = BasesStripeProps & HTMLAttributes<HTMLDivElement>;
24
24
  /**
25
- * @version 1.0.0
25
+ * @version 1.1.0
26
26
  * @description
27
27
  * @zh Stripe 弹窗组件属性定义
28
28
  * @en Props for Stripe popup component
@@ -35,7 +35,7 @@ export interface StripePopupProps extends PayPopupBaseProps {
35
35
  stripeProps?: BasesStripeProps;
36
36
  }
37
37
  /**
38
- * @version 1.0.0
38
+ * @version 1.1.0
39
39
  * @description
40
40
  * @zh Stripe 弹窗组件 Ref 实例方法
41
41
  * @en Ref methods for Stripe popup component
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { StripeModalProps } from './interface';
3
- declare const StripeModal: import("react").ForwardRefExoticComponent<StripeModalProps & {
4
- children?: import("react").ReactNode;
5
- } & import("react").RefAttributes<import("./interface").StripePopupRef>>;
6
- export default StripeModal;
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<StripeModalProps & {
4
+ children?: React.ReactNode;
5
+ } & React.RefAttributes<import("./interface").StripePopupRef>>>;
6
+ export default _default;
@@ -2,12 +2,12 @@ const _excluded = ["stripeProps", "visible", "onClose", "className"];
2
2
  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); }
3
3
  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; }
4
4
  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; }
5
- import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
5
+ import React, { memo, useImperativeHandle, useRef, useState } from 'react';
6
6
  import cs from '../utils/classNames';
7
7
  import PayModal from '../pay-modal';
8
8
  import Stripe from './stripe';
9
9
  import { getPrefixCls } from '../utils/getPrefixCls';
10
- const StripeModal = /*#__PURE__*/forwardRef((props, ref) => {
10
+ const StripeModal = /*#__PURE__*/React.forwardRef((props, ref) => {
11
11
  const {
12
12
  stripeProps: propsStripeProps,
13
13
  visible,
@@ -47,4 +47,4 @@ const StripeModal = /*#__PURE__*/forwardRef((props, ref) => {
47
47
  }, rest), _stripeProps && /*#__PURE__*/React.createElement(Stripe, _stripeProps));
48
48
  });
49
49
  StripeModal.displayName = 'StripeModal';
50
- export default StripeModal;
50
+ export default /*#__PURE__*/memo(StripeModal);
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { StripePopupProps, StripePopupRef } from './interface';
3
- declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<StripePopupProps & {
4
- children?: import("react").ReactNode;
5
- } & import("react").RefAttributes<StripePopupRef>>>;
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<StripePopupProps & {
4
+ children?: React.ReactNode;
5
+ } & React.RefAttributes<StripePopupRef>>>;
6
6
  export default _default;
@@ -7,12 +7,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  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); }
8
8
  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; }
9
9
  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; }
10
- import { forwardRef, memo, useImperativeHandle, useRef, useState } from 'react';
10
+ import React, { memo, useImperativeHandle, useRef, useState } from 'react';
11
11
  import cs from '../utils/classNames';
12
12
  import Stripe from '.';
13
13
  import PayPopup from '../pay-popup';
14
14
  import { getPrefixCls } from '../utils/getPrefixCls';
15
- const StripePopup = /*#__PURE__*/forwardRef((props, ref) => {
15
+ const StripePopup = /*#__PURE__*/React.forwardRef((props, ref) => {
16
16
  const {
17
17
  visible: controlledVisible,
18
18
  onClose,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { WechatButtonProps } from './interface';
3
- declare const WechatButton: React.ForwardRefExoticComponent<WechatButtonProps & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WechatButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>;
6
- export default WechatButton;
5
+ } & React.RefAttributes<import("../Button").ButtonRef>>>;
6
+ export default _default;
@@ -2,7 +2,7 @@ const _excluded = ["className", "children", "onClick", "createOrder", "modalProp
2
2
  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); }
3
3
  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; }
4
4
  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; }
5
- import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
5
+ import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react';
6
6
  import cs from '../utils/classNames';
7
7
  import WechatModal from './wechat-modal';
8
8
  import Button from '../Button';
@@ -47,4 +47,4 @@ const WechatButton = /*#__PURE__*/forwardRef((props, ref) => {
47
47
  }, modalProps)));
48
48
  });
49
49
  WechatButton.displayName = 'WechatButton';
50
- export default WechatButton;
50
+ export default /*#__PURE__*/memo(WechatButton);
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
- import { WechatModalProps, WechatModalRef } from "./interface";
3
- declare const WechatModal: import("react").ForwardRefExoticComponent<WechatModalProps & {
4
- children?: import("react").ReactNode;
5
- } & import("react").RefAttributes<WechatModalRef>>;
6
- export default WechatModal;
1
+ import React from 'react';
2
+ import { WechatModalProps, WechatModalRef } from './interface';
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WechatModalProps & {
4
+ children?: React.ReactNode;
5
+ } & React.RefAttributes<WechatModalRef>>>;
6
+ export default _default;
@@ -2,10 +2,10 @@ const _excluded = ["wechatProps", "visible", "onClose"];
2
2
  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); }
3
3
  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; }
4
4
  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; }
5
- import { forwardRef, useImperativeHandle, useRef, useState } from "react";
6
- import PayModal from "../pay-modal";
7
- import Wechat from "./wechat";
8
- const WechatModal = /*#__PURE__*/forwardRef((props, ref) => {
5
+ import React, { memo, useImperativeHandle, useRef, useState } from 'react';
6
+ import PayModal from '../pay-modal';
7
+ import Wechat from './wechat';
8
+ const WechatModal = /*#__PURE__*/React.forwardRef((props, ref) => {
9
9
  const {
10
10
  wechatProps: propsWechatProps,
11
11
  visible,
@@ -41,5 +41,5 @@ const WechatModal = /*#__PURE__*/forwardRef((props, ref) => {
41
41
  }
42
42
  }, others), (_wechatProps === null || _wechatProps === void 0 ? void 0 : _wechatProps.wechatUrl) && /*#__PURE__*/React.createElement(Wechat, _wechatProps));
43
43
  });
44
- WechatModal.displayName = "WechatModal";
45
- export default WechatModal;
44
+ WechatModal.displayName = 'WechatModal';
45
+ export default /*#__PURE__*/memo(WechatModal);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { WechatProps } from './interface';
3
- declare const WechatQrCode: React.FC<WechatProps>;
4
- export default WechatQrCode;
3
+ declare const _default: React.NamedExoticComponent<WechatProps>;
4
+ export default _default;
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { memo, useEffect, useState } from 'react';
2
2
  import cs from '../utils/classNames';
3
3
  import makeQrcode from '../utils/qrcode';
4
4
  import { getPrefixCls } from '../utils/getPrefixCls';
@@ -37,4 +37,4 @@ const WechatQrCode = _ref => {
37
37
  className: "".concat(classPrefix, "__tip")
38
38
  }, tipText));
39
39
  };
40
- export default WechatQrCode;
40
+ export default /*#__PURE__*/memo(WechatQrCode);
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { ConfirmModalProps } from "./interface";
1
+ import React from 'react';
2
+ import { ConfirmModalProps } from './interface';
3
3
  declare const ConfirmModal: React.FC<ConfirmModalProps>;
4
- export * from "./interface";
4
+ export * from './interface';
5
5
  export default ConfirmModal;
@@ -1,15 +1,22 @@
1
- import React, { useCallback } from "react";
2
- import { usePayWindowOpen } from "../hooks/usePayWindowOpen";
3
- import PayModal from "../pay-modal";
1
+ const _excluded = ["children"],
2
+ _excluded2 = ["children"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7
+ 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); }
8
+ 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; }
9
+ 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; }
10
+ import React, { useCallback } from 'react';
11
+ import { usePayWindowOpen } from '../hooks/usePayWindowOpen';
12
+ import PayModal from '../pay-modal';
4
13
  const ConfirmModal = props => {
5
14
  const {
6
15
  visible,
7
- onRetry,
8
- onFinish,
9
- title = "支付确认",
16
+ title = '支付确认',
10
17
  desc = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "1. \u5982\u679C\u60A8\u5DF2\u5B8C\u6210\u652F\u4ED8\uFF0C\u8BF7\u70B9\u51FB[\u652F\u4ED8\u5B8C\u6210]"), /*#__PURE__*/React.createElement("div", null, "2. \u5982\u679C\u672A\u652F\u4ED8\u6210\u529F\uFF0C\u53EF\u70B9\u51FB[\u91CD\u65B0\u652F\u4ED8]")),
11
- retryText = "重新支付",
12
- finishText = "支付完成",
18
+ retryButtonProps,
19
+ finishButtonProps,
13
20
  icon = /*#__PURE__*/React.createElement("span", {
14
21
  role: "img",
15
22
  "aria-label": "success"
@@ -19,12 +26,22 @@ const ConfirmModal = props => {
19
26
  onClose,
20
27
  payUrl,
21
28
  autoOpenWindow = false,
22
- openMode = "window"
29
+ openMode = 'window'
23
30
  } = props;
31
+ const _ref = retryButtonProps || {},
32
+ {
33
+ children: retryButtonChildren = '重新支付'
34
+ } = _ref,
35
+ retryButtonPropsRest = _objectWithoutProperties(_ref, _excluded);
36
+ const _ref2 = finishButtonProps || {},
37
+ {
38
+ children: finishButtonChildren = '支付完成'
39
+ } = _ref2,
40
+ finishButtonPropsRest = _objectWithoutProperties(_ref2, _excluded2);
24
41
  const {
25
42
  closeWindow
26
43
  } = usePayWindowOpen({
27
- payUrl: payUrl || "",
44
+ payUrl: payUrl || '',
28
45
  onClose,
29
46
  autoOpen: autoOpenWindow,
30
47
  openMode: openMode
@@ -42,11 +59,13 @@ const ConfirmModal = props => {
42
59
  showClose: showClose,
43
60
  maskClosable: maskClosable,
44
61
  onClose: handleClose,
45
- onRetry: onRetry,
46
- onFinish: onFinish,
47
- retryText: retryText,
48
- finishText: finishText
62
+ retryButtonProps: _objectSpread({
63
+ children: retryButtonChildren
64
+ }, retryButtonPropsRest),
65
+ finishButtonProps: _objectSpread({
66
+ children: finishButtonChildren
67
+ }, finishButtonPropsRest)
49
68
  });
50
69
  };
51
- export * from "./interface";
70
+ export * from './interface';
52
71
  export default ConfirmModal;
@@ -1,4 +1,8 @@
1
- import type { NativeProps } from "../utils/native-props";
1
+ import type { NativeProps } from '../utils/native-props';
2
2
  export type DotLoadingProps = {
3
- color?: "default" | "primary" | "white" | (string & {});
3
+ /**
4
+ * @zh 颜色
5
+ * @en Color
6
+ */
7
+ color?: 'default' | 'primary' | 'white' | (string & {});
4
8
  } & NativeProps;