@blocklet/payment-react 1.18.56 → 1.19.1
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/es/checkout/donate.d.ts +1 -15
- package/es/checkout/donate.js +301 -189
- package/es/checkout/form.d.ts +1 -15
- package/es/checkout/form.js +5 -13
- package/es/checkout/table.js +3 -3
- package/es/components/blockchain/gas.d.ts +1 -5
- package/es/components/blockchain/gas.js +10 -2
- package/es/components/blockchain/tx.d.ts +1 -8
- package/es/components/blockchain/tx.js +29 -10
- package/es/components/confirm.d.ts +1 -10
- package/es/components/confirm.js +4 -10
- package/es/components/country-select.d.ts +3 -2
- package/es/components/country-select.js +375 -352
- package/es/components/date-range-picker.d.ts +13 -0
- package/es/components/date-range-picker.js +279 -0
- package/es/components/input.d.ts +14 -20
- package/es/components/input.js +51 -44
- package/es/components/label.d.ts +7 -0
- package/es/components/label.js +49 -0
- package/es/components/lazy-loader.js +1 -2
- package/es/components/link.d.ts +2 -9
- package/es/components/link.js +9 -6
- package/es/components/livemode.d.ts +2 -8
- package/es/components/livemode.js +1 -5
- package/es/components/loading-button.d.ts +6 -1
- package/es/components/loading-button.js +56 -66
- package/es/components/over-due-invoice-payment.d.ts +0 -18
- package/es/components/over-due-invoice-payment.js +138 -95
- package/es/components/payment-beneficiaries.d.ts +2 -7
- package/es/components/payment-beneficiaries.js +86 -40
- package/es/components/pricing-item.d.ts +0 -5
- package/es/components/pricing-item.js +1 -4
- package/es/components/pricing-table.d.ts +2 -10
- package/es/components/pricing-table.js +8 -7
- package/es/components/resume-subscription.d.ts +0 -10
- package/es/components/resume-subscription.js +42 -21
- package/es/components/truncated-text.d.ts +2 -9
- package/es/components/truncated-text.js +0 -5
- package/es/contexts/donate.d.ts +0 -7
- package/es/contexts/donate.js +10 -8
- package/es/contexts/payment.d.ts +1 -4
- package/es/contexts/payment.js +7 -2
- package/es/history/credit/grants-list.d.ts +14 -0
- package/es/history/credit/grants-list.js +215 -0
- package/es/history/credit/transactions-list.d.ts +13 -0
- package/es/history/credit/transactions-list.js +255 -0
- package/es/history/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +172 -74
- package/es/history/payment/list.js +115 -38
- package/es/hooks/keyboard.d.ts +1 -1
- package/es/hooks/keyboard.js +2 -4
- package/es/index.d.ts +5 -1
- package/es/index.js +10 -1
- package/es/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.d.ts +2 -0
- package/es/libs/util.js +14 -4
- package/es/libs/validator.js +2 -4
- package/es/locales/en.js +20 -2
- package/es/locales/zh.js +20 -2
- package/es/payment/amount.d.ts +2 -7
- package/es/payment/amount.js +1 -5
- package/es/payment/donation-form.d.ts +2 -10
- package/es/payment/donation-form.js +196 -160
- package/es/payment/error.d.ts +2 -8
- package/es/payment/error.js +40 -20
- package/es/payment/footer.d.ts +2 -3
- package/es/payment/footer.js +19 -6
- package/es/payment/form/addon.js +14 -4
- package/es/payment/form/address.d.ts +2 -9
- package/es/payment/form/address.js +3 -6
- package/es/payment/form/currency.js +45 -25
- package/es/payment/form/index.d.ts +2 -8
- package/es/payment/form/index.js +151 -71
- package/es/payment/form/phone.js +2 -4
- package/es/payment/form/stripe/form.d.ts +2 -8
- package/es/payment/form/stripe/form.js +1 -3
- package/es/payment/header.js +38 -16
- package/es/payment/index.d.ts +2 -9
- package/es/payment/index.js +23 -17
- package/es/payment/product-card.d.ts +2 -11
- package/es/payment/product-card.js +84 -50
- package/es/payment/product-donation.js +175 -114
- package/es/payment/product-item.d.ts +9 -9
- package/es/payment/product-item.js +320 -145
- package/es/payment/product-skeleton.js +2 -2
- package/es/payment/skeleton/donation.js +27 -7
- package/es/payment/skeleton/overview.js +22 -2
- package/es/payment/skeleton/payment.js +33 -5
- package/es/payment/success.d.ts +2 -9
- package/es/payment/success.js +41 -14
- package/es/payment/summary.d.ts +4 -17
- package/es/payment/summary.js +193 -111
- package/es/theme/index.d.ts +0 -5
- package/es/theme/index.js +2 -5
- package/es/theme/typography.d.ts +2 -2
- package/lib/checkout/donate.d.ts +1 -15
- package/lib/checkout/donate.js +75 -54
- package/lib/checkout/form.d.ts +1 -15
- package/lib/checkout/form.js +7 -15
- package/lib/checkout/table.js +4 -4
- package/lib/components/blockchain/gas.d.ts +1 -5
- package/lib/components/blockchain/gas.js +3 -2
- package/lib/components/blockchain/tx.d.ts +1 -8
- package/lib/components/blockchain/tx.js +15 -10
- package/lib/components/confirm.d.ts +1 -10
- package/lib/components/confirm.js +5 -11
- package/lib/components/country-select.d.ts +3 -2
- package/lib/components/country-select.js +23 -22
- package/lib/components/date-range-picker.d.ts +13 -0
- package/lib/components/date-range-picker.js +329 -0
- package/lib/components/input.d.ts +14 -20
- package/lib/components/input.js +28 -27
- package/lib/components/label.d.ts +7 -0
- package/lib/components/label.js +60 -0
- package/lib/components/lazy-loader.js +1 -1
- package/lib/components/link.d.ts +2 -9
- package/lib/components/link.js +3 -8
- package/lib/components/livemode.d.ts +2 -8
- package/lib/components/livemode.js +3 -7
- package/lib/components/loading-button.d.ts +6 -1
- package/lib/components/loading-button.js +9 -17
- package/lib/components/over-due-invoice-payment.d.ts +0 -18
- package/lib/components/over-due-invoice-payment.js +31 -33
- package/lib/components/payment-beneficiaries.d.ts +2 -7
- package/lib/components/payment-beneficiaries.js +12 -11
- package/lib/components/pricing-item.d.ts +0 -5
- package/lib/components/pricing-item.js +2 -5
- package/lib/components/pricing-table.d.ts +2 -10
- package/lib/components/pricing-table.js +5 -11
- package/lib/components/resume-subscription.d.ts +0 -10
- package/lib/components/resume-subscription.js +16 -16
- package/lib/components/table.js +1 -1
- package/lib/components/truncated-text.d.ts +2 -9
- package/lib/components/truncated-text.js +1 -6
- package/lib/contexts/donate.d.ts +0 -7
- package/lib/contexts/donate.js +4 -7
- package/lib/contexts/payment.d.ts +1 -4
- package/lib/contexts/payment.js +4 -7
- package/lib/history/credit/grants-list.d.ts +14 -0
- package/lib/history/credit/grants-list.js +277 -0
- package/lib/history/credit/transactions-list.d.ts +13 -0
- package/lib/history/credit/transactions-list.js +301 -0
- package/lib/history/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +73 -37
- package/lib/history/payment/list.js +30 -16
- package/lib/hooks/keyboard.d.ts +1 -1
- package/lib/hooks/mobile.js +1 -1
- package/lib/hooks/subscription.js +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +41 -2
- package/lib/libs/api.js +1 -1
- package/lib/libs/dayjs.js +1 -1
- package/lib/libs/phone-validator.js +0 -2
- package/lib/libs/theme.js +1 -1
- package/lib/libs/util.d.ts +2 -0
- package/lib/libs/util.js +15 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +21 -3
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +21 -3
- package/lib/payment/amount.d.ts +2 -7
- package/lib/payment/amount.js +2 -6
- package/lib/payment/donation-form.d.ts +2 -10
- package/lib/payment/donation-form.js +33 -38
- package/lib/payment/error.d.ts +2 -8
- package/lib/payment/error.js +11 -13
- package/lib/payment/footer.d.ts +2 -3
- package/lib/payment/footer.js +5 -5
- package/lib/payment/form/addon.js +5 -3
- package/lib/payment/form/address.d.ts +2 -9
- package/lib/payment/form/address.js +5 -8
- package/lib/payment/form/currency.js +3 -3
- package/lib/payment/form/index.d.ts +2 -8
- package/lib/payment/form/index.js +64 -21
- package/lib/payment/form/phone.js +1 -1
- package/lib/payment/form/stripe/form.d.ts +2 -8
- package/lib/payment/form/stripe/form.js +3 -6
- package/lib/payment/header.js +8 -4
- package/lib/payment/index.d.ts +2 -9
- package/lib/payment/index.js +27 -18
- package/lib/payment/product-card.d.ts +2 -11
- package/lib/payment/product-card.js +13 -20
- package/lib/payment/product-donation.js +71 -66
- package/lib/payment/product-item.d.ts +9 -9
- package/lib/payment/product-item.js +168 -29
- package/lib/payment/product-skeleton.js +2 -2
- package/lib/payment/skeleton/donation.js +8 -4
- package/lib/payment/skeleton/overview.js +6 -2
- package/lib/payment/skeleton/payment.js +9 -3
- package/lib/payment/success.d.ts +2 -9
- package/lib/payment/success.js +12 -15
- package/lib/payment/summary.d.ts +4 -17
- package/lib/payment/summary.js +53 -45
- package/lib/theme/index.d.ts +0 -5
- package/lib/theme/index.js +2 -5
- package/lib/theme/typography.d.ts +2 -2
- package/package.json +40 -40
- package/src/checkout/donate.tsx +103 -35
- package/src/checkout/form.tsx +5 -14
- package/src/checkout/table.tsx +3 -3
- package/src/components/blockchain/gas.tsx +5 -3
- package/src/components/blockchain/tx.tsx +19 -11
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/date-range-picker.tsx +310 -0
- package/src/components/input.tsx +61 -46
- package/src/components/label.tsx +58 -0
- package/src/components/link.tsx +9 -7
- package/src/components/livemode.tsx +2 -6
- package/src/components/loading-button.tsx +63 -76
- package/src/components/over-due-invoice-payment.tsx +43 -28
- package/src/components/payment-beneficiaries.tsx +33 -14
- package/src/components/pricing-item.tsx +1 -4
- package/src/components/pricing-table.tsx +8 -8
- package/src/components/resume-subscription.tsx +20 -14
- package/src/components/table.tsx +2 -2
- package/src/components/truncated-text.tsx +0 -6
- package/src/contexts/donate.tsx +6 -7
- package/src/contexts/payment.tsx +7 -3
- package/src/history/credit/grants-list.tsx +276 -0
- package/src/history/credit/transactions-list.tsx +317 -0
- package/src/history/invoice/list.tsx +92 -36
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- package/src/index.ts +9 -0
- package/src/libs/util.ts +14 -0
- package/src/locales/en.tsx +20 -0
- package/src/locales/zh.tsx +19 -0
- package/src/payment/amount.tsx +1 -6
- package/src/payment/donation-form.tsx +47 -29
- package/src/payment/error.tsx +16 -8
- package/src/payment/footer.tsx +11 -3
- package/src/payment/form/addon.tsx +6 -1
- package/src/payment/form/address.tsx +3 -7
- package/src/payment/form/currency.tsx +12 -2
- package/src/payment/form/index.tsx +121 -45
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +27 -22
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +198 -28
- package/src/payment/product-skeleton.tsx +3 -2
- package/src/payment/skeleton/donation.tsx +12 -2
- package/src/payment/skeleton/overview.tsx +12 -2
- package/src/payment/skeleton/payment.tsx +16 -3
- package/src/payment/success.tsx +26 -15
- package/src/payment/summary.tsx +87 -44
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
|
@@ -35,22 +35,4 @@ type SummaryItem = {
|
|
|
35
35
|
method: PaymentMethod;
|
|
36
36
|
};
|
|
37
37
|
declare function OverdueInvoicePayment({ subscriptionId, customerId, mode, dialogProps, children, onPaid, detailLinkOptions, successToast, alertMessage, authToken, }: Props): import("react").JSX.Element | null;
|
|
38
|
-
declare namespace OverdueInvoicePayment {
|
|
39
|
-
var defaultProps: {
|
|
40
|
-
mode: string;
|
|
41
|
-
onPaid: () => void;
|
|
42
|
-
dialogProps: {
|
|
43
|
-
open: boolean;
|
|
44
|
-
};
|
|
45
|
-
children: null;
|
|
46
|
-
detailLinkOptions: {
|
|
47
|
-
enabled: boolean;
|
|
48
|
-
};
|
|
49
|
-
subscriptionId: undefined;
|
|
50
|
-
customerId: undefined;
|
|
51
|
-
successToast: boolean;
|
|
52
|
-
alertMessage: string;
|
|
53
|
-
authToken: undefined;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
38
|
export default OverdueInvoicePayment;
|
|
@@ -20,7 +20,7 @@ var _util = require("../libs/util");
|
|
|
20
20
|
var _subscription = require("../hooks/subscription");
|
|
21
21
|
var _api = _interopRequireDefault(require("../libs/api"));
|
|
22
22
|
var _loadingButton = _interopRequireDefault(require("./loading-button"));
|
|
23
|
-
function _interopRequireDefault(
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
24
|
const fetchOverdueInvoices = async params => {
|
|
25
25
|
if (!params.subscriptionId && !params.customerId) {
|
|
26
26
|
throw new Error("Either subscriptionId or customerId must be provided");
|
|
@@ -35,18 +35,20 @@ const fetchOverdueInvoices = async params => {
|
|
|
35
35
|
return res.data;
|
|
36
36
|
};
|
|
37
37
|
function OverdueInvoicePayment({
|
|
38
|
-
subscriptionId,
|
|
39
|
-
customerId,
|
|
38
|
+
subscriptionId = void 0,
|
|
39
|
+
customerId = void 0,
|
|
40
40
|
mode = "default",
|
|
41
|
-
dialogProps = {
|
|
42
|
-
|
|
41
|
+
dialogProps = {
|
|
42
|
+
open: true
|
|
43
|
+
},
|
|
44
|
+
children = void 0,
|
|
43
45
|
onPaid = () => {},
|
|
44
46
|
detailLinkOptions = {
|
|
45
47
|
enabled: true
|
|
46
48
|
},
|
|
47
49
|
successToast = true,
|
|
48
50
|
alertMessage = "",
|
|
49
|
-
authToken
|
|
51
|
+
authToken = void 0
|
|
50
52
|
}) {
|
|
51
53
|
const {
|
|
52
54
|
t,
|
|
@@ -386,15 +388,19 @@ function OverdueInvoicePayment({
|
|
|
386
388
|
severity: "error",
|
|
387
389
|
children: error.message
|
|
388
390
|
}) : /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
389
|
-
|
|
391
|
+
sx: {
|
|
392
|
+
gap: 1
|
|
393
|
+
},
|
|
390
394
|
children: [summaryList.length === 0 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
391
395
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Alert, {
|
|
392
396
|
severity: "success",
|
|
393
397
|
children: getEmptyStateMessage()
|
|
394
398
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
395
399
|
direction: "row",
|
|
396
|
-
|
|
397
|
-
|
|
400
|
+
sx: {
|
|
401
|
+
justifyContent: "flex-end",
|
|
402
|
+
mt: 2
|
|
403
|
+
},
|
|
398
404
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
399
405
|
variant: "outlined",
|
|
400
406
|
color: "primary",
|
|
@@ -407,8 +413,10 @@ function OverdueInvoicePayment({
|
|
|
407
413
|
})]
|
|
408
414
|
}), summaryList.length === 1 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
409
415
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
410
|
-
color: "text.secondary",
|
|
411
416
|
variant: "body1",
|
|
417
|
+
sx: {
|
|
418
|
+
color: "text.secondary"
|
|
419
|
+
},
|
|
412
420
|
children: [getOverdueTitle(), detailLinkOptions.enabled && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
413
421
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)("br", {}), t("payment.subscription.overdue.description"), /* @__PURE__ */(0, _jsxRuntime.jsx)("a", {
|
|
414
422
|
href: detailUrl,
|
|
@@ -423,9 +431,11 @@ function OverdueInvoicePayment({
|
|
|
423
431
|
})]
|
|
424
432
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
425
433
|
direction: "row",
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
434
|
+
sx: {
|
|
435
|
+
justifyContent: "flex-end",
|
|
436
|
+
gap: 2,
|
|
437
|
+
mt: 2
|
|
438
|
+
},
|
|
429
439
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
430
440
|
variant: "outlined",
|
|
431
441
|
color: "primary",
|
|
@@ -435,8 +445,10 @@ function OverdueInvoicePayment({
|
|
|
435
445
|
})]
|
|
436
446
|
}), summaryList.length > 1 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
437
447
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
438
|
-
color: "text.secondary",
|
|
439
448
|
variant: "body1",
|
|
449
|
+
sx: {
|
|
450
|
+
color: "text.secondary"
|
|
451
|
+
},
|
|
440
452
|
children: [getOverdueTitle(), detailLinkOptions.enabled && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
441
453
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)("br", {}), t("payment.subscription.overdue.description"), /* @__PURE__ */(0, _jsxRuntime.jsx)("a", {
|
|
442
454
|
href: detailUrl,
|
|
@@ -450,15 +462,17 @@ function OverdueInvoicePayment({
|
|
|
450
462
|
})]
|
|
451
463
|
})]
|
|
452
464
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
453
|
-
color: "text.secondary",
|
|
454
465
|
variant: "body1",
|
|
466
|
+
sx: {
|
|
467
|
+
color: "text.secondary"
|
|
468
|
+
},
|
|
455
469
|
children: t("payment.subscription.overdue.list")
|
|
456
470
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
457
471
|
children: summaryList.map(item => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
458
472
|
direction: "row",
|
|
459
|
-
justifyContent: "space-between",
|
|
460
|
-
alignItems: "center",
|
|
461
473
|
sx: {
|
|
474
|
+
justifyContent: "space-between",
|
|
475
|
+
alignItems: "center",
|
|
462
476
|
py: 1,
|
|
463
477
|
px: 0.5,
|
|
464
478
|
borderBottom: "1px solid",
|
|
@@ -486,20 +500,4 @@ function OverdueInvoicePayment({
|
|
|
486
500
|
})
|
|
487
501
|
});
|
|
488
502
|
}
|
|
489
|
-
OverdueInvoicePayment.defaultProps = {
|
|
490
|
-
mode: "default",
|
|
491
|
-
onPaid: () => {},
|
|
492
|
-
dialogProps: {
|
|
493
|
-
open: true
|
|
494
|
-
},
|
|
495
|
-
children: null,
|
|
496
|
-
detailLinkOptions: {
|
|
497
|
-
enabled: true
|
|
498
|
-
},
|
|
499
|
-
subscriptionId: void 0,
|
|
500
|
-
customerId: void 0,
|
|
501
|
-
successToast: true,
|
|
502
|
-
alertMessage: "",
|
|
503
|
-
authToken: void 0
|
|
504
|
-
};
|
|
505
503
|
module.exports = OverdueInvoicePayment;
|
|
@@ -15,10 +15,5 @@ interface BenefitsProps {
|
|
|
15
15
|
};
|
|
16
16
|
totalAmount?: string;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var defaultProps: {
|
|
21
|
-
totalAmount: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export default PaymentBeneficiaries;
|
|
18
|
+
export default function PaymentBeneficiaries({ data, currency, totalAmount }: BenefitsProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -8,13 +8,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
9
|
var _util = require("@ocap/util");
|
|
10
10
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
11
|
-
PaymentBeneficiaries.defaultProps = {
|
|
12
|
-
totalAmount: "0"
|
|
13
|
-
};
|
|
14
11
|
function PaymentBeneficiaries({
|
|
15
12
|
data,
|
|
16
13
|
currency,
|
|
17
|
-
totalAmount
|
|
14
|
+
totalAmount = "0"
|
|
18
15
|
}) {
|
|
19
16
|
const {
|
|
20
17
|
t
|
|
@@ -23,7 +20,9 @@ function PaymentBeneficiaries({
|
|
|
23
20
|
spacing: 2,
|
|
24
21
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
25
22
|
variant: "subtitle2",
|
|
26
|
-
|
|
23
|
+
sx: {
|
|
24
|
+
color: "text.secondary"
|
|
25
|
+
},
|
|
27
26
|
children: t("benefits.title", {
|
|
28
27
|
count: data.length
|
|
29
28
|
})
|
|
@@ -34,9 +33,9 @@ function PaymentBeneficiaries({
|
|
|
34
33
|
xs: "column",
|
|
35
34
|
sm: "row"
|
|
36
35
|
},
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
justifyContent: "space-between",
|
|
39
36
|
sx: {
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "space-between",
|
|
40
39
|
px: 0.5,
|
|
41
40
|
borderRadius: 1,
|
|
42
41
|
bgcolor: "background.paper",
|
|
@@ -47,8 +46,8 @@ function PaymentBeneficiaries({
|
|
|
47
46
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
48
47
|
direction: "row",
|
|
49
48
|
spacing: 1.5,
|
|
50
|
-
alignItems: "center",
|
|
51
49
|
sx: {
|
|
50
|
+
alignItems: "center",
|
|
52
51
|
width: {
|
|
53
52
|
xs: "100%",
|
|
54
53
|
sm: "auto"
|
|
@@ -79,16 +78,16 @@ function PaymentBeneficiaries({
|
|
|
79
78
|
children: item.name
|
|
80
79
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
81
80
|
variant: "caption",
|
|
82
|
-
color: "text.secondary",
|
|
83
81
|
sx: {
|
|
82
|
+
color: "text.secondary",
|
|
84
83
|
cursor: "pointer"
|
|
85
84
|
},
|
|
86
85
|
children: item.address
|
|
87
86
|
})]
|
|
88
87
|
})]
|
|
89
88
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
90
|
-
alignItems: "flex-end",
|
|
91
89
|
sx: {
|
|
90
|
+
alignItems: "flex-end",
|
|
92
91
|
width: {
|
|
93
92
|
xs: "100%",
|
|
94
93
|
sm: "auto"
|
|
@@ -103,7 +102,9 @@ function PaymentBeneficiaries({
|
|
|
103
102
|
children: [(0, _util.fromUnitToToken)(amount, currency.decimal), " ", currency.symbol]
|
|
104
103
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
105
104
|
variant: "caption",
|
|
106
|
-
|
|
105
|
+
sx: {
|
|
106
|
+
color: "text.secondary"
|
|
107
|
+
},
|
|
107
108
|
children: [Number(item.percent), "%"]
|
|
108
109
|
})]
|
|
109
110
|
})]
|
|
@@ -7,9 +7,4 @@ export type PricingItemProps = {
|
|
|
7
7
|
children?: (pricing: PricingRenderProps, product?: TProductExpanded | undefined) => React.ReactNode;
|
|
8
8
|
};
|
|
9
9
|
declare function PricingItem({ productId, quantity, children, priceId }: PricingItemProps): import("react").JSX.Element;
|
|
10
|
-
declare namespace PricingItem {
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
children: null;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
10
|
export default PricingItem;
|
|
@@ -13,14 +13,14 @@ var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
|
13
13
|
var _system = require("@mui/system");
|
|
14
14
|
var _api = _interopRequireDefault(require("../libs/api"));
|
|
15
15
|
var _util = require("../libs/util");
|
|
16
|
-
function _interopRequireDefault(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const fetchProduct = productId => {
|
|
18
18
|
return _api.default.get(`/api/products/${productId}`).then(res => res?.data);
|
|
19
19
|
};
|
|
20
20
|
function PricingItem({
|
|
21
21
|
productId,
|
|
22
22
|
quantity,
|
|
23
|
-
children,
|
|
23
|
+
children = void 0,
|
|
24
24
|
priceId
|
|
25
25
|
}) {
|
|
26
26
|
const {
|
|
@@ -55,7 +55,4 @@ function PricingItem({
|
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
PricingItem.defaultProps = {
|
|
59
|
-
children: null
|
|
60
|
-
};
|
|
61
58
|
module.exports = PricingItem;
|
|
@@ -7,13 +7,5 @@ type Props = {
|
|
|
7
7
|
interval?: string;
|
|
8
8
|
hideCurrency?: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var defaultProps: {
|
|
13
|
-
alignItems: string;
|
|
14
|
-
mode: string;
|
|
15
|
-
interval: string;
|
|
16
|
-
hideCurrency: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export default PricingTable;
|
|
10
|
+
export default function PricingTable({ table, alignItems, interval, mode, onSelect, hideCurrency, }: Props): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -19,7 +19,7 @@ var _util2 = require("../libs/util");
|
|
|
19
19
|
var _mobile = require("../hooks/mobile");
|
|
20
20
|
var _truncatedText = _interopRequireDefault(require("./truncated-text"));
|
|
21
21
|
var _loadingButton = _interopRequireDefault(require("./loading-button"));
|
|
22
|
-
function _interopRequireDefault(
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
23
|
const sortOrder = {
|
|
24
24
|
year: 1,
|
|
25
25
|
month: 2,
|
|
@@ -44,19 +44,13 @@ const groupItemsByRecurring = (items, currency) => {
|
|
|
44
44
|
grouped
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
PricingTable.defaultProps = {
|
|
48
|
-
alignItems: "center",
|
|
49
|
-
mode: "checkout",
|
|
50
|
-
interval: "",
|
|
51
|
-
hideCurrency: false
|
|
52
|
-
};
|
|
53
47
|
function PricingTable({
|
|
54
48
|
table,
|
|
55
|
-
alignItems,
|
|
56
|
-
interval,
|
|
57
|
-
mode,
|
|
49
|
+
alignItems = "center",
|
|
50
|
+
interval = "",
|
|
51
|
+
mode = "checkout",
|
|
58
52
|
onSelect,
|
|
59
|
-
hideCurrency
|
|
53
|
+
hideCurrency = false
|
|
60
54
|
}) {
|
|
61
55
|
const {
|
|
62
56
|
t,
|
|
@@ -12,14 +12,4 @@ type Props = {
|
|
|
12
12
|
authToken?: string;
|
|
13
13
|
};
|
|
14
14
|
declare function RecoverSubscription({ subscriptionId, dialogProps, onResumed, successToast, authToken, }: Props): import("react").JSX.Element | null;
|
|
15
|
-
declare namespace RecoverSubscription {
|
|
16
|
-
var defaultProps: {
|
|
17
|
-
onResumed: () => void;
|
|
18
|
-
dialogProps: {
|
|
19
|
-
open: boolean;
|
|
20
|
-
};
|
|
21
|
-
successToast: boolean;
|
|
22
|
-
authToken: undefined;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
15
|
export default RecoverSubscription;
|
|
@@ -16,7 +16,7 @@ var _payment = require("../contexts/payment");
|
|
|
16
16
|
var _util = require("../libs/util");
|
|
17
17
|
var _api = _interopRequireDefault(require("../libs/api"));
|
|
18
18
|
var _loadingButton = _interopRequireDefault(require("./loading-button"));
|
|
19
|
-
function _interopRequireDefault(
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
const fetchSubscriptionDetail = async params => {
|
|
21
21
|
const url = `/api/subscriptions/${params.subscriptionId}`;
|
|
22
22
|
const res = await _api.default.get(params.authToken ? (0, _ufo.joinURL)(url, `?authToken=${params.authToken}`) : url);
|
|
@@ -34,10 +34,12 @@ const recoverSubscription = async params => {
|
|
|
34
34
|
};
|
|
35
35
|
function RecoverSubscription({
|
|
36
36
|
subscriptionId,
|
|
37
|
-
dialogProps = {
|
|
37
|
+
dialogProps = {
|
|
38
|
+
open: true
|
|
39
|
+
},
|
|
38
40
|
onResumed = () => {},
|
|
39
41
|
successToast = true,
|
|
40
|
-
authToken
|
|
42
|
+
authToken = void 0
|
|
41
43
|
}) {
|
|
42
44
|
const {
|
|
43
45
|
t,
|
|
@@ -169,10 +171,14 @@ function RecoverSubscription({
|
|
|
169
171
|
severity: "error",
|
|
170
172
|
children: error.message
|
|
171
173
|
}) : /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
172
|
-
|
|
174
|
+
sx: {
|
|
175
|
+
gap: 2
|
|
176
|
+
},
|
|
173
177
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
174
|
-
color: "text.secondary",
|
|
175
178
|
variant: "body2",
|
|
179
|
+
sx: {
|
|
180
|
+
color: "text.secondary"
|
|
181
|
+
},
|
|
176
182
|
children: t("payment.customer.recover.description", {
|
|
177
183
|
date: (0, _util.formatToDate)(Number(data?.subscription?.current_period_end || "0") * 1e3)
|
|
178
184
|
})
|
|
@@ -181,9 +187,11 @@ function RecoverSubscription({
|
|
|
181
187
|
children: t("payment.customer.recover.stakeRequiredDescription")
|
|
182
188
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
183
189
|
direction: "row",
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
sx: {
|
|
191
|
+
justifyContent: "flex-end",
|
|
192
|
+
gap: 2,
|
|
193
|
+
mt: 2
|
|
194
|
+
},
|
|
187
195
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
188
196
|
variant: "outlined",
|
|
189
197
|
color: "primary",
|
|
@@ -200,12 +208,4 @@ function RecoverSubscription({
|
|
|
200
208
|
})
|
|
201
209
|
});
|
|
202
210
|
}
|
|
203
|
-
RecoverSubscription.defaultProps = {
|
|
204
|
-
onResumed: () => {},
|
|
205
|
-
dialogProps: {
|
|
206
|
-
open: true
|
|
207
|
-
},
|
|
208
|
-
successToast: true,
|
|
209
|
-
authToken: void 0
|
|
210
|
-
};
|
|
211
211
|
module.exports = RecoverSubscription;
|
package/lib/components/table.js
CHANGED
|
@@ -11,7 +11,7 @@ var _Datatable = _interopRequireDefault(require("@arcblock/ux/lib/Datatable"));
|
|
|
11
11
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
12
12
|
var _system = require("@mui/system");
|
|
13
13
|
var _mobile = require("../hooks/mobile");
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
function EmptyStub() {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -3,12 +3,5 @@ interface TruncatedTextProps {
|
|
|
3
3
|
maxLength?: number;
|
|
4
4
|
useWidth?: boolean;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
useWidth: boolean;
|
|
10
|
-
text: string;
|
|
11
|
-
maxLength: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default TruncatedText;
|
|
6
|
+
export default function TruncatedText({ text, maxLength, useWidth }: TruncatedTextProps): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
package/lib/contexts/donate.d.ts
CHANGED
|
@@ -28,13 +28,6 @@ export type DonateContextProps = {
|
|
|
28
28
|
declare const DonateContext: import("react").Context<DonateContextType>;
|
|
29
29
|
declare const Consumer: import("react").Consumer<DonateContextType>;
|
|
30
30
|
declare function DonateProvider({ mountLocation, description, defaultSettings, children, active, enableDonate, }: DonateContextProps): import("react").JSX.Element | null;
|
|
31
|
-
declare namespace DonateProvider {
|
|
32
|
-
var defaultProps: {
|
|
33
|
-
defaultSettings: {};
|
|
34
|
-
active: boolean;
|
|
35
|
-
enableDonate: boolean;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
31
|
declare function useDonateContext(): DonateContextType;
|
|
39
32
|
export declare const clearDonateCache: (mountLocation: string) => void;
|
|
40
33
|
export declare const clearDonateSettings: (mountLocation: string) => Promise<void>;
|
package/lib/contexts/donate.js
CHANGED
|
@@ -18,7 +18,7 @@ var _util = require("../libs/util");
|
|
|
18
18
|
var _cachedRequest = require("../libs/cached-request");
|
|
19
19
|
var _confirm = _interopRequireDefault(require("../components/confirm"));
|
|
20
20
|
var _payment = require("./payment");
|
|
21
|
-
function _interopRequireDefault(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
const DonateContext = exports.DonateContext = (0, _react.createContext)({
|
|
23
23
|
api: _api.default
|
|
24
24
|
});
|
|
@@ -125,7 +125,9 @@ function DonateProvider({
|
|
|
125
125
|
alignItems: "center"
|
|
126
126
|
},
|
|
127
127
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
128
|
-
|
|
128
|
+
sx: {
|
|
129
|
+
color: "text.secondary"
|
|
130
|
+
},
|
|
129
131
|
children: t("payment.checkout.donation.inactive")
|
|
130
132
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
131
133
|
size: "small",
|
|
@@ -160,11 +162,6 @@ function useDonateContext() {
|
|
|
160
162
|
const context = (0, _react.useContext)(DonateContext);
|
|
161
163
|
return context;
|
|
162
164
|
}
|
|
163
|
-
DonateProvider.defaultProps = {
|
|
164
|
-
defaultSettings: {},
|
|
165
|
-
active: true,
|
|
166
|
-
enableDonate: false
|
|
167
|
-
};
|
|
168
165
|
const clearDonateCache = mountLocation => {
|
|
169
166
|
const livemode = localStorage.getItem("livemode") !== "false";
|
|
170
167
|
const cacheKey = `donate-settings-${mountLocation}-${livemode}`;
|
|
@@ -29,9 +29,6 @@ export type PaymentContextProps = {
|
|
|
29
29
|
};
|
|
30
30
|
declare const PaymentContext: import("react").Context<PaymentContextType>;
|
|
31
31
|
declare const Consumer: import("react").Consumer<PaymentContextType>;
|
|
32
|
-
declare function PaymentProvider({ session, connect, children, baseUrl, authToken }: PaymentContextProps): import("react").JSX.Element | null;
|
|
33
|
-
declare namespace PaymentProvider {
|
|
34
|
-
var defaultProps: {};
|
|
35
|
-
}
|
|
32
|
+
declare function PaymentProvider({ session, connect, children, baseUrl, authToken, }: PaymentContextProps): import("react").JSX.Element | null;
|
|
36
33
|
declare function usePaymentContext(): PaymentContextType;
|
|
37
34
|
export { PaymentContext, PaymentProvider, Consumer as SettingsConsumer, usePaymentContext };
|
package/lib/contexts/payment.js
CHANGED
|
@@ -16,7 +16,7 @@ var _ufo = require("ufo");
|
|
|
16
16
|
var _api = _interopRequireDefault(require("../libs/api"));
|
|
17
17
|
var _util = require("../libs/util");
|
|
18
18
|
var _cachedRequest = require("../libs/cached-request");
|
|
19
|
-
function _interopRequireDefault(
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
const formatData = data => {
|
|
21
21
|
if (!data) {
|
|
22
22
|
return {
|
|
@@ -61,7 +61,6 @@ const syncToSpaceRequest = (userDid, spaceDid) => {
|
|
|
61
61
|
ttl: 1e3 * 60 * 60
|
|
62
62
|
// 1 hour
|
|
63
63
|
});
|
|
64
|
-
|
|
65
64
|
return cachedRequest.fetch(false).then(res => {
|
|
66
65
|
if (!res.success) {
|
|
67
66
|
cachedRequest.clearCache();
|
|
@@ -73,8 +72,8 @@ function PaymentProvider({
|
|
|
73
72
|
session,
|
|
74
73
|
connect,
|
|
75
74
|
children,
|
|
76
|
-
baseUrl,
|
|
77
|
-
authToken
|
|
75
|
+
baseUrl = void 0,
|
|
76
|
+
authToken = void 0
|
|
78
77
|
}) {
|
|
79
78
|
const [crossOriginLoading, setCrossOriginLoading] = (0, _react.useState)(false);
|
|
80
79
|
if (authToken) {
|
|
@@ -106,7 +105,6 @@ function PaymentProvider({
|
|
|
106
105
|
ttl: 10 * 60 * 1e3
|
|
107
106
|
// 10 minutes TTL
|
|
108
107
|
});
|
|
109
|
-
|
|
110
108
|
const blockletInfo = await cachedRequest.fetch();
|
|
111
109
|
const componentId = (blockletInfo?.componentId || "").split("/").pop();
|
|
112
110
|
if (componentId === _util.PAYMENT_KIT_DID) {
|
|
@@ -177,5 +175,4 @@ function PaymentProvider({
|
|
|
177
175
|
function usePaymentContext() {
|
|
178
176
|
const context = (0, _react.useContext)(PaymentContext);
|
|
179
177
|
return context;
|
|
180
|
-
}
|
|
181
|
-
PaymentProvider.defaultProps = {};
|
|
178
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
customer_id?: string;
|
|
3
|
+
subscription_id?: string;
|
|
4
|
+
status?: string;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
onTableDataChange?: Function;
|
|
7
|
+
mode?: 'dashboard' | 'portal';
|
|
8
|
+
};
|
|
9
|
+
export declare function StatusChip({ status, label }: {
|
|
10
|
+
status: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
export default function CreditGrantsList(rawProps: Props): JSX.Element;
|
|
14
|
+
export {};
|