@blocklet/payment-react 1.18.56 → 1.19.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.
Files changed (220) hide show
  1. package/es/checkout/donate.d.ts +1 -15
  2. package/es/checkout/donate.js +301 -189
  3. package/es/checkout/form.d.ts +1 -15
  4. package/es/checkout/form.js +5 -13
  5. package/es/checkout/table.js +3 -3
  6. package/es/components/blockchain/gas.d.ts +1 -5
  7. package/es/components/blockchain/gas.js +10 -2
  8. package/es/components/blockchain/tx.d.ts +1 -8
  9. package/es/components/blockchain/tx.js +28 -7
  10. package/es/components/confirm.d.ts +1 -10
  11. package/es/components/confirm.js +4 -10
  12. package/es/components/country-select.d.ts +3 -2
  13. package/es/components/country-select.js +375 -352
  14. package/es/components/input.d.ts +11 -20
  15. package/es/components/input.js +46 -43
  16. package/es/components/lazy-loader.js +1 -2
  17. package/es/components/link.d.ts +2 -9
  18. package/es/components/link.js +9 -6
  19. package/es/components/livemode.d.ts +2 -8
  20. package/es/components/livemode.js +1 -5
  21. package/es/components/loading-button.d.ts +6 -1
  22. package/es/components/loading-button.js +56 -66
  23. package/es/components/over-due-invoice-payment.d.ts +0 -18
  24. package/es/components/over-due-invoice-payment.js +138 -95
  25. package/es/components/payment-beneficiaries.d.ts +2 -7
  26. package/es/components/payment-beneficiaries.js +86 -40
  27. package/es/components/pricing-item.d.ts +0 -5
  28. package/es/components/pricing-item.js +1 -4
  29. package/es/components/pricing-table.d.ts +2 -10
  30. package/es/components/pricing-table.js +8 -7
  31. package/es/components/resume-subscription.d.ts +0 -10
  32. package/es/components/resume-subscription.js +42 -21
  33. package/es/components/truncated-text.d.ts +2 -9
  34. package/es/components/truncated-text.js +0 -5
  35. package/es/contexts/donate.d.ts +0 -7
  36. package/es/contexts/donate.js +10 -8
  37. package/es/contexts/payment.d.ts +1 -4
  38. package/es/contexts/payment.js +7 -2
  39. package/es/history/invoice/list.d.ts +2 -18
  40. package/es/history/invoice/list.js +151 -73
  41. package/es/history/payment/list.js +115 -38
  42. package/es/hooks/keyboard.d.ts +1 -1
  43. package/es/hooks/keyboard.js +2 -4
  44. package/es/libs/cached-request.js +2 -4
  45. package/es/libs/phone-validator.js +1 -2
  46. package/es/libs/util.js +2 -4
  47. package/es/libs/validator.js +2 -4
  48. package/es/payment/amount.d.ts +2 -7
  49. package/es/payment/amount.js +1 -5
  50. package/es/payment/donation-form.d.ts +2 -10
  51. package/es/payment/donation-form.js +196 -160
  52. package/es/payment/error.d.ts +2 -8
  53. package/es/payment/error.js +40 -20
  54. package/es/payment/footer.d.ts +2 -3
  55. package/es/payment/footer.js +19 -6
  56. package/es/payment/form/addon.js +14 -4
  57. package/es/payment/form/address.d.ts +2 -9
  58. package/es/payment/form/address.js +3 -6
  59. package/es/payment/form/currency.js +45 -25
  60. package/es/payment/form/index.d.ts +2 -8
  61. package/es/payment/form/index.js +107 -65
  62. package/es/payment/form/phone.js +2 -4
  63. package/es/payment/form/stripe/form.d.ts +2 -8
  64. package/es/payment/form/stripe/form.js +1 -3
  65. package/es/payment/header.js +38 -16
  66. package/es/payment/index.d.ts +2 -9
  67. package/es/payment/index.js +5 -14
  68. package/es/payment/product-card.d.ts +2 -11
  69. package/es/payment/product-card.js +84 -50
  70. package/es/payment/product-donation.js +175 -114
  71. package/es/payment/product-item.d.ts +2 -9
  72. package/es/payment/product-item.js +185 -142
  73. package/es/payment/product-skeleton.js +2 -2
  74. package/es/payment/skeleton/donation.js +27 -7
  75. package/es/payment/skeleton/overview.js +22 -2
  76. package/es/payment/skeleton/payment.js +33 -5
  77. package/es/payment/success.d.ts +2 -9
  78. package/es/payment/success.js +41 -14
  79. package/es/payment/summary.d.ts +2 -17
  80. package/es/payment/summary.js +184 -111
  81. package/es/theme/index.d.ts +0 -5
  82. package/es/theme/index.js +2 -5
  83. package/es/theme/typography.d.ts +2 -2
  84. package/lib/checkout/donate.d.ts +1 -15
  85. package/lib/checkout/donate.js +75 -54
  86. package/lib/checkout/form.d.ts +1 -15
  87. package/lib/checkout/form.js +7 -15
  88. package/lib/checkout/table.js +4 -4
  89. package/lib/components/blockchain/gas.d.ts +1 -5
  90. package/lib/components/blockchain/gas.js +3 -2
  91. package/lib/components/blockchain/tx.d.ts +1 -8
  92. package/lib/components/blockchain/tx.js +11 -7
  93. package/lib/components/confirm.d.ts +1 -10
  94. package/lib/components/confirm.js +5 -11
  95. package/lib/components/country-select.d.ts +3 -2
  96. package/lib/components/country-select.js +23 -22
  97. package/lib/components/input.d.ts +11 -20
  98. package/lib/components/input.js +20 -23
  99. package/lib/components/lazy-loader.js +1 -1
  100. package/lib/components/link.d.ts +2 -9
  101. package/lib/components/link.js +3 -8
  102. package/lib/components/livemode.d.ts +2 -8
  103. package/lib/components/livemode.js +3 -7
  104. package/lib/components/loading-button.d.ts +6 -1
  105. package/lib/components/loading-button.js +9 -17
  106. package/lib/components/over-due-invoice-payment.d.ts +0 -18
  107. package/lib/components/over-due-invoice-payment.js +31 -33
  108. package/lib/components/payment-beneficiaries.d.ts +2 -7
  109. package/lib/components/payment-beneficiaries.js +12 -11
  110. package/lib/components/pricing-item.d.ts +0 -5
  111. package/lib/components/pricing-item.js +2 -5
  112. package/lib/components/pricing-table.d.ts +2 -10
  113. package/lib/components/pricing-table.js +5 -11
  114. package/lib/components/resume-subscription.d.ts +0 -10
  115. package/lib/components/resume-subscription.js +16 -16
  116. package/lib/components/table.js +1 -1
  117. package/lib/components/truncated-text.d.ts +2 -9
  118. package/lib/components/truncated-text.js +1 -6
  119. package/lib/contexts/donate.d.ts +0 -7
  120. package/lib/contexts/donate.js +4 -7
  121. package/lib/contexts/payment.d.ts +1 -4
  122. package/lib/contexts/payment.js +4 -7
  123. package/lib/history/invoice/list.d.ts +2 -18
  124. package/lib/history/invoice/list.js +49 -37
  125. package/lib/history/payment/list.js +30 -16
  126. package/lib/hooks/keyboard.d.ts +1 -1
  127. package/lib/hooks/mobile.js +1 -1
  128. package/lib/hooks/subscription.js +1 -1
  129. package/lib/index.js +2 -2
  130. package/lib/libs/api.js +1 -1
  131. package/lib/libs/dayjs.js +1 -1
  132. package/lib/libs/phone-validator.js +0 -2
  133. package/lib/libs/theme.js +1 -1
  134. package/lib/libs/util.js +1 -1
  135. package/lib/libs/validator.js +1 -1
  136. package/lib/locales/en.js +1 -1
  137. package/lib/locales/index.js +1 -1
  138. package/lib/locales/zh.js +1 -1
  139. package/lib/payment/amount.d.ts +2 -7
  140. package/lib/payment/amount.js +2 -6
  141. package/lib/payment/donation-form.d.ts +2 -10
  142. package/lib/payment/donation-form.js +33 -38
  143. package/lib/payment/error.d.ts +2 -8
  144. package/lib/payment/error.js +11 -13
  145. package/lib/payment/footer.d.ts +2 -3
  146. package/lib/payment/footer.js +5 -5
  147. package/lib/payment/form/addon.js +5 -3
  148. package/lib/payment/form/address.d.ts +2 -9
  149. package/lib/payment/form/address.js +5 -8
  150. package/lib/payment/form/currency.js +3 -3
  151. package/lib/payment/form/index.d.ts +2 -8
  152. package/lib/payment/form/index.js +19 -15
  153. package/lib/payment/form/phone.js +1 -1
  154. package/lib/payment/form/stripe/form.d.ts +2 -8
  155. package/lib/payment/form/stripe/form.js +3 -6
  156. package/lib/payment/header.js +8 -4
  157. package/lib/payment/index.d.ts +2 -9
  158. package/lib/payment/index.js +7 -16
  159. package/lib/payment/product-card.d.ts +2 -11
  160. package/lib/payment/product-card.js +13 -20
  161. package/lib/payment/product-donation.js +71 -66
  162. package/lib/payment/product-item.d.ts +2 -9
  163. package/lib/payment/product-item.js +24 -25
  164. package/lib/payment/product-skeleton.js +2 -2
  165. package/lib/payment/skeleton/donation.js +8 -4
  166. package/lib/payment/skeleton/overview.js +6 -2
  167. package/lib/payment/skeleton/payment.js +9 -3
  168. package/lib/payment/success.d.ts +2 -9
  169. package/lib/payment/success.js +12 -15
  170. package/lib/payment/summary.d.ts +2 -17
  171. package/lib/payment/summary.js +44 -45
  172. package/lib/theme/index.d.ts +0 -5
  173. package/lib/theme/index.js +2 -5
  174. package/lib/theme/typography.d.ts +2 -2
  175. package/package.json +40 -40
  176. package/src/checkout/donate.tsx +103 -35
  177. package/src/checkout/form.tsx +5 -14
  178. package/src/checkout/table.tsx +3 -3
  179. package/src/components/blockchain/gas.tsx +5 -3
  180. package/src/components/blockchain/tx.tsx +22 -8
  181. package/src/components/confirm.tsx +4 -11
  182. package/src/components/country-select.tsx +391 -378
  183. package/src/components/input.tsx +49 -45
  184. package/src/components/link.tsx +9 -7
  185. package/src/components/livemode.tsx +2 -6
  186. package/src/components/loading-button.tsx +63 -76
  187. package/src/components/over-due-invoice-payment.tsx +43 -28
  188. package/src/components/payment-beneficiaries.tsx +33 -14
  189. package/src/components/pricing-item.tsx +1 -4
  190. package/src/components/pricing-table.tsx +8 -8
  191. package/src/components/resume-subscription.tsx +20 -14
  192. package/src/components/table.tsx +2 -2
  193. package/src/components/truncated-text.tsx +0 -6
  194. package/src/contexts/donate.tsx +6 -7
  195. package/src/contexts/payment.tsx +7 -3
  196. package/src/history/invoice/list.tsx +74 -35
  197. package/src/history/payment/list.tsx +53 -16
  198. package/src/hooks/keyboard.ts +1 -1
  199. package/src/payment/amount.tsx +1 -6
  200. package/src/payment/donation-form.tsx +47 -29
  201. package/src/payment/error.tsx +16 -8
  202. package/src/payment/footer.tsx +11 -3
  203. package/src/payment/form/addon.tsx +6 -1
  204. package/src/payment/form/address.tsx +3 -7
  205. package/src/payment/form/currency.tsx +12 -2
  206. package/src/payment/form/index.tsx +30 -12
  207. package/src/payment/form/stripe/form.tsx +1 -5
  208. package/src/payment/header.tsx +14 -2
  209. package/src/payment/index.tsx +10 -21
  210. package/src/payment/product-card.tsx +41 -18
  211. package/src/payment/product-donation.tsx +85 -47
  212. package/src/payment/product-item.tsx +46 -24
  213. package/src/payment/product-skeleton.tsx +3 -2
  214. package/src/payment/skeleton/donation.tsx +12 -2
  215. package/src/payment/skeleton/overview.tsx +12 -2
  216. package/src/payment/skeleton/payment.tsx +16 -3
  217. package/src/payment/success.tsx +26 -15
  218. package/src/payment/summary.tsx +74 -42
  219. package/src/theme/index.tsx +5 -8
  220. package/src/theme/typography.ts +2 -2
@@ -13,6 +13,7 @@ function getHeightStyle(mode) {
13
13
  height: "100vh",
14
14
  maxHeight: "100%"
15
15
  };
16
+ // 独立模式下,高度为100vh
16
17
  default:
17
18
  return {
18
19
  height: "auto",
@@ -23,21 +24,22 @@ function getHeightStyle(mode) {
23
24
  function PaymentError({
24
25
  title,
25
26
  description,
26
- button,
27
- mode
27
+ button = "Back",
28
+ mode = "standalone"
28
29
  }) {
29
30
  const heightStyle = getHeightStyle(mode);
30
31
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
31
- sx: heightStyle,
32
- alignItems: "center",
33
- justifyContent: "center",
32
+ sx: [{
33
+ alignItems: "center",
34
+ justifyContent: "center"
35
+ }, ...(Array.isArray(heightStyle) ? heightStyle : [heightStyle])],
34
36
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
37
+ direction: "column",
35
38
  sx: {
39
+ alignItems: "center",
40
+ justifyContent: "center",
36
41
  width: "280px"
37
42
  },
38
- direction: "column",
39
- alignItems: "center",
40
- justifyContent: "center",
41
43
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
42
44
  variant: "h5",
43
45
  sx: {
@@ -63,8 +65,4 @@ function PaymentError({
63
65
  }) : button]
64
66
  })
65
67
  });
66
- }
67
- PaymentError.defaultProps = {
68
- button: "Back",
69
- mode: "standalone"
70
- };
68
+ }
@@ -1,3 +1,2 @@
1
- export default function CheckoutFooter({ ...props }: {
2
- [x: string]: any;
3
- }): import("react").JSX.Element;
1
+ import { TypographyProps } from '@mui/material';
2
+ export default function CheckoutFooter(props: TypographyProps): import("react").JSX.Element;
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  module.exports = CheckoutFooter;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _material = require("@mui/material");
9
- function CheckoutFooter({
10
- ...props
11
- }) {
9
+ function CheckoutFooter(props) {
12
10
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
13
- color: "text.lighter",
14
- fontSize: 12,
15
11
  ...props,
12
+ sx: [{
13
+ color: "text.lighter",
14
+ fontSize: 12
15
+ }, ...(Array.isArray(props.sx) ? props.sx : [props.sx])],
16
16
  children: ["Powered by", " ", /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
17
17
  component: "span",
18
18
  sx: {
@@ -10,7 +10,7 @@ var _context = require("@arcblock/ux/lib/Locale/context");
10
10
  var _selector = _interopRequireDefault(require("@arcblock/ux/lib/Locale/selector"));
11
11
  var _material = require("@mui/material");
12
12
  var _payment = require("../../contexts/payment");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  function UserButtons() {
15
15
  const {
16
16
  t
@@ -20,8 +20,10 @@ function UserButtons() {
20
20
  } = (0, _payment.usePaymentContext)();
21
21
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
22
22
  direction: "row",
23
- alignItems: "center",
24
- justifyContent: "space-between",
23
+ sx: {
24
+ alignItems: "center",
25
+ justifyContent: "space-between"
26
+ },
25
27
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_selector.default, {
26
28
  showText: false
27
29
  }), session?.user ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_SessionManager.default, {
@@ -6,12 +6,5 @@ type Props = {
6
6
  fieldValidation?: Record<string, any>;
7
7
  errorPosition?: 'right' | 'bottom';
8
8
  };
9
- declare function AddressForm({ mode, stripe, sx, fieldValidation, errorPosition }: Props): import("react").JSX.Element | null;
10
- declare namespace AddressForm {
11
- var defaultProps: {
12
- sx: {};
13
- fieldValidation: {};
14
- errorPosition: string;
15
- };
16
- }
17
- export default AddressForm;
9
+ export default function AddressForm({ mode, stripe, sx, fieldValidation, errorPosition }: Props): import("react").JSX.Element | null;
10
+ export {};
@@ -11,18 +11,13 @@ var _reactHookForm = require("react-hook-form");
11
11
  var _input = _interopRequireDefault(require("../../components/input"));
12
12
  var _countrySelect = _interopRequireDefault(require("../../components/country-select"));
13
13
  var _validator = require("../../libs/validator");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- AddressForm.defaultProps = {
16
- sx: {},
17
- fieldValidation: {},
18
- errorPosition: "right"
19
- };
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
15
  function AddressForm({
21
16
  mode,
22
17
  stripe,
23
18
  sx = {},
24
- fieldValidation,
25
- errorPosition
19
+ fieldValidation = {},
20
+ errorPosition = "right"
26
21
  }) {
27
22
  const {
28
23
  t,
@@ -111,6 +106,7 @@ function AddressForm({
111
106
  field
112
107
  }) => /* @__PURE__ */(0, _jsxRuntime.jsx)(_countrySelect.default, {
113
108
  ...field,
109
+ ref: field.ref,
114
110
  sx: {
115
111
  "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
116
112
  borderColor: "transparent"
@@ -168,6 +164,7 @@ function AddressForm({
168
164
  field
169
165
  }) => /* @__PURE__ */(0, _jsxRuntime.jsx)(_countrySelect.default, {
170
166
  ...field,
167
+ ref: field.ref,
171
168
  sx: {
172
169
  ".MuiOutlinedInput-notchedOutline": {
173
170
  borderColor: "transparent !important"
@@ -29,8 +29,8 @@ function CurrencySelector({
29
29
  className: selected ? "cko-payment-card" : "cko-payment-card-unselect",
30
30
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
31
31
  direction: "row",
32
- alignItems: "center",
33
32
  sx: {
33
+ alignItems: "center",
34
34
  position: "relative"
35
35
  },
36
36
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
@@ -52,11 +52,11 @@ function CurrencySelector({
52
52
  },
53
53
  children: x.symbol
54
54
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
55
+ gutterBottom: true,
55
56
  sx: {
57
+ color: "text.lighter",
56
58
  fontSize: 14
57
59
  },
58
- color: "text.lighter",
59
- gutterBottom: true,
60
60
  children: x.method.name
61
61
  })]
62
62
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Radio, {
@@ -6,11 +6,5 @@ type PageData = CheckoutContext & CheckoutCallbacks & {
6
6
  onlyShowBtn?: boolean;
7
7
  isDonation?: boolean;
8
8
  };
9
- declare function PaymentForm({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, onPaid, onError, action, onlyShowBtn, isDonation, }: PageData): import("react").JSX.Element;
10
- declare namespace PaymentForm {
11
- var defaultProps: {
12
- onlyShowBtn: boolean;
13
- isDonation: boolean;
14
- };
15
- }
16
- export default PaymentForm;
9
+ export default function PaymentForm({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, onPaid, onError, action, onlyShowBtn, isDonation, }: PageData): import("react").JSX.Element;
10
+ export {};
@@ -37,7 +37,7 @@ var _overDueInvoicePayment = _interopRequireDefault(require("../../components/ov
37
37
  var _currency2 = require("../../libs/currency");
38
38
  var _confirm = _interopRequireDefault(require("../../components/confirm"));
39
39
  var _validator = require("../../libs/validator");
40
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
41
41
  const waitForCheckoutComplete = async sessionId => {
42
42
  let result;
43
43
  await (0, _pWaitFor.default)(async () => {
@@ -97,10 +97,6 @@ const setUserFormValues = (userInfo, currentValues, setValue, options = {}) => {
97
97
  }
98
98
  });
99
99
  };
100
- PaymentForm.defaultProps = {
101
- onlyShowBtn: false,
102
- isDonation: false
103
- };
104
100
  function PaymentForm({
105
101
  checkoutSession,
106
102
  paymentMethods,
@@ -111,7 +107,7 @@ function PaymentForm({
111
107
  onError,
112
108
  // mode,
113
109
  action,
114
- onlyShowBtn,
110
+ onlyShowBtn = false,
115
111
  isDonation = false
116
112
  }) {
117
113
  const {
@@ -541,12 +537,14 @@ function PaymentForm({
541
537
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
542
538
  spacing: 1,
543
539
  children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
544
- flexDirection: "row",
545
- alignItems: "center",
546
- justifyContent: "space-between",
540
+ sx: {
541
+ flexDirection: "row",
542
+ alignItems: "center",
543
+ justifyContent: "space-between"
544
+ },
547
545
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
548
- color: "text.primary",
549
546
  sx: {
547
+ color: "text.primary",
550
548
  whiteSpace: "nowrap"
551
549
  },
552
550
  children: t("payment.checkout.fastPay.payer")
@@ -579,11 +577,15 @@ function PaymentForm({
579
577
  })]
580
578
  })]
581
579
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
582
- flexDirection: "row",
583
- alignItems: "center",
584
- justifyContent: "space-between",
580
+ sx: {
581
+ flexDirection: "row",
582
+ alignItems: "center",
583
+ justifyContent: "space-between"
584
+ },
585
585
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
586
- color: "text.primary",
586
+ sx: {
587
+ color: "text.primary"
588
+ },
587
589
  children: t("payment.checkout.fastPay.amount")
588
590
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
589
591
  children: [(0, _util.fromUnitToToken)(state.fastCheckoutInfo.amount, paymentCurrency?.decimal || 18).toString(), " ", paymentCurrency?.symbol]
@@ -669,8 +671,10 @@ function PaymentForm({
669
671
  in: true,
670
672
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
671
673
  direction: "column",
672
- alignItems: "flex-start",
673
674
  className: "cko-payment-methods",
675
+ sx: {
676
+ alignItems: "flex-start"
677
+ },
674
678
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
675
679
  direction: "row",
676
680
  sx: {
@@ -15,7 +15,7 @@ var _input = _interopRequireDefault(require("../../components/input"));
15
15
  var _util = require("../../libs/util");
16
16
  var _countrySelect = _interopRequireDefault(require("../../components/country-select"));
17
17
  var _phoneValidator = require("../../libs/phone-validator");
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
19
  function PhoneInput({
20
20
  ...props
21
21
  }) {
@@ -5,7 +5,7 @@ export type StripeCheckoutFormProps = {
5
5
  customer: TCustomer;
6
6
  mode: string;
7
7
  onConfirm: Function;
8
- returnUrl: string;
8
+ returnUrl?: string;
9
9
  };
10
10
  export type StripeCheckoutProps = {
11
11
  clientSecret: string;
@@ -17,10 +17,4 @@ export type StripeCheckoutProps = {
17
17
  onCancel: Function;
18
18
  returnUrl?: string;
19
19
  };
20
- declare function StripeCheckout({ clientSecret, intentType, publicKey, mode, customer, onConfirm, onCancel, returnUrl, }: StripeCheckoutProps): import("react").JSX.Element;
21
- declare namespace StripeCheckout {
22
- var defaultProps: {
23
- returnUrl: string;
24
- };
25
- }
26
- export default StripeCheckout;
20
+ export default function StripeCheckout({ clientSecret, intentType, publicKey, mode, customer, onConfirm, onCancel, returnUrl, }: StripeCheckoutProps): import("react").JSX.Element;
@@ -14,7 +14,7 @@ var _ahooks = require("ahooks");
14
14
  var _react = require("react");
15
15
  var _mobile = require("../../../hooks/mobile");
16
16
  var _loadingButton = _interopRequireDefault(require("../../../components/loading-button"));
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  const {
19
19
  Elements,
20
20
  PaymentElement,
@@ -104,6 +104,7 @@ function StripeCheckoutForm({
104
104
  });
105
105
  break;
106
106
  case "requires_payment_method":
107
+ // 忽略该状态
107
108
  default:
108
109
  break;
109
110
  }
@@ -188,7 +189,6 @@ function StripeCheckoutForm({
188
189
  }, [customer, intentType, stripe, state.showBillingForm, returnUrl]
189
190
  // eslint-disable-line
190
191
  );
191
-
192
192
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(Content, {
193
193
  onSubmit: handleSubmit,
194
194
  children: [(!state.paymentMethod || ["link", "card"].includes(state.paymentMethod)) && /* @__PURE__ */(0, _jsxRuntime.jsx)(LinkAuthenticationElement, {
@@ -356,7 +356,4 @@ function StripeCheckout({
356
356
  })
357
357
  })
358
358
  });
359
- }
360
- StripeCheckout.defaultProps = {
361
- returnUrl: ""
362
- };
359
+ }
@@ -11,7 +11,7 @@ var _ahooks = require("ahooks");
11
11
  var _livemode = _interopRequireDefault(require("../components/livemode"));
12
12
  var _util = require("../libs/util");
13
13
  var _addon = _interopRequireDefault(require("./form/addon"));
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  function PaymentHeader({
16
16
  checkoutSession
17
17
  }) {
@@ -33,12 +33,16 @@ function PaymentHeader({
33
33
  className: "cko-header",
34
34
  direction: "row",
35
35
  spacing: 1,
36
- alignItems: "center",
37
- justifyContent: "space-between",
36
+ sx: {
37
+ alignItems: "center",
38
+ justifyContent: "space-between"
39
+ },
38
40
  children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
39
41
  direction: "row",
40
42
  spacing: 1,
41
- alignItems: "center",
43
+ sx: {
44
+ alignItems: "center"
45
+ },
42
46
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
43
47
  variant: "square",
44
48
  src: window.blocklet.appLogo,
@@ -6,16 +6,9 @@ type Props = CheckoutContext & CheckoutCallbacks & {
6
6
  error?: any;
7
7
  showCheckoutSummary?: boolean;
8
8
  };
9
- declare function Payment({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, completed, error, mode, onPaid, onError, onChange, goBack, action, showCheckoutSummary, }: Props): import("react").JSX.Element;
10
- declare namespace Payment {
11
- var defaultProps: {
12
- completed: boolean;
13
- error: null;
14
- showCheckoutSummary: boolean;
15
- };
16
- }
17
- export default Payment;
9
+ export default function Payment({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, completed, error, mode, onPaid, onError, onChange, goBack, action, showCheckoutSummary, }: Props): import("react").JSX.Element;
18
10
  type RootProps = {
19
11
  mode: LiteralUnion<'standalone' | 'inline' | 'popup', string>;
20
12
  } & BoxProps;
21
13
  export declare const Root: React.FC<RootProps>;
14
+ export {};
@@ -31,19 +31,15 @@ var _mobile = require("../hooks/mobile");
31
31
  var _phoneValidator = require("../libs/phone-validator");
32
32
  var _currency = require("../libs/currency");
33
33
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
34
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
35
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36
- PaymentInner.defaultProps = {
37
- completed: false,
38
- showCheckoutSummary: true
39
- };
34
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
35
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
40
36
  function PaymentInner({
41
37
  checkoutSession,
42
38
  paymentMethods,
43
39
  paymentLink,
44
40
  paymentIntent,
45
41
  customer,
46
- completed,
42
+ completed = false,
47
43
  mode,
48
44
  onPaid,
49
45
  onError,
@@ -320,19 +316,14 @@ function PaymentInner({
320
316
  })
321
317
  });
322
318
  }
323
- Payment.defaultProps = {
324
- completed: false,
325
- error: null,
326
- showCheckoutSummary: true
327
- };
328
319
  function Payment({
329
320
  checkoutSession,
330
321
  paymentMethods,
331
322
  paymentIntent,
332
323
  paymentLink,
333
324
  customer,
334
- completed,
335
- error,
325
+ completed = false,
326
+ error = null,
336
327
  mode,
337
328
  onPaid,
338
329
  onError,
@@ -426,9 +417,9 @@ function Payment({
426
417
  });
427
418
  };
428
419
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
429
- display: "flex",
430
- flexDirection: "column",
431
420
  sx: {
421
+ display: "flex",
422
+ flexDirection: "column",
432
423
  height: mode === "standalone" ? "100vh" : "auto",
433
424
  overflow: isMobileSafariEnv ? "visible" : "hidden"
434
425
  },
@@ -7,14 +7,5 @@ type Props = {
7
7
  extra?: React.ReactNode;
8
8
  variant?: LiteralUnion<'square' | 'rounded' | 'circular', string>;
9
9
  };
10
- declare function ProductCard({ size, variant, name, logo, description, extra }: Props): import("react").JSX.Element;
11
- declare namespace ProductCard {
12
- var defaultProps: {
13
- logo: string;
14
- size: number;
15
- description: string;
16
- variant: string;
17
- extra: undefined;
18
- };
19
- }
20
- export default ProductCard;
10
+ export default function ProductCard({ size, variant, name, logo, description, extra, }: Props): import("react").JSX.Element;
11
+ export {};
@@ -7,12 +7,12 @@ module.exports = ProductCard;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _material = require("@mui/material");
9
9
  function ProductCard({
10
- size,
11
- variant,
10
+ size = 48,
11
+ variant = "rounded",
12
12
  name,
13
- logo,
14
- description,
15
- extra
13
+ logo = "",
14
+ description = "",
15
+ extra = void 0
16
16
  }) {
17
17
  const s = {
18
18
  width: size,
@@ -20,10 +20,10 @@ function ProductCard({
20
20
  };
21
21
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
22
22
  direction: "row",
23
- alignItems: "center",
24
23
  spacing: 1,
25
- flex: 2,
26
24
  sx: {
25
+ alignItems: "center",
26
+ flex: 2,
27
27
  width: "100%"
28
28
  },
29
29
  children: [logo ?
@@ -43,9 +43,9 @@ function ProductCard({
43
43
  children: (name || "?").slice(0, 1)
44
44
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
45
45
  direction: "column",
46
- alignItems: "flex-start",
47
- justifyContent: "space-around",
48
46
  sx: {
47
+ alignItems: "flex-start",
48
+ justifyContent: "space-around",
49
49
  flexShrink: 1,
50
50
  overflow: "hidden"
51
51
  },
@@ -54,38 +54,31 @@ function ProductCard({
54
54
  variant: "body1",
55
55
  title: name,
56
56
  sx: {
57
+ color: "text.primary",
57
58
  fontWeight: 500,
58
59
  mb: 0.5,
59
60
  lineHeight: 1.2,
60
61
  fontSize: 16
61
62
  },
62
- color: "text.primary",
63
63
  children: name
64
64
  }), description && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
65
65
  variant: "body1",
66
66
  title: description,
67
67
  sx: {
68
+ color: "text.lighter",
68
69
  fontSize: "0.74375rem",
69
70
  mb: 0.5,
70
71
  lineHeight: 1.2,
71
72
  textAlign: "left"
72
73
  },
73
- color: "text.lighter",
74
74
  children: description
75
75
  }), extra && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
76
76
  sx: {
77
+ color: "text.lighter",
77
78
  fontSize: "0.74375rem"
78
79
  },
79
- color: "text.lighter",
80
80
  children: extra
81
81
  })]
82
82
  })]
83
83
  });
84
- }
85
- ProductCard.defaultProps = {
86
- logo: "",
87
- size: 48,
88
- description: "",
89
- variant: "rounded",
90
- extra: void 0
91
- };
84
+ }